diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-20 03:51:48 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-20 04:19:03 +0200 |
commit | d5c0f0232d7351ed83b571aae649ee7971be2682 (patch) | |
tree | 35621cdc89af1acc6d86761e5f9986286f61b5e2 /module/c/operators.scm | |
parent | Add preliminary tests for cpp. (diff) | |
download | calp-d5c0f0232d7351ed83b571aae649ee7971be2682.tar.gz calp-d5c0f0232d7351ed83b571aae649ee7971be2682.tar.xz |
Split parse-cpp into multiple modules.
Diffstat (limited to '')
-rw-r--r-- | module/c/operators.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/module/c/operators.scm b/module/c/operators.scm new file mode 100644 index 00000000..f6fa3da9 --- /dev/null +++ b/module/c/operators.scm @@ -0,0 +1,20 @@ +(define-module (c operators)) + + +;;; Simple operators are those which can be combined with '=' +(define simple-operators + `(+ - * / & ,(symbol #\|) ^ << >> % < > =)) + +;; apparently part of C +(define-public wordy-binary-operators + '(bitand and_eq and bitor or_eq or xor_eq xor)) + +(define-public symbol-binary-operators + (append (map (lambda (x) (symbol-append x '=)) simple-operators) + `(&& ,(symbol #\| #\|) != ,(symbol #\,) + -> ,(symbol #\.)) + simple-operators)) + +(define-public binary-operators + (append symbol-binary-operators + wordy-binary-operators)) |