diff options
author | Camil Staps | 2017-07-19 13:02:16 +0000 |
---|---|---|
committer | Camil Staps | 2017-07-19 13:02:16 +0000 |
commit | 375f655fc7dbf04378dde69af11accb00cde7205 (patch) | |
tree | 7438782bb5cfd8050dd27c69c595d613be07dac2 | |
parent | Update grammar: no semicolon after while / if (diff) |
Discard unused application results
-rw-r--r-- | Sil/Compile.icl | 2 | ||||
-rw-r--r-- | examples/while.sil | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Sil/Compile.icl b/Sil/Compile.icl index ca375b1..7857ff2 100644 --- a/Sil/Compile.icl +++ b/Sil/Compile.icl @@ -186,7 +186,7 @@ where Just i -> comment (toString st) *> gen app *> tell ['ABC'.Update_a 0 $ i+1, 'ABC'.Pop_a 1] *> shrinkStack 1 _ -> liftT $ Error $ UndefinedName n - gen (Application e) = comment "Application" *> gen e *> tell ['ABC'.Pop_a 1] + gen (Application e) = comment "Application" *> gen e *> tell ['ABC'.Pop_a 1] *> shrinkStack 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] diff --git a/examples/while.sil b/examples/while.sil index 2b531d6..b6ae2cc 100644 --- a/examples/while.sil +++ b/examples/while.sil @@ -8,7 +8,7 @@ Int print(Int n) { Int loop(Int start, Int end) { while (!(start == end)) { - start := print(start); + print(start); start := start + 1; } return start; |