diff options
| author | mryouse | 2023-05-26 01:36:49 +0000 |
|---|---|---|
| committer | mryouse | 2023-05-26 01:36:49 +0000 |
| commit | 6b7b9d96fb26ba9d4616d2b839098b7c75f39c3f (patch) | |
| tree | f8fbfc86d0ff65cc55d30e30361664c8a10998dd /parser.d | |
| parent | 9b97f36c3d57459c4de1e7da52e882c9d88142ae (diff) | |
strings as seqs
Diffstat (limited to 'parser.d')
| -rw-r--r-- | parser.d | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -8,6 +8,7 @@ import dbg; enum FormType { ATOM, + LITERALSTRING, CONS, NIL, SYMBOL, @@ -240,6 +241,18 @@ class Def : Form { } } +class LiteralString : Form { + Value value; + + this(string value, int line) { + this.value = makeStringValue(value); + this.line = line; + this.type = FormType.LITERALSTRING; + this.evaluate = false; + this.returnType = this.value.type; + } +} + class Atom : Form { Value value; @@ -419,7 +432,7 @@ class Parser { return new ParseError("unterminated string!", line); } advance(); // go past last quote - return new Atom(to!string(acc), line); + return new LiteralString(to!string(acc), line); } bool isBoundary(char ch) { |
