diff options
author | Eduardo Julian | 2019-05-17 01:56:16 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-05-17 01:56:16 -0400 |
commit | 6c5a33ea07732fdd415712af49784653266682b3 (patch) | |
tree | 6e6b3da9515be9d917fcafc1d38c8ab6807152c1 /new-luxc/source/luxc/lang | |
parent | 8e597897978e9ad1045a89bedce4c58525d54aeb (diff) |
Refactored boxes and reflections.
Diffstat (limited to 'new-luxc/source/luxc/lang')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux | 144 |
1 files changed, 73 insertions, 71 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux index e1e6b3c47..cf68663a5 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux @@ -21,7 +21,9 @@ ["." set]]] [target ["." jvm #_ - ["#" type (#+ Primitive Bound Generic Class Type Method Var Typed Argument Return)]]] + ["#" type (#+ Primitive Bound Generic Class Type Method Var Typed Argument Return) + ["." box] + ["." reflection]]]] [tool [compiler [analysis (#+ Environment)] @@ -181,7 +183,7 @@ [double::% _.DREM] ) -(def: boolean-class (jvm.class jvm.boolean-box (list))) +(def: boolean-class (jvm.class box.boolean (list))) (def: falseI (_.GETSTATIC "java.lang.Boolean" "FALSE" boolean-class)) (def: trueI (_.GETSTATIC "java.lang.Boolean" "TRUE" boolean-class)) @@ -234,7 +236,7 @@ (def: int Bundle - (<| (bundle.prefix jvm.int-reflection) + (<| (bundle.prefix reflection.int) (|> (: Bundle bundle.empty) (bundle.install "+" (binary int::+)) (bundle.install "-" (binary int::-)) @@ -253,7 +255,7 @@ (def: long Bundle - (<| (bundle.prefix jvm.long-reflection) + (<| (bundle.prefix reflection.long) (|> (: Bundle bundle.empty) (bundle.install "+" (binary long::+)) (bundle.install "-" (binary long::-)) @@ -272,7 +274,7 @@ (def: float Bundle - (<| (bundle.prefix jvm.float-reflection) + (<| (bundle.prefix reflection.float) (|> (: Bundle bundle.empty) (bundle.install "+" (binary float::+)) (bundle.install "-" (binary float::-)) @@ -285,7 +287,7 @@ (def: double Bundle - (<| (bundle.prefix jvm.double-reflection) + (<| (bundle.prefix reflection.double) (|> (: Bundle bundle.empty) (bundle.install "+" (binary double::+)) (bundle.install "-" (binary double::-)) @@ -298,7 +300,7 @@ (def: char Bundle - (<| (bundle.prefix jvm.char-reflection) + (<| (bundle.prefix reflection.char) (|> (: Bundle bundle.empty) (bundle.install "=" (binary char::=)) (bundle.install "<" (binary char::<)) @@ -308,14 +310,14 @@ (-> Nat Text Type) (jvm.array nesting (case elem-class - (^ (static jvm.boolean-reflection)) jvm.boolean - (^ (static jvm.byte-reflection)) jvm.byte - (^ (static jvm.short-reflection)) jvm.short - (^ (static jvm.int-reflection)) jvm.int - (^ (static jvm.long-reflection)) jvm.long - (^ (static jvm.float-reflection)) jvm.float - (^ (static jvm.double-reflection)) jvm.double - (^ (static jvm.char-reflection)) jvm.char + (^ (static reflection.boolean)) jvm.boolean + (^ (static reflection.byte)) jvm.byte + (^ (static reflection.short)) jvm.short + (^ (static reflection.int)) jvm.int + (^ (static reflection.long)) jvm.long + (^ (static reflection.float)) jvm.float + (^ (static reflection.double)) jvm.double + (^ (static reflection.char)) jvm.char _ (jvm.class elem-class (list))))) (def: (primitive-array-length-handler jvm-primitive) @@ -451,47 +453,47 @@ (|> bundle.empty (dictionary.merge (<| (bundle.prefix "length") (|> bundle.empty - (bundle.install jvm.boolean-reflection (primitive-array-length-handler jvm.boolean)) - (bundle.install jvm.byte-reflection (primitive-array-length-handler jvm.byte)) - (bundle.install jvm.short-reflection (primitive-array-length-handler jvm.short)) - (bundle.install jvm.int-reflection (primitive-array-length-handler jvm.int)) - (bundle.install jvm.long-reflection (primitive-array-length-handler jvm.long)) - (bundle.install jvm.float-reflection (primitive-array-length-handler jvm.float)) - (bundle.install jvm.double-reflection (primitive-array-length-handler jvm.double)) - (bundle.install jvm.char-reflection (primitive-array-length-handler jvm.char)) + (bundle.install reflection.boolean (primitive-array-length-handler jvm.boolean)) + (bundle.install reflection.byte (primitive-array-length-handler jvm.byte)) + (bundle.install reflection.short (primitive-array-length-handler jvm.short)) + (bundle.install reflection.int (primitive-array-length-handler jvm.int)) + (bundle.install reflection.long (primitive-array-length-handler jvm.long)) + (bundle.install reflection.float (primitive-array-length-handler jvm.float)) + (bundle.install reflection.double (primitive-array-length-handler jvm.double)) + (bundle.install reflection.char (primitive-array-length-handler jvm.char)) (bundle.install "object" array::length::object)))) (dictionary.merge (<| (bundle.prefix "new") (|> bundle.empty - (bundle.install jvm.boolean-reflection (new-primitive-array-handler jvm.boolean)) - (bundle.install jvm.byte-reflection (new-primitive-array-handler jvm.byte)) - (bundle.install jvm.short-reflection (new-primitive-array-handler jvm.short)) - (bundle.install jvm.int-reflection (new-primitive-array-handler jvm.int)) - (bundle.install jvm.long-reflection (new-primitive-array-handler jvm.long)) - (bundle.install jvm.float-reflection (new-primitive-array-handler jvm.float)) - (bundle.install jvm.double-reflection (new-primitive-array-handler jvm.double)) - (bundle.install jvm.char-reflection (new-primitive-array-handler jvm.char)) + (bundle.install reflection.boolean (new-primitive-array-handler jvm.boolean)) + (bundle.install reflection.byte (new-primitive-array-handler jvm.byte)) + (bundle.install reflection.short (new-primitive-array-handler jvm.short)) + (bundle.install reflection.int (new-primitive-array-handler jvm.int)) + (bundle.install reflection.long (new-primitive-array-handler jvm.long)) + (bundle.install reflection.float (new-primitive-array-handler jvm.float)) + (bundle.install reflection.double (new-primitive-array-handler jvm.double)) + (bundle.install reflection.char (new-primitive-array-handler jvm.char)) (bundle.install "object" array::new::object)))) (dictionary.merge (<| (bundle.prefix "read") (|> bundle.empty - (bundle.install jvm.boolean-reflection (read-primitive-array-handler jvm.boolean _.BALOAD)) - (bundle.install jvm.byte-reflection (read-primitive-array-handler jvm.byte _.BALOAD)) - (bundle.install jvm.short-reflection (read-primitive-array-handler jvm.short _.SALOAD)) - (bundle.install jvm.int-reflection (read-primitive-array-handler jvm.int _.IALOAD)) - (bundle.install jvm.long-reflection (read-primitive-array-handler jvm.long _.LALOAD)) - (bundle.install jvm.float-reflection (read-primitive-array-handler jvm.float _.FALOAD)) - (bundle.install jvm.double-reflection (read-primitive-array-handler jvm.double _.DALOAD)) - (bundle.install jvm.char-reflection (read-primitive-array-handler jvm.char _.CALOAD)) + (bundle.install reflection.boolean (read-primitive-array-handler jvm.boolean _.BALOAD)) + (bundle.install reflection.byte (read-primitive-array-handler jvm.byte _.BALOAD)) + (bundle.install reflection.short (read-primitive-array-handler jvm.short _.SALOAD)) + (bundle.install reflection.int (read-primitive-array-handler jvm.int _.IALOAD)) + (bundle.install reflection.long (read-primitive-array-handler jvm.long _.LALOAD)) + (bundle.install reflection.float (read-primitive-array-handler jvm.float _.FALOAD)) + (bundle.install reflection.double (read-primitive-array-handler jvm.double _.DALOAD)) + (bundle.install reflection.char (read-primitive-array-handler jvm.char _.CALOAD)) (bundle.install "object" array::read::object)))) (dictionary.merge (<| (bundle.prefix "write") (|> bundle.empty - (bundle.install jvm.boolean-reflection (write-primitive-array-handler jvm.boolean _.BASTORE)) - (bundle.install jvm.byte-reflection (write-primitive-array-handler jvm.byte _.BASTORE)) - (bundle.install jvm.short-reflection (write-primitive-array-handler jvm.short _.SASTORE)) - (bundle.install jvm.int-reflection (write-primitive-array-handler jvm.int _.IASTORE)) - (bundle.install jvm.long-reflection (write-primitive-array-handler jvm.long _.LASTORE)) - (bundle.install jvm.float-reflection (write-primitive-array-handler jvm.float _.FASTORE)) - (bundle.install jvm.double-reflection (write-primitive-array-handler jvm.double _.DASTORE)) - (bundle.install jvm.char-reflection (write-primitive-array-handler jvm.char _.CASTORE)) + (bundle.install reflection.boolean (write-primitive-array-handler jvm.boolean _.BASTORE)) + (bundle.install reflection.byte (write-primitive-array-handler jvm.byte _.BASTORE)) + (bundle.install reflection.short (write-primitive-array-handler jvm.short _.SASTORE)) + (bundle.install reflection.int (write-primitive-array-handler jvm.int _.IASTORE)) + (bundle.install reflection.long (write-primitive-array-handler jvm.long _.LASTORE)) + (bundle.install reflection.float (write-primitive-array-handler jvm.float _.FASTORE)) + (bundle.install reflection.double (write-primitive-array-handler jvm.double _.DASTORE)) + (bundle.install reflection.char (write-primitive-array-handler jvm.char _.CASTORE)) (bundle.install "object" array::write::object)))) ))) @@ -568,14 +570,14 @@ (^ [(static <object>) (static <primitive>)]) (wrap (|>> valueI (_.unwrap <type>)))) - ([jvm.boolean-reflection jvm.boolean-box #jvm.Boolean] - [jvm.byte-reflection jvm.byte-box #jvm.Byte] - [jvm.short-reflection jvm.short-box #jvm.Short] - [jvm.int-reflection jvm.int-box #jvm.Int] - [jvm.long-reflection jvm.long-box #jvm.Long] - [jvm.float-reflection jvm.float-box #jvm.Float] - [jvm.double-reflection jvm.double-box #jvm.Double] - [jvm.char-reflection jvm.char-box #jvm.Char]) + ([reflection.boolean box.boolean #jvm.Boolean] + [reflection.byte box.byte #jvm.Byte] + [reflection.short box.short #jvm.Short] + [reflection.int box.int #jvm.Int] + [reflection.long box.long #jvm.Long] + [reflection.float box.float #jvm.Float] + [reflection.double box.double #jvm.Double] + [reflection.char box.char #jvm.Char]) _ (wrap valueI))) @@ -598,14 +600,14 @@ (def: primitives (Dictionary Text Primitive) - (|> (list [jvm.boolean-reflection #jvm.Boolean] - [jvm.byte-reflection #jvm.Byte] - [jvm.short-reflection #jvm.Short] - [jvm.int-reflection #jvm.Int] - [jvm.long-reflection #jvm.Long] - [jvm.float-reflection #jvm.Float] - [jvm.double-reflection #jvm.Double] - [jvm.char-reflection #jvm.Char]) + (|> (list [reflection.boolean #jvm.Boolean] + [reflection.byte #jvm.Byte] + [reflection.short #jvm.Short] + [reflection.int #jvm.Int] + [reflection.long #jvm.Long] + [reflection.float #jvm.Float] + [reflection.double #jvm.Double] + [reflection.char #jvm.Char]) (dictionary.from-list text.hash))) (def: (static::get extension-name generate inputs) @@ -841,14 +843,14 @@ (def: primitive (<s>.Parser Primitive) ($_ <>.or - (<s>.constant! ["" jvm.boolean-reflection]) - (<s>.constant! ["" jvm.byte-reflection]) - (<s>.constant! ["" jvm.short-reflection]) - (<s>.constant! ["" jvm.int-reflection]) - (<s>.constant! ["" jvm.long-reflection]) - (<s>.constant! ["" jvm.float-reflection]) - (<s>.constant! ["" jvm.double-reflection]) - (<s>.constant! ["" jvm.char-reflection]) + (<s>.constant! ["" reflection.boolean]) + (<s>.constant! ["" reflection.byte]) + (<s>.constant! ["" reflection.short]) + (<s>.constant! ["" reflection.int]) + (<s>.constant! ["" reflection.long]) + (<s>.constant! ["" reflection.float]) + (<s>.constant! ["" reflection.double]) + (<s>.constant! ["" reflection.char]) )) (def: jvm-type |