1 Clazz.declarePackage ("com.stevesoft.pat");
\r
2 Clazz.load (["com.stevesoft.pat.Pattern", "$.RegSyntax"], ["com.stevesoft.pat.BadRangeArgs", "$.Range"], ["com.stevesoft.pat.RegSyntaxError", "$.oneChar", "$.patInt"], function () {
\r
3 c$ = Clazz.declareType (com.stevesoft.pat, "BadRangeArgs", com.stevesoft.pat.RegSyntax);
\r
4 c$ = Clazz.decorateAsClass (function () {
\r
9 this.printBrackets = false;
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, com.stevesoft.pat, "Range", com.stevesoft.pat.Pattern);
\r
12 Clazz.overrideMethod (c$, "toString",
\r
14 var s = com.stevesoft.pat.Pattern.protect ("" + this.lo, "[]{}(),$,-\"^.", '\\') + "-" + com.stevesoft.pat.Pattern.protect ("" + this.hi, "[]{}(),$,-\"^.", '\\');
\r
15 if (!this.printBrackets) {
\r
17 }return "[" + s + "]";
\r
19 Clazz.makeConstructor (c$,
\r
20 function (loi, hii) {
\r
21 Clazz.superConstructor (this, com.stevesoft.pat.Range, []);
\r
25 if (this.lo >= this.hi) {
\r
26 com.stevesoft.pat.RegSyntaxError.endItAll ("Badly formed []'s : " + this.lo + " >= " + this.hi);
\r
27 }o = new com.stevesoft.pat.oneChar (this.lo);
\r
28 this.altlo = o.altc;
\r
29 o = new com.stevesoft.pat.oneChar (this.hi);
\r
30 this.althi = o.altc;
\r
32 Clazz.overrideMethod (c$, "matchInternal",
\r
33 function (pos, pt) {
\r
34 if (pos >= pt.src.length ()) {
\r
36 }if (this.Masked (pos, pt)) {
\r
38 }var c = pt.src.charAt (pos);
\r
39 if (this.lo <= c && c <= this.hi || (pt.ignoreCase && (this.altlo <= c && c <= this.althi))) {
\r
40 return this.nextMatch (pos + 1, pt);
\r
42 }, "~N,com.stevesoft.pat.Pthings");
\r
43 Clazz.overrideMethod (c$, "minChars",
\r
45 return new com.stevesoft.pat.patInt (1);
\r
47 Clazz.overrideMethod (c$, "maxChars",
\r
49 return new com.stevesoft.pat.patInt (1);
\r
51 Clazz.overrideMethod (c$, "clone1",
\r
54 var r = new com.stevesoft.pat.Range (this.lo, this.hi);
\r
55 r.printBrackets = this.printBrackets;
\r
58 if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
\r
64 }, "java.util.Hashtable");
\r