diff options
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index f94967f..b5d7222 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -80,7 +80,7 @@ static CVal compile_fn(CEnv& cenv, const ATuple* fn) throw() { assert(!cenv.currentFn); - + const AType* type = cenv.type(fn); CFunc f = cenv.findImpl(fn, type); if (f) @@ -98,9 +98,9 @@ compile_fn(CEnv& cenv, const ATuple* fn) throw() // Write function conclusion and pop stack frame cenv.engine()->finishFn(cenv, f, retVal); - cenv.pop(); + cenv.pop(); cenv.currentFn = NULL; - + cenv.vals.def(cenv.penv.sym(cenv.name(fn)), f); cenv.addImpl(fn, f); return f; @@ -130,19 +130,19 @@ compile_let(CEnv& cenv, const ATuple* let) throw() const ATuple* vars = let->list_ref(1)->to_tuple(); cenv.push(); - + for (ATuple::const_iterator i = vars->begin(); i != vars->end();) { const ASymbol* sym = (*i++)->to_symbol(); const AST* val = (*i++); cenv.def(sym, val, cenv.type(val), resp_compile(cenv, val)); } - + CVal ret = NULL; for (ATuple::const_iterator i = let->iter_at(2); i != let->end(); ++i) ret = resp_compile(cenv, *i); cenv.pop(); - + return ret; } @@ -152,7 +152,7 @@ compile_match(CEnv& cenv, const ATuple* match) throw() IfState state = cenv.engine()->compileIfStart(cenv); CVal matchee = resp_compile(cenv, match->list_ref(1)); CVal rtti = cenv.engine()->compileDot(cenv, matchee, 0); - + size_t idx = 1; for (ATuple::const_iterator i = match->iter_at(2); i != match->end(); ++idx) { const AST* pat = *i++; @@ -160,7 +160,7 @@ compile_match(CEnv& cenv, const ATuple* match) throw() const ASymbol* sym = pat->as_tuple()->head()->as_symbol(); CVal condV = cenv.engine()->compileIsA(cenv, rtti, sym); - + cenv.engine()->compileIfBranch(cenv, state, condV, body); } |