diff options
author | Eduardo Julián | 2019-04-04 21:10:23 -0400 |
---|---|---|
committer | GitHub | 2019-04-04 21:10:23 -0400 |
commit | 0416ecd9dd79ea8a2d536c11596fc5c60679f6e2 (patch) | |
tree | 9ac14be1804e9ba53fd5899ff161d028f7499ff4 /new-luxc/source/luxc/lang | |
parent | b4c19578ca9d91c34c5aaba567fadb028a1ec877 (diff) | |
parent | 721e791b9273bb77b762a4dd48b085efc7bedd9b (diff) |
Merge pull request #49 from LuxLang/change-order-of-parameters-in-extensions
Change order of parameters in extensions
Diffstat (limited to 'new-luxc/source/luxc/lang')
-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)) |