diff options
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index 123b403..4c7980e 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -109,22 +109,11 @@ compile_fn(CEnv& cenv, const ATuple* fn) throw() static CVal compile_if(CEnv& cenv, const ATuple* aif) throw() { - IfState state = cenv.engine()->compileIfStart(cenv); - for (ATuple::const_iterator i = aif->iter_at(1); ; ++i) { - ATuple::const_iterator next = i; - if (++next == aif->end()) - break; - - cenv.engine()->compileIfBranch(cenv, state, resp_compile(cenv, *i), *next); - - i = next; // jump 2 each iteration (to the next predicate) - } - - CVal elseV = NULL; + const AST* aelse = NULL; if (*aif->list_last() != *cenv.penv.sym("__unreachable")) - elseV = resp_compile(cenv, aif->list_last()); + aelse = aif->list_ref(3); - return cenv.engine()->compileIfEnd(cenv, state, elseV, cenv.type(aif)); + return cenv.engine()->compileIf(cenv, aif->list_ref(1), aif->list_ref(2), aelse); } static CVal |