X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fcom%2Fstevesoft%2Fpat%2FRange.js;h=8294a31e88e1ca5df6a3251014764da600bb1392;hp=cb007c4aa74a59a47bc48f5c566cd97cb2235db7;hb=7301a2415adab88038b291fc54caeeb3a5a47a44;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/com/stevesoft/pat/Range.js b/bin/com/stevesoft/pat/Range.js index cb007c4..8294a31 100644 --- a/bin/com/stevesoft/pat/Range.js +++ b/bin/com/stevesoft/pat/Range.js @@ -1,65 +1,65 @@ -Clazz.declarePackage ("com.stevesoft.pat"); -Clazz.load (["com.stevesoft.pat.Pattern", "$.RegSyntax"], ["com.stevesoft.pat.BadRangeArgs", "$.Range"], ["com.stevesoft.pat.RegSyntaxError", "$.oneChar", "$.patInt"], function () { -c$ = Clazz.declareType (com.stevesoft.pat, "BadRangeArgs", com.stevesoft.pat.RegSyntax); -c$ = Clazz.decorateAsClass (function () { -this.lo = '\0'; -this.hi = '\0'; -this.altlo = '\0'; -this.althi = '\0'; -this.printBrackets = false; -Clazz.instantialize (this, arguments); -}, com.stevesoft.pat, "Range", com.stevesoft.pat.Pattern); -Clazz.overrideMethod (c$, "toString", -function () { -var s = com.stevesoft.pat.Pattern.protect ("" + this.lo, "[]{}(),$,-\"^.", '\\') + "-" + com.stevesoft.pat.Pattern.protect ("" + this.hi, "[]{}(),$,-\"^.", '\\'); -if (!this.printBrackets) { -return s; -}return "[" + s + "]"; -}); -Clazz.makeConstructor (c$, -function (loi, hii) { -Clazz.superConstructor (this, com.stevesoft.pat.Range, []); -this.lo = loi; -this.hi = hii; -var o = null; -if (this.lo >= this.hi) { -com.stevesoft.pat.RegSyntaxError.endItAll ("Badly formed []'s : " + this.lo + " >= " + this.hi); -}o = new com.stevesoft.pat.oneChar (this.lo); -this.altlo = o.altc; -o = new com.stevesoft.pat.oneChar (this.hi); -this.althi = o.altc; -}, "~S,~S"); -Clazz.overrideMethod (c$, "matchInternal", -function (pos, pt) { -if (pos >= pt.src.length ()) { -return -1; -}if (this.Masked (pos, pt)) { -return -1; -}var c = pt.src.charAt (pos); -if (this.lo <= c && c <= this.hi || (pt.ignoreCase && (this.altlo <= c && c <= this.althi))) { -return this.nextMatch (pos + 1, pt); -}return -1; -}, "~N,com.stevesoft.pat.Pthings"); -Clazz.overrideMethod (c$, "minChars", -function () { -return new com.stevesoft.pat.patInt (1); -}); -Clazz.overrideMethod (c$, "maxChars", -function () { -return new com.stevesoft.pat.patInt (1); -}); -Clazz.overrideMethod (c$, "clone1", -function (h) { -try { -var r = new com.stevesoft.pat.Range (this.lo, this.hi); -r.printBrackets = this.printBrackets; -return r; -} catch (rs) { -if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) { -return null; -} else { -throw rs; -} -} -}, "java.util.Hashtable"); -}); +Clazz.declarePackage ("com.stevesoft.pat"); +Clazz.load (["com.stevesoft.pat.Pattern", "$.RegSyntax"], ["com.stevesoft.pat.BadRangeArgs", "$.Range"], ["com.stevesoft.pat.RegSyntaxError", "$.oneChar", "$.patInt"], function () { +c$ = Clazz.declareType (com.stevesoft.pat, "BadRangeArgs", com.stevesoft.pat.RegSyntax); +c$ = Clazz.decorateAsClass (function () { +this.lo = '\0'; +this.hi = '\0'; +this.altlo = '\0'; +this.althi = '\0'; +this.printBrackets = false; +Clazz.instantialize (this, arguments); +}, com.stevesoft.pat, "Range", com.stevesoft.pat.Pattern); +Clazz.overrideMethod (c$, "toString", +function () { +var s = com.stevesoft.pat.Pattern.protect ("" + this.lo, "[]{}(),$,-\"^.", '\\') + "-" + com.stevesoft.pat.Pattern.protect ("" + this.hi, "[]{}(),$,-\"^.", '\\'); +if (!this.printBrackets) { +return s; +}return "[" + s + "]"; +}); +Clazz.makeConstructor (c$, +function (loi, hii) { +Clazz.superConstructor (this, com.stevesoft.pat.Range, []); +this.lo = loi; +this.hi = hii; +var o = null; +if (this.lo >= this.hi) { +com.stevesoft.pat.RegSyntaxError.endItAll ("Badly formed []'s : " + this.lo + " >= " + this.hi); +}o = new com.stevesoft.pat.oneChar (this.lo); +this.altlo = o.altc; +o = new com.stevesoft.pat.oneChar (this.hi); +this.althi = o.altc; +}, "~S,~S"); +Clazz.overrideMethod (c$, "matchInternal", +function (pos, pt) { +if (pos >= pt.src.length ()) { +return -1; +}if (this.Masked (pos, pt)) { +return -1; +}var c = pt.src.charAt (pos); +if (this.lo <= c && c <= this.hi || (pt.ignoreCase && (this.altlo <= c && c <= this.althi))) { +return this.nextMatch (pos + 1, pt); +}return -1; +}, "~N,com.stevesoft.pat.Pthings"); +Clazz.overrideMethod (c$, "minChars", +function () { +return new com.stevesoft.pat.patInt (1); +}); +Clazz.overrideMethod (c$, "maxChars", +function () { +return new com.stevesoft.pat.patInt (1); +}); +Clazz.overrideMethod (c$, "clone1", +function (h) { +try { +var r = new com.stevesoft.pat.Range (this.lo, this.hi); +r.printBrackets = this.printBrackets; +return r; +} catch (rs) { +if (Clazz.exceptionOf (rs, com.stevesoft.pat.RegSyntax)) { +return null; +} else { +throw rs; +} +} +}, "java.util.Hashtable"); +});