Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9896 |
|
0.00% |
0 / 355 |
CRAP | |
0.00% |
0 / 2 |
GrammarCacheEntry | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
Grammar | |
0.00% |
0 / 9892 |
|
0.00% |
0 / 354 |
7238790 | |
0.00% |
0 / 1 |
initialize | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
assert | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
unreachable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
startOffset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
endOffset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
tsrOffsets | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
emitChunk | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
12 | |||
isXMLTag | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
maybeAnnotationOrExtensionTag | |
0.00% |
0 / 106 |
|
0.00% |
0 / 1 |
930 | |||
a0 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
a1 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
a2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a3 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a4 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
12 | |||
a5 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a6 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a7 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a8 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
a9 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a10 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a11 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a12 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a13 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a14 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a15 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a16 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a17 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a18 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a19 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
a20 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a21 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a22 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a23 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |||
a24 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a25 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
a26 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a27 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
a28 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a29 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a30 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |||
a31 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a32 | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
6 | |||
a33 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a34 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a35 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a36 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
a37 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
a38 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a39 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a40 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a41 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
a42 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a43 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a44 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a45 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a46 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
12 | |||
a47 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
a48 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
a49 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a50 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a51 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a52 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a53 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a54 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a55 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a56 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a57 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a58 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a59 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a60 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a61 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a62 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a63 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a64 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a65 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a66 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a67 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a68 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a69 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a70 | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
12 | |||
a71 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a72 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a73 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a74 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a75 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a76 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a77 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a78 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a79 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |||
a80 | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
56 | |||
a81 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a82 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a83 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
a84 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
a85 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a86 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a87 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
56 | |||
a88 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a89 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a90 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a91 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a92 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a93 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a94 | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
42 | |||
a95 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a96 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a97 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
12 | |||
a98 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a99 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a100 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a101 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a102 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |||
a103 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a104 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a105 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a106 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a107 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
a108 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a109 | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
a110 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a111 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a112 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
20 | |||
a113 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a114 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a115 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a116 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
72 | |||
a117 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a118 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a119 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |||
a120 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
30 | |||
a121 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a122 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a123 | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
2 | |||
a124 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a125 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
12 | |||
a126 | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
2 | |||
a127 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a128 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a129 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
a130 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a131 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a132 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a133 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a134 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a135 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a136 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a137 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a138 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
12 | |||
a139 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a140 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a141 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a142 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a143 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a144 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a145 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a146 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
a147 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a148 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a149 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a150 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a151 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a152 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a153 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a154 | |
0.00% |
0 / 31 |
|
0.00% |
0 / 1 |
56 | |||
a155 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a156 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
30 | |||
a157 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a158 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a159 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a160 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
30 | |||
a161 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a162 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
a163 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a164 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a165 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
420 | |||
a166 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a167 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a168 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
a169 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a170 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a171 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a172 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a173 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a174 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a175 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
a176 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a177 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a178 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a179 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a180 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a181 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a182 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
streamstart_async | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
132 | |||
parsestart | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
110 | |||
parsetable_start_tag | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
420 | |||
parseurl | |
0.00% |
0 / 171 |
|
0.00% |
0 / 1 |
1560 | |||
parserow_syntax_table_args | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
132 | |||
parsetable_attributes | |
0.00% |
0 / 39 |
|
0.00% |
0 / 1 |
156 | |||
parsegeneric_newline_attributes | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
72 | |||
parsetplarg_or_template_or_bust | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
132 | |||
parseextlink | |
0.00% |
0 / 142 |
|
0.00% |
0 / 1 |
870 | |||
parselist_item | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
72 | |||
parsetlb | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
72 | |||
parsenewlineToken | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
parsespace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
30 | |||
parsecomment | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
342 | |||
parsepipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
parseurl_protocol | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
parseipv6urladdr | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
132 | |||
discardinline_breaks | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
90 | |||
parseno_punctuation_char | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
parsetplarg_or_template | |
0.00% |
0 / 37 |
|
0.00% |
0 / 1 |
110 | |||
parsehtmlentity | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
parseoptional_spaces | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
discardpipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
parsetable_attribute | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
272 | |||
discardoptionalSpaceToken | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
parsebroken_table_attribute_name_char | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
30 | |||
parsegeneric_newline_attribute | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
420 | |||
parseextlink_nonipv6url | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
discardspace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
30 | |||
discardunispace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
parseinlineline | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
parsedtdd | |
0.00% |
0 / 94 |
|
0.00% |
0 / 1 |
420 | |||
parsehacky_dl_uses | |
0.00% |
0 / 94 |
|
0.00% |
0 / 1 |
812 | |||
parseli | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
210 | |||
discardeof | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
parseblock | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
342 | |||
discardnewline | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
parsetplarg_or_template_guarded | |
0.00% |
0 / 191 |
|
0.00% |
0 / 1 |
1806 | |||
parseraw_htmlentity | |
0.00% |
0 / 51 |
|
0.00% |
0 / 1 |
156 | |||
parseoptionalSpaceToken | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
parsetable_attribute_name | |
0.00% |
0 / 121 |
|
0.00% |
0 / 1 |
930 | |||
parsetable_att_value | |
0.00% |
0 / 176 |
|
0.00% |
0 / 1 |
2256 | |||
discardspace_or_newline_or_solidus | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
72 | |||
parsegeneric_attribute_name | |
0.00% |
0 / 104 |
|
0.00% |
0 / 1 |
756 | |||
discardspace_or_newline | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parsegeneric_att_value | |
0.00% |
0 / 193 |
|
0.00% |
0 / 1 |
1980 | |||
parseextlink_nonipv6url_parameterized | |
0.00% |
0 / 92 |
|
0.00% |
0 / 1 |
650 | |||
parseurltext | |
0.00% |
0 / 99 |
|
0.00% |
0 / 1 |
462 | |||
parseinline_element | |
0.00% |
0 / 155 |
|
0.00% |
0 / 1 |
992 | |||
discardlist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parselist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parseinlineline_break_on_colon | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
discardeolf | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
12 | |||
parsetable_line | |
0.00% |
0 / 51 |
|
0.00% |
0 / 1 |
210 | |||
parsesol | |
0.00% |
0 / 31 |
|
0.00% |
0 / 1 |
110 | |||
discardcomment | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
342 | |||
discardsof | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
parseredirect | |
0.00% |
0 / 72 |
|
0.00% |
0 / 1 |
380 | |||
parsesol_transparent | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
90 | |||
parseblock_line | |
0.00% |
0 / 50 |
|
0.00% |
0 / 1 |
182 | |||
parseblock_lines | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
156 | |||
discardtplarg | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
parsetemplate | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
parsebroken_template | |
0.00% |
0 / 29 |
|
0.00% |
0 / 1 |
72 | |||
parsetplarg | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
discardwikilink | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
parsedirective | |
0.00% |
0 / 69 |
|
0.00% |
0 / 1 |
272 | |||
parseinline_xmlish_tag | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
156 | |||
parsetable_attribute_preprocessor_text_single | |
0.00% |
0 / 63 |
|
0.00% |
0 / 1 |
380 | |||
parsetable_attribute_preprocessor_text_double | |
0.00% |
0 / 63 |
|
0.00% |
0 / 1 |
380 | |||
parsetable_attribute_preprocessor_text | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
420 | |||
parseless_than | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
42 | |||
parseattribute_preprocessor_text_single | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
552 | |||
parseattribute_preprocessor_text_double | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
552 | |||
parseattribute_preprocessor_text | |
0.00% |
0 / 80 |
|
0.00% |
0 / 1 |
600 | |||
parseautolink | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
156 | |||
parsebehavior_switch | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
132 | |||
parsetext_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parselang_variant_or_tpl | |
0.00% |
0 / 221 |
|
0.00% |
0 / 1 |
2450 | |||
parsewikilink | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
parsequote | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
132 | |||
parsetable_content_line | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
182 | |||
parsetable_end_tag | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
110 | |||
parseempty_line_with_comments | |
0.00% |
0 / 66 |
|
0.00% |
0 / 1 |
272 | |||
parsesol_prefix | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
20 | |||
parseredirect_word | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
306 | |||
parseinclude_limits | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
462 | |||
parseannotation_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
parseheading | |
0.00% |
0 / 116 |
|
0.00% |
0 / 1 |
702 | |||
parsehr | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
discardtplarg_preproc | |
0.00% |
0 / 134 |
|
0.00% |
0 / 1 |
1332 | |||
parsetemplate_preproc | |
0.00% |
0 / 172 |
|
0.00% |
0 / 1 |
2352 | |||
parsetplarg_preproc | |
0.00% |
0 / 134 |
|
0.00% |
0 / 1 |
1332 | |||
discardwikilink_preproc | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
discardbroken_wikilink | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
306 | |||
parseextension_annotation_tag | |
0.00% |
0 / 60 |
|
0.00% |
0 / 1 |
210 | |||
parsexmlish_tag | |
0.00% |
0 / 84 |
|
0.00% |
0 / 1 |
552 | |||
parsetvar_old_syntax_closing_HACK | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
56 | |||
parseautourl | |
0.00% |
0 / 182 |
|
0.00% |
0 / 1 |
1560 | |||
parseautoref | |
0.00% |
0 / 64 |
|
0.00% |
0 / 1 |
380 | |||
parseisbn | |
0.00% |
0 / 117 |
|
0.00% |
0 / 1 |
930 | |||
discardbehavior_text | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
156 | |||
parselang_variant | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
parsewikilink_preproc | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
parsebroken_wikilink | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
306 | |||
parsetable_heading_tags | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
parsetable_row_tag | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
parsetable_data_tags | |
0.00% |
0 / 63 |
|
0.00% |
0 / 1 |
240 | |||
parsetable_caption_tag | |
0.00% |
0 / 57 |
|
0.00% |
0 / 1 |
240 | |||
parsenewline | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
discardsol | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
132 | |||
parsetemplate_param_value | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
discardnl_comment_space | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
20 | |||
parsenl_comment_space | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
20 | |||
parsetemplate_param | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
306 | |||
parsewikilink_preprocessor_text | |
0.00% |
0 / 91 |
|
0.00% |
0 / 1 |
756 | |||
parsewikilink_content | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
132 | |||
parsetag_name | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
42 | |||
parsespace_or_nbsp | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
72 | |||
discardend_of_word | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
30 | |||
parsespace_or_nbsp_or_dash | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
30 | |||
discardtext_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parselang_variant_preproc | |
0.00% |
0 / 126 |
|
0.00% |
0 / 1 |
756 | |||
parsebroken_lang_variant | |
0.00% |
0 / 28 |
|
0.00% |
0 / 1 |
72 | |||
parsetable_heading_tags_parameterized | |
0.00% |
0 / 59 |
|
0.00% |
0 / 1 |
306 | |||
parsetable_data_tag | |
0.00% |
0 / 50 |
|
0.00% |
0 / 1 |
182 | |||
parsetds | |
0.00% |
0 / 55 |
|
0.00% |
0 / 1 |
210 | |||
parsenested_block_in_table | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
462 | |||
discardempty_line_with_comments | |
0.00% |
0 / 66 |
|
0.00% |
0 / 1 |
272 | |||
discardsol_prefix | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
20 | |||
discardsol_transparent | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
90 | |||
parsetemplate_param_text | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
132 | |||
discardnewlineToken | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
parsetemplate_param_name | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
72 | |||
parselink_text | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
parseunispace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
parseopt_lang_variant_flags | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
132 | |||
parselang_variant_text | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
156 | |||
parselang_variant_option_list | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
380 | |||
parsetable_heading_tag | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
156 | |||
parsepipe_pipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
72 | |||
discardrow_syntax_table_args | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
132 | |||
parsenested_block | |
0.00% |
0 / 36 |
|
0.00% |
0 / 1 |
90 | |||
discardinclude_limits | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
462 | |||
discardannotation_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
discardbehavior_switch | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
132 | |||
parselink_text_parameterized | |
0.00% |
0 / 129 |
|
0.00% |
0 / 1 |
1332 | |||
parselang_variant_flags | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
506 | |||
parselang_variant_option | |
0.00% |
0 / 163 |
|
0.00% |
0 / 1 |
1980 | |||
discardbogus_lang_variant_option | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
56 | |||
parsefull_table_in_link_caption | |
0.00% |
0 / 36 |
|
0.00% |
0 / 1 |
90 | |||
parselang_variant_flag | |
0.00% |
0 / 74 |
|
0.00% |
0 / 1 |
342 | |||
parselang_variant_name | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
182 | |||
parselang_variant_nowiki | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
132 | |||
parselang_variant_text_no_semi | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
parselang_variant_text_no_semi_or_arrow | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
discardlang_variant_text | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
156 | |||
parsefull_table_in_link_caption_parameterized | |
0.00% |
0 / 75 |
|
0.00% |
0 / 1 |
600 | |||
discardnowiki | |
0.00% |
0 / 54 |
|
0.00% |
0 / 1 |
182 | |||
parsenowiki_text | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
parsenowiki | |
0.00% |
0 / 54 |
|
0.00% |
0 / 1 |
182 | |||
parse | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
420 |
1 | <?php |
2 | /* |
3 | * DO NOT EDIT MANUALLY. |
4 | * File generated from Grammar.pegphp with `composer regen-tokenizer`. |
5 | */ |
6 | |
7 | |
8 | namespace Wikimedia\Parsoid\Wt2Html; |
9 | |
10 | |
11 | use Wikimedia\Assert\UnreachableException; |
12 | use Wikimedia\Parsoid\Config\Env; |
13 | use Wikimedia\Parsoid\Config\SiteConfig; |
14 | use Wikimedia\Parsoid\Core\DomSourceRange; |
15 | use Wikimedia\Parsoid\NodeData\DataParsoid; |
16 | use Wikimedia\Parsoid\Tokens\CommentTk; |
17 | use Wikimedia\Parsoid\Tokens\EndTagTk; |
18 | use Wikimedia\Parsoid\Tokens\EOFTk; |
19 | use Wikimedia\Parsoid\Tokens\KV; |
20 | use Wikimedia\Parsoid\Tokens\KVSourceRange; |
21 | use Wikimedia\Parsoid\Tokens\NlTk; |
22 | use Wikimedia\Parsoid\Tokens\SelfclosingTagTk; |
23 | use Wikimedia\Parsoid\Tokens\SourceRange; |
24 | use Wikimedia\Parsoid\Tokens\TagTk; |
25 | use Wikimedia\Parsoid\Tokens\Token; |
26 | use Wikimedia\Parsoid\Utils\TokenUtils; |
27 | use Wikimedia\Parsoid\Utils\Utils; |
28 | use Wikimedia\Parsoid\Utils\PHPUtils; |
29 | use Wikimedia\Parsoid\Utils\WTUtils; |
30 | use Wikimedia\Parsoid\Wikitext\Consts; |
31 | |
32 | |
33 | |
34 | class GrammarCacheEntry { |
35 | public $nextPos; |
36 | public $result; |
37 | public $preproc; |
38 | public $th; |
39 | |
40 | |
41 | public function __construct( $nextPos, $result, $preproc, $th ) { |
42 | $this->nextPos = $nextPos; |
43 | $this->result = $result; |
44 | $this->preproc = $preproc; |
45 | $this->th = $th; |
46 | |
47 | } |
48 | } |
49 | |
50 | |
51 | class Grammar extends \Wikimedia\WikiPEG\PEGParserBase { |
52 | // initializer |
53 | |
54 | /** @var Env */ |
55 | private $env; |
56 | |
57 | /** @var SiteConfig */ |
58 | private $siteConfig; |
59 | |
60 | /** @var array */ |
61 | private $pipelineOpts; |
62 | |
63 | /** @var int */ |
64 | private $pipelineOffset; |
65 | |
66 | private $extTags; |
67 | |
68 | private $startTime; |
69 | |
70 | /** @var string */ |
71 | private $reUrltextLookahead; |
72 | |
73 | /** @var string */ |
74 | private $urltextPlainSegment = ''; |
75 | |
76 | /** @var bool */ |
77 | private $urltextFoundAutolink = false; |
78 | |
79 | protected function initialize() { |
80 | $this->env = $this->options['env']; |
81 | $this->siteConfig = $this->env->getSiteConfig(); |
82 | |
83 | $tokenizer = $this->options['pegTokenizer']; |
84 | $this->pipelineOpts = $tokenizer->getOptions(); |
85 | // FIXME: inTemplate option may not always be set in |
86 | // standalone tokenizers user by some pipelines handlers. |
87 | $this->pipelineOffset = $this->options['pipelineOffset'] ?? 0; |
88 | $this->extTags = $this->siteConfig->getExtensionTagNameMap(); |
89 | |
90 | // Non-greedy text_char sequence: stop at ampersand, double-underscore, |
91 | // magic link prefix or protocol |
92 | $this->reUrltextLookahead = '!(?:' . |
93 | '([^-\'<[{\n\r:;\]}|\!=&]*?)' . |
94 | '(?:__|$|[-\'<[{\n\r:;\]}|\!=&]|(RFC|PMID|ISBN|' . |
95 | '(?i)' . $this->siteConfig->getProtocolsRegex( true ) . |
96 | ')))!A'; |
97 | } |
98 | |
99 | private $prevOffset = 0; |
100 | private $headingIndex = 0; |
101 | |
102 | private function assert( $condition, $text ) { |
103 | if ( !$condition ) { |
104 | throw new \RuntimeException( "Grammar.pegphp assertion failure: $text" ); |
105 | } |
106 | } |
107 | |
108 | private function unreachable() { |
109 | throw new UnreachableException( "Grammar.pegphp: this should be unreachable" ); |
110 | } |
111 | |
112 | // Some shorthands for legibility |
113 | private function startOffset() { |
114 | return $this->savedPos; |
115 | } |
116 | |
117 | private function endOffset() { |
118 | return $this->currPos; |
119 | } |
120 | |
121 | private function tsrOffsets( $flag = 'default' ): SourceRange { |
122 | switch ( $flag ) { |
123 | case 'start': |
124 | return new SourceRange( $this->savedPos, $this->savedPos ); |
125 | case 'end': |
126 | return new SourceRange( $this->currPos, $this->currPos ); |
127 | default: |
128 | return new SourceRange( $this->savedPos, $this->currPos ); |
129 | } |
130 | } |
131 | |
132 | /* |
133 | * Emit a chunk of tokens to our consumers. Once this has been done, the |
134 | * current expression can return an empty list (true). |
135 | */ |
136 | private function emitChunk( $tokens ) { |
137 | // FIXME: We don't expect nulls here, but looks like |
138 | // hack from I1c695ab6cdd3655e98877c175ddbabdee9dc44b7 |
139 | // introduces them. Work around it for now! |
140 | if ( !$tokens ) { |
141 | return []; |
142 | } |
143 | |
144 | // Shift tsr of all tokens by the pipeline offset |
145 | TokenUtils::shiftTokenTSR( $tokens, $this->pipelineOffset ); |
146 | $this->env->log( 'trace/peg', $this->options['pipelineId'] ?? '0', '----> ', $tokens ); |
147 | |
148 | $i = null; |
149 | $n = count( $tokens ); |
150 | |
151 | // Enforce parsing resource limits |
152 | for ( $i = 0; $i < $n; $i++ ) { |
153 | TokenizerUtils::enforceParserResourceLimits( $this->env, $tokens[ $i ] ); |
154 | } |
155 | |
156 | return $tokens; |
157 | } |
158 | |
159 | /* ------------------------------------------------------------------------ |
160 | * Extension tags should be parsed with higher priority than anything else. |
161 | * |
162 | * The trick we use is to strip out the content inside a matching tag-pair |
163 | * and not tokenize it. The content, if it needs to parsed (for example, |
164 | * for <ref>, <*include*> tags), is parsed in a fresh tokenizer context |
165 | * which means any error correction that needs to happen is restricted to |
166 | * the scope of the extension content and doesn't spill over to the higher |
167 | * level. Ex: <math><!--foo</math>. |
168 | * |
169 | * IGNORE: {{ this just balances the blocks in this comment for pegjs |
170 | * |
171 | * This trick also lets us prevent extension content (that don't accept WT) |
172 | * from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>) |
173 | * We don't want the "}}" being treated as a template closing tag and |
174 | * closing outer templates. |
175 | * --------------------------------------------------------------------- */ |
176 | |
177 | private function isXMLTag( string $name ): bool { |
178 | $lName = mb_strtolower( $name ); |
179 | return isset( Consts::$HTML['HTML5Tags'][$lName] ) || |
180 | isset( Consts::$HTML['OlderHTMLTags'][$lName] ); |
181 | } |
182 | |
183 | private function maybeAnnotationOrExtensionTag( Token $t, ?bool $end, array $attribs, SourceRange $tsr ) { |
184 | $tagName = mb_strtolower( $t->getName() ); |
185 | |
186 | $isAnnotationTag = $this->siteConfig->isAnnotationTag( $tagName ); |
187 | if ( !$isAnnotationTag ) { |
188 | $pipepos = strpos( $tagName, '|' ); |
189 | if ( $pipepos ) { |
190 | $strBeforePipe = substr( $tagName, 0, $pipepos ); |
191 | $isAnnotationTag = $this->siteConfig->isAnnotationTag( $strBeforePipe ); |
192 | if ( $isAnnotationTag ) { |
193 | $attribs = [ new KV( "name", substr( $tagName, $pipepos + 1, strlen( $tagName ) - $pipepos - 1 ) ) ]; |
194 | $tagName = $strBeforePipe; |
195 | } |
196 | } |
197 | } |
198 | |
199 | if ( $isAnnotationTag ) { |
200 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/' . $tagName . ($end ? '/End' : '') ) ]; |
201 | if ( count( $attribs ) > 0 ) { |
202 | $attrMap = []; |
203 | foreach ( $attribs as $attr ) { |
204 | // If the key or the value is not a string, we replace it by the thing that generated it and |
205 | // consider that wikitext as a raw string instead. |
206 | $k = is_string( $attr->k ) ? $attr->k : $attr->ksrc; |
207 | $v = is_string( $attr->v ) ? $attr->v : $attr->vsrc; |
208 | $attrMap[$k] = $v; |
209 | } |
210 | $datamw = []; |
211 | // Possible follow-up in T295168 for attribute sanitation |
212 | $datamw['attrs'] = $attrMap; |
213 | array_push( $metaAttrs, new KV( 'data-mw', PHPUtils::jsonEncode( $datamw ) ) ); |
214 | } |
215 | $dp = new DataParsoid(); |
216 | $dp->tsr = $tsr; |
217 | $this->env->hasAnnotations = true; |
218 | // FIXME: Suppress annotation meta tokens from template pipelines |
219 | // since they may not have TSR values and won't get recognized as |
220 | // annotation ranges. Without TSR, they might end up stuck in |
221 | // fosterable positions and cause havoc on edits by breaking selser. |
222 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
223 | return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ) ]; |
224 | } else { |
225 | return []; |
226 | } |
227 | } |
228 | |
229 | $isInstalledExt = isset( $this->extTags[$tagName] ); |
230 | $isIncludeTag = WTUtils::isIncludeTag( $tagName ); |
231 | |
232 | // Extensions have higher precedence when they shadow html tags. |
233 | if ( !( $isInstalledExt || $isIncludeTag ) ) { |
234 | return $t; |
235 | } |
236 | |
237 | $dp = $t->dataParsoid; |
238 | $skipPos = $this->currPos; |
239 | |
240 | switch ( get_class( $t ) ) { |
241 | case EndTagTk::class: |
242 | if ( $isIncludeTag ) { |
243 | return $t; |
244 | } |
245 | // Similar to TagTk, we rely on the sanitizer to convert to text |
246 | // where necessary and emit tokens to ease the wikitext escaping |
247 | // code. However, extension tags that shadow html tags will see |
248 | // their unmatched end tags dropped while tree building, since |
249 | // the sanitizer will let them through. |
250 | return $t; // not text() |
251 | |
252 | case SelfclosingTagTk::class: |
253 | $dp->src = $dp->tsr->substr( $this->input ); |
254 | $dp->extTagOffsets = new DomSourceRange( |
255 | $dp->tsr->start, $dp->tsr->end, |
256 | $dp->tsr->length(), 0 |
257 | ); |
258 | if ( $isIncludeTag ) { |
259 | return $t; |
260 | } |
261 | break; |
262 | |
263 | case TagTk::class: |
264 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
265 | $tagContentFound = preg_match( $endTagRE, $this->input, $tagContent, 0, $dp->tsr->start ); |
266 | |
267 | if ( !$tagContentFound ) { |
268 | $dp->src = $dp->tsr->substr( $this->input ); |
269 | $dp->extTagOffsets = new DomSourceRange( |
270 | $dp->tsr->start, $dp->tsr->end, |
271 | $dp->tsr->length(), 0 |
272 | ); |
273 | if ( $isIncludeTag ) { |
274 | return $t; |
275 | } else { |
276 | // This is undefined behaviour. The old parser currently |
277 | // returns text here (see core commit 674e8388cba), |
278 | // whereas this results in unclosed |
279 | // extension tags that shadow html tags falling back to |
280 | // their html equivalent. The sanitizer will take care |
281 | // of converting to text where necessary. We do this to |
282 | // simplify `hasWikitextTokens` when escaping wikitext, |
283 | // which wants these as tokens because it's otherwise |
284 | // lacking in context. |
285 | return $t; // not text() |
286 | } |
287 | } |
288 | |
289 | $extSrc = $tagContent[0]; |
290 | $extEndOffset = $dp->tsr->start + strlen( $extSrc ); |
291 | $extEndTagWidth = strlen( $tagContent[1] ); |
292 | |
293 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
294 | // Support nesting in extensions tags while tokenizing in templates |
295 | // to support the #tag parser function. |
296 | // |
297 | // It's necessary to permit this broadly in templates because |
298 | // there's no way to distinguish whether the nesting happened |
299 | // while expanding the #tag parser function, or just a general |
300 | // syntax errors. In other words, |
301 | // |
302 | // hi<ref>ho<ref>hi</ref>ho</ref> |
303 | // |
304 | // and |
305 | // |
306 | // hi{{#tag:ref|ho<ref>hi</ref>ho}} |
307 | // |
308 | // found in template are returned indistinguishably after a |
309 | // preprocessing request, though the old parser renders them |
310 | // differently. #tag in template is probably a common enough |
311 | // use case that we want to accept these false positives, |
312 | // though another approach could be to drop this code here, and |
313 | // invoke a native #tag handler and forgo those in templates. |
314 | // |
315 | // Expand `extSrc` as long as there is a <tagName> found in the |
316 | // extension source body. |
317 | $startTagRE = '~<' . preg_quote( $tagName, '~' ) . '(?:[^/>]|/(?!>))*>~i'; |
318 | $s = substr( $extSrc, $dp->tsr->end - $dp->tsr->start ); |
319 | $openTags = 0; |
320 | while ( true ) { |
321 | if ( preg_match_all( $startTagRE, $s, $matches ) ) { |
322 | $openTags += count( $matches[0] ); |
323 | } |
324 | if ( !$openTags ) { |
325 | break; |
326 | } |
327 | if ( !preg_match( $endTagRE, $this->input, $tagContent, 0, $extEndOffset ) ) { |
328 | break; |
329 | } |
330 | $openTags -= 1; |
331 | $s = $tagContent[0]; |
332 | $extEndOffset += strlen( $s ); |
333 | $extEndTagWidth = strlen( $tagContent[1] ); |
334 | $extSrc .= $s; |
335 | } |
336 | } |
337 | |
338 | // Extension content source |
339 | $dp->src = $extSrc; |
340 | $dp->extTagOffsets = new DomSourceRange( |
341 | $dp->tsr->start, $extEndOffset, |
342 | $dp->tsr->length(), $extEndTagWidth |
343 | ); |
344 | |
345 | $skipPos = $dp->extTagOffsets->innerEnd(); |
346 | |
347 | // If the xml-tag is a known installed (not native) extension, |
348 | // skip the end-tag as well. |
349 | if ( $isInstalledExt ) { |
350 | $skipPos = $dp->extTagOffsets->end; |
351 | } |
352 | break; |
353 | |
354 | default: |
355 | $this->unreachable(); |
356 | } |
357 | |
358 | $this->currPos = $skipPos; |
359 | |
360 | if ( $isInstalledExt ) { |
361 | // update tsr->end to span the start and end tags. |
362 | $dp->tsr->end = $this->endOffset(); // was just modified above |
363 | return new SelfclosingTagTk( 'extension', [ |
364 | new KV( 'typeof', 'mw:Extension' ), |
365 | new KV( 'name', $tagName ), |
366 | new KV( 'about', $this->env->newAboutId() ), |
367 | new KV( 'source', $dp->src ), |
368 | new KV( 'options', $t->attribs ) |
369 | ], $dp |
370 | ); |
371 | } elseif ( $isIncludeTag ) { |
372 | // Parse ext-content, strip eof, and shift tsr |
373 | $extContent = $dp->extTagOffsets->stripTags( $dp->src ); |
374 | $tokenizer = new PegTokenizer( $this->env ); |
375 | $tokenizer->setSourceOffsets( new SourceRange( $dp->extTagOffsets->innerStart(), $dp->extTagOffsets->innerEnd() ) ); |
376 | $extContentToks = $tokenizer->tokenizeSync( $extContent ); |
377 | if ( $dp->extTagOffsets->closeWidth > 0 ) { |
378 | TokenUtils::stripEOFTkFromTokens( $extContentToks ); |
379 | } |
380 | array_unshift( $extContentToks, $t ); |
381 | return $extContentToks; |
382 | } else { |
383 | $this->unreachable(); |
384 | } |
385 | } |
386 | |
387 | |
388 | // cache init |
389 | protected $cache = []; |
390 | |
391 | // expectations |
392 | protected $expectations = [ |
393 | 0 => ["type" => "end", "description" => "end of input"], |
394 | 1 => ["type" => "other", "description" => "start"], |
395 | 2 => ["type" => "other", "description" => "table_start_tag"], |
396 | 3 => ["type" => "class", "value" => "['{]", "description" => "['{]"], |
397 | 4 => ["type" => "literal", "value" => "&", "description" => "\"&\""], |
398 | 5 => ["type" => "other", "description" => "table_attributes"], |
399 | 6 => ["type" => "other", "description" => "generic_newline_attributes"], |
400 | 7 => ["type" => "any", "description" => "any character"], |
401 | 8 => ["type" => "other", "description" => "extlink"], |
402 | 9 => ["type" => "other", "description" => "tlb"], |
403 | 10 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"], |
404 | 11 => ["type" => "literal", "value" => "<!--", "description" => "\"<!--\""], |
405 | 12 => ["type" => "literal", "value" => "-->", "description" => "\"-->\""], |
406 | 13 => ["type" => "literal", "value" => "|", "description" => "\"|\""], |
407 | 14 => ["type" => "literal", "value" => "{{!}}", "description" => "\"{{!}}\""], |
408 | 15 => ["type" => "literal", "value" => "//", "description" => "\"//\""], |
409 | 16 => ["type" => "class", "value" => "[A-Za-z]", "description" => "[A-Za-z]"], |
410 | 17 => ["type" => "class", "value" => "[-A-Za-z0-9+.]", "description" => "[-A-Za-z0-9+.]"], |
411 | 18 => ["type" => "literal", "value" => ":", "description" => "\":\""], |
412 | 19 => ["type" => "literal", "value" => "[", "description" => "\"[\""], |
413 | 20 => ["type" => "class", "value" => "[0-9A-Fa-f:.]", "description" => "[0-9A-Fa-f:.]"], |
414 | 21 => ["type" => "literal", "value" => "]", "description" => "\"]\""], |
415 | 22 => ["type" => "class", "value" => "[^ \\]\\[\\r\\n\"'<>\\x00-\\x20\\x7f&\\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000{]", "description" => "[^ \\]\\[\\r\\n\"'<>\\x00-\\x20\\x7f&\\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000{]"], |
416 | 23 => ["type" => "literal", "value" => "=", "description" => "\"=\""], |
417 | 24 => ["type" => "class", "value" => "[\\0/=>]", "description" => "[\\0/=>]"], |
418 | 25 => ["type" => "class", "value" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]"], |
419 | 26 => ["type" => "literal", "value" => ";", "description" => "\";\""], |
420 | 27 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""], |
421 | 28 => ["type" => "literal", "value" => "\x0d\x0a", "description" => "\"\\r\\n\""], |
422 | 29 => ["type" => "literal", "value" => "{", "description" => "\"{\""], |
423 | 30 => ["type" => "class", "value" => "[#0-9a-zA-Z\u{5e8}\u{5dc}\u{5de}\u{631}\u{644}\u{645}]", "description" => "[#0-9a-zA-Z\u{5e8}\u{5dc}\u{5de}\u{631}\u{644}\u{645}]"], |
424 | 31 => ["type" => "class", "value" => "[\"'=]", "description" => "[\"'=]"], |
425 | 32 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]"], |
426 | 33 => ["type" => "literal", "value" => "'", "description" => "\"'\""], |
427 | 34 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""], |
428 | 35 => ["type" => "literal", "value" => "/", "description" => "\"/\""], |
429 | 36 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]"], |
430 | 37 => ["type" => "class", "value" => "[ \\t\\n\\r\\x0c]", "description" => "[ \\t\\n\\r\\x0c]"], |
431 | 38 => ["type" => "class", "value" => "[^<[{\\n\\r|!\\]}\\-\\t&=\"' \\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[^<[{\\n\\r|!\\]}\\-\\t&=\"' \\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]"], |
432 | 39 => ["type" => "class", "value" => "[&|{\\-!}=]", "description" => "[&|{\\-!}=]"], |
433 | 40 => ["type" => "class", "value" => "[']", "description" => "[']"], |
434 | 41 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""], |
435 | 42 => ["type" => "class", "value" => "[*#:;]", "description" => "[*#:;]"], |
436 | 43 => ["type" => "literal", "value" => "{{", "description" => "\"{{\""], |
437 | 44 => ["type" => "literal", "value" => "<", "description" => "\"<\""], |
438 | 45 => ["type" => "class", "value" => "[^{}&<\\-!\\['\\r\\n|]", "description" => "[^{}&<\\-!\\['\\r\\n|]"], |
439 | 46 => ["type" => "class", "value" => "[{}&<\\-!\\[]", "description" => "[{}&<\\-!\\[]"], |
440 | 47 => ["type" => "class", "value" => "[^{}&<\\-!\\[\"\\r\\n|]", "description" => "[^{}&<\\-!\\[\"\\r\\n|]"], |
441 | 48 => ["type" => "class", "value" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]", "description" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]"], |
442 | 49 => ["type" => "class", "value" => "[^{}&<\\-|/'>]", "description" => "[^{}&<\\-|/'>]"], |
443 | 50 => ["type" => "class", "value" => "[{}&\\-|/]", "description" => "[{}&\\-|/]"], |
444 | 51 => ["type" => "class", "value" => "[^{}&<\\-|/\">]", "description" => "[^{}&<\\-|/\">]"], |
445 | 52 => ["type" => "class", "value" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]", "description" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]"], |
446 | 53 => ["type" => "literal", "value" => "__", "description" => "\"__\""], |
447 | 54 => ["type" => "class", "value" => "[^-'<[{\\n\\r:;\\]}|!=]", "description" => "[^-'<[{\\n\\r:;\\]}|!=]"], |
448 | 55 => ["type" => "literal", "value" => "-", "description" => "\"-\""], |
449 | 56 => ["type" => "literal", "value" => "''", "description" => "\"''\""], |
450 | 57 => ["type" => "literal", "value" => "}", "description" => "\"}\""], |
451 | 58 => ["type" => "class", "value" => "[ \\t\\n\\r\\0\\x0b]", "description" => "[ \\t\\n\\r\\0\\x0b]"], |
452 | 59 => ["type" => "literal", "value" => "----", "description" => "\"----\""], |
453 | 60 => ["type" => "literal", "value" => "{{{", "description" => "\"{{{\""], |
454 | 61 => ["type" => "literal", "value" => "}}}", "description" => "\"}}}\""], |
455 | 62 => ["type" => "literal", "value" => "}}", "description" => "\"}}\""], |
456 | 63 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""], |
457 | 64 => ["type" => "literal", "value" => ">", "description" => "\">\""], |
458 | 65 => ["type" => "literal", "value" => "/>", "description" => "\"/>\""], |
459 | 66 => ["type" => "literal", "value" => "RFC", "description" => "\"RFC\""], |
460 | 67 => ["type" => "literal", "value" => "PMID", "description" => "\"PMID\""], |
461 | 68 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"], |
462 | 69 => ["type" => "literal", "value" => "ISBN", "description" => "\"ISBN\""], |
463 | 70 => ["type" => "class", "value" => "[xX]", "description" => "[xX]"], |
464 | 71 => ["type" => "literal", "value" => "+", "description" => "\"+\""], |
465 | 72 => ["type" => "class", "value" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]", "description" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]"], |
466 | 73 => ["type" => "class", "value" => "[!<\\-\\}\\]\\n\\r]", "description" => "[!<\\-\\}\\]\\n\\r]"], |
467 | 74 => ["type" => "class", "value" => "[^\\t\\n\\v />\\0]", "description" => "[^\\t\\n\\v />\\0]"], |
468 | 75 => ["type" => "literal", "value" => "-{", "description" => "\"-{\""], |
469 | 76 => ["type" => "literal", "value" => "}-", "description" => "\"}-\""], |
470 | 77 => ["type" => "literal", "value" => "!", "description" => "\"!\""], |
471 | 78 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""], |
472 | 79 => ["type" => "literal", "value" => "||", "description" => "\"||\""], |
473 | 80 => ["type" => "literal", "value" => "{{!}}{{!}}", "description" => "\"{{!}}{{!}}\""], |
474 | 81 => ["type" => "literal", "value" => "=>", "description" => "\"=>\""], |
475 | 82 => ["type" => "class", "value" => "[-+A-Z]", "description" => "[-+A-Z]"], |
476 | 83 => ["type" => "class", "value" => "[^{}|;]", "description" => "[^{}|;]"], |
477 | 84 => ["type" => "class", "value" => "[a-z]", "description" => "[a-z]"], |
478 | 85 => ["type" => "class", "value" => "[-a-zA-Z]", "description" => "[-a-zA-Z]"], |
479 | ]; |
480 | |
481 | // actions |
482 | private function a0() { |
483 | |
484 | $this->startTime = null; |
485 | if ( $this->env->profiling() ) { |
486 | $profile = $this->env->getCurrentProfile(); |
487 | $this->startTime = microtime( true ); |
488 | } |
489 | return true; |
490 | |
491 | } |
492 | private function a1($t) { |
493 | |
494 | if ( $this->env->profiling() ) { |
495 | $profile = $this->env->getCurrentProfile(); |
496 | $profile->bumpTimeUse( |
497 | 'PEG', 1000 * ( microtime( true ) - $this->startTime ), 'PEG' ); |
498 | } |
499 | return true; |
500 | |
501 | } |
502 | private function a2($t) { |
503 | return $t; |
504 | } |
505 | private function a3() { |
506 | |
507 | // "tlb" matches "block" matches "sol" matches "newlineToken" |
508 | // But, "tlb" is prefixed with a !eof clause, so, we should only |
509 | // get here on eof. So, safe to unconditionally terminate the |
510 | // generator loop here. |
511 | return false; |
512 | |
513 | } |
514 | private function a4($t, $n) { |
515 | |
516 | if ( count( $t ) ) { |
517 | $ret = TokenizerUtils::flattenIfArray( $t ); |
518 | } else { |
519 | $ret = []; |
520 | } |
521 | if ( count( $n ) ) { |
522 | PHPUtils::pushArray($ret, $n); |
523 | } |
524 | $ret[] = new EOFTk(); |
525 | return $ret; |
526 | |
527 | } |
528 | private function a5($sc) { |
529 | return $this->endOffset(); |
530 | } |
531 | private function a6($sc, $startPos, $b, $p) { |
532 | $this->unreachable(); |
533 | } |
534 | private function a7($sc, $startPos, $b, $p, $ta) { |
535 | return $this->endOffset(); |
536 | } |
537 | private function a8($sc, $startPos, $b, $p, $ta, $tsEndPos, $s2) { |
538 | |
539 | $coms = TokenizerUtils::popComments( $ta ); |
540 | if ( $coms ) { |
541 | $tsEndPos = $coms['commentStartPos']; |
542 | } |
543 | |
544 | $dp = new DataParsoid; |
545 | $dp->tsr = new SourceRange( $startPos, $tsEndPos ); |
546 | if ( $p !== '|' ) { |
547 | // Variation from default |
548 | $dp->startTagSrc = $b . $p; |
549 | } |
550 | |
551 | return array_merge( $sc, |
552 | [ new TagTk( 'table', $ta, $dp ) ], |
553 | $coms ? $coms['buf'] : [], |
554 | $s2 ); |
555 | |
556 | } |
557 | private function a9($proto, $addr, $he) { |
558 | return $he; |
559 | } |
560 | private function a10($proto, $addr, $r) { |
561 | return $r; |
562 | } |
563 | private function a11($proto, $addr, $c) { |
564 | return $c; |
565 | } |
566 | private function a12($proto, $addr, $path) { |
567 | return $addr !== '' || count( $path ) > 0; |
568 | } |
569 | private function a13($proto, $addr, $path) { |
570 | |
571 | return TokenizerUtils::flattenString( array_merge( [ $proto, $addr ], $path ) ); |
572 | |
573 | } |
574 | private function a14($as, $s, $p) { |
575 | |
576 | return [ $as, $s, $p ]; |
577 | |
578 | } |
579 | private function a15($b) { |
580 | return $b; |
581 | } |
582 | private function a16($r) { |
583 | return TokenizerUtils::flattenIfArray( $r ); |
584 | } |
585 | private function a17() { |
586 | return $this->endOffset(); |
587 | } |
588 | private function a18($p0, $addr, $target) { |
589 | return TokenizerUtils::flattenString( [ $addr, $target ] ); |
590 | } |
591 | private function a19($p0, $flat) { |
592 | |
593 | // Protocol must be valid and there ought to be at least one |
594 | // post-protocol character. So strip last char off target |
595 | // before testing protocol. |
596 | if ( is_array( $flat ) ) { |
597 | // There are templates present, alas. |
598 | return count( $flat ) > 0; |
599 | } |
600 | return Utils::isProtocolValid( substr( $flat, 0, -1 ), $this->env ); |
601 | |
602 | } |
603 | private function a20($p0, $flat) { |
604 | return $this->endOffset(); |
605 | } |
606 | private function a21($p0, $flat, $p1, $sp) { |
607 | return $this->endOffset(); |
608 | } |
609 | private function a22($p0, $flat, $p1, $sp, $p2, $content) { |
610 | return $this->endOffset(); |
611 | } |
612 | private function a23($p0, $flat, $p1, $sp, $p2, $content, $p3) { |
613 | |
614 | $tsr1 = new SourceRange( $p0, $p1 ); |
615 | $tsr2 = new SourceRange( $p2, $p3 ); |
616 | $dp = new DataParsoid; |
617 | $dp->tsr = $this->tsrOffsets(); |
618 | $dp->extLinkContentOffsets = $tsr2; |
619 | return [ |
620 | new SelfclosingTagTk( |
621 | 'extlink', |
622 | [ |
623 | new KV( 'href', $flat, $tsr1->expandTsrV() ), |
624 | new KV( 'mw:content', $content ?? '', $tsr2->expandTsrV() ), |
625 | new KV( 'spaces', $sp ) |
626 | ], |
627 | $dp |
628 | ) |
629 | ]; |
630 | } |
631 | private function a24($r) { |
632 | return $r; |
633 | } |
634 | private function a25($b) { |
635 | |
636 | // Clear the tokenizer's backtracking cache after matching each |
637 | // toplevelblock. There won't be any backtracking as a document is just a |
638 | // sequence of toplevelblocks, so the cache for previous toplevelblocks |
639 | // will never be needed. |
640 | $end = $this->startOffset(); |
641 | for ( ; $this->prevOffset < $end; $this->prevOffset++ ) { |
642 | unset( $this->cache[$this->prevOffset] ); |
643 | } |
644 | |
645 | $tokens = null; |
646 | if ( is_array( $b ) && count( $b ) ) { |
647 | $tokens = TokenizerUtils::flattenIfArray( $b ); |
648 | } elseif ( is_string( $b ) ) { |
649 | $tokens = [ $b ]; |
650 | } |
651 | |
652 | // Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline. |
653 | return $this->emitChunk( $tokens ); |
654 | |
655 | } |
656 | private function a26() { |
657 | return [ new NlTk( $this->tsrOffsets() ) ]; |
658 | } |
659 | private function a27($c, $cEnd) { |
660 | |
661 | $data = WTUtils::encodeComment( $c ); |
662 | $dp = new DataParsoid; |
663 | $dp->tsr = $this->tsrOffsets(); |
664 | if ( $cEnd !== '-->' ) { |
665 | $dp->unclosedComment = true; |
666 | } |
667 | return [ new CommentTk( $data, $dp ) ]; |
668 | |
669 | } |
670 | private function a28($p) { |
671 | return Utils::isProtocolValid( $p, $this->env ); |
672 | } |
673 | private function a29($p) { |
674 | return $p; |
675 | } |
676 | private function a30($annOrExtTag, $h, $extlink, $intemplate, &$preproc, $equal, $table, $templateArg, $tableCellArg, $semicolon, $arrow, $linkdesc, $colon, &$th) { |
677 | |
678 | return TokenizerUtils::inlineBreaks( $this->input, $this->endOffset(), [ |
679 | 'annOrExtTag' => $annOrExtTag, |
680 | 'h' => $h, |
681 | 'extlink' => $extlink, |
682 | 'intemplate' => $intemplate, |
683 | 'preproc' => $preproc, |
684 | 'equal' => $equal, |
685 | 'table' => $table, |
686 | 'templateArg' => $templateArg, |
687 | 'tableCellArg' => $tableCellArg, |
688 | 'semicolon' => $semicolon, |
689 | 'arrow' => $arrow, |
690 | 'linkdesc' => $linkdesc, |
691 | 'colon' => $colon, |
692 | 'th' => $th |
693 | ], $this->env ); |
694 | |
695 | } |
696 | private function a31($t) { |
697 | |
698 | return $t; |
699 | |
700 | } |
701 | private function a32($cc) { |
702 | |
703 | // if this is an invalid entity, don't tag it with 'mw:Entity' |
704 | // note that some entities (like ∾̳) decode to 2 codepoints! |
705 | if ( mb_strlen( $cc ) > 2 /* decoded entity would be 1-2 codepoints */ ) { |
706 | return $cc; |
707 | } |
708 | $dpStart = new DataParsoid; |
709 | $dpStart->src = $this->text(); |
710 | $dpStart->srcContent = $cc; |
711 | $dpStart->tsr = $this->tsrOffsets( 'start' ); |
712 | $dpEnd = new DataParsoid; |
713 | $dpEnd->tsr = $this->tsrOffsets( 'end' ); |
714 | return [ |
715 | // If this changes, the nowiki extension's toDOM will need to follow suit |
716 | new TagTk( 'span', [ new KV( 'typeof', 'mw:Entity' ) ], $dpStart ), |
717 | $cc, |
718 | new EndTagTk( 'span', [], $dpEnd ) |
719 | ]; |
720 | |
721 | } |
722 | private function a33($s) { |
723 | return $this->endOffset(); |
724 | } |
725 | private function a34($s, $namePos0, $name) { |
726 | return $this->endOffset(); |
727 | } |
728 | private function a35($s, $namePos0, $name, $namePos, $v) { |
729 | return $v; |
730 | } |
731 | private function a36($s, $namePos0, $name, $namePos, $vd) { |
732 | |
733 | // NB: Keep in sync w/ generic_newline_attribute |
734 | $res = null; |
735 | // Encapsulate protected attributes. |
736 | if ( gettype( $name ) === 'string' ) { |
737 | $name = TokenizerUtils::protectAttrs( $name ); |
738 | } |
739 | $nameSO = new SourceRange( $namePos0, $namePos ); |
740 | if ( $vd !== null ) { |
741 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
742 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
743 | } else { |
744 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
745 | } |
746 | if ( is_array( $name ) ) { |
747 | $res->ksrc = $nameSO->substr( $this->input ); |
748 | } |
749 | return $res; |
750 | |
751 | } |
752 | private function a37($s) { |
753 | |
754 | if ( $s !== '' ) { |
755 | return [ $s ]; |
756 | } else { |
757 | return []; |
758 | } |
759 | |
760 | } |
761 | private function a38($c) { |
762 | return new KV( $c, '' ); |
763 | } |
764 | private function a39($namePos0, $name) { |
765 | return $this->endOffset(); |
766 | } |
767 | private function a40($namePos0, $name, $namePos, $v) { |
768 | return $v; |
769 | } |
770 | private function a41($namePos0, $name, $namePos, $vd) { |
771 | |
772 | // NB: Keep in sync w/ table_attibute |
773 | $res = null; |
774 | // Encapsulate protected attributes. |
775 | if ( is_string( $name ) ) { |
776 | $name = TokenizerUtils::protectAttrs( $name ); |
777 | } |
778 | $nameSO = new SourceRange( $namePos0, $namePos ); |
779 | if ( $vd !== null ) { |
780 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
781 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
782 | } else { |
783 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
784 | } |
785 | if ( is_array( $name ) ) { |
786 | $res->ksrc = $nameSO->substr( $this->input ); |
787 | } |
788 | return $res; |
789 | |
790 | } |
791 | private function a42($s) { |
792 | return $s; |
793 | } |
794 | private function a43($c) { |
795 | |
796 | return TokenizerUtils::flattenStringlist( $c ); |
797 | |
798 | } |
799 | private function a44($lc) { |
800 | return $lc; |
801 | } |
802 | private function a45($bullets, $c) { |
803 | return $this->endOffset(); |
804 | } |
805 | private function a46($bullets, $c, $cpos, $d) { |
806 | |
807 | // Leave bullets as an array -- list handler expects this |
808 | // TSR: +1 for the leading ";" |
809 | $numBullets = count( $bullets ) + 1; |
810 | $tsr = $this->tsrOffsets( 'start' ); |
811 | $tsr->end += $numBullets; |
812 | $li1Bullets = $bullets; |
813 | $li1Bullets[] = ';'; |
814 | $dp = new DataParsoid; |
815 | $dp->tsr = $tsr; |
816 | $li1 = new TagTk( 'listItem', [ new KV( 'bullets', $li1Bullets, $tsr->expandTsrV() ) ], $dp ); |
817 | // TSR: -1 for the intermediate ":" |
818 | $li2Bullets = $bullets; |
819 | $li2Bullets[] = ':'; |
820 | $tsr2 = new SourceRange( $cpos - 1, $cpos ); |
821 | $dp2 = new DataParsoid; |
822 | $dp2->tsr = $tsr2; |
823 | $dp2->stx = 'row'; |
824 | $li2 = new TagTk( 'listItem', [ new KV( 'bullets', $li2Bullets, $tsr2->expandTsrV() ) ], $dp2 ); |
825 | |
826 | return array_merge( [ $li1 ], $c ?: [], [ $li2 ], $d ?: [] ); |
827 | |
828 | } |
829 | private function a47($bullets, $tbl, $line) { |
830 | |
831 | // Leave bullets as an array -- list handler expects this |
832 | $tsr = $this->tsrOffsets( 'start' ); |
833 | $tsr->end += count( $bullets ); |
834 | $dp = new DataParsoid; |
835 | $dp->tsr = $tsr; |
836 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
837 | return TokenizerUtils::flattenIfArray( [ $li, $tbl, $line ?: [] ] ); |
838 | |
839 | } |
840 | private function a48($bullets, $c) { |
841 | |
842 | // Leave bullets as an array -- list handler expects this |
843 | $tsr = $this->tsrOffsets( 'start' ); |
844 | $tsr->end += count( $bullets ); |
845 | $dp = new DataParsoid; |
846 | $dp->tsr = $tsr; |
847 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
848 | return array_merge( [ $li ], $c ?: [] ); |
849 | |
850 | } |
851 | private function a49() { |
852 | return $this->endOffset() === $this->inputLength; |
853 | } |
854 | private function a50($r, $cil, $bl) { |
855 | |
856 | return array_merge( [ $r ], $cil, $bl ?: [] ); |
857 | |
858 | } |
859 | private function a51($a) { |
860 | return $a; |
861 | } |
862 | private function a52($a, $b) { |
863 | return [ $a, $b ]; |
864 | } |
865 | private function a53($m) { |
866 | |
867 | return Utils::decodeWtEntities( $m ); |
868 | |
869 | } |
870 | private function a54($q, $x, $ill) { |
871 | return array_merge( $x, $ill ?: [] ); |
872 | } |
873 | private function a55($q, $t) { |
874 | return $t; |
875 | } |
876 | private function a56($q, $r) { |
877 | return count( $r ) > 0 || $q !== ''; |
878 | } |
879 | private function a57($q, $r) { |
880 | |
881 | array_unshift( $r, $q ); |
882 | return TokenizerUtils::flattenString( $r ); |
883 | |
884 | } |
885 | private function a58($s, $t, $q) { |
886 | |
887 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() - strlen( $q ) ); |
888 | |
889 | } |
890 | private function a59($s, $t) { |
891 | |
892 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() ); |
893 | |
894 | } |
895 | private function a60($r) { |
896 | |
897 | return TokenizerUtils::flattenString( $r ); |
898 | |
899 | } |
900 | private function a61() { |
901 | |
902 | if ( preg_match( $this->reUrltextLookahead, $this->input, $m, 0, $this->currPos ) ) { |
903 | $plain = $m[1]; |
904 | $this->urltextPlainSegment = $plain; |
905 | $this->urltextFoundAutolink = ( $m[2] ?? '' ) !== ''; |
906 | return (bool)strlen( $plain ); |
907 | } else { |
908 | $this->urltextFoundAutolink = false; |
909 | return false; |
910 | } |
911 | |
912 | } |
913 | private function a62() { |
914 | |
915 | $this->currPos += strlen( $this->urltextPlainSegment ); |
916 | return $this->urltextPlainSegment; |
917 | |
918 | } |
919 | private function a63() { |
920 | return $this->urltextFoundAutolink; |
921 | } |
922 | private function a64($al) { |
923 | return $al; |
924 | } |
925 | private function a65($he) { |
926 | return $he; |
927 | } |
928 | private function a66($bs) { |
929 | return $bs; |
930 | } |
931 | private function a67($tl) { |
932 | |
933 | return $tl; |
934 | |
935 | } |
936 | private function a68() { |
937 | return $this->endOffset() === 0 && !$this->pipelineOffset; |
938 | } |
939 | private function a69($rw, $sp, $c, $wl) { |
940 | |
941 | return count( $wl ) === 1 && $wl[0] instanceof Token; |
942 | |
943 | } |
944 | private function a70($rw, $sp, $c, $wl) { |
945 | |
946 | $link = $wl[0]; |
947 | if ( $sp ) { |
948 | $rw .= $sp; |
949 | } |
950 | if ( $c ) { |
951 | $rw .= $c; |
952 | } |
953 | // Build a redirect token |
954 | $dp = new DataParsoid; |
955 | $dp->src = $rw; |
956 | $dp->tsr = $this->tsrOffsets(); |
957 | $dp->linkTk = $link; |
958 | $redirect = new SelfclosingTagTk( 'mw:redirect', |
959 | // Put 'href' into attributes so it gets template-expanded |
960 | [ $link->getAttributeKV( 'href' ) ], |
961 | $dp |
962 | ); |
963 | return $redirect; |
964 | |
965 | } |
966 | private function a71($st, $tl) { |
967 | |
968 | return array_merge( $st, $tl ); |
969 | |
970 | } |
971 | private function a72($s, $os, $so) { |
972 | return array_merge( $os, $so ); |
973 | } |
974 | private function a73($s, $s2, $bl) { |
975 | |
976 | return array_merge( $s, $s2 ?: [], $bl ); |
977 | |
978 | } |
979 | private function a74(&$preproc, $t) { |
980 | |
981 | $preproc = null; |
982 | return $t; |
983 | |
984 | } |
985 | private function a75($v) { |
986 | return $v; |
987 | } |
988 | private function a76($e) { |
989 | return $e; |
990 | } |
991 | private function a77($tag) { |
992 | return $tag; |
993 | } |
994 | private function a78() { |
995 | return Utils::isUniWord(Utils::lastUniChar( $this->input, $this->endOffset() ) ); |
996 | } |
997 | private function a79($bs) { |
998 | |
999 | if ( $this->siteConfig->isBehaviorSwitch( $bs ) ) { |
1000 | $dp = new DataParsoid; |
1001 | $dp->tsr = $this->tsrOffsets(); |
1002 | $dp->src = $bs; |
1003 | $dp->magicSrc = $bs; |
1004 | return [ |
1005 | new SelfclosingTagTk( 'behavior-switch', [ new KV( 'word', $bs ) ], $dp ) |
1006 | ]; |
1007 | } else { |
1008 | return [ $bs ]; |
1009 | } |
1010 | |
1011 | } |
1012 | private function a80($quotes) { |
1013 | |
1014 | // sequences of four or more than five quotes are assumed to start |
1015 | // with some number of plain-text apostrophes. |
1016 | $plainticks = 0; |
1017 | $result = []; |
1018 | if ( strlen( $quotes ) === 4 ) { |
1019 | $plainticks = 1; |
1020 | } elseif ( strlen( $quotes ) > 5 ) { |
1021 | $plainticks = strlen( $quotes ) - 5; |
1022 | } |
1023 | if ( $plainticks > 0 ) { |
1024 | $result[] = substr( $quotes, 0, $plainticks ); |
1025 | } |
1026 | // mw-quote token will be consumed in token transforms |
1027 | $tsr = $this->tsrOffsets(); |
1028 | $tsr->start += $plainticks; |
1029 | $dp = new DataParsoid; |
1030 | $dp->tsr = $tsr; |
1031 | $mwq = new SelfclosingTagTk( 'mw-quote', |
1032 | [ new KV( 'value', substr( $quotes, $plainticks ) ) ], |
1033 | $dp ); |
1034 | if ( strlen( $quotes ) > 2 ) { |
1035 | $mwq->addAttribute( 'isSpace_1', $tsr->start > 0 && substr( $this->input, $tsr->start - 1, 1 ) === ' '); |
1036 | $mwq->addAttribute( 'isSpace_2', $tsr->start > 1 && substr( $this->input, $tsr->start - 2, 1 ) === ' '); |
1037 | } |
1038 | $result[] = $mwq; |
1039 | return $result; |
1040 | |
1041 | } |
1042 | private function a81($sc, $startPos, $p, $b) { |
1043 | |
1044 | $dp = new DataParsoid; |
1045 | $dp->tsr = new SourceRange( $startPos, $this->endOffset() ); |
1046 | $tblEnd = new EndTagTk( 'table', [], $dp ); |
1047 | if ( $p !== '|' ) { |
1048 | // p+"<brace-char>" is triggering some bug in pegJS |
1049 | // I cannot even use that expression in the comment! |
1050 | $tblEnd->dataParsoid->endTagSrc = $p . $b; |
1051 | } |
1052 | array_push( $sc, $tblEnd ); |
1053 | return $sc; |
1054 | |
1055 | } |
1056 | private function a82($sp) { |
1057 | return $this->endOffset(); |
1058 | } |
1059 | private function a83($sp, $p, $c) { |
1060 | |
1061 | $dp = new DataParsoid; |
1062 | $dp->tsr = new SourceRange( $p, $this->endOffset() ); |
1063 | $dp->tokens = TokenizerUtils::flattenIfArray( $c ); |
1064 | return [ |
1065 | $sp, |
1066 | new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:EmptyLine' ) ], $dp ) |
1067 | ]; |
1068 | |
1069 | } |
1070 | private function a84() { |
1071 | |
1072 | // Use the sol flag only at the start of the input |
1073 | // Flag should always be an actual boolean (not falsy or undefined) |
1074 | $this->assert( is_bool( $this->options['sol'] ), 'sol should be boolean' ); |
1075 | return $this->endOffset() === 0 && $this->options['sol']; |
1076 | |
1077 | } |
1078 | private function a85() { |
1079 | |
1080 | return []; |
1081 | |
1082 | } |
1083 | private function a86($rw) { |
1084 | |
1085 | return preg_match( $this->env->getSiteConfig()->getMagicWordMatcher( 'redirect' ), $rw ); |
1086 | |
1087 | } |
1088 | private function a87($il, $sol_il) { |
1089 | |
1090 | $il = $il[0]; |
1091 | $lname = mb_strtolower( $il->getName() ); |
1092 | if ( !WTUtils::isIncludeTag( $lname ) ) { return false; } |
1093 | // Preserve SOL where necessary (for onlyinclude and noinclude) |
1094 | // Note that this only works because we encounter <*include*> tags in |
1095 | // the toplevel content and we rely on the php preprocessor to expand |
1096 | // templates, so we shouldn't ever be tokenizing inInclude. |
1097 | // Last line should be empty (except for comments) |
1098 | if ( $lname !== 'includeonly' && $sol_il && $il instanceof TagTk ) { |
1099 | $dp = $il->dataParsoid; |
1100 | $inclContent = $dp->extTagOffsets->stripTags( $dp->src ); |
1101 | $nlpos = strrpos( $inclContent, "\n" ); |
1102 | $last = $nlpos === false ? $inclContent : substr( $inclContent, $nlpos + 1 ); |
1103 | if ( !preg_match( '/^(<!--([^-]|-(?!->))*-->)*$/D', $last ) ) { |
1104 | return false; |
1105 | } |
1106 | } |
1107 | return true; |
1108 | |
1109 | } |
1110 | private function a88($il, $sol_il) { |
1111 | |
1112 | return $il; |
1113 | |
1114 | } |
1115 | private function a89($annToken) { |
1116 | |
1117 | return ( $annToken instanceof Token && $annToken->getName() !== 'extension' ); |
1118 | |
1119 | } |
1120 | private function a90($annToken) { |
1121 | return $annToken; |
1122 | } |
1123 | private function a91($s, $ill) { |
1124 | return $ill ?: []; |
1125 | } |
1126 | private function a92($s, $ce) { |
1127 | return $ce || strlen( $s ) > 2; |
1128 | } |
1129 | private function a93($s, $ce) { |
1130 | return $this->endOffset(); |
1131 | } |
1132 | private function a94($s, $ce, $endTPos, $spc) { |
1133 | |
1134 | $c = null; |
1135 | $e = null; |
1136 | $level = null; |
1137 | if ( $ce ) { |
1138 | $c = $ce[0]; |
1139 | $e = $ce[1]; |
1140 | $level = min( strlen( $s ), strlen( $e ) ); |
1141 | } else { |
1142 | // split up equal signs into two equal parts, with at least |
1143 | // one character in the middle. |
1144 | $level = (int)floor( ( strlen( $s ) - 1 ) / 2 ); |
1145 | $c = [ str_repeat( '=', strlen( $s ) - 2 * $level ) ]; |
1146 | $s = $e = str_repeat( '=', $level ); |
1147 | } |
1148 | $level = min( 6, $level ); |
1149 | // convert surplus equals into text |
1150 | if ( strlen( $s ) > $level ) { |
1151 | $extras1 = substr( $s, 0, strlen( $s ) - $level ); |
1152 | if ( is_string( $c[0] ) ) { |
1153 | $c[0] = $extras1 . $c[0]; |
1154 | } else { |
1155 | array_unshift( $c, $extras1 ); |
1156 | } |
1157 | } |
1158 | if ( strlen( $e ) > $level ) { |
1159 | $extras2 = substr( $e, 0, strlen( $e ) - $level ); |
1160 | $lastElem = PHPUtils::lastItem( $c ); |
1161 | if ( is_string( $lastElem ) ) { |
1162 | $c[count( $c ) - 1] .= $extras2; |
1163 | } else { |
1164 | $c[] = $extras2; |
1165 | } |
1166 | } |
1167 | |
1168 | $tagDP = new DataParsoid; |
1169 | $tagDP->tsr = $this->tsrOffsets( 'start' ); |
1170 | $tagDP->tsr->end += $level; |
1171 | // Match the old parser's behavior by (a) making headingIndex part of tokenizer |
1172 | // state(don't reuse pipeline!) and (b) assigning the index when |
1173 | // ==*== is tokenized, even if we're inside a template argument |
1174 | // or other context which won't end up putting the heading |
1175 | // on the output page. T213468/T214538 |
1176 | $this->headingIndex++; |
1177 | $tagDP->getTemp()->headingIndex = $this->headingIndex; |
1178 | $res = [ new TagTk( 'h' . $level, [], $tagDP ) ]; |
1179 | |
1180 | PHPUtils::pushArray( $res, $c ); |
1181 | |
1182 | $endTagDP = new DataParsoid; |
1183 | $endTagDP->tsr = new SourceRange( $endTPos - $level, $endTPos ); |
1184 | $res[] = new EndTagTk( 'h' . $level, [], $endTagDP ); |
1185 | $res[] = $spc; |
1186 | return $res; |
1187 | |
1188 | } |
1189 | private function a95($d) { |
1190 | return null; |
1191 | } |
1192 | private function a96($d) { |
1193 | return true; |
1194 | } |
1195 | private function a97($d, $lineContent) { |
1196 | |
1197 | $dataParsoid = new DataParsoid; |
1198 | $dataParsoid->tsr = $this->tsrOffsets(); |
1199 | if ( $lineContent !== null ) { |
1200 | $dataParsoid->lineContent = $lineContent; |
1201 | } |
1202 | if ( strlen( $d ) > 0 ) { |
1203 | $dataParsoid->extra_dashes = strlen( $d ); |
1204 | } |
1205 | return [new SelfclosingTagTk( 'hr', [], $dataParsoid )]; |
1206 | |
1207 | } |
1208 | private function a98($p, $target) { |
1209 | return $this->endOffset(); |
1210 | } |
1211 | private function a99($p, $target, $p0, $v) { |
1212 | return $this->endOffset(); |
1213 | } |
1214 | private function a100($p, $target, $p0, $v, $p1) { |
1215 | |
1216 | // empty argument |
1217 | return [ 'tokens' => $v, 'srcOffsets' => new SourceRange( $p0, $p1 ) ]; |
1218 | |
1219 | } |
1220 | private function a101($p, $target, $r) { |
1221 | return $r; |
1222 | } |
1223 | private function a102($p, $target, $params) { |
1224 | |
1225 | $kvs = []; |
1226 | |
1227 | if ( $target === null ) { |
1228 | $target = [ 'tokens' => '', 'srcOffsets' => new SourceRange( $p, $p ) ]; |
1229 | } |
1230 | // Insert target as first positional attribute, so that it can be |
1231 | // generically expanded. The TemplateHandler then needs to shift it out |
1232 | // again. |
1233 | $kvs[] = new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ); |
1234 | |
1235 | foreach ( $params as $o ) { |
1236 | $s = $o['srcOffsets']; |
1237 | $kvs[] = new KV( '', TokenizerUtils::flattenIfArray( $o['tokens'] ), $s->expandTsrV() ); |
1238 | } |
1239 | |
1240 | $dp = new DataParsoid; |
1241 | $dp->tsr = $this->tsrOffsets(); |
1242 | $dp->src = $this->text(); |
1243 | $obj = new SelfclosingTagTk( 'templatearg', $kvs, $dp ); |
1244 | return $obj; |
1245 | |
1246 | } |
1247 | private function a103($leadWS, $target) { |
1248 | return $this->endOffset(); |
1249 | } |
1250 | private function a104($leadWS, $target, $p0, $v) { |
1251 | return $this->endOffset(); |
1252 | } |
1253 | private function a105($leadWS, $target, $p0, $v, $p) { |
1254 | |
1255 | // empty argument |
1256 | $tsr0 = new SourceRange( $p0, $p ); |
1257 | return new KV( '', TokenizerUtils::flattenIfArray( $v ), $tsr0->expandTsrV() ); |
1258 | |
1259 | } |
1260 | private function a106($leadWS, $target, $r) { |
1261 | return $r; |
1262 | } |
1263 | private function a107($leadWS, $target, $params, $trailWS) { |
1264 | |
1265 | // Insert target as first positional attribute, so that it can be |
1266 | // generically expanded. The TemplateHandler then needs to shift it out |
1267 | // again. |
1268 | array_unshift( $params, new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ) ); |
1269 | $dp = new DataParsoid; |
1270 | $dp->tsr = $this->tsrOffsets(); |
1271 | $dp->src = $this->text(); |
1272 | $tmp = $dp->getTemp(); |
1273 | $tmp->leadWS = $leadWS; |
1274 | $tmp->trailWS = $trailWS; |
1275 | $obj = new SelfclosingTagTk( 'template', $params, $dp ); |
1276 | return $obj; |
1277 | |
1278 | } |
1279 | private function a108($spos, $target) { |
1280 | return $this->endOffset(); |
1281 | } |
1282 | private function a109($spos, $target, $tpos, $lcs) { |
1283 | |
1284 | $pipeTrick = count( $lcs ) === 1 && count( $lcs[0]->v ) === 0; |
1285 | $textTokens = []; |
1286 | if ( $target === null || $pipeTrick ) { |
1287 | $textTokens[] = '[['; |
1288 | if ( $target ) { |
1289 | $textTokens[] = $target; |
1290 | } |
1291 | foreach ( $lcs as $a ) { |
1292 | // a is a mw:maybeContent attribute |
1293 | $textTokens[] = '|'; |
1294 | if ( count( $a->v ) > 0 ) { |
1295 | $textTokens[] = $a->v; |
1296 | } |
1297 | } |
1298 | $textTokens[] = ']]'; |
1299 | return $textTokens; |
1300 | } |
1301 | $obj = new SelfclosingTagTk( 'wikilink' ); |
1302 | $tsr = new SourceRange( $spos, $tpos ); |
1303 | $hrefKV = new KV( 'href', $target, $tsr->expandTsrV() ); |
1304 | $hrefKV->vsrc = $tsr->substr( $this->input ); |
1305 | // XXX: Point to object with path, revision and input information |
1306 | // obj.source = input; |
1307 | $obj->attribs[] = $hrefKV; |
1308 | $obj->attribs = array_merge( $obj->attribs, $lcs ); |
1309 | $dp = new DataParsoid; |
1310 | $dp->tsr = $this->tsrOffsets(); |
1311 | $dp->src = $this->text(); |
1312 | $obj->dataParsoid = $dp; |
1313 | return [ $obj ]; |
1314 | |
1315 | } |
1316 | private function a110(&$preproc) { |
1317 | $preproc = null; return true; |
1318 | } |
1319 | private function a111(&$preproc, $a) { |
1320 | |
1321 | return $a; |
1322 | |
1323 | } |
1324 | private function a112($extToken) { |
1325 | return !$extToken || $extToken[0]->getName() === 'extension' || |
1326 | ($extToken[0]->getName() === 'meta' && preg_match( WTUtils::ANNOTATION_META_TYPE_REGEXP, $extToken[0]->getAttributeV( 'typeof' ) ?? '' ) > 0); |
1327 | } |
1328 | private function a113($extToken) { |
1329 | return !$extToken ? '' : $extToken[0]; |
1330 | } |
1331 | private function a114() { |
1332 | |
1333 | $this->assert( |
1334 | $this->input[$this->currPos - 1] === '<', |
1335 | 'Failed to open xmlish_tag before entering.' |
1336 | ); |
1337 | return true; |
1338 | |
1339 | } |
1340 | private function a115($end, $name, $annOrExtTag) { |
1341 | |
1342 | if ( $annOrExtTag ) { |
1343 | return WTUtils::isAnnOrExtTag( $this->env, $name ); |
1344 | } else { |
1345 | // Only enforce ascii alpha first char for non-extension tags. |
1346 | // See tag_name above for the details. |
1347 | return preg_match( '/^[A-Za-z]/', $name ) && $this->isXMLTag( $name ); |
1348 | } |
1349 | |
1350 | } |
1351 | private function a116($end, $name, $annOrExtTag, $attribs, $selfclose) { |
1352 | |
1353 | $lcName = mb_strtolower( $name ); |
1354 | |
1355 | // Extension tags don't necessarily have the same semantics as html tags, |
1356 | // so don't treat them as void elements. |
1357 | $isVoidElt = Utils::isVoidElement( $lcName ) && !$annOrExtTag; |
1358 | |
1359 | // Support </br> |
1360 | if ( $lcName === 'br' && $end ) { |
1361 | $end = null; |
1362 | } |
1363 | |
1364 | $tsr = $this->tsrOffsets(); |
1365 | $tsr->start--; // For "<" matched at the start of xmlish_tag rule |
1366 | $res = TokenizerUtils::buildXMLTag( $name, $lcName, $attribs, $end, !!$selfclose || $isVoidElt, $tsr ); |
1367 | |
1368 | // change up data-attribs in one scenario |
1369 | // void-elts that aren't self-closed ==> useful for accurate RT-ing |
1370 | if ( !$selfclose && $isVoidElt ) { |
1371 | unset( $res->dataParsoid->selfClose ); |
1372 | $res->dataParsoid->noClose = true; |
1373 | } |
1374 | |
1375 | $met = $this->maybeAnnotationOrExtensionTag( $res, $end, $attribs, $tsr ); |
1376 | return is_array( $met ) ? $met : [ $met ]; |
1377 | |
1378 | } |
1379 | private function a117() { |
1380 | return $this->env->hasAnnotations && $this->siteConfig->isAnnotationTag( 'tvar' ); |
1381 | } |
1382 | private function a118() { |
1383 | |
1384 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/tvar/End' ) ]; |
1385 | $dp = new DataParsoid(); |
1386 | $dp->tsr = $this->tsrOffsets(); |
1387 | $dp->tsr->start--; // For "<" matched at the start of xmlish_tag rule |
1388 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
1389 | return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ) ]; |
1390 | } else { |
1391 | // suppress meta tags from pipeline output |
1392 | return []; |
1393 | } |
1394 | |
1395 | } |
1396 | private function a119($proto, $addr, $rhe) { |
1397 | return $rhe === '<' || $rhe === '>' || $rhe === "\u{A0}"; |
1398 | } |
1399 | private function a120($proto, $addr, $path) { |
1400 | |
1401 | // as in Parser.php::makeFreeExternalLink, we're going to |
1402 | // yank trailing punctuation out of this match. |
1403 | $url = TokenizerUtils::flattenStringlist( array_merge( [ $proto, $addr ], $path ) ); |
1404 | // only need to look at last element; HTML entities are strip-proof. |
1405 | $last = PHPUtils::lastItem( $url ); |
1406 | $trim = 0; |
1407 | if ( is_string( $last ) ) { |
1408 | $strip = TokenizerUtils::getAutoUrlTerminatingChars( in_array( '(', $path, true ) ); |
1409 | $trim = strspn( strrev( $last ), $strip ); |
1410 | $url[ count( $url ) - 1 ] = substr( $last, 0, strlen( $last ) - $trim ); |
1411 | } |
1412 | $url = TokenizerUtils::flattenStringlist( $url ); |
1413 | if ( count( $url ) === 1 && is_string( $url[0] ) && strlen( $url[0] ) <= strlen( $proto ) ) { |
1414 | return null; // ensure we haven't stripped everything: T106945 |
1415 | } |
1416 | $this->currPos -= $trim; |
1417 | return $url; |
1418 | |
1419 | } |
1420 | private function a121($r) { |
1421 | return $r !== null; |
1422 | } |
1423 | private function a122($r) { |
1424 | |
1425 | $tsr = $this->tsrOffsets(); |
1426 | $dp = new DataParsoid; |
1427 | $dp->tsr = $tsr; |
1428 | $res = [ new SelfclosingTagTk( 'urllink', [ new KV( 'href', $r, $tsr->expandTsrV() ) ], $dp ) ]; |
1429 | return $res; |
1430 | |
1431 | } |
1432 | private function a123($ref, $sp, $identifier) { |
1433 | |
1434 | $base_urls = [ |
1435 | 'RFC' => 'https://tools.ietf.org/html/rfc%s', |
1436 | 'PMID' => '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract' |
1437 | ]; |
1438 | $tsr = $this->tsrOffsets(); |
1439 | $dp = new DataParsoid; |
1440 | $dp->tsr = $tsr; |
1441 | $dp->stx = 'magiclink'; |
1442 | return [ |
1443 | new SelfclosingTagTk( 'extlink', [ |
1444 | new KV( 'href', sprintf( $base_urls[ $ref ], $identifier ) ), |
1445 | new KV( 'mw:content', TokenizerUtils::flattenString( [ $ref, $sp, $identifier ] ), $tsr->expandTsrV() ), |
1446 | new KV( 'typeof', 'mw:ExtLink/' . $ref ) |
1447 | ], |
1448 | $dp |
1449 | ) |
1450 | ]; |
1451 | |
1452 | } |
1453 | private function a124($sp, $isbn) { |
1454 | |
1455 | // Convert isbn token-and-entity array to stripped string. |
1456 | $stripped = ''; |
1457 | foreach ( TokenizerUtils::flattenStringlist( $isbn ) as $part ) { |
1458 | if ( is_string( $part ) ) { |
1459 | $stripped .= $part; |
1460 | } |
1461 | } |
1462 | return strtoupper( preg_replace( '/[^\dX]/i', '', $stripped ) ); |
1463 | |
1464 | } |
1465 | private function a125($sp, $isbn, $isbncode) { |
1466 | |
1467 | // ISBNs can only be 10 or 13 digits long (with a specific format) |
1468 | return strlen( $isbncode ) === 10 |
1469 | || ( strlen( $isbncode ) === 13 && preg_match( '/^97[89]/', $isbncode ) ); |
1470 | |
1471 | } |
1472 | private function a126($sp, $isbn, $isbncode) { |
1473 | |
1474 | $tsr = $this->tsrOffsets(); |
1475 | $dp = new DataParsoid; |
1476 | $dp->stx = 'magiclink'; |
1477 | $dp->tsr = $tsr; |
1478 | return [ |
1479 | new SelfclosingTagTk( 'extlink', [ |
1480 | new KV( 'href', 'Special:BookSources/' . $isbncode ), |
1481 | new KV( 'mw:content', TokenizerUtils::flattenString( [ 'ISBN', $sp, $isbn ] ), $tsr->expandTsrV() ), |
1482 | new KV( 'typeof', 'mw:WikiLink/ISBN' ) |
1483 | ], |
1484 | $dp |
1485 | ) |
1486 | ]; |
1487 | |
1488 | } |
1489 | private function a127($p, $dashes) { |
1490 | $this->unreachable(); |
1491 | } |
1492 | private function a128($p, $dashes, $a) { |
1493 | return $this->endOffset(); |
1494 | } |
1495 | private function a129($p, $dashes, $a, $tagEndPos, $s2) { |
1496 | |
1497 | $coms = TokenizerUtils::popComments( $a ); |
1498 | if ( $coms ) { |
1499 | $tagEndPos = $coms['commentStartPos']; |
1500 | } |
1501 | |
1502 | $da = new DataParsoid; |
1503 | $da->tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1504 | $da->startTagSrc = $p . $dashes; |
1505 | |
1506 | // We rely on our tree builder to close the row as needed. This is |
1507 | // needed to support building tables from fragment templates with |
1508 | // individual cells or rows. |
1509 | $trToken = new TagTk( 'tr', $a, $da ); |
1510 | |
1511 | return array_merge( [ $trToken ], $coms ? $coms['buf'] : [], $s2 ); |
1512 | |
1513 | } |
1514 | private function a130($p, $td) { |
1515 | return $this->endOffset(); |
1516 | } |
1517 | private function a131($p, $td, $tagEndPos, $tds) { |
1518 | |
1519 | // Avoid modifying a cached result |
1520 | $td[0] = clone $td[0]; |
1521 | $da = $td[0]->dataParsoid = clone $td[0]->dataParsoid; |
1522 | $da->tsr = clone $da->tsr; |
1523 | |
1524 | $da->tsr->start -= strlen( $p ); // include "|" |
1525 | if ( $p !== '|' ) { |
1526 | // Variation from default |
1527 | $da->startTagSrc = $p; |
1528 | } |
1529 | return array_merge( $td, $tds ); |
1530 | |
1531 | } |
1532 | private function a132($p, $args) { |
1533 | return $this->endOffset(); |
1534 | } |
1535 | private function a133($p, $args, $tagEndPos, $c) { |
1536 | |
1537 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1538 | return TokenizerUtils::buildTableTokens( |
1539 | 'caption', '|+', $args, $tsr, $this->endOffset(), $c, true ); |
1540 | |
1541 | } |
1542 | private function a134($tpt) { |
1543 | |
1544 | return [ 'tokens' => $tpt, 'srcOffsets' => $this->tsrOffsets() ]; |
1545 | |
1546 | } |
1547 | private function a135($name) { |
1548 | return $this->endOffset(); |
1549 | } |
1550 | private function a136($name, $kEndPos) { |
1551 | return $this->endOffset(); |
1552 | } |
1553 | private function a137($name, $kEndPos, $vStartPos, $optSp, $tpv) { |
1554 | |
1555 | return [ |
1556 | 'kEndPos' => $kEndPos, |
1557 | 'vStartPos' => $vStartPos, |
1558 | 'value' => TokenizerUtils::flattenString( [ $optSp, $tpv['tokens'] ?? [] ] ), |
1559 | ]; |
1560 | |
1561 | } |
1562 | private function a138($name, $val) { |
1563 | |
1564 | if ( $val !== null ) { |
1565 | if ( $val['value'] !== null ) { |
1566 | $so = new KVSourceRange( |
1567 | $this->startOffset(), $val['kEndPos'], |
1568 | $val['vStartPos'], $this->endOffset() |
1569 | ); |
1570 | return new KV( |
1571 | $name, |
1572 | TokenizerUtils::flattenIfArray( $val['value'] ), |
1573 | $so |
1574 | ); |
1575 | } else { |
1576 | return new KV( |
1577 | TokenizerUtils::flattenIfArray( $name ), |
1578 | '', |
1579 | $so |
1580 | ); |
1581 | } |
1582 | } else { |
1583 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1584 | return new KV( |
1585 | '', |
1586 | TokenizerUtils::flattenIfArray( $name ), |
1587 | $so->expandTsrV() |
1588 | ); |
1589 | } |
1590 | |
1591 | } |
1592 | private function a139() { |
1593 | |
1594 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1595 | return new KV( '', '', $so->expandTsrV() ); |
1596 | |
1597 | } |
1598 | private function a140($t, $wr) { |
1599 | return $wr; |
1600 | } |
1601 | private function a141($r) { |
1602 | |
1603 | return TokenizerUtils::flattenStringlist( $r ); |
1604 | |
1605 | } |
1606 | private function a142($startPos, $lt) { |
1607 | |
1608 | $tsr = new SourceRange( $startPos, $this->endOffset() ); |
1609 | $maybeContent = new KV( 'mw:maybeContent', $lt ?? [], $tsr->expandTsrV() ); |
1610 | $maybeContent->vsrc = substr( $this->input, $startPos, $this->endOffset() - $startPos ); |
1611 | return $maybeContent; |
1612 | |
1613 | } |
1614 | private function a143($he) { |
1615 | return is_array( $he ) && $he[ 1 ] === "\u{A0}"; |
1616 | } |
1617 | private function a144() { |
1618 | return $this->startOffset(); |
1619 | } |
1620 | private function a145($lv0) { |
1621 | return $this->env->langConverterEnabled(); |
1622 | } |
1623 | private function a146($lv0, $ff) { |
1624 | |
1625 | // if flags contains 'R', then don't treat ; or : specially inside. |
1626 | if ( isset( $ff['flags'] ) ) { |
1627 | $ff['raw'] = isset( $ff['flags']['R'] ) || isset( $ff['flags']['N'] ); |
1628 | } elseif ( isset( $ff['variants'] ) ) { |
1629 | $ff['raw'] = true; |
1630 | } |
1631 | return $ff; |
1632 | |
1633 | } |
1634 | private function a147($lv0) { |
1635 | return !$this->env->langConverterEnabled(); |
1636 | } |
1637 | private function a148($lv0) { |
1638 | |
1639 | // if language converter not enabled, don't try to parse inside. |
1640 | return [ 'raw' => true ]; |
1641 | |
1642 | } |
1643 | private function a149($lv0, $f) { |
1644 | return $f['raw']; |
1645 | } |
1646 | private function a150($lv0, $f, $lv) { |
1647 | return [ [ 'text' => $lv ] ]; |
1648 | } |
1649 | private function a151($lv0, $f) { |
1650 | return !$f['raw']; |
1651 | } |
1652 | private function a152($lv0, $f, $lv) { |
1653 | return $lv; |
1654 | } |
1655 | private function a153($lv0, $f, $ts) { |
1656 | return $this->endOffset(); |
1657 | } |
1658 | private function a154($lv0, $f, $ts, $lv1) { |
1659 | |
1660 | if ( !$this->env->langConverterEnabled() ) { |
1661 | return [ '-{', $ts[0]['text']['tokens'], '}-' ]; |
1662 | } |
1663 | $lvsrc = substr( $this->input, $lv0, $lv1 - $lv0 ); |
1664 | $attribs = []; |
1665 | |
1666 | foreach ( $ts as &$t ) { |
1667 | // move token strings into KV attributes so that they are |
1668 | // properly expanded by early stages of the token pipeline |
1669 | foreach ( [ 'text', 'from', 'to' ] as $fld ) { |
1670 | if ( !isset( $t[$fld] ) ) { |
1671 | continue; |
1672 | } |
1673 | $name = 'mw:lv' . count( $attribs ); |
1674 | // Note that AttributeExpander will expect the tokens array to be |
1675 | // flattened. We do that in lang_variant_text / lang_variant_nowiki |
1676 | $attribs[] = new KV( $name, $t[$fld]['tokens'], $t[$fld]['srcOffsets']->expandTsrV() ); |
1677 | $t[$fld] = $name; |
1678 | } |
1679 | } |
1680 | unset( $t ); |
1681 | |
1682 | $flags = isset( $f['flags'] ) ? array_keys( $f['flags'] ) : []; |
1683 | sort( $flags ); |
1684 | $variants = isset( $f['variants'] ) ? array_keys( $f['variants'] ) : []; |
1685 | sort( $variants ); |
1686 | |
1687 | $dp = new DataParsoid; |
1688 | $dp->tsr = new SourceRange( $lv0, $lv1 ); |
1689 | $dp->src = $lvsrc; |
1690 | $dp->flags = $flags; |
1691 | $dp->variants = $variants; |
1692 | $dp->original = $f['original']; |
1693 | $dp->flagSp = $f['sp']; |
1694 | $dp->texts = $ts; |
1695 | |
1696 | return [ |
1697 | new SelfclosingTagTk( |
1698 | 'language-variant', |
1699 | $attribs, |
1700 | $dp |
1701 | ) |
1702 | ]; |
1703 | |
1704 | } |
1705 | private function a155($r, &$preproc) { |
1706 | |
1707 | $preproc = null; |
1708 | return $r; |
1709 | |
1710 | } |
1711 | private function a156($thTag, $pp, $tht) { |
1712 | |
1713 | // Avoid modifying a cached result |
1714 | $tht[0] = clone $tht[0]; |
1715 | $da = $tht[0]->dataParsoid = clone $tht[0]->dataParsoid; |
1716 | $da->tsr = clone $da->tsr; |
1717 | |
1718 | $da->stx = 'row'; |
1719 | $da->tsr->start -= strlen( $pp ); // include "!!" or "||" |
1720 | |
1721 | if ( $pp !== '!!' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
1722 | // Variation from default |
1723 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
1724 | } |
1725 | return $tht; |
1726 | |
1727 | } |
1728 | private function a157($thTag, $thTags) { |
1729 | |
1730 | $thTag[0] = clone $thTag[0]; |
1731 | $da = $thTag[0]->dataParsoid = clone $thTag[0]->dataParsoid; |
1732 | $da->tsr = clone $da->tsr; |
1733 | $da->tsr->start--; // include "!" |
1734 | array_unshift( $thTags, $thTag ); |
1735 | return $thTags; |
1736 | |
1737 | } |
1738 | private function a158($arg) { |
1739 | return $this->endOffset(); |
1740 | } |
1741 | private function a159($arg, $tagEndPos, $td) { |
1742 | |
1743 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1744 | return TokenizerUtils::buildTableTokens( 'td', '|', $arg, |
1745 | $tsr, $this->endOffset(), $td ); |
1746 | |
1747 | } |
1748 | private function a160($pp, $tdt) { |
1749 | |
1750 | // Avoid modifying cached dataParsoid object |
1751 | $tdt[0] = clone $tdt[0]; |
1752 | $da = $tdt[0]->dataParsoid = clone $tdt[0]->dataParsoid; |
1753 | $da->tsr = clone $da->tsr; |
1754 | |
1755 | $da->stx = 'row'; |
1756 | $da->tsr->start -= strlen( $pp ); // include "||" |
1757 | if ( $pp !== '||' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
1758 | // Variation from default |
1759 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
1760 | } |
1761 | return $tdt; |
1762 | |
1763 | } |
1764 | private function a161($b) { |
1765 | |
1766 | return $b; |
1767 | |
1768 | } |
1769 | private function a162($il) { |
1770 | |
1771 | // il is guaranteed to be an array -- so, tu.flattenIfArray will |
1772 | // always return an array |
1773 | $r = TokenizerUtils::flattenIfArray( $il ); |
1774 | if ( count( $r ) === 1 && is_string( $r[0] ) ) { |
1775 | $r = $r[0]; |
1776 | } |
1777 | return $r; |
1778 | |
1779 | } |
1780 | private function a163() { |
1781 | return ''; |
1782 | } |
1783 | private function a164($ff) { |
1784 | return $ff; |
1785 | } |
1786 | private function a165($f) { |
1787 | |
1788 | // Collect & separate flags and variants into a hashtable (by key) and ordered list |
1789 | $flags = []; |
1790 | $variants = []; |
1791 | $flagList = []; |
1792 | $flagSpace = []; |
1793 | $variantList = []; |
1794 | $variantSpace = []; |
1795 | $useVariants = false; |
1796 | if ( $f !== null ) { |
1797 | // lang_variant_flags returns arrays in reverse order. |
1798 | $spPtr = count( $f['sp'] ) - 1; |
1799 | for ( $i = count( $f['flags'] ) - 1; $i >= 0; $i--) { |
1800 | $item = $f['flags'][$i]; |
1801 | if ( isset( $item['flag'] ) ) { |
1802 | $flagSpace[] = $f['sp'][$spPtr--]; |
1803 | $flags[$item['flag']] = true; |
1804 | $flagList[] = $item['flag']; |
1805 | $flagSpace[] = $f['sp'][$spPtr--]; |
1806 | } |
1807 | if ( isset( $item['variant'] ) ) { |
1808 | $variantSpace[] = $f['sp'][$spPtr--]; |
1809 | $variants[$item['variant']] = true; |
1810 | $variantList[] = $item['variant']; |
1811 | $variantSpace[] = $f['sp'][$spPtr--]; |
1812 | } |
1813 | } |
1814 | if ( $spPtr >= 0 ) { |
1815 | // handle space after a trailing semicolon |
1816 | $flagSpace[] = $f['sp'][$spPtr]; |
1817 | $variantSpace[] = $f['sp'][$spPtr]; |
1818 | } |
1819 | } |
1820 | // Parse flags (this logic is from core/languages/ConverterRule.php |
1821 | // in the parseFlags() function) |
1822 | if ( count( $flags ) === 0 && count( $variants ) === 0 ) { |
1823 | $flags['$S'] = true; |
1824 | } elseif ( isset( $flags['R'] ) ) { |
1825 | $flags = [ 'R' => true ]; // remove other flags |
1826 | } elseif ( isset( $flags['N'] ) ) { |
1827 | $flags = [ 'N' => true ]; // remove other flags |
1828 | } elseif ( isset( $flags['-'] ) ) { |
1829 | $flags = [ '-' => true ]; // remove other flags |
1830 | } elseif ( isset( $flags['T'] ) && count( $flags ) === 1 ) { |
1831 | $flags['H'] = true; |
1832 | } elseif ( isset( $flags['H'] ) ) { |
1833 | // Replace A flag, and remove other flags except T and D |
1834 | $nf = [ '$+' => true, 'H' => true ]; |
1835 | if ( isset( $flags['T'] ) ) { $nf['T'] = true; } |
1836 | if ( isset( $flags['D'] ) ) { $nf['D'] = true; } |
1837 | $flags = $nf; |
1838 | } elseif ( count( $variants ) > 0 ) { |
1839 | $useVariants = true; |
1840 | } else { |
1841 | if ( isset( $flags['A'] ) ) { |
1842 | $flags['$+'] = true; |
1843 | $flags['$S'] = true; |
1844 | } |
1845 | if ( isset( $flags['D'] ) ) { |
1846 | unset( $flags['$S'] ); |
1847 | } |
1848 | } |
1849 | if ( $useVariants ) { |
1850 | return [ 'variants' => $variants, 'original' => $variantList, 'sp' => $variantSpace ]; |
1851 | } else { |
1852 | return [ 'flags' => $flags, 'original' => $flagList, 'sp' => $flagSpace ]; |
1853 | } |
1854 | |
1855 | } |
1856 | private function a166($tokens) { |
1857 | |
1858 | return [ |
1859 | 'tokens' => TokenizerUtils::flattenStringlist( $tokens ), |
1860 | 'srcOffsets' => $this->tsrOffsets(), |
1861 | ]; |
1862 | |
1863 | } |
1864 | private function a167($o, $oo) { |
1865 | return $oo; |
1866 | } |
1867 | private function a168($o, $rest, $tr) { |
1868 | |
1869 | array_unshift( $rest, $o ); |
1870 | // if the last bogus option is just spaces, keep them; otherwise |
1871 | // drop all this bogus stuff on the ground |
1872 | if ( count($tr) > 0 ) { |
1873 | $last = $tr[count($tr)-1]; |
1874 | if (preg_match('/^\s*$/Du', $last[1])) { |
1875 | $rest[] = [ 'semi' => true, 'sp' => $last[1] ]; |
1876 | } |
1877 | } |
1878 | return $rest; |
1879 | |
1880 | } |
1881 | private function a169($lvtext) { |
1882 | return [ [ 'text' => $lvtext ] ]; |
1883 | } |
1884 | private function a170($arg, $tagEndPos, &$th, $d) { |
1885 | |
1886 | if ( $th !== false && strpos( $this->text(), "\n" ) !== false ) { |
1887 | // There's been a newline. Remove the break and continue |
1888 | // tokenizing nested_block_in_tables. |
1889 | $th = false; |
1890 | } |
1891 | return $d; |
1892 | |
1893 | } |
1894 | private function a171($arg, $tagEndPos, $c) { |
1895 | |
1896 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1897 | return TokenizerUtils::buildTableTokens( 'th', '!', $arg, |
1898 | $tsr, $this->endOffset(), $c ); |
1899 | |
1900 | } |
1901 | private function a172($sp1, $f, $sp2, $more) { |
1902 | |
1903 | $r = ( $more && $more[1] ) ? $more[1] : [ 'sp' => [], 'flags' => [] ]; |
1904 | // Note that sp and flags are in reverse order, since we're using |
1905 | // right recursion and want to push instead of unshift. |
1906 | $r['sp'][] = $sp2; |
1907 | $r['sp'][] = $sp1; |
1908 | $r['flags'][] = $f; |
1909 | return $r; |
1910 | |
1911 | } |
1912 | private function a173($sp) { |
1913 | |
1914 | return [ 'sp' => [ $sp ], 'flags' => [] ]; |
1915 | |
1916 | } |
1917 | private function a174($sp1, $lang, $sp2, $sp3, $lvtext) { |
1918 | |
1919 | return [ |
1920 | 'twoway' => true, |
1921 | 'lang' => $lang, |
1922 | 'text' => $lvtext, |
1923 | 'sp' => [ $sp1, $sp2, $sp3 ] |
1924 | ]; |
1925 | |
1926 | } |
1927 | private function a175($sp1, $from, $sp2, $lang, $sp3, $sp4, $to) { |
1928 | |
1929 | return [ |
1930 | 'oneway' => true, |
1931 | 'from' => $from, |
1932 | 'lang' => $lang, |
1933 | 'to' => $to, |
1934 | 'sp' => [ $sp1, $sp2, $sp3, $sp4 ] |
1935 | ]; |
1936 | |
1937 | } |
1938 | private function a176($r) { |
1939 | |
1940 | return $r; |
1941 | |
1942 | } |
1943 | private function a177($f) { |
1944 | return [ 'flag' => $f ]; |
1945 | } |
1946 | private function a178($v) { |
1947 | return [ 'variant' => $v ]; |
1948 | } |
1949 | private function a179($b) { |
1950 | return [ 'bogus' => $b ]; /* bad flag */ |
1951 | } |
1952 | private function a180($n, $sp) { |
1953 | |
1954 | $tsr = $this->tsrOffsets(); |
1955 | $tsr->end -= strlen( $sp ); |
1956 | return [ |
1957 | 'tokens' => [ $n ], |
1958 | 'srcOffsets' => $tsr, |
1959 | ]; |
1960 | |
1961 | } |
1962 | private function a181($extToken) { |
1963 | return $extToken; |
1964 | } |
1965 | private function a182($extToken) { |
1966 | |
1967 | $txt = Utils::extractExtBody( $extToken ); |
1968 | return Utils::decodeWtEntities( $txt ); |
1969 | |
1970 | } |
1971 | |
1972 | // generated |
1973 | private function streamstart_async($silence, &$param_preproc) { |
1974 | for (;;) { |
1975 | // start choice_1 |
1976 | $p2 = $this->currPos; |
1977 | // start seq_1 |
1978 | $p3 = $this->currPos; |
1979 | $this->savedPos = $this->currPos; |
1980 | $r4 = $this->a0(); |
1981 | if ($r4) { |
1982 | $r4 = false; |
1983 | } else { |
1984 | $r4 = self::$FAILED; |
1985 | $r1 = self::$FAILED; |
1986 | goto seq_1; |
1987 | } |
1988 | $r5 = $this->parsetlb($silence, $param_preproc); |
1989 | // t <- $r5 |
1990 | if ($r5===self::$FAILED) { |
1991 | $this->currPos = $p3; |
1992 | $r1 = self::$FAILED; |
1993 | goto seq_1; |
1994 | } |
1995 | $this->savedPos = $this->currPos; |
1996 | $r6 = $this->a1($r5); |
1997 | if ($r6) { |
1998 | $r6 = false; |
1999 | } else { |
2000 | $r6 = self::$FAILED; |
2001 | $this->currPos = $p3; |
2002 | $r1 = self::$FAILED; |
2003 | goto seq_1; |
2004 | } |
2005 | $r1 = true; |
2006 | seq_1: |
2007 | if ($r1!==self::$FAILED) { |
2008 | $this->savedPos = $p2; |
2009 | $r1 = $this->a2($r5); |
2010 | goto choice_1; |
2011 | } |
2012 | // free $p3 |
2013 | // start seq_2 |
2014 | $p3 = $this->currPos; |
2015 | $r7 = []; |
2016 | for (;;) { |
2017 | $r8 = $this->parsenewlineToken($silence); |
2018 | if ($r8!==self::$FAILED) { |
2019 | $r7[] = $r8; |
2020 | } else { |
2021 | break; |
2022 | } |
2023 | } |
2024 | // free $r8 |
2025 | $this->savedPos = $this->currPos; |
2026 | $r8 = $this->a3(); |
2027 | if ($r8) { |
2028 | $r8 = false; |
2029 | } else { |
2030 | $r8 = self::$FAILED; |
2031 | $this->currPos = $p3; |
2032 | $r1 = self::$FAILED; |
2033 | goto seq_2; |
2034 | } |
2035 | $r1 = [$r7,$r8]; |
2036 | seq_2: |
2037 | // free $p3 |
2038 | choice_1: |
2039 | if ($r1!==self::$FAILED) { |
2040 | yield $r1; |
2041 | } else { |
2042 | if ($this->currPos < $this->inputLength) { |
2043 | $this->fail(0); |
2044 | throw $this->buildParseException(); |
2045 | } |
2046 | break; |
2047 | } |
2048 | } |
2049 | } |
2050 | private function parsestart($silence, &$param_preproc) { |
2051 | $key = json_encode([274, $param_preproc]); |
2052 | $bucket = $this->currPos; |
2053 | $cached = $this->cache[$bucket][$key] ?? null; |
2054 | if ($cached) { |
2055 | $this->currPos = $cached->nextPos; |
2056 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2057 | return $cached->result; |
2058 | } |
2059 | $saved_preproc=$param_preproc; |
2060 | $p2 = $this->currPos; |
2061 | // start seq_1 |
2062 | $p3 = $this->currPos; |
2063 | $r4 = []; |
2064 | for (;;) { |
2065 | $r5 = $this->parsetlb(true, $param_preproc); |
2066 | if ($r5!==self::$FAILED) { |
2067 | $r4[] = $r5; |
2068 | } else { |
2069 | break; |
2070 | } |
2071 | } |
2072 | // t <- $r4 |
2073 | // free $r5 |
2074 | $r5 = []; |
2075 | for (;;) { |
2076 | $r6 = $this->parsenewlineToken(true); |
2077 | if ($r6!==self::$FAILED) { |
2078 | $r5[] = $r6; |
2079 | } else { |
2080 | break; |
2081 | } |
2082 | } |
2083 | // n <- $r5 |
2084 | // free $r6 |
2085 | $r1 = true; |
2086 | seq_1: |
2087 | if ($r1!==self::$FAILED) { |
2088 | $this->savedPos = $p2; |
2089 | $r1 = $this->a4($r4, $r5); |
2090 | } else { |
2091 | if (!$silence) {$this->fail(1);} |
2092 | } |
2093 | // free $p3 |
2094 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2095 | $this->currPos, |
2096 | $r1, |
2097 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2098 | self::$UNDEFINED |
2099 | ); |
2100 | return $r1; |
2101 | } |
2102 | private function parsetable_start_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
2103 | $key = json_encode([454, $boolParams & 0x3fbf, $param_preproc, $param_th]); |
2104 | $bucket = $this->currPos; |
2105 | $cached = $this->cache[$bucket][$key] ?? null; |
2106 | if ($cached) { |
2107 | $this->currPos = $cached->nextPos; |
2108 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2109 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2110 | return $cached->result; |
2111 | } |
2112 | $saved_preproc=$param_preproc; |
2113 | $saved_th=$param_th; |
2114 | $p2 = $this->currPos; |
2115 | // start seq_1 |
2116 | $p3 = $this->currPos; |
2117 | $r4 = []; |
2118 | for (;;) { |
2119 | // start choice_1 |
2120 | $r5 = $this->parsespace(true); |
2121 | if ($r5!==self::$FAILED) { |
2122 | goto choice_1; |
2123 | } |
2124 | $r5 = $this->parsecomment(true); |
2125 | choice_1: |
2126 | if ($r5!==self::$FAILED) { |
2127 | $r4[] = $r5; |
2128 | } else { |
2129 | break; |
2130 | } |
2131 | } |
2132 | // sc <- $r4 |
2133 | // free $r5 |
2134 | $p6 = $this->currPos; |
2135 | $r5 = ''; |
2136 | // startPos <- $r5 |
2137 | if ($r5!==self::$FAILED) { |
2138 | $this->savedPos = $p6; |
2139 | $r5 = $this->a5($r4); |
2140 | } else { |
2141 | $this->currPos = $p3; |
2142 | $r1 = self::$FAILED; |
2143 | goto seq_1; |
2144 | } |
2145 | // b <- $r7 |
2146 | if (($this->input[$this->currPos] ?? null) === "{") { |
2147 | $this->currPos++; |
2148 | $r7 = "{"; |
2149 | } else { |
2150 | $r7 = self::$FAILED; |
2151 | $this->currPos = $p3; |
2152 | $r1 = self::$FAILED; |
2153 | goto seq_1; |
2154 | } |
2155 | $r8 = $this->parsepipe(true); |
2156 | // p <- $r8 |
2157 | if ($r8===self::$FAILED) { |
2158 | $this->currPos = $p3; |
2159 | $r1 = self::$FAILED; |
2160 | goto seq_1; |
2161 | } |
2162 | // start choice_2 |
2163 | $r9 = $this->parsetable_attributes(true, $boolParams & ~0x40, $param_preproc, $param_th); |
2164 | if ($r9!==self::$FAILED) { |
2165 | goto choice_2; |
2166 | } |
2167 | $this->savedPos = $this->currPos; |
2168 | $r9 = $this->a6($r4, $r5, $r7, $r8); |
2169 | if ($r9) { |
2170 | $r9 = false; |
2171 | } else { |
2172 | $r9 = self::$FAILED; |
2173 | } |
2174 | choice_2: |
2175 | // ta <- $r9 |
2176 | if ($r9===self::$FAILED) { |
2177 | $this->currPos = $p3; |
2178 | $r1 = self::$FAILED; |
2179 | goto seq_1; |
2180 | } |
2181 | $p11 = $this->currPos; |
2182 | $r10 = ''; |
2183 | // tsEndPos <- $r10 |
2184 | if ($r10!==self::$FAILED) { |
2185 | $this->savedPos = $p11; |
2186 | $r10 = $this->a7($r4, $r5, $r7, $r8, $r9); |
2187 | } else { |
2188 | $this->currPos = $p3; |
2189 | $r1 = self::$FAILED; |
2190 | goto seq_1; |
2191 | } |
2192 | $r12 = []; |
2193 | for (;;) { |
2194 | $r13 = $this->parsespace(true); |
2195 | if ($r13!==self::$FAILED) { |
2196 | $r12[] = $r13; |
2197 | } else { |
2198 | break; |
2199 | } |
2200 | } |
2201 | // s2 <- $r12 |
2202 | // free $r13 |
2203 | $r1 = true; |
2204 | seq_1: |
2205 | if ($r1!==self::$FAILED) { |
2206 | $this->savedPos = $p2; |
2207 | $r1 = $this->a8($r4, $r5, $r7, $r8, $r9, $r10, $r12); |
2208 | } else { |
2209 | if (!$silence) {$this->fail(2);} |
2210 | } |
2211 | // free $p3 |
2212 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2213 | $this->currPos, |
2214 | $r1, |
2215 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2216 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2217 | ); |
2218 | return $r1; |
2219 | } |
2220 | private function parseurl($silence, &$param_preproc) { |
2221 | $key = json_encode([328, $param_preproc]); |
2222 | $bucket = $this->currPos; |
2223 | $cached = $this->cache[$bucket][$key] ?? null; |
2224 | if ($cached) { |
2225 | $this->currPos = $cached->nextPos; |
2226 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2227 | return $cached->result; |
2228 | } |
2229 | $saved_preproc=$param_preproc; |
2230 | $p2 = $this->currPos; |
2231 | // start seq_1 |
2232 | $p3 = $this->currPos; |
2233 | $r4 = $this->parseurl_protocol($silence); |
2234 | // proto <- $r4 |
2235 | if ($r4===self::$FAILED) { |
2236 | $r1 = self::$FAILED; |
2237 | goto seq_1; |
2238 | } |
2239 | // start choice_1 |
2240 | $r5 = $this->parseipv6urladdr($silence); |
2241 | if ($r5!==self::$FAILED) { |
2242 | goto choice_1; |
2243 | } |
2244 | $r5 = ''; |
2245 | choice_1: |
2246 | // addr <- $r5 |
2247 | if ($r5===self::$FAILED) { |
2248 | $this->currPos = $p3; |
2249 | $r1 = self::$FAILED; |
2250 | goto seq_1; |
2251 | } |
2252 | $r6 = []; |
2253 | for (;;) { |
2254 | $p8 = $this->currPos; |
2255 | // start seq_2 |
2256 | $p9 = $this->currPos; |
2257 | $p10 = $this->currPos; |
2258 | $r11 = $this->discardinline_breaks(true, 0x0, $param_preproc, self::newRef(null)); |
2259 | if ($r11 === self::$FAILED) { |
2260 | $r11 = false; |
2261 | } else { |
2262 | $r11 = self::$FAILED; |
2263 | $this->currPos = $p10; |
2264 | $r7 = self::$FAILED; |
2265 | goto seq_2; |
2266 | } |
2267 | // free $p10 |
2268 | // start choice_2 |
2269 | $r12 = $this->parseno_punctuation_char($silence); |
2270 | if ($r12!==self::$FAILED) { |
2271 | goto choice_2; |
2272 | } |
2273 | $r12 = $this->parsecomment($silence); |
2274 | if ($r12!==self::$FAILED) { |
2275 | goto choice_2; |
2276 | } |
2277 | $r12 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2278 | if ($r12!==self::$FAILED) { |
2279 | goto choice_2; |
2280 | } |
2281 | $r12 = $this->input[$this->currPos] ?? ''; |
2282 | if ($r12 === "'" || $r12 === "{") { |
2283 | $this->currPos++; |
2284 | goto choice_2; |
2285 | } else { |
2286 | $r12 = self::$FAILED; |
2287 | if (!$silence) {$this->fail(3);} |
2288 | } |
2289 | $p10 = $this->currPos; |
2290 | // start seq_3 |
2291 | $p13 = $this->currPos; |
2292 | $p14 = $this->currPos; |
2293 | // start seq_4 |
2294 | $p16 = $this->currPos; |
2295 | if (($this->input[$this->currPos] ?? null) === "&") { |
2296 | $this->currPos++; |
2297 | $r17 = "&"; |
2298 | } else { |
2299 | $r17 = self::$FAILED; |
2300 | $r15 = self::$FAILED; |
2301 | goto seq_4; |
2302 | } |
2303 | // start choice_3 |
2304 | // start seq_5 |
2305 | $p19 = $this->currPos; |
2306 | $r20 = $this->input[$this->currPos] ?? ''; |
2307 | if ($r20 === "l" || $r20 === "L") { |
2308 | $this->currPos++; |
2309 | } else { |
2310 | $r20 = self::$FAILED; |
2311 | $r18 = self::$FAILED; |
2312 | goto seq_5; |
2313 | } |
2314 | $r21 = $this->input[$this->currPos] ?? ''; |
2315 | if ($r21 === "t" || $r21 === "T") { |
2316 | $this->currPos++; |
2317 | } else { |
2318 | $r21 = self::$FAILED; |
2319 | $this->currPos = $p19; |
2320 | $r18 = self::$FAILED; |
2321 | goto seq_5; |
2322 | } |
2323 | $r18 = true; |
2324 | seq_5: |
2325 | if ($r18!==self::$FAILED) { |
2326 | goto choice_3; |
2327 | } |
2328 | // free $p19 |
2329 | // start seq_6 |
2330 | $p19 = $this->currPos; |
2331 | $r22 = $this->input[$this->currPos] ?? ''; |
2332 | if ($r22 === "g" || $r22 === "G") { |
2333 | $this->currPos++; |
2334 | } else { |
2335 | $r22 = self::$FAILED; |
2336 | $r18 = self::$FAILED; |
2337 | goto seq_6; |
2338 | } |
2339 | $r23 = $this->input[$this->currPos] ?? ''; |
2340 | if ($r23 === "t" || $r23 === "T") { |
2341 | $this->currPos++; |
2342 | } else { |
2343 | $r23 = self::$FAILED; |
2344 | $this->currPos = $p19; |
2345 | $r18 = self::$FAILED; |
2346 | goto seq_6; |
2347 | } |
2348 | $r18 = true; |
2349 | seq_6: |
2350 | // free $p19 |
2351 | choice_3: |
2352 | if ($r18===self::$FAILED) { |
2353 | $this->currPos = $p16; |
2354 | $r15 = self::$FAILED; |
2355 | goto seq_4; |
2356 | } |
2357 | if (($this->input[$this->currPos] ?? null) === ";") { |
2358 | $this->currPos++; |
2359 | $r24 = ";"; |
2360 | } else { |
2361 | $r24 = self::$FAILED; |
2362 | $this->currPos = $p16; |
2363 | $r15 = self::$FAILED; |
2364 | goto seq_4; |
2365 | } |
2366 | $r15 = true; |
2367 | seq_4: |
2368 | // free $p16 |
2369 | if ($r15 === self::$FAILED) { |
2370 | $r15 = false; |
2371 | } else { |
2372 | $r15 = self::$FAILED; |
2373 | $this->currPos = $p14; |
2374 | $r12 = self::$FAILED; |
2375 | goto seq_3; |
2376 | } |
2377 | // free $p14 |
2378 | // start choice_4 |
2379 | $p14 = $this->currPos; |
2380 | // start seq_7 |
2381 | $p16 = $this->currPos; |
2382 | $p19 = $this->currPos; |
2383 | if (($this->input[$this->currPos] ?? null) === "&") { |
2384 | $this->currPos++; |
2385 | $r26 = "&"; |
2386 | $r26 = false; |
2387 | $this->currPos = $p19; |
2388 | } else { |
2389 | $r26 = self::$FAILED; |
2390 | $r25 = self::$FAILED; |
2391 | goto seq_7; |
2392 | } |
2393 | // free $p19 |
2394 | $r27 = $this->parsehtmlentity($silence); |
2395 | // he <- $r27 |
2396 | if ($r27===self::$FAILED) { |
2397 | $this->currPos = $p16; |
2398 | $r25 = self::$FAILED; |
2399 | goto seq_7; |
2400 | } |
2401 | $r25 = true; |
2402 | seq_7: |
2403 | if ($r25!==self::$FAILED) { |
2404 | $this->savedPos = $p14; |
2405 | $r25 = $this->a9($r4, $r5, $r27); |
2406 | goto choice_4; |
2407 | } |
2408 | // free $p16 |
2409 | if (($this->input[$this->currPos] ?? null) === "&") { |
2410 | $this->currPos++; |
2411 | $r25 = "&"; |
2412 | } else { |
2413 | if (!$silence) {$this->fail(4);} |
2414 | $r25 = self::$FAILED; |
2415 | } |
2416 | choice_4: |
2417 | // r <- $r25 |
2418 | if ($r25===self::$FAILED) { |
2419 | $this->currPos = $p13; |
2420 | $r12 = self::$FAILED; |
2421 | goto seq_3; |
2422 | } |
2423 | $r12 = true; |
2424 | seq_3: |
2425 | if ($r12!==self::$FAILED) { |
2426 | $this->savedPos = $p10; |
2427 | $r12 = $this->a10($r4, $r5, $r25); |
2428 | } |
2429 | // free $p13 |
2430 | choice_2: |
2431 | // c <- $r12 |
2432 | if ($r12===self::$FAILED) { |
2433 | $this->currPos = $p9; |
2434 | $r7 = self::$FAILED; |
2435 | goto seq_2; |
2436 | } |
2437 | $r7 = true; |
2438 | seq_2: |
2439 | if ($r7!==self::$FAILED) { |
2440 | $this->savedPos = $p8; |
2441 | $r7 = $this->a11($r4, $r5, $r12); |
2442 | $r6[] = $r7; |
2443 | } else { |
2444 | break; |
2445 | } |
2446 | // free $p9 |
2447 | } |
2448 | // path <- $r6 |
2449 | // free $r7 |
2450 | $this->savedPos = $this->currPos; |
2451 | $r7 = $this->a12($r4, $r5, $r6); |
2452 | if ($r7) { |
2453 | $r7 = false; |
2454 | } else { |
2455 | $r7 = self::$FAILED; |
2456 | $this->currPos = $p3; |
2457 | $r1 = self::$FAILED; |
2458 | goto seq_1; |
2459 | } |
2460 | $r1 = true; |
2461 | seq_1: |
2462 | if ($r1!==self::$FAILED) { |
2463 | $this->savedPos = $p2; |
2464 | $r1 = $this->a13($r4, $r5, $r6); |
2465 | } |
2466 | // free $p3 |
2467 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2468 | $this->currPos, |
2469 | $r1, |
2470 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2471 | self::$UNDEFINED |
2472 | ); |
2473 | return $r1; |
2474 | } |
2475 | private function parserow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) { |
2476 | $key = json_encode([474, $boolParams & 0x3eff, $param_preproc, $param_th]); |
2477 | $bucket = $this->currPos; |
2478 | $cached = $this->cache[$bucket][$key] ?? null; |
2479 | if ($cached) { |
2480 | $this->currPos = $cached->nextPos; |
2481 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2482 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2483 | return $cached->result; |
2484 | } |
2485 | $saved_preproc=$param_preproc; |
2486 | $saved_th=$param_th; |
2487 | $p2 = $this->currPos; |
2488 | // start seq_1 |
2489 | $p3 = $this->currPos; |
2490 | $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th); |
2491 | // as <- $r4 |
2492 | if ($r4===self::$FAILED) { |
2493 | $r1 = self::$FAILED; |
2494 | goto seq_1; |
2495 | } |
2496 | $r5 = $this->parseoptional_spaces($silence); |
2497 | // s <- $r5 |
2498 | if ($r5===self::$FAILED) { |
2499 | $this->currPos = $p3; |
2500 | $r1 = self::$FAILED; |
2501 | goto seq_1; |
2502 | } |
2503 | $r6 = $this->parsepipe($silence); |
2504 | // p <- $r6 |
2505 | if ($r6===self::$FAILED) { |
2506 | $this->currPos = $p3; |
2507 | $r1 = self::$FAILED; |
2508 | goto seq_1; |
2509 | } |
2510 | $p7 = $this->currPos; |
2511 | $r8 = $this->discardpipe(true); |
2512 | if ($r8 === self::$FAILED) { |
2513 | $r8 = false; |
2514 | } else { |
2515 | $r8 = self::$FAILED; |
2516 | $this->currPos = $p7; |
2517 | $this->currPos = $p3; |
2518 | $r1 = self::$FAILED; |
2519 | goto seq_1; |
2520 | } |
2521 | // free $p7 |
2522 | $r1 = true; |
2523 | seq_1: |
2524 | if ($r1!==self::$FAILED) { |
2525 | $this->savedPos = $p2; |
2526 | $r1 = $this->a14($r4, $r5, $r6); |
2527 | } |
2528 | // free $p3 |
2529 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2530 | $this->currPos, |
2531 | $r1, |
2532 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2533 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2534 | ); |
2535 | return $r1; |
2536 | } |
2537 | private function parsetable_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2538 | $key = json_encode([278, $boolParams & 0x3fff, $param_preproc, $param_th]); |
2539 | $bucket = $this->currPos; |
2540 | $cached = $this->cache[$bucket][$key] ?? null; |
2541 | if ($cached) { |
2542 | $this->currPos = $cached->nextPos; |
2543 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2544 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2545 | return $cached->result; |
2546 | } |
2547 | $saved_preproc=$param_preproc; |
2548 | $saved_th=$param_th; |
2549 | $r1 = []; |
2550 | for (;;) { |
2551 | // start choice_1 |
2552 | $r2 = $this->parsetable_attribute(true, $boolParams, $param_preproc, $param_th); |
2553 | if ($r2!==self::$FAILED) { |
2554 | goto choice_1; |
2555 | } |
2556 | $p3 = $this->currPos; |
2557 | // start seq_1 |
2558 | $p4 = $this->currPos; |
2559 | $r5 = $this->discardoptionalSpaceToken(true); |
2560 | if ($r5===self::$FAILED) { |
2561 | $r2 = self::$FAILED; |
2562 | goto seq_1; |
2563 | } |
2564 | $r6 = $this->parsebroken_table_attribute_name_char(true); |
2565 | // b <- $r6 |
2566 | if ($r6===self::$FAILED) { |
2567 | $this->currPos = $p4; |
2568 | $r2 = self::$FAILED; |
2569 | goto seq_1; |
2570 | } |
2571 | $r2 = true; |
2572 | seq_1: |
2573 | if ($r2!==self::$FAILED) { |
2574 | $this->savedPos = $p3; |
2575 | $r2 = $this->a15($r6); |
2576 | } |
2577 | // free $p4 |
2578 | choice_1: |
2579 | if ($r2!==self::$FAILED) { |
2580 | $r1[] = $r2; |
2581 | } else { |
2582 | break; |
2583 | } |
2584 | } |
2585 | // free $r2 |
2586 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2587 | $this->currPos, |
2588 | $r1, |
2589 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2590 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2591 | ); |
2592 | return $r1; |
2593 | } |
2594 | private function parsegeneric_newline_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2595 | $key = json_encode([276, $boolParams & 0x3fff, $param_preproc, $param_th]); |
2596 | $bucket = $this->currPos; |
2597 | $cached = $this->cache[$bucket][$key] ?? null; |
2598 | if ($cached) { |
2599 | $this->currPos = $cached->nextPos; |
2600 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2601 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2602 | return $cached->result; |
2603 | } |
2604 | $saved_preproc=$param_preproc; |
2605 | $saved_th=$param_th; |
2606 | $r1 = []; |
2607 | for (;;) { |
2608 | $r2 = $this->parsegeneric_newline_attribute(true, $boolParams, $param_preproc, $param_th); |
2609 | if ($r2!==self::$FAILED) { |
2610 | $r1[] = $r2; |
2611 | } else { |
2612 | break; |
2613 | } |
2614 | } |
2615 | // free $r2 |
2616 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2617 | $this->currPos, |
2618 | $r1, |
2619 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2620 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2621 | ); |
2622 | return $r1; |
2623 | } |
2624 | private function parsetplarg_or_template_or_bust($silence, &$param_preproc) { |
2625 | $key = json_encode([338, $param_preproc]); |
2626 | $bucket = $this->currPos; |
2627 | $cached = $this->cache[$bucket][$key] ?? null; |
2628 | if ($cached) { |
2629 | $this->currPos = $cached->nextPos; |
2630 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2631 | return $cached->result; |
2632 | } |
2633 | $saved_preproc=$param_preproc; |
2634 | $p2 = $this->currPos; |
2635 | $r3 = []; |
2636 | for (;;) { |
2637 | // start choice_1 |
2638 | $r4 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2639 | if ($r4!==self::$FAILED) { |
2640 | goto choice_1; |
2641 | } |
2642 | if ($this->currPos < $this->inputLength) { |
2643 | $r4 = self::consumeChar($this->input, $this->currPos);; |
2644 | } else { |
2645 | $r4 = self::$FAILED; |
2646 | if (!$silence) {$this->fail(7);} |
2647 | } |
2648 | choice_1: |
2649 | if ($r4!==self::$FAILED) { |
2650 | $r3[] = $r4; |
2651 | } else { |
2652 | break; |
2653 | } |
2654 | } |
2655 | if (count($r3) === 0) { |
2656 | $r3 = self::$FAILED; |
2657 | } |
2658 | // r <- $r3 |
2659 | // free $r4 |
2660 | $r1 = $r3; |
2661 | if ($r1!==self::$FAILED) { |
2662 | $this->savedPos = $p2; |
2663 | $r1 = $this->a16($r3); |
2664 | } |
2665 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2666 | $this->currPos, |
2667 | $r1, |
2668 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2669 | self::$UNDEFINED |
2670 | ); |
2671 | return $r1; |
2672 | } |
2673 | private function parseextlink($silence, $boolParams, &$param_preproc, &$param_th) { |
2674 | $key = json_encode([318, $boolParams & 0x3fff, $param_preproc, $param_th]); |
2675 | $bucket = $this->currPos; |
2676 | $cached = $this->cache[$bucket][$key] ?? null; |
2677 | if ($cached) { |
2678 | $this->currPos = $cached->nextPos; |
2679 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2680 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2681 | return $cached->result; |
2682 | } |
2683 | $saved_preproc=$param_preproc; |
2684 | $saved_th=$param_th; |
2685 | $p2 = $this->currPos; |
2686 | // start seq_1 |
2687 | $p3 = $this->currPos; |
2688 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
2689 | $r4 = false; |
2690 | } else { |
2691 | $r4 = self::$FAILED; |
2692 | $r1 = self::$FAILED; |
2693 | goto seq_1; |
2694 | } |
2695 | $p6 = $this->currPos; |
2696 | // start seq_2 |
2697 | $p7 = $this->currPos; |
2698 | if (($this->input[$this->currPos] ?? null) === "[") { |
2699 | $this->currPos++; |
2700 | $r8 = "["; |
2701 | } else { |
2702 | $r8 = self::$FAILED; |
2703 | $r5 = self::$FAILED; |
2704 | goto seq_2; |
2705 | } |
2706 | $p10 = $this->currPos; |
2707 | $r9 = ''; |
2708 | // p0 <- $r9 |
2709 | if ($r9!==self::$FAILED) { |
2710 | $this->savedPos = $p10; |
2711 | $r9 = $this->a17(); |
2712 | } else { |
2713 | $this->currPos = $p7; |
2714 | $r5 = self::$FAILED; |
2715 | goto seq_2; |
2716 | } |
2717 | $p12 = $this->currPos; |
2718 | // start seq_3 |
2719 | $p13 = $this->currPos; |
2720 | // start choice_1 |
2721 | // start seq_4 |
2722 | $p15 = $this->currPos; |
2723 | $r16 = $this->parseurl_protocol(true); |
2724 | if ($r16===self::$FAILED) { |
2725 | $r14 = self::$FAILED; |
2726 | goto seq_4; |
2727 | } |
2728 | $r17 = $this->parseipv6urladdr(true); |
2729 | if ($r17===self::$FAILED) { |
2730 | $this->currPos = $p15; |
2731 | $r14 = self::$FAILED; |
2732 | goto seq_4; |
2733 | } |
2734 | $r14 = [$r16,$r17]; |
2735 | seq_4: |
2736 | if ($r14!==self::$FAILED) { |
2737 | goto choice_1; |
2738 | } |
2739 | // free $p15 |
2740 | $r14 = ''; |
2741 | choice_1: |
2742 | // addr <- $r14 |
2743 | if ($r14===self::$FAILED) { |
2744 | $r11 = self::$FAILED; |
2745 | goto seq_3; |
2746 | } |
2747 | // start choice_2 |
2748 | $r18 = $this->parseextlink_nonipv6url(true, $boolParams | 0x8, $param_preproc, $param_th); |
2749 | if ($r18!==self::$FAILED) { |
2750 | goto choice_2; |
2751 | } |
2752 | $r18 = ''; |
2753 | choice_2: |
2754 | // target <- $r18 |
2755 | if ($r18===self::$FAILED) { |
2756 | $this->currPos = $p13; |
2757 | $r11 = self::$FAILED; |
2758 | goto seq_3; |
2759 | } |
2760 | $r11 = true; |
2761 | seq_3: |
2762 | // flat <- $r11 |
2763 | if ($r11!==self::$FAILED) { |
2764 | $this->savedPos = $p12; |
2765 | $r11 = $this->a18($r9, $r14, $r18); |
2766 | } else { |
2767 | $this->currPos = $p7; |
2768 | $r5 = self::$FAILED; |
2769 | goto seq_2; |
2770 | } |
2771 | // free $p13 |
2772 | $this->savedPos = $this->currPos; |
2773 | $r19 = $this->a19($r9, $r11); |
2774 | if ($r19) { |
2775 | $r19 = false; |
2776 | } else { |
2777 | $r19 = self::$FAILED; |
2778 | $this->currPos = $p7; |
2779 | $r5 = self::$FAILED; |
2780 | goto seq_2; |
2781 | } |
2782 | $p13 = $this->currPos; |
2783 | $r20 = ''; |
2784 | // p1 <- $r20 |
2785 | if ($r20!==self::$FAILED) { |
2786 | $this->savedPos = $p13; |
2787 | $r20 = $this->a20($r9, $r11); |
2788 | } else { |
2789 | $this->currPos = $p7; |
2790 | $r5 = self::$FAILED; |
2791 | goto seq_2; |
2792 | } |
2793 | $p15 = $this->currPos; |
2794 | for (;;) { |
2795 | // start choice_3 |
2796 | $r22 = $this->discardspace(true); |
2797 | if ($r22!==self::$FAILED) { |
2798 | goto choice_3; |
2799 | } |
2800 | $r22 = $this->discardunispace(true); |
2801 | choice_3: |
2802 | if ($r22===self::$FAILED) { |
2803 | break; |
2804 | } |
2805 | } |
2806 | // free $r22 |
2807 | $r21 = true; |
2808 | // sp <- $r21 |
2809 | if ($r21!==self::$FAILED) { |
2810 | $r21 = substr($this->input, $p15, $this->currPos - $p15); |
2811 | } else { |
2812 | $r21 = self::$FAILED; |
2813 | $this->currPos = $p7; |
2814 | $r5 = self::$FAILED; |
2815 | goto seq_2; |
2816 | } |
2817 | // free $p15 |
2818 | $p15 = $this->currPos; |
2819 | $r22 = ''; |
2820 | // p2 <- $r22 |
2821 | if ($r22!==self::$FAILED) { |
2822 | $this->savedPos = $p15; |
2823 | $r22 = $this->a21($r9, $r11, $r20, $r21); |
2824 | } else { |
2825 | $this->currPos = $p7; |
2826 | $r5 = self::$FAILED; |
2827 | goto seq_2; |
2828 | } |
2829 | $r23 = $this->parseinlineline(true, $boolParams | 0x8, $param_preproc, $param_th); |
2830 | if ($r23===self::$FAILED) { |
2831 | $r23 = null; |
2832 | } |
2833 | // content <- $r23 |
2834 | $p25 = $this->currPos; |
2835 | $r24 = ''; |
2836 | // p3 <- $r24 |
2837 | if ($r24!==self::$FAILED) { |
2838 | $this->savedPos = $p25; |
2839 | $r24 = $this->a22($r9, $r11, $r20, $r21, $r22, $r23); |
2840 | } else { |
2841 | $this->currPos = $p7; |
2842 | $r5 = self::$FAILED; |
2843 | goto seq_2; |
2844 | } |
2845 | if (($this->input[$this->currPos] ?? null) === "]") { |
2846 | $this->currPos++; |
2847 | $r26 = "]"; |
2848 | } else { |
2849 | $r26 = self::$FAILED; |
2850 | $this->currPos = $p7; |
2851 | $r5 = self::$FAILED; |
2852 | goto seq_2; |
2853 | } |
2854 | $r5 = true; |
2855 | seq_2: |
2856 | // r <- $r5 |
2857 | if ($r5!==self::$FAILED) { |
2858 | $this->savedPos = $p6; |
2859 | $r5 = $this->a23($r9, $r11, $r20, $r21, $r22, $r23, $r24); |
2860 | } else { |
2861 | $this->currPos = $p3; |
2862 | $r1 = self::$FAILED; |
2863 | goto seq_1; |
2864 | } |
2865 | // free $p7 |
2866 | $r1 = true; |
2867 | seq_1: |
2868 | if ($r1!==self::$FAILED) { |
2869 | $this->savedPos = $p2; |
2870 | $r1 = $this->a24($r5); |
2871 | } else { |
2872 | if (!$silence) {$this->fail(8);} |
2873 | } |
2874 | // free $p3 |
2875 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2876 | $this->currPos, |
2877 | $r1, |
2878 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2879 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2880 | ); |
2881 | return $r1; |
2882 | } |
2883 | private function parselist_item($silence, $boolParams, &$param_preproc, &$param_th) { |
2884 | $key = json_encode([434, $boolParams & 0x3fff, $param_preproc, $param_th]); |
2885 | $bucket = $this->currPos; |
2886 | $cached = $this->cache[$bucket][$key] ?? null; |
2887 | if ($cached) { |
2888 | $this->currPos = $cached->nextPos; |
2889 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2890 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2891 | return $cached->result; |
2892 | } |
2893 | $saved_preproc=$param_preproc; |
2894 | $saved_th=$param_th; |
2895 | // start choice_1 |
2896 | $r1 = $this->parsedtdd($silence, $boolParams, $param_preproc, $param_th); |
2897 | if ($r1!==self::$FAILED) { |
2898 | goto choice_1; |
2899 | } |
2900 | $r1 = $this->parsehacky_dl_uses($silence, $boolParams, $param_preproc, $param_th); |
2901 | if ($r1!==self::$FAILED) { |
2902 | goto choice_1; |
2903 | } |
2904 | $r1 = $this->parseli($silence, $boolParams, $param_preproc, $param_th); |
2905 | choice_1: |
2906 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2907 | $this->currPos, |
2908 | $r1, |
2909 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2910 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2911 | ); |
2912 | return $r1; |
2913 | } |
2914 | private function parsetlb($silence, &$param_preproc) { |
2915 | $key = json_encode([282, $param_preproc]); |
2916 | $bucket = $this->currPos; |
2917 | $cached = $this->cache[$bucket][$key] ?? null; |
2918 | if ($cached) { |
2919 | $this->currPos = $cached->nextPos; |
2920 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2921 | return $cached->result; |
2922 | } |
2923 | $saved_preproc=$param_preproc; |
2924 | $p2 = $this->currPos; |
2925 | // start seq_1 |
2926 | $p3 = $this->currPos; |
2927 | $p4 = $this->currPos; |
2928 | $r5 = $this->discardeof(true); |
2929 | if ($r5 === self::$FAILED) { |
2930 | $r5 = false; |
2931 | } else { |
2932 | $r5 = self::$FAILED; |
2933 | $this->currPos = $p4; |
2934 | $r1 = self::$FAILED; |
2935 | goto seq_1; |
2936 | } |
2937 | // free $p4 |
2938 | $r6 = $this->parseblock(true, 0x0, self::newRef(null), $param_preproc); |
2939 | // b <- $r6 |
2940 | if ($r6===self::$FAILED) { |
2941 | $this->currPos = $p3; |
2942 | $r1 = self::$FAILED; |
2943 | goto seq_1; |
2944 | } |
2945 | $r1 = true; |
2946 | seq_1: |
2947 | if ($r1!==self::$FAILED) { |
2948 | $this->savedPos = $p2; |
2949 | $r1 = $this->a25($r6); |
2950 | } else { |
2951 | if (!$silence) {$this->fail(9);} |
2952 | } |
2953 | // free $p3 |
2954 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2955 | $this->currPos, |
2956 | $r1, |
2957 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2958 | self::$UNDEFINED |
2959 | ); |
2960 | return $r1; |
2961 | } |
2962 | private function parsenewlineToken($silence) { |
2963 | $key = 520; |
2964 | $bucket = $this->currPos; |
2965 | $cached = $this->cache[$bucket][$key] ?? null; |
2966 | if ($cached) { |
2967 | $this->currPos = $cached->nextPos; |
2968 | |
2969 | return $cached->result; |
2970 | } |
2971 | |
2972 | $p2 = $this->currPos; |
2973 | $r1 = $this->discardnewline($silence); |
2974 | if ($r1!==self::$FAILED) { |
2975 | $this->savedPos = $p2; |
2976 | $r1 = $this->a26(); |
2977 | } |
2978 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2979 | $this->currPos, |
2980 | $r1, |
2981 | self::$UNDEFINED, |
2982 | self::$UNDEFINED |
2983 | ); |
2984 | return $r1; |
2985 | } |
2986 | private function parsespace($silence) { |
2987 | $key = 510; |
2988 | $bucket = $this->currPos; |
2989 | $cached = $this->cache[$bucket][$key] ?? null; |
2990 | if ($cached) { |
2991 | $this->currPos = $cached->nextPos; |
2992 | |
2993 | return $cached->result; |
2994 | } |
2995 | |
2996 | $r1 = $this->input[$this->currPos] ?? ''; |
2997 | if ($r1 === " " || $r1 === "\x09") { |
2998 | $this->currPos++; |
2999 | } else { |
3000 | $r1 = self::$FAILED; |
3001 | if (!$silence) {$this->fail(10);} |
3002 | } |
3003 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3004 | $this->currPos, |
3005 | $r1, |
3006 | self::$UNDEFINED, |
3007 | self::$UNDEFINED |
3008 | ); |
3009 | return $r1; |
3010 | } |
3011 | private function parsecomment($silence) { |
3012 | $key = 524; |
3013 | $bucket = $this->currPos; |
3014 | $cached = $this->cache[$bucket][$key] ?? null; |
3015 | if ($cached) { |
3016 | $this->currPos = $cached->nextPos; |
3017 | |
3018 | return $cached->result; |
3019 | } |
3020 | |
3021 | $p2 = $this->currPos; |
3022 | // start seq_1 |
3023 | $p3 = $this->currPos; |
3024 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
3025 | $r4 = "<!--"; |
3026 | $this->currPos += 4; |
3027 | } else { |
3028 | if (!$silence) {$this->fail(11);} |
3029 | $r4 = self::$FAILED; |
3030 | $r1 = self::$FAILED; |
3031 | goto seq_1; |
3032 | } |
3033 | $p6 = $this->currPos; |
3034 | for (;;) { |
3035 | // start seq_2 |
3036 | $p8 = $this->currPos; |
3037 | $p9 = $this->currPos; |
3038 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3039 | $r10 = "-->"; |
3040 | $this->currPos += 3; |
3041 | } else { |
3042 | $r10 = self::$FAILED; |
3043 | } |
3044 | if ($r10 === self::$FAILED) { |
3045 | $r10 = false; |
3046 | } else { |
3047 | $r10 = self::$FAILED; |
3048 | $this->currPos = $p9; |
3049 | $r7 = self::$FAILED; |
3050 | goto seq_2; |
3051 | } |
3052 | // free $p9 |
3053 | if ($this->currPos < $this->inputLength) { |
3054 | $r11 = self::consumeChar($this->input, $this->currPos);; |
3055 | } else { |
3056 | $r11 = self::$FAILED; |
3057 | if (!$silence) {$this->fail(7);} |
3058 | $this->currPos = $p8; |
3059 | $r7 = self::$FAILED; |
3060 | goto seq_2; |
3061 | } |
3062 | $r7 = true; |
3063 | seq_2: |
3064 | if ($r7===self::$FAILED) { |
3065 | break; |
3066 | } |
3067 | // free $p8 |
3068 | } |
3069 | // free $r7 |
3070 | $r5 = true; |
3071 | // c <- $r5 |
3072 | if ($r5!==self::$FAILED) { |
3073 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
3074 | } else { |
3075 | $r5 = self::$FAILED; |
3076 | $this->currPos = $p3; |
3077 | $r1 = self::$FAILED; |
3078 | goto seq_1; |
3079 | } |
3080 | // free $p6 |
3081 | $p6 = $this->currPos; |
3082 | // start choice_1 |
3083 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3084 | $r7 = "-->"; |
3085 | $this->currPos += 3; |
3086 | goto choice_1; |
3087 | } else { |
3088 | if (!$silence) {$this->fail(12);} |
3089 | $r7 = self::$FAILED; |
3090 | } |
3091 | $r7 = $this->discardeof($silence); |
3092 | choice_1: |
3093 | // cEnd <- $r7 |
3094 | if ($r7!==self::$FAILED) { |
3095 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
3096 | } else { |
3097 | $r7 = self::$FAILED; |
3098 | $this->currPos = $p3; |
3099 | $r1 = self::$FAILED; |
3100 | goto seq_1; |
3101 | } |
3102 | // free $p6 |
3103 | $r1 = true; |
3104 | seq_1: |
3105 | if ($r1!==self::$FAILED) { |
3106 | $this->savedPos = $p2; |
3107 | $r1 = $this->a27($r5, $r7); |
3108 | } |
3109 | // free $p3 |
3110 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3111 | $this->currPos, |
3112 | $r1, |
3113 | self::$UNDEFINED, |
3114 | self::$UNDEFINED |
3115 | ); |
3116 | return $r1; |
3117 | } |
3118 | private function parsepipe($silence) { |
3119 | $key = 506; |
3120 | $bucket = $this->currPos; |
3121 | $cached = $this->cache[$bucket][$key] ?? null; |
3122 | if ($cached) { |
3123 | $this->currPos = $cached->nextPos; |
3124 | |
3125 | return $cached->result; |
3126 | } |
3127 | |
3128 | // start choice_1 |
3129 | if (($this->input[$this->currPos] ?? null) === "|") { |
3130 | $this->currPos++; |
3131 | $r1 = "|"; |
3132 | goto choice_1; |
3133 | } else { |
3134 | if (!$silence) {$this->fail(13);} |
3135 | $r1 = self::$FAILED; |
3136 | } |
3137 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3138 | $r1 = "{{!}}"; |
3139 | $this->currPos += 5; |
3140 | } else { |
3141 | if (!$silence) {$this->fail(14);} |
3142 | $r1 = self::$FAILED; |
3143 | } |
3144 | choice_1: |
3145 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3146 | $this->currPos, |
3147 | $r1, |
3148 | self::$UNDEFINED, |
3149 | self::$UNDEFINED |
3150 | ); |
3151 | return $r1; |
3152 | } |
3153 | private function parseurl_protocol($silence) { |
3154 | $key = 324; |
3155 | $bucket = $this->currPos; |
3156 | $cached = $this->cache[$bucket][$key] ?? null; |
3157 | if ($cached) { |
3158 | $this->currPos = $cached->nextPos; |
3159 | |
3160 | return $cached->result; |
3161 | } |
3162 | |
3163 | $p2 = $this->currPos; |
3164 | // start seq_1 |
3165 | $p3 = $this->currPos; |
3166 | $p5 = $this->currPos; |
3167 | // start choice_1 |
3168 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3169 | $r4 = "//"; |
3170 | $this->currPos += 2; |
3171 | goto choice_1; |
3172 | } else { |
3173 | if (!$silence) {$this->fail(15);} |
3174 | $r4 = self::$FAILED; |
3175 | } |
3176 | // start seq_2 |
3177 | $p6 = $this->currPos; |
3178 | $r7 = $this->input[$this->currPos] ?? ''; |
3179 | if (preg_match("/^[A-Za-z]/", $r7)) { |
3180 | $this->currPos++; |
3181 | } else { |
3182 | $r7 = self::$FAILED; |
3183 | if (!$silence) {$this->fail(16);} |
3184 | $r4 = self::$FAILED; |
3185 | goto seq_2; |
3186 | } |
3187 | for (;;) { |
3188 | $r9 = $this->input[$this->currPos] ?? ''; |
3189 | if (preg_match("/^[\\-A-Za-z0-9+.]/", $r9)) { |
3190 | $this->currPos++; |
3191 | } else { |
3192 | $r9 = self::$FAILED; |
3193 | if (!$silence) {$this->fail(17);} |
3194 | break; |
3195 | } |
3196 | } |
3197 | // free $r9 |
3198 | $r8 = true; |
3199 | if ($r8===self::$FAILED) { |
3200 | $this->currPos = $p6; |
3201 | $r4 = self::$FAILED; |
3202 | goto seq_2; |
3203 | } |
3204 | // free $r8 |
3205 | if (($this->input[$this->currPos] ?? null) === ":") { |
3206 | $this->currPos++; |
3207 | $r8 = ":"; |
3208 | } else { |
3209 | if (!$silence) {$this->fail(18);} |
3210 | $r8 = self::$FAILED; |
3211 | $this->currPos = $p6; |
3212 | $r4 = self::$FAILED; |
3213 | goto seq_2; |
3214 | } |
3215 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3216 | $r9 = "//"; |
3217 | $this->currPos += 2; |
3218 | } else { |
3219 | if (!$silence) {$this->fail(15);} |
3220 | $r9 = self::$FAILED; |
3221 | $r9 = null; |
3222 | } |
3223 | $r4 = true; |
3224 | seq_2: |
3225 | // free $p6 |
3226 | choice_1: |
3227 | // p <- $r4 |
3228 | if ($r4!==self::$FAILED) { |
3229 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
3230 | } else { |
3231 | $r4 = self::$FAILED; |
3232 | $r1 = self::$FAILED; |
3233 | goto seq_1; |
3234 | } |
3235 | // free $p5 |
3236 | $this->savedPos = $this->currPos; |
3237 | $r10 = $this->a28($r4); |
3238 | if ($r10) { |
3239 | $r10 = false; |
3240 | } else { |
3241 | $r10 = self::$FAILED; |
3242 | $this->currPos = $p3; |
3243 | $r1 = self::$FAILED; |
3244 | goto seq_1; |
3245 | } |
3246 | $r1 = true; |
3247 | seq_1: |
3248 | if ($r1!==self::$FAILED) { |
3249 | $this->savedPos = $p2; |
3250 | $r1 = $this->a29($r4); |
3251 | } |
3252 | // free $p3 |
3253 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3254 | $this->currPos, |
3255 | $r1, |
3256 | self::$UNDEFINED, |
3257 | self::$UNDEFINED |
3258 | ); |
3259 | return $r1; |
3260 | } |
3261 | private function parseipv6urladdr($silence) { |
3262 | $key = 332; |
3263 | $bucket = $this->currPos; |
3264 | $cached = $this->cache[$bucket][$key] ?? null; |
3265 | if ($cached) { |
3266 | $this->currPos = $cached->nextPos; |
3267 | |
3268 | return $cached->result; |
3269 | } |
3270 | |
3271 | $p1 = $this->currPos; |
3272 | // start seq_1 |
3273 | $p3 = $this->currPos; |
3274 | if (($this->input[$this->currPos] ?? null) === "[") { |
3275 | $this->currPos++; |
3276 | $r4 = "["; |
3277 | } else { |
3278 | if (!$silence) {$this->fail(19);} |
3279 | $r4 = self::$FAILED; |
3280 | $r2 = self::$FAILED; |
3281 | goto seq_1; |
3282 | } |
3283 | $r5 = self::$FAILED; |
3284 | for (;;) { |
3285 | $r6 = $this->input[$this->currPos] ?? ''; |
3286 | if (preg_match("/^[0-9A-Fa-f:.]/", $r6)) { |
3287 | $this->currPos++; |
3288 | $r5 = true; |
3289 | } else { |
3290 | $r6 = self::$FAILED; |
3291 | if (!$silence) {$this->fail(20);} |
3292 | break; |
3293 | } |
3294 | } |
3295 | if ($r5===self::$FAILED) { |
3296 | $this->currPos = $p3; |
3297 | $r2 = self::$FAILED; |
3298 | goto seq_1; |
3299 | } |
3300 | // free $r6 |
3301 | if (($this->input[$this->currPos] ?? null) === "]") { |
3302 | $this->currPos++; |
3303 | $r6 = "]"; |
3304 | } else { |
3305 | if (!$silence) {$this->fail(21);} |
3306 | $r6 = self::$FAILED; |
3307 | $this->currPos = $p3; |
3308 | $r2 = self::$FAILED; |
3309 | goto seq_1; |
3310 | } |
3311 | $r2 = true; |
3312 | seq_1: |
3313 | if ($r2!==self::$FAILED) { |
3314 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3315 | } else { |
3316 | $r2 = self::$FAILED; |
3317 | } |
3318 | // free $p3 |
3319 | // free $p1 |
3320 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3321 | $this->currPos, |
3322 | $r2, |
3323 | self::$UNDEFINED, |
3324 | self::$UNDEFINED |
3325 | ); |
3326 | return $r2; |
3327 | } |
3328 | private function discardinline_breaks($silence, $boolParams, &$param_preproc, &$param_th) { |
3329 | $key = json_encode([303, $boolParams & 0x1ffe, $param_preproc, $param_th]); |
3330 | $bucket = $this->currPos; |
3331 | $cached = $this->cache[$bucket][$key] ?? null; |
3332 | if ($cached) { |
3333 | $this->currPos = $cached->nextPos; |
3334 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3335 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3336 | return $cached->result; |
3337 | } |
3338 | $saved_preproc=$param_preproc; |
3339 | $saved_th=$param_th; |
3340 | // start seq_1 |
3341 | $p1 = $this->currPos; |
3342 | $p3 = $this->currPos; |
3343 | if (strspn($this->input, "=|!{}:;\x0d\x0a[]-", $this->currPos, 1) !== 0) { |
3344 | $r4 = $this->input[$this->currPos++]; |
3345 | $r4 = false; |
3346 | $this->currPos = $p3; |
3347 | } else { |
3348 | $r4 = self::$FAILED; |
3349 | $r2 = self::$FAILED; |
3350 | goto seq_1; |
3351 | } |
3352 | // free $p3 |
3353 | // start seq_2 |
3354 | $p3 = $this->currPos; |
3355 | $this->savedPos = $this->currPos; |
3356 | $r6 = $this->a30(/*annOrExtTag*/($boolParams & 0x2) !== 0, /*h*/($boolParams & 0x4) !== 0, /*extlink*/($boolParams & 0x8) !== 0, /*intemplate*/($boolParams & 0x10) !== 0, $param_preproc, /*equal*/($boolParams & 0x20) !== 0, /*table*/($boolParams & 0x40) !== 0, /*templateArg*/($boolParams & 0x80) !== 0, /*tableCellArg*/($boolParams & 0x100) !== 0, /*semicolon*/($boolParams & 0x200) !== 0, /*arrow*/($boolParams & 0x400) !== 0, /*linkdesc*/($boolParams & 0x800) !== 0, /*colon*/($boolParams & 0x1000) !== 0, $param_th); |
3357 | if ($r6) { |
3358 | $r6 = false; |
3359 | } else { |
3360 | $r6 = self::$FAILED; |
3361 | $this->currPos = $p3; |
3362 | $r5 = self::$FAILED; |
3363 | goto seq_2; |
3364 | } |
3365 | $r5 = true; |
3366 | seq_2: |
3367 | if ($r5===self::$FAILED) { |
3368 | $this->currPos = $p1; |
3369 | $r2 = self::$FAILED; |
3370 | goto seq_1; |
3371 | } |
3372 | // free $r5,$p3 |
3373 | $r2 = true; |
3374 | seq_1: |
3375 | // free $r2,$p1 |
3376 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3377 | $this->currPos, |
3378 | $r2, |
3379 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3380 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3381 | ); |
3382 | return $r2; |
3383 | } |
3384 | private function parseno_punctuation_char($silence) { |
3385 | $key = 326; |
3386 | $bucket = $this->currPos; |
3387 | $cached = $this->cache[$bucket][$key] ?? null; |
3388 | if ($cached) { |
3389 | $this->currPos = $cached->nextPos; |
3390 | |
3391 | return $cached->result; |
3392 | } |
3393 | |
3394 | $r1 = self::charAt($this->input, $this->currPos); |
3395 | if (preg_match("/^[^ \\]\\[\\x0d\\x0a\"'<>\\x00- \\x7f&\\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}{]/u", $r1)) { |
3396 | $this->currPos += strlen($r1); |
3397 | } else { |
3398 | $r1 = self::$FAILED; |
3399 | if (!$silence) {$this->fail(22);} |
3400 | } |
3401 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3402 | $this->currPos, |
3403 | $r1, |
3404 | self::$UNDEFINED, |
3405 | self::$UNDEFINED |
3406 | ); |
3407 | return $r1; |
3408 | } |
3409 | private function parsetplarg_or_template($silence, $boolParams, &$param_th, &$param_preproc) { |
3410 | $key = json_encode([334, $boolParams & 0x3fef, $param_th, $param_preproc]); |
3411 | $bucket = $this->currPos; |
3412 | $cached = $this->cache[$bucket][$key] ?? null; |
3413 | if ($cached) { |
3414 | $this->currPos = $cached->nextPos; |
3415 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3416 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3417 | return $cached->result; |
3418 | } |
3419 | $saved_th=$param_th; |
3420 | $saved_preproc=$param_preproc; |
3421 | $p2 = $this->currPos; |
3422 | // start seq_1 |
3423 | $p3 = $this->currPos; |
3424 | $p4 = $this->currPos; |
3425 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
3426 | $r5 = "{{"; |
3427 | $this->currPos += 2; |
3428 | $r5 = false; |
3429 | $this->currPos = $p4; |
3430 | } else { |
3431 | $r5 = self::$FAILED; |
3432 | $r1 = self::$FAILED; |
3433 | goto seq_1; |
3434 | } |
3435 | // free $p4 |
3436 | $r6 = $this->parsetplarg_or_template_guarded($silence, $boolParams | 0x10, $param_th, $param_preproc); |
3437 | // t <- $r6 |
3438 | if ($r6===self::$FAILED) { |
3439 | $this->currPos = $p3; |
3440 | $r1 = self::$FAILED; |
3441 | goto seq_1; |
3442 | } |
3443 | $r1 = true; |
3444 | seq_1: |
3445 | if ($r1!==self::$FAILED) { |
3446 | $this->savedPos = $p2; |
3447 | $r1 = $this->a31($r6); |
3448 | } |
3449 | // free $p3 |
3450 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3451 | $this->currPos, |
3452 | $r1, |
3453 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3454 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3455 | ); |
3456 | return $r1; |
3457 | } |
3458 | private function parsehtmlentity($silence) { |
3459 | $key = 482; |
3460 | $bucket = $this->currPos; |
3461 | $cached = $this->cache[$bucket][$key] ?? null; |
3462 | if ($cached) { |
3463 | $this->currPos = $cached->nextPos; |
3464 | |
3465 | return $cached->result; |
3466 | } |
3467 | |
3468 | $p2 = $this->currPos; |
3469 | $r3 = $this->parseraw_htmlentity($silence); |
3470 | // cc <- $r3 |
3471 | $r1 = $r3; |
3472 | if ($r1!==self::$FAILED) { |
3473 | $this->savedPos = $p2; |
3474 | $r1 = $this->a32($r3); |
3475 | } |
3476 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3477 | $this->currPos, |
3478 | $r1, |
3479 | self::$UNDEFINED, |
3480 | self::$UNDEFINED |
3481 | ); |
3482 | return $r1; |
3483 | } |
3484 | private function parseoptional_spaces($silence) { |
3485 | $key = 512; |
3486 | $bucket = $this->currPos; |
3487 | $cached = $this->cache[$bucket][$key] ?? null; |
3488 | if ($cached) { |
3489 | $this->currPos = $cached->nextPos; |
3490 | |
3491 | return $cached->result; |
3492 | } |
3493 | |
3494 | $p1 = $this->currPos; |
3495 | for (;;) { |
3496 | $r3 = $this->input[$this->currPos] ?? ''; |
3497 | if ($r3 === " " || $r3 === "\x09") { |
3498 | $this->currPos++; |
3499 | } else { |
3500 | $r3 = self::$FAILED; |
3501 | if (!$silence) {$this->fail(10);} |
3502 | break; |
3503 | } |
3504 | } |
3505 | // free $r3 |
3506 | $r2 = true; |
3507 | if ($r2!==self::$FAILED) { |
3508 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3509 | } else { |
3510 | $r2 = self::$FAILED; |
3511 | } |
3512 | // free $p1 |
3513 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3514 | $this->currPos, |
3515 | $r2, |
3516 | self::$UNDEFINED, |
3517 | self::$UNDEFINED |
3518 | ); |
3519 | return $r2; |
3520 | } |
3521 | private function discardpipe($silence) { |
3522 | $key = 507; |
3523 | $bucket = $this->currPos; |
3524 | $cached = $this->cache[$bucket][$key] ?? null; |
3525 | if ($cached) { |
3526 | $this->currPos = $cached->nextPos; |
3527 | |
3528 | return $cached->result; |
3529 | } |
3530 | |
3531 | // start choice_1 |
3532 | if (($this->input[$this->currPos] ?? null) === "|") { |
3533 | $this->currPos++; |
3534 | $r1 = "|"; |
3535 | goto choice_1; |
3536 | } else { |
3537 | if (!$silence) {$this->fail(13);} |
3538 | $r1 = self::$FAILED; |
3539 | } |
3540 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3541 | $r1 = "{{!}}"; |
3542 | $this->currPos += 5; |
3543 | } else { |
3544 | if (!$silence) {$this->fail(14);} |
3545 | $r1 = self::$FAILED; |
3546 | } |
3547 | choice_1: |
3548 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3549 | $this->currPos, |
3550 | $r1, |
3551 | self::$UNDEFINED, |
3552 | self::$UNDEFINED |
3553 | ); |
3554 | return $r1; |
3555 | } |
3556 | private function parsetable_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3557 | $key = json_encode([420, $boolParams & 0x3fff, $param_preproc, $param_th]); |
3558 | $bucket = $this->currPos; |
3559 | $cached = $this->cache[$bucket][$key] ?? null; |
3560 | if ($cached) { |
3561 | $this->currPos = $cached->nextPos; |
3562 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3563 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3564 | return $cached->result; |
3565 | } |
3566 | $saved_preproc=$param_preproc; |
3567 | $saved_th=$param_th; |
3568 | $p2 = $this->currPos; |
3569 | // start seq_1 |
3570 | $p3 = $this->currPos; |
3571 | $r4 = $this->parseoptionalSpaceToken($silence); |
3572 | // s <- $r4 |
3573 | if ($r4===self::$FAILED) { |
3574 | $r1 = self::$FAILED; |
3575 | goto seq_1; |
3576 | } |
3577 | $p6 = $this->currPos; |
3578 | $r5 = ''; |
3579 | // namePos0 <- $r5 |
3580 | if ($r5!==self::$FAILED) { |
3581 | $this->savedPos = $p6; |
3582 | $r5 = $this->a33($r4); |
3583 | } else { |
3584 | $this->currPos = $p3; |
3585 | $r1 = self::$FAILED; |
3586 | goto seq_1; |
3587 | } |
3588 | $r7 = $this->parsetable_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3589 | // name <- $r7 |
3590 | if ($r7===self::$FAILED) { |
3591 | $this->currPos = $p3; |
3592 | $r1 = self::$FAILED; |
3593 | goto seq_1; |
3594 | } |
3595 | $p9 = $this->currPos; |
3596 | $r8 = ''; |
3597 | // namePos <- $r8 |
3598 | if ($r8!==self::$FAILED) { |
3599 | $this->savedPos = $p9; |
3600 | $r8 = $this->a34($r4, $r5, $r7); |
3601 | } else { |
3602 | $this->currPos = $p3; |
3603 | $r1 = self::$FAILED; |
3604 | goto seq_1; |
3605 | } |
3606 | $p11 = $this->currPos; |
3607 | // start seq_2 |
3608 | $p12 = $this->currPos; |
3609 | $r13 = $this->discardoptionalSpaceToken($silence); |
3610 | if ($r13===self::$FAILED) { |
3611 | $r10 = self::$FAILED; |
3612 | goto seq_2; |
3613 | } |
3614 | if (($this->input[$this->currPos] ?? null) === "=") { |
3615 | $this->currPos++; |
3616 | $r14 = "="; |
3617 | } else { |
3618 | if (!$silence) {$this->fail(23);} |
3619 | $r14 = self::$FAILED; |
3620 | $this->currPos = $p12; |
3621 | $r10 = self::$FAILED; |
3622 | goto seq_2; |
3623 | } |
3624 | $r15 = $this->parsetable_att_value($silence, $boolParams, $param_preproc, $param_th); |
3625 | if ($r15===self::$FAILED) { |
3626 | $r15 = null; |
3627 | } |
3628 | // v <- $r15 |
3629 | $r10 = true; |
3630 | seq_2: |
3631 | if ($r10!==self::$FAILED) { |
3632 | $this->savedPos = $p11; |
3633 | $r10 = $this->a35($r4, $r5, $r7, $r8, $r15); |
3634 | } else { |
3635 | $r10 = null; |
3636 | } |
3637 | // free $p12 |
3638 | // vd <- $r10 |
3639 | $r1 = true; |
3640 | seq_1: |
3641 | if ($r1!==self::$FAILED) { |
3642 | $this->savedPos = $p2; |
3643 | $r1 = $this->a36($r4, $r5, $r7, $r8, $r10); |
3644 | } |
3645 | // free $p3 |
3646 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3647 | $this->currPos, |
3648 | $r1, |
3649 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3650 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3651 | ); |
3652 | return $r1; |
3653 | } |
3654 | private function discardoptionalSpaceToken($silence) { |
3655 | $key = 529; |
3656 | $bucket = $this->currPos; |
3657 | $cached = $this->cache[$bucket][$key] ?? null; |
3658 | if ($cached) { |
3659 | $this->currPos = $cached->nextPos; |
3660 | |
3661 | return $cached->result; |
3662 | } |
3663 | |
3664 | $p2 = $this->currPos; |
3665 | $r3 = $this->parseoptional_spaces($silence); |
3666 | // s <- $r3 |
3667 | $r1 = $r3; |
3668 | if ($r1!==self::$FAILED) { |
3669 | $this->savedPos = $p2; |
3670 | $r1 = $this->a37($r3); |
3671 | } |
3672 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3673 | $this->currPos, |
3674 | $r1, |
3675 | self::$UNDEFINED, |
3676 | self::$UNDEFINED |
3677 | ); |
3678 | return $r1; |
3679 | } |
3680 | private function parsebroken_table_attribute_name_char($silence) { |
3681 | $key = 426; |
3682 | $bucket = $this->currPos; |
3683 | $cached = $this->cache[$bucket][$key] ?? null; |
3684 | if ($cached) { |
3685 | $this->currPos = $cached->nextPos; |
3686 | |
3687 | return $cached->result; |
3688 | } |
3689 | |
3690 | $p2 = $this->currPos; |
3691 | // c <- $r3 |
3692 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
3693 | $r3 = $this->input[$this->currPos++]; |
3694 | } else { |
3695 | $r3 = self::$FAILED; |
3696 | if (!$silence) {$this->fail(24);} |
3697 | } |
3698 | $r1 = $r3; |
3699 | if ($r1!==self::$FAILED) { |
3700 | $this->savedPos = $p2; |
3701 | $r1 = $this->a38($r3); |
3702 | } |
3703 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3704 | $this->currPos, |
3705 | $r1, |
3706 | self::$UNDEFINED, |
3707 | self::$UNDEFINED |
3708 | ); |
3709 | return $r1; |
3710 | } |
3711 | private function parsegeneric_newline_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3712 | $key = json_encode([418, $boolParams & 0x3fff, $param_preproc, $param_th]); |
3713 | $bucket = $this->currPos; |
3714 | $cached = $this->cache[$bucket][$key] ?? null; |
3715 | if ($cached) { |
3716 | $this->currPos = $cached->nextPos; |
3717 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3718 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3719 | return $cached->result; |
3720 | } |
3721 | $saved_preproc=$param_preproc; |
3722 | $saved_th=$param_th; |
3723 | $p2 = $this->currPos; |
3724 | // start seq_1 |
3725 | $p3 = $this->currPos; |
3726 | for (;;) { |
3727 | $r5 = $this->discardspace_or_newline_or_solidus($silence); |
3728 | if ($r5===self::$FAILED) { |
3729 | break; |
3730 | } |
3731 | } |
3732 | // free $r5 |
3733 | $r4 = true; |
3734 | if ($r4===self::$FAILED) { |
3735 | $r1 = self::$FAILED; |
3736 | goto seq_1; |
3737 | } |
3738 | // free $r4 |
3739 | $p6 = $this->currPos; |
3740 | $r4 = ''; |
3741 | // namePos0 <- $r4 |
3742 | if ($r4!==self::$FAILED) { |
3743 | $this->savedPos = $p6; |
3744 | $r4 = $this->a17(); |
3745 | } else { |
3746 | $this->currPos = $p3; |
3747 | $r1 = self::$FAILED; |
3748 | goto seq_1; |
3749 | } |
3750 | $r5 = $this->parsegeneric_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3751 | // name <- $r5 |
3752 | if ($r5===self::$FAILED) { |
3753 | $this->currPos = $p3; |
3754 | $r1 = self::$FAILED; |
3755 | goto seq_1; |
3756 | } |
3757 | $p8 = $this->currPos; |
3758 | $r7 = ''; |
3759 | // namePos <- $r7 |
3760 | if ($r7!==self::$FAILED) { |
3761 | $this->savedPos = $p8; |
3762 | $r7 = $this->a39($r4, $r5); |
3763 | } else { |
3764 | $this->currPos = $p3; |
3765 | $r1 = self::$FAILED; |
3766 | goto seq_1; |
3767 | } |
3768 | $p10 = $this->currPos; |
3769 | // start seq_2 |
3770 | $p11 = $this->currPos; |
3771 | for (;;) { |
3772 | $r13 = $this->discardspace_or_newline($silence); |
3773 | if ($r13===self::$FAILED) { |
3774 | break; |
3775 | } |
3776 | } |
3777 | // free $r13 |
3778 | $r12 = true; |
3779 | if ($r12===self::$FAILED) { |
3780 | $r9 = self::$FAILED; |
3781 | goto seq_2; |
3782 | } |
3783 | // free $r12 |
3784 | if (($this->input[$this->currPos] ?? null) === "=") { |
3785 | $this->currPos++; |
3786 | $r12 = "="; |
3787 | } else { |
3788 | if (!$silence) {$this->fail(23);} |
3789 | $r12 = self::$FAILED; |
3790 | $this->currPos = $p11; |
3791 | $r9 = self::$FAILED; |
3792 | goto seq_2; |
3793 | } |
3794 | $r13 = $this->parsegeneric_att_value($silence, $boolParams, $param_preproc, $param_th); |
3795 | if ($r13===self::$FAILED) { |
3796 | $r13 = null; |
3797 | } |
3798 | // v <- $r13 |
3799 | $r9 = true; |
3800 | seq_2: |
3801 | if ($r9!==self::$FAILED) { |
3802 | $this->savedPos = $p10; |
3803 | $r9 = $this->a40($r4, $r5, $r7, $r13); |
3804 | } else { |
3805 | $r9 = null; |
3806 | } |
3807 | // free $p11 |
3808 | // vd <- $r9 |
3809 | $r1 = true; |
3810 | seq_1: |
3811 | if ($r1!==self::$FAILED) { |
3812 | $this->savedPos = $p2; |
3813 | $r1 = $this->a41($r4, $r5, $r7, $r9); |
3814 | } |
3815 | // free $p3 |
3816 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3817 | $this->currPos, |
3818 | $r1, |
3819 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3820 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3821 | ); |
3822 | return $r1; |
3823 | } |
3824 | private function parseextlink_nonipv6url($silence, $boolParams, &$param_preproc, &$param_th) { |
3825 | $key = json_encode([490, $boolParams & 0x37ff, $param_preproc, $param_th]); |
3826 | $bucket = $this->currPos; |
3827 | $cached = $this->cache[$bucket][$key] ?? null; |
3828 | if ($cached) { |
3829 | $this->currPos = $cached->nextPos; |
3830 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3831 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3832 | return $cached->result; |
3833 | } |
3834 | $saved_preproc=$param_preproc; |
3835 | $saved_th=$param_th; |
3836 | $r1 = $this->parseextlink_nonipv6url_parameterized($silence, $boolParams & ~0x800, $param_preproc, $param_th); |
3837 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3838 | $this->currPos, |
3839 | $r1, |
3840 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3841 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3842 | ); |
3843 | return $r1; |
3844 | } |
3845 | private function discardspace($silence) { |
3846 | $key = 511; |
3847 | $bucket = $this->currPos; |
3848 | $cached = $this->cache[$bucket][$key] ?? null; |
3849 | if ($cached) { |
3850 | $this->currPos = $cached->nextPos; |
3851 | |
3852 | return $cached->result; |
3853 | } |
3854 | |
3855 | $r1 = $this->input[$this->currPos] ?? ''; |
3856 | if ($r1 === " " || $r1 === "\x09") { |
3857 | $this->currPos++; |
3858 | } else { |
3859 | $r1 = self::$FAILED; |
3860 | if (!$silence) {$this->fail(10);} |
3861 | } |
3862 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3863 | $this->currPos, |
3864 | $r1, |
3865 | self::$UNDEFINED, |
3866 | self::$UNDEFINED |
3867 | ); |
3868 | return $r1; |
3869 | } |
3870 | private function discardunispace($silence) { |
3871 | $key = 535; |
3872 | $bucket = $this->currPos; |
3873 | $cached = $this->cache[$bucket][$key] ?? null; |
3874 | if ($cached) { |
3875 | $this->currPos = $cached->nextPos; |
3876 | |
3877 | return $cached->result; |
3878 | } |
3879 | |
3880 | $r1 = self::charAt($this->input, $this->currPos); |
3881 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
3882 | $this->currPos += strlen($r1); |
3883 | } else { |
3884 | $r1 = self::$FAILED; |
3885 | if (!$silence) {$this->fail(25);} |
3886 | } |
3887 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3888 | $this->currPos, |
3889 | $r1, |
3890 | self::$UNDEFINED, |
3891 | self::$UNDEFINED |
3892 | ); |
3893 | return $r1; |
3894 | } |
3895 | private function parseinlineline($silence, $boolParams, &$param_preproc, &$param_th) { |
3896 | $key = json_encode([304, $boolParams & 0x3fff, $param_preproc, $param_th]); |
3897 | $bucket = $this->currPos; |
3898 | $cached = $this->cache[$bucket][$key] ?? null; |
3899 | if ($cached) { |
3900 | $this->currPos = $cached->nextPos; |
3901 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3902 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3903 | return $cached->result; |
3904 | } |
3905 | $saved_preproc=$param_preproc; |
3906 | $saved_th=$param_th; |
3907 | $p2 = $this->currPos; |
3908 | $r3 = []; |
3909 | for (;;) { |
3910 | // start choice_1 |
3911 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
3912 | if ($r4!==self::$FAILED) { |
3913 | goto choice_1; |
3914 | } |
3915 | $p5 = $this->currPos; |
3916 | // start seq_1 |
3917 | $p6 = $this->currPos; |
3918 | $p7 = $this->currPos; |
3919 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
3920 | if ($r8 === self::$FAILED) { |
3921 | $r8 = false; |
3922 | } else { |
3923 | $r8 = self::$FAILED; |
3924 | $this->currPos = $p7; |
3925 | $r4 = self::$FAILED; |
3926 | goto seq_1; |
3927 | } |
3928 | // free $p7 |
3929 | // start choice_2 |
3930 | $r9 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
3931 | if ($r9!==self::$FAILED) { |
3932 | goto choice_2; |
3933 | } |
3934 | $p7 = $this->currPos; |
3935 | // start seq_2 |
3936 | $p10 = $this->currPos; |
3937 | $p11 = $this->currPos; |
3938 | $r12 = $this->discardnewline(true); |
3939 | if ($r12 === self::$FAILED) { |
3940 | $r12 = false; |
3941 | } else { |
3942 | $r12 = self::$FAILED; |
3943 | $this->currPos = $p11; |
3944 | $r9 = self::$FAILED; |
3945 | goto seq_2; |
3946 | } |
3947 | // free $p11 |
3948 | // s <- $r13 |
3949 | if ($this->currPos < $this->inputLength) { |
3950 | $r13 = self::consumeChar($this->input, $this->currPos);; |
3951 | } else { |
3952 | $r13 = self::$FAILED; |
3953 | if (!$silence) {$this->fail(7);} |
3954 | $this->currPos = $p10; |
3955 | $r9 = self::$FAILED; |
3956 | goto seq_2; |
3957 | } |
3958 | $r9 = true; |
3959 | seq_2: |
3960 | if ($r9!==self::$FAILED) { |
3961 | $this->savedPos = $p7; |
3962 | $r9 = $this->a42($r13); |
3963 | } |
3964 | // free $p10 |
3965 | choice_2: |
3966 | // r <- $r9 |
3967 | if ($r9===self::$FAILED) { |
3968 | $this->currPos = $p6; |
3969 | $r4 = self::$FAILED; |
3970 | goto seq_1; |
3971 | } |
3972 | $r4 = true; |
3973 | seq_1: |
3974 | if ($r4!==self::$FAILED) { |
3975 | $this->savedPos = $p5; |
3976 | $r4 = $this->a24($r9); |
3977 | } |
3978 | // free $p6 |
3979 | choice_1: |
3980 | if ($r4!==self::$FAILED) { |
3981 | $r3[] = $r4; |
3982 | } else { |
3983 | break; |
3984 | } |
3985 | } |
3986 | if (count($r3) === 0) { |
3987 | $r3 = self::$FAILED; |
3988 | } |
3989 | // c <- $r3 |
3990 | // free $r4 |
3991 | $r1 = $r3; |
3992 | if ($r1!==self::$FAILED) { |
3993 | $this->savedPos = $p2; |
3994 | $r1 = $this->a43($r3); |
3995 | } |
3996 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3997 | $this->currPos, |
3998 | $r1, |
3999 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4000 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4001 | ); |
4002 | return $r1; |
4003 | } |
4004 | private function parsedtdd($silence, $boolParams, &$param_preproc, &$param_th) { |
4005 | $key = json_encode([440, $boolParams & 0x3fff, $param_preproc, $param_th]); |
4006 | $bucket = $this->currPos; |
4007 | $cached = $this->cache[$bucket][$key] ?? null; |
4008 | if ($cached) { |
4009 | $this->currPos = $cached->nextPos; |
4010 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4011 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4012 | return $cached->result; |
4013 | } |
4014 | $saved_preproc=$param_preproc; |
4015 | $saved_th=$param_th; |
4016 | $p2 = $this->currPos; |
4017 | // start seq_1 |
4018 | $p3 = $this->currPos; |
4019 | $r4 = []; |
4020 | for (;;) { |
4021 | $p6 = $this->currPos; |
4022 | // start seq_2 |
4023 | $p7 = $this->currPos; |
4024 | $p8 = $this->currPos; |
4025 | // start seq_3 |
4026 | $p10 = $this->currPos; |
4027 | if (($this->input[$this->currPos] ?? null) === ";") { |
4028 | $this->currPos++; |
4029 | $r11 = ";"; |
4030 | } else { |
4031 | $r11 = self::$FAILED; |
4032 | $r9 = self::$FAILED; |
4033 | goto seq_3; |
4034 | } |
4035 | $p12 = $this->currPos; |
4036 | $r13 = $this->discardlist_char(true); |
4037 | if ($r13 === self::$FAILED) { |
4038 | $r13 = false; |
4039 | } else { |
4040 | $r13 = self::$FAILED; |
4041 | $this->currPos = $p12; |
4042 | $this->currPos = $p10; |
4043 | $r9 = self::$FAILED; |
4044 | goto seq_3; |
4045 | } |
4046 | // free $p12 |
4047 | $r9 = true; |
4048 | seq_3: |
4049 | // free $p10 |
4050 | if ($r9 === self::$FAILED) { |
4051 | $r9 = false; |
4052 | } else { |
4053 | $r9 = self::$FAILED; |
4054 | $this->currPos = $p8; |
4055 | $r5 = self::$FAILED; |
4056 | goto seq_2; |
4057 | } |
4058 | // free $p8 |
4059 | $r14 = $this->parselist_char($silence); |
4060 | // lc <- $r14 |
4061 | if ($r14===self::$FAILED) { |
4062 | $this->currPos = $p7; |
4063 | $r5 = self::$FAILED; |
4064 | goto seq_2; |
4065 | } |
4066 | $r5 = true; |
4067 | seq_2: |
4068 | if ($r5!==self::$FAILED) { |
4069 | $this->savedPos = $p6; |
4070 | $r5 = $this->a44($r14); |
4071 | $r4[] = $r5; |
4072 | } else { |
4073 | break; |
4074 | } |
4075 | // free $p7 |
4076 | } |
4077 | // bullets <- $r4 |
4078 | // free $r5 |
4079 | if (($this->input[$this->currPos] ?? null) === ";") { |
4080 | $this->currPos++; |
4081 | $r5 = ";"; |
4082 | } else { |
4083 | if (!$silence) {$this->fail(26);} |
4084 | $r5 = self::$FAILED; |
4085 | $this->currPos = $p3; |
4086 | $r1 = self::$FAILED; |
4087 | goto seq_1; |
4088 | } |
4089 | $r15 = $this->parseinlineline_break_on_colon($silence, $boolParams, $param_preproc, $param_th); |
4090 | if ($r15===self::$FAILED) { |
4091 | $r15 = null; |
4092 | } |
4093 | // c <- $r15 |
4094 | $p7 = $this->currPos; |
4095 | // cpos <- $r16 |
4096 | if (($this->input[$this->currPos] ?? null) === ":") { |
4097 | $this->currPos++; |
4098 | $r16 = ":"; |
4099 | $this->savedPos = $p7; |
4100 | $r16 = $this->a45($r4, $r15); |
4101 | } else { |
4102 | if (!$silence) {$this->fail(18);} |
4103 | $r16 = self::$FAILED; |
4104 | $this->currPos = $p3; |
4105 | $r1 = self::$FAILED; |
4106 | goto seq_1; |
4107 | } |
4108 | $r17 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4109 | if ($r17===self::$FAILED) { |
4110 | $r17 = null; |
4111 | } |
4112 | // d <- $r17 |
4113 | $p8 = $this->currPos; |
4114 | $r18 = $this->discardeolf(true); |
4115 | if ($r18!==self::$FAILED) { |
4116 | $r18 = false; |
4117 | $this->currPos = $p8; |
4118 | } else { |
4119 | $this->currPos = $p3; |
4120 | $r1 = self::$FAILED; |
4121 | goto seq_1; |
4122 | } |
4123 | // free $p8 |
4124 | $r1 = true; |
4125 | seq_1: |
4126 | if ($r1!==self::$FAILED) { |
4127 | $this->savedPos = $p2; |
4128 | $r1 = $this->a46($r4, $r15, $r16, $r17); |
4129 | } |
4130 | // free $p3 |
4131 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4132 | $this->currPos, |
4133 | $r1, |
4134 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4135 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4136 | ); |
4137 | return $r1; |
4138 | } |
4139 | private function parsehacky_dl_uses($silence, $boolParams, &$param_preproc, &$param_th) { |
4140 | $key = json_encode([438, $boolParams & 0x3fff, $param_preproc, $param_th]); |
4141 | $bucket = $this->currPos; |
4142 | $cached = $this->cache[$bucket][$key] ?? null; |
4143 | if ($cached) { |
4144 | $this->currPos = $cached->nextPos; |
4145 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4146 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4147 | return $cached->result; |
4148 | } |
4149 | $saved_preproc=$param_preproc; |
4150 | $saved_th=$param_th; |
4151 | $p2 = $this->currPos; |
4152 | // start seq_1 |
4153 | $p3 = $this->currPos; |
4154 | $r4 = []; |
4155 | for (;;) { |
4156 | if (($this->input[$this->currPos] ?? null) === ":") { |
4157 | $this->currPos++; |
4158 | $r5 = ":"; |
4159 | $r4[] = $r5; |
4160 | } else { |
4161 | if (!$silence) {$this->fail(18);} |
4162 | $r5 = self::$FAILED; |
4163 | break; |
4164 | } |
4165 | } |
4166 | if (count($r4) === 0) { |
4167 | $r4 = self::$FAILED; |
4168 | } |
4169 | // bullets <- $r4 |
4170 | if ($r4===self::$FAILED) { |
4171 | $r1 = self::$FAILED; |
4172 | goto seq_1; |
4173 | } |
4174 | // free $r5 |
4175 | // start seq_2 |
4176 | $p6 = $this->currPos; |
4177 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4178 | if ($r7===self::$FAILED) { |
4179 | $r5 = self::$FAILED; |
4180 | goto seq_2; |
4181 | } |
4182 | $r8 = []; |
4183 | for (;;) { |
4184 | // start seq_3 |
4185 | $p10 = $this->currPos; |
4186 | $r11 = []; |
4187 | for (;;) { |
4188 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4189 | if ($r12!==self::$FAILED) { |
4190 | $r11[] = $r12; |
4191 | } else { |
4192 | break; |
4193 | } |
4194 | } |
4195 | if (count($r11) === 0) { |
4196 | $r11 = self::$FAILED; |
4197 | } |
4198 | if ($r11===self::$FAILED) { |
4199 | $r9 = self::$FAILED; |
4200 | goto seq_3; |
4201 | } |
4202 | // free $r12 |
4203 | $r12 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4204 | if ($r12===self::$FAILED) { |
4205 | $this->currPos = $p10; |
4206 | $r9 = self::$FAILED; |
4207 | goto seq_3; |
4208 | } |
4209 | $r9 = [$r11,$r12]; |
4210 | seq_3: |
4211 | if ($r9!==self::$FAILED) { |
4212 | $r8[] = $r9; |
4213 | } else { |
4214 | break; |
4215 | } |
4216 | // free $p10 |
4217 | } |
4218 | // free $r9 |
4219 | $r5 = [$r7,$r8]; |
4220 | seq_2: |
4221 | // tbl <- $r5 |
4222 | if ($r5===self::$FAILED) { |
4223 | $this->currPos = $p3; |
4224 | $r1 = self::$FAILED; |
4225 | goto seq_1; |
4226 | } |
4227 | // free $p6 |
4228 | $r9 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4229 | if ($r9===self::$FAILED) { |
4230 | $r9 = null; |
4231 | } |
4232 | // line <- $r9 |
4233 | $p6 = $this->currPos; |
4234 | // start seq_4 |
4235 | $p10 = $this->currPos; |
4236 | for (;;) { |
4237 | // start choice_1 |
4238 | $r15 = $this->discardspace(true); |
4239 | if ($r15!==self::$FAILED) { |
4240 | goto choice_1; |
4241 | } |
4242 | $r15 = $this->discardcomment(true); |
4243 | choice_1: |
4244 | if ($r15===self::$FAILED) { |
4245 | break; |
4246 | } |
4247 | } |
4248 | // free $r15 |
4249 | $r14 = true; |
4250 | if ($r14===self::$FAILED) { |
4251 | $r13 = self::$FAILED; |
4252 | goto seq_4; |
4253 | } |
4254 | // free $r14 |
4255 | $r14 = $this->discardeolf(true); |
4256 | if ($r14===self::$FAILED) { |
4257 | $this->currPos = $p10; |
4258 | $r13 = self::$FAILED; |
4259 | goto seq_4; |
4260 | } |
4261 | $r13 = true; |
4262 | seq_4: |
4263 | if ($r13!==self::$FAILED) { |
4264 | $r13 = false; |
4265 | $this->currPos = $p6; |
4266 | } else { |
4267 | $this->currPos = $p3; |
4268 | $r1 = self::$FAILED; |
4269 | goto seq_1; |
4270 | } |
4271 | // free $p10 |
4272 | // free $p6 |
4273 | $r1 = true; |
4274 | seq_1: |
4275 | if ($r1!==self::$FAILED) { |
4276 | $this->savedPos = $p2; |
4277 | $r1 = $this->a47($r4, $r5, $r9); |
4278 | } |
4279 | // free $p3 |
4280 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4281 | $this->currPos, |
4282 | $r1, |
4283 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4284 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4285 | ); |
4286 | return $r1; |
4287 | } |
4288 | private function parseli($silence, $boolParams, &$param_preproc, &$param_th) { |
4289 | $key = json_encode([436, $boolParams & 0x3fff, $param_preproc, $param_th]); |
4290 | $bucket = $this->currPos; |
4291 | $cached = $this->cache[$bucket][$key] ?? null; |
4292 | if ($cached) { |
4293 | $this->currPos = $cached->nextPos; |
4294 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4295 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4296 | return $cached->result; |
4297 | } |
4298 | $saved_preproc=$param_preproc; |
4299 | $saved_th=$param_th; |
4300 | $p2 = $this->currPos; |
4301 | // start seq_1 |
4302 | $p3 = $this->currPos; |
4303 | $r4 = []; |
4304 | for (;;) { |
4305 | $r5 = $this->parselist_char($silence); |
4306 | if ($r5!==self::$FAILED) { |
4307 | $r4[] = $r5; |
4308 | } else { |
4309 | break; |
4310 | } |
4311 | } |
4312 | if (count($r4) === 0) { |
4313 | $r4 = self::$FAILED; |
4314 | } |
4315 | // bullets <- $r4 |
4316 | if ($r4===self::$FAILED) { |
4317 | $r1 = self::$FAILED; |
4318 | goto seq_1; |
4319 | } |
4320 | // free $r5 |
4321 | $r5 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4322 | if ($r5===self::$FAILED) { |
4323 | $r5 = null; |
4324 | } |
4325 | // c <- $r5 |
4326 | $p6 = $this->currPos; |
4327 | // start choice_1 |
4328 | $r7 = $this->discardeolf(true); |
4329 | if ($r7!==self::$FAILED) { |
4330 | goto choice_1; |
4331 | } |
4332 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4333 | choice_1: |
4334 | if ($r7!==self::$FAILED) { |
4335 | $r7 = false; |
4336 | $this->currPos = $p6; |
4337 | } else { |
4338 | $this->currPos = $p3; |
4339 | $r1 = self::$FAILED; |
4340 | goto seq_1; |
4341 | } |
4342 | // free $p6 |
4343 | $r1 = true; |
4344 | seq_1: |
4345 | if ($r1!==self::$FAILED) { |
4346 | $this->savedPos = $p2; |
4347 | $r1 = $this->a48($r4, $r5); |
4348 | } |
4349 | // free $p3 |
4350 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4351 | $this->currPos, |
4352 | $r1, |
4353 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4354 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4355 | ); |
4356 | return $r1; |
4357 | } |
4358 | private function discardeof($silence) { |
4359 | $key = 517; |
4360 | $bucket = $this->currPos; |
4361 | $cached = $this->cache[$bucket][$key] ?? null; |
4362 | if ($cached) { |
4363 | $this->currPos = $cached->nextPos; |
4364 | |
4365 | return $cached->result; |
4366 | } |
4367 | |
4368 | $this->savedPos = $this->currPos; |
4369 | $r1 = $this->a49(); |
4370 | if ($r1) { |
4371 | $r1 = false; |
4372 | } else { |
4373 | $r1 = self::$FAILED; |
4374 | } |
4375 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4376 | $this->currPos, |
4377 | $r1, |
4378 | self::$UNDEFINED, |
4379 | self::$UNDEFINED |
4380 | ); |
4381 | return $r1; |
4382 | } |
4383 | private function parseblock($silence, $boolParams, &$param_th, &$param_preproc) { |
4384 | $key = json_encode([288, $boolParams & 0x3fff, $param_th, $param_preproc]); |
4385 | $bucket = $this->currPos; |
4386 | $cached = $this->cache[$bucket][$key] ?? null; |
4387 | if ($cached) { |
4388 | $this->currPos = $cached->nextPos; |
4389 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4390 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4391 | return $cached->result; |
4392 | } |
4393 | $saved_th=$param_th; |
4394 | $saved_preproc=$param_preproc; |
4395 | // start choice_1 |
4396 | $p2 = $this->currPos; |
4397 | // start seq_1 |
4398 | $p3 = $this->currPos; |
4399 | $p4 = $this->currPos; |
4400 | $r5 = $this->discardsof(true); |
4401 | if ($r5!==self::$FAILED) { |
4402 | $r5 = false; |
4403 | $this->currPos = $p4; |
4404 | } else { |
4405 | $r1 = self::$FAILED; |
4406 | goto seq_1; |
4407 | } |
4408 | // free $p4 |
4409 | $r6 = $this->parseredirect($silence, $boolParams, $param_th, $param_preproc); |
4410 | // r <- $r6 |
4411 | if ($r6===self::$FAILED) { |
4412 | $this->currPos = $p3; |
4413 | $r1 = self::$FAILED; |
4414 | goto seq_1; |
4415 | } |
4416 | $r7 = []; |
4417 | for (;;) { |
4418 | $r8 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
4419 | if ($r8!==self::$FAILED) { |
4420 | $r7[] = $r8; |
4421 | } else { |
4422 | break; |
4423 | } |
4424 | } |
4425 | // cil <- $r7 |
4426 | // free $r8 |
4427 | $r8 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
4428 | if ($r8===self::$FAILED) { |
4429 | $r8 = null; |
4430 | } |
4431 | // bl <- $r8 |
4432 | $r1 = true; |
4433 | seq_1: |
4434 | if ($r1!==self::$FAILED) { |
4435 | $this->savedPos = $p2; |
4436 | $r1 = $this->a50($r6, $r7, $r8); |
4437 | goto choice_1; |
4438 | } |
4439 | // free $p3 |
4440 | $r1 = $this->parseblock_lines($silence, $boolParams, $param_preproc, $param_th); |
4441 | if ($r1!==self::$FAILED) { |
4442 | goto choice_1; |
4443 | } |
4444 | $r1 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4445 | if ($r1!==self::$FAILED) { |
4446 | goto choice_1; |
4447 | } |
4448 | $p3 = $this->currPos; |
4449 | // start seq_2 |
4450 | $p4 = $this->currPos; |
4451 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4452 | // s <- $r9 |
4453 | if ($r9===self::$FAILED) { |
4454 | $r1 = self::$FAILED; |
4455 | goto seq_2; |
4456 | } |
4457 | $p10 = $this->currPos; |
4458 | $r11 = $this->discardsof(true); |
4459 | if ($r11 === self::$FAILED) { |
4460 | $r11 = false; |
4461 | } else { |
4462 | $r11 = self::$FAILED; |
4463 | $this->currPos = $p10; |
4464 | $this->currPos = $p4; |
4465 | $r1 = self::$FAILED; |
4466 | goto seq_2; |
4467 | } |
4468 | // free $p10 |
4469 | $p10 = $this->currPos; |
4470 | $r12 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4471 | if ($r12 === self::$FAILED) { |
4472 | $r12 = false; |
4473 | } else { |
4474 | $r12 = self::$FAILED; |
4475 | $this->currPos = $p10; |
4476 | $this->currPos = $p4; |
4477 | $r1 = self::$FAILED; |
4478 | goto seq_2; |
4479 | } |
4480 | // free $p10 |
4481 | $r1 = true; |
4482 | seq_2: |
4483 | if ($r1!==self::$FAILED) { |
4484 | $this->savedPos = $p3; |
4485 | $r1 = $this->a42($r9); |
4486 | } |
4487 | // free $p4 |
4488 | choice_1: |
4489 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4490 | $this->currPos, |
4491 | $r1, |
4492 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4493 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4494 | ); |
4495 | return $r1; |
4496 | } |
4497 | private function discardnewline($silence) { |
4498 | $key = 519; |
4499 | $bucket = $this->currPos; |
4500 | $cached = $this->cache[$bucket][$key] ?? null; |
4501 | if ($cached) { |
4502 | $this->currPos = $cached->nextPos; |
4503 | |
4504 | return $cached->result; |
4505 | } |
4506 | |
4507 | // start choice_1 |
4508 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
4509 | $this->currPos++; |
4510 | $r1 = "\x0a"; |
4511 | goto choice_1; |
4512 | } else { |
4513 | if (!$silence) {$this->fail(27);} |
4514 | $r1 = self::$FAILED; |
4515 | } |
4516 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
4517 | $r1 = "\x0d\x0a"; |
4518 | $this->currPos += 2; |
4519 | } else { |
4520 | if (!$silence) {$this->fail(28);} |
4521 | $r1 = self::$FAILED; |
4522 | } |
4523 | choice_1: |
4524 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4525 | $this->currPos, |
4526 | $r1, |
4527 | self::$UNDEFINED, |
4528 | self::$UNDEFINED |
4529 | ); |
4530 | return $r1; |
4531 | } |
4532 | private function parsetplarg_or_template_guarded($silence, $boolParams, &$param_th, &$param_preproc) { |
4533 | $key = json_encode([336, $boolParams & 0x3fff, $param_th, $param_preproc]); |
4534 | $bucket = $this->currPos; |
4535 | $cached = $this->cache[$bucket][$key] ?? null; |
4536 | if ($cached) { |
4537 | $this->currPos = $cached->nextPos; |
4538 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4539 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4540 | return $cached->result; |
4541 | } |
4542 | $saved_th=$param_th; |
4543 | $saved_preproc=$param_preproc; |
4544 | // start choice_1 |
4545 | $p2 = $this->currPos; |
4546 | // start seq_1 |
4547 | $p3 = $this->currPos; |
4548 | $p4 = $this->currPos; |
4549 | // start seq_2 |
4550 | $p6 = $this->currPos; |
4551 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4552 | $r7 = "{{"; |
4553 | $this->currPos += 2; |
4554 | } else { |
4555 | $r7 = self::$FAILED; |
4556 | $r5 = self::$FAILED; |
4557 | goto seq_2; |
4558 | } |
4559 | $p8 = $this->currPos; |
4560 | // start seq_3 |
4561 | $p10 = $this->currPos; |
4562 | $r11 = self::$FAILED; |
4563 | for (;;) { |
4564 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4565 | $r12 = "{{{"; |
4566 | $this->currPos += 3; |
4567 | $r11 = true; |
4568 | } else { |
4569 | $r12 = self::$FAILED; |
4570 | break; |
4571 | } |
4572 | } |
4573 | if ($r11===self::$FAILED) { |
4574 | $r9 = self::$FAILED; |
4575 | goto seq_3; |
4576 | } |
4577 | // free $r12 |
4578 | $p13 = $this->currPos; |
4579 | if (($this->input[$this->currPos] ?? null) === "{") { |
4580 | $this->currPos++; |
4581 | $r12 = "{"; |
4582 | } else { |
4583 | $r12 = self::$FAILED; |
4584 | } |
4585 | if ($r12 === self::$FAILED) { |
4586 | $r12 = false; |
4587 | } else { |
4588 | $r12 = self::$FAILED; |
4589 | $this->currPos = $p13; |
4590 | $this->currPos = $p10; |
4591 | $r9 = self::$FAILED; |
4592 | goto seq_3; |
4593 | } |
4594 | // free $p13 |
4595 | $r9 = true; |
4596 | seq_3: |
4597 | if ($r9!==self::$FAILED) { |
4598 | $r9 = false; |
4599 | $this->currPos = $p8; |
4600 | } else { |
4601 | $this->currPos = $p6; |
4602 | $r5 = self::$FAILED; |
4603 | goto seq_2; |
4604 | } |
4605 | // free $p10 |
4606 | // free $p8 |
4607 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
4608 | if ($r14===self::$FAILED) { |
4609 | $this->currPos = $p6; |
4610 | $r5 = self::$FAILED; |
4611 | goto seq_2; |
4612 | } |
4613 | $r5 = true; |
4614 | seq_2: |
4615 | if ($r5!==self::$FAILED) { |
4616 | $r5 = false; |
4617 | $this->currPos = $p4; |
4618 | } else { |
4619 | $r1 = self::$FAILED; |
4620 | goto seq_1; |
4621 | } |
4622 | // free $p6 |
4623 | // free $p4 |
4624 | // start choice_2 |
4625 | $r15 = $this->parsetemplate($silence, $boolParams, $param_th); |
4626 | if ($r15!==self::$FAILED) { |
4627 | goto choice_2; |
4628 | } |
4629 | $r15 = $this->parsebroken_template($silence, $param_preproc); |
4630 | choice_2: |
4631 | // a <- $r15 |
4632 | if ($r15===self::$FAILED) { |
4633 | $this->currPos = $p3; |
4634 | $r1 = self::$FAILED; |
4635 | goto seq_1; |
4636 | } |
4637 | $r1 = true; |
4638 | seq_1: |
4639 | if ($r1!==self::$FAILED) { |
4640 | $this->savedPos = $p2; |
4641 | $r1 = $this->a51($r15); |
4642 | goto choice_1; |
4643 | } |
4644 | // free $p3 |
4645 | $p3 = $this->currPos; |
4646 | // start seq_4 |
4647 | $p4 = $this->currPos; |
4648 | $p6 = $this->currPos; |
4649 | // start seq_5 |
4650 | $p8 = $this->currPos; |
4651 | if (($this->input[$this->currPos] ?? null) === "{") { |
4652 | $this->currPos++; |
4653 | $r17 = "{"; |
4654 | } else { |
4655 | if (!$silence) {$this->fail(29);} |
4656 | $r17 = self::$FAILED; |
4657 | $r16 = self::$FAILED; |
4658 | goto seq_5; |
4659 | } |
4660 | $p10 = $this->currPos; |
4661 | // start seq_6 |
4662 | $p13 = $this->currPos; |
4663 | $r19 = self::$FAILED; |
4664 | for (;;) { |
4665 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4666 | $r20 = "{{{"; |
4667 | $this->currPos += 3; |
4668 | $r19 = true; |
4669 | } else { |
4670 | $r20 = self::$FAILED; |
4671 | break; |
4672 | } |
4673 | } |
4674 | if ($r19===self::$FAILED) { |
4675 | $r18 = self::$FAILED; |
4676 | goto seq_6; |
4677 | } |
4678 | // free $r20 |
4679 | $p21 = $this->currPos; |
4680 | if (($this->input[$this->currPos] ?? null) === "{") { |
4681 | $this->currPos++; |
4682 | $r20 = "{"; |
4683 | } else { |
4684 | $r20 = self::$FAILED; |
4685 | } |
4686 | if ($r20 === self::$FAILED) { |
4687 | $r20 = false; |
4688 | } else { |
4689 | $r20 = self::$FAILED; |
4690 | $this->currPos = $p21; |
4691 | $this->currPos = $p13; |
4692 | $r18 = self::$FAILED; |
4693 | goto seq_6; |
4694 | } |
4695 | // free $p21 |
4696 | $r18 = true; |
4697 | seq_6: |
4698 | if ($r18!==self::$FAILED) { |
4699 | $r18 = false; |
4700 | $this->currPos = $p10; |
4701 | } else { |
4702 | $this->currPos = $p8; |
4703 | $r16 = self::$FAILED; |
4704 | goto seq_5; |
4705 | } |
4706 | // free $p13 |
4707 | // free $p10 |
4708 | $r16 = true; |
4709 | seq_5: |
4710 | if ($r16===self::$FAILED) { |
4711 | $r16 = null; |
4712 | } |
4713 | // free $p8 |
4714 | // a <- $r16 |
4715 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
4716 | // free $p6 |
4717 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
4718 | // b <- $r22 |
4719 | if ($r22===self::$FAILED) { |
4720 | $this->currPos = $p4; |
4721 | $r1 = self::$FAILED; |
4722 | goto seq_4; |
4723 | } |
4724 | $r1 = true; |
4725 | seq_4: |
4726 | if ($r1!==self::$FAILED) { |
4727 | $this->savedPos = $p3; |
4728 | $r1 = $this->a52($r16, $r22); |
4729 | goto choice_1; |
4730 | } |
4731 | // free $p4 |
4732 | $p4 = $this->currPos; |
4733 | // start seq_7 |
4734 | $p6 = $this->currPos; |
4735 | $p8 = $this->currPos; |
4736 | // start seq_8 |
4737 | $p10 = $this->currPos; |
4738 | if (($this->input[$this->currPos] ?? null) === "{") { |
4739 | $this->currPos++; |
4740 | $r24 = "{"; |
4741 | } else { |
4742 | if (!$silence) {$this->fail(29);} |
4743 | $r24 = self::$FAILED; |
4744 | $r23 = self::$FAILED; |
4745 | goto seq_8; |
4746 | } |
4747 | $p13 = $this->currPos; |
4748 | // start seq_9 |
4749 | $p21 = $this->currPos; |
4750 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4751 | $r26 = "{{"; |
4752 | $this->currPos += 2; |
4753 | } else { |
4754 | $r26 = self::$FAILED; |
4755 | $r25 = self::$FAILED; |
4756 | goto seq_9; |
4757 | } |
4758 | $p27 = $this->currPos; |
4759 | if (($this->input[$this->currPos] ?? null) === "{") { |
4760 | $this->currPos++; |
4761 | $r28 = "{"; |
4762 | } else { |
4763 | $r28 = self::$FAILED; |
4764 | } |
4765 | if ($r28 === self::$FAILED) { |
4766 | $r28 = false; |
4767 | } else { |
4768 | $r28 = self::$FAILED; |
4769 | $this->currPos = $p27; |
4770 | $this->currPos = $p21; |
4771 | $r25 = self::$FAILED; |
4772 | goto seq_9; |
4773 | } |
4774 | // free $p27 |
4775 | $r25 = true; |
4776 | seq_9: |
4777 | if ($r25!==self::$FAILED) { |
4778 | $r25 = false; |
4779 | $this->currPos = $p13; |
4780 | } else { |
4781 | $this->currPos = $p10; |
4782 | $r23 = self::$FAILED; |
4783 | goto seq_8; |
4784 | } |
4785 | // free $p21 |
4786 | // free $p13 |
4787 | $r23 = true; |
4788 | seq_8: |
4789 | if ($r23===self::$FAILED) { |
4790 | $r23 = null; |
4791 | } |
4792 | // free $p10 |
4793 | // a <- $r23 |
4794 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
4795 | // free $p8 |
4796 | $r29 = $this->parsetemplate($silence, $boolParams, $param_th); |
4797 | // b <- $r29 |
4798 | if ($r29===self::$FAILED) { |
4799 | $this->currPos = $p6; |
4800 | $r1 = self::$FAILED; |
4801 | goto seq_7; |
4802 | } |
4803 | $r1 = true; |
4804 | seq_7: |
4805 | if ($r1!==self::$FAILED) { |
4806 | $this->savedPos = $p4; |
4807 | $r1 = $this->a52($r23, $r29); |
4808 | goto choice_1; |
4809 | } |
4810 | // free $p6 |
4811 | $r1 = $this->parsebroken_template($silence, $param_preproc); |
4812 | choice_1: |
4813 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4814 | $this->currPos, |
4815 | $r1, |
4816 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4817 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4818 | ); |
4819 | return $r1; |
4820 | } |
4821 | private function parseraw_htmlentity($silence) { |
4822 | $key = 480; |
4823 | $bucket = $this->currPos; |
4824 | $cached = $this->cache[$bucket][$key] ?? null; |
4825 | if ($cached) { |
4826 | $this->currPos = $cached->nextPos; |
4827 | |
4828 | return $cached->result; |
4829 | } |
4830 | |
4831 | $p2 = $this->currPos; |
4832 | $p4 = $this->currPos; |
4833 | // start seq_1 |
4834 | $p5 = $this->currPos; |
4835 | if (($this->input[$this->currPos] ?? null) === "&") { |
4836 | $this->currPos++; |
4837 | $r6 = "&"; |
4838 | } else { |
4839 | if (!$silence) {$this->fail(4);} |
4840 | $r6 = self::$FAILED; |
4841 | $r3 = self::$FAILED; |
4842 | goto seq_1; |
4843 | } |
4844 | $r7 = self::$FAILED; |
4845 | for (;;) { |
4846 | $r8 = self::charAt($this->input, $this->currPos); |
4847 | if (preg_match("/^[#0-9a-zA-Z\\x{5e8}\\x{5dc}\\x{5de}\\x{631}\\x{644}\\x{645}]/u", $r8)) { |
4848 | $this->currPos += strlen($r8); |
4849 | $r7 = true; |
4850 | } else { |
4851 | $r8 = self::$FAILED; |
4852 | if (!$silence) {$this->fail(30);} |
4853 | break; |
4854 | } |
4855 | } |
4856 | if ($r7===self::$FAILED) { |
4857 | $this->currPos = $p5; |
4858 | $r3 = self::$FAILED; |
4859 | goto seq_1; |
4860 | } |
4861 | // free $r8 |
4862 | if (($this->input[$this->currPos] ?? null) === ";") { |
4863 | $this->currPos++; |
4864 | $r8 = ";"; |
4865 | } else { |
4866 | if (!$silence) {$this->fail(26);} |
4867 | $r8 = self::$FAILED; |
4868 | $this->currPos = $p5; |
4869 | $r3 = self::$FAILED; |
4870 | goto seq_1; |
4871 | } |
4872 | $r3 = true; |
4873 | seq_1: |
4874 | // m <- $r3 |
4875 | if ($r3!==self::$FAILED) { |
4876 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
4877 | } else { |
4878 | $r3 = self::$FAILED; |
4879 | } |
4880 | // free $p5 |
4881 | // free $p4 |
4882 | $r1 = $r3; |
4883 | if ($r1!==self::$FAILED) { |
4884 | $this->savedPos = $p2; |
4885 | $r1 = $this->a53($r3); |
4886 | } |
4887 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4888 | $this->currPos, |
4889 | $r1, |
4890 | self::$UNDEFINED, |
4891 | self::$UNDEFINED |
4892 | ); |
4893 | return $r1; |
4894 | } |
4895 | private function parseoptionalSpaceToken($silence) { |
4896 | $key = 528; |
4897 | $bucket = $this->currPos; |
4898 | $cached = $this->cache[$bucket][$key] ?? null; |
4899 | if ($cached) { |
4900 | $this->currPos = $cached->nextPos; |
4901 | |
4902 | return $cached->result; |
4903 | } |
4904 | |
4905 | $p2 = $this->currPos; |
4906 | $r3 = $this->parseoptional_spaces($silence); |
4907 | // s <- $r3 |
4908 | $r1 = $r3; |
4909 | if ($r1!==self::$FAILED) { |
4910 | $this->savedPos = $p2; |
4911 | $r1 = $this->a37($r3); |
4912 | } |
4913 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4914 | $this->currPos, |
4915 | $r1, |
4916 | self::$UNDEFINED, |
4917 | self::$UNDEFINED |
4918 | ); |
4919 | return $r1; |
4920 | } |
4921 | private function parsetable_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
4922 | $key = json_encode([428, $boolParams & 0x3fff, $param_preproc, $param_th]); |
4923 | $bucket = $this->currPos; |
4924 | $cached = $this->cache[$bucket][$key] ?? null; |
4925 | if ($cached) { |
4926 | $this->currPos = $cached->nextPos; |
4927 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4928 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4929 | return $cached->result; |
4930 | } |
4931 | $saved_preproc=$param_preproc; |
4932 | $saved_th=$param_th; |
4933 | $p2 = $this->currPos; |
4934 | // start seq_1 |
4935 | $p3 = $this->currPos; |
4936 | $p5 = $this->currPos; |
4937 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
4938 | $r4 = $this->input[$this->currPos++]; |
4939 | } else { |
4940 | $r4 = self::$FAILED; |
4941 | if (!$silence) {$this->fail(31);} |
4942 | $r4 = null; |
4943 | } |
4944 | // q <- $r4 |
4945 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
4946 | // free $p5 |
4947 | $r6 = []; |
4948 | for (;;) { |
4949 | // start choice_1 |
4950 | $p5 = $this->currPos; |
4951 | $r7 = self::$FAILED; |
4952 | for (;;) { |
4953 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|[", $this->currPos, 1) !== 0) { |
4954 | $r8 = self::consumeChar($this->input, $this->currPos); |
4955 | $r7 = true; |
4956 | } else { |
4957 | $r8 = self::$FAILED; |
4958 | if (!$silence) {$this->fail(32);} |
4959 | break; |
4960 | } |
4961 | } |
4962 | if ($r7!==self::$FAILED) { |
4963 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
4964 | goto choice_1; |
4965 | } else { |
4966 | $r7 = self::$FAILED; |
4967 | } |
4968 | // free $r8 |
4969 | // free $p5 |
4970 | $p5 = $this->currPos; |
4971 | // start seq_2 |
4972 | $p9 = $this->currPos; |
4973 | $p10 = $this->currPos; |
4974 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4975 | if ($r8 === self::$FAILED) { |
4976 | $r8 = false; |
4977 | } else { |
4978 | $r8 = self::$FAILED; |
4979 | $this->currPos = $p10; |
4980 | $r7 = self::$FAILED; |
4981 | goto seq_2; |
4982 | } |
4983 | // free $p10 |
4984 | // start choice_2 |
4985 | $p10 = $this->currPos; |
4986 | $r11 = $this->discardwikilink($silence, $boolParams, $param_th, $param_preproc); |
4987 | if ($r11!==self::$FAILED) { |
4988 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
4989 | goto choice_2; |
4990 | } else { |
4991 | $r11 = self::$FAILED; |
4992 | } |
4993 | // free $p10 |
4994 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
4995 | if ($r11!==self::$FAILED) { |
4996 | goto choice_2; |
4997 | } |
4998 | $p10 = $this->currPos; |
4999 | // start seq_3 |
5000 | $p12 = $this->currPos; |
5001 | $r13 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th); |
5002 | // x <- $r13 |
5003 | if ($r13===self::$FAILED) { |
5004 | $r11 = self::$FAILED; |
5005 | goto seq_3; |
5006 | } |
5007 | $r14 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
5008 | if ($r14===self::$FAILED) { |
5009 | $r14 = null; |
5010 | } |
5011 | // ill <- $r14 |
5012 | $r11 = true; |
5013 | seq_3: |
5014 | if ($r11!==self::$FAILED) { |
5015 | $this->savedPos = $p10; |
5016 | $r11 = $this->a54($r4, $r13, $r14); |
5017 | goto choice_2; |
5018 | } |
5019 | // free $p12 |
5020 | $p12 = $this->currPos; |
5021 | // start seq_4 |
5022 | $p15 = $this->currPos; |
5023 | $p16 = $this->currPos; |
5024 | // start choice_3 |
5025 | $r17 = $this->discardspace_or_newline(true); |
5026 | if ($r17!==self::$FAILED) { |
5027 | goto choice_3; |
5028 | } |
5029 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
5030 | $r17 = $this->input[$this->currPos++]; |
5031 | } else { |
5032 | $r17 = self::$FAILED; |
5033 | } |
5034 | choice_3: |
5035 | if ($r17 === self::$FAILED) { |
5036 | $r17 = false; |
5037 | } else { |
5038 | $r17 = self::$FAILED; |
5039 | $this->currPos = $p16; |
5040 | $r11 = self::$FAILED; |
5041 | goto seq_4; |
5042 | } |
5043 | // free $p16 |
5044 | if ($this->currPos < $this->inputLength) { |
5045 | $r18 = self::consumeChar($this->input, $this->currPos);; |
5046 | } else { |
5047 | $r18 = self::$FAILED; |
5048 | if (!$silence) {$this->fail(7);} |
5049 | $this->currPos = $p15; |
5050 | $r11 = self::$FAILED; |
5051 | goto seq_4; |
5052 | } |
5053 | $r11 = true; |
5054 | seq_4: |
5055 | if ($r11!==self::$FAILED) { |
5056 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
5057 | } else { |
5058 | $r11 = self::$FAILED; |
5059 | } |
5060 | // free $p15 |
5061 | // free $p12 |
5062 | choice_2: |
5063 | // t <- $r11 |
5064 | if ($r11===self::$FAILED) { |
5065 | $this->currPos = $p9; |
5066 | $r7 = self::$FAILED; |
5067 | goto seq_2; |
5068 | } |
5069 | $r7 = true; |
5070 | seq_2: |
5071 | if ($r7!==self::$FAILED) { |
5072 | $this->savedPos = $p5; |
5073 | $r7 = $this->a55($r4, $r11); |
5074 | } |
5075 | // free $p9 |
5076 | choice_1: |
5077 | if ($r7!==self::$FAILED) { |
5078 | $r6[] = $r7; |
5079 | } else { |
5080 | break; |
5081 | } |
5082 | } |
5083 | // r <- $r6 |
5084 | // free $r7 |
5085 | $this->savedPos = $this->currPos; |
5086 | $r7 = $this->a56($r4, $r6); |
5087 | if ($r7) { |
5088 | $r7 = false; |
5089 | } else { |
5090 | $r7 = self::$FAILED; |
5091 | $this->currPos = $p3; |
5092 | $r1 = self::$FAILED; |
5093 | goto seq_1; |
5094 | } |
5095 | $r1 = true; |
5096 | seq_1: |
5097 | if ($r1!==self::$FAILED) { |
5098 | $this->savedPos = $p2; |
5099 | $r1 = $this->a57($r4, $r6); |
5100 | } |
5101 | // free $p3 |
5102 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5103 | $this->currPos, |
5104 | $r1, |
5105 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5106 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5107 | ); |
5108 | return $r1; |
5109 | } |
5110 | private function parsetable_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5111 | $key = json_encode([432, $boolParams & 0x3fff, $param_preproc, $param_th]); |
5112 | $bucket = $this->currPos; |
5113 | $cached = $this->cache[$bucket][$key] ?? null; |
5114 | if ($cached) { |
5115 | $this->currPos = $cached->nextPos; |
5116 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5117 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5118 | return $cached->result; |
5119 | } |
5120 | $saved_preproc=$param_preproc; |
5121 | $saved_th=$param_th; |
5122 | // start choice_1 |
5123 | $p2 = $this->currPos; |
5124 | // start seq_1 |
5125 | $p3 = $this->currPos; |
5126 | $p5 = $this->currPos; |
5127 | // start seq_2 |
5128 | $p6 = $this->currPos; |
5129 | for (;;) { |
5130 | $r8 = $this->discardspace($silence); |
5131 | if ($r8===self::$FAILED) { |
5132 | break; |
5133 | } |
5134 | } |
5135 | // free $r8 |
5136 | $r7 = true; |
5137 | if ($r7===self::$FAILED) { |
5138 | $r4 = self::$FAILED; |
5139 | goto seq_2; |
5140 | } |
5141 | // free $r7 |
5142 | if (($this->input[$this->currPos] ?? null) === "'") { |
5143 | $this->currPos++; |
5144 | $r7 = "'"; |
5145 | } else { |
5146 | if (!$silence) {$this->fail(33);} |
5147 | $r7 = self::$FAILED; |
5148 | $this->currPos = $p6; |
5149 | $r4 = self::$FAILED; |
5150 | goto seq_2; |
5151 | } |
5152 | $r4 = true; |
5153 | seq_2: |
5154 | // s <- $r4 |
5155 | if ($r4!==self::$FAILED) { |
5156 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5157 | } else { |
5158 | $r4 = self::$FAILED; |
5159 | $r1 = self::$FAILED; |
5160 | goto seq_1; |
5161 | } |
5162 | // free $p6 |
5163 | // free $p5 |
5164 | $r8 = $this->parsetable_attribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5165 | if ($r8===self::$FAILED) { |
5166 | $r8 = null; |
5167 | } |
5168 | // t <- $r8 |
5169 | $p5 = $this->currPos; |
5170 | // start choice_2 |
5171 | if (($this->input[$this->currPos] ?? null) === "'") { |
5172 | $this->currPos++; |
5173 | $r9 = "'"; |
5174 | goto choice_2; |
5175 | } else { |
5176 | if (!$silence) {$this->fail(33);} |
5177 | $r9 = self::$FAILED; |
5178 | } |
5179 | $p6 = $this->currPos; |
5180 | // start choice_3 |
5181 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5182 | $r9 = "!!"; |
5183 | $this->currPos += 2; |
5184 | goto choice_3; |
5185 | } else { |
5186 | $r9 = self::$FAILED; |
5187 | } |
5188 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5189 | $r9 = $this->input[$this->currPos++]; |
5190 | } else { |
5191 | $r9 = self::$FAILED; |
5192 | } |
5193 | choice_3: |
5194 | if ($r9!==self::$FAILED) { |
5195 | $r9 = false; |
5196 | $this->currPos = $p6; |
5197 | } |
5198 | // free $p6 |
5199 | choice_2: |
5200 | // q <- $r9 |
5201 | if ($r9!==self::$FAILED) { |
5202 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5203 | } else { |
5204 | $r9 = self::$FAILED; |
5205 | $this->currPos = $p3; |
5206 | $r1 = self::$FAILED; |
5207 | goto seq_1; |
5208 | } |
5209 | // free $p5 |
5210 | $r1 = true; |
5211 | seq_1: |
5212 | if ($r1!==self::$FAILED) { |
5213 | $this->savedPos = $p2; |
5214 | $r1 = $this->a58($r4, $r8, $r9); |
5215 | goto choice_1; |
5216 | } |
5217 | // free $p3 |
5218 | $p3 = $this->currPos; |
5219 | // start seq_3 |
5220 | $p5 = $this->currPos; |
5221 | $p6 = $this->currPos; |
5222 | // start seq_4 |
5223 | $p11 = $this->currPos; |
5224 | for (;;) { |
5225 | $r13 = $this->discardspace($silence); |
5226 | if ($r13===self::$FAILED) { |
5227 | break; |
5228 | } |
5229 | } |
5230 | // free $r13 |
5231 | $r12 = true; |
5232 | if ($r12===self::$FAILED) { |
5233 | $r10 = self::$FAILED; |
5234 | goto seq_4; |
5235 | } |
5236 | // free $r12 |
5237 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5238 | $this->currPos++; |
5239 | $r12 = "\""; |
5240 | } else { |
5241 | if (!$silence) {$this->fail(34);} |
5242 | $r12 = self::$FAILED; |
5243 | $this->currPos = $p11; |
5244 | $r10 = self::$FAILED; |
5245 | goto seq_4; |
5246 | } |
5247 | $r10 = true; |
5248 | seq_4: |
5249 | // s <- $r10 |
5250 | if ($r10!==self::$FAILED) { |
5251 | $r10 = substr($this->input, $p6, $this->currPos - $p6); |
5252 | } else { |
5253 | $r10 = self::$FAILED; |
5254 | $r1 = self::$FAILED; |
5255 | goto seq_3; |
5256 | } |
5257 | // free $p11 |
5258 | // free $p6 |
5259 | $r13 = $this->parsetable_attribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5260 | if ($r13===self::$FAILED) { |
5261 | $r13 = null; |
5262 | } |
5263 | // t <- $r13 |
5264 | $p6 = $this->currPos; |
5265 | // start choice_4 |
5266 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5267 | $this->currPos++; |
5268 | $r14 = "\""; |
5269 | goto choice_4; |
5270 | } else { |
5271 | if (!$silence) {$this->fail(34);} |
5272 | $r14 = self::$FAILED; |
5273 | } |
5274 | $p11 = $this->currPos; |
5275 | // start choice_5 |
5276 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5277 | $r14 = "!!"; |
5278 | $this->currPos += 2; |
5279 | goto choice_5; |
5280 | } else { |
5281 | $r14 = self::$FAILED; |
5282 | } |
5283 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5284 | $r14 = $this->input[$this->currPos++]; |
5285 | } else { |
5286 | $r14 = self::$FAILED; |
5287 | } |
5288 | choice_5: |
5289 | if ($r14!==self::$FAILED) { |
5290 | $r14 = false; |
5291 | $this->currPos = $p11; |
5292 | } |
5293 | // free $p11 |
5294 | choice_4: |
5295 | // q <- $r14 |
5296 | if ($r14!==self::$FAILED) { |
5297 | $r14 = substr($this->input, $p6, $this->currPos - $p6); |
5298 | } else { |
5299 | $r14 = self::$FAILED; |
5300 | $this->currPos = $p5; |
5301 | $r1 = self::$FAILED; |
5302 | goto seq_3; |
5303 | } |
5304 | // free $p6 |
5305 | $r1 = true; |
5306 | seq_3: |
5307 | if ($r1!==self::$FAILED) { |
5308 | $this->savedPos = $p3; |
5309 | $r1 = $this->a58($r10, $r13, $r14); |
5310 | goto choice_1; |
5311 | } |
5312 | // free $p5 |
5313 | $p5 = $this->currPos; |
5314 | // start seq_5 |
5315 | $p6 = $this->currPos; |
5316 | $p11 = $this->currPos; |
5317 | for (;;) { |
5318 | $r16 = $this->discardspace($silence); |
5319 | if ($r16===self::$FAILED) { |
5320 | break; |
5321 | } |
5322 | } |
5323 | // free $r16 |
5324 | $r15 = true; |
5325 | // s <- $r15 |
5326 | if ($r15!==self::$FAILED) { |
5327 | $r15 = substr($this->input, $p11, $this->currPos - $p11); |
5328 | } else { |
5329 | $r15 = self::$FAILED; |
5330 | $r1 = self::$FAILED; |
5331 | goto seq_5; |
5332 | } |
5333 | // free $p11 |
5334 | $r16 = $this->parsetable_attribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
5335 | // t <- $r16 |
5336 | if ($r16===self::$FAILED) { |
5337 | $this->currPos = $p6; |
5338 | $r1 = self::$FAILED; |
5339 | goto seq_5; |
5340 | } |
5341 | $p11 = $this->currPos; |
5342 | // start choice_6 |
5343 | $r17 = $this->discardspace_or_newline(true); |
5344 | if ($r17!==self::$FAILED) { |
5345 | goto choice_6; |
5346 | } |
5347 | $r17 = $this->discardeof(true); |
5348 | if ($r17!==self::$FAILED) { |
5349 | goto choice_6; |
5350 | } |
5351 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5352 | $r17 = "!!"; |
5353 | $this->currPos += 2; |
5354 | goto choice_6; |
5355 | } else { |
5356 | $r17 = self::$FAILED; |
5357 | } |
5358 | if (($this->input[$this->currPos] ?? null) === "|") { |
5359 | $this->currPos++; |
5360 | $r17 = "|"; |
5361 | } else { |
5362 | $r17 = self::$FAILED; |
5363 | } |
5364 | choice_6: |
5365 | if ($r17!==self::$FAILED) { |
5366 | $r17 = false; |
5367 | $this->currPos = $p11; |
5368 | } else { |
5369 | $this->currPos = $p6; |
5370 | $r1 = self::$FAILED; |
5371 | goto seq_5; |
5372 | } |
5373 | // free $p11 |
5374 | $r1 = true; |
5375 | seq_5: |
5376 | if ($r1!==self::$FAILED) { |
5377 | $this->savedPos = $p5; |
5378 | $r1 = $this->a59($r15, $r16); |
5379 | } |
5380 | // free $p6 |
5381 | choice_1: |
5382 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5383 | $this->currPos, |
5384 | $r1, |
5385 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5386 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5387 | ); |
5388 | return $r1; |
5389 | } |
5390 | private function discardspace_or_newline_or_solidus($silence) { |
5391 | $key = 415; |
5392 | $bucket = $this->currPos; |
5393 | $cached = $this->cache[$bucket][$key] ?? null; |
5394 | if ($cached) { |
5395 | $this->currPos = $cached->nextPos; |
5396 | |
5397 | return $cached->result; |
5398 | } |
5399 | |
5400 | // start choice_1 |
5401 | $r1 = $this->discardspace_or_newline($silence); |
5402 | if ($r1!==self::$FAILED) { |
5403 | goto choice_1; |
5404 | } |
5405 | $p2 = $this->currPos; |
5406 | // start seq_1 |
5407 | $p3 = $this->currPos; |
5408 | // s <- $r4 |
5409 | if (($this->input[$this->currPos] ?? null) === "/") { |
5410 | $this->currPos++; |
5411 | $r4 = "/"; |
5412 | } else { |
5413 | if (!$silence) {$this->fail(35);} |
5414 | $r4 = self::$FAILED; |
5415 | $r1 = self::$FAILED; |
5416 | goto seq_1; |
5417 | } |
5418 | $p5 = $this->currPos; |
5419 | if (($this->input[$this->currPos] ?? null) === ">") { |
5420 | $this->currPos++; |
5421 | $r6 = ">"; |
5422 | } else { |
5423 | $r6 = self::$FAILED; |
5424 | } |
5425 | if ($r6 === self::$FAILED) { |
5426 | $r6 = false; |
5427 | } else { |
5428 | $r6 = self::$FAILED; |
5429 | $this->currPos = $p5; |
5430 | $this->currPos = $p3; |
5431 | $r1 = self::$FAILED; |
5432 | goto seq_1; |
5433 | } |
5434 | // free $p5 |
5435 | $r1 = true; |
5436 | seq_1: |
5437 | if ($r1!==self::$FAILED) { |
5438 | $this->savedPos = $p2; |
5439 | $r1 = $this->a42($r4); |
5440 | } |
5441 | // free $p3 |
5442 | choice_1: |
5443 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5444 | $this->currPos, |
5445 | $r1, |
5446 | self::$UNDEFINED, |
5447 | self::$UNDEFINED |
5448 | ); |
5449 | return $r1; |
5450 | } |
5451 | private function parsegeneric_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
5452 | $key = json_encode([424, $boolParams & 0x3fff, $param_preproc, $param_th]); |
5453 | $bucket = $this->currPos; |
5454 | $cached = $this->cache[$bucket][$key] ?? null; |
5455 | if ($cached) { |
5456 | $this->currPos = $cached->nextPos; |
5457 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5458 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5459 | return $cached->result; |
5460 | } |
5461 | $saved_preproc=$param_preproc; |
5462 | $saved_th=$param_th; |
5463 | $p2 = $this->currPos; |
5464 | // start seq_1 |
5465 | $p3 = $this->currPos; |
5466 | $p5 = $this->currPos; |
5467 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
5468 | $r4 = $this->input[$this->currPos++]; |
5469 | } else { |
5470 | $r4 = self::$FAILED; |
5471 | if (!$silence) {$this->fail(31);} |
5472 | $r4 = null; |
5473 | } |
5474 | // q <- $r4 |
5475 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5476 | // free $p5 |
5477 | $r6 = []; |
5478 | for (;;) { |
5479 | // start choice_1 |
5480 | $p5 = $this->currPos; |
5481 | $r7 = self::$FAILED; |
5482 | for (;;) { |
5483 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|", $this->currPos, 1) !== 0) { |
5484 | $r8 = self::consumeChar($this->input, $this->currPos); |
5485 | $r7 = true; |
5486 | } else { |
5487 | $r8 = self::$FAILED; |
5488 | if (!$silence) {$this->fail(36);} |
5489 | break; |
5490 | } |
5491 | } |
5492 | if ($r7!==self::$FAILED) { |
5493 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
5494 | goto choice_1; |
5495 | } else { |
5496 | $r7 = self::$FAILED; |
5497 | } |
5498 | // free $r8 |
5499 | // free $p5 |
5500 | $p5 = $this->currPos; |
5501 | // start seq_2 |
5502 | $p9 = $this->currPos; |
5503 | $p10 = $this->currPos; |
5504 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5505 | if ($r8 === self::$FAILED) { |
5506 | $r8 = false; |
5507 | } else { |
5508 | $r8 = self::$FAILED; |
5509 | $this->currPos = $p10; |
5510 | $r7 = self::$FAILED; |
5511 | goto seq_2; |
5512 | } |
5513 | // free $p10 |
5514 | // start choice_2 |
5515 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5516 | if ($r11!==self::$FAILED) { |
5517 | goto choice_2; |
5518 | } |
5519 | $r11 = $this->parseless_than($silence, $boolParams); |
5520 | if ($r11!==self::$FAILED) { |
5521 | goto choice_2; |
5522 | } |
5523 | $p10 = $this->currPos; |
5524 | // start seq_3 |
5525 | $p12 = $this->currPos; |
5526 | $p13 = $this->currPos; |
5527 | // start choice_3 |
5528 | $r14 = $this->discardspace_or_newline(true); |
5529 | if ($r14!==self::$FAILED) { |
5530 | goto choice_3; |
5531 | } |
5532 | if (strspn($this->input, "\x00/=><", $this->currPos, 1) !== 0) { |
5533 | $r14 = $this->input[$this->currPos++]; |
5534 | } else { |
5535 | $r14 = self::$FAILED; |
5536 | } |
5537 | choice_3: |
5538 | if ($r14 === self::$FAILED) { |
5539 | $r14 = false; |
5540 | } else { |
5541 | $r14 = self::$FAILED; |
5542 | $this->currPos = $p13; |
5543 | $r11 = self::$FAILED; |
5544 | goto seq_3; |
5545 | } |
5546 | // free $p13 |
5547 | if ($this->currPos < $this->inputLength) { |
5548 | $r15 = self::consumeChar($this->input, $this->currPos);; |
5549 | } else { |
5550 | $r15 = self::$FAILED; |
5551 | if (!$silence) {$this->fail(7);} |
5552 | $this->currPos = $p12; |
5553 | $r11 = self::$FAILED; |
5554 | goto seq_3; |
5555 | } |
5556 | $r11 = true; |
5557 | seq_3: |
5558 | if ($r11!==self::$FAILED) { |
5559 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
5560 | } else { |
5561 | $r11 = self::$FAILED; |
5562 | } |
5563 | // free $p12 |
5564 | // free $p10 |
5565 | choice_2: |
5566 | // t <- $r11 |
5567 | if ($r11===self::$FAILED) { |
5568 | $this->currPos = $p9; |
5569 | $r7 = self::$FAILED; |
5570 | goto seq_2; |
5571 | } |
5572 | $r7 = true; |
5573 | seq_2: |
5574 | if ($r7!==self::$FAILED) { |
5575 | $this->savedPos = $p5; |
5576 | $r7 = $this->a55($r4, $r11); |
5577 | } |
5578 | // free $p9 |
5579 | choice_1: |
5580 | if ($r7!==self::$FAILED) { |
5581 | $r6[] = $r7; |
5582 | } else { |
5583 | break; |
5584 | } |
5585 | } |
5586 | // r <- $r6 |
5587 | // free $r7 |
5588 | $this->savedPos = $this->currPos; |
5589 | $r7 = $this->a56($r4, $r6); |
5590 | if ($r7) { |
5591 | $r7 = false; |
5592 | } else { |
5593 | $r7 = self::$FAILED; |
5594 | $this->currPos = $p3; |
5595 | $r1 = self::$FAILED; |
5596 | goto seq_1; |
5597 | } |
5598 | $r1 = true; |
5599 | seq_1: |
5600 | if ($r1!==self::$FAILED) { |
5601 | $this->savedPos = $p2; |
5602 | $r1 = $this->a57($r4, $r6); |
5603 | } |
5604 | // free $p3 |
5605 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5606 | $this->currPos, |
5607 | $r1, |
5608 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5609 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5610 | ); |
5611 | return $r1; |
5612 | } |
5613 | private function discardspace_or_newline($silence) { |
5614 | $key = 531; |
5615 | $bucket = $this->currPos; |
5616 | $cached = $this->cache[$bucket][$key] ?? null; |
5617 | if ($cached) { |
5618 | $this->currPos = $cached->nextPos; |
5619 | |
5620 | return $cached->result; |
5621 | } |
5622 | |
5623 | if (strspn($this->input, " \x09\x0a\x0d\x0c", $this->currPos, 1) !== 0) { |
5624 | $r1 = $this->input[$this->currPos++]; |
5625 | } else { |
5626 | $r1 = self::$FAILED; |
5627 | if (!$silence) {$this->fail(37);} |
5628 | } |
5629 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5630 | $this->currPos, |
5631 | $r1, |
5632 | self::$UNDEFINED, |
5633 | self::$UNDEFINED |
5634 | ); |
5635 | return $r1; |
5636 | } |
5637 | private function parsegeneric_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5638 | $key = json_encode([430, $boolParams & 0x3fff, $param_preproc, $param_th]); |
5639 | $bucket = $this->currPos; |
5640 | $cached = $this->cache[$bucket][$key] ?? null; |
5641 | if ($cached) { |
5642 | $this->currPos = $cached->nextPos; |
5643 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5644 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5645 | return $cached->result; |
5646 | } |
5647 | $saved_preproc=$param_preproc; |
5648 | $saved_th=$param_th; |
5649 | // start choice_1 |
5650 | $p2 = $this->currPos; |
5651 | // start seq_1 |
5652 | $p3 = $this->currPos; |
5653 | $p5 = $this->currPos; |
5654 | // start seq_2 |
5655 | $p6 = $this->currPos; |
5656 | for (;;) { |
5657 | $r8 = $this->discardspace_or_newline($silence); |
5658 | if ($r8===self::$FAILED) { |
5659 | break; |
5660 | } |
5661 | } |
5662 | // free $r8 |
5663 | $r7 = true; |
5664 | if ($r7===self::$FAILED) { |
5665 | $r4 = self::$FAILED; |
5666 | goto seq_2; |
5667 | } |
5668 | // free $r7 |
5669 | if (($this->input[$this->currPos] ?? null) === "'") { |
5670 | $this->currPos++; |
5671 | $r7 = "'"; |
5672 | } else { |
5673 | if (!$silence) {$this->fail(33);} |
5674 | $r7 = self::$FAILED; |
5675 | $this->currPos = $p6; |
5676 | $r4 = self::$FAILED; |
5677 | goto seq_2; |
5678 | } |
5679 | $r4 = true; |
5680 | seq_2: |
5681 | // s <- $r4 |
5682 | if ($r4!==self::$FAILED) { |
5683 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5684 | } else { |
5685 | $r4 = self::$FAILED; |
5686 | $r1 = self::$FAILED; |
5687 | goto seq_1; |
5688 | } |
5689 | // free $p6 |
5690 | // free $p5 |
5691 | $r8 = $this->parseattribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5692 | if ($r8===self::$FAILED) { |
5693 | $r8 = null; |
5694 | } |
5695 | // t <- $r8 |
5696 | $p5 = $this->currPos; |
5697 | // start choice_2 |
5698 | if (($this->input[$this->currPos] ?? null) === "'") { |
5699 | $this->currPos++; |
5700 | $r9 = "'"; |
5701 | goto choice_2; |
5702 | } else { |
5703 | if (!$silence) {$this->fail(33);} |
5704 | $r9 = self::$FAILED; |
5705 | } |
5706 | $p6 = $this->currPos; |
5707 | // start seq_3 |
5708 | $p10 = $this->currPos; |
5709 | if (($this->input[$this->currPos] ?? null) === "/") { |
5710 | $this->currPos++; |
5711 | $r11 = "/"; |
5712 | } else { |
5713 | $r11 = self::$FAILED; |
5714 | $r11 = null; |
5715 | } |
5716 | if (($this->input[$this->currPos] ?? null) === ">") { |
5717 | $this->currPos++; |
5718 | $r12 = ">"; |
5719 | } else { |
5720 | $r12 = self::$FAILED; |
5721 | $this->currPos = $p10; |
5722 | $r9 = self::$FAILED; |
5723 | goto seq_3; |
5724 | } |
5725 | $r9 = true; |
5726 | seq_3: |
5727 | if ($r9!==self::$FAILED) { |
5728 | $r9 = false; |
5729 | $this->currPos = $p6; |
5730 | } |
5731 | // free $p10 |
5732 | // free $p6 |
5733 | choice_2: |
5734 | // q <- $r9 |
5735 | if ($r9!==self::$FAILED) { |
5736 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5737 | } else { |
5738 | $r9 = self::$FAILED; |
5739 | $this->currPos = $p3; |
5740 | $r1 = self::$FAILED; |
5741 | goto seq_1; |
5742 | } |
5743 | // free $p5 |
5744 | $r1 = true; |
5745 | seq_1: |
5746 | if ($r1!==self::$FAILED) { |
5747 | $this->savedPos = $p2; |
5748 | $r1 = $this->a58($r4, $r8, $r9); |
5749 | goto choice_1; |
5750 | } |
5751 | // free $p3 |
5752 | $p3 = $this->currPos; |
5753 | // start seq_4 |
5754 | $p5 = $this->currPos; |
5755 | $p6 = $this->currPos; |
5756 | // start seq_5 |
5757 | $p10 = $this->currPos; |
5758 | for (;;) { |
5759 | $r15 = $this->discardspace_or_newline($silence); |
5760 | if ($r15===self::$FAILED) { |
5761 | break; |
5762 | } |
5763 | } |
5764 | // free $r15 |
5765 | $r14 = true; |
5766 | if ($r14===self::$FAILED) { |
5767 | $r13 = self::$FAILED; |
5768 | goto seq_5; |
5769 | } |
5770 | // free $r14 |
5771 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5772 | $this->currPos++; |
5773 | $r14 = "\""; |
5774 | } else { |
5775 | if (!$silence) {$this->fail(34);} |
5776 | $r14 = self::$FAILED; |
5777 | $this->currPos = $p10; |
5778 | $r13 = self::$FAILED; |
5779 | goto seq_5; |
5780 | } |
5781 | $r13 = true; |
5782 | seq_5: |
5783 | // s <- $r13 |
5784 | if ($r13!==self::$FAILED) { |
5785 | $r13 = substr($this->input, $p6, $this->currPos - $p6); |
5786 | } else { |
5787 | $r13 = self::$FAILED; |
5788 | $r1 = self::$FAILED; |
5789 | goto seq_4; |
5790 | } |
5791 | // free $p10 |
5792 | // free $p6 |
5793 | $r15 = $this->parseattribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5794 | if ($r15===self::$FAILED) { |
5795 | $r15 = null; |
5796 | } |
5797 | // t <- $r15 |
5798 | $p6 = $this->currPos; |
5799 | // start choice_3 |
5800 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5801 | $this->currPos++; |
5802 | $r16 = "\""; |
5803 | goto choice_3; |
5804 | } else { |
5805 | if (!$silence) {$this->fail(34);} |
5806 | $r16 = self::$FAILED; |
5807 | } |
5808 | $p10 = $this->currPos; |
5809 | // start seq_6 |
5810 | $p17 = $this->currPos; |
5811 | if (($this->input[$this->currPos] ?? null) === "/") { |
5812 | $this->currPos++; |
5813 | $r18 = "/"; |
5814 | } else { |
5815 | $r18 = self::$FAILED; |
5816 | $r18 = null; |
5817 | } |
5818 | if (($this->input[$this->currPos] ?? null) === ">") { |
5819 | $this->currPos++; |
5820 | $r19 = ">"; |
5821 | } else { |
5822 | $r19 = self::$FAILED; |
5823 | $this->currPos = $p17; |
5824 | $r16 = self::$FAILED; |
5825 | goto seq_6; |
5826 | } |
5827 | $r16 = true; |
5828 | seq_6: |
5829 | if ($r16!==self::$FAILED) { |
5830 | $r16 = false; |
5831 | $this->currPos = $p10; |
5832 | } |
5833 | // free $p17 |
5834 | // free $p10 |
5835 | choice_3: |
5836 | // q <- $r16 |
5837 | if ($r16!==self::$FAILED) { |
5838 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
5839 | } else { |
5840 | $r16 = self::$FAILED; |
5841 | $this->currPos = $p5; |
5842 | $r1 = self::$FAILED; |
5843 | goto seq_4; |
5844 | } |
5845 | // free $p6 |
5846 | $r1 = true; |
5847 | seq_4: |
5848 | if ($r1!==self::$FAILED) { |
5849 | $this->savedPos = $p3; |
5850 | $r1 = $this->a58($r13, $r15, $r16); |
5851 | goto choice_1; |
5852 | } |
5853 | // free $p5 |
5854 | $p5 = $this->currPos; |
5855 | // start seq_7 |
5856 | $p6 = $this->currPos; |
5857 | $p10 = $this->currPos; |
5858 | for (;;) { |
5859 | $r21 = $this->discardspace_or_newline($silence); |
5860 | if ($r21===self::$FAILED) { |
5861 | break; |
5862 | } |
5863 | } |
5864 | // free $r21 |
5865 | $r20 = true; |
5866 | // s <- $r20 |
5867 | if ($r20!==self::$FAILED) { |
5868 | $r20 = substr($this->input, $p10, $this->currPos - $p10); |
5869 | } else { |
5870 | $r20 = self::$FAILED; |
5871 | $r1 = self::$FAILED; |
5872 | goto seq_7; |
5873 | } |
5874 | // free $p10 |
5875 | $r21 = $this->parseattribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
5876 | // t <- $r21 |
5877 | if ($r21===self::$FAILED) { |
5878 | $this->currPos = $p6; |
5879 | $r1 = self::$FAILED; |
5880 | goto seq_7; |
5881 | } |
5882 | $p10 = $this->currPos; |
5883 | // start choice_4 |
5884 | $r22 = $this->discardspace_or_newline(true); |
5885 | if ($r22!==self::$FAILED) { |
5886 | goto choice_4; |
5887 | } |
5888 | $r22 = $this->discardeof(true); |
5889 | if ($r22!==self::$FAILED) { |
5890 | goto choice_4; |
5891 | } |
5892 | // start seq_8 |
5893 | $p17 = $this->currPos; |
5894 | if (($this->input[$this->currPos] ?? null) === "/") { |
5895 | $this->currPos++; |
5896 | $r23 = "/"; |
5897 | } else { |
5898 | $r23 = self::$FAILED; |
5899 | $r23 = null; |
5900 | } |
5901 | if (($this->input[$this->currPos] ?? null) === ">") { |
5902 | $this->currPos++; |
5903 | $r24 = ">"; |
5904 | } else { |
5905 | $r24 = self::$FAILED; |
5906 | $this->currPos = $p17; |
5907 | $r22 = self::$FAILED; |
5908 | goto seq_8; |
5909 | } |
5910 | $r22 = true; |
5911 | seq_8: |
5912 | // free $p17 |
5913 | choice_4: |
5914 | if ($r22!==self::$FAILED) { |
5915 | $r22 = false; |
5916 | $this->currPos = $p10; |
5917 | } else { |
5918 | $this->currPos = $p6; |
5919 | $r1 = self::$FAILED; |
5920 | goto seq_7; |
5921 | } |
5922 | // free $p10 |
5923 | $r1 = true; |
5924 | seq_7: |
5925 | if ($r1!==self::$FAILED) { |
5926 | $this->savedPos = $p5; |
5927 | $r1 = $this->a59($r20, $r21); |
5928 | } |
5929 | // free $p6 |
5930 | choice_1: |
5931 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5932 | $this->currPos, |
5933 | $r1, |
5934 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5935 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5936 | ); |
5937 | return $r1; |
5938 | } |
5939 | private function parseextlink_nonipv6url_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
5940 | $key = json_encode([492, $boolParams & 0x3fff, $param_preproc, $param_th]); |
5941 | $bucket = $this->currPos; |
5942 | $cached = $this->cache[$bucket][$key] ?? null; |
5943 | if ($cached) { |
5944 | $this->currPos = $cached->nextPos; |
5945 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5946 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5947 | return $cached->result; |
5948 | } |
5949 | $saved_preproc=$param_preproc; |
5950 | $saved_th=$param_th; |
5951 | $p2 = $this->currPos; |
5952 | $r3 = []; |
5953 | for (;;) { |
5954 | // start choice_1 |
5955 | $p5 = $this->currPos; |
5956 | $r4 = self::$FAILED; |
5957 | for (;;) { |
5958 | $r6 = self::charAt($this->input, $this->currPos); |
5959 | if (preg_match("/^[^<\\[{\\x0a\\x0d|!\\]}\\-\\x09&=\"' \\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r6)) { |
5960 | $this->currPos += strlen($r6); |
5961 | $r4 = true; |
5962 | } else { |
5963 | $r6 = self::$FAILED; |
5964 | if (!$silence) {$this->fail(38);} |
5965 | break; |
5966 | } |
5967 | } |
5968 | if ($r4!==self::$FAILED) { |
5969 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5970 | goto choice_1; |
5971 | } else { |
5972 | $r4 = self::$FAILED; |
5973 | } |
5974 | // free $r6 |
5975 | // free $p5 |
5976 | $p5 = $this->currPos; |
5977 | // start seq_1 |
5978 | $p7 = $this->currPos; |
5979 | $p8 = $this->currPos; |
5980 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5981 | if ($r6 === self::$FAILED) { |
5982 | $r6 = false; |
5983 | } else { |
5984 | $r6 = self::$FAILED; |
5985 | $this->currPos = $p8; |
5986 | $r4 = self::$FAILED; |
5987 | goto seq_1; |
5988 | } |
5989 | // free $p8 |
5990 | // start choice_2 |
5991 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5992 | if ($r9!==self::$FAILED) { |
5993 | goto choice_2; |
5994 | } |
5995 | if (strspn($this->input, "&|{-!}=", $this->currPos, 1) !== 0) { |
5996 | $r9 = $this->input[$this->currPos++]; |
5997 | } else { |
5998 | $r9 = self::$FAILED; |
5999 | if (!$silence) {$this->fail(39);} |
6000 | } |
6001 | choice_2: |
6002 | // s <- $r9 |
6003 | if ($r9===self::$FAILED) { |
6004 | $this->currPos = $p7; |
6005 | $r4 = self::$FAILED; |
6006 | goto seq_1; |
6007 | } |
6008 | $r4 = true; |
6009 | seq_1: |
6010 | if ($r4!==self::$FAILED) { |
6011 | $this->savedPos = $p5; |
6012 | $r4 = $this->a42($r9); |
6013 | goto choice_1; |
6014 | } |
6015 | // free $p7 |
6016 | $p7 = $this->currPos; |
6017 | // start seq_2 |
6018 | $p8 = $this->currPos; |
6019 | $r10 = $this->input[$this->currPos] ?? ''; |
6020 | if ($r10 === "'") { |
6021 | $this->currPos++; |
6022 | } else { |
6023 | $r10 = self::$FAILED; |
6024 | if (!$silence) {$this->fail(40);} |
6025 | $r4 = self::$FAILED; |
6026 | goto seq_2; |
6027 | } |
6028 | $p11 = $this->currPos; |
6029 | $r12 = $this->input[$this->currPos] ?? ''; |
6030 | if ($r12 === "'") { |
6031 | $this->currPos++; |
6032 | } else { |
6033 | $r12 = self::$FAILED; |
6034 | } |
6035 | if ($r12 === self::$FAILED) { |
6036 | $r12 = false; |
6037 | } else { |
6038 | $r12 = self::$FAILED; |
6039 | $this->currPos = $p11; |
6040 | $this->currPos = $p8; |
6041 | $r4 = self::$FAILED; |
6042 | goto seq_2; |
6043 | } |
6044 | // free $p11 |
6045 | $r4 = true; |
6046 | seq_2: |
6047 | if ($r4!==self::$FAILED) { |
6048 | $r4 = substr($this->input, $p7, $this->currPos - $p7); |
6049 | } else { |
6050 | $r4 = self::$FAILED; |
6051 | } |
6052 | // free $p8 |
6053 | // free $p7 |
6054 | choice_1: |
6055 | if ($r4!==self::$FAILED) { |
6056 | $r3[] = $r4; |
6057 | } else { |
6058 | break; |
6059 | } |
6060 | } |
6061 | if (count($r3) === 0) { |
6062 | $r3 = self::$FAILED; |
6063 | } |
6064 | // r <- $r3 |
6065 | // free $r4 |
6066 | $r1 = $r3; |
6067 | if ($r1!==self::$FAILED) { |
6068 | $this->savedPos = $p2; |
6069 | $r1 = $this->a60($r3); |
6070 | } |
6071 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6072 | $this->currPos, |
6073 | $r1, |
6074 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6075 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6076 | ); |
6077 | return $r1; |
6078 | } |
6079 | private function parseurltext($silence, $boolParams, &$param_preproc, &$param_th) { |
6080 | $key = json_encode([478, $boolParams & 0x3fff, $param_preproc, $param_th]); |
6081 | $bucket = $this->currPos; |
6082 | $cached = $this->cache[$bucket][$key] ?? null; |
6083 | if ($cached) { |
6084 | $this->currPos = $cached->nextPos; |
6085 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6086 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6087 | return $cached->result; |
6088 | } |
6089 | $saved_preproc=$param_preproc; |
6090 | $saved_th=$param_th; |
6091 | $r1 = []; |
6092 | for (;;) { |
6093 | // start choice_1 |
6094 | $p3 = $this->currPos; |
6095 | // start seq_1 |
6096 | $p4 = $this->currPos; |
6097 | $this->savedPos = $this->currPos; |
6098 | $r5 = $this->a61(); |
6099 | if ($r5) { |
6100 | $r5 = false; |
6101 | } else { |
6102 | $r5 = self::$FAILED; |
6103 | $r2 = self::$FAILED; |
6104 | goto seq_1; |
6105 | } |
6106 | $r2 = true; |
6107 | seq_1: |
6108 | if ($r2!==self::$FAILED) { |
6109 | $this->savedPos = $p3; |
6110 | $r2 = $this->a62(); |
6111 | goto choice_1; |
6112 | } |
6113 | // free $p4 |
6114 | $p4 = $this->currPos; |
6115 | // start seq_2 |
6116 | $p6 = $this->currPos; |
6117 | $this->savedPos = $this->currPos; |
6118 | $r7 = $this->a63(); |
6119 | if ($r7) { |
6120 | $r7 = false; |
6121 | } else { |
6122 | $r7 = self::$FAILED; |
6123 | $r2 = self::$FAILED; |
6124 | goto seq_2; |
6125 | } |
6126 | $r8 = $this->parseautolink($silence, $boolParams, $param_preproc, $param_th); |
6127 | // al <- $r8 |
6128 | if ($r8===self::$FAILED) { |
6129 | $this->currPos = $p6; |
6130 | $r2 = self::$FAILED; |
6131 | goto seq_2; |
6132 | } |
6133 | $r2 = true; |
6134 | seq_2: |
6135 | if ($r2!==self::$FAILED) { |
6136 | $this->savedPos = $p4; |
6137 | $r2 = $this->a64($r8); |
6138 | goto choice_1; |
6139 | } |
6140 | // free $p6 |
6141 | $p6 = $this->currPos; |
6142 | // start seq_3 |
6143 | $p9 = $this->currPos; |
6144 | $p10 = $this->currPos; |
6145 | if (($this->input[$this->currPos] ?? null) === "&") { |
6146 | $this->currPos++; |
6147 | $r11 = "&"; |
6148 | $r11 = false; |
6149 | $this->currPos = $p10; |
6150 | } else { |
6151 | $r11 = self::$FAILED; |
6152 | $r2 = self::$FAILED; |
6153 | goto seq_3; |
6154 | } |
6155 | // free $p10 |
6156 | $r12 = $this->parsehtmlentity($silence); |
6157 | // he <- $r12 |
6158 | if ($r12===self::$FAILED) { |
6159 | $this->currPos = $p9; |
6160 | $r2 = self::$FAILED; |
6161 | goto seq_3; |
6162 | } |
6163 | $r2 = true; |
6164 | seq_3: |
6165 | if ($r2!==self::$FAILED) { |
6166 | $this->savedPos = $p6; |
6167 | $r2 = $this->a65($r12); |
6168 | goto choice_1; |
6169 | } |
6170 | // free $p9 |
6171 | $p9 = $this->currPos; |
6172 | // start seq_4 |
6173 | $p10 = $this->currPos; |
6174 | $p13 = $this->currPos; |
6175 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
6176 | $r14 = "__"; |
6177 | $this->currPos += 2; |
6178 | $r14 = false; |
6179 | $this->currPos = $p13; |
6180 | } else { |
6181 | $r14 = self::$FAILED; |
6182 | $r2 = self::$FAILED; |
6183 | goto seq_4; |
6184 | } |
6185 | // free $p13 |
6186 | $r15 = $this->parsebehavior_switch($silence); |
6187 | // bs <- $r15 |
6188 | if ($r15===self::$FAILED) { |
6189 | $this->currPos = $p10; |
6190 | $r2 = self::$FAILED; |
6191 | goto seq_4; |
6192 | } |
6193 | $r2 = true; |
6194 | seq_4: |
6195 | if ($r2!==self::$FAILED) { |
6196 | $this->savedPos = $p9; |
6197 | $r2 = $this->a66($r15); |
6198 | goto choice_1; |
6199 | } |
6200 | // free $p10 |
6201 | $r2 = $this->parsetext_char($silence); |
6202 | choice_1: |
6203 | if ($r2!==self::$FAILED) { |
6204 | $r1[] = $r2; |
6205 | } else { |
6206 | break; |
6207 | } |
6208 | } |
6209 | if (count($r1) === 0) { |
6210 | $r1 = self::$FAILED; |
6211 | } |
6212 | // free $r2 |
6213 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6214 | $this->currPos, |
6215 | $r1, |
6216 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6217 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6218 | ); |
6219 | return $r1; |
6220 | } |
6221 | private function parseinline_element($silence, $boolParams, &$param_preproc, &$param_th) { |
6222 | $key = json_encode([308, $boolParams & 0x3fff, $param_preproc, $param_th]); |
6223 | $bucket = $this->currPos; |
6224 | $cached = $this->cache[$bucket][$key] ?? null; |
6225 | if ($cached) { |
6226 | $this->currPos = $cached->nextPos; |
6227 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6228 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6229 | return $cached->result; |
6230 | } |
6231 | $saved_preproc=$param_preproc; |
6232 | $saved_th=$param_th; |
6233 | // start choice_1 |
6234 | $p2 = $this->currPos; |
6235 | // start seq_1 |
6236 | $p3 = $this->currPos; |
6237 | $p4 = $this->currPos; |
6238 | if (($this->input[$this->currPos] ?? null) === "<") { |
6239 | $this->currPos++; |
6240 | $r5 = "<"; |
6241 | $r5 = false; |
6242 | $this->currPos = $p4; |
6243 | } else { |
6244 | $r5 = self::$FAILED; |
6245 | $r1 = self::$FAILED; |
6246 | goto seq_1; |
6247 | } |
6248 | // free $p4 |
6249 | // start choice_2 |
6250 | $r6 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th); |
6251 | if ($r6!==self::$FAILED) { |
6252 | goto choice_2; |
6253 | } |
6254 | $r6 = $this->parsecomment($silence); |
6255 | choice_2: |
6256 | // r <- $r6 |
6257 | if ($r6===self::$FAILED) { |
6258 | $this->currPos = $p3; |
6259 | $r1 = self::$FAILED; |
6260 | goto seq_1; |
6261 | } |
6262 | $r1 = true; |
6263 | seq_1: |
6264 | if ($r1!==self::$FAILED) { |
6265 | $this->savedPos = $p2; |
6266 | $r1 = $this->a24($r6); |
6267 | goto choice_1; |
6268 | } |
6269 | // free $p3 |
6270 | $p3 = $this->currPos; |
6271 | // start seq_2 |
6272 | $p4 = $this->currPos; |
6273 | $p7 = $this->currPos; |
6274 | if (($this->input[$this->currPos] ?? null) === "{") { |
6275 | $this->currPos++; |
6276 | $r8 = "{"; |
6277 | $r8 = false; |
6278 | $this->currPos = $p7; |
6279 | } else { |
6280 | $r8 = self::$FAILED; |
6281 | $r1 = self::$FAILED; |
6282 | goto seq_2; |
6283 | } |
6284 | // free $p7 |
6285 | $r9 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
6286 | // r <- $r9 |
6287 | if ($r9===self::$FAILED) { |
6288 | $this->currPos = $p4; |
6289 | $r1 = self::$FAILED; |
6290 | goto seq_2; |
6291 | } |
6292 | $r1 = true; |
6293 | seq_2: |
6294 | if ($r1!==self::$FAILED) { |
6295 | $this->savedPos = $p3; |
6296 | $r1 = $this->a24($r9); |
6297 | goto choice_1; |
6298 | } |
6299 | // free $p4 |
6300 | $p4 = $this->currPos; |
6301 | // start seq_3 |
6302 | $p7 = $this->currPos; |
6303 | $p10 = $this->currPos; |
6304 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
6305 | $r11 = "-{"; |
6306 | $this->currPos += 2; |
6307 | $r11 = false; |
6308 | $this->currPos = $p10; |
6309 | } else { |
6310 | $r11 = self::$FAILED; |
6311 | $r1 = self::$FAILED; |
6312 | goto seq_3; |
6313 | } |
6314 | // free $p10 |
6315 | $r12 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
6316 | // r <- $r12 |
6317 | if ($r12===self::$FAILED) { |
6318 | $this->currPos = $p7; |
6319 | $r1 = self::$FAILED; |
6320 | goto seq_3; |
6321 | } |
6322 | $r1 = true; |
6323 | seq_3: |
6324 | if ($r1!==self::$FAILED) { |
6325 | $this->savedPos = $p4; |
6326 | $r1 = $this->a24($r12); |
6327 | goto choice_1; |
6328 | } |
6329 | // free $p7 |
6330 | $p7 = $this->currPos; |
6331 | $r1 = self::$FAILED; |
6332 | for (;;) { |
6333 | // start seq_4 |
6334 | $p10 = $this->currPos; |
6335 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
6336 | $r14 = "[["; |
6337 | $this->currPos += 2; |
6338 | } else { |
6339 | if (!$silence) {$this->fail(41);} |
6340 | $r14 = self::$FAILED; |
6341 | $r13 = self::$FAILED; |
6342 | goto seq_4; |
6343 | } |
6344 | $p15 = $this->currPos; |
6345 | if (($this->input[$this->currPos] ?? null) === "[") { |
6346 | $this->currPos++; |
6347 | $r16 = "["; |
6348 | $r16 = false; |
6349 | $this->currPos = $p15; |
6350 | } else { |
6351 | $r16 = self::$FAILED; |
6352 | $this->currPos = $p10; |
6353 | $r13 = self::$FAILED; |
6354 | goto seq_4; |
6355 | } |
6356 | // free $p15 |
6357 | $r13 = true; |
6358 | seq_4: |
6359 | if ($r13!==self::$FAILED) { |
6360 | $r1 = true; |
6361 | } else { |
6362 | break; |
6363 | } |
6364 | // free $p10 |
6365 | } |
6366 | if ($r1!==self::$FAILED) { |
6367 | $r1 = substr($this->input, $p7, $this->currPos - $p7); |
6368 | goto choice_1; |
6369 | } else { |
6370 | $r1 = self::$FAILED; |
6371 | } |
6372 | // free $r13 |
6373 | // free $p7 |
6374 | $p7 = $this->currPos; |
6375 | // start seq_5 |
6376 | $p10 = $this->currPos; |
6377 | $p15 = $this->currPos; |
6378 | if (($this->input[$this->currPos] ?? null) === "[") { |
6379 | $this->currPos++; |
6380 | $r13 = "["; |
6381 | $r13 = false; |
6382 | $this->currPos = $p15; |
6383 | } else { |
6384 | $r13 = self::$FAILED; |
6385 | $r1 = self::$FAILED; |
6386 | goto seq_5; |
6387 | } |
6388 | // free $p15 |
6389 | // start choice_3 |
6390 | $r17 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
6391 | if ($r17!==self::$FAILED) { |
6392 | goto choice_3; |
6393 | } |
6394 | $r17 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
6395 | choice_3: |
6396 | // r <- $r17 |
6397 | if ($r17===self::$FAILED) { |
6398 | $this->currPos = $p10; |
6399 | $r1 = self::$FAILED; |
6400 | goto seq_5; |
6401 | } |
6402 | $r1 = true; |
6403 | seq_5: |
6404 | if ($r1!==self::$FAILED) { |
6405 | $this->savedPos = $p7; |
6406 | $r1 = $this->a24($r17); |
6407 | goto choice_1; |
6408 | } |
6409 | // free $p10 |
6410 | $p10 = $this->currPos; |
6411 | // start seq_6 |
6412 | $p15 = $this->currPos; |
6413 | $p18 = $this->currPos; |
6414 | if (($this->input[$this->currPos] ?? null) === "'") { |
6415 | $this->currPos++; |
6416 | $r19 = "'"; |
6417 | $r19 = false; |
6418 | $this->currPos = $p18; |
6419 | } else { |
6420 | $r19 = self::$FAILED; |
6421 | $r1 = self::$FAILED; |
6422 | goto seq_6; |
6423 | } |
6424 | // free $p18 |
6425 | $r20 = $this->parsequote($silence); |
6426 | // r <- $r20 |
6427 | if ($r20===self::$FAILED) { |
6428 | $this->currPos = $p15; |
6429 | $r1 = self::$FAILED; |
6430 | goto seq_6; |
6431 | } |
6432 | $r1 = true; |
6433 | seq_6: |
6434 | if ($r1!==self::$FAILED) { |
6435 | $this->savedPos = $p10; |
6436 | $r1 = $this->a24($r20); |
6437 | } |
6438 | // free $p15 |
6439 | choice_1: |
6440 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6441 | $this->currPos, |
6442 | $r1, |
6443 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6444 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6445 | ); |
6446 | return $r1; |
6447 | } |
6448 | private function discardlist_char($silence) { |
6449 | $key = 443; |
6450 | $bucket = $this->currPos; |
6451 | $cached = $this->cache[$bucket][$key] ?? null; |
6452 | if ($cached) { |
6453 | $this->currPos = $cached->nextPos; |
6454 | |
6455 | return $cached->result; |
6456 | } |
6457 | |
6458 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6459 | $r1 = $this->input[$this->currPos++]; |
6460 | } else { |
6461 | $r1 = self::$FAILED; |
6462 | if (!$silence) {$this->fail(42);} |
6463 | } |
6464 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6465 | $this->currPos, |
6466 | $r1, |
6467 | self::$UNDEFINED, |
6468 | self::$UNDEFINED |
6469 | ); |
6470 | return $r1; |
6471 | } |
6472 | private function parselist_char($silence) { |
6473 | $key = 442; |
6474 | $bucket = $this->currPos; |
6475 | $cached = $this->cache[$bucket][$key] ?? null; |
6476 | if ($cached) { |
6477 | $this->currPos = $cached->nextPos; |
6478 | |
6479 | return $cached->result; |
6480 | } |
6481 | |
6482 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6483 | $r1 = $this->input[$this->currPos++]; |
6484 | } else { |
6485 | $r1 = self::$FAILED; |
6486 | if (!$silence) {$this->fail(42);} |
6487 | } |
6488 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6489 | $this->currPos, |
6490 | $r1, |
6491 | self::$UNDEFINED, |
6492 | self::$UNDEFINED |
6493 | ); |
6494 | return $r1; |
6495 | } |
6496 | private function parseinlineline_break_on_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
6497 | $key = json_encode([444, $boolParams & 0x2fff, $param_preproc, $param_th]); |
6498 | $bucket = $this->currPos; |
6499 | $cached = $this->cache[$bucket][$key] ?? null; |
6500 | if ($cached) { |
6501 | $this->currPos = $cached->nextPos; |
6502 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6503 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6504 | return $cached->result; |
6505 | } |
6506 | $saved_preproc=$param_preproc; |
6507 | $saved_th=$param_th; |
6508 | $r1 = $this->parseinlineline($silence, $boolParams | 0x1000, $param_preproc, $param_th); |
6509 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6510 | $this->currPos, |
6511 | $r1, |
6512 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6513 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6514 | ); |
6515 | return $r1; |
6516 | } |
6517 | private function discardeolf($silence) { |
6518 | $key = 523; |
6519 | $bucket = $this->currPos; |
6520 | $cached = $this->cache[$bucket][$key] ?? null; |
6521 | if ($cached) { |
6522 | $this->currPos = $cached->nextPos; |
6523 | |
6524 | return $cached->result; |
6525 | } |
6526 | |
6527 | // start choice_1 |
6528 | $r1 = $this->discardnewline($silence); |
6529 | if ($r1!==self::$FAILED) { |
6530 | goto choice_1; |
6531 | } |
6532 | $r1 = $this->discardeof($silence); |
6533 | choice_1: |
6534 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6535 | $this->currPos, |
6536 | $r1, |
6537 | self::$UNDEFINED, |
6538 | self::$UNDEFINED |
6539 | ); |
6540 | return $r1; |
6541 | } |
6542 | private function parsetable_line($silence, $boolParams, &$param_preproc, &$param_th) { |
6543 | $key = json_encode([450, $boolParams & 0x3fff, $param_preproc, $param_th]); |
6544 | $bucket = $this->currPos; |
6545 | $cached = $this->cache[$bucket][$key] ?? null; |
6546 | if ($cached) { |
6547 | $this->currPos = $cached->nextPos; |
6548 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6549 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6550 | return $cached->result; |
6551 | } |
6552 | $saved_preproc=$param_preproc; |
6553 | $saved_th=$param_th; |
6554 | $p2 = $this->currPos; |
6555 | // start seq_1 |
6556 | $p3 = $this->currPos; |
6557 | // start choice_1 |
6558 | $p5 = $this->currPos; |
6559 | $r4 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
6560 | if ($r4 === self::$FAILED) { |
6561 | $r4 = false; |
6562 | goto choice_1; |
6563 | } else { |
6564 | $r4 = self::$FAILED; |
6565 | $this->currPos = $p5; |
6566 | } |
6567 | // free $p5 |
6568 | $p5 = $this->currPos; |
6569 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
6570 | $r4 = "{{!}}"; |
6571 | $this->currPos += 5; |
6572 | $r4 = false; |
6573 | $this->currPos = $p5; |
6574 | } else { |
6575 | $r4 = self::$FAILED; |
6576 | } |
6577 | // free $p5 |
6578 | choice_1: |
6579 | if ($r4===self::$FAILED) { |
6580 | $r1 = self::$FAILED; |
6581 | goto seq_1; |
6582 | } |
6583 | // start choice_2 |
6584 | $r6 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
6585 | if ($r6!==self::$FAILED) { |
6586 | goto choice_2; |
6587 | } |
6588 | $r6 = $this->parsetable_content_line($silence, $boolParams | 0x40, $param_preproc, $param_th); |
6589 | if ($r6!==self::$FAILED) { |
6590 | goto choice_2; |
6591 | } |
6592 | $r6 = $this->parsetable_end_tag($silence); |
6593 | choice_2: |
6594 | // tl <- $r6 |
6595 | if ($r6===self::$FAILED) { |
6596 | $this->currPos = $p3; |
6597 | $r1 = self::$FAILED; |
6598 | goto seq_1; |
6599 | } |
6600 | $r1 = true; |
6601 | seq_1: |
6602 | if ($r1!==self::$FAILED) { |
6603 | $this->savedPos = $p2; |
6604 | $r1 = $this->a67($r6); |
6605 | } |
6606 | // free $p3 |
6607 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6608 | $this->currPos, |
6609 | $r1, |
6610 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6611 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6612 | ); |
6613 | return $r1; |
6614 | } |
6615 | private function parsesol($silence, $boolParams, &$param_preproc, &$param_th) { |
6616 | $key = json_encode([542, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
6617 | $bucket = $this->currPos; |
6618 | $cached = $this->cache[$bucket][$key] ?? null; |
6619 | if ($cached) { |
6620 | $this->currPos = $cached->nextPos; |
6621 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6622 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6623 | return $cached->result; |
6624 | } |
6625 | $saved_preproc=$param_preproc; |
6626 | $saved_th=$param_th; |
6627 | // start seq_1 |
6628 | $p1 = $this->currPos; |
6629 | // start choice_1 |
6630 | $r3 = $this->parseempty_line_with_comments($silence); |
6631 | if ($r3!==self::$FAILED) { |
6632 | goto choice_1; |
6633 | } |
6634 | $r3 = $this->parsesol_prefix($silence); |
6635 | choice_1: |
6636 | if ($r3===self::$FAILED) { |
6637 | $r2 = self::$FAILED; |
6638 | goto seq_1; |
6639 | } |
6640 | $r4 = []; |
6641 | for (;;) { |
6642 | $r5 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
6643 | if ($r5!==self::$FAILED) { |
6644 | $r4[] = $r5; |
6645 | } else { |
6646 | break; |
6647 | } |
6648 | } |
6649 | // free $r5 |
6650 | $r2 = [$r3,$r4]; |
6651 | seq_1: |
6652 | // free $r2,$p1 |
6653 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6654 | $this->currPos, |
6655 | $r2, |
6656 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6657 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6658 | ); |
6659 | return $r2; |
6660 | } |
6661 | private function discardcomment($silence) { |
6662 | $key = 525; |
6663 | $bucket = $this->currPos; |
6664 | $cached = $this->cache[$bucket][$key] ?? null; |
6665 | if ($cached) { |
6666 | $this->currPos = $cached->nextPos; |
6667 | |
6668 | return $cached->result; |
6669 | } |
6670 | |
6671 | $p2 = $this->currPos; |
6672 | // start seq_1 |
6673 | $p3 = $this->currPos; |
6674 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
6675 | $r4 = "<!--"; |
6676 | $this->currPos += 4; |
6677 | } else { |
6678 | if (!$silence) {$this->fail(11);} |
6679 | $r4 = self::$FAILED; |
6680 | $r1 = self::$FAILED; |
6681 | goto seq_1; |
6682 | } |
6683 | $p6 = $this->currPos; |
6684 | for (;;) { |
6685 | // start seq_2 |
6686 | $p8 = $this->currPos; |
6687 | $p9 = $this->currPos; |
6688 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6689 | $r10 = "-->"; |
6690 | $this->currPos += 3; |
6691 | } else { |
6692 | $r10 = self::$FAILED; |
6693 | } |
6694 | if ($r10 === self::$FAILED) { |
6695 | $r10 = false; |
6696 | } else { |
6697 | $r10 = self::$FAILED; |
6698 | $this->currPos = $p9; |
6699 | $r7 = self::$FAILED; |
6700 | goto seq_2; |
6701 | } |
6702 | // free $p9 |
6703 | if ($this->currPos < $this->inputLength) { |
6704 | $r11 = self::consumeChar($this->input, $this->currPos);; |
6705 | } else { |
6706 | $r11 = self::$FAILED; |
6707 | if (!$silence) {$this->fail(7);} |
6708 | $this->currPos = $p8; |
6709 | $r7 = self::$FAILED; |
6710 | goto seq_2; |
6711 | } |
6712 | $r7 = true; |
6713 | seq_2: |
6714 | if ($r7===self::$FAILED) { |
6715 | break; |
6716 | } |
6717 | // free $p8 |
6718 | } |
6719 | // free $r7 |
6720 | $r5 = true; |
6721 | // c <- $r5 |
6722 | if ($r5!==self::$FAILED) { |
6723 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
6724 | } else { |
6725 | $r5 = self::$FAILED; |
6726 | $this->currPos = $p3; |
6727 | $r1 = self::$FAILED; |
6728 | goto seq_1; |
6729 | } |
6730 | // free $p6 |
6731 | $p6 = $this->currPos; |
6732 | // start choice_1 |
6733 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6734 | $r7 = "-->"; |
6735 | $this->currPos += 3; |
6736 | goto choice_1; |
6737 | } else { |
6738 | if (!$silence) {$this->fail(12);} |
6739 | $r7 = self::$FAILED; |
6740 | } |
6741 | $r7 = $this->discardeof($silence); |
6742 | choice_1: |
6743 | // cEnd <- $r7 |
6744 | if ($r7!==self::$FAILED) { |
6745 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
6746 | } else { |
6747 | $r7 = self::$FAILED; |
6748 | $this->currPos = $p3; |
6749 | $r1 = self::$FAILED; |
6750 | goto seq_1; |
6751 | } |
6752 | // free $p6 |
6753 | $r1 = true; |
6754 | seq_1: |
6755 | if ($r1!==self::$FAILED) { |
6756 | $this->savedPos = $p2; |
6757 | $r1 = $this->a27($r5, $r7); |
6758 | } |
6759 | // free $p3 |
6760 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6761 | $this->currPos, |
6762 | $r1, |
6763 | self::$UNDEFINED, |
6764 | self::$UNDEFINED |
6765 | ); |
6766 | return $r1; |
6767 | } |
6768 | private function discardsof($silence) { |
6769 | $key = 515; |
6770 | $bucket = $this->currPos; |
6771 | $cached = $this->cache[$bucket][$key] ?? null; |
6772 | if ($cached) { |
6773 | $this->currPos = $cached->nextPos; |
6774 | |
6775 | return $cached->result; |
6776 | } |
6777 | |
6778 | $this->savedPos = $this->currPos; |
6779 | $r1 = $this->a68(); |
6780 | if ($r1) { |
6781 | $r1 = false; |
6782 | } else { |
6783 | $r1 = self::$FAILED; |
6784 | } |
6785 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6786 | $this->currPos, |
6787 | $r1, |
6788 | self::$UNDEFINED, |
6789 | self::$UNDEFINED |
6790 | ); |
6791 | return $r1; |
6792 | } |
6793 | private function parseredirect($silence, $boolParams, &$param_th, &$param_preproc) { |
6794 | $key = json_encode([284, $boolParams & 0x3fff, $param_th, $param_preproc]); |
6795 | $bucket = $this->currPos; |
6796 | $cached = $this->cache[$bucket][$key] ?? null; |
6797 | if ($cached) { |
6798 | $this->currPos = $cached->nextPos; |
6799 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6800 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6801 | return $cached->result; |
6802 | } |
6803 | $saved_th=$param_th; |
6804 | $saved_preproc=$param_preproc; |
6805 | $p2 = $this->currPos; |
6806 | // start seq_1 |
6807 | $p3 = $this->currPos; |
6808 | $r4 = $this->parseredirect_word($silence); |
6809 | // rw <- $r4 |
6810 | if ($r4===self::$FAILED) { |
6811 | $r1 = self::$FAILED; |
6812 | goto seq_1; |
6813 | } |
6814 | $p6 = $this->currPos; |
6815 | for (;;) { |
6816 | $r7 = $this->discardspace_or_newline($silence); |
6817 | if ($r7===self::$FAILED) { |
6818 | break; |
6819 | } |
6820 | } |
6821 | // free $r7 |
6822 | $r5 = true; |
6823 | // sp <- $r5 |
6824 | if ($r5!==self::$FAILED) { |
6825 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
6826 | } else { |
6827 | $r5 = self::$FAILED; |
6828 | $this->currPos = $p3; |
6829 | $r1 = self::$FAILED; |
6830 | goto seq_1; |
6831 | } |
6832 | // free $p6 |
6833 | $p6 = $this->currPos; |
6834 | // start seq_2 |
6835 | $p8 = $this->currPos; |
6836 | if (($this->input[$this->currPos] ?? null) === ":") { |
6837 | $this->currPos++; |
6838 | $r9 = ":"; |
6839 | } else { |
6840 | if (!$silence) {$this->fail(18);} |
6841 | $r9 = self::$FAILED; |
6842 | $r7 = self::$FAILED; |
6843 | goto seq_2; |
6844 | } |
6845 | for (;;) { |
6846 | $r11 = $this->discardspace_or_newline($silence); |
6847 | if ($r11===self::$FAILED) { |
6848 | break; |
6849 | } |
6850 | } |
6851 | // free $r11 |
6852 | $r10 = true; |
6853 | if ($r10===self::$FAILED) { |
6854 | $this->currPos = $p8; |
6855 | $r7 = self::$FAILED; |
6856 | goto seq_2; |
6857 | } |
6858 | // free $r10 |
6859 | $r7 = true; |
6860 | seq_2: |
6861 | if ($r7===self::$FAILED) { |
6862 | $r7 = null; |
6863 | } |
6864 | // free $p8 |
6865 | // c <- $r7 |
6866 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
6867 | // free $p6 |
6868 | $r10 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
6869 | // wl <- $r10 |
6870 | if ($r10===self::$FAILED) { |
6871 | $this->currPos = $p3; |
6872 | $r1 = self::$FAILED; |
6873 | goto seq_1; |
6874 | } |
6875 | $this->savedPos = $this->currPos; |
6876 | $r11 = $this->a69($r4, $r5, $r7, $r10); |
6877 | if ($r11) { |
6878 | $r11 = false; |
6879 | } else { |
6880 | $r11 = self::$FAILED; |
6881 | $this->currPos = $p3; |
6882 | $r1 = self::$FAILED; |
6883 | goto seq_1; |
6884 | } |
6885 | $r1 = true; |
6886 | seq_1: |
6887 | if ($r1!==self::$FAILED) { |
6888 | $this->savedPos = $p2; |
6889 | $r1 = $this->a70($r4, $r5, $r7, $r10); |
6890 | } |
6891 | // free $p3 |
6892 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6893 | $this->currPos, |
6894 | $r1, |
6895 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6896 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6897 | ); |
6898 | return $r1; |
6899 | } |
6900 | private function parsesol_transparent($silence, $boolParams, &$param_preproc, &$param_th) { |
6901 | $key = json_encode([540, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
6902 | $bucket = $this->currPos; |
6903 | $cached = $this->cache[$bucket][$key] ?? null; |
6904 | if ($cached) { |
6905 | $this->currPos = $cached->nextPos; |
6906 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6907 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6908 | return $cached->result; |
6909 | } |
6910 | $saved_preproc=$param_preproc; |
6911 | $saved_th=$param_th; |
6912 | // start choice_1 |
6913 | $r1 = $this->parsecomment($silence); |
6914 | if ($r1!==self::$FAILED) { |
6915 | goto choice_1; |
6916 | } |
6917 | $r1 = $this->parseinclude_limits($silence, $boolParams | 0x2000, $param_preproc, $param_th); |
6918 | if ($r1!==self::$FAILED) { |
6919 | goto choice_1; |
6920 | } |
6921 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
6922 | if ($r1!==self::$FAILED) { |
6923 | goto choice_1; |
6924 | } |
6925 | $r1 = $this->parsebehavior_switch($silence); |
6926 | choice_1: |
6927 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6928 | $this->currPos, |
6929 | $r1, |
6930 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6931 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6932 | ); |
6933 | return $r1; |
6934 | } |
6935 | private function parseblock_line($silence, $boolParams, &$param_preproc, &$param_th) { |
6936 | $key = json_encode([298, $boolParams & 0x3fff, $param_preproc, $param_th]); |
6937 | $bucket = $this->currPos; |
6938 | $cached = $this->cache[$bucket][$key] ?? null; |
6939 | if ($cached) { |
6940 | $this->currPos = $cached->nextPos; |
6941 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6942 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6943 | return $cached->result; |
6944 | } |
6945 | $saved_preproc=$param_preproc; |
6946 | $saved_th=$param_th; |
6947 | // start choice_1 |
6948 | $r1 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
6949 | if ($r1!==self::$FAILED) { |
6950 | goto choice_1; |
6951 | } |
6952 | $r1 = $this->parselist_item($silence, $boolParams, $param_preproc, $param_th); |
6953 | if ($r1!==self::$FAILED) { |
6954 | goto choice_1; |
6955 | } |
6956 | $r1 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
6957 | if ($r1!==self::$FAILED) { |
6958 | goto choice_1; |
6959 | } |
6960 | $p2 = $this->currPos; |
6961 | // start seq_1 |
6962 | $p3 = $this->currPos; |
6963 | $r4 = $this->parseoptionalSpaceToken($silence); |
6964 | // st <- $r4 |
6965 | if ($r4===self::$FAILED) { |
6966 | $r1 = self::$FAILED; |
6967 | goto seq_1; |
6968 | } |
6969 | $p5 = $this->currPos; |
6970 | if (strspn($this->input, " <{}|!", $this->currPos, 1) !== 0) { |
6971 | $r6 = $this->input[$this->currPos++]; |
6972 | $r6 = false; |
6973 | $this->currPos = $p5; |
6974 | } else { |
6975 | $r6 = self::$FAILED; |
6976 | $this->currPos = $p3; |
6977 | $r1 = self::$FAILED; |
6978 | goto seq_1; |
6979 | } |
6980 | // free $p5 |
6981 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
6982 | // tl <- $r7 |
6983 | if ($r7===self::$FAILED) { |
6984 | $this->currPos = $p3; |
6985 | $r1 = self::$FAILED; |
6986 | goto seq_1; |
6987 | } |
6988 | $r1 = true; |
6989 | seq_1: |
6990 | if ($r1!==self::$FAILED) { |
6991 | $this->savedPos = $p2; |
6992 | $r1 = $this->a71($r4, $r7); |
6993 | } |
6994 | // free $p3 |
6995 | choice_1: |
6996 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6997 | $this->currPos, |
6998 | $r1, |
6999 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7000 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7001 | ); |
7002 | return $r1; |
7003 | } |
7004 | private function parseblock_lines($silence, $boolParams, &$param_preproc, &$param_th) { |
7005 | $key = json_encode([294, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7006 | $bucket = $this->currPos; |
7007 | $cached = $this->cache[$bucket][$key] ?? null; |
7008 | if ($cached) { |
7009 | $this->currPos = $cached->nextPos; |
7010 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7011 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7012 | return $cached->result; |
7013 | } |
7014 | $saved_preproc=$param_preproc; |
7015 | $saved_th=$param_th; |
7016 | $p2 = $this->currPos; |
7017 | // start seq_1 |
7018 | $p3 = $this->currPos; |
7019 | $r4 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7020 | // s <- $r4 |
7021 | if ($r4===self::$FAILED) { |
7022 | $r1 = self::$FAILED; |
7023 | goto seq_1; |
7024 | } |
7025 | $p6 = $this->currPos; |
7026 | // start seq_2 |
7027 | $p7 = $this->currPos; |
7028 | $r8 = $this->parseoptionalSpaceToken($silence); |
7029 | // os <- $r8 |
7030 | if ($r8===self::$FAILED) { |
7031 | $r5 = self::$FAILED; |
7032 | goto seq_2; |
7033 | } |
7034 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7035 | // so <- $r9 |
7036 | if ($r9===self::$FAILED) { |
7037 | $this->currPos = $p7; |
7038 | $r5 = self::$FAILED; |
7039 | goto seq_2; |
7040 | } |
7041 | $r5 = true; |
7042 | seq_2: |
7043 | if ($r5!==self::$FAILED) { |
7044 | $this->savedPos = $p6; |
7045 | $r5 = $this->a72($r4, $r8, $r9); |
7046 | } else { |
7047 | $r5 = null; |
7048 | } |
7049 | // free $p7 |
7050 | // s2 <- $r5 |
7051 | $r10 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
7052 | // bl <- $r10 |
7053 | if ($r10===self::$FAILED) { |
7054 | $this->currPos = $p3; |
7055 | $r1 = self::$FAILED; |
7056 | goto seq_1; |
7057 | } |
7058 | $r1 = true; |
7059 | seq_1: |
7060 | if ($r1!==self::$FAILED) { |
7061 | $this->savedPos = $p2; |
7062 | $r1 = $this->a73($r4, $r5, $r10); |
7063 | } |
7064 | // free $p3 |
7065 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7066 | $this->currPos, |
7067 | $r1, |
7068 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7069 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7070 | ); |
7071 | return $r1; |
7072 | } |
7073 | private function discardtplarg($silence, $boolParams, &$param_th) { |
7074 | $key = json_encode([347, $boolParams & 0x3fff, $param_th]); |
7075 | $bucket = $this->currPos; |
7076 | $cached = $this->cache[$bucket][$key] ?? null; |
7077 | if ($cached) { |
7078 | $this->currPos = $cached->nextPos; |
7079 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7080 | return $cached->result; |
7081 | } |
7082 | $saved_th=$param_th; |
7083 | $r1 = $this->discardtplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7084 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7085 | $this->currPos, |
7086 | $r1, |
7087 | self::$UNDEFINED, |
7088 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7089 | ); |
7090 | return $r1; |
7091 | } |
7092 | private function parsetemplate($silence, $boolParams, &$param_th) { |
7093 | $key = json_encode([340, $boolParams & 0x3fff, $param_th]); |
7094 | $bucket = $this->currPos; |
7095 | $cached = $this->cache[$bucket][$key] ?? null; |
7096 | if ($cached) { |
7097 | $this->currPos = $cached->nextPos; |
7098 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7099 | return $cached->result; |
7100 | } |
7101 | $saved_th=$param_th; |
7102 | $r1 = $this->parsetemplate_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7103 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7104 | $this->currPos, |
7105 | $r1, |
7106 | self::$UNDEFINED, |
7107 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7108 | ); |
7109 | return $r1; |
7110 | } |
7111 | private function parsebroken_template($silence, &$param_preproc) { |
7112 | $key = json_encode([342, $param_preproc]); |
7113 | $bucket = $this->currPos; |
7114 | $cached = $this->cache[$bucket][$key] ?? null; |
7115 | if ($cached) { |
7116 | $this->currPos = $cached->nextPos; |
7117 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7118 | return $cached->result; |
7119 | } |
7120 | $saved_preproc=$param_preproc; |
7121 | $p2 = $this->currPos; |
7122 | // start seq_1 |
7123 | $p3 = $this->currPos; |
7124 | // t <- $r4 |
7125 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
7126 | $r4 = "{{"; |
7127 | $this->currPos += 2; |
7128 | } else { |
7129 | if (!$silence) {$this->fail(43);} |
7130 | $r4 = self::$FAILED; |
7131 | $this->currPos = $p3; |
7132 | $r1 = self::$FAILED; |
7133 | goto seq_1; |
7134 | } |
7135 | $r1 = true; |
7136 | seq_1: |
7137 | if ($r1!==self::$FAILED) { |
7138 | $this->savedPos = $p2; |
7139 | $r1 = $this->a74($param_preproc, $r4); |
7140 | } |
7141 | // free $p3 |
7142 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7143 | $this->currPos, |
7144 | $r1, |
7145 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7146 | self::$UNDEFINED |
7147 | ); |
7148 | return $r1; |
7149 | } |
7150 | private function parsetplarg($silence, $boolParams, &$param_th) { |
7151 | $key = json_encode([346, $boolParams & 0x3fff, $param_th]); |
7152 | $bucket = $this->currPos; |
7153 | $cached = $this->cache[$bucket][$key] ?? null; |
7154 | if ($cached) { |
7155 | $this->currPos = $cached->nextPos; |
7156 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7157 | return $cached->result; |
7158 | } |
7159 | $saved_th=$param_th; |
7160 | $r1 = $this->parsetplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7161 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7162 | $this->currPos, |
7163 | $r1, |
7164 | self::$UNDEFINED, |
7165 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7166 | ); |
7167 | return $r1; |
7168 | } |
7169 | private function discardwikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
7170 | $key = json_encode([391, $boolParams & 0x3fff, $param_th, $param_preproc]); |
7171 | $bucket = $this->currPos; |
7172 | $cached = $this->cache[$bucket][$key] ?? null; |
7173 | if ($cached) { |
7174 | $this->currPos = $cached->nextPos; |
7175 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7176 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7177 | return $cached->result; |
7178 | } |
7179 | $saved_th=$param_th; |
7180 | $saved_preproc=$param_preproc; |
7181 | // start choice_1 |
7182 | $r1 = $this->discardwikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
7183 | if ($r1!==self::$FAILED) { |
7184 | goto choice_1; |
7185 | } |
7186 | $r1 = $this->discardbroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
7187 | choice_1: |
7188 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7189 | $this->currPos, |
7190 | $r1, |
7191 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7192 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7193 | ); |
7194 | return $r1; |
7195 | } |
7196 | private function parsedirective($silence, $boolParams, &$param_preproc, &$param_th) { |
7197 | $key = json_encode([486, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7198 | $bucket = $this->currPos; |
7199 | $cached = $this->cache[$bucket][$key] ?? null; |
7200 | if ($cached) { |
7201 | $this->currPos = $cached->nextPos; |
7202 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7203 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7204 | return $cached->result; |
7205 | } |
7206 | $saved_preproc=$param_preproc; |
7207 | $saved_th=$param_th; |
7208 | // start choice_1 |
7209 | $r1 = $this->parsecomment($silence); |
7210 | if ($r1!==self::$FAILED) { |
7211 | goto choice_1; |
7212 | } |
7213 | $r1 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
7214 | if ($r1!==self::$FAILED) { |
7215 | goto choice_1; |
7216 | } |
7217 | $r1 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
7218 | if ($r1!==self::$FAILED) { |
7219 | goto choice_1; |
7220 | } |
7221 | $p2 = $this->currPos; |
7222 | // start seq_1 |
7223 | $p3 = $this->currPos; |
7224 | $p4 = $this->currPos; |
7225 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
7226 | $r5 = "-{"; |
7227 | $this->currPos += 2; |
7228 | $r5 = false; |
7229 | $this->currPos = $p4; |
7230 | } else { |
7231 | $r5 = self::$FAILED; |
7232 | $r1 = self::$FAILED; |
7233 | goto seq_1; |
7234 | } |
7235 | // free $p4 |
7236 | $r6 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
7237 | // v <- $r6 |
7238 | if ($r6===self::$FAILED) { |
7239 | $this->currPos = $p3; |
7240 | $r1 = self::$FAILED; |
7241 | goto seq_1; |
7242 | } |
7243 | $r1 = true; |
7244 | seq_1: |
7245 | if ($r1!==self::$FAILED) { |
7246 | $this->savedPos = $p2; |
7247 | $r1 = $this->a75($r6); |
7248 | goto choice_1; |
7249 | } |
7250 | // free $p3 |
7251 | $p3 = $this->currPos; |
7252 | // start seq_2 |
7253 | $p4 = $this->currPos; |
7254 | $p7 = $this->currPos; |
7255 | if (($this->input[$this->currPos] ?? null) === "&") { |
7256 | $this->currPos++; |
7257 | $r8 = "&"; |
7258 | $r8 = false; |
7259 | $this->currPos = $p7; |
7260 | } else { |
7261 | $r8 = self::$FAILED; |
7262 | $r1 = self::$FAILED; |
7263 | goto seq_2; |
7264 | } |
7265 | // free $p7 |
7266 | $r9 = $this->parsehtmlentity($silence); |
7267 | // e <- $r9 |
7268 | if ($r9===self::$FAILED) { |
7269 | $this->currPos = $p4; |
7270 | $r1 = self::$FAILED; |
7271 | goto seq_2; |
7272 | } |
7273 | $r1 = true; |
7274 | seq_2: |
7275 | if ($r1!==self::$FAILED) { |
7276 | $this->savedPos = $p3; |
7277 | $r1 = $this->a76($r9); |
7278 | goto choice_1; |
7279 | } |
7280 | // free $p4 |
7281 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
7282 | choice_1: |
7283 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7284 | $this->currPos, |
7285 | $r1, |
7286 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7287 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7288 | ); |
7289 | return $r1; |
7290 | } |
7291 | private function parseinline_xmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
7292 | $key = json_encode([306, $boolParams & 0x3ebd, $param_preproc, $param_th]); |
7293 | $bucket = $this->currPos; |
7294 | $cached = $this->cache[$bucket][$key] ?? null; |
7295 | if ($cached) { |
7296 | $this->currPos = $cached->nextPos; |
7297 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7298 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7299 | return $cached->result; |
7300 | } |
7301 | $saved_preproc=$param_preproc; |
7302 | $saved_th=$param_th; |
7303 | $p2 = $this->currPos; |
7304 | // start seq_1 |
7305 | $p3 = $this->currPos; |
7306 | if (($this->input[$this->currPos] ?? null) === "<") { |
7307 | $this->currPos++; |
7308 | $r4 = "<"; |
7309 | } else { |
7310 | if (!$silence) {$this->fail(44);} |
7311 | $r4 = self::$FAILED; |
7312 | $r1 = self::$FAILED; |
7313 | goto seq_1; |
7314 | } |
7315 | // start choice_1 |
7316 | $r5 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
7317 | if ($r5!==self::$FAILED) { |
7318 | goto choice_1; |
7319 | } |
7320 | $r5 = $this->parsexmlish_tag($silence, $boolParams & ~0x2, $param_preproc, $param_th); |
7321 | if ($r5!==self::$FAILED) { |
7322 | goto choice_1; |
7323 | } |
7324 | $r5 = $this->parsetvar_old_syntax_closing_HACK($silence); |
7325 | choice_1: |
7326 | // tag <- $r5 |
7327 | if ($r5===self::$FAILED) { |
7328 | $this->currPos = $p3; |
7329 | $r1 = self::$FAILED; |
7330 | goto seq_1; |
7331 | } |
7332 | $r1 = true; |
7333 | seq_1: |
7334 | if ($r1!==self::$FAILED) { |
7335 | $this->savedPos = $p2; |
7336 | $r1 = $this->a77($r5); |
7337 | } |
7338 | // free $p3 |
7339 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7340 | $this->currPos, |
7341 | $r1, |
7342 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7343 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7344 | ); |
7345 | return $r1; |
7346 | } |
7347 | private function parsetable_attribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7348 | $key = json_encode([502, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7349 | $bucket = $this->currPos; |
7350 | $cached = $this->cache[$bucket][$key] ?? null; |
7351 | if ($cached) { |
7352 | $this->currPos = $cached->nextPos; |
7353 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7354 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7355 | return $cached->result; |
7356 | } |
7357 | $saved_preproc=$param_preproc; |
7358 | $saved_th=$param_th; |
7359 | $p2 = $this->currPos; |
7360 | $r3 = []; |
7361 | for (;;) { |
7362 | // start choice_1 |
7363 | $p5 = $this->currPos; |
7364 | $r4 = self::$FAILED; |
7365 | for (;;) { |
7366 | if (strcspn($this->input, "{}&<-!['\x0d\x0a|", $this->currPos, 1) !== 0) { |
7367 | $r6 = self::consumeChar($this->input, $this->currPos); |
7368 | $r4 = true; |
7369 | } else { |
7370 | $r6 = self::$FAILED; |
7371 | if (!$silence) {$this->fail(45);} |
7372 | break; |
7373 | } |
7374 | } |
7375 | if ($r4!==self::$FAILED) { |
7376 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7377 | goto choice_1; |
7378 | } else { |
7379 | $r4 = self::$FAILED; |
7380 | } |
7381 | // free $r6 |
7382 | // free $p5 |
7383 | $p5 = $this->currPos; |
7384 | // start seq_1 |
7385 | $p7 = $this->currPos; |
7386 | $p8 = $this->currPos; |
7387 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7388 | if ($r6 === self::$FAILED) { |
7389 | $r6 = false; |
7390 | } else { |
7391 | $r6 = self::$FAILED; |
7392 | $this->currPos = $p8; |
7393 | $r4 = self::$FAILED; |
7394 | goto seq_1; |
7395 | } |
7396 | // free $p8 |
7397 | // start choice_2 |
7398 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7399 | if ($r9!==self::$FAILED) { |
7400 | goto choice_2; |
7401 | } |
7402 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7403 | $r9 = $this->input[$this->currPos++]; |
7404 | } else { |
7405 | $r9 = self::$FAILED; |
7406 | if (!$silence) {$this->fail(46);} |
7407 | } |
7408 | choice_2: |
7409 | // s <- $r9 |
7410 | if ($r9===self::$FAILED) { |
7411 | $this->currPos = $p7; |
7412 | $r4 = self::$FAILED; |
7413 | goto seq_1; |
7414 | } |
7415 | $r4 = true; |
7416 | seq_1: |
7417 | if ($r4!==self::$FAILED) { |
7418 | $this->savedPos = $p5; |
7419 | $r4 = $this->a42($r9); |
7420 | } |
7421 | // free $p7 |
7422 | choice_1: |
7423 | if ($r4!==self::$FAILED) { |
7424 | $r3[] = $r4; |
7425 | } else { |
7426 | break; |
7427 | } |
7428 | } |
7429 | // r <- $r3 |
7430 | // free $r4 |
7431 | $r1 = $r3; |
7432 | if ($r1!==self::$FAILED) { |
7433 | $this->savedPos = $p2; |
7434 | $r1 = $this->a60($r3); |
7435 | } |
7436 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7437 | $this->currPos, |
7438 | $r1, |
7439 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7440 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7441 | ); |
7442 | return $r1; |
7443 | } |
7444 | private function parsetable_attribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7445 | $key = json_encode([504, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7446 | $bucket = $this->currPos; |
7447 | $cached = $this->cache[$bucket][$key] ?? null; |
7448 | if ($cached) { |
7449 | $this->currPos = $cached->nextPos; |
7450 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7451 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7452 | return $cached->result; |
7453 | } |
7454 | $saved_preproc=$param_preproc; |
7455 | $saved_th=$param_th; |
7456 | $p2 = $this->currPos; |
7457 | $r3 = []; |
7458 | for (;;) { |
7459 | // start choice_1 |
7460 | $p5 = $this->currPos; |
7461 | $r4 = self::$FAILED; |
7462 | for (;;) { |
7463 | if (strcspn($this->input, "{}&<-![\"\x0d\x0a|", $this->currPos, 1) !== 0) { |
7464 | $r6 = self::consumeChar($this->input, $this->currPos); |
7465 | $r4 = true; |
7466 | } else { |
7467 | $r6 = self::$FAILED; |
7468 | if (!$silence) {$this->fail(47);} |
7469 | break; |
7470 | } |
7471 | } |
7472 | if ($r4!==self::$FAILED) { |
7473 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7474 | goto choice_1; |
7475 | } else { |
7476 | $r4 = self::$FAILED; |
7477 | } |
7478 | // free $r6 |
7479 | // free $p5 |
7480 | $p5 = $this->currPos; |
7481 | // start seq_1 |
7482 | $p7 = $this->currPos; |
7483 | $p8 = $this->currPos; |
7484 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7485 | if ($r6 === self::$FAILED) { |
7486 | $r6 = false; |
7487 | } else { |
7488 | $r6 = self::$FAILED; |
7489 | $this->currPos = $p8; |
7490 | $r4 = self::$FAILED; |
7491 | goto seq_1; |
7492 | } |
7493 | // free $p8 |
7494 | // start choice_2 |
7495 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7496 | if ($r9!==self::$FAILED) { |
7497 | goto choice_2; |
7498 | } |
7499 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7500 | $r9 = $this->input[$this->currPos++]; |
7501 | } else { |
7502 | $r9 = self::$FAILED; |
7503 | if (!$silence) {$this->fail(46);} |
7504 | } |
7505 | choice_2: |
7506 | // s <- $r9 |
7507 | if ($r9===self::$FAILED) { |
7508 | $this->currPos = $p7; |
7509 | $r4 = self::$FAILED; |
7510 | goto seq_1; |
7511 | } |
7512 | $r4 = true; |
7513 | seq_1: |
7514 | if ($r4!==self::$FAILED) { |
7515 | $this->savedPos = $p5; |
7516 | $r4 = $this->a42($r9); |
7517 | } |
7518 | // free $p7 |
7519 | choice_1: |
7520 | if ($r4!==self::$FAILED) { |
7521 | $r3[] = $r4; |
7522 | } else { |
7523 | break; |
7524 | } |
7525 | } |
7526 | // r <- $r3 |
7527 | // free $r4 |
7528 | $r1 = $r3; |
7529 | if ($r1!==self::$FAILED) { |
7530 | $this->savedPos = $p2; |
7531 | $r1 = $this->a60($r3); |
7532 | } |
7533 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7534 | $this->currPos, |
7535 | $r1, |
7536 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7537 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7538 | ); |
7539 | return $r1; |
7540 | } |
7541 | private function parsetable_attribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
7542 | $key = json_encode([500, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7543 | $bucket = $this->currPos; |
7544 | $cached = $this->cache[$bucket][$key] ?? null; |
7545 | if ($cached) { |
7546 | $this->currPos = $cached->nextPos; |
7547 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7548 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7549 | return $cached->result; |
7550 | } |
7551 | $saved_preproc=$param_preproc; |
7552 | $saved_th=$param_th; |
7553 | $p2 = $this->currPos; |
7554 | $r3 = []; |
7555 | for (;;) { |
7556 | // start choice_1 |
7557 | $p5 = $this->currPos; |
7558 | $r4 = self::$FAILED; |
7559 | for (;;) { |
7560 | if (strcspn($this->input, "{}&<-![ \x09\x0a\x0d\x0c|", $this->currPos, 1) !== 0) { |
7561 | $r6 = self::consumeChar($this->input, $this->currPos); |
7562 | $r4 = true; |
7563 | } else { |
7564 | $r6 = self::$FAILED; |
7565 | if (!$silence) {$this->fail(48);} |
7566 | break; |
7567 | } |
7568 | } |
7569 | if ($r4!==self::$FAILED) { |
7570 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7571 | goto choice_1; |
7572 | } else { |
7573 | $r4 = self::$FAILED; |
7574 | } |
7575 | // free $r6 |
7576 | // free $p5 |
7577 | $p5 = $this->currPos; |
7578 | // start seq_1 |
7579 | $p7 = $this->currPos; |
7580 | $p8 = $this->currPos; |
7581 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7582 | if ($r6 === self::$FAILED) { |
7583 | $r6 = false; |
7584 | } else { |
7585 | $r6 = self::$FAILED; |
7586 | $this->currPos = $p8; |
7587 | $r4 = self::$FAILED; |
7588 | goto seq_1; |
7589 | } |
7590 | // free $p8 |
7591 | // start choice_2 |
7592 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7593 | if ($r9!==self::$FAILED) { |
7594 | goto choice_2; |
7595 | } |
7596 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7597 | $r9 = $this->input[$this->currPos++]; |
7598 | } else { |
7599 | $r9 = self::$FAILED; |
7600 | if (!$silence) {$this->fail(46);} |
7601 | } |
7602 | choice_2: |
7603 | // s <- $r9 |
7604 | if ($r9===self::$FAILED) { |
7605 | $this->currPos = $p7; |
7606 | $r4 = self::$FAILED; |
7607 | goto seq_1; |
7608 | } |
7609 | $r4 = true; |
7610 | seq_1: |
7611 | if ($r4!==self::$FAILED) { |
7612 | $this->savedPos = $p5; |
7613 | $r4 = $this->a42($r9); |
7614 | } |
7615 | // free $p7 |
7616 | choice_1: |
7617 | if ($r4!==self::$FAILED) { |
7618 | $r3[] = $r4; |
7619 | } else { |
7620 | break; |
7621 | } |
7622 | } |
7623 | if (count($r3) === 0) { |
7624 | $r3 = self::$FAILED; |
7625 | } |
7626 | // r <- $r3 |
7627 | // free $r4 |
7628 | $r1 = $r3; |
7629 | if ($r1!==self::$FAILED) { |
7630 | $this->savedPos = $p2; |
7631 | $r1 = $this->a60($r3); |
7632 | } |
7633 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7634 | $this->currPos, |
7635 | $r1, |
7636 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7637 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7638 | ); |
7639 | return $r1; |
7640 | } |
7641 | private function parseless_than($silence, $boolParams) { |
7642 | $key = json_encode([422, $boolParams & 0x2]); |
7643 | $bucket = $this->currPos; |
7644 | $cached = $this->cache[$bucket][$key] ?? null; |
7645 | if ($cached) { |
7646 | $this->currPos = $cached->nextPos; |
7647 | |
7648 | return $cached->result; |
7649 | } |
7650 | |
7651 | $p1 = $this->currPos; |
7652 | // start seq_1 |
7653 | $p3 = $this->currPos; |
7654 | if (/*annOrExtTag*/($boolParams & 0x2) !== 0) { |
7655 | $r4 = false; |
7656 | } else { |
7657 | $r4 = self::$FAILED; |
7658 | $r2 = self::$FAILED; |
7659 | goto seq_1; |
7660 | } |
7661 | if (($this->input[$this->currPos] ?? null) === "<") { |
7662 | $this->currPos++; |
7663 | $r5 = "<"; |
7664 | } else { |
7665 | if (!$silence) {$this->fail(44);} |
7666 | $r5 = self::$FAILED; |
7667 | $this->currPos = $p3; |
7668 | $r2 = self::$FAILED; |
7669 | goto seq_1; |
7670 | } |
7671 | $r2 = true; |
7672 | seq_1: |
7673 | if ($r2!==self::$FAILED) { |
7674 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
7675 | } else { |
7676 | $r2 = self::$FAILED; |
7677 | } |
7678 | // free $p3 |
7679 | // free $p1 |
7680 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7681 | $this->currPos, |
7682 | $r2, |
7683 | self::$UNDEFINED, |
7684 | self::$UNDEFINED |
7685 | ); |
7686 | return $r2; |
7687 | } |
7688 | private function parseattribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7689 | $key = json_encode([496, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7690 | $bucket = $this->currPos; |
7691 | $cached = $this->cache[$bucket][$key] ?? null; |
7692 | if ($cached) { |
7693 | $this->currPos = $cached->nextPos; |
7694 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7695 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7696 | return $cached->result; |
7697 | } |
7698 | $saved_preproc=$param_preproc; |
7699 | $saved_th=$param_th; |
7700 | $p2 = $this->currPos; |
7701 | $r3 = []; |
7702 | for (;;) { |
7703 | // start choice_1 |
7704 | $p5 = $this->currPos; |
7705 | $r4 = self::$FAILED; |
7706 | for (;;) { |
7707 | if (strcspn($this->input, "{}&<-|/'>", $this->currPos, 1) !== 0) { |
7708 | $r6 = self::consumeChar($this->input, $this->currPos); |
7709 | $r4 = true; |
7710 | } else { |
7711 | $r6 = self::$FAILED; |
7712 | if (!$silence) {$this->fail(49);} |
7713 | break; |
7714 | } |
7715 | } |
7716 | if ($r4!==self::$FAILED) { |
7717 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7718 | goto choice_1; |
7719 | } else { |
7720 | $r4 = self::$FAILED; |
7721 | } |
7722 | // free $r6 |
7723 | // free $p5 |
7724 | $p5 = $this->currPos; |
7725 | // start seq_1 |
7726 | $p7 = $this->currPos; |
7727 | $p8 = $this->currPos; |
7728 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7729 | if ($r6 === self::$FAILED) { |
7730 | $r6 = false; |
7731 | } else { |
7732 | $r6 = self::$FAILED; |
7733 | $this->currPos = $p8; |
7734 | $r4 = self::$FAILED; |
7735 | goto seq_1; |
7736 | } |
7737 | // free $p8 |
7738 | $p8 = $this->currPos; |
7739 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7740 | $r9 = "/>"; |
7741 | $this->currPos += 2; |
7742 | } else { |
7743 | $r9 = self::$FAILED; |
7744 | } |
7745 | if ($r9 === self::$FAILED) { |
7746 | $r9 = false; |
7747 | } else { |
7748 | $r9 = self::$FAILED; |
7749 | $this->currPos = $p8; |
7750 | $this->currPos = $p7; |
7751 | $r4 = self::$FAILED; |
7752 | goto seq_1; |
7753 | } |
7754 | // free $p8 |
7755 | // start choice_2 |
7756 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7757 | if ($r10!==self::$FAILED) { |
7758 | goto choice_2; |
7759 | } |
7760 | $r10 = $this->parseless_than($silence, $boolParams); |
7761 | if ($r10!==self::$FAILED) { |
7762 | goto choice_2; |
7763 | } |
7764 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
7765 | $r10 = $this->input[$this->currPos++]; |
7766 | } else { |
7767 | $r10 = self::$FAILED; |
7768 | if (!$silence) {$this->fail(50);} |
7769 | } |
7770 | choice_2: |
7771 | // s <- $r10 |
7772 | if ($r10===self::$FAILED) { |
7773 | $this->currPos = $p7; |
7774 | $r4 = self::$FAILED; |
7775 | goto seq_1; |
7776 | } |
7777 | $r4 = true; |
7778 | seq_1: |
7779 | if ($r4!==self::$FAILED) { |
7780 | $this->savedPos = $p5; |
7781 | $r4 = $this->a42($r10); |
7782 | } |
7783 | // free $p7 |
7784 | choice_1: |
7785 | if ($r4!==self::$FAILED) { |
7786 | $r3[] = $r4; |
7787 | } else { |
7788 | break; |
7789 | } |
7790 | } |
7791 | // r <- $r3 |
7792 | // free $r4 |
7793 | $r1 = $r3; |
7794 | if ($r1!==self::$FAILED) { |
7795 | $this->savedPos = $p2; |
7796 | $r1 = $this->a60($r3); |
7797 | } |
7798 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7799 | $this->currPos, |
7800 | $r1, |
7801 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7802 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7803 | ); |
7804 | return $r1; |
7805 | } |
7806 | private function parseattribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7807 | $key = json_encode([498, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7808 | $bucket = $this->currPos; |
7809 | $cached = $this->cache[$bucket][$key] ?? null; |
7810 | if ($cached) { |
7811 | $this->currPos = $cached->nextPos; |
7812 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7813 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7814 | return $cached->result; |
7815 | } |
7816 | $saved_preproc=$param_preproc; |
7817 | $saved_th=$param_th; |
7818 | $p2 = $this->currPos; |
7819 | $r3 = []; |
7820 | for (;;) { |
7821 | // start choice_1 |
7822 | $p5 = $this->currPos; |
7823 | $r4 = self::$FAILED; |
7824 | for (;;) { |
7825 | if (strcspn($this->input, "{}&<-|/\">", $this->currPos, 1) !== 0) { |
7826 | $r6 = self::consumeChar($this->input, $this->currPos); |
7827 | $r4 = true; |
7828 | } else { |
7829 | $r6 = self::$FAILED; |
7830 | if (!$silence) {$this->fail(51);} |
7831 | break; |
7832 | } |
7833 | } |
7834 | if ($r4!==self::$FAILED) { |
7835 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7836 | goto choice_1; |
7837 | } else { |
7838 | $r4 = self::$FAILED; |
7839 | } |
7840 | // free $r6 |
7841 | // free $p5 |
7842 | $p5 = $this->currPos; |
7843 | // start seq_1 |
7844 | $p7 = $this->currPos; |
7845 | $p8 = $this->currPos; |
7846 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7847 | if ($r6 === self::$FAILED) { |
7848 | $r6 = false; |
7849 | } else { |
7850 | $r6 = self::$FAILED; |
7851 | $this->currPos = $p8; |
7852 | $r4 = self::$FAILED; |
7853 | goto seq_1; |
7854 | } |
7855 | // free $p8 |
7856 | $p8 = $this->currPos; |
7857 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7858 | $r9 = "/>"; |
7859 | $this->currPos += 2; |
7860 | } else { |
7861 | $r9 = self::$FAILED; |
7862 | } |
7863 | if ($r9 === self::$FAILED) { |
7864 | $r9 = false; |
7865 | } else { |
7866 | $r9 = self::$FAILED; |
7867 | $this->currPos = $p8; |
7868 | $this->currPos = $p7; |
7869 | $r4 = self::$FAILED; |
7870 | goto seq_1; |
7871 | } |
7872 | // free $p8 |
7873 | // start choice_2 |
7874 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7875 | if ($r10!==self::$FAILED) { |
7876 | goto choice_2; |
7877 | } |
7878 | $r10 = $this->parseless_than($silence, $boolParams); |
7879 | if ($r10!==self::$FAILED) { |
7880 | goto choice_2; |
7881 | } |
7882 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
7883 | $r10 = $this->input[$this->currPos++]; |
7884 | } else { |
7885 | $r10 = self::$FAILED; |
7886 | if (!$silence) {$this->fail(50);} |
7887 | } |
7888 | choice_2: |
7889 | // s <- $r10 |
7890 | if ($r10===self::$FAILED) { |
7891 | $this->currPos = $p7; |
7892 | $r4 = self::$FAILED; |
7893 | goto seq_1; |
7894 | } |
7895 | $r4 = true; |
7896 | seq_1: |
7897 | if ($r4!==self::$FAILED) { |
7898 | $this->savedPos = $p5; |
7899 | $r4 = $this->a42($r10); |
7900 | } |
7901 | // free $p7 |
7902 | choice_1: |
7903 | if ($r4!==self::$FAILED) { |
7904 | $r3[] = $r4; |
7905 | } else { |
7906 | break; |
7907 | } |
7908 | } |
7909 | // r <- $r3 |
7910 | // free $r4 |
7911 | $r1 = $r3; |
7912 | if ($r1!==self::$FAILED) { |
7913 | $this->savedPos = $p2; |
7914 | $r1 = $this->a60($r3); |
7915 | } |
7916 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7917 | $this->currPos, |
7918 | $r1, |
7919 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7920 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7921 | ); |
7922 | return $r1; |
7923 | } |
7924 | private function parseattribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
7925 | $key = json_encode([494, $boolParams & 0x3fff, $param_preproc, $param_th]); |
7926 | $bucket = $this->currPos; |
7927 | $cached = $this->cache[$bucket][$key] ?? null; |
7928 | if ($cached) { |
7929 | $this->currPos = $cached->nextPos; |
7930 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7931 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7932 | return $cached->result; |
7933 | } |
7934 | $saved_preproc=$param_preproc; |
7935 | $saved_th=$param_th; |
7936 | $p2 = $this->currPos; |
7937 | $r3 = []; |
7938 | for (;;) { |
7939 | // start choice_1 |
7940 | $p5 = $this->currPos; |
7941 | $r4 = self::$FAILED; |
7942 | for (;;) { |
7943 | if (strcspn($this->input, "{}&<-|/ \x09\x0a\x0d\x0c>", $this->currPos, 1) !== 0) { |
7944 | $r6 = self::consumeChar($this->input, $this->currPos); |
7945 | $r4 = true; |
7946 | } else { |
7947 | $r6 = self::$FAILED; |
7948 | if (!$silence) {$this->fail(52);} |
7949 | break; |
7950 | } |
7951 | } |
7952 | if ($r4!==self::$FAILED) { |
7953 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7954 | goto choice_1; |
7955 | } else { |
7956 | $r4 = self::$FAILED; |
7957 | } |
7958 | // free $r6 |
7959 | // free $p5 |
7960 | $p5 = $this->currPos; |
7961 | // start seq_1 |
7962 | $p7 = $this->currPos; |
7963 | $p8 = $this->currPos; |
7964 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7965 | if ($r6 === self::$FAILED) { |
7966 | $r6 = false; |
7967 | } else { |
7968 | $r6 = self::$FAILED; |
7969 | $this->currPos = $p8; |
7970 | $r4 = self::$FAILED; |
7971 | goto seq_1; |
7972 | } |
7973 | // free $p8 |
7974 | $p8 = $this->currPos; |
7975 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7976 | $r9 = "/>"; |
7977 | $this->currPos += 2; |
7978 | } else { |
7979 | $r9 = self::$FAILED; |
7980 | } |
7981 | if ($r9 === self::$FAILED) { |
7982 | $r9 = false; |
7983 | } else { |
7984 | $r9 = self::$FAILED; |
7985 | $this->currPos = $p8; |
7986 | $this->currPos = $p7; |
7987 | $r4 = self::$FAILED; |
7988 | goto seq_1; |
7989 | } |
7990 | // free $p8 |
7991 | // start choice_2 |
7992 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7993 | if ($r10!==self::$FAILED) { |
7994 | goto choice_2; |
7995 | } |
7996 | $r10 = $this->parseless_than($silence, $boolParams); |
7997 | if ($r10!==self::$FAILED) { |
7998 | goto choice_2; |
7999 | } |
8000 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
8001 | $r10 = $this->input[$this->currPos++]; |
8002 | } else { |
8003 | $r10 = self::$FAILED; |
8004 | if (!$silence) {$this->fail(50);} |
8005 | } |
8006 | choice_2: |
8007 | // s <- $r10 |
8008 | if ($r10===self::$FAILED) { |
8009 | $this->currPos = $p7; |
8010 | $r4 = self::$FAILED; |
8011 | goto seq_1; |
8012 | } |
8013 | $r4 = true; |
8014 | seq_1: |
8015 | if ($r4!==self::$FAILED) { |
8016 | $this->savedPos = $p5; |
8017 | $r4 = $this->a42($r10); |
8018 | } |
8019 | // free $p7 |
8020 | choice_1: |
8021 | if ($r4!==self::$FAILED) { |
8022 | $r3[] = $r4; |
8023 | } else { |
8024 | break; |
8025 | } |
8026 | } |
8027 | if (count($r3) === 0) { |
8028 | $r3 = self::$FAILED; |
8029 | } |
8030 | // r <- $r3 |
8031 | // free $r4 |
8032 | $r1 = $r3; |
8033 | if ($r1!==self::$FAILED) { |
8034 | $this->savedPos = $p2; |
8035 | $r1 = $this->a60($r3); |
8036 | } |
8037 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8038 | $this->currPos, |
8039 | $r1, |
8040 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8041 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8042 | ); |
8043 | return $r1; |
8044 | } |
8045 | private function parseautolink($silence, $boolParams, &$param_preproc, &$param_th) { |
8046 | $key = json_encode([316, $boolParams & 0x3fff, $param_preproc, $param_th]); |
8047 | $bucket = $this->currPos; |
8048 | $cached = $this->cache[$bucket][$key] ?? null; |
8049 | if ($cached) { |
8050 | $this->currPos = $cached->nextPos; |
8051 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8052 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8053 | return $cached->result; |
8054 | } |
8055 | $saved_preproc=$param_preproc; |
8056 | $saved_th=$param_th; |
8057 | $p2 = $this->currPos; |
8058 | // start seq_1 |
8059 | $p3 = $this->currPos; |
8060 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
8061 | $r4 = false; |
8062 | } else { |
8063 | $r4 = self::$FAILED; |
8064 | $r1 = self::$FAILED; |
8065 | goto seq_1; |
8066 | } |
8067 | $this->savedPos = $this->currPos; |
8068 | $r5 = $this->a78(); |
8069 | if (!$r5) { |
8070 | $r5 = false; |
8071 | } else { |
8072 | $r5 = self::$FAILED; |
8073 | $this->currPos = $p3; |
8074 | $r1 = self::$FAILED; |
8075 | goto seq_1; |
8076 | } |
8077 | // start choice_1 |
8078 | $r6 = $this->parseautourl($silence, $boolParams, $param_preproc, $param_th); |
8079 | if ($r6!==self::$FAILED) { |
8080 | goto choice_1; |
8081 | } |
8082 | $r6 = $this->parseautoref($silence); |
8083 | if ($r6!==self::$FAILED) { |
8084 | goto choice_1; |
8085 | } |
8086 | $r6 = $this->parseisbn($silence); |
8087 | choice_1: |
8088 | // r <- $r6 |
8089 | if ($r6===self::$FAILED) { |
8090 | $this->currPos = $p3; |
8091 | $r1 = self::$FAILED; |
8092 | goto seq_1; |
8093 | } |
8094 | $r1 = true; |
8095 | seq_1: |
8096 | if ($r1!==self::$FAILED) { |
8097 | $this->savedPos = $p2; |
8098 | $r1 = $this->a24($r6); |
8099 | } |
8100 | // free $p3 |
8101 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8102 | $this->currPos, |
8103 | $r1, |
8104 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8105 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8106 | ); |
8107 | return $r1; |
8108 | } |
8109 | private function parsebehavior_switch($silence) { |
8110 | $key = 312; |
8111 | $bucket = $this->currPos; |
8112 | $cached = $this->cache[$bucket][$key] ?? null; |
8113 | if ($cached) { |
8114 | $this->currPos = $cached->nextPos; |
8115 | |
8116 | return $cached->result; |
8117 | } |
8118 | |
8119 | $p2 = $this->currPos; |
8120 | $p4 = $this->currPos; |
8121 | // start seq_1 |
8122 | $p5 = $this->currPos; |
8123 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8124 | $r6 = "__"; |
8125 | $this->currPos += 2; |
8126 | } else { |
8127 | if (!$silence) {$this->fail(53);} |
8128 | $r6 = self::$FAILED; |
8129 | $r3 = self::$FAILED; |
8130 | goto seq_1; |
8131 | } |
8132 | $r7 = $this->discardbehavior_text($silence); |
8133 | if ($r7===self::$FAILED) { |
8134 | $this->currPos = $p5; |
8135 | $r3 = self::$FAILED; |
8136 | goto seq_1; |
8137 | } |
8138 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8139 | $r8 = "__"; |
8140 | $this->currPos += 2; |
8141 | } else { |
8142 | if (!$silence) {$this->fail(53);} |
8143 | $r8 = self::$FAILED; |
8144 | $this->currPos = $p5; |
8145 | $r3 = self::$FAILED; |
8146 | goto seq_1; |
8147 | } |
8148 | $r3 = true; |
8149 | seq_1: |
8150 | // bs <- $r3 |
8151 | if ($r3!==self::$FAILED) { |
8152 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8153 | } else { |
8154 | $r3 = self::$FAILED; |
8155 | } |
8156 | // free $p5 |
8157 | // free $p4 |
8158 | $r1 = $r3; |
8159 | if ($r1!==self::$FAILED) { |
8160 | $this->savedPos = $p2; |
8161 | $r1 = $this->a79($r3); |
8162 | } |
8163 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8164 | $this->currPos, |
8165 | $r1, |
8166 | self::$UNDEFINED, |
8167 | self::$UNDEFINED |
8168 | ); |
8169 | return $r1; |
8170 | } |
8171 | private function parsetext_char($silence) { |
8172 | $key = 476; |
8173 | $bucket = $this->currPos; |
8174 | $cached = $this->cache[$bucket][$key] ?? null; |
8175 | if ($cached) { |
8176 | $this->currPos = $cached->nextPos; |
8177 | |
8178 | return $cached->result; |
8179 | } |
8180 | |
8181 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
8182 | $r1 = self::consumeChar($this->input, $this->currPos); |
8183 | } else { |
8184 | $r1 = self::$FAILED; |
8185 | if (!$silence) {$this->fail(54);} |
8186 | } |
8187 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8188 | $this->currPos, |
8189 | $r1, |
8190 | self::$UNDEFINED, |
8191 | self::$UNDEFINED |
8192 | ); |
8193 | return $r1; |
8194 | } |
8195 | private function parselang_variant_or_tpl($silence, $boolParams, &$param_th, &$param_preproc) { |
8196 | $key = json_encode([358, $boolParams & 0x3fff, $param_th, $param_preproc]); |
8197 | $bucket = $this->currPos; |
8198 | $cached = $this->cache[$bucket][$key] ?? null; |
8199 | if ($cached) { |
8200 | $this->currPos = $cached->nextPos; |
8201 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8202 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8203 | return $cached->result; |
8204 | } |
8205 | $saved_th=$param_th; |
8206 | $saved_preproc=$param_preproc; |
8207 | // start choice_1 |
8208 | $p2 = $this->currPos; |
8209 | // start seq_1 |
8210 | $p3 = $this->currPos; |
8211 | $p4 = $this->currPos; |
8212 | // start seq_2 |
8213 | $p6 = $this->currPos; |
8214 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8215 | $r7 = "-{"; |
8216 | $this->currPos += 2; |
8217 | } else { |
8218 | $r7 = self::$FAILED; |
8219 | $r5 = self::$FAILED; |
8220 | goto seq_2; |
8221 | } |
8222 | $p8 = $this->currPos; |
8223 | // start seq_3 |
8224 | $p10 = $this->currPos; |
8225 | $r11 = self::$FAILED; |
8226 | for (;;) { |
8227 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8228 | $r12 = "{{{"; |
8229 | $this->currPos += 3; |
8230 | $r11 = true; |
8231 | } else { |
8232 | $r12 = self::$FAILED; |
8233 | break; |
8234 | } |
8235 | } |
8236 | if ($r11===self::$FAILED) { |
8237 | $r9 = self::$FAILED; |
8238 | goto seq_3; |
8239 | } |
8240 | // free $r12 |
8241 | $p13 = $this->currPos; |
8242 | if (($this->input[$this->currPos] ?? null) === "{") { |
8243 | $this->currPos++; |
8244 | $r12 = "{"; |
8245 | } else { |
8246 | $r12 = self::$FAILED; |
8247 | } |
8248 | if ($r12 === self::$FAILED) { |
8249 | $r12 = false; |
8250 | } else { |
8251 | $r12 = self::$FAILED; |
8252 | $this->currPos = $p13; |
8253 | $this->currPos = $p10; |
8254 | $r9 = self::$FAILED; |
8255 | goto seq_3; |
8256 | } |
8257 | // free $p13 |
8258 | $r9 = true; |
8259 | seq_3: |
8260 | if ($r9!==self::$FAILED) { |
8261 | $r9 = false; |
8262 | $this->currPos = $p8; |
8263 | } else { |
8264 | $this->currPos = $p6; |
8265 | $r5 = self::$FAILED; |
8266 | goto seq_2; |
8267 | } |
8268 | // free $p10 |
8269 | // free $p8 |
8270 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
8271 | if ($r14===self::$FAILED) { |
8272 | $this->currPos = $p6; |
8273 | $r5 = self::$FAILED; |
8274 | goto seq_2; |
8275 | } |
8276 | $r5 = true; |
8277 | seq_2: |
8278 | if ($r5!==self::$FAILED) { |
8279 | $r5 = false; |
8280 | $this->currPos = $p4; |
8281 | } else { |
8282 | $r1 = self::$FAILED; |
8283 | goto seq_1; |
8284 | } |
8285 | // free $p6 |
8286 | // free $p4 |
8287 | $r15 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8288 | // a <- $r15 |
8289 | if ($r15===self::$FAILED) { |
8290 | $this->currPos = $p3; |
8291 | $r1 = self::$FAILED; |
8292 | goto seq_1; |
8293 | } |
8294 | $r1 = true; |
8295 | seq_1: |
8296 | if ($r1!==self::$FAILED) { |
8297 | $this->savedPos = $p2; |
8298 | $r1 = $this->a51($r15); |
8299 | goto choice_1; |
8300 | } |
8301 | // free $p3 |
8302 | $p3 = $this->currPos; |
8303 | // start seq_4 |
8304 | $p4 = $this->currPos; |
8305 | $p6 = $this->currPos; |
8306 | // start seq_5 |
8307 | $p8 = $this->currPos; |
8308 | if (($this->input[$this->currPos] ?? null) === "-") { |
8309 | $this->currPos++; |
8310 | $r17 = "-"; |
8311 | } else { |
8312 | if (!$silence) {$this->fail(55);} |
8313 | $r17 = self::$FAILED; |
8314 | $r16 = self::$FAILED; |
8315 | goto seq_5; |
8316 | } |
8317 | $p10 = $this->currPos; |
8318 | // start seq_6 |
8319 | $p13 = $this->currPos; |
8320 | $r19 = self::$FAILED; |
8321 | for (;;) { |
8322 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8323 | $r20 = "{{{"; |
8324 | $this->currPos += 3; |
8325 | $r19 = true; |
8326 | } else { |
8327 | $r20 = self::$FAILED; |
8328 | break; |
8329 | } |
8330 | } |
8331 | if ($r19===self::$FAILED) { |
8332 | $r18 = self::$FAILED; |
8333 | goto seq_6; |
8334 | } |
8335 | // free $r20 |
8336 | $p21 = $this->currPos; |
8337 | if (($this->input[$this->currPos] ?? null) === "{") { |
8338 | $this->currPos++; |
8339 | $r20 = "{"; |
8340 | } else { |
8341 | $r20 = self::$FAILED; |
8342 | } |
8343 | if ($r20 === self::$FAILED) { |
8344 | $r20 = false; |
8345 | } else { |
8346 | $r20 = self::$FAILED; |
8347 | $this->currPos = $p21; |
8348 | $this->currPos = $p13; |
8349 | $r18 = self::$FAILED; |
8350 | goto seq_6; |
8351 | } |
8352 | // free $p21 |
8353 | $r18 = true; |
8354 | seq_6: |
8355 | if ($r18!==self::$FAILED) { |
8356 | $r18 = false; |
8357 | $this->currPos = $p10; |
8358 | } else { |
8359 | $this->currPos = $p8; |
8360 | $r16 = self::$FAILED; |
8361 | goto seq_5; |
8362 | } |
8363 | // free $p13 |
8364 | // free $p10 |
8365 | $r16 = true; |
8366 | seq_5: |
8367 | // a <- $r16 |
8368 | if ($r16!==self::$FAILED) { |
8369 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
8370 | } else { |
8371 | $r16 = self::$FAILED; |
8372 | $r1 = self::$FAILED; |
8373 | goto seq_4; |
8374 | } |
8375 | // free $p8 |
8376 | // free $p6 |
8377 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
8378 | // b <- $r22 |
8379 | if ($r22===self::$FAILED) { |
8380 | $this->currPos = $p4; |
8381 | $r1 = self::$FAILED; |
8382 | goto seq_4; |
8383 | } |
8384 | $r1 = true; |
8385 | seq_4: |
8386 | if ($r1!==self::$FAILED) { |
8387 | $this->savedPos = $p3; |
8388 | $r1 = $this->a52($r16, $r22); |
8389 | goto choice_1; |
8390 | } |
8391 | // free $p4 |
8392 | $p4 = $this->currPos; |
8393 | // start seq_7 |
8394 | $p6 = $this->currPos; |
8395 | $p8 = $this->currPos; |
8396 | // start seq_8 |
8397 | $p10 = $this->currPos; |
8398 | if (($this->input[$this->currPos] ?? null) === "-") { |
8399 | $this->currPos++; |
8400 | $r24 = "-"; |
8401 | } else { |
8402 | if (!$silence) {$this->fail(55);} |
8403 | $r24 = self::$FAILED; |
8404 | $r23 = self::$FAILED; |
8405 | goto seq_8; |
8406 | } |
8407 | $p13 = $this->currPos; |
8408 | // start seq_9 |
8409 | $p21 = $this->currPos; |
8410 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
8411 | $r26 = "{{"; |
8412 | $this->currPos += 2; |
8413 | } else { |
8414 | $r26 = self::$FAILED; |
8415 | $r25 = self::$FAILED; |
8416 | goto seq_9; |
8417 | } |
8418 | for (;;) { |
8419 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8420 | $r28 = "{{{"; |
8421 | $this->currPos += 3; |
8422 | } else { |
8423 | $r28 = self::$FAILED; |
8424 | break; |
8425 | } |
8426 | } |
8427 | // free $r28 |
8428 | $r27 = true; |
8429 | if ($r27===self::$FAILED) { |
8430 | $this->currPos = $p21; |
8431 | $r25 = self::$FAILED; |
8432 | goto seq_9; |
8433 | } |
8434 | // free $r27 |
8435 | $p29 = $this->currPos; |
8436 | if (($this->input[$this->currPos] ?? null) === "{") { |
8437 | $this->currPos++; |
8438 | $r27 = "{"; |
8439 | } else { |
8440 | $r27 = self::$FAILED; |
8441 | } |
8442 | if ($r27 === self::$FAILED) { |
8443 | $r27 = false; |
8444 | } else { |
8445 | $r27 = self::$FAILED; |
8446 | $this->currPos = $p29; |
8447 | $this->currPos = $p21; |
8448 | $r25 = self::$FAILED; |
8449 | goto seq_9; |
8450 | } |
8451 | // free $p29 |
8452 | $r25 = true; |
8453 | seq_9: |
8454 | if ($r25!==self::$FAILED) { |
8455 | $r25 = false; |
8456 | $this->currPos = $p13; |
8457 | } else { |
8458 | $this->currPos = $p10; |
8459 | $r23 = self::$FAILED; |
8460 | goto seq_8; |
8461 | } |
8462 | // free $p21 |
8463 | // free $p13 |
8464 | $r23 = true; |
8465 | seq_8: |
8466 | // a <- $r23 |
8467 | if ($r23!==self::$FAILED) { |
8468 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
8469 | } else { |
8470 | $r23 = self::$FAILED; |
8471 | $r1 = self::$FAILED; |
8472 | goto seq_7; |
8473 | } |
8474 | // free $p10 |
8475 | // free $p8 |
8476 | $r28 = $this->parsetemplate($silence, $boolParams, $param_th); |
8477 | // b <- $r28 |
8478 | if ($r28===self::$FAILED) { |
8479 | $this->currPos = $p6; |
8480 | $r1 = self::$FAILED; |
8481 | goto seq_7; |
8482 | } |
8483 | $r1 = true; |
8484 | seq_7: |
8485 | if ($r1!==self::$FAILED) { |
8486 | $this->savedPos = $p4; |
8487 | $r1 = $this->a52($r23, $r28); |
8488 | goto choice_1; |
8489 | } |
8490 | // free $p6 |
8491 | $p6 = $this->currPos; |
8492 | // start seq_10 |
8493 | $p8 = $this->currPos; |
8494 | $p10 = $this->currPos; |
8495 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8496 | $r30 = "-{"; |
8497 | $this->currPos += 2; |
8498 | $r30 = false; |
8499 | $this->currPos = $p10; |
8500 | } else { |
8501 | $r30 = self::$FAILED; |
8502 | $r1 = self::$FAILED; |
8503 | goto seq_10; |
8504 | } |
8505 | // free $p10 |
8506 | $r31 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8507 | // a <- $r31 |
8508 | if ($r31===self::$FAILED) { |
8509 | $this->currPos = $p8; |
8510 | $r1 = self::$FAILED; |
8511 | goto seq_10; |
8512 | } |
8513 | $r1 = true; |
8514 | seq_10: |
8515 | if ($r1!==self::$FAILED) { |
8516 | $this->savedPos = $p6; |
8517 | $r1 = $this->a51($r31); |
8518 | } |
8519 | // free $p8 |
8520 | choice_1: |
8521 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8522 | $this->currPos, |
8523 | $r1, |
8524 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8525 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8526 | ); |
8527 | return $r1; |
8528 | } |
8529 | private function parsewikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
8530 | $key = json_encode([390, $boolParams & 0x3fff, $param_th, $param_preproc]); |
8531 | $bucket = $this->currPos; |
8532 | $cached = $this->cache[$bucket][$key] ?? null; |
8533 | if ($cached) { |
8534 | $this->currPos = $cached->nextPos; |
8535 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8536 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8537 | return $cached->result; |
8538 | } |
8539 | $saved_th=$param_th; |
8540 | $saved_preproc=$param_preproc; |
8541 | // start choice_1 |
8542 | $r1 = $this->parsewikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
8543 | if ($r1!==self::$FAILED) { |
8544 | goto choice_1; |
8545 | } |
8546 | $r1 = $this->parsebroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
8547 | choice_1: |
8548 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8549 | $this->currPos, |
8550 | $r1, |
8551 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8552 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8553 | ); |
8554 | return $r1; |
8555 | } |
8556 | private function parsequote($silence) { |
8557 | $key = 400; |
8558 | $bucket = $this->currPos; |
8559 | $cached = $this->cache[$bucket][$key] ?? null; |
8560 | if ($cached) { |
8561 | $this->currPos = $cached->nextPos; |
8562 | |
8563 | return $cached->result; |
8564 | } |
8565 | |
8566 | $p2 = $this->currPos; |
8567 | $p4 = $this->currPos; |
8568 | // start seq_1 |
8569 | $p5 = $this->currPos; |
8570 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "''", $this->currPos, 2, false) === 0) { |
8571 | $r6 = "''"; |
8572 | $this->currPos += 2; |
8573 | } else { |
8574 | if (!$silence) {$this->fail(56);} |
8575 | $r6 = self::$FAILED; |
8576 | $r3 = self::$FAILED; |
8577 | goto seq_1; |
8578 | } |
8579 | for (;;) { |
8580 | if (($this->input[$this->currPos] ?? null) === "'") { |
8581 | $this->currPos++; |
8582 | $r8 = "'"; |
8583 | } else { |
8584 | if (!$silence) {$this->fail(33);} |
8585 | $r8 = self::$FAILED; |
8586 | break; |
8587 | } |
8588 | } |
8589 | // free $r8 |
8590 | $r7 = true; |
8591 | if ($r7===self::$FAILED) { |
8592 | $this->currPos = $p5; |
8593 | $r3 = self::$FAILED; |
8594 | goto seq_1; |
8595 | } |
8596 | // free $r7 |
8597 | $r3 = true; |
8598 | seq_1: |
8599 | // quotes <- $r3 |
8600 | if ($r3!==self::$FAILED) { |
8601 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8602 | } else { |
8603 | $r3 = self::$FAILED; |
8604 | } |
8605 | // free $p5 |
8606 | // free $p4 |
8607 | $r1 = $r3; |
8608 | if ($r1!==self::$FAILED) { |
8609 | $this->savedPos = $p2; |
8610 | $r1 = $this->a80($r3); |
8611 | } |
8612 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8613 | $this->currPos, |
8614 | $r1, |
8615 | self::$UNDEFINED, |
8616 | self::$UNDEFINED |
8617 | ); |
8618 | return $r1; |
8619 | } |
8620 | private function parsetable_content_line($silence, $boolParams, &$param_preproc, &$param_th) { |
8621 | $key = json_encode([452, $boolParams & 0x3fff, $param_preproc, $param_th]); |
8622 | $bucket = $this->currPos; |
8623 | $cached = $this->cache[$bucket][$key] ?? null; |
8624 | if ($cached) { |
8625 | $this->currPos = $cached->nextPos; |
8626 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8627 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8628 | return $cached->result; |
8629 | } |
8630 | $saved_preproc=$param_preproc; |
8631 | $saved_th=$param_th; |
8632 | // start seq_1 |
8633 | $p1 = $this->currPos; |
8634 | $r3 = []; |
8635 | for (;;) { |
8636 | // start choice_1 |
8637 | $r4 = $this->parsespace($silence); |
8638 | if ($r4!==self::$FAILED) { |
8639 | goto choice_1; |
8640 | } |
8641 | $r4 = $this->parsecomment($silence); |
8642 | choice_1: |
8643 | if ($r4!==self::$FAILED) { |
8644 | $r3[] = $r4; |
8645 | } else { |
8646 | break; |
8647 | } |
8648 | } |
8649 | // free $r4 |
8650 | // start choice_2 |
8651 | $r4 = $this->parsetable_heading_tags($silence, $boolParams, $param_preproc); |
8652 | if ($r4!==self::$FAILED) { |
8653 | goto choice_2; |
8654 | } |
8655 | $r4 = $this->parsetable_row_tag($silence, $boolParams, $param_preproc, $param_th); |
8656 | if ($r4!==self::$FAILED) { |
8657 | goto choice_2; |
8658 | } |
8659 | $r4 = $this->parsetable_data_tags($silence, $boolParams, $param_preproc, $param_th); |
8660 | if ($r4!==self::$FAILED) { |
8661 | goto choice_2; |
8662 | } |
8663 | $r4 = $this->parsetable_caption_tag($silence, $boolParams, $param_preproc, $param_th); |
8664 | choice_2: |
8665 | if ($r4===self::$FAILED) { |
8666 | $this->currPos = $p1; |
8667 | $r2 = self::$FAILED; |
8668 | goto seq_1; |
8669 | } |
8670 | $r2 = [$r3,$r4]; |
8671 | seq_1: |
8672 | // free $r2,$p1 |
8673 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8674 | $this->currPos, |
8675 | $r2, |
8676 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8677 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8678 | ); |
8679 | return $r2; |
8680 | } |
8681 | private function parsetable_end_tag($silence) { |
8682 | $key = 472; |
8683 | $bucket = $this->currPos; |
8684 | $cached = $this->cache[$bucket][$key] ?? null; |
8685 | if ($cached) { |
8686 | $this->currPos = $cached->nextPos; |
8687 | |
8688 | return $cached->result; |
8689 | } |
8690 | |
8691 | $p2 = $this->currPos; |
8692 | // start seq_1 |
8693 | $p3 = $this->currPos; |
8694 | $r4 = []; |
8695 | for (;;) { |
8696 | // start choice_1 |
8697 | $r5 = $this->parsespace($silence); |
8698 | if ($r5!==self::$FAILED) { |
8699 | goto choice_1; |
8700 | } |
8701 | $r5 = $this->parsecomment($silence); |
8702 | choice_1: |
8703 | if ($r5!==self::$FAILED) { |
8704 | $r4[] = $r5; |
8705 | } else { |
8706 | break; |
8707 | } |
8708 | } |
8709 | // sc <- $r4 |
8710 | // free $r5 |
8711 | $p6 = $this->currPos; |
8712 | $r5 = ''; |
8713 | // startPos <- $r5 |
8714 | if ($r5!==self::$FAILED) { |
8715 | $this->savedPos = $p6; |
8716 | $r5 = $this->a5($r4); |
8717 | } else { |
8718 | $this->currPos = $p3; |
8719 | $r1 = self::$FAILED; |
8720 | goto seq_1; |
8721 | } |
8722 | $r7 = $this->parsepipe($silence); |
8723 | // p <- $r7 |
8724 | if ($r7===self::$FAILED) { |
8725 | $this->currPos = $p3; |
8726 | $r1 = self::$FAILED; |
8727 | goto seq_1; |
8728 | } |
8729 | // b <- $r8 |
8730 | if (($this->input[$this->currPos] ?? null) === "}") { |
8731 | $this->currPos++; |
8732 | $r8 = "}"; |
8733 | } else { |
8734 | if (!$silence) {$this->fail(57);} |
8735 | $r8 = self::$FAILED; |
8736 | $this->currPos = $p3; |
8737 | $r1 = self::$FAILED; |
8738 | goto seq_1; |
8739 | } |
8740 | $r1 = true; |
8741 | seq_1: |
8742 | if ($r1!==self::$FAILED) { |
8743 | $this->savedPos = $p2; |
8744 | $r1 = $this->a81($r4, $r5, $r7, $r8); |
8745 | } |
8746 | // free $p3 |
8747 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8748 | $this->currPos, |
8749 | $r1, |
8750 | self::$UNDEFINED, |
8751 | self::$UNDEFINED |
8752 | ); |
8753 | return $r1; |
8754 | } |
8755 | private function parseempty_line_with_comments($silence) { |
8756 | $key = 546; |
8757 | $bucket = $this->currPos; |
8758 | $cached = $this->cache[$bucket][$key] ?? null; |
8759 | if ($cached) { |
8760 | $this->currPos = $cached->nextPos; |
8761 | |
8762 | return $cached->result; |
8763 | } |
8764 | |
8765 | $p2 = $this->currPos; |
8766 | // start seq_1 |
8767 | $p3 = $this->currPos; |
8768 | $r4 = $this->parsesol_prefix($silence); |
8769 | // sp <- $r4 |
8770 | if ($r4===self::$FAILED) { |
8771 | $r1 = self::$FAILED; |
8772 | goto seq_1; |
8773 | } |
8774 | $p6 = $this->currPos; |
8775 | $r5 = ''; |
8776 | // p <- $r5 |
8777 | if ($r5!==self::$FAILED) { |
8778 | $this->savedPos = $p6; |
8779 | $r5 = $this->a82($r4); |
8780 | } else { |
8781 | $this->currPos = $p3; |
8782 | $r1 = self::$FAILED; |
8783 | goto seq_1; |
8784 | } |
8785 | $r7 = []; |
8786 | for (;;) { |
8787 | // start seq_2 |
8788 | $p9 = $this->currPos; |
8789 | $r10 = []; |
8790 | for (;;) { |
8791 | $r11 = $this->parsespace($silence); |
8792 | if ($r11!==self::$FAILED) { |
8793 | $r10[] = $r11; |
8794 | } else { |
8795 | break; |
8796 | } |
8797 | } |
8798 | // free $r11 |
8799 | $r11 = $this->parsecomment($silence); |
8800 | if ($r11===self::$FAILED) { |
8801 | $this->currPos = $p9; |
8802 | $r8 = self::$FAILED; |
8803 | goto seq_2; |
8804 | } |
8805 | $r12 = []; |
8806 | for (;;) { |
8807 | // start choice_1 |
8808 | $r13 = $this->parsespace($silence); |
8809 | if ($r13!==self::$FAILED) { |
8810 | goto choice_1; |
8811 | } |
8812 | $r13 = $this->parsecomment($silence); |
8813 | choice_1: |
8814 | if ($r13!==self::$FAILED) { |
8815 | $r12[] = $r13; |
8816 | } else { |
8817 | break; |
8818 | } |
8819 | } |
8820 | // free $r13 |
8821 | $r13 = $this->parsenewline($silence); |
8822 | if ($r13===self::$FAILED) { |
8823 | $this->currPos = $p9; |
8824 | $r8 = self::$FAILED; |
8825 | goto seq_2; |
8826 | } |
8827 | $r8 = [$r10,$r11,$r12,$r13]; |
8828 | seq_2: |
8829 | if ($r8!==self::$FAILED) { |
8830 | $r7[] = $r8; |
8831 | } else { |
8832 | break; |
8833 | } |
8834 | // free $p9 |
8835 | } |
8836 | if (count($r7) === 0) { |
8837 | $r7 = self::$FAILED; |
8838 | } |
8839 | // c <- $r7 |
8840 | if ($r7===self::$FAILED) { |
8841 | $this->currPos = $p3; |
8842 | $r1 = self::$FAILED; |
8843 | goto seq_1; |
8844 | } |
8845 | // free $r8 |
8846 | $r1 = true; |
8847 | seq_1: |
8848 | if ($r1!==self::$FAILED) { |
8849 | $this->savedPos = $p2; |
8850 | $r1 = $this->a83($r4, $r5, $r7); |
8851 | } |
8852 | // free $p3 |
8853 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8854 | $this->currPos, |
8855 | $r1, |
8856 | self::$UNDEFINED, |
8857 | self::$UNDEFINED |
8858 | ); |
8859 | return $r1; |
8860 | } |
8861 | private function parsesol_prefix($silence) { |
8862 | $key = 544; |
8863 | $bucket = $this->currPos; |
8864 | $cached = $this->cache[$bucket][$key] ?? null; |
8865 | if ($cached) { |
8866 | $this->currPos = $cached->nextPos; |
8867 | |
8868 | return $cached->result; |
8869 | } |
8870 | |
8871 | // start choice_1 |
8872 | $r1 = $this->parsenewlineToken($silence); |
8873 | if ($r1!==self::$FAILED) { |
8874 | goto choice_1; |
8875 | } |
8876 | $p2 = $this->currPos; |
8877 | $this->savedPos = $this->currPos; |
8878 | $r1 = $this->a84(); |
8879 | if ($r1) { |
8880 | $r1 = false; |
8881 | $this->savedPos = $p2; |
8882 | $r1 = $this->a85(); |
8883 | } else { |
8884 | $r1 = self::$FAILED; |
8885 | } |
8886 | choice_1: |
8887 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8888 | $this->currPos, |
8889 | $r1, |
8890 | self::$UNDEFINED, |
8891 | self::$UNDEFINED |
8892 | ); |
8893 | return $r1; |
8894 | } |
8895 | private function parseredirect_word($silence) { |
8896 | $key = 286; |
8897 | $bucket = $this->currPos; |
8898 | $cached = $this->cache[$bucket][$key] ?? null; |
8899 | if ($cached) { |
8900 | $this->currPos = $cached->nextPos; |
8901 | |
8902 | return $cached->result; |
8903 | } |
8904 | |
8905 | $p1 = $this->currPos; |
8906 | // start seq_1 |
8907 | $p3 = $this->currPos; |
8908 | for (;;) { |
8909 | if (strspn($this->input, " \x09\x0a\x0d\x00\x0b", $this->currPos, 1) !== 0) { |
8910 | $r5 = $this->input[$this->currPos++]; |
8911 | } else { |
8912 | $r5 = self::$FAILED; |
8913 | if (!$silence) {$this->fail(58);} |
8914 | break; |
8915 | } |
8916 | } |
8917 | // free $r5 |
8918 | $r4 = true; |
8919 | if ($r4===self::$FAILED) { |
8920 | $r2 = self::$FAILED; |
8921 | goto seq_1; |
8922 | } |
8923 | // free $r4 |
8924 | $p6 = $this->currPos; |
8925 | $r4 = self::$FAILED; |
8926 | for (;;) { |
8927 | // start seq_2 |
8928 | $p7 = $this->currPos; |
8929 | $p8 = $this->currPos; |
8930 | $r9 = $this->discardspace_or_newline(true); |
8931 | if ($r9 === self::$FAILED) { |
8932 | $r9 = false; |
8933 | } else { |
8934 | $r9 = self::$FAILED; |
8935 | $this->currPos = $p8; |
8936 | $r5 = self::$FAILED; |
8937 | goto seq_2; |
8938 | } |
8939 | // free $p8 |
8940 | $p8 = $this->currPos; |
8941 | $r10 = $this->input[$this->currPos] ?? ''; |
8942 | if ($r10 === ":" || $r10 === "[") { |
8943 | $this->currPos++; |
8944 | } else { |
8945 | $r10 = self::$FAILED; |
8946 | } |
8947 | if ($r10 === self::$FAILED) { |
8948 | $r10 = false; |
8949 | } else { |
8950 | $r10 = self::$FAILED; |
8951 | $this->currPos = $p8; |
8952 | $this->currPos = $p7; |
8953 | $r5 = self::$FAILED; |
8954 | goto seq_2; |
8955 | } |
8956 | // free $p8 |
8957 | if ($this->currPos < $this->inputLength) { |
8958 | $r11 = self::consumeChar($this->input, $this->currPos);; |
8959 | } else { |
8960 | $r11 = self::$FAILED; |
8961 | if (!$silence) {$this->fail(7);} |
8962 | $this->currPos = $p7; |
8963 | $r5 = self::$FAILED; |
8964 | goto seq_2; |
8965 | } |
8966 | $r5 = true; |
8967 | seq_2: |
8968 | if ($r5!==self::$FAILED) { |
8969 | $r4 = true; |
8970 | } else { |
8971 | break; |
8972 | } |
8973 | // free $p7 |
8974 | } |
8975 | // rw <- $r4 |
8976 | if ($r4!==self::$FAILED) { |
8977 | $r4 = substr($this->input, $p6, $this->currPos - $p6); |
8978 | } else { |
8979 | $r4 = self::$FAILED; |
8980 | $this->currPos = $p3; |
8981 | $r2 = self::$FAILED; |
8982 | goto seq_1; |
8983 | } |
8984 | // free $r5 |
8985 | // free $p6 |
8986 | $this->savedPos = $this->currPos; |
8987 | $r5 = $this->a86($r4); |
8988 | if ($r5) { |
8989 | $r5 = false; |
8990 | } else { |
8991 | $r5 = self::$FAILED; |
8992 | $this->currPos = $p3; |
8993 | $r2 = self::$FAILED; |
8994 | goto seq_1; |
8995 | } |
8996 | $r2 = true; |
8997 | seq_1: |
8998 | if ($r2!==self::$FAILED) { |
8999 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
9000 | } else { |
9001 | $r2 = self::$FAILED; |
9002 | } |
9003 | // free $p3 |
9004 | // free $p1 |
9005 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9006 | $this->currPos, |
9007 | $r2, |
9008 | self::$UNDEFINED, |
9009 | self::$UNDEFINED |
9010 | ); |
9011 | return $r2; |
9012 | } |
9013 | private function parseinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) { |
9014 | $key = json_encode([484, $boolParams & 0x3ebd, $param_preproc, $param_th]); |
9015 | $bucket = $this->currPos; |
9016 | $cached = $this->cache[$bucket][$key] ?? null; |
9017 | if ($cached) { |
9018 | $this->currPos = $cached->nextPos; |
9019 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9020 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9021 | return $cached->result; |
9022 | } |
9023 | $saved_preproc=$param_preproc; |
9024 | $saved_th=$param_th; |
9025 | $p2 = $this->currPos; |
9026 | // start seq_1 |
9027 | $p3 = $this->currPos; |
9028 | $p4 = $this->currPos; |
9029 | // start seq_2 |
9030 | $p6 = $this->currPos; |
9031 | if (($this->input[$this->currPos] ?? null) === "<") { |
9032 | $this->currPos++; |
9033 | $r7 = "<"; |
9034 | } else { |
9035 | $r7 = self::$FAILED; |
9036 | $r5 = self::$FAILED; |
9037 | goto seq_2; |
9038 | } |
9039 | if (($this->input[$this->currPos] ?? null) === "/") { |
9040 | $this->currPos++; |
9041 | $r8 = "/"; |
9042 | } else { |
9043 | $r8 = self::$FAILED; |
9044 | $r8 = null; |
9045 | } |
9046 | // start choice_1 |
9047 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "includeonly", $this->currPos, 11, true) === 0) { |
9048 | $r9 = substr($this->input, $this->currPos, 11); |
9049 | $this->currPos += 11; |
9050 | goto choice_1; |
9051 | } else { |
9052 | $r9 = self::$FAILED; |
9053 | } |
9054 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "noinclude", $this->currPos, 9, true) === 0) { |
9055 | $r9 = substr($this->input, $this->currPos, 9); |
9056 | $this->currPos += 9; |
9057 | goto choice_1; |
9058 | } else { |
9059 | $r9 = self::$FAILED; |
9060 | } |
9061 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "onlyinclude", $this->currPos, 11, true) === 0) { |
9062 | $r9 = substr($this->input, $this->currPos, 11); |
9063 | $this->currPos += 11; |
9064 | } else { |
9065 | $r9 = self::$FAILED; |
9066 | } |
9067 | choice_1: |
9068 | if ($r9===self::$FAILED) { |
9069 | $this->currPos = $p6; |
9070 | $r5 = self::$FAILED; |
9071 | goto seq_2; |
9072 | } |
9073 | $r5 = true; |
9074 | seq_2: |
9075 | if ($r5!==self::$FAILED) { |
9076 | $r5 = false; |
9077 | $this->currPos = $p4; |
9078 | } else { |
9079 | $r1 = self::$FAILED; |
9080 | goto seq_1; |
9081 | } |
9082 | // free $p6 |
9083 | // free $p4 |
9084 | if (($this->input[$this->currPos] ?? null) === "<") { |
9085 | $this->currPos++; |
9086 | $r10 = "<"; |
9087 | } else { |
9088 | if (!$silence) {$this->fail(44);} |
9089 | $r10 = self::$FAILED; |
9090 | $this->currPos = $p3; |
9091 | $r1 = self::$FAILED; |
9092 | goto seq_1; |
9093 | } |
9094 | $r11 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
9095 | // il <- $r11 |
9096 | if ($r11===self::$FAILED) { |
9097 | $this->currPos = $p3; |
9098 | $r1 = self::$FAILED; |
9099 | goto seq_1; |
9100 | } |
9101 | $this->savedPos = $this->currPos; |
9102 | $r12 = $this->a87($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
9103 | if ($r12) { |
9104 | $r12 = false; |
9105 | } else { |
9106 | $r12 = self::$FAILED; |
9107 | $this->currPos = $p3; |
9108 | $r1 = self::$FAILED; |
9109 | goto seq_1; |
9110 | } |
9111 | $r1 = true; |
9112 | seq_1: |
9113 | if ($r1!==self::$FAILED) { |
9114 | $this->savedPos = $p2; |
9115 | $r1 = $this->a88($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
9116 | } |
9117 | // free $p3 |
9118 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9119 | $this->currPos, |
9120 | $r1, |
9121 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9122 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9123 | ); |
9124 | return $r1; |
9125 | } |
9126 | private function parseannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
9127 | $key = json_encode([404, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
9128 | $bucket = $this->currPos; |
9129 | $cached = $this->cache[$bucket][$key] ?? null; |
9130 | if ($cached) { |
9131 | $this->currPos = $cached->nextPos; |
9132 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9133 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9134 | return $cached->result; |
9135 | } |
9136 | $saved_preproc=$param_preproc; |
9137 | $saved_th=$param_th; |
9138 | $p2 = $this->currPos; |
9139 | // start seq_1 |
9140 | $p3 = $this->currPos; |
9141 | $r4 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
9142 | // annToken <- $r4 |
9143 | if ($r4===self::$FAILED) { |
9144 | $r1 = self::$FAILED; |
9145 | goto seq_1; |
9146 | } |
9147 | $this->savedPos = $this->currPos; |
9148 | $r5 = $this->a89($r4); |
9149 | if ($r5) { |
9150 | $r5 = false; |
9151 | } else { |
9152 | $r5 = self::$FAILED; |
9153 | $this->currPos = $p3; |
9154 | $r1 = self::$FAILED; |
9155 | goto seq_1; |
9156 | } |
9157 | $r1 = true; |
9158 | seq_1: |
9159 | if ($r1!==self::$FAILED) { |
9160 | $this->savedPos = $p2; |
9161 | $r1 = $this->a90($r4); |
9162 | } |
9163 | // free $p3 |
9164 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9165 | $this->currPos, |
9166 | $r1, |
9167 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9168 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9169 | ); |
9170 | return $r1; |
9171 | } |
9172 | private function parseheading($silence, $boolParams, &$param_preproc, &$param_th) { |
9173 | $key = json_encode([310, $boolParams & 0x3fff, $param_preproc, $param_th]); |
9174 | $bucket = $this->currPos; |
9175 | $cached = $this->cache[$bucket][$key] ?? null; |
9176 | if ($cached) { |
9177 | $this->currPos = $cached->nextPos; |
9178 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9179 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9180 | return $cached->result; |
9181 | } |
9182 | $saved_preproc=$param_preproc; |
9183 | $saved_th=$param_th; |
9184 | $p2 = $this->currPos; |
9185 | // start seq_1 |
9186 | $p3 = $this->currPos; |
9187 | $p4 = $this->currPos; |
9188 | if (($this->input[$this->currPos] ?? null) === "=") { |
9189 | $this->currPos++; |
9190 | $r5 = "="; |
9191 | $r5 = false; |
9192 | $this->currPos = $p4; |
9193 | } else { |
9194 | $r5 = self::$FAILED; |
9195 | $r1 = self::$FAILED; |
9196 | goto seq_1; |
9197 | } |
9198 | // free $p4 |
9199 | $p4 = $this->currPos; |
9200 | // start seq_2 |
9201 | $p7 = $this->currPos; |
9202 | $p9 = $this->currPos; |
9203 | $r8 = self::$FAILED; |
9204 | for (;;) { |
9205 | if (($this->input[$this->currPos] ?? null) === "=") { |
9206 | $this->currPos++; |
9207 | $r10 = "="; |
9208 | $r8 = true; |
9209 | } else { |
9210 | if (!$silence) {$this->fail(23);} |
9211 | $r10 = self::$FAILED; |
9212 | break; |
9213 | } |
9214 | } |
9215 | // s <- $r8 |
9216 | if ($r8!==self::$FAILED) { |
9217 | $r8 = substr($this->input, $p9, $this->currPos - $p9); |
9218 | } else { |
9219 | $r8 = self::$FAILED; |
9220 | $r6 = self::$FAILED; |
9221 | goto seq_2; |
9222 | } |
9223 | // free $r10 |
9224 | // free $p9 |
9225 | // start seq_3 |
9226 | $p9 = $this->currPos; |
9227 | $p12 = $this->currPos; |
9228 | $r13 = $this->parseinlineline($silence, $boolParams | 0x4, $param_preproc, $param_th); |
9229 | if ($r13===self::$FAILED) { |
9230 | $r13 = null; |
9231 | } |
9232 | // ill <- $r13 |
9233 | $r11 = $r13; |
9234 | if ($r11!==self::$FAILED) { |
9235 | $this->savedPos = $p12; |
9236 | $r11 = $this->a91($r8, $r13); |
9237 | } else { |
9238 | $r10 = self::$FAILED; |
9239 | goto seq_3; |
9240 | } |
9241 | $p14 = $this->currPos; |
9242 | $r15 = self::$FAILED; |
9243 | for (;;) { |
9244 | if (($this->input[$this->currPos] ?? null) === "=") { |
9245 | $this->currPos++; |
9246 | $r16 = "="; |
9247 | $r15 = true; |
9248 | } else { |
9249 | if (!$silence) {$this->fail(23);} |
9250 | $r16 = self::$FAILED; |
9251 | break; |
9252 | } |
9253 | } |
9254 | if ($r15!==self::$FAILED) { |
9255 | $r15 = substr($this->input, $p14, $this->currPos - $p14); |
9256 | } else { |
9257 | $r15 = self::$FAILED; |
9258 | $this->currPos = $p9; |
9259 | $r10 = self::$FAILED; |
9260 | goto seq_3; |
9261 | } |
9262 | // free $r16 |
9263 | // free $p14 |
9264 | $r10 = [$r11,$r15]; |
9265 | seq_3: |
9266 | if ($r10===self::$FAILED) { |
9267 | $r10 = null; |
9268 | } |
9269 | // free $p9 |
9270 | // ce <- $r10 |
9271 | $this->savedPos = $this->currPos; |
9272 | $r16 = $this->a92($r8, $r10); |
9273 | if ($r16) { |
9274 | $r16 = false; |
9275 | } else { |
9276 | $r16 = self::$FAILED; |
9277 | $this->currPos = $p7; |
9278 | $r6 = self::$FAILED; |
9279 | goto seq_2; |
9280 | } |
9281 | $p9 = $this->currPos; |
9282 | $r17 = ''; |
9283 | // endTPos <- $r17 |
9284 | if ($r17!==self::$FAILED) { |
9285 | $this->savedPos = $p9; |
9286 | $r17 = $this->a93($r8, $r10); |
9287 | } else { |
9288 | $this->currPos = $p7; |
9289 | $r6 = self::$FAILED; |
9290 | goto seq_2; |
9291 | } |
9292 | $r18 = []; |
9293 | for (;;) { |
9294 | // start choice_1 |
9295 | $r19 = $this->parsespace($silence); |
9296 | if ($r19!==self::$FAILED) { |
9297 | goto choice_1; |
9298 | } |
9299 | $r19 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
9300 | choice_1: |
9301 | if ($r19!==self::$FAILED) { |
9302 | $r18[] = $r19; |
9303 | } else { |
9304 | break; |
9305 | } |
9306 | } |
9307 | // spc <- $r18 |
9308 | // free $r19 |
9309 | $p14 = $this->currPos; |
9310 | $r19 = $this->discardeolf(true); |
9311 | if ($r19!==self::$FAILED) { |
9312 | $r19 = false; |
9313 | $this->currPos = $p14; |
9314 | } else { |
9315 | $this->currPos = $p7; |
9316 | $r6 = self::$FAILED; |
9317 | goto seq_2; |
9318 | } |
9319 | // free $p14 |
9320 | $r6 = true; |
9321 | seq_2: |
9322 | // r <- $r6 |
9323 | if ($r6!==self::$FAILED) { |
9324 | $this->savedPos = $p4; |
9325 | $r6 = $this->a94($r8, $r10, $r17, $r18); |
9326 | } else { |
9327 | $this->currPos = $p3; |
9328 | $r1 = self::$FAILED; |
9329 | goto seq_1; |
9330 | } |
9331 | // free $p7 |
9332 | $r1 = true; |
9333 | seq_1: |
9334 | if ($r1!==self::$FAILED) { |
9335 | $this->savedPos = $p2; |
9336 | $r1 = $this->a24($r6); |
9337 | } |
9338 | // free $p3 |
9339 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9340 | $this->currPos, |
9341 | $r1, |
9342 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9343 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9344 | ); |
9345 | return $r1; |
9346 | } |
9347 | private function parsehr($silence, $boolParams, &$param_preproc, &$param_th) { |
9348 | $key = json_encode([296, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
9349 | $bucket = $this->currPos; |
9350 | $cached = $this->cache[$bucket][$key] ?? null; |
9351 | if ($cached) { |
9352 | $this->currPos = $cached->nextPos; |
9353 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9354 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9355 | return $cached->result; |
9356 | } |
9357 | $saved_preproc=$param_preproc; |
9358 | $saved_th=$param_th; |
9359 | $p2 = $this->currPos; |
9360 | // start seq_1 |
9361 | $p3 = $this->currPos; |
9362 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "----", $this->currPos, 4, false) === 0) { |
9363 | $r4 = "----"; |
9364 | $this->currPos += 4; |
9365 | } else { |
9366 | if (!$silence) {$this->fail(59);} |
9367 | $r4 = self::$FAILED; |
9368 | $r1 = self::$FAILED; |
9369 | goto seq_1; |
9370 | } |
9371 | $p6 = $this->currPos; |
9372 | for (;;) { |
9373 | if (($this->input[$this->currPos] ?? null) === "-") { |
9374 | $this->currPos++; |
9375 | $r7 = "-"; |
9376 | } else { |
9377 | if (!$silence) {$this->fail(55);} |
9378 | $r7 = self::$FAILED; |
9379 | break; |
9380 | } |
9381 | } |
9382 | // free $r7 |
9383 | $r5 = true; |
9384 | // d <- $r5 |
9385 | if ($r5!==self::$FAILED) { |
9386 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9387 | } else { |
9388 | $r5 = self::$FAILED; |
9389 | $this->currPos = $p3; |
9390 | $r1 = self::$FAILED; |
9391 | goto seq_1; |
9392 | } |
9393 | // free $p6 |
9394 | // start choice_1 |
9395 | $p6 = $this->currPos; |
9396 | // start seq_2 |
9397 | $p8 = $this->currPos; |
9398 | $p9 = $this->currPos; |
9399 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
9400 | if ($r10!==self::$FAILED) { |
9401 | $r10 = false; |
9402 | $this->currPos = $p9; |
9403 | } else { |
9404 | $r7 = self::$FAILED; |
9405 | goto seq_2; |
9406 | } |
9407 | // free $p9 |
9408 | $r7 = true; |
9409 | seq_2: |
9410 | if ($r7!==self::$FAILED) { |
9411 | $this->savedPos = $p6; |
9412 | $r7 = $this->a95($r5); |
9413 | goto choice_1; |
9414 | } |
9415 | // free $p8 |
9416 | $p8 = $this->currPos; |
9417 | $r7 = ''; |
9418 | if ($r7!==self::$FAILED) { |
9419 | $this->savedPos = $p8; |
9420 | $r7 = $this->a96($r5); |
9421 | } |
9422 | choice_1: |
9423 | // lineContent <- $r7 |
9424 | if ($r7===self::$FAILED) { |
9425 | $this->currPos = $p3; |
9426 | $r1 = self::$FAILED; |
9427 | goto seq_1; |
9428 | } |
9429 | $r1 = true; |
9430 | seq_1: |
9431 | if ($r1!==self::$FAILED) { |
9432 | $this->savedPos = $p2; |
9433 | $r1 = $this->a97($r5, $r7); |
9434 | } |
9435 | // free $p3 |
9436 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9437 | $this->currPos, |
9438 | $r1, |
9439 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9440 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9441 | ); |
9442 | return $r1; |
9443 | } |
9444 | private function discardtplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9445 | $key = json_encode([349, $boolParams & 0x3fff, $param_preproc, $param_th]); |
9446 | $bucket = $this->currPos; |
9447 | $cached = $this->cache[$bucket][$key] ?? null; |
9448 | if ($cached) { |
9449 | $this->currPos = $cached->nextPos; |
9450 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9451 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9452 | return $cached->result; |
9453 | } |
9454 | $saved_preproc=$param_preproc; |
9455 | $saved_th=$param_th; |
9456 | $p2 = $this->currPos; |
9457 | // start seq_1 |
9458 | $p3 = $this->currPos; |
9459 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
9460 | $r4 = "{{{"; |
9461 | $this->currPos += 3; |
9462 | } else { |
9463 | if (!$silence) {$this->fail(60);} |
9464 | $r4 = self::$FAILED; |
9465 | $r1 = self::$FAILED; |
9466 | goto seq_1; |
9467 | } |
9468 | $p6 = $this->currPos; |
9469 | $r5 = ''; |
9470 | // p <- $r5 |
9471 | if ($r5!==self::$FAILED) { |
9472 | $this->savedPos = $p6; |
9473 | $r5 = $this->a17(); |
9474 | } else { |
9475 | $this->currPos = $p3; |
9476 | $r1 = self::$FAILED; |
9477 | goto seq_1; |
9478 | } |
9479 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9480 | if ($r7===self::$FAILED) { |
9481 | $r7 = null; |
9482 | } |
9483 | // target <- $r7 |
9484 | $r8 = []; |
9485 | for (;;) { |
9486 | $p10 = $this->currPos; |
9487 | // start seq_2 |
9488 | $p11 = $this->currPos; |
9489 | for (;;) { |
9490 | $r13 = $this->discardnl_comment_space($silence); |
9491 | if ($r13===self::$FAILED) { |
9492 | break; |
9493 | } |
9494 | } |
9495 | // free $r13 |
9496 | $r12 = true; |
9497 | if ($r12===self::$FAILED) { |
9498 | $r9 = self::$FAILED; |
9499 | goto seq_2; |
9500 | } |
9501 | // free $r12 |
9502 | if (($this->input[$this->currPos] ?? null) === "|") { |
9503 | $this->currPos++; |
9504 | $r12 = "|"; |
9505 | } else { |
9506 | if (!$silence) {$this->fail(13);} |
9507 | $r12 = self::$FAILED; |
9508 | $this->currPos = $p11; |
9509 | $r9 = self::$FAILED; |
9510 | goto seq_2; |
9511 | } |
9512 | // start choice_1 |
9513 | $p14 = $this->currPos; |
9514 | // start seq_3 |
9515 | $p15 = $this->currPos; |
9516 | $p17 = $this->currPos; |
9517 | $r16 = ''; |
9518 | // p0 <- $r16 |
9519 | if ($r16!==self::$FAILED) { |
9520 | $this->savedPos = $p17; |
9521 | $r16 = $this->a98($r5, $r7); |
9522 | } else { |
9523 | $r13 = self::$FAILED; |
9524 | goto seq_3; |
9525 | } |
9526 | $r18 = []; |
9527 | for (;;) { |
9528 | $r19 = $this->parsenl_comment_space($silence); |
9529 | if ($r19!==self::$FAILED) { |
9530 | $r18[] = $r19; |
9531 | } else { |
9532 | break; |
9533 | } |
9534 | } |
9535 | // v <- $r18 |
9536 | // free $r19 |
9537 | $p20 = $this->currPos; |
9538 | $r19 = ''; |
9539 | // p1 <- $r19 |
9540 | if ($r19!==self::$FAILED) { |
9541 | $this->savedPos = $p20; |
9542 | $r19 = $this->a99($r5, $r7, $r16, $r18); |
9543 | } else { |
9544 | $this->currPos = $p15; |
9545 | $r13 = self::$FAILED; |
9546 | goto seq_3; |
9547 | } |
9548 | $p21 = $this->currPos; |
9549 | // start choice_2 |
9550 | if (($this->input[$this->currPos] ?? null) === "|") { |
9551 | $this->currPos++; |
9552 | $r22 = "|"; |
9553 | goto choice_2; |
9554 | } else { |
9555 | $r22 = self::$FAILED; |
9556 | } |
9557 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9558 | $r22 = "}}}"; |
9559 | $this->currPos += 3; |
9560 | } else { |
9561 | $r22 = self::$FAILED; |
9562 | } |
9563 | choice_2: |
9564 | if ($r22!==self::$FAILED) { |
9565 | $r22 = false; |
9566 | $this->currPos = $p21; |
9567 | } else { |
9568 | $this->currPos = $p15; |
9569 | $r13 = self::$FAILED; |
9570 | goto seq_3; |
9571 | } |
9572 | // free $p21 |
9573 | $r13 = true; |
9574 | seq_3: |
9575 | if ($r13!==self::$FAILED) { |
9576 | $this->savedPos = $p14; |
9577 | $r13 = $this->a100($r5, $r7, $r16, $r18, $r19); |
9578 | goto choice_1; |
9579 | } |
9580 | // free $p15 |
9581 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9582 | choice_1: |
9583 | // r <- $r13 |
9584 | if ($r13===self::$FAILED) { |
9585 | $this->currPos = $p11; |
9586 | $r9 = self::$FAILED; |
9587 | goto seq_2; |
9588 | } |
9589 | $r9 = true; |
9590 | seq_2: |
9591 | if ($r9!==self::$FAILED) { |
9592 | $this->savedPos = $p10; |
9593 | $r9 = $this->a101($r5, $r7, $r13); |
9594 | $r8[] = $r9; |
9595 | } else { |
9596 | break; |
9597 | } |
9598 | // free $p11 |
9599 | } |
9600 | // params <- $r8 |
9601 | // free $r9 |
9602 | for (;;) { |
9603 | $r23 = $this->discardnl_comment_space($silence); |
9604 | if ($r23===self::$FAILED) { |
9605 | break; |
9606 | } |
9607 | } |
9608 | // free $r23 |
9609 | $r9 = true; |
9610 | if ($r9===self::$FAILED) { |
9611 | $this->currPos = $p3; |
9612 | $r1 = self::$FAILED; |
9613 | goto seq_1; |
9614 | } |
9615 | // free $r9 |
9616 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
9617 | if ($r9===self::$FAILED) { |
9618 | $this->currPos = $p3; |
9619 | $r1 = self::$FAILED; |
9620 | goto seq_1; |
9621 | } |
9622 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9623 | $r23 = "}}}"; |
9624 | $this->currPos += 3; |
9625 | } else { |
9626 | if (!$silence) {$this->fail(61);} |
9627 | $r23 = self::$FAILED; |
9628 | $this->currPos = $p3; |
9629 | $r1 = self::$FAILED; |
9630 | goto seq_1; |
9631 | } |
9632 | $r1 = true; |
9633 | seq_1: |
9634 | if ($r1!==self::$FAILED) { |
9635 | $this->savedPos = $p2; |
9636 | $r1 = $this->a102($r5, $r7, $r8); |
9637 | } |
9638 | // free $p3 |
9639 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9640 | $this->currPos, |
9641 | $r1, |
9642 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9643 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9644 | ); |
9645 | return $r1; |
9646 | } |
9647 | private function parsetemplate_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9648 | $key = json_encode([344, $boolParams & 0x3fff, $param_preproc, $param_th]); |
9649 | $bucket = $this->currPos; |
9650 | $cached = $this->cache[$bucket][$key] ?? null; |
9651 | if ($cached) { |
9652 | $this->currPos = $cached->nextPos; |
9653 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9654 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9655 | return $cached->result; |
9656 | } |
9657 | $saved_preproc=$param_preproc; |
9658 | $saved_th=$param_th; |
9659 | // start choice_1 |
9660 | $p2 = $this->currPos; |
9661 | // start seq_1 |
9662 | $p3 = $this->currPos; |
9663 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
9664 | $r4 = "{{"; |
9665 | $this->currPos += 2; |
9666 | } else { |
9667 | if (!$silence) {$this->fail(43);} |
9668 | $r4 = self::$FAILED; |
9669 | $r1 = self::$FAILED; |
9670 | goto seq_1; |
9671 | } |
9672 | $p6 = $this->currPos; |
9673 | for (;;) { |
9674 | $r7 = $this->discardnl_comment_space($silence); |
9675 | if ($r7===self::$FAILED) { |
9676 | break; |
9677 | } |
9678 | } |
9679 | // free $r7 |
9680 | $r5 = true; |
9681 | // leadWS <- $r5 |
9682 | if ($r5!==self::$FAILED) { |
9683 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9684 | } else { |
9685 | $r5 = self::$FAILED; |
9686 | $this->currPos = $p3; |
9687 | $r1 = self::$FAILED; |
9688 | goto seq_1; |
9689 | } |
9690 | // free $p6 |
9691 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9692 | // target <- $r7 |
9693 | if ($r7===self::$FAILED) { |
9694 | $this->currPos = $p3; |
9695 | $r1 = self::$FAILED; |
9696 | goto seq_1; |
9697 | } |
9698 | $r8 = []; |
9699 | for (;;) { |
9700 | $p6 = $this->currPos; |
9701 | // start seq_2 |
9702 | $p10 = $this->currPos; |
9703 | for (;;) { |
9704 | $r12 = $this->discardnl_comment_space($silence); |
9705 | if ($r12===self::$FAILED) { |
9706 | break; |
9707 | } |
9708 | } |
9709 | // free $r12 |
9710 | $r11 = true; |
9711 | if ($r11===self::$FAILED) { |
9712 | $r9 = self::$FAILED; |
9713 | goto seq_2; |
9714 | } |
9715 | // free $r11 |
9716 | if (($this->input[$this->currPos] ?? null) === "|") { |
9717 | $this->currPos++; |
9718 | $r11 = "|"; |
9719 | } else { |
9720 | if (!$silence) {$this->fail(13);} |
9721 | $r11 = self::$FAILED; |
9722 | $this->currPos = $p10; |
9723 | $r9 = self::$FAILED; |
9724 | goto seq_2; |
9725 | } |
9726 | // start choice_2 |
9727 | $p13 = $this->currPos; |
9728 | // start seq_3 |
9729 | $p14 = $this->currPos; |
9730 | $p16 = $this->currPos; |
9731 | $r15 = ''; |
9732 | // p0 <- $r15 |
9733 | if ($r15!==self::$FAILED) { |
9734 | $this->savedPos = $p16; |
9735 | $r15 = $this->a103($r5, $r7); |
9736 | } else { |
9737 | $r12 = self::$FAILED; |
9738 | goto seq_3; |
9739 | } |
9740 | $r17 = []; |
9741 | for (;;) { |
9742 | $r18 = $this->parsenl_comment_space($silence); |
9743 | if ($r18!==self::$FAILED) { |
9744 | $r17[] = $r18; |
9745 | } else { |
9746 | break; |
9747 | } |
9748 | } |
9749 | // v <- $r17 |
9750 | // free $r18 |
9751 | $p19 = $this->currPos; |
9752 | $r18 = ''; |
9753 | // p <- $r18 |
9754 | if ($r18!==self::$FAILED) { |
9755 | $this->savedPos = $p19; |
9756 | $r18 = $this->a104($r5, $r7, $r15, $r17); |
9757 | } else { |
9758 | $this->currPos = $p14; |
9759 | $r12 = self::$FAILED; |
9760 | goto seq_3; |
9761 | } |
9762 | $p20 = $this->currPos; |
9763 | // start choice_3 |
9764 | if (($this->input[$this->currPos] ?? null) === "|") { |
9765 | $this->currPos++; |
9766 | $r21 = "|"; |
9767 | goto choice_3; |
9768 | } else { |
9769 | $r21 = self::$FAILED; |
9770 | } |
9771 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9772 | $r21 = "}}"; |
9773 | $this->currPos += 2; |
9774 | } else { |
9775 | $r21 = self::$FAILED; |
9776 | } |
9777 | choice_3: |
9778 | if ($r21!==self::$FAILED) { |
9779 | $r21 = false; |
9780 | $this->currPos = $p20; |
9781 | } else { |
9782 | $this->currPos = $p14; |
9783 | $r12 = self::$FAILED; |
9784 | goto seq_3; |
9785 | } |
9786 | // free $p20 |
9787 | $r12 = true; |
9788 | seq_3: |
9789 | if ($r12!==self::$FAILED) { |
9790 | $this->savedPos = $p13; |
9791 | $r12 = $this->a105($r5, $r7, $r15, $r17, $r18); |
9792 | goto choice_2; |
9793 | } |
9794 | // free $p14 |
9795 | $r12 = $this->parsetemplate_param($silence, $boolParams, $param_preproc, $param_th); |
9796 | choice_2: |
9797 | // r <- $r12 |
9798 | if ($r12===self::$FAILED) { |
9799 | $this->currPos = $p10; |
9800 | $r9 = self::$FAILED; |
9801 | goto seq_2; |
9802 | } |
9803 | $r9 = true; |
9804 | seq_2: |
9805 | if ($r9!==self::$FAILED) { |
9806 | $this->savedPos = $p6; |
9807 | $r9 = $this->a106($r5, $r7, $r12); |
9808 | $r8[] = $r9; |
9809 | } else { |
9810 | break; |
9811 | } |
9812 | // free $p10 |
9813 | } |
9814 | // params <- $r8 |
9815 | // free $r9 |
9816 | $p10 = $this->currPos; |
9817 | for (;;) { |
9818 | $r22 = $this->discardnl_comment_space($silence); |
9819 | if ($r22===self::$FAILED) { |
9820 | break; |
9821 | } |
9822 | } |
9823 | // free $r22 |
9824 | $r9 = true; |
9825 | // trailWS <- $r9 |
9826 | if ($r9!==self::$FAILED) { |
9827 | $r9 = substr($this->input, $p10, $this->currPos - $p10); |
9828 | } else { |
9829 | $r9 = self::$FAILED; |
9830 | $this->currPos = $p3; |
9831 | $r1 = self::$FAILED; |
9832 | goto seq_1; |
9833 | } |
9834 | // free $p10 |
9835 | $r22 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
9836 | if ($r22===self::$FAILED) { |
9837 | $this->currPos = $p3; |
9838 | $r1 = self::$FAILED; |
9839 | goto seq_1; |
9840 | } |
9841 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9842 | $r23 = "}}"; |
9843 | $this->currPos += 2; |
9844 | } else { |
9845 | if (!$silence) {$this->fail(62);} |
9846 | $r23 = self::$FAILED; |
9847 | $this->currPos = $p3; |
9848 | $r1 = self::$FAILED; |
9849 | goto seq_1; |
9850 | } |
9851 | $r1 = true; |
9852 | seq_1: |
9853 | if ($r1!==self::$FAILED) { |
9854 | $this->savedPos = $p2; |
9855 | $r1 = $this->a107($r5, $r7, $r8, $r9); |
9856 | goto choice_1; |
9857 | } |
9858 | // free $p3 |
9859 | $p3 = $this->currPos; |
9860 | // start seq_4 |
9861 | $p10 = $this->currPos; |
9862 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
9863 | $r24 = "{{"; |
9864 | $this->currPos += 2; |
9865 | } else { |
9866 | if (!$silence) {$this->fail(43);} |
9867 | $r24 = self::$FAILED; |
9868 | $r1 = self::$FAILED; |
9869 | goto seq_4; |
9870 | } |
9871 | for (;;) { |
9872 | $r26 = $this->discardspace_or_newline($silence); |
9873 | if ($r26===self::$FAILED) { |
9874 | break; |
9875 | } |
9876 | } |
9877 | // free $r26 |
9878 | $r25 = true; |
9879 | if ($r25===self::$FAILED) { |
9880 | $this->currPos = $p10; |
9881 | $r1 = self::$FAILED; |
9882 | goto seq_4; |
9883 | } |
9884 | // free $r25 |
9885 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9886 | $r25 = "}}"; |
9887 | $this->currPos += 2; |
9888 | } else { |
9889 | if (!$silence) {$this->fail(62);} |
9890 | $r25 = self::$FAILED; |
9891 | $this->currPos = $p10; |
9892 | $r1 = self::$FAILED; |
9893 | goto seq_4; |
9894 | } |
9895 | $r1 = true; |
9896 | seq_4: |
9897 | if ($r1!==self::$FAILED) { |
9898 | $r1 = substr($this->input, $p3, $this->currPos - $p3); |
9899 | } else { |
9900 | $r1 = self::$FAILED; |
9901 | } |
9902 | // free $p10 |
9903 | // free $p3 |
9904 | choice_1: |
9905 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9906 | $this->currPos, |
9907 | $r1, |
9908 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9909 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9910 | ); |
9911 | return $r1; |
9912 | } |
9913 | private function parsetplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9914 | $key = json_encode([348, $boolParams & 0x3fff, $param_preproc, $param_th]); |
9915 | $bucket = $this->currPos; |
9916 | $cached = $this->cache[$bucket][$key] ?? null; |
9917 | if ($cached) { |
9918 | $this->currPos = $cached->nextPos; |
9919 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9920 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9921 | return $cached->result; |
9922 | } |
9923 | $saved_preproc=$param_preproc; |
9924 | $saved_th=$param_th; |
9925 | $p2 = $this->currPos; |
9926 | // start seq_1 |
9927 | $p3 = $this->currPos; |
9928 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
9929 | $r4 = "{{{"; |
9930 | $this->currPos += 3; |
9931 | } else { |
9932 | if (!$silence) {$this->fail(60);} |
9933 | $r4 = self::$FAILED; |
9934 | $r1 = self::$FAILED; |
9935 | goto seq_1; |
9936 | } |
9937 | $p6 = $this->currPos; |
9938 | $r5 = ''; |
9939 | // p <- $r5 |
9940 | if ($r5!==self::$FAILED) { |
9941 | $this->savedPos = $p6; |
9942 | $r5 = $this->a17(); |
9943 | } else { |
9944 | $this->currPos = $p3; |
9945 | $r1 = self::$FAILED; |
9946 | goto seq_1; |
9947 | } |
9948 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9949 | if ($r7===self::$FAILED) { |
9950 | $r7 = null; |
9951 | } |
9952 | // target <- $r7 |
9953 | $r8 = []; |
9954 | for (;;) { |
9955 | $p10 = $this->currPos; |
9956 | // start seq_2 |
9957 | $p11 = $this->currPos; |
9958 | for (;;) { |
9959 | $r13 = $this->discardnl_comment_space($silence); |
9960 | if ($r13===self::$FAILED) { |
9961 | break; |
9962 | } |
9963 | } |
9964 | // free $r13 |
9965 | $r12 = true; |
9966 | if ($r12===self::$FAILED) { |
9967 | $r9 = self::$FAILED; |
9968 | goto seq_2; |
9969 | } |
9970 | // free $r12 |
9971 | if (($this->input[$this->currPos] ?? null) === "|") { |
9972 | $this->currPos++; |
9973 | $r12 = "|"; |
9974 | } else { |
9975 | if (!$silence) {$this->fail(13);} |
9976 | $r12 = self::$FAILED; |
9977 | $this->currPos = $p11; |
9978 | $r9 = self::$FAILED; |
9979 | goto seq_2; |
9980 | } |
9981 | // start choice_1 |
9982 | $p14 = $this->currPos; |
9983 | // start seq_3 |
9984 | $p15 = $this->currPos; |
9985 | $p17 = $this->currPos; |
9986 | $r16 = ''; |
9987 | // p0 <- $r16 |
9988 | if ($r16!==self::$FAILED) { |
9989 | $this->savedPos = $p17; |
9990 | $r16 = $this->a98($r5, $r7); |
9991 | } else { |
9992 | $r13 = self::$FAILED; |
9993 | goto seq_3; |
9994 | } |
9995 | $r18 = []; |
9996 | for (;;) { |
9997 | $r19 = $this->parsenl_comment_space($silence); |
9998 | if ($r19!==self::$FAILED) { |
9999 | $r18[] = $r19; |
10000 | } else { |
10001 | break; |
10002 | } |
10003 | } |
10004 | // v <- $r18 |
10005 | // free $r19 |
10006 | $p20 = $this->currPos; |
10007 | $r19 = ''; |
10008 | // p1 <- $r19 |
10009 | if ($r19!==self::$FAILED) { |
10010 | $this->savedPos = $p20; |
10011 | $r19 = $this->a99($r5, $r7, $r16, $r18); |
10012 | } else { |
10013 | $this->currPos = $p15; |
10014 | $r13 = self::$FAILED; |
10015 | goto seq_3; |
10016 | } |
10017 | $p21 = $this->currPos; |
10018 | // start choice_2 |
10019 | if (($this->input[$this->currPos] ?? null) === "|") { |
10020 | $this->currPos++; |
10021 | $r22 = "|"; |
10022 | goto choice_2; |
10023 | } else { |
10024 | $r22 = self::$FAILED; |
10025 | } |
10026 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10027 | $r22 = "}}}"; |
10028 | $this->currPos += 3; |
10029 | } else { |
10030 | $r22 = self::$FAILED; |
10031 | } |
10032 | choice_2: |
10033 | if ($r22!==self::$FAILED) { |
10034 | $r22 = false; |
10035 | $this->currPos = $p21; |
10036 | } else { |
10037 | $this->currPos = $p15; |
10038 | $r13 = self::$FAILED; |
10039 | goto seq_3; |
10040 | } |
10041 | // free $p21 |
10042 | $r13 = true; |
10043 | seq_3: |
10044 | if ($r13!==self::$FAILED) { |
10045 | $this->savedPos = $p14; |
10046 | $r13 = $this->a100($r5, $r7, $r16, $r18, $r19); |
10047 | goto choice_1; |
10048 | } |
10049 | // free $p15 |
10050 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
10051 | choice_1: |
10052 | // r <- $r13 |
10053 | if ($r13===self::$FAILED) { |
10054 | $this->currPos = $p11; |
10055 | $r9 = self::$FAILED; |
10056 | goto seq_2; |
10057 | } |
10058 | $r9 = true; |
10059 | seq_2: |
10060 | if ($r9!==self::$FAILED) { |
10061 | $this->savedPos = $p10; |
10062 | $r9 = $this->a101($r5, $r7, $r13); |
10063 | $r8[] = $r9; |
10064 | } else { |
10065 | break; |
10066 | } |
10067 | // free $p11 |
10068 | } |
10069 | // params <- $r8 |
10070 | // free $r9 |
10071 | for (;;) { |
10072 | $r23 = $this->discardnl_comment_space($silence); |
10073 | if ($r23===self::$FAILED) { |
10074 | break; |
10075 | } |
10076 | } |
10077 | // free $r23 |
10078 | $r9 = true; |
10079 | if ($r9===self::$FAILED) { |
10080 | $this->currPos = $p3; |
10081 | $r1 = self::$FAILED; |
10082 | goto seq_1; |
10083 | } |
10084 | // free $r9 |
10085 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10086 | if ($r9===self::$FAILED) { |
10087 | $this->currPos = $p3; |
10088 | $r1 = self::$FAILED; |
10089 | goto seq_1; |
10090 | } |
10091 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10092 | $r23 = "}}}"; |
10093 | $this->currPos += 3; |
10094 | } else { |
10095 | if (!$silence) {$this->fail(61);} |
10096 | $r23 = self::$FAILED; |
10097 | $this->currPos = $p3; |
10098 | $r1 = self::$FAILED; |
10099 | goto seq_1; |
10100 | } |
10101 | $r1 = true; |
10102 | seq_1: |
10103 | if ($r1!==self::$FAILED) { |
10104 | $this->savedPos = $p2; |
10105 | $r1 = $this->a102($r5, $r7, $r8); |
10106 | } |
10107 | // free $p3 |
10108 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10109 | $this->currPos, |
10110 | $r1, |
10111 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10112 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10113 | ); |
10114 | return $r1; |
10115 | } |
10116 | private function discardwikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
10117 | $key = json_encode([395, $boolParams & 0x3fff, $param_preproc, $param_th]); |
10118 | $bucket = $this->currPos; |
10119 | $cached = $this->cache[$bucket][$key] ?? null; |
10120 | if ($cached) { |
10121 | $this->currPos = $cached->nextPos; |
10122 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10123 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10124 | return $cached->result; |
10125 | } |
10126 | $saved_preproc=$param_preproc; |
10127 | $saved_th=$param_th; |
10128 | $p2 = $this->currPos; |
10129 | // start seq_1 |
10130 | $p3 = $this->currPos; |
10131 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10132 | $r4 = "[["; |
10133 | $this->currPos += 2; |
10134 | } else { |
10135 | if (!$silence) {$this->fail(41);} |
10136 | $r4 = self::$FAILED; |
10137 | $r1 = self::$FAILED; |
10138 | goto seq_1; |
10139 | } |
10140 | $p6 = $this->currPos; |
10141 | $r5 = ''; |
10142 | // spos <- $r5 |
10143 | if ($r5!==self::$FAILED) { |
10144 | $this->savedPos = $p6; |
10145 | $r5 = $this->a17(); |
10146 | } else { |
10147 | $this->currPos = $p3; |
10148 | $r1 = self::$FAILED; |
10149 | goto seq_1; |
10150 | } |
10151 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
10152 | if ($r7===self::$FAILED) { |
10153 | $r7 = null; |
10154 | } |
10155 | // target <- $r7 |
10156 | $p9 = $this->currPos; |
10157 | $r8 = ''; |
10158 | // tpos <- $r8 |
10159 | if ($r8!==self::$FAILED) { |
10160 | $this->savedPos = $p9; |
10161 | $r8 = $this->a108($r5, $r7); |
10162 | } else { |
10163 | $this->currPos = $p3; |
10164 | $r1 = self::$FAILED; |
10165 | goto seq_1; |
10166 | } |
10167 | $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
10168 | // lcs <- $r10 |
10169 | if ($r10===self::$FAILED) { |
10170 | $this->currPos = $p3; |
10171 | $r1 = self::$FAILED; |
10172 | goto seq_1; |
10173 | } |
10174 | $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10175 | if ($r11===self::$FAILED) { |
10176 | $this->currPos = $p3; |
10177 | $r1 = self::$FAILED; |
10178 | goto seq_1; |
10179 | } |
10180 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
10181 | $r12 = "]]"; |
10182 | $this->currPos += 2; |
10183 | } else { |
10184 | if (!$silence) {$this->fail(63);} |
10185 | $r12 = self::$FAILED; |
10186 | $this->currPos = $p3; |
10187 | $r1 = self::$FAILED; |
10188 | goto seq_1; |
10189 | } |
10190 | $r1 = true; |
10191 | seq_1: |
10192 | if ($r1!==self::$FAILED) { |
10193 | $this->savedPos = $p2; |
10194 | $r1 = $this->a109($r5, $r7, $r8, $r10); |
10195 | } |
10196 | // free $p3 |
10197 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10198 | $this->currPos, |
10199 | $r1, |
10200 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10201 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10202 | ); |
10203 | return $r1; |
10204 | } |
10205 | private function discardbroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
10206 | $key = json_encode([393, $boolParams & 0x3fff, $param_preproc, $param_th]); |
10207 | $bucket = $this->currPos; |
10208 | $cached = $this->cache[$bucket][$key] ?? null; |
10209 | if ($cached) { |
10210 | $this->currPos = $cached->nextPos; |
10211 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10212 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10213 | return $cached->result; |
10214 | } |
10215 | $saved_preproc=$param_preproc; |
10216 | $saved_th=$param_th; |
10217 | $p2 = $this->currPos; |
10218 | // start seq_1 |
10219 | $p3 = $this->currPos; |
10220 | $p4 = $this->currPos; |
10221 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10222 | $r5 = "[["; |
10223 | $this->currPos += 2; |
10224 | $r5 = false; |
10225 | $this->currPos = $p4; |
10226 | } else { |
10227 | $r5 = self::$FAILED; |
10228 | $r1 = self::$FAILED; |
10229 | goto seq_1; |
10230 | } |
10231 | // free $p4 |
10232 | $this->savedPos = $this->currPos; |
10233 | $r6 = $this->a110($param_preproc); |
10234 | if ($r6) { |
10235 | $r6 = false; |
10236 | } else { |
10237 | $r6 = self::$FAILED; |
10238 | $this->currPos = $p3; |
10239 | $r1 = self::$FAILED; |
10240 | goto seq_1; |
10241 | } |
10242 | // start seq_2 |
10243 | $p4 = $this->currPos; |
10244 | if (($this->input[$this->currPos] ?? null) === "[") { |
10245 | $this->currPos++; |
10246 | $r8 = "["; |
10247 | } else { |
10248 | if (!$silence) {$this->fail(19);} |
10249 | $r8 = self::$FAILED; |
10250 | $r7 = self::$FAILED; |
10251 | goto seq_2; |
10252 | } |
10253 | // start choice_1 |
10254 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
10255 | if ($r9!==self::$FAILED) { |
10256 | goto choice_1; |
10257 | } |
10258 | if (($this->input[$this->currPos] ?? null) === "[") { |
10259 | $this->currPos++; |
10260 | $r9 = "["; |
10261 | } else { |
10262 | if (!$silence) {$this->fail(19);} |
10263 | $r9 = self::$FAILED; |
10264 | } |
10265 | choice_1: |
10266 | if ($r9===self::$FAILED) { |
10267 | $this->currPos = $p4; |
10268 | $r7 = self::$FAILED; |
10269 | goto seq_2; |
10270 | } |
10271 | $r7 = [$r8,$r9]; |
10272 | seq_2: |
10273 | // a <- $r7 |
10274 | if ($r7===self::$FAILED) { |
10275 | $this->currPos = $p3; |
10276 | $r1 = self::$FAILED; |
10277 | goto seq_1; |
10278 | } |
10279 | // free $p4 |
10280 | $r1 = true; |
10281 | seq_1: |
10282 | if ($r1!==self::$FAILED) { |
10283 | $this->savedPos = $p2; |
10284 | $r1 = $this->a111($param_preproc, $r7); |
10285 | } |
10286 | // free $p3 |
10287 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10288 | $this->currPos, |
10289 | $r1, |
10290 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10291 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10292 | ); |
10293 | return $r1; |
10294 | } |
10295 | private function parseextension_annotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10296 | $key = json_encode([406, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
10297 | $bucket = $this->currPos; |
10298 | $cached = $this->cache[$bucket][$key] ?? null; |
10299 | if ($cached) { |
10300 | $this->currPos = $cached->nextPos; |
10301 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10302 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10303 | return $cached->result; |
10304 | } |
10305 | $saved_preproc=$param_preproc; |
10306 | $saved_th=$param_th; |
10307 | $p2 = $this->currPos; |
10308 | // start seq_1 |
10309 | $p3 = $this->currPos; |
10310 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
10311 | $r4 = false; |
10312 | } else { |
10313 | $r4 = self::$FAILED; |
10314 | $r1 = self::$FAILED; |
10315 | goto seq_1; |
10316 | } |
10317 | if (($this->input[$this->currPos] ?? null) === "<") { |
10318 | $this->currPos++; |
10319 | $r5 = "<"; |
10320 | } else { |
10321 | if (!$silence) {$this->fail(44);} |
10322 | $r5 = self::$FAILED; |
10323 | $this->currPos = $p3; |
10324 | $r1 = self::$FAILED; |
10325 | goto seq_1; |
10326 | } |
10327 | // start choice_1 |
10328 | $p7 = $this->currPos; |
10329 | // start seq_2 |
10330 | $p8 = $this->currPos; |
10331 | $r9 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
10332 | // extToken <- $r9 |
10333 | if ($r9===self::$FAILED) { |
10334 | $r6 = self::$FAILED; |
10335 | goto seq_2; |
10336 | } |
10337 | $this->savedPos = $this->currPos; |
10338 | $r10 = $this->a112($r9); |
10339 | if ($r10) { |
10340 | $r10 = false; |
10341 | } else { |
10342 | $r10 = self::$FAILED; |
10343 | $this->currPos = $p8; |
10344 | $r6 = self::$FAILED; |
10345 | goto seq_2; |
10346 | } |
10347 | $r6 = true; |
10348 | seq_2: |
10349 | if ($r6!==self::$FAILED) { |
10350 | $this->savedPos = $p7; |
10351 | $r6 = $this->a113($r9); |
10352 | goto choice_1; |
10353 | } |
10354 | // free $p8 |
10355 | $r6 = $this->parsetvar_old_syntax_closing_HACK($silence); |
10356 | choice_1: |
10357 | // tag <- $r6 |
10358 | if ($r6===self::$FAILED) { |
10359 | $this->currPos = $p3; |
10360 | $r1 = self::$FAILED; |
10361 | goto seq_1; |
10362 | } |
10363 | $r1 = true; |
10364 | seq_1: |
10365 | if ($r1!==self::$FAILED) { |
10366 | $this->savedPos = $p2; |
10367 | $r1 = $this->a77($r6); |
10368 | } |
10369 | // free $p3 |
10370 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10371 | $this->currPos, |
10372 | $r1, |
10373 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10374 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10375 | ); |
10376 | return $r1; |
10377 | } |
10378 | private function parsexmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10379 | $key = json_encode([416, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
10380 | $bucket = $this->currPos; |
10381 | $cached = $this->cache[$bucket][$key] ?? null; |
10382 | if ($cached) { |
10383 | $this->currPos = $cached->nextPos; |
10384 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10385 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10386 | return $cached->result; |
10387 | } |
10388 | $saved_preproc=$param_preproc; |
10389 | $saved_th=$param_th; |
10390 | $p2 = $this->currPos; |
10391 | // start seq_1 |
10392 | $p3 = $this->currPos; |
10393 | $this->savedPos = $this->currPos; |
10394 | $r4 = $this->a114(); |
10395 | if ($r4) { |
10396 | $r4 = false; |
10397 | } else { |
10398 | $r4 = self::$FAILED; |
10399 | $r1 = self::$FAILED; |
10400 | goto seq_1; |
10401 | } |
10402 | if (($this->input[$this->currPos] ?? null) === "/") { |
10403 | $this->currPos++; |
10404 | $r5 = "/"; |
10405 | } else { |
10406 | if (!$silence) {$this->fail(35);} |
10407 | $r5 = self::$FAILED; |
10408 | $r5 = null; |
10409 | } |
10410 | // end <- $r5 |
10411 | $r6 = $this->parsetag_name($silence); |
10412 | // name <- $r6 |
10413 | if ($r6===self::$FAILED) { |
10414 | $this->currPos = $p3; |
10415 | $r1 = self::$FAILED; |
10416 | goto seq_1; |
10417 | } |
10418 | $this->savedPos = $this->currPos; |
10419 | $r7 = $this->a115($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0); |
10420 | if ($r7) { |
10421 | $r7 = false; |
10422 | } else { |
10423 | $r7 = self::$FAILED; |
10424 | $this->currPos = $p3; |
10425 | $r1 = self::$FAILED; |
10426 | goto seq_1; |
10427 | } |
10428 | $r8 = $this->parsegeneric_newline_attributes($silence, $boolParams & ~0x140, $param_preproc, $param_th); |
10429 | // attribs <- $r8 |
10430 | if ($r8===self::$FAILED) { |
10431 | $this->currPos = $p3; |
10432 | $r1 = self::$FAILED; |
10433 | goto seq_1; |
10434 | } |
10435 | for (;;) { |
10436 | $r10 = $this->discardspace_or_newline_or_solidus($silence); |
10437 | if ($r10===self::$FAILED) { |
10438 | break; |
10439 | } |
10440 | } |
10441 | // free $r10 |
10442 | $r9 = true; |
10443 | if ($r9===self::$FAILED) { |
10444 | $this->currPos = $p3; |
10445 | $r1 = self::$FAILED; |
10446 | goto seq_1; |
10447 | } |
10448 | // free $r9 |
10449 | if (($this->input[$this->currPos] ?? null) === "/") { |
10450 | $this->currPos++; |
10451 | $r9 = "/"; |
10452 | } else { |
10453 | if (!$silence) {$this->fail(35);} |
10454 | $r9 = self::$FAILED; |
10455 | $r9 = null; |
10456 | } |
10457 | // selfclose <- $r9 |
10458 | for (;;) { |
10459 | $r11 = $this->discardspace($silence); |
10460 | if ($r11===self::$FAILED) { |
10461 | break; |
10462 | } |
10463 | } |
10464 | // free $r11 |
10465 | $r10 = true; |
10466 | if ($r10===self::$FAILED) { |
10467 | $this->currPos = $p3; |
10468 | $r1 = self::$FAILED; |
10469 | goto seq_1; |
10470 | } |
10471 | // free $r10 |
10472 | if (($this->input[$this->currPos] ?? null) === ">") { |
10473 | $this->currPos++; |
10474 | $r10 = ">"; |
10475 | } else { |
10476 | if (!$silence) {$this->fail(64);} |
10477 | $r10 = self::$FAILED; |
10478 | $this->currPos = $p3; |
10479 | $r1 = self::$FAILED; |
10480 | goto seq_1; |
10481 | } |
10482 | $r1 = true; |
10483 | seq_1: |
10484 | if ($r1!==self::$FAILED) { |
10485 | $this->savedPos = $p2; |
10486 | $r1 = $this->a116($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0, $r8, $r9); |
10487 | } |
10488 | // free $p3 |
10489 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10490 | $this->currPos, |
10491 | $r1, |
10492 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10493 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10494 | ); |
10495 | return $r1; |
10496 | } |
10497 | private function parsetvar_old_syntax_closing_HACK($silence) { |
10498 | $key = 402; |
10499 | $bucket = $this->currPos; |
10500 | $cached = $this->cache[$bucket][$key] ?? null; |
10501 | if ($cached) { |
10502 | $this->currPos = $cached->nextPos; |
10503 | |
10504 | return $cached->result; |
10505 | } |
10506 | |
10507 | $p2 = $this->currPos; |
10508 | // start seq_1 |
10509 | $p3 = $this->currPos; |
10510 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
10511 | $r4 = "/>"; |
10512 | $this->currPos += 2; |
10513 | } else { |
10514 | if (!$silence) {$this->fail(65);} |
10515 | $r4 = self::$FAILED; |
10516 | $r1 = self::$FAILED; |
10517 | goto seq_1; |
10518 | } |
10519 | $this->savedPos = $this->currPos; |
10520 | $r5 = $this->a117(); |
10521 | if ($r5) { |
10522 | $r5 = false; |
10523 | } else { |
10524 | $r5 = self::$FAILED; |
10525 | $this->currPos = $p3; |
10526 | $r1 = self::$FAILED; |
10527 | goto seq_1; |
10528 | } |
10529 | $r1 = true; |
10530 | seq_1: |
10531 | if ($r1!==self::$FAILED) { |
10532 | $this->savedPos = $p2; |
10533 | $r1 = $this->a118(); |
10534 | } |
10535 | // free $p3 |
10536 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10537 | $this->currPos, |
10538 | $r1, |
10539 | self::$UNDEFINED, |
10540 | self::$UNDEFINED |
10541 | ); |
10542 | return $r1; |
10543 | } |
10544 | private function parseautourl($silence, $boolParams, &$param_preproc, &$param_th) { |
10545 | $key = json_encode([330, $boolParams & 0x3fff, $param_preproc, $param_th]); |
10546 | $bucket = $this->currPos; |
10547 | $cached = $this->cache[$bucket][$key] ?? null; |
10548 | if ($cached) { |
10549 | $this->currPos = $cached->nextPos; |
10550 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10551 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10552 | return $cached->result; |
10553 | } |
10554 | $saved_preproc=$param_preproc; |
10555 | $saved_th=$param_th; |
10556 | $p2 = $this->currPos; |
10557 | // start seq_1 |
10558 | $p3 = $this->currPos; |
10559 | $p4 = $this->currPos; |
10560 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
10561 | $r5 = "//"; |
10562 | $this->currPos += 2; |
10563 | } else { |
10564 | $r5 = self::$FAILED; |
10565 | } |
10566 | if ($r5 === self::$FAILED) { |
10567 | $r5 = false; |
10568 | } else { |
10569 | $r5 = self::$FAILED; |
10570 | $this->currPos = $p4; |
10571 | $r1 = self::$FAILED; |
10572 | goto seq_1; |
10573 | } |
10574 | // free $p4 |
10575 | $p4 = $this->currPos; |
10576 | // start seq_2 |
10577 | $p7 = $this->currPos; |
10578 | $r8 = $this->parseurl_protocol($silence); |
10579 | // proto <- $r8 |
10580 | if ($r8===self::$FAILED) { |
10581 | $r6 = self::$FAILED; |
10582 | goto seq_2; |
10583 | } |
10584 | // start choice_1 |
10585 | $r9 = $this->parseipv6urladdr($silence); |
10586 | if ($r9!==self::$FAILED) { |
10587 | goto choice_1; |
10588 | } |
10589 | $r9 = ''; |
10590 | choice_1: |
10591 | // addr <- $r9 |
10592 | if ($r9===self::$FAILED) { |
10593 | $this->currPos = $p7; |
10594 | $r6 = self::$FAILED; |
10595 | goto seq_2; |
10596 | } |
10597 | $r10 = []; |
10598 | for (;;) { |
10599 | $p12 = $this->currPos; |
10600 | // start seq_3 |
10601 | $p13 = $this->currPos; |
10602 | $p14 = $this->currPos; |
10603 | $r15 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
10604 | if ($r15 === self::$FAILED) { |
10605 | $r15 = false; |
10606 | } else { |
10607 | $r15 = self::$FAILED; |
10608 | $this->currPos = $p14; |
10609 | $r11 = self::$FAILED; |
10610 | goto seq_3; |
10611 | } |
10612 | // free $p14 |
10613 | // start choice_2 |
10614 | $r16 = $this->parseno_punctuation_char($silence); |
10615 | if ($r16!==self::$FAILED) { |
10616 | goto choice_2; |
10617 | } |
10618 | $r16 = $this->parsecomment($silence); |
10619 | if ($r16!==self::$FAILED) { |
10620 | goto choice_2; |
10621 | } |
10622 | $r16 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
10623 | if ($r16!==self::$FAILED) { |
10624 | goto choice_2; |
10625 | } |
10626 | $p14 = $this->currPos; |
10627 | // start seq_4 |
10628 | $p17 = $this->currPos; |
10629 | if (($this->input[$this->currPos] ?? null) === "'") { |
10630 | $this->currPos++; |
10631 | $r18 = "'"; |
10632 | } else { |
10633 | if (!$silence) {$this->fail(33);} |
10634 | $r18 = self::$FAILED; |
10635 | $r16 = self::$FAILED; |
10636 | goto seq_4; |
10637 | } |
10638 | $p19 = $this->currPos; |
10639 | if (($this->input[$this->currPos] ?? null) === "'") { |
10640 | $this->currPos++; |
10641 | $r20 = "'"; |
10642 | } else { |
10643 | $r20 = self::$FAILED; |
10644 | } |
10645 | if ($r20 === self::$FAILED) { |
10646 | $r20 = false; |
10647 | } else { |
10648 | $r20 = self::$FAILED; |
10649 | $this->currPos = $p19; |
10650 | $this->currPos = $p17; |
10651 | $r16 = self::$FAILED; |
10652 | goto seq_4; |
10653 | } |
10654 | // free $p19 |
10655 | $r16 = true; |
10656 | seq_4: |
10657 | if ($r16!==self::$FAILED) { |
10658 | $r16 = substr($this->input, $p14, $this->currPos - $p14); |
10659 | goto choice_2; |
10660 | } else { |
10661 | $r16 = self::$FAILED; |
10662 | } |
10663 | // free $p17 |
10664 | // free $p14 |
10665 | if (($this->input[$this->currPos] ?? null) === "{") { |
10666 | $this->currPos++; |
10667 | $r16 = "{"; |
10668 | goto choice_2; |
10669 | } else { |
10670 | if (!$silence) {$this->fail(29);} |
10671 | $r16 = self::$FAILED; |
10672 | } |
10673 | $p14 = $this->currPos; |
10674 | // start seq_5 |
10675 | $p17 = $this->currPos; |
10676 | $p19 = $this->currPos; |
10677 | // start seq_6 |
10678 | $p22 = $this->currPos; |
10679 | $r23 = $this->parseraw_htmlentity(true); |
10680 | // rhe <- $r23 |
10681 | if ($r23===self::$FAILED) { |
10682 | $r21 = self::$FAILED; |
10683 | goto seq_6; |
10684 | } |
10685 | $this->savedPos = $this->currPos; |
10686 | $r24 = $this->a119($r8, $r9, $r23); |
10687 | if ($r24) { |
10688 | $r24 = false; |
10689 | } else { |
10690 | $r24 = self::$FAILED; |
10691 | $this->currPos = $p22; |
10692 | $r21 = self::$FAILED; |
10693 | goto seq_6; |
10694 | } |
10695 | $r21 = true; |
10696 | seq_6: |
10697 | // free $p22 |
10698 | if ($r21 === self::$FAILED) { |
10699 | $r21 = false; |
10700 | } else { |
10701 | $r21 = self::$FAILED; |
10702 | $this->currPos = $p19; |
10703 | $r16 = self::$FAILED; |
10704 | goto seq_5; |
10705 | } |
10706 | // free $p19 |
10707 | // start choice_3 |
10708 | $p19 = $this->currPos; |
10709 | // start seq_7 |
10710 | $p22 = $this->currPos; |
10711 | $p26 = $this->currPos; |
10712 | if (($this->input[$this->currPos] ?? null) === "&") { |
10713 | $this->currPos++; |
10714 | $r27 = "&"; |
10715 | $r27 = false; |
10716 | $this->currPos = $p26; |
10717 | } else { |
10718 | $r27 = self::$FAILED; |
10719 | $r25 = self::$FAILED; |
10720 | goto seq_7; |
10721 | } |
10722 | // free $p26 |
10723 | $r28 = $this->parsehtmlentity($silence); |
10724 | // he <- $r28 |
10725 | if ($r28===self::$FAILED) { |
10726 | $this->currPos = $p22; |
10727 | $r25 = self::$FAILED; |
10728 | goto seq_7; |
10729 | } |
10730 | $r25 = true; |
10731 | seq_7: |
10732 | if ($r25!==self::$FAILED) { |
10733 | $this->savedPos = $p19; |
10734 | $r25 = $this->a9($r8, $r9, $r28); |
10735 | goto choice_3; |
10736 | } |
10737 | // free $p22 |
10738 | if (($this->input[$this->currPos] ?? null) === "&") { |
10739 | $this->currPos++; |
10740 | $r25 = "&"; |
10741 | } else { |
10742 | if (!$silence) {$this->fail(4);} |
10743 | $r25 = self::$FAILED; |
10744 | } |
10745 | choice_3: |
10746 | // r <- $r25 |
10747 | if ($r25===self::$FAILED) { |
10748 | $this->currPos = $p17; |
10749 | $r16 = self::$FAILED; |
10750 | goto seq_5; |
10751 | } |
10752 | $r16 = true; |
10753 | seq_5: |
10754 | if ($r16!==self::$FAILED) { |
10755 | $this->savedPos = $p14; |
10756 | $r16 = $this->a10($r8, $r9, $r25); |
10757 | } |
10758 | // free $p17 |
10759 | choice_2: |
10760 | // c <- $r16 |
10761 | if ($r16===self::$FAILED) { |
10762 | $this->currPos = $p13; |
10763 | $r11 = self::$FAILED; |
10764 | goto seq_3; |
10765 | } |
10766 | $r11 = true; |
10767 | seq_3: |
10768 | if ($r11!==self::$FAILED) { |
10769 | $this->savedPos = $p12; |
10770 | $r11 = $this->a11($r8, $r9, $r16); |
10771 | $r10[] = $r11; |
10772 | } else { |
10773 | break; |
10774 | } |
10775 | // free $p13 |
10776 | } |
10777 | // path <- $r10 |
10778 | // free $r11 |
10779 | $r6 = true; |
10780 | seq_2: |
10781 | // r <- $r6 |
10782 | if ($r6!==self::$FAILED) { |
10783 | $this->savedPos = $p4; |
10784 | $r6 = $this->a120($r8, $r9, $r10); |
10785 | } else { |
10786 | $this->currPos = $p3; |
10787 | $r1 = self::$FAILED; |
10788 | goto seq_1; |
10789 | } |
10790 | // free $p7 |
10791 | $this->savedPos = $this->currPos; |
10792 | $r11 = $this->a121($r6); |
10793 | if ($r11) { |
10794 | $r11 = false; |
10795 | } else { |
10796 | $r11 = self::$FAILED; |
10797 | $this->currPos = $p3; |
10798 | $r1 = self::$FAILED; |
10799 | goto seq_1; |
10800 | } |
10801 | $r1 = true; |
10802 | seq_1: |
10803 | if ($r1!==self::$FAILED) { |
10804 | $this->savedPos = $p2; |
10805 | $r1 = $this->a122($r6); |
10806 | } |
10807 | // free $p3 |
10808 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10809 | $this->currPos, |
10810 | $r1, |
10811 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10812 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10813 | ); |
10814 | return $r1; |
10815 | } |
10816 | private function parseautoref($silence) { |
10817 | $key = 320; |
10818 | $bucket = $this->currPos; |
10819 | $cached = $this->cache[$bucket][$key] ?? null; |
10820 | if ($cached) { |
10821 | $this->currPos = $cached->nextPos; |
10822 | |
10823 | return $cached->result; |
10824 | } |
10825 | |
10826 | $p2 = $this->currPos; |
10827 | // start seq_1 |
10828 | $p3 = $this->currPos; |
10829 | // start choice_1 |
10830 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "RFC", $this->currPos, 3, false) === 0) { |
10831 | $r4 = "RFC"; |
10832 | $this->currPos += 3; |
10833 | goto choice_1; |
10834 | } else { |
10835 | if (!$silence) {$this->fail(66);} |
10836 | $r4 = self::$FAILED; |
10837 | } |
10838 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "PMID", $this->currPos, 4, false) === 0) { |
10839 | $r4 = "PMID"; |
10840 | $this->currPos += 4; |
10841 | } else { |
10842 | if (!$silence) {$this->fail(67);} |
10843 | $r4 = self::$FAILED; |
10844 | } |
10845 | choice_1: |
10846 | // ref <- $r4 |
10847 | if ($r4===self::$FAILED) { |
10848 | $r1 = self::$FAILED; |
10849 | goto seq_1; |
10850 | } |
10851 | $r5 = []; |
10852 | for (;;) { |
10853 | $r6 = $this->parsespace_or_nbsp($silence); |
10854 | if ($r6!==self::$FAILED) { |
10855 | $r5[] = $r6; |
10856 | } else { |
10857 | break; |
10858 | } |
10859 | } |
10860 | if (count($r5) === 0) { |
10861 | $r5 = self::$FAILED; |
10862 | } |
10863 | // sp <- $r5 |
10864 | if ($r5===self::$FAILED) { |
10865 | $this->currPos = $p3; |
10866 | $r1 = self::$FAILED; |
10867 | goto seq_1; |
10868 | } |
10869 | // free $r6 |
10870 | $p7 = $this->currPos; |
10871 | $r6 = self::$FAILED; |
10872 | for (;;) { |
10873 | $r8 = $this->input[$this->currPos] ?? ''; |
10874 | if (preg_match("/^[0-9]/", $r8)) { |
10875 | $this->currPos++; |
10876 | $r6 = true; |
10877 | } else { |
10878 | $r8 = self::$FAILED; |
10879 | if (!$silence) {$this->fail(68);} |
10880 | break; |
10881 | } |
10882 | } |
10883 | // identifier <- $r6 |
10884 | if ($r6!==self::$FAILED) { |
10885 | $r6 = substr($this->input, $p7, $this->currPos - $p7); |
10886 | } else { |
10887 | $r6 = self::$FAILED; |
10888 | $this->currPos = $p3; |
10889 | $r1 = self::$FAILED; |
10890 | goto seq_1; |
10891 | } |
10892 | // free $r8 |
10893 | // free $p7 |
10894 | $r8 = $this->discardend_of_word($silence); |
10895 | if ($r8===self::$FAILED) { |
10896 | $this->currPos = $p3; |
10897 | $r1 = self::$FAILED; |
10898 | goto seq_1; |
10899 | } |
10900 | $r1 = true; |
10901 | seq_1: |
10902 | if ($r1!==self::$FAILED) { |
10903 | $this->savedPos = $p2; |
10904 | $r1 = $this->a123($r4, $r5, $r6); |
10905 | } |
10906 | // free $p3 |
10907 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10908 | $this->currPos, |
10909 | $r1, |
10910 | self::$UNDEFINED, |
10911 | self::$UNDEFINED |
10912 | ); |
10913 | return $r1; |
10914 | } |
10915 | private function parseisbn($silence) { |
10916 | $key = 322; |
10917 | $bucket = $this->currPos; |
10918 | $cached = $this->cache[$bucket][$key] ?? null; |
10919 | if ($cached) { |
10920 | $this->currPos = $cached->nextPos; |
10921 | |
10922 | return $cached->result; |
10923 | } |
10924 | |
10925 | $p2 = $this->currPos; |
10926 | // start seq_1 |
10927 | $p3 = $this->currPos; |
10928 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "ISBN", $this->currPos, 4, false) === 0) { |
10929 | $r4 = "ISBN"; |
10930 | $this->currPos += 4; |
10931 | } else { |
10932 | if (!$silence) {$this->fail(69);} |
10933 | $r4 = self::$FAILED; |
10934 | $r1 = self::$FAILED; |
10935 | goto seq_1; |
10936 | } |
10937 | $r5 = []; |
10938 | for (;;) { |
10939 | $r6 = $this->parsespace_or_nbsp($silence); |
10940 | if ($r6!==self::$FAILED) { |
10941 | $r5[] = $r6; |
10942 | } else { |
10943 | break; |
10944 | } |
10945 | } |
10946 | if (count($r5) === 0) { |
10947 | $r5 = self::$FAILED; |
10948 | } |
10949 | // sp <- $r5 |
10950 | if ($r5===self::$FAILED) { |
10951 | $this->currPos = $p3; |
10952 | $r1 = self::$FAILED; |
10953 | goto seq_1; |
10954 | } |
10955 | // free $r6 |
10956 | // start seq_2 |
10957 | $p7 = $this->currPos; |
10958 | $r8 = $this->input[$this->currPos] ?? ''; |
10959 | if (preg_match("/^[0-9]/", $r8)) { |
10960 | $this->currPos++; |
10961 | } else { |
10962 | $r8 = self::$FAILED; |
10963 | if (!$silence) {$this->fail(68);} |
10964 | $r6 = self::$FAILED; |
10965 | goto seq_2; |
10966 | } |
10967 | $r9 = []; |
10968 | for (;;) { |
10969 | // start seq_3 |
10970 | $p11 = $this->currPos; |
10971 | // start choice_1 |
10972 | $r12 = $this->parsespace_or_nbsp_or_dash($silence); |
10973 | if ($r12!==self::$FAILED) { |
10974 | goto choice_1; |
10975 | } |
10976 | $r12 = ''; |
10977 | choice_1: |
10978 | if ($r12===self::$FAILED) { |
10979 | $r10 = self::$FAILED; |
10980 | goto seq_3; |
10981 | } |
10982 | $r13 = $this->input[$this->currPos] ?? ''; |
10983 | if (preg_match("/^[0-9]/", $r13)) { |
10984 | $this->currPos++; |
10985 | } else { |
10986 | $r13 = self::$FAILED; |
10987 | if (!$silence) {$this->fail(68);} |
10988 | $this->currPos = $p11; |
10989 | $r10 = self::$FAILED; |
10990 | goto seq_3; |
10991 | } |
10992 | $r10 = [$r12,$r13]; |
10993 | seq_3: |
10994 | if ($r10!==self::$FAILED) { |
10995 | $r9[] = $r10; |
10996 | } else { |
10997 | break; |
10998 | } |
10999 | // free $p11 |
11000 | } |
11001 | if (count($r9) === 0) { |
11002 | $r9 = self::$FAILED; |
11003 | } |
11004 | if ($r9===self::$FAILED) { |
11005 | $this->currPos = $p7; |
11006 | $r6 = self::$FAILED; |
11007 | goto seq_2; |
11008 | } |
11009 | // free $r10 |
11010 | // start choice_2 |
11011 | // start seq_4 |
11012 | $p11 = $this->currPos; |
11013 | // start choice_3 |
11014 | $r14 = $this->parsespace_or_nbsp_or_dash($silence); |
11015 | if ($r14!==self::$FAILED) { |
11016 | goto choice_3; |
11017 | } |
11018 | $r14 = ''; |
11019 | choice_3: |
11020 | if ($r14===self::$FAILED) { |
11021 | $r10 = self::$FAILED; |
11022 | goto seq_4; |
11023 | } |
11024 | $r15 = $this->input[$this->currPos] ?? ''; |
11025 | if ($r15 === "x" || $r15 === "X") { |
11026 | $this->currPos++; |
11027 | } else { |
11028 | $r15 = self::$FAILED; |
11029 | if (!$silence) {$this->fail(70);} |
11030 | $this->currPos = $p11; |
11031 | $r10 = self::$FAILED; |
11032 | goto seq_4; |
11033 | } |
11034 | $r10 = [$r14,$r15]; |
11035 | seq_4: |
11036 | if ($r10!==self::$FAILED) { |
11037 | goto choice_2; |
11038 | } |
11039 | // free $p11 |
11040 | $r10 = ''; |
11041 | choice_2: |
11042 | if ($r10===self::$FAILED) { |
11043 | $this->currPos = $p7; |
11044 | $r6 = self::$FAILED; |
11045 | goto seq_2; |
11046 | } |
11047 | $r6 = [$r8,$r9,$r10]; |
11048 | seq_2: |
11049 | // isbn <- $r6 |
11050 | if ($r6===self::$FAILED) { |
11051 | $this->currPos = $p3; |
11052 | $r1 = self::$FAILED; |
11053 | goto seq_1; |
11054 | } |
11055 | // free $p7 |
11056 | $p7 = $this->currPos; |
11057 | $r16 = $this->discardend_of_word($silence); |
11058 | // isbncode <- $r16 |
11059 | if ($r16!==self::$FAILED) { |
11060 | $this->savedPos = $p7; |
11061 | $r16 = $this->a124($r5, $r6); |
11062 | } else { |
11063 | $this->currPos = $p3; |
11064 | $r1 = self::$FAILED; |
11065 | goto seq_1; |
11066 | } |
11067 | $this->savedPos = $this->currPos; |
11068 | $r17 = $this->a125($r5, $r6, $r16); |
11069 | if ($r17) { |
11070 | $r17 = false; |
11071 | } else { |
11072 | $r17 = self::$FAILED; |
11073 | $this->currPos = $p3; |
11074 | $r1 = self::$FAILED; |
11075 | goto seq_1; |
11076 | } |
11077 | $r1 = true; |
11078 | seq_1: |
11079 | if ($r1!==self::$FAILED) { |
11080 | $this->savedPos = $p2; |
11081 | $r1 = $this->a126($r5, $r6, $r16); |
11082 | } |
11083 | // free $p3 |
11084 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11085 | $this->currPos, |
11086 | $r1, |
11087 | self::$UNDEFINED, |
11088 | self::$UNDEFINED |
11089 | ); |
11090 | return $r1; |
11091 | } |
11092 | private function discardbehavior_text($silence) { |
11093 | $key = 315; |
11094 | $bucket = $this->currPos; |
11095 | $cached = $this->cache[$bucket][$key] ?? null; |
11096 | if ($cached) { |
11097 | $this->currPos = $cached->nextPos; |
11098 | |
11099 | return $cached->result; |
11100 | } |
11101 | |
11102 | $p1 = $this->currPos; |
11103 | $r2 = self::$FAILED; |
11104 | for (;;) { |
11105 | // start seq_1 |
11106 | $p4 = $this->currPos; |
11107 | $p5 = $this->currPos; |
11108 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
11109 | $r6 = "__"; |
11110 | $this->currPos += 2; |
11111 | } else { |
11112 | $r6 = self::$FAILED; |
11113 | } |
11114 | if ($r6 === self::$FAILED) { |
11115 | $r6 = false; |
11116 | } else { |
11117 | $r6 = self::$FAILED; |
11118 | $this->currPos = $p5; |
11119 | $r3 = self::$FAILED; |
11120 | goto seq_1; |
11121 | } |
11122 | // free $p5 |
11123 | // start choice_1 |
11124 | $r7 = $this->discardtext_char($silence); |
11125 | if ($r7!==self::$FAILED) { |
11126 | goto choice_1; |
11127 | } |
11128 | if (($this->input[$this->currPos] ?? null) === "-") { |
11129 | $this->currPos++; |
11130 | $r7 = "-"; |
11131 | } else { |
11132 | if (!$silence) {$this->fail(55);} |
11133 | $r7 = self::$FAILED; |
11134 | } |
11135 | choice_1: |
11136 | if ($r7===self::$FAILED) { |
11137 | $this->currPos = $p4; |
11138 | $r3 = self::$FAILED; |
11139 | goto seq_1; |
11140 | } |
11141 | $r3 = true; |
11142 | seq_1: |
11143 | if ($r3!==self::$FAILED) { |
11144 | $r2 = true; |
11145 | } else { |
11146 | break; |
11147 | } |
11148 | // free $p4 |
11149 | } |
11150 | if ($r2!==self::$FAILED) { |
11151 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
11152 | } else { |
11153 | $r2 = self::$FAILED; |
11154 | } |
11155 | // free $r3 |
11156 | // free $p1 |
11157 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11158 | $this->currPos, |
11159 | $r2, |
11160 | self::$UNDEFINED, |
11161 | self::$UNDEFINED |
11162 | ); |
11163 | return $r2; |
11164 | } |
11165 | private function parselang_variant($silence, $boolParams, &$param_th, &$param_preproc) { |
11166 | $key = json_encode([362, $boolParams & 0x3ff7, $param_th, $param_preproc]); |
11167 | $bucket = $this->currPos; |
11168 | $cached = $this->cache[$bucket][$key] ?? null; |
11169 | if ($cached) { |
11170 | $this->currPos = $cached->nextPos; |
11171 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11172 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11173 | return $cached->result; |
11174 | } |
11175 | $saved_th=$param_th; |
11176 | $saved_preproc=$param_preproc; |
11177 | // start choice_1 |
11178 | $r1 = $this->parselang_variant_preproc($silence, $boolParams & ~0x8, self::newRef("}-"), $param_th); |
11179 | if ($r1!==self::$FAILED) { |
11180 | goto choice_1; |
11181 | } |
11182 | $r1 = $this->parsebroken_lang_variant($silence, $param_preproc); |
11183 | choice_1: |
11184 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11185 | $this->currPos, |
11186 | $r1, |
11187 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11188 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11189 | ); |
11190 | return $r1; |
11191 | } |
11192 | private function parsewikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
11193 | $key = json_encode([394, $boolParams & 0x3fff, $param_preproc, $param_th]); |
11194 | $bucket = $this->currPos; |
11195 | $cached = $this->cache[$bucket][$key] ?? null; |
11196 | if ($cached) { |
11197 | $this->currPos = $cached->nextPos; |
11198 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11199 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11200 | return $cached->result; |
11201 | } |
11202 | $saved_preproc=$param_preproc; |
11203 | $saved_th=$param_th; |
11204 | $p2 = $this->currPos; |
11205 | // start seq_1 |
11206 | $p3 = $this->currPos; |
11207 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
11208 | $r4 = "[["; |
11209 | $this->currPos += 2; |
11210 | } else { |
11211 | if (!$silence) {$this->fail(41);} |
11212 | $r4 = self::$FAILED; |
11213 | $r1 = self::$FAILED; |
11214 | goto seq_1; |
11215 | } |
11216 | $p6 = $this->currPos; |
11217 | $r5 = ''; |
11218 | // spos <- $r5 |
11219 | if ($r5!==self::$FAILED) { |
11220 | $this->savedPos = $p6; |
11221 | $r5 = $this->a17(); |
11222 | } else { |
11223 | $this->currPos = $p3; |
11224 | $r1 = self::$FAILED; |
11225 | goto seq_1; |
11226 | } |
11227 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
11228 | if ($r7===self::$FAILED) { |
11229 | $r7 = null; |
11230 | } |
11231 | // target <- $r7 |
11232 | $p9 = $this->currPos; |
11233 | $r8 = ''; |
11234 | // tpos <- $r8 |
11235 | if ($r8!==self::$FAILED) { |
11236 | $this->savedPos = $p9; |
11237 | $r8 = $this->a108($r5, $r7); |
11238 | } else { |
11239 | $this->currPos = $p3; |
11240 | $r1 = self::$FAILED; |
11241 | goto seq_1; |
11242 | } |
11243 | $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
11244 | // lcs <- $r10 |
11245 | if ($r10===self::$FAILED) { |
11246 | $this->currPos = $p3; |
11247 | $r1 = self::$FAILED; |
11248 | goto seq_1; |
11249 | } |
11250 | $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
11251 | if ($r11===self::$FAILED) { |
11252 | $this->currPos = $p3; |
11253 | $r1 = self::$FAILED; |
11254 | goto seq_1; |
11255 | } |
11256 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
11257 | $r12 = "]]"; |
11258 | $this->currPos += 2; |
11259 | } else { |
11260 | if (!$silence) {$this->fail(63);} |
11261 | $r12 = self::$FAILED; |
11262 | $this->currPos = $p3; |
11263 | $r1 = self::$FAILED; |
11264 | goto seq_1; |
11265 | } |
11266 | $r1 = true; |
11267 | seq_1: |
11268 | if ($r1!==self::$FAILED) { |
11269 | $this->savedPos = $p2; |
11270 | $r1 = $this->a109($r5, $r7, $r8, $r10); |
11271 | } |
11272 | // free $p3 |
11273 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11274 | $this->currPos, |
11275 | $r1, |
11276 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11277 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11278 | ); |
11279 | return $r1; |
11280 | } |
11281 | private function parsebroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
11282 | $key = json_encode([392, $boolParams & 0x3fff, $param_preproc, $param_th]); |
11283 | $bucket = $this->currPos; |
11284 | $cached = $this->cache[$bucket][$key] ?? null; |
11285 | if ($cached) { |
11286 | $this->currPos = $cached->nextPos; |
11287 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11288 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11289 | return $cached->result; |
11290 | } |
11291 | $saved_preproc=$param_preproc; |
11292 | $saved_th=$param_th; |
11293 | $p2 = $this->currPos; |
11294 | // start seq_1 |
11295 | $p3 = $this->currPos; |
11296 | $p4 = $this->currPos; |
11297 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
11298 | $r5 = "[["; |
11299 | $this->currPos += 2; |
11300 | $r5 = false; |
11301 | $this->currPos = $p4; |
11302 | } else { |
11303 | $r5 = self::$FAILED; |
11304 | $r1 = self::$FAILED; |
11305 | goto seq_1; |
11306 | } |
11307 | // free $p4 |
11308 | $this->savedPos = $this->currPos; |
11309 | $r6 = $this->a110($param_preproc); |
11310 | if ($r6) { |
11311 | $r6 = false; |
11312 | } else { |
11313 | $r6 = self::$FAILED; |
11314 | $this->currPos = $p3; |
11315 | $r1 = self::$FAILED; |
11316 | goto seq_1; |
11317 | } |
11318 | // start seq_2 |
11319 | $p4 = $this->currPos; |
11320 | if (($this->input[$this->currPos] ?? null) === "[") { |
11321 | $this->currPos++; |
11322 | $r8 = "["; |
11323 | } else { |
11324 | if (!$silence) {$this->fail(19);} |
11325 | $r8 = self::$FAILED; |
11326 | $r7 = self::$FAILED; |
11327 | goto seq_2; |
11328 | } |
11329 | // start choice_1 |
11330 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
11331 | if ($r9!==self::$FAILED) { |
11332 | goto choice_1; |
11333 | } |
11334 | if (($this->input[$this->currPos] ?? null) === "[") { |
11335 | $this->currPos++; |
11336 | $r9 = "["; |
11337 | } else { |
11338 | if (!$silence) {$this->fail(19);} |
11339 | $r9 = self::$FAILED; |
11340 | } |
11341 | choice_1: |
11342 | if ($r9===self::$FAILED) { |
11343 | $this->currPos = $p4; |
11344 | $r7 = self::$FAILED; |
11345 | goto seq_2; |
11346 | } |
11347 | $r7 = [$r8,$r9]; |
11348 | seq_2: |
11349 | // a <- $r7 |
11350 | if ($r7===self::$FAILED) { |
11351 | $this->currPos = $p3; |
11352 | $r1 = self::$FAILED; |
11353 | goto seq_1; |
11354 | } |
11355 | // free $p4 |
11356 | $r1 = true; |
11357 | seq_1: |
11358 | if ($r1!==self::$FAILED) { |
11359 | $this->savedPos = $p2; |
11360 | $r1 = $this->a111($param_preproc, $r7); |
11361 | } |
11362 | // free $p3 |
11363 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11364 | $this->currPos, |
11365 | $r1, |
11366 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11367 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11368 | ); |
11369 | return $r1; |
11370 | } |
11371 | private function parsetable_heading_tags($silence, $boolParams, &$param_preproc) { |
11372 | $key = json_encode([466, $boolParams & 0x3fff, $param_preproc]); |
11373 | $bucket = $this->currPos; |
11374 | $cached = $this->cache[$bucket][$key] ?? null; |
11375 | if ($cached) { |
11376 | $this->currPos = $cached->nextPos; |
11377 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11378 | return $cached->result; |
11379 | } |
11380 | $saved_preproc=$param_preproc; |
11381 | $r1 = $this->parsetable_heading_tags_parameterized($silence, $boolParams, $param_preproc, self::newRef(true)); |
11382 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11383 | $this->currPos, |
11384 | $r1, |
11385 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11386 | self::$UNDEFINED |
11387 | ); |
11388 | return $r1; |
11389 | } |
11390 | private function parsetable_row_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
11391 | $key = json_encode([458, $boolParams & 0x3fbf, $param_preproc, $param_th]); |
11392 | $bucket = $this->currPos; |
11393 | $cached = $this->cache[$bucket][$key] ?? null; |
11394 | if ($cached) { |
11395 | $this->currPos = $cached->nextPos; |
11396 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11397 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11398 | return $cached->result; |
11399 | } |
11400 | $saved_preproc=$param_preproc; |
11401 | $saved_th=$param_th; |
11402 | $p2 = $this->currPos; |
11403 | // start seq_1 |
11404 | $p3 = $this->currPos; |
11405 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11406 | $r4 = false; |
11407 | } else { |
11408 | $r4 = self::$FAILED; |
11409 | $r1 = self::$FAILED; |
11410 | goto seq_1; |
11411 | } |
11412 | $r5 = $this->parsepipe($silence); |
11413 | // p <- $r5 |
11414 | if ($r5===self::$FAILED) { |
11415 | $this->currPos = $p3; |
11416 | $r1 = self::$FAILED; |
11417 | goto seq_1; |
11418 | } |
11419 | $p7 = $this->currPos; |
11420 | $r6 = self::$FAILED; |
11421 | for (;;) { |
11422 | if (($this->input[$this->currPos] ?? null) === "-") { |
11423 | $this->currPos++; |
11424 | $r8 = "-"; |
11425 | $r6 = true; |
11426 | } else { |
11427 | if (!$silence) {$this->fail(55);} |
11428 | $r8 = self::$FAILED; |
11429 | break; |
11430 | } |
11431 | } |
11432 | // dashes <- $r6 |
11433 | if ($r6!==self::$FAILED) { |
11434 | $r6 = substr($this->input, $p7, $this->currPos - $p7); |
11435 | } else { |
11436 | $r6 = self::$FAILED; |
11437 | $this->currPos = $p3; |
11438 | $r1 = self::$FAILED; |
11439 | goto seq_1; |
11440 | } |
11441 | // free $r8 |
11442 | // free $p7 |
11443 | // start choice_1 |
11444 | $r8 = $this->parsetable_attributes($silence, $boolParams & ~0x40, $param_preproc, $param_th); |
11445 | if ($r8!==self::$FAILED) { |
11446 | goto choice_1; |
11447 | } |
11448 | $this->savedPos = $this->currPos; |
11449 | $r8 = $this->a127($r5, $r6); |
11450 | if ($r8) { |
11451 | $r8 = false; |
11452 | } else { |
11453 | $r8 = self::$FAILED; |
11454 | } |
11455 | choice_1: |
11456 | // a <- $r8 |
11457 | if ($r8===self::$FAILED) { |
11458 | $this->currPos = $p3; |
11459 | $r1 = self::$FAILED; |
11460 | goto seq_1; |
11461 | } |
11462 | $p7 = $this->currPos; |
11463 | $r9 = ''; |
11464 | // tagEndPos <- $r9 |
11465 | if ($r9!==self::$FAILED) { |
11466 | $this->savedPos = $p7; |
11467 | $r9 = $this->a128($r5, $r6, $r8); |
11468 | } else { |
11469 | $this->currPos = $p3; |
11470 | $r1 = self::$FAILED; |
11471 | goto seq_1; |
11472 | } |
11473 | $r10 = []; |
11474 | for (;;) { |
11475 | $r11 = $this->parsespace($silence); |
11476 | if ($r11!==self::$FAILED) { |
11477 | $r10[] = $r11; |
11478 | } else { |
11479 | break; |
11480 | } |
11481 | } |
11482 | // s2 <- $r10 |
11483 | // free $r11 |
11484 | $r1 = true; |
11485 | seq_1: |
11486 | if ($r1!==self::$FAILED) { |
11487 | $this->savedPos = $p2; |
11488 | $r1 = $this->a129($r5, $r6, $r8, $r9, $r10); |
11489 | } |
11490 | // free $p3 |
11491 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11492 | $this->currPos, |
11493 | $r1, |
11494 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11495 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11496 | ); |
11497 | return $r1; |
11498 | } |
11499 | private function parsetable_data_tags($silence, $boolParams, &$param_preproc, &$param_th) { |
11500 | $key = json_encode([462, $boolParams & 0x3fff, $param_preproc, $param_th]); |
11501 | $bucket = $this->currPos; |
11502 | $cached = $this->cache[$bucket][$key] ?? null; |
11503 | if ($cached) { |
11504 | $this->currPos = $cached->nextPos; |
11505 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11506 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11507 | return $cached->result; |
11508 | } |
11509 | $saved_preproc=$param_preproc; |
11510 | $saved_th=$param_th; |
11511 | $p2 = $this->currPos; |
11512 | // start seq_1 |
11513 | $p3 = $this->currPos; |
11514 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11515 | $r4 = false; |
11516 | } else { |
11517 | $r4 = self::$FAILED; |
11518 | $r1 = self::$FAILED; |
11519 | goto seq_1; |
11520 | } |
11521 | $r5 = $this->parsepipe($silence); |
11522 | // p <- $r5 |
11523 | if ($r5===self::$FAILED) { |
11524 | $this->currPos = $p3; |
11525 | $r1 = self::$FAILED; |
11526 | goto seq_1; |
11527 | } |
11528 | $p6 = $this->currPos; |
11529 | $r7 = $this->input[$this->currPos] ?? ''; |
11530 | if ($r7 === "+" || $r7 === "-") { |
11531 | $this->currPos++; |
11532 | } else { |
11533 | $r7 = self::$FAILED; |
11534 | } |
11535 | if ($r7 === self::$FAILED) { |
11536 | $r7 = false; |
11537 | } else { |
11538 | $r7 = self::$FAILED; |
11539 | $this->currPos = $p6; |
11540 | $this->currPos = $p3; |
11541 | $r1 = self::$FAILED; |
11542 | goto seq_1; |
11543 | } |
11544 | // free $p6 |
11545 | $r8 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th); |
11546 | // td <- $r8 |
11547 | if ($r8===self::$FAILED) { |
11548 | $this->currPos = $p3; |
11549 | $r1 = self::$FAILED; |
11550 | goto seq_1; |
11551 | } |
11552 | $p6 = $this->currPos; |
11553 | $r9 = ''; |
11554 | // tagEndPos <- $r9 |
11555 | if ($r9!==self::$FAILED) { |
11556 | $this->savedPos = $p6; |
11557 | $r9 = $this->a130($r5, $r8); |
11558 | } else { |
11559 | $this->currPos = $p3; |
11560 | $r1 = self::$FAILED; |
11561 | goto seq_1; |
11562 | } |
11563 | $r10 = $this->parsetds($silence, $boolParams, $param_preproc, $param_th); |
11564 | // tds <- $r10 |
11565 | if ($r10===self::$FAILED) { |
11566 | $this->currPos = $p3; |
11567 | $r1 = self::$FAILED; |
11568 | goto seq_1; |
11569 | } |
11570 | $r1 = true; |
11571 | seq_1: |
11572 | if ($r1!==self::$FAILED) { |
11573 | $this->savedPos = $p2; |
11574 | $r1 = $this->a131($r5, $r8, $r9, $r10); |
11575 | } |
11576 | // free $p3 |
11577 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11578 | $this->currPos, |
11579 | $r1, |
11580 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11581 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11582 | ); |
11583 | return $r1; |
11584 | } |
11585 | private function parsetable_caption_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
11586 | $key = json_encode([456, $boolParams & 0x3fff, $param_preproc, $param_th]); |
11587 | $bucket = $this->currPos; |
11588 | $cached = $this->cache[$bucket][$key] ?? null; |
11589 | if ($cached) { |
11590 | $this->currPos = $cached->nextPos; |
11591 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11592 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11593 | return $cached->result; |
11594 | } |
11595 | $saved_preproc=$param_preproc; |
11596 | $saved_th=$param_th; |
11597 | $p2 = $this->currPos; |
11598 | // start seq_1 |
11599 | $p3 = $this->currPos; |
11600 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11601 | $r4 = false; |
11602 | } else { |
11603 | $r4 = self::$FAILED; |
11604 | $r1 = self::$FAILED; |
11605 | goto seq_1; |
11606 | } |
11607 | $r5 = $this->parsepipe($silence); |
11608 | // p <- $r5 |
11609 | if ($r5===self::$FAILED) { |
11610 | $this->currPos = $p3; |
11611 | $r1 = self::$FAILED; |
11612 | goto seq_1; |
11613 | } |
11614 | if (($this->input[$this->currPos] ?? null) === "+") { |
11615 | $this->currPos++; |
11616 | $r6 = "+"; |
11617 | } else { |
11618 | if (!$silence) {$this->fail(71);} |
11619 | $r6 = self::$FAILED; |
11620 | $this->currPos = $p3; |
11621 | $r1 = self::$FAILED; |
11622 | goto seq_1; |
11623 | } |
11624 | $r7 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
11625 | if ($r7===self::$FAILED) { |
11626 | $r7 = null; |
11627 | } |
11628 | // args <- $r7 |
11629 | $p9 = $this->currPos; |
11630 | $r8 = ''; |
11631 | // tagEndPos <- $r8 |
11632 | if ($r8!==self::$FAILED) { |
11633 | $this->savedPos = $p9; |
11634 | $r8 = $this->a132($r5, $r7); |
11635 | } else { |
11636 | $this->currPos = $p3; |
11637 | $r1 = self::$FAILED; |
11638 | goto seq_1; |
11639 | } |
11640 | $r10 = []; |
11641 | for (;;) { |
11642 | $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
11643 | if ($r11!==self::$FAILED) { |
11644 | $r10[] = $r11; |
11645 | } else { |
11646 | break; |
11647 | } |
11648 | } |
11649 | // c <- $r10 |
11650 | // free $r11 |
11651 | $r1 = true; |
11652 | seq_1: |
11653 | if ($r1!==self::$FAILED) { |
11654 | $this->savedPos = $p2; |
11655 | $r1 = $this->a133($r5, $r7, $r8, $r10); |
11656 | } |
11657 | // free $p3 |
11658 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11659 | $this->currPos, |
11660 | $r1, |
11661 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11662 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11663 | ); |
11664 | return $r1; |
11665 | } |
11666 | private function parsenewline($silence) { |
11667 | $key = 518; |
11668 | $bucket = $this->currPos; |
11669 | $cached = $this->cache[$bucket][$key] ?? null; |
11670 | if ($cached) { |
11671 | $this->currPos = $cached->nextPos; |
11672 | |
11673 | return $cached->result; |
11674 | } |
11675 | |
11676 | // start choice_1 |
11677 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
11678 | $this->currPos++; |
11679 | $r1 = "\x0a"; |
11680 | goto choice_1; |
11681 | } else { |
11682 | if (!$silence) {$this->fail(27);} |
11683 | $r1 = self::$FAILED; |
11684 | } |
11685 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
11686 | $r1 = "\x0d\x0a"; |
11687 | $this->currPos += 2; |
11688 | } else { |
11689 | if (!$silence) {$this->fail(28);} |
11690 | $r1 = self::$FAILED; |
11691 | } |
11692 | choice_1: |
11693 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11694 | $this->currPos, |
11695 | $r1, |
11696 | self::$UNDEFINED, |
11697 | self::$UNDEFINED |
11698 | ); |
11699 | return $r1; |
11700 | } |
11701 | private function discardsol($silence, $boolParams, &$param_preproc, &$param_th) { |
11702 | $key = json_encode([543, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
11703 | $bucket = $this->currPos; |
11704 | $cached = $this->cache[$bucket][$key] ?? null; |
11705 | if ($cached) { |
11706 | $this->currPos = $cached->nextPos; |
11707 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11708 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11709 | return $cached->result; |
11710 | } |
11711 | $saved_preproc=$param_preproc; |
11712 | $saved_th=$param_th; |
11713 | // start seq_1 |
11714 | $p1 = $this->currPos; |
11715 | // start choice_1 |
11716 | $r3 = $this->discardempty_line_with_comments($silence); |
11717 | if ($r3!==self::$FAILED) { |
11718 | goto choice_1; |
11719 | } |
11720 | $r3 = $this->discardsol_prefix($silence); |
11721 | choice_1: |
11722 | if ($r3===self::$FAILED) { |
11723 | $r2 = self::$FAILED; |
11724 | goto seq_1; |
11725 | } |
11726 | for (;;) { |
11727 | $r5 = $this->discardsol_transparent($silence, $boolParams, $param_preproc, $param_th); |
11728 | if ($r5===self::$FAILED) { |
11729 | break; |
11730 | } |
11731 | } |
11732 | // free $r5 |
11733 | $r4 = true; |
11734 | if ($r4===self::$FAILED) { |
11735 | $this->currPos = $p1; |
11736 | $r2 = self::$FAILED; |
11737 | goto seq_1; |
11738 | } |
11739 | // free $r4 |
11740 | $r2 = true; |
11741 | seq_1: |
11742 | // free $r2,$p1 |
11743 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11744 | $this->currPos, |
11745 | $r2, |
11746 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11747 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11748 | ); |
11749 | return $r2; |
11750 | } |
11751 | private function parsetemplate_param_value($silence, $boolParams, &$param_preproc, &$param_th) { |
11752 | $key = json_encode([354, $boolParams & 0x3e17, $param_preproc, $param_th]); |
11753 | $bucket = $this->currPos; |
11754 | $cached = $this->cache[$bucket][$key] ?? null; |
11755 | if ($cached) { |
11756 | $this->currPos = $cached->nextPos; |
11757 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11758 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11759 | return $cached->result; |
11760 | } |
11761 | $saved_preproc=$param_preproc; |
11762 | $saved_th=$param_th; |
11763 | $p2 = $this->currPos; |
11764 | $r3 = $this->parsetemplate_param_text($silence, $boolParams & ~0x20, $param_preproc, $param_th); |
11765 | // tpt <- $r3 |
11766 | $r1 = $r3; |
11767 | if ($r1!==self::$FAILED) { |
11768 | $this->savedPos = $p2; |
11769 | $r1 = $this->a134($r3); |
11770 | } |
11771 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11772 | $this->currPos, |
11773 | $r1, |
11774 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11775 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11776 | ); |
11777 | return $r1; |
11778 | } |
11779 | private function discardnl_comment_space($silence) { |
11780 | $key = 527; |
11781 | $bucket = $this->currPos; |
11782 | $cached = $this->cache[$bucket][$key] ?? null; |
11783 | if ($cached) { |
11784 | $this->currPos = $cached->nextPos; |
11785 | |
11786 | return $cached->result; |
11787 | } |
11788 | |
11789 | // start choice_1 |
11790 | $r1 = $this->discardnewlineToken($silence); |
11791 | if ($r1!==self::$FAILED) { |
11792 | goto choice_1; |
11793 | } |
11794 | $r1 = $this->discardspace($silence); |
11795 | if ($r1!==self::$FAILED) { |
11796 | goto choice_1; |
11797 | } |
11798 | $r1 = $this->discardcomment($silence); |
11799 | choice_1: |
11800 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11801 | $this->currPos, |
11802 | $r1, |
11803 | self::$UNDEFINED, |
11804 | self::$UNDEFINED |
11805 | ); |
11806 | return $r1; |
11807 | } |
11808 | private function parsenl_comment_space($silence) { |
11809 | $key = 526; |
11810 | $bucket = $this->currPos; |
11811 | $cached = $this->cache[$bucket][$key] ?? null; |
11812 | if ($cached) { |
11813 | $this->currPos = $cached->nextPos; |
11814 | |
11815 | return $cached->result; |
11816 | } |
11817 | |
11818 | // start choice_1 |
11819 | $r1 = $this->parsenewlineToken($silence); |
11820 | if ($r1!==self::$FAILED) { |
11821 | goto choice_1; |
11822 | } |
11823 | $r1 = $this->parsespace($silence); |
11824 | if ($r1!==self::$FAILED) { |
11825 | goto choice_1; |
11826 | } |
11827 | $r1 = $this->parsecomment($silence); |
11828 | choice_1: |
11829 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11830 | $this->currPos, |
11831 | $r1, |
11832 | self::$UNDEFINED, |
11833 | self::$UNDEFINED |
11834 | ); |
11835 | return $r1; |
11836 | } |
11837 | private function parsetemplate_param($silence, $boolParams, &$param_preproc, &$param_th) { |
11838 | $key = json_encode([350, $boolParams & 0x3e17, $param_preproc, $param_th]); |
11839 | $bucket = $this->currPos; |
11840 | $cached = $this->cache[$bucket][$key] ?? null; |
11841 | if ($cached) { |
11842 | $this->currPos = $cached->nextPos; |
11843 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11844 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11845 | return $cached->result; |
11846 | } |
11847 | $saved_preproc=$param_preproc; |
11848 | $saved_th=$param_th; |
11849 | // start choice_1 |
11850 | $p2 = $this->currPos; |
11851 | // start seq_1 |
11852 | $p3 = $this->currPos; |
11853 | $r4 = $this->parsetemplate_param_name($silence, $boolParams, $param_preproc, $param_th); |
11854 | // name <- $r4 |
11855 | if ($r4===self::$FAILED) { |
11856 | $r1 = self::$FAILED; |
11857 | goto seq_1; |
11858 | } |
11859 | $p6 = $this->currPos; |
11860 | // start seq_2 |
11861 | $p7 = $this->currPos; |
11862 | $p9 = $this->currPos; |
11863 | $r8 = ''; |
11864 | // kEndPos <- $r8 |
11865 | if ($r8!==self::$FAILED) { |
11866 | $this->savedPos = $p9; |
11867 | $r8 = $this->a135($r4); |
11868 | } else { |
11869 | $r5 = self::$FAILED; |
11870 | goto seq_2; |
11871 | } |
11872 | if (($this->input[$this->currPos] ?? null) === "=") { |
11873 | $this->currPos++; |
11874 | $r10 = "="; |
11875 | } else { |
11876 | if (!$silence) {$this->fail(23);} |
11877 | $r10 = self::$FAILED; |
11878 | $this->currPos = $p7; |
11879 | $r5 = self::$FAILED; |
11880 | goto seq_2; |
11881 | } |
11882 | $p12 = $this->currPos; |
11883 | $r11 = ''; |
11884 | // vStartPos <- $r11 |
11885 | if ($r11!==self::$FAILED) { |
11886 | $this->savedPos = $p12; |
11887 | $r11 = $this->a136($r4, $r8); |
11888 | } else { |
11889 | $this->currPos = $p7; |
11890 | $r5 = self::$FAILED; |
11891 | goto seq_2; |
11892 | } |
11893 | $r13 = $this->parseoptionalSpaceToken($silence); |
11894 | // optSp <- $r13 |
11895 | if ($r13===self::$FAILED) { |
11896 | $this->currPos = $p7; |
11897 | $r5 = self::$FAILED; |
11898 | goto seq_2; |
11899 | } |
11900 | $r14 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
11901 | if ($r14===self::$FAILED) { |
11902 | $r14 = null; |
11903 | } |
11904 | // tpv <- $r14 |
11905 | $r5 = true; |
11906 | seq_2: |
11907 | if ($r5!==self::$FAILED) { |
11908 | $this->savedPos = $p6; |
11909 | $r5 = $this->a137($r4, $r8, $r11, $r13, $r14); |
11910 | } else { |
11911 | $r5 = null; |
11912 | } |
11913 | // free $p7 |
11914 | // val <- $r5 |
11915 | $r1 = true; |
11916 | seq_1: |
11917 | if ($r1!==self::$FAILED) { |
11918 | $this->savedPos = $p2; |
11919 | $r1 = $this->a138($r4, $r5); |
11920 | goto choice_1; |
11921 | } |
11922 | // free $p3 |
11923 | $p3 = $this->currPos; |
11924 | $p7 = $this->currPos; |
11925 | $r1 = $this->input[$this->currPos] ?? ''; |
11926 | if ($r1 === "|" || $r1 === "}") { |
11927 | $this->currPos++; |
11928 | $r1 = false; |
11929 | $this->currPos = $p7; |
11930 | $this->savedPos = $p3; |
11931 | $r1 = $this->a139(); |
11932 | } else { |
11933 | $r1 = self::$FAILED; |
11934 | } |
11935 | // free $p7 |
11936 | choice_1: |
11937 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11938 | $this->currPos, |
11939 | $r1, |
11940 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11941 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11942 | ); |
11943 | return $r1; |
11944 | } |
11945 | private function parsewikilink_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
11946 | $key = json_encode([488, $boolParams & 0x3fff, $param_preproc, $param_th]); |
11947 | $bucket = $this->currPos; |
11948 | $cached = $this->cache[$bucket][$key] ?? null; |
11949 | if ($cached) { |
11950 | $this->currPos = $cached->nextPos; |
11951 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11952 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11953 | return $cached->result; |
11954 | } |
11955 | $saved_preproc=$param_preproc; |
11956 | $saved_th=$param_th; |
11957 | $p2 = $this->currPos; |
11958 | $r3 = []; |
11959 | for (;;) { |
11960 | // start choice_1 |
11961 | $p6 = $this->currPos; |
11962 | $r5 = self::$FAILED; |
11963 | for (;;) { |
11964 | if (strcspn($this->input, "<[{\x0a\x0d\x09|!]}{ &-", $this->currPos, 1) !== 0) { |
11965 | $r7 = self::consumeChar($this->input, $this->currPos); |
11966 | $r5 = true; |
11967 | } else { |
11968 | $r7 = self::$FAILED; |
11969 | if (!$silence) {$this->fail(72);} |
11970 | break; |
11971 | } |
11972 | } |
11973 | // t <- $r5 |
11974 | if ($r5!==self::$FAILED) { |
11975 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
11976 | } else { |
11977 | $r5 = self::$FAILED; |
11978 | } |
11979 | // free $r7 |
11980 | // free $p6 |
11981 | $r4 = $r5; |
11982 | if ($r4!==self::$FAILED) { |
11983 | goto choice_1; |
11984 | } |
11985 | $p6 = $this->currPos; |
11986 | // start seq_1 |
11987 | $p8 = $this->currPos; |
11988 | $p9 = $this->currPos; |
11989 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
11990 | if ($r7 === self::$FAILED) { |
11991 | $r7 = false; |
11992 | } else { |
11993 | $r7 = self::$FAILED; |
11994 | $this->currPos = $p9; |
11995 | $r4 = self::$FAILED; |
11996 | goto seq_1; |
11997 | } |
11998 | // free $p9 |
11999 | // start choice_2 |
12000 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
12001 | if ($r10!==self::$FAILED) { |
12002 | goto choice_2; |
12003 | } |
12004 | $p9 = $this->currPos; |
12005 | // start seq_2 |
12006 | $p11 = $this->currPos; |
12007 | $p12 = $this->currPos; |
12008 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
12009 | $r13 = "]]"; |
12010 | $this->currPos += 2; |
12011 | } else { |
12012 | $r13 = self::$FAILED; |
12013 | } |
12014 | if ($r13 === self::$FAILED) { |
12015 | $r13 = false; |
12016 | } else { |
12017 | $r13 = self::$FAILED; |
12018 | $this->currPos = $p12; |
12019 | $r10 = self::$FAILED; |
12020 | goto seq_2; |
12021 | } |
12022 | // free $p12 |
12023 | // start choice_3 |
12024 | $r14 = $this->discardtext_char($silence); |
12025 | if ($r14!==self::$FAILED) { |
12026 | goto choice_3; |
12027 | } |
12028 | if (strspn($this->input, "!<-}]\x0a\x0d", $this->currPos, 1) !== 0) { |
12029 | $r14 = $this->input[$this->currPos++]; |
12030 | } else { |
12031 | $r14 = self::$FAILED; |
12032 | if (!$silence) {$this->fail(73);} |
12033 | } |
12034 | choice_3: |
12035 | if ($r14===self::$FAILED) { |
12036 | $this->currPos = $p11; |
12037 | $r10 = self::$FAILED; |
12038 | goto seq_2; |
12039 | } |
12040 | $r10 = true; |
12041 | seq_2: |
12042 | if ($r10!==self::$FAILED) { |
12043 | $r10 = substr($this->input, $p9, $this->currPos - $p9); |
12044 | } else { |
12045 | $r10 = self::$FAILED; |
12046 | } |
12047 | // free $p11 |
12048 | // free $p9 |
12049 | choice_2: |
12050 | // wr <- $r10 |
12051 | if ($r10===self::$FAILED) { |
12052 | $this->currPos = $p8; |
12053 | $r4 = self::$FAILED; |
12054 | goto seq_1; |
12055 | } |
12056 | $r4 = true; |
12057 | seq_1: |
12058 | if ($r4!==self::$FAILED) { |
12059 | $this->savedPos = $p6; |
12060 | $r4 = $this->a140($r5, $r10); |
12061 | } |
12062 | // free $p8 |
12063 | choice_1: |
12064 | if ($r4!==self::$FAILED) { |
12065 | $r3[] = $r4; |
12066 | } else { |
12067 | break; |
12068 | } |
12069 | } |
12070 | if (count($r3) === 0) { |
12071 | $r3 = self::$FAILED; |
12072 | } |
12073 | // r <- $r3 |
12074 | // free $r4 |
12075 | $r1 = $r3; |
12076 | if ($r1!==self::$FAILED) { |
12077 | $this->savedPos = $p2; |
12078 | $r1 = $this->a141($r3); |
12079 | } |
12080 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12081 | $this->currPos, |
12082 | $r1, |
12083 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12084 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12085 | ); |
12086 | return $r1; |
12087 | } |
12088 | private function parsewikilink_content($silence, $boolParams, &$param_preproc, &$param_th) { |
12089 | $key = json_encode([388, $boolParams & 0x37df, $param_preproc, $param_th]); |
12090 | $bucket = $this->currPos; |
12091 | $cached = $this->cache[$bucket][$key] ?? null; |
12092 | if ($cached) { |
12093 | $this->currPos = $cached->nextPos; |
12094 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12095 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12096 | return $cached->result; |
12097 | } |
12098 | $saved_preproc=$param_preproc; |
12099 | $saved_th=$param_th; |
12100 | $r1 = []; |
12101 | for (;;) { |
12102 | $p3 = $this->currPos; |
12103 | // start seq_1 |
12104 | $p4 = $this->currPos; |
12105 | $r5 = $this->discardpipe($silence); |
12106 | if ($r5===self::$FAILED) { |
12107 | $r2 = self::$FAILED; |
12108 | goto seq_1; |
12109 | } |
12110 | $p7 = $this->currPos; |
12111 | $r6 = ''; |
12112 | // startPos <- $r6 |
12113 | if ($r6!==self::$FAILED) { |
12114 | $this->savedPos = $p7; |
12115 | $r6 = $this->a17(); |
12116 | } else { |
12117 | $this->currPos = $p4; |
12118 | $r2 = self::$FAILED; |
12119 | goto seq_1; |
12120 | } |
12121 | $r8 = $this->parselink_text($silence, $boolParams, $param_preproc, $param_th); |
12122 | if ($r8===self::$FAILED) { |
12123 | $r8 = null; |
12124 | } |
12125 | // lt <- $r8 |
12126 | $r2 = true; |
12127 | seq_1: |
12128 | if ($r2!==self::$FAILED) { |
12129 | $this->savedPos = $p3; |
12130 | $r2 = $this->a142($r6, $r8); |
12131 | $r1[] = $r2; |
12132 | } else { |
12133 | break; |
12134 | } |
12135 | // free $p4 |
12136 | } |
12137 | // free $r2 |
12138 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12139 | $this->currPos, |
12140 | $r1, |
12141 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12142 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12143 | ); |
12144 | return $r1; |
12145 | } |
12146 | private function parsetag_name($silence) { |
12147 | $key = 412; |
12148 | $bucket = $this->currPos; |
12149 | $cached = $this->cache[$bucket][$key] ?? null; |
12150 | if ($cached) { |
12151 | $this->currPos = $cached->nextPos; |
12152 | |
12153 | return $cached->result; |
12154 | } |
12155 | |
12156 | $p1 = $this->currPos; |
12157 | $r2 = self::$FAILED; |
12158 | for (;;) { |
12159 | if (strcspn($this->input, "\x09\x0a\x0b />\x00", $this->currPos, 1) !== 0) { |
12160 | $r3 = self::consumeChar($this->input, $this->currPos); |
12161 | $r2 = true; |
12162 | } else { |
12163 | $r3 = self::$FAILED; |
12164 | if (!$silence) {$this->fail(74);} |
12165 | break; |
12166 | } |
12167 | } |
12168 | if ($r2!==self::$FAILED) { |
12169 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
12170 | } else { |
12171 | $r2 = self::$FAILED; |
12172 | } |
12173 | // free $r3 |
12174 | // free $p1 |
12175 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12176 | $this->currPos, |
12177 | $r2, |
12178 | self::$UNDEFINED, |
12179 | self::$UNDEFINED |
12180 | ); |
12181 | return $r2; |
12182 | } |
12183 | private function parsespace_or_nbsp($silence) { |
12184 | $key = 536; |
12185 | $bucket = $this->currPos; |
12186 | $cached = $this->cache[$bucket][$key] ?? null; |
12187 | if ($cached) { |
12188 | $this->currPos = $cached->nextPos; |
12189 | |
12190 | return $cached->result; |
12191 | } |
12192 | |
12193 | // start choice_1 |
12194 | $r1 = $this->parsespace($silence); |
12195 | if ($r1!==self::$FAILED) { |
12196 | goto choice_1; |
12197 | } |
12198 | $r1 = $this->parseunispace($silence); |
12199 | if ($r1!==self::$FAILED) { |
12200 | goto choice_1; |
12201 | } |
12202 | $p2 = $this->currPos; |
12203 | // start seq_1 |
12204 | $p3 = $this->currPos; |
12205 | $p4 = $this->currPos; |
12206 | if (($this->input[$this->currPos] ?? null) === "&") { |
12207 | $this->currPos++; |
12208 | $r5 = "&"; |
12209 | $r5 = false; |
12210 | $this->currPos = $p4; |
12211 | } else { |
12212 | $r5 = self::$FAILED; |
12213 | $r1 = self::$FAILED; |
12214 | goto seq_1; |
12215 | } |
12216 | // free $p4 |
12217 | $r6 = $this->parsehtmlentity($silence); |
12218 | // he <- $r6 |
12219 | if ($r6===self::$FAILED) { |
12220 | $this->currPos = $p3; |
12221 | $r1 = self::$FAILED; |
12222 | goto seq_1; |
12223 | } |
12224 | $this->savedPos = $this->currPos; |
12225 | $r7 = $this->a143($r6); |
12226 | if ($r7) { |
12227 | $r7 = false; |
12228 | } else { |
12229 | $r7 = self::$FAILED; |
12230 | $this->currPos = $p3; |
12231 | $r1 = self::$FAILED; |
12232 | goto seq_1; |
12233 | } |
12234 | $r1 = true; |
12235 | seq_1: |
12236 | if ($r1!==self::$FAILED) { |
12237 | $this->savedPos = $p2; |
12238 | $r1 = $this->a65($r6); |
12239 | } |
12240 | // free $p3 |
12241 | choice_1: |
12242 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12243 | $this->currPos, |
12244 | $r1, |
12245 | self::$UNDEFINED, |
12246 | self::$UNDEFINED |
12247 | ); |
12248 | return $r1; |
12249 | } |
12250 | private function discardend_of_word($silence) { |
12251 | $key = 533; |
12252 | $bucket = $this->currPos; |
12253 | $cached = $this->cache[$bucket][$key] ?? null; |
12254 | if ($cached) { |
12255 | $this->currPos = $cached->nextPos; |
12256 | |
12257 | return $cached->result; |
12258 | } |
12259 | |
12260 | // start choice_1 |
12261 | $r1 = $this->discardeof($silence); |
12262 | if ($r1!==self::$FAILED) { |
12263 | goto choice_1; |
12264 | } |
12265 | $p2 = $this->currPos; |
12266 | $r1 = $this->input[$this->currPos] ?? ''; |
12267 | if (preg_match("/^[A-Za-z0-9_]/", $r1)) { |
12268 | $this->currPos++; |
12269 | } else { |
12270 | $r1 = self::$FAILED; |
12271 | } |
12272 | if ($r1 === self::$FAILED) { |
12273 | $r1 = false; |
12274 | } else { |
12275 | $r1 = self::$FAILED; |
12276 | $this->currPos = $p2; |
12277 | } |
12278 | // free $p2 |
12279 | choice_1: |
12280 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12281 | $this->currPos, |
12282 | $r1, |
12283 | self::$UNDEFINED, |
12284 | self::$UNDEFINED |
12285 | ); |
12286 | return $r1; |
12287 | } |
12288 | private function parsespace_or_nbsp_or_dash($silence) { |
12289 | $key = 538; |
12290 | $bucket = $this->currPos; |
12291 | $cached = $this->cache[$bucket][$key] ?? null; |
12292 | if ($cached) { |
12293 | $this->currPos = $cached->nextPos; |
12294 | |
12295 | return $cached->result; |
12296 | } |
12297 | |
12298 | // start choice_1 |
12299 | $r1 = $this->parsespace_or_nbsp($silence); |
12300 | if ($r1!==self::$FAILED) { |
12301 | goto choice_1; |
12302 | } |
12303 | if (($this->input[$this->currPos] ?? null) === "-") { |
12304 | $this->currPos++; |
12305 | $r1 = "-"; |
12306 | } else { |
12307 | if (!$silence) {$this->fail(55);} |
12308 | $r1 = self::$FAILED; |
12309 | } |
12310 | choice_1: |
12311 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12312 | $this->currPos, |
12313 | $r1, |
12314 | self::$UNDEFINED, |
12315 | self::$UNDEFINED |
12316 | ); |
12317 | return $r1; |
12318 | } |
12319 | private function discardtext_char($silence) { |
12320 | $key = 477; |
12321 | $bucket = $this->currPos; |
12322 | $cached = $this->cache[$bucket][$key] ?? null; |
12323 | if ($cached) { |
12324 | $this->currPos = $cached->nextPos; |
12325 | |
12326 | return $cached->result; |
12327 | } |
12328 | |
12329 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
12330 | $r1 = self::consumeChar($this->input, $this->currPos); |
12331 | } else { |
12332 | $r1 = self::$FAILED; |
12333 | if (!$silence) {$this->fail(54);} |
12334 | } |
12335 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12336 | $this->currPos, |
12337 | $r1, |
12338 | self::$UNDEFINED, |
12339 | self::$UNDEFINED |
12340 | ); |
12341 | return $r1; |
12342 | } |
12343 | private function parselang_variant_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
12344 | $key = json_encode([364, $boolParams & 0x3fff, $param_preproc, $param_th]); |
12345 | $bucket = $this->currPos; |
12346 | $cached = $this->cache[$bucket][$key] ?? null; |
12347 | if ($cached) { |
12348 | $this->currPos = $cached->nextPos; |
12349 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12350 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12351 | return $cached->result; |
12352 | } |
12353 | $saved_preproc=$param_preproc; |
12354 | $saved_th=$param_th; |
12355 | $p2 = $this->currPos; |
12356 | // start seq_1 |
12357 | $p3 = $this->currPos; |
12358 | $p5 = $this->currPos; |
12359 | // lv0 <- $r4 |
12360 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
12361 | $r4 = "-{"; |
12362 | $this->currPos += 2; |
12363 | $this->savedPos = $p5; |
12364 | $r4 = $this->a144(); |
12365 | } else { |
12366 | if (!$silence) {$this->fail(75);} |
12367 | $r4 = self::$FAILED; |
12368 | $r1 = self::$FAILED; |
12369 | goto seq_1; |
12370 | } |
12371 | // start choice_1 |
12372 | $p7 = $this->currPos; |
12373 | // start seq_2 |
12374 | $p8 = $this->currPos; |
12375 | $this->savedPos = $this->currPos; |
12376 | $r9 = $this->a145($r4); |
12377 | if ($r9) { |
12378 | $r9 = false; |
12379 | } else { |
12380 | $r9 = self::$FAILED; |
12381 | $r6 = self::$FAILED; |
12382 | goto seq_2; |
12383 | } |
12384 | $r10 = $this->parseopt_lang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
12385 | // ff <- $r10 |
12386 | if ($r10===self::$FAILED) { |
12387 | $this->currPos = $p8; |
12388 | $r6 = self::$FAILED; |
12389 | goto seq_2; |
12390 | } |
12391 | $r6 = true; |
12392 | seq_2: |
12393 | if ($r6!==self::$FAILED) { |
12394 | $this->savedPos = $p7; |
12395 | $r6 = $this->a146($r4, $r10); |
12396 | goto choice_1; |
12397 | } |
12398 | // free $p8 |
12399 | $p8 = $this->currPos; |
12400 | // start seq_3 |
12401 | $p11 = $this->currPos; |
12402 | $this->savedPos = $this->currPos; |
12403 | $r12 = $this->a147($r4); |
12404 | if ($r12) { |
12405 | $r12 = false; |
12406 | } else { |
12407 | $r12 = self::$FAILED; |
12408 | $r6 = self::$FAILED; |
12409 | goto seq_3; |
12410 | } |
12411 | $r6 = true; |
12412 | seq_3: |
12413 | if ($r6!==self::$FAILED) { |
12414 | $this->savedPos = $p8; |
12415 | $r6 = $this->a148($r4); |
12416 | } |
12417 | // free $p11 |
12418 | choice_1: |
12419 | // f <- $r6 |
12420 | if ($r6===self::$FAILED) { |
12421 | $this->currPos = $p3; |
12422 | $r1 = self::$FAILED; |
12423 | goto seq_1; |
12424 | } |
12425 | // start choice_2 |
12426 | $p11 = $this->currPos; |
12427 | // start seq_4 |
12428 | $p14 = $this->currPos; |
12429 | $this->savedPos = $this->currPos; |
12430 | $r15 = $this->a149($r4, $r6); |
12431 | if ($r15) { |
12432 | $r15 = false; |
12433 | } else { |
12434 | $r15 = self::$FAILED; |
12435 | $r13 = self::$FAILED; |
12436 | goto seq_4; |
12437 | } |
12438 | $r16 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
12439 | // lv <- $r16 |
12440 | if ($r16===self::$FAILED) { |
12441 | $this->currPos = $p14; |
12442 | $r13 = self::$FAILED; |
12443 | goto seq_4; |
12444 | } |
12445 | $r13 = true; |
12446 | seq_4: |
12447 | if ($r13!==self::$FAILED) { |
12448 | $this->savedPos = $p11; |
12449 | $r13 = $this->a150($r4, $r6, $r16); |
12450 | goto choice_2; |
12451 | } |
12452 | // free $p14 |
12453 | $p14 = $this->currPos; |
12454 | // start seq_5 |
12455 | $p17 = $this->currPos; |
12456 | $this->savedPos = $this->currPos; |
12457 | $r18 = $this->a151($r4, $r6); |
12458 | if ($r18) { |
12459 | $r18 = false; |
12460 | } else { |
12461 | $r18 = self::$FAILED; |
12462 | $r13 = self::$FAILED; |
12463 | goto seq_5; |
12464 | } |
12465 | $r19 = $this->parselang_variant_option_list($silence, $boolParams, $param_preproc, $param_th); |
12466 | // lv <- $r19 |
12467 | if ($r19===self::$FAILED) { |
12468 | $this->currPos = $p17; |
12469 | $r13 = self::$FAILED; |
12470 | goto seq_5; |
12471 | } |
12472 | $r13 = true; |
12473 | seq_5: |
12474 | if ($r13!==self::$FAILED) { |
12475 | $this->savedPos = $p14; |
12476 | $r13 = $this->a152($r4, $r6, $r19); |
12477 | } |
12478 | // free $p17 |
12479 | choice_2: |
12480 | // ts <- $r13 |
12481 | if ($r13===self::$FAILED) { |
12482 | $this->currPos = $p3; |
12483 | $r1 = self::$FAILED; |
12484 | goto seq_1; |
12485 | } |
12486 | $r20 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
12487 | if ($r20===self::$FAILED) { |
12488 | $this->currPos = $p3; |
12489 | $r1 = self::$FAILED; |
12490 | goto seq_1; |
12491 | } |
12492 | $p17 = $this->currPos; |
12493 | // lv1 <- $r21 |
12494 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}-", $this->currPos, 2, false) === 0) { |
12495 | $r21 = "}-"; |
12496 | $this->currPos += 2; |
12497 | $this->savedPos = $p17; |
12498 | $r21 = $this->a153($r4, $r6, $r13); |
12499 | } else { |
12500 | if (!$silence) {$this->fail(76);} |
12501 | $r21 = self::$FAILED; |
12502 | $this->currPos = $p3; |
12503 | $r1 = self::$FAILED; |
12504 | goto seq_1; |
12505 | } |
12506 | $r1 = true; |
12507 | seq_1: |
12508 | if ($r1!==self::$FAILED) { |
12509 | $this->savedPos = $p2; |
12510 | $r1 = $this->a154($r4, $r6, $r13, $r21); |
12511 | } |
12512 | // free $p3 |
12513 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12514 | $this->currPos, |
12515 | $r1, |
12516 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12517 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12518 | ); |
12519 | return $r1; |
12520 | } |
12521 | private function parsebroken_lang_variant($silence, &$param_preproc) { |
12522 | $key = json_encode([360, $param_preproc]); |
12523 | $bucket = $this->currPos; |
12524 | $cached = $this->cache[$bucket][$key] ?? null; |
12525 | if ($cached) { |
12526 | $this->currPos = $cached->nextPos; |
12527 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12528 | return $cached->result; |
12529 | } |
12530 | $saved_preproc=$param_preproc; |
12531 | $p2 = $this->currPos; |
12532 | // start seq_1 |
12533 | $p3 = $this->currPos; |
12534 | // r <- $r4 |
12535 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
12536 | $r4 = "-{"; |
12537 | $this->currPos += 2; |
12538 | } else { |
12539 | if (!$silence) {$this->fail(75);} |
12540 | $r4 = self::$FAILED; |
12541 | $r1 = self::$FAILED; |
12542 | goto seq_1; |
12543 | } |
12544 | $r1 = true; |
12545 | seq_1: |
12546 | if ($r1!==self::$FAILED) { |
12547 | $this->savedPos = $p2; |
12548 | $r1 = $this->a155($r4, $param_preproc); |
12549 | } |
12550 | // free $p3 |
12551 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12552 | $this->currPos, |
12553 | $r1, |
12554 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12555 | self::$UNDEFINED |
12556 | ); |
12557 | return $r1; |
12558 | } |
12559 | private function parsetable_heading_tags_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
12560 | $key = json_encode([468, $boolParams & 0x3fff, $param_preproc, $param_th]); |
12561 | $bucket = $this->currPos; |
12562 | $cached = $this->cache[$bucket][$key] ?? null; |
12563 | if ($cached) { |
12564 | $this->currPos = $cached->nextPos; |
12565 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12566 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12567 | return $cached->result; |
12568 | } |
12569 | $saved_preproc=$param_preproc; |
12570 | $saved_th=$param_th; |
12571 | $p2 = $this->currPos; |
12572 | // start seq_1 |
12573 | $p3 = $this->currPos; |
12574 | if (($this->input[$this->currPos] ?? null) === "!") { |
12575 | $this->currPos++; |
12576 | $r4 = "!"; |
12577 | } else { |
12578 | if (!$silence) {$this->fail(77);} |
12579 | $r4 = self::$FAILED; |
12580 | $r1 = self::$FAILED; |
12581 | goto seq_1; |
12582 | } |
12583 | $r5 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th); |
12584 | // thTag <- $r5 |
12585 | if ($r5===self::$FAILED) { |
12586 | $this->currPos = $p3; |
12587 | $r1 = self::$FAILED; |
12588 | goto seq_1; |
12589 | } |
12590 | $r6 = []; |
12591 | for (;;) { |
12592 | $p8 = $this->currPos; |
12593 | // start seq_2 |
12594 | $p9 = $this->currPos; |
12595 | // start choice_1 |
12596 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
12597 | $r10 = "!!"; |
12598 | $this->currPos += 2; |
12599 | goto choice_1; |
12600 | } else { |
12601 | if (!$silence) {$this->fail(78);} |
12602 | $r10 = self::$FAILED; |
12603 | } |
12604 | $r10 = $this->parsepipe_pipe($silence); |
12605 | choice_1: |
12606 | // pp <- $r10 |
12607 | if ($r10===self::$FAILED) { |
12608 | $r7 = self::$FAILED; |
12609 | goto seq_2; |
12610 | } |
12611 | $r11 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th); |
12612 | // tht <- $r11 |
12613 | if ($r11===self::$FAILED) { |
12614 | $this->currPos = $p9; |
12615 | $r7 = self::$FAILED; |
12616 | goto seq_2; |
12617 | } |
12618 | $r7 = true; |
12619 | seq_2: |
12620 | if ($r7!==self::$FAILED) { |
12621 | $this->savedPos = $p8; |
12622 | $r7 = $this->a156($r5, $r10, $r11); |
12623 | $r6[] = $r7; |
12624 | } else { |
12625 | break; |
12626 | } |
12627 | // free $p9 |
12628 | } |
12629 | // thTags <- $r6 |
12630 | // free $r7 |
12631 | $r1 = true; |
12632 | seq_1: |
12633 | if ($r1!==self::$FAILED) { |
12634 | $this->savedPos = $p2; |
12635 | $r1 = $this->a157($r5, $r6); |
12636 | } |
12637 | // free $p3 |
12638 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12639 | $this->currPos, |
12640 | $r1, |
12641 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12642 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12643 | ); |
12644 | return $r1; |
12645 | } |
12646 | private function parsetable_data_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
12647 | $key = json_encode([464, $boolParams & 0x3fff, $param_preproc, $param_th]); |
12648 | $bucket = $this->currPos; |
12649 | $cached = $this->cache[$bucket][$key] ?? null; |
12650 | if ($cached) { |
12651 | $this->currPos = $cached->nextPos; |
12652 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12653 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12654 | return $cached->result; |
12655 | } |
12656 | $saved_preproc=$param_preproc; |
12657 | $saved_th=$param_th; |
12658 | $p2 = $this->currPos; |
12659 | // start seq_1 |
12660 | $p3 = $this->currPos; |
12661 | $p4 = $this->currPos; |
12662 | if (($this->input[$this->currPos] ?? null) === "}") { |
12663 | $this->currPos++; |
12664 | $r5 = "}"; |
12665 | } else { |
12666 | $r5 = self::$FAILED; |
12667 | } |
12668 | if ($r5 === self::$FAILED) { |
12669 | $r5 = false; |
12670 | } else { |
12671 | $r5 = self::$FAILED; |
12672 | $this->currPos = $p4; |
12673 | $r1 = self::$FAILED; |
12674 | goto seq_1; |
12675 | } |
12676 | // free $p4 |
12677 | $r6 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
12678 | if ($r6===self::$FAILED) { |
12679 | $r6 = null; |
12680 | } |
12681 | // arg <- $r6 |
12682 | $p4 = $this->currPos; |
12683 | $r7 = ''; |
12684 | // tagEndPos <- $r7 |
12685 | if ($r7!==self::$FAILED) { |
12686 | $this->savedPos = $p4; |
12687 | $r7 = $this->a158($r6); |
12688 | } else { |
12689 | $this->currPos = $p3; |
12690 | $r1 = self::$FAILED; |
12691 | goto seq_1; |
12692 | } |
12693 | $r8 = []; |
12694 | for (;;) { |
12695 | $r9 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
12696 | if ($r9!==self::$FAILED) { |
12697 | $r8[] = $r9; |
12698 | } else { |
12699 | break; |
12700 | } |
12701 | } |
12702 | // td <- $r8 |
12703 | // free $r9 |
12704 | $r1 = true; |
12705 | seq_1: |
12706 | if ($r1!==self::$FAILED) { |
12707 | $this->savedPos = $p2; |
12708 | $r1 = $this->a159($r6, $r7, $r8); |
12709 | } |
12710 | // free $p3 |
12711 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12712 | $this->currPos, |
12713 | $r1, |
12714 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12715 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12716 | ); |
12717 | return $r1; |
12718 | } |
12719 | private function parsetds($silence, $boolParams, &$param_preproc, &$param_th) { |
12720 | $key = json_encode([460, $boolParams & 0x3fff, $param_preproc, $param_th]); |
12721 | $bucket = $this->currPos; |
12722 | $cached = $this->cache[$bucket][$key] ?? null; |
12723 | if ($cached) { |
12724 | $this->currPos = $cached->nextPos; |
12725 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12726 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12727 | return $cached->result; |
12728 | } |
12729 | $saved_preproc=$param_preproc; |
12730 | $saved_th=$param_th; |
12731 | $r1 = []; |
12732 | for (;;) { |
12733 | $p3 = $this->currPos; |
12734 | // start seq_1 |
12735 | $p4 = $this->currPos; |
12736 | // start choice_1 |
12737 | $r5 = $this->parsepipe_pipe($silence); |
12738 | if ($r5!==self::$FAILED) { |
12739 | goto choice_1; |
12740 | } |
12741 | $p6 = $this->currPos; |
12742 | // start seq_2 |
12743 | $p7 = $this->currPos; |
12744 | $r8 = $this->parsepipe($silence); |
12745 | // p <- $r8 |
12746 | if ($r8===self::$FAILED) { |
12747 | $r5 = self::$FAILED; |
12748 | goto seq_2; |
12749 | } |
12750 | $p9 = $this->currPos; |
12751 | $r10 = $this->discardrow_syntax_table_args(true, $boolParams, $param_preproc, $param_th); |
12752 | if ($r10!==self::$FAILED) { |
12753 | $r10 = false; |
12754 | $this->currPos = $p9; |
12755 | } else { |
12756 | $this->currPos = $p7; |
12757 | $r5 = self::$FAILED; |
12758 | goto seq_2; |
12759 | } |
12760 | // free $p9 |
12761 | $r5 = true; |
12762 | seq_2: |
12763 | if ($r5!==self::$FAILED) { |
12764 | $this->savedPos = $p6; |
12765 | $r5 = $this->a29($r8); |
12766 | } |
12767 | // free $p7 |
12768 | choice_1: |
12769 | // pp <- $r5 |
12770 | if ($r5===self::$FAILED) { |
12771 | $r2 = self::$FAILED; |
12772 | goto seq_1; |
12773 | } |
12774 | $r11 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th); |
12775 | // tdt <- $r11 |
12776 | if ($r11===self::$FAILED) { |
12777 | $this->currPos = $p4; |
12778 | $r2 = self::$FAILED; |
12779 | goto seq_1; |
12780 | } |
12781 | $r2 = true; |
12782 | seq_1: |
12783 | if ($r2!==self::$FAILED) { |
12784 | $this->savedPos = $p3; |
12785 | $r2 = $this->a160($r5, $r11); |
12786 | $r1[] = $r2; |
12787 | } else { |
12788 | break; |
12789 | } |
12790 | // free $p4 |
12791 | } |
12792 | // free $r2 |
12793 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12794 | $this->currPos, |
12795 | $r1, |
12796 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12797 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12798 | ); |
12799 | return $r1; |
12800 | } |
12801 | private function parsenested_block_in_table($silence, $boolParams, &$param_preproc, &$param_th) { |
12802 | $key = json_encode([292, $boolParams & 0x3fff, $param_preproc, $param_th]); |
12803 | $bucket = $this->currPos; |
12804 | $cached = $this->cache[$bucket][$key] ?? null; |
12805 | if ($cached) { |
12806 | $this->currPos = $cached->nextPos; |
12807 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12808 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12809 | return $cached->result; |
12810 | } |
12811 | $saved_preproc=$param_preproc; |
12812 | $saved_th=$param_th; |
12813 | $p2 = $this->currPos; |
12814 | // start seq_1 |
12815 | $p3 = $this->currPos; |
12816 | $p4 = $this->currPos; |
12817 | // start seq_2 |
12818 | $p6 = $this->currPos; |
12819 | $r7 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
12820 | if ($r7===self::$FAILED) { |
12821 | $r5 = self::$FAILED; |
12822 | goto seq_2; |
12823 | } |
12824 | // start seq_3 |
12825 | $p9 = $this->currPos; |
12826 | for (;;) { |
12827 | $r11 = $this->discardspace(true); |
12828 | if ($r11===self::$FAILED) { |
12829 | break; |
12830 | } |
12831 | } |
12832 | // free $r11 |
12833 | $r10 = true; |
12834 | if ($r10===self::$FAILED) { |
12835 | $r8 = self::$FAILED; |
12836 | goto seq_3; |
12837 | } |
12838 | // free $r10 |
12839 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
12840 | if ($r10===self::$FAILED) { |
12841 | $this->currPos = $p9; |
12842 | $r8 = self::$FAILED; |
12843 | goto seq_3; |
12844 | } |
12845 | $r8 = true; |
12846 | seq_3: |
12847 | if ($r8===self::$FAILED) { |
12848 | $r8 = null; |
12849 | } |
12850 | // free $p9 |
12851 | for (;;) { |
12852 | $r12 = $this->discardspace(true); |
12853 | if ($r12===self::$FAILED) { |
12854 | break; |
12855 | } |
12856 | } |
12857 | // free $r12 |
12858 | $r11 = true; |
12859 | if ($r11===self::$FAILED) { |
12860 | $this->currPos = $p6; |
12861 | $r5 = self::$FAILED; |
12862 | goto seq_2; |
12863 | } |
12864 | // free $r11 |
12865 | // start choice_1 |
12866 | $r11 = $this->discardpipe(true); |
12867 | if ($r11!==self::$FAILED) { |
12868 | goto choice_1; |
12869 | } |
12870 | if (($this->input[$this->currPos] ?? null) === "!") { |
12871 | $this->currPos++; |
12872 | $r11 = "!"; |
12873 | } else { |
12874 | $r11 = self::$FAILED; |
12875 | } |
12876 | choice_1: |
12877 | if ($r11===self::$FAILED) { |
12878 | $this->currPos = $p6; |
12879 | $r5 = self::$FAILED; |
12880 | goto seq_2; |
12881 | } |
12882 | $r5 = true; |
12883 | seq_2: |
12884 | // free $p6 |
12885 | if ($r5 === self::$FAILED) { |
12886 | $r5 = false; |
12887 | } else { |
12888 | $r5 = self::$FAILED; |
12889 | $this->currPos = $p4; |
12890 | $r1 = self::$FAILED; |
12891 | goto seq_1; |
12892 | } |
12893 | // free $p4 |
12894 | $r12 = $this->parsenested_block($silence, $boolParams | 0x1, $param_preproc, $param_th); |
12895 | // b <- $r12 |
12896 | if ($r12===self::$FAILED) { |
12897 | $this->currPos = $p3; |
12898 | $r1 = self::$FAILED; |
12899 | goto seq_1; |
12900 | } |
12901 | $r1 = true; |
12902 | seq_1: |
12903 | if ($r1!==self::$FAILED) { |
12904 | $this->savedPos = $p2; |
12905 | $r1 = $this->a161($r12); |
12906 | } |
12907 | // free $p3 |
12908 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12909 | $this->currPos, |
12910 | $r1, |
12911 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12912 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12913 | ); |
12914 | return $r1; |
12915 | } |
12916 | private function discardempty_line_with_comments($silence) { |
12917 | $key = 547; |
12918 | $bucket = $this->currPos; |
12919 | $cached = $this->cache[$bucket][$key] ?? null; |
12920 | if ($cached) { |
12921 | $this->currPos = $cached->nextPos; |
12922 | |
12923 | return $cached->result; |
12924 | } |
12925 | |
12926 | $p2 = $this->currPos; |
12927 | // start seq_1 |
12928 | $p3 = $this->currPos; |
12929 | $r4 = $this->parsesol_prefix($silence); |
12930 | // sp <- $r4 |
12931 | if ($r4===self::$FAILED) { |
12932 | $r1 = self::$FAILED; |
12933 | goto seq_1; |
12934 | } |
12935 | $p6 = $this->currPos; |
12936 | $r5 = ''; |
12937 | // p <- $r5 |
12938 | if ($r5!==self::$FAILED) { |
12939 | $this->savedPos = $p6; |
12940 | $r5 = $this->a82($r4); |
12941 | } else { |
12942 | $this->currPos = $p3; |
12943 | $r1 = self::$FAILED; |
12944 | goto seq_1; |
12945 | } |
12946 | $r7 = []; |
12947 | for (;;) { |
12948 | // start seq_2 |
12949 | $p9 = $this->currPos; |
12950 | $r10 = []; |
12951 | for (;;) { |
12952 | $r11 = $this->parsespace($silence); |
12953 | if ($r11!==self::$FAILED) { |
12954 | $r10[] = $r11; |
12955 | } else { |
12956 | break; |
12957 | } |
12958 | } |
12959 | // free $r11 |
12960 | $r11 = $this->parsecomment($silence); |
12961 | if ($r11===self::$FAILED) { |
12962 | $this->currPos = $p9; |
12963 | $r8 = self::$FAILED; |
12964 | goto seq_2; |
12965 | } |
12966 | $r12 = []; |
12967 | for (;;) { |
12968 | // start choice_1 |
12969 | $r13 = $this->parsespace($silence); |
12970 | if ($r13!==self::$FAILED) { |
12971 | goto choice_1; |
12972 | } |
12973 | $r13 = $this->parsecomment($silence); |
12974 | choice_1: |
12975 | if ($r13!==self::$FAILED) { |
12976 | $r12[] = $r13; |
12977 | } else { |
12978 | break; |
12979 | } |
12980 | } |
12981 | // free $r13 |
12982 | $r13 = $this->parsenewline($silence); |
12983 | if ($r13===self::$FAILED) { |
12984 | $this->currPos = $p9; |
12985 | $r8 = self::$FAILED; |
12986 | goto seq_2; |
12987 | } |
12988 | $r8 = [$r10,$r11,$r12,$r13]; |
12989 | seq_2: |
12990 | if ($r8!==self::$FAILED) { |
12991 | $r7[] = $r8; |
12992 | } else { |
12993 | break; |
12994 | } |
12995 | // free $p9 |
12996 | } |
12997 | if (count($r7) === 0) { |
12998 | $r7 = self::$FAILED; |
12999 | } |
13000 | // c <- $r7 |
13001 | if ($r7===self::$FAILED) { |
13002 | $this->currPos = $p3; |
13003 | $r1 = self::$FAILED; |
13004 | goto seq_1; |
13005 | } |
13006 | // free $r8 |
13007 | $r1 = true; |
13008 | seq_1: |
13009 | if ($r1!==self::$FAILED) { |
13010 | $this->savedPos = $p2; |
13011 | $r1 = $this->a83($r4, $r5, $r7); |
13012 | } |
13013 | // free $p3 |
13014 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13015 | $this->currPos, |
13016 | $r1, |
13017 | self::$UNDEFINED, |
13018 | self::$UNDEFINED |
13019 | ); |
13020 | return $r1; |
13021 | } |
13022 | private function discardsol_prefix($silence) { |
13023 | $key = 545; |
13024 | $bucket = $this->currPos; |
13025 | $cached = $this->cache[$bucket][$key] ?? null; |
13026 | if ($cached) { |
13027 | $this->currPos = $cached->nextPos; |
13028 | |
13029 | return $cached->result; |
13030 | } |
13031 | |
13032 | // start choice_1 |
13033 | $r1 = $this->discardnewlineToken($silence); |
13034 | if ($r1!==self::$FAILED) { |
13035 | goto choice_1; |
13036 | } |
13037 | $p2 = $this->currPos; |
13038 | $this->savedPos = $this->currPos; |
13039 | $r1 = $this->a84(); |
13040 | if ($r1) { |
13041 | $r1 = false; |
13042 | $this->savedPos = $p2; |
13043 | $r1 = $this->a85(); |
13044 | } else { |
13045 | $r1 = self::$FAILED; |
13046 | } |
13047 | choice_1: |
13048 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13049 | $this->currPos, |
13050 | $r1, |
13051 | self::$UNDEFINED, |
13052 | self::$UNDEFINED |
13053 | ); |
13054 | return $r1; |
13055 | } |
13056 | private function discardsol_transparent($silence, $boolParams, &$param_preproc, &$param_th) { |
13057 | $key = json_encode([541, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
13058 | $bucket = $this->currPos; |
13059 | $cached = $this->cache[$bucket][$key] ?? null; |
13060 | if ($cached) { |
13061 | $this->currPos = $cached->nextPos; |
13062 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13063 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13064 | return $cached->result; |
13065 | } |
13066 | $saved_preproc=$param_preproc; |
13067 | $saved_th=$param_th; |
13068 | // start choice_1 |
13069 | $r1 = $this->discardcomment($silence); |
13070 | if ($r1!==self::$FAILED) { |
13071 | goto choice_1; |
13072 | } |
13073 | $r1 = $this->discardinclude_limits($silence, $boolParams | 0x2000, $param_preproc, $param_th); |
13074 | if ($r1!==self::$FAILED) { |
13075 | goto choice_1; |
13076 | } |
13077 | $r1 = $this->discardannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
13078 | if ($r1!==self::$FAILED) { |
13079 | goto choice_1; |
13080 | } |
13081 | $r1 = $this->discardbehavior_switch($silence); |
13082 | choice_1: |
13083 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13084 | $this->currPos, |
13085 | $r1, |
13086 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13087 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13088 | ); |
13089 | return $r1; |
13090 | } |
13091 | private function parsetemplate_param_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13092 | $key = json_encode([356, $boolParams & 0x3e37, $param_preproc, $param_th]); |
13093 | $bucket = $this->currPos; |
13094 | $cached = $this->cache[$bucket][$key] ?? null; |
13095 | if ($cached) { |
13096 | $this->currPos = $cached->nextPos; |
13097 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13098 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13099 | return $cached->result; |
13100 | } |
13101 | $saved_preproc=$param_preproc; |
13102 | $saved_th=$param_th; |
13103 | $p2 = $this->currPos; |
13104 | $r3 = []; |
13105 | for (;;) { |
13106 | // start choice_1 |
13107 | $r4 = $this->parsenested_block($silence, ($boolParams & ~0x148) | 0x80, $param_preproc, $param_th); |
13108 | if ($r4!==self::$FAILED) { |
13109 | goto choice_1; |
13110 | } |
13111 | $r4 = $this->parsenewlineToken($silence); |
13112 | choice_1: |
13113 | if ($r4!==self::$FAILED) { |
13114 | $r3[] = $r4; |
13115 | } else { |
13116 | break; |
13117 | } |
13118 | } |
13119 | if (count($r3) === 0) { |
13120 | $r3 = self::$FAILED; |
13121 | } |
13122 | // il <- $r3 |
13123 | // free $r4 |
13124 | $r1 = $r3; |
13125 | if ($r1!==self::$FAILED) { |
13126 | $this->savedPos = $p2; |
13127 | $r1 = $this->a162($r3); |
13128 | } |
13129 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13130 | $this->currPos, |
13131 | $r1, |
13132 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13133 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13134 | ); |
13135 | return $r1; |
13136 | } |
13137 | private function discardnewlineToken($silence) { |
13138 | $key = 521; |
13139 | $bucket = $this->currPos; |
13140 | $cached = $this->cache[$bucket][$key] ?? null; |
13141 | if ($cached) { |
13142 | $this->currPos = $cached->nextPos; |
13143 | |
13144 | return $cached->result; |
13145 | } |
13146 | |
13147 | $p2 = $this->currPos; |
13148 | $r1 = $this->discardnewline($silence); |
13149 | if ($r1!==self::$FAILED) { |
13150 | $this->savedPos = $p2; |
13151 | $r1 = $this->a26(); |
13152 | } |
13153 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13154 | $this->currPos, |
13155 | $r1, |
13156 | self::$UNDEFINED, |
13157 | self::$UNDEFINED |
13158 | ); |
13159 | return $r1; |
13160 | } |
13161 | private function parsetemplate_param_name($silence, $boolParams, &$param_preproc, &$param_th) { |
13162 | $key = json_encode([352, $boolParams & 0x3e17, $param_preproc, $param_th]); |
13163 | $bucket = $this->currPos; |
13164 | $cached = $this->cache[$bucket][$key] ?? null; |
13165 | if ($cached) { |
13166 | $this->currPos = $cached->nextPos; |
13167 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13168 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13169 | return $cached->result; |
13170 | } |
13171 | $saved_preproc=$param_preproc; |
13172 | $saved_th=$param_th; |
13173 | // start choice_1 |
13174 | $r1 = $this->parsetemplate_param_text($silence, $boolParams | 0x20, $param_preproc, $param_th); |
13175 | if ($r1!==self::$FAILED) { |
13176 | goto choice_1; |
13177 | } |
13178 | $p2 = $this->currPos; |
13179 | $p3 = $this->currPos; |
13180 | if (($this->input[$this->currPos] ?? null) === "=") { |
13181 | $this->currPos++; |
13182 | $r1 = "="; |
13183 | $r1 = false; |
13184 | $this->currPos = $p3; |
13185 | $this->savedPos = $p2; |
13186 | $r1 = $this->a163(); |
13187 | } else { |
13188 | $r1 = self::$FAILED; |
13189 | } |
13190 | // free $p3 |
13191 | choice_1: |
13192 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13193 | $this->currPos, |
13194 | $r1, |
13195 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13196 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13197 | ); |
13198 | return $r1; |
13199 | } |
13200 | private function parselink_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13201 | $key = json_encode([396, $boolParams & 0x37df, $param_preproc, $param_th]); |
13202 | $bucket = $this->currPos; |
13203 | $cached = $this->cache[$bucket][$key] ?? null; |
13204 | if ($cached) { |
13205 | $this->currPos = $cached->nextPos; |
13206 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13207 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13208 | return $cached->result; |
13209 | } |
13210 | $saved_preproc=$param_preproc; |
13211 | $saved_th=$param_th; |
13212 | $r1 = $this->parselink_text_parameterized($silence, ($boolParams & ~0x20) | 0x800, $param_preproc, $param_th); |
13213 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13214 | $this->currPos, |
13215 | $r1, |
13216 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13217 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13218 | ); |
13219 | return $r1; |
13220 | } |
13221 | private function parseunispace($silence) { |
13222 | $key = 534; |
13223 | $bucket = $this->currPos; |
13224 | $cached = $this->cache[$bucket][$key] ?? null; |
13225 | if ($cached) { |
13226 | $this->currPos = $cached->nextPos; |
13227 | |
13228 | return $cached->result; |
13229 | } |
13230 | |
13231 | $r1 = self::charAt($this->input, $this->currPos); |
13232 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
13233 | $this->currPos += strlen($r1); |
13234 | } else { |
13235 | $r1 = self::$FAILED; |
13236 | if (!$silence) {$this->fail(25);} |
13237 | } |
13238 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13239 | $this->currPos, |
13240 | $r1, |
13241 | self::$UNDEFINED, |
13242 | self::$UNDEFINED |
13243 | ); |
13244 | return $r1; |
13245 | } |
13246 | private function parseopt_lang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) { |
13247 | $key = json_encode([366, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
13248 | $bucket = $this->currPos; |
13249 | $cached = $this->cache[$bucket][$key] ?? null; |
13250 | if ($cached) { |
13251 | $this->currPos = $cached->nextPos; |
13252 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13253 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13254 | return $cached->result; |
13255 | } |
13256 | $saved_preproc=$param_preproc; |
13257 | $saved_th=$param_th; |
13258 | $p2 = $this->currPos; |
13259 | $p4 = $this->currPos; |
13260 | // start seq_1 |
13261 | $p5 = $this->currPos; |
13262 | $r6 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
13263 | // ff <- $r6 |
13264 | if ($r6===self::$FAILED) { |
13265 | $r3 = self::$FAILED; |
13266 | goto seq_1; |
13267 | } |
13268 | if (($this->input[$this->currPos] ?? null) === "|") { |
13269 | $this->currPos++; |
13270 | $r7 = "|"; |
13271 | } else { |
13272 | if (!$silence) {$this->fail(13);} |
13273 | $r7 = self::$FAILED; |
13274 | $this->currPos = $p5; |
13275 | $r3 = self::$FAILED; |
13276 | goto seq_1; |
13277 | } |
13278 | $r3 = true; |
13279 | seq_1: |
13280 | if ($r3!==self::$FAILED) { |
13281 | $this->savedPos = $p4; |
13282 | $r3 = $this->a164($r6); |
13283 | } else { |
13284 | $r3 = null; |
13285 | } |
13286 | // free $p5 |
13287 | // f <- $r3 |
13288 | $r1 = $r3; |
13289 | if ($r1!==self::$FAILED) { |
13290 | $this->savedPos = $p2; |
13291 | $r1 = $this->a165($r3); |
13292 | } |
13293 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13294 | $this->currPos, |
13295 | $r1, |
13296 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13297 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13298 | ); |
13299 | return $r1; |
13300 | } |
13301 | private function parselang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13302 | $key = json_encode([382, $boolParams & 0x3fff, $param_preproc, $param_th]); |
13303 | $bucket = $this->currPos; |
13304 | $cached = $this->cache[$bucket][$key] ?? null; |
13305 | if ($cached) { |
13306 | $this->currPos = $cached->nextPos; |
13307 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13308 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13309 | return $cached->result; |
13310 | } |
13311 | $saved_preproc=$param_preproc; |
13312 | $saved_th=$param_th; |
13313 | $p2 = $this->currPos; |
13314 | $r3 = []; |
13315 | for (;;) { |
13316 | // start choice_1 |
13317 | $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
13318 | if ($r4!==self::$FAILED) { |
13319 | goto choice_1; |
13320 | } |
13321 | if (($this->input[$this->currPos] ?? null) === "|") { |
13322 | $this->currPos++; |
13323 | $r4 = "|"; |
13324 | } else { |
13325 | if (!$silence) {$this->fail(13);} |
13326 | $r4 = self::$FAILED; |
13327 | } |
13328 | choice_1: |
13329 | if ($r4!==self::$FAILED) { |
13330 | $r3[] = $r4; |
13331 | } else { |
13332 | break; |
13333 | } |
13334 | } |
13335 | // tokens <- $r3 |
13336 | // free $r4 |
13337 | $r1 = $r3; |
13338 | if ($r1!==self::$FAILED) { |
13339 | $this->savedPos = $p2; |
13340 | $r1 = $this->a166($r3); |
13341 | } |
13342 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13343 | $this->currPos, |
13344 | $r1, |
13345 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13346 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13347 | ); |
13348 | return $r1; |
13349 | } |
13350 | private function parselang_variant_option_list($silence, $boolParams, &$param_preproc, &$param_th) { |
13351 | $key = json_encode([374, $boolParams & 0x3fff, $param_preproc, $param_th]); |
13352 | $bucket = $this->currPos; |
13353 | $cached = $this->cache[$bucket][$key] ?? null; |
13354 | if ($cached) { |
13355 | $this->currPos = $cached->nextPos; |
13356 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13357 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13358 | return $cached->result; |
13359 | } |
13360 | $saved_preproc=$param_preproc; |
13361 | $saved_th=$param_th; |
13362 | // start choice_1 |
13363 | $p2 = $this->currPos; |
13364 | // start seq_1 |
13365 | $p3 = $this->currPos; |
13366 | $r4 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13367 | // o <- $r4 |
13368 | if ($r4===self::$FAILED) { |
13369 | $r1 = self::$FAILED; |
13370 | goto seq_1; |
13371 | } |
13372 | $r5 = []; |
13373 | for (;;) { |
13374 | $p7 = $this->currPos; |
13375 | // start seq_2 |
13376 | $p8 = $this->currPos; |
13377 | if (($this->input[$this->currPos] ?? null) === ";") { |
13378 | $this->currPos++; |
13379 | $r9 = ";"; |
13380 | } else { |
13381 | if (!$silence) {$this->fail(26);} |
13382 | $r9 = self::$FAILED; |
13383 | $r6 = self::$FAILED; |
13384 | goto seq_2; |
13385 | } |
13386 | $r10 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13387 | // oo <- $r10 |
13388 | if ($r10===self::$FAILED) { |
13389 | $this->currPos = $p8; |
13390 | $r6 = self::$FAILED; |
13391 | goto seq_2; |
13392 | } |
13393 | $r6 = true; |
13394 | seq_2: |
13395 | if ($r6!==self::$FAILED) { |
13396 | $this->savedPos = $p7; |
13397 | $r6 = $this->a167($r4, $r10); |
13398 | $r5[] = $r6; |
13399 | } else { |
13400 | break; |
13401 | } |
13402 | // free $p8 |
13403 | } |
13404 | // rest <- $r5 |
13405 | // free $r6 |
13406 | $r6 = []; |
13407 | for (;;) { |
13408 | // start seq_3 |
13409 | $p8 = $this->currPos; |
13410 | if (($this->input[$this->currPos] ?? null) === ";") { |
13411 | $this->currPos++; |
13412 | $r12 = ";"; |
13413 | } else { |
13414 | if (!$silence) {$this->fail(26);} |
13415 | $r12 = self::$FAILED; |
13416 | $r11 = self::$FAILED; |
13417 | goto seq_3; |
13418 | } |
13419 | $p13 = $this->currPos; |
13420 | $r14 = $this->discardbogus_lang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13421 | if ($r14!==self::$FAILED) { |
13422 | $r14 = substr($this->input, $p13, $this->currPos - $p13); |
13423 | } else { |
13424 | $r14 = self::$FAILED; |
13425 | $this->currPos = $p8; |
13426 | $r11 = self::$FAILED; |
13427 | goto seq_3; |
13428 | } |
13429 | // free $p13 |
13430 | $r11 = [$r12,$r14]; |
13431 | seq_3: |
13432 | if ($r11!==self::$FAILED) { |
13433 | $r6[] = $r11; |
13434 | } else { |
13435 | break; |
13436 | } |
13437 | // free $p8 |
13438 | } |
13439 | // tr <- $r6 |
13440 | // free $r11 |
13441 | $r1 = true; |
13442 | seq_1: |
13443 | if ($r1!==self::$FAILED) { |
13444 | $this->savedPos = $p2; |
13445 | $r1 = $this->a168($r4, $r5, $r6); |
13446 | goto choice_1; |
13447 | } |
13448 | // free $p3 |
13449 | $p3 = $this->currPos; |
13450 | $r11 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
13451 | // lvtext <- $r11 |
13452 | $r1 = $r11; |
13453 | if ($r1!==self::$FAILED) { |
13454 | $this->savedPos = $p3; |
13455 | $r1 = $this->a169($r11); |
13456 | } |
13457 | choice_1: |
13458 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13459 | $this->currPos, |
13460 | $r1, |
13461 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13462 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13463 | ); |
13464 | return $r1; |
13465 | } |
13466 | private function parsetable_heading_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
13467 | $key = json_encode([470, $boolParams & 0x3fff, $param_preproc, $param_th]); |
13468 | $bucket = $this->currPos; |
13469 | $cached = $this->cache[$bucket][$key] ?? null; |
13470 | if ($cached) { |
13471 | $this->currPos = $cached->nextPos; |
13472 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13473 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13474 | return $cached->result; |
13475 | } |
13476 | $saved_preproc=$param_preproc; |
13477 | $saved_th=$param_th; |
13478 | $p2 = $this->currPos; |
13479 | // start seq_1 |
13480 | $p3 = $this->currPos; |
13481 | $r4 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
13482 | if ($r4===self::$FAILED) { |
13483 | $r4 = null; |
13484 | } |
13485 | // arg <- $r4 |
13486 | $p6 = $this->currPos; |
13487 | $r5 = ''; |
13488 | // tagEndPos <- $r5 |
13489 | if ($r5!==self::$FAILED) { |
13490 | $this->savedPos = $p6; |
13491 | $r5 = $this->a158($r4); |
13492 | } else { |
13493 | $this->currPos = $p3; |
13494 | $r1 = self::$FAILED; |
13495 | goto seq_1; |
13496 | } |
13497 | $r7 = []; |
13498 | for (;;) { |
13499 | $p9 = $this->currPos; |
13500 | // start seq_2 |
13501 | $p10 = $this->currPos; |
13502 | $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
13503 | // d <- $r11 |
13504 | if ($r11===self::$FAILED) { |
13505 | $this->currPos = $p10; |
13506 | $r8 = self::$FAILED; |
13507 | goto seq_2; |
13508 | } |
13509 | $r8 = true; |
13510 | seq_2: |
13511 | if ($r8!==self::$FAILED) { |
13512 | $this->savedPos = $p9; |
13513 | $r8 = $this->a170($r4, $r5, $param_th, $r11); |
13514 | $r7[] = $r8; |
13515 | } else { |
13516 | break; |
13517 | } |
13518 | // free $p10 |
13519 | } |
13520 | // c <- $r7 |
13521 | // free $r8 |
13522 | $r1 = true; |
13523 | seq_1: |
13524 | if ($r1!==self::$FAILED) { |
13525 | $this->savedPos = $p2; |
13526 | $r1 = $this->a171($r4, $r5, $r7); |
13527 | } |
13528 | // free $p3 |
13529 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13530 | $this->currPos, |
13531 | $r1, |
13532 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13533 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13534 | ); |
13535 | return $r1; |
13536 | } |
13537 | private function parsepipe_pipe($silence) { |
13538 | $key = 508; |
13539 | $bucket = $this->currPos; |
13540 | $cached = $this->cache[$bucket][$key] ?? null; |
13541 | if ($cached) { |
13542 | $this->currPos = $cached->nextPos; |
13543 | |
13544 | return $cached->result; |
13545 | } |
13546 | |
13547 | // start choice_1 |
13548 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "||", $this->currPos, 2, false) === 0) { |
13549 | $r1 = "||"; |
13550 | $this->currPos += 2; |
13551 | goto choice_1; |
13552 | } else { |
13553 | if (!$silence) {$this->fail(79);} |
13554 | $r1 = self::$FAILED; |
13555 | } |
13556 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}{{!}}", $this->currPos, 10, false) === 0) { |
13557 | $r1 = "{{!}}{{!}}"; |
13558 | $this->currPos += 10; |
13559 | } else { |
13560 | if (!$silence) {$this->fail(80);} |
13561 | $r1 = self::$FAILED; |
13562 | } |
13563 | choice_1: |
13564 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13565 | $this->currPos, |
13566 | $r1, |
13567 | self::$UNDEFINED, |
13568 | self::$UNDEFINED |
13569 | ); |
13570 | return $r1; |
13571 | } |
13572 | private function discardrow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) { |
13573 | $key = json_encode([475, $boolParams & 0x3eff, $param_preproc, $param_th]); |
13574 | $bucket = $this->currPos; |
13575 | $cached = $this->cache[$bucket][$key] ?? null; |
13576 | if ($cached) { |
13577 | $this->currPos = $cached->nextPos; |
13578 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13579 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13580 | return $cached->result; |
13581 | } |
13582 | $saved_preproc=$param_preproc; |
13583 | $saved_th=$param_th; |
13584 | $p2 = $this->currPos; |
13585 | // start seq_1 |
13586 | $p3 = $this->currPos; |
13587 | $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th); |
13588 | // as <- $r4 |
13589 | if ($r4===self::$FAILED) { |
13590 | $r1 = self::$FAILED; |
13591 | goto seq_1; |
13592 | } |
13593 | $r5 = $this->parseoptional_spaces($silence); |
13594 | // s <- $r5 |
13595 | if ($r5===self::$FAILED) { |
13596 | $this->currPos = $p3; |
13597 | $r1 = self::$FAILED; |
13598 | goto seq_1; |
13599 | } |
13600 | $r6 = $this->parsepipe($silence); |
13601 | // p <- $r6 |
13602 | if ($r6===self::$FAILED) { |
13603 | $this->currPos = $p3; |
13604 | $r1 = self::$FAILED; |
13605 | goto seq_1; |
13606 | } |
13607 | $p7 = $this->currPos; |
13608 | $r8 = $this->discardpipe(true); |
13609 | if ($r8 === self::$FAILED) { |
13610 | $r8 = false; |
13611 | } else { |
13612 | $r8 = self::$FAILED; |
13613 | $this->currPos = $p7; |
13614 | $this->currPos = $p3; |
13615 | $r1 = self::$FAILED; |
13616 | goto seq_1; |
13617 | } |
13618 | // free $p7 |
13619 | $r1 = true; |
13620 | seq_1: |
13621 | if ($r1!==self::$FAILED) { |
13622 | $this->savedPos = $p2; |
13623 | $r1 = $this->a14($r4, $r5, $r6); |
13624 | } |
13625 | // free $p3 |
13626 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13627 | $this->currPos, |
13628 | $r1, |
13629 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13630 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13631 | ); |
13632 | return $r1; |
13633 | } |
13634 | private function parsenested_block($silence, $boolParams, &$param_preproc, &$param_th) { |
13635 | $key = json_encode([290, $boolParams & 0x3fff, $param_preproc, $param_th]); |
13636 | $bucket = $this->currPos; |
13637 | $cached = $this->cache[$bucket][$key] ?? null; |
13638 | if ($cached) { |
13639 | $this->currPos = $cached->nextPos; |
13640 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13641 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13642 | return $cached->result; |
13643 | } |
13644 | $saved_preproc=$param_preproc; |
13645 | $saved_th=$param_th; |
13646 | $p2 = $this->currPos; |
13647 | // start seq_1 |
13648 | $p3 = $this->currPos; |
13649 | $p4 = $this->currPos; |
13650 | $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
13651 | if ($r5 === self::$FAILED) { |
13652 | $r5 = false; |
13653 | } else { |
13654 | $r5 = self::$FAILED; |
13655 | $this->currPos = $p4; |
13656 | $r1 = self::$FAILED; |
13657 | goto seq_1; |
13658 | } |
13659 | // free $p4 |
13660 | $r6 = $this->parseblock($silence, $boolParams, $param_th, $param_preproc); |
13661 | // b <- $r6 |
13662 | if ($r6===self::$FAILED) { |
13663 | $this->currPos = $p3; |
13664 | $r1 = self::$FAILED; |
13665 | goto seq_1; |
13666 | } |
13667 | $r1 = true; |
13668 | seq_1: |
13669 | if ($r1!==self::$FAILED) { |
13670 | $this->savedPos = $p2; |
13671 | $r1 = $this->a15($r6); |
13672 | } |
13673 | // free $p3 |
13674 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13675 | $this->currPos, |
13676 | $r1, |
13677 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13678 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13679 | ); |
13680 | return $r1; |
13681 | } |
13682 | private function discardinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) { |
13683 | $key = json_encode([485, $boolParams & 0x3ebd, $param_preproc, $param_th]); |
13684 | $bucket = $this->currPos; |
13685 | $cached = $this->cache[$bucket][$key] ?? null; |
13686 | if ($cached) { |
13687 | $this->currPos = $cached->nextPos; |
13688 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13689 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13690 | return $cached->result; |
13691 | } |
13692 | $saved_preproc=$param_preproc; |
13693 | $saved_th=$param_th; |
13694 | $p2 = $this->currPos; |
13695 | // start seq_1 |
13696 | $p3 = $this->currPos; |
13697 | $p4 = $this->currPos; |
13698 | // start seq_2 |
13699 | $p6 = $this->currPos; |
13700 | if (($this->input[$this->currPos] ?? null) === "<") { |
13701 | $this->currPos++; |
13702 | $r7 = "<"; |
13703 | } else { |
13704 | $r7 = self::$FAILED; |
13705 | $r5 = self::$FAILED; |
13706 | goto seq_2; |
13707 | } |
13708 | if (($this->input[$this->currPos] ?? null) === "/") { |
13709 | $this->currPos++; |
13710 | $r8 = "/"; |
13711 | } else { |
13712 | $r8 = self::$FAILED; |
13713 | $r8 = null; |
13714 | } |
13715 | // start choice_1 |
13716 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "includeonly", $this->currPos, 11, true) === 0) { |
13717 | $r9 = substr($this->input, $this->currPos, 11); |
13718 | $this->currPos += 11; |
13719 | goto choice_1; |
13720 | } else { |
13721 | $r9 = self::$FAILED; |
13722 | } |
13723 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "noinclude", $this->currPos, 9, true) === 0) { |
13724 | $r9 = substr($this->input, $this->currPos, 9); |
13725 | $this->currPos += 9; |
13726 | goto choice_1; |
13727 | } else { |
13728 | $r9 = self::$FAILED; |
13729 | } |
13730 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "onlyinclude", $this->currPos, 11, true) === 0) { |
13731 | $r9 = substr($this->input, $this->currPos, 11); |
13732 | $this->currPos += 11; |
13733 | } else { |
13734 | $r9 = self::$FAILED; |
13735 | } |
13736 | choice_1: |
13737 | if ($r9===self::$FAILED) { |
13738 | $this->currPos = $p6; |
13739 | $r5 = self::$FAILED; |
13740 | goto seq_2; |
13741 | } |
13742 | $r5 = true; |
13743 | seq_2: |
13744 | if ($r5!==self::$FAILED) { |
13745 | $r5 = false; |
13746 | $this->currPos = $p4; |
13747 | } else { |
13748 | $r1 = self::$FAILED; |
13749 | goto seq_1; |
13750 | } |
13751 | // free $p6 |
13752 | // free $p4 |
13753 | if (($this->input[$this->currPos] ?? null) === "<") { |
13754 | $this->currPos++; |
13755 | $r10 = "<"; |
13756 | } else { |
13757 | if (!$silence) {$this->fail(44);} |
13758 | $r10 = self::$FAILED; |
13759 | $this->currPos = $p3; |
13760 | $r1 = self::$FAILED; |
13761 | goto seq_1; |
13762 | } |
13763 | $r11 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
13764 | // il <- $r11 |
13765 | if ($r11===self::$FAILED) { |
13766 | $this->currPos = $p3; |
13767 | $r1 = self::$FAILED; |
13768 | goto seq_1; |
13769 | } |
13770 | $this->savedPos = $this->currPos; |
13771 | $r12 = $this->a87($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
13772 | if ($r12) { |
13773 | $r12 = false; |
13774 | } else { |
13775 | $r12 = self::$FAILED; |
13776 | $this->currPos = $p3; |
13777 | $r1 = self::$FAILED; |
13778 | goto seq_1; |
13779 | } |
13780 | $r1 = true; |
13781 | seq_1: |
13782 | if ($r1!==self::$FAILED) { |
13783 | $this->savedPos = $p2; |
13784 | $r1 = $this->a88($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
13785 | } |
13786 | // free $p3 |
13787 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13788 | $this->currPos, |
13789 | $r1, |
13790 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13791 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13792 | ); |
13793 | return $r1; |
13794 | } |
13795 | private function discardannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
13796 | $key = json_encode([405, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
13797 | $bucket = $this->currPos; |
13798 | $cached = $this->cache[$bucket][$key] ?? null; |
13799 | if ($cached) { |
13800 | $this->currPos = $cached->nextPos; |
13801 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13802 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13803 | return $cached->result; |
13804 | } |
13805 | $saved_preproc=$param_preproc; |
13806 | $saved_th=$param_th; |
13807 | $p2 = $this->currPos; |
13808 | // start seq_1 |
13809 | $p3 = $this->currPos; |
13810 | $r4 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
13811 | // annToken <- $r4 |
13812 | if ($r4===self::$FAILED) { |
13813 | $r1 = self::$FAILED; |
13814 | goto seq_1; |
13815 | } |
13816 | $this->savedPos = $this->currPos; |
13817 | $r5 = $this->a89($r4); |
13818 | if ($r5) { |
13819 | $r5 = false; |
13820 | } else { |
13821 | $r5 = self::$FAILED; |
13822 | $this->currPos = $p3; |
13823 | $r1 = self::$FAILED; |
13824 | goto seq_1; |
13825 | } |
13826 | $r1 = true; |
13827 | seq_1: |
13828 | if ($r1!==self::$FAILED) { |
13829 | $this->savedPos = $p2; |
13830 | $r1 = $this->a90($r4); |
13831 | } |
13832 | // free $p3 |
13833 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13834 | $this->currPos, |
13835 | $r1, |
13836 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13837 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13838 | ); |
13839 | return $r1; |
13840 | } |
13841 | private function discardbehavior_switch($silence) { |
13842 | $key = 313; |
13843 | $bucket = $this->currPos; |
13844 | $cached = $this->cache[$bucket][$key] ?? null; |
13845 | if ($cached) { |
13846 | $this->currPos = $cached->nextPos; |
13847 | |
13848 | return $cached->result; |
13849 | } |
13850 | |
13851 | $p2 = $this->currPos; |
13852 | $p4 = $this->currPos; |
13853 | // start seq_1 |
13854 | $p5 = $this->currPos; |
13855 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
13856 | $r6 = "__"; |
13857 | $this->currPos += 2; |
13858 | } else { |
13859 | if (!$silence) {$this->fail(53);} |
13860 | $r6 = self::$FAILED; |
13861 | $r3 = self::$FAILED; |
13862 | goto seq_1; |
13863 | } |
13864 | $r7 = $this->discardbehavior_text($silence); |
13865 | if ($r7===self::$FAILED) { |
13866 | $this->currPos = $p5; |
13867 | $r3 = self::$FAILED; |
13868 | goto seq_1; |
13869 | } |
13870 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
13871 | $r8 = "__"; |
13872 | $this->currPos += 2; |
13873 | } else { |
13874 | if (!$silence) {$this->fail(53);} |
13875 | $r8 = self::$FAILED; |
13876 | $this->currPos = $p5; |
13877 | $r3 = self::$FAILED; |
13878 | goto seq_1; |
13879 | } |
13880 | $r3 = true; |
13881 | seq_1: |
13882 | // bs <- $r3 |
13883 | if ($r3!==self::$FAILED) { |
13884 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
13885 | } else { |
13886 | $r3 = self::$FAILED; |
13887 | } |
13888 | // free $p5 |
13889 | // free $p4 |
13890 | $r1 = $r3; |
13891 | if ($r1!==self::$FAILED) { |
13892 | $this->savedPos = $p2; |
13893 | $r1 = $this->a79($r3); |
13894 | } |
13895 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13896 | $this->currPos, |
13897 | $r1, |
13898 | self::$UNDEFINED, |
13899 | self::$UNDEFINED |
13900 | ); |
13901 | return $r1; |
13902 | } |
13903 | private function parselink_text_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
13904 | $key = json_encode([398, $boolParams & 0x3fff, $param_preproc, $param_th]); |
13905 | $bucket = $this->currPos; |
13906 | $cached = $this->cache[$bucket][$key] ?? null; |
13907 | if ($cached) { |
13908 | $this->currPos = $cached->nextPos; |
13909 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13910 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13911 | return $cached->result; |
13912 | } |
13913 | $saved_preproc=$param_preproc; |
13914 | $saved_th=$param_th; |
13915 | $p2 = $this->currPos; |
13916 | $r3 = []; |
13917 | for (;;) { |
13918 | // start choice_1 |
13919 | // start seq_1 |
13920 | $p5 = $this->currPos; |
13921 | $r6 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
13922 | if ($r6===self::$FAILED) { |
13923 | $r4 = self::$FAILED; |
13924 | goto seq_1; |
13925 | } |
13926 | // start choice_2 |
13927 | $r7 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
13928 | if ($r7!==self::$FAILED) { |
13929 | goto choice_2; |
13930 | } |
13931 | $r7 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
13932 | if ($r7!==self::$FAILED) { |
13933 | goto choice_2; |
13934 | } |
13935 | $r7 = $this->parsefull_table_in_link_caption($silence, $boolParams, $param_preproc, $param_th); |
13936 | choice_2: |
13937 | if ($r7===self::$FAILED) { |
13938 | $this->currPos = $p5; |
13939 | $r4 = self::$FAILED; |
13940 | goto seq_1; |
13941 | } |
13942 | $r4 = [$r6,$r7]; |
13943 | seq_1: |
13944 | if ($r4!==self::$FAILED) { |
13945 | goto choice_1; |
13946 | } |
13947 | // free $p5 |
13948 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
13949 | if ($r4!==self::$FAILED) { |
13950 | goto choice_1; |
13951 | } |
13952 | $p5 = $this->currPos; |
13953 | // start seq_2 |
13954 | $p8 = $this->currPos; |
13955 | $p9 = $this->currPos; |
13956 | $r10 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
13957 | if ($r10 === self::$FAILED) { |
13958 | $r10 = false; |
13959 | } else { |
13960 | $r10 = self::$FAILED; |
13961 | $this->currPos = $p9; |
13962 | $r4 = self::$FAILED; |
13963 | goto seq_2; |
13964 | } |
13965 | // free $p9 |
13966 | // start choice_3 |
13967 | $r11 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
13968 | if ($r11!==self::$FAILED) { |
13969 | goto choice_3; |
13970 | } |
13971 | // start seq_3 |
13972 | $p9 = $this->currPos; |
13973 | if (($this->input[$this->currPos] ?? null) === "[") { |
13974 | $this->currPos++; |
13975 | $r12 = "["; |
13976 | } else { |
13977 | if (!$silence) {$this->fail(19);} |
13978 | $r12 = self::$FAILED; |
13979 | $r11 = self::$FAILED; |
13980 | goto seq_3; |
13981 | } |
13982 | $r13 = []; |
13983 | for (;;) { |
13984 | $r14 = $this->parsetext_char($silence); |
13985 | if ($r14!==self::$FAILED) { |
13986 | $r13[] = $r14; |
13987 | } else { |
13988 | break; |
13989 | } |
13990 | } |
13991 | if (count($r13) === 0) { |
13992 | $r13 = self::$FAILED; |
13993 | } |
13994 | if ($r13===self::$FAILED) { |
13995 | $this->currPos = $p9; |
13996 | $r11 = self::$FAILED; |
13997 | goto seq_3; |
13998 | } |
13999 | // free $r14 |
14000 | if (($this->input[$this->currPos] ?? null) === "]") { |
14001 | $this->currPos++; |
14002 | $r14 = "]"; |
14003 | } else { |
14004 | if (!$silence) {$this->fail(21);} |
14005 | $r14 = self::$FAILED; |
14006 | $this->currPos = $p9; |
14007 | $r11 = self::$FAILED; |
14008 | goto seq_3; |
14009 | } |
14010 | $p15 = $this->currPos; |
14011 | $p17 = $this->currPos; |
14012 | // start choice_4 |
14013 | $p18 = $this->currPos; |
14014 | if (($this->input[$this->currPos] ?? null) === "]") { |
14015 | $this->currPos++; |
14016 | $r16 = "]"; |
14017 | } else { |
14018 | $r16 = self::$FAILED; |
14019 | } |
14020 | if ($r16 === self::$FAILED) { |
14021 | $r16 = false; |
14022 | goto choice_4; |
14023 | } else { |
14024 | $r16 = self::$FAILED; |
14025 | $this->currPos = $p18; |
14026 | } |
14027 | // free $p18 |
14028 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
14029 | $r16 = "]]"; |
14030 | $this->currPos += 2; |
14031 | } else { |
14032 | $r16 = self::$FAILED; |
14033 | } |
14034 | choice_4: |
14035 | if ($r16!==self::$FAILED) { |
14036 | $r16 = false; |
14037 | $this->currPos = $p17; |
14038 | $r16 = substr($this->input, $p15, $this->currPos - $p15); |
14039 | } else { |
14040 | $r16 = self::$FAILED; |
14041 | $this->currPos = $p9; |
14042 | $r11 = self::$FAILED; |
14043 | goto seq_3; |
14044 | } |
14045 | // free $p17 |
14046 | // free $p15 |
14047 | $r11 = [$r12,$r13,$r14,$r16]; |
14048 | seq_3: |
14049 | if ($r11!==self::$FAILED) { |
14050 | goto choice_3; |
14051 | } |
14052 | // free $p9 |
14053 | if ($this->currPos < $this->inputLength) { |
14054 | $r11 = self::consumeChar($this->input, $this->currPos);; |
14055 | } else { |
14056 | $r11 = self::$FAILED; |
14057 | if (!$silence) {$this->fail(7);} |
14058 | } |
14059 | choice_3: |
14060 | // r <- $r11 |
14061 | if ($r11===self::$FAILED) { |
14062 | $this->currPos = $p8; |
14063 | $r4 = self::$FAILED; |
14064 | goto seq_2; |
14065 | } |
14066 | $r4 = true; |
14067 | seq_2: |
14068 | if ($r4!==self::$FAILED) { |
14069 | $this->savedPos = $p5; |
14070 | $r4 = $this->a24($r11); |
14071 | } |
14072 | // free $p8 |
14073 | choice_1: |
14074 | if ($r4!==self::$FAILED) { |
14075 | $r3[] = $r4; |
14076 | } else { |
14077 | break; |
14078 | } |
14079 | } |
14080 | if (count($r3) === 0) { |
14081 | $r3 = self::$FAILED; |
14082 | } |
14083 | // c <- $r3 |
14084 | // free $r4 |
14085 | $r1 = $r3; |
14086 | if ($r1!==self::$FAILED) { |
14087 | $this->savedPos = $p2; |
14088 | $r1 = $this->a43($r3); |
14089 | } |
14090 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14091 | $this->currPos, |
14092 | $r1, |
14093 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14094 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14095 | ); |
14096 | return $r1; |
14097 | } |
14098 | private function parselang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) { |
14099 | $key = json_encode([368, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
14100 | $bucket = $this->currPos; |
14101 | $cached = $this->cache[$bucket][$key] ?? null; |
14102 | if ($cached) { |
14103 | $this->currPos = $cached->nextPos; |
14104 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14105 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14106 | return $cached->result; |
14107 | } |
14108 | $saved_preproc=$param_preproc; |
14109 | $saved_th=$param_th; |
14110 | // start choice_1 |
14111 | $p2 = $this->currPos; |
14112 | // start seq_1 |
14113 | $p3 = $this->currPos; |
14114 | $p5 = $this->currPos; |
14115 | for (;;) { |
14116 | $r6 = $this->discardspace_or_newline($silence); |
14117 | if ($r6===self::$FAILED) { |
14118 | break; |
14119 | } |
14120 | } |
14121 | // free $r6 |
14122 | $r4 = true; |
14123 | // sp1 <- $r4 |
14124 | if ($r4!==self::$FAILED) { |
14125 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
14126 | } else { |
14127 | $r4 = self::$FAILED; |
14128 | $r1 = self::$FAILED; |
14129 | goto seq_1; |
14130 | } |
14131 | // free $p5 |
14132 | $r6 = $this->parselang_variant_flag($silence, $boolParams, $param_preproc, $param_th); |
14133 | // f <- $r6 |
14134 | if ($r6===self::$FAILED) { |
14135 | $this->currPos = $p3; |
14136 | $r1 = self::$FAILED; |
14137 | goto seq_1; |
14138 | } |
14139 | $p5 = $this->currPos; |
14140 | for (;;) { |
14141 | $r8 = $this->discardspace_or_newline($silence); |
14142 | if ($r8===self::$FAILED) { |
14143 | break; |
14144 | } |
14145 | } |
14146 | // free $r8 |
14147 | $r7 = true; |
14148 | // sp2 <- $r7 |
14149 | if ($r7!==self::$FAILED) { |
14150 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
14151 | } else { |
14152 | $r7 = self::$FAILED; |
14153 | $this->currPos = $p3; |
14154 | $r1 = self::$FAILED; |
14155 | goto seq_1; |
14156 | } |
14157 | // free $p5 |
14158 | // start seq_2 |
14159 | $p5 = $this->currPos; |
14160 | if (($this->input[$this->currPos] ?? null) === ";") { |
14161 | $this->currPos++; |
14162 | $r9 = ";"; |
14163 | } else { |
14164 | if (!$silence) {$this->fail(26);} |
14165 | $r9 = self::$FAILED; |
14166 | $r8 = self::$FAILED; |
14167 | goto seq_2; |
14168 | } |
14169 | $r10 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
14170 | if ($r10===self::$FAILED) { |
14171 | $r10 = null; |
14172 | } |
14173 | $r8 = [$r9,$r10]; |
14174 | seq_2: |
14175 | if ($r8===self::$FAILED) { |
14176 | $r8 = null; |
14177 | } |
14178 | // free $p5 |
14179 | // more <- $r8 |
14180 | $r1 = true; |
14181 | seq_1: |
14182 | if ($r1!==self::$FAILED) { |
14183 | $this->savedPos = $p2; |
14184 | $r1 = $this->a172($r4, $r6, $r7, $r8); |
14185 | goto choice_1; |
14186 | } |
14187 | // free $p3 |
14188 | $p3 = $this->currPos; |
14189 | $p5 = $this->currPos; |
14190 | for (;;) { |
14191 | $r12 = $this->discardspace_or_newline($silence); |
14192 | if ($r12===self::$FAILED) { |
14193 | break; |
14194 | } |
14195 | } |
14196 | // free $r12 |
14197 | $r11 = true; |
14198 | // sp <- $r11 |
14199 | if ($r11!==self::$FAILED) { |
14200 | $r11 = substr($this->input, $p5, $this->currPos - $p5); |
14201 | } else { |
14202 | $r11 = self::$FAILED; |
14203 | } |
14204 | // free $p5 |
14205 | $r1 = $r11; |
14206 | if ($r1!==self::$FAILED) { |
14207 | $this->savedPos = $p3; |
14208 | $r1 = $this->a173($r11); |
14209 | } |
14210 | choice_1: |
14211 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14212 | $this->currPos, |
14213 | $r1, |
14214 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14215 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14216 | ); |
14217 | return $r1; |
14218 | } |
14219 | private function parselang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) { |
14220 | $key = json_encode([378, $boolParams & 0x3fff, $param_preproc, $param_th]); |
14221 | $bucket = $this->currPos; |
14222 | $cached = $this->cache[$bucket][$key] ?? null; |
14223 | if ($cached) { |
14224 | $this->currPos = $cached->nextPos; |
14225 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14226 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14227 | return $cached->result; |
14228 | } |
14229 | $saved_preproc=$param_preproc; |
14230 | $saved_th=$param_th; |
14231 | // start choice_1 |
14232 | $p2 = $this->currPos; |
14233 | // start seq_1 |
14234 | $p3 = $this->currPos; |
14235 | $p5 = $this->currPos; |
14236 | for (;;) { |
14237 | $r6 = $this->discardspace_or_newline($silence); |
14238 | if ($r6===self::$FAILED) { |
14239 | break; |
14240 | } |
14241 | } |
14242 | // free $r6 |
14243 | $r4 = true; |
14244 | // sp1 <- $r4 |
14245 | if ($r4!==self::$FAILED) { |
14246 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
14247 | } else { |
14248 | $r4 = self::$FAILED; |
14249 | $r1 = self::$FAILED; |
14250 | goto seq_1; |
14251 | } |
14252 | // free $p5 |
14253 | $r6 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14254 | // lang <- $r6 |
14255 | if ($r6===self::$FAILED) { |
14256 | $this->currPos = $p3; |
14257 | $r1 = self::$FAILED; |
14258 | goto seq_1; |
14259 | } |
14260 | $p5 = $this->currPos; |
14261 | for (;;) { |
14262 | $r8 = $this->discardspace_or_newline($silence); |
14263 | if ($r8===self::$FAILED) { |
14264 | break; |
14265 | } |
14266 | } |
14267 | // free $r8 |
14268 | $r7 = true; |
14269 | // sp2 <- $r7 |
14270 | if ($r7!==self::$FAILED) { |
14271 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
14272 | } else { |
14273 | $r7 = self::$FAILED; |
14274 | $this->currPos = $p3; |
14275 | $r1 = self::$FAILED; |
14276 | goto seq_1; |
14277 | } |
14278 | // free $p5 |
14279 | if (($this->input[$this->currPos] ?? null) === ":") { |
14280 | $this->currPos++; |
14281 | $r8 = ":"; |
14282 | } else { |
14283 | if (!$silence) {$this->fail(18);} |
14284 | $r8 = self::$FAILED; |
14285 | $this->currPos = $p3; |
14286 | $r1 = self::$FAILED; |
14287 | goto seq_1; |
14288 | } |
14289 | $p5 = $this->currPos; |
14290 | for (;;) { |
14291 | $r10 = $this->discardspace_or_newline($silence); |
14292 | if ($r10===self::$FAILED) { |
14293 | break; |
14294 | } |
14295 | } |
14296 | // free $r10 |
14297 | $r9 = true; |
14298 | // sp3 <- $r9 |
14299 | if ($r9!==self::$FAILED) { |
14300 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
14301 | } else { |
14302 | $r9 = self::$FAILED; |
14303 | $this->currPos = $p3; |
14304 | $r1 = self::$FAILED; |
14305 | goto seq_1; |
14306 | } |
14307 | // free $p5 |
14308 | // start choice_2 |
14309 | $r10 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14310 | if ($r10!==self::$FAILED) { |
14311 | goto choice_2; |
14312 | } |
14313 | $r10 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th); |
14314 | choice_2: |
14315 | // lvtext <- $r10 |
14316 | if ($r10===self::$FAILED) { |
14317 | $this->currPos = $p3; |
14318 | $r1 = self::$FAILED; |
14319 | goto seq_1; |
14320 | } |
14321 | $r1 = true; |
14322 | seq_1: |
14323 | if ($r1!==self::$FAILED) { |
14324 | $this->savedPos = $p2; |
14325 | $r1 = $this->a174($r4, $r6, $r7, $r9, $r10); |
14326 | goto choice_1; |
14327 | } |
14328 | // free $p3 |
14329 | $p3 = $this->currPos; |
14330 | // start seq_2 |
14331 | $p5 = $this->currPos; |
14332 | $p12 = $this->currPos; |
14333 | for (;;) { |
14334 | $r13 = $this->discardspace_or_newline($silence); |
14335 | if ($r13===self::$FAILED) { |
14336 | break; |
14337 | } |
14338 | } |
14339 | // free $r13 |
14340 | $r11 = true; |
14341 | // sp1 <- $r11 |
14342 | if ($r11!==self::$FAILED) { |
14343 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
14344 | } else { |
14345 | $r11 = self::$FAILED; |
14346 | $r1 = self::$FAILED; |
14347 | goto seq_2; |
14348 | } |
14349 | // free $p12 |
14350 | // start choice_3 |
14351 | $r13 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14352 | if ($r13!==self::$FAILED) { |
14353 | goto choice_3; |
14354 | } |
14355 | $r13 = $this->parselang_variant_text_no_semi_or_arrow($silence, $boolParams, $param_preproc, $param_th); |
14356 | choice_3: |
14357 | // from <- $r13 |
14358 | if ($r13===self::$FAILED) { |
14359 | $this->currPos = $p5; |
14360 | $r1 = self::$FAILED; |
14361 | goto seq_2; |
14362 | } |
14363 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "=>", $this->currPos, 2, false) === 0) { |
14364 | $r14 = "=>"; |
14365 | $this->currPos += 2; |
14366 | } else { |
14367 | if (!$silence) {$this->fail(81);} |
14368 | $r14 = self::$FAILED; |
14369 | $this->currPos = $p5; |
14370 | $r1 = self::$FAILED; |
14371 | goto seq_2; |
14372 | } |
14373 | $p12 = $this->currPos; |
14374 | for (;;) { |
14375 | $r16 = $this->discardspace_or_newline($silence); |
14376 | if ($r16===self::$FAILED) { |
14377 | break; |
14378 | } |
14379 | } |
14380 | // free $r16 |
14381 | $r15 = true; |
14382 | // sp2 <- $r15 |
14383 | if ($r15!==self::$FAILED) { |
14384 | $r15 = substr($this->input, $p12, $this->currPos - $p12); |
14385 | } else { |
14386 | $r15 = self::$FAILED; |
14387 | $this->currPos = $p5; |
14388 | $r1 = self::$FAILED; |
14389 | goto seq_2; |
14390 | } |
14391 | // free $p12 |
14392 | $r16 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14393 | // lang <- $r16 |
14394 | if ($r16===self::$FAILED) { |
14395 | $this->currPos = $p5; |
14396 | $r1 = self::$FAILED; |
14397 | goto seq_2; |
14398 | } |
14399 | $p12 = $this->currPos; |
14400 | for (;;) { |
14401 | $r18 = $this->discardspace_or_newline($silence); |
14402 | if ($r18===self::$FAILED) { |
14403 | break; |
14404 | } |
14405 | } |
14406 | // free $r18 |
14407 | $r17 = true; |
14408 | // sp3 <- $r17 |
14409 | if ($r17!==self::$FAILED) { |
14410 | $r17 = substr($this->input, $p12, $this->currPos - $p12); |
14411 | } else { |
14412 | $r17 = self::$FAILED; |
14413 | $this->currPos = $p5; |
14414 | $r1 = self::$FAILED; |
14415 | goto seq_2; |
14416 | } |
14417 | // free $p12 |
14418 | if (($this->input[$this->currPos] ?? null) === ":") { |
14419 | $this->currPos++; |
14420 | $r18 = ":"; |
14421 | } else { |
14422 | if (!$silence) {$this->fail(18);} |
14423 | $r18 = self::$FAILED; |
14424 | $this->currPos = $p5; |
14425 | $r1 = self::$FAILED; |
14426 | goto seq_2; |
14427 | } |
14428 | $p12 = $this->currPos; |
14429 | for (;;) { |
14430 | $r20 = $this->discardspace_or_newline($silence); |
14431 | if ($r20===self::$FAILED) { |
14432 | break; |
14433 | } |
14434 | } |
14435 | // free $r20 |
14436 | $r19 = true; |
14437 | // sp4 <- $r19 |
14438 | if ($r19!==self::$FAILED) { |
14439 | $r19 = substr($this->input, $p12, $this->currPos - $p12); |
14440 | } else { |
14441 | $r19 = self::$FAILED; |
14442 | $this->currPos = $p5; |
14443 | $r1 = self::$FAILED; |
14444 | goto seq_2; |
14445 | } |
14446 | // free $p12 |
14447 | // start choice_4 |
14448 | $r20 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14449 | if ($r20!==self::$FAILED) { |
14450 | goto choice_4; |
14451 | } |
14452 | $r20 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th); |
14453 | choice_4: |
14454 | // to <- $r20 |
14455 | if ($r20===self::$FAILED) { |
14456 | $this->currPos = $p5; |
14457 | $r1 = self::$FAILED; |
14458 | goto seq_2; |
14459 | } |
14460 | $r1 = true; |
14461 | seq_2: |
14462 | if ($r1!==self::$FAILED) { |
14463 | $this->savedPos = $p3; |
14464 | $r1 = $this->a175($r11, $r13, $r15, $r16, $r17, $r19, $r20); |
14465 | } |
14466 | // free $p5 |
14467 | choice_1: |
14468 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14469 | $this->currPos, |
14470 | $r1, |
14471 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14472 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14473 | ); |
14474 | return $r1; |
14475 | } |
14476 | private function discardbogus_lang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) { |
14477 | $key = json_encode([377, $boolParams & 0x3fff, $param_preproc, $param_th]); |
14478 | $bucket = $this->currPos; |
14479 | $cached = $this->cache[$bucket][$key] ?? null; |
14480 | if ($cached) { |
14481 | $this->currPos = $cached->nextPos; |
14482 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14483 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14484 | return $cached->result; |
14485 | } |
14486 | $saved_preproc=$param_preproc; |
14487 | $saved_th=$param_th; |
14488 | $r1 = $this->discardlang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
14489 | if ($r1===self::$FAILED) { |
14490 | $r1 = null; |
14491 | } |
14492 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14493 | $this->currPos, |
14494 | $r1, |
14495 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14496 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14497 | ); |
14498 | return $r1; |
14499 | } |
14500 | private function parsefull_table_in_link_caption($silence, $boolParams, &$param_preproc, &$param_th) { |
14501 | $key = json_encode([446, $boolParams & 0x3ffe, $param_preproc, $param_th]); |
14502 | $bucket = $this->currPos; |
14503 | $cached = $this->cache[$bucket][$key] ?? null; |
14504 | if ($cached) { |
14505 | $this->currPos = $cached->nextPos; |
14506 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14507 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14508 | return $cached->result; |
14509 | } |
14510 | $saved_preproc=$param_preproc; |
14511 | $saved_th=$param_th; |
14512 | $p2 = $this->currPos; |
14513 | // start seq_1 |
14514 | $p3 = $this->currPos; |
14515 | $p4 = $this->currPos; |
14516 | $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
14517 | if ($r5 === self::$FAILED) { |
14518 | $r5 = false; |
14519 | } else { |
14520 | $r5 = self::$FAILED; |
14521 | $this->currPos = $p4; |
14522 | $r1 = self::$FAILED; |
14523 | goto seq_1; |
14524 | } |
14525 | // free $p4 |
14526 | $r6 = $this->parsefull_table_in_link_caption_parameterized($silence, ($boolParams & ~0x801) | 0x40, $param_preproc, $param_th); |
14527 | // r <- $r6 |
14528 | if ($r6===self::$FAILED) { |
14529 | $this->currPos = $p3; |
14530 | $r1 = self::$FAILED; |
14531 | goto seq_1; |
14532 | } |
14533 | $r1 = true; |
14534 | seq_1: |
14535 | if ($r1!==self::$FAILED) { |
14536 | $this->savedPos = $p2; |
14537 | $r1 = $this->a176($r6); |
14538 | } |
14539 | // free $p3 |
14540 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14541 | $this->currPos, |
14542 | $r1, |
14543 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14544 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14545 | ); |
14546 | return $r1; |
14547 | } |
14548 | private function parselang_variant_flag($silence, $boolParams, &$param_preproc, &$param_th) { |
14549 | $key = json_encode([370, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
14550 | $bucket = $this->currPos; |
14551 | $cached = $this->cache[$bucket][$key] ?? null; |
14552 | if ($cached) { |
14553 | $this->currPos = $cached->nextPos; |
14554 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14555 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14556 | return $cached->result; |
14557 | } |
14558 | $saved_preproc=$param_preproc; |
14559 | $saved_th=$param_th; |
14560 | // start choice_1 |
14561 | $p2 = $this->currPos; |
14562 | $r3 = $this->input[$this->currPos] ?? ''; |
14563 | // f <- $r3 |
14564 | if (preg_match("/^[\\-+A-Z]/", $r3)) { |
14565 | $this->currPos++; |
14566 | } else { |
14567 | $r3 = self::$FAILED; |
14568 | if (!$silence) {$this->fail(82);} |
14569 | } |
14570 | $r1 = $r3; |
14571 | if ($r1!==self::$FAILED) { |
14572 | $this->savedPos = $p2; |
14573 | $r1 = $this->a177($r3); |
14574 | goto choice_1; |
14575 | } |
14576 | $p4 = $this->currPos; |
14577 | $r5 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14578 | // v <- $r5 |
14579 | $r1 = $r5; |
14580 | if ($r1!==self::$FAILED) { |
14581 | $this->savedPos = $p4; |
14582 | $r1 = $this->a178($r5); |
14583 | goto choice_1; |
14584 | } |
14585 | $p6 = $this->currPos; |
14586 | $p8 = $this->currPos; |
14587 | $r7 = self::$FAILED; |
14588 | for (;;) { |
14589 | // start seq_1 |
14590 | $p10 = $this->currPos; |
14591 | $p11 = $this->currPos; |
14592 | $r12 = $this->discardspace_or_newline(true); |
14593 | if ($r12 === self::$FAILED) { |
14594 | $r12 = false; |
14595 | } else { |
14596 | $r12 = self::$FAILED; |
14597 | $this->currPos = $p11; |
14598 | $r9 = self::$FAILED; |
14599 | goto seq_1; |
14600 | } |
14601 | // free $p11 |
14602 | $p11 = $this->currPos; |
14603 | $r13 = $this->discardnowiki(true, $boolParams, $param_preproc, $param_th); |
14604 | if ($r13 === self::$FAILED) { |
14605 | $r13 = false; |
14606 | } else { |
14607 | $r13 = self::$FAILED; |
14608 | $this->currPos = $p11; |
14609 | $this->currPos = $p10; |
14610 | $r9 = self::$FAILED; |
14611 | goto seq_1; |
14612 | } |
14613 | // free $p11 |
14614 | if (strcspn($this->input, "{}|;", $this->currPos, 1) !== 0) { |
14615 | $r14 = self::consumeChar($this->input, $this->currPos); |
14616 | } else { |
14617 | $r14 = self::$FAILED; |
14618 | if (!$silence) {$this->fail(83);} |
14619 | $this->currPos = $p10; |
14620 | $r9 = self::$FAILED; |
14621 | goto seq_1; |
14622 | } |
14623 | $r9 = true; |
14624 | seq_1: |
14625 | if ($r9!==self::$FAILED) { |
14626 | $r7 = true; |
14627 | } else { |
14628 | break; |
14629 | } |
14630 | // free $p10 |
14631 | } |
14632 | // b <- $r7 |
14633 | if ($r7!==self::$FAILED) { |
14634 | $r7 = substr($this->input, $p8, $this->currPos - $p8); |
14635 | } else { |
14636 | $r7 = self::$FAILED; |
14637 | } |
14638 | // free $r9 |
14639 | // free $p8 |
14640 | $r1 = $r7; |
14641 | if ($r1!==self::$FAILED) { |
14642 | $this->savedPos = $p6; |
14643 | $r1 = $this->a179($r7); |
14644 | } |
14645 | choice_1: |
14646 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14647 | $this->currPos, |
14648 | $r1, |
14649 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14650 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14651 | ); |
14652 | return $r1; |
14653 | } |
14654 | private function parselang_variant_name($silence, $boolParams, &$param_preproc, &$param_th) { |
14655 | $key = json_encode([372, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
14656 | $bucket = $this->currPos; |
14657 | $cached = $this->cache[$bucket][$key] ?? null; |
14658 | if ($cached) { |
14659 | $this->currPos = $cached->nextPos; |
14660 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14661 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14662 | return $cached->result; |
14663 | } |
14664 | $saved_preproc=$param_preproc; |
14665 | $saved_th=$param_th; |
14666 | // start choice_1 |
14667 | $p2 = $this->currPos; |
14668 | // start seq_1 |
14669 | $p3 = $this->currPos; |
14670 | $r4 = $this->input[$this->currPos] ?? ''; |
14671 | if (preg_match("/^[a-z]/", $r4)) { |
14672 | $this->currPos++; |
14673 | } else { |
14674 | $r4 = self::$FAILED; |
14675 | if (!$silence) {$this->fail(84);} |
14676 | $r1 = self::$FAILED; |
14677 | goto seq_1; |
14678 | } |
14679 | $r5 = self::$FAILED; |
14680 | for (;;) { |
14681 | $r6 = $this->input[$this->currPos] ?? ''; |
14682 | if (preg_match("/^[\\-a-zA-Z]/", $r6)) { |
14683 | $this->currPos++; |
14684 | $r5 = true; |
14685 | } else { |
14686 | $r6 = self::$FAILED; |
14687 | if (!$silence) {$this->fail(85);} |
14688 | break; |
14689 | } |
14690 | } |
14691 | if ($r5===self::$FAILED) { |
14692 | $this->currPos = $p3; |
14693 | $r1 = self::$FAILED; |
14694 | goto seq_1; |
14695 | } |
14696 | // free $r6 |
14697 | $r1 = true; |
14698 | seq_1: |
14699 | if ($r1!==self::$FAILED) { |
14700 | $r1 = substr($this->input, $p2, $this->currPos - $p2); |
14701 | goto choice_1; |
14702 | } else { |
14703 | $r1 = self::$FAILED; |
14704 | } |
14705 | // free $p3 |
14706 | // free $p2 |
14707 | $r1 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th); |
14708 | choice_1: |
14709 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14710 | $this->currPos, |
14711 | $r1, |
14712 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14713 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14714 | ); |
14715 | return $r1; |
14716 | } |
14717 | private function parselang_variant_nowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
14718 | $key = json_encode([380, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
14719 | $bucket = $this->currPos; |
14720 | $cached = $this->cache[$bucket][$key] ?? null; |
14721 | if ($cached) { |
14722 | $this->currPos = $cached->nextPos; |
14723 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14724 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14725 | return $cached->result; |
14726 | } |
14727 | $saved_preproc=$param_preproc; |
14728 | $saved_th=$param_th; |
14729 | $p2 = $this->currPos; |
14730 | // start seq_1 |
14731 | $p3 = $this->currPos; |
14732 | $r4 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th); |
14733 | // n <- $r4 |
14734 | if ($r4===self::$FAILED) { |
14735 | $r1 = self::$FAILED; |
14736 | goto seq_1; |
14737 | } |
14738 | $p6 = $this->currPos; |
14739 | for (;;) { |
14740 | $r7 = $this->discardspace_or_newline($silence); |
14741 | if ($r7===self::$FAILED) { |
14742 | break; |
14743 | } |
14744 | } |
14745 | // free $r7 |
14746 | $r5 = true; |
14747 | // sp <- $r5 |
14748 | if ($r5!==self::$FAILED) { |
14749 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
14750 | } else { |
14751 | $r5 = self::$FAILED; |
14752 | $this->currPos = $p3; |
14753 | $r1 = self::$FAILED; |
14754 | goto seq_1; |
14755 | } |
14756 | // free $p6 |
14757 | $r1 = true; |
14758 | seq_1: |
14759 | if ($r1!==self::$FAILED) { |
14760 | $this->savedPos = $p2; |
14761 | $r1 = $this->a180($r4, $r5); |
14762 | } |
14763 | // free $p3 |
14764 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14765 | $this->currPos, |
14766 | $r1, |
14767 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14768 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14769 | ); |
14770 | return $r1; |
14771 | } |
14772 | private function parselang_variant_text_no_semi($silence, $boolParams, &$param_preproc, &$param_th) { |
14773 | $key = json_encode([384, $boolParams & 0x3dff, $param_preproc, $param_th]); |
14774 | $bucket = $this->currPos; |
14775 | $cached = $this->cache[$bucket][$key] ?? null; |
14776 | if ($cached) { |
14777 | $this->currPos = $cached->nextPos; |
14778 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14779 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14780 | return $cached->result; |
14781 | } |
14782 | $saved_preproc=$param_preproc; |
14783 | $saved_th=$param_th; |
14784 | $r1 = $this->parselang_variant_text($silence, $boolParams | 0x200, $param_preproc, $param_th); |
14785 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14786 | $this->currPos, |
14787 | $r1, |
14788 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14789 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14790 | ); |
14791 | return $r1; |
14792 | } |
14793 | private function parselang_variant_text_no_semi_or_arrow($silence, $boolParams, &$param_preproc, &$param_th) { |
14794 | $key = json_encode([386, $boolParams & 0x39ff, $param_preproc, $param_th]); |
14795 | $bucket = $this->currPos; |
14796 | $cached = $this->cache[$bucket][$key] ?? null; |
14797 | if ($cached) { |
14798 | $this->currPos = $cached->nextPos; |
14799 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14800 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14801 | return $cached->result; |
14802 | } |
14803 | $saved_preproc=$param_preproc; |
14804 | $saved_th=$param_th; |
14805 | $r1 = $this->parselang_variant_text_no_semi($silence, $boolParams | 0x400, $param_preproc, $param_th); |
14806 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14807 | $this->currPos, |
14808 | $r1, |
14809 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14810 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14811 | ); |
14812 | return $r1; |
14813 | } |
14814 | private function discardlang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) { |
14815 | $key = json_encode([383, $boolParams & 0x3fff, $param_preproc, $param_th]); |
14816 | $bucket = $this->currPos; |
14817 | $cached = $this->cache[$bucket][$key] ?? null; |
14818 | if ($cached) { |
14819 | $this->currPos = $cached->nextPos; |
14820 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14821 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14822 | return $cached->result; |
14823 | } |
14824 | $saved_preproc=$param_preproc; |
14825 | $saved_th=$param_th; |
14826 | $p2 = $this->currPos; |
14827 | $r3 = []; |
14828 | for (;;) { |
14829 | // start choice_1 |
14830 | $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
14831 | if ($r4!==self::$FAILED) { |
14832 | goto choice_1; |
14833 | } |
14834 | if (($this->input[$this->currPos] ?? null) === "|") { |
14835 | $this->currPos++; |
14836 | $r4 = "|"; |
14837 | } else { |
14838 | if (!$silence) {$this->fail(13);} |
14839 | $r4 = self::$FAILED; |
14840 | } |
14841 | choice_1: |
14842 | if ($r4!==self::$FAILED) { |
14843 | $r3[] = $r4; |
14844 | } else { |
14845 | break; |
14846 | } |
14847 | } |
14848 | // tokens <- $r3 |
14849 | // free $r4 |
14850 | $r1 = $r3; |
14851 | if ($r1!==self::$FAILED) { |
14852 | $this->savedPos = $p2; |
14853 | $r1 = $this->a166($r3); |
14854 | } |
14855 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14856 | $this->currPos, |
14857 | $r1, |
14858 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14859 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14860 | ); |
14861 | return $r1; |
14862 | } |
14863 | private function parsefull_table_in_link_caption_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
14864 | $key = json_encode([448, $boolParams & 0x3fff, $param_preproc, $param_th]); |
14865 | $bucket = $this->currPos; |
14866 | $cached = $this->cache[$bucket][$key] ?? null; |
14867 | if ($cached) { |
14868 | $this->currPos = $cached->nextPos; |
14869 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14870 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14871 | return $cached->result; |
14872 | } |
14873 | $saved_preproc=$param_preproc; |
14874 | $saved_th=$param_th; |
14875 | // start seq_1 |
14876 | $p1 = $this->currPos; |
14877 | $r3 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
14878 | if ($r3===self::$FAILED) { |
14879 | $r2 = self::$FAILED; |
14880 | goto seq_1; |
14881 | } |
14882 | $r4 = []; |
14883 | for (;;) { |
14884 | // start seq_2 |
14885 | $p6 = $this->currPos; |
14886 | $r7 = []; |
14887 | for (;;) { |
14888 | // start seq_3 |
14889 | $p9 = $this->currPos; |
14890 | $r10 = []; |
14891 | for (;;) { |
14892 | $r11 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
14893 | if ($r11!==self::$FAILED) { |
14894 | $r10[] = $r11; |
14895 | } else { |
14896 | break; |
14897 | } |
14898 | } |
14899 | if (count($r10) === 0) { |
14900 | $r10 = self::$FAILED; |
14901 | } |
14902 | if ($r10===self::$FAILED) { |
14903 | $r8 = self::$FAILED; |
14904 | goto seq_3; |
14905 | } |
14906 | // free $r11 |
14907 | // start choice_1 |
14908 | $r11 = $this->parsetable_content_line($silence, $boolParams, $param_preproc, $param_th); |
14909 | if ($r11!==self::$FAILED) { |
14910 | goto choice_1; |
14911 | } |
14912 | $r11 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
14913 | choice_1: |
14914 | if ($r11===self::$FAILED) { |
14915 | $this->currPos = $p9; |
14916 | $r8 = self::$FAILED; |
14917 | goto seq_3; |
14918 | } |
14919 | $r8 = [$r10,$r11]; |
14920 | seq_3: |
14921 | if ($r8!==self::$FAILED) { |
14922 | $r7[] = $r8; |
14923 | } else { |
14924 | break; |
14925 | } |
14926 | // free $p9 |
14927 | } |
14928 | // free $r8 |
14929 | $r8 = []; |
14930 | for (;;) { |
14931 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
14932 | if ($r12!==self::$FAILED) { |
14933 | $r8[] = $r12; |
14934 | } else { |
14935 | break; |
14936 | } |
14937 | } |
14938 | if (count($r8) === 0) { |
14939 | $r8 = self::$FAILED; |
14940 | } |
14941 | if ($r8===self::$FAILED) { |
14942 | $this->currPos = $p6; |
14943 | $r5 = self::$FAILED; |
14944 | goto seq_2; |
14945 | } |
14946 | // free $r12 |
14947 | $r12 = $this->parsetable_end_tag($silence); |
14948 | if ($r12===self::$FAILED) { |
14949 | $this->currPos = $p6; |
14950 | $r5 = self::$FAILED; |
14951 | goto seq_2; |
14952 | } |
14953 | $r5 = [$r7,$r8,$r12]; |
14954 | seq_2: |
14955 | if ($r5!==self::$FAILED) { |
14956 | $r4[] = $r5; |
14957 | } else { |
14958 | break; |
14959 | } |
14960 | // free $p6 |
14961 | } |
14962 | if (count($r4) === 0) { |
14963 | $r4 = self::$FAILED; |
14964 | } |
14965 | if ($r4===self::$FAILED) { |
14966 | $this->currPos = $p1; |
14967 | $r2 = self::$FAILED; |
14968 | goto seq_1; |
14969 | } |
14970 | // free $r5 |
14971 | $r2 = [$r3,$r4]; |
14972 | seq_1: |
14973 | // free $r2,$p1 |
14974 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14975 | $this->currPos, |
14976 | $r2, |
14977 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14978 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14979 | ); |
14980 | return $r2; |
14981 | } |
14982 | private function discardnowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
14983 | $key = json_encode([409, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
14984 | $bucket = $this->currPos; |
14985 | $cached = $this->cache[$bucket][$key] ?? null; |
14986 | if ($cached) { |
14987 | $this->currPos = $cached->nextPos; |
14988 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14989 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14990 | return $cached->result; |
14991 | } |
14992 | $saved_preproc=$param_preproc; |
14993 | $saved_th=$param_th; |
14994 | $p2 = $this->currPos; |
14995 | // start seq_1 |
14996 | $p3 = $this->currPos; |
14997 | $p4 = $this->currPos; |
14998 | // start seq_2 |
14999 | $p6 = $this->currPos; |
15000 | if (($this->input[$this->currPos] ?? null) === "<") { |
15001 | $this->currPos++; |
15002 | $r7 = "<"; |
15003 | } else { |
15004 | $r7 = self::$FAILED; |
15005 | $r5 = self::$FAILED; |
15006 | goto seq_2; |
15007 | } |
15008 | if (($this->input[$this->currPos] ?? null) === "/") { |
15009 | $this->currPos++; |
15010 | $r8 = "/"; |
15011 | } else { |
15012 | $r8 = self::$FAILED; |
15013 | $r8 = null; |
15014 | } |
15015 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "nowiki", $this->currPos, 6, true) === 0) { |
15016 | $r9 = substr($this->input, $this->currPos, 6); |
15017 | $this->currPos += 6; |
15018 | } else { |
15019 | $r9 = self::$FAILED; |
15020 | $this->currPos = $p6; |
15021 | $r5 = self::$FAILED; |
15022 | goto seq_2; |
15023 | } |
15024 | $r5 = true; |
15025 | seq_2: |
15026 | if ($r5!==self::$FAILED) { |
15027 | $r5 = false; |
15028 | $this->currPos = $p4; |
15029 | } else { |
15030 | $r1 = self::$FAILED; |
15031 | goto seq_1; |
15032 | } |
15033 | // free $p6 |
15034 | // free $p4 |
15035 | $r10 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
15036 | // extToken <- $r10 |
15037 | if ($r10===self::$FAILED) { |
15038 | $this->currPos = $p3; |
15039 | $r1 = self::$FAILED; |
15040 | goto seq_1; |
15041 | } |
15042 | $r1 = true; |
15043 | seq_1: |
15044 | if ($r1!==self::$FAILED) { |
15045 | $this->savedPos = $p2; |
15046 | $r1 = $this->a181($r10); |
15047 | } |
15048 | // free $p3 |
15049 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15050 | $this->currPos, |
15051 | $r1, |
15052 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15053 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15054 | ); |
15055 | return $r1; |
15056 | } |
15057 | private function parsenowiki_text($silence, $boolParams, &$param_preproc, &$param_th) { |
15058 | $key = json_encode([410, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
15059 | $bucket = $this->currPos; |
15060 | $cached = $this->cache[$bucket][$key] ?? null; |
15061 | if ($cached) { |
15062 | $this->currPos = $cached->nextPos; |
15063 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
15064 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
15065 | return $cached->result; |
15066 | } |
15067 | $saved_preproc=$param_preproc; |
15068 | $saved_th=$param_th; |
15069 | $p2 = $this->currPos; |
15070 | $r3 = $this->parsenowiki($silence, $boolParams, $param_preproc, $param_th); |
15071 | // extToken <- $r3 |
15072 | $r1 = $r3; |
15073 | if ($r1!==self::$FAILED) { |
15074 | $this->savedPos = $p2; |
15075 | $r1 = $this->a182($r3); |
15076 | } |
15077 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15078 | $this->currPos, |
15079 | $r1, |
15080 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15081 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15082 | ); |
15083 | return $r1; |
15084 | } |
15085 | private function parsenowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
15086 | $key = json_encode([408, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
15087 | $bucket = $this->currPos; |
15088 | $cached = $this->cache[$bucket][$key] ?? null; |
15089 | if ($cached) { |
15090 | $this->currPos = $cached->nextPos; |
15091 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
15092 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
15093 | return $cached->result; |
15094 | } |
15095 | $saved_preproc=$param_preproc; |
15096 | $saved_th=$param_th; |
15097 | $p2 = $this->currPos; |
15098 | // start seq_1 |
15099 | $p3 = $this->currPos; |
15100 | $p4 = $this->currPos; |
15101 | // start seq_2 |
15102 | $p6 = $this->currPos; |
15103 | if (($this->input[$this->currPos] ?? null) === "<") { |
15104 | $this->currPos++; |
15105 | $r7 = "<"; |
15106 | } else { |
15107 | $r7 = self::$FAILED; |
15108 | $r5 = self::$FAILED; |
15109 | goto seq_2; |
15110 | } |
15111 | if (($this->input[$this->currPos] ?? null) === "/") { |
15112 | $this->currPos++; |
15113 | $r8 = "/"; |
15114 | } else { |
15115 | $r8 = self::$FAILED; |
15116 | $r8 = null; |
15117 | } |
15118 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "nowiki", $this->currPos, 6, true) === 0) { |
15119 | $r9 = substr($this->input, $this->currPos, 6); |
15120 | $this->currPos += 6; |
15121 | } else { |
15122 | $r9 = self::$FAILED; |
15123 | $this->currPos = $p6; |
15124 | $r5 = self::$FAILED; |
15125 | goto seq_2; |
15126 | } |
15127 | $r5 = true; |
15128 | seq_2: |
15129 | if ($r5!==self::$FAILED) { |
15130 | $r5 = false; |
15131 | $this->currPos = $p4; |
15132 | } else { |
15133 | $r1 = self::$FAILED; |
15134 | goto seq_1; |
15135 | } |
15136 | // free $p6 |
15137 | // free $p4 |
15138 | $r10 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
15139 | // extToken <- $r10 |
15140 | if ($r10===self::$FAILED) { |
15141 | $this->currPos = $p3; |
15142 | $r1 = self::$FAILED; |
15143 | goto seq_1; |
15144 | } |
15145 | $r1 = true; |
15146 | seq_1: |
15147 | if ($r1!==self::$FAILED) { |
15148 | $this->savedPos = $p2; |
15149 | $r1 = $this->a181($r10); |
15150 | } |
15151 | // free $p3 |
15152 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15153 | $this->currPos, |
15154 | $r1, |
15155 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15156 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15157 | ); |
15158 | return $r1; |
15159 | } |
15160 | |
15161 | public function parse( $input, $options = [] ) { |
15162 | $this->initInternal( $input, $options ); |
15163 | $startRule = $options['startRule'] ?? '(DEFAULT)'; |
15164 | $result = null; |
15165 | |
15166 | if ( !empty( $options['stream'] ) ) { |
15167 | switch ( $startRule ) { |
15168 | case '(DEFAULT)': |
15169 | case "start_async": |
15170 | return $this->streamstart_async(false, self::newRef(null)); |
15171 | break; |
15172 | default: |
15173 | throw new \Wikimedia\WikiPEG\InternalError( "Can't stream rule $startRule." ); |
15174 | } |
15175 | } else { |
15176 | switch ( $startRule ) { |
15177 | case '(DEFAULT)': |
15178 | case "start": |
15179 | $result = $this->parsestart(false, self::newRef(null)); |
15180 | break; |
15181 | |
15182 | case "table_start_tag": |
15183 | $result = $this->parsetable_start_tag(false, 0, self::newRef(null), self::newRef(null)); |
15184 | break; |
15185 | |
15186 | case "url": |
15187 | $result = $this->parseurl(false, self::newRef(null)); |
15188 | break; |
15189 | |
15190 | case "row_syntax_table_args": |
15191 | $result = $this->parserow_syntax_table_args(false, 0, self::newRef(null), self::newRef(null)); |
15192 | break; |
15193 | |
15194 | case "table_attributes": |
15195 | $result = $this->parsetable_attributes(false, 0, self::newRef(null), self::newRef(null)); |
15196 | break; |
15197 | |
15198 | case "generic_newline_attributes": |
15199 | $result = $this->parsegeneric_newline_attributes(false, 0, self::newRef(null), self::newRef(null)); |
15200 | break; |
15201 | |
15202 | case "tplarg_or_template_or_bust": |
15203 | $result = $this->parsetplarg_or_template_or_bust(false, self::newRef(null)); |
15204 | break; |
15205 | |
15206 | case "extlink": |
15207 | $result = $this->parseextlink(false, 0, self::newRef(null), self::newRef(null)); |
15208 | break; |
15209 | |
15210 | case "list_item": |
15211 | $result = $this->parselist_item(false, 0, self::newRef(null), self::newRef(null)); |
15212 | break; |
15213 | default: |
15214 | throw new \Wikimedia\WikiPEG\InternalError( "Can't start parsing from rule $startRule." ); |
15215 | } |
15216 | } |
15217 | |
15218 | if ( $result !== self::$FAILED && $this->currPos === $this->inputLength ) { |
15219 | return $result; |
15220 | } else { |
15221 | if ( $result !== self::$FAILED && $this->currPos < $this->inputLength ) { |
15222 | $this->fail( 0 ); |
15223 | } |
15224 | throw $this->buildParseException(); |
15225 | } |
15226 | } |
15227 | } |