Socket
Socket
Sign inDemoInstall

intl-messageformat-parser

Package Overview
Dependencies
Maintainers
4
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 1.7.0 to 1.7.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.7.1](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.7.0...intl-messageformat-parser@1.7.1) (2019-06-26)
### Bug Fixes
* **intl-messageformat-parser:** Escape double-' to a single ' ([#103](https://github.com/formatjs/formatjs/issues/103)) ([4d0cd1f](https://github.com/formatjs/formatjs/commit/4d0cd1f))
# [1.7.0](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@1.6.8...intl-messageformat-parser@1.7.0) (2019-06-27)

@@ -8,0 +19,0 @@

531

dist/parser.js

@@ -163,11 +163,10 @@ /*

},
peg$c3 = /^[^ \t\n\r,.+={}#]/,
peg$c4 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], true, false),
peg$c5 = "{",
peg$c6 = peg$literalExpectation("{", false),
peg$c7 = ",",
peg$c8 = peg$literalExpectation(",", false),
peg$c9 = "}",
peg$c10 = peg$literalExpectation("}", false),
peg$c11 = function(id, format) {
peg$c3 = function(chars) { return chars.join(''); },
peg$c4 = "{",
peg$c5 = peg$literalExpectation("{", false),
peg$c6 = ",",
peg$c7 = peg$literalExpectation(",", false),
peg$c8 = "}",
peg$c9 = peg$literalExpectation("}", false),
peg$c10 = function(id, format) {
return {

@@ -180,9 +179,9 @@ type : 'argumentElement',

},
peg$c12 = "number",
peg$c13 = peg$literalExpectation("number", false),
peg$c14 = "date",
peg$c15 = peg$literalExpectation("date", false),
peg$c16 = "time",
peg$c17 = peg$literalExpectation("time", false),
peg$c18 = function(type, style) {
peg$c11 = "number",
peg$c12 = peg$literalExpectation("number", false),
peg$c13 = "date",
peg$c14 = peg$literalExpectation("date", false),
peg$c15 = "time",
peg$c16 = peg$literalExpectation("time", false),
peg$c17 = function(type, style) {
return {

@@ -194,5 +193,5 @@ type : type + 'Format',

},
peg$c19 = "plural",
peg$c20 = peg$literalExpectation("plural", false),
peg$c21 = function(pluralStyle) {
peg$c18 = "plural",
peg$c19 = peg$literalExpectation("plural", false),
peg$c20 = function(pluralStyle) {
return {

@@ -206,5 +205,5 @@ type : pluralStyle.type,

},
peg$c22 = "selectordinal",
peg$c23 = peg$literalExpectation("selectordinal", false),
peg$c24 = function(pluralStyle) {
peg$c21 = "selectordinal",
peg$c22 = peg$literalExpectation("selectordinal", false),
peg$c23 = function(pluralStyle) {
return {

@@ -218,5 +217,5 @@ type : pluralStyle.type,

},
peg$c25 = "select",
peg$c26 = peg$literalExpectation("select", false),
peg$c27 = function(options) {
peg$c24 = "select",
peg$c25 = peg$literalExpectation("select", false),
peg$c26 = function(options) {
return {

@@ -228,5 +227,5 @@ type : 'selectFormat',

},
peg$c28 = "=",
peg$c29 = peg$literalExpectation("=", false),
peg$c30 = function(selector, pattern) {
peg$c27 = "=",
peg$c28 = peg$literalExpectation("=", false),
peg$c29 = function(selector, pattern) {
return {

@@ -239,8 +238,8 @@ type : 'optionalFormatPattern',

},
peg$c31 = "offset:",
peg$c32 = peg$literalExpectation("offset:", false),
peg$c33 = function(number) {
peg$c30 = "offset:",
peg$c31 = peg$literalExpectation("offset:", false),
peg$c32 = function(number) {
return number;
},
peg$c34 = function(offset, options) {
peg$c33 = function(offset, options) {
return {

@@ -253,37 +252,43 @@ type : 'pluralFormat',

},
peg$c35 = peg$otherExpectation("whitespace"),
peg$c36 = /^[ \t\n\r]/,
peg$c37 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c38 = peg$otherExpectation("optionalWhitespace"),
peg$c39 = /^[0-9]/,
peg$c40 = peg$classExpectation([["0", "9"]], false, false),
peg$c41 = /^[0-9a-f]/i,
peg$c42 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c43 = "0",
peg$c44 = peg$literalExpectation("0", false),
peg$c45 = /^[1-9]/,
peg$c46 = peg$classExpectation([["1", "9"]], false, false),
peg$c47 = function(digits) {
peg$c34 = peg$otherExpectation("whitespace"),
peg$c35 = /^[ \t\n\r]/,
peg$c36 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c37 = peg$otherExpectation("optionalWhitespace"),
peg$c38 = /^[0-9]/,
peg$c39 = peg$classExpectation([["0", "9"]], false, false),
peg$c40 = /^[0-9a-f]/i,
peg$c41 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c42 = "0",
peg$c43 = peg$literalExpectation("0", false),
peg$c44 = /^[1-9]/,
peg$c45 = peg$classExpectation([["1", "9"]], false, false),
peg$c46 = function(digits) {
return parseInt(digits, 10);
},
peg$c48 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c49 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c50 = "\\\\",
peg$c51 = peg$literalExpectation("\\\\", false),
peg$c52 = function() { return '\\'; },
peg$c53 = "\\#",
peg$c54 = peg$literalExpectation("\\#", false),
peg$c55 = function() { return '\\#'; },
peg$c56 = "\\{",
peg$c57 = peg$literalExpectation("\\{", false),
peg$c58 = function() { return '\u007B'; },
peg$c59 = "\\}",
peg$c60 = peg$literalExpectation("\\}", false),
peg$c61 = function() { return '\u007D'; },
peg$c62 = "\\u",
peg$c63 = peg$literalExpectation("\\u", false),
peg$c64 = function(digits) {
peg$c47 = "'",
peg$c48 = peg$literalExpectation("'", false),
peg$c49 = /^[ \t\n\r,.+={}#]/,
peg$c50 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], false, false),
peg$c51 = peg$anyExpectation(),
peg$c52 = function(char) { return char; },
peg$c53 = function(sequence) { return sequence; },
peg$c54 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c55 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c56 = "\\\\",
peg$c57 = peg$literalExpectation("\\\\", false),
peg$c58 = function() { return '\\'; },
peg$c59 = "\\#",
peg$c60 = peg$literalExpectation("\\#", false),
peg$c61 = function() { return '\\#'; },
peg$c62 = "\\{",
peg$c63 = peg$literalExpectation("\\{", false),
peg$c64 = function() { return '\u007B'; },
peg$c65 = "\\}",
peg$c66 = peg$literalExpectation("\\}", false),
peg$c67 = function() { return '\u007D'; },
peg$c68 = "\\u",
peg$c69 = peg$literalExpectation("\\u", false),
peg$c70 = function(digits) {
return String.fromCharCode(parseInt(digits, 16));
},
peg$c65 = function(chars) { return chars.join(''); },

@@ -557,28 +562,12 @@ peg$currPos = 0,

s1 = [];
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
s2 = peg$parsequoteEscapedChar();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parsequoteEscapedChar();
}
if (s2 !== peg$FAILED) {
while (s2 !== peg$FAILED) {
s1.push(s2);
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
}
} else {
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
s0 = input.substring(s0, peg$currPos);
} else {
s0 = s1;
peg$savedPos = s0;
s1 = peg$c3(s1);
}
s0 = s1;
}

@@ -594,7 +583,7 @@

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

@@ -610,7 +599,7 @@ if (s1 !== peg$FAILED) {

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

@@ -643,11 +632,11 @@ if (s6 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s7 = peg$c9;
s7 = peg$c8;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s7 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c11(s3, s5);
s1 = peg$c10(s3, s5);
s0 = s1;

@@ -707,24 +696,24 @@ } else {

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

@@ -738,7 +727,7 @@ }

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

@@ -769,3 +758,3 @@ if (s4 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c18(s1, s3);
s1 = peg$c17(s1, s3);
s0 = s1;

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

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

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

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

@@ -817,3 +806,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c21(s5);
s1 = peg$c20(s5);
s0 = s1;

@@ -848,8 +837,8 @@ } else {

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

@@ -860,7 +849,7 @@ if (s1 !== peg$FAILED) {

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

@@ -873,3 +862,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c24(s5);
s1 = peg$c23(s5);
s0 = s1;

@@ -904,8 +893,8 @@ } else {

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

@@ -916,7 +905,7 @@ if (s1 !== peg$FAILED) {

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

@@ -938,3 +927,3 @@ if (s3 !== peg$FAILED) {

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

@@ -971,7 +960,7 @@ } else {

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

@@ -1014,7 +1003,7 @@ if (s2 !== peg$FAILED) {

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

@@ -1025,11 +1014,11 @@ if (s4 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s6 = peg$c9;
s6 = peg$c8;
peg$currPos++;
} else {
s6 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s6 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c30(s2, s5);
s1 = peg$c29(s2, s5);
s0 = s1;

@@ -1068,8 +1057,8 @@ } else {

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

@@ -1082,3 +1071,3 @@ if (s1 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c33(s3);
s1 = peg$c32(s3);
s0 = s1;

@@ -1124,3 +1113,3 @@ } else {

peg$savedPos = s0;
s1 = peg$c34(s1, s3);
s1 = peg$c33(s1, s3);
s0 = s1;

@@ -1148,3 +1137,3 @@ } else {

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

@@ -1154,3 +1143,3 @@ peg$currPos++;

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

@@ -1160,3 +1149,3 @@ if (s1 !== peg$FAILED) {

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

@@ -1166,3 +1155,3 @@ peg$currPos++;

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

@@ -1176,3 +1165,3 @@ }

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

@@ -1202,3 +1191,3 @@

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

@@ -1212,3 +1201,3 @@

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

@@ -1218,3 +1207,3 @@ peg$currPos++;

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

@@ -1228,3 +1217,3 @@

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

@@ -1234,3 +1223,3 @@ peg$currPos++;

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

@@ -1246,7 +1235,7 @@

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

@@ -1256,3 +1245,3 @@ if (s1 === peg$FAILED) {

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

@@ -1262,3 +1251,3 @@ peg$currPos++;

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

@@ -1291,3 +1280,3 @@ if (s3 !== peg$FAILED) {

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

@@ -1299,38 +1288,155 @@ s0 = s1;

function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
function peg$parsequoteEscapedChar() {
var s0, s1, s2;
if (peg$c48.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c47;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s2 === peg$FAILED) {
if (peg$c49.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = void 0;
} else {
peg$currPos = s1;
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c50) {
s1 = peg$c50;
peg$currPos += 2;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseescape();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
return s0;
}
function peg$parseapostrophe() {
var s0;
if (input.charCodeAt(peg$currPos) === 39) {
s0 = peg$c47;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
return s0;
}
function peg$parseescape() {
var s0;
if (peg$c49.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
if (s0 === peg$FAILED) {
s0 = peg$parseapostrophe();
}
return s0;
}
function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseapostrophe();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52();
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
if (peg$c54.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c53) {
s1 = peg$c53;
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$c54); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c55();
s1 = peg$c58();
}

@@ -1340,12 +1446,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c56) {
s1 = peg$c56;
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$c57); }
if (peg$silentFails === 0) { peg$fail(peg$c60); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c58();
s1 = peg$c61();
}

@@ -1355,12 +1461,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c59) {
s1 = peg$c59;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c60); }
if (peg$silentFails === 0) { peg$fail(peg$c63); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c61();
s1 = peg$c64();
}

@@ -1370,22 +1476,40 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
if (input.substr(peg$currPos, 2) === peg$c65) {
s1 = peg$c65;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c63); }
if (peg$silentFails === 0) { peg$fail(peg$c66); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
peg$savedPos = s0;
s1 = peg$c67();
}
s0 = s1;
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c68) {
s1 = peg$c68;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {

@@ -1403,22 +1527,19 @@ peg$currPos = s3;

}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c70(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c64(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}

@@ -1450,3 +1571,3 @@ }

peg$savedPos = s0;
s1 = peg$c65(s1);
s1 = peg$c3(s1);
}

@@ -1453,0 +1574,0 @@ s0 = s1;

@@ -163,11 +163,10 @@ /*

},
peg$c3 = /^[^ \t\n\r,.+={}#]/,
peg$c4 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], true, false),
peg$c5 = "{",
peg$c6 = peg$literalExpectation("{", false),
peg$c7 = ",",
peg$c8 = peg$literalExpectation(",", false),
peg$c9 = "}",
peg$c10 = peg$literalExpectation("}", false),
peg$c11 = function(id, format) {
peg$c3 = function(chars) { return chars.join(''); },
peg$c4 = "{",
peg$c5 = peg$literalExpectation("{", false),
peg$c6 = ",",
peg$c7 = peg$literalExpectation(",", false),
peg$c8 = "}",
peg$c9 = peg$literalExpectation("}", false),
peg$c10 = function(id, format) {
return {

@@ -180,9 +179,9 @@ type : 'argumentElement',

},
peg$c12 = "number",
peg$c13 = peg$literalExpectation("number", false),
peg$c14 = "date",
peg$c15 = peg$literalExpectation("date", false),
peg$c16 = "time",
peg$c17 = peg$literalExpectation("time", false),
peg$c18 = function(type, style) {
peg$c11 = "number",
peg$c12 = peg$literalExpectation("number", false),
peg$c13 = "date",
peg$c14 = peg$literalExpectation("date", false),
peg$c15 = "time",
peg$c16 = peg$literalExpectation("time", false),
peg$c17 = function(type, style) {
return {

@@ -194,5 +193,5 @@ type : type + 'Format',

},
peg$c19 = "plural",
peg$c20 = peg$literalExpectation("plural", false),
peg$c21 = function(pluralStyle) {
peg$c18 = "plural",
peg$c19 = peg$literalExpectation("plural", false),
peg$c20 = function(pluralStyle) {
return {

@@ -206,5 +205,5 @@ type : pluralStyle.type,

},
peg$c22 = "selectordinal",
peg$c23 = peg$literalExpectation("selectordinal", false),
peg$c24 = function(pluralStyle) {
peg$c21 = "selectordinal",
peg$c22 = peg$literalExpectation("selectordinal", false),
peg$c23 = function(pluralStyle) {
return {

@@ -218,5 +217,5 @@ type : pluralStyle.type,

},
peg$c25 = "select",
peg$c26 = peg$literalExpectation("select", false),
peg$c27 = function(options) {
peg$c24 = "select",
peg$c25 = peg$literalExpectation("select", false),
peg$c26 = function(options) {
return {

@@ -228,5 +227,5 @@ type : 'selectFormat',

},
peg$c28 = "=",
peg$c29 = peg$literalExpectation("=", false),
peg$c30 = function(selector, pattern) {
peg$c27 = "=",
peg$c28 = peg$literalExpectation("=", false),
peg$c29 = function(selector, pattern) {
return {

@@ -239,8 +238,8 @@ type : 'optionalFormatPattern',

},
peg$c31 = "offset:",
peg$c32 = peg$literalExpectation("offset:", false),
peg$c33 = function(number) {
peg$c30 = "offset:",
peg$c31 = peg$literalExpectation("offset:", false),
peg$c32 = function(number) {
return number;
},
peg$c34 = function(offset, options) {
peg$c33 = function(offset, options) {
return {

@@ -253,37 +252,43 @@ type : 'pluralFormat',

},
peg$c35 = peg$otherExpectation("whitespace"),
peg$c36 = /^[ \t\n\r]/,
peg$c37 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c38 = peg$otherExpectation("optionalWhitespace"),
peg$c39 = /^[0-9]/,
peg$c40 = peg$classExpectation([["0", "9"]], false, false),
peg$c41 = /^[0-9a-f]/i,
peg$c42 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c43 = "0",
peg$c44 = peg$literalExpectation("0", false),
peg$c45 = /^[1-9]/,
peg$c46 = peg$classExpectation([["1", "9"]], false, false),
peg$c47 = function(digits) {
peg$c34 = peg$otherExpectation("whitespace"),
peg$c35 = /^[ \t\n\r]/,
peg$c36 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c37 = peg$otherExpectation("optionalWhitespace"),
peg$c38 = /^[0-9]/,
peg$c39 = peg$classExpectation([["0", "9"]], false, false),
peg$c40 = /^[0-9a-f]/i,
peg$c41 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c42 = "0",
peg$c43 = peg$literalExpectation("0", false),
peg$c44 = /^[1-9]/,
peg$c45 = peg$classExpectation([["1", "9"]], false, false),
peg$c46 = function(digits) {
return parseInt(digits, 10);
},
peg$c48 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c49 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c50 = "\\\\",
peg$c51 = peg$literalExpectation("\\\\", false),
peg$c52 = function() { return '\\'; },
peg$c53 = "\\#",
peg$c54 = peg$literalExpectation("\\#", false),
peg$c55 = function() { return '\\#'; },
peg$c56 = "\\{",
peg$c57 = peg$literalExpectation("\\{", false),
peg$c58 = function() { return '\u007B'; },
peg$c59 = "\\}",
peg$c60 = peg$literalExpectation("\\}", false),
peg$c61 = function() { return '\u007D'; },
peg$c62 = "\\u",
peg$c63 = peg$literalExpectation("\\u", false),
peg$c64 = function(digits) {
peg$c47 = "'",
peg$c48 = peg$literalExpectation("'", false),
peg$c49 = /^[ \t\n\r,.+={}#]/,
peg$c50 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], false, false),
peg$c51 = peg$anyExpectation(),
peg$c52 = function(char) { return char; },
peg$c53 = function(sequence) { return sequence; },
peg$c54 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c55 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c56 = "\\\\",
peg$c57 = peg$literalExpectation("\\\\", false),
peg$c58 = function() { return '\\'; },
peg$c59 = "\\#",
peg$c60 = peg$literalExpectation("\\#", false),
peg$c61 = function() { return '\\#'; },
peg$c62 = "\\{",
peg$c63 = peg$literalExpectation("\\{", false),
peg$c64 = function() { return '\u007B'; },
peg$c65 = "\\}",
peg$c66 = peg$literalExpectation("\\}", false),
peg$c67 = function() { return '\u007D'; },
peg$c68 = "\\u",
peg$c69 = peg$literalExpectation("\\u", false),
peg$c70 = function(digits) {
return String.fromCharCode(parseInt(digits, 16));
},
peg$c65 = function(chars) { return chars.join(''); },

@@ -557,28 +562,12 @@ peg$currPos = 0,

s1 = [];
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
s2 = peg$parsequoteEscapedChar();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parsequoteEscapedChar();
}
if (s2 !== peg$FAILED) {
while (s2 !== peg$FAILED) {
s1.push(s2);
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
}
} else {
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
s0 = input.substring(s0, peg$currPos);
} else {
s0 = s1;
peg$savedPos = s0;
s1 = peg$c3(s1);
}
s0 = s1;
}

@@ -594,7 +583,7 @@

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

@@ -610,7 +599,7 @@ if (s1 !== peg$FAILED) {

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

@@ -643,11 +632,11 @@ if (s6 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s7 = peg$c9;
s7 = peg$c8;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s7 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c11(s3, s5);
s1 = peg$c10(s3, s5);
s0 = s1;

@@ -707,24 +696,24 @@ } else {

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

@@ -738,7 +727,7 @@ }

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

@@ -769,3 +758,3 @@ if (s4 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c18(s1, s3);
s1 = peg$c17(s1, s3);
s0 = s1;

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

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

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

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

@@ -817,3 +806,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c21(s5);
s1 = peg$c20(s5);
s0 = s1;

@@ -848,8 +837,8 @@ } else {

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

@@ -860,7 +849,7 @@ if (s1 !== peg$FAILED) {

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

@@ -873,3 +862,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c24(s5);
s1 = peg$c23(s5);
s0 = s1;

@@ -904,8 +893,8 @@ } else {

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

@@ -916,7 +905,7 @@ if (s1 !== peg$FAILED) {

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

@@ -938,3 +927,3 @@ if (s3 !== peg$FAILED) {

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

@@ -971,7 +960,7 @@ } else {

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

@@ -1014,7 +1003,7 @@ if (s2 !== peg$FAILED) {

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

@@ -1025,11 +1014,11 @@ if (s4 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s6 = peg$c9;
s6 = peg$c8;
peg$currPos++;
} else {
s6 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s6 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c30(s2, s5);
s1 = peg$c29(s2, s5);
s0 = s1;

@@ -1068,8 +1057,8 @@ } else {

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

@@ -1082,3 +1071,3 @@ if (s1 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c33(s3);
s1 = peg$c32(s3);
s0 = s1;

@@ -1124,3 +1113,3 @@ } else {

peg$savedPos = s0;
s1 = peg$c34(s1, s3);
s1 = peg$c33(s1, s3);
s0 = s1;

@@ -1148,3 +1137,3 @@ } else {

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

@@ -1154,3 +1143,3 @@ peg$currPos++;

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

@@ -1160,3 +1149,3 @@ if (s1 !== peg$FAILED) {

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

@@ -1166,3 +1155,3 @@ peg$currPos++;

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

@@ -1176,3 +1165,3 @@ }

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

@@ -1202,3 +1191,3 @@

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

@@ -1212,3 +1201,3 @@

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

@@ -1218,3 +1207,3 @@ peg$currPos++;

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

@@ -1228,3 +1217,3 @@

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

@@ -1234,3 +1223,3 @@ peg$currPos++;

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

@@ -1246,7 +1235,7 @@

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

@@ -1256,3 +1245,3 @@ if (s1 === peg$FAILED) {

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

@@ -1262,3 +1251,3 @@ peg$currPos++;

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

@@ -1291,3 +1280,3 @@ if (s3 !== peg$FAILED) {

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

@@ -1299,38 +1288,155 @@ s0 = s1;

function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
function peg$parsequoteEscapedChar() {
var s0, s1, s2;
if (peg$c48.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c47;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s2 === peg$FAILED) {
if (peg$c49.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = void 0;
} else {
peg$currPos = s1;
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c50) {
s1 = peg$c50;
peg$currPos += 2;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseescape();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
return s0;
}
function peg$parseapostrophe() {
var s0;
if (input.charCodeAt(peg$currPos) === 39) {
s0 = peg$c47;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
return s0;
}
function peg$parseescape() {
var s0;
if (peg$c49.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
if (s0 === peg$FAILED) {
s0 = peg$parseapostrophe();
}
return s0;
}
function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseapostrophe();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52();
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
if (peg$c54.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c53) {
s1 = peg$c53;
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$c54); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c55();
s1 = peg$c58();
}

@@ -1340,12 +1446,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c56) {
s1 = peg$c56;
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$c57); }
if (peg$silentFails === 0) { peg$fail(peg$c60); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c58();
s1 = peg$c61();
}

@@ -1355,12 +1461,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c59) {
s1 = peg$c59;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c60); }
if (peg$silentFails === 0) { peg$fail(peg$c63); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c61();
s1 = peg$c64();
}

@@ -1370,22 +1476,40 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
if (input.substr(peg$currPos, 2) === peg$c65) {
s1 = peg$c65;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c63); }
if (peg$silentFails === 0) { peg$fail(peg$c66); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
peg$savedPos = s0;
s1 = peg$c67();
}
s0 = s1;
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c68) {
s1 = peg$c68;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {

@@ -1403,22 +1527,19 @@ peg$currPos = s3;

}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c70(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c64(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}

@@ -1450,3 +1571,3 @@ }

peg$savedPos = s0;
s1 = peg$c65(s1);
s1 = peg$c3(s1);
}

@@ -1453,0 +1574,0 @@ s0 = s1;

{
"name": "intl-messageformat-parser",
"version": "1.7.0",
"version": "1.7.1",
"description": "Parses ICU Message strings into an AST via JavaScript.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -163,11 +163,10 @@ export default /*

},
peg$c3 = /^[^ \t\n\r,.+={}#]/,
peg$c4 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], true, false),
peg$c5 = "{",
peg$c6 = peg$literalExpectation("{", false),
peg$c7 = ",",
peg$c8 = peg$literalExpectation(",", false),
peg$c9 = "}",
peg$c10 = peg$literalExpectation("}", false),
peg$c11 = function(id, format) {
peg$c3 = function(chars) { return chars.join(''); },
peg$c4 = "{",
peg$c5 = peg$literalExpectation("{", false),
peg$c6 = ",",
peg$c7 = peg$literalExpectation(",", false),
peg$c8 = "}",
peg$c9 = peg$literalExpectation("}", false),
peg$c10 = function(id, format) {
return {

@@ -180,9 +179,9 @@ type : 'argumentElement',

},
peg$c12 = "number",
peg$c13 = peg$literalExpectation("number", false),
peg$c14 = "date",
peg$c15 = peg$literalExpectation("date", false),
peg$c16 = "time",
peg$c17 = peg$literalExpectation("time", false),
peg$c18 = function(type, style) {
peg$c11 = "number",
peg$c12 = peg$literalExpectation("number", false),
peg$c13 = "date",
peg$c14 = peg$literalExpectation("date", false),
peg$c15 = "time",
peg$c16 = peg$literalExpectation("time", false),
peg$c17 = function(type, style) {
return {

@@ -194,5 +193,5 @@ type : type + 'Format',

},
peg$c19 = "plural",
peg$c20 = peg$literalExpectation("plural", false),
peg$c21 = function(pluralStyle) {
peg$c18 = "plural",
peg$c19 = peg$literalExpectation("plural", false),
peg$c20 = function(pluralStyle) {
return {

@@ -206,5 +205,5 @@ type : pluralStyle.type,

},
peg$c22 = "selectordinal",
peg$c23 = peg$literalExpectation("selectordinal", false),
peg$c24 = function(pluralStyle) {
peg$c21 = "selectordinal",
peg$c22 = peg$literalExpectation("selectordinal", false),
peg$c23 = function(pluralStyle) {
return {

@@ -218,5 +217,5 @@ type : pluralStyle.type,

},
peg$c25 = "select",
peg$c26 = peg$literalExpectation("select", false),
peg$c27 = function(options) {
peg$c24 = "select",
peg$c25 = peg$literalExpectation("select", false),
peg$c26 = function(options) {
return {

@@ -228,5 +227,5 @@ type : 'selectFormat',

},
peg$c28 = "=",
peg$c29 = peg$literalExpectation("=", false),
peg$c30 = function(selector, pattern) {
peg$c27 = "=",
peg$c28 = peg$literalExpectation("=", false),
peg$c29 = function(selector, pattern) {
return {

@@ -239,8 +238,8 @@ type : 'optionalFormatPattern',

},
peg$c31 = "offset:",
peg$c32 = peg$literalExpectation("offset:", false),
peg$c33 = function(number) {
peg$c30 = "offset:",
peg$c31 = peg$literalExpectation("offset:", false),
peg$c32 = function(number) {
return number;
},
peg$c34 = function(offset, options) {
peg$c33 = function(offset, options) {
return {

@@ -253,37 +252,43 @@ type : 'pluralFormat',

},
peg$c35 = peg$otherExpectation("whitespace"),
peg$c36 = /^[ \t\n\r]/,
peg$c37 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c38 = peg$otherExpectation("optionalWhitespace"),
peg$c39 = /^[0-9]/,
peg$c40 = peg$classExpectation([["0", "9"]], false, false),
peg$c41 = /^[0-9a-f]/i,
peg$c42 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c43 = "0",
peg$c44 = peg$literalExpectation("0", false),
peg$c45 = /^[1-9]/,
peg$c46 = peg$classExpectation([["1", "9"]], false, false),
peg$c47 = function(digits) {
peg$c34 = peg$otherExpectation("whitespace"),
peg$c35 = /^[ \t\n\r]/,
peg$c36 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false),
peg$c37 = peg$otherExpectation("optionalWhitespace"),
peg$c38 = /^[0-9]/,
peg$c39 = peg$classExpectation([["0", "9"]], false, false),
peg$c40 = /^[0-9a-f]/i,
peg$c41 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true),
peg$c42 = "0",
peg$c43 = peg$literalExpectation("0", false),
peg$c44 = /^[1-9]/,
peg$c45 = peg$classExpectation([["1", "9"]], false, false),
peg$c46 = function(digits) {
return parseInt(digits, 10);
},
peg$c48 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c49 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c50 = "\\\\",
peg$c51 = peg$literalExpectation("\\\\", false),
peg$c52 = function() { return '\\'; },
peg$c53 = "\\#",
peg$c54 = peg$literalExpectation("\\#", false),
peg$c55 = function() { return '\\#'; },
peg$c56 = "\\{",
peg$c57 = peg$literalExpectation("\\{", false),
peg$c58 = function() { return '\u007B'; },
peg$c59 = "\\}",
peg$c60 = peg$literalExpectation("\\}", false),
peg$c61 = function() { return '\u007D'; },
peg$c62 = "\\u",
peg$c63 = peg$literalExpectation("\\u", false),
peg$c64 = function(digits) {
peg$c47 = "'",
peg$c48 = peg$literalExpectation("'", false),
peg$c49 = /^[ \t\n\r,.+={}#]/,
peg$c50 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], false, false),
peg$c51 = peg$anyExpectation(),
peg$c52 = function(char) { return char; },
peg$c53 = function(sequence) { return sequence; },
peg$c54 = /^[^{}\\\0-\x1F\x7F \t\n\r]/,
peg$c55 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false),
peg$c56 = "\\\\",
peg$c57 = peg$literalExpectation("\\\\", false),
peg$c58 = function() { return '\\'; },
peg$c59 = "\\#",
peg$c60 = peg$literalExpectation("\\#", false),
peg$c61 = function() { return '\\#'; },
peg$c62 = "\\{",
peg$c63 = peg$literalExpectation("\\{", false),
peg$c64 = function() { return '\u007B'; },
peg$c65 = "\\}",
peg$c66 = peg$literalExpectation("\\}", false),
peg$c67 = function() { return '\u007D'; },
peg$c68 = "\\u",
peg$c69 = peg$literalExpectation("\\u", false),
peg$c70 = function(digits) {
return String.fromCharCode(parseInt(digits, 16));
},
peg$c65 = function(chars) { return chars.join(''); },

@@ -557,28 +562,12 @@ peg$currPos = 0,

s1 = [];
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
s2 = peg$parsequoteEscapedChar();
while (s2 !== peg$FAILED) {
s1.push(s2);
s2 = peg$parsequoteEscapedChar();
}
if (s2 !== peg$FAILED) {
while (s2 !== peg$FAILED) {
s1.push(s2);
if (peg$c3.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
}
} else {
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
s0 = input.substring(s0, peg$currPos);
} else {
s0 = s1;
peg$savedPos = s0;
s1 = peg$c3(s1);
}
s0 = s1;
}

@@ -594,7 +583,7 @@

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

@@ -610,7 +599,7 @@ if (s1 !== peg$FAILED) {

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

@@ -643,11 +632,11 @@ if (s6 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s7 = peg$c9;
s7 = peg$c8;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s7 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c11(s3, s5);
s1 = peg$c10(s3, s5);
s0 = s1;

@@ -707,24 +696,24 @@ } else {

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

@@ -738,7 +727,7 @@ }

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

@@ -769,3 +758,3 @@ if (s4 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c18(s1, s3);
s1 = peg$c17(s1, s3);
s0 = s1;

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

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

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

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

@@ -817,3 +806,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c21(s5);
s1 = peg$c20(s5);
s0 = s1;

@@ -848,8 +837,8 @@ } else {

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

@@ -860,7 +849,7 @@ if (s1 !== peg$FAILED) {

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

@@ -873,3 +862,3 @@ if (s3 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c24(s5);
s1 = peg$c23(s5);
s0 = s1;

@@ -904,8 +893,8 @@ } else {

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

@@ -916,7 +905,7 @@ if (s1 !== peg$FAILED) {

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

@@ -938,3 +927,3 @@ if (s3 !== peg$FAILED) {

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

@@ -971,7 +960,7 @@ } else {

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

@@ -1014,7 +1003,7 @@ if (s2 !== peg$FAILED) {

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

@@ -1025,11 +1014,11 @@ if (s4 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 125) {
s6 = peg$c9;
s6 = peg$c8;
peg$currPos++;
} else {
s6 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c10); }
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s6 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c30(s2, s5);
s1 = peg$c29(s2, s5);
s0 = s1;

@@ -1068,8 +1057,8 @@ } else {

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

@@ -1082,3 +1071,3 @@ if (s1 !== peg$FAILED) {

peg$savedPos = s0;
s1 = peg$c33(s3);
s1 = peg$c32(s3);
s0 = s1;

@@ -1124,3 +1113,3 @@ } else {

peg$savedPos = s0;
s1 = peg$c34(s1, s3);
s1 = peg$c33(s1, s3);
s0 = s1;

@@ -1148,3 +1137,3 @@ } else {

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

@@ -1154,3 +1143,3 @@ peg$currPos++;

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

@@ -1160,3 +1149,3 @@ if (s1 !== peg$FAILED) {

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

@@ -1166,3 +1155,3 @@ peg$currPos++;

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

@@ -1176,3 +1165,3 @@ }

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

@@ -1202,3 +1191,3 @@

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

@@ -1212,3 +1201,3 @@

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

@@ -1218,3 +1207,3 @@ peg$currPos++;

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

@@ -1228,3 +1217,3 @@

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

@@ -1234,3 +1223,3 @@ peg$currPos++;

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

@@ -1246,7 +1235,7 @@

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

@@ -1256,3 +1245,3 @@ if (s1 === peg$FAILED) {

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

@@ -1262,3 +1251,3 @@ peg$currPos++;

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

@@ -1291,3 +1280,3 @@ if (s3 !== peg$FAILED) {

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

@@ -1299,38 +1288,155 @@ s0 = s1;

function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
function peg$parsequoteEscapedChar() {
var s0, s1, s2;
if (peg$c48.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c47;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s2 === peg$FAILED) {
if (peg$c49.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = void 0;
} else {
peg$currPos = s1;
s1 = peg$FAILED;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c50) {
s1 = peg$c50;
peg$currPos += 2;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseescape();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
return s0;
}
function peg$parseapostrophe() {
var s0;
if (input.charCodeAt(peg$currPos) === 39) {
s0 = peg$c47;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
return s0;
}
function peg$parseescape() {
var s0;
if (peg$c49.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}
if (s0 === peg$FAILED) {
s0 = peg$parseapostrophe();
}
return s0;
}
function peg$parsechar() {
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseapostrophe();
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c52();
s1 = peg$c53(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
if (peg$c54.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c53) {
s1 = peg$c53;
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$c54); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c55();
s1 = peg$c58();
}

@@ -1340,12 +1446,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c56) {
s1 = peg$c56;
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$c57); }
if (peg$silentFails === 0) { peg$fail(peg$c60); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c58();
s1 = peg$c61();
}

@@ -1355,12 +1461,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c59) {
s1 = peg$c59;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c60); }
if (peg$silentFails === 0) { peg$fail(peg$c63); }
}
if (s1 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c61();
s1 = peg$c64();
}

@@ -1370,22 +1476,40 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c62) {
s1 = peg$c62;
if (input.substr(peg$currPos, 2) === peg$c65) {
s1 = peg$c65;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c63); }
if (peg$silentFails === 0) { peg$fail(peg$c66); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
peg$savedPos = s0;
s1 = peg$c67();
}
s0 = s1;
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 2) === peg$c68) {
s1 = peg$c68;
peg$currPos += 2;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$currPos;
s4 = peg$parsehexDigit();
if (s4 !== peg$FAILED) {
s5 = peg$parsehexDigit();
if (s5 !== peg$FAILED) {
s6 = peg$parsehexDigit();
if (s6 !== peg$FAILED) {
s7 = peg$parsehexDigit();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {

@@ -1403,22 +1527,19 @@ peg$currPos = s3;

}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c70(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 !== peg$FAILED) {
s2 = input.substring(s2, peg$currPos);
} else {
s2 = s3;
}
if (s2 !== peg$FAILED) {
peg$savedPos = s0;
s1 = peg$c64(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}

@@ -1450,3 +1571,3 @@ }

peg$savedPos = s0;
s1 = peg$c65(s1);
s1 = peg$c3(s1);
}

@@ -1453,0 +1574,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