aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2019-04-04 21:09:12 -0400
committerEduardo Julian2019-04-04 21:09:12 -0400
commit721e791b9273bb77b762a4dd48b085efc7bedd9b (patch)
tree9ac14be1804e9ba53fd5899ff161d028f7499ff4
parente45c856bad7f0dd2dfdd32d4d99b951715e3b267 (diff)
Updated JVM compiler.
-rw-r--r--.gitignore1
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux38
2 files changed, 19 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index d55202a8b..9fa81e94a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ pom.xml.asc
/new-luxc/target
/new-luxc/source/lux.lux
/new-luxc/source/lux
+/new-luxc/source/program
/lux-js/target
/lux-js/source/lux.lux
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))