summaryrefslogtreecommitdiff
path: root/src/modules/ast/syntax-tree.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/ast/syntax-tree.scm')
-rw-r--r--src/modules/ast/syntax-tree.scm26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/modules/ast/syntax-tree.scm b/src/modules/ast/syntax-tree.scm
index 738b115..b7db8dd 100644
--- a/src/modules/ast/syntax-tree.scm
+++ b/src/modules/ast/syntax-tree.scm
@@ -15,7 +15,16 @@
make-expr
expr?
- expr-int
+ expr-type
+
+ make-unary
+ unary?
+ unary-operator
+ unary-expr
+
+ make-const
+ const?
+ const-int
make-id
id?
@@ -38,9 +47,20 @@
(expr stmt-expr))
(define-record-type <expr>
- (make-expr int)
+ (make-expr type)
expr?
- (int expr-int))
+ (type expr-type))
+
+(define-record-type <unary>
+ (make-unary op expr)
+ unary?
+ (op unary-operator)
+ (expr unary-expr))
+
+(define-record-type <const>
+ (make-const int)
+ const?
+ (int const-int))
(define-record-type <id>
(make-id symbol)