aboutsummaryrefslogtreecommitdiff
path: root/parser.d
diff options
context:
space:
mode:
authormryouse2023-05-25 21:15:04 +0000
committermryouse2023-05-25 21:15:04 +0000
commit9fe6496202bd95d252ed2323a88fd24781780b64 (patch)
tree907f85973ab3e5b22b076a27a3933b88855e07ba /parser.d
parentd95e4f6f988b16bbd95a9c78c0355d190390f003 (diff)
lists as sequences, first and rest
Diffstat (limited to 'parser.d')
-rw-r--r--parser.d10
1 files changed, 9 insertions, 1 deletions
diff --git a/parser.d b/parser.d
index 97557ca..68f5093 100644
--- a/parser.d
+++ b/parser.d
@@ -270,6 +270,7 @@ enum ValueType {
NUMBER,
BOOLEAN,
TYPE,
+ SEQ,
OBJ,
ANY,
NIL,
@@ -281,6 +282,7 @@ union As {
string str;
string type;
Obj obj;
+ Seq seq;
}
@@ -313,6 +315,12 @@ Value makeObjValue(Obj obj) {
return val;
}
+Value makeSeqValue(Seq seq) {
+ As as = { seq: seq };
+ Value val = { ValueType.SEQ, as };
+ return val;
+}
+
Value makeTypeValue(string name) {
As as = { type: name };
Value val = { ValueType.TYPE, as };
@@ -464,7 +472,7 @@ class Parser {
if (next == ')') {
break;
}
- func.addToBody(parseForm());
+ func.addToBody(this.parseForm());
}
if (!peekable()) {