aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm
diff options
context:
space:
mode:
authorEduardo Julian2021-09-12 00:07:08 -0400
committerEduardo Julian2021-09-12 00:07:08 -0400
commitdda05bca0956af5e5b3875c4cc36e61aa04772e4 (patch)
tree0f8b27697d58ab5c8e41aba7c7c9f769d3800767 /lux-jvm/source/luxc/lang/translation/jvm
parentd48270f43c404ba19ca04da2553455ecaaf2caba (diff)
Made the "#" character great again!
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux28
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/common.lux22
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/expression.lux2
-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.lux104
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux12
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/program.lux6
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/reference.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/runtime.lux8
9 files changed, 95 insertions, 95 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 0959130a3..04a9571a9 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -103,21 +103,21 @@
(def: (path' stack_depth @else @end phase archive path)
(-> Nat Label Label Phase Archive Path (Operation Inst))
(.case path
- #synthesis.Pop
+ {synthesis.#Pop}
(operation@in ..popI)
- {#synthesis.Bind register}
+ {synthesis.#Bind register}
(operation@in (|>> peekI
(_.ASTORE register)))
- {#synthesis.Bit_Fork when thenP elseP}
+ {synthesis.#Bit_Fork when thenP elseP}
(do phase.monad
[thenG (path' stack_depth @else @end phase archive thenP)
elseG (.case elseP
- {#.Some elseP}
+ {.#Some elseP}
(path' stack_depth @else @end phase archive elseP)
- #.None
+ {.#None}
(in (_.GOTO @else)))
.let [ifI (.if when _.IFEQ _.IFNE)]]
(in (<| _.with_label (function (_ @else))
@@ -146,17 +146,17 @@
elseG)))))
(|>> <pop>
(_.GOTO @else))
- {#.Item cons}))]
+ {.#Item cons}))]
(in (|>> peekI
<unwrap>
forkG)))])
- ([#synthesis.I64_Fork (_.unwrap type.long) _.DUP2 _.POP2 (|>> .int _.long) _.LCMP _.IFNE]
- [#synthesis.F64_Fork (_.unwrap type.double) _.DUP2 _.POP2 _.double _.DCMPL _.IFNE]
- [#synthesis.Text_Fork (|>) _.DUP _.POP _.string
+ ([synthesis.#I64_Fork (_.unwrap type.long) _.DUP2 _.POP2 (|>> .int _.long) _.LCMP _.IFNE]
+ [synthesis.#F64_Fork (_.unwrap type.double) _.DUP2 _.POP2 _.double _.DCMPL _.IFNE]
+ [synthesis.#Text_Fork (|>) _.DUP _.POP _.string
(_.INVOKEVIRTUAL (type.class "java.lang.Object" (list)) "equals" ..equalsJT)
_.IFEQ])
- {#synthesis.Then bodyS}
+ {synthesis.#Then bodyS}
(do phase.monad
[bodyI (phase archive bodyS)]
(in (|>> (pop_altI stack_depth)
@@ -202,14 +202,14 @@
([synthesis.member/left ..left_projection]
[synthesis.member/right ..right_projection])
- {#synthesis.Seq leftP rightP}
+ {synthesis.#Seq leftP rightP}
(do phase.monad
[leftI (path' stack_depth @else @end phase archive leftP)
rightI (path' stack_depth @else @end phase archive rightP)]
(in (|>> leftI
rightI)))
- {#synthesis.Alt leftP rightP}
+ {synthesis.#Alt leftP rightP}
(do phase.monad
[@alt_else _.make_label
leftI (path' (++ stack_depth) @alt_else @end phase archive leftP)
@@ -268,10 +268,10 @@
[recordG (phase archive recordS)]
(in (list@mix (function (_ step so_far)
(.let [next (.case step
- {#.Left lefts}
+ {.#Left lefts}
(..left_projection lefts)
- {#.Right lefts}
+ {.#Right lefts}
(..right_projection lefts))]
(|>> so_far next)))
recordG
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux
index 2dade7a97..456a20694 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux
@@ -31,22 +31,22 @@
... (def: .public (with-artifacts action)
... (All (_ a) (-> (Meta a) (Meta [Artifacts a])))
... (function (_ state)
-... (case (action (revised@ #.host
+... (case (action (revised@ .#host
... (|>> (:coerce Host)
... (with@ #artifacts (dictionary.new text.hash))
... (:coerce Nothing))
... state))
-... {#try.Success [state' output]}
-... {#try.Success [(revised@ #.host
+... {try.#Success [state' output]}
+... {try.#Success [(revised@ .#host
... (|>> (:coerce Host)
-... (with@ #artifacts (|> (value@ #.host state) (:coerce Host) (value@ #artifacts)))
+... (with@ #artifacts (|> (value@ .#host state) (:coerce Host) (value@ #artifacts)))
... (:coerce Nothing))
... state')
-... [(|> state' (value@ #.host) (:coerce Host) (value@ #artifacts))
+... [(|> state' (value@ .#host) (:coerce Host) (value@ #artifacts))
... output]]}
-... {#try.Failure error}
-... {#try.Failure error})))
+... {try.#Failure error}
+... {try.#Failure error})))
... (def: .public (load-definition state)
... (-> Lux (-> Name Binary (Try Any)))
@@ -59,14 +59,14 @@
... class (..load-class class-name)]
... (case (do try.monad
... [field (Class::getField [..value-field] class)]
-... (Field::get [#.None] field))
-... {#try.Success {#.Some def-value}}
+... (Field::get [{.#None}] field))
+... {try.#Success {.#Some def-value}}
... (wrap def-value)
-... {#try.Success #.None}
+... {try.#Success {.#None}}
... (phase.throw invalid-definition-value (%name def-name))
-... {#try.Failure error}
+... {try.#Failure error}
... (phase.throw cannot-load-definition
... (format "Definition: " (%name def-name) "\n"
... "Error:\n"
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
index a460ad96b..55e81812d 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux
@@ -72,5 +72,5 @@
(^ (synthesis.function/abstraction data))
(function.function translate archive data)
- {#synthesis.Extension extension}
+ {synthesis.#Extension extension}
(extension.apply archive translate extension)))
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 8d92a68eb..78048379c 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 5eda6443d..930e219a5 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -96,15 +96,15 @@
(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
+ {.#None}
(<>.failure (exception.error ..not_an_object_array [arrayJT])))
- #.None
+ {.#None}
(undefined))))
(template [<name> <inst>]
@@ -629,10 +629,10 @@
(do phase.monad
[]
(case (dictionary.value unboxed ..primitives)
- {#.Some primitive}
+ {.#Some primitive}
(in (_.GETSTATIC (type.class class (list)) field primitive))
- #.None
+ {.#None}
(in (_.GETSTATIC (type.class class (list)) field (type.class unboxed (list)))))))]))
(def: put::static
@@ -644,12 +644,12 @@
[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)))
- #.None
+ {.#None}
(in (|>> valueI
(_.CHECKCAST $class)
(_.PUTSTATIC $class field $class)
@@ -664,10 +664,10 @@
[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
+ {.#None}
(_.GETFIELD $class field (type.class unboxed (list))))]]
(in (|>> objectI
(_.CHECKCAST $class)
@@ -683,10 +683,10 @@
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
+ {.#None}
(let [$unboxed (type.class unboxed (list))]
(|>> (_.CHECKCAST $unboxed)
(_.PUTFIELD $class field $unboxed))))]]
@@ -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 _})
+ (^or {synthesis.#Pop}
+ {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))
_
@@ -875,18 +875,18 @@
(^template [<tag>]
[(^ {<tag> leftP rightP})
{<tag> (recur leftP) (recur rightP)}])
- ([#synthesis.Alt]
- [#synthesis.Seq])
+ ([synthesis.#Alt]
+ [synthesis.#Seq])
(^template [<tag>]
- [(^ {<tag> value})
+ [(^ {<tag> _})
path])
- ([#synthesis.Pop]
- [#synthesis.Bind]
- [#synthesis.Access])
+ ([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]}
@@ -894,16 +894,16 @@
(list\each (function (_ [else_test else_then])
[else_test (recur else_then)])
elses)]}])
- ([#synthesis.I64_Fork]
- [#synthesis.F64_Fork]
- [#synthesis.Text_Fork])
+ ([synthesis.#I64_Fork]
+ [synthesis.#F64_Fork]
+ [synthesis.#Text_Fork])
)))
(def: (normalize_method_body mapping)
(-> (Dictionary Synthesis Variable) Synthesis Synthesis)
(function (recur body)
(case body
- (^ {#synthesis.Primitive value})
+ (^ {synthesis.#Primitive value})
body
(^ (synthesis.constant value))
@@ -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
+ {.#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
@@ -1150,7 +1150,7 @@
(..with_anonymous_init class total_environment super_class inputsTI)
method_definitions))]]
_ (generation.execute! directive)
- _ (generation.save! artifact_id #.None directive)]
+ _ (generation.save! artifact_id {.#None} directive)]
(..anonymous_instance generate archive class total_environment)))]))
(def: class_bundle
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 7630191e9..458683ec2 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -308,14 +308,14 @@
(do [! phase.monad]
[@begin _.make_label
[function_context bodyI] (case forced_context
- {#.Some function_context}
+ {.#Some function_context}
(do !
[without_context (generation.with_anchor [@begin 1]
(generate archive bodyS))]
(in [function_context
without_context]))
- #.None
+ {.#None}
(generation.with_new_context archive
(generation.with_anchor [@begin 1]
(generate archive bodyS))))
@@ -328,16 +328,16 @@
functionD)]]
_ (generation.execute! directive)
_ (case forced_context
- #.None
- (generation.save! (product.right function_context) #.None directive)
+ {.#None}
+ (generation.save! (product.right function_context) {.#None} directive)
- {#.Some function_context}
+ {.#Some function_context}
(in []))]
(in instanceI)))
(def: .public function
(Generator Abstraction)
- (..function' #.None))
+ (..function' {.#None}))
(def: .public (call generate archive [functionS argsS])
(Generator Apply)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/program.lux b/lux-jvm/source/luxc/lang/translation/jvm/program.lux
index 1db9028d1..266938286 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/program.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/program.lux
@@ -79,12 +79,12 @@
(list)])
class (artifact_name context)]
[class
- ($d.class #_.V1_6
- #_.Public _.finalC
+ ($d.class {_.#V1_6}
+ {_.#Public} _.finalC
class
(list) ..^Object
(list)
- (|>> ($d.method #_.Public _.staticM "main" main_type
+ (|>> ($d.method {_.#Public} _.staticM "main" main_type
(|>> programI
prepare_input_listI
feed_inputsI
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
index 3c76f44c0..1c1beda17 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux
@@ -53,10 +53,10 @@
(def: .public (variable archive variable)
(-> Archive Variable (Operation Inst))
(case variable
- {#variable.Local variable}
+ {variable.#Local variable}
(operation@in (local variable))
- {#variable.Foreign variable}
+ {variable.#Foreign variable}
(foreign archive variable)))
(def: .public (constant archive name)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
index 8deac8430..995d82e47 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
@@ -364,8 +364,8 @@
directive [runtime_class bytecode]]
(do phase.monad
[_ (generation.execute! directive)
- _ (generation.save! ..runtime_id #.None directive)]
- (in [..runtime_id #.None bytecode]))))
+ _ (generation.save! ..runtime_id {.#None} directive)]
+ (in [..runtime_id {.#None} bytecode]))))
(def: function_id
1)
@@ -401,8 +401,8 @@
directive [function_class bytecode]]
(do phase.monad
[_ (generation.execute! directive)
- _ (generation.save! ..function_id #.None directive)]
- (in [..function_id #.None bytecode]))))
+ _ (generation.save! ..function_id {.#None} directive)]
+ (in [..function_id {.#None} bytecode]))))
(def: .public translate
(Operation [Registry Output])