aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux47
1 files changed, 24 insertions, 23 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
index b01a68c3d..a138bd79a 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
@@ -3,23 +3,24 @@
[control
[monad (#+ do)]
["ex" exception (#+ exception:)]]
- [io]
+ ["." io]
[concurrency
[atom (#+ Atom atom)]]
[data
- [error (#+ Error)]
- [text ("text/" Hash<Text>)
+ ["." error (#+ Error)]
+ ["." text ("text/." Hash<Text>)
format]
[collection
- [dictionary (#+ Dictionary)]]]
- [macro]
+ ["." dictionary (#+ Dictionary)]]]
+ ["." macro]
[host (#+ import:)]
[world
- [blob (#+ Blob)]]
- [language
- [name]
- [reference (#+ Register)]
- ["." compiler]]]
+ [binary (#+ Binary)]]
+ [compiler
+ [default
+ ["." name]
+ [reference (#+ Register)]
+ ["." phase]]]]
## [luxc
## [lang
## [host
@@ -29,30 +30,30 @@
## (def: #export (with-artifacts action)
## (All [a] (-> (Meta a) (Meta [Artifacts a])))
-## (function (_ compiler)
+## (function (_ state)
## (case (action (update@ #.host
## (|>> (:coerce Host)
## (set@ #artifacts (dictionary.new text.Hash<Text>))
## (:coerce Nothing))
-## compiler))
-## (#error.Success [compiler' output])
+## state))
+## (#error.Success [state' output])
## (#error.Success [(update@ #.host
## (|>> (:coerce Host)
-## (set@ #artifacts (|> (get@ #.host compiler) (:coerce Host) (get@ #artifacts)))
+## (set@ #artifacts (|> (get@ #.host state) (:coerce Host) (get@ #artifacts)))
## (:coerce Nothing))
-## compiler')
-## [(|> compiler' (get@ #.host) (:coerce Host) (get@ #artifacts))
+## state')
+## [(|> state' (get@ #.host) (:coerce Host) (get@ #artifacts))
## output]])
## (#error.Error error)
## (#error.Error error))))
-## (def: #export (load-definition compiler)
-## (-> Lux (-> Ident Blob (Error Any)))
-## (function (_ (^@ def-ident [def-module def-name]) def-bytecode)
+## (def: #export (load-definition state)
+## (-> Lux (-> Name Binary (Error Any)))
+## (function (_ (^@ def-name [def-module def-name]) def-bytecode)
## (let [normal-name (format (name.normalize def-name) (%n (text/hash def-name)))
## class-name (format (text.replace-all "/" "." def-module) "." normal-name)]
-## (<| (macro.run compiler)
+## (<| (macro.run state)
## (do macro.Monad<Meta>
## [_ (..store-class class-name def-bytecode)
## class (..load-class class-name)]
@@ -63,10 +64,10 @@
## (wrap def-value)
## (#error.Success #.None)
-## (compiler.throw invalid-definition-value (%ident def-ident))
+## (phase.throw invalid-definition-value (%name def-name))
## (#error.Error error)
-## (compiler.throw cannot-load-definition
-## (format "Definition: " (%ident def-ident) "\n"
+## (phase.throw cannot-load-definition
+## (format "Definition: " (%name def-name) "\n"
## "Error:\n"
## error))))))))