diff options
Diffstat (limited to 'new-luxc/source/luxc/generator/primitive.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/generator/primitive.jvm.lux | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/new-luxc/source/luxc/generator/primitive.jvm.lux b/new-luxc/source/luxc/generator/primitive.jvm.lux index 18ce2e24a..c444f791d 100644 --- a/new-luxc/source/luxc/generator/primitive.jvm.lux +++ b/new-luxc/source/luxc/generator/primitive.jvm.lux @@ -10,18 +10,25 @@ ["&;" synthesizer] (generator ["&;" common] (host ["$" jvm] - (jvm ["$i" inst]))))) + (jvm ["$i" inst] + ["$t" type])))) + [../runtime]) (def: #export generate-unit (Lux $;Inst) - (Lux/wrap ($i;string &common;unit))) + (Lux/wrap ($i;string ../runtime;unit))) + +(def: #export (generate-bool value) + (-> Bool (Lux $;Inst)) + (Lux/wrap ($i;GETSTATIC "java.lang.Boolean" + (if value "TRUE" "FALSE") + ($t;class "java.lang.Boolean" (list))))) (do-template [<name> <type> <load> <wrap>] [(def: #export (<name> value) (-> <type> (Lux $;Inst)) (Lux/wrap (|>. (<load> value) <wrap>)))] - [generate-bool Bool $i;boolean $i;wrap-boolean] [generate-nat Nat (|>. (:! Int) $i;long) $i;wrap-long] [generate-int Int $i;long $i;wrap-long] [generate-deg Deg (|>. (:! Int) $i;long) $i;wrap-long] |