diff options
Diffstat (limited to 'Sil/Compile.icl')
-rw-r--r-- | Sil/Compile.icl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Sil/Compile.icl b/Sil/Compile.icl index abed973..b4854ba 100644 --- a/Sil/Compile.icl +++ b/Sil/Compile.icl @@ -186,16 +186,16 @@ where Just i -> comment (toString st) *> gen app *> tell ['ABC'.Update_a 0 $ i+1, 'ABC'.Pop_a 1] _ -> liftT $ Error $ UndefinedName n - gen (Application app) = comment "Application" *> gen app *> tell ['ABC'.Pop_a 1] - gen (Return (Just app)) = comment "Return" *> gen app *> cleanup *> tell ['ABC'.Rtn] - gen (Return Nothing) = comment "Return" *> cleanup *> tell ['ABC'.Rtn] - gen (MachineStm s) = tell ['ABC'.Raw s] - gen (If blocks else) = + gen (Application e) = comment "Application" *> gen e *> tell ['ABC'.Pop_a 1] + gen (Return (Just e)) = comment "Return" *> gen e *> cleanup *> tell ['ABC'.Rtn] + gen (Return Nothing) = comment "Return" *> cleanup *> tell ['ABC'.Rtn] + gen (MachineStm s) = tell ['ABC'.Raw s] + gen (If blocks else) = fresh "ifend" >>= \end -> mapM_ (genifblock end) blocks *> genelse end else where - genifblock :: 'ABC'.Label (Application, CodeBlock) -> Gen () + genifblock :: 'ABC'.Label (Expression, CodeBlock) -> Gen () genifblock end (cond, cb) = fresh "ifelse" >>= \else -> gen cond *> @@ -209,7 +209,7 @@ where genelse end Nothing = tell ['ABC'.Label end] genelse end (Just cb) = gen cb *> tell ['ABC'.Label end] -instance gen Application +instance gen Expression where gen (Name n) = gets stackoffset >>= \so -> |