diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/synthesis')
-rw-r--r-- | new-luxc/source/luxc/lang/synthesis/loop.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/lang/synthesis/loop.lux b/new-luxc/source/luxc/lang/synthesis/loop.lux index ac72e69b2..a5da743d5 100644 --- a/new-luxc/source/luxc/lang/synthesis/loop.lux +++ b/new-luxc/source/luxc/lang/synthesis/loop.lux @@ -152,7 +152,7 @@ _ _var)) environment))] - (~ (recur bodyS)))) + (~ bodyS))) (^ [_ (#;Form (list& [_ (#;Text "lux call")] funcS argsS))]) (` ("lux call" (~ (recur funcS)) (~@ (list/map recur argsS)))) @@ -160,15 +160,7 @@ (^ [_ (#;Form (list& [_ (#;Text "lux recur")] argsS))]) (` ("lux recur" (~@ (list/map recur argsS)))) - (^ [_ (#;Form (list& [_ (#;Text procedure)] argsS))]) - (` ((~ (code;text procedure)) (~@ (list/map recur argsS)))) - - (^ [_ (#;Form (list [_ (#;Int var)]))]) - (if (variableL;captured? var) - (` ((~ (code;int (resolve-captured var))))) - (` ((~ (code;int (|> offset nat-to-int (i.+ var))))))) - - (^ [_ (#;Form (list [_ (#;Text "lux let")] [_ (#;Nat register)] inputS bodyS))]) + (^code ("lux let" (~ [_ (#;Nat register)]) (~ inputS) (~ bodyS))) (` ("lux let" (~ (code;nat (n.+ offset register))) (~ (recur inputS)) (~ (recur bodyS)))) @@ -183,6 +175,14 @@ [(~@ (list/map recur initsS))] (~ (recur bodyS)))) + (^ [_ (#;Form (list [_ (#;Int var)]))]) + (if (variableL;captured? var) + (` ((~ (code;int (resolve-captured var))))) + (` ((~ (code;int (|> offset nat-to-int (i.+ var))))))) + + (^ [_ (#;Form (list& [_ (#;Text procedure)] argsS))]) + (` ((~ (code;text procedure)) (~@ (list/map recur argsS)))) + _ exprS )))) |