diff options
author | Eduardo Julian | 2018-01-08 22:09:12 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-01-08 22:09:12 -0400 |
commit | d48da794a693c00990c411b669d6412b8bf4d904 (patch) | |
tree | a1442427fdd9852ec0199a65b4b9999b35261137 /new-luxc/source/luxc/lang/translation.lux | |
parent | 9eaaaf953ba7ce1eeb805603f4e113aa15f5178f (diff) |
- Re-factored initialization functions to their own module.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation.lux | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index cbd63b998..da465a804 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -26,6 +26,7 @@ [".L" host] [".L" macro] [".L" extension] + [".L" init] (extension [".E" analysis] [".E" synthesis] [".E" translation] @@ -142,8 +143,7 @@ (def: (with-active-compilation [module-name file-name source-code] action) (All [a] (-> [Text Text Text] (Meta a) (Meta a))) (do macro.Monad<Meta> - [#let [init-cursor [file-name +1 +0]] - output (&.with-source-code [init-cursor +0 source-code] + [output (&.with-source-code (initL.source file-name source-code) action) _ (moduleL.flag-compiled! module-name)] (wrap output))) @@ -211,41 +211,11 @@ (#e.Error error) (io.fail error)))) -(def: init-cursor Cursor ["" +1 +0]) - -(def: #export init-type-context - Type-Context - {#.ex-counter +0 - #.var-counter +0 - #.var-bindings (list)}) - -(def: #export init-info - Info - {#.target (for {"JVM" "JVM" - "JS" "JS"}) - #.version &.version - #.mode #.Build}) - -(def: #export (init-compiler host) - (-> commonT.Host Compiler) - {#.info init-info - #.source [init-cursor +0 ""] - #.cursor .dummy-cursor - #.current-module #.None - #.modules (list) - #.scopes (list) - #.type-context init-type-context - #.expected #.None - #.seed +0 - #.scope-type-vars (list) - #.extensions (:! Void extensionL.fresh) - #.host (:! Void host)}) - (def: (initialize sources target) (-> (List File) File (Process Compiler)) (do io.Monad<Process> [compiler (: (Process Compiler) - (case (runtimeT.translate (init-compiler (io.run hostL.init-host))) + (case (runtimeT.translate (initL.compiler (io.run hostL.init-host))) (#e.Error error) (io.fail error) |