aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation.lux36
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)