aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/compiler')
-rw-r--r--new-luxc/source/luxc/compiler/base.jvm.lux3
-rw-r--r--new-luxc/source/luxc/compiler/common.jvm.lux22
-rw-r--r--new-luxc/source/luxc/compiler/expr.jvm.lux3
-rw-r--r--new-luxc/source/luxc/compiler/runtime.jvm.lux6
-rw-r--r--new-luxc/source/luxc/compiler/statement.jvm.lux3
5 files changed, 18 insertions, 19 deletions
diff --git a/new-luxc/source/luxc/compiler/base.jvm.lux b/new-luxc/source/luxc/compiler/base.jvm.lux
index f5784319a..01a97aec4 100644
--- a/new-luxc/source/luxc/compiler/base.jvm.lux
+++ b/new-luxc/source/luxc/compiler/base.jvm.lux
@@ -3,8 +3,7 @@
(lux (control monad)
[io #- run]
(concurrency ["A" atom])
- (data ["E" error]
- [text]
+ (data [text]
text/format)
host)
(luxc ["&" base]))
diff --git a/new-luxc/source/luxc/compiler/common.jvm.lux b/new-luxc/source/luxc/compiler/common.jvm.lux
index d7abc1ff1..bd5487ef6 100644
--- a/new-luxc/source/luxc/compiler/common.jvm.lux
+++ b/new-luxc/source/luxc/compiler/common.jvm.lux
@@ -1,7 +1,7 @@
(;module:
lux
(lux (concurrency ["A" atom])
- (data ["E" error]
+ (data ["R" result]
(coll ["D" dict]))
[macro]
[host #+ jvm-import]))
@@ -33,13 +33,13 @@
(:! Host)
(get@ #visitor)))
-(def: (visitor::put visitor compiler)
- (-> MethodVisitor Compiler Compiler)
+(def: (visitor::put ?visitor compiler)
+ (-> (Maybe MethodVisitor) Compiler Compiler)
(update@ #;host
(function [host]
(|> host
(:! Host)
- (set@ #visitor (#;Some visitor))
+ (set@ #visitor ?visitor)
(:! Void)))
compiler))
@@ -48,18 +48,18 @@
(function [compiler]
(case (visitor::get compiler)
#;None
- (#E;Error "No visitor has been set.")
+ (#R;Error "No visitor has been set.")
(#;Some visitor)
- (#E;Success [compiler visitor]))))
+ (#R;Success [compiler visitor]))))
(def: #export (with-visitor visitor body)
(All [a] (-> MethodVisitor (Lux a) (Lux a)))
(function [compiler]
- (case (macro;run' (visitor::put visitor compiler) body)
- (#E;Error error)
- (#E;Error error)
+ (case (macro;run' (visitor::put (#;Some visitor) compiler) body)
+ (#R;Error error)
+ (#R;Error error)
- (#E;Success [compiler' output])
- (#E;Success [(visitor::put (visitor::get compiler) compiler')
+ (#R;Success [compiler' output])
+ (#R;Success [(visitor::put (visitor::get compiler) compiler')
output]))))
diff --git a/new-luxc/source/luxc/compiler/expr.jvm.lux b/new-luxc/source/luxc/compiler/expr.jvm.lux
index 173293b1c..b2e4923c4 100644
--- a/new-luxc/source/luxc/compiler/expr.jvm.lux
+++ b/new-luxc/source/luxc/compiler/expr.jvm.lux
@@ -5,7 +5,8 @@
[macro #+ Monad<Lux> "Lux/" Monad<Lux>]
[host #+ jvm-import])
(luxc ["&" base]
- (lang ["ls" synthesis])
+ (lang ["la" analysis]
+ ["ls" synthesis])
["&;" analyser]
["&;" synthesizer]
(compiler ["&;" common])))
diff --git a/new-luxc/source/luxc/compiler/runtime.jvm.lux b/new-luxc/source/luxc/compiler/runtime.jvm.lux
index 4a5e44785..16e072194 100644
--- a/new-luxc/source/luxc/compiler/runtime.jvm.lux
+++ b/new-luxc/source/luxc/compiler/runtime.jvm.lux
@@ -3,9 +3,9 @@
(lux (control monad)
(concurrency ["P" promise "P/" Monad<Promise>])
(data text/format
- ["E" error]))
+ ["R" result]))
(luxc ["&" base]))
(def: #export (compile-runtime compiler)
- (-> Compiler (P;Promise (E;Error Compiler)))
- (P/wrap (#E;Success compiler)))
+ (-> Compiler (P;Promise (R;Result Compiler)))
+ (P/wrap (#R;Success compiler)))
diff --git a/new-luxc/source/luxc/compiler/statement.jvm.lux b/new-luxc/source/luxc/compiler/statement.jvm.lux
index 7e48d061f..96263181f 100644
--- a/new-luxc/source/luxc/compiler/statement.jvm.lux
+++ b/new-luxc/source/luxc/compiler/statement.jvm.lux
@@ -2,8 +2,7 @@
lux
(lux (control monad)
[io #- run]
- (data ["E" error]
- [text "T/" Eq<Text>]
+ (data [text "T/" Eq<Text>]
text/format)
[macro #+ Monad<Lux>])
(luxc ["&" base]