aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-02-06 21:12:06 -0400
committerEduardo Julian2018-02-06 21:12:06 -0400
commitfb1a1d4b86f95cc16bdf0e7872dd20901023f6c6 (patch)
tree5e56decbb8ade68fa1dbb81c575c48597815f34d /new-luxc/source/luxc/lang/translation.lux
parentf41bd812104958a9e374bacf10a84857dee798da (diff)
- Fixed some failing new-luxc tests.
- Re-designed the way casting is done for JVM interop. - Now always adding extensions when initializing compiler.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation.lux64
1 files changed, 24 insertions, 40 deletions
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux
index 30c4ec33c..8c42c2a71 100644
--- a/new-luxc/source/luxc/lang/translation.lux
+++ b/new-luxc/source/luxc/lang/translation.lux
@@ -27,22 +27,18 @@
[".L" macro]
[".L" extension]
[".L" init]
- (extension [".E" analysis]
- [".E" synthesis]
- [".E" translation]
- [".E" statement])
(host ["$" jvm])
(analysis [".A" expression]
[".A" common])
(synthesis [".S" expression])
["&." eval]))
- (/ [js]
- (js [".T" runtime]
- [".T" statement]
- ## [".T" common #+ Artifacts]
- [".T" expression]
- [".T" eval]
- [".T" imports])))
+ (/ ## [js]
+ (jvm [".T" runtime]
+ [".T" statement]
+ [".T" common #+ Artifacts]
+ [".T" expression]
+ [".T" eval]
+ [".T" imports])))
(def: analyse
(&.Analyser)
@@ -53,8 +49,8 @@
(exception: #export Invalid-Macro)
(def: (process-annotations annsC)
- (-> Code (Meta [js.Expression
- ## $.Inst
+ (-> Code (Meta [## js.Expression
+ $.Inst
Code]))
(do macro.Monad<Meta>
[[_ annsA] (&.with-scope
@@ -242,39 +238,27 @@
(def: (initialize sources target)
(-> (List File) File (Process Compiler))
(do io.Monad<Process>
- [compiler (case (runtimeT.translate (initL.compiler (io.run js.init))
- ## (initL.compiler (io.run hostL.init-host))
+ [compiler (case (runtimeT.translate ## (initL.compiler (io.run js.init))
+ (initL.compiler (io.run hostL.init-host))
)
- (#e.Success [compiler disk-write])
- (do @
- [_ (&io.prepare-target target)
- _ disk-write
- ## _ (cache/io.pre-load sources target (commonT.load-definition compiler))
- ]
- (wrap (|> compiler
- (set@ [#.info #.mode] #.Build)
- (set@ #.extensions
- (:! Void
- {#extensionL.analysis analysisE.defaults
- #extensionL.synthesis synthesisE.defaults
- #extensionL.translation translationE.defaults
- #extensionL.statement statementE.defaults})))))
-
- ## (#e.Success [compiler [runtime-bc function-bc]])
+ ## (#e.Success [compiler disk-write])
## (do @
## [_ (&io.prepare-target target)
- ## ## _ (&io.write target (format hostL.runtime-class ".class") runtime-bc)
- ## ## _ (&io.write target (format hostL.function-class ".class") function-bc)
+ ## _ disk-write
## ## _ (cache/io.pre-load sources target (commonT.load-definition compiler))
## ]
## (wrap (|> compiler
- ## (set@ [#.info #.mode] #.Build)
- ## (set@ #.extensions
- ## (:! Void
- ## {#extensionL.analysis analysisE.defaults
- ## #extensionL.synthesis synthesisE.defaults
- ## #extensionL.translation translationE.defaults
- ## #extensionL.statement statementE.defaults})))))
+ ## (set@ [#.info #.mode] #.Build))))
+
+ (#e.Success [compiler [runtime-bc function-bc]])
+ (do @
+ [_ (&io.prepare-target target)
+ ## _ (&io.write target (format hostL.runtime-class ".class") runtime-bc)
+ ## _ (&io.write target (format hostL.function-class ".class") function-bc)
+ ## _ (cache/io.pre-load sources target (commonT.load-definition compiler))
+ ]
+ (wrap (|> compiler
+ (set@ [#.info #.mode] #.Build))))
(#e.Error error)
(io.fail error))]