From 9e12b8536648a30377040f407e06ea0713db91b4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 4 Jul 2009 03:44:06 +0000 Subject: Lex to AST with AString type. git-svn-id: http://svn.drobilla.net/resp/tuplr@181 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/lex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lex.cpp') 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 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 `)'"); } -- cgit v1.2.1