diff --git a/src/Compiler/Compiler.hs b/src/Compiler/Compiler.hs index cb09c2d..2afc66f 100644 --- a/src/Compiler/Compiler.hs +++ b/src/Compiler/Compiler.hs @@ -211,6 +211,8 @@ compile (Program prgE) = do binExprToValues e1 e2 = case (e1, e2) of -- instead of declaring variables for working on ints, -- we can directly pass them to their functions. + -- This optimization removes the need to declare + -- roughly 50% of variables (EInt i1, EInt i2) -> return (VInteger i1, VInteger i2) (EInt i, e) -> do go e diff --git a/test/simple.sf b/test/simple.sf index 0a35e27..bbd9312 100644 --- a/test/simple.sf +++ b/test/simple.sf @@ -2,4 +2,4 @@ -main = ((2 * (123 + 4214 % (1230)) - 1231) / 314) +main = ((2 * (123 + 4214 % (1230)) - 1231) / 2) * 412412