aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm/extension
diff options
context:
space:
mode:
authorEduardo Julian2021-09-10 01:21:23 -0400
committerEduardo Julian2021-09-10 01:21:23 -0400
commitcd71a864ad5be13ed6ec6d046e0a2cb1087bdf94 (patch)
treeaf6366578f98f1a8e551f4da9f3ad230fd63a4dd /lux-jvm/source/luxc/lang/translation/jvm/extension
parentef77466323f85a3d1b65b46a3deb93652ef22085 (diff)
Migrated variants to the new syntax.
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm/extension')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux88
2 files changed, 46 insertions, 46 deletions
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 e3ac4141b..8d92a68eb 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -48,10 +48,10 @@
Handler))
(function (_ extension_name phase archive input)
(case (<s>.result parser input)
- (#try.Success input')
+ {#try.Success input'}
(handler extension_name phase archive input')
- (#try.Failure error)
+ {#try.Failure error}
(phase.except extension.invalid_syntax [extension_name %synthesis input]))))
(import: java/lang/Double
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 131ff0968..8535c3b35 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -96,9 +96,9 @@
(do <>.monad
[arrayJT (<text>.then parser.array <synthesis>.text)]
(case (parser.array? arrayJT)
- (#.Some elementJT)
+ {#.Some elementJT}
(case (parser.object? elementJT)
- (#.Some elementJT)
+ {#.Some elementJT}
(in elementJT)
#.None
@@ -629,7 +629,7 @@
(do phase.monad
[]
(case (dictionary.value unboxed ..primitives)
- (#.Some primitive)
+ {#.Some primitive}
(in (_.GETSTATIC (type.class class (list)) field primitive))
#.None
@@ -644,7 +644,7 @@
[valueI (generate archive valueS)
.let [$class (type.class class (list))]]
(case (dictionary.value unboxed ..primitives)
- (#.Some primitive)
+ {#.Some primitive}
(in (|>> valueI
(_.PUTSTATIC $class field primitive)
(_.string synthesis.unit)))
@@ -664,7 +664,7 @@
[objectI (generate archive objectS)
.let [$class (type.class class (list))
getI (case (dictionary.value unboxed ..primitives)
- (#.Some primitive)
+ {#.Some primitive}
(_.GETFIELD $class field primitive)
#.None
@@ -683,7 +683,7 @@
objectI (generate archive objectS)
.let [$class (type.class class (list))
putI (case (dictionary.value unboxed ..primitives)
- (#.Some primitive)
+ {#.Some primitive}
(_.PUTFIELD $class field primitive)
#.None
@@ -709,10 +709,10 @@
(do phase.monad
[valueI (generate archive valueS)]
(case (type.primitive? valueT)
- (#.Right valueT)
+ {#.Right valueT}
(in [valueT valueI])
- (#.Left valueT)
+ {#.Left valueT}
(in [valueT (|>> valueI
(_.CHECKCAST valueT))]))))
@@ -722,10 +722,10 @@
(def: (prepare_output outputT)
(-> (Type Return) Inst)
(case (type.void? outputT)
- (#.Right outputT)
+ {#.Right outputT}
..voidI
- (#.Left outputT)
+ {#.Left outputT}
function.identity))
(def: invoke::static
@@ -814,26 +814,26 @@
[0 _] body
[1 _] body
- [2 (#synthesis.Control (#synthesis.Branch (#synthesis.Let _ 2 hidden)))]
+ [2 {#synthesis.Control {#synthesis.Branch {#synthesis.Let _ 2 hidden}}}]
hidden
- [_ (#synthesis.Control (#synthesis.Branch (#synthesis.Case _ path)))]
+ [_ {#synthesis.Control {#synthesis.Branch {#synthesis.Case _ path}}}]
(loop [path path]
(case path
(^or #synthesis.Pop
- (#synthesis.Access _)
- (#synthesis.Bind _)
- (#synthesis.Bit_Fork _)
- (#synthesis.I64_Fork _)
- (#synthesis.F64_Fork _)
- (#synthesis.Text_Fork _)
- (#synthesis.Alt _))
+ {#synthesis.Access _}
+ {#synthesis.Bind _}
+ {#synthesis.Bit_Fork _}
+ {#synthesis.I64_Fork _}
+ {#synthesis.F64_Fork _}
+ {#synthesis.Text_Fork _}
+ {#synthesis.Alt _})
body
- (#synthesis.Seq _ next)
+ {#synthesis.Seq _ next}
(recur next)
- (#synthesis.Then hidden)
+ {#synthesis.Then hidden}
hidden))
_
@@ -873,27 +873,27 @@
(synthesis.path/then (normalize bodyS))
(^template [<tag>]
- [(^ (<tag> leftP rightP))
- (<tag> (recur leftP) (recur rightP))])
+ [(^ {<tag> leftP rightP})
+ {<tag> (recur leftP) (recur rightP)}])
([#synthesis.Alt]
[#synthesis.Seq])
(^template [<tag>]
- [(^ (<tag> value))
+ [(^ {<tag> value})
path])
([#synthesis.Pop]
[#synthesis.Bind]
[#synthesis.Access])
- (#synthesis.Bit_Fork when then else)
- (#synthesis.Bit_Fork when (recur then) (maybe\each recur else))
+ {#synthesis.Bit_Fork when then else}
+ {#synthesis.Bit_Fork when (recur then) (maybe\each recur else)}
(^template [<tag>]
- [(<tag> [[test then] elses])
- (<tag> [[test (recur then)]
+ [{<tag> [[test then] elses]}
+ {<tag> [[test (recur then)]
(list\each (function (_ [else_test else_then])
[else_test (recur else_then)])
- elses)])])
+ elses)]}])
([#synthesis.I64_Fork]
[#synthesis.F64_Fork]
[#synthesis.Text_Fork])
@@ -903,11 +903,11 @@
(-> (Dictionary Synthesis Variable) Synthesis Synthesis)
(function (recur body)
(case body
- (^template [<tag>]
- [(^ (<tag> value))
- body])
- ([#synthesis.Primitive]
- [synthesis.constant])
+ (^ {#synthesis.Primitive value})
+ body
+
+ (^ {synthesis.constant value})
+ body
(^ (synthesis.variant [lefts right? sub]))
(synthesis.variant [lefts right? (recur sub)])
@@ -957,8 +957,8 @@
(^ (synthesis.function/apply [functionS inputsS+]))
(synthesis.function/apply [(recur functionS) (list\each recur inputsS+)])
- (#synthesis.Extension [name inputsS+])
- (#synthesis.Extension [name (list\each recur inputsS+)]))))
+ {#synthesis.Extension [name inputsS+]}
+ {#synthesis.Extension [name (list\each recur inputsS+)]})))
(def: $Object
(type.class "java.lang.Object" (list)))
@@ -999,14 +999,14 @@
(def: (prepare_argument lux_register argumentT jvm_register)
(-> Register (Type Value) Register [Register Inst])
(case (type.primitive? argumentT)
- (#.Left argumentT)
+ {#.Left argumentT}
[(n.+ 1 jvm_register)
(if (n.= lux_register jvm_register)
(|>>)
(|>> (_.ALOAD jvm_register)
(_.ASTORE lux_register)))]
- (#.Right argumentT)
+ {#.Right argumentT}
(template.let [(wrap_primitive <shift> <load> <type>)
[[(n.+ <shift> jvm_register)
(|>> (<load> jvm_register)
@@ -1040,21 +1040,21 @@
(def: .public (returnI returnT)
(-> (Type Return) Inst)
(case (type.void? returnT)
- (#.Right returnT)
+ {#.Right returnT}
_.RETURN
- (#.Left returnT)
+ {#.Left returnT}
(case (type.primitive? returnT)
- (#.Left returnT)
+ {#.Left returnT}
(case (type.class? returnT)
- (#.Some class_name)
+ {#.Some class_name}
(|>> (_.CHECKCAST returnT)
_.ARETURN)
#.None
_.ARETURN)
- (#.Right returnT)
+ {#.Right returnT}
(template.let [(unwrap_primitive <return> <type>)
[(|>> (_.unwrap <type>)
<return>)]]
@@ -1102,7 +1102,7 @@
... Give them names as "foreign" variables.
list.enumeration
(list\each (function (_ [id capture])
- [capture (#variable.Foreign id)]))
+ [capture {#variable.Foreign id}]))
(dictionary.of_list synthesis.hash))
normalized_methods (list\each (function (_ [environment
[ownerT name