Socket
Socket
Sign inDemoInstall

intl-messageformat-parser

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-messageformat-parser - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

dist/parser-min.js

@@ -1,1 +0,1 @@

(function(){"use strict";var a=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Nb!==b&&(Nb>b&&(Nb=0,Ob={line:1,column:1,seenCR:!1}),c(Ob,Nb,b),Nb=b),Ob}function d(a){Pb>Lb||(Lb>Pb&&(Pb=Lb,Qb=[]),Qb.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=f<a.length?a.charAt(f):null;return null!==e&&g(e),new b(null!==d?d:h(e,j),e,j,f,i.line,i.column)}function f(){var a;return a=g()}function g(){var a,b,c;if(a=Lb,b=[],c=h(),c!==C)for(;c!==C;)b.push(c),c=h();else b=F;return b!==C&&(Mb=a,b=G(b)),a=b}function h(){var a;return a=j(),a===C&&(a=l()),a}function i(){var b,c,d,e,f,g;if(b=Lb,c=[],d=Lb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Lb=d,d=F)):(Lb=d,d=F)):(Lb=d,d=F),d!==C)for(;d!==C;)c.push(d),d=Lb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Lb=d,d=F)):(Lb=d,d=F)):(Lb=d,d=F);else c=F;return c!==C&&(c=a.substring(b,Lb)),b=c,b===C&&(b=Lb,c=t(),c!==C&&(c=a.substring(b,Lb)),b=c),b}function j(){var a,b;return a=Lb,b=i(),b!==C&&(Mb=a,b=H(b)),a=b}function k(){var b,c,e;if(b=x(),b===C){if(b=Lb,c=[],I.test(a.charAt(Lb))?(e=a.charAt(Lb),Lb++):(e=C,0===Rb&&d(J)),e!==C)for(;e!==C;)c.push(e),I.test(a.charAt(Lb))?(e=a.charAt(Lb),Lb++):(e=C,0===Rb&&d(J));else c=F;c!==C&&(c=a.substring(b,Lb)),b=c}return b}function l(){var b,c,e,f,g,h,i,j,l;return b=Lb,123===a.charCodeAt(Lb)?(c=K,Lb++):(c=C,0===Rb&&d(L)),c!==C?(e=u(),e!==C?(f=k(),f!==C?(g=u(),g!==C?(h=Lb,44===a.charCodeAt(Lb)?(i=N,Lb++):(i=C,0===Rb&&d(O)),i!==C?(j=u(),j!==C?(l=m(),l!==C?(i=[i,j,l],h=i):(Lb=h,h=F)):(Lb=h,h=F)):(Lb=h,h=F),h===C&&(h=M),h!==C?(i=u(),i!==C?(125===a.charCodeAt(Lb)?(j=P,Lb++):(j=C,0===Rb&&d(Q)),j!==C?(Mb=b,c=R(f,h),b=c):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F),b}function m(){var a;return a=n(),a===C&&(a=o(),a===C&&(a=p())),a}function n(){var b,c,e,f,g,h,i;return b=Lb,a.substr(Lb,6)===S?(c=S,Lb+=6):(c=C,0===Rb&&d(T)),c===C&&(a.substr(Lb,4)===U?(c=U,Lb+=4):(c=C,0===Rb&&d(V)),c===C&&(a.substr(Lb,4)===W?(c=W,Lb+=4):(c=C,0===Rb&&d(X)))),c!==C?(e=u(),e!==C?(f=Lb,44===a.charCodeAt(Lb)?(g=N,Lb++):(g=C,0===Rb&&d(O)),g!==C?(h=u(),h!==C?(i=z(),i!==C?(g=[g,h,i],f=g):(Lb=f,f=F)):(Lb=f,f=F)):(Lb=f,f=F),f===C&&(f=M),f!==C?(Mb=b,c=Y(c,f),b=c):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F),b}function o(){var b,c,e,f,g,h,i,j,k;if(b=Lb,a.substr(Lb,6)===Z?(c=Z,Lb+=6):(c=C,0===Rb&&d($)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Lb)?(f=N,Lb++):(f=C,0===Rb&&d(O)),f!==C)if(g=u(),g!==C)if(h=s(),h===C&&(h=M),h!==C)if(i=u(),i!==C){if(j=[],k=r(),k!==C)for(;k!==C;)j.push(k),k=r();else j=F;j!==C?(Mb=b,c=_(h,j),b=c):(Lb=b,b=F)}else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;return b}function p(){var b,c,e,f,g,h,i;if(b=Lb,a.substr(Lb,6)===ab?(c=ab,Lb+=6):(c=C,0===Rb&&d(bb)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Lb)?(f=N,Lb++):(f=C,0===Rb&&d(O)),f!==C)if(g=u(),g!==C){if(h=[],i=r(),i!==C)for(;i!==C;)h.push(i),i=r();else h=F;h!==C?(Mb=b,c=cb(h),b=c):(Lb=b,b=F)}else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;else Lb=b,b=F;return b}function q(){var b,c,e;return b=Lb,61===a.charCodeAt(Lb)?(c=db,Lb++):(c=C,0===Rb&&d(eb)),c!==C?(e=x(),e!==C?(Mb=b,c=fb(e),b=c):(Lb=b,b=F)):(Lb=b,b=F),b===C&&(b=z()),b}function r(){var b,c,e,f,h,i,j,k,l;return b=Lb,c=u(),c!==C?(e=q(),e!==C?(f=u(),f!==C?(123===a.charCodeAt(Lb)?(h=K,Lb++):(h=C,0===Rb&&d(L)),h!==C?(i=u(),i!==C?(j=g(),j!==C?(k=u(),k!==C?(125===a.charCodeAt(Lb)?(l=P,Lb++):(l=C,0===Rb&&d(Q)),l!==C?(Mb=b,c=gb(e,j),b=c):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F),b}function s(){var b,c,e,f;return b=Lb,a.substr(Lb,7)===hb?(c=hb,Lb+=7):(c=C,0===Rb&&d(ib)),c!==C?(e=u(),e!==C?(f=x(),f!==C?(Mb=b,c=jb(f),b=c):(Lb=b,b=F)):(Lb=b,b=F)):(Lb=b,b=F),b}function t(){var b,c;if(Rb++,b=[],lb.test(a.charAt(Lb))?(c=a.charAt(Lb),Lb++):(c=C,0===Rb&&d(mb)),c!==C)for(;c!==C;)b.push(c),lb.test(a.charAt(Lb))?(c=a.charAt(Lb),Lb++):(c=C,0===Rb&&d(mb));else b=F;return Rb--,b===C&&(c=C,0===Rb&&d(kb)),b}function u(){var a,b;for(Rb++,a=[],b=t();b!==C;)a.push(b),b=t();return Rb--,a===C&&(b=C,0===Rb&&d(nb)),a}function v(){var b;return ob.test(a.charAt(Lb))?(b=a.charAt(Lb),Lb++):(b=C,0===Rb&&d(pb)),b}function w(){var b;return qb.test(a.charAt(Lb))?(b=a.charAt(Lb),Lb++):(b=C,0===Rb&&d(rb)),b}function x(){var b,c,e,f,g,h;if(b=Lb,48===a.charCodeAt(Lb)?(c=sb,Lb++):(c=C,0===Rb&&d(tb)),c===C){if(c=Lb,e=Lb,ub.test(a.charAt(Lb))?(f=a.charAt(Lb),Lb++):(f=C,0===Rb&&d(vb)),f!==C){for(g=[],h=v();h!==C;)g.push(h),h=v();g!==C?(f=[f,g],e=f):(Lb=e,e=F)}else Lb=e,e=F;e!==C&&(e=a.substring(c,Lb)),c=e}return c!==C&&(Mb=b,c=wb(c)),b=c}function y(){var b,c,e,f,g,h,i,j;return xb.test(a.charAt(Lb))?(b=a.charAt(Lb),Lb++):(b=C,0===Rb&&d(yb)),b===C&&(b=Lb,a.substr(Lb,2)===zb?(c=zb,Lb+=2):(c=C,0===Rb&&d(Ab)),c!==C&&(Mb=b,c=Bb()),b=c,b===C&&(b=Lb,a.substr(Lb,2)===Cb?(c=Cb,Lb+=2):(c=C,0===Rb&&d(Db)),c!==C&&(Mb=b,c=Eb()),b=c,b===C&&(b=Lb,a.substr(Lb,2)===Fb?(c=Fb,Lb+=2):(c=C,0===Rb&&d(Gb)),c!==C&&(Mb=b,c=Hb()),b=c,b===C&&(b=Lb,a.substr(Lb,2)===Ib?(c=Ib,Lb+=2):(c=C,0===Rb&&d(Jb)),c!==C?(e=Lb,f=Lb,g=w(),g!==C?(h=w(),h!==C?(i=w(),i!==C?(j=w(),j!==C?(g=[g,h,i,j],f=g):(Lb=f,f=F)):(Lb=f,f=F)):(Lb=f,f=F)):(Lb=f,f=F),f!==C&&(f=a.substring(e,Lb)),e=f,e!==C?(Mb=b,c=Kb(e),b=c):(Lb=b,b=F)):(Lb=b,b=F))))),b}function z(){var b,c,d;if(b=Lb,c=[],d=y(),d!==C)for(;d!==C;)c.push(d),d=y();else c=F;return c!==C&&(c=a.substring(b,Lb)),b=c}var A,B=arguments.length>1?arguments[1]:{},C={},D={start:f},E=f,F=C,G=function(a){return{type:"messageFormatPattern",elements:a}},H=function(a){return{type:"messageTextElement",value:a}},I=/^[^ \t\n\r,.+={}]/,J={type:"class",value:"[^ \\t\\n\\r,.+={}]",description:"[^ \\t\\n\\r,.+={}]"},K="{",L={type:"literal",value:"{",description:'"{"'},M=null,N=",",O={type:"literal",value:",",description:'","'},P="}",Q={type:"literal",value:"}",description:'"}"'},R=function(a,b){return{type:"argumentElement",id:a,format:b&&b[2]}},S="number",T={type:"literal",value:"number",description:'"number"'},U="date",V={type:"literal",value:"date",description:'"date"'},W="time",X={type:"literal",value:"time",description:'"time"'},Y=function(a,b){return{type:a+"Format",style:b&&b[2]}},Z="plural",$={type:"literal",value:"plural",description:'"plural"'},_=function(a,b){return{type:"pluralFormat",offset:a||0,options:b}},ab="select",bb={type:"literal",value:"select",description:'"select"'},cb=function(a){return{type:"selectFormat",options:a}},db="=",eb={type:"literal",value:"=",description:'"="'},fb=function(a){return a},gb=function(a,b){return{type:"optionalFormatPattern",selector:a,value:b}},hb="offset:",ib={type:"literal",value:"offset:",description:'"offset:"'},jb=function(a){return a},kb={type:"other",description:"whitespace"},lb=/^[ \t\n\r]/,mb={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},nb={type:"other",description:"optionalWhitespace"},ob=/^[0-9]/,pb={type:"class",value:"[0-9]",description:"[0-9]"},qb=/^[0-9a-f]/i,rb={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},sb="0",tb={type:"literal",value:"0",description:'"0"'},ub=/^[1-9]/,vb={type:"class",value:"[1-9]",description:"[1-9]"},wb=function(a){return parseInt(a,10)},xb=/^[^{}\\\0-\x1F \t\n\r]/,yb={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},zb="\\#",Ab={type:"literal",value:"\\#",description:'"\\\\#"'},Bb=function(){return"\\#"},Cb="\\{",Db={type:"literal",value:"\\{",description:'"\\\\{"'},Eb=function(){return"{"},Fb="\\}",Gb={type:"literal",value:"\\}",description:'"\\\\}"'},Hb=function(){return"}"},Ib="\\u",Jb={type:"literal",value:"\\u",description:'"\\\\u"'},Kb=function(a){return String.fromCharCode(parseInt(a,16))},Lb=0,Mb=0,Nb=0,Ob={line:1,column:1,seenCR:!1},Pb=0,Qb=[],Rb=0;if("startRule"in B){if(!(B.startRule in D))throw new Error("Can't start parsing from rule \""+B.startRule+'".');E=D[B.startRule]}if(A=E(),A!==C&&Lb===a.length)return A;throw A!==C&&Lb<a.length&&d({type:"end",description:"end of input"}),e(null,Qb,Pb)}return a(b,Error),{SyntaxError:b,parse:c}}();"function"==typeof define&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:"undefined"!=typeof this&&(this.IntlMessageFormatParser=a)}).call(this);
(function(){"use strict";var a=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Pb!==b&&(Pb>b&&(Pb=0,Qb={line:1,column:1,seenCR:!1}),c(Qb,Pb,b),Pb=b),Qb}function d(a){Rb>Nb||(Nb>Rb&&(Rb=Nb,Sb=[]),Sb.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=f<a.length?a.charAt(f):null;return null!==e&&g(e),new b(null!==d?d:h(e,j),e,j,f,i.line,i.column)}function f(){var a;return a=g()}function g(){var a,b,c;if(a=Nb,b=[],c=h(),c!==C)for(;c!==C;)b.push(c),c=h();else b=F;return b!==C&&(Ob=a,b=G(b)),a=b}function h(){var a;return a=j(),a===C&&(a=l()),a}function i(){var b,c,d,e,f,g;if(b=Nb,c=[],d=Nb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Nb=d,d=F)):(Nb=d,d=F)):(Nb=d,d=F),d!==C)for(;d!==C;)c.push(d),d=Nb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Nb=d,d=F)):(Nb=d,d=F)):(Nb=d,d=F);else c=F;return c!==C&&(Ob=b,c=H(c)),b=c,b===C&&(b=Nb,c=t(),c!==C&&(c=a.substring(b,Nb)),b=c),b}function j(){var a,b;return a=Nb,b=i(),b!==C&&(Ob=a,b=I(b)),a=b}function k(){var b,c,e;if(b=x(),b===C){if(b=Nb,c=[],J.test(a.charAt(Nb))?(e=a.charAt(Nb),Nb++):(e=C,0===Tb&&d(K)),e!==C)for(;e!==C;)c.push(e),J.test(a.charAt(Nb))?(e=a.charAt(Nb),Nb++):(e=C,0===Tb&&d(K));else c=F;c!==C&&(c=a.substring(b,Nb)),b=c}return b}function l(){var b,c,e,f,g,h,i,j,l;return b=Nb,123===a.charCodeAt(Nb)?(c=L,Nb++):(c=C,0===Tb&&d(M)),c!==C?(e=u(),e!==C?(f=k(),f!==C?(g=u(),g!==C?(h=Nb,44===a.charCodeAt(Nb)?(i=O,Nb++):(i=C,0===Tb&&d(P)),i!==C?(j=u(),j!==C?(l=m(),l!==C?(i=[i,j,l],h=i):(Nb=h,h=F)):(Nb=h,h=F)):(Nb=h,h=F),h===C&&(h=N),h!==C?(i=u(),i!==C?(125===a.charCodeAt(Nb)?(j=Q,Nb++):(j=C,0===Tb&&d(R)),j!==C?(Ob=b,c=S(f,h),b=c):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F),b}function m(){var a;return a=n(),a===C&&(a=o(),a===C&&(a=p())),a}function n(){var b,c,e,f,g,h,i;return b=Nb,a.substr(Nb,6)===T?(c=T,Nb+=6):(c=C,0===Tb&&d(U)),c===C&&(a.substr(Nb,4)===V?(c=V,Nb+=4):(c=C,0===Tb&&d(W)),c===C&&(a.substr(Nb,4)===X?(c=X,Nb+=4):(c=C,0===Tb&&d(Y)))),c!==C?(e=u(),e!==C?(f=Nb,44===a.charCodeAt(Nb)?(g=O,Nb++):(g=C,0===Tb&&d(P)),g!==C?(h=u(),h!==C?(i=z(),i!==C?(g=[g,h,i],f=g):(Nb=f,f=F)):(Nb=f,f=F)):(Nb=f,f=F),f===C&&(f=N),f!==C?(Ob=b,c=Z(c,f),b=c):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F),b}function o(){var b,c,e,f,g,h,i,j,k;if(b=Nb,a.substr(Nb,6)===$?(c=$,Nb+=6):(c=C,0===Tb&&d(_)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Nb)?(f=O,Nb++):(f=C,0===Tb&&d(P)),f!==C)if(g=u(),g!==C)if(h=s(),h===C&&(h=N),h!==C)if(i=u(),i!==C){if(j=[],k=r(),k!==C)for(;k!==C;)j.push(k),k=r();else j=F;j!==C?(Ob=b,c=ab(h,j),b=c):(Nb=b,b=F)}else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;return b}function p(){var b,c,e,f,g,h,i;if(b=Nb,a.substr(Nb,6)===bb?(c=bb,Nb+=6):(c=C,0===Tb&&d(cb)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Nb)?(f=O,Nb++):(f=C,0===Tb&&d(P)),f!==C)if(g=u(),g!==C){if(h=[],i=r(),i!==C)for(;i!==C;)h.push(i),i=r();else h=F;h!==C?(Ob=b,c=db(h),b=c):(Nb=b,b=F)}else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;else Nb=b,b=F;return b}function q(){var b,c,e;return b=Nb,61===a.charCodeAt(Nb)?(c=eb,Nb++):(c=C,0===Tb&&d(fb)),c!==C?(e=x(),e!==C?(Ob=b,c=gb(e),b=c):(Nb=b,b=F)):(Nb=b,b=F),b===C&&(b=z()),b}function r(){var b,c,e,f,h,i,j,k,l;return b=Nb,c=u(),c!==C?(e=q(),e!==C?(f=u(),f!==C?(123===a.charCodeAt(Nb)?(h=L,Nb++):(h=C,0===Tb&&d(M)),h!==C?(i=u(),i!==C?(j=g(),j!==C?(k=u(),k!==C?(125===a.charCodeAt(Nb)?(l=Q,Nb++):(l=C,0===Tb&&d(R)),l!==C?(Ob=b,c=hb(e,j),b=c):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F),b}function s(){var b,c,e,f;return b=Nb,a.substr(Nb,7)===ib?(c=ib,Nb+=7):(c=C,0===Tb&&d(jb)),c!==C?(e=u(),e!==C?(f=x(),f!==C?(Ob=b,c=kb(f),b=c):(Nb=b,b=F)):(Nb=b,b=F)):(Nb=b,b=F),b}function t(){var b,c;if(Tb++,b=[],mb.test(a.charAt(Nb))?(c=a.charAt(Nb),Nb++):(c=C,0===Tb&&d(nb)),c!==C)for(;c!==C;)b.push(c),mb.test(a.charAt(Nb))?(c=a.charAt(Nb),Nb++):(c=C,0===Tb&&d(nb));else b=F;return Tb--,b===C&&(c=C,0===Tb&&d(lb)),b}function u(){var b,c,e;for(Tb++,b=Nb,c=[],e=t();e!==C;)c.push(e),e=t();return c!==C&&(c=a.substring(b,Nb)),b=c,Tb--,b===C&&(c=C,0===Tb&&d(ob)),b}function v(){var b;return pb.test(a.charAt(Nb))?(b=a.charAt(Nb),Nb++):(b=C,0===Tb&&d(qb)),b}function w(){var b;return rb.test(a.charAt(Nb))?(b=a.charAt(Nb),Nb++):(b=C,0===Tb&&d(sb)),b}function x(){var b,c,e,f,g,h;if(b=Nb,48===a.charCodeAt(Nb)?(c=tb,Nb++):(c=C,0===Tb&&d(ub)),c===C){if(c=Nb,e=Nb,vb.test(a.charAt(Nb))?(f=a.charAt(Nb),Nb++):(f=C,0===Tb&&d(wb)),f!==C){for(g=[],h=v();h!==C;)g.push(h),h=v();g!==C?(f=[f,g],e=f):(Nb=e,e=F)}else Nb=e,e=F;e!==C&&(e=a.substring(c,Nb)),c=e}return c!==C&&(Ob=b,c=xb(c)),b=c}function y(){var b,c,e,f,g,h,i,j;return yb.test(a.charAt(Nb))?(b=a.charAt(Nb),Nb++):(b=C,0===Tb&&d(zb)),b===C&&(b=Nb,a.substr(Nb,2)===Ab?(c=Ab,Nb+=2):(c=C,0===Tb&&d(Bb)),c!==C&&(Ob=b,c=Cb()),b=c,b===C&&(b=Nb,a.substr(Nb,2)===Db?(c=Db,Nb+=2):(c=C,0===Tb&&d(Eb)),c!==C&&(Ob=b,c=Fb()),b=c,b===C&&(b=Nb,a.substr(Nb,2)===Gb?(c=Gb,Nb+=2):(c=C,0===Tb&&d(Hb)),c!==C&&(Ob=b,c=Ib()),b=c,b===C&&(b=Nb,a.substr(Nb,2)===Jb?(c=Jb,Nb+=2):(c=C,0===Tb&&d(Kb)),c!==C?(e=Nb,f=Nb,g=w(),g!==C?(h=w(),h!==C?(i=w(),i!==C?(j=w(),j!==C?(g=[g,h,i,j],f=g):(Nb=f,f=F)):(Nb=f,f=F)):(Nb=f,f=F)):(Nb=f,f=F),f!==C&&(f=a.substring(e,Nb)),e=f,e!==C?(Ob=b,c=Lb(e),b=c):(Nb=b,b=F)):(Nb=b,b=F))))),b}function z(){var a,b,c;if(a=Nb,b=[],c=y(),c!==C)for(;c!==C;)b.push(c),c=y();else b=F;return b!==C&&(Ob=a,b=Mb(b)),a=b}var A,B=arguments.length>1?arguments[1]:{},C={},D={start:f},E=f,F=C,G=function(a){return{type:"messageFormatPattern",elements:a}},H=function(a){var b,c,d,e,f,g="";for(b=0,d=a.length;d>b;b+=1)for(e=a[b],c=0,f=e.length;f>c;c+=1)g+=e[c];return g},I=function(a){return{type:"messageTextElement",value:a}},J=/^[^ \t\n\r,.+={}#]/,K={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},L="{",M={type:"literal",value:"{",description:'"{"'},N=null,O=",",P={type:"literal",value:",",description:'","'},Q="}",R={type:"literal",value:"}",description:'"}"'},S=function(a,b){return{type:"argumentElement",id:a,format:b&&b[2]}},T="number",U={type:"literal",value:"number",description:'"number"'},V="date",W={type:"literal",value:"date",description:'"date"'},X="time",Y={type:"literal",value:"time",description:'"time"'},Z=function(a,b){return{type:a+"Format",style:b&&b[2]}},$="plural",_={type:"literal",value:"plural",description:'"plural"'},ab=function(a,b){return{type:"pluralFormat",offset:a||0,options:b}},bb="select",cb={type:"literal",value:"select",description:'"select"'},db=function(a){return{type:"selectFormat",options:a}},eb="=",fb={type:"literal",value:"=",description:'"="'},gb=function(a){return a},hb=function(a,b){return{type:"optionalFormatPattern",selector:a,value:b}},ib="offset:",jb={type:"literal",value:"offset:",description:'"offset:"'},kb=function(a){return a},lb={type:"other",description:"whitespace"},mb=/^[ \t\n\r]/,nb={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},ob={type:"other",description:"optionalWhitespace"},pb=/^[0-9]/,qb={type:"class",value:"[0-9]",description:"[0-9]"},rb=/^[0-9a-f]/i,sb={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},tb="0",ub={type:"literal",value:"0",description:'"0"'},vb=/^[1-9]/,wb={type:"class",value:"[1-9]",description:"[1-9]"},xb=function(a){return parseInt(a,10)},yb=/^[^{}\\\0-\x1F \t\n\r]/,zb={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Ab="\\#",Bb={type:"literal",value:"\\#",description:'"\\\\#"'},Cb=function(){return"\\#"},Db="\\{",Eb={type:"literal",value:"\\{",description:'"\\\\{"'},Fb=function(){return"{"},Gb="\\}",Hb={type:"literal",value:"\\}",description:'"\\\\}"'},Ib=function(){return"}"},Jb="\\u",Kb={type:"literal",value:"\\u",description:'"\\\\u"'},Lb=function(a){return String.fromCharCode(parseInt(a,16))},Mb=function(a){return a.join("")},Nb=0,Ob=0,Pb=0,Qb={line:1,column:1,seenCR:!1},Rb=0,Sb=[],Tb=0;if("startRule"in B){if(!(B.startRule in D))throw new Error("Can't start parsing from rule \""+B.startRule+'".');E=D[B.startRule]}if(A=E(),A!==C&&Nb===a.length)return A;throw A!==C&&Nb<a.length&&d({type:"end",description:"end of input"}),e(null,Sb,Rb)}return a(b,Error),{SyntaxError:b,parse:c}}();"function"==typeof define&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:"undefined"!=typeof this&&(this.IntlMessageFormatParser=a)}).call(this);

@@ -46,3 +46,17 @@ (function() {

},
peg$c3 = function(messageText) {
peg$c3 = function(text) {
var string = '',
i, j, outerLen, inner, innerLen;
for (i = 0, outerLen = text.length; i < outerLen; i += 1) {
inner = text[i];
for (j = 0, innerLen = inner.length; j < innerLen; j += 1) {
string += inner[j];
}
}
return string;
},
peg$c4 = function(messageText) {
return {

@@ -53,12 +67,12 @@ type : 'messageTextElement',

},
peg$c4 = /^[^ \t\n\r,.+={}]/,
peg$c5 = { type: "class", value: "[^ \\t\\n\\r,.+={}]", description: "[^ \\t\\n\\r,.+={}]" },
peg$c6 = "{",
peg$c7 = { type: "literal", value: "{", description: "\"{\"" },
peg$c8 = null,
peg$c9 = ",",
peg$c10 = { type: "literal", value: ",", description: "\",\"" },
peg$c11 = "}",
peg$c12 = { type: "literal", value: "}", description: "\"}\"" },
peg$c13 = function(id, format) {
peg$c5 = /^[^ \t\n\r,.+={}#]/,
peg$c6 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" },
peg$c7 = "{",
peg$c8 = { type: "literal", value: "{", description: "\"{\"" },
peg$c9 = null,
peg$c10 = ",",
peg$c11 = { type: "literal", value: ",", description: "\",\"" },
peg$c12 = "}",
peg$c13 = { type: "literal", value: "}", description: "\"}\"" },
peg$c14 = function(id, format) {
return {

@@ -70,9 +84,9 @@ type : 'argumentElement',

},
peg$c14 = "number",
peg$c15 = { type: "literal", value: "number", description: "\"number\"" },
peg$c16 = "date",
peg$c17 = { type: "literal", value: "date", description: "\"date\"" },
peg$c18 = "time",
peg$c19 = { type: "literal", value: "time", description: "\"time\"" },
peg$c20 = function(type, style) {
peg$c15 = "number",
peg$c16 = { type: "literal", value: "number", description: "\"number\"" },
peg$c17 = "date",
peg$c18 = { type: "literal", value: "date", description: "\"date\"" },
peg$c19 = "time",
peg$c20 = { type: "literal", value: "time", description: "\"time\"" },
peg$c21 = function(type, style) {
return {

@@ -83,5 +97,5 @@ type : type + 'Format',

},
peg$c21 = "plural",
peg$c22 = { type: "literal", value: "plural", description: "\"plural\"" },
peg$c23 = function(offset, options) {
peg$c22 = "plural",
peg$c23 = { type: "literal", value: "plural", description: "\"plural\"" },
peg$c24 = function(offset, options) {
return {

@@ -93,5 +107,5 @@ type : 'pluralFormat',

},
peg$c24 = "select",
peg$c25 = { type: "literal", value: "select", description: "\"select\"" },
peg$c26 = function(options) {
peg$c25 = "select",
peg$c26 = { type: "literal", value: "select", description: "\"select\"" },
peg$c27 = function(options) {
return {

@@ -102,6 +116,6 @@ type : 'selectFormat',

},
peg$c27 = "=",
peg$c28 = { type: "literal", value: "=", description: "\"=\"" },
peg$c29 = function(number) { return number; },
peg$c30 = function(selector, pattern) {
peg$c28 = "=",
peg$c29 = { type: "literal", value: "=", description: "\"=\"" },
peg$c30 = function(number) { return number; },
peg$c31 = function(selector, pattern) {
return {

@@ -113,38 +127,39 @@ type : 'optionalFormatPattern',

},
peg$c31 = "offset:",
peg$c32 = { type: "literal", value: "offset:", description: "\"offset:\"" },
peg$c33 = function(number) {
peg$c32 = "offset:",
peg$c33 = { type: "literal", value: "offset:", description: "\"offset:\"" },
peg$c34 = function(number) {
return number;
},
peg$c34 = { type: "other", description: "whitespace" },
peg$c35 = /^[ \t\n\r]/,
peg$c36 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
peg$c37 = { type: "other", description: "optionalWhitespace" },
peg$c38 = /^[0-9]/,
peg$c39 = { type: "class", value: "[0-9]", description: "[0-9]" },
peg$c40 = /^[0-9a-f]/i,
peg$c41 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" },
peg$c42 = "0",
peg$c43 = { type: "literal", value: "0", description: "\"0\"" },
peg$c44 = /^[1-9]/,
peg$c45 = { type: "class", value: "[1-9]", description: "[1-9]" },
peg$c46 = function(digits) {
peg$c35 = { type: "other", description: "whitespace" },
peg$c36 = /^[ \t\n\r]/,
peg$c37 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
peg$c38 = { type: "other", description: "optionalWhitespace" },
peg$c39 = /^[0-9]/,
peg$c40 = { type: "class", value: "[0-9]", description: "[0-9]" },
peg$c41 = /^[0-9a-f]/i,
peg$c42 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" },
peg$c43 = "0",
peg$c44 = { type: "literal", value: "0", description: "\"0\"" },
peg$c45 = /^[1-9]/,
peg$c46 = { type: "class", value: "[1-9]", description: "[1-9]" },
peg$c47 = function(digits) {
return parseInt(digits, 10);
},
peg$c47 = /^[^{}\\\0-\x1F \t\n\r]/,
peg$c48 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" },
peg$c49 = "\\#",
peg$c50 = { type: "literal", value: "\\#", description: "\"\\\\#\"" },
peg$c51 = function() { return '\\#'; },
peg$c52 = "\\{",
peg$c53 = { type: "literal", value: "\\{", description: "\"\\\\{\"" },
peg$c54 = function() { return '\u007B'; },
peg$c55 = "\\}",
peg$c56 = { type: "literal", value: "\\}", description: "\"\\\\}\"" },
peg$c57 = function() { return '\u007D'; },
peg$c58 = "\\u",
peg$c59 = { type: "literal", value: "\\u", description: "\"\\\\u\"" },
peg$c60 = function(digits) {
peg$c48 = /^[^{}\\\0-\x1F \t\n\r]/,
peg$c49 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" },
peg$c50 = "\\#",
peg$c51 = { type: "literal", value: "\\#", description: "\"\\\\#\"" },
peg$c52 = function() { return '\\#'; },
peg$c53 = "\\{",
peg$c54 = { type: "literal", value: "\\{", description: "\"\\\\{\"" },
peg$c55 = function() { return '\u007B'; },
peg$c56 = "\\}",
peg$c57 = { type: "literal", value: "\\}", description: "\"\\\\}\"" },
peg$c58 = function() { return '\u007D'; },
peg$c59 = "\\u",
peg$c60 = { type: "literal", value: "\\u", description: "\"\\\\u\"" },
peg$c61 = function(digits) {
return String.fromCharCode(parseInt(digits, 16));
},
peg$c62 = function(chars) { return chars.join(''); },

@@ -414,3 +429,4 @@ peg$currPos = 0,

if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
peg$reportedPos = s0;
s1 = peg$c3(s1);
}

@@ -437,3 +453,3 @@ s0 = s1;

peg$reportedPos = s0;
s1 = peg$c3(s1);
s1 = peg$c4(s1);
}

@@ -452,3 +468,3 @@ s0 = s1;

s1 = [];
if (peg$c4.test(input.charAt(peg$currPos))) {
if (peg$c5.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -458,3 +474,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c5); }
if (peg$silentFails === 0) { peg$fail(peg$c6); }
}

@@ -464,3 +480,3 @@ if (s2 !== peg$FAILED) {

s1.push(s2);
if (peg$c4.test(input.charAt(peg$currPos))) {
if (peg$c5.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -470,3 +486,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c5); }
if (peg$silentFails === 0) { peg$fail(peg$c6); }
}

@@ -491,7 +507,7 @@ }

if (input.charCodeAt(peg$currPos) === 123) {
s1 = peg$c6;
s1 = peg$c7;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c7); }
if (peg$silentFails === 0) { peg$fail(peg$c8); }
}

@@ -507,7 +523,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s6 = peg$c9;
s6 = peg$c10;
peg$currPos++;
} else {
s6 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -534,3 +550,3 @@ if (s6 !== peg$FAILED) {

if (s5 === peg$FAILED) {
s5 = peg$c8;
s5 = peg$c9;
}

@@ -541,11 +557,11 @@ if (s5 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s7 = peg$c11;
s7 = peg$c12;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c12); }
if (peg$silentFails === 0) { peg$fail(peg$c13); }
}
if (s7 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c13(s3, s5);
s1 = peg$c14(s3, s5);
s0 = s1;

@@ -602,24 +618,24 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c14) {
s1 = peg$c14;
if (input.substr(peg$currPos, 6) === peg$c15) {
s1 = peg$c15;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c15); }
if (peg$silentFails === 0) { peg$fail(peg$c16); }
}
if (s1 === peg$FAILED) {
if (input.substr(peg$currPos, 4) === peg$c16) {
s1 = peg$c16;
if (input.substr(peg$currPos, 4) === peg$c17) {
s1 = peg$c17;
peg$currPos += 4;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c17); }
if (peg$silentFails === 0) { peg$fail(peg$c18); }
}
if (s1 === peg$FAILED) {
if (input.substr(peg$currPos, 4) === peg$c18) {
s1 = peg$c18;
if (input.substr(peg$currPos, 4) === peg$c19) {
s1 = peg$c19;
peg$currPos += 4;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c19); }
if (peg$silentFails === 0) { peg$fail(peg$c20); }
}

@@ -633,7 +649,7 @@ }

if (input.charCodeAt(peg$currPos) === 44) {
s4 = peg$c9;
s4 = peg$c10;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -660,7 +676,7 @@ if (s4 !== peg$FAILED) {

if (s3 === peg$FAILED) {
s3 = peg$c8;
s3 = peg$c9;
}
if (s3 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c20(s1, s3);
s1 = peg$c21(s1, s3);
s0 = s1;

@@ -687,8 +703,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c21) {
s1 = peg$c21;
if (input.substr(peg$currPos, 6) === peg$c22) {
s1 = peg$c22;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c22); }
if (peg$silentFails === 0) { peg$fail(peg$c23); }
}

@@ -699,7 +715,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s3 = peg$c9;
s3 = peg$c10;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -711,3 +727,3 @@ if (s3 !== peg$FAILED) {

if (s5 === peg$FAILED) {
s5 = peg$c8;
s5 = peg$c9;
}

@@ -729,3 +745,3 @@ if (s5 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c23(s5, s7);
s1 = peg$c24(s5, s7);
s0 = s1;

@@ -768,8 +784,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c24) {
s1 = peg$c24;
if (input.substr(peg$currPos, 6) === peg$c25) {
s1 = peg$c25;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c25); }
if (peg$silentFails === 0) { peg$fail(peg$c26); }
}

@@ -780,7 +796,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s3 = peg$c9;
s3 = peg$c10;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -802,3 +818,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c26(s5);
s1 = peg$c27(s5);
s0 = s1;

@@ -834,7 +850,7 @@ } else {

if (input.charCodeAt(peg$currPos) === 61) {
s1 = peg$c27;
s1 = peg$c28;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c28); }
if (peg$silentFails === 0) { peg$fail(peg$c29); }
}

@@ -845,3 +861,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c29(s2);
s1 = peg$c30(s2);
s0 = s1;

@@ -874,7 +890,7 @@ } else {

if (input.charCodeAt(peg$currPos) === 123) {
s4 = peg$c6;
s4 = peg$c7;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c7); }
if (peg$silentFails === 0) { peg$fail(peg$c8); }
}

@@ -889,11 +905,11 @@ if (s4 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s8 = peg$c11;
s8 = peg$c12;
peg$currPos++;
} else {
s8 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c12); }
if (peg$silentFails === 0) { peg$fail(peg$c13); }
}
if (s8 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c30(s2, s6);
s1 = peg$c31(s2, s6);
s0 = s1;

@@ -940,8 +956,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c31) {
s1 = peg$c31;
if (input.substr(peg$currPos, 7) === peg$c32) {
s1 = peg$c32;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c32); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}

@@ -954,3 +970,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c33(s3);
s1 = peg$c34(s3);
s0 = s1;

@@ -978,3 +994,3 @@ } else {

s0 = [];
if (peg$c35.test(input.charAt(peg$currPos))) {
if (peg$c36.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -984,3 +1000,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -990,3 +1006,3 @@ if (s1 !== peg$FAILED) {

s0.push(s1);
if (peg$c35.test(input.charAt(peg$currPos))) {
if (peg$c36.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -996,3 +1012,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -1006,3 +1022,3 @@ }

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c34); }
if (peg$silentFails === 0) { peg$fail(peg$c35); }
}

@@ -1014,15 +1030,20 @@

function peg$parse_() {
var s0, s1;
var s0, s1, s2;
peg$silentFails++;
s0 = [];
s1 = peg$parsews();
while (s1 !== peg$FAILED) {
s0.push(s1);
s1 = peg$parsews();
s0 = peg$currPos;
s1 = [];
s2 = peg$parsews();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parsews();
}
if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
}
s0 = s1;
peg$silentFails--;
if (s0 === peg$FAILED) {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c37); }
if (peg$silentFails === 0) { peg$fail(peg$c38); }
}

@@ -1036,3 +1057,3 @@

if (peg$c38.test(input.charAt(peg$currPos))) {
if (peg$c39.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1042,3 +1063,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c39); }
if (peg$silentFails === 0) { peg$fail(peg$c40); }
}

@@ -1052,3 +1073,3 @@

if (peg$c40.test(input.charAt(peg$currPos))) {
if (peg$c41.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1058,3 +1079,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c41); }
if (peg$silentFails === 0) { peg$fail(peg$c42); }
}

@@ -1070,7 +1091,7 @@

if (input.charCodeAt(peg$currPos) === 48) {
s1 = peg$c42;
s1 = peg$c43;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c43); }
if (peg$silentFails === 0) { peg$fail(peg$c44); }
}

@@ -1080,3 +1101,3 @@ if (s1 === peg$FAILED) {

s2 = peg$currPos;
if (peg$c44.test(input.charAt(peg$currPos))) {
if (peg$c45.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);

@@ -1086,3 +1107,3 @@ peg$currPos++;

s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c45); }
if (peg$silentFails === 0) { peg$fail(peg$c46); }
}

@@ -1114,3 +1135,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c46(s1);
s1 = peg$c47(s1);
}

@@ -1125,3 +1146,3 @@ s0 = s1;

if (peg$c47.test(input.charAt(peg$currPos))) {
if (peg$c48.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1131,16 +1152,16 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c49) {
s1 = peg$c49;
if (input.substr(peg$currPos, 2) === peg$c50) {
s1 = peg$c50;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c51();
s1 = peg$c52();
}

@@ -1150,12 +1171,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c52) {
s1 = peg$c52;
if (input.substr(peg$currPos, 2) === peg$c53) {
s1 = peg$c53;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c53); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c54();
s1 = peg$c55();
}

@@ -1165,12 +1186,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c55) {
s1 = peg$c55;
if (input.substr(peg$currPos, 2) === peg$c56) {
s1 = peg$c56;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c56); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c57();
s1 = peg$c58();
}

@@ -1180,8 +1201,8 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c58) {
s1 = peg$c58;
if (input.substr(peg$currPos, 2) === peg$c59) {
s1 = peg$c59;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c59); }
if (peg$silentFails === 0) { peg$fail(peg$c60); }
}

@@ -1223,3 +1244,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c60(s2);
s1 = peg$c61(s2);
s0 = s1;

@@ -1257,3 +1278,4 @@ } else {

if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
peg$reportedPos = s0;
s1 = peg$c62(s1);
}

@@ -1260,0 +1282,0 @@ s0 = s1;

{
"name": "intl-messageformat-parser",
"version": "0.1.0",
"version": "0.1.1",
"description": "Parses ICU message strings to an AST that can be used to format the messages for a person's locale.",

@@ -34,3 +34,3 @@ "main": "dist/parser.js",

"grunt-benchmark": "^0.3.0",
"grunt-bundle-jsnext-lib": "git://github.com/caridy/grunt-bundle-jsnext-lib",
"grunt-bundle-jsnext-lib": "^0.1.0",
"grunt-contrib-clean": "^0.5.0",

@@ -37,0 +37,0 @@ "grunt-contrib-uglify": "^0.5.0",

@@ -43,3 +43,17 @@ export default (function() {

},
peg$c3 = function(messageText) {
peg$c3 = function(text) {
var string = '',
i, j, outerLen, inner, innerLen;
for (i = 0, outerLen = text.length; i < outerLen; i += 1) {
inner = text[i];
for (j = 0, innerLen = inner.length; j < innerLen; j += 1) {
string += inner[j];
}
}
return string;
},
peg$c4 = function(messageText) {
return {

@@ -50,12 +64,12 @@ type : 'messageTextElement',

},
peg$c4 = /^[^ \t\n\r,.+={}]/,
peg$c5 = { type: "class", value: "[^ \\t\\n\\r,.+={}]", description: "[^ \\t\\n\\r,.+={}]" },
peg$c6 = "{",
peg$c7 = { type: "literal", value: "{", description: "\"{\"" },
peg$c8 = null,
peg$c9 = ",",
peg$c10 = { type: "literal", value: ",", description: "\",\"" },
peg$c11 = "}",
peg$c12 = { type: "literal", value: "}", description: "\"}\"" },
peg$c13 = function(id, format) {
peg$c5 = /^[^ \t\n\r,.+={}#]/,
peg$c6 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" },
peg$c7 = "{",
peg$c8 = { type: "literal", value: "{", description: "\"{\"" },
peg$c9 = null,
peg$c10 = ",",
peg$c11 = { type: "literal", value: ",", description: "\",\"" },
peg$c12 = "}",
peg$c13 = { type: "literal", value: "}", description: "\"}\"" },
peg$c14 = function(id, format) {
return {

@@ -67,9 +81,9 @@ type : 'argumentElement',

},
peg$c14 = "number",
peg$c15 = { type: "literal", value: "number", description: "\"number\"" },
peg$c16 = "date",
peg$c17 = { type: "literal", value: "date", description: "\"date\"" },
peg$c18 = "time",
peg$c19 = { type: "literal", value: "time", description: "\"time\"" },
peg$c20 = function(type, style) {
peg$c15 = "number",
peg$c16 = { type: "literal", value: "number", description: "\"number\"" },
peg$c17 = "date",
peg$c18 = { type: "literal", value: "date", description: "\"date\"" },
peg$c19 = "time",
peg$c20 = { type: "literal", value: "time", description: "\"time\"" },
peg$c21 = function(type, style) {
return {

@@ -80,5 +94,5 @@ type : type + 'Format',

},
peg$c21 = "plural",
peg$c22 = { type: "literal", value: "plural", description: "\"plural\"" },
peg$c23 = function(offset, options) {
peg$c22 = "plural",
peg$c23 = { type: "literal", value: "plural", description: "\"plural\"" },
peg$c24 = function(offset, options) {
return {

@@ -90,5 +104,5 @@ type : 'pluralFormat',

},
peg$c24 = "select",
peg$c25 = { type: "literal", value: "select", description: "\"select\"" },
peg$c26 = function(options) {
peg$c25 = "select",
peg$c26 = { type: "literal", value: "select", description: "\"select\"" },
peg$c27 = function(options) {
return {

@@ -99,6 +113,6 @@ type : 'selectFormat',

},
peg$c27 = "=",
peg$c28 = { type: "literal", value: "=", description: "\"=\"" },
peg$c29 = function(number) { return number; },
peg$c30 = function(selector, pattern) {
peg$c28 = "=",
peg$c29 = { type: "literal", value: "=", description: "\"=\"" },
peg$c30 = function(number) { return number; },
peg$c31 = function(selector, pattern) {
return {

@@ -110,38 +124,39 @@ type : 'optionalFormatPattern',

},
peg$c31 = "offset:",
peg$c32 = { type: "literal", value: "offset:", description: "\"offset:\"" },
peg$c33 = function(number) {
peg$c32 = "offset:",
peg$c33 = { type: "literal", value: "offset:", description: "\"offset:\"" },
peg$c34 = function(number) {
return number;
},
peg$c34 = { type: "other", description: "whitespace" },
peg$c35 = /^[ \t\n\r]/,
peg$c36 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
peg$c37 = { type: "other", description: "optionalWhitespace" },
peg$c38 = /^[0-9]/,
peg$c39 = { type: "class", value: "[0-9]", description: "[0-9]" },
peg$c40 = /^[0-9a-f]/i,
peg$c41 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" },
peg$c42 = "0",
peg$c43 = { type: "literal", value: "0", description: "\"0\"" },
peg$c44 = /^[1-9]/,
peg$c45 = { type: "class", value: "[1-9]", description: "[1-9]" },
peg$c46 = function(digits) {
peg$c35 = { type: "other", description: "whitespace" },
peg$c36 = /^[ \t\n\r]/,
peg$c37 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
peg$c38 = { type: "other", description: "optionalWhitespace" },
peg$c39 = /^[0-9]/,
peg$c40 = { type: "class", value: "[0-9]", description: "[0-9]" },
peg$c41 = /^[0-9a-f]/i,
peg$c42 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" },
peg$c43 = "0",
peg$c44 = { type: "literal", value: "0", description: "\"0\"" },
peg$c45 = /^[1-9]/,
peg$c46 = { type: "class", value: "[1-9]", description: "[1-9]" },
peg$c47 = function(digits) {
return parseInt(digits, 10);
},
peg$c47 = /^[^{}\\\0-\x1F \t\n\r]/,
peg$c48 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" },
peg$c49 = "\\#",
peg$c50 = { type: "literal", value: "\\#", description: "\"\\\\#\"" },
peg$c51 = function() { return '\\#'; },
peg$c52 = "\\{",
peg$c53 = { type: "literal", value: "\\{", description: "\"\\\\{\"" },
peg$c54 = function() { return '\u007B'; },
peg$c55 = "\\}",
peg$c56 = { type: "literal", value: "\\}", description: "\"\\\\}\"" },
peg$c57 = function() { return '\u007D'; },
peg$c58 = "\\u",
peg$c59 = { type: "literal", value: "\\u", description: "\"\\\\u\"" },
peg$c60 = function(digits) {
peg$c48 = /^[^{}\\\0-\x1F \t\n\r]/,
peg$c49 = { type: "class", value: "[^{}\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F \\t\\n\\r]" },
peg$c50 = "\\#",
peg$c51 = { type: "literal", value: "\\#", description: "\"\\\\#\"" },
peg$c52 = function() { return '\\#'; },
peg$c53 = "\\{",
peg$c54 = { type: "literal", value: "\\{", description: "\"\\\\{\"" },
peg$c55 = function() { return '\u007B'; },
peg$c56 = "\\}",
peg$c57 = { type: "literal", value: "\\}", description: "\"\\\\}\"" },
peg$c58 = function() { return '\u007D'; },
peg$c59 = "\\u",
peg$c60 = { type: "literal", value: "\\u", description: "\"\\\\u\"" },
peg$c61 = function(digits) {
return String.fromCharCode(parseInt(digits, 16));
},
peg$c62 = function(chars) { return chars.join(''); },

@@ -411,3 +426,4 @@ peg$currPos = 0,

if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
peg$reportedPos = s0;
s1 = peg$c3(s1);
}

@@ -434,3 +450,3 @@ s0 = s1;

peg$reportedPos = s0;
s1 = peg$c3(s1);
s1 = peg$c4(s1);
}

@@ -449,3 +465,3 @@ s0 = s1;

s1 = [];
if (peg$c4.test(input.charAt(peg$currPos))) {
if (peg$c5.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -455,3 +471,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c5); }
if (peg$silentFails === 0) { peg$fail(peg$c6); }
}

@@ -461,3 +477,3 @@ if (s2 !== peg$FAILED) {

s1.push(s2);
if (peg$c4.test(input.charAt(peg$currPos))) {
if (peg$c5.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -467,3 +483,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c5); }
if (peg$silentFails === 0) { peg$fail(peg$c6); }
}

@@ -488,7 +504,7 @@ }

if (input.charCodeAt(peg$currPos) === 123) {
s1 = peg$c6;
s1 = peg$c7;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c7); }
if (peg$silentFails === 0) { peg$fail(peg$c8); }
}

@@ -504,7 +520,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s6 = peg$c9;
s6 = peg$c10;
peg$currPos++;
} else {
s6 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -531,3 +547,3 @@ if (s6 !== peg$FAILED) {

if (s5 === peg$FAILED) {
s5 = peg$c8;
s5 = peg$c9;
}

@@ -538,11 +554,11 @@ if (s5 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s7 = peg$c11;
s7 = peg$c12;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c12); }
if (peg$silentFails === 0) { peg$fail(peg$c13); }
}
if (s7 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c13(s3, s5);
s1 = peg$c14(s3, s5);
s0 = s1;

@@ -599,24 +615,24 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c14) {
s1 = peg$c14;
if (input.substr(peg$currPos, 6) === peg$c15) {
s1 = peg$c15;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c15); }
if (peg$silentFails === 0) { peg$fail(peg$c16); }
}
if (s1 === peg$FAILED) {
if (input.substr(peg$currPos, 4) === peg$c16) {
s1 = peg$c16;
if (input.substr(peg$currPos, 4) === peg$c17) {
s1 = peg$c17;
peg$currPos += 4;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c17); }
if (peg$silentFails === 0) { peg$fail(peg$c18); }
}
if (s1 === peg$FAILED) {
if (input.substr(peg$currPos, 4) === peg$c18) {
s1 = peg$c18;
if (input.substr(peg$currPos, 4) === peg$c19) {
s1 = peg$c19;
peg$currPos += 4;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c19); }
if (peg$silentFails === 0) { peg$fail(peg$c20); }
}

@@ -630,7 +646,7 @@ }

if (input.charCodeAt(peg$currPos) === 44) {
s4 = peg$c9;
s4 = peg$c10;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -657,7 +673,7 @@ if (s4 !== peg$FAILED) {

if (s3 === peg$FAILED) {
s3 = peg$c8;
s3 = peg$c9;
}
if (s3 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c20(s1, s3);
s1 = peg$c21(s1, s3);
s0 = s1;

@@ -684,8 +700,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c21) {
s1 = peg$c21;
if (input.substr(peg$currPos, 6) === peg$c22) {
s1 = peg$c22;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c22); }
if (peg$silentFails === 0) { peg$fail(peg$c23); }
}

@@ -696,7 +712,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s3 = peg$c9;
s3 = peg$c10;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -708,3 +724,3 @@ if (s3 !== peg$FAILED) {

if (s5 === peg$FAILED) {
s5 = peg$c8;
s5 = peg$c9;
}

@@ -726,3 +742,3 @@ if (s5 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c23(s5, s7);
s1 = peg$c24(s5, s7);
s0 = s1;

@@ -765,8 +781,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c24) {
s1 = peg$c24;
if (input.substr(peg$currPos, 6) === peg$c25) {
s1 = peg$c25;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c25); }
if (peg$silentFails === 0) { peg$fail(peg$c26); }
}

@@ -777,7 +793,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 44) {
s3 = peg$c9;
s3 = peg$c10;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}

@@ -799,3 +815,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c26(s5);
s1 = peg$c27(s5);
s0 = s1;

@@ -831,7 +847,7 @@ } else {

if (input.charCodeAt(peg$currPos) === 61) {
s1 = peg$c27;
s1 = peg$c28;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c28); }
if (peg$silentFails === 0) { peg$fail(peg$c29); }
}

@@ -842,3 +858,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c29(s2);
s1 = peg$c30(s2);
s0 = s1;

@@ -871,7 +887,7 @@ } else {

if (input.charCodeAt(peg$currPos) === 123) {
s4 = peg$c6;
s4 = peg$c7;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c7); }
if (peg$silentFails === 0) { peg$fail(peg$c8); }
}

@@ -886,11 +902,11 @@ if (s4 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s8 = peg$c11;
s8 = peg$c12;
peg$currPos++;
} else {
s8 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c12); }
if (peg$silentFails === 0) { peg$fail(peg$c13); }
}
if (s8 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c30(s2, s6);
s1 = peg$c31(s2, s6);
s0 = s1;

@@ -937,8 +953,8 @@ } else {

s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c31) {
s1 = peg$c31;
if (input.substr(peg$currPos, 7) === peg$c32) {
s1 = peg$c32;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c32); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}

@@ -951,3 +967,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c33(s3);
s1 = peg$c34(s3);
s0 = s1;

@@ -975,3 +991,3 @@ } else {

s0 = [];
if (peg$c35.test(input.charAt(peg$currPos))) {
if (peg$c36.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -981,3 +997,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -987,3 +1003,3 @@ if (s1 !== peg$FAILED) {

s0.push(s1);
if (peg$c35.test(input.charAt(peg$currPos))) {
if (peg$c36.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -993,3 +1009,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -1003,3 +1019,3 @@ }

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c34); }
if (peg$silentFails === 0) { peg$fail(peg$c35); }
}

@@ -1011,15 +1027,20 @@

function peg$parse_() {
var s0, s1;
var s0, s1, s2;
peg$silentFails++;
s0 = [];
s1 = peg$parsews();
while (s1 !== peg$FAILED) {
s0.push(s1);
s1 = peg$parsews();
s0 = peg$currPos;
s1 = [];
s2 = peg$parsews();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parsews();
}
if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
}
s0 = s1;
peg$silentFails--;
if (s0 === peg$FAILED) {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c37); }
if (peg$silentFails === 0) { peg$fail(peg$c38); }
}

@@ -1033,3 +1054,3 @@

if (peg$c38.test(input.charAt(peg$currPos))) {
if (peg$c39.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1039,3 +1060,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c39); }
if (peg$silentFails === 0) { peg$fail(peg$c40); }
}

@@ -1049,3 +1070,3 @@

if (peg$c40.test(input.charAt(peg$currPos))) {
if (peg$c41.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1055,3 +1076,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c41); }
if (peg$silentFails === 0) { peg$fail(peg$c42); }
}

@@ -1067,7 +1088,7 @@

if (input.charCodeAt(peg$currPos) === 48) {
s1 = peg$c42;
s1 = peg$c43;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c43); }
if (peg$silentFails === 0) { peg$fail(peg$c44); }
}

@@ -1077,3 +1098,3 @@ if (s1 === peg$FAILED) {

s2 = peg$currPos;
if (peg$c44.test(input.charAt(peg$currPos))) {
if (peg$c45.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);

@@ -1083,3 +1104,3 @@ peg$currPos++;

s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c45); }
if (peg$silentFails === 0) { peg$fail(peg$c46); }
}

@@ -1111,3 +1132,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c46(s1);
s1 = peg$c47(s1);
}

@@ -1122,3 +1143,3 @@ s0 = s1;

if (peg$c47.test(input.charAt(peg$currPos))) {
if (peg$c48.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1128,16 +1149,16 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c49) {
s1 = peg$c49;
if (input.substr(peg$currPos, 2) === peg$c50) {
s1 = peg$c50;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c51();
s1 = peg$c52();
}

@@ -1147,12 +1168,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c52) {
s1 = peg$c52;
if (input.substr(peg$currPos, 2) === peg$c53) {
s1 = peg$c53;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c53); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c54();
s1 = peg$c55();
}

@@ -1162,12 +1183,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c55) {
s1 = peg$c55;
if (input.substr(peg$currPos, 2) === peg$c56) {
s1 = peg$c56;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c56); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c57();
s1 = peg$c58();
}

@@ -1177,8 +1198,8 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c58) {
s1 = peg$c58;
if (input.substr(peg$currPos, 2) === peg$c59) {
s1 = peg$c59;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c59); }
if (peg$silentFails === 0) { peg$fail(peg$c60); }
}

@@ -1220,3 +1241,3 @@ if (s1 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c60(s2);
s1 = peg$c61(s2);
s0 = s1;

@@ -1254,3 +1275,4 @@ } else {

if (s1 !== peg$FAILED) {
s1 = input.substring(s0, peg$currPos);
peg$reportedPos = s0;
s1 = peg$c62(s1);
}

@@ -1257,0 +1279,0 @@ s0 = s1;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc