From 3b138be92a31c31ce43747cde8f5ec3b95cfd106 Mon Sep 17 00:00:00 2001 From: Nikos M Date: Wed, 5 Aug 2015 02:02:30 +0300 Subject: [PATCH] v. 0.10 re-upload --- build/prism_grammar.js | 4 ++-- build/prism_grammar.min.js | 2 +- src/main.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/prism_grammar.js b/build/prism_grammar.js index 2de0629..9426351 100644 --- a/build/prism_grammar.js +++ b/build/prism_grammar.js @@ -2313,8 +2313,8 @@ Parser[PROTO] = { else if ( true !== type ) { style = Style[type] || DEFAULT; - // match action error - if ( tokenizer.MTCH ) + // action error + if ( tokenizer.ACT ) { // empty the stack stack.empty('sID', tokenizer.sID); diff --git a/build/prism_grammar.min.js b/build/prism_grammar.min.js index dab073f..c80c3e7 100644 --- a/build/prism_grammar.min.js +++ b/build/prism_grammar.min.js @@ -6,4 +6,4 @@ * Transform a grammar specification in JSON format, into a syntax-highlighter for Prism * https://github.com/foo123/prism-grammar * -**/!function(t,n,e){"use strict";var r,l="object"==typeof module&&module.exports,o="function"==typeof define&&define.amd;l?module.exports=(module.$deps=module.$deps||{})[n]=module.$deps[n]||e.call(t,{NODE:module})||1:o&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(n)?define(n,["require","exports","module"],function(n,r,l){return e.call(t,{AMD:l})}):n in t||(t[n]=r=e.call(t,{})||1)&&o&&define(n,[],function(){return r})}(this,"PrismGrammar",function(t){"use strict";function n(t){var n=this;n._=null,n.s=t?""+t:"",n.start=n.pos=0,n.lCP=n.lCV=0,n.lS=0}function e(t){this._=t||[]}function r(t,n){var r=this;r.id=n?In("state"):"state",r.l=t||0,r.stack=new e,r.data=new e,r.col=0,r.indent=0,r.t=null,r.inBlock=null,r.endBlock=null}function l(t,n,e,r){var o=this;switch(o.$class=l,o.mt=O,o.tt=t||rn,o.tn=n,o.tk=r||0,o.tg=0,o.tp=null,o.p=null,o.np=null,o.tt){case rn:case ln:o.tp=e,o.get=ln===o.tt?Kn:Gn;break;case en:o.tp=e,o.p={},o.p[""+e.charAt(0)]=1,o.get=Un;break;case cn:o.tp=e[0],o.p=e[1].peek||null,o.np=e[1].negativepeek||null,o.tg=e[2]||0,o.get=Hn;break;case pn:o.tp=null,o.get=Zn}}function o(t,n,e){var r=this;r.$class=o,r.mt=A,r.tn=t,r.ms=n,r.ownKey=!1!==e}function s(t,n,e){var r=this;r.$class=s,r.mt=T,r.tn=t,r.s=new o(r.tn+"_Start",n,!1),r.e=e}function i(t,n,e,r){var o=mn(n);if(X===o)return n;if(!r[t]){e=e||0;var s,i=0;n&&n.isCharList&&(i=1,delete n.isCharList),s=pn&o?new l(pn,t,n,e):rn===o?new l(rn,t,n,e):en&o?i?new l(ln,t,n,e):new l(en,t,n,e):on&o?new l(cn,t,n,e):n,r[t]=s}return r[t]}function u(t,n,e,r,l,s){if(!s[t]){var c,a,p,f,h,g,k,d=0,m=0,E=1;if(c=Rn(n),p=c.length,1==p)k=i(t,Nn(c[0],e,l),0,s);else if(p>1){for(f=(p>>1)+1,a=0;f>=a;a++)h=mn(c[a]),g=mn(c[p-1-a]),(rn!==h||rn!==g)&&(E=0),on&h||on&g?d=1:(Mn(c[a],e)||Mn(c[p-1-a],e))&&(m=1);if(!E||r&&en&mn(r))if(!r||d||m){for(a=0;p>a;a++)c[a]=on&mn(c[a])?u(t+"_"+a,c[a],e,r,l,s):i(t+"_"+a,Nn(c[a],e,l),a,s);k=p>1?new o(t,c):c[0]}else k=i(t,jn(c,r),0,s);else c=c.slice().join(""),c.isCharList=1,k=i(t,c,0,s)}s[t]=k}return s[t]}function c(t,n,e,r,l){if(!l[t]){var o,u,c,a,p,f,h;for(a=[],p=[],o=yn(n),u=0,c=o.length;c>u;u++)f=i(t+"_0_"+u,Nn(o[u][0],e,r),u,l),h=o[u].length>1?cn!==f.tt||en!==mn(o[u][1])||Mn(o[u][1],e)?i(t+"_1_"+u,Nn(o[u][1],e,r),u,l):o[u][1]:f,a.push(f),p.push(h);l[t]=new s(t,a,p)}return l[t]}function a(t,n,e){var r=this;r.$class=a,r.tt=t||w,r.id=n,r.tk=e,r.REQ=0,r.ERR=0,r.ACT=0,r.CLONE=["tk"]}function p(t,n,e,r,l,o){var s=this;s.$class=p,s.tt=t,s.id=n,s.tk=e,s.REQ=0,s.ERR=0,s.ACT=0,s.mline="undefined"==typeof r?1:r,s.esc=l||"\\",s.inter=o,s.CLONE=["tk","mline","esc","inter"]}function f(t,n,e,r,l){var o=this;o.$class=f,o.tt=t||I,o.id=n||null,o.tk=null,o.ts=null,o.min=r||0,o.max=l||b,o.found=0,o.CLONE=["ts","min","max","found"],e&&o.set(e)}function h(t,n,e){f.call(this,t,n,e,1,1),this.$class=h}function g(t,n,e){f.call(this,t,n,e,1,1),this.$class=g}function k(t,n,e){f.call(this,t,n,e,1,1),this.$class=k}function d(t,n,e,r,l,o,s,i,v,R,y){var _,C,O,A,T,N,V,F,U,H,Z,W,Y,J,X,tn,nn,rn,ln,sn,un,cn,an=null;if(null===t)return new a(x,"EOL",t);if(""===t)return new a(S,"NONSPACE",t);if(!1===t||0===t)return new a(D,"EMPTY",t);if(on&mn(t)&&(tn=t,t="NGRAM_"+tn.join("_"),r[t]||(r[t]={type:"ngram",tokens:tn})),t=""+t,i[t])return i[t];if(e[t]?(_=e[t],gn&mn(_)&&(_=e[t]={type:"simple",tokens:_})):_=r[t]?r[t]:t,en&mn(_))if(tn=_,1===tn.length)_=e[tn]={type:"simple",tokens:tn};else if(ln=tn.split(" | ").map(xn),cn=ln.length,cn>1){for(un=cn-1;un>=0;un--)sn=ln[un],sn.length?e[sn]||r[sn]||(nn=sn.charAt(sn.length-1),rn=sn.slice(0,-1),e[rn]||r[rn]?"*"===nn?r[sn]={type:"group",match:"zeroOrMore",tokens:[rn]}:"+"===nn?r[sn]={type:"group",match:"oneOrMore",tokens:[rn]}:"?"===nn?r[sn]={type:"group",match:"zeroOrOne",tokens:[rn]}:e[sn]||r[sn]||(e[sn]={type:"simple",tokens:sn}):e[sn]={type:"simple",tokens:sn}):ln[un]=!1;_=r[tn]={type:"group",match:"either",tokens:ln}}else nn=tn.charAt(tn.length-1),rn=tn.slice(0,-1),e[rn]||r[rn]?"*"===nn?_=r[tn]={type:"group",match:"zeroOrMore",tokens:[rn]}:"+"===nn?_=r[tn]={type:"group",match:"oneOrMore",tokens:[rn]}:"?"===nn?_=r[tn]={type:"group",match:"zeroOrOne",tokens:[rn]}:e[tn]||r[tn]||(_=e[tn]={type:"simple",tokens:tn}):_=e[tn]={type:"simple",tokens:tn};for(;_.extend;)J=_.extend,X=e[J]||r[J],delete _.extend,X&&((en|on)&mn(X)&&(X={type:"simple",tokens:X}),_=Cn(X,_));if("undefined"==typeof _.type&&(_.either?(_.type="group",_.match="either",_.tokens=_.either,delete _.either):_.all||_.sequence?(_.type="group",_.match="all",_.tokens=_.all||_.sequence,_.all?delete _.all:delete _.sequence):_.zeroOrMore?(_.type="group",_.match="zeroOrMore",_.tokens=_.zeroOrMore,delete _.zeroOrMore):_.oneOrMore?(_.type="group",_.match="oneOrMore",_.tokens=_.oneOrMore,delete _.oneOrMore):_.zeroOrOne&&(_.type="group",_.match="zeroOrOne",_.tokens=_.zeroOrOne,delete _.zeroOrOne)),C=_.type?K[_.type.toUpperCase().replace(Jn,"")]:w,w&C){if(""===_.tokens)return an=new a(S,t,t),i[t]=an,an;if(null===_.tokens)return an=new a(x,t,t),i[t]=an,an;if(!1===_.tokens||0===_.tokens)return an=new a(D,t,t),i[t]=an,an}if(_.tokens=Rn(_.tokens),w&C)_.autocomplete&&E(_,t,y),A=null,_.push?A=[Wn,_.push]:"undefined"!=typeof _.pop&&(A=[Yn,_.pop]),O="undefined"==typeof _.combine?"\\b":_.combine,an=new a(w,t,u(t,_.tokens.slice(),n,O,o,s)),an.ta=A,i[t]=an;else if(M&C)j&C&&m(_,R),an=new p(C,t,c(t,_.tokens.slice(),n,o,s),_.multiline,_.escape,l[t+".inside"]?1:0),i[t]=an,_.interleave&&v.push(an.clone());else if(q&C){for(N=_.tokens.slice(),on&mn(_.match)?an=new f(I,t,null,_.match[0],_.match[1]):(T=G[_.match.toUpperCase()],an=L===T?new f(L,t,null,0,1):$===T?new f($,t,null,0,b):Q===T?new f(Q,t,null,1,b):P&T?new h(P,t,null):new g(B,t,null)),i[t]=an,V=[],H=0,Z=N.length;Z>H;H++)V=V.concat(d(N[H],n,e,r,l,o,s,i,v,R,y));an.set(V)}else if(z&C){for(an=yn(_.tokens.slice()).slice(),F=[],H=0,Z=an.length;Z>H;H++)F[H]=an[H].slice(),an[H]=new k(z,t+"_NGRAM_"+H,null);for(i[t]=an,H=0,Z=an.length;Z>H;H++){for(U=F[H],V=[],W=0,Y=U.length;Y>W;W++)V=V.concat(d(U[W],n,e,r,l,o,s,i,v,R,y));an[H].set(V)}}return i[t]}function m(t,n){var e,r,l,o,s,i=yn(t.tokens.slice());for(o=0,s=i.length;s>o;o++)e=i[o][0],r=i[o].length>1?i[o][1]:i[o][0],l=i[o].length>2?i[o][2]:"",null===r?(n.line=n.line||[],n.line.push(e)):(n.block=n.block||[],n.block.push([e,r,l]))}function E(t,n,e){var r=[].concat(Rn(t.tokens)).map(function(t){return{word:t,meta:n}});e.autocomplete=(e.autocomplete||[]).concat(r)}function v(t){var n,e,r,l,o,s,i,u,c,a,p,f,h,g,k,m;if(t.__parsed)return t;for(p={},f={},h={},k={},m={},g=[],t=_n(t),n=t.RegExpID||null,t.RegExpID=null,delete t.RegExpID,s=t.Lex||{},t.Lex=null,delete t.Lex,i=t.Syntax||{},t.Syntax=null,delete t.Syntax,o=t.Style||{},l=t.Parser||[],r=l.length,e=[],u=0;r>u;u++)c=l[u],a=d(c,n,s,i,o,p,f,h,g,k,m)||null,a&&(on&mn(a)?e=e.concat(a):e.push(a));return t.Parser=e,t.cTokens=g,t.Style=o,t.Comments=k,t.Keywords=m,t.Extra=t.Extra||{},t.__parsed=1,t}function R(t,n){var e=this;e.DEF=n.DEFAULT,e.ERR=n.ERROR,e.Tokens=t.Parser||[],e.cTokens=t.cTokens.length?t.cTokens:null,e.Style=t.Style}function y(t){var n,e=new R(v(t),{DEFAULT:_,ERROR:C}),r=0,l=null,o={"before-highlight":function(t){l===t.language&&(t._code=t.code,t.code="",t.parser=e)},"before-insert":function(t){l===t.language&&(t.code=t._code,t._code="",t.highlightedCode=n.Token.stringify(t.parser.parse(t.code),t.language))}};return{hook:function(t,e){if(!r){n=t,l=e;for(var s in o)o[Z](s)&&n.hooks.add(s,o[s]);r=1}},unhook:function(){if(r){var t=n.hooks.all;for(var e in o)if(t[Z](e)&&o[Z](e)){var l=t[e].indexOf(o[e]);l>-1&&t[e].splice(l,1)}r=0}}}}var _,C,b=1/0,O=2,A=4,T=8,w=16,x=17,S=18,D=20,M=32,N=33,j=34,P=64,B=128,I=256,L=257,$=258,Q=259,q=512,z=1024,V=2048,F=4096,G={EITHER:P,ALL:B,ZEROORONE:L,ZEROORMORE:$,ONEORMORE:Q,REPEATED:I},K={INDENT:V,DEDENT:F,BLOCK:M,COMMENT:j,ESCAPEDBLOCK:N,SIMPLE:w,GROUP:q,NGRAM:z},U=void 0,H="prototype",Z="hasOwnProperty",W="propertyIsEnumerable",Y=(Object.keys,Array[H],Object[H]),J=(Function[H],Y.toString),X=4,tn=5,nn=8,en=16,rn=17,ln=18,on=32,sn=64,un=128,cn=256,an=512,pn=1024,fn=2048,hn=4096,gn=en|on,kn=sn|on,dn={"[object Array]":on,"[object RegExp]":cn,"[object Date]":an,"[object Number]":X,"[object String]":en,"[object Function]":un,"[object Object]":sn},mn=function(t){var n;return null===t?pn:!0===t||!1===t?nn:U===t?fn:(n=J.call(t),n=dn[n]||hn,X===n||t instanceof Number?isNaN(t)?tn:X:en===n||t instanceof String?1===t.length?rn:en:on===n||t instanceof Array?on:cn===n||t instanceof RegExp?cn:an===n||t instanceof Date?an:un===n||t instanceof Function?un:sn===n?sn:hn)},En=Object.create,vn=function(){var t,n,e,r,l,o,s,i=arguments;for(n=i[0]||{},t=i.length,o=1;t>o;o++)if(e=i[o],sn===mn(e))for(l in e)e[Z](l)&&e[W](l)&&(r=e[l],s=mn(r),n[l]=X&s?0+r:gn&s?r.slice(0):r);return n},Rn=function(t,n){return n||on!==mn(t)?[t]:t},yn=function(t,n){return t=Rn(t,n),(n||on!==mn(t[0]))&&(t=[t]),t},_n=function(t){var n,e=mn(t);if(!(kn&e))return t;var r,l={};for(r in t)t[Z](r)&&t[W](r)&&(n=mn(t[r]),l[r]=sn&n?_n(t[r]):gn&n?t[r].slice():t[r]);return l},Cn=function(){var t=arguments,n=t.length;if(1>n)return null;if(2>n)return _n(t[0]);var e,r,l,o,s=t[0],i=_n(s);for(n--,r=1;n>r;r++)if(e=t[r])for(l in e)e[Z](l)&&e[W](l)&&(s[Z](l)&&s[W](l)?(o=mn(s[l]),sn&~en&o&&(i[l]=Cn(s[l],e[l]))):i[l]=_n(e[l]));return i},bn=/([.*+?^${}()|[\]\/\\\-])/g,On=function(t){return t.replace(bn,"\\$1")},An=/\$(\d{1,2})/g,Tn=function(t,n){var e,r,l,o;for(o=function(t,e){return n[1+parseInt(e,10)]},e=t.split("$$"),l=e.length,r=0;l>r;r++)e[r]=e[r].replace(An,o);return e.join("$")},wn=/^\s+|\s+$/g,xn=String[H].trim?function(t){return t.trim()}:function(t){return t.replace(wn,"")},Sn=function(t,n){return n.length-t.length},Dn=/\r\n|\r|\n/g,Mn=function(t,n){return en&mn(n)&&en&mn(t)&&n.length&&n.length<=t.length&&n==t.substr(0,n.length)},Nn=function(t,n,e){if(!t||X==mn(t))return t;var r,l=n?n.length||0:0;if(l&&n==t.substr(0,l)){var o,s,i,u,r,c,a=t.substr(l),p=a[0],f="";for(r=a.length;r--&&(c=a[r],p!=c);)"i"==c.toLowerCase()&&(f="i");return o=a.substring(1,r),s="^("+o+")",e[s]||(i=new RegExp(s,f),u={peek:null,negativepeek:null},e[s]=[i,u]),e[s]}return t},jn=function(t,n){var e={},r="",l=mn(n);(en==l||rn==l)&&(r=n);var o=t.sort(Sn).map(function(t){return e[t.charAt(0)]=1,On(t)}).join("|");return[new RegExp("^("+o+")"+r),{peek:e,negativepeek:null},1]},Pn=0,Bn=function(){return++Pn},In=function(t){return[t||"uuid",++Pn,(new Date).getTime()].join("_")},Ln="undefined"!=typeof global&&"[object global]"==J.call(global)?1:0,$n=Ln||"undefined"==typeof navigator?0:1,Qn="function"==typeof importScripts&&navigator instanceof WorkerNavigator?1:0,qn=function(){var t,n,e=null;return Ln?(e=__filename,{path:__dirname,file:__filename,base:__dirname}):(Qn?e=self.location.href:$n&&(t=document.location.href.split("#")[0].split("?")[0].split("/").slice(0,-1).join("/"),(n=document.getElementsByTagName("script"))&&n.length&&(e=n[n.length-1].src)),e?{path:e.split("/").slice(0,-1).join("/"),file:e,base:t}:{path:null,file:null,base:null})},zn=(qn(),Math.max),Vn=/^[\s\u00a0]+/,Fn=/[^\s\u00a0]/;n.col=function(t,n,e,r,l){var o,s;for(null===n&&(n=t.search(Fn),-1==n&&(n=t.length)),o=r||0,s=l||0;n>o;++o)s+=" "==t.charAt(o)?e-s%e:1;return s},n._=function(t){var e=new n;return e._=t,e.s=""+t.string,e.start=t.start,e.pos=t.pos,e.lCP=t.lastColumnPos,e.lCV=t.lastColumnValue,e.lS=t.lineStart,e},n[H]={constructor:n,_:null,s:"",start:0,pos:0,lCP:0,lCV:0,lS:0,dispose:function(){var t=this;return t._=null,t.s=null,t.start=null,t.pos=null,t.lCP=null,t.lCV=null,t.lS=null,t},toString:function(){return this.s},sol:function(){return 0===this.pos},eol:function(){return this.pos>=this.s.length},chr:function(t,n){var e=this,r=e.s.charAt(e.pos)||null;return r&&t===r?(!1!==n&&(e.pos+=1,e._&&(e._.pos=e.pos)),r):!1},chl:function(t,n){var e=this,r=e.s.charAt(e.pos)||null;return r&&-10?!1:(!1!==l&&(s.pos+=o[r||0].length,s._&&(s._.pos=s.pos)),o)},spc:function(t){var n,e=this,r=e.pos,l=e.s.slice(r);return(n=l.match(Vn))?(!1!==t&&(e.pos+=n[0].length,e._&&(e._.pos=e.pos)),1):0},end:function(){var t=this;return t.pos=t.s.length,t._&&(t._.pos=t.pos),t},nxt:function(){var t,n=this,e=n.s;return n.pos=this._.length},pos:function(){return this._.length},peek:function(t){var n=this,e=n._;if(t=arguments.length?t:-1,e.length){if(0>t&&0<=e.length+t)return e[e.length+t];if(t>=0&&te;e++)if(r=o[e].get(t,n))return i?[e,r[1]]:r;return!1}}),s[H]=vn(En(l[H]),{constructor:s,s:null,e:null,get:function(t,n){var e,r=this,o=r.s,s=r.e;if(e=o.get(t,n)){var i,u=s[e[0]],c=mn(u),a=o.ms[e[0]].tt;return cn===a&&(X===c?(i=e[1][u+1],u=new l(i.length>1?en:rn,r.tn+"_End",i)):en===c&&(i=Tn(u,e[1]),u=new l(i.length>1?en:rn,r.tn+"_End",i))),u}return!1}});var Wn=1,Yn=2;a[H]={constructor:a,$class:null,sID:null,id:null,tt:null,tk:null,ta:null,REQ:0,ERR:0,ACT:0,CLONE:null,act:function(t,n){var e,r,l=this.ta||null,o=n.data;if(e)if(e=l[0],r=l[1],Yn===e){if(r&&(t&&(r=X===mn(r)?t[1][r]:Tn(r,t[1])),o.isEmpty()||r!==o.peek()))return r;o.pop()}else Wn===e&&r&&(t&&(r=X===mn(r)?t[1][r]:Tn(r,t[1])),o.push(r));return 0},get:function(t,n){var e=this,r=e.ta,l=e.tk,o=e.tt,s=e.id,i=null;if(e.ACT=0,D===o)return e.ERR=0,e.REQ=0,!0;if(x===o){if(t.spc(),t.eol())return s}else if(S===o)e.ERR=e.REQ&&t.spc()&&!t.eol()?1:0,e.REQ=0;else if(i=l.get(t))return r&&(e.ACT=e.act(i,n)),s;return!1},req:function(t){return this.REQ=!!t,this},err:function(){var t=this;return t.REQ?'Token "'+t.id+'" Expected':t.ACT?'Token "'+t.ACT+'" No Match':'Syntax Error: "'+t.id+'"'},clone:function(){var t,n,e,r=this,l=r.CLONE;if(t=new r.$class,t.tt=r.tt,t.id=r.id,t.tm=r.tm?r.tm.slice():r.tm,l&&l.length)for(n=0,e=l.length;e>n;n++)t[l[n]]=r[l[n]];return t},toString:function(){var t=this;return["[","Tokenizer: ",t.id,", Matcher: ",t.tk?t.tk.toString():null,"]"].join("")}},p[H]=vn(En(a[H]),{constructor:p,inter:0,mline:0,esc:null,get:function(t,n){var e,r,l,o,s,i,u,c,a,p=this,f=0,h=0,g="",k=p.mline,d=p.tk,m=p.id,E=p.tt,v=p.inter,R=v?m+".inside":m,y=0,_=N===E,C=p.esc;if(j===E&&(p.REQ=0),s=0,n.inBlock===m?(h=1,e=n.endBlock,s=1,i=R):!n.inBlock&&(e=d.get(t))&&(h=1,n.inBlock=m,n.endBlock=e,i=m),h){if(l=n.stack.pos(),o=pn===e.tt,v){if(s&&o&&t.sol())return p.REQ=0,n.inBlock=null,n.endBlock=null,!1;if(!s)return n.stack.pushAt(l,p.clone(),"sID",m),i}if(f=e.get(t),r=k,a=0,f)i=o?R:m;else for(c=t.pos;!t.eol();){if(u=t.pos,!(_&&y||!e.get(t))){v&&t.pos>u&&u>c?(i=R,t.bck2(u),a=1):(i=m,f=1);break}g=t.nxt(),y=!y&&g==C}return r=k||_&&y,f||!r&&!a?(n.inBlock=null,n.endBlock=null):n.stack.pushAt(l,p.clone(),"sID",m),i}return!1}}),f[H]=vn(En(a[H]),{constructor:f,ts:null,min:0,max:1,found:0,set:function(t){return t&&(this.ts=Rn(t)),this},get:function(t,n){var e,r,l,o,s,i,u=this,c=u.ts,a=c.length,p=u.found,f=u.min,h=u.max,g=0;for(u.ERR=0,u.REQ=0,u.ACT=0,o=t.pos,s=n.stack.pos(),i=u.id+"_"+Bn(),e=0;a>e;e++){if(r=c[e].clone().req(1),l=r.get(t,n),!1!==l){if(++p,h>=p)return u.found=p,n.stack.pushAt(s,u.clone(),"sID",i),u.found=0,u.ACT=r.ACT,l;break}r.REQ&&g++,r.ERR&&t.bck2(o)}return u.REQ=f>p,u.ERR=p>h||f>p&&g>0,!1}}),h[H]=vn(En(f[H]),{constructor:h,get:function(t,n){var e,r,l,o,s=this,i=s.ts,u=i.length,c=0,a=0;for(s.REQ=1,s.ERR=0,s.ACT=0,o=t.pos,l=0;u>l;l++){if(r=i[l].clone().req(1),e=r.get(t,n),c+=r.REQ?1:0,!1!==e)return s.ACT=r.ACT,e;r.ERR&&(a++,t.bck2(o))}return s.REQ=c>0,s.ERR=u==a&&c>0,!1}}),g[H]=vn(En(f[H]),{constructor:g,get:function(t,n){var e,r,l,o,s,i=this,u=i.ts,c=u.length;if(i.REQ=1,i.ERR=0,i.ACT=0,l=t.pos,o=n.stack.pos(),e=u[0].clone().req(1),r=e.get(t,n),s=i.id+"_"+Bn(),!1!==r){if(!0!==r)for(var a=c-1;a>0;a--)n.stack.pushAt(o+c-a-1,u[a].clone().req(1),"sID",s);return i.ACT=e.ACT,r}return e.ERR?(i.ERR=1,t.bck2(l)):e.REQ&&(i.ERR=1),!1}}),k[H]=vn(En(f[H]),{constructor:k,get:function(t,n){var e,r,l,o,s,i,u=this,c=u.ts,a=c.length;if(u.REQ=0,u.ERR=0,u.ACT=0,l=t.pos,o=n.stack.pos(),e=c[0].clone().req(0),r=e.get(t,n),s=u.id+"_"+Bn(),!1!==r){if(!0!==r)for(i=a-1;i>0;i--)n.stack.pushAt(o+a-i-1,c[i].clone().req(1),"sID",s);return u.ACT=e.ACT,r}return e.ERR&&t.bck2(l),!1}});var Jn=/[\-_]/g;R[H]={constructor:R,ERR:null,DEF:null,cTokens:null,Tokens:null,Style:null,dispose:function(){var t=this;return t.ERR=null,t.DEF=null,t.cTokens=null,t.Tokens=null,t.Style=null,t},parse:function(t){t=t||"";var n,e,l=this,o=t.split(Dn),s=o.length,i=[];for(e={state:new r,tokens:null},n=0;s>n;n++)e=l.getLineTokens(o[n],e.state,n),i=i.concat(e.tokens),s-1>n&&i.push("\n");return i},getLineTokens:function(t,e){var r,l,o,s,i,u,c,a,p,f,h,g=this,k=g.cTokens,d=g.Tokens,m=d.length,E=g.Style,v=g.DEF,R=g.ERR;for(u=[],f=new n(t),h=e.stack,c={type:null,content:""},a=null,p=null,f.sol()&&!h.isEmpty()&&x===h.peek().tt&&h.pop();!f.eol();)if(l=0,v===p||R===p?(c.type&&u.push(c),u.push(f.cur(1)),c={type:null,content:""}):p&&p!==c.type?(c.type&&u.push(c),c={type:p,content:f.cur(1)}):c.type&&(c.content+=f.cur(1)),p=!1,!h.isEmpty()&&S===h.peek().tt||!f.spc()){for(;!h.isEmpty()&&!f.eol();){if(k){for(s=0,o=0;sr;r++)if(i=d[r],e.t=a=i.get(f,e),!1!==a){if(!0!==a){p=E[a]||v,i.MTCH&&(h.empty("sID",i.sID),e.t=a=R,p=R,currentError=i.err()),l=1;break}}else{if(i.ERR||i.REQ){h.empty("sID",i.sID),f.nxt(),e.t=a=R,p=R,currentError=i.err(),l=1;break}p=!1}if(!l){if(f.eol())break;f.nxt(),e.t=a=v,p=v}}}else e.t=a=v,p=v;return v===p||R===p?(c.type&&u.push(c),u.push(f.cur(1))):p&&p!==c.type?(c.type&&u.push(c),u.push({type:p,content:f.cur(1)})):c.type&&(c.content+=f.cur(1),u.push(c)),c=null,{state:e,tokens:u}}},_="",C="";t.PrismGrammar={VERSION:"0.10",extend:Cn,parse:v,getMode:y};return t.PrismGrammar}); \ No newline at end of file +**/!function(t,n,e){"use strict";var r,l="object"==typeof module&&module.exports,o="function"==typeof define&&define.amd;l?module.exports=(module.$deps=module.$deps||{})[n]=module.$deps[n]||e.call(t,{NODE:module})||1:o&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(n)?define(n,["require","exports","module"],function(n,r,l){return e.call(t,{AMD:l})}):n in t||(t[n]=r=e.call(t,{})||1)&&o&&define(n,[],function(){return r})}(this,"PrismGrammar",function(t){"use strict";function n(t){var n=this;n._=null,n.s=t?""+t:"",n.start=n.pos=0,n.lCP=n.lCV=0,n.lS=0}function e(t){this._=t||[]}function r(t,n){var r=this;r.id=n?In("state"):"state",r.l=t||0,r.stack=new e,r.data=new e,r.col=0,r.indent=0,r.t=null,r.inBlock=null,r.endBlock=null}function l(t,n,e,r){var o=this;switch(o.$class=l,o.mt=O,o.tt=t||rn,o.tn=n,o.tk=r||0,o.tg=0,o.tp=null,o.p=null,o.np=null,o.tt){case rn:case ln:o.tp=e,o.get=ln===o.tt?Kn:Gn;break;case en:o.tp=e,o.p={},o.p[""+e.charAt(0)]=1,o.get=Un;break;case cn:o.tp=e[0],o.p=e[1].peek||null,o.np=e[1].negativepeek||null,o.tg=e[2]||0,o.get=Zn;break;case pn:o.tp=null,o.get=Hn}}function o(t,n,e){var r=this;r.$class=o,r.mt=A,r.tn=t,r.ms=n,r.ownKey=!1!==e}function s(t,n,e){var r=this;r.$class=s,r.mt=T,r.tn=t,r.s=new o(r.tn+"_Start",n,!1),r.e=e}function i(t,n,e,r){var o=mn(n);if(X===o)return n;if(!r[t]){e=e||0;var s,i=0;n&&n.isCharList&&(i=1,delete n.isCharList),s=pn&o?new l(pn,t,n,e):rn===o?new l(rn,t,n,e):en&o?i?new l(ln,t,n,e):new l(en,t,n,e):on&o?new l(cn,t,n,e):n,r[t]=s}return r[t]}function u(t,n,e,r,l,s){if(!s[t]){var c,a,p,f,h,g,k,d=0,m=0,E=1;if(c=Rn(n),p=c.length,1==p)k=i(t,Nn(c[0],e,l),0,s);else if(p>1){for(f=(p>>1)+1,a=0;f>=a;a++)h=mn(c[a]),g=mn(c[p-1-a]),(rn!==h||rn!==g)&&(E=0),on&h||on&g?d=1:(Mn(c[a],e)||Mn(c[p-1-a],e))&&(m=1);if(!E||r&&en&mn(r))if(!r||d||m){for(a=0;p>a;a++)c[a]=on&mn(c[a])?u(t+"_"+a,c[a],e,r,l,s):i(t+"_"+a,Nn(c[a],e,l),a,s);k=p>1?new o(t,c):c[0]}else k=i(t,jn(c,r),0,s);else c=c.slice().join(""),c.isCharList=1,k=i(t,c,0,s)}s[t]=k}return s[t]}function c(t,n,e,r,l){if(!l[t]){var o,u,c,a,p,f,h;for(a=[],p=[],o=yn(n),u=0,c=o.length;c>u;u++)f=i(t+"_0_"+u,Nn(o[u][0],e,r),u,l),h=o[u].length>1?cn!==f.tt||en!==mn(o[u][1])||Mn(o[u][1],e)?i(t+"_1_"+u,Nn(o[u][1],e,r),u,l):o[u][1]:f,a.push(f),p.push(h);l[t]=new s(t,a,p)}return l[t]}function a(t,n,e){var r=this;r.$class=a,r.tt=t||w,r.id=n,r.tk=e,r.REQ=0,r.ERR=0,r.ACT=0,r.CLONE=["tk"]}function p(t,n,e,r,l,o){var s=this;s.$class=p,s.tt=t,s.id=n,s.tk=e,s.REQ=0,s.ERR=0,s.ACT=0,s.mline="undefined"==typeof r?1:r,s.esc=l||"\\",s.inter=o,s.CLONE=["tk","mline","esc","inter"]}function f(t,n,e,r,l){var o=this;o.$class=f,o.tt=t||I,o.id=n||null,o.tk=null,o.ts=null,o.min=r||0,o.max=l||b,o.found=0,o.CLONE=["ts","min","max","found"],e&&o.set(e)}function h(t,n,e){f.call(this,t,n,e,1,1),this.$class=h}function g(t,n,e){f.call(this,t,n,e,1,1),this.$class=g}function k(t,n,e){f.call(this,t,n,e,1,1),this.$class=k}function d(t,n,e,r,l,o,s,i,v,R,y){var _,C,O,A,T,N,V,F,U,Z,H,W,Y,J,X,tn,nn,rn,ln,sn,un,cn,an=null;if(null===t)return new a(x,"EOL",t);if(""===t)return new a(S,"NONSPACE",t);if(!1===t||0===t)return new a(D,"EMPTY",t);if(on&mn(t)&&(tn=t,t="NGRAM_"+tn.join("_"),r[t]||(r[t]={type:"ngram",tokens:tn})),t=""+t,i[t])return i[t];if(e[t]?(_=e[t],gn&mn(_)&&(_=e[t]={type:"simple",tokens:_})):_=r[t]?r[t]:t,en&mn(_))if(tn=_,1===tn.length)_=e[tn]={type:"simple",tokens:tn};else if(ln=tn.split(" | ").map(xn),cn=ln.length,cn>1){for(un=cn-1;un>=0;un--)sn=ln[un],sn.length?e[sn]||r[sn]||(nn=sn.charAt(sn.length-1),rn=sn.slice(0,-1),e[rn]||r[rn]?"*"===nn?r[sn]={type:"group",match:"zeroOrMore",tokens:[rn]}:"+"===nn?r[sn]={type:"group",match:"oneOrMore",tokens:[rn]}:"?"===nn?r[sn]={type:"group",match:"zeroOrOne",tokens:[rn]}:e[sn]||r[sn]||(e[sn]={type:"simple",tokens:sn}):e[sn]={type:"simple",tokens:sn}):ln[un]=!1;_=r[tn]={type:"group",match:"either",tokens:ln}}else nn=tn.charAt(tn.length-1),rn=tn.slice(0,-1),e[rn]||r[rn]?"*"===nn?_=r[tn]={type:"group",match:"zeroOrMore",tokens:[rn]}:"+"===nn?_=r[tn]={type:"group",match:"oneOrMore",tokens:[rn]}:"?"===nn?_=r[tn]={type:"group",match:"zeroOrOne",tokens:[rn]}:e[tn]||r[tn]||(_=e[tn]={type:"simple",tokens:tn}):_=e[tn]={type:"simple",tokens:tn};for(;_.extend;)J=_.extend,X=e[J]||r[J],delete _.extend,X&&((en|on)&mn(X)&&(X={type:"simple",tokens:X}),_=Cn(X,_));if("undefined"==typeof _.type&&(_.either?(_.type="group",_.match="either",_.tokens=_.either,delete _.either):_.all||_.sequence?(_.type="group",_.match="all",_.tokens=_.all||_.sequence,_.all?delete _.all:delete _.sequence):_.zeroOrMore?(_.type="group",_.match="zeroOrMore",_.tokens=_.zeroOrMore,delete _.zeroOrMore):_.oneOrMore?(_.type="group",_.match="oneOrMore",_.tokens=_.oneOrMore,delete _.oneOrMore):_.zeroOrOne&&(_.type="group",_.match="zeroOrOne",_.tokens=_.zeroOrOne,delete _.zeroOrOne)),C=_.type?K[_.type.toUpperCase().replace(Jn,"")]:w,w&C){if(""===_.tokens)return an=new a(S,t,t),i[t]=an,an;if(null===_.tokens)return an=new a(x,t,t),i[t]=an,an;if(!1===_.tokens||0===_.tokens)return an=new a(D,t,t),i[t]=an,an}if(_.tokens=Rn(_.tokens),w&C)_.autocomplete&&E(_,t,y),A=null,_.push?A=[Wn,_.push]:"undefined"!=typeof _.pop&&(A=[Yn,_.pop]),O="undefined"==typeof _.combine?"\\b":_.combine,an=new a(w,t,u(t,_.tokens.slice(),n,O,o,s)),an.ta=A,i[t]=an;else if(M&C)j&C&&m(_,R),an=new p(C,t,c(t,_.tokens.slice(),n,o,s),_.multiline,_.escape,l[t+".inside"]?1:0),i[t]=an,_.interleave&&v.push(an.clone());else if(q&C){for(N=_.tokens.slice(),on&mn(_.match)?an=new f(I,t,null,_.match[0],_.match[1]):(T=G[_.match.toUpperCase()],an=L===T?new f(L,t,null,0,1):$===T?new f($,t,null,0,b):Q===T?new f(Q,t,null,1,b):P&T?new h(P,t,null):new g(B,t,null)),i[t]=an,V=[],Z=0,H=N.length;H>Z;Z++)V=V.concat(d(N[Z],n,e,r,l,o,s,i,v,R,y));an.set(V)}else if(z&C){for(an=yn(_.tokens.slice()).slice(),F=[],Z=0,H=an.length;H>Z;Z++)F[Z]=an[Z].slice(),an[Z]=new k(z,t+"_NGRAM_"+Z,null);for(i[t]=an,Z=0,H=an.length;H>Z;Z++){for(U=F[Z],V=[],W=0,Y=U.length;Y>W;W++)V=V.concat(d(U[W],n,e,r,l,o,s,i,v,R,y));an[Z].set(V)}}return i[t]}function m(t,n){var e,r,l,o,s,i=yn(t.tokens.slice());for(o=0,s=i.length;s>o;o++)e=i[o][0],r=i[o].length>1?i[o][1]:i[o][0],l=i[o].length>2?i[o][2]:"",null===r?(n.line=n.line||[],n.line.push(e)):(n.block=n.block||[],n.block.push([e,r,l]))}function E(t,n,e){var r=[].concat(Rn(t.tokens)).map(function(t){return{word:t,meta:n}});e.autocomplete=(e.autocomplete||[]).concat(r)}function v(t){var n,e,r,l,o,s,i,u,c,a,p,f,h,g,k,m;if(t.__parsed)return t;for(p={},f={},h={},k={},m={},g=[],t=_n(t),n=t.RegExpID||null,t.RegExpID=null,delete t.RegExpID,s=t.Lex||{},t.Lex=null,delete t.Lex,i=t.Syntax||{},t.Syntax=null,delete t.Syntax,o=t.Style||{},l=t.Parser||[],r=l.length,e=[],u=0;r>u;u++)c=l[u],a=d(c,n,s,i,o,p,f,h,g,k,m)||null,a&&(on&mn(a)?e=e.concat(a):e.push(a));return t.Parser=e,t.cTokens=g,t.Style=o,t.Comments=k,t.Keywords=m,t.Extra=t.Extra||{},t.__parsed=1,t}function R(t,n){var e=this;e.DEF=n.DEFAULT,e.ERR=n.ERROR,e.Tokens=t.Parser||[],e.cTokens=t.cTokens.length?t.cTokens:null,e.Style=t.Style}function y(t){var n,e=new R(v(t),{DEFAULT:_,ERROR:C}),r=0,l=null,o={"before-highlight":function(t){l===t.language&&(t._code=t.code,t.code="",t.parser=e)},"before-insert":function(t){l===t.language&&(t.code=t._code,t._code="",t.highlightedCode=n.Token.stringify(t.parser.parse(t.code),t.language))}};return{hook:function(t,e){if(!r){n=t,l=e;for(var s in o)o[H](s)&&n.hooks.add(s,o[s]);r=1}},unhook:function(){if(r){var t=n.hooks.all;for(var e in o)if(t[H](e)&&o[H](e)){var l=t[e].indexOf(o[e]);l>-1&&t[e].splice(l,1)}r=0}}}}var _,C,b=1/0,O=2,A=4,T=8,w=16,x=17,S=18,D=20,M=32,N=33,j=34,P=64,B=128,I=256,L=257,$=258,Q=259,q=512,z=1024,V=2048,F=4096,G={EITHER:P,ALL:B,ZEROORONE:L,ZEROORMORE:$,ONEORMORE:Q,REPEATED:I},K={INDENT:V,DEDENT:F,BLOCK:M,COMMENT:j,ESCAPEDBLOCK:N,SIMPLE:w,GROUP:q,NGRAM:z},U=void 0,Z="prototype",H="hasOwnProperty",W="propertyIsEnumerable",Y=(Object.keys,Array[Z],Object[Z]),J=(Function[Z],Y.toString),X=4,tn=5,nn=8,en=16,rn=17,ln=18,on=32,sn=64,un=128,cn=256,an=512,pn=1024,fn=2048,hn=4096,gn=en|on,kn=sn|on,dn={"[object Array]":on,"[object RegExp]":cn,"[object Date]":an,"[object Number]":X,"[object String]":en,"[object Function]":un,"[object Object]":sn},mn=function(t){var n;return null===t?pn:!0===t||!1===t?nn:U===t?fn:(n=J.call(t),n=dn[n]||hn,X===n||t instanceof Number?isNaN(t)?tn:X:en===n||t instanceof String?1===t.length?rn:en:on===n||t instanceof Array?on:cn===n||t instanceof RegExp?cn:an===n||t instanceof Date?an:un===n||t instanceof Function?un:sn===n?sn:hn)},En=Object.create,vn=function(){var t,n,e,r,l,o,s,i=arguments;for(n=i[0]||{},t=i.length,o=1;t>o;o++)if(e=i[o],sn===mn(e))for(l in e)e[H](l)&&e[W](l)&&(r=e[l],s=mn(r),n[l]=X&s?0+r:gn&s?r.slice(0):r);return n},Rn=function(t,n){return n||on!==mn(t)?[t]:t},yn=function(t,n){return t=Rn(t,n),(n||on!==mn(t[0]))&&(t=[t]),t},_n=function(t){var n,e=mn(t);if(!(kn&e))return t;var r,l={};for(r in t)t[H](r)&&t[W](r)&&(n=mn(t[r]),l[r]=sn&n?_n(t[r]):gn&n?t[r].slice():t[r]);return l},Cn=function(){var t=arguments,n=t.length;if(1>n)return null;if(2>n)return _n(t[0]);var e,r,l,o,s=t[0],i=_n(s);for(n--,r=1;n>r;r++)if(e=t[r])for(l in e)e[H](l)&&e[W](l)&&(s[H](l)&&s[W](l)?(o=mn(s[l]),sn&~en&o&&(i[l]=Cn(s[l],e[l]))):i[l]=_n(e[l]));return i},bn=/([.*+?^${}()|[\]\/\\\-])/g,On=function(t){return t.replace(bn,"\\$1")},An=/\$(\d{1,2})/g,Tn=function(t,n){var e,r,l,o;for(o=function(t,e){return n[1+parseInt(e,10)]},e=t.split("$$"),l=e.length,r=0;l>r;r++)e[r]=e[r].replace(An,o);return e.join("$")},wn=/^\s+|\s+$/g,xn=String[Z].trim?function(t){return t.trim()}:function(t){return t.replace(wn,"")},Sn=function(t,n){return n.length-t.length},Dn=/\r\n|\r|\n/g,Mn=function(t,n){return en&mn(n)&&en&mn(t)&&n.length&&n.length<=t.length&&n==t.substr(0,n.length)},Nn=function(t,n,e){if(!t||X==mn(t))return t;var r,l=n?n.length||0:0;if(l&&n==t.substr(0,l)){var o,s,i,u,r,c,a=t.substr(l),p=a[0],f="";for(r=a.length;r--&&(c=a[r],p!=c);)"i"==c.toLowerCase()&&(f="i");return o=a.substring(1,r),s="^("+o+")",e[s]||(i=new RegExp(s,f),u={peek:null,negativepeek:null},e[s]=[i,u]),e[s]}return t},jn=function(t,n){var e={},r="",l=mn(n);(en==l||rn==l)&&(r=n);var o=t.sort(Sn).map(function(t){return e[t.charAt(0)]=1,On(t)}).join("|");return[new RegExp("^("+o+")"+r),{peek:e,negativepeek:null},1]},Pn=0,Bn=function(){return++Pn},In=function(t){return[t||"uuid",++Pn,(new Date).getTime()].join("_")},Ln="undefined"!=typeof global&&"[object global]"==J.call(global)?1:0,$n=Ln||"undefined"==typeof navigator?0:1,Qn="function"==typeof importScripts&&navigator instanceof WorkerNavigator?1:0,qn=function(){var t,n,e=null;return Ln?(e=__filename,{path:__dirname,file:__filename,base:__dirname}):(Qn?e=self.location.href:$n&&(t=document.location.href.split("#")[0].split("?")[0].split("/").slice(0,-1).join("/"),(n=document.getElementsByTagName("script"))&&n.length&&(e=n[n.length-1].src)),e?{path:e.split("/").slice(0,-1).join("/"),file:e,base:t}:{path:null,file:null,base:null})},zn=(qn(),Math.max),Vn=/^[\s\u00a0]+/,Fn=/[^\s\u00a0]/;n.col=function(t,n,e,r,l){var o,s;for(null===n&&(n=t.search(Fn),-1==n&&(n=t.length)),o=r||0,s=l||0;n>o;++o)s+=" "==t.charAt(o)?e-s%e:1;return s},n._=function(t){var e=new n;return e._=t,e.s=""+t.string,e.start=t.start,e.pos=t.pos,e.lCP=t.lastColumnPos,e.lCV=t.lastColumnValue,e.lS=t.lineStart,e},n[Z]={constructor:n,_:null,s:"",start:0,pos:0,lCP:0,lCV:0,lS:0,dispose:function(){var t=this;return t._=null,t.s=null,t.start=null,t.pos=null,t.lCP=null,t.lCV=null,t.lS=null,t},toString:function(){return this.s},sol:function(){return 0===this.pos},eol:function(){return this.pos>=this.s.length},chr:function(t,n){var e=this,r=e.s.charAt(e.pos)||null;return r&&t===r?(!1!==n&&(e.pos+=1,e._&&(e._.pos=e.pos)),r):!1},chl:function(t,n){var e=this,r=e.s.charAt(e.pos)||null;return r&&-10?!1:(!1!==l&&(s.pos+=o[r||0].length,s._&&(s._.pos=s.pos)),o)},spc:function(t){var n,e=this,r=e.pos,l=e.s.slice(r);return(n=l.match(Vn))?(!1!==t&&(e.pos+=n[0].length,e._&&(e._.pos=e.pos)),1):0},end:function(){var t=this;return t.pos=t.s.length,t._&&(t._.pos=t.pos),t},nxt:function(){var t,n=this,e=n.s;return n.pos=this._.length},pos:function(){return this._.length},peek:function(t){var n=this,e=n._;if(t=arguments.length?t:-1,e.length){if(0>t&&0<=e.length+t)return e[e.length+t];if(t>=0&&te;e++)if(r=o[e].get(t,n))return i?[e,r[1]]:r;return!1}}),s[Z]=vn(En(l[Z]),{constructor:s,s:null,e:null,get:function(t,n){var e,r=this,o=r.s,s=r.e;if(e=o.get(t,n)){var i,u=s[e[0]],c=mn(u),a=o.ms[e[0]].tt;return cn===a&&(X===c?(i=e[1][u+1],u=new l(i.length>1?en:rn,r.tn+"_End",i)):en===c&&(i=Tn(u,e[1]),u=new l(i.length>1?en:rn,r.tn+"_End",i))),u}return!1}});var Wn=1,Yn=2;a[Z]={constructor:a,$class:null,sID:null,id:null,tt:null,tk:null,ta:null,REQ:0,ERR:0,ACT:0,CLONE:null,act:function(t,n){var e,r,l=this.ta||null,o=n.data;if(e)if(e=l[0],r=l[1],Yn===e){if(r&&(t&&(r=X===mn(r)?t[1][r]:Tn(r,t[1])),o.isEmpty()||r!==o.peek()))return r;o.pop()}else Wn===e&&r&&(t&&(r=X===mn(r)?t[1][r]:Tn(r,t[1])),o.push(r));return 0},get:function(t,n){var e=this,r=e.ta,l=e.tk,o=e.tt,s=e.id,i=null;if(e.ACT=0,D===o)return e.ERR=0,e.REQ=0,!0;if(x===o){if(t.spc(),t.eol())return s}else if(S===o)e.ERR=e.REQ&&t.spc()&&!t.eol()?1:0,e.REQ=0;else if(i=l.get(t))return r&&(e.ACT=e.act(i,n)),s;return!1},req:function(t){return this.REQ=!!t,this},err:function(){var t=this;return t.REQ?'Token "'+t.id+'" Expected':t.ACT?'Token "'+t.ACT+'" No Match':'Syntax Error: "'+t.id+'"'},clone:function(){var t,n,e,r=this,l=r.CLONE;if(t=new r.$class,t.tt=r.tt,t.id=r.id,t.tm=r.tm?r.tm.slice():r.tm,l&&l.length)for(n=0,e=l.length;e>n;n++)t[l[n]]=r[l[n]];return t},toString:function(){var t=this;return["[","Tokenizer: ",t.id,", Matcher: ",t.tk?t.tk.toString():null,"]"].join("")}},p[Z]=vn(En(a[Z]),{constructor:p,inter:0,mline:0,esc:null,get:function(t,n){var e,r,l,o,s,i,u,c,a,p=this,f=0,h=0,g="",k=p.mline,d=p.tk,m=p.id,E=p.tt,v=p.inter,R=v?m+".inside":m,y=0,_=N===E,C=p.esc;if(j===E&&(p.REQ=0),s=0,n.inBlock===m?(h=1,e=n.endBlock,s=1,i=R):!n.inBlock&&(e=d.get(t))&&(h=1,n.inBlock=m,n.endBlock=e,i=m),h){if(l=n.stack.pos(),o=pn===e.tt,v){if(s&&o&&t.sol())return p.REQ=0,n.inBlock=null,n.endBlock=null,!1;if(!s)return n.stack.pushAt(l,p.clone(),"sID",m),i}if(f=e.get(t),r=k,a=0,f)i=o?R:m;else for(c=t.pos;!t.eol();){if(u=t.pos,!(_&&y||!e.get(t))){v&&t.pos>u&&u>c?(i=R,t.bck2(u),a=1):(i=m,f=1);break}g=t.nxt(),y=!y&&g==C}return r=k||_&&y,f||!r&&!a?(n.inBlock=null,n.endBlock=null):n.stack.pushAt(l,p.clone(),"sID",m),i}return!1}}),f[Z]=vn(En(a[Z]),{constructor:f,ts:null,min:0,max:1,found:0,set:function(t){return t&&(this.ts=Rn(t)),this},get:function(t,n){var e,r,l,o,s,i,u=this,c=u.ts,a=c.length,p=u.found,f=u.min,h=u.max,g=0;for(u.ERR=0,u.REQ=0,u.ACT=0,o=t.pos,s=n.stack.pos(),i=u.id+"_"+Bn(),e=0;a>e;e++){if(r=c[e].clone().req(1),l=r.get(t,n),!1!==l){if(++p,h>=p)return u.found=p,n.stack.pushAt(s,u.clone(),"sID",i),u.found=0,u.ACT=r.ACT,l;break}r.REQ&&g++,r.ERR&&t.bck2(o)}return u.REQ=f>p,u.ERR=p>h||f>p&&g>0,!1}}),h[Z]=vn(En(f[Z]),{constructor:h,get:function(t,n){var e,r,l,o,s=this,i=s.ts,u=i.length,c=0,a=0;for(s.REQ=1,s.ERR=0,s.ACT=0,o=t.pos,l=0;u>l;l++){if(r=i[l].clone().req(1),e=r.get(t,n),c+=r.REQ?1:0,!1!==e)return s.ACT=r.ACT,e;r.ERR&&(a++,t.bck2(o))}return s.REQ=c>0,s.ERR=u==a&&c>0,!1}}),g[Z]=vn(En(f[Z]),{constructor:g,get:function(t,n){var e,r,l,o,s,i=this,u=i.ts,c=u.length;if(i.REQ=1,i.ERR=0,i.ACT=0,l=t.pos,o=n.stack.pos(),e=u[0].clone().req(1),r=e.get(t,n),s=i.id+"_"+Bn(),!1!==r){if(!0!==r)for(var a=c-1;a>0;a--)n.stack.pushAt(o+c-a-1,u[a].clone().req(1),"sID",s);return i.ACT=e.ACT,r}return e.ERR?(i.ERR=1,t.bck2(l)):e.REQ&&(i.ERR=1),!1}}),k[Z]=vn(En(f[Z]),{constructor:k,get:function(t,n){var e,r,l,o,s,i,u=this,c=u.ts,a=c.length;if(u.REQ=0,u.ERR=0,u.ACT=0,l=t.pos,o=n.stack.pos(),e=c[0].clone().req(0),r=e.get(t,n),s=u.id+"_"+Bn(),!1!==r){if(!0!==r)for(i=a-1;i>0;i--)n.stack.pushAt(o+a-i-1,c[i].clone().req(1),"sID",s);return u.ACT=e.ACT,r}return e.ERR&&t.bck2(l),!1}});var Jn=/[\-_]/g;R[Z]={constructor:R,ERR:null,DEF:null,cTokens:null,Tokens:null,Style:null,dispose:function(){var t=this;return t.ERR=null,t.DEF=null,t.cTokens=null,t.Tokens=null,t.Style=null,t},parse:function(t){t=t||"";var n,e,l=this,o=t.split(Dn),s=o.length,i=[];for(e={state:new r,tokens:null},n=0;s>n;n++)e=l.getLineTokens(o[n],e.state,n),i=i.concat(e.tokens),s-1>n&&i.push("\n");return i},getLineTokens:function(t,e){var r,l,o,s,i,u,c,a,p,f,h,g=this,k=g.cTokens,d=g.Tokens,m=d.length,E=g.Style,v=g.DEF,R=g.ERR;for(u=[],f=new n(t),h=e.stack,c={type:null,content:""},a=null,p=null,f.sol()&&!h.isEmpty()&&x===h.peek().tt&&h.pop();!f.eol();)if(l=0,v===p||R===p?(c.type&&u.push(c),u.push(f.cur(1)),c={type:null,content:""}):p&&p!==c.type?(c.type&&u.push(c),c={type:p,content:f.cur(1)}):c.type&&(c.content+=f.cur(1)),p=!1,!h.isEmpty()&&S===h.peek().tt||!f.spc()){for(;!h.isEmpty()&&!f.eol();){if(k){for(s=0,o=0;sr;r++)if(i=d[r],e.t=a=i.get(f,e),!1!==a){if(!0!==a){p=E[a]||v,i.ACT&&(h.empty("sID",i.sID),e.t=a=R,p=R,currentError=i.err()),l=1;break}}else{if(i.ERR||i.REQ){h.empty("sID",i.sID),f.nxt(),e.t=a=R,p=R,currentError=i.err(),l=1;break}p=!1}if(!l){if(f.eol())break;f.nxt(),e.t=a=v,p=v}}}else e.t=a=v,p=v;return v===p||R===p?(c.type&&u.push(c),u.push(f.cur(1))):p&&p!==c.type?(c.type&&u.push(c),u.push({type:p,content:f.cur(1)})):c.type&&(c.content+=f.cur(1),u.push(c)),c=null,{state:e,tokens:u}}},_="",C="";t.PrismGrammar={VERSION:"0.10",extend:Cn,parse:v,getMode:y};return t.PrismGrammar}); \ No newline at end of file diff --git a/src/main.js b/src/main.js index 963b4a0..0279fb4 100644 --- a/src/main.js +++ b/src/main.js @@ -211,8 +211,8 @@ Parser[PROTO] = { else if ( true !== type ) { style = Style[type] || DEFAULT; - // match action error - if ( tokenizer.MTCH ) + // action error + if ( tokenizer.ACT ) { // empty the stack stack.empty('sID', tokenizer.sID);