diff options
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) { |
