diff options
author | Eduardo Julian | 2019-08-20 22:00:59 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-08-20 22:00:59 -0400 |
commit | 59ededb795732e04ac8e1eaceb2b1509a1c1cc23 (patch) | |
tree | c0498fbae7cd18fa9434c972a6f7e35d0e02b456 /new-luxc/source/luxc/lang/translation/jvm/primitive.lux | |
parent | cdfda2f80b2abd8ec7d8021aab910ccc82271ade (diff) |
WIP: Make new-luxc instructions rely on the Descriptor type.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/primitive.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/primitive.lux | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux index 85fed0a8e..6903b065d 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux @@ -2,6 +2,7 @@ [lux (#- i64) [target [jvm + ["." descriptor] ["$t" type]]] [tool [compiler @@ -12,11 +13,11 @@ ["." jvm (#+ Inst Operation) ["_" inst]]]]]) -(def: #export (bit value) +(def: #export bit (-> Bit (Operation Inst)) - (operation@wrap (_.GETSTATIC "java.lang.Boolean" - (if value "TRUE" "FALSE") - ($t.class "java.lang.Boolean" (list))))) + (let [Boolean (descriptor.class "java.lang.Boolean")] + (function (_ value) + (operation@wrap (_.GETSTATIC Boolean (if value "TRUE" "FALSE") Boolean))))) (template [<name> <type> <load> <wrap>] [(def: #export (<name> value) @@ -24,7 +25,7 @@ (let [loadI (|> value <load>)] (operation@wrap (|>> loadI <wrap>))))] - [i64 (I64 Any) (<| _.long .int) (_.wrap #$t.Long)] - [f64 Frac _.double (_.wrap #$t.Double)] + [i64 (I64 Any) (<| _.long .int) (_.wrap descriptor.long)] + [f64 Frac _.double (_.wrap descriptor.double)] [text Text _.string (<|)] ) |