diff options
| author | mryouse | 2023-05-25 21:15:04 +0000 |
|---|---|---|
| committer | mryouse | 2023-05-25 21:15:04 +0000 |
| commit | 9fe6496202bd95d252ed2323a88fd24781780b64 (patch) | |
| tree | 907f85973ab3e5b22b076a27a3933b88855e07ba /parser.d | |
| parent | d95e4f6f988b16bbd95a9c78c0355d190390f003 (diff) | |
lists as sequences, first and rest
Diffstat (limited to 'parser.d')
| -rw-r--r-- | parser.d | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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()) { |
