diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-21 18:05:59 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-21 18:05:59 +0200 |
commit | 3413f60db482ce7e6d6d786348723a2b406d1038 (patch) | |
tree | c3063d65d05e93ff6045f99fa15ff80acf7d3066 /module/c/old/operators.scm | |
parent | Major work on parser. (diff) | |
download | calp-3413f60db482ce7e6d6d786348723a2b406d1038.tar.gz calp-3413f60db482ce7e6d6d786348723a2b406d1038.tar.xz |
Remove old unused files.
Diffstat (limited to 'module/c/old/operators.scm')
-rw-r--r-- | module/c/old/operators.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/module/c/old/operators.scm b/module/c/old/operators.scm new file mode 100644 index 00000000..0b253ada --- /dev/null +++ b/module/c/old/operators.scm @@ -0,0 +1,24 @@ +(define-module (c old operators) + :export (wordy-binary-operators + symbol-binary-operators + binary-operators)) + + +;;; Simple operators are those which can be combined with '=' +(define simple-operators + `(+ - * / & ,(symbol #\|) ^ << >> % < > =)) + +;; apparently part of C +;; https://en.cppreference.com/w/cpp/language/operator_alternative +(define wordy-binary-operators + '(bitand and_eq and bitor or_eq or xor_eq xor not_eq)) + +(define symbol-binary-operators + (append (map (lambda (x) (symbol-append x '=)) simple-operators) + `(&& ,(symbol #\| #\|) != ,(symbol #\,) + -> ,(symbol #\.)) + simple-operators)) + +(define binary-operators + (append symbol-binary-operators + wordy-binary-operators)) |