aboutsummaryrefslogtreecommitdiff
path: root/parser.d
diff options
context:
space:
mode:
Diffstat (limited to 'parser.d')
-rw-r--r--parser.d15
1 files changed, 14 insertions, 1 deletions
diff --git a/parser.d b/parser.d
index e51b5e1..6974662 100644
--- a/parser.d
+++ b/parser.d
@@ -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) {