From 686a46f569b818681583e6ce75b37b25642b375b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Nov 2017 14:59:45 -0400 Subject: - Removed "lux text last-index" procedure. - Removed "lux text trim" procedure. - Modified "lux text clip" procedure. - Some bug fixes. --- .../source/luxc/lang/translation/procedure/common.jvm.lux | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/procedure') 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)) )) -- cgit v1.2.3