From b88027c19181f24584d5ad1c46fb2443d65edece Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Nov 2017 20:03:14 -0400 Subject: - Fixed some bugs. - new-luxc can now fully compile lux.lux! --- .../source/luxc/lang/translation/runtime.jvm.lux | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'new-luxc/source/luxc/lang/translation/runtime.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux index 0a330ab73..cc17014e1 100644 --- a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux @@ -386,6 +386,28 @@ $i;DRETURN))) ))) +(def: text-methods + $;Def + (|>. ($d;method #$;Public $;staticM "text_char" ($t;method (list $String $t;int) (#;Some $Variant) (list)) + (let [get-charI (|>. ($i;ALOAD +0) + ($i;ILOAD +1) + ($i;INVOKEVIRTUAL "java.lang.String" "codePointAt" ($t;method (list $t;int) (#;Some $t;int) (list)) false) + $i;I2L + ($i;wrap #$;Long))] + (<| $i;with-label (function [@from]) + $i;with-label (function [@to]) + $i;with-label (function [@handler]) + (|>. ($i;try @from @to @handler "java.lang.Exception") + ($i;label @from) + get-charI + someI + $i;ARETURN + ($i;label @to) + ($i;label @handler) + noneI + $i;ARETURN)))) + )) + (def: pm-methods $;Def (let [tuple-sizeI (|>. ($i;ALOAD +0) $i;ARRAYLENGTH) @@ -564,6 +586,7 @@ nat-methods frac-methods deg-methods + text-methods pm-methods io-methods))] _ (commonT;store-class hostL;runtime-class bytecode)] -- cgit v1.2.3