aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/procedure
diff options
context:
space:
mode:
authorEduardo Julian2017-10-30 21:49:35 -0400
committerEduardo Julian2017-10-30 21:49:35 -0400
commitb6c3a84b536235a53bdfaf0f96d76413bc222ba7 (patch)
tree6295ffe197e98fc998f1553fed14b44114fbfc8b /new-luxc/source/luxc/generator/procedure
parent7b870a7bd124f35939d9089a2e21f0806a4c6e85 (diff)
- Migrated the format of synthesis nodes from a custom data-type, to just Code nodes.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/generator/procedure/common.jvm.lux5
-rw-r--r--new-luxc/source/luxc/generator/procedure/host.jvm.lux33
2 files changed, 23 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/generator/procedure/common.jvm.lux b/new-luxc/source/luxc/generator/procedure/common.jvm.lux
index fd76082a6..7ae471c64 100644
--- a/new-luxc/source/luxc/generator/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/generator/procedure/common.jvm.lux
@@ -146,6 +146,10 @@
($i;CHECKCAST hostL;function-class)
($i;INVOKESTATIC hostL;runtime-class "try" try-method false)))
+(def: (lux//noop valueI)
+ Unary
+ valueI)
+
## [[Bits]]
(do-template [<name> <op>]
[(def: (<name> [inputI maskI])
@@ -536,6 +540,7 @@
(def: lux-procs
Bundle
(|> (dict;new text;Hash<Text>)
+ (install "lux noop" (unary lux//noop))
(install "lux is" (binary lux//is))
(install "lux try" (unary lux//try))))
diff --git a/new-luxc/source/luxc/generator/procedure/host.jvm.lux b/new-luxc/source/luxc/generator/procedure/host.jvm.lux
index fc6bdd01b..44da5744d 100644
--- a/new-luxc/source/luxc/generator/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/generator/procedure/host.jvm.lux
@@ -37,6 +37,7 @@
[L2S (|>. $i;L2I $i;I2S)]
[L2B (|>. $i;L2I $i;I2B)]
+ [L2C (|>. $i;L2I $i;I2C)]
)
(do-template [<name> <unwrap> <conversion> <wrap>]
@@ -68,6 +69,7 @@
[convert//long-to-int #$;Long $i;L2I #$;Int]
[convert//long-to-short #$;Long L2S #$;Short]
[convert//long-to-byte #$;Long L2B #$;Byte]
+ [convert//long-to-char #$;Long L2C #$;Char]
[convert//char-to-byte #$;Char $i;I2B #$;Byte]
[convert//char-to-short #$;Char $i;I2S #$;Short]
[convert//char-to-int #$;Char $i;NOP #$;Int]
@@ -97,6 +99,7 @@
(@;install "long-to-int" (@;unary convert//long-to-int))
(@;install "long-to-short" (@;unary convert//long-to-short))
(@;install "long-to-byte" (@;unary convert//long-to-byte))
+ (@;install "long-to-char" (@;unary convert//long-to-char))
(@;install "char-to-byte" (@;unary convert//char-to-byte))
(@;install "char-to-short" (@;unary convert//char-to-short))
(@;install "char-to-int" (@;unary convert//char-to-int))
@@ -278,7 +281,7 @@
(def: (array//new proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Nat level) (#ls;Text class) lengthS))
+ (^ (list [_ (#;Nat level)] [_ (#;Text class)] lengthS))
(do meta;Monad<Meta>
[lengthI (generate lengthS)
#let [arrayJT ($t;array level (case class
@@ -302,7 +305,7 @@
(def: (array//read proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) idxS arrayS))
+ (^ (list [_ (#;Text class)] idxS arrayS))
(do meta;Monad<Meta>
[arrayI (generate arrayS)
idxI (generate idxS)
@@ -328,7 +331,7 @@
(def: (array//write proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) idxS valueS arrayS))
+ (^ (list [_ (#;Text class)] idxS valueS arrayS))
(do meta;Monad<Meta>
[arrayI (generate arrayS)
idxI (generate idxS)
@@ -397,7 +400,7 @@
(def: (object//class proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class)))
+ (^ (list [_ (#;Text class)]))
(do meta;Monad<Meta>
[]
(wrap (|>. ($i;string class)
@@ -413,7 +416,7 @@
(def: (object//instance? proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) objectS))
+ (^ (list [_ (#;Text class)] objectS))
(do meta;Monad<Meta>
[objectI (generate objectS)]
(wrap (|>. objectI
@@ -450,7 +453,7 @@
(def: (static//get proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) (#ls;Text field) (#ls;Text unboxed)))
+ (^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)]))
(do meta;Monad<Meta>
[]
(case (dict;get unboxed primitives)
@@ -477,7 +480,7 @@
(def: (static//put proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) (#ls;Text field) (#ls;Text unboxed) valueS))
+ (^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] valueS))
(do meta;Monad<Meta>
[valueI (generate valueS)]
(case (dict;get unboxed primitives)
@@ -509,7 +512,7 @@
(def: (virtual//get proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) (#ls;Text field) (#ls;Text unboxed) objectS))
+ (^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] objectS))
(do meta;Monad<Meta>
[objectI (generate objectS)]
(case (dict;get unboxed primitives)
@@ -540,7 +543,7 @@
(def: (virtual//put proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list (#ls;Text class) (#ls;Text field) (#ls;Text unboxed) valueS objectS))
+ (^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] valueS objectS))
(do meta;Monad<Meta>
[valueI (generate valueS)
objectI (generate objectS)]
@@ -632,7 +635,7 @@
#;Nil
(meta/wrap #;Nil)
- (^ (list& [(#ls;Tuple (list (#ls;Text argD) argS))] tail))
+ (^ (list& [_ (#;Tuple (list [_ (#;Text argD)] argS))] tail))
(do meta;Monad<Meta>
[argT (generate-type argD)
argI (:: @ map (prepare-input argT) (generate argS))
@@ -669,8 +672,8 @@
(def: (invoke//static proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list& (#ls;Text class) (#ls;Text method)
- (#ls;Text unboxed) argsS))
+ (^ (list& [_ (#;Text class)] [_ (#;Text method)]
+ [_ (#;Text unboxed)] argsS))
(do meta;Monad<Meta>
[argsTI (generate-args generate argsS)
returnT (method-return-type unboxed)
@@ -687,8 +690,8 @@
[(def: (<name> proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list& (#ls;Text class) (#ls;Text method)
- (#ls;Text unboxed) objectS argsS))
+ (^ (list& [_ (#;Text class)] [_ (#;Text method)]
+ [_ (#;Text unboxed)] objectS argsS))
(do meta;Monad<Meta>
[objectI (generate objectS)
argsTI (generate-args generate argsS)
@@ -712,7 +715,7 @@
(def: (invoke//constructor proc generate inputs)
(-> Text @;Proc)
(case inputs
- (^ (list& (#ls;Text class) argsS))
+ (^ (list& [_ (#;Text class)] argsS))
(do meta;Monad<Meta>
[argsTI (generate-args generate argsS)]
(wrap (|>. ($i;NEW class)