@rohal12/spindle 0.64.23 → 0.64.25
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/dist/pkg/format.js +1 -1
- package/dist/pkg/headless.js +534 -218
- package/dist/pkg/story-variables.js +375 -174
- package/package.json +1 -1
- package/src/components/Passage.tsx +43 -17
- package/src/components/macros/Computed.tsx +8 -3
- package/src/components/macros/Goto.tsx +5 -0
- package/src/components/macros/Include.tsx +6 -2
- package/src/components/macros/MacroError.tsx +7 -2
- package/src/components/macros/PassageDisplay.tsx +75 -17
- package/src/components/macros/SaveManager.tsx +79 -3
- package/src/hooks/use-story-fields.ts +13 -0
- package/src/markup/spindle.peggy +27 -14
- package/src/observe/observable-text.ts +26 -8
- package/src/styles.css +19 -0
- package/src/utils/element-visibility.ts +13 -0
|
@@ -358,9 +358,9 @@ function peg$parse(input, options) {
|
|
|
358
358
|
const peg$c7 = "[";
|
|
359
359
|
const peg$c8 = "[[";
|
|
360
360
|
const peg$c9 = "]]";
|
|
361
|
-
const peg$c10 = "
|
|
361
|
+
const peg$c10 = "/";
|
|
362
362
|
const peg$c11 = "}";
|
|
363
|
-
const peg$c12 = "
|
|
363
|
+
const peg$c12 = " ";
|
|
364
364
|
const peg$c13 = "@";
|
|
365
365
|
const peg$c14 = ":";
|
|
366
366
|
const peg$c15 = "</";
|
|
@@ -396,38 +396,38 @@ function peg$parse(input, options) {
|
|
|
396
396
|
const peg$e11 = peg$literalExpectation("[", false);
|
|
397
397
|
const peg$e12 = peg$literalExpectation("[[", false);
|
|
398
398
|
const peg$e13 = peg$literalExpectation("]]", false);
|
|
399
|
-
const peg$e14 = peg$literalExpectation("
|
|
400
|
-
const peg$e15 = peg$classExpectation([
|
|
401
|
-
|
|
399
|
+
const peg$e14 = peg$literalExpectation("/", false);
|
|
400
|
+
const peg$e15 = peg$classExpectation([
|
|
401
|
+
"$",
|
|
402
|
+
"_",
|
|
403
|
+
"@",
|
|
404
|
+
"%",
|
|
405
|
+
"(",
|
|
406
|
+
"!"
|
|
407
|
+
], false, false, false);
|
|
408
|
+
const peg$e16 = peg$literalExpectation("}", false);
|
|
409
|
+
const peg$e17 = peg$literalExpectation(" ", false);
|
|
410
|
+
const peg$e18 = peg$classExpectation([".", "#"], false, false, false);
|
|
411
|
+
const peg$e19 = peg$classExpectation([
|
|
402
412
|
["a", "z"],
|
|
403
413
|
["A", "Z"],
|
|
404
414
|
["0", "9"],
|
|
405
415
|
"_",
|
|
406
416
|
"-"
|
|
407
417
|
], false, false, false);
|
|
408
|
-
const peg$
|
|
418
|
+
const peg$e20 = peg$classExpectation([
|
|
409
419
|
"$",
|
|
410
420
|
"_",
|
|
411
421
|
"@",
|
|
412
422
|
"%"
|
|
413
423
|
], false, false, false);
|
|
414
|
-
const peg$
|
|
424
|
+
const peg$e21 = peg$classExpectation([
|
|
415
425
|
["a", "z"],
|
|
416
426
|
["A", "Z"],
|
|
417
427
|
["0", "9"],
|
|
418
428
|
"_",
|
|
419
429
|
"."
|
|
420
430
|
], false, false, false);
|
|
421
|
-
const peg$e19 = peg$literalExpectation("}", false);
|
|
422
|
-
const peg$e20 = peg$classExpectation([
|
|
423
|
-
"$",
|
|
424
|
-
"_",
|
|
425
|
-
"@",
|
|
426
|
-
"%",
|
|
427
|
-
"(",
|
|
428
|
-
"!"
|
|
429
|
-
], false, false, false);
|
|
430
|
-
const peg$e21 = peg$literalExpectation("/", false);
|
|
431
431
|
const peg$e22 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
|
|
432
432
|
const peg$e23 = peg$classExpectation([
|
|
433
433
|
" ",
|
|
@@ -701,7 +701,7 @@ function peg$parse(input, options) {
|
|
|
701
701
|
return !textMode;
|
|
702
702
|
}
|
|
703
703
|
function peg$f34(ss, s, at, inner) {
|
|
704
|
-
const link = lexeme("link", location(), parseLink(inner, at, (separator) => linkSeparatorIndex(inner, at, separator)));
|
|
704
|
+
const link = lexeme("link", location(), parseLink(inner.value, at, (separator) => linkSeparatorIndex(inner.value, at, separator, inner.spans)));
|
|
705
705
|
link.selectorSpan = selectorSpan(s, ss, at);
|
|
706
706
|
return withSelectors(link, s);
|
|
707
707
|
}
|
|
@@ -711,22 +711,56 @@ function peg$parse(input, options) {
|
|
|
711
711
|
function peg$f36() {
|
|
712
712
|
fail("Unclosed link: [[ without ]]", location(), "unclosed-link");
|
|
713
713
|
}
|
|
714
|
-
function peg$f37(
|
|
714
|
+
function peg$f37(start) {
|
|
715
|
+
const close = input.indexOf("]]", start);
|
|
716
|
+
const nested = input.indexOf("[[", start);
|
|
717
|
+
linkTextEnd = Math.min(close < 0 ? input.length : close, nested < 0 ? input.length : nested);
|
|
718
|
+
return true;
|
|
719
|
+
}
|
|
720
|
+
function peg$f38(start, part) {
|
|
721
|
+
return typeof part === "string" ? null : part;
|
|
722
|
+
}
|
|
723
|
+
function peg$f39(start, parts, end) {
|
|
724
|
+
return {
|
|
725
|
+
value: input.slice(start, end),
|
|
726
|
+
spans: parts.filter(Boolean)
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function peg$f40(start, end) {
|
|
730
|
+
return {
|
|
731
|
+
start,
|
|
732
|
+
end
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
function peg$f41(start, codeStart, nameEnd) {
|
|
736
|
+
const close = hooks.closeBrace(input, nameEnd, codeStart);
|
|
737
|
+
return close >= 0 && close < linkTextEnd && skipTo(close);
|
|
738
|
+
}
|
|
739
|
+
function peg$f42(start, codeStart, nameEnd) {
|
|
740
|
+
return skipEnd - offset();
|
|
741
|
+
}
|
|
742
|
+
function peg$f43(start, codeStart, nameEnd, end) {
|
|
743
|
+
return {
|
|
744
|
+
start,
|
|
745
|
+
end
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
function peg$f44(parts) {
|
|
715
749
|
return selectorsOf(parts);
|
|
716
750
|
}
|
|
717
|
-
function peg$
|
|
751
|
+
function peg$f45() {
|
|
718
752
|
return NO_SELECTORS;
|
|
719
753
|
}
|
|
720
|
-
function peg$
|
|
754
|
+
function peg$f46(s, end) {
|
|
721
755
|
return {
|
|
722
756
|
...s,
|
|
723
757
|
end
|
|
724
758
|
};
|
|
725
759
|
}
|
|
726
|
-
function peg$
|
|
760
|
+
function peg$f47(prefix, name) {
|
|
727
761
|
return [prefix, name];
|
|
728
762
|
}
|
|
729
|
-
function peg$
|
|
763
|
+
function peg$f48(ss, s, sigil, nameStart, name) {
|
|
730
764
|
const variable = lexeme("variable", location(), {
|
|
731
765
|
name,
|
|
732
766
|
nameStart,
|
|
@@ -736,7 +770,7 @@ function peg$parse(input, options) {
|
|
|
736
770
|
variable.selectorSpan = selectorSpan(s, ss, nameStart - 1);
|
|
737
771
|
return withSelectors(variable, s);
|
|
738
772
|
}
|
|
739
|
-
function peg$
|
|
773
|
+
function peg$f49(ss, s, after, expression) {
|
|
740
774
|
const node = lexeme("expression", location(), {
|
|
741
775
|
expression,
|
|
742
776
|
expressionStart: after,
|
|
@@ -745,33 +779,33 @@ function peg$parse(input, options) {
|
|
|
745
779
|
node.selectorSpan = selectorSpan(s, ss, after);
|
|
746
780
|
return withSelectors(node, s);
|
|
747
781
|
}
|
|
748
|
-
function peg$
|
|
782
|
+
function peg$f50() {
|
|
749
783
|
fail("Unclosed {" + input.substr(location().end.offset, 1) + "…: no } ends it", location(), "unclosed-expression");
|
|
750
784
|
}
|
|
751
|
-
function peg$
|
|
785
|
+
function peg$f51(start) {
|
|
752
786
|
const end = hooks.closeBrace(input, start, start);
|
|
753
787
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
754
788
|
}
|
|
755
|
-
function peg$
|
|
789
|
+
function peg$f52(start) {
|
|
756
790
|
return skipEnd - offset();
|
|
757
791
|
}
|
|
758
|
-
function peg$
|
|
792
|
+
function peg$f53(start, code) {
|
|
759
793
|
return code;
|
|
760
794
|
}
|
|
761
|
-
function peg$
|
|
795
|
+
function peg$f54() {
|
|
762
796
|
return completionMode;
|
|
763
797
|
}
|
|
764
|
-
function peg$
|
|
798
|
+
function peg$f55(ss, s, start, close, name, nameEnd) {
|
|
765
799
|
const end = hooks.closeBrace(input, nameEnd, start);
|
|
766
800
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
767
801
|
}
|
|
768
|
-
function peg$
|
|
802
|
+
function peg$f56(ss, s, start, close, name, nameEnd) {
|
|
769
803
|
return skipEnd - offset();
|
|
770
804
|
}
|
|
771
|
-
function peg$
|
|
805
|
+
function peg$f57(ss, s, start, close, name, nameEnd, args) {
|
|
772
806
|
return args;
|
|
773
807
|
}
|
|
774
|
-
function peg$
|
|
808
|
+
function peg$f58(ss, s, start, close, name, nameEnd, tail) {
|
|
775
809
|
const loc = location();
|
|
776
810
|
const lower = name.toLowerCase();
|
|
777
811
|
const tag = lexeme("macro", loc, {
|
|
@@ -797,19 +831,19 @@ function peg$parse(input, options) {
|
|
|
797
831
|
}
|
|
798
832
|
return tag;
|
|
799
833
|
}
|
|
800
|
-
function peg$
|
|
834
|
+
function peg$f59(s) {
|
|
801
835
|
fail("A closing tag starts with a letter after {/", location(), "invalid-closer");
|
|
802
836
|
}
|
|
803
|
-
function peg$
|
|
837
|
+
function peg$f60(value) {
|
|
804
838
|
return EMAIL_AUTOLINK.test(value);
|
|
805
839
|
}
|
|
806
|
-
function peg$
|
|
840
|
+
function peg$f61(value) {
|
|
807
841
|
return lexeme("text", location(), { value });
|
|
808
842
|
}
|
|
809
|
-
function peg$
|
|
843
|
+
function peg$f62(value) {
|
|
810
844
|
return lexeme("text", location(), { value });
|
|
811
845
|
}
|
|
812
|
-
function peg$
|
|
846
|
+
function peg$f63(tagStart, tag, list, slash) {
|
|
813
847
|
const lower = tag.toLowerCase();
|
|
814
848
|
return lexeme("html", location(), {
|
|
815
849
|
tag,
|
|
@@ -822,7 +856,7 @@ function peg$parse(input, options) {
|
|
|
822
856
|
isSelfClose: !!slash || VOID_TAGS.has(lower)
|
|
823
857
|
});
|
|
824
858
|
}
|
|
825
|
-
function peg$
|
|
859
|
+
function peg$f64(tag, bad) {
|
|
826
860
|
const c = input.charAt(bad);
|
|
827
861
|
if (!c) fail("Unclosed tag <" + tag + ": no > ends it (write < for a < that starts no tag)", location(), "unclosed-tag");
|
|
828
862
|
const at = {
|
|
@@ -840,7 +874,7 @@ function peg$parse(input, options) {
|
|
|
840
874
|
};
|
|
841
875
|
fail("Unexpected " + JSON.stringify(c) + " in the tag <" + tag + ">: expected an attribute, or > to end the tag", at, "unexpected-character");
|
|
842
876
|
}
|
|
843
|
-
function peg$
|
|
877
|
+
function peg$f65(tagStart, tag) {
|
|
844
878
|
return lexeme("html", location(), {
|
|
845
879
|
tag,
|
|
846
880
|
lower: tag.toLowerCase(),
|
|
@@ -852,14 +886,14 @@ function peg$parse(input, options) {
|
|
|
852
886
|
isSelfClose: false
|
|
853
887
|
});
|
|
854
888
|
}
|
|
855
|
-
function peg$
|
|
889
|
+
function peg$f66(nameStart, name) {
|
|
856
890
|
attrCode = hooks.isCodeAttribute(name);
|
|
857
891
|
return true;
|
|
858
892
|
}
|
|
859
|
-
function peg$
|
|
893
|
+
function peg$f67(nameStart, name, v) {
|
|
860
894
|
return v;
|
|
861
895
|
}
|
|
862
|
-
function peg$
|
|
896
|
+
function peg$f68(nameStart, name, value) {
|
|
863
897
|
const attribute = {
|
|
864
898
|
name,
|
|
865
899
|
value: value ? value.value : "",
|
|
@@ -873,7 +907,7 @@ function peg$parse(input, options) {
|
|
|
873
907
|
}
|
|
874
908
|
return attribute;
|
|
875
909
|
}
|
|
876
|
-
function peg$
|
|
910
|
+
function peg$f69(start, value, end) {
|
|
877
911
|
return {
|
|
878
912
|
value,
|
|
879
913
|
start,
|
|
@@ -881,7 +915,7 @@ function peg$parse(input, options) {
|
|
|
881
915
|
quote: "\""
|
|
882
916
|
};
|
|
883
917
|
}
|
|
884
|
-
function peg$
|
|
918
|
+
function peg$f70(start, value, end) {
|
|
885
919
|
return {
|
|
886
920
|
value,
|
|
887
921
|
start,
|
|
@@ -889,36 +923,36 @@ function peg$parse(input, options) {
|
|
|
889
923
|
quote: "'"
|
|
890
924
|
};
|
|
891
925
|
}
|
|
892
|
-
function peg$
|
|
926
|
+
function peg$f71(q) {
|
|
893
927
|
fail("Unclosed attribute value: the " + q + " here has no closing " + q, location(), "unclosed-attribute");
|
|
894
928
|
}
|
|
895
|
-
function peg$
|
|
929
|
+
function peg$f72(start, value, end) {
|
|
896
930
|
return {
|
|
897
931
|
value,
|
|
898
932
|
start,
|
|
899
933
|
end
|
|
900
934
|
};
|
|
901
935
|
}
|
|
902
|
-
function peg$
|
|
936
|
+
function peg$f73() {
|
|
903
937
|
return !attrCode;
|
|
904
938
|
}
|
|
905
|
-
function peg$
|
|
939
|
+
function peg$f74(bs) {
|
|
906
940
|
return bs.length % 2 === 1;
|
|
907
941
|
}
|
|
908
|
-
function peg$
|
|
942
|
+
function peg$f75() {
|
|
909
943
|
return !attrCode;
|
|
910
944
|
}
|
|
911
|
-
function peg$
|
|
945
|
+
function peg$f76(start, nameEnd) {
|
|
912
946
|
const end = hooks.closeBrace(input, nameEnd, start);
|
|
913
947
|
return skipTo(end < 0 && completionMode ? input.length : end);
|
|
914
948
|
}
|
|
915
|
-
function peg$
|
|
949
|
+
function peg$f77(start, nameEnd) {
|
|
916
950
|
return skipEnd - offset();
|
|
917
951
|
}
|
|
918
|
-
function peg$
|
|
952
|
+
function peg$f78() {
|
|
919
953
|
return !attrCode;
|
|
920
954
|
}
|
|
921
|
-
function peg$
|
|
955
|
+
function peg$f79() {
|
|
922
956
|
return attrCode;
|
|
923
957
|
}
|
|
924
958
|
let peg$currPos = options.peg$currPos | 0;
|
|
@@ -1689,20 +1723,23 @@ function peg$parse(input, options) {
|
|
|
1689
1723
|
s4 = peg$parseSelectors();
|
|
1690
1724
|
if (s4 !== peg$FAILED) {
|
|
1691
1725
|
s5 = peg$parseHere();
|
|
1692
|
-
s6 = peg$
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1726
|
+
s6 = peg$parseLinkText();
|
|
1727
|
+
if (s6 !== peg$FAILED) {
|
|
1728
|
+
if (input.substr(peg$currPos, 2) === peg$c9) {
|
|
1729
|
+
s7 = peg$c9;
|
|
1730
|
+
peg$currPos += 2;
|
|
1731
|
+
} else {
|
|
1732
|
+
s7 = peg$FAILED;
|
|
1733
|
+
if (peg$silentFails === 0) peg$fail(peg$e13);
|
|
1734
|
+
}
|
|
1735
|
+
if (s7 === peg$FAILED) s7 = peg$parseOpenEnd();
|
|
1736
|
+
if (s7 !== peg$FAILED) {
|
|
1737
|
+
peg$savedPos = s0;
|
|
1738
|
+
s0 = peg$f34(s3, s4, s5, s6);
|
|
1739
|
+
} else {
|
|
1740
|
+
peg$currPos = s0;
|
|
1741
|
+
s0 = peg$FAILED;
|
|
1742
|
+
}
|
|
1706
1743
|
} else {
|
|
1707
1744
|
peg$currPos = s0;
|
|
1708
1745
|
s0 = peg$FAILED;
|
|
@@ -1748,55 +1785,224 @@ function peg$parse(input, options) {
|
|
|
1748
1785
|
return s0;
|
|
1749
1786
|
}
|
|
1750
1787
|
function peg$parseLinkText() {
|
|
1751
|
-
let s0, s1, s2, s3;
|
|
1752
|
-
s0 =
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
s3 = peg$c8;
|
|
1788
|
+
let s0, s1, s2, s3, s4, s5, s6;
|
|
1789
|
+
s0 = peg$currPos;
|
|
1790
|
+
s1 = peg$parseHere();
|
|
1791
|
+
peg$savedPos = peg$currPos;
|
|
1792
|
+
s2 = peg$f37(s1);
|
|
1793
|
+
if (s2) s2 = void 0;
|
|
1794
|
+
else s2 = peg$FAILED;
|
|
1795
|
+
if (s2 !== peg$FAILED) {
|
|
1796
|
+
s3 = [];
|
|
1797
|
+
for (;;) {
|
|
1798
|
+
s4 = peg$currPos;
|
|
1799
|
+
s5 = peg$currPos;
|
|
1800
|
+
peg$silentFails++;
|
|
1801
|
+
if (input.substr(peg$currPos, 2) === peg$c9) {
|
|
1802
|
+
s6 = peg$c9;
|
|
1767
1803
|
peg$currPos += 2;
|
|
1768
1804
|
} else {
|
|
1769
|
-
|
|
1770
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
1805
|
+
s6 = peg$FAILED;
|
|
1806
|
+
if (peg$silentFails === 0) peg$fail(peg$e13);
|
|
1807
|
+
}
|
|
1808
|
+
if (s6 === peg$FAILED) {
|
|
1809
|
+
if (input.substr(peg$currPos, 2) === peg$c8) {
|
|
1810
|
+
s6 = peg$c8;
|
|
1811
|
+
peg$currPos += 2;
|
|
1812
|
+
} else {
|
|
1813
|
+
s6 = peg$FAILED;
|
|
1814
|
+
if (peg$silentFails === 0) peg$fail(peg$e12);
|
|
1815
|
+
}
|
|
1771
1816
|
}
|
|
1817
|
+
peg$silentFails--;
|
|
1818
|
+
if (s6 === peg$FAILED) s5 = void 0;
|
|
1819
|
+
else {
|
|
1820
|
+
peg$currPos = s5;
|
|
1821
|
+
s5 = peg$FAILED;
|
|
1822
|
+
}
|
|
1823
|
+
if (s5 !== peg$FAILED) {
|
|
1824
|
+
s6 = peg$parseLinkLabelCode();
|
|
1825
|
+
if (s6 === peg$FAILED) {
|
|
1826
|
+
if (input.length > peg$currPos) {
|
|
1827
|
+
s6 = input.charAt(peg$currPos);
|
|
1828
|
+
peg$currPos++;
|
|
1829
|
+
} else {
|
|
1830
|
+
s6 = peg$FAILED;
|
|
1831
|
+
if (peg$silentFails === 0) peg$fail(peg$e0);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
if (s6 !== peg$FAILED) {
|
|
1835
|
+
peg$savedPos = s4;
|
|
1836
|
+
s4 = peg$f38(s1, s6);
|
|
1837
|
+
} else {
|
|
1838
|
+
peg$currPos = s4;
|
|
1839
|
+
s4 = peg$FAILED;
|
|
1840
|
+
}
|
|
1841
|
+
} else {
|
|
1842
|
+
peg$currPos = s4;
|
|
1843
|
+
s4 = peg$FAILED;
|
|
1844
|
+
}
|
|
1845
|
+
if (s4 === peg$FAILED) break;
|
|
1846
|
+
s3.push(s4);
|
|
1772
1847
|
}
|
|
1773
|
-
peg$
|
|
1774
|
-
|
|
1848
|
+
s4 = peg$parseHere();
|
|
1849
|
+
peg$savedPos = s0;
|
|
1850
|
+
s0 = peg$f39(s1, s3, s4);
|
|
1851
|
+
} else {
|
|
1852
|
+
peg$currPos = s0;
|
|
1853
|
+
s0 = peg$FAILED;
|
|
1854
|
+
}
|
|
1855
|
+
return s0;
|
|
1856
|
+
}
|
|
1857
|
+
function peg$parseLinkLabelCode() {
|
|
1858
|
+
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
|
|
1859
|
+
s0 = peg$currPos;
|
|
1860
|
+
s1 = peg$parseHere();
|
|
1861
|
+
if (input.charCodeAt(peg$currPos) === 92) {
|
|
1862
|
+
s2 = peg$c4;
|
|
1863
|
+
peg$currPos++;
|
|
1864
|
+
} else {
|
|
1865
|
+
s2 = peg$FAILED;
|
|
1866
|
+
if (peg$silentFails === 0) peg$fail(peg$e6);
|
|
1867
|
+
}
|
|
1868
|
+
if (s2 !== peg$FAILED) {
|
|
1869
|
+
s3 = input.charAt(peg$currPos);
|
|
1870
|
+
if (peg$charCode = s3.charCodeAt(0), peg$charCode === 123 || peg$charCode === 125) peg$currPos++;
|
|
1775
1871
|
else {
|
|
1776
|
-
|
|
1872
|
+
s3 = peg$FAILED;
|
|
1873
|
+
if (peg$silentFails === 0) peg$fail(peg$e7);
|
|
1874
|
+
}
|
|
1875
|
+
if (s3 !== peg$FAILED) {
|
|
1876
|
+
s4 = peg$parseHere();
|
|
1877
|
+
peg$savedPos = s0;
|
|
1878
|
+
s0 = peg$f40(s1, s4);
|
|
1879
|
+
} else {
|
|
1880
|
+
peg$currPos = s0;
|
|
1881
|
+
s0 = peg$FAILED;
|
|
1882
|
+
}
|
|
1883
|
+
} else {
|
|
1884
|
+
peg$currPos = s0;
|
|
1885
|
+
s0 = peg$FAILED;
|
|
1886
|
+
}
|
|
1887
|
+
if (s0 === peg$FAILED) {
|
|
1888
|
+
s0 = peg$currPos;
|
|
1889
|
+
s1 = peg$parseHere();
|
|
1890
|
+
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1891
|
+
s2 = peg$c5;
|
|
1892
|
+
peg$currPos++;
|
|
1893
|
+
} else {
|
|
1777
1894
|
s2 = peg$FAILED;
|
|
1895
|
+
if (peg$silentFails === 0) peg$fail(peg$e8);
|
|
1778
1896
|
}
|
|
1779
1897
|
if (s2 !== peg$FAILED) {
|
|
1780
|
-
|
|
1781
|
-
s3 = input.charAt(peg$currPos);
|
|
1782
|
-
peg$currPos++;
|
|
1783
|
-
} else {
|
|
1784
|
-
s3 = peg$FAILED;
|
|
1785
|
-
if (peg$silentFails === 0) peg$fail(peg$e0);
|
|
1786
|
-
}
|
|
1898
|
+
s3 = peg$parseSelectors();
|
|
1787
1899
|
if (s3 !== peg$FAILED) {
|
|
1788
|
-
|
|
1789
|
-
|
|
1900
|
+
s4 = peg$parseHere();
|
|
1901
|
+
s5 = peg$currPos;
|
|
1902
|
+
if (input.charCodeAt(peg$currPos) === 47) {
|
|
1903
|
+
s6 = peg$c10;
|
|
1904
|
+
peg$currPos++;
|
|
1905
|
+
} else {
|
|
1906
|
+
s6 = peg$FAILED;
|
|
1907
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
1908
|
+
}
|
|
1909
|
+
if (s6 === peg$FAILED) s6 = null;
|
|
1910
|
+
s7 = peg$parseMacroName();
|
|
1911
|
+
if (s7 !== peg$FAILED) {
|
|
1912
|
+
s6 = [s6, s7];
|
|
1913
|
+
s5 = s6;
|
|
1914
|
+
} else {
|
|
1915
|
+
peg$currPos = s5;
|
|
1916
|
+
s5 = peg$FAILED;
|
|
1917
|
+
}
|
|
1918
|
+
if (s5 === peg$FAILED) {
|
|
1919
|
+
s5 = peg$currPos;
|
|
1920
|
+
peg$silentFails++;
|
|
1921
|
+
s6 = input.charAt(peg$currPos);
|
|
1922
|
+
if (peg$charCode = s6.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33) peg$currPos++;
|
|
1923
|
+
else {
|
|
1924
|
+
s6 = peg$FAILED;
|
|
1925
|
+
if (peg$silentFails === 0) peg$fail(peg$e15);
|
|
1926
|
+
}
|
|
1927
|
+
peg$silentFails--;
|
|
1928
|
+
if (s6 !== peg$FAILED) {
|
|
1929
|
+
peg$currPos = s5;
|
|
1930
|
+
s5 = void 0;
|
|
1931
|
+
} else s5 = peg$FAILED;
|
|
1932
|
+
}
|
|
1933
|
+
if (s5 !== peg$FAILED) {
|
|
1934
|
+
s6 = peg$parseHere();
|
|
1935
|
+
peg$savedPos = peg$currPos;
|
|
1936
|
+
s7 = peg$f41(s1, s4, s6);
|
|
1937
|
+
if (s7) s7 = void 0;
|
|
1938
|
+
else s7 = peg$FAILED;
|
|
1939
|
+
if (s7 !== peg$FAILED) {
|
|
1940
|
+
s8 = peg$currPos;
|
|
1941
|
+
s9 = peg$f42(s1, s4, s6);
|
|
1942
|
+
s10 = peg$currPos;
|
|
1943
|
+
s11 = [];
|
|
1944
|
+
if (s11.length >= (s9 | 0)) s12 = peg$FAILED;
|
|
1945
|
+
else if (input.length > peg$currPos) {
|
|
1946
|
+
s12 = input.charAt(peg$currPos);
|
|
1947
|
+
peg$currPos++;
|
|
1948
|
+
} else {
|
|
1949
|
+
s12 = peg$FAILED;
|
|
1950
|
+
if (peg$silentFails === 0) peg$fail(peg$e0);
|
|
1951
|
+
}
|
|
1952
|
+
while (s12 !== peg$FAILED) {
|
|
1953
|
+
s11.push(s12);
|
|
1954
|
+
if (s11.length >= (s9 | 0)) s12 = peg$FAILED;
|
|
1955
|
+
else if (input.length > peg$currPos) {
|
|
1956
|
+
s12 = input.charAt(peg$currPos);
|
|
1957
|
+
peg$currPos++;
|
|
1958
|
+
} else {
|
|
1959
|
+
s12 = peg$FAILED;
|
|
1960
|
+
if (peg$silentFails === 0) peg$fail(peg$e0);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
if (s11.length < (s9 | 0)) {
|
|
1964
|
+
peg$currPos = s10;
|
|
1965
|
+
s10 = peg$FAILED;
|
|
1966
|
+
} else s10 = s11;
|
|
1967
|
+
s9 = s10;
|
|
1968
|
+
if (s9 !== peg$FAILED) s8 = input.substring(s8, peg$currPos);
|
|
1969
|
+
else s8 = s9;
|
|
1970
|
+
if (s8 !== peg$FAILED) {
|
|
1971
|
+
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1972
|
+
s9 = peg$c11;
|
|
1973
|
+
peg$currPos++;
|
|
1974
|
+
} else {
|
|
1975
|
+
s9 = peg$FAILED;
|
|
1976
|
+
if (peg$silentFails === 0) peg$fail(peg$e16);
|
|
1977
|
+
}
|
|
1978
|
+
if (s9 !== peg$FAILED) {
|
|
1979
|
+
s10 = peg$parseHere();
|
|
1980
|
+
peg$savedPos = s0;
|
|
1981
|
+
s0 = peg$f43(s1, s4, s6, s10);
|
|
1982
|
+
} else {
|
|
1983
|
+
peg$currPos = s0;
|
|
1984
|
+
s0 = peg$FAILED;
|
|
1985
|
+
}
|
|
1986
|
+
} else {
|
|
1987
|
+
peg$currPos = s0;
|
|
1988
|
+
s0 = peg$FAILED;
|
|
1989
|
+
}
|
|
1990
|
+
} else {
|
|
1991
|
+
peg$currPos = s0;
|
|
1992
|
+
s0 = peg$FAILED;
|
|
1993
|
+
}
|
|
1994
|
+
} else {
|
|
1995
|
+
peg$currPos = s0;
|
|
1996
|
+
s0 = peg$FAILED;
|
|
1997
|
+
}
|
|
1790
1998
|
} else {
|
|
1791
|
-
peg$currPos =
|
|
1792
|
-
|
|
1999
|
+
peg$currPos = s0;
|
|
2000
|
+
s0 = peg$FAILED;
|
|
1793
2001
|
}
|
|
1794
2002
|
} else {
|
|
1795
|
-
peg$currPos =
|
|
1796
|
-
|
|
2003
|
+
peg$currPos = s0;
|
|
2004
|
+
s0 = peg$FAILED;
|
|
1797
2005
|
}
|
|
1798
|
-
if (s1 === peg$FAILED) break;
|
|
1799
|
-
s0.push(s1);
|
|
1800
2006
|
}
|
|
1801
2007
|
return s0;
|
|
1802
2008
|
}
|
|
@@ -1812,15 +2018,15 @@ function peg$parse(input, options) {
|
|
|
1812
2018
|
if (s1.length < 1) s1 = peg$FAILED;
|
|
1813
2019
|
if (s1 !== peg$FAILED) {
|
|
1814
2020
|
if (input.charCodeAt(peg$currPos) === 32) {
|
|
1815
|
-
s2 = peg$
|
|
2021
|
+
s2 = peg$c12;
|
|
1816
2022
|
peg$currPos++;
|
|
1817
2023
|
} else {
|
|
1818
2024
|
s2 = peg$FAILED;
|
|
1819
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2025
|
+
if (peg$silentFails === 0) peg$fail(peg$e17);
|
|
1820
2026
|
}
|
|
1821
2027
|
if (s2 === peg$FAILED) s2 = null;
|
|
1822
2028
|
peg$savedPos = s0;
|
|
1823
|
-
s0 = peg$
|
|
2029
|
+
s0 = peg$f44(s1);
|
|
1824
2030
|
} else {
|
|
1825
2031
|
peg$currPos = s0;
|
|
1826
2032
|
s0 = peg$FAILED;
|
|
@@ -1829,7 +2035,7 @@ function peg$parse(input, options) {
|
|
|
1829
2035
|
s0 = peg$currPos;
|
|
1830
2036
|
s1 = "";
|
|
1831
2037
|
peg$savedPos = s0;
|
|
1832
|
-
s1 = peg$
|
|
2038
|
+
s1 = peg$f45();
|
|
1833
2039
|
s0 = s1;
|
|
1834
2040
|
}
|
|
1835
2041
|
return s0;
|
|
@@ -1853,7 +2059,7 @@ function peg$parse(input, options) {
|
|
|
1853
2059
|
s3.push(s4);
|
|
1854
2060
|
}
|
|
1855
2061
|
peg$savedPos = s0;
|
|
1856
|
-
s0 = peg$
|
|
2062
|
+
s0 = peg$f46(s1, s2);
|
|
1857
2063
|
} else {
|
|
1858
2064
|
peg$currPos = s0;
|
|
1859
2065
|
s0 = peg$FAILED;
|
|
@@ -1867,7 +2073,7 @@ function peg$parse(input, options) {
|
|
|
1867
2073
|
if (peg$charCode = s1.charCodeAt(0), peg$charCode === 46 || peg$charCode === 35) peg$currPos++;
|
|
1868
2074
|
else {
|
|
1869
2075
|
s1 = peg$FAILED;
|
|
1870
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2076
|
+
if (peg$silentFails === 0) peg$fail(peg$e18);
|
|
1871
2077
|
}
|
|
1872
2078
|
if (s1 !== peg$FAILED) {
|
|
1873
2079
|
s2 = peg$currPos;
|
|
@@ -1879,7 +2085,7 @@ function peg$parse(input, options) {
|
|
|
1879
2085
|
}
|
|
1880
2086
|
s2 = input.substring(s2, peg$currPos);
|
|
1881
2087
|
peg$savedPos = s0;
|
|
1882
|
-
s0 = peg$
|
|
2088
|
+
s0 = peg$f47(s1, s2);
|
|
1883
2089
|
} else {
|
|
1884
2090
|
peg$currPos = s0;
|
|
1885
2091
|
s0 = peg$FAILED;
|
|
@@ -1892,7 +2098,7 @@ function peg$parse(input, options) {
|
|
|
1892
2098
|
if (peg$charCode = s0.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 45) peg$currPos++;
|
|
1893
2099
|
else {
|
|
1894
2100
|
s0 = peg$FAILED;
|
|
1895
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2101
|
+
if (peg$silentFails === 0) peg$fail(peg$e19);
|
|
1896
2102
|
}
|
|
1897
2103
|
if (s0 === peg$FAILED) {
|
|
1898
2104
|
s0 = peg$currPos;
|
|
@@ -1908,7 +2114,7 @@ function peg$parse(input, options) {
|
|
|
1908
2114
|
if (peg$charCode = s2.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
|
|
1909
2115
|
else {
|
|
1910
2116
|
s2 = peg$FAILED;
|
|
1911
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2117
|
+
if (peg$silentFails === 0) peg$fail(peg$e20);
|
|
1912
2118
|
}
|
|
1913
2119
|
if (s2 !== peg$FAILED) {
|
|
1914
2120
|
s3 = [];
|
|
@@ -1917,7 +2123,7 @@ function peg$parse(input, options) {
|
|
|
1917
2123
|
if (peg$charCode = s4.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 46) peg$currPos++;
|
|
1918
2124
|
else {
|
|
1919
2125
|
s4 = peg$FAILED;
|
|
1920
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2126
|
+
if (peg$silentFails === 0) peg$fail(peg$e21);
|
|
1921
2127
|
}
|
|
1922
2128
|
if (s4 === peg$FAILED) break;
|
|
1923
2129
|
s3.push(s4);
|
|
@@ -1927,7 +2133,7 @@ function peg$parse(input, options) {
|
|
|
1927
2133
|
peg$currPos++;
|
|
1928
2134
|
} else {
|
|
1929
2135
|
s4 = peg$FAILED;
|
|
1930
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2136
|
+
if (peg$silentFails === 0) peg$fail(peg$e16);
|
|
1931
2137
|
}
|
|
1932
2138
|
if (s4 !== peg$FAILED) {
|
|
1933
2139
|
s1 = [
|
|
@@ -1970,7 +2176,7 @@ function peg$parse(input, options) {
|
|
|
1970
2176
|
if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
|
|
1971
2177
|
else {
|
|
1972
2178
|
s4 = peg$FAILED;
|
|
1973
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2179
|
+
if (peg$silentFails === 0) peg$fail(peg$e20);
|
|
1974
2180
|
}
|
|
1975
2181
|
if (s4 !== peg$FAILED) {
|
|
1976
2182
|
s5 = peg$parseHere();
|
|
@@ -1981,7 +2187,7 @@ function peg$parse(input, options) {
|
|
|
1981
2187
|
if (peg$charCode = s8.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 46) peg$currPos++;
|
|
1982
2188
|
else {
|
|
1983
2189
|
s8 = peg$FAILED;
|
|
1984
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2190
|
+
if (peg$silentFails === 0) peg$fail(peg$e21);
|
|
1985
2191
|
}
|
|
1986
2192
|
if (s8 === peg$FAILED) break;
|
|
1987
2193
|
s7.push(s8);
|
|
@@ -1990,7 +2196,7 @@ function peg$parse(input, options) {
|
|
|
1990
2196
|
s7 = peg$parseBraceEnd();
|
|
1991
2197
|
if (s7 !== peg$FAILED) {
|
|
1992
2198
|
peg$savedPos = s0;
|
|
1993
|
-
s0 = peg$
|
|
2199
|
+
s0 = peg$f48(s2, s3, s4, s5, s6);
|
|
1994
2200
|
} else {
|
|
1995
2201
|
peg$currPos = s0;
|
|
1996
2202
|
s0 = peg$FAILED;
|
|
@@ -2027,7 +2233,7 @@ function peg$parse(input, options) {
|
|
|
2027
2233
|
if (peg$charCode = s6.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33) peg$currPos++;
|
|
2028
2234
|
else {
|
|
2029
2235
|
s6 = peg$FAILED;
|
|
2030
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2236
|
+
if (peg$silentFails === 0) peg$fail(peg$e15);
|
|
2031
2237
|
}
|
|
2032
2238
|
peg$silentFails--;
|
|
2033
2239
|
if (s6 !== peg$FAILED) {
|
|
@@ -2040,7 +2246,7 @@ function peg$parse(input, options) {
|
|
|
2040
2246
|
s7 = peg$parseBraceEnd();
|
|
2041
2247
|
if (s7 !== peg$FAILED) {
|
|
2042
2248
|
peg$savedPos = s0;
|
|
2043
|
-
s0 = peg$
|
|
2249
|
+
s0 = peg$f49(s2, s3, s4, s6);
|
|
2044
2250
|
} else {
|
|
2045
2251
|
peg$currPos = s0;
|
|
2046
2252
|
s0 = peg$FAILED;
|
|
@@ -2079,7 +2285,7 @@ function peg$parse(input, options) {
|
|
|
2079
2285
|
if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33) peg$currPos++;
|
|
2080
2286
|
else {
|
|
2081
2287
|
s4 = peg$FAILED;
|
|
2082
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2288
|
+
if (peg$silentFails === 0) peg$fail(peg$e15);
|
|
2083
2289
|
}
|
|
2084
2290
|
peg$silentFails--;
|
|
2085
2291
|
if (s4 !== peg$FAILED) {
|
|
@@ -2088,7 +2294,7 @@ function peg$parse(input, options) {
|
|
|
2088
2294
|
} else s3 = peg$FAILED;
|
|
2089
2295
|
if (s3 !== peg$FAILED) {
|
|
2090
2296
|
peg$savedPos = s0;
|
|
2091
|
-
s0 = peg$
|
|
2297
|
+
s0 = peg$f50();
|
|
2092
2298
|
} else {
|
|
2093
2299
|
peg$currPos = s0;
|
|
2094
2300
|
s0 = peg$FAILED;
|
|
@@ -2110,12 +2316,12 @@ function peg$parse(input, options) {
|
|
|
2110
2316
|
s0 = peg$currPos;
|
|
2111
2317
|
s1 = peg$parseHere();
|
|
2112
2318
|
peg$savedPos = peg$currPos;
|
|
2113
|
-
s2 = peg$
|
|
2319
|
+
s2 = peg$f51(s1);
|
|
2114
2320
|
if (s2) s2 = void 0;
|
|
2115
2321
|
else s2 = peg$FAILED;
|
|
2116
2322
|
if (s2 !== peg$FAILED) {
|
|
2117
2323
|
s3 = peg$currPos;
|
|
2118
|
-
s4 = peg$
|
|
2324
|
+
s4 = peg$f52(s1);
|
|
2119
2325
|
s5 = peg$currPos;
|
|
2120
2326
|
s6 = [];
|
|
2121
2327
|
if (s6.length >= (s4 | 0)) s7 = peg$FAILED;
|
|
@@ -2146,7 +2352,7 @@ function peg$parse(input, options) {
|
|
|
2146
2352
|
else s3 = s4;
|
|
2147
2353
|
if (s3 !== peg$FAILED) {
|
|
2148
2354
|
peg$savedPos = s0;
|
|
2149
|
-
s0 = peg$
|
|
2355
|
+
s0 = peg$f53(s1, s3);
|
|
2150
2356
|
} else {
|
|
2151
2357
|
peg$currPos = s0;
|
|
2152
2358
|
s0 = peg$FAILED;
|
|
@@ -2161,7 +2367,7 @@ function peg$parse(input, options) {
|
|
|
2161
2367
|
let s0, s1, s2, s3;
|
|
2162
2368
|
s0 = peg$currPos;
|
|
2163
2369
|
peg$savedPos = peg$currPos;
|
|
2164
|
-
s1 = peg$
|
|
2370
|
+
s1 = peg$f54();
|
|
2165
2371
|
if (s1) s1 = void 0;
|
|
2166
2372
|
else s1 = peg$FAILED;
|
|
2167
2373
|
if (s1 !== peg$FAILED) {
|
|
@@ -2200,7 +2406,7 @@ function peg$parse(input, options) {
|
|
|
2200
2406
|
peg$currPos++;
|
|
2201
2407
|
} else {
|
|
2202
2408
|
s0 = peg$FAILED;
|
|
2203
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2409
|
+
if (peg$silentFails === 0) peg$fail(peg$e16);
|
|
2204
2410
|
}
|
|
2205
2411
|
if (s0 === peg$FAILED) s0 = peg$parseOpenEnd();
|
|
2206
2412
|
return s0;
|
|
@@ -2221,11 +2427,11 @@ function peg$parse(input, options) {
|
|
|
2221
2427
|
if (s3 !== peg$FAILED) {
|
|
2222
2428
|
s4 = peg$parseHere();
|
|
2223
2429
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
2224
|
-
s5 = peg$
|
|
2430
|
+
s5 = peg$c10;
|
|
2225
2431
|
peg$currPos++;
|
|
2226
2432
|
} else {
|
|
2227
2433
|
s5 = peg$FAILED;
|
|
2228
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2434
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
2229
2435
|
}
|
|
2230
2436
|
if (s5 === peg$FAILED) s5 = null;
|
|
2231
2437
|
s6 = peg$parseMacroName();
|
|
@@ -2233,12 +2439,12 @@ function peg$parse(input, options) {
|
|
|
2233
2439
|
s7 = peg$parseHere();
|
|
2234
2440
|
s8 = peg$currPos;
|
|
2235
2441
|
peg$savedPos = peg$currPos;
|
|
2236
|
-
s9 = peg$
|
|
2442
|
+
s9 = peg$f55(s2, s3, s4, s5, s6, s7);
|
|
2237
2443
|
if (s9) s9 = void 0;
|
|
2238
2444
|
else s9 = peg$FAILED;
|
|
2239
2445
|
if (s9 !== peg$FAILED) {
|
|
2240
2446
|
s10 = peg$currPos;
|
|
2241
|
-
s11 = peg$
|
|
2447
|
+
s11 = peg$f56(s2, s3, s4, s5, s6, s7);
|
|
2242
2448
|
s12 = peg$currPos;
|
|
2243
2449
|
s13 = [];
|
|
2244
2450
|
if (s13.length >= (s11 | 0)) s14 = peg$FAILED;
|
|
@@ -2271,7 +2477,7 @@ function peg$parse(input, options) {
|
|
|
2271
2477
|
s11 = peg$parseBraceEnd();
|
|
2272
2478
|
if (s11 !== peg$FAILED) {
|
|
2273
2479
|
peg$savedPos = s8;
|
|
2274
|
-
s8 = peg$
|
|
2480
|
+
s8 = peg$f57(s2, s3, s4, s5, s6, s7, s10);
|
|
2275
2481
|
} else {
|
|
2276
2482
|
peg$currPos = s8;
|
|
2277
2483
|
s8 = peg$FAILED;
|
|
@@ -2286,7 +2492,7 @@ function peg$parse(input, options) {
|
|
|
2286
2492
|
}
|
|
2287
2493
|
if (s8 === peg$FAILED) s8 = null;
|
|
2288
2494
|
peg$savedPos = s0;
|
|
2289
|
-
s0 = peg$
|
|
2495
|
+
s0 = peg$f58(s2, s3, s4, s5, s6, s7, s8);
|
|
2290
2496
|
} else {
|
|
2291
2497
|
peg$currPos = s0;
|
|
2292
2498
|
s0 = peg$FAILED;
|
|
@@ -2312,15 +2518,15 @@ function peg$parse(input, options) {
|
|
|
2312
2518
|
s2 = peg$parseSelectors();
|
|
2313
2519
|
if (s2 !== peg$FAILED) {
|
|
2314
2520
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
2315
|
-
s3 = peg$
|
|
2521
|
+
s3 = peg$c10;
|
|
2316
2522
|
peg$currPos++;
|
|
2317
2523
|
} else {
|
|
2318
2524
|
s3 = peg$FAILED;
|
|
2319
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2525
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
2320
2526
|
}
|
|
2321
2527
|
if (s3 !== peg$FAILED) {
|
|
2322
2528
|
peg$savedPos = s0;
|
|
2323
|
-
s0 = peg$
|
|
2529
|
+
s0 = peg$f59(s2);
|
|
2324
2530
|
} else {
|
|
2325
2531
|
peg$currPos = s0;
|
|
2326
2532
|
s0 = peg$FAILED;
|
|
@@ -2455,12 +2661,12 @@ function peg$parse(input, options) {
|
|
|
2455
2661
|
else s1 = s2;
|
|
2456
2662
|
if (s1 !== peg$FAILED) {
|
|
2457
2663
|
peg$savedPos = peg$currPos;
|
|
2458
|
-
s2 = peg$
|
|
2664
|
+
s2 = peg$f60(s1);
|
|
2459
2665
|
if (s2) s2 = void 0;
|
|
2460
2666
|
else s2 = peg$FAILED;
|
|
2461
2667
|
if (s2 !== peg$FAILED) {
|
|
2462
2668
|
peg$savedPos = s0;
|
|
2463
|
-
s0 = peg$
|
|
2669
|
+
s0 = peg$f61(s1);
|
|
2464
2670
|
} else {
|
|
2465
2671
|
peg$currPos = s0;
|
|
2466
2672
|
s0 = peg$FAILED;
|
|
@@ -2604,7 +2810,7 @@ function peg$parse(input, options) {
|
|
|
2604
2810
|
else s1 = s2;
|
|
2605
2811
|
if (s1 !== peg$FAILED) {
|
|
2606
2812
|
peg$savedPos = s0;
|
|
2607
|
-
s1 = peg$
|
|
2813
|
+
s1 = peg$f62(s1);
|
|
2608
2814
|
}
|
|
2609
2815
|
s0 = s1;
|
|
2610
2816
|
return s0;
|
|
@@ -2631,11 +2837,11 @@ function peg$parse(input, options) {
|
|
|
2631
2837
|
}
|
|
2632
2838
|
s5 = peg$parse_();
|
|
2633
2839
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
2634
|
-
s6 = peg$
|
|
2840
|
+
s6 = peg$c10;
|
|
2635
2841
|
peg$currPos++;
|
|
2636
2842
|
} else {
|
|
2637
2843
|
s6 = peg$FAILED;
|
|
2638
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
2844
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
2639
2845
|
}
|
|
2640
2846
|
if (s6 === peg$FAILED) s6 = null;
|
|
2641
2847
|
if (input.charCodeAt(peg$currPos) === 62) {
|
|
@@ -2648,7 +2854,7 @@ function peg$parse(input, options) {
|
|
|
2648
2854
|
if (s7 === peg$FAILED) s7 = peg$parseOpenEnd();
|
|
2649
2855
|
if (s7 !== peg$FAILED) {
|
|
2650
2856
|
peg$savedPos = s0;
|
|
2651
|
-
s0 = peg$
|
|
2857
|
+
s0 = peg$f63(s2, s3, s4, s6);
|
|
2652
2858
|
} else {
|
|
2653
2859
|
peg$currPos = s0;
|
|
2654
2860
|
s0 = peg$FAILED;
|
|
@@ -2713,7 +2919,7 @@ function peg$parse(input, options) {
|
|
|
2713
2919
|
s5 = peg$parse_();
|
|
2714
2920
|
s6 = peg$parseHere();
|
|
2715
2921
|
peg$savedPos = s0;
|
|
2716
|
-
s0 = peg$
|
|
2922
|
+
s0 = peg$f64(s2, s6);
|
|
2717
2923
|
} else {
|
|
2718
2924
|
peg$currPos = s0;
|
|
2719
2925
|
s0 = peg$FAILED;
|
|
@@ -2753,7 +2959,7 @@ function peg$parse(input, options) {
|
|
|
2753
2959
|
}
|
|
2754
2960
|
if (s5 !== peg$FAILED) {
|
|
2755
2961
|
peg$savedPos = s0;
|
|
2756
|
-
s0 = peg$
|
|
2962
|
+
s0 = peg$f65(s2, s3);
|
|
2757
2963
|
} else {
|
|
2758
2964
|
peg$currPos = s0;
|
|
2759
2965
|
s0 = peg$FAILED;
|
|
@@ -2850,7 +3056,7 @@ function peg$parse(input, options) {
|
|
|
2850
3056
|
else s3 = s4;
|
|
2851
3057
|
if (s3 !== peg$FAILED) {
|
|
2852
3058
|
peg$savedPos = peg$currPos;
|
|
2853
|
-
s4 = peg$
|
|
3059
|
+
s4 = peg$f66(s2, s3);
|
|
2854
3060
|
if (s4) s4 = void 0;
|
|
2855
3061
|
else s4 = peg$FAILED;
|
|
2856
3062
|
if (s4 !== peg$FAILED) {
|
|
@@ -2868,7 +3074,7 @@ function peg$parse(input, options) {
|
|
|
2868
3074
|
s9 = peg$parseAttrValue();
|
|
2869
3075
|
if (s9 !== peg$FAILED) {
|
|
2870
3076
|
peg$savedPos = s5;
|
|
2871
|
-
s5 = peg$
|
|
3077
|
+
s5 = peg$f67(s2, s3, s9);
|
|
2872
3078
|
} else {
|
|
2873
3079
|
peg$currPos = s5;
|
|
2874
3080
|
s5 = peg$FAILED;
|
|
@@ -2879,7 +3085,7 @@ function peg$parse(input, options) {
|
|
|
2879
3085
|
}
|
|
2880
3086
|
if (s5 === peg$FAILED) s5 = null;
|
|
2881
3087
|
peg$savedPos = s0;
|
|
2882
|
-
s0 = peg$
|
|
3088
|
+
s0 = peg$f68(s2, s3, s5);
|
|
2883
3089
|
} else {
|
|
2884
3090
|
peg$currPos = s0;
|
|
2885
3091
|
s0 = peg$FAILED;
|
|
@@ -2929,7 +3135,7 @@ function peg$parse(input, options) {
|
|
|
2929
3135
|
if (s5 === peg$FAILED) s5 = peg$parseOpenEnd();
|
|
2930
3136
|
if (s5 !== peg$FAILED) {
|
|
2931
3137
|
peg$savedPos = s0;
|
|
2932
|
-
s0 = peg$
|
|
3138
|
+
s0 = peg$f69(s2, s3, s4);
|
|
2933
3139
|
} else {
|
|
2934
3140
|
peg$currPos = s0;
|
|
2935
3141
|
s0 = peg$FAILED;
|
|
@@ -2976,7 +3182,7 @@ function peg$parse(input, options) {
|
|
|
2976
3182
|
if (s5 === peg$FAILED) s5 = peg$parseOpenEnd();
|
|
2977
3183
|
if (s5 !== peg$FAILED) {
|
|
2978
3184
|
peg$savedPos = s0;
|
|
2979
|
-
s0 = peg$
|
|
3185
|
+
s0 = peg$f70(s2, s3, s4);
|
|
2980
3186
|
} else {
|
|
2981
3187
|
peg$currPos = s0;
|
|
2982
3188
|
s0 = peg$FAILED;
|
|
@@ -2995,7 +3201,7 @@ function peg$parse(input, options) {
|
|
|
2995
3201
|
}
|
|
2996
3202
|
if (s1 !== peg$FAILED) {
|
|
2997
3203
|
peg$savedPos = s0;
|
|
2998
|
-
s1 = peg$
|
|
3204
|
+
s1 = peg$f71(s1);
|
|
2999
3205
|
}
|
|
3000
3206
|
s0 = s1;
|
|
3001
3207
|
if (s0 === peg$FAILED) {
|
|
@@ -3016,7 +3222,7 @@ function peg$parse(input, options) {
|
|
|
3016
3222
|
s2 = input.substring(s2, peg$currPos);
|
|
3017
3223
|
s3 = peg$parseHere();
|
|
3018
3224
|
peg$savedPos = s0;
|
|
3019
|
-
s0 = peg$
|
|
3225
|
+
s0 = peg$f72(s1, s2, s3);
|
|
3020
3226
|
}
|
|
3021
3227
|
}
|
|
3022
3228
|
}
|
|
@@ -3026,7 +3232,7 @@ function peg$parse(input, options) {
|
|
|
3026
3232
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
|
3027
3233
|
s0 = peg$currPos;
|
|
3028
3234
|
peg$savedPos = peg$currPos;
|
|
3029
|
-
s1 = peg$
|
|
3235
|
+
s1 = peg$f73();
|
|
3030
3236
|
if (s1) s1 = void 0;
|
|
3031
3237
|
else s1 = peg$FAILED;
|
|
3032
3238
|
if (s1 !== peg$FAILED) {
|
|
@@ -3049,7 +3255,7 @@ function peg$parse(input, options) {
|
|
|
3049
3255
|
if (s2 !== peg$FAILED) {
|
|
3050
3256
|
s3 = peg$currPos;
|
|
3051
3257
|
peg$savedPos = peg$currPos;
|
|
3052
|
-
s4 = peg$
|
|
3258
|
+
s4 = peg$f74(s2);
|
|
3053
3259
|
if (s4) s4 = void 0;
|
|
3054
3260
|
else s4 = peg$FAILED;
|
|
3055
3261
|
if (s4 !== peg$FAILED) {
|
|
@@ -3088,7 +3294,7 @@ function peg$parse(input, options) {
|
|
|
3088
3294
|
if (s0 === peg$FAILED) {
|
|
3089
3295
|
s0 = peg$currPos;
|
|
3090
3296
|
peg$savedPos = peg$currPos;
|
|
3091
|
-
s1 = peg$
|
|
3297
|
+
s1 = peg$f75();
|
|
3092
3298
|
if (s1) s1 = void 0;
|
|
3093
3299
|
else s1 = peg$FAILED;
|
|
3094
3300
|
if (s1 !== peg$FAILED) {
|
|
@@ -3104,23 +3310,23 @@ function peg$parse(input, options) {
|
|
|
3104
3310
|
if (s3 !== peg$FAILED) {
|
|
3105
3311
|
s4 = peg$parseHere();
|
|
3106
3312
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
3107
|
-
s5 = peg$
|
|
3313
|
+
s5 = peg$c10;
|
|
3108
3314
|
peg$currPos++;
|
|
3109
3315
|
} else {
|
|
3110
3316
|
s5 = peg$FAILED;
|
|
3111
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
3317
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
3112
3318
|
}
|
|
3113
3319
|
if (s5 === peg$FAILED) s5 = null;
|
|
3114
3320
|
s6 = peg$parseMacroName();
|
|
3115
3321
|
if (s6 !== peg$FAILED) {
|
|
3116
3322
|
s7 = peg$parseHere();
|
|
3117
3323
|
peg$savedPos = peg$currPos;
|
|
3118
|
-
s8 = peg$
|
|
3324
|
+
s8 = peg$f76(s4, s7);
|
|
3119
3325
|
if (s8) s8 = void 0;
|
|
3120
3326
|
else s8 = peg$FAILED;
|
|
3121
3327
|
if (s8 !== peg$FAILED) {
|
|
3122
3328
|
s9 = peg$currPos;
|
|
3123
|
-
s10 = peg$
|
|
3329
|
+
s10 = peg$f77(s4, s7);
|
|
3124
3330
|
s11 = peg$currPos;
|
|
3125
3331
|
s12 = [];
|
|
3126
3332
|
if (s12.length >= (s10 | 0)) s13 = peg$FAILED;
|
|
@@ -3196,7 +3402,7 @@ function peg$parse(input, options) {
|
|
|
3196
3402
|
if (s0 === peg$FAILED) {
|
|
3197
3403
|
s0 = peg$currPos;
|
|
3198
3404
|
peg$savedPos = peg$currPos;
|
|
3199
|
-
s1 = peg$
|
|
3405
|
+
s1 = peg$f78();
|
|
3200
3406
|
if (s1) s1 = void 0;
|
|
3201
3407
|
else s1 = peg$FAILED;
|
|
3202
3408
|
if (s1 !== peg$FAILED) {
|
|
@@ -3214,11 +3420,11 @@ function peg$parse(input, options) {
|
|
|
3214
3420
|
peg$silentFails++;
|
|
3215
3421
|
s5 = peg$currPos;
|
|
3216
3422
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
3217
|
-
s6 = peg$
|
|
3423
|
+
s6 = peg$c10;
|
|
3218
3424
|
peg$currPos++;
|
|
3219
3425
|
} else {
|
|
3220
3426
|
s6 = peg$FAILED;
|
|
3221
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
3427
|
+
if (peg$silentFails === 0) peg$fail(peg$e14);
|
|
3222
3428
|
}
|
|
3223
3429
|
if (s6 === peg$FAILED) s6 = null;
|
|
3224
3430
|
s7 = input.charAt(peg$currPos);
|
|
@@ -3281,7 +3487,7 @@ function peg$parse(input, options) {
|
|
|
3281
3487
|
if (s0 === peg$FAILED) {
|
|
3282
3488
|
s0 = peg$currPos;
|
|
3283
3489
|
peg$savedPos = peg$currPos;
|
|
3284
|
-
s1 = peg$
|
|
3490
|
+
s1 = peg$f79();
|
|
3285
3491
|
if (s1) s1 = void 0;
|
|
3286
3492
|
else s1 = peg$FAILED;
|
|
3287
3493
|
if (s1 !== peg$FAILED) {
|
|
@@ -3299,7 +3505,7 @@ function peg$parse(input, options) {
|
|
|
3299
3505
|
if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
|
|
3300
3506
|
else {
|
|
3301
3507
|
s4 = peg$FAILED;
|
|
3302
|
-
if (peg$silentFails === 0) peg$fail(peg$
|
|
3508
|
+
if (peg$silentFails === 0) peg$fail(peg$e20);
|
|
3303
3509
|
}
|
|
3304
3510
|
peg$silentFails--;
|
|
3305
3511
|
if (s4 !== peg$FAILED) {
|
|
@@ -3376,22 +3582,17 @@ function peg$parse(input, options) {
|
|
|
3376
3582
|
let rawName = "";
|
|
3377
3583
|
/** The HTML text-only body being read; its own closer ends this context. */
|
|
3378
3584
|
let htmlTextTag = "";
|
|
3585
|
+
/** First bracket boundary of the current (non-nesting) link label. */
|
|
3586
|
+
let linkTextEnd = -1;
|
|
3379
3587
|
/**
|
|
3380
3588
|
* The index in `inner` (at `at` in the input) of the first `separator` that
|
|
3381
3589
|
* is not inside a {…} of the label: its code (`{if $a || $b}`, a string with
|
|
3382
3590
|
* a pipe) belongs to the label, not to the link's syntax.
|
|
3383
3591
|
*/
|
|
3384
|
-
function linkSeparatorIndex(inner, at, separator) {
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
else if (c === LB) {
|
|
3389
|
-
const head = /^(?:[.#][\w-]*)* ?(\/?[a-zA-Z][\w-]*|(?=[$_@%(!]))/.exec(inner.slice(i + 1));
|
|
3390
|
-
if (!head) continue;
|
|
3391
|
-
const close = hooks.closeBrace(input, at + i + 1 + head[0].length, at + i + 1);
|
|
3392
|
-
if (close !== -1 && close < at + inner.length) i = close - at;
|
|
3393
|
-
} else if (inner.startsWith(separator, i)) return i;
|
|
3394
|
-
}
|
|
3592
|
+
function linkSeparatorIndex(inner, at, separator, spans) {
|
|
3593
|
+
let span = 0;
|
|
3594
|
+
for (let i = 0; i < inner.length; i++) if (span < spans.length && i === spans[span].start - at) i = spans[span++].end - at - 1;
|
|
3595
|
+
else if (inner.startsWith(separator, i)) return i;
|
|
3395
3596
|
return -1;
|
|
3396
3597
|
}
|
|
3397
3598
|
/**
|