aboutsummaryrefslogtreecommitdiff
path: root/Sil/Compile.icl
diff options
context:
space:
mode:
authorCamil Staps2017-07-19 12:30:10 +0000
committerCamil Staps2017-07-19 12:30:10 +0000
commit7364919175a6bc988d17523005917933f0680492 (patch)
treecc66d7ec332bf729ed2c484ee642d557fa38ae43 /Sil/Compile.icl
parentAdd else if (diff)
Nomenclature: Application type is now Expression
Diffstat (limited to 'Sil/Compile.icl')
-rw-r--r--Sil/Compile.icl14
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 ->