aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm
diff options
context:
space:
mode:
authorEduardo Julian2018-07-13 22:01:32 -0400
committerEduardo Julian2018-07-13 22:01:32 -0400
commit69fefab57c40f323d759dc444dbcebad15071585 (patch)
treedb08a3ea37c7818c8a98fc995d3c19440141b700 /new-luxc/source/luxc/lang/translation/jvm
parent6acf4ffc362c0f8ef77d96f8cfe991adb2d9a0eb (diff)
Re-named "Bool" type to "Bit".
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux16
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux4
8 files changed, 22 insertions, 18 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
index 18309b0e5..d29b9ae7c 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
@@ -73,7 +73,7 @@
(macro/wrap (|>> peekI
($i.ASTORE register)))
- [_ (#.Bool value)]
+ [_ (#.Bit value)]
(macro/wrap (let [jumpI (if value $i.IFEQ $i.IFNE)]
(|>> peekI
($i.unwrap #$.Boolean)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux
index a587d2e5b..b6fed434e 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux
@@ -32,8 +32,8 @@
(def: #export (translate synthesis)
(-> Synthesis (Meta $.Inst))
(case synthesis
- (^ (//synthesis.bool value))
- (primitiveT.translate-bool value)
+ (^ (//synthesis.bit value))
+ (primitiveT.translate-bit value)
(^ (//synthesis.i64 value))
(primitiveT.translate-i64 value)
@@ -44,7 +44,7 @@
(^ (//synthesis.text value))
(primitiveT.translate-text value)
- (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS)))
+ (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS)))
(structureT.translate-variant translate tag last? valueS)
(^code [(~+ members)])
diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux
index 70eedf738..062cf5d52 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux
@@ -23,7 +23,7 @@
(def: $Object $.Type ($t.class "java.lang.Object" (list)))
(def: (poly-arg? arity)
- (-> ls.Arity Bool)
+ (-> ls.Arity Bit)
(n/> +1 arity))
(def: (reset-method class)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux
index 22fdfbece..820024153 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux
@@ -66,7 +66,7 @@
(<| (Future::get [])
promise-to-future
(do promise.Monad<Promise>
- [[new? future] (stm.commit (: (STM [Bool (CompletableFuture (Error Lux))])
+ [[new? future] (stm.commit (: (STM [Bit (CompletableFuture (Error Lux))])
(do stm.Monad<STM>
[current-compilations (stm.read compilations)]
(case (dict.get dependency current-compilations)
@@ -87,7 +87,7 @@
(wrap future)))))
(def: compiled?
- (-> Module Bool)
+ (-> Module Bit)
(|>> (get@ #.module-state)
(case>
(^or #.Cached #.Compiled)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux
index f48ab149a..120a3e384 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux
@@ -19,7 +19,7 @@
[".T" reference]))
(def: (constant? register changeS)
- (-> Register ls.Synthesis Bool)
+ (-> Register ls.Synthesis Bit)
(case changeS
(^multi (^code ((~ [_ (#.Int var)])))
(i/= (variableL.local register)
diff --git a/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux
index 80a243852..250b0db52 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux
@@ -12,8 +12,8 @@
["ls" synthesis]))
(// [".T" common]))
-(def: #export (translate-bool value)
- (-> Bool (Meta $.Inst))
+(def: #export (translate-bit value)
+ (-> Bit (Meta $.Inst))
(macro/wrap ($i.GETSTATIC "java.lang.Boolean"
(if value "TRUE" "FALSE")
($t.class "java.lang.Boolean" (list)))))
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
index f6a0069f5..45cb67fb9 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
@@ -155,6 +155,10 @@
[double//% $i.DREM #$.Double #$.Double #$.Double]
)
+(def: boolean-class ($t.class "java.lang.Boolean" (list)))
+(def: falseI ($i.GETSTATIC "java.lang.Boolean" "FALSE" boolean-class))
+(def: trueI ($i.GETSTATIC "java.lang.Boolean" "TRUE" boolean-class))
+
(do-template [<name> <op> <unwrapX> <unwrapY> <wrap>]
[(def: (<name> [xI yI])
@.Binary
@@ -163,10 +167,10 @@
(|>> xI ($i.unwrap <unwrapX>)
yI ($i.unwrap <unwrapY>)
(<op> @then)
- ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list)))
+ falseI
($i.GOTO @end)
($i.label @then)
- ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list)))
+ trueI
($i.label @end))))]
[int//= $i.IF_ICMPEQ #$.Int #$.Int #$.Boolean]
@@ -186,10 +190,10 @@
<op>
($i.int <reference>)
($i.IF_ICMPEQ @then)
- ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list)))
+ falseI
($i.GOTO @end)
($i.label @then)
- ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list)))
+ trueI
($i.label @end))))]
[long//= $i.LCMP 0 #$.Long #$.Long #$.Boolean]
@@ -380,10 +384,10 @@
$i.with-label (function (_ @end))
(|>> objectI
($i.IFNULL @then)
- ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list)))
+ falseI
($i.GOTO @end)
($i.label @then)
- ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list)))
+ trueI
($i.label @end))))
(def: (object//synchronized [monitorI exprI])
diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux
index fce1c6790..9d3e4d097 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux
@@ -42,13 +42,13 @@
membersI))))
(def: (flagI tail?)
- (-> Bool $.Inst)
+ (-> Bit $.Inst)
(if tail?
($i.string "")
$i.NULL))
(def: #export (translate-variant translate tag tail? member)
- (-> (-> ls.Synthesis (Meta $.Inst)) Nat Bool ls.Synthesis (Meta $.Inst))
+ (-> (-> ls.Synthesis (Meta $.Inst)) Nat Bit ls.Synthesis (Meta $.Inst))
(do macro.Monad<Meta>
[memberI (translate member)]
(wrap (|>> ($i.int (.int tag))