aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation
diff options
context:
space:
mode:
authorEduardo Julian2021-09-05 22:52:26 -0400
committerEduardo Julian2021-09-05 22:52:26 -0400
commit132ffdae1add622c8a3c6065d7730a8fe8ea5e78 (patch)
tree540310f190007d192b892db2d0a520d17b73ad48 /lux-jvm/source/luxc/lang/translation
parent09e2747bf8c6dcdc1d7318f2490f0de37d77b39f (diff)
Changed the syntax of do/be's (co)monad bindings.
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux10
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux6
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/loop.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/reference.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/structure.lux2
7 files changed, 15 insertions, 15 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 41511f300..33aa7f793 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -130,7 +130,7 @@
(^template [<tag> <unwrap> <dup> <pop> <test> <comparison> <if>]
[(<tag> cons)
- (do {@ phase.monad}
+ (do [@ phase.monad]
[forkG (: (Operation Inst)
(monad.mix @ (function (_ [test thenP] elseG)
(do @
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
index 2d33970db..706c69c00 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -95,7 +95,7 @@
(function (_ extension_name phase archive [input else conditionals])
(<| _.with_label (function (_ @end))
_.with_label (function (_ @else))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[inputG (phase archive input)
elseG (phase archive else)
conditionalsG+ (: (Operation (List [(List [Int Label])
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 16ef783f2..802d13d3f 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -733,7 +733,7 @@
(..custom
[($_ <>.and ..class <synthesis>.text ..return (<>.some ..input))
(function (_ extension_name generate archive [class method outputT inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> (_.fuse (list\each product.right inputsTI))
(_.INVOKESTATIC class method (type.method [(list) (list\each product.left inputsTI) outputT (list)]))
@@ -745,7 +745,7 @@
(..custom
[($_ <>.and ..class <synthesis>.text ..return <synthesis>.any (<>.some ..input))
(function (_ extension_name generate archive [class method outputT objectS inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[objectI (generate archive objectS)
inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> objectI
@@ -768,7 +768,7 @@
(..custom
[($_ <>.and ..class (<>.some ..input))
(function (_ extension_name generate archive [class inputsTS])
- (do {! phase.monad}
+ (do [! phase.monad]
[inputsTI (monad.each ! (generate_input generate archive) inputsTS)]
(in (|>> (_.NEW class)
_.DUP
@@ -989,7 +989,7 @@
(def: (anonymous_instance generate archive class env)
(-> Phase Archive (Type Class) (Environment Synthesis) (Operation Inst))
- (do {! phase.monad}
+ (do [! phase.monad]
[captureI+ (monad.each ! (generate archive) env)]
(in (|>> (_.NEW class)
_.DUP
@@ -1085,7 +1085,7 @@
super_interfaces
inputsTS
overriden_methods])
- (do {! phase.monad}
+ (do [! phase.monad]
[[context _] (generation.with_new_context archive (in []))
.let [[module_id artifact_id] context
anonymous_class_name (///.class_name context)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 69605bb8a..9cd5efdfb 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -108,7 +108,7 @@
(def: (instance generate archive class arity env)
(-> Phase Archive (Type Class) Arity (Environment Synthesis) (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[captureI+ (monad.each @ (generate archive) env)
.let [argsI (if (poly_arg? arity)
(|> (nullsI (-- arity))
@@ -305,7 +305,7 @@
(def: .public (function' forced_context generate archive [env arity bodyS])
(-> (Maybe Context) (Generator Abstraction))
- (do {! phase.monad}
+ (do [! phase.monad]
[@begin _.make_label
[function_context bodyI] (case forced_context
(#.Some function_context)
@@ -341,7 +341,7 @@
(def: .public (call generate archive [functionS argsS])
(Generator Apply)
- (do {@ phase.monad}
+ (do [@ phase.monad]
[functionI (generate archive functionS)
argsI (monad.each @ (generate archive) argsS)
.let [applyI (|> argsI
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
index 260d14ca8..1583cbed3 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
@@ -38,7 +38,7 @@
(def: .public (recur translate archive argsS)
(Generator (List Synthesis))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[[@begin start] generation.anchor
.let [pairs (|> argsS
list.enumeration
@@ -70,7 +70,7 @@
(def: .public (scope translate archive [start initsS+ iterationS])
(Generator [Nat (List Synthesis) Synthesis])
- (do {@ phase.monad}
+ (do [@ phase.monad]
[@begin _.make_label
initsI+ (monad.each @ (translate archive) initsS+)
iterationI (generation.with_anchor [@begin start]
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
index 1adc46589..204fddfa8 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
@@ -38,7 +38,7 @@
(def: (foreign archive variable)
(-> Archive Register (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[class_name (\ @ each //.class_name
(generation.context archive))]
(in (|>> (_.ALOAD 0)
@@ -61,7 +61,7 @@
(def: .public (constant archive name)
(-> Archive Name (Operation Inst))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[class_name (\ @ each //.class_name
(generation.remember archive name))]
(in (_.GETSTATIC (type.class class_name (list)) //.value_field //.$Value))))
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
index 109c44b22..8e4e309de 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
@@ -44,7 +44,7 @@
(def: .public (tuple generate archive members)
(Generator (List Synthesis))
- (do {@ phase.monad}
+ (do [@ phase.monad]
[.let [size (list.size members)]
_ (phase.assertion ..not_a_tuple size
(n.>= 2 size))