From d5c0f0232d7351ed83b571aae649ee7971be2682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Jul 2020 03:51:48 +0200 Subject: Split parse-cpp into multiple modules. --- module/c/operators.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 module/c/operators.scm (limited to 'module/c/operators.scm') 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)) -- cgit v1.2.3