Commit 731a9029 authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

evaluating the condition also places one element on the stack beforehand

parent f731f81e
......@@ -101,9 +101,9 @@ where
// The function part could by arbitrary SaplTerm in theory, but in practice at this point
// it can be only SVar
sTermS ctx (SApplication (SVar var) terms) a = a <++ appType ctx var <++ sNum (length terms) <++ sVar ctx var <++ sList0 (sTerm {ctx & inspine = False}) terms
sTermS ctx (SCase cond [(PLit (LBool True), texpr), (PLit (LBool False), fexpr)]) a = a <++ "I" <++ sTerm {ctx & inspine = False} cond <++ sTerm ctx texpr <++ sTerm ctx fexpr
sTermS ctx (SCase cond [(PLit (LBool False), fexpr), (PLit (LBool True), texpr)]) a = a <++ "I" <++ sTerm {ctx & inspine = False} cond <++ sTerm ctx texpr <++ sTerm ctx fexpr
sTermS ctx (SCase expr cs) a = a <++ "C" <++ sTerm {ctx & inspine = False} expr <++ sList (sSelectCase ctx) (sortBy selectCaseOrder cs)
sTermS ctx (SCase cond [(PLit (LBool True), texpr), (PLit (LBool False), fexpr)]) a = a <++ "I" <++ sTerm {ctx & inspine = False, localcount = ctx.localcount + 1} cond <++ sTerm ctx texpr <++ sTerm ctx fexpr
sTermS ctx (SCase cond [(PLit (LBool False), fexpr), (PLit (LBool True), texpr)]) a = a <++ "I" <++ sTerm {ctx & inspine = False, localcount = ctx.localcount + 1} cond <++ sTerm ctx texpr <++ sTerm ctx fexpr
sTermS ctx (SCase expr cs) a = a <++ "C" <++ sTerm {ctx & inspine = False, localcount = ctx.localcount + 1} expr <++ sList (sSelectCase ctx) (sortBy selectCaseOrder cs)
sTermS ctx (SLet body bindings) a
# bindings = fromJust (sortBindings bindings)
# ctx = {ctx & vars = registerVars ctx.vars ctx.localcount (map unpackBindVar bindings), localcount = ctx.localcount + length bindings}
......@@ -199,7 +199,7 @@ Start world
# (fs, ps) = doStrictnessPropagation ps isStrictArg fs
// lifting
# fs = map prepareFun fs
# (_, world) = writeFile (args!!2) (toString (genDefs fs newAppender)) world
= world
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment