diff options
Diffstat (limited to 'll.cpp')
-rw-r--r-- | ll.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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); |