aboutsummaryrefslogtreecommitdiffstats
path: root/src/lex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lex.cpp')
-rw-r--r--src/lex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lex.cpp b/src/lex.cpp
index dc7bd4a..bfdd9c1 100644
--- a/src/lex.cpp
+++ b/src/lex.cpp
@@ -39,8 +39,8 @@ readChar(Cursor& cur, istream& in)
SExp
readExpression(Cursor& cur, istream& in)
{
-#define PUSH(s, t) { if (t != "") { s.top().push_back(SExp(loc, t)); t = ""; } }
-#define YIELD(s, t) { if (s.empty()) { return SExp(loc, t); } else PUSH(s, t) }
+#define PUSH(s, t) { if (t != "") { s.top().push_back(SExp(loc, new AString(loc, t))); t = ""; } }
+#define YIELD(s, t) { if (s.empty()) { return SExp(loc, new AString(loc, t)); } else PUSH(s, t) }
stack<SExp> stk;
string tok;
Cursor loc; // start of tok
@@ -87,7 +87,7 @@ readExpression(Cursor& cur, istream& in)
}
}
switch (stk.size()) {
- case 0: return SExp(loc, tok);
+ case 0: return SExp(loc, new AString(loc, tok));
case 1: return stk.top();
default: throw Error(cur, "missing `)'");
}