X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSRegexp.java;h=d352ce659e41ab2fccbb692d6815b5b7853f8093;hb=a19b897271a8ab6b25aba63e4b30223c2477c28d;hp=00a6f40a12cecbe06d606a20aeb430351c40c8db;hpb=2d6763644359578428d56d004b998edd10463a84;p=org.ibex.core.git diff --git a/src/org/ibex/js/JSRegexp.java b/src/org/ibex/js/JSRegexp.java index 00a6f40..d352ce6 100644 --- a/src/org/ibex/js/JSRegexp.java +++ b/src/org/ibex/js/JSRegexp.java @@ -4,7 +4,7 @@ package org.ibex.js; import gnu.regexp.*; /** A JavaScript regular expression object */ -public class JSRegexp extends JS { +class JSRegexp extends JS { private boolean global; private RE re; private int lastIndex; @@ -127,7 +127,7 @@ public class JSRegexp extends JS { return sb.toString(); } - public static JS stringMatch(JS o, JS arg0) throws JSExn { + static JS stringMatch(JS o, JS arg0) throws JSExn { String s = JS.toString(o); RE re; JSRegexp regexp = null; @@ -151,14 +151,14 @@ public class JSRegexp extends JS { return ret; } - public static JS stringSearch(JS o, JS arg0) throws JSExn { + static JS stringSearch(JS o, JS arg0) throws JSExn { String s = JS.toString(o); RE re = arg0 instanceof JSRegexp ? ((JSRegexp)arg0).re : newRE(JS.toString(arg0),0); REMatch match = re.getMatch(s); return match == null ? N(-1) : N(match.getStartIndex()); } - public static JS stringReplace(JS o, JS arg0, JS arg1) throws JSExn { + static JS stringReplace(JS o, JS arg0, JS arg1) throws JSExn { String s = JS.toString(o); RE re; JSFunction replaceFunc = null; @@ -279,7 +279,7 @@ public class JSRegexp extends JS { } - public static JS stringSplit(JS s_, JS arg0, JS arg1, int nargs) throws JSExn { + static JS stringSplit(JS s_, JS arg0, JS arg1, int nargs) throws JSExn { String s = JS.toString(s_); int limit = nargs < 2 ? Integer.MAX_VALUE : JS.toInt(arg1); if(limit < 0) limit = Integer.MAX_VALUE; @@ -333,7 +333,7 @@ public class JSRegexp extends JS { return ret; } - public static RE newRE(String pattern, int flags) throws JSExn { + private static RE newRE(String pattern, int flags) throws JSExn { try { return new RE(pattern,flags,RESyntax.RE_SYNTAX_PERL5); } catch(REException e) {