diff options
author | Eduardo Julian | 2017-11-13 20:02:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-13 20:02:18 -0400 |
commit | 2a3946e713821880ecc47580e754315349f2fe73 (patch) | |
tree | 7c32a522dff9d09293a5265baa968bc04137c944 /new-luxc/source/luxc/lang/translation.lux | |
parent | ca297162d5416a8c7b8af5f27757900d82d3ad03 (diff) |
- Type-vars no longer get deleted.
- Fixed some bugs.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation.lux | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index 779cb92fd..c4ebf3642 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -39,24 +39,25 @@ (case code (^code ("lux def" (~ [_ (#;Symbol ["" def-name])]) (~ valueC) (~ metaC))) (hostL;with-context def-name - (do meta;Monad<Meta> - [[_ metaA] (&;with-scope - (&;with-expected-type Code - (analyse metaC))) - metaI (expressionT;translate (expressionS;synthesize metaA)) - metaV (evalT;eval metaI) - [_ valueT valueA] (&;with-scope - (if (meta;type? (:! Code metaV)) - (&;with-expected-type Type + (&;with-fresh-type-env + (do meta;Monad<Meta> + [[_ metaA] (&;with-scope + (&;with-expected-type Code + (analyse metaC))) + metaI (expressionT;translate (expressionS;synthesize metaA)) + metaV (evalT;eval metaI) + [_ valueT valueA] (&;with-scope + (if (meta;type? (:! Code metaV)) (do @ - [valueA (analyse valueC)] - (wrap [Type valueA]))) - (commonA;with-unknown-type - (analyse valueC)))) - valueI (expressionT;translate (expressionS;synthesize valueA)) - _ (&;with-scope - (statementT;translate-def def-name valueT valueI metaI (:! Code metaV)))] - (wrap []))) + [valueA (&;with-expected-type Type + (analyse valueC))] + (wrap [Type valueA])) + (commonA;with-unknown-type + (analyse valueC)))) + valueI (expressionT;translate (expressionS;synthesize valueA)) + _ (&;with-scope + (statementT;translate-def def-name valueT valueI metaI (:! Code metaV)))] + (wrap [])))) (^code ("lux program" (~ [_ (#;Symbol ["" program-args])]) (~ programC))) (do meta;Monad<Meta> |