-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (40 loc) · 19.5 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(g,n,e){if(e.get||e.set)throw new TypeError("ES3 does not support getters and setters.");g!=Array.prototype&&g!=Object.prototype&&(g[n]=e.value)};$jscomp.getGlobal=function(g){return"undefined"!=typeof window&&window===g?g:"undefined"!=typeof global&&null!=global?global:g};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(g){return $jscomp.SYMBOL_PREFIX+(g||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var g=$jscomp.global.Symbol.iterator;g||(g=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[g]&&$jscomp.defineProperty(Array.prototype,g,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(g){var n=0;return $jscomp.iteratorPrototype(function(){return n<g.length?{done:!1,value:g[n++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(g){$jscomp.initSymbolIterator();g={next:g};g[$jscomp.global.Symbol.iterator]=function(){return this};return g};$jscomp.makeIterator=function(g){$jscomp.initSymbolIterator();$jscomp.initSymbol();$jscomp.initSymbolIterator();var n=g[Symbol.iterator];return n?n.call(g):$jscomp.arrayIterator(g)};$jscomp.arrayFromIterator=function(g){for(var n,e=[];!(n=g.next()).done;)e.push(n.value);return e};$jscomp.arrayFromIterable=function(g){return g instanceof Array?g:$jscomp.arrayFromIterator($jscomp.makeIterator(g))};
(function(){function g(c,e,b){c.every(function(a){return a.name!==e})&&c.push({name:e,shallow:b})}function n(c,e){for(var b=[];c!==e;)c.type===F&&g(b,c.name,c.shallow),c.type===G||c.type===H||c.type===I||c.type===J?(c.props.forEach(function(a){return g(b,a.name,a.shallow)}),c=c.end):c=c.next;return b}function e(c,t){for(var b=[],a=1;a<arguments.length;++a)b[a-1]=arguments[a];switch(c){case "alternation":var a=$jscomp.makeIterator(b),b=a.next().value,K=a.next().value,z=[],A={type:P,props:z,next:null,
prev:null},u={type:J,props:z,end:A,next:null,prev:null},a=function(){var a=[];K.forEach(function(b){b.first.type===J&&b.first.end===b.last?b.first.next.forEach(function(c,r){return a.push({first:c,last:b.last.prev[r],matchable:!0})}):a.push(b)});return a}(),k=a.filter(function(a){return a.matchable});a.forEach(function(a){return n(a.first,a.last).forEach(function(a){return g(z,a.name,a.shallow)})});if((1===k.length&&0===z.length||0===a.length)&&!b)return k[0];k.forEach(function(a){return a.first.prev=
u,a.last.next=A});u.next=k.map(function(a){return a.first});A.prev=k.map(function(a){return a.last});return{first:u,last:A,matchable:0!==k.length};case "assertion":var p=$jscomp.makeIterator(b),a=p.next().value,k=p.next().value,v=p.next().value,b=p.next().value,p=p.next().value,q={type:R,name:a,dimensions:k,condition:v,then:b.first,thenNot:p.first,prev:null},a={type:S,name:a,dimensions:k,condition:v,then:b.last,thenNot:p.last,next:null};b.first.prev=q;p.first.prev=q;b.last.next=a;p.last.next=a;return{first:q,
last:a,matchable:b.matchable||p.matchable};case "backreference":return a=$jscomp.makeIterator(b),b=a.next().value,a=a.next().value,b={type:T,name:b,dimensions:a,next:null,prev:null},{first:b,last:b,matchable:!0};case "captrGroup":a=$jscomp.makeIterator(b);b=a.next().value;k=a.next().value;a=a.next().value;k={type:F,name:b,objName:a.first.type===M?a.first.name:null,shallow:k,next:a.first,prev:null};v={type:U,next:null,prev:a.last};if("loc"===b||"input"===b||"name"===b)throw Error('Capturing group cannot be named "'+
b+'".');a.first.prev=k;a.last.next=v;return{first:k,last:v,matchable:a.matchable};case "group":return b=$jscomp.makeIterator(b).next().value,b={type:C,arr:b,next:null,prev:null},{first:b,last:b,matchable:!0};case "lookahead":v=$jscomp.makeIterator(b);b=v.next().value;a=v.next().value;k=v.next().value;v=v.next().value;p={type:N,condition:b,negated:!1,lookbehind:v,next:null,prev:null};q={type:N,condition:b,negated:!0,lookbehind:v,next:null,prev:null};if(v)return p.next=a.first,a.first.prev=p,q.next=
k.first,k.first.prev=q,e("alternative",!1,!1,[{first:p,last:a.last,matchable:b.matchable&&a.matchable},{first:q,last:k.last,matchable:k.matchable}]);a.last.next=p;p.prev=a.last;k.last.next=q;q.prev=k.last;return e("alternative",!1,!1,[{first:a.first,last:p,matchable:a.matchable&&b.matchable},{first:k.first,last:q,matchable:k.matchable}]);case "subroutine":return b=$jscomp.makeIterator(b).next().value,b={type:M,name:b,next:null,prev:null},{first:b,last:b,matchable:!0};case "quantifier":var q=$jscomp.makeIterator(b),
p=q.next().value,a=q.next().value,k=q.next().value,v=q.next().value,b=q.next().value,q=q.next().value,x=n(b.first,b.last),p={type:p,min:k,max:v,props:x,special:q,end:null,next:b.first,prev:null},a={type:a,min:k,max:v,props:x,special:q,start:p,next:null,prev:b.last};p.end=a;b.first.prev=p;b.last.next=a;return{first:p,last:a,matchable:b.matchable}}}function D(c){var t=c.toUpperCase()===c;switch(c){case "d":case "D":return{min:"0",max:"9",negated:t};case "w":return e("alternation",!1,[e("group",["_"]),
e("group",[{min:"a",max:"z",negated:!1}]),e("group",[{min:"A",max:"Z",negated:!1}]),e("group",[{min:"0",max:"9",negated:!1}])]);case "W":return["_",{min:"a",max:"z",negated:!1},{min:"A",max:"Z",negated:!1},{min:"0",max:"9",negated:!1}];case "s":return e("alternation",!1,[e("group",["\n"]),e("group",["\r"]),e("group",["\t"]),e("group",[" "]),e("group",["\u00a0"]),e("group",["\u1680"]),e("group",["\u180e"]),e("group",[{min:"\u8192",max:"\u8202",negated:!1}]),e("group",["\u2028"]),e("group",["\u2029"]),
e("group",["\u202f"]),e("group",["\u205f"]),e("group",["\u3000"]),e("group",["\ufeff"])]);case "S":return["\n","\r","\t","\u00a0","\u1680","\u180e",{min:"\u8192",max:"\u8202",negated:!1},"\u2028","\u2029","\u202f","\u205f","\u3000","\ufeff"];case "l":return e("alternation",!1,[e("group",["\n"]),e("group",["\r"]),e("group",["\u2028"]),e("group",["\u2029"])]);case "L":return["\n","\r","\t","\u2028","\u2029"];case "n":return"\n";case "N":return{min:"\n",max:"\n",negated:!0};case "r":return"\r";case "R":return{min:"\r",
max:"\r",negated:!0};case "t":return"\t";case "T":return{min:"\t",max:"\t",negated:!0};case "a":return V;case "z":return W;case "`":return X;case "'":return Y;default:return null}}0;var y="undefined"!==typeof window,E="object"!==typeof exports||"undefined"!==typeof window&&exports===window.exports?{}:exports;E["default"]=E;y&&(window.RegeRex=E);$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();
$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();var Z=Symbol("startLine"),aa=Symbol("endLine"),V=Symbol("startString"),W=Symbol("endString"),X=Symbol("startPosition"),Y=Symbol("endPosition"),ba=
Symbol("wordBoundary"),J=Symbol("alternationStart"),P=Symbol("alternationEnd"),R=Symbol("assertionStart"),S=Symbol("assertionEnd"),T=Symbol("backreference"),F=Symbol("capturingGroupStart"),U=Symbol("capturingGroupEnd"),N=Symbol("conditionCheck"),C=Symbol("group"),G=Symbol("greedyStart"),O=Symbol("greedyEnd"),H=Symbol("possesiveStart"),ca=Symbol("possesiveEnd"),I=Symbol("lazyStart"),da=Symbol("lazyEnd"),M=Symbol("subroutine"),ea=Symbol("quantifierBreak"),fa=Symbol("quantifierNested");D.l=new Set(["\n",
"\r","\u2028","\u2029"]);var ha=new Set("[]()^$|\\*+?{}".split("")),y=function(c,e){e=void 0===e?!1:e;if("string"!==typeof c)throw Error("Name must be a string");this.regexMap=new Map;this.name=c;this.trackLines=!!e};y.prototype.add=function(c){"string"===typeof c&&(c=new ga(c));if(!(c instanceof ga))throw Error("Argument regex must be a string or an instance of Regex.");if(this.regexMap.has(c.name))throw Error('Regex "'+c.name+'" already exists.');this.regexMap.set(c.name,c);return this};y.prototype.match=
function(c,e,b,a){function g(a){switch(a){case "subroutine":return 0===k.length?null:k[k.length-1];case "quantifier":a=g("subroutine");if(null===a)return null;a=a.quantifierOpenStack;return 0===a.length?null:a[a.length-1];case "captrGroup":a=g("quantifier");if(null===a)return null;a=a.captrGroupOpenStack;return 0===a.length?null:a[a.length-1]}}function z(a,b){b=void 0===b?!1:b;switch(a){case "subroutine":if(b){var c=p.pop();return k.push(c),c}c=k.pop();return p.push(c),c;case "quantifier":c=g("subroutine");
if(b){var f=c.quantifierClosedStack.pop();return c.quantifierOpenStack.push(f),f}f=c.quantifierOpenStack.pop();return c.quantifierClosedStack.push(f),f;case "captrGroup":c=g("quantifier");if(b)return f=c.captrGroupClosedStack.pop(),c.captrGroupOpenStack.push(f),f;f=c.captrGroupOpenStack.pop();return c.captrGroupClosedStack.push(f),f}}function A(a,b){for(var c=[],f=1;f<arguments.length;++f)c[f-1]=arguments[f];switch(a){case "quantifier":f=g(a);if(0===c.length)return 0===f.end&&(g("subroutine").quantifierOpenStack.pop(),
f=g(a)),f&&f.captrGroupClosedStack.pop(),f;f&&f.captrGroupClosedStack.push(f.start===f.end?ea:fa);if(!f||f.start!==f.end){var e=$jscomp.makeIterator(c),f=e.next().value,c=e.next().value,d=e.next().value,e=e.next().value,h=g("subroutine");h.quantifierOpenStack.push(f={captrGroupOpenStack:[],captrGroupClosedStack:[],start:d,end:e,props:f,special:c,flag:!0,depth:h.quantifierOpenStack.length})}return f;case "captrGroup":f=g("quantifier");if(0===c.length)return f.captrGroupOpenStack.pop();h=$jscomp.makeIterator(c);
c=h.next().value;d=h.next().value;e=h.next().value;h=h.next().value;c={name:c,objName:d,shallow:e,posStart:h,posEnd:0};return f.captrGroupOpenStack.push(c),c}}function u(d,h,l,f){if(null===f){if(null===g("subroutine")){var r=function(a){var b=a.sub,c=a.children,d=[{props:[],qIndex:0}],e=0;b.quantifierClosedStack.forEach(function(a){function f(b,c){var d=g[b];switch(k[b]){case 0:a.special?g[b]=c:d.push(c);break;case 1:a.special?g[b]=[g[b],c]:d[d.length-1]=[d[d.length-1],c];break;default:a.special?
d.push(c):d[d.length-1].push(c)}k[b]++}var h=0,g={},k={};a.props.forEach(function(c){if(c.shallow)return c.name in b.retObj||(b.retObj[c.name]=[]);k[c.name]=0;g[c.name]=a.special?null:[]});a.captrGroupClosedStack.forEach(function(g){if(g===ea)return a.props.forEach(function(a){return k[a.name]=0});if(g===fa){var p=d[e].props[d[e].qIndex++];return Object.keys(p).forEach(function(a){return f(a,p[a])})}var m=g.name,l=g.objName,q=g.shallow,t=g.posStart;g=g.posEnd;if(null===l)l=x.substring(t,g);else{for(;c[h].sub.retObj.name!==
l;)h++;l=r(c[h++])}if(q)return m in b.retObj?b.retObj[m].push(l):b.retObj[m]=[l];f(m,l)});if(e===a.depth)d[e].props.push(g);else if(e>a.depth)d[e]={props:[],qIndex:0},d[a.depth].props.push(g);else if(e<a.depth){for(;d.length<=a.depth;)d.push({props:[],qIndex:0});d[a.depth].props.push(g)}e=a.depth});return Object.assign(d[0].props[0],b.retObj)},t=[[]],n=0;p.forEach(function(a){if(a.depth===n)t[n].push({sub:a,children:[]});else if(a.depth<n)t[a.depth].push({sub:a,children:t[n]}),t[n]=[];else{for(;t.length<=
a.depth;)t.push([]);t[a.depth].push({sub:a,children:[]})}n=a.depth});return r(t[0][0])}var m=z("subroutine"),w=m.retObj,K=m.next,Q=g("subroutine"),m=c,w=w.loc.end;w.pos=(a&&(w.line=h,w.column=l),d);c=Q&&Q.ignoreCase?q:x;w=u(d,h,l,K);return w||(z("subroutine",!0),c=m),w}f.type===S&&(f=f.next);switch(f.type){case R:throw Error("Not implemented yet, see issue #1.");case J:for(m=0;m<f.next.length;m++){A("quantifier",f.props,!0,1,0);if(w=u(d,h,l,f.next[m]))return w;A("quantifier")}return null;case P:return z("quantifier"),
m=u(d,h,l,f.next),m||z("quantifier",!0),m;case T:throw Error("Not implemented yet, see issue # 2.");case F:return A("captrGroup",f.name,f.objName,f.shallow,d),m=u(d,h,l,f.next),m||A("captrGroup"),m;case U:return z("captrGroup").posEnd=d,m=u(d,h,l,f.next),m||z("captrGroup",!0),m;case N:return m=condition.lookbehind?u(d,h,l,f.condition):matchBackwards(d,h,l,f.condition),(f.negated?!m:m)?u(d,h,l,f.next):null;case G:case H:case I:var m=function(){if((f.type!==H||y.flag)&&y.start>=f.min){y.flag=!1;z("quantifier");
var a=u(d,h,l,f.end.next);return a||z("quantifier",!0),a}return null},w=function(){if(y.start<f.max){y.start++;var a=u(d,h,l,f.next);return a||y.start--,a}return null},y=A("quantifier",f.props,f.special,0,0),m=f.type===I?m()||w():w()||m();return m||A("quantifier"),m;case O:case ca:case da:return m=g("quantifier"),m.end++,w=u(d,h,l,f.start),w||m.end--,w;case C:var L,B=0<d?c.charAt(d-1):null;return f.arr.every(function(a){L=B;B=c.charAt(d++);if("symbol"===typeof a){var f;switch(a){case Z:f=D.l.has(L);
break;case aa:f=D.l.has(B);break;case V:f=1===d;break;case W:f=d===c.length+1;break;case X:f=d===e+1;break;case Y:f=d===b;break;case ba:throw Error("Not implemented yet, see issue #3.");}return f?(d--,B=L,!0):!1}if(d>b)return!1;D.l.has(B)?(h++,l=0):l++;return a instanceof Array?a.every(function(a){if("string"===typeof a)return a!==B;var b=B<a.min||B>a.max;return a.negated?!b:b}):"object"===typeof a?(f=a.min<=B&&B<=a.max,a.negated?!f:f):B===a})?u(d,h,l,f.next):null;case M:m=v.get(f.name);if(!m)throw Error('Unknown subroutine "'+
f.name+'".');w={retObj:{input:x,loc:{start:{pos:null,line:null,column:null},end:{pos:null,line:null,column:null}},name:m.name},quantifierOpenStack:[],quantifierClosedStack:[],ignoreCase:m.ignoreCase,next:f.next,depth:k.length};k.push(w);w=w.retObj.loc.start;w.pos=(a&&(w.line=h,w.column=l),d);m.ignoreCase&&null===q&&(q=c.toLowerCase());c=m.ignoreCase?q:x;m=u(d,h,l,m.parsed.first);return m||k.pop(),m}}e=void 0===e?0:e;b=void 0===b?c.length:b;a=void 0===a?this.trackLines:a;2===arguments.length&&"boolean"===
typeof e&&(a=e,e=0);3===arguments.length&&"boolean"===typeof b&&(a=b,b=c.length);if("string"!==typeof c)throw Error("Parameter 'str' must be a string.");if("number"!==typeof e||0!==e%1||0>e)throw Error("Invalid parameter 'start'.");if("number"!==typeof b||0!==b%1)throw Error("Invalid parameter 'start'.");if(e>c.length)return null;b>c.length&&(b=c.length);a=!!a;var k=[],p=[],v=this.regexMap,q=null,x=c,t=0,n=0;if(!this.regexMap.has(this.name))throw Error("Default regex is required to start matching");
if(a)for(var d=0;d<e;d++)n++,D.l.has(c.charAt(d))&&(n=0,t++);for(;e<b;){if(d=u(e,t,n,this.regexMap.get(this.name).parsed.subroutine))return d;n++;D.l.has(c.charAt(e++))&&(n=0,t++)}return null};y.prototype.replace=function(c,e,b,a){throw Error("Not implemented yet.");};y.prototype.matchAll=function(c,e,b,a){function g(g,k){for(;;)switch(t){case 0:a=void 0===a?u.trackLines:a,n=null;case 1:if(!(n=u.match(c,e,b,a))){t=2;break}t=3;return{value:n,done:!1};case 3:if(void 0===k){t=4;break}t=-1;throw k;case 4:e=
n.loc.end.pos;t=1;break;case 2:return t=-1,{value:n,done:!0};default:return{value:void 0,done:!0}}}var t=0,n,u=this,k={next:function(a){return g(a,void 0)},"throw":function(a){return g(void 0,a)},"return":function(a){throw Error("Not yet implemented");}};$jscomp.initSymbolIterator();k[Symbol.iterator]=function(){return this};return k};E.RegexGroup=y;var ga=E.Regex=function(c){function g(n,t){function k(d){for(var e="";(a=c.charAt(b++)).match(/[A-Za-z_]/);)e+=a;if(!d.includes(a)||""===e)throw Error(""===
a?"Unexpected end of string.":b-1+": Invalid character:"+a);return e}function p(d){var e=null,f=!1;"-"===c.charAt(b)&&(f=!0,b++);for(;(a=c.charAt(b++)).match(/\d/);)e=null===e?+a:+a+10*e;if(!d.includes(a)||f&&null===e)throw Error(""===a?"Unexpected end of string.":b-1+": Invalid character:"+a);if(f&&0===e)throw Error("Zero cannot be negative");return f?-1*e:e}t=void 0===t?!1:t;for(var v=new Map,q=null,x=null,u=!0,y={};a=c.charAt(b++);){var d=void 0;switch(a){case "^":d=Z;break;case "$":d=aa;break;
case "|":d=ba;break;case "\\":a=c.charAt(b++);if(""===a)throw Error("Unexpected end of string.");if(d=D(a)||(ha.has(a)||n.includes(a))&&(d=a))break;switch(a){case "u":d=c.substring(b,b+3).match(/\{([0-9a-f]{4,5})\}/);if(!d)throw Error(b+": Invalid escape sequance.");d=String.fromCharCode(parseInt(d[1],16));break;default:throw Error(b-1+": Unknown escape character: "+a);}break;case ")":case "]":case "}":case ":":case "<":case ">":if(n.includes(a))return q||(q=x={type:C,arr:[],next:null,prev:null}),
{first:q,last:x,matchable:u};if(")]}".includes(a))throw Error(b-1+": Unmatched brace/bracket/parenthesis.");d=a;break;case "*":case "+":case "?":case "{":throw Error(b-1+"Unescaped special character: "+a);default:d=z?a.toLowerCase():a;break;case "(":a=c.charAt(b++);if(!a)throw Error("Unexpected end of string.");switch(a){default:b--;d=g(")");break;case "=":for(var r=k(")["),d=[];"["===a;){var h=p("]");a=c.charAt(b++);d.push(h)}if(")"!==a)throw Error(b-1+": Invalid character: "+a);d=e("backreference",
r,d);break;case ":":r=k(":.)");h="."===a;if(d=")"===a)d=e("subroutine",r);else{if(v.has(r)){if(v.get(r)!==h)throw Error("Capturing groups with the same name cannot be both shallow and normal");}else v.set(r,h);d=e("captrGroup",r,h,g(")"))}break;case "?":var r=g(":>"),d=void 0,l=!1;">"===a?(d=r.last,r=g(":"),h=g(")"),l=!0):(h=g("<"),d=g(")").first);d=e("lookahead",d,r,h,l);break;case "|":l=k("[=>");for(d=[];"["===a;){r=p("]");if(null===r)throw Error(b-1+"Invalid character: ]");d.push(r);a=c.charAt(b++)}var f=
"="===a?g(">").first:null,r=g(":"),h=g(")"),d=e("assertion",l,d,f,r,h)}break;case "[":if(d=c.substring(b,b+5).match(/^(\^?)-([^]?)([^]?)([^]?)/)){l=$jscomp.makeIterator(d);l.next();r=l.next().value;d=l.next().value;h=l.next().value;l=l.next().value;if(""===l)throw Error("Unexpected end of string.");if("]"!==l)throw Error(b+(r?4:3)+": Unexpected character: "+l);d!==h&&(d>h&&(h=$jscomp.makeIterator([h,d]),d=h.next().value,h=h.next().value),d={min:d,max:h,negated:!!r},b+=r?5:4)}else{d="^"===c.charAt(b)&&
(b++,!0);r=[];y.set=d&&new Set;for(h=void 0;h=g("]",!0),h.first.type!==C||0!==h.first.arr.length;)if(d){if(h.first.type!==C||h.first.arr.some(function(a){return function(b){a.set.add(b);return"symbol"===typeof b}}(y)))throw Error(b-1+": Negated alternation can only contain characters, character classes and negated alternations.");}else r.push(h);d=d?Array.from(y.set):e("alternation",x&&x.type===F,r)}}a=c.charAt(b++);h=void 0;r=!1;switch(a){default:b--;break;case "?":h=[0,1];r=!0;break;case "*":h=
[0,Infinity];break;case "+":h=[1,Infinity];break;case "{":h=p("},");if(!h)throw Error(b-1+": Empty quantifier: {}");h=[h,","===a?p("}"):h];null===h[1]&&(h[1]=Infinity);if(0<h.length&&(0>h[0]||h[1]<h[0]))throw Error(b-1+": Quantifier with negative or swapped boundaries.");}if(h){a=c.charAt(b++);l=void 0;switch(a){default:b--;l=G;f=O;break;case "+":l=H;f=ca;break;case "?":l=I,f=da}if(!u)continue;"object"===typeof d&&"first"in d||(d=e("group",[d]));if(!d.matchable){0!==h[0]&&(u=e("alternation",!1,[]),
q=u.first,x=u.last,u=u.matchable);continue}d=e.apply(null,[].concat(["quantifier",l,f],$jscomp.arrayFromIterable(h),[d,r]))}if("object"!==typeof d||!("first"in d))if(x&&x.type===C){x.arr.push(d);continue}else d=e("group",[d]);if(t)return d;(d.first.prev=x)&&(x.next=d.first);q||(q=d.first);x=d.last;y={set:y.set}}if(n)throw Error('Unexpected end of string; expected one of: "'+n+'".');q||(q=x={type:C,arr:[],next:null,prev:null});return{first:q,last:x,matchable:u,subroutine:null}}var b=0,a,n=c.indexOf(":");
if(-1===n)throw Error("Regexp must contain a colon.");var z=this.ignoreCase=!("i|"!==c.substring(0,2)||!(b+=2));this.name=c.substring(b,n);b=n+1;this.ignoreCase&&(c=c.toLowerCase());this.parsed=e("quantifier",G,O,1,1,g(""),!0);this.parsed.subroutine=e("subroutine",this.name).first}})();