react-intl 3.9.2 → 3.12.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/CHANGELOG.md +27 -0
- package/dist/components/createFormattedComponent.d.ts +2 -1
- package/dist/components/createFormattedComponent.js +7 -2
- package/dist/components/html-message.js +1 -1
- package/dist/components/injectIntl.d.ts +1 -1
- package/dist/components/message.js +13 -4
- package/dist/components/plural.d.ts +1 -1
- package/dist/components/provider.js +3 -2
- package/dist/components/relative.js +3 -10
- package/dist/formatters/dateTime.js +2 -2
- package/dist/formatters/displayName.d.ts +2 -0
- package/dist/formatters/displayName.js +25 -0
- package/dist/formatters/message.d.ts +1 -0
- package/dist/formatters/message.js +19 -18
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -0
- package/dist/react-intl.api.md +22 -5
- package/dist/react-intl.d.ts +42 -9
- package/dist/react-intl.js +595 -389
- package/dist/react-intl.js.map +1 -1
- package/dist/react-intl.min.js +1 -1
- package/dist/react-intl.min.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +5 -7
- package/lib/components/createFormattedComponent.d.ts +2 -1
- package/lib/components/createFormattedComponent.js +7 -2
- package/lib/components/html-message.js +1 -1
- package/lib/components/injectIntl.d.ts +1 -1
- package/lib/components/message.js +5 -3
- package/lib/components/plural.d.ts +1 -1
- package/lib/components/provider.js +3 -2
- package/lib/components/relative.js +3 -10
- package/lib/formatters/dateTime.js +2 -2
- package/lib/formatters/displayName.d.ts +2 -0
- package/lib/formatters/displayName.js +22 -0
- package/lib/formatters/message.d.ts +1 -0
- package/lib/formatters/message.js +12 -18
- package/lib/index.d.ts +6 -2
- package/lib/index.js +1 -0
- package/lib/react-intl.d.ts +18 -5
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +6 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +4 -6
- package/package.json +28 -27
- package/src/components/createFormattedComponent.tsx +5 -0
- package/src/components/provider.tsx +7 -1
- package/src/components/relative.tsx +6 -15
- package/src/formatters/displayName.ts +35 -0
- package/src/formatters/message.ts +13 -18
- package/src/index.ts +4 -0
- package/src/types.ts +16 -5
- package/src/utils.ts +5 -7
package/dist/react-intl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2020, Yahoo Inc.
|
|
3
3
|
* Copyrights licensed under the New BSD License.
|
|
4
4
|
* See the accompanying LICENSE file for terms.
|
|
5
5
|
*/
|
|
@@ -195,6 +195,12 @@
|
|
|
195
195
|
*/
|
|
196
196
|
|
|
197
197
|
TYPE[TYPE["plural"] = 6] = "plural";
|
|
198
|
+
/**
|
|
199
|
+
* Only possible within plural argument.
|
|
200
|
+
* This is the `#` symbol that will be substituted with the count.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
TYPE[TYPE["pound"] = 7] = "pound";
|
|
198
204
|
})(TYPE || (TYPE = {}));
|
|
199
205
|
/**
|
|
200
206
|
* Type Guards
|
|
@@ -222,6 +228,9 @@
|
|
|
222
228
|
function isPluralElement(el) {
|
|
223
229
|
return el.type === TYPE.plural;
|
|
224
230
|
}
|
|
231
|
+
function isPoundElement(el) {
|
|
232
|
+
return el.type === TYPE.pound;
|
|
233
|
+
}
|
|
225
234
|
function isNumberSkeleton(el) {
|
|
226
235
|
return !!(el && _typeof(el) === 'object' && el.type === 0
|
|
227
236
|
/* number */
|
|
@@ -405,41 +414,50 @@
|
|
|
405
414
|
}, insertLocation());
|
|
406
415
|
};
|
|
407
416
|
|
|
408
|
-
var peg$c2 =
|
|
409
|
-
var peg$c3 = "
|
|
410
|
-
|
|
411
|
-
var peg$
|
|
412
|
-
|
|
417
|
+
var peg$c2 = "#";
|
|
418
|
+
var peg$c3 = peg$literalExpectation("#", false);
|
|
419
|
+
|
|
420
|
+
var peg$c4 = function peg$c4() {
|
|
421
|
+
return __assign({
|
|
422
|
+
type: TYPE.pound
|
|
423
|
+
}, insertLocation());
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
var peg$c5 = peg$otherExpectation("argumentElement");
|
|
427
|
+
var peg$c6 = "{";
|
|
428
|
+
var peg$c7 = peg$literalExpectation("{", false);
|
|
429
|
+
var peg$c8 = "}";
|
|
430
|
+
var peg$c9 = peg$literalExpectation("}", false);
|
|
413
431
|
|
|
414
|
-
var peg$
|
|
432
|
+
var peg$c10 = function peg$c10(value) {
|
|
415
433
|
return __assign({
|
|
416
434
|
type: TYPE.argument,
|
|
417
435
|
value: value
|
|
418
436
|
}, insertLocation());
|
|
419
437
|
};
|
|
420
438
|
|
|
421
|
-
var peg$
|
|
422
|
-
var peg$
|
|
423
|
-
var peg$
|
|
424
|
-
var peg$
|
|
425
|
-
var peg$
|
|
426
|
-
var peg$
|
|
427
|
-
var peg$
|
|
439
|
+
var peg$c11 = peg$otherExpectation("numberSkeletonId");
|
|
440
|
+
var peg$c12 = /^['\/{}]/;
|
|
441
|
+
var peg$c13 = peg$classExpectation(["'", "/", "{", "}"], false, false);
|
|
442
|
+
var peg$c14 = peg$anyExpectation();
|
|
443
|
+
var peg$c15 = peg$otherExpectation("numberSkeletonTokenOption");
|
|
444
|
+
var peg$c16 = "/";
|
|
445
|
+
var peg$c17 = peg$literalExpectation("/", false);
|
|
428
446
|
|
|
429
|
-
var peg$
|
|
447
|
+
var peg$c18 = function peg$c18(option) {
|
|
430
448
|
return option;
|
|
431
449
|
};
|
|
432
450
|
|
|
433
|
-
var peg$
|
|
451
|
+
var peg$c19 = peg$otherExpectation("numberSkeletonToken");
|
|
434
452
|
|
|
435
|
-
var peg$
|
|
453
|
+
var peg$c20 = function peg$c20(stem, options) {
|
|
436
454
|
return {
|
|
437
455
|
stem: stem,
|
|
438
456
|
options: options
|
|
439
457
|
};
|
|
440
458
|
};
|
|
441
459
|
|
|
442
|
-
var peg$
|
|
460
|
+
var peg$c21 = function peg$c21(tokens) {
|
|
443
461
|
return __assign({
|
|
444
462
|
type: 0
|
|
445
463
|
/* number */
|
|
@@ -448,23 +466,29 @@
|
|
|
448
466
|
}, insertLocation());
|
|
449
467
|
};
|
|
450
468
|
|
|
451
|
-
var peg$
|
|
452
|
-
var peg$
|
|
469
|
+
var peg$c22 = "::";
|
|
470
|
+
var peg$c23 = peg$literalExpectation("::", false);
|
|
453
471
|
|
|
454
|
-
var peg$
|
|
472
|
+
var peg$c24 = function peg$c24(skeleton) {
|
|
455
473
|
return skeleton;
|
|
456
474
|
};
|
|
457
475
|
|
|
458
|
-
var peg$
|
|
476
|
+
var peg$c25 = function peg$c25() {
|
|
477
|
+
messageCtx.push('numberArgStyle');
|
|
478
|
+
return true;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
var peg$c26 = function peg$c26(style) {
|
|
482
|
+
messageCtx.pop();
|
|
459
483
|
return style.replace(/\s*$/, '');
|
|
460
484
|
};
|
|
461
485
|
|
|
462
|
-
var peg$
|
|
463
|
-
var peg$
|
|
464
|
-
var peg$
|
|
465
|
-
var peg$
|
|
486
|
+
var peg$c27 = ",";
|
|
487
|
+
var peg$c28 = peg$literalExpectation(",", false);
|
|
488
|
+
var peg$c29 = "number";
|
|
489
|
+
var peg$c30 = peg$literalExpectation("number", false);
|
|
466
490
|
|
|
467
|
-
var peg$
|
|
491
|
+
var peg$c31 = function peg$c31(value, type, style) {
|
|
468
492
|
return __assign({
|
|
469
493
|
type: type === 'number' ? TYPE.number : type === 'date' ? TYPE.date : TYPE.time,
|
|
470
494
|
style: style && style[2],
|
|
@@ -472,16 +496,16 @@
|
|
|
472
496
|
}, insertLocation());
|
|
473
497
|
};
|
|
474
498
|
|
|
475
|
-
var peg$
|
|
476
|
-
var peg$
|
|
477
|
-
var peg$
|
|
478
|
-
var peg$
|
|
479
|
-
var peg$
|
|
480
|
-
var peg$
|
|
481
|
-
var peg$
|
|
482
|
-
var peg$
|
|
499
|
+
var peg$c32 = "'";
|
|
500
|
+
var peg$c33 = peg$literalExpectation("'", false);
|
|
501
|
+
var peg$c34 = /^[^']/;
|
|
502
|
+
var peg$c35 = peg$classExpectation(["'"], true, false);
|
|
503
|
+
var peg$c36 = /^[^a-zA-Z'{}]/;
|
|
504
|
+
var peg$c37 = peg$classExpectation([["a", "z"], ["A", "Z"], "'", "{", "}"], true, false);
|
|
505
|
+
var peg$c38 = /^[a-zA-Z]/;
|
|
506
|
+
var peg$c39 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
|
|
483
507
|
|
|
484
|
-
var peg$
|
|
508
|
+
var peg$c40 = function peg$c40(pattern) {
|
|
485
509
|
return __assign({
|
|
486
510
|
type: 1
|
|
487
511
|
/* dateTime */
|
|
@@ -490,18 +514,23 @@
|
|
|
490
514
|
}, insertLocation());
|
|
491
515
|
};
|
|
492
516
|
|
|
493
|
-
var peg$
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
var peg$c42 =
|
|
499
|
-
var peg$c43 = "
|
|
500
|
-
var peg$c44 =
|
|
501
|
-
var peg$c45 = "
|
|
502
|
-
var peg$c46 =
|
|
503
|
-
|
|
504
|
-
var peg$
|
|
517
|
+
var peg$c41 = function peg$c41() {
|
|
518
|
+
messageCtx.push('dateOrTimeArgStyle');
|
|
519
|
+
return true;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
var peg$c42 = "date";
|
|
523
|
+
var peg$c43 = peg$literalExpectation("date", false);
|
|
524
|
+
var peg$c44 = "time";
|
|
525
|
+
var peg$c45 = peg$literalExpectation("time", false);
|
|
526
|
+
var peg$c46 = "plural";
|
|
527
|
+
var peg$c47 = peg$literalExpectation("plural", false);
|
|
528
|
+
var peg$c48 = "selectordinal";
|
|
529
|
+
var peg$c49 = peg$literalExpectation("selectordinal", false);
|
|
530
|
+
var peg$c50 = "offset:";
|
|
531
|
+
var peg$c51 = peg$literalExpectation("offset:", false);
|
|
532
|
+
|
|
533
|
+
var peg$c52 = function peg$c52(value, pluralType, offset, options) {
|
|
505
534
|
return __assign({
|
|
506
535
|
type: TYPE.plural,
|
|
507
536
|
pluralType: pluralType === 'plural' ? 'cardinal' : 'ordinal',
|
|
@@ -525,10 +554,10 @@
|
|
|
525
554
|
}, insertLocation());
|
|
526
555
|
};
|
|
527
556
|
|
|
528
|
-
var peg$
|
|
529
|
-
var peg$
|
|
557
|
+
var peg$c53 = "select";
|
|
558
|
+
var peg$c54 = peg$literalExpectation("select", false);
|
|
530
559
|
|
|
531
|
-
var peg$
|
|
560
|
+
var peg$c55 = function peg$c55(value, options) {
|
|
532
561
|
return __assign({
|
|
533
562
|
type: TYPE.select,
|
|
534
563
|
value: value,
|
|
@@ -550,73 +579,91 @@
|
|
|
550
579
|
}, insertLocation());
|
|
551
580
|
};
|
|
552
581
|
|
|
553
|
-
var peg$
|
|
554
|
-
var peg$
|
|
582
|
+
var peg$c56 = "=";
|
|
583
|
+
var peg$c57 = peg$literalExpectation("=", false);
|
|
584
|
+
|
|
585
|
+
var peg$c58 = function peg$c58(id) {
|
|
586
|
+
messageCtx.push('select');
|
|
587
|
+
return true;
|
|
588
|
+
};
|
|
555
589
|
|
|
556
|
-
var peg$
|
|
590
|
+
var peg$c59 = function peg$c59(id, value) {
|
|
591
|
+
messageCtx.pop();
|
|
557
592
|
return __assign({
|
|
558
593
|
id: id,
|
|
559
594
|
value: value
|
|
560
595
|
}, insertLocation());
|
|
561
596
|
};
|
|
562
597
|
|
|
563
|
-
var peg$
|
|
598
|
+
var peg$c60 = function peg$c60(id) {
|
|
599
|
+
messageCtx.push('plural');
|
|
600
|
+
return true;
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
var peg$c61 = function peg$c61(id, value) {
|
|
604
|
+
messageCtx.pop();
|
|
564
605
|
return __assign({
|
|
565
606
|
id: id,
|
|
566
607
|
value: value
|
|
567
608
|
}, insertLocation());
|
|
568
609
|
};
|
|
569
610
|
|
|
570
|
-
var peg$
|
|
571
|
-
var peg$
|
|
572
|
-
var peg$
|
|
573
|
-
var peg$
|
|
574
|
-
var peg$
|
|
575
|
-
var peg$
|
|
576
|
-
var peg$
|
|
577
|
-
var peg$
|
|
578
|
-
var peg$
|
|
579
|
-
var peg$
|
|
580
|
-
|
|
581
|
-
var peg$
|
|
611
|
+
var peg$c62 = peg$otherExpectation("whitespace pattern");
|
|
612
|
+
var peg$c63 = /^[\t-\r \x85\u200E\u200F\u2028\u2029]/;
|
|
613
|
+
var peg$c64 = peg$classExpectation([["\t", "\r"], " ", "\x85", "\u200E", "\u200F", "\u2028", "\u2029"], false, false);
|
|
614
|
+
var peg$c65 = peg$otherExpectation("syntax pattern");
|
|
615
|
+
var peg$c66 = /^[!-\/:-@[-\^`{-~\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]/;
|
|
616
|
+
var peg$c67 = 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);
|
|
617
|
+
var peg$c68 = peg$otherExpectation("optional whitespace");
|
|
618
|
+
var peg$c69 = peg$otherExpectation("number");
|
|
619
|
+
var peg$c70 = "-";
|
|
620
|
+
var peg$c71 = peg$literalExpectation("-", false);
|
|
621
|
+
|
|
622
|
+
var peg$c72 = function peg$c72(negative, num) {
|
|
582
623
|
return num ? negative ? -num : num : 0;
|
|
583
624
|
};
|
|
584
|
-
var peg$
|
|
585
|
-
var peg$
|
|
586
|
-
var peg$
|
|
625
|
+
var peg$c74 = peg$otherExpectation("double apostrophes");
|
|
626
|
+
var peg$c75 = "''";
|
|
627
|
+
var peg$c76 = peg$literalExpectation("''", false);
|
|
587
628
|
|
|
588
|
-
var peg$
|
|
629
|
+
var peg$c77 = function peg$c77() {
|
|
589
630
|
return "'";
|
|
590
631
|
};
|
|
591
632
|
|
|
592
|
-
var peg$
|
|
593
|
-
var peg$c72 = peg$classExpectation(["{", "}"], false, false);
|
|
594
|
-
|
|
595
|
-
var peg$c73 = function peg$c73(escapedChar, quotedChars) {
|
|
633
|
+
var peg$c78 = function peg$c78(escapedChar, quotedChars) {
|
|
596
634
|
return escapedChar + quotedChars.replace("''", "'");
|
|
597
635
|
};
|
|
598
636
|
|
|
599
|
-
var peg$
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
var peg$
|
|
604
|
-
var peg$
|
|
637
|
+
var peg$c79 = function peg$c79(x) {
|
|
638
|
+
return x !== '{' && !(isInPluralOption() && x === '#') && !(isNestedMessageText() && x === '}');
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
var peg$c80 = "\n";
|
|
642
|
+
var peg$c81 = peg$literalExpectation("\n", false);
|
|
643
|
+
|
|
644
|
+
var peg$c82 = function peg$c82(x) {
|
|
645
|
+
return x === '{' || x === '}' || isInPluralOption() && x === '#';
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
var peg$c83 = peg$otherExpectation("argNameOrNumber");
|
|
649
|
+
var peg$c84 = peg$otherExpectation("argNumber");
|
|
650
|
+
var peg$c85 = "0";
|
|
651
|
+
var peg$c86 = peg$literalExpectation("0", false);
|
|
605
652
|
|
|
606
|
-
var peg$
|
|
653
|
+
var peg$c87 = function peg$c87() {
|
|
607
654
|
return 0;
|
|
608
655
|
};
|
|
609
656
|
|
|
610
|
-
var peg$
|
|
611
|
-
var peg$
|
|
612
|
-
var peg$
|
|
613
|
-
var peg$
|
|
657
|
+
var peg$c88 = /^[1-9]/;
|
|
658
|
+
var peg$c89 = peg$classExpectation([["1", "9"]], false, false);
|
|
659
|
+
var peg$c90 = /^[0-9]/;
|
|
660
|
+
var peg$c91 = peg$classExpectation([["0", "9"]], false, false);
|
|
614
661
|
|
|
615
|
-
var peg$
|
|
662
|
+
var peg$c92 = function peg$c92(digits) {
|
|
616
663
|
return parseInt(digits.join(''), 10);
|
|
617
664
|
};
|
|
618
665
|
|
|
619
|
-
var peg$
|
|
666
|
+
var peg$c93 = peg$otherExpectation("argName");
|
|
620
667
|
var peg$currPos = 0;
|
|
621
668
|
var peg$savedPos = 0;
|
|
622
669
|
var peg$posDetailsCache = [{
|
|
@@ -792,6 +839,10 @@
|
|
|
792
839
|
|
|
793
840
|
if (s0 === peg$FAILED) {
|
|
794
841
|
s0 = peg$parseselectElement();
|
|
842
|
+
|
|
843
|
+
if (s0 === peg$FAILED) {
|
|
844
|
+
s0 = peg$parsepoundElement();
|
|
845
|
+
}
|
|
795
846
|
}
|
|
796
847
|
}
|
|
797
848
|
}
|
|
@@ -854,19 +905,43 @@
|
|
|
854
905
|
return s0;
|
|
855
906
|
}
|
|
856
907
|
|
|
908
|
+
function peg$parsepoundElement() {
|
|
909
|
+
var s0, s1;
|
|
910
|
+
s0 = peg$currPos;
|
|
911
|
+
|
|
912
|
+
if (input.charCodeAt(peg$currPos) === 35) {
|
|
913
|
+
s1 = peg$c2;
|
|
914
|
+
peg$currPos++;
|
|
915
|
+
} else {
|
|
916
|
+
s1 = peg$FAILED;
|
|
917
|
+
|
|
918
|
+
if (peg$silentFails === 0) {
|
|
919
|
+
peg$fail(peg$c3);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (s1 !== peg$FAILED) {
|
|
924
|
+
peg$savedPos = s0;
|
|
925
|
+
s1 = peg$c4();
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
s0 = s1;
|
|
929
|
+
return s0;
|
|
930
|
+
}
|
|
931
|
+
|
|
857
932
|
function peg$parseargumentElement() {
|
|
858
933
|
var s0, s1, s2, s3, s4, s5;
|
|
859
934
|
peg$silentFails++;
|
|
860
935
|
s0 = peg$currPos;
|
|
861
936
|
|
|
862
937
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
863
|
-
s1 = peg$
|
|
938
|
+
s1 = peg$c6;
|
|
864
939
|
peg$currPos++;
|
|
865
940
|
} else {
|
|
866
941
|
s1 = peg$FAILED;
|
|
867
942
|
|
|
868
943
|
if (peg$silentFails === 0) {
|
|
869
|
-
peg$fail(peg$
|
|
944
|
+
peg$fail(peg$c7);
|
|
870
945
|
}
|
|
871
946
|
}
|
|
872
947
|
|
|
@@ -881,19 +956,19 @@
|
|
|
881
956
|
|
|
882
957
|
if (s4 !== peg$FAILED) {
|
|
883
958
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
884
|
-
s5 = peg$
|
|
959
|
+
s5 = peg$c8;
|
|
885
960
|
peg$currPos++;
|
|
886
961
|
} else {
|
|
887
962
|
s5 = peg$FAILED;
|
|
888
963
|
|
|
889
964
|
if (peg$silentFails === 0) {
|
|
890
|
-
peg$fail(peg$
|
|
965
|
+
peg$fail(peg$c9);
|
|
891
966
|
}
|
|
892
967
|
}
|
|
893
968
|
|
|
894
969
|
if (s5 !== peg$FAILED) {
|
|
895
970
|
peg$savedPos = s0;
|
|
896
|
-
s1 = peg$
|
|
971
|
+
s1 = peg$c10(s3);
|
|
897
972
|
s0 = s1;
|
|
898
973
|
} else {
|
|
899
974
|
peg$currPos = s0;
|
|
@@ -922,7 +997,7 @@
|
|
|
922
997
|
s1 = peg$FAILED;
|
|
923
998
|
|
|
924
999
|
if (peg$silentFails === 0) {
|
|
925
|
-
peg$fail(peg$
|
|
1000
|
+
peg$fail(peg$c5);
|
|
926
1001
|
}
|
|
927
1002
|
}
|
|
928
1003
|
|
|
@@ -940,14 +1015,14 @@
|
|
|
940
1015
|
s4 = peg$parsepatternWhiteSpace();
|
|
941
1016
|
|
|
942
1017
|
if (s4 === peg$FAILED) {
|
|
943
|
-
if (peg$
|
|
1018
|
+
if (peg$c12.test(input.charAt(peg$currPos))) {
|
|
944
1019
|
s4 = input.charAt(peg$currPos);
|
|
945
1020
|
peg$currPos++;
|
|
946
1021
|
} else {
|
|
947
1022
|
s4 = peg$FAILED;
|
|
948
1023
|
|
|
949
1024
|
if (peg$silentFails === 0) {
|
|
950
|
-
peg$fail(peg$
|
|
1025
|
+
peg$fail(peg$c13);
|
|
951
1026
|
}
|
|
952
1027
|
}
|
|
953
1028
|
}
|
|
@@ -969,7 +1044,7 @@
|
|
|
969
1044
|
s4 = peg$FAILED;
|
|
970
1045
|
|
|
971
1046
|
if (peg$silentFails === 0) {
|
|
972
|
-
peg$fail(peg$
|
|
1047
|
+
peg$fail(peg$c14);
|
|
973
1048
|
}
|
|
974
1049
|
}
|
|
975
1050
|
|
|
@@ -994,14 +1069,14 @@
|
|
|
994
1069
|
s4 = peg$parsepatternWhiteSpace();
|
|
995
1070
|
|
|
996
1071
|
if (s4 === peg$FAILED) {
|
|
997
|
-
if (peg$
|
|
1072
|
+
if (peg$c12.test(input.charAt(peg$currPos))) {
|
|
998
1073
|
s4 = input.charAt(peg$currPos);
|
|
999
1074
|
peg$currPos++;
|
|
1000
1075
|
} else {
|
|
1001
1076
|
s4 = peg$FAILED;
|
|
1002
1077
|
|
|
1003
1078
|
if (peg$silentFails === 0) {
|
|
1004
|
-
peg$fail(peg$
|
|
1079
|
+
peg$fail(peg$c13);
|
|
1005
1080
|
}
|
|
1006
1081
|
}
|
|
1007
1082
|
}
|
|
@@ -1023,7 +1098,7 @@
|
|
|
1023
1098
|
s4 = peg$FAILED;
|
|
1024
1099
|
|
|
1025
1100
|
if (peg$silentFails === 0) {
|
|
1026
|
-
peg$fail(peg$
|
|
1101
|
+
peg$fail(peg$c14);
|
|
1027
1102
|
}
|
|
1028
1103
|
}
|
|
1029
1104
|
|
|
@@ -1055,7 +1130,7 @@
|
|
|
1055
1130
|
s1 = peg$FAILED;
|
|
1056
1131
|
|
|
1057
1132
|
if (peg$silentFails === 0) {
|
|
1058
|
-
peg$fail(peg$
|
|
1133
|
+
peg$fail(peg$c11);
|
|
1059
1134
|
}
|
|
1060
1135
|
}
|
|
1061
1136
|
|
|
@@ -1068,13 +1143,13 @@
|
|
|
1068
1143
|
s0 = peg$currPos;
|
|
1069
1144
|
|
|
1070
1145
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
1071
|
-
s1 = peg$
|
|
1146
|
+
s1 = peg$c16;
|
|
1072
1147
|
peg$currPos++;
|
|
1073
1148
|
} else {
|
|
1074
1149
|
s1 = peg$FAILED;
|
|
1075
1150
|
|
|
1076
1151
|
if (peg$silentFails === 0) {
|
|
1077
|
-
peg$fail(peg$
|
|
1152
|
+
peg$fail(peg$c17);
|
|
1078
1153
|
}
|
|
1079
1154
|
}
|
|
1080
1155
|
|
|
@@ -1083,7 +1158,7 @@
|
|
|
1083
1158
|
|
|
1084
1159
|
if (s2 !== peg$FAILED) {
|
|
1085
1160
|
peg$savedPos = s0;
|
|
1086
|
-
s1 = peg$
|
|
1161
|
+
s1 = peg$c18(s2);
|
|
1087
1162
|
s0 = s1;
|
|
1088
1163
|
} else {
|
|
1089
1164
|
peg$currPos = s0;
|
|
@@ -1100,7 +1175,7 @@
|
|
|
1100
1175
|
s1 = peg$FAILED;
|
|
1101
1176
|
|
|
1102
1177
|
if (peg$silentFails === 0) {
|
|
1103
|
-
peg$fail(peg$
|
|
1178
|
+
peg$fail(peg$c15);
|
|
1104
1179
|
}
|
|
1105
1180
|
}
|
|
1106
1181
|
|
|
@@ -1127,7 +1202,7 @@
|
|
|
1127
1202
|
|
|
1128
1203
|
if (s3 !== peg$FAILED) {
|
|
1129
1204
|
peg$savedPos = s0;
|
|
1130
|
-
s1 = peg$
|
|
1205
|
+
s1 = peg$c20(s2, s3);
|
|
1131
1206
|
s0 = s1;
|
|
1132
1207
|
} else {
|
|
1133
1208
|
peg$currPos = s0;
|
|
@@ -1148,7 +1223,7 @@
|
|
|
1148
1223
|
s1 = peg$FAILED;
|
|
1149
1224
|
|
|
1150
1225
|
if (peg$silentFails === 0) {
|
|
1151
|
-
peg$fail(peg$
|
|
1226
|
+
peg$fail(peg$c19);
|
|
1152
1227
|
}
|
|
1153
1228
|
}
|
|
1154
1229
|
|
|
@@ -1172,7 +1247,7 @@
|
|
|
1172
1247
|
|
|
1173
1248
|
if (s1 !== peg$FAILED) {
|
|
1174
1249
|
peg$savedPos = s0;
|
|
1175
|
-
s1 = peg$
|
|
1250
|
+
s1 = peg$c21(s1);
|
|
1176
1251
|
}
|
|
1177
1252
|
|
|
1178
1253
|
s0 = s1;
|
|
@@ -1183,14 +1258,14 @@
|
|
|
1183
1258
|
var s0, s1, s2;
|
|
1184
1259
|
s0 = peg$currPos;
|
|
1185
1260
|
|
|
1186
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
1187
|
-
s1 = peg$
|
|
1261
|
+
if (input.substr(peg$currPos, 2) === peg$c22) {
|
|
1262
|
+
s1 = peg$c22;
|
|
1188
1263
|
peg$currPos += 2;
|
|
1189
1264
|
} else {
|
|
1190
1265
|
s1 = peg$FAILED;
|
|
1191
1266
|
|
|
1192
1267
|
if (peg$silentFails === 0) {
|
|
1193
|
-
peg$fail(peg$
|
|
1268
|
+
peg$fail(peg$c23);
|
|
1194
1269
|
}
|
|
1195
1270
|
}
|
|
1196
1271
|
|
|
@@ -1199,7 +1274,7 @@
|
|
|
1199
1274
|
|
|
1200
1275
|
if (s2 !== peg$FAILED) {
|
|
1201
1276
|
peg$savedPos = s0;
|
|
1202
|
-
s1 = peg$
|
|
1277
|
+
s1 = peg$c24(s2);
|
|
1203
1278
|
s0 = s1;
|
|
1204
1279
|
} else {
|
|
1205
1280
|
peg$currPos = s0;
|
|
@@ -1212,14 +1287,30 @@
|
|
|
1212
1287
|
|
|
1213
1288
|
if (s0 === peg$FAILED) {
|
|
1214
1289
|
s0 = peg$currPos;
|
|
1215
|
-
|
|
1290
|
+
peg$savedPos = peg$currPos;
|
|
1291
|
+
s1 = peg$c25();
|
|
1216
1292
|
|
|
1217
|
-
if (s1
|
|
1218
|
-
|
|
1219
|
-
|
|
1293
|
+
if (s1) {
|
|
1294
|
+
s1 = undefined;
|
|
1295
|
+
} else {
|
|
1296
|
+
s1 = peg$FAILED;
|
|
1220
1297
|
}
|
|
1221
1298
|
|
|
1222
|
-
|
|
1299
|
+
if (s1 !== peg$FAILED) {
|
|
1300
|
+
s2 = peg$parsemessageText();
|
|
1301
|
+
|
|
1302
|
+
if (s2 !== peg$FAILED) {
|
|
1303
|
+
peg$savedPos = s0;
|
|
1304
|
+
s1 = peg$c26(s2);
|
|
1305
|
+
s0 = s1;
|
|
1306
|
+
} else {
|
|
1307
|
+
peg$currPos = s0;
|
|
1308
|
+
s0 = peg$FAILED;
|
|
1309
|
+
}
|
|
1310
|
+
} else {
|
|
1311
|
+
peg$currPos = s0;
|
|
1312
|
+
s0 = peg$FAILED;
|
|
1313
|
+
}
|
|
1223
1314
|
}
|
|
1224
1315
|
|
|
1225
1316
|
return s0;
|
|
@@ -1230,13 +1321,13 @@
|
|
|
1230
1321
|
s0 = peg$currPos;
|
|
1231
1322
|
|
|
1232
1323
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1233
|
-
s1 = peg$
|
|
1324
|
+
s1 = peg$c6;
|
|
1234
1325
|
peg$currPos++;
|
|
1235
1326
|
} else {
|
|
1236
1327
|
s1 = peg$FAILED;
|
|
1237
1328
|
|
|
1238
1329
|
if (peg$silentFails === 0) {
|
|
1239
|
-
peg$fail(peg$
|
|
1330
|
+
peg$fail(peg$c7);
|
|
1240
1331
|
}
|
|
1241
1332
|
}
|
|
1242
1333
|
|
|
@@ -1251,13 +1342,13 @@
|
|
|
1251
1342
|
|
|
1252
1343
|
if (s4 !== peg$FAILED) {
|
|
1253
1344
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1254
|
-
s5 = peg$
|
|
1345
|
+
s5 = peg$c27;
|
|
1255
1346
|
peg$currPos++;
|
|
1256
1347
|
} else {
|
|
1257
1348
|
s5 = peg$FAILED;
|
|
1258
1349
|
|
|
1259
1350
|
if (peg$silentFails === 0) {
|
|
1260
|
-
peg$fail(peg$
|
|
1351
|
+
peg$fail(peg$c28);
|
|
1261
1352
|
}
|
|
1262
1353
|
}
|
|
1263
1354
|
|
|
@@ -1265,14 +1356,14 @@
|
|
|
1265
1356
|
s6 = peg$parse_();
|
|
1266
1357
|
|
|
1267
1358
|
if (s6 !== peg$FAILED) {
|
|
1268
|
-
if (input.substr(peg$currPos, 6) === peg$
|
|
1269
|
-
s7 = peg$
|
|
1359
|
+
if (input.substr(peg$currPos, 6) === peg$c29) {
|
|
1360
|
+
s7 = peg$c29;
|
|
1270
1361
|
peg$currPos += 6;
|
|
1271
1362
|
} else {
|
|
1272
1363
|
s7 = peg$FAILED;
|
|
1273
1364
|
|
|
1274
1365
|
if (peg$silentFails === 0) {
|
|
1275
|
-
peg$fail(peg$
|
|
1366
|
+
peg$fail(peg$c30);
|
|
1276
1367
|
}
|
|
1277
1368
|
}
|
|
1278
1369
|
|
|
@@ -1283,13 +1374,13 @@
|
|
|
1283
1374
|
s9 = peg$currPos;
|
|
1284
1375
|
|
|
1285
1376
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1286
|
-
s10 = peg$
|
|
1377
|
+
s10 = peg$c27;
|
|
1287
1378
|
peg$currPos++;
|
|
1288
1379
|
} else {
|
|
1289
1380
|
s10 = peg$FAILED;
|
|
1290
1381
|
|
|
1291
1382
|
if (peg$silentFails === 0) {
|
|
1292
|
-
peg$fail(peg$
|
|
1383
|
+
peg$fail(peg$c28);
|
|
1293
1384
|
}
|
|
1294
1385
|
}
|
|
1295
1386
|
|
|
@@ -1324,19 +1415,19 @@
|
|
|
1324
1415
|
|
|
1325
1416
|
if (s10 !== peg$FAILED) {
|
|
1326
1417
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1327
|
-
s11 = peg$
|
|
1418
|
+
s11 = peg$c8;
|
|
1328
1419
|
peg$currPos++;
|
|
1329
1420
|
} else {
|
|
1330
1421
|
s11 = peg$FAILED;
|
|
1331
1422
|
|
|
1332
1423
|
if (peg$silentFails === 0) {
|
|
1333
|
-
peg$fail(peg$
|
|
1424
|
+
peg$fail(peg$c9);
|
|
1334
1425
|
}
|
|
1335
1426
|
}
|
|
1336
1427
|
|
|
1337
1428
|
if (s11 !== peg$FAILED) {
|
|
1338
1429
|
peg$savedPos = s0;
|
|
1339
|
-
s1 = peg$
|
|
1430
|
+
s1 = peg$c31(s3, s7, s9);
|
|
1340
1431
|
s0 = s1;
|
|
1341
1432
|
} else {
|
|
1342
1433
|
peg$currPos = s0;
|
|
@@ -1391,13 +1482,13 @@
|
|
|
1391
1482
|
s0 = peg$currPos;
|
|
1392
1483
|
|
|
1393
1484
|
if (input.charCodeAt(peg$currPos) === 39) {
|
|
1394
|
-
s1 = peg$
|
|
1485
|
+
s1 = peg$c32;
|
|
1395
1486
|
peg$currPos++;
|
|
1396
1487
|
} else {
|
|
1397
1488
|
s1 = peg$FAILED;
|
|
1398
1489
|
|
|
1399
1490
|
if (peg$silentFails === 0) {
|
|
1400
|
-
peg$fail(peg$
|
|
1491
|
+
peg$fail(peg$c33);
|
|
1401
1492
|
}
|
|
1402
1493
|
}
|
|
1403
1494
|
|
|
@@ -1406,14 +1497,14 @@
|
|
|
1406
1497
|
s3 = peg$parsedoubleApostrophes();
|
|
1407
1498
|
|
|
1408
1499
|
if (s3 === peg$FAILED) {
|
|
1409
|
-
if (peg$
|
|
1500
|
+
if (peg$c34.test(input.charAt(peg$currPos))) {
|
|
1410
1501
|
s3 = input.charAt(peg$currPos);
|
|
1411
1502
|
peg$currPos++;
|
|
1412
1503
|
} else {
|
|
1413
1504
|
s3 = peg$FAILED;
|
|
1414
1505
|
|
|
1415
1506
|
if (peg$silentFails === 0) {
|
|
1416
|
-
peg$fail(peg$
|
|
1507
|
+
peg$fail(peg$c35);
|
|
1417
1508
|
}
|
|
1418
1509
|
}
|
|
1419
1510
|
}
|
|
@@ -1424,14 +1515,14 @@
|
|
|
1424
1515
|
s3 = peg$parsedoubleApostrophes();
|
|
1425
1516
|
|
|
1426
1517
|
if (s3 === peg$FAILED) {
|
|
1427
|
-
if (peg$
|
|
1518
|
+
if (peg$c34.test(input.charAt(peg$currPos))) {
|
|
1428
1519
|
s3 = input.charAt(peg$currPos);
|
|
1429
1520
|
peg$currPos++;
|
|
1430
1521
|
} else {
|
|
1431
1522
|
s3 = peg$FAILED;
|
|
1432
1523
|
|
|
1433
1524
|
if (peg$silentFails === 0) {
|
|
1434
|
-
peg$fail(peg$
|
|
1525
|
+
peg$fail(peg$c35);
|
|
1435
1526
|
}
|
|
1436
1527
|
}
|
|
1437
1528
|
}
|
|
@@ -1442,13 +1533,13 @@
|
|
|
1442
1533
|
|
|
1443
1534
|
if (s2 !== peg$FAILED) {
|
|
1444
1535
|
if (input.charCodeAt(peg$currPos) === 39) {
|
|
1445
|
-
s3 = peg$
|
|
1536
|
+
s3 = peg$c32;
|
|
1446
1537
|
peg$currPos++;
|
|
1447
1538
|
} else {
|
|
1448
1539
|
s3 = peg$FAILED;
|
|
1449
1540
|
|
|
1450
1541
|
if (peg$silentFails === 0) {
|
|
1451
|
-
peg$fail(peg$
|
|
1542
|
+
peg$fail(peg$c33);
|
|
1452
1543
|
}
|
|
1453
1544
|
}
|
|
1454
1545
|
|
|
@@ -1473,14 +1564,14 @@
|
|
|
1473
1564
|
s1 = peg$parsedoubleApostrophes();
|
|
1474
1565
|
|
|
1475
1566
|
if (s1 === peg$FAILED) {
|
|
1476
|
-
if (peg$
|
|
1567
|
+
if (peg$c36.test(input.charAt(peg$currPos))) {
|
|
1477
1568
|
s1 = input.charAt(peg$currPos);
|
|
1478
1569
|
peg$currPos++;
|
|
1479
1570
|
} else {
|
|
1480
1571
|
s1 = peg$FAILED;
|
|
1481
1572
|
|
|
1482
1573
|
if (peg$silentFails === 0) {
|
|
1483
|
-
peg$fail(peg$
|
|
1574
|
+
peg$fail(peg$c37);
|
|
1484
1575
|
}
|
|
1485
1576
|
}
|
|
1486
1577
|
}
|
|
@@ -1491,14 +1582,14 @@
|
|
|
1491
1582
|
s1 = peg$parsedoubleApostrophes();
|
|
1492
1583
|
|
|
1493
1584
|
if (s1 === peg$FAILED) {
|
|
1494
|
-
if (peg$
|
|
1585
|
+
if (peg$c36.test(input.charAt(peg$currPos))) {
|
|
1495
1586
|
s1 = input.charAt(peg$currPos);
|
|
1496
1587
|
peg$currPos++;
|
|
1497
1588
|
} else {
|
|
1498
1589
|
s1 = peg$FAILED;
|
|
1499
1590
|
|
|
1500
1591
|
if (peg$silentFails === 0) {
|
|
1501
|
-
peg$fail(peg$
|
|
1592
|
+
peg$fail(peg$c37);
|
|
1502
1593
|
}
|
|
1503
1594
|
}
|
|
1504
1595
|
}
|
|
@@ -1515,14 +1606,14 @@
|
|
|
1515
1606
|
var s0, s1;
|
|
1516
1607
|
s0 = [];
|
|
1517
1608
|
|
|
1518
|
-
if (peg$
|
|
1609
|
+
if (peg$c38.test(input.charAt(peg$currPos))) {
|
|
1519
1610
|
s1 = input.charAt(peg$currPos);
|
|
1520
1611
|
peg$currPos++;
|
|
1521
1612
|
} else {
|
|
1522
1613
|
s1 = peg$FAILED;
|
|
1523
1614
|
|
|
1524
1615
|
if (peg$silentFails === 0) {
|
|
1525
|
-
peg$fail(peg$
|
|
1616
|
+
peg$fail(peg$c39);
|
|
1526
1617
|
}
|
|
1527
1618
|
}
|
|
1528
1619
|
|
|
@@ -1530,14 +1621,14 @@
|
|
|
1530
1621
|
while (s1 !== peg$FAILED) {
|
|
1531
1622
|
s0.push(s1);
|
|
1532
1623
|
|
|
1533
|
-
if (peg$
|
|
1624
|
+
if (peg$c38.test(input.charAt(peg$currPos))) {
|
|
1534
1625
|
s1 = input.charAt(peg$currPos);
|
|
1535
1626
|
peg$currPos++;
|
|
1536
1627
|
} else {
|
|
1537
1628
|
s1 = peg$FAILED;
|
|
1538
1629
|
|
|
1539
1630
|
if (peg$silentFails === 0) {
|
|
1540
|
-
peg$fail(peg$
|
|
1631
|
+
peg$fail(peg$c39);
|
|
1541
1632
|
}
|
|
1542
1633
|
}
|
|
1543
1634
|
}
|
|
@@ -1580,7 +1671,7 @@
|
|
|
1580
1671
|
|
|
1581
1672
|
if (s1 !== peg$FAILED) {
|
|
1582
1673
|
peg$savedPos = s0;
|
|
1583
|
-
s1 = peg$
|
|
1674
|
+
s1 = peg$c40(s1);
|
|
1584
1675
|
}
|
|
1585
1676
|
|
|
1586
1677
|
s0 = s1;
|
|
@@ -1591,14 +1682,14 @@
|
|
|
1591
1682
|
var s0, s1, s2;
|
|
1592
1683
|
s0 = peg$currPos;
|
|
1593
1684
|
|
|
1594
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
1595
|
-
s1 = peg$
|
|
1685
|
+
if (input.substr(peg$currPos, 2) === peg$c22) {
|
|
1686
|
+
s1 = peg$c22;
|
|
1596
1687
|
peg$currPos += 2;
|
|
1597
1688
|
} else {
|
|
1598
1689
|
s1 = peg$FAILED;
|
|
1599
1690
|
|
|
1600
1691
|
if (peg$silentFails === 0) {
|
|
1601
|
-
peg$fail(peg$
|
|
1692
|
+
peg$fail(peg$c23);
|
|
1602
1693
|
}
|
|
1603
1694
|
}
|
|
1604
1695
|
|
|
@@ -1607,7 +1698,7 @@
|
|
|
1607
1698
|
|
|
1608
1699
|
if (s2 !== peg$FAILED) {
|
|
1609
1700
|
peg$savedPos = s0;
|
|
1610
|
-
s1 = peg$
|
|
1701
|
+
s1 = peg$c24(s2);
|
|
1611
1702
|
s0 = s1;
|
|
1612
1703
|
} else {
|
|
1613
1704
|
peg$currPos = s0;
|
|
@@ -1620,14 +1711,30 @@
|
|
|
1620
1711
|
|
|
1621
1712
|
if (s0 === peg$FAILED) {
|
|
1622
1713
|
s0 = peg$currPos;
|
|
1623
|
-
|
|
1714
|
+
peg$savedPos = peg$currPos;
|
|
1715
|
+
s1 = peg$c41();
|
|
1624
1716
|
|
|
1625
|
-
if (s1
|
|
1626
|
-
|
|
1627
|
-
|
|
1717
|
+
if (s1) {
|
|
1718
|
+
s1 = undefined;
|
|
1719
|
+
} else {
|
|
1720
|
+
s1 = peg$FAILED;
|
|
1628
1721
|
}
|
|
1629
1722
|
|
|
1630
|
-
|
|
1723
|
+
if (s1 !== peg$FAILED) {
|
|
1724
|
+
s2 = peg$parsemessageText();
|
|
1725
|
+
|
|
1726
|
+
if (s2 !== peg$FAILED) {
|
|
1727
|
+
peg$savedPos = s0;
|
|
1728
|
+
s1 = peg$c26(s2);
|
|
1729
|
+
s0 = s1;
|
|
1730
|
+
} else {
|
|
1731
|
+
peg$currPos = s0;
|
|
1732
|
+
s0 = peg$FAILED;
|
|
1733
|
+
}
|
|
1734
|
+
} else {
|
|
1735
|
+
peg$currPos = s0;
|
|
1736
|
+
s0 = peg$FAILED;
|
|
1737
|
+
}
|
|
1631
1738
|
}
|
|
1632
1739
|
|
|
1633
1740
|
return s0;
|
|
@@ -1638,13 +1745,13 @@
|
|
|
1638
1745
|
s0 = peg$currPos;
|
|
1639
1746
|
|
|
1640
1747
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1641
|
-
s1 = peg$
|
|
1748
|
+
s1 = peg$c6;
|
|
1642
1749
|
peg$currPos++;
|
|
1643
1750
|
} else {
|
|
1644
1751
|
s1 = peg$FAILED;
|
|
1645
1752
|
|
|
1646
1753
|
if (peg$silentFails === 0) {
|
|
1647
|
-
peg$fail(peg$
|
|
1754
|
+
peg$fail(peg$c7);
|
|
1648
1755
|
}
|
|
1649
1756
|
}
|
|
1650
1757
|
|
|
@@ -1659,13 +1766,13 @@
|
|
|
1659
1766
|
|
|
1660
1767
|
if (s4 !== peg$FAILED) {
|
|
1661
1768
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1662
|
-
s5 = peg$
|
|
1769
|
+
s5 = peg$c27;
|
|
1663
1770
|
peg$currPos++;
|
|
1664
1771
|
} else {
|
|
1665
1772
|
s5 = peg$FAILED;
|
|
1666
1773
|
|
|
1667
1774
|
if (peg$silentFails === 0) {
|
|
1668
|
-
peg$fail(peg$
|
|
1775
|
+
peg$fail(peg$c28);
|
|
1669
1776
|
}
|
|
1670
1777
|
}
|
|
1671
1778
|
|
|
@@ -1673,26 +1780,26 @@
|
|
|
1673
1780
|
s6 = peg$parse_();
|
|
1674
1781
|
|
|
1675
1782
|
if (s6 !== peg$FAILED) {
|
|
1676
|
-
if (input.substr(peg$currPos, 4) === peg$
|
|
1677
|
-
s7 = peg$
|
|
1783
|
+
if (input.substr(peg$currPos, 4) === peg$c42) {
|
|
1784
|
+
s7 = peg$c42;
|
|
1678
1785
|
peg$currPos += 4;
|
|
1679
1786
|
} else {
|
|
1680
1787
|
s7 = peg$FAILED;
|
|
1681
1788
|
|
|
1682
1789
|
if (peg$silentFails === 0) {
|
|
1683
|
-
peg$fail(peg$
|
|
1790
|
+
peg$fail(peg$c43);
|
|
1684
1791
|
}
|
|
1685
1792
|
}
|
|
1686
1793
|
|
|
1687
1794
|
if (s7 === peg$FAILED) {
|
|
1688
|
-
if (input.substr(peg$currPos, 4) === peg$
|
|
1689
|
-
s7 = peg$
|
|
1795
|
+
if (input.substr(peg$currPos, 4) === peg$c44) {
|
|
1796
|
+
s7 = peg$c44;
|
|
1690
1797
|
peg$currPos += 4;
|
|
1691
1798
|
} else {
|
|
1692
1799
|
s7 = peg$FAILED;
|
|
1693
1800
|
|
|
1694
1801
|
if (peg$silentFails === 0) {
|
|
1695
|
-
peg$fail(peg$
|
|
1802
|
+
peg$fail(peg$c45);
|
|
1696
1803
|
}
|
|
1697
1804
|
}
|
|
1698
1805
|
}
|
|
@@ -1704,13 +1811,13 @@
|
|
|
1704
1811
|
s9 = peg$currPos;
|
|
1705
1812
|
|
|
1706
1813
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1707
|
-
s10 = peg$
|
|
1814
|
+
s10 = peg$c27;
|
|
1708
1815
|
peg$currPos++;
|
|
1709
1816
|
} else {
|
|
1710
1817
|
s10 = peg$FAILED;
|
|
1711
1818
|
|
|
1712
1819
|
if (peg$silentFails === 0) {
|
|
1713
|
-
peg$fail(peg$
|
|
1820
|
+
peg$fail(peg$c28);
|
|
1714
1821
|
}
|
|
1715
1822
|
}
|
|
1716
1823
|
|
|
@@ -1745,19 +1852,19 @@
|
|
|
1745
1852
|
|
|
1746
1853
|
if (s10 !== peg$FAILED) {
|
|
1747
1854
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1748
|
-
s11 = peg$
|
|
1855
|
+
s11 = peg$c8;
|
|
1749
1856
|
peg$currPos++;
|
|
1750
1857
|
} else {
|
|
1751
1858
|
s11 = peg$FAILED;
|
|
1752
1859
|
|
|
1753
1860
|
if (peg$silentFails === 0) {
|
|
1754
|
-
peg$fail(peg$
|
|
1861
|
+
peg$fail(peg$c9);
|
|
1755
1862
|
}
|
|
1756
1863
|
}
|
|
1757
1864
|
|
|
1758
1865
|
if (s11 !== peg$FAILED) {
|
|
1759
1866
|
peg$savedPos = s0;
|
|
1760
|
-
s1 = peg$
|
|
1867
|
+
s1 = peg$c31(s3, s7, s9);
|
|
1761
1868
|
s0 = s1;
|
|
1762
1869
|
} else {
|
|
1763
1870
|
peg$currPos = s0;
|
|
@@ -1823,13 +1930,13 @@
|
|
|
1823
1930
|
s0 = peg$currPos;
|
|
1824
1931
|
|
|
1825
1932
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1826
|
-
s1 = peg$
|
|
1933
|
+
s1 = peg$c6;
|
|
1827
1934
|
peg$currPos++;
|
|
1828
1935
|
} else {
|
|
1829
1936
|
s1 = peg$FAILED;
|
|
1830
1937
|
|
|
1831
1938
|
if (peg$silentFails === 0) {
|
|
1832
|
-
peg$fail(peg$
|
|
1939
|
+
peg$fail(peg$c7);
|
|
1833
1940
|
}
|
|
1834
1941
|
}
|
|
1835
1942
|
|
|
@@ -1844,13 +1951,13 @@
|
|
|
1844
1951
|
|
|
1845
1952
|
if (s4 !== peg$FAILED) {
|
|
1846
1953
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1847
|
-
s5 = peg$
|
|
1954
|
+
s5 = peg$c27;
|
|
1848
1955
|
peg$currPos++;
|
|
1849
1956
|
} else {
|
|
1850
1957
|
s5 = peg$FAILED;
|
|
1851
1958
|
|
|
1852
1959
|
if (peg$silentFails === 0) {
|
|
1853
|
-
peg$fail(peg$
|
|
1960
|
+
peg$fail(peg$c28);
|
|
1854
1961
|
}
|
|
1855
1962
|
}
|
|
1856
1963
|
|
|
@@ -1858,26 +1965,26 @@
|
|
|
1858
1965
|
s6 = peg$parse_();
|
|
1859
1966
|
|
|
1860
1967
|
if (s6 !== peg$FAILED) {
|
|
1861
|
-
if (input.substr(peg$currPos, 6) === peg$
|
|
1862
|
-
s7 = peg$
|
|
1968
|
+
if (input.substr(peg$currPos, 6) === peg$c46) {
|
|
1969
|
+
s7 = peg$c46;
|
|
1863
1970
|
peg$currPos += 6;
|
|
1864
1971
|
} else {
|
|
1865
1972
|
s7 = peg$FAILED;
|
|
1866
1973
|
|
|
1867
1974
|
if (peg$silentFails === 0) {
|
|
1868
|
-
peg$fail(peg$
|
|
1975
|
+
peg$fail(peg$c47);
|
|
1869
1976
|
}
|
|
1870
1977
|
}
|
|
1871
1978
|
|
|
1872
1979
|
if (s7 === peg$FAILED) {
|
|
1873
|
-
if (input.substr(peg$currPos, 13) === peg$
|
|
1874
|
-
s7 = peg$
|
|
1980
|
+
if (input.substr(peg$currPos, 13) === peg$c48) {
|
|
1981
|
+
s7 = peg$c48;
|
|
1875
1982
|
peg$currPos += 13;
|
|
1876
1983
|
} else {
|
|
1877
1984
|
s7 = peg$FAILED;
|
|
1878
1985
|
|
|
1879
1986
|
if (peg$silentFails === 0) {
|
|
1880
|
-
peg$fail(peg$
|
|
1987
|
+
peg$fail(peg$c49);
|
|
1881
1988
|
}
|
|
1882
1989
|
}
|
|
1883
1990
|
}
|
|
@@ -1887,13 +1994,13 @@
|
|
|
1887
1994
|
|
|
1888
1995
|
if (s8 !== peg$FAILED) {
|
|
1889
1996
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1890
|
-
s9 = peg$
|
|
1997
|
+
s9 = peg$c27;
|
|
1891
1998
|
peg$currPos++;
|
|
1892
1999
|
} else {
|
|
1893
2000
|
s9 = peg$FAILED;
|
|
1894
2001
|
|
|
1895
2002
|
if (peg$silentFails === 0) {
|
|
1896
|
-
peg$fail(peg$
|
|
2003
|
+
peg$fail(peg$c28);
|
|
1897
2004
|
}
|
|
1898
2005
|
}
|
|
1899
2006
|
|
|
@@ -1903,14 +2010,14 @@
|
|
|
1903
2010
|
if (s10 !== peg$FAILED) {
|
|
1904
2011
|
s11 = peg$currPos;
|
|
1905
2012
|
|
|
1906
|
-
if (input.substr(peg$currPos, 7) === peg$
|
|
1907
|
-
s12 = peg$
|
|
2013
|
+
if (input.substr(peg$currPos, 7) === peg$c50) {
|
|
2014
|
+
s12 = peg$c50;
|
|
1908
2015
|
peg$currPos += 7;
|
|
1909
2016
|
} else {
|
|
1910
2017
|
s12 = peg$FAILED;
|
|
1911
2018
|
|
|
1912
2019
|
if (peg$silentFails === 0) {
|
|
1913
|
-
peg$fail(peg$
|
|
2020
|
+
peg$fail(peg$c51);
|
|
1914
2021
|
}
|
|
1915
2022
|
}
|
|
1916
2023
|
|
|
@@ -1961,19 +2068,19 @@
|
|
|
1961
2068
|
|
|
1962
2069
|
if (s14 !== peg$FAILED) {
|
|
1963
2070
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1964
|
-
s15 = peg$
|
|
2071
|
+
s15 = peg$c8;
|
|
1965
2072
|
peg$currPos++;
|
|
1966
2073
|
} else {
|
|
1967
2074
|
s15 = peg$FAILED;
|
|
1968
2075
|
|
|
1969
2076
|
if (peg$silentFails === 0) {
|
|
1970
|
-
peg$fail(peg$
|
|
2077
|
+
peg$fail(peg$c9);
|
|
1971
2078
|
}
|
|
1972
2079
|
}
|
|
1973
2080
|
|
|
1974
2081
|
if (s15 !== peg$FAILED) {
|
|
1975
2082
|
peg$savedPos = s0;
|
|
1976
|
-
s1 = peg$
|
|
2083
|
+
s1 = peg$c52(s3, s7, s11, s13);
|
|
1977
2084
|
s0 = s1;
|
|
1978
2085
|
} else {
|
|
1979
2086
|
peg$currPos = s0;
|
|
@@ -2044,13 +2151,13 @@
|
|
|
2044
2151
|
s0 = peg$currPos;
|
|
2045
2152
|
|
|
2046
2153
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2047
|
-
s1 = peg$
|
|
2154
|
+
s1 = peg$c6;
|
|
2048
2155
|
peg$currPos++;
|
|
2049
2156
|
} else {
|
|
2050
2157
|
s1 = peg$FAILED;
|
|
2051
2158
|
|
|
2052
2159
|
if (peg$silentFails === 0) {
|
|
2053
|
-
peg$fail(peg$
|
|
2160
|
+
peg$fail(peg$c7);
|
|
2054
2161
|
}
|
|
2055
2162
|
}
|
|
2056
2163
|
|
|
@@ -2065,13 +2172,13 @@
|
|
|
2065
2172
|
|
|
2066
2173
|
if (s4 !== peg$FAILED) {
|
|
2067
2174
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2068
|
-
s5 = peg$
|
|
2175
|
+
s5 = peg$c27;
|
|
2069
2176
|
peg$currPos++;
|
|
2070
2177
|
} else {
|
|
2071
2178
|
s5 = peg$FAILED;
|
|
2072
2179
|
|
|
2073
2180
|
if (peg$silentFails === 0) {
|
|
2074
|
-
peg$fail(peg$
|
|
2181
|
+
peg$fail(peg$c28);
|
|
2075
2182
|
}
|
|
2076
2183
|
}
|
|
2077
2184
|
|
|
@@ -2079,14 +2186,14 @@
|
|
|
2079
2186
|
s6 = peg$parse_();
|
|
2080
2187
|
|
|
2081
2188
|
if (s6 !== peg$FAILED) {
|
|
2082
|
-
if (input.substr(peg$currPos, 6) === peg$
|
|
2083
|
-
s7 = peg$
|
|
2189
|
+
if (input.substr(peg$currPos, 6) === peg$c53) {
|
|
2190
|
+
s7 = peg$c53;
|
|
2084
2191
|
peg$currPos += 6;
|
|
2085
2192
|
} else {
|
|
2086
2193
|
s7 = peg$FAILED;
|
|
2087
2194
|
|
|
2088
2195
|
if (peg$silentFails === 0) {
|
|
2089
|
-
peg$fail(peg$
|
|
2196
|
+
peg$fail(peg$c54);
|
|
2090
2197
|
}
|
|
2091
2198
|
}
|
|
2092
2199
|
|
|
@@ -2095,13 +2202,13 @@
|
|
|
2095
2202
|
|
|
2096
2203
|
if (s8 !== peg$FAILED) {
|
|
2097
2204
|
if (input.charCodeAt(peg$currPos) === 44) {
|
|
2098
|
-
s9 = peg$
|
|
2205
|
+
s9 = peg$c27;
|
|
2099
2206
|
peg$currPos++;
|
|
2100
2207
|
} else {
|
|
2101
2208
|
s9 = peg$FAILED;
|
|
2102
2209
|
|
|
2103
2210
|
if (peg$silentFails === 0) {
|
|
2104
|
-
peg$fail(peg$
|
|
2211
|
+
peg$fail(peg$c28);
|
|
2105
2212
|
}
|
|
2106
2213
|
}
|
|
2107
2214
|
|
|
@@ -2126,19 +2233,19 @@
|
|
|
2126
2233
|
|
|
2127
2234
|
if (s12 !== peg$FAILED) {
|
|
2128
2235
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2129
|
-
s13 = peg$
|
|
2236
|
+
s13 = peg$c8;
|
|
2130
2237
|
peg$currPos++;
|
|
2131
2238
|
} else {
|
|
2132
2239
|
s13 = peg$FAILED;
|
|
2133
2240
|
|
|
2134
2241
|
if (peg$silentFails === 0) {
|
|
2135
|
-
peg$fail(peg$
|
|
2242
|
+
peg$fail(peg$c9);
|
|
2136
2243
|
}
|
|
2137
2244
|
}
|
|
2138
2245
|
|
|
2139
2246
|
if (s13 !== peg$FAILED) {
|
|
2140
2247
|
peg$savedPos = s0;
|
|
2141
|
-
s1 = peg$
|
|
2248
|
+
s1 = peg$c55(s3, s11);
|
|
2142
2249
|
s0 = s1;
|
|
2143
2250
|
} else {
|
|
2144
2251
|
peg$currPos = s0;
|
|
@@ -2202,13 +2309,13 @@
|
|
|
2202
2309
|
s1 = peg$currPos;
|
|
2203
2310
|
|
|
2204
2311
|
if (input.charCodeAt(peg$currPos) === 61) {
|
|
2205
|
-
s2 = peg$
|
|
2312
|
+
s2 = peg$c56;
|
|
2206
2313
|
peg$currPos++;
|
|
2207
2314
|
} else {
|
|
2208
2315
|
s2 = peg$FAILED;
|
|
2209
2316
|
|
|
2210
2317
|
if (peg$silentFails === 0) {
|
|
2211
|
-
peg$fail(peg$
|
|
2318
|
+
peg$fail(peg$c57);
|
|
2212
2319
|
}
|
|
2213
2320
|
}
|
|
2214
2321
|
|
|
@@ -2241,7 +2348,7 @@
|
|
|
2241
2348
|
}
|
|
2242
2349
|
|
|
2243
2350
|
function peg$parseselectOption() {
|
|
2244
|
-
var s0, s1, s2, s3, s4, s5, s6;
|
|
2351
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2245
2352
|
s0 = peg$currPos;
|
|
2246
2353
|
s1 = peg$parse_();
|
|
2247
2354
|
|
|
@@ -2253,35 +2360,49 @@
|
|
|
2253
2360
|
|
|
2254
2361
|
if (s3 !== peg$FAILED) {
|
|
2255
2362
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2256
|
-
s4 = peg$
|
|
2363
|
+
s4 = peg$c6;
|
|
2257
2364
|
peg$currPos++;
|
|
2258
2365
|
} else {
|
|
2259
2366
|
s4 = peg$FAILED;
|
|
2260
2367
|
|
|
2261
2368
|
if (peg$silentFails === 0) {
|
|
2262
|
-
peg$fail(peg$
|
|
2369
|
+
peg$fail(peg$c7);
|
|
2263
2370
|
}
|
|
2264
2371
|
}
|
|
2265
2372
|
|
|
2266
2373
|
if (s4 !== peg$FAILED) {
|
|
2267
|
-
|
|
2374
|
+
peg$savedPos = peg$currPos;
|
|
2375
|
+
s5 = peg$c58();
|
|
2376
|
+
|
|
2377
|
+
if (s5) {
|
|
2378
|
+
s5 = undefined;
|
|
2379
|
+
} else {
|
|
2380
|
+
s5 = peg$FAILED;
|
|
2381
|
+
}
|
|
2268
2382
|
|
|
2269
2383
|
if (s5 !== peg$FAILED) {
|
|
2270
|
-
|
|
2271
|
-
s6 = peg$c5;
|
|
2272
|
-
peg$currPos++;
|
|
2273
|
-
} else {
|
|
2274
|
-
s6 = peg$FAILED;
|
|
2384
|
+
s6 = peg$parsemessage();
|
|
2275
2385
|
|
|
2276
|
-
|
|
2277
|
-
|
|
2386
|
+
if (s6 !== peg$FAILED) {
|
|
2387
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2388
|
+
s7 = peg$c8;
|
|
2389
|
+
peg$currPos++;
|
|
2390
|
+
} else {
|
|
2391
|
+
s7 = peg$FAILED;
|
|
2392
|
+
|
|
2393
|
+
if (peg$silentFails === 0) {
|
|
2394
|
+
peg$fail(peg$c9);
|
|
2395
|
+
}
|
|
2278
2396
|
}
|
|
2279
|
-
}
|
|
2280
2397
|
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2398
|
+
if (s7 !== peg$FAILED) {
|
|
2399
|
+
peg$savedPos = s0;
|
|
2400
|
+
s1 = peg$c59(s2, s6);
|
|
2401
|
+
s0 = s1;
|
|
2402
|
+
} else {
|
|
2403
|
+
peg$currPos = s0;
|
|
2404
|
+
s0 = peg$FAILED;
|
|
2405
|
+
}
|
|
2285
2406
|
} else {
|
|
2286
2407
|
peg$currPos = s0;
|
|
2287
2408
|
s0 = peg$FAILED;
|
|
@@ -2311,7 +2432,7 @@
|
|
|
2311
2432
|
}
|
|
2312
2433
|
|
|
2313
2434
|
function peg$parsepluralOption() {
|
|
2314
|
-
var s0, s1, s2, s3, s4, s5, s6;
|
|
2435
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2315
2436
|
s0 = peg$currPos;
|
|
2316
2437
|
s1 = peg$parse_();
|
|
2317
2438
|
|
|
@@ -2323,35 +2444,49 @@
|
|
|
2323
2444
|
|
|
2324
2445
|
if (s3 !== peg$FAILED) {
|
|
2325
2446
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
2326
|
-
s4 = peg$
|
|
2447
|
+
s4 = peg$c6;
|
|
2327
2448
|
peg$currPos++;
|
|
2328
2449
|
} else {
|
|
2329
2450
|
s4 = peg$FAILED;
|
|
2330
2451
|
|
|
2331
2452
|
if (peg$silentFails === 0) {
|
|
2332
|
-
peg$fail(peg$
|
|
2453
|
+
peg$fail(peg$c7);
|
|
2333
2454
|
}
|
|
2334
2455
|
}
|
|
2335
2456
|
|
|
2336
2457
|
if (s4 !== peg$FAILED) {
|
|
2337
|
-
|
|
2458
|
+
peg$savedPos = peg$currPos;
|
|
2459
|
+
s5 = peg$c60();
|
|
2460
|
+
|
|
2461
|
+
if (s5) {
|
|
2462
|
+
s5 = undefined;
|
|
2463
|
+
} else {
|
|
2464
|
+
s5 = peg$FAILED;
|
|
2465
|
+
}
|
|
2338
2466
|
|
|
2339
2467
|
if (s5 !== peg$FAILED) {
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2468
|
+
s6 = peg$parsemessage();
|
|
2469
|
+
|
|
2470
|
+
if (s6 !== peg$FAILED) {
|
|
2471
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
2472
|
+
s7 = peg$c8;
|
|
2473
|
+
peg$currPos++;
|
|
2474
|
+
} else {
|
|
2475
|
+
s7 = peg$FAILED;
|
|
2345
2476
|
|
|
2346
|
-
|
|
2347
|
-
|
|
2477
|
+
if (peg$silentFails === 0) {
|
|
2478
|
+
peg$fail(peg$c9);
|
|
2479
|
+
}
|
|
2348
2480
|
}
|
|
2349
|
-
}
|
|
2350
2481
|
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2482
|
+
if (s7 !== peg$FAILED) {
|
|
2483
|
+
peg$savedPos = s0;
|
|
2484
|
+
s1 = peg$c61(s2, s6);
|
|
2485
|
+
s0 = s1;
|
|
2486
|
+
} else {
|
|
2487
|
+
peg$currPos = s0;
|
|
2488
|
+
s0 = peg$FAILED;
|
|
2489
|
+
}
|
|
2355
2490
|
} else {
|
|
2356
2491
|
peg$currPos = s0;
|
|
2357
2492
|
s0 = peg$FAILED;
|
|
@@ -2384,14 +2519,14 @@
|
|
|
2384
2519
|
var s0;
|
|
2385
2520
|
peg$silentFails++;
|
|
2386
2521
|
|
|
2387
|
-
if (peg$
|
|
2522
|
+
if (peg$c63.test(input.charAt(peg$currPos))) {
|
|
2388
2523
|
s0 = input.charAt(peg$currPos);
|
|
2389
2524
|
peg$currPos++;
|
|
2390
2525
|
} else {
|
|
2391
2526
|
s0 = peg$FAILED;
|
|
2392
2527
|
|
|
2393
2528
|
if (peg$silentFails === 0) {
|
|
2394
|
-
peg$fail(peg$
|
|
2529
|
+
peg$fail(peg$c64);
|
|
2395
2530
|
}
|
|
2396
2531
|
}
|
|
2397
2532
|
|
|
@@ -2400,7 +2535,7 @@
|
|
|
2400
2535
|
if (s0 === peg$FAILED) {
|
|
2401
2536
|
|
|
2402
2537
|
if (peg$silentFails === 0) {
|
|
2403
|
-
peg$fail(peg$
|
|
2538
|
+
peg$fail(peg$c62);
|
|
2404
2539
|
}
|
|
2405
2540
|
}
|
|
2406
2541
|
|
|
@@ -2411,14 +2546,14 @@
|
|
|
2411
2546
|
var s0;
|
|
2412
2547
|
peg$silentFails++;
|
|
2413
2548
|
|
|
2414
|
-
if (peg$
|
|
2549
|
+
if (peg$c66.test(input.charAt(peg$currPos))) {
|
|
2415
2550
|
s0 = input.charAt(peg$currPos);
|
|
2416
2551
|
peg$currPos++;
|
|
2417
2552
|
} else {
|
|
2418
2553
|
s0 = peg$FAILED;
|
|
2419
2554
|
|
|
2420
2555
|
if (peg$silentFails === 0) {
|
|
2421
|
-
peg$fail(peg$
|
|
2556
|
+
peg$fail(peg$c67);
|
|
2422
2557
|
}
|
|
2423
2558
|
}
|
|
2424
2559
|
|
|
@@ -2427,7 +2562,7 @@
|
|
|
2427
2562
|
if (s0 === peg$FAILED) {
|
|
2428
2563
|
|
|
2429
2564
|
if (peg$silentFails === 0) {
|
|
2430
|
-
peg$fail(peg$
|
|
2565
|
+
peg$fail(peg$c65);
|
|
2431
2566
|
}
|
|
2432
2567
|
}
|
|
2433
2568
|
|
|
@@ -2458,7 +2593,7 @@
|
|
|
2458
2593
|
s1 = peg$FAILED;
|
|
2459
2594
|
|
|
2460
2595
|
if (peg$silentFails === 0) {
|
|
2461
|
-
peg$fail(peg$
|
|
2596
|
+
peg$fail(peg$c68);
|
|
2462
2597
|
}
|
|
2463
2598
|
}
|
|
2464
2599
|
|
|
@@ -2471,13 +2606,13 @@
|
|
|
2471
2606
|
s0 = peg$currPos;
|
|
2472
2607
|
|
|
2473
2608
|
if (input.charCodeAt(peg$currPos) === 45) {
|
|
2474
|
-
s1 = peg$
|
|
2609
|
+
s1 = peg$c70;
|
|
2475
2610
|
peg$currPos++;
|
|
2476
2611
|
} else {
|
|
2477
2612
|
s1 = peg$FAILED;
|
|
2478
2613
|
|
|
2479
2614
|
if (peg$silentFails === 0) {
|
|
2480
|
-
peg$fail(peg$
|
|
2615
|
+
peg$fail(peg$c71);
|
|
2481
2616
|
}
|
|
2482
2617
|
}
|
|
2483
2618
|
|
|
@@ -2490,7 +2625,7 @@
|
|
|
2490
2625
|
|
|
2491
2626
|
if (s2 !== peg$FAILED) {
|
|
2492
2627
|
peg$savedPos = s0;
|
|
2493
|
-
s1 = peg$
|
|
2628
|
+
s1 = peg$c72(s1, s2);
|
|
2494
2629
|
s0 = s1;
|
|
2495
2630
|
} else {
|
|
2496
2631
|
peg$currPos = s0;
|
|
@@ -2507,7 +2642,7 @@
|
|
|
2507
2642
|
s1 = peg$FAILED;
|
|
2508
2643
|
|
|
2509
2644
|
if (peg$silentFails === 0) {
|
|
2510
|
-
peg$fail(peg$
|
|
2645
|
+
peg$fail(peg$c69);
|
|
2511
2646
|
}
|
|
2512
2647
|
}
|
|
2513
2648
|
|
|
@@ -2519,20 +2654,20 @@
|
|
|
2519
2654
|
peg$silentFails++;
|
|
2520
2655
|
s0 = peg$currPos;
|
|
2521
2656
|
|
|
2522
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
2523
|
-
s1 = peg$
|
|
2657
|
+
if (input.substr(peg$currPos, 2) === peg$c75) {
|
|
2658
|
+
s1 = peg$c75;
|
|
2524
2659
|
peg$currPos += 2;
|
|
2525
2660
|
} else {
|
|
2526
2661
|
s1 = peg$FAILED;
|
|
2527
2662
|
|
|
2528
2663
|
if (peg$silentFails === 0) {
|
|
2529
|
-
peg$fail(peg$
|
|
2664
|
+
peg$fail(peg$c76);
|
|
2530
2665
|
}
|
|
2531
2666
|
}
|
|
2532
2667
|
|
|
2533
2668
|
if (s1 !== peg$FAILED) {
|
|
2534
2669
|
peg$savedPos = s0;
|
|
2535
|
-
s1 = peg$
|
|
2670
|
+
s1 = peg$c77();
|
|
2536
2671
|
}
|
|
2537
2672
|
|
|
2538
2673
|
s0 = s1;
|
|
@@ -2542,7 +2677,7 @@
|
|
|
2542
2677
|
s1 = peg$FAILED;
|
|
2543
2678
|
|
|
2544
2679
|
if (peg$silentFails === 0) {
|
|
2545
|
-
peg$fail(peg$
|
|
2680
|
+
peg$fail(peg$c74);
|
|
2546
2681
|
}
|
|
2547
2682
|
}
|
|
2548
2683
|
|
|
@@ -2554,52 +2689,43 @@
|
|
|
2554
2689
|
s0 = peg$currPos;
|
|
2555
2690
|
|
|
2556
2691
|
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2557
|
-
s1 = peg$
|
|
2692
|
+
s1 = peg$c32;
|
|
2558
2693
|
peg$currPos++;
|
|
2559
2694
|
} else {
|
|
2560
2695
|
s1 = peg$FAILED;
|
|
2561
2696
|
|
|
2562
2697
|
if (peg$silentFails === 0) {
|
|
2563
|
-
peg$fail(peg$
|
|
2698
|
+
peg$fail(peg$c33);
|
|
2564
2699
|
}
|
|
2565
2700
|
}
|
|
2566
2701
|
|
|
2567
2702
|
if (s1 !== peg$FAILED) {
|
|
2568
|
-
|
|
2569
|
-
s2 = input.charAt(peg$currPos);
|
|
2570
|
-
peg$currPos++;
|
|
2571
|
-
} else {
|
|
2572
|
-
s2 = peg$FAILED;
|
|
2573
|
-
|
|
2574
|
-
if (peg$silentFails === 0) {
|
|
2575
|
-
peg$fail(peg$c72);
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2703
|
+
s2 = peg$parseescapedChar();
|
|
2578
2704
|
|
|
2579
2705
|
if (s2 !== peg$FAILED) {
|
|
2580
2706
|
s3 = peg$currPos;
|
|
2581
2707
|
s4 = [];
|
|
2582
2708
|
|
|
2583
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
2584
|
-
s5 = peg$
|
|
2709
|
+
if (input.substr(peg$currPos, 2) === peg$c75) {
|
|
2710
|
+
s5 = peg$c75;
|
|
2585
2711
|
peg$currPos += 2;
|
|
2586
2712
|
} else {
|
|
2587
2713
|
s5 = peg$FAILED;
|
|
2588
2714
|
|
|
2589
2715
|
if (peg$silentFails === 0) {
|
|
2590
|
-
peg$fail(peg$
|
|
2716
|
+
peg$fail(peg$c76);
|
|
2591
2717
|
}
|
|
2592
2718
|
}
|
|
2593
2719
|
|
|
2594
2720
|
if (s5 === peg$FAILED) {
|
|
2595
|
-
if (peg$
|
|
2721
|
+
if (peg$c34.test(input.charAt(peg$currPos))) {
|
|
2596
2722
|
s5 = input.charAt(peg$currPos);
|
|
2597
2723
|
peg$currPos++;
|
|
2598
2724
|
} else {
|
|
2599
2725
|
s5 = peg$FAILED;
|
|
2600
2726
|
|
|
2601
2727
|
if (peg$silentFails === 0) {
|
|
2602
|
-
peg$fail(peg$
|
|
2728
|
+
peg$fail(peg$c35);
|
|
2603
2729
|
}
|
|
2604
2730
|
}
|
|
2605
2731
|
}
|
|
@@ -2607,26 +2733,26 @@
|
|
|
2607
2733
|
while (s5 !== peg$FAILED) {
|
|
2608
2734
|
s4.push(s5);
|
|
2609
2735
|
|
|
2610
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
2611
|
-
s5 = peg$
|
|
2736
|
+
if (input.substr(peg$currPos, 2) === peg$c75) {
|
|
2737
|
+
s5 = peg$c75;
|
|
2612
2738
|
peg$currPos += 2;
|
|
2613
2739
|
} else {
|
|
2614
2740
|
s5 = peg$FAILED;
|
|
2615
2741
|
|
|
2616
2742
|
if (peg$silentFails === 0) {
|
|
2617
|
-
peg$fail(peg$
|
|
2743
|
+
peg$fail(peg$c76);
|
|
2618
2744
|
}
|
|
2619
2745
|
}
|
|
2620
2746
|
|
|
2621
2747
|
if (s5 === peg$FAILED) {
|
|
2622
|
-
if (peg$
|
|
2748
|
+
if (peg$c34.test(input.charAt(peg$currPos))) {
|
|
2623
2749
|
s5 = input.charAt(peg$currPos);
|
|
2624
2750
|
peg$currPos++;
|
|
2625
2751
|
} else {
|
|
2626
2752
|
s5 = peg$FAILED;
|
|
2627
2753
|
|
|
2628
2754
|
if (peg$silentFails === 0) {
|
|
2629
|
-
peg$fail(peg$
|
|
2755
|
+
peg$fail(peg$c35);
|
|
2630
2756
|
}
|
|
2631
2757
|
}
|
|
2632
2758
|
}
|
|
@@ -2640,19 +2766,23 @@
|
|
|
2640
2766
|
|
|
2641
2767
|
if (s3 !== peg$FAILED) {
|
|
2642
2768
|
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2643
|
-
s4 = peg$
|
|
2769
|
+
s4 = peg$c32;
|
|
2644
2770
|
peg$currPos++;
|
|
2645
2771
|
} else {
|
|
2646
2772
|
s4 = peg$FAILED;
|
|
2647
2773
|
|
|
2648
2774
|
if (peg$silentFails === 0) {
|
|
2649
|
-
peg$fail(peg$
|
|
2775
|
+
peg$fail(peg$c33);
|
|
2650
2776
|
}
|
|
2651
2777
|
}
|
|
2652
2778
|
|
|
2779
|
+
if (s4 === peg$FAILED) {
|
|
2780
|
+
s4 = null;
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2653
2783
|
if (s4 !== peg$FAILED) {
|
|
2654
2784
|
peg$savedPos = s0;
|
|
2655
|
-
s1 = peg$
|
|
2785
|
+
s1 = peg$c78(s2, s3);
|
|
2656
2786
|
s0 = s1;
|
|
2657
2787
|
} else {
|
|
2658
2788
|
peg$currPos = s0;
|
|
@@ -2675,18 +2805,101 @@
|
|
|
2675
2805
|
}
|
|
2676
2806
|
|
|
2677
2807
|
function peg$parseunquotedString() {
|
|
2678
|
-
var s0, s1;
|
|
2808
|
+
var s0, s1, s2, s3;
|
|
2679
2809
|
s0 = peg$currPos;
|
|
2810
|
+
s1 = peg$currPos;
|
|
2680
2811
|
|
|
2681
|
-
if (
|
|
2682
|
-
|
|
2812
|
+
if (input.length > peg$currPos) {
|
|
2813
|
+
s2 = input.charAt(peg$currPos);
|
|
2683
2814
|
peg$currPos++;
|
|
2684
2815
|
} else {
|
|
2816
|
+
s2 = peg$FAILED;
|
|
2817
|
+
|
|
2818
|
+
if (peg$silentFails === 0) {
|
|
2819
|
+
peg$fail(peg$c14);
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
if (s2 !== peg$FAILED) {
|
|
2824
|
+
peg$savedPos = peg$currPos;
|
|
2825
|
+
s3 = peg$c79(s2);
|
|
2826
|
+
|
|
2827
|
+
if (s3) {
|
|
2828
|
+
s3 = undefined;
|
|
2829
|
+
} else {
|
|
2830
|
+
s3 = peg$FAILED;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
if (s3 !== peg$FAILED) {
|
|
2834
|
+
s2 = [s2, s3];
|
|
2835
|
+
s1 = s2;
|
|
2836
|
+
} else {
|
|
2837
|
+
peg$currPos = s1;
|
|
2838
|
+
s1 = peg$FAILED;
|
|
2839
|
+
}
|
|
2840
|
+
} else {
|
|
2841
|
+
peg$currPos = s1;
|
|
2685
2842
|
s1 = peg$FAILED;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
if (s1 === peg$FAILED) {
|
|
2846
|
+
if (input.charCodeAt(peg$currPos) === 10) {
|
|
2847
|
+
s1 = peg$c80;
|
|
2848
|
+
peg$currPos++;
|
|
2849
|
+
} else {
|
|
2850
|
+
s1 = peg$FAILED;
|
|
2851
|
+
|
|
2852
|
+
if (peg$silentFails === 0) {
|
|
2853
|
+
peg$fail(peg$c81);
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
if (s1 !== peg$FAILED) {
|
|
2859
|
+
s0 = input.substring(s0, peg$currPos);
|
|
2860
|
+
} else {
|
|
2861
|
+
s0 = s1;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
return s0;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
function peg$parseescapedChar() {
|
|
2868
|
+
var s0, s1, s2, s3;
|
|
2869
|
+
s0 = peg$currPos;
|
|
2870
|
+
s1 = peg$currPos;
|
|
2871
|
+
|
|
2872
|
+
if (input.length > peg$currPos) {
|
|
2873
|
+
s2 = input.charAt(peg$currPos);
|
|
2874
|
+
peg$currPos++;
|
|
2875
|
+
} else {
|
|
2876
|
+
s2 = peg$FAILED;
|
|
2686
2877
|
|
|
2687
2878
|
if (peg$silentFails === 0) {
|
|
2688
|
-
peg$fail(peg$
|
|
2879
|
+
peg$fail(peg$c14);
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
if (s2 !== peg$FAILED) {
|
|
2884
|
+
peg$savedPos = peg$currPos;
|
|
2885
|
+
s3 = peg$c82(s2);
|
|
2886
|
+
|
|
2887
|
+
if (s3) {
|
|
2888
|
+
s3 = undefined;
|
|
2889
|
+
} else {
|
|
2890
|
+
s3 = peg$FAILED;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
if (s3 !== peg$FAILED) {
|
|
2894
|
+
s2 = [s2, s3];
|
|
2895
|
+
s1 = s2;
|
|
2896
|
+
} else {
|
|
2897
|
+
peg$currPos = s1;
|
|
2898
|
+
s1 = peg$FAILED;
|
|
2689
2899
|
}
|
|
2900
|
+
} else {
|
|
2901
|
+
peg$currPos = s1;
|
|
2902
|
+
s1 = peg$FAILED;
|
|
2690
2903
|
}
|
|
2691
2904
|
|
|
2692
2905
|
if (s1 !== peg$FAILED) {
|
|
@@ -2720,7 +2933,7 @@
|
|
|
2720
2933
|
s1 = peg$FAILED;
|
|
2721
2934
|
|
|
2722
2935
|
if (peg$silentFails === 0) {
|
|
2723
|
-
peg$fail(peg$
|
|
2936
|
+
peg$fail(peg$c83);
|
|
2724
2937
|
}
|
|
2725
2938
|
}
|
|
2726
2939
|
|
|
@@ -2733,19 +2946,19 @@
|
|
|
2733
2946
|
s0 = peg$currPos;
|
|
2734
2947
|
|
|
2735
2948
|
if (input.charCodeAt(peg$currPos) === 48) {
|
|
2736
|
-
s1 = peg$
|
|
2949
|
+
s1 = peg$c85;
|
|
2737
2950
|
peg$currPos++;
|
|
2738
2951
|
} else {
|
|
2739
2952
|
s1 = peg$FAILED;
|
|
2740
2953
|
|
|
2741
2954
|
if (peg$silentFails === 0) {
|
|
2742
|
-
peg$fail(peg$
|
|
2955
|
+
peg$fail(peg$c86);
|
|
2743
2956
|
}
|
|
2744
2957
|
}
|
|
2745
2958
|
|
|
2746
2959
|
if (s1 !== peg$FAILED) {
|
|
2747
2960
|
peg$savedPos = s0;
|
|
2748
|
-
s1 = peg$
|
|
2961
|
+
s1 = peg$c87();
|
|
2749
2962
|
}
|
|
2750
2963
|
|
|
2751
2964
|
s0 = s1;
|
|
@@ -2754,42 +2967,42 @@
|
|
|
2754
2967
|
s0 = peg$currPos;
|
|
2755
2968
|
s1 = peg$currPos;
|
|
2756
2969
|
|
|
2757
|
-
if (peg$
|
|
2970
|
+
if (peg$c88.test(input.charAt(peg$currPos))) {
|
|
2758
2971
|
s2 = input.charAt(peg$currPos);
|
|
2759
2972
|
peg$currPos++;
|
|
2760
2973
|
} else {
|
|
2761
2974
|
s2 = peg$FAILED;
|
|
2762
2975
|
|
|
2763
2976
|
if (peg$silentFails === 0) {
|
|
2764
|
-
peg$fail(peg$
|
|
2977
|
+
peg$fail(peg$c89);
|
|
2765
2978
|
}
|
|
2766
2979
|
}
|
|
2767
2980
|
|
|
2768
2981
|
if (s2 !== peg$FAILED) {
|
|
2769
2982
|
s3 = [];
|
|
2770
2983
|
|
|
2771
|
-
if (peg$
|
|
2984
|
+
if (peg$c90.test(input.charAt(peg$currPos))) {
|
|
2772
2985
|
s4 = input.charAt(peg$currPos);
|
|
2773
2986
|
peg$currPos++;
|
|
2774
2987
|
} else {
|
|
2775
2988
|
s4 = peg$FAILED;
|
|
2776
2989
|
|
|
2777
2990
|
if (peg$silentFails === 0) {
|
|
2778
|
-
peg$fail(peg$
|
|
2991
|
+
peg$fail(peg$c91);
|
|
2779
2992
|
}
|
|
2780
2993
|
}
|
|
2781
2994
|
|
|
2782
2995
|
while (s4 !== peg$FAILED) {
|
|
2783
2996
|
s3.push(s4);
|
|
2784
2997
|
|
|
2785
|
-
if (peg$
|
|
2998
|
+
if (peg$c90.test(input.charAt(peg$currPos))) {
|
|
2786
2999
|
s4 = input.charAt(peg$currPos);
|
|
2787
3000
|
peg$currPos++;
|
|
2788
3001
|
} else {
|
|
2789
3002
|
s4 = peg$FAILED;
|
|
2790
3003
|
|
|
2791
3004
|
if (peg$silentFails === 0) {
|
|
2792
|
-
peg$fail(peg$
|
|
3005
|
+
peg$fail(peg$c91);
|
|
2793
3006
|
}
|
|
2794
3007
|
}
|
|
2795
3008
|
}
|
|
@@ -2808,7 +3021,7 @@
|
|
|
2808
3021
|
|
|
2809
3022
|
if (s1 !== peg$FAILED) {
|
|
2810
3023
|
peg$savedPos = s0;
|
|
2811
|
-
s1 = peg$
|
|
3024
|
+
s1 = peg$c92(s1);
|
|
2812
3025
|
}
|
|
2813
3026
|
|
|
2814
3027
|
s0 = s1;
|
|
@@ -2820,7 +3033,7 @@
|
|
|
2820
3033
|
s1 = peg$FAILED;
|
|
2821
3034
|
|
|
2822
3035
|
if (peg$silentFails === 0) {
|
|
2823
|
-
peg$fail(peg$
|
|
3036
|
+
peg$fail(peg$c84);
|
|
2824
3037
|
}
|
|
2825
3038
|
}
|
|
2826
3039
|
|
|
@@ -2858,7 +3071,7 @@
|
|
|
2858
3071
|
s4 = peg$FAILED;
|
|
2859
3072
|
|
|
2860
3073
|
if (peg$silentFails === 0) {
|
|
2861
|
-
peg$fail(peg$
|
|
3074
|
+
peg$fail(peg$c14);
|
|
2862
3075
|
}
|
|
2863
3076
|
}
|
|
2864
3077
|
|
|
@@ -2903,7 +3116,7 @@
|
|
|
2903
3116
|
s4 = peg$FAILED;
|
|
2904
3117
|
|
|
2905
3118
|
if (peg$silentFails === 0) {
|
|
2906
|
-
peg$fail(peg$
|
|
3119
|
+
peg$fail(peg$c14);
|
|
2907
3120
|
}
|
|
2908
3121
|
}
|
|
2909
3122
|
|
|
@@ -2935,13 +3148,23 @@
|
|
|
2935
3148
|
s1 = peg$FAILED;
|
|
2936
3149
|
|
|
2937
3150
|
if (peg$silentFails === 0) {
|
|
2938
|
-
peg$fail(peg$
|
|
3151
|
+
peg$fail(peg$c93);
|
|
2939
3152
|
}
|
|
2940
3153
|
}
|
|
2941
3154
|
|
|
2942
3155
|
return s0;
|
|
2943
3156
|
}
|
|
2944
3157
|
|
|
3158
|
+
var messageCtx = ['root'];
|
|
3159
|
+
|
|
3160
|
+
function isNestedMessageText() {
|
|
3161
|
+
return messageCtx.length > 1;
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3164
|
+
function isInPluralOption() {
|
|
3165
|
+
return messageCtx[messageCtx.length - 1] === 'plural';
|
|
3166
|
+
}
|
|
3167
|
+
|
|
2945
3168
|
function insertLocation() {
|
|
2946
3169
|
return options && options.captureLocation ? {
|
|
2947
3170
|
location: location()
|
|
@@ -3526,8 +3749,6 @@
|
|
|
3526
3749
|
|
|
3527
3750
|
return r;
|
|
3528
3751
|
};
|
|
3529
|
-
var ESCAPE_HASH_REGEX = /\\#/g;
|
|
3530
|
-
var PLURAL_HASH = /(^|[^\\])#/g;
|
|
3531
3752
|
|
|
3532
3753
|
var FormatError =
|
|
3533
3754
|
/** @class */
|
|
@@ -3571,17 +3792,11 @@
|
|
|
3571
3792
|
originalMessage) {
|
|
3572
3793
|
// Hot path for straight simple msg translations
|
|
3573
3794
|
if (els.length === 1 && isLiteralElement(els[0])) {
|
|
3574
|
-
var value = els[0].value;
|
|
3575
|
-
|
|
3576
|
-
if (typeof currentPluralValue === 'number') {
|
|
3577
|
-
value = value.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
|
|
3578
|
-
}
|
|
3579
|
-
|
|
3580
3795
|
return [{
|
|
3581
3796
|
type: 0
|
|
3582
3797
|
/* literal */
|
|
3583
3798
|
,
|
|
3584
|
-
value: value
|
|
3799
|
+
value: els[0].value
|
|
3585
3800
|
}];
|
|
3586
3801
|
}
|
|
3587
3802
|
|
|
@@ -3591,18 +3806,27 @@
|
|
|
3591
3806
|
var el = els_1[_i]; // Exit early for string parts.
|
|
3592
3807
|
|
|
3593
3808
|
if (isLiteralElement(el)) {
|
|
3594
|
-
var value_1 = el.value;
|
|
3595
|
-
|
|
3596
|
-
if (typeof currentPluralValue === 'number') {
|
|
3597
|
-
value_1 = value_1.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
|
|
3598
|
-
}
|
|
3599
|
-
|
|
3600
3809
|
result.push({
|
|
3601
3810
|
type: 0
|
|
3602
3811
|
/* literal */
|
|
3603
3812
|
,
|
|
3604
|
-
value:
|
|
3813
|
+
value: el.value
|
|
3605
3814
|
});
|
|
3815
|
+
continue;
|
|
3816
|
+
} // TODO: should this part be literal type?
|
|
3817
|
+
// Replace `#` in plural rules with the actual numeric value.
|
|
3818
|
+
|
|
3819
|
+
|
|
3820
|
+
if (isPoundElement(el)) {
|
|
3821
|
+
if (typeof currentPluralValue === 'number') {
|
|
3822
|
+
result.push({
|
|
3823
|
+
type: 0
|
|
3824
|
+
/* literal */
|
|
3825
|
+
,
|
|
3826
|
+
value: formatters.getNumberFormat(locales).format(currentPluralValue)
|
|
3827
|
+
});
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3606
3830
|
continue;
|
|
3607
3831
|
}
|
|
3608
3832
|
|
|
@@ -4038,47 +4262,15 @@
|
|
|
4038
4262
|
See the accompanying LICENSE file for terms.
|
|
4039
4263
|
*/
|
|
4040
4264
|
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
* This source code is licensed under the MIT license found in the
|
|
4045
|
-
* LICENSE file in the root directory of this source tree.
|
|
4046
|
-
*/
|
|
4047
|
-
|
|
4048
|
-
var invariant = function invariant(condition, format, a, b, c, d, e, f) {
|
|
4049
|
-
{
|
|
4050
|
-
if (format === undefined) {
|
|
4051
|
-
throw new Error('invariant requires an error message argument');
|
|
4052
|
-
}
|
|
4265
|
+
function invariant(condition, message, Err) {
|
|
4266
|
+
if (Err === void 0) {
|
|
4267
|
+
Err = Error;
|
|
4053
4268
|
}
|
|
4054
4269
|
|
|
4055
4270
|
if (!condition) {
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
if (format === undefined) {
|
|
4059
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
4060
|
-
} else {
|
|
4061
|
-
var args = [a, b, c, d, e, f];
|
|
4062
|
-
var argIndex = 0;
|
|
4063
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
4064
|
-
return args[argIndex++];
|
|
4065
|
-
}));
|
|
4066
|
-
error.name = 'Invariant Violation';
|
|
4067
|
-
}
|
|
4068
|
-
|
|
4069
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
4070
|
-
|
|
4071
|
-
throw error;
|
|
4271
|
+
throw new Err(message);
|
|
4072
4272
|
}
|
|
4073
|
-
}
|
|
4074
|
-
|
|
4075
|
-
var invariant_1 = invariant;
|
|
4076
|
-
|
|
4077
|
-
var invariant_ = /*#__PURE__*/Object.freeze({
|
|
4078
|
-
__proto__: null,
|
|
4079
|
-
'default': invariant_1,
|
|
4080
|
-
__moduleExports: invariant_1
|
|
4081
|
-
});
|
|
4273
|
+
}
|
|
4082
4274
|
|
|
4083
4275
|
/*
|
|
4084
4276
|
HTML escaping is the same as React's
|
|
@@ -4090,7 +4282,6 @@
|
|
|
4090
4282
|
This source code is licensed under the BSD-style license found in the LICENSE
|
|
4091
4283
|
file in the root directory of React's source tree.
|
|
4092
4284
|
*/
|
|
4093
|
-
var invariant$1 = invariant_1 || invariant_;
|
|
4094
4285
|
var ESCAPED_CHARS = {
|
|
4095
4286
|
38: '&',
|
|
4096
4287
|
62: '>',
|
|
@@ -4117,7 +4308,7 @@
|
|
|
4117
4308
|
}, {});
|
|
4118
4309
|
}
|
|
4119
4310
|
function invariantIntlContext(intl) {
|
|
4120
|
-
invariant
|
|
4311
|
+
invariant(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
|
|
4121
4312
|
}
|
|
4122
4313
|
function createError(message, exception) {
|
|
4123
4314
|
var eMsg = exception ? "\n".concat(exception.stack) : '';
|
|
@@ -4144,7 +4335,8 @@
|
|
|
4144
4335
|
message: {},
|
|
4145
4336
|
relativeTime: {},
|
|
4146
4337
|
pluralRules: {},
|
|
4147
|
-
list: {}
|
|
4338
|
+
list: {},
|
|
4339
|
+
displayNames: {}
|
|
4148
4340
|
};
|
|
4149
4341
|
}
|
|
4150
4342
|
/**
|
|
@@ -4156,13 +4348,15 @@
|
|
|
4156
4348
|
var cache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createIntlCache();
|
|
4157
4349
|
var RelativeTimeFormat = Intl.RelativeTimeFormat;
|
|
4158
4350
|
var ListFormat = Intl.ListFormat;
|
|
4351
|
+
var DisplayNames = Intl.DisplayNames;
|
|
4159
4352
|
return {
|
|
4160
4353
|
getDateTimeFormat: memoizeFormatConstructor(Intl.DateTimeFormat, cache.dateTime),
|
|
4161
4354
|
getNumberFormat: memoizeFormatConstructor(Intl.NumberFormat, cache.number),
|
|
4162
4355
|
getMessageFormat: memoizeFormatConstructor(IntlMessageFormat, cache.message),
|
|
4163
4356
|
getRelativeTimeFormat: memoizeFormatConstructor(RelativeTimeFormat, cache.relativeTime),
|
|
4164
4357
|
getPluralRules: memoizeFormatConstructor(Intl.PluralRules, cache.pluralRules),
|
|
4165
|
-
getListFormat: memoizeFormatConstructor(ListFormat, cache.list)
|
|
4358
|
+
getListFormat: memoizeFormatConstructor(ListFormat, cache.list),
|
|
4359
|
+
getDisplayNames: memoizeFormatConstructor(DisplayNames, cache.displayNames)
|
|
4166
4360
|
};
|
|
4167
4361
|
}
|
|
4168
4362
|
function getNamedFormat(formats, type, name, onError) {
|
|
@@ -4614,7 +4808,7 @@
|
|
|
4614
4808
|
}
|
|
4615
4809
|
|
|
4616
4810
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
4617
|
-
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
|
|
4811
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
4618
4812
|
}
|
|
4619
4813
|
return t;
|
|
4620
4814
|
};
|
|
@@ -4624,7 +4818,10 @@
|
|
|
4624
4818
|
DisplayName["formatDate"] = "FormattedDate";
|
|
4625
4819
|
DisplayName["formatTime"] = "FormattedTime";
|
|
4626
4820
|
DisplayName["formatNumber"] = "FormattedNumber";
|
|
4627
|
-
DisplayName["formatList"] = "FormattedList";
|
|
4821
|
+
DisplayName["formatList"] = "FormattedList"; // Note that this DisplayName is the locale display name, not to be confused with
|
|
4822
|
+
// the name of the enum, which is for React component display name in dev tools.
|
|
4823
|
+
|
|
4824
|
+
DisplayName["formatDisplayName"] = "FormattedDisplayName";
|
|
4628
4825
|
})(DisplayName || (DisplayName = {}));
|
|
4629
4826
|
|
|
4630
4827
|
var DisplayNameParts;
|
|
@@ -4810,14 +5007,14 @@
|
|
|
4810
5007
|
timeZone = _ref.timeZone;
|
|
4811
5008
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
4812
5009
|
var format = options.format;
|
|
4813
|
-
var defaults = Object.assign({}, timeZone && {
|
|
5010
|
+
var defaults = Object.assign(Object.assign({}, timeZone && {
|
|
4814
5011
|
timeZone: timeZone
|
|
4815
|
-
}, format && getNamedFormat(formats, type, format, onError));
|
|
5012
|
+
}), format && getNamedFormat(formats, type, format, onError));
|
|
4816
5013
|
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
|
|
4817
5014
|
|
|
4818
5015
|
if (type === 'time' && !filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {
|
|
4819
5016
|
// Add default formatting options if hour, minute, or second isn't defined.
|
|
4820
|
-
filteredOptions = Object.assign({}, filteredOptions, {
|
|
5017
|
+
filteredOptions = Object.assign(Object.assign({}, filteredOptions), {
|
|
4821
5018
|
hour: 'numeric',
|
|
4822
5019
|
minute: 'numeric'
|
|
4823
5020
|
});
|
|
@@ -4895,13 +5092,6 @@
|
|
|
4895
5092
|
return 'other';
|
|
4896
5093
|
}
|
|
4897
5094
|
|
|
4898
|
-
/*
|
|
4899
|
-
* Copyright 2015, Yahoo Inc.
|
|
4900
|
-
* Copyrights licensed under the New BSD License.
|
|
4901
|
-
* See the accompanying LICENSE file for terms.
|
|
4902
|
-
*/
|
|
4903
|
-
var invariant$2 = invariant_1 || invariant_;
|
|
4904
|
-
|
|
4905
5095
|
function setTimeZoneInOptions(opts, timeZone) {
|
|
4906
5096
|
return Object.keys(opts).reduce(function (all, k) {
|
|
4907
5097
|
all[k] = Object.assign({
|
|
@@ -4912,9 +5102,9 @@
|
|
|
4912
5102
|
}
|
|
4913
5103
|
|
|
4914
5104
|
function deepMergeOptions(opts1, opts2) {
|
|
4915
|
-
var keys = Object.keys(Object.assign({}, opts1, opts2));
|
|
5105
|
+
var keys = Object.keys(Object.assign(Object.assign({}, opts1), opts2));
|
|
4916
5106
|
return keys.reduce(function (all, k) {
|
|
4917
|
-
all[k] = Object.assign({}, opts1[k] || {}, opts2[k] || {});
|
|
5107
|
+
all[k] = Object.assign(Object.assign({}, opts1[k] || {}), opts2[k] || {});
|
|
4918
5108
|
return all;
|
|
4919
5109
|
}, {});
|
|
4920
5110
|
}
|
|
@@ -4925,12 +5115,15 @@
|
|
|
4925
5115
|
}
|
|
4926
5116
|
|
|
4927
5117
|
var mfFormats = IntlMessageFormat.formats;
|
|
4928
|
-
return Object.assign({}, mfFormats, f1, {
|
|
5118
|
+
return Object.assign(Object.assign(Object.assign({}, mfFormats), f1), {
|
|
4929
5119
|
date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)),
|
|
4930
5120
|
time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone))
|
|
4931
5121
|
});
|
|
4932
5122
|
}
|
|
4933
5123
|
|
|
5124
|
+
var prepareIntlMessageFormatHtmlOutput = function prepareIntlMessageFormatHtmlOutput(chunks) {
|
|
5125
|
+
return React.createElement.apply(React, [React.Fragment, null].concat(_toConsumableArray(chunks)));
|
|
5126
|
+
};
|
|
4934
5127
|
function formatMessage(_ref, state) {
|
|
4935
5128
|
var locale = _ref.locale,
|
|
4936
5129
|
formats = _ref.formats,
|
|
@@ -4946,13 +5139,8 @@
|
|
|
4946
5139
|
var id = messageDescriptor.id,
|
|
4947
5140
|
defaultMessage = messageDescriptor.defaultMessage; // `id` is a required field of a Message Descriptor.
|
|
4948
5141
|
|
|
4949
|
-
invariant
|
|
4950
|
-
|
|
4951
|
-
if (!id) {
|
|
4952
|
-
throw new Error('[React Intl] An `id` must be provided to format a message.');
|
|
4953
|
-
}
|
|
4954
|
-
|
|
4955
|
-
var message = messages && messages[id];
|
|
5142
|
+
invariant(!!id, '[React Intl] An `id` must be provided to format a message.');
|
|
5143
|
+
var message = messages && messages[String(id)];
|
|
4956
5144
|
formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
|
|
4957
5145
|
defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
|
|
4958
5146
|
var formattedMessageParts = [];
|
|
@@ -4989,17 +5177,17 @@
|
|
|
4989
5177
|
onError(createError("Cannot format message: \"".concat(id, "\", ") + "using message ".concat(message || defaultMessage ? 'source' : 'id', " as fallback.")));
|
|
4990
5178
|
|
|
4991
5179
|
if (typeof message === 'string') {
|
|
4992
|
-
return message || defaultMessage || id;
|
|
5180
|
+
return message || defaultMessage || String(id);
|
|
4993
5181
|
}
|
|
4994
5182
|
|
|
4995
|
-
return defaultMessage || id;
|
|
5183
|
+
return defaultMessage || String(id);
|
|
4996
5184
|
}
|
|
4997
5185
|
|
|
4998
5186
|
if (formattedMessageParts.length === 1 && typeof formattedMessageParts[0] === 'string') {
|
|
4999
|
-
return formattedMessageParts[0] || defaultMessage || id;
|
|
5187
|
+
return formattedMessageParts[0] || defaultMessage || String(id);
|
|
5000
5188
|
}
|
|
5001
5189
|
|
|
5002
|
-
return formattedMessageParts;
|
|
5190
|
+
return prepareIntlMessageFormatHtmlOutput(formattedMessageParts);
|
|
5003
5191
|
}
|
|
5004
5192
|
function formatHTMLMessage$1(config, state) {
|
|
5005
5193
|
var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
@@ -5109,6 +5297,26 @@
|
|
|
5109
5297
|
return values;
|
|
5110
5298
|
}
|
|
5111
5299
|
|
|
5300
|
+
var DISPLAY_NAMES_OPTONS = ['localeMatcher', 'style', 'type', 'fallback'];
|
|
5301
|
+
function formatDisplayName(_ref, getDisplayNames, value) {
|
|
5302
|
+
var locale = _ref.locale,
|
|
5303
|
+
onError = _ref.onError;
|
|
5304
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
5305
|
+
var DisplayNames = Intl.DisplayNames;
|
|
5306
|
+
|
|
5307
|
+
if (!DisplayNames) {
|
|
5308
|
+
onError(createError("Intl.DisplayNames is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-displaynames\"\n"));
|
|
5309
|
+
}
|
|
5310
|
+
|
|
5311
|
+
var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);
|
|
5312
|
+
|
|
5313
|
+
try {
|
|
5314
|
+
return getDisplayNames(locale, filteredOptions).of(value);
|
|
5315
|
+
} catch (e) {
|
|
5316
|
+
onError(createError('Error formatting display name.', e));
|
|
5317
|
+
}
|
|
5318
|
+
}
|
|
5319
|
+
|
|
5112
5320
|
var shallowEquals = objects || shallowEquals_;
|
|
5113
5321
|
|
|
5114
5322
|
function processIntlConfig(config) {
|
|
@@ -5132,7 +5340,7 @@
|
|
|
5132
5340
|
|
|
5133
5341
|
function createIntl(config, cache) {
|
|
5134
5342
|
var formatters = createFormatters(cache);
|
|
5135
|
-
var resolvedConfig = Object.assign({}, DEFAULT_INTL_CONFIG, config);
|
|
5343
|
+
var resolvedConfig = Object.assign(Object.assign({}, DEFAULT_INTL_CONFIG), config);
|
|
5136
5344
|
|
|
5137
5345
|
if (!resolvedConfig.locale || !areIntlLocalesSupported(resolvedConfig.locale)) {
|
|
5138
5346
|
var locale = resolvedConfig.locale,
|
|
@@ -5151,7 +5359,7 @@
|
|
|
5151
5359
|
resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
|
|
5152
5360
|
}
|
|
5153
5361
|
|
|
5154
|
-
return Object.assign({}, resolvedConfig, {
|
|
5362
|
+
return Object.assign(Object.assign({}, resolvedConfig), {
|
|
5155
5363
|
formatters: formatters,
|
|
5156
5364
|
formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat),
|
|
5157
5365
|
formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat),
|
|
@@ -5163,7 +5371,8 @@
|
|
|
5163
5371
|
formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules),
|
|
5164
5372
|
formatMessage: formatMessage.bind(null, resolvedConfig, formatters),
|
|
5165
5373
|
formatHTMLMessage: formatHTMLMessage$1.bind(null, resolvedConfig, formatters),
|
|
5166
|
-
formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat)
|
|
5374
|
+
formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat),
|
|
5375
|
+
formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames)
|
|
5167
5376
|
});
|
|
5168
5377
|
}
|
|
5169
5378
|
|
|
@@ -5218,7 +5427,6 @@
|
|
|
5218
5427
|
IntlProvider$1.displayName = 'IntlProvider';
|
|
5219
5428
|
IntlProvider$1.defaultProps = DEFAULT_INTL_CONFIG;
|
|
5220
5429
|
|
|
5221
|
-
var invariant$3 = invariant_1 || invariant_;
|
|
5222
5430
|
var MINUTE = 60;
|
|
5223
5431
|
var HOUR = 60 * 60;
|
|
5224
5432
|
var DAY = 60 * 60 * 24;
|
|
@@ -5281,10 +5489,6 @@
|
|
|
5281
5489
|
return INCREMENTABLE_UNITS.includes(unit);
|
|
5282
5490
|
}
|
|
5283
5491
|
|
|
5284
|
-
function verifyProps(updateIntervalInSeconds, unit) {
|
|
5285
|
-
invariant$3(!updateIntervalInSeconds || updateIntervalInSeconds && canIncrement(unit), 'Cannot schedule update with unit longer than hour');
|
|
5286
|
-
}
|
|
5287
|
-
|
|
5288
5492
|
var FormattedRelativeTime =
|
|
5289
5493
|
/*#__PURE__*/
|
|
5290
5494
|
function (_React$PureComponent) {
|
|
@@ -5303,7 +5507,7 @@
|
|
|
5303
5507
|
prevValue: _this.props.value,
|
|
5304
5508
|
currentValueInSeconds: canIncrement(_this.props.unit) ? valueToSeconds(_this.props.value, _this.props.unit) : 0
|
|
5305
5509
|
};
|
|
5306
|
-
|
|
5510
|
+
invariant(!props.updateIntervalInSeconds || !!(props.updateIntervalInSeconds && canIncrement(props.unit)), 'Cannot schedule update with unit longer than hour');
|
|
5307
5511
|
return _this;
|
|
5308
5512
|
}
|
|
5309
5513
|
|
|
@@ -5464,7 +5668,7 @@
|
|
|
5464
5668
|
}
|
|
5465
5669
|
|
|
5466
5670
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5467
|
-
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
|
|
5671
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
5468
5672
|
}
|
|
5469
5673
|
return t;
|
|
5470
5674
|
};
|
|
@@ -5475,7 +5679,7 @@
|
|
|
5475
5679
|
console.error('[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry. Using default message as fallback.');
|
|
5476
5680
|
}
|
|
5477
5681
|
|
|
5478
|
-
return formatMessage(Object.assign({}, DEFAULT_INTL_CONFIG, {
|
|
5682
|
+
return formatMessage(Object.assign(Object.assign({}, DEFAULT_INTL_CONFIG), {
|
|
5479
5683
|
locale: 'en'
|
|
5480
5684
|
}), createFormatters(), descriptor, values);
|
|
5481
5685
|
};
|
|
@@ -5629,7 +5833,7 @@
|
|
|
5629
5833
|
}(FormattedMessage);
|
|
5630
5834
|
|
|
5631
5835
|
FormattedHTMLMessage.displayName = 'FormattedHTMLMessage';
|
|
5632
|
-
FormattedHTMLMessage.defaultProps = Object.assign({}, FormattedMessage.defaultProps, {
|
|
5836
|
+
FormattedHTMLMessage.defaultProps = Object.assign(Object.assign({}, FormattedMessage.defaultProps), {
|
|
5633
5837
|
tagName: 'span'
|
|
5634
5838
|
});
|
|
5635
5839
|
|
|
@@ -5637,11 +5841,13 @@
|
|
|
5637
5841
|
var FormattedTime = createFormattedComponent('formatTime');
|
|
5638
5842
|
var FormattedNumber = createFormattedComponent('formatNumber');
|
|
5639
5843
|
var FormattedList = createFormattedComponent('formatList');
|
|
5844
|
+
var FormattedDisplayName = createFormattedComponent('formatDisplayName');
|
|
5640
5845
|
var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');
|
|
5641
5846
|
var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');
|
|
5642
5847
|
|
|
5643
5848
|
exports.FormattedDate = FormattedDate;
|
|
5644
5849
|
exports.FormattedDateParts = FormattedDateParts;
|
|
5850
|
+
exports.FormattedDisplayName = FormattedDisplayName;
|
|
5645
5851
|
exports.FormattedHTMLMessage = FormattedHTMLMessage;
|
|
5646
5852
|
exports.FormattedList = FormattedList;
|
|
5647
5853
|
exports.FormattedMessage = FormattedMessage;
|