diff options
author | Eduardo Julian | 2017-06-30 18:43:07 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-30 18:43:07 -0400 |
commit | a79927892174c3564c83a0e741e5cc0aaaeeb37c (patch) | |
tree | 780936163414dd6105cf00bb5debb8ee9a7a518a /new-luxc/source/luxc/generator/primitive.jvm.lux | |
parent | 36cf0c61991bda395e224fa2d435fa6b6f5090e5 (diff) |
- WIP: Added generation for common procedures.
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] |