aboutsummaryrefslogtreecommitdiff
path: root/module/c/cpp.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/c/cpp.scm')
-rw-r--r--module/c/cpp.scm22
1 files changed, 19 insertions, 3 deletions
diff --git a/module/c/cpp.scm b/module/c/cpp.scm
index 86130167..861b8ee2 100644
--- a/module/c/cpp.scm
+++ b/module/c/cpp.scm
@@ -5,6 +5,7 @@
:use-module (ice-9 match)
:use-module (ice-9 regex)
:use-module ((rnrs io ports) :select (call-with-port))
+ :use-module ((rnrs bytevectors) :select (bytevector?))
:use-module (ice-9 format)
:use-module ((hnh util io) :select (read-lines))
:use-module (hnh util graph)
@@ -44,12 +45,27 @@
;; Direct values. Lisp also has quoted symbols in this group.
(define (immediate? x)
(or (number? x)
- (char? x)
- (string? x)))
+ (bytevector? x)))
+;; TODO replace this with something sensible
+;; like a correct list extracted from (c eval)
+;; and not thinging that types are variables
;; built in symbols. Should never be marked as dependencies
(define (primitive? x)
- (memv x (cons 'funcall binary-operators)))
+ (memv x `(
+ ;; language primitives
+ sizeof
+
+ ;; special forms introduced by parser
+ funcall ternary struct-type as-type
+
+ ;; unary operatons which aren't also binary operators
+ ++ -- ! ~
+ not compl dereference pointer
+ pre-increment pre-decrement
+ post-increment post-decrement
+ ,@binary-operators
+ )))