aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm
diff options
context:
space:
mode:
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/case.lux32
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux118
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux28
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux42
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/loop.lux16
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/primitive.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/runtime.lux32
7 files changed, 135 insertions, 135 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
index 8e90b4510..cb5004f83 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux
@@ -133,22 +133,22 @@
(^.template [<tag> <unwrap> <dup> <pop> <test> <comparison> <if>]
[{<tag> cons}
(do [@ phase.monad]
- [forkG (: (Operation Inst)
- (monad.mix @ (function (_ [test thenP] elseG)
- (do @
- [thenG (path' stack_depth @else @end phase archive thenP)]
- (in (<| _.with_label (function (_ @else))
- (|>> <dup>
- (<test> test)
- <comparison>
- (<if> @else)
- <pop>
- thenG
- (_.label @else)
- elseG)))))
- (|>> <pop>
- (_.GOTO @else))
- {.#Item cons}))]
+ [forkG (is (Operation Inst)
+ (monad.mix @ (function (_ [test thenP] elseG)
+ (do @
+ [thenG (path' stack_depth @else @end phase archive thenP)]
+ (in (<| _.with_label (function (_ @else))
+ (|>> <dup>
+ (<test> test)
+ <comparison>
+ (<if> @else)
+ <pop>
+ thenG
+ (_.label @else)
+ elseG)))))
+ (|>> <pop>
+ (_.GOTO @else))
+ {.#Item cons}))]
(in (|>> peekI
<unwrap>
forkG)))])
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 20f3fdf7a..10fe4e948 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -1,45 +1,45 @@
(.using
- [library
- [lux {"-" Type Label}
- [ffi {"+" import:}]
- [abstract
- ["[0]" monad {"+" do}]]
- [control
- ["[0]" try]
- ["<>" parser
- ["<s>" synthesis {"+" Parser}]]]
- [data
- ["[0]" product]
- [collection
- ["[0]" list ("[1]@[0]" monad)]
- ["[0]" dictionary]]]
- [math
- [number
- ["f" frac]]]
- [target
- [jvm
- ["[0]" type]]]
- [tool
- [compiler
- ["[0]" phase]
- [meta
- [archive {"+" Archive}]]
- [language
- [lux
- ["[0]" synthesis {"+" Synthesis %synthesis}]
- [phase
- [generation
- [extension {"+" Nullary Unary Binary Trinary Variadic
- nullary unary binary trinary variadic}]]
- ["[0]" extension
- ["[0]" bundle]]]]]]]]]
- [luxc
- [lang
- [host
- ["$" jvm {"+" Label Inst Def Handler Bundle Operation Phase}
- ["_" inst]]]]]
- ["[0]" ///
- ["[0]" runtime]])
+ [library
+ [lux {"-" Type Label}
+ [ffi {"+" import:}]
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [control
+ ["[0]" try]
+ ["<>" parser
+ ["<s>" synthesis {"+" Parser}]]]
+ [data
+ ["[0]" product]
+ [collection
+ ["[0]" list ("[1]@[0]" monad)]
+ ["[0]" dictionary]]]
+ [math
+ [number
+ ["f" frac]]]
+ [target
+ [jvm
+ ["[0]" type]]]
+ [tool
+ [compiler
+ ["[0]" phase]
+ [meta
+ [archive {"+" Archive}]]
+ [language
+ [lux
+ ["[0]" synthesis {"+" Synthesis %synthesis}]
+ [phase
+ [generation
+ [extension {"+" Nullary Unary Binary Trinary Variadic
+ nullary unary binary trinary variadic}]]
+ ["[0]" extension
+ ["[0]" bundle]]]]]]]]]
+ [luxc
+ [lang
+ [host
+ ["$" jvm {"+" Label Inst Def Handler Bundle Operation Phase}
+ ["_" inst]]]]]
+ ["[0]" ///
+ ["[0]" runtime]])
(def: .public (custom [parser handler])
(All (_ s)
@@ -93,19 +93,19 @@
(do [@ phase.monad]
[inputG (phase archive input)
elseG (phase archive else)
- conditionalsG+ (: (Operation (List [(List [Int Label])
- Inst]))
- (monad.each @ (function (_ [chars branch])
- (do @
- [branchG (phase archive branch)]
- (in (<| _.with_label (function (_ @branch))
- [(list@each (function (_ char)
- [(.int char) @branch])
- chars)
- (|>> (_.label @branch)
- branchG
- (_.GOTO @end))]))))
- conditionals))
+ conditionalsG+ (is (Operation (List [(List [Int Label])
+ Inst]))
+ (monad.each @ (function (_ [chars branch])
+ (do @
+ [branchG (phase archive branch)]
+ (in (<| _.with_label (function (_ @branch))
+ [(list@each (function (_ char)
+ [(.int char) @branch])
+ chars)
+ (|>> (_.label @branch)
+ branchG
+ (_.GOTO @end))]))))
+ conditionals))
.let [table (|> conditionalsG+
(list@each product.left)
list@conjoint)
@@ -291,7 +291,7 @@
(def: bundle::lux
Bundle
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "syntax char case!" lux::syntax_char_case!)
(bundle.install "is" (binary lux::is))
(bundle.install "try" (unary lux::try))))
@@ -299,7 +299,7 @@
(def: bundle::i64
Bundle
(<| (bundle.prefix "i64")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "and" (binary i64::and))
(bundle.install "or" (binary i64::or))
(bundle.install "xor" (binary i64::xor))
@@ -318,7 +318,7 @@
(def: bundle::f64
Bundle
(<| (bundle.prefix "f64")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "+" (binary f64::+))
(bundle.install "-" (binary f64::-))
(bundle.install "*" (binary f64::*))
@@ -333,7 +333,7 @@
(def: bundle::text
Bundle
(<| (bundle.prefix "text")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "=" (binary text::=))
(bundle.install "<" (binary text::<))
(bundle.install "concat" (binary text::concat))
@@ -345,7 +345,7 @@
(def: bundle::io
Bundle
(<| (bundle.prefix "io")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "log" (unary io::log))
(bundle.install "error" (unary io::error)))))
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 f98188196..820e230db 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -164,7 +164,7 @@
(def: conversion_bundle
Bundle
(<| (bundle.prefix "conversion")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "double-to-float" (unary conversion::double_to_float))
(bundle.install "double-to-int" (unary conversion::double_to_int))
(bundle.install "double-to-long" (unary conversion::double_to_long))
@@ -295,7 +295,7 @@
(def: int_bundle
Bundle
(<| (bundle.prefix (reflection.reflection reflection.int))
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "+" (binary int::+))
(bundle.install "-" (binary int::-))
(bundle.install "*" (binary int::*))
@@ -314,7 +314,7 @@
(def: long_bundle
Bundle
(<| (bundle.prefix (reflection.reflection reflection.long))
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "+" (binary long::+))
(bundle.install "-" (binary long::-))
(bundle.install "*" (binary long::*))
@@ -333,7 +333,7 @@
(def: float_bundle
Bundle
(<| (bundle.prefix (reflection.reflection reflection.float))
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "+" (binary float::+))
(bundle.install "-" (binary float::-))
(bundle.install "*" (binary float::*))
@@ -346,7 +346,7 @@
(def: double_bundle
Bundle
(<| (bundle.prefix (reflection.reflection reflection.double))
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "+" (binary double::+))
(bundle.install "-" (binary double::-))
(bundle.install "*" (binary double::*))
@@ -359,7 +359,7 @@
(def: char_bundle
Bundle
(<| (bundle.prefix (reflection.reflection reflection.char))
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "=" (binary char::=))
(bundle.install "<" (binary char::<))
)))
@@ -615,7 +615,7 @@
(def: object_bundle
Bundle
(<| (bundle.prefix "object")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "null" (nullary object::null))
(bundle.install "null?" (unary object::null?))
(bundle.install "synchronized" (binary object::synchronized))
@@ -794,17 +794,17 @@
(def: member_bundle
Bundle
(<| (bundle.prefix "member")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(dictionary.merged (<| (bundle.prefix "get")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "static" get::static)
(bundle.install "virtual" get::virtual))))
(dictionary.merged (<| (bundle.prefix "put")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "static" put::static)
(bundle.install "virtual" put::virtual))))
(dictionary.merged (<| (bundle.prefix "invoke")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "static" invoke::static)
(bundle.install "virtual" invoke::virtual)
(bundle.install "special" invoke::special)
@@ -834,7 +834,7 @@
hidden
[_ {synthesis.#Control {synthesis.#Branch {synthesis.#Case _ path}}}]
- (loop [path (: synthesis.Path path)]
+ (loop [path (is synthesis.Path path)]
(case path
(^.or {synthesis.#Pop}
{synthesis.#Access _}
@@ -1088,7 +1088,7 @@
(list#mix (function (_ [lux_register type] [jvm_register before])
(let [[jvm_register' after] (prepare_argument (n.+ offset lux_register) type jvm_register)]
[jvm_register' (|>> before after)]))
- (: [Register Inst] [offset (|>>)]))
+ (is [Register Inst] [offset (|>>)]))
product.right))
(def: .public (returnI returnT)
@@ -1228,7 +1228,7 @@
(def: class_bundle
Bundle
(<| (bundle.prefix "class")
- (|> (: Bundle bundle.empty)
+ (|> (is Bundle bundle.empty)
(bundle.install "anonymous" class::anonymous)
)))
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 92ca0e16c..f93f4d035 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -173,8 +173,8 @@
(def: (with_init class env arity)
(-> (Type Class) (Environment Synthesis) Arity Def)
(let [env_size (list.size env)
- offset_partial (: (-> Nat Nat)
- (|>> ++ (n.+ env_size)))
+ offset_partial (is (-> Nat Nat)
+ (|>> ++ (n.+ env_size)))
store_capturedI (|> (case env_size
0 (list)
_ (enum.range n.enum 0 (-- env_size)))
@@ -283,25 +283,25 @@
(-> Phase Archive Label Text (Environment Synthesis) Arity Inst
(Operation [Def Inst]))
(let [classD (type.class class (list))
- applyD (: Def
- (if (poly_arg? arity)
- (|> (n.min arity //runtime.num_apply_variants)
- (enum.range n.enum 1)
- (list@each (with_apply classD env arity @begin bodyI))
- (list& (with_implementation arity @begin bodyI))
- def.fuse)
- (def.method {$.#Public} $.strictM //runtime.apply_method (//runtime.apply_signature 1)
- (|>> (_.label @begin)
- bodyI
- _.ARETURN))))
- functionD (: Def
- (|>> (def.int_field {$.#Public} ($_ $.++F $.staticF $.finalF) arity_field (.int arity))
- (with_environment env)
- (with_partial arity)
- (with_init classD env arity)
- (with_reset classD arity env)
- applyD
- ))]
+ applyD (is Def
+ (if (poly_arg? arity)
+ (|> (n.min arity //runtime.num_apply_variants)
+ (enum.range n.enum 1)
+ (list@each (with_apply classD env arity @begin bodyI))
+ (list& (with_implementation arity @begin bodyI))
+ def.fuse)
+ (def.method {$.#Public} $.strictM //runtime.apply_method (//runtime.apply_signature 1)
+ (|>> (_.label @begin)
+ bodyI
+ _.ARETURN))))
+ functionD (is Def
+ (|>> (def.int_field {$.#Public} ($_ $.++F $.staticF $.finalF) arity_field (.int arity))
+ (with_environment env)
+ (with_partial arity)
+ (with_init classD env arity)
+ (with_reset classD arity env)
+ applyD
+ ))]
(do phase.monad
[instanceI (..instance generate archive classD arity env)]
(in [functionD instanceI]))))
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
index 92b8c0286..4449b3606 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/loop.lux
@@ -53,16 +53,16 @@
... will refer to the new value of X, instead of the old value, and
... shouldn't be the case.
valuesI+ (monad.each @ (function (_ [register argS])
- (: (Operation Inst)
- (if (invariant? register argS)
- (in function.identity)
- (translate archive argS))))
+ (is (Operation Inst)
+ (if (invariant? register argS)
+ (in function.identity)
+ (translate archive argS))))
pairs)
.let [storesI+ (list@each (function (_ [register argS])
- (: Inst
- (if (invariant? register argS)
- function.identity
- (_.ASTORE register))))
+ (is Inst
+ (if (invariant? register argS)
+ function.identity
+ (_.ASTORE register))))
(list.reversed pairs))]]
(in (|>> (_.fuse valuesI+)
(_.fuse storesI+)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
index 49bc10ff3..734b55316 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
@@ -102,7 +102,7 @@
_
(let [constantI (if (|> value
- (:as java/lang/Double)
+ (as java/lang/Double)
java/lang/Double::doubleToRawLongBits
(i.= ..d0-bits))
_.DCONST_0
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
index ee3e16ed8..76c170725 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
@@ -167,11 +167,11 @@
last_rightI
_.AALOAD
(_.CHECKCAST //.$Tuple))
- recurI (: (-> Label Inst)
- (function (_ @loop)
- (|>> sub_leftsI (_.ISTORE 1)
- sub_tupleI (_.ASTORE 0)
- (_.GOTO @loop))))]
+ recurI (is (-> Label Inst)
+ (function (_ @loop)
+ (|>> sub_leftsI (_.ISTORE 1)
+ sub_tupleI (_.ASTORE 0)
+ (_.GOTO @loop))))]
(|>> ($d.method {$.#Public} $.staticM "pm_fail" throw_methodT
(|>> (illegal_state_exception "Invalid expression for pattern-matching.")
_.ATHROW))
@@ -200,12 +200,12 @@
$lefts (_.ILOAD 1)
$right? (_.ALOAD 2)
- variant_partI (: (-> Nat Inst)
- (function (_ idx)
- (|>> (_.int (.int idx)) _.AALOAD)))
- ::lefts (: Inst
- (|>> (variant_partI 0)
- (_.unwrap type.int)))
+ variant_partI (is (-> Nat Inst)
+ (function (_ idx)
+ (|>> (_.int (.int idx)) _.AALOAD)))
+ ::lefts (is Inst
+ (|>> (variant_partI 0)
+ (_.unwrap type.int)))
::right? (variant_partI 1)
::value (variant_partI 2)
@@ -226,11 +226,11 @@
update_$lefts (|>> _.ISUB
(_.int +1)
_.ISUB)
- iterate! (: (-> Label Inst)
- (function (_ @loop)
- (|>> update_$variant
- update_$lefts
- (_.GOTO @loop))))])
+ iterate! (is (-> Label Inst)
+ (function (_ @loop)
+ (|>> update_$variant
+ update_$lefts
+ (_.GOTO @loop))))])
(|>> $lefts ... lefts
(_.label @loop)
$variant ::lefts ... lefts, variant::lefts