diff options
Diffstat (limited to 'new-luxc/source')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux | 38 |
1 files changed, 18 insertions, 20 deletions
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 [<name> <type> <op>] - [(def: (<name> [subjectI paramI]) + [(def: (<name> [paramI subjectI]) Binary (|>> subjectI (_.unwrap <type>) paramI (_.unwrap <type>) @@ -177,7 +177,7 @@ (template [<eq> <lt> <unwrap> <cmp>] [(template [<name> <reference>] - [(def: (<name> [subjectI paramI]) + [(def: (<name> [paramI subjectI]) Binary (|>> subjectI <unwrap> paramI <unwrap> @@ -217,7 +217,7 @@ lux-intI)) (template [<name> <pre-subject> <pre-param> <op> <post>] - [(def: (<name> [subjectI paramI]) + [(def: (<name> [paramI subjectI]) Binary (|>> subjectI <pre-subject> paramI <pre-param> @@ -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 [<name> <pre-subject> <pre-param> <pre-extra> <op>] - [(def: (<name> [subjectI paramI extraI]) - Trinary - (|>> subjectI <pre-subject> - paramI <pre-param> - extraI <pre-extra> - <op>))] +(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)) |