From 721e791b9273bb77b762a4dd48b085efc7bedd9b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 4 Apr 2019 21:09:12 -0400 Subject: Updated JVM compiler. --- .../lang/translation/jvm/procedure/common.jvm.lux | 38 ++++++++++------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/procedure') diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux index faec813e9..6f5fccf4e 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux @@ -103,10 +103,10 @@ ## Extensions ### Lux -(def: (lux::is [leftI rightI]) +(def: (lux::is [referenceI sampleI]) Binary - (|>> leftI - rightI + (|>> referenceI + sampleI (predicateI _.IF_ACMPEQ))) (def: (lux::try riskyI) @@ -155,7 +155,7 @@ ) (template [ ] - [(def: ( [subjectI paramI]) + [(def: ( [paramI subjectI]) Binary (|>> subjectI (_.unwrap ) paramI (_.unwrap ) @@ -177,7 +177,7 @@ (template [ ] [(template [ ] - [(def: ( [subjectI paramI]) + [(def: ( [paramI subjectI]) Binary (|>> subjectI paramI @@ -217,7 +217,7 @@ lux-intI)) (template [ ] - [(def: ( [subjectI paramI]) + [(def: ( [paramI subjectI]) Binary (|>> subjectI paramI @@ -229,28 +229,26 @@ [text::< ..check-stringI ..check-stringI (_.INVOKEVIRTUAL "java.lang.String" "compareTo" (_t.method (list $String) (#.Some _t.int) (list)) #0) (predicateI _.IFLT)] - [text::concat ..check-stringI ..check-stringI - (_.INVOKEVIRTUAL "java.lang.String" "concat" (_t.method (list $String) (#.Some $String) (list)) #0) - (<|)] [text::char ..check-stringI jvm-intI (_.INVOKEVIRTUAL "java.lang.String" "charAt" (_t.method (list _t.int) (#.Some _t.char) (list)) #0) lux-intI] ) -(template [ ] - [(def: ( [subjectI paramI extraI]) - Trinary - (|>> subjectI - paramI - extraI - ))] +(def: (text::concat [leftI rightI]) + Binary + (|>> leftI ..check-stringI + rightI ..check-stringI + (_.INVOKEVIRTUAL "java.lang.String" "concat" (_t.method (list $String) (#.Some $String) (list)) #0))) - [text::clip ..check-stringI jvm-intI jvm-intI - (_.INVOKEVIRTUAL "java.lang.String" "substring" (_t.method (list _t.int _t.int) (#.Some $String) (list)) #0)] - ) +(def: (text::clip [startI endI subjectI]) + Trinary + (|>> subjectI ..check-stringI + startI jvm-intI + endI jvm-intI + (_.INVOKEVIRTUAL "java.lang.String" "substring" (_t.method (list _t.int _t.int) (#.Some $String) (list)) #0))) (def: index-method Method (_t.method (list $String _t.int) (#.Some _t.int) (list))) -(def: (text::index [textI partI startI]) +(def: (text::index [startI partI textI]) Trinary (<| _.with-label (function (_ @not-found)) _.with-label (function (_ @end)) -- cgit v1.2.3