aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/procedure/host.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/translation/jvm/procedure/host.lux
parent36d22e31ab696b2cf3382d77b0896dcb357dfb8c (diff)
Various fixes and tweaks.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux18
1 files changed, 15 insertions, 3 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 83cbd017b..4239a89aa 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.lux
@@ -4,6 +4,7 @@
["." monad (#+ do)]]
[control
["." exception (#+ exception:)]
+ ["." function]
["<>" parser ("#@." monad)
["<t>" text]
["<s>" synthesis (#+ Parser)]]]
@@ -343,7 +344,7 @@
(do phase.monad
[lengthI (generate lengthS)]
(wrap (|>> lengthI
- (_.array (jvm.array 1 jvm-primitive)))))
+ (_.array jvm-primitive))))
_
(phase.throw extension.invalid-syntax [extension-name %synthesis inputs]))))
@@ -728,6 +729,15 @@
#.None
argI))
+(def: (prepare-returnI return)
+ (-> Return Inst)
+ (case return
+ (#.Some _)
+ function.identity
+
+ #.None
+ (_.string synthesis.unit)))
+
(def: invoke::static
Handler
(..custom
@@ -739,7 +749,8 @@
(wrap (|>> (_.fuse (list@map ..prepare-argI argsTI))
(_.INVOKESTATIC class method
(jvm.method (list@map product.left argsTI) returnT (list))
- false)))))]))
+ false)
+ (prepare-returnI returnT)))))]))
(template [<name> <invoke> <interface?>]
[(def: <name>
@@ -756,7 +767,8 @@
(_.fuse (list@map ..prepare-argI argsTI))
(<invoke> class method
(jvm.method (list@map product.left argsTI) returnT (list))
- <interface?>)))))]))]
+ <interface?>)
+ (prepare-returnI returnT)))))]))]
[invoke::virtual _.INVOKEVIRTUAL false]
[invoke::special _.INVOKESPECIAL false]