aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.cpp')
-rw-r--r--src/parse.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parse.cpp b/src/parse.cpp
index 1c448db..20d0816 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -36,7 +36,7 @@ macDef(PEnv& penv, const AST* exp)
THROW_IF(i == tup->end(), tup->loc, "Unexpected end of `def' macro call");
const AST* name = *(++i);
THROW_IF(i == tup->end(), name->loc, "Unexpected end of `def' macro call");
- if (name->to<const AString*>()) {
+ if (name->to<const ALexeme*>()) {
return const_cast<AST*>(exp);
} else {
const ATuple* pat = name->to<const ATuple*>();
@@ -48,7 +48,7 @@ macDef(PEnv& penv, const AST* exp)
argsExp->push_back(*j);
const AST* body = *(++i);
ATuple* fnExp = new ATuple(body->loc);
- fnExp->push_back(new AString(exp->loc, "fn"));
+ fnExp->push_back(new ALexeme(exp->loc, "fn"));
fnExp->push_back(argsExp);
for (; i != tup->end(); ++i)
fnExp->push_back(*i);
@@ -107,6 +107,7 @@ initLang(PEnv& penv, TEnv& tenv)
tenv.def(penv.sym("Int"), new AType(penv.sym("Int")));
tenv.def(penv.sym("Float"), new AType(penv.sym("Float")));
tenv.def(penv.sym("String"), new AType(penv.sym("String")));
+ tenv.def(penv.sym("Lexeme"), new AType(penv.sym("Lexeme")));
// Literals
static bool trueVal = true;