Skip to content

Commit

Permalink
Fix minor codegen issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinheghan committed Jul 1, 2024
1 parent 4c6f7ab commit 5b523cb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions compiler/src/Generate/JavaScript/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ generateField mode name =
-- DEBUG

generateDebug :: ModuleName.Canonical -> Name.Name -> ModuleName.Canonical -> A.Region -> Maybe Name.Name -> JS.Expr
generateDebug parentMod name module_@(ModuleName.Canonical _ home) region@(A.Region startPos _) unhandledValueName =
let trackedRef = JS.TrackedRef parentMod startPos (JsName.fromGlobalHumanReadable module_ name) (JsName.fromGlobal module_ name)
generateDebug parentMod name (ModuleName.Canonical _ home) region@(A.Region startPos _) unhandledValueName =
let trackedRef = JS.TrackedRef parentMod startPos (JsName.fromGlobalHumanReadable ModuleName.debug name) (JsName.fromGlobal ModuleName.debug name)
in if name /= "todo"
then trackedRef
else case unhandledValueName of
Expand Down Expand Up @@ -426,8 +426,6 @@ generateBasicsCall mode argLookup parentModule pos home name args =
_ -> generateGlobalCall argLookup parentModule pos home name [arg]
[grenLeft, grenRight] ->
case name of
-- NOTE: removed "composeL" and "composeR" because of this issue:
-- https://github.com/elm/compiler/issues/1722
"append" -> append mode argLookup parentModule grenLeft grenRight
"apL" -> generateJsExpr mode argLookup parentModule $ apply grenLeft grenRight
"apR" -> generateJsExpr mode argLookup parentModule $ apply grenRight grenLeft
Expand Down Expand Up @@ -456,10 +454,6 @@ generateBasicsCall mode argLookup parentModule pos home name args =
generateMathCall :: FnArgLookup -> ModuleName.Canonical -> A.Position -> ModuleName.Canonical -> Name.Name -> [JS.Expr] -> JS.Expr
generateMathCall argLookup parentModule pos home name args =
case args of
[arg] ->
case name of
"truncate" -> JS.Infix JS.OpBitwiseOr arg (JS.Int 0)
_ -> generateGlobalCall argLookup parentModule pos home name [arg]
[left, right] ->
case name of
"remainderBy" -> JS.Infix JS.OpMod right left
Expand Down

0 comments on commit 5b523cb

Please sign in to comment.