JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / com / stevesoft / pat / Group.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Group", ["com.stevesoft.pat.patInt"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.op = '\0';
5 this.cl = '\0';
6 Clazz.instantialize (this, arguments);
7 }, com.stevesoft.pat, "Group", com.stevesoft.pat.Pattern);
8 Clazz.makeConstructor (c$, 
9 function (opi, cli) {
10 Clazz.superConstructor (this, com.stevesoft.pat.Group, []);
11 this.op = opi;
12 this.cl = cli;
13 }, "~S,~S");
14 Clazz.overrideMethod (c$, "matchInternal", 
15 function (pos, pt) {
16 var i;
17 var count = 1;
18 if (pos < pt.src.length ()) {
19 if (!this.Masked (pos, pt) && pt.src.charAt (pos) != this.op) {
20 return -1;
21 }}for (i = pos + 1; i < pt.src.length (); i++) {
22 var c = pt.src.charAt (i);
23 var b = !this.Masked (i, pt);
24 if (b && c == '\\') {
25 i++;
26 } else {
27 if (b && c == this.cl) {
28 count--;
29 }if (count == 0) {
30 return this.nextMatch (i + 1, pt);
31 }if (b && c == this.op) {
32 count++;
33 }}}
34 return -1;
35 }, "~N,com.stevesoft.pat.Pthings");
36 Clazz.overrideMethod (c$, "toString", 
37 function () {
38 return "(?@" + this.op + this.cl + ")" + this.nextString ();
39 });
40 Clazz.overrideMethod (c$, "minChars", 
41 function () {
42 return  new com.stevesoft.pat.patInt (2);
43 });
44 Clazz.overrideMethod (c$, "clone1", 
45 function (h) {
46 return  new com.stevesoft.pat.Group (this.op, this.cl);
47 }, "java.util.Hashtable");
48 });