aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ll.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/ll.cpp b/ll.cpp
index 8bd14ac..6c876e7 100644
--- a/ll.cpp
+++ b/ll.cpp
@@ -704,10 +704,8 @@ Value*
ASTSymbol::compile(CEnv& cenv)
{
AST** c = cenv.code.ref(this);
- if (c)
- return cenv.vals.def(this, cenv.compile(*c));
-
- throw SyntaxError((string("Undefined symbol '") + cppstr + "'").c_str());
+ if (!c) throw SyntaxError((string("Undefined symbol: ") + cppstr).c_str());
+ return cenv.vals.def(this, cenv.compile(*c));
}
void
@@ -787,14 +785,7 @@ ASTCall::lift(CEnv& cenv)
Value*
ASTCall::compile(CEnv& cenv)
{
- ASTClosure* c = dynamic_cast<ASTClosure*>(tup[0]);
- if (!c) {
- AST** val = cenv.code.ref(tup[0]);
- c = (val) ? dynamic_cast<ASTClosure*>(*val) : c;
- }
-
- assert(c);
- Function* f = dynamic_cast<Function*>(cenv.compile(c));
+ Function* f = dynamic_cast<Function*>(cenv.compile(tup[0]));
if (!f) throw CompileError("Callee failed to compile");
vector<Value*> params(tup.size() - 1);