intl-messageformat 9.4.6 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/intl-messageformat.iife.js +3883 -0
- package/lib/src/core.d.ts +4 -59
- package/lib/src/core.d.ts.map +1 -1
- package/lib/src/core.js +6 -6
- package/lib/src/error.d.ts +1 -1
- package/lib/src/error.d.ts.map +1 -1
- package/lib/src/error.js +3 -3
- package/lib/src/formatters.d.ts +1 -1
- package/lib/src/formatters.d.ts.map +1 -1
- package/lib/src/formatters.js +12 -12
- package/package.json +2 -2
- package/src/core.d.ts +4 -59
- package/src/core.d.ts.map +1 -1
- package/src/core.js +4 -4
- package/src/error.d.ts +1 -1
- package/src/error.d.ts.map +1 -1
- package/src/error.js +3 -3
- package/src/formatters.d.ts +1 -1
- package/src/formatters.d.ts.map +1 -1
- package/src/formatters.js +11 -11
- package/intl-messageformat.umd.js +0 -4252
- package/intl-messageformat.umd.min.js +0 -15
|
@@ -0,0 +1,3883 @@
|
|
|
1
|
+
var IntlMessageFormat = (function() {
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __markAsModule = function(target) {
|
|
9
|
+
return __defProp(target, "__esModule", {value: true});
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = function(callback, module) {
|
|
12
|
+
return function() {
|
|
13
|
+
if (!module) {
|
|
14
|
+
module = {exports: {}};
|
|
15
|
+
callback(module.exports, module);
|
|
16
|
+
}
|
|
17
|
+
return module.exports;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
var __export = function(target, all) {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
23
|
+
};
|
|
24
|
+
var __exportStar = function(target, module, desc) {
|
|
25
|
+
if (module && typeof module === "object" || typeof module === "function")
|
|
26
|
+
for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
+
key = keys[i];
|
|
28
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
29
|
+
__defProp(target, key, {get: function(k) {
|
|
30
|
+
return module[k];
|
|
31
|
+
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __toModule = function(module) {
|
|
36
|
+
if (module && module.__esModule)
|
|
37
|
+
return module;
|
|
38
|
+
return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", {value: module, enumerable: true})), module);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// external/npm/node_modules/fast-memoize/src/index.js
|
|
42
|
+
var require_src = __commonJS(function(exports, module) {
|
|
43
|
+
function memoize2(fn, options) {
|
|
44
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
45
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
46
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
47
|
+
return strategy(fn, {
|
|
48
|
+
cache: cache,
|
|
49
|
+
serializer: serializer
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function isPrimitive(value) {
|
|
53
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
54
|
+
}
|
|
55
|
+
function monadic(fn, cache, serializer, arg) {
|
|
56
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
57
|
+
var computedValue = cache.get(cacheKey);
|
|
58
|
+
if (typeof computedValue === "undefined") {
|
|
59
|
+
computedValue = fn.call(this, arg);
|
|
60
|
+
cache.set(cacheKey, computedValue);
|
|
61
|
+
}
|
|
62
|
+
return computedValue;
|
|
63
|
+
}
|
|
64
|
+
function variadic(fn, cache, serializer) {
|
|
65
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
66
|
+
var cacheKey = serializer(args);
|
|
67
|
+
var computedValue = cache.get(cacheKey);
|
|
68
|
+
if (typeof computedValue === "undefined") {
|
|
69
|
+
computedValue = fn.apply(this, args);
|
|
70
|
+
cache.set(cacheKey, computedValue);
|
|
71
|
+
}
|
|
72
|
+
return computedValue;
|
|
73
|
+
}
|
|
74
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
75
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
76
|
+
}
|
|
77
|
+
function strategyDefault(fn, options) {
|
|
78
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
79
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
80
|
+
}
|
|
81
|
+
function strategyVariadic(fn, options) {
|
|
82
|
+
var strategy = variadic;
|
|
83
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
84
|
+
}
|
|
85
|
+
function strategyMonadic(fn, options) {
|
|
86
|
+
var strategy = monadic;
|
|
87
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
88
|
+
}
|
|
89
|
+
function serializerDefault() {
|
|
90
|
+
return JSON.stringify(arguments);
|
|
91
|
+
}
|
|
92
|
+
function ObjectWithoutPrototypeCache() {
|
|
93
|
+
this.cache = Object.create(null);
|
|
94
|
+
}
|
|
95
|
+
ObjectWithoutPrototypeCache.prototype.has = function(key) {
|
|
96
|
+
return key in this.cache;
|
|
97
|
+
};
|
|
98
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
99
|
+
return this.cache[key];
|
|
100
|
+
};
|
|
101
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
102
|
+
this.cache[key] = value;
|
|
103
|
+
};
|
|
104
|
+
var cacheDefault = {
|
|
105
|
+
create: function create() {
|
|
106
|
+
return new ObjectWithoutPrototypeCache();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
module.exports = memoize2;
|
|
110
|
+
module.exports.strategies = {
|
|
111
|
+
variadic: strategyVariadic,
|
|
112
|
+
monadic: strategyMonadic
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/index.js
|
|
117
|
+
var lib_exports = {};
|
|
118
|
+
__export(lib_exports, {
|
|
119
|
+
ErrorCode: function() {
|
|
120
|
+
return ErrorCode;
|
|
121
|
+
},
|
|
122
|
+
FormatError: function() {
|
|
123
|
+
return FormatError;
|
|
124
|
+
},
|
|
125
|
+
IntlMessageFormat: function() {
|
|
126
|
+
return IntlMessageFormat;
|
|
127
|
+
},
|
|
128
|
+
InvalidValueError: function() {
|
|
129
|
+
return InvalidValueError;
|
|
130
|
+
},
|
|
131
|
+
InvalidValueTypeError: function() {
|
|
132
|
+
return InvalidValueTypeError;
|
|
133
|
+
},
|
|
134
|
+
MissingValueError: function() {
|
|
135
|
+
return MissingValueError;
|
|
136
|
+
},
|
|
137
|
+
PART_TYPE: function() {
|
|
138
|
+
return PART_TYPE;
|
|
139
|
+
},
|
|
140
|
+
default: function() {
|
|
141
|
+
return lib_default;
|
|
142
|
+
},
|
|
143
|
+
formatToParts: function() {
|
|
144
|
+
return formatToParts;
|
|
145
|
+
},
|
|
146
|
+
isFormatXMLElementFn: function() {
|
|
147
|
+
return isFormatXMLElementFn;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// external/npm/node_modules/tslib/tslib.es6.js
|
|
152
|
+
/*! *****************************************************************************
|
|
153
|
+
Copyright (c) Microsoft Corporation.
|
|
154
|
+
|
|
155
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
156
|
+
purpose with or without fee is hereby granted.
|
|
157
|
+
|
|
158
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
159
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
160
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
161
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
162
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
163
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
164
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
165
|
+
***************************************************************************** */
|
|
166
|
+
var extendStatics = function(d, b) {
|
|
167
|
+
extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
|
|
168
|
+
d2.__proto__ = b2;
|
|
169
|
+
} || function(d2, b2) {
|
|
170
|
+
for (var p in b2)
|
|
171
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
172
|
+
d2[p] = b2[p];
|
|
173
|
+
};
|
|
174
|
+
return extendStatics(d, b);
|
|
175
|
+
};
|
|
176
|
+
function __extends(d, b) {
|
|
177
|
+
if (typeof b !== "function" && b !== null)
|
|
178
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
179
|
+
extendStatics(d, b);
|
|
180
|
+
function __() {
|
|
181
|
+
this.constructor = d;
|
|
182
|
+
}
|
|
183
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
184
|
+
}
|
|
185
|
+
var __assign = function() {
|
|
186
|
+
__assign = Object.assign || function __assign2(t) {
|
|
187
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
188
|
+
s = arguments[i];
|
|
189
|
+
for (var p in s)
|
|
190
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
191
|
+
t[p] = s[p];
|
|
192
|
+
}
|
|
193
|
+
return t;
|
|
194
|
+
};
|
|
195
|
+
return __assign.apply(this, arguments);
|
|
196
|
+
};
|
|
197
|
+
function __spreadArray(to, from) {
|
|
198
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
199
|
+
to[j] = from[i];
|
|
200
|
+
return to;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat-parser/lib/src/types.js
|
|
204
|
+
var TYPE;
|
|
205
|
+
(function(TYPE2) {
|
|
206
|
+
TYPE2[TYPE2["literal"] = 0] = "literal";
|
|
207
|
+
TYPE2[TYPE2["argument"] = 1] = "argument";
|
|
208
|
+
TYPE2[TYPE2["number"] = 2] = "number";
|
|
209
|
+
TYPE2[TYPE2["date"] = 3] = "date";
|
|
210
|
+
TYPE2[TYPE2["time"] = 4] = "time";
|
|
211
|
+
TYPE2[TYPE2["select"] = 5] = "select";
|
|
212
|
+
TYPE2[TYPE2["plural"] = 6] = "plural";
|
|
213
|
+
TYPE2[TYPE2["pound"] = 7] = "pound";
|
|
214
|
+
TYPE2[TYPE2["tag"] = 8] = "tag";
|
|
215
|
+
})(TYPE || (TYPE = {}));
|
|
216
|
+
var SKELETON_TYPE;
|
|
217
|
+
(function(SKELETON_TYPE2) {
|
|
218
|
+
SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number";
|
|
219
|
+
SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime";
|
|
220
|
+
})(SKELETON_TYPE || (SKELETON_TYPE = {}));
|
|
221
|
+
function isLiteralElement(el) {
|
|
222
|
+
return el.type === TYPE.literal;
|
|
223
|
+
}
|
|
224
|
+
function isArgumentElement(el) {
|
|
225
|
+
return el.type === TYPE.argument;
|
|
226
|
+
}
|
|
227
|
+
function isNumberElement(el) {
|
|
228
|
+
return el.type === TYPE.number;
|
|
229
|
+
}
|
|
230
|
+
function isDateElement(el) {
|
|
231
|
+
return el.type === TYPE.date;
|
|
232
|
+
}
|
|
233
|
+
function isTimeElement(el) {
|
|
234
|
+
return el.type === TYPE.time;
|
|
235
|
+
}
|
|
236
|
+
function isSelectElement(el) {
|
|
237
|
+
return el.type === TYPE.select;
|
|
238
|
+
}
|
|
239
|
+
function isPluralElement(el) {
|
|
240
|
+
return el.type === TYPE.plural;
|
|
241
|
+
}
|
|
242
|
+
function isPoundElement(el) {
|
|
243
|
+
return el.type === TYPE.pound;
|
|
244
|
+
}
|
|
245
|
+
function isTagElement(el) {
|
|
246
|
+
return el.type === TYPE.tag;
|
|
247
|
+
}
|
|
248
|
+
function isNumberSkeleton(el) {
|
|
249
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number);
|
|
250
|
+
}
|
|
251
|
+
function isDateTimeSkeleton(el) {
|
|
252
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat-parser/lib/src/skeleton.js
|
|
256
|
+
var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
257
|
+
function parseDateTimeSkeleton(skeleton) {
|
|
258
|
+
var result = {};
|
|
259
|
+
skeleton.replace(DATE_TIME_REGEX, function(match) {
|
|
260
|
+
var len = match.length;
|
|
261
|
+
switch (match[0]) {
|
|
262
|
+
case "G":
|
|
263
|
+
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
264
|
+
break;
|
|
265
|
+
case "y":
|
|
266
|
+
result.year = len === 2 ? "2-digit" : "numeric";
|
|
267
|
+
break;
|
|
268
|
+
case "Y":
|
|
269
|
+
case "u":
|
|
270
|
+
case "U":
|
|
271
|
+
case "r":
|
|
272
|
+
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
273
|
+
case "q":
|
|
274
|
+
case "Q":
|
|
275
|
+
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
276
|
+
case "M":
|
|
277
|
+
case "L":
|
|
278
|
+
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
279
|
+
break;
|
|
280
|
+
case "w":
|
|
281
|
+
case "W":
|
|
282
|
+
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
283
|
+
case "d":
|
|
284
|
+
result.day = ["numeric", "2-digit"][len - 1];
|
|
285
|
+
break;
|
|
286
|
+
case "D":
|
|
287
|
+
case "F":
|
|
288
|
+
case "g":
|
|
289
|
+
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
290
|
+
case "E":
|
|
291
|
+
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
292
|
+
break;
|
|
293
|
+
case "e":
|
|
294
|
+
if (len < 4) {
|
|
295
|
+
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
296
|
+
}
|
|
297
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
298
|
+
break;
|
|
299
|
+
case "c":
|
|
300
|
+
if (len < 4) {
|
|
301
|
+
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
302
|
+
}
|
|
303
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
304
|
+
break;
|
|
305
|
+
case "a":
|
|
306
|
+
result.hour12 = true;
|
|
307
|
+
break;
|
|
308
|
+
case "b":
|
|
309
|
+
case "B":
|
|
310
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
311
|
+
case "h":
|
|
312
|
+
result.hourCycle = "h12";
|
|
313
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
314
|
+
break;
|
|
315
|
+
case "H":
|
|
316
|
+
result.hourCycle = "h23";
|
|
317
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
318
|
+
break;
|
|
319
|
+
case "K":
|
|
320
|
+
result.hourCycle = "h11";
|
|
321
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
322
|
+
break;
|
|
323
|
+
case "k":
|
|
324
|
+
result.hourCycle = "h24";
|
|
325
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
326
|
+
break;
|
|
327
|
+
case "j":
|
|
328
|
+
case "J":
|
|
329
|
+
case "C":
|
|
330
|
+
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
331
|
+
case "m":
|
|
332
|
+
result.minute = ["numeric", "2-digit"][len - 1];
|
|
333
|
+
break;
|
|
334
|
+
case "s":
|
|
335
|
+
result.second = ["numeric", "2-digit"][len - 1];
|
|
336
|
+
break;
|
|
337
|
+
case "S":
|
|
338
|
+
case "A":
|
|
339
|
+
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
340
|
+
case "z":
|
|
341
|
+
result.timeZoneName = len < 4 ? "short" : "long";
|
|
342
|
+
break;
|
|
343
|
+
case "Z":
|
|
344
|
+
case "O":
|
|
345
|
+
case "v":
|
|
346
|
+
case "V":
|
|
347
|
+
case "X":
|
|
348
|
+
case "x":
|
|
349
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
350
|
+
}
|
|
351
|
+
return "";
|
|
352
|
+
});
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
function icuUnitToEcma(unit) {
|
|
356
|
+
return unit.replace(/^(.*?)-/, "");
|
|
357
|
+
}
|
|
358
|
+
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
359
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
|
|
360
|
+
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
361
|
+
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
362
|
+
function parseSignificantPrecision(str) {
|
|
363
|
+
var result = {};
|
|
364
|
+
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
365
|
+
if (typeof g2 !== "string") {
|
|
366
|
+
result.minimumSignificantDigits = g1.length;
|
|
367
|
+
result.maximumSignificantDigits = g1.length;
|
|
368
|
+
} else if (g2 === "+") {
|
|
369
|
+
result.minimumSignificantDigits = g1.length;
|
|
370
|
+
} else if (g1[0] === "#") {
|
|
371
|
+
result.maximumSignificantDigits = g1.length;
|
|
372
|
+
} else {
|
|
373
|
+
result.minimumSignificantDigits = g1.length;
|
|
374
|
+
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
375
|
+
}
|
|
376
|
+
return "";
|
|
377
|
+
});
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
function parseSign(str) {
|
|
381
|
+
switch (str) {
|
|
382
|
+
case "sign-auto":
|
|
383
|
+
return {
|
|
384
|
+
signDisplay: "auto"
|
|
385
|
+
};
|
|
386
|
+
case "sign-accounting":
|
|
387
|
+
case "()":
|
|
388
|
+
return {
|
|
389
|
+
currencySign: "accounting"
|
|
390
|
+
};
|
|
391
|
+
case "sign-always":
|
|
392
|
+
case "+!":
|
|
393
|
+
return {
|
|
394
|
+
signDisplay: "always"
|
|
395
|
+
};
|
|
396
|
+
case "sign-accounting-always":
|
|
397
|
+
case "()!":
|
|
398
|
+
return {
|
|
399
|
+
signDisplay: "always",
|
|
400
|
+
currencySign: "accounting"
|
|
401
|
+
};
|
|
402
|
+
case "sign-except-zero":
|
|
403
|
+
case "+?":
|
|
404
|
+
return {
|
|
405
|
+
signDisplay: "exceptZero"
|
|
406
|
+
};
|
|
407
|
+
case "sign-accounting-except-zero":
|
|
408
|
+
case "()?":
|
|
409
|
+
return {
|
|
410
|
+
signDisplay: "exceptZero",
|
|
411
|
+
currencySign: "accounting"
|
|
412
|
+
};
|
|
413
|
+
case "sign-never":
|
|
414
|
+
case "+_":
|
|
415
|
+
return {
|
|
416
|
+
signDisplay: "never"
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function parseConciseScientificAndEngineeringStem(stem) {
|
|
421
|
+
var result;
|
|
422
|
+
if (stem[0] === "E" && stem[1] === "E") {
|
|
423
|
+
result = {
|
|
424
|
+
notation: "engineering"
|
|
425
|
+
};
|
|
426
|
+
stem = stem.slice(2);
|
|
427
|
+
} else if (stem[0] === "E") {
|
|
428
|
+
result = {
|
|
429
|
+
notation: "scientific"
|
|
430
|
+
};
|
|
431
|
+
stem = stem.slice(1);
|
|
432
|
+
}
|
|
433
|
+
if (result) {
|
|
434
|
+
var signDisplay = stem.slice(0, 2);
|
|
435
|
+
if (signDisplay === "+!") {
|
|
436
|
+
result.signDisplay = "always";
|
|
437
|
+
stem = stem.slice(2);
|
|
438
|
+
} else if (signDisplay === "+?") {
|
|
439
|
+
result.signDisplay = "exceptZero";
|
|
440
|
+
stem = stem.slice(2);
|
|
441
|
+
}
|
|
442
|
+
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {
|
|
443
|
+
throw new Error("Malformed concise eng/scientific notation");
|
|
444
|
+
}
|
|
445
|
+
result.minimumIntegerDigits = stem.length;
|
|
446
|
+
}
|
|
447
|
+
return result;
|
|
448
|
+
}
|
|
449
|
+
function parseNotationOptions(opt) {
|
|
450
|
+
var result = {};
|
|
451
|
+
var signOpts = parseSign(opt);
|
|
452
|
+
if (signOpts) {
|
|
453
|
+
return signOpts;
|
|
454
|
+
}
|
|
455
|
+
return result;
|
|
456
|
+
}
|
|
457
|
+
function parseNumberSkeleton(tokens) {
|
|
458
|
+
var result = {};
|
|
459
|
+
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
|
|
460
|
+
var token = tokens_1[_i];
|
|
461
|
+
switch (token.stem) {
|
|
462
|
+
case "percent":
|
|
463
|
+
case "%":
|
|
464
|
+
result.style = "percent";
|
|
465
|
+
continue;
|
|
466
|
+
case "%x100":
|
|
467
|
+
result.style = "percent";
|
|
468
|
+
result.scale = 100;
|
|
469
|
+
continue;
|
|
470
|
+
case "currency":
|
|
471
|
+
result.style = "currency";
|
|
472
|
+
result.currency = token.options[0];
|
|
473
|
+
continue;
|
|
474
|
+
case "group-off":
|
|
475
|
+
case ",_":
|
|
476
|
+
result.useGrouping = false;
|
|
477
|
+
continue;
|
|
478
|
+
case "precision-integer":
|
|
479
|
+
case ".":
|
|
480
|
+
result.maximumFractionDigits = 0;
|
|
481
|
+
continue;
|
|
482
|
+
case "measure-unit":
|
|
483
|
+
case "unit":
|
|
484
|
+
result.style = "unit";
|
|
485
|
+
result.unit = icuUnitToEcma(token.options[0]);
|
|
486
|
+
continue;
|
|
487
|
+
case "compact-short":
|
|
488
|
+
case "K":
|
|
489
|
+
result.notation = "compact";
|
|
490
|
+
result.compactDisplay = "short";
|
|
491
|
+
continue;
|
|
492
|
+
case "compact-long":
|
|
493
|
+
case "KK":
|
|
494
|
+
result.notation = "compact";
|
|
495
|
+
result.compactDisplay = "long";
|
|
496
|
+
continue;
|
|
497
|
+
case "scientific":
|
|
498
|
+
result = __assign(__assign(__assign({}, result), {notation: "scientific"}), token.options.reduce(function(all, opt) {
|
|
499
|
+
return __assign(__assign({}, all), parseNotationOptions(opt));
|
|
500
|
+
}, {}));
|
|
501
|
+
continue;
|
|
502
|
+
case "engineering":
|
|
503
|
+
result = __assign(__assign(__assign({}, result), {notation: "engineering"}), token.options.reduce(function(all, opt) {
|
|
504
|
+
return __assign(__assign({}, all), parseNotationOptions(opt));
|
|
505
|
+
}, {}));
|
|
506
|
+
continue;
|
|
507
|
+
case "notation-simple":
|
|
508
|
+
result.notation = "standard";
|
|
509
|
+
continue;
|
|
510
|
+
case "unit-width-narrow":
|
|
511
|
+
result.currencyDisplay = "narrowSymbol";
|
|
512
|
+
result.unitDisplay = "narrow";
|
|
513
|
+
continue;
|
|
514
|
+
case "unit-width-short":
|
|
515
|
+
result.currencyDisplay = "code";
|
|
516
|
+
result.unitDisplay = "short";
|
|
517
|
+
continue;
|
|
518
|
+
case "unit-width-full-name":
|
|
519
|
+
result.currencyDisplay = "name";
|
|
520
|
+
result.unitDisplay = "long";
|
|
521
|
+
continue;
|
|
522
|
+
case "unit-width-iso-code":
|
|
523
|
+
result.currencyDisplay = "symbol";
|
|
524
|
+
continue;
|
|
525
|
+
case "scale":
|
|
526
|
+
result.scale = parseFloat(token.options[0]);
|
|
527
|
+
continue;
|
|
528
|
+
case "integer-width":
|
|
529
|
+
if (token.options.length > 1) {
|
|
530
|
+
throw new RangeError("integer-width stems only accept a single optional option");
|
|
531
|
+
}
|
|
532
|
+
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
533
|
+
if (g1) {
|
|
534
|
+
result.minimumIntegerDigits = g2.length;
|
|
535
|
+
} else if (g3 && g4) {
|
|
536
|
+
throw new Error("We currently do not support maximum integer digits");
|
|
537
|
+
} else if (g5) {
|
|
538
|
+
throw new Error("We currently do not support exact integer digits");
|
|
539
|
+
}
|
|
540
|
+
return "";
|
|
541
|
+
});
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
|
|
545
|
+
result.minimumIntegerDigits = token.stem.length;
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
|
|
549
|
+
if (token.options.length > 1) {
|
|
550
|
+
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
551
|
+
}
|
|
552
|
+
token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
553
|
+
if (g2 === "*") {
|
|
554
|
+
result.minimumFractionDigits = g1.length;
|
|
555
|
+
} else if (g3 && g3[0] === "#") {
|
|
556
|
+
result.maximumFractionDigits = g3.length;
|
|
557
|
+
} else if (g4 && g5) {
|
|
558
|
+
result.minimumFractionDigits = g4.length;
|
|
559
|
+
result.maximumFractionDigits = g4.length + g5.length;
|
|
560
|
+
} else {
|
|
561
|
+
result.minimumFractionDigits = g1.length;
|
|
562
|
+
result.maximumFractionDigits = g1.length;
|
|
563
|
+
}
|
|
564
|
+
return "";
|
|
565
|
+
});
|
|
566
|
+
if (token.options.length) {
|
|
567
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
|
|
568
|
+
}
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
571
|
+
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
|
|
572
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
var signOpts = parseSign(token.stem);
|
|
576
|
+
if (signOpts) {
|
|
577
|
+
result = __assign(__assign({}, result), signOpts);
|
|
578
|
+
}
|
|
579
|
+
var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
|
|
580
|
+
if (conciseScientificAndEngineeringOpts) {
|
|
581
|
+
result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return result;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat-parser/lib/src/parser.js
|
|
588
|
+
var SyntaxError = function(_super) {
|
|
589
|
+
__extends(SyntaxError2, _super);
|
|
590
|
+
function SyntaxError2(message, expected, found, location) {
|
|
591
|
+
var _this = _super.call(this) || this;
|
|
592
|
+
_this.message = message;
|
|
593
|
+
_this.expected = expected;
|
|
594
|
+
_this.found = found;
|
|
595
|
+
_this.location = location;
|
|
596
|
+
_this.name = "SyntaxError";
|
|
597
|
+
if (typeof Error.captureStackTrace === "function") {
|
|
598
|
+
Error.captureStackTrace(_this, SyntaxError2);
|
|
599
|
+
}
|
|
600
|
+
return _this;
|
|
601
|
+
}
|
|
602
|
+
SyntaxError2.buildMessage = function(expected, found) {
|
|
603
|
+
function hex(ch) {
|
|
604
|
+
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
605
|
+
}
|
|
606
|
+
function literalEscape(s) {
|
|
607
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
608
|
+
return "\\x0" + hex(ch);
|
|
609
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
610
|
+
return "\\x" + hex(ch);
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function classEscape(s) {
|
|
614
|
+
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
615
|
+
return "\\x0" + hex(ch);
|
|
616
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
617
|
+
return "\\x" + hex(ch);
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function describeExpectation(expectation) {
|
|
621
|
+
switch (expectation.type) {
|
|
622
|
+
case "literal":
|
|
623
|
+
return '"' + literalEscape(expectation.text) + '"';
|
|
624
|
+
case "class":
|
|
625
|
+
var escapedParts = expectation.parts.map(function(part) {
|
|
626
|
+
return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
|
|
627
|
+
});
|
|
628
|
+
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
|
|
629
|
+
case "any":
|
|
630
|
+
return "any character";
|
|
631
|
+
case "end":
|
|
632
|
+
return "end of input";
|
|
633
|
+
case "other":
|
|
634
|
+
return expectation.description;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
function describeExpected(expected1) {
|
|
638
|
+
var descriptions = expected1.map(describeExpectation);
|
|
639
|
+
var i;
|
|
640
|
+
var j;
|
|
641
|
+
descriptions.sort();
|
|
642
|
+
if (descriptions.length > 0) {
|
|
643
|
+
for (i = 1, j = 1; i < descriptions.length; i++) {
|
|
644
|
+
if (descriptions[i - 1] !== descriptions[i]) {
|
|
645
|
+
descriptions[j] = descriptions[i];
|
|
646
|
+
j++;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
descriptions.length = j;
|
|
650
|
+
}
|
|
651
|
+
switch (descriptions.length) {
|
|
652
|
+
case 1:
|
|
653
|
+
return descriptions[0];
|
|
654
|
+
case 2:
|
|
655
|
+
return descriptions[0] + " or " + descriptions[1];
|
|
656
|
+
default:
|
|
657
|
+
return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
function describeFound(found1) {
|
|
661
|
+
return found1 ? '"' + literalEscape(found1) + '"' : "end of input";
|
|
662
|
+
}
|
|
663
|
+
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
664
|
+
};
|
|
665
|
+
return SyntaxError2;
|
|
666
|
+
}(Error);
|
|
667
|
+
function peg$parse(input, options) {
|
|
668
|
+
options = options !== void 0 ? options : {};
|
|
669
|
+
var peg$FAILED = {};
|
|
670
|
+
var peg$startRuleFunctions = {start: peg$parsestart};
|
|
671
|
+
var peg$startRuleFunction = peg$parsestart;
|
|
672
|
+
var peg$c0 = function() {
|
|
673
|
+
return !ignoreTag;
|
|
674
|
+
};
|
|
675
|
+
var peg$c1 = function(x) {
|
|
676
|
+
return x;
|
|
677
|
+
};
|
|
678
|
+
var peg$c2 = function() {
|
|
679
|
+
return ignoreTag;
|
|
680
|
+
};
|
|
681
|
+
var peg$c3 = "<";
|
|
682
|
+
var peg$c4 = peg$literalExpectation("<", false);
|
|
683
|
+
var peg$c5 = function(parts) {
|
|
684
|
+
return parts.join("");
|
|
685
|
+
};
|
|
686
|
+
var peg$c6 = function() {
|
|
687
|
+
return "<";
|
|
688
|
+
};
|
|
689
|
+
var peg$c7 = function(messageText) {
|
|
690
|
+
return __assign({type: TYPE.literal, value: messageText}, insertLocation());
|
|
691
|
+
};
|
|
692
|
+
var peg$c8 = "#";
|
|
693
|
+
var peg$c9 = peg$literalExpectation("#", false);
|
|
694
|
+
var peg$c10 = function() {
|
|
695
|
+
return __assign({type: TYPE.pound}, insertLocation());
|
|
696
|
+
};
|
|
697
|
+
var peg$c11 = peg$otherExpectation("tagElement");
|
|
698
|
+
var peg$c12 = function(open, children, close) {
|
|
699
|
+
if (open !== close) {
|
|
700
|
+
error('Mismatch tag "' + open + '" !== "' + close + '"', location());
|
|
701
|
+
}
|
|
702
|
+
return __assign({type: TYPE.tag, value: open, children: children}, insertLocation());
|
|
703
|
+
};
|
|
704
|
+
var peg$c13 = "/>";
|
|
705
|
+
var peg$c14 = peg$literalExpectation("/>", false);
|
|
706
|
+
var peg$c15 = function(value) {
|
|
707
|
+
return __assign({type: TYPE.literal, value: value.join("")}, insertLocation());
|
|
708
|
+
};
|
|
709
|
+
var peg$c16 = ">";
|
|
710
|
+
var peg$c17 = peg$literalExpectation(">", false);
|
|
711
|
+
var peg$c18 = function(tag) {
|
|
712
|
+
return tag;
|
|
713
|
+
};
|
|
714
|
+
var peg$c19 = "</";
|
|
715
|
+
var peg$c20 = peg$literalExpectation("</", false);
|
|
716
|
+
var peg$c21 = peg$otherExpectation("argumentElement");
|
|
717
|
+
var peg$c22 = "{";
|
|
718
|
+
var peg$c23 = peg$literalExpectation("{", false);
|
|
719
|
+
var peg$c24 = "}";
|
|
720
|
+
var peg$c25 = peg$literalExpectation("}", false);
|
|
721
|
+
var peg$c26 = function(value) {
|
|
722
|
+
return __assign({type: TYPE.argument, value: value}, insertLocation());
|
|
723
|
+
};
|
|
724
|
+
var peg$c27 = peg$otherExpectation("numberSkeletonId");
|
|
725
|
+
var peg$c28 = /^['\/{}]/;
|
|
726
|
+
var peg$c29 = peg$classExpectation(["'", "/", "{", "}"], false, false);
|
|
727
|
+
var peg$c30 = peg$anyExpectation();
|
|
728
|
+
var peg$c31 = peg$otherExpectation("numberSkeletonTokenOption");
|
|
729
|
+
var peg$c32 = "/";
|
|
730
|
+
var peg$c33 = peg$literalExpectation("/", false);
|
|
731
|
+
var peg$c34 = function(option) {
|
|
732
|
+
return option;
|
|
733
|
+
};
|
|
734
|
+
var peg$c35 = peg$otherExpectation("numberSkeletonToken");
|
|
735
|
+
var peg$c36 = function(stem, options2) {
|
|
736
|
+
return {stem: stem, options: options2};
|
|
737
|
+
};
|
|
738
|
+
var peg$c37 = function(tokens) {
|
|
739
|
+
return __assign({type: SKELETON_TYPE.number, tokens: tokens, parsedOptions: shouldParseSkeleton ? parseNumberSkeleton(tokens) : {}}, insertLocation());
|
|
740
|
+
};
|
|
741
|
+
var peg$c38 = "::";
|
|
742
|
+
var peg$c39 = peg$literalExpectation("::", false);
|
|
743
|
+
var peg$c40 = function(skeleton) {
|
|
744
|
+
return skeleton;
|
|
745
|
+
};
|
|
746
|
+
var peg$c41 = function() {
|
|
747
|
+
messageCtx.push("numberArgStyle");
|
|
748
|
+
return true;
|
|
749
|
+
};
|
|
750
|
+
var peg$c42 = function(style) {
|
|
751
|
+
messageCtx.pop();
|
|
752
|
+
return style.replace(/\s*$/, "");
|
|
753
|
+
};
|
|
754
|
+
var peg$c43 = ",";
|
|
755
|
+
var peg$c44 = peg$literalExpectation(",", false);
|
|
756
|
+
var peg$c45 = "number";
|
|
757
|
+
var peg$c46 = peg$literalExpectation("number", false);
|
|
758
|
+
var peg$c47 = function(value, type, style) {
|
|
759
|
+
return __assign({type: type === "number" ? TYPE.number : type === "date" ? TYPE.date : TYPE.time, style: style && style[2], value: value}, insertLocation());
|
|
760
|
+
};
|
|
761
|
+
var peg$c48 = "'";
|
|
762
|
+
var peg$c49 = peg$literalExpectation("'", false);
|
|
763
|
+
var peg$c50 = /^[^']/;
|
|
764
|
+
var peg$c51 = peg$classExpectation(["'"], true, false);
|
|
765
|
+
var peg$c52 = /^[^a-zA-Z'{}]/;
|
|
766
|
+
var peg$c53 = peg$classExpectation([["a", "z"], ["A", "Z"], "'", "{", "}"], true, false);
|
|
767
|
+
var peg$c54 = /^[a-zA-Z]/;
|
|
768
|
+
var peg$c55 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
|
|
769
|
+
var peg$c56 = function(pattern) {
|
|
770
|
+
return __assign({type: SKELETON_TYPE.dateTime, pattern: pattern, parsedOptions: shouldParseSkeleton ? parseDateTimeSkeleton(pattern) : {}}, insertLocation());
|
|
771
|
+
};
|
|
772
|
+
var peg$c57 = function() {
|
|
773
|
+
messageCtx.push("dateOrTimeArgStyle");
|
|
774
|
+
return true;
|
|
775
|
+
};
|
|
776
|
+
var peg$c58 = "date";
|
|
777
|
+
var peg$c59 = peg$literalExpectation("date", false);
|
|
778
|
+
var peg$c60 = "time";
|
|
779
|
+
var peg$c61 = peg$literalExpectation("time", false);
|
|
780
|
+
var peg$c62 = "plural";
|
|
781
|
+
var peg$c63 = peg$literalExpectation("plural", false);
|
|
782
|
+
var peg$c64 = "selectordinal";
|
|
783
|
+
var peg$c65 = peg$literalExpectation("selectordinal", false);
|
|
784
|
+
var peg$c66 = "offset:";
|
|
785
|
+
var peg$c67 = peg$literalExpectation("offset:", false);
|
|
786
|
+
var peg$c68 = function(value, pluralType, offset, options2) {
|
|
787
|
+
return __assign({type: TYPE.plural, pluralType: pluralType === "plural" ? "cardinal" : "ordinal", value: value, offset: offset ? offset[2] : 0, options: options2.reduce(function(all, _a) {
|
|
788
|
+
var id = _a.id, value2 = _a.value, optionLocation = _a.location;
|
|
789
|
+
if (id in all) {
|
|
790
|
+
error('Duplicate option "' + id + '" in plural element: "' + text() + '"', location());
|
|
791
|
+
}
|
|
792
|
+
all[id] = {
|
|
793
|
+
value: value2,
|
|
794
|
+
location: optionLocation
|
|
795
|
+
};
|
|
796
|
+
return all;
|
|
797
|
+
}, {})}, insertLocation());
|
|
798
|
+
};
|
|
799
|
+
var peg$c69 = "select";
|
|
800
|
+
var peg$c70 = peg$literalExpectation("select", false);
|
|
801
|
+
var peg$c71 = function(value, options2) {
|
|
802
|
+
return __assign({type: TYPE.select, value: value, options: options2.reduce(function(all, _a) {
|
|
803
|
+
var id = _a.id, value2 = _a.value, optionLocation = _a.location;
|
|
804
|
+
if (id in all) {
|
|
805
|
+
error('Duplicate option "' + id + '" in select element: "' + text() + '"', location());
|
|
806
|
+
}
|
|
807
|
+
all[id] = {
|
|
808
|
+
value: value2,
|
|
809
|
+
location: optionLocation
|
|
810
|
+
};
|
|
811
|
+
return all;
|
|
812
|
+
}, {})}, insertLocation());
|
|
813
|
+
};
|
|
814
|
+
var peg$c72 = "=";
|
|
815
|
+
var peg$c73 = peg$literalExpectation("=", false);
|
|
816
|
+
var peg$c74 = function(id) {
|
|
817
|
+
messageCtx.push("select");
|
|
818
|
+
return true;
|
|
819
|
+
};
|
|
820
|
+
var peg$c75 = function(id, value) {
|
|
821
|
+
messageCtx.pop();
|
|
822
|
+
return __assign({
|
|
823
|
+
id: id,
|
|
824
|
+
value: value
|
|
825
|
+
}, insertLocation());
|
|
826
|
+
};
|
|
827
|
+
var peg$c76 = function(id) {
|
|
828
|
+
messageCtx.push("plural");
|
|
829
|
+
return true;
|
|
830
|
+
};
|
|
831
|
+
var peg$c77 = function(id, value) {
|
|
832
|
+
messageCtx.pop();
|
|
833
|
+
return __assign({
|
|
834
|
+
id: id,
|
|
835
|
+
value: value
|
|
836
|
+
}, insertLocation());
|
|
837
|
+
};
|
|
838
|
+
var peg$c78 = peg$otherExpectation("whitespace");
|
|
839
|
+
var peg$c79 = /^[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
|
|
840
|
+
var peg$c80 = peg$classExpectation([[" ", "\r"], " ", "\x85", "\xA0", "\u1680", ["\u2000", "\u200A"], "\u2028", "\u2029", "\u202F", "\u205F", "\u3000"], false, false);
|
|
841
|
+
var peg$c81 = peg$otherExpectation("syntax pattern");
|
|
842
|
+
var peg$c82 = /^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/;
|
|
843
|
+
var peg$c83 = peg$classExpectation([["!", "/"], [":", "@"], ["[", "^"], "`", ["{", "~"], ["\xA1", "\xA7"], "\xA9", "\xAB", "\xAC", "\xAE", "\xB0", "\xB1", "\xB6", "\xBB", "\xBF", "\xD7", "\xF7", ["\u2010", "\u2027"], ["\u2030", "\u203E"], ["\u2041", "\u2053"], ["\u2055", "\u205E"], ["\u2190", "\u245F"], ["\u2500", "\u2775"], ["\u2794", "\u2BFF"], ["\u2E00", "\u2E7F"], ["\u3001", "\u3003"], ["\u3008", "\u3020"], "\u3030", "\uFD3E", "\uFD3F", "\uFE45", "\uFE46"], false, false);
|
|
844
|
+
var peg$c84 = peg$otherExpectation("optional whitespace");
|
|
845
|
+
var peg$c85 = peg$otherExpectation("number");
|
|
846
|
+
var peg$c86 = "-";
|
|
847
|
+
var peg$c87 = peg$literalExpectation("-", false);
|
|
848
|
+
var peg$c88 = function(negative, num) {
|
|
849
|
+
return num ? negative ? -num : num : 0;
|
|
850
|
+
};
|
|
851
|
+
var peg$c89 = peg$otherExpectation("apostrophe");
|
|
852
|
+
var peg$c90 = peg$otherExpectation("double apostrophes");
|
|
853
|
+
var peg$c91 = "''";
|
|
854
|
+
var peg$c92 = peg$literalExpectation("''", false);
|
|
855
|
+
var peg$c93 = function() {
|
|
856
|
+
return "'";
|
|
857
|
+
};
|
|
858
|
+
var peg$c94 = function(escapedChar, quotedChars) {
|
|
859
|
+
return escapedChar + quotedChars.replace("''", "'");
|
|
860
|
+
};
|
|
861
|
+
var peg$c95 = function(x) {
|
|
862
|
+
return x !== "<" && x !== "{" && !(isInPluralOption() && x === "#") && !(isNestedMessageText() && x === "}");
|
|
863
|
+
};
|
|
864
|
+
var peg$c96 = "\n";
|
|
865
|
+
var peg$c97 = peg$literalExpectation("\n", false);
|
|
866
|
+
var peg$c98 = function(x) {
|
|
867
|
+
return x === "<" || x === ">" || x === "{" || x === "}" || isInPluralOption() && x === "#";
|
|
868
|
+
};
|
|
869
|
+
var peg$c99 = peg$otherExpectation("argNameOrNumber");
|
|
870
|
+
var peg$c100 = peg$otherExpectation("validTag");
|
|
871
|
+
var peg$c101 = peg$otherExpectation("argNumber");
|
|
872
|
+
var peg$c102 = "0";
|
|
873
|
+
var peg$c103 = peg$literalExpectation("0", false);
|
|
874
|
+
var peg$c104 = function() {
|
|
875
|
+
return 0;
|
|
876
|
+
};
|
|
877
|
+
var peg$c105 = /^[1-9]/;
|
|
878
|
+
var peg$c106 = peg$classExpectation([["1", "9"]], false, false);
|
|
879
|
+
var peg$c107 = /^[0-9]/;
|
|
880
|
+
var peg$c108 = peg$classExpectation([["0", "9"]], false, false);
|
|
881
|
+
var peg$c109 = function(digits) {
|
|
882
|
+
return parseInt(digits.join(""), 10);
|
|
883
|
+
};
|
|
884
|
+
var peg$c110 = peg$otherExpectation("argName");
|
|
885
|
+
var peg$c111 = peg$otherExpectation("tagName");
|
|
886
|
+
var peg$currPos = 0;
|
|
887
|
+
var peg$savedPos = 0;
|
|
888
|
+
var peg$posDetailsCache = [{line: 1, column: 1}];
|
|
889
|
+
var peg$maxFailPos = 0;
|
|
890
|
+
var peg$maxFailExpected = [];
|
|
891
|
+
var peg$silentFails = 0;
|
|
892
|
+
var peg$result;
|
|
893
|
+
if (options.startRule !== void 0) {
|
|
894
|
+
if (!(options.startRule in peg$startRuleFunctions)) {
|
|
895
|
+
throw new Error("Can't start parsing from rule \"" + options.startRule + '".');
|
|
896
|
+
}
|
|
897
|
+
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
898
|
+
}
|
|
899
|
+
function text() {
|
|
900
|
+
return input.substring(peg$savedPos, peg$currPos);
|
|
901
|
+
}
|
|
902
|
+
function location() {
|
|
903
|
+
return peg$computeLocation(peg$savedPos, peg$currPos);
|
|
904
|
+
}
|
|
905
|
+
function expected(description, location1) {
|
|
906
|
+
location1 = location1 !== void 0 ? location1 : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
907
|
+
throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location1);
|
|
908
|
+
}
|
|
909
|
+
function error(message, location1) {
|
|
910
|
+
location1 = location1 !== void 0 ? location1 : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
911
|
+
throw peg$buildSimpleError(message, location1);
|
|
912
|
+
}
|
|
913
|
+
function peg$literalExpectation(text1, ignoreCase) {
|
|
914
|
+
return {type: "literal", text: text1, ignoreCase: ignoreCase};
|
|
915
|
+
}
|
|
916
|
+
function peg$classExpectation(parts, inverted, ignoreCase) {
|
|
917
|
+
return {type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase};
|
|
918
|
+
}
|
|
919
|
+
function peg$anyExpectation() {
|
|
920
|
+
return {type: "any"};
|
|
921
|
+
}
|
|
922
|
+
function peg$endExpectation() {
|
|
923
|
+
return {type: "end"};
|
|
924
|
+
}
|
|
925
|
+
function peg$otherExpectation(description) {
|
|
926
|
+
return {type: "other", description: description};
|
|
927
|
+
}
|
|
928
|
+
function peg$computePosDetails(pos) {
|
|
929
|
+
var details = peg$posDetailsCache[pos];
|
|
930
|
+
var p;
|
|
931
|
+
if (details) {
|
|
932
|
+
return details;
|
|
933
|
+
} else {
|
|
934
|
+
p = pos - 1;
|
|
935
|
+
while (!peg$posDetailsCache[p]) {
|
|
936
|
+
p--;
|
|
937
|
+
}
|
|
938
|
+
details = peg$posDetailsCache[p];
|
|
939
|
+
details = {
|
|
940
|
+
line: details.line,
|
|
941
|
+
column: details.column
|
|
942
|
+
};
|
|
943
|
+
while (p < pos) {
|
|
944
|
+
if (input.charCodeAt(p) === 10) {
|
|
945
|
+
details.line++;
|
|
946
|
+
details.column = 1;
|
|
947
|
+
} else {
|
|
948
|
+
details.column++;
|
|
949
|
+
}
|
|
950
|
+
p++;
|
|
951
|
+
}
|
|
952
|
+
peg$posDetailsCache[pos] = details;
|
|
953
|
+
return details;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function peg$computeLocation(startPos, endPos) {
|
|
957
|
+
var startPosDetails = peg$computePosDetails(startPos);
|
|
958
|
+
var endPosDetails = peg$computePosDetails(endPos);
|
|
959
|
+
return {
|
|
960
|
+
start: {
|
|
961
|
+
offset: startPos,
|
|
962
|
+
line: startPosDetails.line,
|
|
963
|
+
column: startPosDetails.column
|
|
964
|
+
},
|
|
965
|
+
end: {
|
|
966
|
+
offset: endPos,
|
|
967
|
+
line: endPosDetails.line,
|
|
968
|
+
column: endPosDetails.column
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
function peg$fail(expected1) {
|
|
973
|
+
if (peg$currPos < peg$maxFailPos) {
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
if (peg$currPos > peg$maxFailPos) {
|
|
977
|
+
peg$maxFailPos = peg$currPos;
|
|
978
|
+
peg$maxFailExpected = [];
|
|
979
|
+
}
|
|
980
|
+
peg$maxFailExpected.push(expected1);
|
|
981
|
+
}
|
|
982
|
+
function peg$buildSimpleError(message, location1) {
|
|
983
|
+
return new SyntaxError(message, [], "", location1);
|
|
984
|
+
}
|
|
985
|
+
function peg$buildStructuredError(expected1, found, location1) {
|
|
986
|
+
return new SyntaxError(SyntaxError.buildMessage(expected1, found), expected1, found, location1);
|
|
987
|
+
}
|
|
988
|
+
function peg$parsestart() {
|
|
989
|
+
var s0;
|
|
990
|
+
s0 = peg$parsemessage();
|
|
991
|
+
return s0;
|
|
992
|
+
}
|
|
993
|
+
function peg$parsemessage() {
|
|
994
|
+
var s0, s1;
|
|
995
|
+
s0 = [];
|
|
996
|
+
s1 = peg$parsemessageElement();
|
|
997
|
+
while (s1 !== peg$FAILED) {
|
|
998
|
+
s0.push(s1);
|
|
999
|
+
s1 = peg$parsemessageElement();
|
|
1000
|
+
}
|
|
1001
|
+
return s0;
|
|
1002
|
+
}
|
|
1003
|
+
function peg$parsemessageElement() {
|
|
1004
|
+
var s0, s1, s2;
|
|
1005
|
+
s0 = peg$currPos;
|
|
1006
|
+
peg$savedPos = peg$currPos;
|
|
1007
|
+
s1 = peg$c0();
|
|
1008
|
+
if (s1) {
|
|
1009
|
+
s1 = void 0;
|
|
1010
|
+
} else {
|
|
1011
|
+
s1 = peg$FAILED;
|
|
1012
|
+
}
|
|
1013
|
+
if (s1 !== peg$FAILED) {
|
|
1014
|
+
s2 = peg$parsetagElement();
|
|
1015
|
+
if (s2 !== peg$FAILED) {
|
|
1016
|
+
peg$savedPos = s0;
|
|
1017
|
+
s1 = peg$c1(s2);
|
|
1018
|
+
s0 = s1;
|
|
1019
|
+
} else {
|
|
1020
|
+
peg$currPos = s0;
|
|
1021
|
+
s0 = peg$FAILED;
|
|
1022
|
+
}
|
|
1023
|
+
} else {
|
|
1024
|
+
peg$currPos = s0;
|
|
1025
|
+
s0 = peg$FAILED;
|
|
1026
|
+
}
|
|
1027
|
+
if (s0 === peg$FAILED) {
|
|
1028
|
+
s0 = peg$parseliteralElement();
|
|
1029
|
+
if (s0 === peg$FAILED) {
|
|
1030
|
+
s0 = peg$parseargumentElement();
|
|
1031
|
+
if (s0 === peg$FAILED) {
|
|
1032
|
+
s0 = peg$parsesimpleFormatElement();
|
|
1033
|
+
if (s0 === peg$FAILED) {
|
|
1034
|
+
s0 = peg$parsepluralElement();
|
|
1035
|
+
if (s0 === peg$FAILED) {
|
|
1036
|
+
s0 = peg$parseselectElement();
|
|
1037
|
+
if (s0 === peg$FAILED) {
|
|
1038
|
+
s0 = peg$parsepoundElement();
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return s0;
|
|
1046
|
+
}
|
|
1047
|
+
function peg$parsemessageText() {
|
|
1048
|
+
var s0, s1, s2, s3;
|
|
1049
|
+
s0 = peg$currPos;
|
|
1050
|
+
peg$savedPos = peg$currPos;
|
|
1051
|
+
s1 = peg$c2();
|
|
1052
|
+
if (s1) {
|
|
1053
|
+
s1 = void 0;
|
|
1054
|
+
} else {
|
|
1055
|
+
s1 = peg$FAILED;
|
|
1056
|
+
}
|
|
1057
|
+
if (s1 !== peg$FAILED) {
|
|
1058
|
+
s2 = [];
|
|
1059
|
+
s3 = peg$parsedoubleApostrophes();
|
|
1060
|
+
if (s3 === peg$FAILED) {
|
|
1061
|
+
s3 = peg$parsequotedString();
|
|
1062
|
+
if (s3 === peg$FAILED) {
|
|
1063
|
+
s3 = peg$parseunquotedString();
|
|
1064
|
+
if (s3 === peg$FAILED) {
|
|
1065
|
+
if (input.charCodeAt(peg$currPos) === 60) {
|
|
1066
|
+
s3 = peg$c3;
|
|
1067
|
+
peg$currPos++;
|
|
1068
|
+
} else {
|
|
1069
|
+
s3 = peg$FAILED;
|
|
1070
|
+
if (peg$silentFails === 0) {
|
|
1071
|
+
peg$fail(peg$c4);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
if (s3 !== peg$FAILED) {
|
|
1078
|
+
while (s3 !== peg$FAILED) {
|
|
1079
|
+
s2.push(s3);
|
|
1080
|
+
s3 = peg$parsedoubleApostrophes();
|
|
1081
|
+
if (s3 === peg$FAILED) {
|
|
1082
|
+
s3 = peg$parsequotedString();
|
|
1083
|
+
if (s3 === peg$FAILED) {
|
|
1084
|
+
s3 = peg$parseunquotedString();
|
|
1085
|
+
if (s3 === peg$FAILED) {
|
|
1086
|
+
if (input.charCodeAt(peg$currPos) === 60) {
|
|
1087
|
+
s3 = peg$c3;
|
|
1088
|
+
peg$currPos++;
|
|
1089
|
+
} else {
|
|
1090
|
+
s3 = peg$FAILED;
|
|
1091
|
+
if (peg$silentFails === 0) {
|
|
1092
|
+
peg$fail(peg$c4);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
} else {
|
|
1100
|
+
s2 = peg$FAILED;
|
|
1101
|
+
}
|
|
1102
|
+
if (s2 !== peg$FAILED) {
|
|
1103
|
+
peg$savedPos = s0;
|
|
1104
|
+
s1 = peg$c5(s2);
|
|
1105
|
+
s0 = s1;
|
|
1106
|
+
} else {
|
|
1107
|
+
peg$currPos = s0;
|
|
1108
|
+
s0 = peg$FAILED;
|
|
1109
|
+
}
|
|
1110
|
+
} else {
|
|
1111
|
+
peg$currPos = s0;
|
|
1112
|
+
s0 = peg$FAILED;
|
|
1113
|
+
}
|
|
1114
|
+
if (s0 === peg$FAILED) {
|
|
1115
|
+
s0 = peg$currPos;
|
|
1116
|
+
s1 = [];
|
|
1117
|
+
s2 = peg$parsedoubleApostrophes();
|
|
1118
|
+
if (s2 === peg$FAILED) {
|
|
1119
|
+
s2 = peg$parsequotedString();
|
|
1120
|
+
if (s2 === peg$FAILED) {
|
|
1121
|
+
s2 = peg$parseunquotedString();
|
|
1122
|
+
if (s2 === peg$FAILED) {
|
|
1123
|
+
s2 = peg$parsenonTagStartingAngleBracket();
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
if (s2 !== peg$FAILED) {
|
|
1128
|
+
while (s2 !== peg$FAILED) {
|
|
1129
|
+
s1.push(s2);
|
|
1130
|
+
s2 = peg$parsedoubleApostrophes();
|
|
1131
|
+
if (s2 === peg$FAILED) {
|
|
1132
|
+
s2 = peg$parsequotedString();
|
|
1133
|
+
if (s2 === peg$FAILED) {
|
|
1134
|
+
s2 = peg$parseunquotedString();
|
|
1135
|
+
if (s2 === peg$FAILED) {
|
|
1136
|
+
s2 = peg$parsenonTagStartingAngleBracket();
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
} else {
|
|
1142
|
+
s1 = peg$FAILED;
|
|
1143
|
+
}
|
|
1144
|
+
if (s1 !== peg$FAILED) {
|
|
1145
|
+
peg$savedPos = s0;
|
|
1146
|
+
s1 = peg$c5(s1);
|
|
1147
|
+
}
|
|
1148
|
+
s0 = s1;
|
|
1149
|
+
}
|
|
1150
|
+
return s0;
|
|
1151
|
+
}
|
|
1152
|
+
function peg$parsenonTagStartingAngleBracket() {
|
|
1153
|
+
var s0, s1, s2;
|
|
1154
|
+
s0 = peg$currPos;
|
|
1155
|
+
s1 = peg$currPos;
|
|
1156
|
+
peg$silentFails++;
|
|
1157
|
+
s2 = peg$parseopeningTag();
|
|
1158
|
+
if (s2 === peg$FAILED) {
|
|
1159
|
+
s2 = peg$parseclosingTag();
|
|
1160
|
+
if (s2 === peg$FAILED) {
|
|
1161
|
+
s2 = peg$parseselfClosingTag();
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
peg$silentFails--;
|
|
1165
|
+
if (s2 === peg$FAILED) {
|
|
1166
|
+
s1 = void 0;
|
|
1167
|
+
} else {
|
|
1168
|
+
peg$currPos = s1;
|
|
1169
|
+
s1 = peg$FAILED;
|
|
1170
|
+
}
|
|
1171
|
+
if (s1 !== peg$FAILED) {
|
|
1172
|
+
if (input.charCodeAt(peg$currPos) === 60) {
|
|
1173
|
+
s2 = peg$c3;
|
|
1174
|
+
peg$currPos++;
|
|
1175
|
+
} else {
|
|
1176
|
+
s2 = peg$FAILED;
|
|
1177
|
+
if (peg$silentFails === 0) {
|
|
1178
|
+
peg$fail(peg$c4);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (s2 !== peg$FAILED) {
|
|
1182
|
+
peg$savedPos = s0;
|
|
1183
|
+
s1 = peg$c6();
|
|
1184
|
+
s0 = s1;
|
|
1185
|
+
} else {
|
|
1186
|
+
peg$currPos = s0;
|
|
1187
|
+
s0 = peg$FAILED;
|
|
1188
|
+
}
|
|
1189
|
+
} else {
|
|
1190
|
+
peg$currPos = s0;
|
|
1191
|
+
s0 = peg$FAILED;
|
|
1192
|
+
}
|
|
1193
|
+
return s0;
|
|
1194
|
+
}
|
|
1195
|
+
function peg$parseliteralElement() {
|
|
1196
|
+
var s0, s1;
|
|
1197
|
+
s0 = peg$currPos;
|
|
1198
|
+
s1 = peg$parsemessageText();
|
|
1199
|
+
if (s1 !== peg$FAILED) {
|
|
1200
|
+
peg$savedPos = s0;
|
|
1201
|
+
s1 = peg$c7(s1);
|
|
1202
|
+
}
|
|
1203
|
+
s0 = s1;
|
|
1204
|
+
return s0;
|
|
1205
|
+
}
|
|
1206
|
+
function peg$parsepoundElement() {
|
|
1207
|
+
var s0, s1;
|
|
1208
|
+
s0 = peg$currPos;
|
|
1209
|
+
if (input.charCodeAt(peg$currPos) === 35) {
|
|
1210
|
+
s1 = peg$c8;
|
|
1211
|
+
peg$currPos++;
|
|
1212
|
+
} else {
|
|
1213
|
+
s1 = peg$FAILED;
|
|
1214
|
+
if (peg$silentFails === 0) {
|
|
1215
|
+
peg$fail(peg$c9);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
if (s1 !== peg$FAILED) {
|
|
1219
|
+
peg$savedPos = s0;
|
|
1220
|
+
s1 = peg$c10();
|
|
1221
|
+
}
|
|
1222
|
+
s0 = s1;
|
|
1223
|
+
return s0;
|
|
1224
|
+
}
|
|
1225
|
+
function peg$parsetagElement() {
|
|
1226
|
+
var s0, s1, s2, s3;
|
|
1227
|
+
peg$silentFails++;
|
|
1228
|
+
s0 = peg$parseselfClosingTag();
|
|
1229
|
+
if (s0 === peg$FAILED) {
|
|
1230
|
+
s0 = peg$currPos;
|
|
1231
|
+
s1 = peg$parseopeningTag();
|
|
1232
|
+
if (s1 !== peg$FAILED) {
|
|
1233
|
+
s2 = peg$parsemessage();
|
|
1234
|
+
if (s2 !== peg$FAILED) {
|
|
1235
|
+
s3 = peg$parseclosingTag();
|
|
1236
|
+
if (s3 !== peg$FAILED) {
|
|
1237
|
+
peg$savedPos = s0;
|
|
1238
|
+
s1 = peg$c12(s1, s2, s3);
|
|
1239
|
+
s0 = s1;
|
|
1240
|
+
} else {
|
|
1241
|
+
peg$currPos = s0;
|
|
1242
|
+
s0 = peg$FAILED;
|
|
1243
|
+
}
|
|
1244
|
+
} else {
|
|
1245
|
+
peg$currPos = s0;
|
|
1246
|
+
s0 = peg$FAILED;
|
|
1247
|
+
}
|
|
1248
|
+
} else {
|
|
1249
|
+
peg$currPos = s0;
|
|
1250
|
+
s0 = peg$FAILED;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
peg$silentFails--;
|
|
1254
|
+
if (s0 === peg$FAILED) {
|
|
1255
|
+
s1 = peg$FAILED;
|
|
1256
|
+
if (peg$silentFails === 0) {
|
|
1257
|
+
peg$fail(peg$c11);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
return s0;
|
|
1261
|
+
}
|
|
1262
|
+
function peg$parseselfClosingTag() {
|
|
1263
|
+
var s0, s1, s2, s3, s4, s5;
|
|
1264
|
+
s0 = peg$currPos;
|
|
1265
|
+
s1 = peg$currPos;
|
|
1266
|
+
if (input.charCodeAt(peg$currPos) === 60) {
|
|
1267
|
+
s2 = peg$c3;
|
|
1268
|
+
peg$currPos++;
|
|
1269
|
+
} else {
|
|
1270
|
+
s2 = peg$FAILED;
|
|
1271
|
+
if (peg$silentFails === 0) {
|
|
1272
|
+
peg$fail(peg$c4);
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
if (s2 !== peg$FAILED) {
|
|
1276
|
+
s3 = peg$parsevalidTag();
|
|
1277
|
+
if (s3 !== peg$FAILED) {
|
|
1278
|
+
s4 = peg$parse_();
|
|
1279
|
+
if (s4 !== peg$FAILED) {
|
|
1280
|
+
if (input.substr(peg$currPos, 2) === peg$c13) {
|
|
1281
|
+
s5 = peg$c13;
|
|
1282
|
+
peg$currPos += 2;
|
|
1283
|
+
} else {
|
|
1284
|
+
s5 = peg$FAILED;
|
|
1285
|
+
if (peg$silentFails === 0) {
|
|
1286
|
+
peg$fail(peg$c14);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (s5 !== peg$FAILED) {
|
|
1290
|
+
s2 = [s2, s3, s4, s5];
|
|
1291
|
+
s1 = s2;
|
|
1292
|
+
} else {
|
|
1293
|
+
peg$currPos = s1;
|
|
1294
|
+
s1 = peg$FAILED;
|
|
1295
|
+
}
|
|
1296
|
+
} else {
|
|
1297
|
+
peg$currPos = s1;
|
|
1298
|
+
s1 = peg$FAILED;
|
|
1299
|
+
}
|
|
1300
|
+
} else {
|
|
1301
|
+
peg$currPos = s1;
|
|
1302
|
+
s1 = peg$FAILED;
|
|
1303
|
+
}
|
|
1304
|
+
} else {
|
|
1305
|
+
peg$currPos = s1;
|
|
1306
|
+
s1 = peg$FAILED;
|
|
1307
|
+
}
|
|
1308
|
+
if (s1 !== peg$FAILED) {
|
|
1309
|
+
peg$savedPos = s0;
|
|
1310
|
+
s1 = peg$c15(s1);
|
|
1311
|
+
}
|
|
1312
|
+
s0 = s1;
|
|
1313
|
+
return s0;
|
|
1314
|
+
}
|
|
1315
|
+
function peg$parseopeningTag() {
|
|
1316
|
+
var s0, s1, s2, s3;
|
|
1317
|
+
s0 = peg$currPos;
|
|
1318
|
+
if (input.charCodeAt(peg$currPos) === 60) {
|
|
1319
|
+
s1 = peg$c3;
|
|
1320
|
+
peg$currPos++;
|
|
1321
|
+
} else {
|
|
1322
|
+
s1 = peg$FAILED;
|
|
1323
|
+
if (peg$silentFails === 0) {
|
|
1324
|
+
peg$fail(peg$c4);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
if (s1 !== peg$FAILED) {
|
|
1328
|
+
s2 = peg$parsevalidTag();
|
|
1329
|
+
if (s2 !== peg$FAILED) {
|
|
1330
|
+
if (input.charCodeAt(peg$currPos) === 62) {
|
|
1331
|
+
s3 = peg$c16;
|
|
1332
|
+
peg$currPos++;
|
|
1333
|
+
} else {
|
|
1334
|
+
s3 = peg$FAILED;
|
|
1335
|
+
if (peg$silentFails === 0) {
|
|
1336
|
+
peg$fail(peg$c17);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
if (s3 !== peg$FAILED) {
|
|
1340
|
+
peg$savedPos = s0;
|
|
1341
|
+
s1 = peg$c18(s2);
|
|
1342
|
+
s0 = s1;
|
|
1343
|
+
} else {
|
|
1344
|
+
peg$currPos = s0;
|
|
1345
|
+
s0 = peg$FAILED;
|
|
1346
|
+
}
|
|
1347
|
+
} else {
|
|
1348
|
+
peg$currPos = s0;
|
|
1349
|
+
s0 = peg$FAILED;
|
|
1350
|
+
}
|
|
1351
|
+
} else {
|
|
1352
|
+
peg$currPos = s0;
|
|
1353
|
+
s0 = peg$FAILED;
|
|
1354
|
+
}
|
|
1355
|
+
return s0;
|
|
1356
|
+
}
|
|
1357
|
+
function peg$parseclosingTag() {
|
|
1358
|
+
var s0, s1, s2, s3;
|
|
1359
|
+
s0 = peg$currPos;
|
|
1360
|
+
if (input.substr(peg$currPos, 2) === peg$c19) {
|
|
1361
|
+
s1 = peg$c19;
|
|
1362
|
+
peg$currPos += 2;
|
|
1363
|
+
} else {
|
|
1364
|
+
s1 = peg$FAILED;
|
|
1365
|
+
if (peg$silentFails === 0) {
|
|
1366
|
+
peg$fail(peg$c20);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
if (s1 !== peg$FAILED) {
|
|
1370
|
+
s2 = peg$parsevalidTag();
|
|
1371
|
+
if (s2 !== peg$FAILED) {
|
|
1372
|
+
if (input.charCodeAt(peg$currPos) === 62) {
|
|
1373
|
+
s3 = peg$c16;
|
|
1374
|
+
peg$currPos++;
|
|
1375
|
+
} else {
|
|
1376
|
+
s3 = peg$FAILED;
|
|
1377
|
+
if (peg$silentFails === 0) {
|
|
1378
|
+
peg$fail(peg$c17);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
if (s3 !== peg$FAILED) {
|
|
1382
|
+
peg$savedPos = s0;
|
|
1383
|
+
s1 = peg$c18(s2);
|
|
1384
|
+
s0 = s1;
|
|
1385
|
+
} else {
|
|
1386
|
+
peg$currPos = s0;
|
|
1387
|
+
s0 = peg$FAILED;
|
|
1388
|
+
}
|
|
1389
|
+
} else {
|
|
1390
|
+
peg$currPos = s0;
|
|
1391
|
+
s0 = peg$FAILED;
|
|
1392
|
+
}
|
|
1393
|
+
} else {
|
|
1394
|
+
peg$currPos = s0;
|
|
1395
|
+
s0 = peg$FAILED;
|
|
1396
|
+
}
|
|
1397
|
+
return s0;
|
|
1398
|
+
}
|
|
1399
|
+
function peg$parseargumentElement() {
|
|
1400
|
+
var s0, s1, s2, s3, s4, s5;
|
|
1401
|
+
peg$silentFails++;
|
|
1402
|
+
s0 = peg$currPos;
|
|
1403
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1404
|
+
s1 = peg$c22;
|
|
1405
|
+
peg$currPos++;
|
|
1406
|
+
} else {
|
|
1407
|
+
s1 = peg$FAILED;
|
|
1408
|
+
if (peg$silentFails === 0) {
|
|
1409
|
+
peg$fail(peg$c23);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
if (s1 !== peg$FAILED) {
|
|
1413
|
+
s2 = peg$parse_();
|
|
1414
|
+
if (s2 !== peg$FAILED) {
|
|
1415
|
+
s3 = peg$parseargNameOrNumber();
|
|
1416
|
+
if (s3 !== peg$FAILED) {
|
|
1417
|
+
s4 = peg$parse_();
|
|
1418
|
+
if (s4 !== peg$FAILED) {
|
|
1419
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1420
|
+
s5 = peg$c24;
|
|
1421
|
+
peg$currPos++;
|
|
1422
|
+
} else {
|
|
1423
|
+
s5 = peg$FAILED;
|
|
1424
|
+
if (peg$silentFails === 0) {
|
|
1425
|
+
peg$fail(peg$c25);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
if (s5 !== peg$FAILED) {
|
|
1429
|
+
peg$savedPos = s0;
|
|
1430
|
+
s1 = peg$c26(s3);
|
|
1431
|
+
s0 = s1;
|
|
1432
|
+
} else {
|
|
1433
|
+
peg$currPos = s0;
|
|
1434
|
+
s0 = peg$FAILED;
|
|
1435
|
+
}
|
|
1436
|
+
} else {
|
|
1437
|
+
peg$currPos = s0;
|
|
1438
|
+
s0 = peg$FAILED;
|
|
1439
|
+
}
|
|
1440
|
+
} else {
|
|
1441
|
+
peg$currPos = s0;
|
|
1442
|
+
s0 = peg$FAILED;
|
|
1443
|
+
}
|
|
1444
|
+
} else {
|
|
1445
|
+
peg$currPos = s0;
|
|
1446
|
+
s0 = peg$FAILED;
|
|
1447
|
+
}
|
|
1448
|
+
} else {
|
|
1449
|
+
peg$currPos = s0;
|
|
1450
|
+
s0 = peg$FAILED;
|
|
1451
|
+
}
|
|
1452
|
+
peg$silentFails--;
|
|
1453
|
+
if (s0 === peg$FAILED) {
|
|
1454
|
+
s1 = peg$FAILED;
|
|
1455
|
+
if (peg$silentFails === 0) {
|
|
1456
|
+
peg$fail(peg$c21);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
return s0;
|
|
1460
|
+
}
|
|
1461
|
+
function peg$parsenumberSkeletonId() {
|
|
1462
|
+
var s0, s1, s2, s3, s4;
|
|
1463
|
+
peg$silentFails++;
|
|
1464
|
+
s0 = peg$currPos;
|
|
1465
|
+
s1 = [];
|
|
1466
|
+
s2 = peg$currPos;
|
|
1467
|
+
s3 = peg$currPos;
|
|
1468
|
+
peg$silentFails++;
|
|
1469
|
+
s4 = peg$parsewhiteSpace();
|
|
1470
|
+
if (s4 === peg$FAILED) {
|
|
1471
|
+
if (peg$c28.test(input.charAt(peg$currPos))) {
|
|
1472
|
+
s4 = input.charAt(peg$currPos);
|
|
1473
|
+
peg$currPos++;
|
|
1474
|
+
} else {
|
|
1475
|
+
s4 = peg$FAILED;
|
|
1476
|
+
if (peg$silentFails === 0) {
|
|
1477
|
+
peg$fail(peg$c29);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
peg$silentFails--;
|
|
1482
|
+
if (s4 === peg$FAILED) {
|
|
1483
|
+
s3 = void 0;
|
|
1484
|
+
} else {
|
|
1485
|
+
peg$currPos = s3;
|
|
1486
|
+
s3 = peg$FAILED;
|
|
1487
|
+
}
|
|
1488
|
+
if (s3 !== peg$FAILED) {
|
|
1489
|
+
if (input.length > peg$currPos) {
|
|
1490
|
+
s4 = input.charAt(peg$currPos);
|
|
1491
|
+
peg$currPos++;
|
|
1492
|
+
} else {
|
|
1493
|
+
s4 = peg$FAILED;
|
|
1494
|
+
if (peg$silentFails === 0) {
|
|
1495
|
+
peg$fail(peg$c30);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
if (s4 !== peg$FAILED) {
|
|
1499
|
+
s3 = [s3, s4];
|
|
1500
|
+
s2 = s3;
|
|
1501
|
+
} else {
|
|
1502
|
+
peg$currPos = s2;
|
|
1503
|
+
s2 = peg$FAILED;
|
|
1504
|
+
}
|
|
1505
|
+
} else {
|
|
1506
|
+
peg$currPos = s2;
|
|
1507
|
+
s2 = peg$FAILED;
|
|
1508
|
+
}
|
|
1509
|
+
if (s2 !== peg$FAILED) {
|
|
1510
|
+
while (s2 !== peg$FAILED) {
|
|
1511
|
+
s1.push(s2);
|
|
1512
|
+
s2 = peg$currPos;
|
|
1513
|
+
s3 = peg$currPos;
|
|
1514
|
+
peg$silentFails++;
|
|
1515
|
+
s4 = peg$parsewhiteSpace();
|
|
1516
|
+
if (s4 === peg$FAILED) {
|
|
1517
|
+
if (peg$c28.test(input.charAt(peg$currPos))) {
|
|
1518
|
+
s4 = input.charAt(peg$currPos);
|
|
1519
|
+
peg$currPos++;
|
|
1520
|
+
} else {
|
|
1521
|
+
s4 = peg$FAILED;
|
|
1522
|
+
if (peg$silentFails === 0) {
|
|
1523
|
+
peg$fail(peg$c29);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
peg$silentFails--;
|
|
1528
|
+
if (s4 === peg$FAILED) {
|
|
1529
|
+
s3 = void 0;
|
|
1530
|
+
} else {
|
|
1531
|
+
peg$currPos = s3;
|
|
1532
|
+
s3 = peg$FAILED;
|
|
1533
|
+
}
|
|
1534
|
+
if (s3 !== peg$FAILED) {
|
|
1535
|
+
if (input.length > peg$currPos) {
|
|
1536
|
+
s4 = input.charAt(peg$currPos);
|
|
1537
|
+
peg$currPos++;
|
|
1538
|
+
} else {
|
|
1539
|
+
s4 = peg$FAILED;
|
|
1540
|
+
if (peg$silentFails === 0) {
|
|
1541
|
+
peg$fail(peg$c30);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
if (s4 !== peg$FAILED) {
|
|
1545
|
+
s3 = [s3, s4];
|
|
1546
|
+
s2 = s3;
|
|
1547
|
+
} else {
|
|
1548
|
+
peg$currPos = s2;
|
|
1549
|
+
s2 = peg$FAILED;
|
|
1550
|
+
}
|
|
1551
|
+
} else {
|
|
1552
|
+
peg$currPos = s2;
|
|
1553
|
+
s2 = peg$FAILED;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
} else {
|
|
1557
|
+
s1 = peg$FAILED;
|
|
1558
|
+
}
|
|
1559
|
+
if (s1 !== peg$FAILED) {
|
|
1560
|
+
s0 = input.substring(s0, peg$currPos);
|
|
1561
|
+
} else {
|
|
1562
|
+
s0 = s1;
|
|
1563
|
+
}
|
|
1564
|
+
peg$silentFails--;
|
|
1565
|
+
if (s0 === peg$FAILED) {
|
|
1566
|
+
s1 = peg$FAILED;
|
|
1567
|
+
if (peg$silentFails === 0) {
|
|
1568
|
+
peg$fail(peg$c27);
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
return s0;
|
|
1572
|
+
}
|
|
1573
|
+
function peg$parsenumberSkeletonTokenOption() {
|
|
1574
|
+
var s0, s1, s2;
|
|
1575
|
+
peg$silentFails++;
|
|
1576
|
+
s0 = peg$currPos;
|
|
1577
|
+
if (input.charCodeAt(peg$currPos) === 47) {
|
|
1578
|
+
s1 = peg$c32;
|
|
1579
|
+
peg$currPos++;
|
|
1580
|
+
} else {
|
|
1581
|
+
s1 = peg$FAILED;
|
|
1582
|
+
if (peg$silentFails === 0) {
|
|
1583
|
+
peg$fail(peg$c33);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
if (s1 !== peg$FAILED) {
|
|
1587
|
+
s2 = peg$parsenumberSkeletonId();
|
|
1588
|
+
if (s2 !== peg$FAILED) {
|
|
1589
|
+
peg$savedPos = s0;
|
|
1590
|
+
s1 = peg$c34(s2);
|
|
1591
|
+
s0 = s1;
|
|
1592
|
+
} else {
|
|
1593
|
+
peg$currPos = s0;
|
|
1594
|
+
s0 = peg$FAILED;
|
|
1595
|
+
}
|
|
1596
|
+
} else {
|
|
1597
|
+
peg$currPos = s0;
|
|
1598
|
+
s0 = peg$FAILED;
|
|
1599
|
+
}
|
|
1600
|
+
peg$silentFails--;
|
|
1601
|
+
if (s0 === peg$FAILED) {
|
|
1602
|
+
s1 = peg$FAILED;
|
|
1603
|
+
if (peg$silentFails === 0) {
|
|
1604
|
+
peg$fail(peg$c31);
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
return s0;
|
|
1608
|
+
}
|
|
1609
|
+
function peg$parsenumberSkeletonToken() {
|
|
1610
|
+
var s0, s1, s2, s3, s4;
|
|
1611
|
+
peg$silentFails++;
|
|
1612
|
+
s0 = peg$currPos;
|
|
1613
|
+
s1 = peg$parse_();
|
|
1614
|
+
if (s1 !== peg$FAILED) {
|
|
1615
|
+
s2 = peg$parsenumberSkeletonId();
|
|
1616
|
+
if (s2 !== peg$FAILED) {
|
|
1617
|
+
s3 = [];
|
|
1618
|
+
s4 = peg$parsenumberSkeletonTokenOption();
|
|
1619
|
+
while (s4 !== peg$FAILED) {
|
|
1620
|
+
s3.push(s4);
|
|
1621
|
+
s4 = peg$parsenumberSkeletonTokenOption();
|
|
1622
|
+
}
|
|
1623
|
+
if (s3 !== peg$FAILED) {
|
|
1624
|
+
peg$savedPos = s0;
|
|
1625
|
+
s1 = peg$c36(s2, s3);
|
|
1626
|
+
s0 = s1;
|
|
1627
|
+
} else {
|
|
1628
|
+
peg$currPos = s0;
|
|
1629
|
+
s0 = peg$FAILED;
|
|
1630
|
+
}
|
|
1631
|
+
} else {
|
|
1632
|
+
peg$currPos = s0;
|
|
1633
|
+
s0 = peg$FAILED;
|
|
1634
|
+
}
|
|
1635
|
+
} else {
|
|
1636
|
+
peg$currPos = s0;
|
|
1637
|
+
s0 = peg$FAILED;
|
|
1638
|
+
}
|
|
1639
|
+
peg$silentFails--;
|
|
1640
|
+
if (s0 === peg$FAILED) {
|
|
1641
|
+
s1 = peg$FAILED;
|
|
1642
|
+
if (peg$silentFails === 0) {
|
|
1643
|
+
peg$fail(peg$c35);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
return s0;
|
|
1647
|
+
}
|
|
1648
|
+
function peg$parsenumberSkeleton() {
|
|
1649
|
+
var s0, s1, s2;
|
|
1650
|
+
s0 = peg$currPos;
|
|
1651
|
+
s1 = [];
|
|
1652
|
+
s2 = peg$parsenumberSkeletonToken();
|
|
1653
|
+
if (s2 !== peg$FAILED) {
|
|
1654
|
+
while (s2 !== peg$FAILED) {
|
|
1655
|
+
s1.push(s2);
|
|
1656
|
+
s2 = peg$parsenumberSkeletonToken();
|
|
1657
|
+
}
|
|
1658
|
+
} else {
|
|
1659
|
+
s1 = peg$FAILED;
|
|
1660
|
+
}
|
|
1661
|
+
if (s1 !== peg$FAILED) {
|
|
1662
|
+
peg$savedPos = s0;
|
|
1663
|
+
s1 = peg$c37(s1);
|
|
1664
|
+
}
|
|
1665
|
+
s0 = s1;
|
|
1666
|
+
return s0;
|
|
1667
|
+
}
|
|
1668
|
+
function peg$parsenumberArgStyle() {
|
|
1669
|
+
var s0, s1, s2;
|
|
1670
|
+
s0 = peg$currPos;
|
|
1671
|
+
if (input.substr(peg$currPos, 2) === peg$c38) {
|
|
1672
|
+
s1 = peg$c38;
|
|
1673
|
+
peg$currPos += 2;
|
|
1674
|
+
} else {
|
|
1675
|
+
s1 = peg$FAILED;
|
|
1676
|
+
if (peg$silentFails === 0) {
|
|
1677
|
+
peg$fail(peg$c39);
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
if (s1 !== peg$FAILED) {
|
|
1681
|
+
s2 = peg$parsenumberSkeleton();
|
|
1682
|
+
if (s2 !== peg$FAILED) {
|
|
1683
|
+
peg$savedPos = s0;
|
|
1684
|
+
s1 = peg$c40(s2);
|
|
1685
|
+
s0 = s1;
|
|
1686
|
+
} else {
|
|
1687
|
+
peg$currPos = s0;
|
|
1688
|
+
s0 = peg$FAILED;
|
|
1689
|
+
}
|
|
1690
|
+
} else {
|
|
1691
|
+
peg$currPos = s0;
|
|
1692
|
+
s0 = peg$FAILED;
|
|
1693
|
+
}
|
|
1694
|
+
if (s0 === peg$FAILED) {
|
|
1695
|
+
s0 = peg$currPos;
|
|
1696
|
+
peg$savedPos = peg$currPos;
|
|
1697
|
+
s1 = peg$c41();
|
|
1698
|
+
if (s1) {
|
|
1699
|
+
s1 = void 0;
|
|
1700
|
+
} else {
|
|
1701
|
+
s1 = peg$FAILED;
|
|
1702
|
+
}
|
|
1703
|
+
if (s1 !== peg$FAILED) {
|
|
1704
|
+
s2 = peg$parsemessageText();
|
|
1705
|
+
if (s2 !== peg$FAILED) {
|
|
1706
|
+
peg$savedPos = s0;
|
|
1707
|
+
s1 = peg$c42(s2);
|
|
1708
|
+
s0 = s1;
|
|
1709
|
+
} else {
|
|
1710
|
+
peg$currPos = s0;
|
|
1711
|
+
s0 = peg$FAILED;
|
|
1712
|
+
}
|
|
1713
|
+
} else {
|
|
1714
|
+
peg$currPos = s0;
|
|
1715
|
+
s0 = peg$FAILED;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return s0;
|
|
1719
|
+
}
|
|
1720
|
+
function peg$parsenumberFormatElement() {
|
|
1721
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
|
|
1722
|
+
s0 = peg$currPos;
|
|
1723
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1724
|
+
s1 = peg$c22;
|
|
1725
|
+
peg$currPos++;
|
|
1726
|
+
} else {
|
|
1727
|
+
s1 = peg$FAILED;
|
|
1728
|
+
if (peg$silentFails === 0) {
|
|
1729
|
+
peg$fail(peg$c23);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
if (s1 !== peg$FAILED) {
|
|
1733
|
+
s2 = peg$parse_();
|
|
1734
|
+
if (s2 !== peg$FAILED) {
|
|
1735
|
+
s3 = peg$parseargNameOrNumber();
|
|
1736
|
+
if (s3 !== peg$FAILED) {
|
|
1737
|
+
s4 = peg$parse_();
|
|
1738
|
+
if (s4 !== peg$FAILED) {
|
|
1739
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1740
|
+
s5 = peg$c43;
|
|
1741
|
+
peg$currPos++;
|
|
1742
|
+
} else {
|
|
1743
|
+
s5 = peg$FAILED;
|
|
1744
|
+
if (peg$silentFails === 0) {
|
|
1745
|
+
peg$fail(peg$c44);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
if (s5 !== peg$FAILED) {
|
|
1749
|
+
s6 = peg$parse_();
|
|
1750
|
+
if (s6 !== peg$FAILED) {
|
|
1751
|
+
if (input.substr(peg$currPos, 6) === peg$c45) {
|
|
1752
|
+
s7 = peg$c45;
|
|
1753
|
+
peg$currPos += 6;
|
|
1754
|
+
} else {
|
|
1755
|
+
s7 = peg$FAILED;
|
|
1756
|
+
if (peg$silentFails === 0) {
|
|
1757
|
+
peg$fail(peg$c46);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
if (s7 !== peg$FAILED) {
|
|
1761
|
+
s8 = peg$parse_();
|
|
1762
|
+
if (s8 !== peg$FAILED) {
|
|
1763
|
+
s9 = peg$currPos;
|
|
1764
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1765
|
+
s10 = peg$c43;
|
|
1766
|
+
peg$currPos++;
|
|
1767
|
+
} else {
|
|
1768
|
+
s10 = peg$FAILED;
|
|
1769
|
+
if (peg$silentFails === 0) {
|
|
1770
|
+
peg$fail(peg$c44);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
if (s10 !== peg$FAILED) {
|
|
1774
|
+
s11 = peg$parse_();
|
|
1775
|
+
if (s11 !== peg$FAILED) {
|
|
1776
|
+
s12 = peg$parsenumberArgStyle();
|
|
1777
|
+
if (s12 !== peg$FAILED) {
|
|
1778
|
+
s10 = [s10, s11, s12];
|
|
1779
|
+
s9 = s10;
|
|
1780
|
+
} else {
|
|
1781
|
+
peg$currPos = s9;
|
|
1782
|
+
s9 = peg$FAILED;
|
|
1783
|
+
}
|
|
1784
|
+
} else {
|
|
1785
|
+
peg$currPos = s9;
|
|
1786
|
+
s9 = peg$FAILED;
|
|
1787
|
+
}
|
|
1788
|
+
} else {
|
|
1789
|
+
peg$currPos = s9;
|
|
1790
|
+
s9 = peg$FAILED;
|
|
1791
|
+
}
|
|
1792
|
+
if (s9 === peg$FAILED) {
|
|
1793
|
+
s9 = null;
|
|
1794
|
+
}
|
|
1795
|
+
if (s9 !== peg$FAILED) {
|
|
1796
|
+
s10 = peg$parse_();
|
|
1797
|
+
if (s10 !== peg$FAILED) {
|
|
1798
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1799
|
+
s11 = peg$c24;
|
|
1800
|
+
peg$currPos++;
|
|
1801
|
+
} else {
|
|
1802
|
+
s11 = peg$FAILED;
|
|
1803
|
+
if (peg$silentFails === 0) {
|
|
1804
|
+
peg$fail(peg$c25);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
if (s11 !== peg$FAILED) {
|
|
1808
|
+
peg$savedPos = s0;
|
|
1809
|
+
s1 = peg$c47(s3, s7, s9);
|
|
1810
|
+
s0 = s1;
|
|
1811
|
+
} else {
|
|
1812
|
+
peg$currPos = s0;
|
|
1813
|
+
s0 = peg$FAILED;
|
|
1814
|
+
}
|
|
1815
|
+
} else {
|
|
1816
|
+
peg$currPos = s0;
|
|
1817
|
+
s0 = peg$FAILED;
|
|
1818
|
+
}
|
|
1819
|
+
} else {
|
|
1820
|
+
peg$currPos = s0;
|
|
1821
|
+
s0 = peg$FAILED;
|
|
1822
|
+
}
|
|
1823
|
+
} else {
|
|
1824
|
+
peg$currPos = s0;
|
|
1825
|
+
s0 = peg$FAILED;
|
|
1826
|
+
}
|
|
1827
|
+
} else {
|
|
1828
|
+
peg$currPos = s0;
|
|
1829
|
+
s0 = peg$FAILED;
|
|
1830
|
+
}
|
|
1831
|
+
} else {
|
|
1832
|
+
peg$currPos = s0;
|
|
1833
|
+
s0 = peg$FAILED;
|
|
1834
|
+
}
|
|
1835
|
+
} else {
|
|
1836
|
+
peg$currPos = s0;
|
|
1837
|
+
s0 = peg$FAILED;
|
|
1838
|
+
}
|
|
1839
|
+
} else {
|
|
1840
|
+
peg$currPos = s0;
|
|
1841
|
+
s0 = peg$FAILED;
|
|
1842
|
+
}
|
|
1843
|
+
} else {
|
|
1844
|
+
peg$currPos = s0;
|
|
1845
|
+
s0 = peg$FAILED;
|
|
1846
|
+
}
|
|
1847
|
+
} else {
|
|
1848
|
+
peg$currPos = s0;
|
|
1849
|
+
s0 = peg$FAILED;
|
|
1850
|
+
}
|
|
1851
|
+
} else {
|
|
1852
|
+
peg$currPos = s0;
|
|
1853
|
+
s0 = peg$FAILED;
|
|
1854
|
+
}
|
|
1855
|
+
return s0;
|
|
1856
|
+
}
|
|
1857
|
+
function peg$parsedateTimeSkeletonLiteral() {
|
|
1858
|
+
var s0, s1, s2, s3;
|
|
1859
|
+
s0 = peg$currPos;
|
|
1860
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
1861
|
+
s1 = peg$c48;
|
|
1862
|
+
peg$currPos++;
|
|
1863
|
+
} else {
|
|
1864
|
+
s1 = peg$FAILED;
|
|
1865
|
+
if (peg$silentFails === 0) {
|
|
1866
|
+
peg$fail(peg$c49);
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
if (s1 !== peg$FAILED) {
|
|
1870
|
+
s2 = [];
|
|
1871
|
+
s3 = peg$parsedoubleApostrophes();
|
|
1872
|
+
if (s3 === peg$FAILED) {
|
|
1873
|
+
if (peg$c50.test(input.charAt(peg$currPos))) {
|
|
1874
|
+
s3 = input.charAt(peg$currPos);
|
|
1875
|
+
peg$currPos++;
|
|
1876
|
+
} else {
|
|
1877
|
+
s3 = peg$FAILED;
|
|
1878
|
+
if (peg$silentFails === 0) {
|
|
1879
|
+
peg$fail(peg$c51);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
if (s3 !== peg$FAILED) {
|
|
1884
|
+
while (s3 !== peg$FAILED) {
|
|
1885
|
+
s2.push(s3);
|
|
1886
|
+
s3 = peg$parsedoubleApostrophes();
|
|
1887
|
+
if (s3 === peg$FAILED) {
|
|
1888
|
+
if (peg$c50.test(input.charAt(peg$currPos))) {
|
|
1889
|
+
s3 = input.charAt(peg$currPos);
|
|
1890
|
+
peg$currPos++;
|
|
1891
|
+
} else {
|
|
1892
|
+
s3 = peg$FAILED;
|
|
1893
|
+
if (peg$silentFails === 0) {
|
|
1894
|
+
peg$fail(peg$c51);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
} else {
|
|
1900
|
+
s2 = peg$FAILED;
|
|
1901
|
+
}
|
|
1902
|
+
if (s2 !== peg$FAILED) {
|
|
1903
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
1904
|
+
s3 = peg$c48;
|
|
1905
|
+
peg$currPos++;
|
|
1906
|
+
} else {
|
|
1907
|
+
s3 = peg$FAILED;
|
|
1908
|
+
if (peg$silentFails === 0) {
|
|
1909
|
+
peg$fail(peg$c49);
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
if (s3 !== peg$FAILED) {
|
|
1913
|
+
s1 = [s1, s2, s3];
|
|
1914
|
+
s0 = s1;
|
|
1915
|
+
} else {
|
|
1916
|
+
peg$currPos = s0;
|
|
1917
|
+
s0 = peg$FAILED;
|
|
1918
|
+
}
|
|
1919
|
+
} else {
|
|
1920
|
+
peg$currPos = s0;
|
|
1921
|
+
s0 = peg$FAILED;
|
|
1922
|
+
}
|
|
1923
|
+
} else {
|
|
1924
|
+
peg$currPos = s0;
|
|
1925
|
+
s0 = peg$FAILED;
|
|
1926
|
+
}
|
|
1927
|
+
if (s0 === peg$FAILED) {
|
|
1928
|
+
s0 = [];
|
|
1929
|
+
s1 = peg$parsedoubleApostrophes();
|
|
1930
|
+
if (s1 === peg$FAILED) {
|
|
1931
|
+
if (peg$c52.test(input.charAt(peg$currPos))) {
|
|
1932
|
+
s1 = input.charAt(peg$currPos);
|
|
1933
|
+
peg$currPos++;
|
|
1934
|
+
} else {
|
|
1935
|
+
s1 = peg$FAILED;
|
|
1936
|
+
if (peg$silentFails === 0) {
|
|
1937
|
+
peg$fail(peg$c53);
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
if (s1 !== peg$FAILED) {
|
|
1942
|
+
while (s1 !== peg$FAILED) {
|
|
1943
|
+
s0.push(s1);
|
|
1944
|
+
s1 = peg$parsedoubleApostrophes();
|
|
1945
|
+
if (s1 === peg$FAILED) {
|
|
1946
|
+
if (peg$c52.test(input.charAt(peg$currPos))) {
|
|
1947
|
+
s1 = input.charAt(peg$currPos);
|
|
1948
|
+
peg$currPos++;
|
|
1949
|
+
} else {
|
|
1950
|
+
s1 = peg$FAILED;
|
|
1951
|
+
if (peg$silentFails === 0) {
|
|
1952
|
+
peg$fail(peg$c53);
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
} else {
|
|
1958
|
+
s0 = peg$FAILED;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
return s0;
|
|
1962
|
+
}
|
|
1963
|
+
function peg$parsedateTimeSkeletonPattern() {
|
|
1964
|
+
var s0, s1;
|
|
1965
|
+
s0 = [];
|
|
1966
|
+
if (peg$c54.test(input.charAt(peg$currPos))) {
|
|
1967
|
+
s1 = input.charAt(peg$currPos);
|
|
1968
|
+
peg$currPos++;
|
|
1969
|
+
} else {
|
|
1970
|
+
s1 = peg$FAILED;
|
|
1971
|
+
if (peg$silentFails === 0) {
|
|
1972
|
+
peg$fail(peg$c55);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
if (s1 !== peg$FAILED) {
|
|
1976
|
+
while (s1 !== peg$FAILED) {
|
|
1977
|
+
s0.push(s1);
|
|
1978
|
+
if (peg$c54.test(input.charAt(peg$currPos))) {
|
|
1979
|
+
s1 = input.charAt(peg$currPos);
|
|
1980
|
+
peg$currPos++;
|
|
1981
|
+
} else {
|
|
1982
|
+
s1 = peg$FAILED;
|
|
1983
|
+
if (peg$silentFails === 0) {
|
|
1984
|
+
peg$fail(peg$c55);
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
} else {
|
|
1989
|
+
s0 = peg$FAILED;
|
|
1990
|
+
}
|
|
1991
|
+
return s0;
|
|
1992
|
+
}
|
|
1993
|
+
function peg$parsedateTimeSkeleton() {
|
|
1994
|
+
var s0, s1, s2, s3;
|
|
1995
|
+
s0 = peg$currPos;
|
|
1996
|
+
s1 = peg$currPos;
|
|
1997
|
+
s2 = [];
|
|
1998
|
+
s3 = peg$parsedateTimeSkeletonLiteral();
|
|
1999
|
+
if (s3 === peg$FAILED) {
|
|
2000
|
+
s3 = peg$parsedateTimeSkeletonPattern();
|
|
2001
|
+
}
|
|
2002
|
+
if (s3 !== peg$FAILED) {
|
|
2003
|
+
while (s3 !== peg$FAILED) {
|
|
2004
|
+
s2.push(s3);
|
|
2005
|
+
s3 = peg$parsedateTimeSkeletonLiteral();
|
|
2006
|
+
if (s3 === peg$FAILED) {
|
|
2007
|
+
s3 = peg$parsedateTimeSkeletonPattern();
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
} else {
|
|
2011
|
+
s2 = peg$FAILED;
|
|
2012
|
+
}
|
|
2013
|
+
if (s2 !== peg$FAILED) {
|
|
2014
|
+
s1 = input.substring(s1, peg$currPos);
|
|
2015
|
+
} else {
|
|
2016
|
+
s1 = s2;
|
|
2017
|
+
}
|
|
2018
|
+
if (s1 !== peg$FAILED) {
|
|
2019
|
+
peg$savedPos = s0;
|
|
2020
|
+
s1 = peg$c56(s1);
|
|
2021
|
+
}
|
|
2022
|
+
s0 = s1;
|
|
2023
|
+
return s0;
|
|
2024
|
+
}
|
|
2025
|
+
function peg$parsedateOrTimeArgStyle() {
|
|
2026
|
+
var s0, s1, s2;
|
|
2027
|
+
s0 = peg$currPos;
|
|
2028
|
+
if (input.substr(peg$currPos, 2) === peg$c38) {
|
|
2029
|
+
s1 = peg$c38;
|
|
2030
|
+
peg$currPos += 2;
|
|
2031
|
+
} else {
|
|
2032
|
+
s1 = peg$FAILED;
|
|
2033
|
+
if (peg$silentFails === 0) {
|
|
2034
|
+
peg$fail(peg$c39);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
if (s1 !== peg$FAILED) {
|
|
2038
|
+
s2 = peg$parsedateTimeSkeleton();
|
|
2039
|
+
if (s2 !== peg$FAILED) {
|
|
2040
|
+
peg$savedPos = s0;
|
|
2041
|
+
s1 = peg$c40(s2);
|
|
2042
|
+
s0 = s1;
|
|
2043
|
+
} else {
|
|
2044
|
+
peg$currPos = s0;
|
|
2045
|
+
s0 = peg$FAILED;
|
|
2046
|
+
}
|
|
2047
|
+
} else {
|
|
2048
|
+
peg$currPos = s0;
|
|
2049
|
+
s0 = peg$FAILED;
|
|
2050
|
+
}
|
|
2051
|
+
if (s0 === peg$FAILED) {
|
|
2052
|
+
s0 = peg$currPos;
|
|
2053
|
+
peg$savedPos = peg$currPos;
|
|
2054
|
+
s1 = peg$c57();
|
|
2055
|
+
if (s1) {
|
|
2056
|
+
s1 = void 0;
|
|
2057
|
+
} else {
|
|
2058
|
+
s1 = peg$FAILED;
|
|
2059
|
+
}
|
|
2060
|
+
if (s1 !== peg$FAILED) {
|
|
2061
|
+
s2 = peg$parsemessageText();
|
|
2062
|
+
if (s2 !== peg$FAILED) {
|
|
2063
|
+
peg$savedPos = s0;
|
|
2064
|
+
s1 = peg$c42(s2);
|
|
2065
|
+
s0 = s1;
|
|
2066
|
+
} else {
|
|
2067
|
+
peg$currPos = s0;
|
|
2068
|
+
s0 = peg$FAILED;
|
|
2069
|
+
}
|
|
2070
|
+
} else {
|
|
2071
|
+
peg$currPos = s0;
|
|
2072
|
+
s0 = peg$FAILED;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
return s0;
|
|
2076
|
+
}
|
|
2077
|
+
function peg$parsedateOrTimeFormatElement() {
|
|
2078
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
|
|
2079
|
+
s0 = peg$currPos;
|
|
2080
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2081
|
+
s1 = peg$c22;
|
|
2082
|
+
peg$currPos++;
|
|
2083
|
+
} else {
|
|
2084
|
+
s1 = peg$FAILED;
|
|
2085
|
+
if (peg$silentFails === 0) {
|
|
2086
|
+
peg$fail(peg$c23);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
if (s1 !== peg$FAILED) {
|
|
2090
|
+
s2 = peg$parse_();
|
|
2091
|
+
if (s2 !== peg$FAILED) {
|
|
2092
|
+
s3 = peg$parseargNameOrNumber();
|
|
2093
|
+
if (s3 !== peg$FAILED) {
|
|
2094
|
+
s4 = peg$parse_();
|
|
2095
|
+
if (s4 !== peg$FAILED) {
|
|
2096
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2097
|
+
s5 = peg$c43;
|
|
2098
|
+
peg$currPos++;
|
|
2099
|
+
} else {
|
|
2100
|
+
s5 = peg$FAILED;
|
|
2101
|
+
if (peg$silentFails === 0) {
|
|
2102
|
+
peg$fail(peg$c44);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
if (s5 !== peg$FAILED) {
|
|
2106
|
+
s6 = peg$parse_();
|
|
2107
|
+
if (s6 !== peg$FAILED) {
|
|
2108
|
+
if (input.substr(peg$currPos, 4) === peg$c58) {
|
|
2109
|
+
s7 = peg$c58;
|
|
2110
|
+
peg$currPos += 4;
|
|
2111
|
+
} else {
|
|
2112
|
+
s7 = peg$FAILED;
|
|
2113
|
+
if (peg$silentFails === 0) {
|
|
2114
|
+
peg$fail(peg$c59);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
if (s7 === peg$FAILED) {
|
|
2118
|
+
if (input.substr(peg$currPos, 4) === peg$c60) {
|
|
2119
|
+
s7 = peg$c60;
|
|
2120
|
+
peg$currPos += 4;
|
|
2121
|
+
} else {
|
|
2122
|
+
s7 = peg$FAILED;
|
|
2123
|
+
if (peg$silentFails === 0) {
|
|
2124
|
+
peg$fail(peg$c61);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
if (s7 !== peg$FAILED) {
|
|
2129
|
+
s8 = peg$parse_();
|
|
2130
|
+
if (s8 !== peg$FAILED) {
|
|
2131
|
+
s9 = peg$currPos;
|
|
2132
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2133
|
+
s10 = peg$c43;
|
|
2134
|
+
peg$currPos++;
|
|
2135
|
+
} else {
|
|
2136
|
+
s10 = peg$FAILED;
|
|
2137
|
+
if (peg$silentFails === 0) {
|
|
2138
|
+
peg$fail(peg$c44);
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
if (s10 !== peg$FAILED) {
|
|
2142
|
+
s11 = peg$parse_();
|
|
2143
|
+
if (s11 !== peg$FAILED) {
|
|
2144
|
+
s12 = peg$parsedateOrTimeArgStyle();
|
|
2145
|
+
if (s12 !== peg$FAILED) {
|
|
2146
|
+
s10 = [s10, s11, s12];
|
|
2147
|
+
s9 = s10;
|
|
2148
|
+
} else {
|
|
2149
|
+
peg$currPos = s9;
|
|
2150
|
+
s9 = peg$FAILED;
|
|
2151
|
+
}
|
|
2152
|
+
} else {
|
|
2153
|
+
peg$currPos = s9;
|
|
2154
|
+
s9 = peg$FAILED;
|
|
2155
|
+
}
|
|
2156
|
+
} else {
|
|
2157
|
+
peg$currPos = s9;
|
|
2158
|
+
s9 = peg$FAILED;
|
|
2159
|
+
}
|
|
2160
|
+
if (s9 === peg$FAILED) {
|
|
2161
|
+
s9 = null;
|
|
2162
|
+
}
|
|
2163
|
+
if (s9 !== peg$FAILED) {
|
|
2164
|
+
s10 = peg$parse_();
|
|
2165
|
+
if (s10 !== peg$FAILED) {
|
|
2166
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2167
|
+
s11 = peg$c24;
|
|
2168
|
+
peg$currPos++;
|
|
2169
|
+
} else {
|
|
2170
|
+
s11 = peg$FAILED;
|
|
2171
|
+
if (peg$silentFails === 0) {
|
|
2172
|
+
peg$fail(peg$c25);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
if (s11 !== peg$FAILED) {
|
|
2176
|
+
peg$savedPos = s0;
|
|
2177
|
+
s1 = peg$c47(s3, s7, s9);
|
|
2178
|
+
s0 = s1;
|
|
2179
|
+
} else {
|
|
2180
|
+
peg$currPos = s0;
|
|
2181
|
+
s0 = peg$FAILED;
|
|
2182
|
+
}
|
|
2183
|
+
} else {
|
|
2184
|
+
peg$currPos = s0;
|
|
2185
|
+
s0 = peg$FAILED;
|
|
2186
|
+
}
|
|
2187
|
+
} else {
|
|
2188
|
+
peg$currPos = s0;
|
|
2189
|
+
s0 = peg$FAILED;
|
|
2190
|
+
}
|
|
2191
|
+
} else {
|
|
2192
|
+
peg$currPos = s0;
|
|
2193
|
+
s0 = peg$FAILED;
|
|
2194
|
+
}
|
|
2195
|
+
} else {
|
|
2196
|
+
peg$currPos = s0;
|
|
2197
|
+
s0 = peg$FAILED;
|
|
2198
|
+
}
|
|
2199
|
+
} else {
|
|
2200
|
+
peg$currPos = s0;
|
|
2201
|
+
s0 = peg$FAILED;
|
|
2202
|
+
}
|
|
2203
|
+
} else {
|
|
2204
|
+
peg$currPos = s0;
|
|
2205
|
+
s0 = peg$FAILED;
|
|
2206
|
+
}
|
|
2207
|
+
} else {
|
|
2208
|
+
peg$currPos = s0;
|
|
2209
|
+
s0 = peg$FAILED;
|
|
2210
|
+
}
|
|
2211
|
+
} else {
|
|
2212
|
+
peg$currPos = s0;
|
|
2213
|
+
s0 = peg$FAILED;
|
|
2214
|
+
}
|
|
2215
|
+
} else {
|
|
2216
|
+
peg$currPos = s0;
|
|
2217
|
+
s0 = peg$FAILED;
|
|
2218
|
+
}
|
|
2219
|
+
} else {
|
|
2220
|
+
peg$currPos = s0;
|
|
2221
|
+
s0 = peg$FAILED;
|
|
2222
|
+
}
|
|
2223
|
+
return s0;
|
|
2224
|
+
}
|
|
2225
|
+
function peg$parsesimpleFormatElement() {
|
|
2226
|
+
var s0;
|
|
2227
|
+
s0 = peg$parsenumberFormatElement();
|
|
2228
|
+
if (s0 === peg$FAILED) {
|
|
2229
|
+
s0 = peg$parsedateOrTimeFormatElement();
|
|
2230
|
+
}
|
|
2231
|
+
return s0;
|
|
2232
|
+
}
|
|
2233
|
+
function peg$parsepluralElement() {
|
|
2234
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
|
|
2235
|
+
s0 = peg$currPos;
|
|
2236
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2237
|
+
s1 = peg$c22;
|
|
2238
|
+
peg$currPos++;
|
|
2239
|
+
} else {
|
|
2240
|
+
s1 = peg$FAILED;
|
|
2241
|
+
if (peg$silentFails === 0) {
|
|
2242
|
+
peg$fail(peg$c23);
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
if (s1 !== peg$FAILED) {
|
|
2246
|
+
s2 = peg$parse_();
|
|
2247
|
+
if (s2 !== peg$FAILED) {
|
|
2248
|
+
s3 = peg$parseargNameOrNumber();
|
|
2249
|
+
if (s3 !== peg$FAILED) {
|
|
2250
|
+
s4 = peg$parse_();
|
|
2251
|
+
if (s4 !== peg$FAILED) {
|
|
2252
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2253
|
+
s5 = peg$c43;
|
|
2254
|
+
peg$currPos++;
|
|
2255
|
+
} else {
|
|
2256
|
+
s5 = peg$FAILED;
|
|
2257
|
+
if (peg$silentFails === 0) {
|
|
2258
|
+
peg$fail(peg$c44);
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
if (s5 !== peg$FAILED) {
|
|
2262
|
+
s6 = peg$parse_();
|
|
2263
|
+
if (s6 !== peg$FAILED) {
|
|
2264
|
+
if (input.substr(peg$currPos, 6) === peg$c62) {
|
|
2265
|
+
s7 = peg$c62;
|
|
2266
|
+
peg$currPos += 6;
|
|
2267
|
+
} else {
|
|
2268
|
+
s7 = peg$FAILED;
|
|
2269
|
+
if (peg$silentFails === 0) {
|
|
2270
|
+
peg$fail(peg$c63);
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
if (s7 === peg$FAILED) {
|
|
2274
|
+
if (input.substr(peg$currPos, 13) === peg$c64) {
|
|
2275
|
+
s7 = peg$c64;
|
|
2276
|
+
peg$currPos += 13;
|
|
2277
|
+
} else {
|
|
2278
|
+
s7 = peg$FAILED;
|
|
2279
|
+
if (peg$silentFails === 0) {
|
|
2280
|
+
peg$fail(peg$c65);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
if (s7 !== peg$FAILED) {
|
|
2285
|
+
s8 = peg$parse_();
|
|
2286
|
+
if (s8 !== peg$FAILED) {
|
|
2287
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2288
|
+
s9 = peg$c43;
|
|
2289
|
+
peg$currPos++;
|
|
2290
|
+
} else {
|
|
2291
|
+
s9 = peg$FAILED;
|
|
2292
|
+
if (peg$silentFails === 0) {
|
|
2293
|
+
peg$fail(peg$c44);
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
if (s9 !== peg$FAILED) {
|
|
2297
|
+
s10 = peg$parse_();
|
|
2298
|
+
if (s10 !== peg$FAILED) {
|
|
2299
|
+
s11 = peg$currPos;
|
|
2300
|
+
if (input.substr(peg$currPos, 7) === peg$c66) {
|
|
2301
|
+
s12 = peg$c66;
|
|
2302
|
+
peg$currPos += 7;
|
|
2303
|
+
} else {
|
|
2304
|
+
s12 = peg$FAILED;
|
|
2305
|
+
if (peg$silentFails === 0) {
|
|
2306
|
+
peg$fail(peg$c67);
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
if (s12 !== peg$FAILED) {
|
|
2310
|
+
s13 = peg$parse_();
|
|
2311
|
+
if (s13 !== peg$FAILED) {
|
|
2312
|
+
s14 = peg$parsenumber();
|
|
2313
|
+
if (s14 !== peg$FAILED) {
|
|
2314
|
+
s12 = [s12, s13, s14];
|
|
2315
|
+
s11 = s12;
|
|
2316
|
+
} else {
|
|
2317
|
+
peg$currPos = s11;
|
|
2318
|
+
s11 = peg$FAILED;
|
|
2319
|
+
}
|
|
2320
|
+
} else {
|
|
2321
|
+
peg$currPos = s11;
|
|
2322
|
+
s11 = peg$FAILED;
|
|
2323
|
+
}
|
|
2324
|
+
} else {
|
|
2325
|
+
peg$currPos = s11;
|
|
2326
|
+
s11 = peg$FAILED;
|
|
2327
|
+
}
|
|
2328
|
+
if (s11 === peg$FAILED) {
|
|
2329
|
+
s11 = null;
|
|
2330
|
+
}
|
|
2331
|
+
if (s11 !== peg$FAILED) {
|
|
2332
|
+
s12 = peg$parse_();
|
|
2333
|
+
if (s12 !== peg$FAILED) {
|
|
2334
|
+
s13 = [];
|
|
2335
|
+
s14 = peg$parsepluralOption();
|
|
2336
|
+
if (s14 !== peg$FAILED) {
|
|
2337
|
+
while (s14 !== peg$FAILED) {
|
|
2338
|
+
s13.push(s14);
|
|
2339
|
+
s14 = peg$parsepluralOption();
|
|
2340
|
+
}
|
|
2341
|
+
} else {
|
|
2342
|
+
s13 = peg$FAILED;
|
|
2343
|
+
}
|
|
2344
|
+
if (s13 !== peg$FAILED) {
|
|
2345
|
+
s14 = peg$parse_();
|
|
2346
|
+
if (s14 !== peg$FAILED) {
|
|
2347
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2348
|
+
s15 = peg$c24;
|
|
2349
|
+
peg$currPos++;
|
|
2350
|
+
} else {
|
|
2351
|
+
s15 = peg$FAILED;
|
|
2352
|
+
if (peg$silentFails === 0) {
|
|
2353
|
+
peg$fail(peg$c25);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
if (s15 !== peg$FAILED) {
|
|
2357
|
+
peg$savedPos = s0;
|
|
2358
|
+
s1 = peg$c68(s3, s7, s11, s13);
|
|
2359
|
+
s0 = s1;
|
|
2360
|
+
} else {
|
|
2361
|
+
peg$currPos = s0;
|
|
2362
|
+
s0 = peg$FAILED;
|
|
2363
|
+
}
|
|
2364
|
+
} else {
|
|
2365
|
+
peg$currPos = s0;
|
|
2366
|
+
s0 = peg$FAILED;
|
|
2367
|
+
}
|
|
2368
|
+
} else {
|
|
2369
|
+
peg$currPos = s0;
|
|
2370
|
+
s0 = peg$FAILED;
|
|
2371
|
+
}
|
|
2372
|
+
} else {
|
|
2373
|
+
peg$currPos = s0;
|
|
2374
|
+
s0 = peg$FAILED;
|
|
2375
|
+
}
|
|
2376
|
+
} else {
|
|
2377
|
+
peg$currPos = s0;
|
|
2378
|
+
s0 = peg$FAILED;
|
|
2379
|
+
}
|
|
2380
|
+
} else {
|
|
2381
|
+
peg$currPos = s0;
|
|
2382
|
+
s0 = peg$FAILED;
|
|
2383
|
+
}
|
|
2384
|
+
} else {
|
|
2385
|
+
peg$currPos = s0;
|
|
2386
|
+
s0 = peg$FAILED;
|
|
2387
|
+
}
|
|
2388
|
+
} else {
|
|
2389
|
+
peg$currPos = s0;
|
|
2390
|
+
s0 = peg$FAILED;
|
|
2391
|
+
}
|
|
2392
|
+
} else {
|
|
2393
|
+
peg$currPos = s0;
|
|
2394
|
+
s0 = peg$FAILED;
|
|
2395
|
+
}
|
|
2396
|
+
} else {
|
|
2397
|
+
peg$currPos = s0;
|
|
2398
|
+
s0 = peg$FAILED;
|
|
2399
|
+
}
|
|
2400
|
+
} else {
|
|
2401
|
+
peg$currPos = s0;
|
|
2402
|
+
s0 = peg$FAILED;
|
|
2403
|
+
}
|
|
2404
|
+
} else {
|
|
2405
|
+
peg$currPos = s0;
|
|
2406
|
+
s0 = peg$FAILED;
|
|
2407
|
+
}
|
|
2408
|
+
} else {
|
|
2409
|
+
peg$currPos = s0;
|
|
2410
|
+
s0 = peg$FAILED;
|
|
2411
|
+
}
|
|
2412
|
+
} else {
|
|
2413
|
+
peg$currPos = s0;
|
|
2414
|
+
s0 = peg$FAILED;
|
|
2415
|
+
}
|
|
2416
|
+
} else {
|
|
2417
|
+
peg$currPos = s0;
|
|
2418
|
+
s0 = peg$FAILED;
|
|
2419
|
+
}
|
|
2420
|
+
return s0;
|
|
2421
|
+
}
|
|
2422
|
+
function peg$parseselectElement() {
|
|
2423
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
|
2424
|
+
s0 = peg$currPos;
|
|
2425
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2426
|
+
s1 = peg$c22;
|
|
2427
|
+
peg$currPos++;
|
|
2428
|
+
} else {
|
|
2429
|
+
s1 = peg$FAILED;
|
|
2430
|
+
if (peg$silentFails === 0) {
|
|
2431
|
+
peg$fail(peg$c23);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
if (s1 !== peg$FAILED) {
|
|
2435
|
+
s2 = peg$parse_();
|
|
2436
|
+
if (s2 !== peg$FAILED) {
|
|
2437
|
+
s3 = peg$parseargNameOrNumber();
|
|
2438
|
+
if (s3 !== peg$FAILED) {
|
|
2439
|
+
s4 = peg$parse_();
|
|
2440
|
+
if (s4 !== peg$FAILED) {
|
|
2441
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2442
|
+
s5 = peg$c43;
|
|
2443
|
+
peg$currPos++;
|
|
2444
|
+
} else {
|
|
2445
|
+
s5 = peg$FAILED;
|
|
2446
|
+
if (peg$silentFails === 0) {
|
|
2447
|
+
peg$fail(peg$c44);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
if (s5 !== peg$FAILED) {
|
|
2451
|
+
s6 = peg$parse_();
|
|
2452
|
+
if (s6 !== peg$FAILED) {
|
|
2453
|
+
if (input.substr(peg$currPos, 6) === peg$c69) {
|
|
2454
|
+
s7 = peg$c69;
|
|
2455
|
+
peg$currPos += 6;
|
|
2456
|
+
} else {
|
|
2457
|
+
s7 = peg$FAILED;
|
|
2458
|
+
if (peg$silentFails === 0) {
|
|
2459
|
+
peg$fail(peg$c70);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
if (s7 !== peg$FAILED) {
|
|
2463
|
+
s8 = peg$parse_();
|
|
2464
|
+
if (s8 !== peg$FAILED) {
|
|
2465
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2466
|
+
s9 = peg$c43;
|
|
2467
|
+
peg$currPos++;
|
|
2468
|
+
} else {
|
|
2469
|
+
s9 = peg$FAILED;
|
|
2470
|
+
if (peg$silentFails === 0) {
|
|
2471
|
+
peg$fail(peg$c44);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
if (s9 !== peg$FAILED) {
|
|
2475
|
+
s10 = peg$parse_();
|
|
2476
|
+
if (s10 !== peg$FAILED) {
|
|
2477
|
+
s11 = [];
|
|
2478
|
+
s12 = peg$parseselectOption();
|
|
2479
|
+
if (s12 !== peg$FAILED) {
|
|
2480
|
+
while (s12 !== peg$FAILED) {
|
|
2481
|
+
s11.push(s12);
|
|
2482
|
+
s12 = peg$parseselectOption();
|
|
2483
|
+
}
|
|
2484
|
+
} else {
|
|
2485
|
+
s11 = peg$FAILED;
|
|
2486
|
+
}
|
|
2487
|
+
if (s11 !== peg$FAILED) {
|
|
2488
|
+
s12 = peg$parse_();
|
|
2489
|
+
if (s12 !== peg$FAILED) {
|
|
2490
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2491
|
+
s13 = peg$c24;
|
|
2492
|
+
peg$currPos++;
|
|
2493
|
+
} else {
|
|
2494
|
+
s13 = peg$FAILED;
|
|
2495
|
+
if (peg$silentFails === 0) {
|
|
2496
|
+
peg$fail(peg$c25);
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
if (s13 !== peg$FAILED) {
|
|
2500
|
+
peg$savedPos = s0;
|
|
2501
|
+
s1 = peg$c71(s3, s11);
|
|
2502
|
+
s0 = s1;
|
|
2503
|
+
} else {
|
|
2504
|
+
peg$currPos = s0;
|
|
2505
|
+
s0 = peg$FAILED;
|
|
2506
|
+
}
|
|
2507
|
+
} else {
|
|
2508
|
+
peg$currPos = s0;
|
|
2509
|
+
s0 = peg$FAILED;
|
|
2510
|
+
}
|
|
2511
|
+
} else {
|
|
2512
|
+
peg$currPos = s0;
|
|
2513
|
+
s0 = peg$FAILED;
|
|
2514
|
+
}
|
|
2515
|
+
} else {
|
|
2516
|
+
peg$currPos = s0;
|
|
2517
|
+
s0 = peg$FAILED;
|
|
2518
|
+
}
|
|
2519
|
+
} else {
|
|
2520
|
+
peg$currPos = s0;
|
|
2521
|
+
s0 = peg$FAILED;
|
|
2522
|
+
}
|
|
2523
|
+
} else {
|
|
2524
|
+
peg$currPos = s0;
|
|
2525
|
+
s0 = peg$FAILED;
|
|
2526
|
+
}
|
|
2527
|
+
} else {
|
|
2528
|
+
peg$currPos = s0;
|
|
2529
|
+
s0 = peg$FAILED;
|
|
2530
|
+
}
|
|
2531
|
+
} else {
|
|
2532
|
+
peg$currPos = s0;
|
|
2533
|
+
s0 = peg$FAILED;
|
|
2534
|
+
}
|
|
2535
|
+
} else {
|
|
2536
|
+
peg$currPos = s0;
|
|
2537
|
+
s0 = peg$FAILED;
|
|
2538
|
+
}
|
|
2539
|
+
} else {
|
|
2540
|
+
peg$currPos = s0;
|
|
2541
|
+
s0 = peg$FAILED;
|
|
2542
|
+
}
|
|
2543
|
+
} else {
|
|
2544
|
+
peg$currPos = s0;
|
|
2545
|
+
s0 = peg$FAILED;
|
|
2546
|
+
}
|
|
2547
|
+
} else {
|
|
2548
|
+
peg$currPos = s0;
|
|
2549
|
+
s0 = peg$FAILED;
|
|
2550
|
+
}
|
|
2551
|
+
} else {
|
|
2552
|
+
peg$currPos = s0;
|
|
2553
|
+
s0 = peg$FAILED;
|
|
2554
|
+
}
|
|
2555
|
+
return s0;
|
|
2556
|
+
}
|
|
2557
|
+
function peg$parsepluralRuleSelectValue() {
|
|
2558
|
+
var s0, s1, s2, s3;
|
|
2559
|
+
s0 = peg$currPos;
|
|
2560
|
+
s1 = peg$currPos;
|
|
2561
|
+
if (input.charCodeAt(peg$currPos) === 61) {
|
|
2562
|
+
s2 = peg$c72;
|
|
2563
|
+
peg$currPos++;
|
|
2564
|
+
} else {
|
|
2565
|
+
s2 = peg$FAILED;
|
|
2566
|
+
if (peg$silentFails === 0) {
|
|
2567
|
+
peg$fail(peg$c73);
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
if (s2 !== peg$FAILED) {
|
|
2571
|
+
s3 = peg$parsenumber();
|
|
2572
|
+
if (s3 !== peg$FAILED) {
|
|
2573
|
+
s2 = [s2, s3];
|
|
2574
|
+
s1 = s2;
|
|
2575
|
+
} else {
|
|
2576
|
+
peg$currPos = s1;
|
|
2577
|
+
s1 = peg$FAILED;
|
|
2578
|
+
}
|
|
2579
|
+
} else {
|
|
2580
|
+
peg$currPos = s1;
|
|
2581
|
+
s1 = peg$FAILED;
|
|
2582
|
+
}
|
|
2583
|
+
if (s1 !== peg$FAILED) {
|
|
2584
|
+
s0 = input.substring(s0, peg$currPos);
|
|
2585
|
+
} else {
|
|
2586
|
+
s0 = s1;
|
|
2587
|
+
}
|
|
2588
|
+
if (s0 === peg$FAILED) {
|
|
2589
|
+
s0 = peg$parseargName();
|
|
2590
|
+
}
|
|
2591
|
+
return s0;
|
|
2592
|
+
}
|
|
2593
|
+
function peg$parseselectOption() {
|
|
2594
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2595
|
+
s0 = peg$currPos;
|
|
2596
|
+
s1 = peg$parse_();
|
|
2597
|
+
if (s1 !== peg$FAILED) {
|
|
2598
|
+
s2 = peg$parseargName();
|
|
2599
|
+
if (s2 !== peg$FAILED) {
|
|
2600
|
+
s3 = peg$parse_();
|
|
2601
|
+
if (s3 !== peg$FAILED) {
|
|
2602
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2603
|
+
s4 = peg$c22;
|
|
2604
|
+
peg$currPos++;
|
|
2605
|
+
} else {
|
|
2606
|
+
s4 = peg$FAILED;
|
|
2607
|
+
if (peg$silentFails === 0) {
|
|
2608
|
+
peg$fail(peg$c23);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
if (s4 !== peg$FAILED) {
|
|
2612
|
+
peg$savedPos = peg$currPos;
|
|
2613
|
+
s5 = peg$c74(s2);
|
|
2614
|
+
if (s5) {
|
|
2615
|
+
s5 = void 0;
|
|
2616
|
+
} else {
|
|
2617
|
+
s5 = peg$FAILED;
|
|
2618
|
+
}
|
|
2619
|
+
if (s5 !== peg$FAILED) {
|
|
2620
|
+
s6 = peg$parsemessage();
|
|
2621
|
+
if (s6 !== peg$FAILED) {
|
|
2622
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2623
|
+
s7 = peg$c24;
|
|
2624
|
+
peg$currPos++;
|
|
2625
|
+
} else {
|
|
2626
|
+
s7 = peg$FAILED;
|
|
2627
|
+
if (peg$silentFails === 0) {
|
|
2628
|
+
peg$fail(peg$c25);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
if (s7 !== peg$FAILED) {
|
|
2632
|
+
peg$savedPos = s0;
|
|
2633
|
+
s1 = peg$c75(s2, s6);
|
|
2634
|
+
s0 = s1;
|
|
2635
|
+
} else {
|
|
2636
|
+
peg$currPos = s0;
|
|
2637
|
+
s0 = peg$FAILED;
|
|
2638
|
+
}
|
|
2639
|
+
} else {
|
|
2640
|
+
peg$currPos = s0;
|
|
2641
|
+
s0 = peg$FAILED;
|
|
2642
|
+
}
|
|
2643
|
+
} else {
|
|
2644
|
+
peg$currPos = s0;
|
|
2645
|
+
s0 = peg$FAILED;
|
|
2646
|
+
}
|
|
2647
|
+
} else {
|
|
2648
|
+
peg$currPos = s0;
|
|
2649
|
+
s0 = peg$FAILED;
|
|
2650
|
+
}
|
|
2651
|
+
} else {
|
|
2652
|
+
peg$currPos = s0;
|
|
2653
|
+
s0 = peg$FAILED;
|
|
2654
|
+
}
|
|
2655
|
+
} else {
|
|
2656
|
+
peg$currPos = s0;
|
|
2657
|
+
s0 = peg$FAILED;
|
|
2658
|
+
}
|
|
2659
|
+
} else {
|
|
2660
|
+
peg$currPos = s0;
|
|
2661
|
+
s0 = peg$FAILED;
|
|
2662
|
+
}
|
|
2663
|
+
return s0;
|
|
2664
|
+
}
|
|
2665
|
+
function peg$parsepluralOption() {
|
|
2666
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2667
|
+
s0 = peg$currPos;
|
|
2668
|
+
s1 = peg$parse_();
|
|
2669
|
+
if (s1 !== peg$FAILED) {
|
|
2670
|
+
s2 = peg$parsepluralRuleSelectValue();
|
|
2671
|
+
if (s2 !== peg$FAILED) {
|
|
2672
|
+
s3 = peg$parse_();
|
|
2673
|
+
if (s3 !== peg$FAILED) {
|
|
2674
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2675
|
+
s4 = peg$c22;
|
|
2676
|
+
peg$currPos++;
|
|
2677
|
+
} else {
|
|
2678
|
+
s4 = peg$FAILED;
|
|
2679
|
+
if (peg$silentFails === 0) {
|
|
2680
|
+
peg$fail(peg$c23);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
if (s4 !== peg$FAILED) {
|
|
2684
|
+
peg$savedPos = peg$currPos;
|
|
2685
|
+
s5 = peg$c76(s2);
|
|
2686
|
+
if (s5) {
|
|
2687
|
+
s5 = void 0;
|
|
2688
|
+
} else {
|
|
2689
|
+
s5 = peg$FAILED;
|
|
2690
|
+
}
|
|
2691
|
+
if (s5 !== peg$FAILED) {
|
|
2692
|
+
s6 = peg$parsemessage();
|
|
2693
|
+
if (s6 !== peg$FAILED) {
|
|
2694
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2695
|
+
s7 = peg$c24;
|
|
2696
|
+
peg$currPos++;
|
|
2697
|
+
} else {
|
|
2698
|
+
s7 = peg$FAILED;
|
|
2699
|
+
if (peg$silentFails === 0) {
|
|
2700
|
+
peg$fail(peg$c25);
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
if (s7 !== peg$FAILED) {
|
|
2704
|
+
peg$savedPos = s0;
|
|
2705
|
+
s1 = peg$c77(s2, s6);
|
|
2706
|
+
s0 = s1;
|
|
2707
|
+
} else {
|
|
2708
|
+
peg$currPos = s0;
|
|
2709
|
+
s0 = peg$FAILED;
|
|
2710
|
+
}
|
|
2711
|
+
} else {
|
|
2712
|
+
peg$currPos = s0;
|
|
2713
|
+
s0 = peg$FAILED;
|
|
2714
|
+
}
|
|
2715
|
+
} else {
|
|
2716
|
+
peg$currPos = s0;
|
|
2717
|
+
s0 = peg$FAILED;
|
|
2718
|
+
}
|
|
2719
|
+
} else {
|
|
2720
|
+
peg$currPos = s0;
|
|
2721
|
+
s0 = peg$FAILED;
|
|
2722
|
+
}
|
|
2723
|
+
} else {
|
|
2724
|
+
peg$currPos = s0;
|
|
2725
|
+
s0 = peg$FAILED;
|
|
2726
|
+
}
|
|
2727
|
+
} else {
|
|
2728
|
+
peg$currPos = s0;
|
|
2729
|
+
s0 = peg$FAILED;
|
|
2730
|
+
}
|
|
2731
|
+
} else {
|
|
2732
|
+
peg$currPos = s0;
|
|
2733
|
+
s0 = peg$FAILED;
|
|
2734
|
+
}
|
|
2735
|
+
return s0;
|
|
2736
|
+
}
|
|
2737
|
+
function peg$parsewhiteSpace() {
|
|
2738
|
+
var s0, s1;
|
|
2739
|
+
peg$silentFails++;
|
|
2740
|
+
if (peg$c79.test(input.charAt(peg$currPos))) {
|
|
2741
|
+
s0 = input.charAt(peg$currPos);
|
|
2742
|
+
peg$currPos++;
|
|
2743
|
+
} else {
|
|
2744
|
+
s0 = peg$FAILED;
|
|
2745
|
+
if (peg$silentFails === 0) {
|
|
2746
|
+
peg$fail(peg$c80);
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
peg$silentFails--;
|
|
2750
|
+
if (s0 === peg$FAILED) {
|
|
2751
|
+
s1 = peg$FAILED;
|
|
2752
|
+
if (peg$silentFails === 0) {
|
|
2753
|
+
peg$fail(peg$c78);
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
return s0;
|
|
2757
|
+
}
|
|
2758
|
+
function peg$parsepatternSyntax() {
|
|
2759
|
+
var s0, s1;
|
|
2760
|
+
peg$silentFails++;
|
|
2761
|
+
if (peg$c82.test(input.charAt(peg$currPos))) {
|
|
2762
|
+
s0 = input.charAt(peg$currPos);
|
|
2763
|
+
peg$currPos++;
|
|
2764
|
+
} else {
|
|
2765
|
+
s0 = peg$FAILED;
|
|
2766
|
+
if (peg$silentFails === 0) {
|
|
2767
|
+
peg$fail(peg$c83);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
peg$silentFails--;
|
|
2771
|
+
if (s0 === peg$FAILED) {
|
|
2772
|
+
s1 = peg$FAILED;
|
|
2773
|
+
if (peg$silentFails === 0) {
|
|
2774
|
+
peg$fail(peg$c81);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
return s0;
|
|
2778
|
+
}
|
|
2779
|
+
function peg$parse_() {
|
|
2780
|
+
var s0, s1, s2;
|
|
2781
|
+
peg$silentFails++;
|
|
2782
|
+
s0 = peg$currPos;
|
|
2783
|
+
s1 = [];
|
|
2784
|
+
s2 = peg$parsewhiteSpace();
|
|
2785
|
+
while (s2 !== peg$FAILED) {
|
|
2786
|
+
s1.push(s2);
|
|
2787
|
+
s2 = peg$parsewhiteSpace();
|
|
2788
|
+
}
|
|
2789
|
+
if (s1 !== peg$FAILED) {
|
|
2790
|
+
s0 = input.substring(s0, peg$currPos);
|
|
2791
|
+
} else {
|
|
2792
|
+
s0 = s1;
|
|
2793
|
+
}
|
|
2794
|
+
peg$silentFails--;
|
|
2795
|
+
if (s0 === peg$FAILED) {
|
|
2796
|
+
s1 = peg$FAILED;
|
|
2797
|
+
if (peg$silentFails === 0) {
|
|
2798
|
+
peg$fail(peg$c84);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
return s0;
|
|
2802
|
+
}
|
|
2803
|
+
function peg$parsenumber() {
|
|
2804
|
+
var s0, s1, s2;
|
|
2805
|
+
peg$silentFails++;
|
|
2806
|
+
s0 = peg$currPos;
|
|
2807
|
+
if (input.charCodeAt(peg$currPos) === 45) {
|
|
2808
|
+
s1 = peg$c86;
|
|
2809
|
+
peg$currPos++;
|
|
2810
|
+
} else {
|
|
2811
|
+
s1 = peg$FAILED;
|
|
2812
|
+
if (peg$silentFails === 0) {
|
|
2813
|
+
peg$fail(peg$c87);
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
if (s1 === peg$FAILED) {
|
|
2817
|
+
s1 = null;
|
|
2818
|
+
}
|
|
2819
|
+
if (s1 !== peg$FAILED) {
|
|
2820
|
+
s2 = peg$parseargNumber();
|
|
2821
|
+
if (s2 !== peg$FAILED) {
|
|
2822
|
+
peg$savedPos = s0;
|
|
2823
|
+
s1 = peg$c88(s1, s2);
|
|
2824
|
+
s0 = s1;
|
|
2825
|
+
} else {
|
|
2826
|
+
peg$currPos = s0;
|
|
2827
|
+
s0 = peg$FAILED;
|
|
2828
|
+
}
|
|
2829
|
+
} else {
|
|
2830
|
+
peg$currPos = s0;
|
|
2831
|
+
s0 = peg$FAILED;
|
|
2832
|
+
}
|
|
2833
|
+
peg$silentFails--;
|
|
2834
|
+
if (s0 === peg$FAILED) {
|
|
2835
|
+
s1 = peg$FAILED;
|
|
2836
|
+
if (peg$silentFails === 0) {
|
|
2837
|
+
peg$fail(peg$c85);
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
return s0;
|
|
2841
|
+
}
|
|
2842
|
+
function peg$parseapostrophe() {
|
|
2843
|
+
var s0, s1;
|
|
2844
|
+
peg$silentFails++;
|
|
2845
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2846
|
+
s0 = peg$c48;
|
|
2847
|
+
peg$currPos++;
|
|
2848
|
+
} else {
|
|
2849
|
+
s0 = peg$FAILED;
|
|
2850
|
+
if (peg$silentFails === 0) {
|
|
2851
|
+
peg$fail(peg$c49);
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
peg$silentFails--;
|
|
2855
|
+
if (s0 === peg$FAILED) {
|
|
2856
|
+
s1 = peg$FAILED;
|
|
2857
|
+
if (peg$silentFails === 0) {
|
|
2858
|
+
peg$fail(peg$c89);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
return s0;
|
|
2862
|
+
}
|
|
2863
|
+
function peg$parsedoubleApostrophes() {
|
|
2864
|
+
var s0, s1;
|
|
2865
|
+
peg$silentFails++;
|
|
2866
|
+
s0 = peg$currPos;
|
|
2867
|
+
if (input.substr(peg$currPos, 2) === peg$c91) {
|
|
2868
|
+
s1 = peg$c91;
|
|
2869
|
+
peg$currPos += 2;
|
|
2870
|
+
} else {
|
|
2871
|
+
s1 = peg$FAILED;
|
|
2872
|
+
if (peg$silentFails === 0) {
|
|
2873
|
+
peg$fail(peg$c92);
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
if (s1 !== peg$FAILED) {
|
|
2877
|
+
peg$savedPos = s0;
|
|
2878
|
+
s1 = peg$c93();
|
|
2879
|
+
}
|
|
2880
|
+
s0 = s1;
|
|
2881
|
+
peg$silentFails--;
|
|
2882
|
+
if (s0 === peg$FAILED) {
|
|
2883
|
+
s1 = peg$FAILED;
|
|
2884
|
+
if (peg$silentFails === 0) {
|
|
2885
|
+
peg$fail(peg$c90);
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
return s0;
|
|
2889
|
+
}
|
|
2890
|
+
function peg$parsequotedString() {
|
|
2891
|
+
var s0, s1, s2, s3, s4, s5;
|
|
2892
|
+
s0 = peg$currPos;
|
|
2893
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2894
|
+
s1 = peg$c48;
|
|
2895
|
+
peg$currPos++;
|
|
2896
|
+
} else {
|
|
2897
|
+
s1 = peg$FAILED;
|
|
2898
|
+
if (peg$silentFails === 0) {
|
|
2899
|
+
peg$fail(peg$c49);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
if (s1 !== peg$FAILED) {
|
|
2903
|
+
s2 = peg$parseescapedChar();
|
|
2904
|
+
if (s2 !== peg$FAILED) {
|
|
2905
|
+
s3 = peg$currPos;
|
|
2906
|
+
s4 = [];
|
|
2907
|
+
if (input.substr(peg$currPos, 2) === peg$c91) {
|
|
2908
|
+
s5 = peg$c91;
|
|
2909
|
+
peg$currPos += 2;
|
|
2910
|
+
} else {
|
|
2911
|
+
s5 = peg$FAILED;
|
|
2912
|
+
if (peg$silentFails === 0) {
|
|
2913
|
+
peg$fail(peg$c92);
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
if (s5 === peg$FAILED) {
|
|
2917
|
+
if (peg$c50.test(input.charAt(peg$currPos))) {
|
|
2918
|
+
s5 = input.charAt(peg$currPos);
|
|
2919
|
+
peg$currPos++;
|
|
2920
|
+
} else {
|
|
2921
|
+
s5 = peg$FAILED;
|
|
2922
|
+
if (peg$silentFails === 0) {
|
|
2923
|
+
peg$fail(peg$c51);
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
while (s5 !== peg$FAILED) {
|
|
2928
|
+
s4.push(s5);
|
|
2929
|
+
if (input.substr(peg$currPos, 2) === peg$c91) {
|
|
2930
|
+
s5 = peg$c91;
|
|
2931
|
+
peg$currPos += 2;
|
|
2932
|
+
} else {
|
|
2933
|
+
s5 = peg$FAILED;
|
|
2934
|
+
if (peg$silentFails === 0) {
|
|
2935
|
+
peg$fail(peg$c92);
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
if (s5 === peg$FAILED) {
|
|
2939
|
+
if (peg$c50.test(input.charAt(peg$currPos))) {
|
|
2940
|
+
s5 = input.charAt(peg$currPos);
|
|
2941
|
+
peg$currPos++;
|
|
2942
|
+
} else {
|
|
2943
|
+
s5 = peg$FAILED;
|
|
2944
|
+
if (peg$silentFails === 0) {
|
|
2945
|
+
peg$fail(peg$c51);
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
if (s4 !== peg$FAILED) {
|
|
2951
|
+
s3 = input.substring(s3, peg$currPos);
|
|
2952
|
+
} else {
|
|
2953
|
+
s3 = s4;
|
|
2954
|
+
}
|
|
2955
|
+
if (s3 !== peg$FAILED) {
|
|
2956
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2957
|
+
s4 = peg$c48;
|
|
2958
|
+
peg$currPos++;
|
|
2959
|
+
} else {
|
|
2960
|
+
s4 = peg$FAILED;
|
|
2961
|
+
if (peg$silentFails === 0) {
|
|
2962
|
+
peg$fail(peg$c49);
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
if (s4 === peg$FAILED) {
|
|
2966
|
+
s4 = null;
|
|
2967
|
+
}
|
|
2968
|
+
if (s4 !== peg$FAILED) {
|
|
2969
|
+
peg$savedPos = s0;
|
|
2970
|
+
s1 = peg$c94(s2, s3);
|
|
2971
|
+
s0 = s1;
|
|
2972
|
+
} else {
|
|
2973
|
+
peg$currPos = s0;
|
|
2974
|
+
s0 = peg$FAILED;
|
|
2975
|
+
}
|
|
2976
|
+
} else {
|
|
2977
|
+
peg$currPos = s0;
|
|
2978
|
+
s0 = peg$FAILED;
|
|
2979
|
+
}
|
|
2980
|
+
} else {
|
|
2981
|
+
peg$currPos = s0;
|
|
2982
|
+
s0 = peg$FAILED;
|
|
2983
|
+
}
|
|
2984
|
+
} else {
|
|
2985
|
+
peg$currPos = s0;
|
|
2986
|
+
s0 = peg$FAILED;
|
|
2987
|
+
}
|
|
2988
|
+
return s0;
|
|
2989
|
+
}
|
|
2990
|
+
function peg$parseunquotedString() {
|
|
2991
|
+
var s0, s1, s2, s3;
|
|
2992
|
+
s0 = peg$currPos;
|
|
2993
|
+
s1 = peg$currPos;
|
|
2994
|
+
if (input.length > peg$currPos) {
|
|
2995
|
+
s2 = input.charAt(peg$currPos);
|
|
2996
|
+
peg$currPos++;
|
|
2997
|
+
} else {
|
|
2998
|
+
s2 = peg$FAILED;
|
|
2999
|
+
if (peg$silentFails === 0) {
|
|
3000
|
+
peg$fail(peg$c30);
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
if (s2 !== peg$FAILED) {
|
|
3004
|
+
peg$savedPos = peg$currPos;
|
|
3005
|
+
s3 = peg$c95(s2);
|
|
3006
|
+
if (s3) {
|
|
3007
|
+
s3 = void 0;
|
|
3008
|
+
} else {
|
|
3009
|
+
s3 = peg$FAILED;
|
|
3010
|
+
}
|
|
3011
|
+
if (s3 !== peg$FAILED) {
|
|
3012
|
+
s2 = [s2, s3];
|
|
3013
|
+
s1 = s2;
|
|
3014
|
+
} else {
|
|
3015
|
+
peg$currPos = s1;
|
|
3016
|
+
s1 = peg$FAILED;
|
|
3017
|
+
}
|
|
3018
|
+
} else {
|
|
3019
|
+
peg$currPos = s1;
|
|
3020
|
+
s1 = peg$FAILED;
|
|
3021
|
+
}
|
|
3022
|
+
if (s1 === peg$FAILED) {
|
|
3023
|
+
if (input.charCodeAt(peg$currPos) === 10) {
|
|
3024
|
+
s1 = peg$c96;
|
|
3025
|
+
peg$currPos++;
|
|
3026
|
+
} else {
|
|
3027
|
+
s1 = peg$FAILED;
|
|
3028
|
+
if (peg$silentFails === 0) {
|
|
3029
|
+
peg$fail(peg$c97);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
if (s1 !== peg$FAILED) {
|
|
3034
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3035
|
+
} else {
|
|
3036
|
+
s0 = s1;
|
|
3037
|
+
}
|
|
3038
|
+
return s0;
|
|
3039
|
+
}
|
|
3040
|
+
function peg$parseescapedChar() {
|
|
3041
|
+
var s0, s1, s2, s3;
|
|
3042
|
+
s0 = peg$currPos;
|
|
3043
|
+
s1 = peg$currPos;
|
|
3044
|
+
if (input.length > peg$currPos) {
|
|
3045
|
+
s2 = input.charAt(peg$currPos);
|
|
3046
|
+
peg$currPos++;
|
|
3047
|
+
} else {
|
|
3048
|
+
s2 = peg$FAILED;
|
|
3049
|
+
if (peg$silentFails === 0) {
|
|
3050
|
+
peg$fail(peg$c30);
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
if (s2 !== peg$FAILED) {
|
|
3054
|
+
peg$savedPos = peg$currPos;
|
|
3055
|
+
s3 = peg$c98(s2);
|
|
3056
|
+
if (s3) {
|
|
3057
|
+
s3 = void 0;
|
|
3058
|
+
} else {
|
|
3059
|
+
s3 = peg$FAILED;
|
|
3060
|
+
}
|
|
3061
|
+
if (s3 !== peg$FAILED) {
|
|
3062
|
+
s2 = [s2, s3];
|
|
3063
|
+
s1 = s2;
|
|
3064
|
+
} else {
|
|
3065
|
+
peg$currPos = s1;
|
|
3066
|
+
s1 = peg$FAILED;
|
|
3067
|
+
}
|
|
3068
|
+
} else {
|
|
3069
|
+
peg$currPos = s1;
|
|
3070
|
+
s1 = peg$FAILED;
|
|
3071
|
+
}
|
|
3072
|
+
if (s1 !== peg$FAILED) {
|
|
3073
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3074
|
+
} else {
|
|
3075
|
+
s0 = s1;
|
|
3076
|
+
}
|
|
3077
|
+
return s0;
|
|
3078
|
+
}
|
|
3079
|
+
function peg$parseargNameOrNumber() {
|
|
3080
|
+
var s0, s1;
|
|
3081
|
+
peg$silentFails++;
|
|
3082
|
+
s0 = peg$currPos;
|
|
3083
|
+
s1 = peg$parseargNumber();
|
|
3084
|
+
if (s1 === peg$FAILED) {
|
|
3085
|
+
s1 = peg$parseargName();
|
|
3086
|
+
}
|
|
3087
|
+
if (s1 !== peg$FAILED) {
|
|
3088
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3089
|
+
} else {
|
|
3090
|
+
s0 = s1;
|
|
3091
|
+
}
|
|
3092
|
+
peg$silentFails--;
|
|
3093
|
+
if (s0 === peg$FAILED) {
|
|
3094
|
+
s1 = peg$FAILED;
|
|
3095
|
+
if (peg$silentFails === 0) {
|
|
3096
|
+
peg$fail(peg$c99);
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
return s0;
|
|
3100
|
+
}
|
|
3101
|
+
function peg$parsevalidTag() {
|
|
3102
|
+
var s0, s1;
|
|
3103
|
+
peg$silentFails++;
|
|
3104
|
+
s0 = peg$currPos;
|
|
3105
|
+
s1 = peg$parseargNumber();
|
|
3106
|
+
if (s1 === peg$FAILED) {
|
|
3107
|
+
s1 = peg$parsetagName();
|
|
3108
|
+
}
|
|
3109
|
+
if (s1 !== peg$FAILED) {
|
|
3110
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3111
|
+
} else {
|
|
3112
|
+
s0 = s1;
|
|
3113
|
+
}
|
|
3114
|
+
peg$silentFails--;
|
|
3115
|
+
if (s0 === peg$FAILED) {
|
|
3116
|
+
s1 = peg$FAILED;
|
|
3117
|
+
if (peg$silentFails === 0) {
|
|
3118
|
+
peg$fail(peg$c100);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
return s0;
|
|
3122
|
+
}
|
|
3123
|
+
function peg$parseargNumber() {
|
|
3124
|
+
var s0, s1, s2, s3, s4;
|
|
3125
|
+
peg$silentFails++;
|
|
3126
|
+
s0 = peg$currPos;
|
|
3127
|
+
if (input.charCodeAt(peg$currPos) === 48) {
|
|
3128
|
+
s1 = peg$c102;
|
|
3129
|
+
peg$currPos++;
|
|
3130
|
+
} else {
|
|
3131
|
+
s1 = peg$FAILED;
|
|
3132
|
+
if (peg$silentFails === 0) {
|
|
3133
|
+
peg$fail(peg$c103);
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
if (s1 !== peg$FAILED) {
|
|
3137
|
+
peg$savedPos = s0;
|
|
3138
|
+
s1 = peg$c104();
|
|
3139
|
+
}
|
|
3140
|
+
s0 = s1;
|
|
3141
|
+
if (s0 === peg$FAILED) {
|
|
3142
|
+
s0 = peg$currPos;
|
|
3143
|
+
s1 = peg$currPos;
|
|
3144
|
+
if (peg$c105.test(input.charAt(peg$currPos))) {
|
|
3145
|
+
s2 = input.charAt(peg$currPos);
|
|
3146
|
+
peg$currPos++;
|
|
3147
|
+
} else {
|
|
3148
|
+
s2 = peg$FAILED;
|
|
3149
|
+
if (peg$silentFails === 0) {
|
|
3150
|
+
peg$fail(peg$c106);
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
if (s2 !== peg$FAILED) {
|
|
3154
|
+
s3 = [];
|
|
3155
|
+
if (peg$c107.test(input.charAt(peg$currPos))) {
|
|
3156
|
+
s4 = input.charAt(peg$currPos);
|
|
3157
|
+
peg$currPos++;
|
|
3158
|
+
} else {
|
|
3159
|
+
s4 = peg$FAILED;
|
|
3160
|
+
if (peg$silentFails === 0) {
|
|
3161
|
+
peg$fail(peg$c108);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
while (s4 !== peg$FAILED) {
|
|
3165
|
+
s3.push(s4);
|
|
3166
|
+
if (peg$c107.test(input.charAt(peg$currPos))) {
|
|
3167
|
+
s4 = input.charAt(peg$currPos);
|
|
3168
|
+
peg$currPos++;
|
|
3169
|
+
} else {
|
|
3170
|
+
s4 = peg$FAILED;
|
|
3171
|
+
if (peg$silentFails === 0) {
|
|
3172
|
+
peg$fail(peg$c108);
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
if (s3 !== peg$FAILED) {
|
|
3177
|
+
s2 = [s2, s3];
|
|
3178
|
+
s1 = s2;
|
|
3179
|
+
} else {
|
|
3180
|
+
peg$currPos = s1;
|
|
3181
|
+
s1 = peg$FAILED;
|
|
3182
|
+
}
|
|
3183
|
+
} else {
|
|
3184
|
+
peg$currPos = s1;
|
|
3185
|
+
s1 = peg$FAILED;
|
|
3186
|
+
}
|
|
3187
|
+
if (s1 !== peg$FAILED) {
|
|
3188
|
+
peg$savedPos = s0;
|
|
3189
|
+
s1 = peg$c109(s1);
|
|
3190
|
+
}
|
|
3191
|
+
s0 = s1;
|
|
3192
|
+
}
|
|
3193
|
+
peg$silentFails--;
|
|
3194
|
+
if (s0 === peg$FAILED) {
|
|
3195
|
+
s1 = peg$FAILED;
|
|
3196
|
+
if (peg$silentFails === 0) {
|
|
3197
|
+
peg$fail(peg$c101);
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
return s0;
|
|
3201
|
+
}
|
|
3202
|
+
function peg$parseargName() {
|
|
3203
|
+
var s0, s1, s2, s3, s4;
|
|
3204
|
+
peg$silentFails++;
|
|
3205
|
+
s0 = peg$currPos;
|
|
3206
|
+
s1 = [];
|
|
3207
|
+
s2 = peg$currPos;
|
|
3208
|
+
s3 = peg$currPos;
|
|
3209
|
+
peg$silentFails++;
|
|
3210
|
+
s4 = peg$parsewhiteSpace();
|
|
3211
|
+
if (s4 === peg$FAILED) {
|
|
3212
|
+
s4 = peg$parsepatternSyntax();
|
|
3213
|
+
}
|
|
3214
|
+
peg$silentFails--;
|
|
3215
|
+
if (s4 === peg$FAILED) {
|
|
3216
|
+
s3 = void 0;
|
|
3217
|
+
} else {
|
|
3218
|
+
peg$currPos = s3;
|
|
3219
|
+
s3 = peg$FAILED;
|
|
3220
|
+
}
|
|
3221
|
+
if (s3 !== peg$FAILED) {
|
|
3222
|
+
if (input.length > peg$currPos) {
|
|
3223
|
+
s4 = input.charAt(peg$currPos);
|
|
3224
|
+
peg$currPos++;
|
|
3225
|
+
} else {
|
|
3226
|
+
s4 = peg$FAILED;
|
|
3227
|
+
if (peg$silentFails === 0) {
|
|
3228
|
+
peg$fail(peg$c30);
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
if (s4 !== peg$FAILED) {
|
|
3232
|
+
s3 = [s3, s4];
|
|
3233
|
+
s2 = s3;
|
|
3234
|
+
} else {
|
|
3235
|
+
peg$currPos = s2;
|
|
3236
|
+
s2 = peg$FAILED;
|
|
3237
|
+
}
|
|
3238
|
+
} else {
|
|
3239
|
+
peg$currPos = s2;
|
|
3240
|
+
s2 = peg$FAILED;
|
|
3241
|
+
}
|
|
3242
|
+
if (s2 !== peg$FAILED) {
|
|
3243
|
+
while (s2 !== peg$FAILED) {
|
|
3244
|
+
s1.push(s2);
|
|
3245
|
+
s2 = peg$currPos;
|
|
3246
|
+
s3 = peg$currPos;
|
|
3247
|
+
peg$silentFails++;
|
|
3248
|
+
s4 = peg$parsewhiteSpace();
|
|
3249
|
+
if (s4 === peg$FAILED) {
|
|
3250
|
+
s4 = peg$parsepatternSyntax();
|
|
3251
|
+
}
|
|
3252
|
+
peg$silentFails--;
|
|
3253
|
+
if (s4 === peg$FAILED) {
|
|
3254
|
+
s3 = void 0;
|
|
3255
|
+
} else {
|
|
3256
|
+
peg$currPos = s3;
|
|
3257
|
+
s3 = peg$FAILED;
|
|
3258
|
+
}
|
|
3259
|
+
if (s3 !== peg$FAILED) {
|
|
3260
|
+
if (input.length > peg$currPos) {
|
|
3261
|
+
s4 = input.charAt(peg$currPos);
|
|
3262
|
+
peg$currPos++;
|
|
3263
|
+
} else {
|
|
3264
|
+
s4 = peg$FAILED;
|
|
3265
|
+
if (peg$silentFails === 0) {
|
|
3266
|
+
peg$fail(peg$c30);
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
if (s4 !== peg$FAILED) {
|
|
3270
|
+
s3 = [s3, s4];
|
|
3271
|
+
s2 = s3;
|
|
3272
|
+
} else {
|
|
3273
|
+
peg$currPos = s2;
|
|
3274
|
+
s2 = peg$FAILED;
|
|
3275
|
+
}
|
|
3276
|
+
} else {
|
|
3277
|
+
peg$currPos = s2;
|
|
3278
|
+
s2 = peg$FAILED;
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
} else {
|
|
3282
|
+
s1 = peg$FAILED;
|
|
3283
|
+
}
|
|
3284
|
+
if (s1 !== peg$FAILED) {
|
|
3285
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3286
|
+
} else {
|
|
3287
|
+
s0 = s1;
|
|
3288
|
+
}
|
|
3289
|
+
peg$silentFails--;
|
|
3290
|
+
if (s0 === peg$FAILED) {
|
|
3291
|
+
s1 = peg$FAILED;
|
|
3292
|
+
if (peg$silentFails === 0) {
|
|
3293
|
+
peg$fail(peg$c110);
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
return s0;
|
|
3297
|
+
}
|
|
3298
|
+
function peg$parsetagName() {
|
|
3299
|
+
var s0, s1, s2, s3, s4;
|
|
3300
|
+
peg$silentFails++;
|
|
3301
|
+
s0 = peg$currPos;
|
|
3302
|
+
s1 = [];
|
|
3303
|
+
if (input.charCodeAt(peg$currPos) === 45) {
|
|
3304
|
+
s2 = peg$c86;
|
|
3305
|
+
peg$currPos++;
|
|
3306
|
+
} else {
|
|
3307
|
+
s2 = peg$FAILED;
|
|
3308
|
+
if (peg$silentFails === 0) {
|
|
3309
|
+
peg$fail(peg$c87);
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
if (s2 === peg$FAILED) {
|
|
3313
|
+
s2 = peg$currPos;
|
|
3314
|
+
s3 = peg$currPos;
|
|
3315
|
+
peg$silentFails++;
|
|
3316
|
+
s4 = peg$parsewhiteSpace();
|
|
3317
|
+
if (s4 === peg$FAILED) {
|
|
3318
|
+
s4 = peg$parsepatternSyntax();
|
|
3319
|
+
}
|
|
3320
|
+
peg$silentFails--;
|
|
3321
|
+
if (s4 === peg$FAILED) {
|
|
3322
|
+
s3 = void 0;
|
|
3323
|
+
} else {
|
|
3324
|
+
peg$currPos = s3;
|
|
3325
|
+
s3 = peg$FAILED;
|
|
3326
|
+
}
|
|
3327
|
+
if (s3 !== peg$FAILED) {
|
|
3328
|
+
if (input.length > peg$currPos) {
|
|
3329
|
+
s4 = input.charAt(peg$currPos);
|
|
3330
|
+
peg$currPos++;
|
|
3331
|
+
} else {
|
|
3332
|
+
s4 = peg$FAILED;
|
|
3333
|
+
if (peg$silentFails === 0) {
|
|
3334
|
+
peg$fail(peg$c30);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
if (s4 !== peg$FAILED) {
|
|
3338
|
+
s3 = [s3, s4];
|
|
3339
|
+
s2 = s3;
|
|
3340
|
+
} else {
|
|
3341
|
+
peg$currPos = s2;
|
|
3342
|
+
s2 = peg$FAILED;
|
|
3343
|
+
}
|
|
3344
|
+
} else {
|
|
3345
|
+
peg$currPos = s2;
|
|
3346
|
+
s2 = peg$FAILED;
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
if (s2 !== peg$FAILED) {
|
|
3350
|
+
while (s2 !== peg$FAILED) {
|
|
3351
|
+
s1.push(s2);
|
|
3352
|
+
if (input.charCodeAt(peg$currPos) === 45) {
|
|
3353
|
+
s2 = peg$c86;
|
|
3354
|
+
peg$currPos++;
|
|
3355
|
+
} else {
|
|
3356
|
+
s2 = peg$FAILED;
|
|
3357
|
+
if (peg$silentFails === 0) {
|
|
3358
|
+
peg$fail(peg$c87);
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
if (s2 === peg$FAILED) {
|
|
3362
|
+
s2 = peg$currPos;
|
|
3363
|
+
s3 = peg$currPos;
|
|
3364
|
+
peg$silentFails++;
|
|
3365
|
+
s4 = peg$parsewhiteSpace();
|
|
3366
|
+
if (s4 === peg$FAILED) {
|
|
3367
|
+
s4 = peg$parsepatternSyntax();
|
|
3368
|
+
}
|
|
3369
|
+
peg$silentFails--;
|
|
3370
|
+
if (s4 === peg$FAILED) {
|
|
3371
|
+
s3 = void 0;
|
|
3372
|
+
} else {
|
|
3373
|
+
peg$currPos = s3;
|
|
3374
|
+
s3 = peg$FAILED;
|
|
3375
|
+
}
|
|
3376
|
+
if (s3 !== peg$FAILED) {
|
|
3377
|
+
if (input.length > peg$currPos) {
|
|
3378
|
+
s4 = input.charAt(peg$currPos);
|
|
3379
|
+
peg$currPos++;
|
|
3380
|
+
} else {
|
|
3381
|
+
s4 = peg$FAILED;
|
|
3382
|
+
if (peg$silentFails === 0) {
|
|
3383
|
+
peg$fail(peg$c30);
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
if (s4 !== peg$FAILED) {
|
|
3387
|
+
s3 = [s3, s4];
|
|
3388
|
+
s2 = s3;
|
|
3389
|
+
} else {
|
|
3390
|
+
peg$currPos = s2;
|
|
3391
|
+
s2 = peg$FAILED;
|
|
3392
|
+
}
|
|
3393
|
+
} else {
|
|
3394
|
+
peg$currPos = s2;
|
|
3395
|
+
s2 = peg$FAILED;
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
} else {
|
|
3400
|
+
s1 = peg$FAILED;
|
|
3401
|
+
}
|
|
3402
|
+
if (s1 !== peg$FAILED) {
|
|
3403
|
+
s0 = input.substring(s0, peg$currPos);
|
|
3404
|
+
} else {
|
|
3405
|
+
s0 = s1;
|
|
3406
|
+
}
|
|
3407
|
+
peg$silentFails--;
|
|
3408
|
+
if (s0 === peg$FAILED) {
|
|
3409
|
+
s1 = peg$FAILED;
|
|
3410
|
+
if (peg$silentFails === 0) {
|
|
3411
|
+
peg$fail(peg$c111);
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
return s0;
|
|
3415
|
+
}
|
|
3416
|
+
var messageCtx = ["root"];
|
|
3417
|
+
function isNestedMessageText() {
|
|
3418
|
+
return messageCtx.length > 1;
|
|
3419
|
+
}
|
|
3420
|
+
function isInPluralOption() {
|
|
3421
|
+
return messageCtx[messageCtx.length - 1] === "plural";
|
|
3422
|
+
}
|
|
3423
|
+
function insertLocation() {
|
|
3424
|
+
return options && options.captureLocation ? {
|
|
3425
|
+
location: location()
|
|
3426
|
+
} : {};
|
|
3427
|
+
}
|
|
3428
|
+
var ignoreTag = options && options.ignoreTag;
|
|
3429
|
+
var shouldParseSkeleton = options && options.shouldParseSkeleton;
|
|
3430
|
+
peg$result = peg$startRuleFunction();
|
|
3431
|
+
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
3432
|
+
return peg$result;
|
|
3433
|
+
} else {
|
|
3434
|
+
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
3435
|
+
peg$fail(peg$endExpectation());
|
|
3436
|
+
}
|
|
3437
|
+
throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
var pegParse = peg$parse;
|
|
3441
|
+
|
|
3442
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat-parser/lib/src/normalize.js
|
|
3443
|
+
var PLURAL_HASHTAG_REGEX = /(^|[^\\])#/g;
|
|
3444
|
+
function normalizeHashtagInPlural(els) {
|
|
3445
|
+
els.forEach(function(el) {
|
|
3446
|
+
if (!isPluralElement(el) && !isSelectElement(el)) {
|
|
3447
|
+
return;
|
|
3448
|
+
}
|
|
3449
|
+
Object.keys(el.options).forEach(function(id) {
|
|
3450
|
+
var _a;
|
|
3451
|
+
var opt = el.options[id];
|
|
3452
|
+
var matchingLiteralElIndex = -1;
|
|
3453
|
+
var literalEl = void 0;
|
|
3454
|
+
for (var i = 0; i < opt.value.length; i++) {
|
|
3455
|
+
var el_1 = opt.value[i];
|
|
3456
|
+
if (isLiteralElement(el_1) && PLURAL_HASHTAG_REGEX.test(el_1.value)) {
|
|
3457
|
+
matchingLiteralElIndex = i;
|
|
3458
|
+
literalEl = el_1;
|
|
3459
|
+
break;
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
if (literalEl) {
|
|
3463
|
+
var newValue = literalEl.value.replace(PLURAL_HASHTAG_REGEX, "$1{" + el.value + ", number}");
|
|
3464
|
+
var newEls = pegParse(newValue);
|
|
3465
|
+
(_a = opt.value).splice.apply(_a, __spreadArray([matchingLiteralElIndex, 1], newEls));
|
|
3466
|
+
}
|
|
3467
|
+
normalizeHashtagInPlural(opt.value);
|
|
3468
|
+
});
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat-parser/lib/index.js
|
|
3473
|
+
function parse(input, opts) {
|
|
3474
|
+
opts = __assign({normalizeHashtagInPlural: true, shouldParseSkeleton: true}, opts || {});
|
|
3475
|
+
var els = pegParse(input, opts);
|
|
3476
|
+
if (opts.normalizeHashtagInPlural) {
|
|
3477
|
+
normalizeHashtagInPlural(els);
|
|
3478
|
+
}
|
|
3479
|
+
return els;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/src/core.js
|
|
3483
|
+
var memoize = __toModule(require_src());
|
|
3484
|
+
|
|
3485
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/src/error.js
|
|
3486
|
+
var ErrorCode;
|
|
3487
|
+
(function(ErrorCode2) {
|
|
3488
|
+
ErrorCode2["MISSING_VALUE"] = "MISSING_VALUE";
|
|
3489
|
+
ErrorCode2["INVALID_VALUE"] = "INVALID_VALUE";
|
|
3490
|
+
ErrorCode2["MISSING_INTL_API"] = "MISSING_INTL_API";
|
|
3491
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
3492
|
+
var FormatError = function(_super) {
|
|
3493
|
+
__extends(FormatError2, _super);
|
|
3494
|
+
function FormatError2(msg, code, originalMessage) {
|
|
3495
|
+
var _this = _super.call(this, msg) || this;
|
|
3496
|
+
_this.code = code;
|
|
3497
|
+
_this.originalMessage = originalMessage;
|
|
3498
|
+
return _this;
|
|
3499
|
+
}
|
|
3500
|
+
FormatError2.prototype.toString = function() {
|
|
3501
|
+
return "[formatjs Error: " + this.code + "] " + this.message;
|
|
3502
|
+
};
|
|
3503
|
+
return FormatError2;
|
|
3504
|
+
}(Error);
|
|
3505
|
+
var InvalidValueError = function(_super) {
|
|
3506
|
+
__extends(InvalidValueError2, _super);
|
|
3507
|
+
function InvalidValueError2(variableId, value, options, originalMessage) {
|
|
3508
|
+
return _super.call(this, 'Invalid values for "' + variableId + '": "' + value + '". Options are "' + Object.keys(options).join('", "') + '"', ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
3509
|
+
}
|
|
3510
|
+
return InvalidValueError2;
|
|
3511
|
+
}(FormatError);
|
|
3512
|
+
var InvalidValueTypeError = function(_super) {
|
|
3513
|
+
__extends(InvalidValueTypeError2, _super);
|
|
3514
|
+
function InvalidValueTypeError2(value, type, originalMessage) {
|
|
3515
|
+
return _super.call(this, 'Value for "' + value + '" must be of type ' + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
3516
|
+
}
|
|
3517
|
+
return InvalidValueTypeError2;
|
|
3518
|
+
}(FormatError);
|
|
3519
|
+
var MissingValueError = function(_super) {
|
|
3520
|
+
__extends(MissingValueError2, _super);
|
|
3521
|
+
function MissingValueError2(variableId, originalMessage) {
|
|
3522
|
+
return _super.call(this, 'The intl string context variable "' + variableId + '" was not provided to the string "' + originalMessage + '"', ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
3523
|
+
}
|
|
3524
|
+
return MissingValueError2;
|
|
3525
|
+
}(FormatError);
|
|
3526
|
+
|
|
3527
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/src/formatters.js
|
|
3528
|
+
var PART_TYPE;
|
|
3529
|
+
(function(PART_TYPE2) {
|
|
3530
|
+
PART_TYPE2[PART_TYPE2["literal"] = 0] = "literal";
|
|
3531
|
+
PART_TYPE2[PART_TYPE2["object"] = 1] = "object";
|
|
3532
|
+
})(PART_TYPE || (PART_TYPE = {}));
|
|
3533
|
+
function mergeLiteral(parts) {
|
|
3534
|
+
if (parts.length < 2) {
|
|
3535
|
+
return parts;
|
|
3536
|
+
}
|
|
3537
|
+
return parts.reduce(function(all, part) {
|
|
3538
|
+
var lastPart = all[all.length - 1];
|
|
3539
|
+
if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) {
|
|
3540
|
+
all.push(part);
|
|
3541
|
+
} else {
|
|
3542
|
+
lastPart.value += part.value;
|
|
3543
|
+
}
|
|
3544
|
+
return all;
|
|
3545
|
+
}, []);
|
|
3546
|
+
}
|
|
3547
|
+
function isFormatXMLElementFn(el) {
|
|
3548
|
+
return typeof el === "function";
|
|
3549
|
+
}
|
|
3550
|
+
function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
|
|
3551
|
+
if (els.length === 1 && isLiteralElement(els[0])) {
|
|
3552
|
+
return [
|
|
3553
|
+
{
|
|
3554
|
+
type: PART_TYPE.literal,
|
|
3555
|
+
value: els[0].value
|
|
3556
|
+
}
|
|
3557
|
+
];
|
|
3558
|
+
}
|
|
3559
|
+
var result = [];
|
|
3560
|
+
for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {
|
|
3561
|
+
var el = els_1[_i];
|
|
3562
|
+
if (isLiteralElement(el)) {
|
|
3563
|
+
result.push({
|
|
3564
|
+
type: PART_TYPE.literal,
|
|
3565
|
+
value: el.value
|
|
3566
|
+
});
|
|
3567
|
+
continue;
|
|
3568
|
+
}
|
|
3569
|
+
if (isPoundElement(el)) {
|
|
3570
|
+
if (typeof currentPluralValue === "number") {
|
|
3571
|
+
result.push({
|
|
3572
|
+
type: PART_TYPE.literal,
|
|
3573
|
+
value: formatters.getNumberFormat(locales).format(currentPluralValue)
|
|
3574
|
+
});
|
|
3575
|
+
}
|
|
3576
|
+
continue;
|
|
3577
|
+
}
|
|
3578
|
+
var varName = el.value;
|
|
3579
|
+
if (!(values && varName in values)) {
|
|
3580
|
+
throw new MissingValueError(varName, originalMessage);
|
|
3581
|
+
}
|
|
3582
|
+
var value = values[varName];
|
|
3583
|
+
if (isArgumentElement(el)) {
|
|
3584
|
+
if (!value || typeof value === "string" || typeof value === "number") {
|
|
3585
|
+
value = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
3586
|
+
}
|
|
3587
|
+
result.push({
|
|
3588
|
+
type: typeof value === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
3589
|
+
value: value
|
|
3590
|
+
});
|
|
3591
|
+
continue;
|
|
3592
|
+
}
|
|
3593
|
+
if (isDateElement(el)) {
|
|
3594
|
+
var style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3595
|
+
result.push({
|
|
3596
|
+
type: PART_TYPE.literal,
|
|
3597
|
+
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
3598
|
+
});
|
|
3599
|
+
continue;
|
|
3600
|
+
}
|
|
3601
|
+
if (isTimeElement(el)) {
|
|
3602
|
+
var style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3603
|
+
result.push({
|
|
3604
|
+
type: PART_TYPE.literal,
|
|
3605
|
+
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
3606
|
+
});
|
|
3607
|
+
continue;
|
|
3608
|
+
}
|
|
3609
|
+
if (isNumberElement(el)) {
|
|
3610
|
+
var style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3611
|
+
if (style && style.scale) {
|
|
3612
|
+
value = value * (style.scale || 1);
|
|
3613
|
+
}
|
|
3614
|
+
result.push({
|
|
3615
|
+
type: PART_TYPE.literal,
|
|
3616
|
+
value: formatters.getNumberFormat(locales, style).format(value)
|
|
3617
|
+
});
|
|
3618
|
+
continue;
|
|
3619
|
+
}
|
|
3620
|
+
if (isTagElement(el)) {
|
|
3621
|
+
var children = el.children, value_1 = el.value;
|
|
3622
|
+
var formatFn = values[value_1];
|
|
3623
|
+
if (!isFormatXMLElementFn(formatFn)) {
|
|
3624
|
+
throw new InvalidValueTypeError(value_1, "function", originalMessage);
|
|
3625
|
+
}
|
|
3626
|
+
var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
|
|
3627
|
+
var chunks = formatFn(parts.map(function(p) {
|
|
3628
|
+
return p.value;
|
|
3629
|
+
}));
|
|
3630
|
+
if (!Array.isArray(chunks)) {
|
|
3631
|
+
chunks = [chunks];
|
|
3632
|
+
}
|
|
3633
|
+
result.push.apply(result, chunks.map(function(c) {
|
|
3634
|
+
return {
|
|
3635
|
+
type: typeof c === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
3636
|
+
value: c
|
|
3637
|
+
};
|
|
3638
|
+
}));
|
|
3639
|
+
}
|
|
3640
|
+
if (isSelectElement(el)) {
|
|
3641
|
+
var opt = el.options[value] || el.options.other;
|
|
3642
|
+
if (!opt) {
|
|
3643
|
+
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
3644
|
+
}
|
|
3645
|
+
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
|
|
3646
|
+
continue;
|
|
3647
|
+
}
|
|
3648
|
+
if (isPluralElement(el)) {
|
|
3649
|
+
var opt = el.options["=" + value];
|
|
3650
|
+
if (!opt) {
|
|
3651
|
+
if (!Intl.PluralRules) {
|
|
3652
|
+
throw new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', ErrorCode.MISSING_INTL_API, originalMessage);
|
|
3653
|
+
}
|
|
3654
|
+
var rule = formatters.getPluralRules(locales, {type: el.pluralType}).select(value - (el.offset || 0));
|
|
3655
|
+
opt = el.options[rule] || el.options.other;
|
|
3656
|
+
}
|
|
3657
|
+
if (!opt) {
|
|
3658
|
+
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
3659
|
+
}
|
|
3660
|
+
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
|
|
3661
|
+
continue;
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
return mergeLiteral(result);
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/src/core.js
|
|
3668
|
+
function mergeConfig(c1, c2) {
|
|
3669
|
+
if (!c2) {
|
|
3670
|
+
return c1;
|
|
3671
|
+
}
|
|
3672
|
+
return __assign(__assign(__assign({}, c1 || {}), c2 || {}), Object.keys(c1).reduce(function(all, k) {
|
|
3673
|
+
all[k] = __assign(__assign({}, c1[k]), c2[k] || {});
|
|
3674
|
+
return all;
|
|
3675
|
+
}, {}));
|
|
3676
|
+
}
|
|
3677
|
+
function mergeConfigs(defaultConfig, configs) {
|
|
3678
|
+
if (!configs) {
|
|
3679
|
+
return defaultConfig;
|
|
3680
|
+
}
|
|
3681
|
+
return Object.keys(defaultConfig).reduce(function(all, k) {
|
|
3682
|
+
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
3683
|
+
return all;
|
|
3684
|
+
}, __assign({}, defaultConfig));
|
|
3685
|
+
}
|
|
3686
|
+
function createFastMemoizeCache(store) {
|
|
3687
|
+
return {
|
|
3688
|
+
create: function() {
|
|
3689
|
+
return {
|
|
3690
|
+
has: function(key) {
|
|
3691
|
+
return key in store;
|
|
3692
|
+
},
|
|
3693
|
+
get: function(key) {
|
|
3694
|
+
return store[key];
|
|
3695
|
+
},
|
|
3696
|
+
set: function(key, value) {
|
|
3697
|
+
store[key] = value;
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
}
|
|
3701
|
+
};
|
|
3702
|
+
}
|
|
3703
|
+
var _memoizeIntl = memoize.default || memoize;
|
|
3704
|
+
var memoizeIntl = _memoizeIntl;
|
|
3705
|
+
function createDefaultFormatters(cache) {
|
|
3706
|
+
if (cache === void 0) {
|
|
3707
|
+
cache = {
|
|
3708
|
+
number: {},
|
|
3709
|
+
dateTime: {},
|
|
3710
|
+
pluralRules: {}
|
|
3711
|
+
};
|
|
3712
|
+
}
|
|
3713
|
+
return {
|
|
3714
|
+
getNumberFormat: memoizeIntl(function() {
|
|
3715
|
+
var _a;
|
|
3716
|
+
var args = [];
|
|
3717
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3718
|
+
args[_i] = arguments[_i];
|
|
3719
|
+
}
|
|
3720
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
3721
|
+
}, {
|
|
3722
|
+
cache: createFastMemoizeCache(cache.number),
|
|
3723
|
+
strategy: memoizeIntl.strategies.variadic
|
|
3724
|
+
}),
|
|
3725
|
+
getDateTimeFormat: memoizeIntl(function() {
|
|
3726
|
+
var _a;
|
|
3727
|
+
var args = [];
|
|
3728
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3729
|
+
args[_i] = arguments[_i];
|
|
3730
|
+
}
|
|
3731
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
3732
|
+
}, {
|
|
3733
|
+
cache: createFastMemoizeCache(cache.dateTime),
|
|
3734
|
+
strategy: memoizeIntl.strategies.variadic
|
|
3735
|
+
}),
|
|
3736
|
+
getPluralRules: memoizeIntl(function() {
|
|
3737
|
+
var _a;
|
|
3738
|
+
var args = [];
|
|
3739
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3740
|
+
args[_i] = arguments[_i];
|
|
3741
|
+
}
|
|
3742
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
|
|
3743
|
+
}, {
|
|
3744
|
+
cache: createFastMemoizeCache(cache.pluralRules),
|
|
3745
|
+
strategy: memoizeIntl.strategies.variadic
|
|
3746
|
+
})
|
|
3747
|
+
};
|
|
3748
|
+
}
|
|
3749
|
+
var IntlMessageFormat = function() {
|
|
3750
|
+
function IntlMessageFormat2(message, locales, overrideFormats, opts) {
|
|
3751
|
+
var _this = this;
|
|
3752
|
+
if (locales === void 0) {
|
|
3753
|
+
locales = IntlMessageFormat2.defaultLocale;
|
|
3754
|
+
}
|
|
3755
|
+
this.formatterCache = {
|
|
3756
|
+
number: {},
|
|
3757
|
+
dateTime: {},
|
|
3758
|
+
pluralRules: {}
|
|
3759
|
+
};
|
|
3760
|
+
this.format = function(values) {
|
|
3761
|
+
var parts = _this.formatToParts(values);
|
|
3762
|
+
if (parts.length === 1) {
|
|
3763
|
+
return parts[0].value;
|
|
3764
|
+
}
|
|
3765
|
+
var result = parts.reduce(function(all, part) {
|
|
3766
|
+
if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") {
|
|
3767
|
+
all.push(part.value);
|
|
3768
|
+
} else {
|
|
3769
|
+
all[all.length - 1] += part.value;
|
|
3770
|
+
}
|
|
3771
|
+
return all;
|
|
3772
|
+
}, []);
|
|
3773
|
+
if (result.length <= 1) {
|
|
3774
|
+
return result[0] || "";
|
|
3775
|
+
}
|
|
3776
|
+
return result;
|
|
3777
|
+
};
|
|
3778
|
+
this.formatToParts = function(values) {
|
|
3779
|
+
return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message);
|
|
3780
|
+
};
|
|
3781
|
+
this.resolvedOptions = function() {
|
|
3782
|
+
return {
|
|
3783
|
+
locale: Intl.NumberFormat.supportedLocalesOf(_this.locales)[0]
|
|
3784
|
+
};
|
|
3785
|
+
};
|
|
3786
|
+
this.getAst = function() {
|
|
3787
|
+
return _this.ast;
|
|
3788
|
+
};
|
|
3789
|
+
if (typeof message === "string") {
|
|
3790
|
+
this.message = message;
|
|
3791
|
+
if (!IntlMessageFormat2.__parse) {
|
|
3792
|
+
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3793
|
+
}
|
|
3794
|
+
this.ast = IntlMessageFormat2.__parse(message, {
|
|
3795
|
+
normalizeHashtagInPlural: false,
|
|
3796
|
+
ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag
|
|
3797
|
+
});
|
|
3798
|
+
} else {
|
|
3799
|
+
this.ast = message;
|
|
3800
|
+
}
|
|
3801
|
+
if (!Array.isArray(this.ast)) {
|
|
3802
|
+
throw new TypeError("A message must be provided as a String or AST.");
|
|
3803
|
+
}
|
|
3804
|
+
this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats);
|
|
3805
|
+
this.locales = locales;
|
|
3806
|
+
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
3807
|
+
}
|
|
3808
|
+
Object.defineProperty(IntlMessageFormat2, "defaultLocale", {
|
|
3809
|
+
get: function() {
|
|
3810
|
+
if (!IntlMessageFormat2.memoizedDefaultLocale) {
|
|
3811
|
+
IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3812
|
+
}
|
|
3813
|
+
return IntlMessageFormat2.memoizedDefaultLocale;
|
|
3814
|
+
},
|
|
3815
|
+
enumerable: false,
|
|
3816
|
+
configurable: true
|
|
3817
|
+
});
|
|
3818
|
+
IntlMessageFormat2.memoizedDefaultLocale = null;
|
|
3819
|
+
IntlMessageFormat2.__parse = parse;
|
|
3820
|
+
IntlMessageFormat2.formats = {
|
|
3821
|
+
number: {
|
|
3822
|
+
currency: {
|
|
3823
|
+
style: "currency"
|
|
3824
|
+
},
|
|
3825
|
+
percent: {
|
|
3826
|
+
style: "percent"
|
|
3827
|
+
}
|
|
3828
|
+
},
|
|
3829
|
+
date: {
|
|
3830
|
+
short: {
|
|
3831
|
+
month: "numeric",
|
|
3832
|
+
day: "numeric",
|
|
3833
|
+
year: "2-digit"
|
|
3834
|
+
},
|
|
3835
|
+
medium: {
|
|
3836
|
+
month: "short",
|
|
3837
|
+
day: "numeric",
|
|
3838
|
+
year: "numeric"
|
|
3839
|
+
},
|
|
3840
|
+
long: {
|
|
3841
|
+
month: "long",
|
|
3842
|
+
day: "numeric",
|
|
3843
|
+
year: "numeric"
|
|
3844
|
+
},
|
|
3845
|
+
full: {
|
|
3846
|
+
weekday: "long",
|
|
3847
|
+
month: "long",
|
|
3848
|
+
day: "numeric",
|
|
3849
|
+
year: "numeric"
|
|
3850
|
+
}
|
|
3851
|
+
},
|
|
3852
|
+
time: {
|
|
3853
|
+
short: {
|
|
3854
|
+
hour: "numeric",
|
|
3855
|
+
minute: "numeric"
|
|
3856
|
+
},
|
|
3857
|
+
medium: {
|
|
3858
|
+
hour: "numeric",
|
|
3859
|
+
minute: "numeric",
|
|
3860
|
+
second: "numeric"
|
|
3861
|
+
},
|
|
3862
|
+
long: {
|
|
3863
|
+
hour: "numeric",
|
|
3864
|
+
minute: "numeric",
|
|
3865
|
+
second: "numeric",
|
|
3866
|
+
timeZoneName: "short"
|
|
3867
|
+
},
|
|
3868
|
+
full: {
|
|
3869
|
+
hour: "numeric",
|
|
3870
|
+
minute: "numeric",
|
|
3871
|
+
second: "numeric",
|
|
3872
|
+
timeZoneName: "short"
|
|
3873
|
+
}
|
|
3874
|
+
}
|
|
3875
|
+
};
|
|
3876
|
+
return IntlMessageFormat2;
|
|
3877
|
+
}();
|
|
3878
|
+
|
|
3879
|
+
// bazel-out/k8-fastbuild/bin/packages/intl-messageformat/lib/index.js
|
|
3880
|
+
var lib_default = IntlMessageFormat;
|
|
3881
|
+
return lib_exports;
|
|
3882
|
+
})();
|
|
3883
|
+
//# sourceMappingURL=intl-messageformat.iife.js.map
|