From 7364919175a6bc988d17523005917933f0680492 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 19 Jul 2017 12:30:10 +0000 Subject: Nomenclature: Application type is now Expression --- Sil/Compile.icl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Sil/Compile.icl') 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 -> -- cgit v1.2.3