aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/host/jvm/def.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-05-29 23:34:17 -0400
committerEduardo Julian2019-05-29 23:34:17 -0400
commita85bfc405e7acaf86c61fcd8f7987da0200d7b03 (patch)
tree0bdcbef2e40814d9e5a828c9c8fcf83d233b2645 /new-luxc/source/luxc/lang/host/jvm/def.lux
parent36d22e31ab696b2cf3382d77b0896dcb357dfb8c (diff)
Various fixes and tweaks.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/host/jvm/def.lux31
1 files changed, 29 insertions, 2 deletions
diff --git a/new-luxc/source/luxc/lang/host/jvm/def.lux b/new-luxc/source/luxc/lang/host/jvm/def.lux
index bf4abc8ed..4d1b99da0 100644
--- a/new-luxc/source/luxc/lang/host/jvm/def.lux
+++ b/new-luxc/source/luxc/lang/host/jvm/def.lux
@@ -12,7 +12,8 @@
["." list ("#/." functor)]]]
[target
[jvm
- ["$t" type (#+ Method Class Type Parameter)]]]]
+ ["$t" type (#+ Method Class Type Parameter)
+ ["." reflection]]]]]
["." //])
(import: #long java/lang/Object)
@@ -71,10 +72,36 @@
(list.enumerate values))
output)))
+(def: (exception-class-name type)
+ (-> Type Text)
+ (case type
+ (#$t.Primitive prim)
+ (case prim
+ #$t.Boolean reflection.boolean
+ #$t.Byte reflection.byte
+ #$t.Short reflection.short
+ #$t.Int reflection.int
+ #$t.Long reflection.long
+ #$t.Float reflection.float
+ #$t.Double reflection.double
+ #$t.Char reflection.char)
+
+ (#$t.Array sub)
+ (format $t.array-prefix (exception-class-name sub))
+
+ (#$t.Generic generic)
+ (case generic
+ (#$t.Class class params)
+ ($t.binary-name class)
+
+ (^or (#$t.Var _) (#$t.Wildcard _))
+ ($t.binary-name $t.object-class))
+ ))
+
(def: exceptions-array
(-> Method (Array Text))
(|>> (get@ #$t.exceptions)
- (list/map (|>> #$t.Generic $t.descriptor))
+ (list/map (|>> #$t.Generic ..exception-class-name))
string-array))
(def: (version-flag version)