diff options
Diffstat (limited to 'module/c/operators.scm')
-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)) |