aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation
diff options
context:
space:
mode:
authorEduardo Julian2017-11-14 14:59:45 -0400
committerEduardo Julian2017-11-14 14:59:45 -0400
commit686a46f569b818681583e6ce75b37b25642b375b (patch)
treeee3c9d368ad6c89ce1475c34a2dc87e860f33279 /new-luxc/source/luxc/lang/translation
parent72603f38074a67f9ab1e53df1b5fb5da3836162d (diff)
- Removed "lux text last-index" procedure.
- Removed "lux text trim" procedure. - Modified "lux text clip" procedure. - Some bug fixes.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation')
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux15
1 files changed, 12 insertions, 3 deletions
diff --git a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
index 2cdf65e32..e680c46e8 100644
--- a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
@@ -423,8 +423,16 @@
[text//clip ($i;CHECKCAST "java.lang.String") jvm-intI jvm-intI
($i;INVOKESTATIC hostL;runtime-class "text_clip"
($t;method (list $String $t;int $t;int) (#;Some $Object-Array) (list)) false)]
- [text//replace ($i;CHECKCAST "java.lang.String") ($i;CHECKCAST "java.lang.String") ($i;CHECKCAST "java.lang.String")
- ($i;INVOKEVIRTUAL "java.lang.String" "replace" ($t;method (list $CharSequence $CharSequence) (#;Some $String) (list)) false)]
+ [text//replace-once ($i;CHECKCAST "java.lang.String")
+ (<| ($i;INVOKESTATIC "java.util.regex.Pattern" "quote" ($t;method (list $String) (#;Some $String) (list)) false)
+ ($i;CHECKCAST "java.lang.String"))
+ ($i;CHECKCAST "java.lang.String")
+ ($i;INVOKEVIRTUAL "java.lang.String" "replaceFirst" ($t;method (list $String $String) (#;Some $String) (list)) false)]
+ [text//replace-all ($i;CHECKCAST "java.lang.String")
+ (<| ($i;INVOKESTATIC "java.util.regex.Pattern" "quote" ($t;method (list $String) (#;Some $String) (list)) false)
+ ($i;CHECKCAST "java.lang.String"))
+ ($i;CHECKCAST "java.lang.String")
+ ($i;INVOKEVIRTUAL "java.lang.String" "replaceAll" ($t;method (list $String $String) (#;Some $String) (list)) false)]
)
(def: index-method $;Method ($t;method (list $String $t;int) (#;Some $t;int) (list)))
@@ -674,7 +682,8 @@
(install "text index" (trinary text//index))
(install "text size" (unary text//size))
(install "text hash" (unary text//hash))
- (install "text replace" (trinary text//replace))
+ (install "text replace-once" (trinary text//replace-once))
+ (install "text replace-all" (trinary text//replace-all))
(install "text char" (binary text//char))
(install "text clip" (trinary text//clip))
))