From c4b6a0404387c88f332210119129719544a1987c Mon Sep 17 00:00:00 2001 From: Nikos M Date: Fri, 25 Mar 2016 01:49:42 +0200 Subject: [PATCH] v. 3.0.0 (update editor-grammar) --- build/prism_grammar.js | 74 ++++++++++++++++++++++++-------------- build/prism_grammar.min.js | 4 +-- editor-grammar | 2 +- 3 files changed, 50 insertions(+), 30 deletions(-) diff --git a/build/prism_grammar.js b/build/prism_grammar.js index 5bc1e97..f1043c4 100644 --- a/build/prism_grammar.js +++ b/build/prism_grammar.js @@ -1230,11 +1230,11 @@ function preprocess_grammar( grammar ) return grammar; } -function generate_autocompletion( token, follows ) +function generate_autocompletion( token, follows, hash ) { - follows = follows || []; + hash = hash || {}; follows = follows || []; if ( !token || !token.length ) return follows; - var i, l, j, m, tok, tok2, toks, i0; + var i, l, j, m, tok, tok2, toks, i0, w; for(i=0,l=token.length; i 1) ) { - follows.push( {word:''+tok.token.pattern, meta:tok.name, ci:!!tok.ci} ); - } - /*else if ( T_CHARLIST === tok.token.ptype ) - { - follows.push.apply( follows, tok.token.pattern.split('') ); + if ( !hash[HAS]('w_'+tok.token.pattern) ) + { + follows.push( {word:''+tok.token.pattern, meta:tok.name, ci:!!tok.ci} ); + hash['w_'+tok.token.pattern] = 1; + } } - else if ( T_REGEX === tok.token.ptype ) - { - follows.push( tok.token.pattern[0].source ); - }*/ } else if ( T_ALTERNATION === tok.type ) { - generate_autocompletion( tok.token, follows ); + generate_autocompletion( tok.token, follows, hash ); } else if ( T_SEQUENCE_OR_NGRAM & tok.type ) { j = 0; m = tok.token.length; do{ - generate_autocompletion( [tok2 = tok.token[j++]], follows ); - }while(j < m && (((T_REPEATED & tok2.type) && 0 === tok2.min) || T_ACTION === tok2.type)); + generate_autocompletion( [tok2 = tok.token[j++]], follows, hash ); + }while(j < m && (((T_REPEATED & tok2.type) && (1 > tok2.min)) || T_ACTION === tok2.type)); } else if ( T_REPEATED & tok.type ) { - generate_autocompletion( [tok.token[0]], follows ); + generate_autocompletion( [tok.token[0]], follows, hash ); } } return follows; @@ -2977,8 +2981,8 @@ function State( unique, s ) self.bline = s.bline; self.status = s.status; self.stack = s.stack.slice(); - self.block = s.block; self.token = s.token; + self.block = s.block; // keep extra state only if error handling is enabled if ( self.status & ERRORS ) { @@ -3003,8 +3007,8 @@ function State( unique, s ) self.bline = -1; self.status = s || 0; self.stack = []; - self.block = null; self.token = null; + self.block = null; // keep extra state only if error handling is enabled if ( self.status & ERRORS ) { @@ -3036,8 +3040,8 @@ function state_dispose( state ) state.bline = null; state.status = null; state.stack = null; - state.block = null; state.token = null; + state.block = null; state.queu = null; state.symb = null; state.ctx = null; @@ -3197,8 +3201,7 @@ var Parser = Class({ } state.$blank$ = state.bline+1 === state.line; } - state.$actionerr$ = false; - //state.token = null; + state.$actionerr$ = false; state.token = null; stack = state.stack; line = state.line; pos = stream.pos; type = false; notfound = true; err = false; just_space = false; block_in_progress = state.block ? state.block.name : undef; @@ -3231,7 +3234,7 @@ var Parser = Class({ { tokenizer = interleaved_tokens[ii]; type = tokenize( tokenizer, stream, state, token ); - if ( false !== type ) { notfound = false; state.token=tokenizer; break; } + if ( false !== type ) { notfound = false; break; } } if ( !notfound ) break; } @@ -3248,11 +3251,12 @@ var Parser = Class({ if ( tokenizer.status & REQUIRED_OR_ERROR ) { // empty the stack of the syntax rule group of this tokenizer + state.token = tokenizer; empty( stack, tokenizer.$id /*|| true*/ ); // skip this if ( !stream.nxt( true ) ) { stream.spc( ); just_space = true; } // generate error - err = true; notfound = false; state.token=tokenizer; break; + err = true; notfound = false; break; } // optional /*else @@ -3290,7 +3294,7 @@ var Parser = Class({ } } // not empty - if ( true !== type ) { notfound = false; state.token=tokenizer; break; } + if ( true !== type ) { notfound = false; break; } } } } @@ -3324,8 +3328,24 @@ var Parser = Class({ return T; } - ,autocompletion: function( token, follows ) { - return generate_autocompletion( token, follows||[] ); + ,autocompletion: function( state ) { + var stack = state.stack, i, token, type, + hash = {}, follows = generate_autocompletion( [ state.token ], [], hash ); + for(i=stack.length-1; i>=0; i--) + { + token = stack[ i ]; type = token.type; + if ( T_REPEATED & type ) + { + follows = generate_autocompletion( [ token ], follows, hash ); + if ( (0 < token.min) && follows.length ) break; + } + else if ( (T_SIMPLE === type) || (T_ALTERNATION === type) || (T_SEQUENCE_OR_NGRAM & type) ) + { + follows = generate_autocompletion( [ token ], follows, hash ); + if ( follows.length ) break; + } + } + return follows; } ,tokenize: function( stream, state, row ) { diff --git a/build/prism_grammar.min.js b/build/prism_grammar.min.js index 64020c2..f0b38cd 100644 --- a/build/prism_grammar.min.js +++ b/build/prism_grammar.min.js @@ -7,5 +7,5 @@ * https://github.com/foo123/prism-grammar * https://github.com/foo123/editor-grammar * -**/!function(e,n,t){"use strict";var o;"object"==typeof module&&module.exports?module.exports=t.call(e,{}):"undefined"!=typeof System&&"function"==typeof System.register&&"function"==typeof System["import"]?System.register(n,[],function(o){o(n,t.call(e,{}))}):"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(n)?define(n,["require","exports","module"],function(){return t.call(e,{})}):n in e||(e[n]=o=t.call(e,{}))&&"function"==typeof define&&define.amd&&define(function(){return o})}(this,"PrismGrammar",function(e){"use strict";function n(e){var n=0;return null===e?n=ht:!0===e||!1===e||e instanceof Boolean?n=yt:Zn===e?n=ft:(n=Rt[lt.call(e)]||pt,n=mt===n||e instanceof Number?isNaN(e)?kt:isFinite(e)?mt:gt:$t===n||e instanceof String?1===e.length?dt:$t:xt===n||e instanceof Array?xt:_t===n||e instanceof RegExp?_t:Ot===n||e instanceof Date?Ot:wt===n||e instanceof Function?wt:vt===n?vt:pt),n}function t(e,n,t,o){var l,r,i,s,u,a,c=e.length;if(arguments.length<4&&(o=c-1),0>o&&(o+=c),arguments.length<3&&(t=0),t>o)return[];if(t===o)return[n(e[t],t,t,o)];for(i=o-t+1,s=15&i,u=1&s,a=new Array(i),u&&(a[0]=n(e[t],t,t,o)),l=u;s>l;l+=2)r=t+l,a[l]=n(e[r],r,t,o),a[l+1]=n(e[r+1],r+1,t,o);for(l=s;i>l;l+=16)r=t+l,a[l]=n(e[r],r,t,o),a[l+1]=n(e[r+1],r+1,t,o),a[l+2]=n(e[r+2],r+2,t,o),a[l+3]=n(e[r+3],r+3,t,o),a[l+4]=n(e[r+4],r+4,t,o),a[l+5]=n(e[r+5],r+5,t,o),a[l+6]=n(e[r+6],r+6,t,o),a[l+7]=n(e[r+7],r+7,t,o),a[l+8]=n(e[r+8],r+8,t,o),a[l+9]=n(e[r+9],r+9,t,o),a[l+10]=n(e[r+10],r+10,t,o),a[l+11]=n(e[r+11],r+11,t,o),a[l+12]=n(e[r+12],r+12,t,o),a[l+13]=n(e[r+13],r+13,t,o),a[l+14]=n(e[r+14],r+14,t,o),a[l+15]=n(e[r+15],r+15,t,o);return a}function o(e,n,t,o,l){var r,i,s,u,a,c=e.length,p=t;if(arguments.length<5&&(l=c-1),0>l&&(l+=c),arguments.length<4&&(o=0),o>l)return p;if(o===l)return n(p,e[o],o);for(s=l-o+1,u=15&s,a=1&u,a&&(p=n(p,e[o],o)),r=a;u>r;r+=2)i=o+r,p=n(n(p,e[i],i),e[i+1],i+1);for(r=u;s>r;r+=16)i=o+r,p=n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(p,e[i],i),e[i+1],i+1),e[i+2],i+2),e[i+3],i+3),e[i+4],i+4),e[i+5],i+5),e[i+6],i+6),e[i+7],i+7),e[i+8],i+8),e[i+9],i+9),e[i+10],i+10),e[i+11],i+11),e[i+12],i+12),e[i+13],i+13),e[i+14],i+14),e[i+15],i+15);return p}function l(e,n,t,o){if(n>t)return o;if(n===t)return e(n,o,n,t),o;var l,r,i=t-n+1,s=15&i,u=1&s;for(u&&e(n,o,n,t),l=u;s>l;l+=2)r=n+l,e(r,o,n,t),e(++r,o,n,t);for(l=s;i>l;l+=16)r=n+l,e(r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t),e(++r,o,n,t);return o}function r(e,t){var o,l,i,s,u=n(e),a=0;if(mt===n(t)?t>0?(a=t,t=!0):t=!1:t=!1!==t,vt===u){l={};for(i in e)e[nt](i)&&e[tt](i)&&(o=n(e[i]),l[i]=vt===o?t?r(e[i],a>0?a-1:t):e[i]:xt===o?t?r(e[i],a>0?a-1:t):e[i].slice():Ot===o?new Date(e[i]):$t&o?e[i].slice():mt&o?0+e[i]:e[i])}else if(xt===u)for(s=e.length,l=new Array(s),i=0;s>i;i++)o=n(e[i]),l[i]=vt===o?t?r(e[i],a>0?a-1:t):e[i]:xt===o?t?r(e[i],a>0?a-1:t):e[i].slice():Ot===o?new Date(e[i]):$t&o?e[i].slice():mt&o?0+e[i]:e[i];else l=Ot===u?new Date(e):$t&u?e.slice():mt&u?0+e:e;return l}function i(){var e,t,o,l,s,u,a,c,p,f,h=arguments,m=h.length;if(1>m)return null;for(t=r(h[0]),o=1;m>o;o++)if(e=h[o])for(l in e)if(e[nt](l)&&e[tt](l))if(t[nt](l)&&t[tt](l)){if(p=n(t[l]),f=n(e[l]),vt===p&&vt===f)t[l]=i(t[l],e[l]);else if(xt===p&&xt===f){if(a=t[l],c=e[l],u=c.length,!u)continue;if(a.length)for(s=0;u>s;s++)0>a.indexOf(c[s])&&a.push(c[s]);else t[l]=c.slice()}}else t[l]=r(e[l]);return t}function s(e,t){return t||xt!==n(e)?[e]:e}function u(e,t){return e=s(e),(t||xt!==n(e[0]))&&(e=[e]),e}function a(e,t){return $t&n(t)&&$t&n(e)&&t.length&&t.length<=e.length&&t===e.substr(0,t.length)}function c(e,n,t){return nt&&e[o-t-1].$id===n;)t++;t&&(e.length=o-t)}return e}function f(e,n,t){return t?e[n]=Zn:delete e[n],e}function h(e){return(e||"id_")+ ++Mt}function m(e){return(e||"uuid")+"_"+ ++Mt+"_"+(new Date).getTime()}function g(){var e,t,o,l,r,i,s=arguments,u=s.length;for(e=s[0]||{},r=1;u>r;r++)if(t=s[r],vt===n(t))for(l in t)t[nt](l)&&t[tt](l)&&(o=t[l],i=n(o),e[l]=mt&i?0+o:Ot&i?new Date(o):Et&i?o.slice():o);return e}function k(e,n){var t,o=arguments.length,l="constructor";return 0===o?(e=Object,n={}):1===o?(n=e||{},e=Object):(e=e||Object,n=n||{}),n[nt](l)||(n[l]=function(){}),t=n[l],delete n[l],t[et]=g(rt(e[et]),n),t[et][l]=t,t}function y(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"}function $(e){return"&#"+e.charCodeAt(0)+";"}function d(e,n){return e.replace(Tt,n?y:$)}function b(e){return e.replace(Pt,"\\$1")}function x(e,n){return new RegExp(e,n||"")}function v(e,n,t,o){var l,r,i,s,u=e.pos,a=e.length,c="",p=!!t;if(p){for(o=!!o,r=!1,s=0;a>u&&(l=e[at](u++),n!==l||r);)i=t===l,r=!r&&i,o?(i&&s++,(!i||2&s)&&(c+=l,s=0)):c+=l;2&s&&(c+=t)}else for(;a>u&&(l=e[at](u++),n!==l);)c+=l;return e.pos=u,c}function w(e,t,o){var l,r,i,s,u,a=!0===o?0:1;for($t&n(t)&&(t=[t,t,t],a=0),r=e.length,u="",l=0;r>l;)i=e[at](l),r>l+1&&"$"===i?(s=e.charCodeAt(l+1),36===s?(u+="$",l+=2):s>=48&&57>=s?(u+=t[a+s-48]||"",l+=2):(u+=i,l+=1)):(u+=i,l+=1);return u}function _(e,t,o,l){if(!e||(mt|_t)&n(e))return e;var r,i=t?t.length||0:0,s="";if($t&n(l)?s=l:l&&(s=Ct),i&&t===e.substr(0,i)){var u,a,c,r,p,f=e.substr(i),h=f[at](0),m="";for(r=f.length;r--&&(p=f[at](r),h!==p);)"i"===p.toLowerCase()&&(m="i");return u=f.substring(1,r),a="^("+u+")",o[a]||(c=x(a,m),o[a]=c),o[a]}return s?(a="^("+b(e)+")"+s,o[a]||(c=x(a,m),o[a]=c),o[a]):e}function O(e,o,l){var r,i="";return $t&n(o)?i=o:o&&(i=Ct),r=t(e.sort(Nt),b).join("|"),[x("^("+r+")"+i,l?"i":""),1]}function q(e,t,o,l){var r=n(t);if(mt===r)return t;if(l[e])return l[e];o=o||0;var i,s=0;return t&&t.isCharList&&(s=1,f(t,"isCharList")),i=ht===r?new A(bn,e,t,ht,o):dt===r?new A(bn,e,t,dt,o):St&r?new A(bn,e,t,_t,o):$t&r?new A(bn,e,t,s?bt:$t,o):t,l[e]=i}function E(e,t,o,l,r,i,u){if(u[e])return u[e];var c,p,f,h,m,g,k,y=0,$=0,d=1,b=$t&n(l)?!0:!!l;if(c=s(t),f=c.length,1===f)k=q(e,_(c[0],o,i,l),0,u);else if(f>1){for(h=(f>>>1)+1,p=0;h>=p;p++)m=n(c[p]),g=n(c[f-1-p]),(dt!==m||dt!==g)&&(d=0),xt&m||xt&g?y=1:(_t&m||_t&g||a(c[p],o)||a(c[f-1-p],o))&&($=1);if(d&&!b)c=c.slice().join(""),c.isCharList=1,k=q(e,c,0,u);else if(!b||y||$)if(y||$){for(p=0;f>p;p++)c[p]=xt&n(c[p])?E(e+"_"+p,c[p],o,l,r,i,u):q(e+"_"+p,_(c[p],o,i),p,u);k=f>1?new A(xn,e,c):c[0]}else{for(c=c.sort(Nt),p=0;f>p;p++)c[p]=q(e+"_"+p,_(c[p],o,i),p,u);k=f>1?new A(xn,e,c):c[0]}else k=q(e,O(c,l,r),0,u)}return u[e]=k}function S(e,t,o,r,i){if(i[e])return i[e];var s=u(t),c=[],p=[];return l(function(t){var l,u;l=q(e+"_0_"+t,_(s[t][0],o,r),t,i),u=s[t].length>1?_t!==l.ptype||$t!==n(s[t][1])||a(s[t][1],o)?q(e+"_1_"+t,_(s[t][1],o,r),t,i):s[t][1]:l,c.push(l),p.push(u)},0,s.length-1),i[e]=new A(vn,e,[c,p])}function L(e,n){var t=u(e.tokens.slice());l(function(e){var o=t[e][0],l=t[e].length>1?t[e][1]:t[e][0],r=t[e].length>2?t[e][2]:"";null===l?(n.line=n.line||[],n.line.push(o)):(n.block=n.block||[],n.block.push([o,l,r]))},0,t.length-1)}function R(e,n,o,l){var r=e.meta||o,i=!(!e.caseInsesitive&&!e.ci),s=t(n,function(e){return{word:e,meta:r,ci:i}});return l.autocomplete=(l.autocomplete||[]).concat(s),s}function j(e){e.Lex||(e.Lex={}),e.Syntax||(e.Syntax={});var t,o,l,r,s,u,a,c,p,h,m,g=e.Lex,k=e.Syntax,y=[g,k],$=y.length;for(m=0;$>m;){h=y[m++];for(l in h)h[nt](l)&&(t=l.split(":"),o=t[1]&&Dt(t[1]).length?Dt(t[1]):null,t=Dt(t[0]),t.length||(t=l,o=null),t!==l&&(h[t]=h[l],f(h,l),o&&(o=o[ut](),r=h[t],s=n(r),vt===s?h[t].type||(h[t].type=o):(h[t]={type:o},"error"===o?(h[t].type="action",h[t].error=r):"nop"===o?(h[t].type="action",h[t].nop=!0):"group"===o?(h[t].type="sequence",h[t].tokens=r):"action"===o&&$t===s?h[t][r]=!0:h[t].tokens=r))),g===h&&(Lt&n(h[t])&&(h[t]={type:"simple",tokens:h[t]}),r=h[t],r.type&&(c=r.type=r.type[ut](),"line-block"===c?(r.type="block",r.multiline=!1,r.escape=!1):"escaped-line-block"===c?(r.type="block",r.multiline=!1,r.escape="\\"):"escaped-block"===c&&(r.type="block",r.multiline=!0,r.escape="\\"))))}h=g;for(t in h)if(h[nt](t))for(r=h[t];r.extend;)u=r.extend,f(r,"extend"),a=g[u],a&&(Lt&n(a)&&(a=g[u]={type:"simple",tokens:a}),r=i(a,r));h=g;for(t in h)h[nt](t)&&(r=h[t],r.type?(c=r.type=r.type[ut](),"line-block"===c?(r.type="block",r.multiline=!1,r.escape=!1):"escaped-line-block"===c?(r.type="block",r.multiline=!1,r.escape="\\"):"escaped-block"===c&&(r.type="block",r.multiline=!0,r.escape="\\")):r["escaped-line-block"]?(r.type="block",r.multiline=!1,r.escape||(r.escape="\\"),r.tokens=r["escaped-line-block"],f(r,"escaped-line-block")):r["escaped-block"]?(r.type="block",r.multiline=!0,r.escape||(r.escape="\\"),r.tokens=r["escaped-block"],f(r,"escaped-block")):r["line-block"]?(r.type="block",r.multiline=!1,r.escape=!1,r.tokens=r["line-block"],f(r,"line-block")):r.comment?(r.type="comment",r.escape=!1,r.tokens=r.comment,f(r,"comment")):r.block?(r.type="block",r.tokens=r.block,f(r,"block")):r.simple?(r.type="simple",r.tokens=r.simple,f(r,"simple")):r.nop?(r.type="action",r.action=["nop",r.nop,!1],r.nop=!0):r.error?(r.type="action",r.action=["error",r.error,!!r["in-context"]],f(r,"error")):r[nt]("context")?(r.type="action",r.action=[r.context?"context-start":"context-end",r.context,!!r["in-context"]],f(r,"context")):r.indent?(r.type="action",r.action=["indent",r.indent,!!r["in-context"]],f(r,"indent")):r.outdent?(r.type="action",r.action=["outdent",r.outdent,!!r["in-context"]],f(r,"outdent")):r.unique?(r.type="action",r.action=["unique",$t&n(r.unique)?["_DEFAULT_",r.unique]:r.unique,!!r["in-context"]],f(r,"unique")):r.push?(r.type="action",r.action=["push",r.push,!!r["in-context"]],f(r,"push")):r[nt]("pop")?(r.type="action",r.action=["pop",r.pop,!!r["in-context"]],f(r,"pop")):r.type="simple","action"===r.type?r.ci=!(!r.caseInsesitive&&!r.ci):"block"===r.type||"comment"===r.type?(r.multiline=r[nt]("multiline")?!!r.multiline:!0,$t&n(r.escape)||(r.escape=!1)):"simple"===r.type&&(r.meta=r.autocomplete&&$t&n(r.meta)?r.meta:null,r.ci=!(!r.caseInsesitive&&!r.ci)));h=k;for(t in h)h[nt](t)&&(r=h[t],vt!==n(r)||r.type?r.type&&(c=r.type=r.type[ut](),"group"===c&&r.match?(s=n(r.match),$t&s?(p=r.match[ut](),"alternation"===p||"either"===p?(r.type="alternation",f(r,"match")):"sequence"===p||"all"===p?(r.type="sequence",f(r,"match")):"zeroorone"===p?(r.type="zeroOrOne",f(r,"match")):"zeroormore"===p?(r.type="zeroOrMore",f(r,"match")):"oneormore"===p?(r.type="oneOrMore",f(r,"match")):(r.type="sequence",f(r,"match"))):xt&s&&(r.type="repeat",r.repeat=r.match,f(r,"match"))):"either"===c?r.type="alternation":"all"===c?r.type="sequence":"lookahead"===c&&(r.type="positiveLookahead")):r.ngram||r["n-gram"]?(r.type="ngram",r.tokens=r.ngram||r["n-gram"],r["n-gram"]?f(r,"n-gram"):f(r,"ngram")):r.sequence||r.all?(r.type="sequence",r.tokens=r.sequence||r.all,r.all?f(r,"all"):f(r,"sequence")):r.alternation||r.either?(r.type="alternation",r.tokens=r.alternation||r.either,r.either?f(r,"either"):f(r,"alternation")):r.zeroOrOne?(r.type="zeroOrOne",r.tokens=r.zeroOrOne,f(r,"zeroOrOne")):r.zeroOrMore?(r.type="zeroOrMore",r.tokens=r.zeroOrMore,f(r,"zeroOrMore")):r.oneOrMore?(r.type="oneOrMore",r.tokens=r.oneOrMore,f(r,"oneOrMore")):r.positiveLookahead||r.lookahead?(r.type="positiveLookahead",r.tokens=r.positiveLookahead||r.lookahead,r.lookahead?f(r,"lookahead"):f(r,"positiveLookahead")):r.negativeLookahead&&(r.type="negativeLookahead",r.tokens=r.negativeLookahead,f(r,"negativeLookahead")));return e}function D(e,t){if(t=t||[],!e||!e.length)return t;var o,l,r,i,s,u;for(o=0,l=e.length;l>o;o++)if(s=e[o])if(Rn===s.type)s.autocompletions?t.push.apply(t,s.autocompletions):$t===s.token.ptype&&$t&n(s.token.pattern)&&s.token.pattern.length>1&&t.push({word:""+s.token.pattern,meta:s.name,ci:!!s.ci});else if(Nn===s.type)D(s.token,t);else if(Bn&s.type){r=0,i=s.token.length;do D([u=s.token[r++]],t);while(i>r&&(Fn&u.type&&0===u.min||wn===u.type))}else Fn&s.type&&D([s.token[0]],t);return t}function N(e,t,o,l){for(var r;$t&n(r=t[e]||o[e]);)e=r;return l?e:t[e]||o[e]||e}function z(e,n){return e.length>1?l(n?function(n,t){var o=t[t.length-1],l=e[n];o===l||t.push(l)}:function(n,t){var o=t[t.length-1],l=e[n];It.test(l)&&It.test(o)&&o===l||t.push(l)},1,e.length-1,[e[0]]):e}function F(e,o,l){var i,s,u,a,c,p,f,h,m,g,k,y,$,d,w,_=!1;if(w=e.modifier?e.modifier:null,h=new String(Dt(e)),h.pos=0,1===h.length)y=""+e,o[y]||l[y]||(o[y]={type:"simple",tokens:e}),e=y;else{for(i=[],s=[],u="",$=[];h.posc[0]&&(c[0]=0),2>c.length?c.push(c[0]):c[1]=c[1].length?parseInt(c[1],10)||ct:ct,0>c[1]&&(c[1]=0),k=s[s.length-1],y=""+k+["{",c[0],",",isFinite(c[1])?c[1]:"","}"].join(""),l[y]||(l[y]={type:"repeat",repeat:[c[0],c[1]],tokens:[k]}),s[s.length-1]=y):u+=m;else{if("}"===m){u+=m;continue}"&"===m||"!"===m?u+=m:"|"===m?(_=!1,s=z(s),s.length>1?(y=""+s.join(" "),l[y]||(l[y]={type:"sequence",tokens:s}),i.push(y)):s.length?i.push(s[0]):u+=m,s=[]):"("===m?($.push([s,i,u]),s=[],i=[],u=""):")"===m&&(s=z(s),s.length>1?(y=""+s.join(" "),l[y]||(l[y]={type:"sequence",tokens:s}),i.push(y)):s.length&&i.push(s[0]),s=[],i=z(i,1),i.length>1?(y=""+i.join(" | "),l[y]||(l[y]={type:"alternation",tokens:i})):i.length&&(y=i[0]),i=[],d=$.pop(),s=d[0],i=d[1],u=d[2],k=y,y="("+k+")",l[y]||(l[y]=r(N(k,o,l))),s.push(y))}}else u+=m;u.length&&(_?(s.length&&(k=s[s.length-1],y=k+"."+u,p=o[y]||l[y],p||(f=N(k,o,l),l[y]=$t&n(f)?new String(f):r(f),l[y].modifier=u),s[s.length-1]=y),_=!1):"0"===u?(o[Qn]||(o[Qn]={type:"simple",tokens:0}),s.push(Qn)):"^^"===u?(o[Yn]||(o[Yn]={type:"simple",tokens:_n}),s.push(Yn)):"^^1"===u?(o[Kn]||(o[Kn]={type:"simple",tokens:On}),s.push(Kn)):"^"===u?(o[Vn]||(o[Vn]={type:"simple",tokens:En}),s.push(Vn)):"$"===u?(o[Wn]||(o[Wn]={type:"simple",tokens:qn}),s.push(Wn)):(o[u]||l[u]||(o[u]={type:"simple",tokens:u}),s.push(u))),u="",s=z(s),s.length>1?(y=""+s.join(" "),l[y]||(l[y]={type:"sequence",tokens:s}),i.push(y)):s.length&&i.push(s[0]),s=[],i=z(i,1),i.length>1?(y=""+i.join(" | "),l[y]||(l[y]={type:"alternation",tokens:i}),e=y):i.length&&(e=i[0]),i=[]}return w&&(o[e]||l[e])&&((o[e]||l[e]).modifier=w),e}function M(e,r,i,a,c,p,f,h,m,g,k){var y,$,d,b,x,v,w,_=null,O=null,q=null;if(_n===e||On===e||En===e||qn===e)return new I(e,_n===e?Yn:On===e?$T_FBNL$:En===e?Vn:Wn,e,O);if(!1===e||0===e)return new I(Sn,Qn,0,O);if(""===e)return new I(Ln,Xn,"",O);if(null===e)return new I(Rn,Jn,ht,O,q);if(xt&n(e)&&(d=e,e="NGRAM_"+d.join("_"),a[e]||(a[e]={type:"ngram",tokens:d})),e=""+e,h[e])return h[e];if(x=N(e,i,a),$t&n(x)&&(x=F(x,i,a),x=i[x]||a[x]||null),!x)return null;if(y=x.type?Un[x.type[ut]().replace(Ft,"")]||Rn:Rn,O=x.msg||null,q=x.modifier||null,$=x.tokens,Rn&y){if(_n===$||On===$||En===$||qn===$||!1===$||0===$)return _=new I($||Sn,e,$||0,O),h[e]=_,_;if(""===$)return _=new I(Ln,e,"",O),h[e]=_,_;if(null===$)return _=new I(Rn,e,ht,O,q),h[e]=_,_;if(!$)return null}if(wn&y)x[nt]("action")?"nop"===x.action[0]?x.action[0]=pn:"error"===x.action[0]?x.action[0]=fn:"context-start"===x.action[0]?x.action[0]=mn:"context-end"===x.action[0]?x.action[0]=gn:"push"===x.action[0]?x.action[0]=kn:"pop"===x.action[0]?x.action[0]=yn:"unique"===x.action[0]?x.action[0]=hn:"indent"===x.action[0]?x.action[0]=$n:"outdent"===x.action[0]&&(x.action[0]=dn):x[nt]("nop")?x.action=[pn,x.nop,!!x["in-context"]]:x[nt]("error")?x.action=[fn,x.error,!!x["in-context"]]:x[nt]("context")?x.action=[x.context?mn:gn,x.context,!!x["in-context"]]:x[nt]("context-start")?x.action=[mn,x["context-start"],!!x["in-context"]]:x[nt]("context-end")?x.action=[gn,x["context-end"],!!x["in-context"]]:x[nt]("push")?x.action=[kn,x.push,!!x["in-context"]]:x[nt]("pop")?x.action=[yn,x.pop,!!x["in-context"]]:x[nt]("unique")?x.action=[hn,$t&n(x.unique)?["_DEFAULT_",x.unique]:x.unique,!!x["in-context"]]:x[nt]("indent")?x.action=[$n,x.indent,!!x["in-context"]]:x[nt]("outdent")&&(x.action=[dn,x.outdent,!!x["in-context"]]),x.nop&&(x.action[0]=pn),_=new I(wn,e,x.action.slice(),O,q),_.ci=!!x.caseInsensitive||x.ci,h[e]=_;else if($=s($),Rn&y){if(w=x.autocomplete?R(x,s(Et&n(x.autocomplete)?x.autocomplete:x.tokens),e,k):null,v="undefined"!=typeof x.combine?x.combine:xt&n(x.tokens)?!0:!1,_=new I(Rn,e,E(e,$.slice(),r,v,!(!x.caseInsensitive&&!x.ci),p,f),O,q,null,w),h[e]=_,null!=x.except){var j,D,z=s(x.except),P=z.length,T=[];for(j=0;P>j;j++)z[j]&&(D=M(z[j],r,i,a,c,p,f,h,m,g,k),D&&T.push(D));T.length&&(_.except=T)}}else jn&y?(Dn===y&&L(x,g),_=new I(y,e,S(e,$.slice(),r,p,f),O),_.mline=x[nt]("multiline")?!!x.multiline:!0,_.esc=x[nt]("escape")?x.escape:!1,_.inter=!!c[e+".inside"],Dn===y&&x.interleave&&m.push(B(_)),q&&(_.modifier=q),h[e]=_):Hn&y&&(Gn===y?(b=u($),_=t(b,function(n,t){return new I(Gn,e+"_NGRAM_"+t,null,O,q)}),h[e]=_,l(function(e){_[e].token=s(o(b[e],function(e,n){return e.concat(M(n,r,i,a,c,p,f,h,m,g,k))},[]))},0,b.length-1)):(Cn===y||In===y?_=new I(y,e,null,O,q):Fn&y&&xt&n(x.repeat)?(_=new I(Fn,e,null,O,q),_.min=x.repeat[0],_.max=x.repeat[1]):Mn===y?(_=new I(Mn,e,null,O,q),_.min=0,_.max=1):Pn===y?(_=new I(Pn,e,null,O,q),_.min=0,_.max=ct):Tn===y?(_=new I(Tn,e,null,O,q),_.min=1,_.max=ct):_=Nn===y?new I(Nn,e,null,O,q):new I(zn,e,null,O,q),h[e]=_,_.token=s(o($,function(e,n){return e.concat(M(n,r,i,a,c,p,f,h,m,g,k))},[]))));return h[e]}function P(e){var t={};return e.Lex=e.Lex||{},e.Syntax=e.Syntax||{},e=j(e),e.Parser&&e.Parser.length&&l(function o(r,i){var s,u,a,c=i[r];t[c]||(xt&n(c)&&(s=c,c="NGRAM_"+s.join("_"),e.Syntax[c]||(e.Syntax[c]={type:"ngram",tokens:s})),u=N(c,e.Lex,e.Syntax),$t&n(u)&&(u=F(u,e.Lex,e.Syntax),u=e.Lex[u]||e.Syntax[u]||null),u&&(t[c]=u,a=u.type?Un[u.type[ut]().replace(Ft,"")]||Rn:Rn,Hn&a&&l(o,0,u.tokens.length-1,u.tokens)))},0,e.Parser.length-1,e.Parser),e}function T(e){var t,l,i,s,u,a,c,p,f,h,m,g,k;return e.__parsed?e:(t=e.RegExpID||null,i=e.Extra?r(e.Extra):{},s=e.Style?r(e.Style):{},u=null,a=e.Lex?r(e.Lex):{},c=e.Syntax?r(e.Syntax):{},p={},f={},h={},g={},k={},m=[],l=e.Parser?r(e.Parser):[],e=j({Style:s,Fold:u,Lex:a,Syntax:c,$parser:null,$interleaved:null,$comments:null,$autocomplete:null,$extra:i,__parsed:0}),e.$parser=o(l,function(e,o){var l=M(o,t,a,c,s,p,f,h,m,g,k)||null;return l&&(xt&n(l)?e=e.concat(l):e.push(l)),e},[]),e.$interleaved=m&&m.length?m:null,e.$comments=g,e.$autocomplete=k&&k.autocomplete&&k.autocomplete.length?k.autocomplete:null,e.__parsed=1,e)}function A(e,t,o,l,r){var i,s,u=this;i=u.type=e,u.name=t,u.pattern=o,s=u.ptype=l||$t,u.key=r||0,xn===i?u.key=!1!==r:vn===i?u.pattern[0]=new A(xn,t+"_Start",o[0],null,!1):ht===s?u.pattern=null:_t===s&&(u.pattern=_t&n(o)?[o,0]:[o[0],o[1]||0])}function C(e,t,o,l){var r,i,s,u,a,c,p,f,h,m,g,k=e,y=k.type,$=k.pattern,d=k.key;if(vn===y){if(r=k.name,s=$[0],u=$[1],c=C(s,t,o,l))return a=u[c[0]],f=n(a),h=s.pattern[c[0]].ptype,_t===h&&qt&f&&(p=mt&f?c[1][a+1]:w(a,c[1]),a=new A(bn,r+"_End",p,p.length>1?$t:dt)),a}else if(xn===y){for(m=0,g=$.length;g>m;m++)if(p=C($[m],t,o,l))return d?[m,p[1]]:p}else{if(i=k.ptype,ht===i)return!1!==o&&t.end(),[d,""];if(_t===i){if(p=t.slice(t.pos).match($[0]),p&&0===p.index)return!1!==o&&t.mov(p[$[1]||0].length),[d,$[1]>0?p[$[1]]:p]}else if(bt===i){if(!0===l){p=-1;var b,x;for(g=$.length-1;g>=0;g--)b=t.indexOf($[at](g),t.pos),b>-1&&(-1===p||p>b)&&(p=b,x=$[at](g));if(p>-1)return!1!==o&&(t.pos=p+1),[d,x]}else if(p=t[at](t.pos)||null,p&&-1<$.indexOf(p))return!1!==o&&t.mov(1),[d,p]}else if(dt===i){if(!0===l){if(p=t.indexOf($,t.pos),p>-1)return!1!==o&&(t.pos=p+1),[d,$]}else if(p=t[at](t.pos)||null,$===p)return!1!==o&&t.mov(1),[d,p]}else if($t===i)if(g=$.length,!0===l){if(p=t.indexOf($,t.pos),p>-1)return!1!==o&&(t.pos=p+g),[d,$]}else if($===t.substr(t.pos,g))return!1!==o&&t.mov(g),[d,$]}return!1}function I(e,n,t,o,l,r,i){var s=this;s.type=e,s.name=n,s.token=t,s.modifier=l||null,s.except=r||null,s.autocompletions=i||null,s.pos=null,s.msg=o||null,s.$msg=null,s.status=0,s.ci=!1,s.mline=!0,s.esc=!1,s.inter=!1,s.found=0,s.min=0,s.max=1,s.$id=null}function G(){var e=this;e.T=0,e.id=null,e.type=null,e.match=null,e.str="",e.pos=null,e.block=null}function B(e,n,t,o){var l=new I(e.type,e.name,e.token,e.msg,e.modifier,e.except,e.autocompletions);return l.ci=e.ci,l.mline=e.mline,l.esc=e.esc,l.inter=e.inter,l.found=e.found,l.min=e.min,l.max=e.max,n&&(l.status|=rn),t&&(l.modifier=t),o&&(l.$id=o),l}function H(e){var n=e.name;return e.$msg?e.$msg:e.status&rn?'Token "'+n+'" Expected':'Syntax Error: "'+n+'"'}function U(e,n,t,o,l,r,i){e.err[n+"_"+t+"_"+o+"_"+l+"_"+(r?r.name:"ERROR")]=[n,t,o,l,i||H(r)]}function Y(e,n,t,o){if(!e)return!1;var l=e.type,r=Hn&l?J:jn&l?W:wn&l?K:V;return r(e,n,t,o)}function K(e,t,o,l){var r,i,s,u,a,c,p,f,h,m,g,k,y,$,d,b,x=e,v=x.token||null,_=x.ci,O=x.name,q=!(o.status&on);if(x.status=0,x.$msg=null,q||!v||!l||!l.pos)return!0;if(b=!!(jn&l.T),pn===v[0]||b&&!l.block)return!0;if(r=v[0],i=v[1],y=v[2],a=x.msg,c=o.queu,p=o.symb,f=o.ctx,b?(d=l.block.match||l.block.str,h=l.block.pos[0][0],m=l.block.pos[0][1],g=l.block.pos[0][2],k=l.block.pos[0][3]):(d=l.match||l.str,h=l.pos[0],m=l.pos[1],g=l.pos[2],k=l.pos[3]),fn===r)return!a&&$t&n(i)&&(a=i),x.$msg=a?w(a,d,!0):'Error "'+O+'"',U(o,h,m,g,k,x,H(x)),x.status|=sn,!1;if(gn===r)f.length&&f.shift();else if(mn===r)f.unshift({symb:{},queu:[]});else if(yn===r){if(y){if(!f.length)return!0;c=f[0].queu}if(i){if(i=w(i,d),_&&(i=i[ut]()),!c.length||i!==c[0][0])return c.length?(x.$msg=a?w(a,[c[0][0],i],!0):'Tokens do not match "'+c[0][0]+'","'+i+'"',$=H(x),U(o,c[0][1],c[0][2],c[0][3],c[0][4],x,$),U(o,h,m,g,k,x,$),c.shift()):(x.$msg=a?w(a,["",i],!0):'Token does not match "'+i+'"',$=H(x),U(o,h,m,g,k,x,$)),x.status|=sn,!1;c.shift()}else c.shift()}else if(kn===r&&i){if(y){if(!f.length)return!0;c=f[0].queu}i=w(i,d),_&&(i=i[ut]()),x.$msg=a?w(a,i,!0):'Token does not match "'+i+'"',c.unshift([i,h,m,g,k,H(x)])}else if(hn===r){if(y){if(!f.length)return!0;p=f[0].symb}if(s=i[1],u=i[0],s=w(s,d,!0),_&&(s=s[ut]()),p[nt](u)||(p[u]={}),p[u][nt](s))return x.$msg=a?w(a,s,!0):'Duplicate "'+s+'"',$=H(x),U(o,p[u][s][0],p[u][s][1],p[u][s][2],p[u][s][3],x,$),U(o,h,m,g,k,x,$),x.status|=sn,!1;p[u][s]=[h,m,g,k]}return!0}function V(e,n,t,o,l){var r,i=e,s=i.token,u=i.modifier,a=i.type,c=i.name,p=i.except,f=t.line,h=n.pos,m=null,g=!1;if(i.status&=an,i.$msg=l?null:i.msg||null,p)for(var k=0,y=p.length;y>k;k++)if(r=p[k],i!==r&&Rn===r.type&&V(r,n,t,o,1))return n.bck(h),!1;return _n===a?g=0===t.line:On===a?g=t.bline+1===t.line:En===a?g=n.sol():qn===a?(n.spc(),n.eol()?g=c:n.bck(h)):Sn===a?(i.status=0,g=!0):Ln===a?(i.status&rn&&n.spc()&&!n.eol()?(n.bck(h),i.status|=sn):g=!0,i.status&=un):ht===s?(n.end(),g=u||c):(m=C(s,n))&&(m=m[1],g=u||c),l?g:(!1!==g&&(o.T=a,o.id=c,o.type=g,o.str=n.sel(h,n.pos),o.match=m,o.pos=[f,h,f,n.pos]),!g&&i.status&&i.$msg&&(i.$msg=w(i.$msg,c,!0)),g)}function W(e,n,t,o){var l,r,i,s,u,a,p,f,h,m,g,k,y,$,d,b,x,v,_,O,q,E=e,S=E.name,L=E.type,R=E.modifier,j=E.token,D=E.mline,N=E.inter,z=N?S+".inside":S,F=E.esc,M=!!F,P="",T="",A="",I="",G=E.$id||S,H=t.stack;if(E.status&=an,E.$msg=E.msg||null,_=t.line,O=n.pos,Dn===L&&(E.status&=un),d=E.status&rn,i=0,s=0,t.block&&t.block.name===S?(s=1,i=1,$=z,l=t.block.end,f=t.block.sp,m=t.block.ip,h=t.block.ep,P=t.block.s,T=t.block.i):!t.block&&(l=C(j,n))&&(s=1,$=S,b=n.pos,f=[_,O],m=[[_,b],[_,b]],h=[_,b],P=n.sel(O,b),T="",I="",t.block={name:S,end:l,sp:f,ip:m,ep:h,s:P,i:T,e:I}),s){if(v=H.length,r=ht===l.type,N){if(r&&i&&n.sol())return E.status&=un,t.block=null,!1;if(!i)return b=n.pos,o.T=L,o.id=S,o.type=R||$,o.str=n.sel(O,b),o.match=null,o.pos=[_,O,_,b],c(H,v,B(E,d,0,G)),R||$}if(b=n.pos,u=C(l,n),p=D,a=0,u)$=r?z:S,I=n.sel(b,n.pos);else if(x=n.pos,k=!1,M||bt!==l.ptype&&dt!==l.ptype&&$t!==l.ptype)for(;!n.eol();){if(b=n.pos,!k&&C(l,n)){N&&n.pos>b&&b>x?($=z,n.bck(b),a=1):($=S,u=1),I=n.sel(b,n.pos);break}y=n.nxt(1),A+=y,k=M&&!k&&F===y,b=n.pos}else(q=C(l,n,!0,!0))?(N&&n.pos>b+q[1].length?($=z,n.mov(-q[1].length),a=1):($=S,u=1),I=n.sel(b,n.pos)):(n.end(),$=z,a=1,A=n.sel(b,n.pos));return p=D||M&&k,T+=A,m[1]=[_,b],h=[_,n.pos],u||!p&&!a?t.block=null:(t.block.ip=m,t.block.ep=h,t.block.i=T,t.block.e=I,c(H,v,B(E,d,0,G))),o.T=L,o.id=S,o.type=R||$,o.str=n.sel(O,n.pos),o.match=null,o.pos=[_,O,h[0],h[1]],t.block||(g=P+T+I,o.block={str:g,match:[g,T,P,I],part:[g,P,T,I],pos:[[f[0],f[1],h[0],h[1]],[f[0],f[1],m[0][0],m[0][1]],[m[0][0],m[0][1],m[1][0],m[1][1]],[m[1][0],m[1][1],h[0],h[1]]]}),R||$}return E.status&&E.$msg&&(E.$msg=w(E.$msg,S,!0)),!1}function J(e,n,t,o){var l,r,i,s,u,a,p,f,m,g,k,y,$,d,b,x=e,v=x.type,w=(x.name,x.token),_=w.length,O=x.modifier;if(x.status&=an,x.$msg=x.msg||null,y=t.stack,f=n.pos,m=y.length,a=0,p=0,d=x.$id||h(),Nn===v){for(x.status|=rn,$=[],g=0;_>g;g++){if(l=B(w[g],1,O,d),r=Y(l,n,t,o),l.status&rn&&(a++,$.push(H(l))),!1!==r)return r;l.status&sn&&(p++,n.pos>f&&n.bck(f),y.length>m&&(y.length=m))}return a>0?x.status|=rn:x.status&=un,_===p&&a>0?x.status|=sn:x.status&=an,x.status&&!x.$msg&&$.length&&(x.$msg=$.join(" | ")),!1}if(Bn&v){b=!!(v&zn),b?x.status|=rn:x.status&=un,k=0;do l=B(w[k++],b,O,d),r=Y(l,n,t,o);while(_>k&&!1===r&&!(l.status&rn));if(!1!==r){if(!0!==r||Sn!==l.type)for(g=_-1;g>=k;g--)c(y,m+_-g-1,B(w[g],1,O,d));return r}return l.status&sn?(b?x.status|=sn:x.status&=an,n.pos>f&&n.bck(f),y.length>m&&(y.length=m)):b&&l.status&rn&&(x.status|=sn),x.status&&!x.$msg&&(x.$msg=H(l)),!1}if(Cn===v)return x.status=0,!1;if(In===v)return x.status=0,!1;for(i=x.found,s=x.min,u=x.max,x.status=0,$=[],g=0;_>g;g++){if(l=B(w[g],1,O,d),r=Y(l,n,t,o),!1!==r){if(++i,u>=i)return x.found=i,c(y,m,B(x,0,0,d)),x.found=0,r;break}l.status&rn&&(a++,$.push(H(l))),l.status&sn&&(n.pos>f&&n.bck(f),y.length>m&&(y.length=m))}return s>i&&(x.status|=rn),(i>u||s>i&&a>0)&&(x.status|=sn),x.status&&!x.$msg&&$.length&&(x.$msg=$.join(" | ")),!1}function Q(e,n){var t=this;t.id=e?m("state"):"state",n instanceof Q?(t.line=n.line,t.bline=n.bline,t.status=n.status,t.stack=n.stack.slice(),t.block=n.block,t.token=n.token,t.status&on?(t.queu=n.queu,t.symb=n.symb,t.ctx=n.ctx,t.err=n.err):(t.queu=null,t.symb=null,t.ctx=null,t.err=null),t.$eol$=n.$eol$,t.$blank$=n.$blank$):(t.line=-1,t.bline=-1,t.status=n||0,t.stack=[],t.block=null,t.token=null,t.status&on?(t.queu=[],t.symb={},t.ctx=[],t.err={}):(t.queu=null,t.symb=null,t.ctx=null,t.err=null),t.$eol$=!0,t.$blank$=!0),t.toString=function(){return t.id+"_"+t.line+"_"+t.bline+"_"+(t.block?t.block.name:"0")}}function X(e){e.id=null,e.line=null,e.bline=null,e.status=null,e.stack=null,e.block=null,e.token=null,e.queu=null,e.symb=null,e.ctx=null,e.err=null}function Z(e,n,t){var o=new String(e);return o.start=n||0,o.pos=t||0,o.sol=function(){return 0===o.pos},o.eol=function(){return o.pos>=o.length},o.end=function(){return o.pos=o.length,o},o.mov=function(e){return o.pos=0>e?it(0,o.pos+e):st(o.length,o.pos+e),o},o.bck=function(e){return o.pos=it(0,e),o},o.sft=function(){return o.start=o.pos,o},o.nxt=function(e,n){var t,l,r="";if(!0===e){for(n=n||Z.$NONSPC$;o.pos-1&&t[e].splice(n,1));r=0,o.$lang=null,i=null}},dispose:function(){o.unhook(),o.$parser&&o.$parser.dispose(),o.$parser=null,o.$lang=null}}}var tn=1,on=2,ln=32,rn=4,sn=8,un=~rn,an=~sn,cn=rn|sn,pn=0,fn=4,hn=8,mn=16,gn=17,kn=32,yn=33,$n=128,dn=129,bn=2,xn=4,vn=8,wn=4,_n=8,On=9,qn=16,En=32,Sn=128,Ln=256,Rn=512,jn=1024,Dn=1025,Nn=2048,zn=4096,Fn=8192,Mn=8193,Pn=8194,Tn=8195,An=16384,Cn=An,In=16385,Gn=32768,Bn=zn|Gn,Hn=Nn|zn|Fn|An|Gn,Un={action:wn,simple:Rn,block:jn,comment:Dn,alternation:Nn,sequence:zn,repeat:Fn,zeroorone:Mn,zeroormore:Pn,oneormore:Tn,positivelookahead:Cn,negativelookahead:In,ngram:Gn},Yn="$|SOF|$",Kn="$|NONBLANK|$",Vn="$|SOL|$",Wn="$|EOL|$",Jn="$|ENDLINE|$",Qn="$|EMPTY|$",Xn="$|NONSPACE|$",Zn=void 0,et="prototype",nt="hasOwnProperty",tt="propertyIsEnumerable",ot=Object[et],lt=ot.toString,rt=Object.create,it=Math.max,st=Math.min,ut="toLowerCase",at="charAt",ct=1/0,pt=4,ft=8,ht=16,mt=32,gt=33,kt=34,yt=64,$t=128,dt=129,bt=130,xt=256,vt=512,wt=1024,_t=2048,Ot=4096,qt=$t|mt,Et=$t|xt,St=_t|xt,Lt=$t|xt|_t,Rt={"[object Number]":mt,"[object String]":$t,"[object Array]":xt,"[object RegExp]":_t,"[object Date]":Ot,"[object Function]":wt,"[object Object]":vt},jt=/^\s+|\s+$/g,Dt=String[et].trim?function(e){return e.trim()}:function(e){return e.replace(jt,"")},Nt=function(e,n){return n.length-e.length},zt=/\r\n|\r|\n/g,Ft=/[\-_]/g,Mt=0,Pt=/([.*+?^${}()|[\]\/\\\-])/g,Tt=/[&"'<>]/g,At=/^([.!&\[\]{}()*+?\/|'"]|\s)/,Ct="(\\s|\\W|$)",It=/[*+]$/;Z.$SPC$=/^[\s\u00a0]+/,Z.$NONSPC$=/[^\s\u00a0]/,Z.$NOTEMPTY$=/\S/,Z.$SPACE$=/^\s*/;var Gt=k({constructor:function(e,n,t){var o=this;o.$grammar=e,o.$DEF=n||null,o.$ERR=t||null,o.DEF=o.$DEF,o.ERR=o.$ERR,o.$folders=[]},$grammar:null,$folders:null,$n$:"name",$t$:"type",$v$:"token",$DEF:null,$ERR:null,DEF:null,ERR:null,dispose:function(){var e=this;return e.$grammar=null,e.$folders=null,e.$n$=e.$t$=e.$v$=null,e.$DEF=e.$ERR=e.DEF=e.ERR=null,e},token:function(e,n){var t,o,l,r,i,s,u,a,c,f,h,m,g,k,y,$=this,d=$.$grammar,b=d.Style,x=$.DEF,v=$.ERR,w={},_=$.$n$,O=$.$t$,q=$.$v$,E=d.$interleaved,S=d.$parser,L=S.length,R=E?E.length:0;if(e.sol()&&(n.$eol$&&(n.$blank$&&(n.bline=n.line),n.$eol$=!1,n.line++),n.$blank$=n.bline+1===n.line),n.$actionerr$=!1,r=n.stack,i=n.line,s=e.pos,h=!1,g=!0,m=!1,k=!1,y=n.block?n.block.name:Zn,r.length&&qn===r[r.length-1].type&&e.sol()&&r.pop(),(!r.length||Ln!==r[r.length-1].type&&y!==r[r.length-1].name)&&e.spc()&&(g=!1,k=!0),w[_]=null,w[O]=x,w[q]=null,g)for(l=new G,u=0;g&&(r.length||L>u)&&!e.eol();){if(c=e.pos,f=r.length,R&&!n.block){for(a=0;R>a;a++)if(t=E[a],h=Y(t,e,n,l),!1!==h){g=!1,n.token=t;break}if(!g)break}if(!r.length&&u>=L)break;if(t=r.length?r.pop():S[u++],h=Y(t,e,n,l),!1===h){if(t.status&cn){p(r,t.$id),e.nxt(!0)||(e.spc(),k=!0),m=!0,g=!1,n.token=t; -break}}else{if(r.length&&wn===r[r.length-1].type)for(;r.length&&wn===r[r.length-1].type;)o=r.pop(),K(o,e,n,l),o.status&sn&&(n.$actionerr$=!0);else if(r.length>1&&e.eol()&&jn&r[r.length-1].type&&n.block&&n.block.name===r[r.length-1].name)for(a=r.length-2;a>=0&&wn===r[a].type;)o=r[a--],K(o,e,n,l),o.status&sn&&(n.$actionerr$=!0);if(!0!==h){g=!1,n.token=t;break}}}return g&&e.nxt(1),w[q]=e.cur(1),!1!==h?(h=b[h]||x,w[_]=t.name):m?(h=v,n.status&on&&U(n,i,s,i,e.pos,t)):h=x,w[O]=h,n.$eol$=e.eol(),n.$blank$=n.$blank$&&(k||n.$eol$),w},autocompletion:function(e,n){return D(e,n||[])},tokenize:function(e,n){var t=this,o=[];if(e.eol())n.line++,n.$blank$&&n.bline++;else for(;!e.eol();)o.push(t.token(e,n));return o},parse:function(e,n){var t,o,r,i,s,u=this,a=(e||"").split(zt),c=a.length,p=null;if(n=n||tn,o=!!(n&on),r=!!(n&tn),t=new Q(0,n),t.$full_parse$=!0,l(function(e){a[e]+="\n"},0,c-2),r?p=l(n&ln?function(e,n){n._=n._.concat(u.tokenize(Z(a[e]),t,e))}:function(e,n){n._.push(u.tokenize(Z(a[e]),t,e))},0,c-1,{_:[]})._:l(function(e){var n=Z(a[e]);if(n.eol())t.line++,t.$blank$&&t.bline++;else for(;!n.eol();)u.token(n,t)},0,c-1),o&&t.queu&&t.queu.length)for(;t.queu.length;)i=t.queu.shift(),U(t,i[1],i[2],i[3],i[4],null,i[5]);return s=r&&o?{tokens:p,errors:t.err}:r?p:t.err,X(t),s},iterator:function(){},validate:function(){},autocomplete:function(){},indent:function(){},fold:function(){}}),Bt=k(Gt,{constructor:function(e,n){var t=this;Gt.call(t,e,"",""),t.$v$="content",t.DEF=n||t.$DEF,t.ERR=t.$ERR},tokenize:function(e,n){var o,l=this,r=[],i=[],s=null,u=function(e){return e.content},a=function(e){return l.$DEF===e.type?e.content:e};if(e.eol())n.line++,n.$blank$&&n.bline++;else for(;!e.eol();)o=l.token(e,n),n.$actionerr$?(i.length&&(r=r.concat(t(i,u))),r.push(o.content),i.length=0,s=null):(s!==o.name&&(i.length&&(r=r.concat(t(i,a))),i.length=0,s=o.name),i.push(o));return i.length&&(r=r.concat(t(i,a))),i.length=0,s=null,r}}),Ht=e.PrismGrammar={VERSION:"3.0.0",clone:r,extend:i,pre_process:P,parse:T,getMode:nn,Parser:Bt};return e.PrismGrammar}); \ No newline at end of file +**/!function(e,t,n){"use strict";var o;"object"==typeof module&&module.exports?module.exports=n.call(e,{}):"undefined"!=typeof System&&"function"==typeof System.register&&"function"==typeof System["import"]?System.register(t,[],function(o){o(t,n.call(e,{}))}):"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(t)?define(t,["require","exports","module"],function(){return n.call(e,{})}):t in e||(e[t]=o=n.call(e,{}))&&"function"==typeof define&&define.amd&&define(function(){return o})}(this,"PrismGrammar",function(e){"use strict";function t(e){var t=0;return null===e?t=hn:!0===e||!1===e||e instanceof Boolean?t=yn:Xt===e?t=fn:(t=Rn[on.call(e)]||pn,t=mn===t||e instanceof Number?isNaN(e)?kn:isFinite(e)?mn:gn:$n===t||e instanceof String?1===e.length?dn:$n:xn===t||e instanceof Array?xn:_n===t||e instanceof RegExp?_n:On===t||e instanceof Date?On:wn===t||e instanceof Function?wn:vn===t?vn:pn),t}function n(e,t,n,o){var r,l,i,s,u,a,c=e.length;if(arguments.length<4&&(o=c-1),0>o&&(o+=c),arguments.length<3&&(n=0),n>o)return[];if(n===o)return[t(e[n],n,n,o)];for(i=o-n+1,s=15&i,u=1&s,a=new Array(i),u&&(a[0]=t(e[n],n,n,o)),r=u;s>r;r+=2)l=n+r,a[r]=t(e[l],l,n,o),a[r+1]=t(e[l+1],l+1,n,o);for(r=s;i>r;r+=16)l=n+r,a[r]=t(e[l],l,n,o),a[r+1]=t(e[l+1],l+1,n,o),a[r+2]=t(e[l+2],l+2,n,o),a[r+3]=t(e[l+3],l+3,n,o),a[r+4]=t(e[l+4],l+4,n,o),a[r+5]=t(e[l+5],l+5,n,o),a[r+6]=t(e[l+6],l+6,n,o),a[r+7]=t(e[l+7],l+7,n,o),a[r+8]=t(e[l+8],l+8,n,o),a[r+9]=t(e[l+9],l+9,n,o),a[r+10]=t(e[l+10],l+10,n,o),a[r+11]=t(e[l+11],l+11,n,o),a[r+12]=t(e[l+12],l+12,n,o),a[r+13]=t(e[l+13],l+13,n,o),a[r+14]=t(e[l+14],l+14,n,o),a[r+15]=t(e[l+15],l+15,n,o);return a}function o(e,t,n,o,r){var l,i,s,u,a,c=e.length,p=n;if(arguments.length<5&&(r=c-1),0>r&&(r+=c),arguments.length<4&&(o=0),o>r)return p;if(o===r)return t(p,e[o],o);for(s=r-o+1,u=15&s,a=1&u,a&&(p=t(p,e[o],o)),l=a;u>l;l+=2)i=o+l,p=t(t(p,e[i],i),e[i+1],i+1);for(l=u;s>l;l+=16)i=o+l,p=t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(p,e[i],i),e[i+1],i+1),e[i+2],i+2),e[i+3],i+3),e[i+4],i+4),e[i+5],i+5),e[i+6],i+6),e[i+7],i+7),e[i+8],i+8),e[i+9],i+9),e[i+10],i+10),e[i+11],i+11),e[i+12],i+12),e[i+13],i+13),e[i+14],i+14),e[i+15],i+15);return p}function r(e,t,n,o){if(t>n)return o;if(t===n)return e(t,o,t,n),o;var r,l,i=n-t+1,s=15&i,u=1&s;for(u&&e(t,o,t,n),r=u;s>r;r+=2)l=t+r,e(l,o,t,n),e(++l,o,t,n);for(r=s;i>r;r+=16)l=t+r,e(l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n),e(++l,o,t,n);return o}function l(e,n){var o,r,i,s,u=t(e),a=0;if(mn===t(n)?n>0?(a=n,n=!0):n=!1:n=!1!==n,vn===u){r={};for(i in e)e[en](i)&&e[tn](i)&&(o=t(e[i]),r[i]=vn===o?n?l(e[i],a>0?a-1:n):e[i]:xn===o?n?l(e[i],a>0?a-1:n):e[i].slice():On===o?new Date(e[i]):$n&o?e[i].slice():mn&o?0+e[i]:e[i])}else if(xn===u)for(s=e.length,r=new Array(s),i=0;s>i;i++)o=t(e[i]),r[i]=vn===o?n?l(e[i],a>0?a-1:n):e[i]:xn===o?n?l(e[i],a>0?a-1:n):e[i].slice():On===o?new Date(e[i]):$n&o?e[i].slice():mn&o?0+e[i]:e[i];else r=On===u?new Date(e):$n&u?e.slice():mn&u?0+e:e;return r}function i(){var e,n,o,r,s,u,a,c,p,f,h=arguments,m=h.length;if(1>m)return null;for(n=l(h[0]),o=1;m>o;o++)if(e=h[o])for(r in e)if(e[en](r)&&e[tn](r))if(n[en](r)&&n[tn](r)){if(p=t(n[r]),f=t(e[r]),vn===p&&vn===f)n[r]=i(n[r],e[r]);else if(xn===p&&xn===f){if(a=n[r],c=e[r],u=c.length,!u)continue;if(a.length)for(s=0;u>s;s++)0>a.indexOf(c[s])&&a.push(c[s]);else n[r]=c.slice()}}else n[r]=l(e[r]);return n}function s(e,n){return n||xn!==t(e)?[e]:e}function u(e,n){return e=s(e),(n||xn!==t(e[0]))&&(e=[e]),e}function a(e,n){return $n&t(n)&&$n&t(e)&&n.length&&n.length<=e.length&&n===e.substr(0,n.length)}function c(e,t,n){return tn&&e[o-n-1].$id===t;)n++;n&&(e.length=o-n)}return e}function f(e,t,n){return n?e[t]=Xt:delete e[t],e}function h(e){return(e||"id_")+ ++Mn}function m(e){return(e||"uuid")+"_"+ ++Mn+"_"+(new Date).getTime()}function g(){var e,n,o,r,l,i,s=arguments,u=s.length;for(e=s[0]||{},l=1;u>l;l++)if(n=s[l],vn===t(n))for(r in n)n[en](r)&&n[tn](r)&&(o=n[r],i=t(o),e[r]=mn&i?0+o:On&i?new Date(o):En&i?o.slice():o);return e}function k(e,t){var n,o=arguments.length,r="constructor";return 0===o?(e=Object,t={}):1===o?(t=e||{},e=Object):(e=e||Object,t=t||{}),t[en](r)||(t[r]=function(){}),n=t[r],delete t[r],n[Zt]=g(rn(e[Zt]),t),n[Zt][r]=n,n}function y(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"}function $(e){return"&#"+e.charCodeAt(0)+";"}function d(e,t){return e.replace(Tn,t?y:$)}function b(e){return e.replace(Pn,"\\$1")}function x(e,t){return new RegExp(e,t||"")}function v(e,t,n,o){var r,l,i,s,u=e.pos,a=e.length,c="",p=!!n;if(p){for(o=!!o,l=!1,s=0;a>u&&(r=e[an](u++),t!==r||l);)i=n===r,l=!l&&i,o?(i&&s++,(!i||2&s)&&(c+=r,s=0)):c+=r;2&s&&(c+=n)}else for(;a>u&&(r=e[an](u++),t!==r);)c+=r;return e.pos=u,c}function w(e,n,o){var r,l,i,s,u,a=!0===o?0:1;for($n&t(n)&&(n=[n,n,n],a=0),l=e.length,u="",r=0;l>r;)i=e[an](r),l>r+1&&"$"===i?(s=e.charCodeAt(r+1),36===s?(u+="$",r+=2):s>=48&&57>=s?(u+=n[a+s-48]||"",r+=2):(u+=i,r+=1)):(u+=i,r+=1);return u}function _(e,n,o,r){if(!e||(mn|_n)&t(e))return e;var l,i=n?n.length||0:0,s="";if($n&t(r)?s=r:r&&(s=Cn),i&&n===e.substr(0,i)){var u,a,c,l,p,f=e.substr(i),h=f[an](0),m="";for(l=f.length;l--&&(p=f[an](l),h!==p);)"i"===p.toLowerCase()&&(m="i");return u=f.substring(1,l),a="^("+u+")",o[a]||(c=x(a,m),o[a]=c),o[a]}return s?(a="^("+b(e)+")"+s,o[a]||(c=x(a,m),o[a]=c),o[a]):e}function O(e,o,r){var l,i="";return $n&t(o)?i=o:o&&(i=Cn),l=n(e.sort(Nn),b).join("|"),[x("^("+l+")"+i,r?"i":""),1]}function q(e,n,o,r){var l=t(n);if(mn===l)return n;if(r[e])return r[e];o=o||0;var i,s=0;return n&&n.isCharList&&(s=1,f(n,"isCharList")),i=hn===l?new A(dt,e,n,hn,o):dn===l?new A(dt,e,n,dn,o):Sn&l?new A(dt,e,n,_n,o):$n&l?new A(dt,e,n,s?bn:$n,o):n,r[e]=i}function E(e,n,o,r,l,i,u){if(u[e])return u[e];var c,p,f,h,m,g,k,y=0,$=0,d=1,b=$n&t(r)?!0:!!r;if(c=s(n),f=c.length,1===f)k=q(e,_(c[0],o,i,r),0,u);else if(f>1){for(h=(f>>>1)+1,p=0;h>=p;p++)m=t(c[p]),g=t(c[f-1-p]),(dn!==m||dn!==g)&&(d=0),xn&m||xn&g?y=1:(_n&m||_n&g||a(c[p],o)||a(c[f-1-p],o))&&($=1);if(d&&!b)c=c.slice().join(""),c.isCharList=1,k=q(e,c,0,u);else if(!b||y||$)if(y||$){for(p=0;f>p;p++)c[p]=xn&t(c[p])?E(e+"_"+p,c[p],o,r,l,i,u):q(e+"_"+p,_(c[p],o,i),p,u);k=f>1?new A(bt,e,c):c[0]}else{for(c=c.sort(Nn),p=0;f>p;p++)c[p]=q(e+"_"+p,_(c[p],o,i),p,u);k=f>1?new A(bt,e,c):c[0]}else k=q(e,O(c,r,l),0,u)}return u[e]=k}function S(e,n,o,l,i){if(i[e])return i[e];var s=u(n),c=[],p=[];return r(function(n){var r,u;r=q(e+"_0_"+n,_(s[n][0],o,l),n,i),u=s[n].length>1?_n!==r.ptype||$n!==t(s[n][1])||a(s[n][1],o)?q(e+"_1_"+n,_(s[n][1],o,l),n,i):s[n][1]:r,c.push(r),p.push(u)},0,s.length-1),i[e]=new A(xt,e,[c,p])}function L(e,t){var n=u(e.tokens.slice());r(function(e){var o=n[e][0],r=n[e].length>1?n[e][1]:n[e][0],l=n[e].length>2?n[e][2]:"";null===r?(t.line=t.line||[],t.line.push(o)):(t.block=t.block||[],t.block.push([o,r,l]))},0,n.length-1)}function R(e,t,o,r){var l=e.meta||o,i=!(!e.caseInsesitive&&!e.ci),s=n(t,function(e){return{word:e,meta:l,ci:i}});return r.autocomplete=(r.autocomplete||[]).concat(s),s}function j(e){e.Lex||(e.Lex={}),e.Syntax||(e.Syntax={});var n,o,r,l,s,u,a,c,p,h,m,g=e.Lex,k=e.Syntax,y=[g,k],$=y.length;for(m=0;$>m;){h=y[m++];for(r in h)h[en](r)&&(n=r.split(":"),o=n[1]&&Dn(n[1]).length?Dn(n[1]):null,n=Dn(n[0]),n.length||(n=r,o=null),n!==r&&(h[n]=h[r],f(h,r),o&&(o=o[un](),l=h[n],s=t(l),vn===s?h[n].type||(h[n].type=o):(h[n]={type:o},"error"===o?(h[n].type="action",h[n].error=l):"nop"===o?(h[n].type="action",h[n].nop=!0):"group"===o?(h[n].type="sequence",h[n].tokens=l):"action"===o&&$n===s?h[n][l]=!0:h[n].tokens=l))),g===h&&(Ln&t(h[n])&&(h[n]={type:"simple",tokens:h[n]}),l=h[n],l.type&&(c=l.type=l.type[un](),"line-block"===c?(l.type="block",l.multiline=!1,l.escape=!1):"escaped-line-block"===c?(l.type="block",l.multiline=!1,l.escape="\\"):"escaped-block"===c&&(l.type="block",l.multiline=!0,l.escape="\\"))))}h=g;for(n in h)if(h[en](n))for(l=h[n];l.extend;)u=l.extend,f(l,"extend"),a=g[u],a&&(Ln&t(a)&&(a=g[u]={type:"simple",tokens:a}),l=i(a,l));h=g;for(n in h)h[en](n)&&(l=h[n],l.type?(c=l.type=l.type[un](),"line-block"===c?(l.type="block",l.multiline=!1,l.escape=!1):"escaped-line-block"===c?(l.type="block",l.multiline=!1,l.escape="\\"):"escaped-block"===c&&(l.type="block",l.multiline=!0,l.escape="\\")):l["escaped-line-block"]?(l.type="block",l.multiline=!1,l.escape||(l.escape="\\"),l.tokens=l["escaped-line-block"],f(l,"escaped-line-block")):l["escaped-block"]?(l.type="block",l.multiline=!0,l.escape||(l.escape="\\"),l.tokens=l["escaped-block"],f(l,"escaped-block")):l["line-block"]?(l.type="block",l.multiline=!1,l.escape=!1,l.tokens=l["line-block"],f(l,"line-block")):l.comment?(l.type="comment",l.escape=!1,l.tokens=l.comment,f(l,"comment")):l.block?(l.type="block",l.tokens=l.block,f(l,"block")):l.simple?(l.type="simple",l.tokens=l.simple,f(l,"simple")):l.nop?(l.type="action",l.action=["nop",l.nop,!1],l.nop=!0):l.error?(l.type="action",l.action=["error",l.error,!!l["in-context"]],f(l,"error")):l[en]("context")?(l.type="action",l.action=[l.context?"context-start":"context-end",l.context,!!l["in-context"]],f(l,"context")):l.indent?(l.type="action",l.action=["indent",l.indent,!!l["in-context"]],f(l,"indent")):l.outdent?(l.type="action",l.action=["outdent",l.outdent,!!l["in-context"]],f(l,"outdent")):l.unique?(l.type="action",l.action=["unique",$n&t(l.unique)?["_DEFAULT_",l.unique]:l.unique,!!l["in-context"]],f(l,"unique")):l.push?(l.type="action",l.action=["push",l.push,!!l["in-context"]],f(l,"push")):l[en]("pop")?(l.type="action",l.action=["pop",l.pop,!!l["in-context"]],f(l,"pop")):l.type="simple","action"===l.type?l.ci=!(!l.caseInsesitive&&!l.ci):"block"===l.type||"comment"===l.type?(l.multiline=l[en]("multiline")?!!l.multiline:!0,$n&t(l.escape)||(l.escape=!1)):"simple"===l.type&&(l.meta=l.autocomplete&&$n&t(l.meta)?l.meta:null,l.ci=!(!l.caseInsesitive&&!l.ci)));h=k;for(n in h)h[en](n)&&(l=h[n],vn!==t(l)||l.type?l.type&&(c=l.type=l.type[un](),"group"===c&&l.match?(s=t(l.match),$n&s?(p=l.match[un](),"alternation"===p||"either"===p?(l.type="alternation",f(l,"match")):"sequence"===p||"all"===p?(l.type="sequence",f(l,"match")):"zeroorone"===p?(l.type="zeroOrOne",f(l,"match")):"zeroormore"===p?(l.type="zeroOrMore",f(l,"match")):"oneormore"===p?(l.type="oneOrMore",f(l,"match")):(l.type="sequence",f(l,"match"))):xn&s&&(l.type="repeat",l.repeat=l.match,f(l,"match"))):"either"===c?l.type="alternation":"all"===c?l.type="sequence":"lookahead"===c&&(l.type="positiveLookahead")):l.ngram||l["n-gram"]?(l.type="ngram",l.tokens=l.ngram||l["n-gram"],l["n-gram"]?f(l,"n-gram"):f(l,"ngram")):l.sequence||l.all?(l.type="sequence",l.tokens=l.sequence||l.all,l.all?f(l,"all"):f(l,"sequence")):l.alternation||l.either?(l.type="alternation",l.tokens=l.alternation||l.either,l.either?f(l,"either"):f(l,"alternation")):l.zeroOrOne?(l.type="zeroOrOne",l.tokens=l.zeroOrOne,f(l,"zeroOrOne")):l.zeroOrMore?(l.type="zeroOrMore",l.tokens=l.zeroOrMore,f(l,"zeroOrMore")):l.oneOrMore?(l.type="oneOrMore",l.tokens=l.oneOrMore,f(l,"oneOrMore")):l.positiveLookahead||l.lookahead?(l.type="positiveLookahead",l.tokens=l.positiveLookahead||l.lookahead,l.lookahead?f(l,"lookahead"):f(l,"positiveLookahead")):l.negativeLookahead&&(l.type="negativeLookahead",l.tokens=l.negativeLookahead,f(l,"negativeLookahead")));return e}function D(e,n,o){if(o=o||{},n=n||[],!e||!e.length)return n;var r,l,i,s,u,a,c;for(r=0,l=e.length;l>r;r++)if(u=e[r])if(Lt===u.type)if(u.autocompletions)for(i=0,s=u.autocompletions.length;s>i;i++)c=u.autocompletions[i],o[en]("w_"+c.word)||(n.push(c),o["w_"+c.word]=1);else $n===u.token.ptype&&$n&t(u.token.pattern)&&u.token.pattern.length>1&&(o[en]("w_"+u.token.pattern)||(n.push({word:""+u.token.pattern,meta:u.name,ci:!!u.ci}),o["w_"+u.token.pattern]=1));else if(Dt===u.type)D(u.token,n,o);else if(Gt&u.type){i=0,s=u.token.length;do D([a=u.token[i++]],n,o);while(s>i&&(zt&a.type&&1>a.min||vt===a.type))}else zt&u.type&&D([u.token[0]],n,o);return n}function N(e,n,o,r){for(var l;$n&t(l=n[e]||o[e]);)e=l;return r?e:n[e]||o[e]||e}function z(e,t){return e.length>1?r(t?function(t,n){var o=n[n.length-1],r=e[t];o===r||n.push(r)}:function(t,n){var o=n[n.length-1],r=e[t];In.test(r)&&In.test(o)&&o===r||n.push(r)},1,e.length-1,[e[0]]):e}function F(e,o,r){var i,s,u,a,c,p,f,h,m,g,k,y,$,d,w,_=!1;if(w=e.modifier?e.modifier:null,h=new String(Dn(e)),h.pos=0,1===h.length)y=""+e,o[y]||r[y]||(o[y]={type:"simple",tokens:e}),e=y;else{for(i=[],s=[],u="",$=[];h.posc[0]&&(c[0]=0),2>c.length?c.push(c[0]):c[1]=c[1].length?parseInt(c[1],10)||cn:cn,0>c[1]&&(c[1]=0),k=s[s.length-1],y=""+k+["{",c[0],",",isFinite(c[1])?c[1]:"","}"].join(""),r[y]||(r[y]={type:"repeat",repeat:[c[0],c[1]],tokens:[k]}),s[s.length-1]=y):u+=m;else{if("}"===m){u+=m;continue}"&"===m||"!"===m?u+=m:"|"===m?(_=!1,s=z(s),s.length>1?(y=""+s.join(" "),r[y]||(r[y]={type:"sequence",tokens:s}),i.push(y)):s.length?i.push(s[0]):u+=m,s=[]):"("===m?($.push([s,i,u]),s=[],i=[],u=""):")"===m&&(s=z(s),s.length>1?(y=""+s.join(" "),r[y]||(r[y]={type:"sequence",tokens:s}),i.push(y)):s.length&&i.push(s[0]),s=[],i=z(i,1),i.length>1?(y=""+i.join(" | "),r[y]||(r[y]={type:"alternation",tokens:i})):i.length&&(y=i[0]),i=[],d=$.pop(),s=d[0],i=d[1],u=d[2],k=y,y="("+k+")",r[y]||(r[y]=l(N(k,o,r))),s.push(y))}}else u+=m;u.length&&(_?(s.length&&(k=s[s.length-1],y=k+"."+u,p=o[y]||r[y],p||(f=N(k,o,r),r[y]=$n&t(f)?new String(f):l(f),r[y].modifier=u),s[s.length-1]=y),_=!1):"0"===u?(o[Jt]||(o[Jt]={type:"simple",tokens:0}),s.push(Jt)):"^^"===u?(o[Ut]||(o[Ut]={type:"simple",tokens:wt}),s.push(Ut)):"^^1"===u?(o[Yt]||(o[Yt]={type:"simple",tokens:_t}),s.push(Yt)):"^"===u?(o[Kt]||(o[Kt]={type:"simple",tokens:qt}),s.push(Kt)):"$"===u?(o[Vt]||(o[Vt]={type:"simple",tokens:Ot}),s.push(Vt)):(o[u]||r[u]||(o[u]={type:"simple",tokens:u}),s.push(u))),u="",s=z(s),s.length>1?(y=""+s.join(" "),r[y]||(r[y]={type:"sequence",tokens:s}),i.push(y)):s.length&&i.push(s[0]),s=[],i=z(i,1),i.length>1?(y=""+i.join(" | "),r[y]||(r[y]={type:"alternation",tokens:i}),e=y):i.length&&(e=i[0]),i=[]}return w&&(o[e]||r[e])&&((o[e]||r[e]).modifier=w),e}function M(e,l,i,a,c,p,f,h,m,g,k){var y,$,d,b,x,v,w,_=null,O=null,q=null;if(wt===e||_t===e||qt===e||Ot===e)return new I(e,wt===e?Ut:_t===e?$T_FBNL$:qt===e?Kt:Vt,e,O);if(!1===e||0===e)return new I(Et,Jt,0,O);if(""===e)return new I(St,Qt,"",O);if(null===e)return new I(Lt,Wt,hn,O,q);if(xn&t(e)&&(d=e,e="NGRAM_"+d.join("_"),a[e]||(a[e]={type:"ngram",tokens:d})),e=""+e,h[e])return h[e];if(x=N(e,i,a),$n&t(x)&&(x=F(x,i,a),x=i[x]||a[x]||null),!x)return null;if(y=x.type?Ht[x.type[un]().replace(Fn,"")]||Lt:Lt,O=x.msg||null,q=x.modifier||null,$=x.tokens,Lt&y){if(wt===$||_t===$||qt===$||Ot===$||!1===$||0===$)return _=new I($||Et,e,$||0,O),h[e]=_,_;if(""===$)return _=new I(St,e,"",O),h[e]=_,_;if(null===$)return _=new I(Lt,e,hn,O,q),h[e]=_,_;if(!$)return null}if(vt&y)x[en]("action")?"nop"===x.action[0]?x.action[0]=ct:"error"===x.action[0]?x.action[0]=pt:"context-start"===x.action[0]?x.action[0]=ht:"context-end"===x.action[0]?x.action[0]=mt:"push"===x.action[0]?x.action[0]=gt:"pop"===x.action[0]?x.action[0]=kt:"unique"===x.action[0]?x.action[0]=ft:"indent"===x.action[0]?x.action[0]=yt:"outdent"===x.action[0]&&(x.action[0]=$t):x[en]("nop")?x.action=[ct,x.nop,!!x["in-context"]]:x[en]("error")?x.action=[pt,x.error,!!x["in-context"]]:x[en]("context")?x.action=[x.context?ht:mt,x.context,!!x["in-context"]]:x[en]("context-start")?x.action=[ht,x["context-start"],!!x["in-context"]]:x[en]("context-end")?x.action=[mt,x["context-end"],!!x["in-context"]]:x[en]("push")?x.action=[gt,x.push,!!x["in-context"]]:x[en]("pop")?x.action=[kt,x.pop,!!x["in-context"]]:x[en]("unique")?x.action=[ft,$n&t(x.unique)?["_DEFAULT_",x.unique]:x.unique,!!x["in-context"]]:x[en]("indent")?x.action=[yt,x.indent,!!x["in-context"]]:x[en]("outdent")&&(x.action=[$t,x.outdent,!!x["in-context"]]),x.nop&&(x.action[0]=ct),_=new I(vt,e,x.action.slice(),O,q),_.ci=!!x.caseInsensitive||x.ci,h[e]=_;else if($=s($),Lt&y){if(w=x.autocomplete?R(x,s(En&t(x.autocomplete)?x.autocomplete:x.tokens),e,k):null,v="undefined"!=typeof x.combine?x.combine:xn&t(x.tokens)?!0:!1,_=new I(Lt,e,E(e,$.slice(),l,v,!(!x.caseInsensitive&&!x.ci),p,f),O,q,null,w),h[e]=_,null!=x.except){var j,D,z=s(x.except),P=z.length,T=[];for(j=0;P>j;j++)z[j]&&(D=M(z[j],l,i,a,c,p,f,h,m,g,k),D&&T.push(D));T.length&&(_.except=T)}}else Rt&y?(jt===y&&L(x,g),_=new I(y,e,S(e,$.slice(),l,p,f),O),_.mline=x[en]("multiline")?!!x.multiline:!0,_.esc=x[en]("escape")?x.escape:!1,_.inter=!!c[e+".inside"],jt===y&&x.interleave&&m.push(B(_)),q&&(_.modifier=q),h[e]=_):Bt&y&&(It===y?(b=u($),_=n(b,function(t,n){return new I(It,e+"_NGRAM_"+n,null,O,q)}),h[e]=_,r(function(e){_[e].token=s(o(b[e],function(e,t){return e.concat(M(t,l,i,a,c,p,f,h,m,g,k))},[]))},0,b.length-1)):(At===y||Ct===y?_=new I(y,e,null,O,q):zt&y&&xn&t(x.repeat)?(_=new I(zt,e,null,O,q),_.min=x.repeat[0],_.max=x.repeat[1]):Ft===y?(_=new I(Ft,e,null,O,q),_.min=0,_.max=1):Mt===y?(_=new I(Mt,e,null,O,q),_.min=0,_.max=cn):Pt===y?(_=new I(Pt,e,null,O,q),_.min=1,_.max=cn):_=Dt===y?new I(Dt,e,null,O,q):new I(Nt,e,null,O,q),h[e]=_,_.token=s(o($,function(e,t){return e.concat(M(t,l,i,a,c,p,f,h,m,g,k))},[]))));return h[e]}function P(e){var n={};return e.Lex=e.Lex||{},e.Syntax=e.Syntax||{},e=j(e),e.Parser&&e.Parser.length&&r(function o(l,i){var s,u,a,c=i[l];n[c]||(xn&t(c)&&(s=c,c="NGRAM_"+s.join("_"),e.Syntax[c]||(e.Syntax[c]={type:"ngram",tokens:s})),u=N(c,e.Lex,e.Syntax),$n&t(u)&&(u=F(u,e.Lex,e.Syntax),u=e.Lex[u]||e.Syntax[u]||null),u&&(n[c]=u,a=u.type?Ht[u.type[un]().replace(Fn,"")]||Lt:Lt,Bt&a&&r(o,0,u.tokens.length-1,u.tokens)))},0,e.Parser.length-1,e.Parser),e}function T(e){var n,r,i,s,u,a,c,p,f,h,m,g,k;return e.__parsed?e:(n=e.RegExpID||null,i=e.Extra?l(e.Extra):{},s=e.Style?l(e.Style):{},u=null,a=e.Lex?l(e.Lex):{},c=e.Syntax?l(e.Syntax):{},p={},f={},h={},g={},k={},m=[],r=e.Parser?l(e.Parser):[],e=j({Style:s,Fold:u,Lex:a,Syntax:c,$parser:null,$interleaved:null,$comments:null,$autocomplete:null,$extra:i,__parsed:0}),e.$parser=o(r,function(e,o){var r=M(o,n,a,c,s,p,f,h,m,g,k)||null;return r&&(xn&t(r)?e=e.concat(r):e.push(r)),e},[]),e.$interleaved=m&&m.length?m:null,e.$comments=g,e.$autocomplete=k&&k.autocomplete&&k.autocomplete.length?k.autocomplete:null,e.__parsed=1,e)}function A(e,n,o,r,l){var i,s,u=this;i=u.type=e,u.name=n,u.pattern=o,s=u.ptype=r||$n,u.key=l||0,bt===i?u.key=!1!==l:xt===i?u.pattern[0]=new A(bt,n+"_Start",o[0],null,!1):hn===s?u.pattern=null:_n===s&&(u.pattern=_n&t(o)?[o,0]:[o[0],o[1]||0])}function C(e,n,o,r){var l,i,s,u,a,c,p,f,h,m,g,k=e,y=k.type,$=k.pattern,d=k.key;if(xt===y){if(l=k.name,s=$[0],u=$[1],c=C(s,n,o,r))return a=u[c[0]],f=t(a),h=s.pattern[c[0]].ptype,_n===h&&qn&f&&(p=mn&f?c[1][a+1]:w(a,c[1]),a=new A(dt,l+"_End",p,p.length>1?$n:dn)),a}else if(bt===y){for(m=0,g=$.length;g>m;m++)if(p=C($[m],n,o,r))return d?[m,p[1]]:p}else{if(i=k.ptype,hn===i)return!1!==o&&n.end(),[d,""];if(_n===i){if(p=n.slice(n.pos).match($[0]),p&&0===p.index)return!1!==o&&n.mov(p[$[1]||0].length),[d,$[1]>0?p[$[1]]:p]}else if(bn===i){if(!0===r){p=-1;var b,x;for(g=$.length-1;g>=0;g--)b=n.indexOf($[an](g),n.pos),b>-1&&(-1===p||p>b)&&(p=b,x=$[an](g));if(p>-1)return!1!==o&&(n.pos=p+1),[d,x]}else if(p=n[an](n.pos)||null,p&&-1<$.indexOf(p))return!1!==o&&n.mov(1),[d,p]}else if(dn===i){if(!0===r){if(p=n.indexOf($,n.pos),p>-1)return!1!==o&&(n.pos=p+1),[d,$]}else if(p=n[an](n.pos)||null,$===p)return!1!==o&&n.mov(1),[d,p]}else if($n===i)if(g=$.length,!0===r){if(p=n.indexOf($,n.pos),p>-1)return!1!==o&&(n.pos=p+g),[d,$]}else if($===n.substr(n.pos,g))return!1!==o&&n.mov(g),[d,$]}return!1}function I(e,t,n,o,r,l,i){var s=this;s.type=e,s.name=t,s.token=n,s.modifier=r||null,s.except=l||null,s.autocompletions=i||null,s.pos=null,s.msg=o||null,s.$msg=null,s.status=0,s.ci=!1,s.mline=!0,s.esc=!1,s.inter=!1,s.found=0,s.min=0,s.max=1,s.$id=null}function G(){var e=this;e.T=0,e.id=null,e.type=null,e.match=null,e.str="",e.pos=null,e.block=null}function B(e,t,n,o){var r=new I(e.type,e.name,e.token,e.msg,e.modifier,e.except,e.autocompletions);return r.ci=e.ci,r.mline=e.mline,r.esc=e.esc,r.inter=e.inter,r.found=e.found,r.min=e.min,r.max=e.max,t&&(r.status|=lt),n&&(r.modifier=n),o&&(r.$id=o),r}function H(e){var t=e.name;return e.$msg?e.$msg:e.status<?'Token "'+t+'" Expected':'Syntax Error: "'+t+'"'}function U(e,t,n,o,r,l,i){e.err[t+"_"+n+"_"+o+"_"+r+"_"+(l?l.name:"ERROR")]=[t,n,o,r,i||H(l)]}function Y(e,t,n,o){if(!e)return!1;var r=e.type,l=Bt&r?J:Rt&r?W:vt&r?K:V;return l(e,t,n,o)}function K(e,n,o,r){var l,i,s,u,a,c,p,f,h,m,g,k,y,$,d,b,x=e,v=x.token||null,_=x.ci,O=x.name,q=!(o.status&ot);if(x.status=0,x.$msg=null,q||!v||!r||!r.pos)return!0;if(b=!!(Rt&r.T),ct===v[0]||b&&!r.block)return!0;if(l=v[0],i=v[1],y=v[2],a=x.msg,c=o.queu,p=o.symb,f=o.ctx,b?(d=r.block.match||r.block.str,h=r.block.pos[0][0],m=r.block.pos[0][1],g=r.block.pos[0][2],k=r.block.pos[0][3]):(d=r.match||r.str,h=r.pos[0],m=r.pos[1],g=r.pos[2],k=r.pos[3]),pt===l)return!a&&$n&t(i)&&(a=i),x.$msg=a?w(a,d,!0):'Error "'+O+'"',U(o,h,m,g,k,x,H(x)),x.status|=it,!1;if(mt===l)f.length&&f.shift();else if(ht===l)f.unshift({symb:{},queu:[]});else if(kt===l){if(y){if(!f.length)return!0;c=f[0].queu}if(i){if(i=w(i,d),_&&(i=i[un]()),!c.length||i!==c[0][0])return c.length?(x.$msg=a?w(a,[c[0][0],i],!0):'Tokens do not match "'+c[0][0]+'","'+i+'"',$=H(x),U(o,c[0][1],c[0][2],c[0][3],c[0][4],x,$),U(o,h,m,g,k,x,$),c.shift()):(x.$msg=a?w(a,["",i],!0):'Token does not match "'+i+'"',$=H(x),U(o,h,m,g,k,x,$)),x.status|=it,!1;c.shift()}else c.shift()}else if(gt===l&&i){if(y){if(!f.length)return!0;c=f[0].queu}i=w(i,d),_&&(i=i[un]()),x.$msg=a?w(a,i,!0):'Token does not match "'+i+'"',c.unshift([i,h,m,g,k,H(x)])}else if(ft===l){if(y){if(!f.length)return!0;p=f[0].symb}if(s=i[1],u=i[0],s=w(s,d,!0),_&&(s=s[un]()),p[en](u)||(p[u]={}),p[u][en](s))return x.$msg=a?w(a,s,!0):'Duplicate "'+s+'"',$=H(x),U(o,p[u][s][0],p[u][s][1],p[u][s][2],p[u][s][3],x,$),U(o,h,m,g,k,x,$),x.status|=it,!1;p[u][s]=[h,m,g,k]}return!0}function V(e,t,n,o,r){var l,i=e,s=i.token,u=i.modifier,a=i.type,c=i.name,p=i.except,f=n.line,h=t.pos,m=null,g=!1;if(i.status&=ut,i.$msg=r?null:i.msg||null,p)for(var k=0,y=p.length;y>k;k++)if(l=p[k],i!==l&&Lt===l.type&&V(l,t,n,o,1))return t.bck(h),!1;return wt===a?g=0===n.line:_t===a?g=n.bline+1===n.line:qt===a?g=t.sol():Ot===a?(t.spc(),t.eol()?g=c:t.bck(h)):Et===a?(i.status=0,g=!0):St===a?(i.status<&&t.spc()&&!t.eol()?(t.bck(h),i.status|=it):g=!0,i.status&=st):hn===s?(t.end(),g=u||c):(m=C(s,t))&&(m=m[1],g=u||c),r?g:(!1!==g&&(o.T=a,o.id=c,o.type=g,o.str=t.sel(h,t.pos),o.match=m,o.pos=[f,h,f,t.pos]),!g&&i.status&&i.$msg&&(i.$msg=w(i.$msg,c,!0)),g)}function W(e,t,n,o){var r,l,i,s,u,a,p,f,h,m,g,k,y,$,d,b,x,v,_,O,q,E=e,S=E.name,L=E.type,R=E.modifier,j=E.token,D=E.mline,N=E.inter,z=N?S+".inside":S,F=E.esc,M=!!F,P="",T="",A="",I="",G=E.$id||S,H=n.stack;if(E.status&=ut,E.$msg=E.msg||null,_=n.line,O=t.pos,jt===L&&(E.status&=st),d=E.status<,i=0,s=0,n.block&&n.block.name===S?(s=1,i=1,$=z,r=n.block.end,f=n.block.sp,m=n.block.ip,h=n.block.ep,P=n.block.s,T=n.block.i):!n.block&&(r=C(j,t))&&(s=1,$=S,b=t.pos,f=[_,O],m=[[_,b],[_,b]],h=[_,b],P=t.sel(O,b),T="",I="",n.block={name:S,end:r,sp:f,ip:m,ep:h,s:P,i:T,e:I}),s){if(v=H.length,l=hn===r.type,N){if(l&&i&&t.sol())return E.status&=st,n.block=null,!1;if(!i)return b=t.pos,o.T=L,o.id=S,o.type=R||$,o.str=t.sel(O,b),o.match=null,o.pos=[_,O,_,b],c(H,v,B(E,d,0,G)),R||$}if(b=t.pos,u=C(r,t),p=D,a=0,u)$=l?z:S,I=t.sel(b,t.pos);else if(x=t.pos,k=!1,M||bn!==r.ptype&&dn!==r.ptype&&$n!==r.ptype)for(;!t.eol();){if(b=t.pos,!k&&C(r,t)){N&&t.pos>b&&b>x?($=z,t.bck(b),a=1):($=S,u=1),I=t.sel(b,t.pos);break}y=t.nxt(1),A+=y,k=M&&!k&&F===y,b=t.pos}else(q=C(r,t,!0,!0))?(N&&t.pos>b+q[1].length?($=z,t.mov(-q[1].length),a=1):($=S,u=1),I=t.sel(b,t.pos)):(t.end(),$=z,a=1,A=t.sel(b,t.pos));return p=D||M&&k,T+=A,m[1]=[_,b],h=[_,t.pos],u||!p&&!a?n.block=null:(n.block.ip=m,n.block.ep=h,n.block.i=T,n.block.e=I,c(H,v,B(E,d,0,G))),o.T=L,o.id=S,o.type=R||$,o.str=t.sel(O,t.pos),o.match=null,o.pos=[_,O,h[0],h[1]],n.block||(g=P+T+I,o.block={str:g,match:[g,T,P,I],part:[g,P,T,I],pos:[[f[0],f[1],h[0],h[1]],[f[0],f[1],m[0][0],m[0][1]],[m[0][0],m[0][1],m[1][0],m[1][1]],[m[1][0],m[1][1],h[0],h[1]]]}),R||$}return E.status&&E.$msg&&(E.$msg=w(E.$msg,S,!0)),!1}function J(e,t,n,o){var r,l,i,s,u,a,p,f,m,g,k,y,$,d,b,x=e,v=x.type,w=(x.name,x.token),_=w.length,O=x.modifier;if(x.status&=ut,x.$msg=x.msg||null,y=n.stack,f=t.pos,m=y.length,a=0,p=0,d=x.$id||h(),Dt===v){for(x.status|=lt,$=[],g=0;_>g;g++){if(r=B(w[g],1,O,d),l=Y(r,t,n,o),r.status<&&(a++,$.push(H(r))),!1!==l)return l;r.status&it&&(p++,t.pos>f&&t.bck(f),y.length>m&&(y.length=m))}return a>0?x.status|=lt:x.status&=st,_===p&&a>0?x.status|=it:x.status&=ut,x.status&&!x.$msg&&$.length&&(x.$msg=$.join(" | ")),!1}if(Gt&v){b=!!(v&Nt),b?x.status|=lt:x.status&=st,k=0;do r=B(w[k++],b,O,d),l=Y(r,t,n,o);while(_>k&&!1===l&&!(r.status<));if(!1!==l){if(!0!==l||Et!==r.type)for(g=_-1;g>=k;g--)c(y,m+_-g-1,B(w[g],1,O,d));return l}return r.status&it?(b?x.status|=it:x.status&=ut,t.pos>f&&t.bck(f),y.length>m&&(y.length=m)):b&&r.status<&&(x.status|=it),x.status&&!x.$msg&&(x.$msg=H(r)),!1}if(At===v)return x.status=0,!1;if(Ct===v)return x.status=0,!1;for(i=x.found,s=x.min,u=x.max,x.status=0,$=[],g=0;_>g;g++){if(r=B(w[g],1,O,d),l=Y(r,t,n,o),!1!==l){if(++i,u>=i)return x.found=i,c(y,m,B(x,0,0,d)),x.found=0,l;break}r.status<&&(a++,$.push(H(r))),r.status&it&&(t.pos>f&&t.bck(f),y.length>m&&(y.length=m))}return s>i&&(x.status|=lt),(i>u||s>i&&a>0)&&(x.status|=it),x.status&&!x.$msg&&$.length&&(x.$msg=$.join(" | ")),!1}function Q(e,t){var n=this;n.id=e?m("state"):"state",t instanceof Q?(n.line=t.line,n.bline=t.bline,n.status=t.status,n.stack=t.stack.slice(),n.token=t.token,n.block=t.block,n.status&ot?(n.queu=t.queu,n.symb=t.symb,n.ctx=t.ctx,n.err=t.err):(n.queu=null,n.symb=null,n.ctx=null,n.err=null),n.$eol$=t.$eol$,n.$blank$=t.$blank$):(n.line=-1,n.bline=-1,n.status=t||0,n.stack=[],n.token=null,n.block=null,n.status&ot?(n.queu=[],n.symb={},n.ctx=[],n.err={}):(n.queu=null,n.symb=null,n.ctx=null,n.err=null),n.$eol$=!0,n.$blank$=!0),n.toString=function(){return n.id+"_"+n.line+"_"+n.bline+"_"+(n.block?n.block.name:"0")}}function X(e){e.id=null,e.line=null,e.bline=null,e.status=null,e.stack=null,e.token=null,e.block=null,e.queu=null,e.symb=null,e.ctx=null,e.err=null}function Z(e,t,n){var o=new String(e);return o.start=t||0,o.pos=n||0,o.sol=function(){return 0===o.pos},o.eol=function(){return o.pos>=o.length},o.end=function(){return o.pos=o.length,o},o.mov=function(e){return o.pos=0>e?ln(0,o.pos+e):sn(o.length,o.pos+e),o},o.bck=function(e){return o.pos=ln(0,e),o},o.sft=function(){return o.start=o.pos,o},o.nxt=function(e,t){var n,r,l="";if(!0===e){for(t=t||Z.$NONSPC$;o.pos-1&&n[e].splice(t,1));l=0,o.$lang=null,i=null}},dispose:function(){o.unhook(),o.$parser&&o.$parser.dispose(),o.$parser=null,o.$lang=null}}}var nt=1,ot=2,rt=32,lt=4,it=8,st=~lt,ut=~it,at=lt|it,ct=0,pt=4,ft=8,ht=16,mt=17,gt=32,kt=33,yt=128,$t=129,dt=2,bt=4,xt=8,vt=4,wt=8,_t=9,Ot=16,qt=32,Et=128,St=256,Lt=512,Rt=1024,jt=1025,Dt=2048,Nt=4096,zt=8192,Ft=8193,Mt=8194,Pt=8195,Tt=16384,At=Tt,Ct=16385,It=32768,Gt=Nt|It,Bt=Dt|Nt|zt|Tt|It,Ht={action:vt,simple:Lt,block:Rt,comment:jt,alternation:Dt,sequence:Nt,repeat:zt,zeroorone:Ft,zeroormore:Mt,oneormore:Pt,positivelookahead:At,negativelookahead:Ct,ngram:It},Ut="$|SOF|$",Yt="$|NONBLANK|$",Kt="$|SOL|$",Vt="$|EOL|$",Wt="$|ENDLINE|$",Jt="$|EMPTY|$",Qt="$|NONSPACE|$",Xt=void 0,Zt="prototype",en="hasOwnProperty",tn="propertyIsEnumerable",nn=Object[Zt],on=nn.toString,rn=Object.create,ln=Math.max,sn=Math.min,un="toLowerCase",an="charAt",cn=1/0,pn=4,fn=8,hn=16,mn=32,gn=33,kn=34,yn=64,$n=128,dn=129,bn=130,xn=256,vn=512,wn=1024,_n=2048,On=4096,qn=$n|mn,En=$n|xn,Sn=_n|xn,Ln=$n|xn|_n,Rn={"[object Number]":mn,"[object String]":$n,"[object Array]":xn,"[object RegExp]":_n,"[object Date]":On,"[object Function]":wn,"[object Object]":vn},jn=/^\s+|\s+$/g,Dn=String[Zt].trim?function(e){return e.trim()}:function(e){return e.replace(jn,"")},Nn=function(e,t){return t.length-e.length},zn=/\r\n|\r|\n/g,Fn=/[\-_]/g,Mn=0,Pn=/([.*+?^${}()|[\]\/\\\-])/g,Tn=/[&"'<>]/g,An=/^([.!&\[\]{}()*+?\/|'"]|\s)/,Cn="(\\s|\\W|$)",In=/[*+]$/;Z.$SPC$=/^[\s\u00a0]+/,Z.$NONSPC$=/[^\s\u00a0]/,Z.$NOTEMPTY$=/\S/,Z.$SPACE$=/^\s*/;var Gn=k({constructor:function(e,t,n){var o=this;o.$grammar=e,o.$DEF=t||null,o.$ERR=n||null,o.DEF=o.$DEF,o.ERR=o.$ERR,o.$folders=[]},$grammar:null,$folders:null,$n$:"name",$t$:"type",$v$:"token",$DEF:null,$ERR:null,DEF:null,ERR:null,dispose:function(){var e=this;return e.$grammar=null,e.$folders=null,e.$n$=e.$t$=e.$v$=null,e.$DEF=e.$ERR=e.DEF=e.ERR=null,e},token:function(e,t){var n,o,r,l,i,s,u,a,c,f,h,m,g,k,y,$=this,d=$.$grammar,b=d.Style,x=$.DEF,v=$.ERR,w={},_=$.$n$,O=$.$t$,q=$.$v$,E=d.$interleaved,S=d.$parser,L=S.length,R=E?E.length:0;if(e.sol()&&(t.$eol$&&(t.$blank$&&(t.bline=t.line),t.$eol$=!1,t.line++),t.$blank$=t.bline+1===t.line),t.$actionerr$=!1,t.token=null,l=t.stack,i=t.line,s=e.pos,h=!1,g=!0,m=!1,k=!1,y=t.block?t.block.name:Xt,l.length&&Ot===l[l.length-1].type&&e.sol()&&l.pop(),(!l.length||St!==l[l.length-1].type&&y!==l[l.length-1].name)&&e.spc()&&(g=!1,k=!0),w[_]=null,w[O]=x,w[q]=null,g)for(r=new G,u=0;g&&(l.length||L>u)&&!e.eol();){if(c=e.pos,f=l.length,R&&!t.block){for(a=0;R>a;a++)if(n=E[a],h=Y(n,e,t,r),!1!==h){g=!1; +break}if(!g)break}if(!l.length&&u>=L)break;if(n=l.length?l.pop():S[u++],h=Y(n,e,t,r),!1===h){if(n.status&at){t.token=n,p(l,n.$id),e.nxt(!0)||(e.spc(),k=!0),m=!0,g=!1;break}}else{if(l.length&&vt===l[l.length-1].type)for(;l.length&&vt===l[l.length-1].type;)o=l.pop(),K(o,e,t,r),o.status&it&&(t.$actionerr$=!0);else if(l.length>1&&e.eol()&&Rt&l[l.length-1].type&&t.block&&t.block.name===l[l.length-1].name)for(a=l.length-2;a>=0&&vt===l[a].type;)o=l[a--],K(o,e,t,r),o.status&it&&(t.$actionerr$=!0);if(!0!==h){g=!1;break}}}return g&&e.nxt(1),w[q]=e.cur(1),!1!==h?(h=b[h]||x,w[_]=n.name):m?(h=v,t.status&ot&&U(t,i,s,i,e.pos,n)):h=x,w[O]=h,t.$eol$=e.eol(),t.$blank$=t.$blank$&&(k||t.$eol$),w},autocompletion:function(e){var t,n,o,r=e.stack,l={},i=D([e.token],[],l);for(t=r.length-1;t>=0;t--)if(n=r[t],o=n.type,zt&o){if(i=D([n],i,l),0