diff options
author | Eduardo Julian | 2017-11-22 20:37:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-22 20:37:41 -0400 |
commit | 0e3830be97930a01c38d8bca09a1ac9d5bf55465 (patch) | |
tree | 3078996542de6d53baa43388d0bca96e2b517aa9 /new-luxc/source/luxc/lang/synthesis | |
parent | e37e3713e080606930a5f8442f03dabc4c26a7f9 (diff) |
- Fixed some bugs.
- Some refactoring.
- Added some alternative snippets of code that new-luxc can handle better.
Diffstat (limited to '')
-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 )))) |