Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9871 |
|
0.00% |
0 / 368 |
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 / 9867 |
|
0.00% |
0 / 367 |
7072940 | |
0.00% |
0 / 1 |
initialize | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
resetState | |
0.00% |
0 / 2 |
|
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 | |||
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 / 23 |
|
0.00% |
0 / 1 |
20 | |||
a46 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
a47 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
a48 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a49 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a50 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
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 |
6 | |||
a54 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a55 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a56 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a57 | |
0.00% |
0 / 1 |
|
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 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a61 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a62 | |
0.00% |
0 / 1 |
|
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 |
2 | |||
a69 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a70 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a71 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a72 | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
12 | |||
a73 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a74 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a75 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a76 | |
0.00% |
0 / 2 |
|
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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a80 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |||
a81 | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
56 | |||
a82 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a83 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
a84 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a85 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a86 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a87 | |
0.00% |
0 / 72 |
|
0.00% |
0 / 1 |
306 | |||
a88 | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
a89 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
a90 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a91 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a92 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a93 | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
42 | |||
a94 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a95 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a96 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
12 | |||
a97 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
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 / 12 |
|
0.00% |
0 / 1 |
12 | |||
a102 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a103 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a104 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a105 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a106 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
a107 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a108 | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
a109 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a110 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a111 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a112 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a113 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a114 | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
56 | |||
a115 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |||
a116 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
30 | |||
a117 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a118 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a119 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
2 | |||
a120 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a121 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a122 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
12 | |||
a123 | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 | |||
a124 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
132 | |||
a125 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a126 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a127 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
a128 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a129 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a130 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a131 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a132 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a133 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a134 | |
0.00% |
0 / 2 |
|
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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a138 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a139 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
12 | |||
a140 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a141 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a142 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a143 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a144 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a145 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a146 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
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 |
6 | |||
a150 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
a151 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a152 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a153 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
a154 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a155 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a156 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a157 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a158 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a159 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a160 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a161 | |
0.00% |
0 / 31 |
|
0.00% |
0 / 1 |
56 | |||
a162 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a163 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a164 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a165 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a166 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
a167 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a168 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
a169 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a170 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a171 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
420 | |||
a172 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a173 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a174 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
a175 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a176 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a177 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
a178 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
a179 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a180 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a181 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a182 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
a183 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a184 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a185 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a186 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a187 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a188 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a189 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a190 | |
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 / 85 |
|
0.00% |
0 / 1 |
380 | |||
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 / 131 |
|
0.00% |
0 / 1 |
992 | |||
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 / 152 |
|
0.00% |
0 / 1 |
930 | |||
discardlist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parselist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
parsedtdd_colon | |
0.00% |
0 / 37 |
|
0.00% |
0 / 1 |
110 | |||
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 / 35 |
|
0.00% |
0 / 1 |
132 | |||
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 / 72 |
|
0.00% |
0 / 1 |
306 | |||
parsehtml_tag | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
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 | |||
parseangle_bracket_markup | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
110 | |||
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 | |||
parseinlineline_break_on_colon | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
parsetable_content_line | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
182 | |||
parsetable_end_tag | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
110 | |||
parsesol_prefix | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
20 | |||
parseempty_lines_with_comments | |
0.00% |
0 / 61 |
|
0.00% |
0 / 1 |
240 | |||
parseredirect_word | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
306 | |||
parseinclude_limits | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
parseannotation_tag | |
0.00% |
0 / 43 |
|
0.00% |
0 / 1 |
132 | |||
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 / 175 |
|
0.00% |
0 / 1 |
2450 | |||
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 | |||
parsewellformed_extension_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
parsexmlish_tag | |
0.00% |
0 / 71 |
|
0.00% |
0 / 1 |
420 | |||
parseautourl | |
0.00% |
0 / 182 |
|
0.00% |
0 / 1 |
1560 | |||
parseautoref | |
0.00% |
0 / 57 |
|
0.00% |
0 / 1 |
210 | |||
parseisbn | |
0.00% |
0 / 125 |
|
0.00% |
0 / 1 |
992 | |||
discardbehavior_text | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
156 | |||
parsemaybe_extension_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
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 / 55 |
|
0.00% |
0 / 1 |
210 | |||
parsetable_caption_tag | |
0.00% |
0 / 57 |
|
0.00% |
0 / 1 |
240 | |||
parsenewline | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
discardinclude_check | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
30 | |||
parsetvar_old_syntax_closing_HACK | |
0.00% |
0 / 40 |
|
0.00% |
0 / 1 |
72 | |||
discardannotation_check | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
30 | |||
discardsol | |
0.00% |
0 / 35 |
|
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 | |||
parseparsoid_fragment_marker | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
110 | |||
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 | |||
parsexmlish_start | |
0.00% |
0 / 37 |
|
0.00% |
0 / 1 |
72 | |||
parseRFC | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
56 | |||
parsePMID | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
56 | |||
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 | |||
discardextension_check | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
30 | |||
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 / 40 |
|
0.00% |
0 / 1 |
132 | |||
parsetable_data_tag | |
0.00% |
0 / 50 |
|
0.00% |
0 / 1 |
182 | |||
parsetds | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
110 | |||
parsenested_block_in_table | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
462 | |||
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 | |||
parsetag_name | |
0.00% |
0 / 24 |
|
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 | |||
parseths | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
182 | |||
parsepipe_pipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
72 | |||
parsenested_block | |
0.00% |
0 / 36 |
|
0.00% |
0 / 1 |
90 | |||
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 / 35 |
|
0.00% |
0 / 1 |
90 | |||
parsenowiki_text | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
discardnowiki_check | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
30 | |||
parsenowiki | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
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 `npm run regen-php-tokenizer`. |
5 | */ |
6 | |
7 | |
8 | namespace Wikimedia\Parsoid\Wt2Html; |
9 | |
10 | |
11 | use Wikimedia\Assert\UnreachableException; |
12 | use Wikimedia\JsonCodec\JsonCodec; |
13 | use Wikimedia\Parsoid\Config\Env; |
14 | use Wikimedia\Parsoid\Config\SiteConfig; |
15 | use Wikimedia\Parsoid\Core\DomSourceRange; |
16 | use Wikimedia\Parsoid\NodeData\DataMw; |
17 | use Wikimedia\Parsoid\NodeData\DataParsoid; |
18 | use Wikimedia\Parsoid\NodeData\TempData; |
19 | use Wikimedia\Parsoid\Tokens\CommentTk; |
20 | use Wikimedia\Parsoid\Tokens\EOFTk; |
21 | use Wikimedia\Parsoid\Tokens\EndTagTk; |
22 | use Wikimedia\Parsoid\Tokens\KV; |
23 | use Wikimedia\Parsoid\Tokens\KVSourceRange; |
24 | use Wikimedia\Parsoid\Tokens\NlTk; |
25 | use Wikimedia\Parsoid\Tokens\SelfclosingTagTk; |
26 | use Wikimedia\Parsoid\Tokens\SourceRange; |
27 | use Wikimedia\Parsoid\Tokens\TagTk; |
28 | use Wikimedia\Parsoid\Tokens\Token; |
29 | use Wikimedia\Parsoid\Utils\DOMDataUtils; |
30 | use Wikimedia\Parsoid\Utils\PHPUtils; |
31 | use Wikimedia\Parsoid\Utils\TokenUtils; |
32 | use Wikimedia\Parsoid\Utils\Utils; |
33 | use Wikimedia\Parsoid\Utils\WTUtils; |
34 | use Wikimedia\Parsoid\Wikitext\Consts; |
35 | |
36 | |
37 | |
38 | class GrammarCacheEntry { |
39 | public $nextPos; |
40 | public $result; |
41 | public $preproc; |
42 | public $th; |
43 | |
44 | |
45 | public function __construct( $nextPos, $result, $preproc, $th ) { |
46 | $this->nextPos = $nextPos; |
47 | $this->result = $result; |
48 | $this->preproc = $preproc; |
49 | $this->th = $th; |
50 | |
51 | } |
52 | } |
53 | |
54 | |
55 | class Grammar extends \Wikimedia\WikiPEG\PEGParserBase { |
56 | // initializer |
57 | |
58 | /** @var Env */ |
59 | private $env; |
60 | |
61 | /** @var SiteConfig */ |
62 | private $siteConfig; |
63 | |
64 | /** @var array */ |
65 | private $pipelineOpts; |
66 | |
67 | /** @var int */ |
68 | private $pipelineOffset; |
69 | |
70 | private $extTags; |
71 | |
72 | private $startTime; |
73 | |
74 | /** @var string */ |
75 | private $reUrltextLookahead; |
76 | |
77 | /** @var string */ |
78 | private $urltextPlainSegment = ''; |
79 | |
80 | /** @var bool */ |
81 | private $urltextFoundAutolink = false; |
82 | |
83 | protected function initialize() { |
84 | $this->env = $this->options['env']; |
85 | $this->siteConfig = $this->env->getSiteConfig(); |
86 | |
87 | $tokenizer = $this->options['pegTokenizer']; |
88 | $this->pipelineOpts = $tokenizer->getOptions(); |
89 | // FIXME: inTemplate option may not always be set in |
90 | // standalone tokenizers user by some pipelines handlers. |
91 | $this->pipelineOffset = $this->options['pipelineOffset'] ?? 0; |
92 | $this->extTags = $this->siteConfig->getExtensionTagNameMap(); |
93 | |
94 | // Non-greedy text_char sequence: stop at ampersand, double-underscore, |
95 | // magic link prefix or protocol |
96 | $this->reUrltextLookahead = '!(?:' . |
97 | '([^-\'<[{\n\r:;\]}|\!=&]*?)' . |
98 | '(?:__|$|[-\'<[{\n\r:;\]}|\!=&]|(RFC|PMID|ISBN|' . |
99 | '(?i)' . $this->siteConfig->getProtocolsRegex( true ) . |
100 | ')))!A'; |
101 | } |
102 | |
103 | private $prevOffset = 0; |
104 | private $headingIndex = 0; |
105 | |
106 | public function resetState() { |
107 | $this->prevOffset = 0; |
108 | $this->headingIndex = 0; |
109 | } |
110 | |
111 | private function assert( $condition, $text ) { |
112 | if ( !$condition ) { |
113 | throw new \RuntimeException( "Grammar.pegphp assertion failure: $text" ); |
114 | } |
115 | } |
116 | |
117 | private function unreachable() { |
118 | throw new UnreachableException( "Grammar.pegphp: this should be unreachable" ); |
119 | } |
120 | |
121 | // Some shorthands for legibility |
122 | private function startOffset() { |
123 | return $this->savedPos; |
124 | } |
125 | |
126 | private function endOffset() { |
127 | return $this->currPos; |
128 | } |
129 | |
130 | private function tsrOffsets( $flag = 'default' ): SourceRange { |
131 | switch ( $flag ) { |
132 | case 'start': |
133 | return new SourceRange( $this->savedPos, $this->savedPos ); |
134 | case 'end': |
135 | return new SourceRange( $this->currPos, $this->currPos ); |
136 | default: |
137 | return new SourceRange( $this->savedPos, $this->currPos ); |
138 | } |
139 | } |
140 | |
141 | /* |
142 | * Emit a chunk of tokens to our consumers. Once this has been done, the |
143 | * current expression can return an empty list (true). |
144 | */ |
145 | private function emitChunk( $tokens ) { |
146 | // FIXME: We don't expect nulls here, but looks like |
147 | // hack from I1c695ab6cdd3655e98877c175ddbabdee9dc44b7 |
148 | // introduces them. Work around it for now! |
149 | if ( !$tokens ) { |
150 | return []; |
151 | } |
152 | |
153 | // Shift tsr of all tokens by the pipeline offset |
154 | TokenUtils::shiftTokenTSR( $tokens, $this->pipelineOffset ); |
155 | $this->env->log( 'trace/peg', $this->options['pipelineId'] ?? '0', '----> ', $tokens ); |
156 | |
157 | $i = null; |
158 | $n = count( $tokens ); |
159 | |
160 | // Enforce parsing resource limits |
161 | for ( $i = 0; $i < $n; $i++ ) { |
162 | TokenizerUtils::enforceParserResourceLimits( $this->env, $tokens[ $i ] ); |
163 | } |
164 | |
165 | return $tokens; |
166 | } |
167 | |
168 | /* ------------------------------------------------------------------------ |
169 | * Extension tags should be parsed with higher priority than anything else. |
170 | * |
171 | * The trick we use is to strip out the content inside a matching tag-pair |
172 | * and not tokenize it. The content, if it needs to parsed (for example, |
173 | * for <ref>, <*include*> tags), is parsed in a fresh tokenizer context |
174 | * which means any error correction that needs to happen is restricted to |
175 | * the scope of the extension content and doesn't spill over to the higher |
176 | * level. Ex: <math><!--foo</math>. |
177 | * |
178 | * IGNORE: {{ this just balances the blocks in this comment for pegjs |
179 | * |
180 | * This trick also lets us prevent extension content (that don't accept WT) |
181 | * from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>) |
182 | * We don't want the "}}" being treated as a template closing tag and |
183 | * closing outer templates. |
184 | * --------------------------------------------------------------------- */ |
185 | |
186 | private function isXMLTag( string $name ): bool { |
187 | $lName = mb_strtolower( $name ); |
188 | return isset( Consts::$HTML['HTML5Tags'][$lName] ) || |
189 | isset( Consts::$HTML['OlderHTMLTags'][$lName] ); |
190 | } |
191 | |
192 | |
193 | |
194 | // cache init |
195 | protected $cache = []; |
196 | |
197 | // expectations |
198 | protected $expectations = [ |
199 | 0 => ["type" => "end", "description" => "end of input"], |
200 | 1 => ["type" => "other", "description" => "start"], |
201 | 2 => ["type" => "other", "description" => "table_start_tag"], |
202 | 3 => ["type" => "class", "value" => "['{]", "description" => "['{]"], |
203 | 4 => ["type" => "literal", "value" => "&", "description" => "\"&\""], |
204 | 5 => ["type" => "other", "description" => "table_attributes"], |
205 | 6 => ["type" => "other", "description" => "generic_newline_attributes"], |
206 | 7 => ["type" => "any", "description" => "any character"], |
207 | 8 => ["type" => "other", "description" => "extlink"], |
208 | 9 => ["type" => "other", "description" => "tlb"], |
209 | 10 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"], |
210 | 11 => ["type" => "literal", "value" => "<!--", "description" => "\"<!--\""], |
211 | 12 => ["type" => "literal", "value" => "-->", "description" => "\"-->\""], |
212 | 13 => ["type" => "literal", "value" => "|", "description" => "\"|\""], |
213 | 14 => ["type" => "literal", "value" => "{{!}}", "description" => "\"{{!}}\""], |
214 | 15 => ["type" => "literal", "value" => "//", "description" => "\"//\""], |
215 | 16 => ["type" => "class", "value" => "[A-Za-z]", "description" => "[A-Za-z]"], |
216 | 17 => ["type" => "class", "value" => "[-A-Za-z0-9+.]", "description" => "[-A-Za-z0-9+.]"], |
217 | 18 => ["type" => "literal", "value" => ":", "description" => "\":\""], |
218 | 19 => ["type" => "literal", "value" => "[", "description" => "\"[\""], |
219 | 20 => ["type" => "class", "value" => "[0-9A-Fa-f:.]", "description" => "[0-9A-Fa-f:.]"], |
220 | 21 => ["type" => "literal", "value" => "]", "description" => "\"]\""], |
221 | 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{]"], |
222 | 23 => ["type" => "literal", "value" => "=", "description" => "\"=\""], |
223 | 24 => ["type" => "class", "value" => "[\\0/=>]", "description" => "[\\0/=>]"], |
224 | 25 => ["type" => "class", "value" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]"], |
225 | 26 => ["type" => "literal", "value" => ";", "description" => "\";\""], |
226 | 27 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""], |
227 | 28 => ["type" => "literal", "value" => "\x0d\x0a", "description" => "\"\\r\\n\""], |
228 | 29 => ["type" => "literal", "value" => "{", "description" => "\"{\""], |
229 | 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}]"], |
230 | 31 => ["type" => "class", "value" => "[\"'=]", "description" => "[\"'=]"], |
231 | 32 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]"], |
232 | 33 => ["type" => "literal", "value" => "'", "description" => "\"'\""], |
233 | 34 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""], |
234 | 35 => ["type" => "literal", "value" => "/", "description" => "\"/\""], |
235 | 36 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]"], |
236 | 37 => ["type" => "class", "value" => "[ \\t\\n\\r\\x0c]", "description" => "[ \\t\\n\\r\\x0c]"], |
237 | 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]"], |
238 | 39 => ["type" => "class", "value" => "[&|{\\-!}=]", "description" => "[&|{\\-!}=]"], |
239 | 40 => ["type" => "class", "value" => "[']", "description" => "[']"], |
240 | 41 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""], |
241 | 42 => ["type" => "class", "value" => "[*#:;]", "description" => "[*#:;]"], |
242 | 43 => ["type" => "literal", "value" => "{{", "description" => "\"{{\""], |
243 | 44 => ["type" => "class", "value" => "[^{}&<\\-!\\['\\r\\n|]", "description" => "[^{}&<\\-!\\['\\r\\n|]"], |
244 | 45 => ["type" => "class", "value" => "[{}&<\\-!\\[]", "description" => "[{}&<\\-!\\[]"], |
245 | 46 => ["type" => "class", "value" => "[^{}&<\\-!\\[\"\\r\\n|]", "description" => "[^{}&<\\-!\\[\"\\r\\n|]"], |
246 | 47 => ["type" => "class", "value" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]", "description" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]"], |
247 | 48 => ["type" => "literal", "value" => "<", "description" => "\"<\""], |
248 | 49 => ["type" => "class", "value" => "[^{}&<\\-|/'>]", "description" => "[^{}&<\\-|/'>]"], |
249 | 50 => ["type" => "class", "value" => "[{}&\\-|/]", "description" => "[{}&\\-|/]"], |
250 | 51 => ["type" => "class", "value" => "[^{}&<\\-|/\">]", "description" => "[^{}&<\\-|/\">]"], |
251 | 52 => ["type" => "class", "value" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]", "description" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]"], |
252 | 53 => ["type" => "literal", "value" => "__", "description" => "\"__\""], |
253 | 54 => ["type" => "class", "value" => "[^-'<[{\\n\\r:;\\]}|!=]", "description" => "[^-'<[{\\n\\r:;\\]}|!=]"], |
254 | 55 => ["type" => "literal", "value" => "-", "description" => "\"-\""], |
255 | 56 => ["type" => "literal", "value" => "''", "description" => "\"''\""], |
256 | 57 => ["type" => "literal", "value" => "}", "description" => "\"}\""], |
257 | 58 => ["type" => "class", "value" => "[ \\t\\n\\r\\0\\x0b]", "description" => "[ \\t\\n\\r\\0\\x0b]"], |
258 | 59 => ["type" => "literal", "value" => "----", "description" => "\"----\""], |
259 | 60 => ["type" => "literal", "value" => "{{{", "description" => "\"{{{\""], |
260 | 61 => ["type" => "literal", "value" => "}}}", "description" => "\"}}}\""], |
261 | 62 => ["type" => "literal", "value" => "}}", "description" => "\"}}\""], |
262 | 63 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""], |
263 | 64 => ["type" => "literal", "value" => ">", "description" => "\">\""], |
264 | 65 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"], |
265 | 66 => ["type" => "literal", "value" => "ISBN", "description" => "\"ISBN\""], |
266 | 67 => ["type" => "class", "value" => "[xX]", "description" => "[xX]"], |
267 | 68 => ["type" => "literal", "value" => "+", "description" => "\"+\""], |
268 | 69 => ["type" => "literal", "value" => "</>", "description" => "\"</>\""], |
269 | 70 => ["type" => "literal", "value" => "#parsoid\x00fragment:", "description" => "\"#parsoid\\u0000fragment:\""], |
270 | 71 => ["type" => "class", "value" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]", "description" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]"], |
271 | 72 => ["type" => "class", "value" => "[!<\\-\\}\\]\\n\\r]", "description" => "[!<\\-\\}\\]\\n\\r]"], |
272 | 73 => ["type" => "literal", "value" => "RFC", "description" => "\"RFC\""], |
273 | 74 => ["type" => "literal", "value" => "PMID", "description" => "\"PMID\""], |
274 | 75 => ["type" => "literal", "value" => "-{", "description" => "\"-{\""], |
275 | 76 => ["type" => "literal", "value" => "}-", "description" => "\"}-\""], |
276 | 77 => ["type" => "literal", "value" => "!", "description" => "\"!\""], |
277 | 78 => ["type" => "class", "value" => "[^\\t\\n\\v />\\0]", "description" => "[^\\t\\n\\v />\\0]"], |
278 | 79 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""], |
279 | 80 => ["type" => "literal", "value" => "||", "description" => "\"||\""], |
280 | 81 => ["type" => "literal", "value" => "{{!}}{{!}}", "description" => "\"{{!}}{{!}}\""], |
281 | 82 => ["type" => "literal", "value" => "=>", "description" => "\"=>\""], |
282 | 83 => ["type" => "class", "value" => "[-+A-Z]", "description" => "[-+A-Z]"], |
283 | 84 => ["type" => "class", "value" => "[^{}|;]", "description" => "[^{}|;]"], |
284 | 85 => ["type" => "class", "value" => "[a-z]", "description" => "[a-z]"], |
285 | 86 => ["type" => "class", "value" => "[-a-zA-Z]", "description" => "[-a-zA-Z]"], |
286 | ]; |
287 | |
288 | // actions |
289 | private function a0() { |
290 | |
291 | $this->startTime = null; |
292 | if ( $this->env->profiling() ) { |
293 | $profile = $this->env->getCurrentProfile(); |
294 | $this->startTime = microtime( true ); |
295 | } |
296 | return true; |
297 | |
298 | } |
299 | private function a1($t) { |
300 | |
301 | if ( $this->env->profiling() ) { |
302 | $profile = $this->env->getCurrentProfile(); |
303 | $profile->bumpTimeUse( |
304 | 'PEG', 1000 * ( microtime( true ) - $this->startTime ), 'PEG' ); |
305 | } |
306 | return true; |
307 | |
308 | } |
309 | private function a2($t) { |
310 | return $t; |
311 | } |
312 | private function a3() { |
313 | |
314 | // "tlb" matches "block" matches "sol" matches "newlineToken" |
315 | // But, "tlb" is prefixed with a !eof clause, so, we should only |
316 | // get here on eof. So, safe to unconditionally terminate the |
317 | // generator loop here. |
318 | return false; |
319 | |
320 | } |
321 | private function a4($t, $n) { |
322 | |
323 | if ( count( $t ) ) { |
324 | $ret = TokenizerUtils::flattenIfArray( $t ); |
325 | } else { |
326 | $ret = []; |
327 | } |
328 | if ( count( $n ) ) { |
329 | PHPUtils::pushArray($ret, $n); |
330 | } |
331 | $ret[] = new EOFTk(); |
332 | return $ret; |
333 | |
334 | } |
335 | private function a5($sc) { |
336 | return $this->endOffset(); |
337 | } |
338 | private function a6($sc, $startPos, $b, $p) { |
339 | $this->unreachable(); |
340 | } |
341 | private function a7($sc, $startPos, $b, $p, $ta) { |
342 | return $this->endOffset(); |
343 | } |
344 | private function a8($sc, $startPos, $b, $p, $ta, $tsEndPos, $s2) { |
345 | |
346 | $coms = TokenizerUtils::popComments( $ta ); |
347 | if ( $coms ) { |
348 | $tsEndPos = $coms['commentStartPos']; |
349 | } |
350 | |
351 | $dp = new DataParsoid; |
352 | $dp->tsr = new SourceRange( $startPos, $tsEndPos ); |
353 | if ( $p !== '|' ) { |
354 | // Variation from default |
355 | $dp->startTagSrc = $b . $p; |
356 | } |
357 | |
358 | return array_merge( $sc, |
359 | [ new TagTk( 'table', $ta, $dp ) ], |
360 | $coms ? $coms['buf'] : [], |
361 | $s2 ); |
362 | |
363 | } |
364 | private function a9($proto, $addr, $he) { |
365 | return $he; |
366 | } |
367 | private function a10($proto, $addr, $r) { |
368 | return $r; |
369 | } |
370 | private function a11($proto, $addr, $c) { |
371 | return $c; |
372 | } |
373 | private function a12($proto, $addr, $path) { |
374 | return $addr !== '' || count( $path ) > 0; |
375 | } |
376 | private function a13($proto, $addr, $path) { |
377 | |
378 | return TokenizerUtils::flattenString( array_merge( [ $proto, $addr ], $path ) ); |
379 | |
380 | } |
381 | private function a14($as, $s, $p) { |
382 | |
383 | return [ $as, $s, $p ]; |
384 | |
385 | } |
386 | private function a15($b) { |
387 | return $b; |
388 | } |
389 | private function a16($r) { |
390 | return TokenizerUtils::flattenIfArray( $r ); |
391 | } |
392 | private function a17() { |
393 | return $this->endOffset(); |
394 | } |
395 | private function a18($p0, $addr, $target) { |
396 | return TokenizerUtils::flattenString( [ $addr, $target ] ); |
397 | } |
398 | private function a19($p0, $flat) { |
399 | |
400 | // Protocol must be valid and there ought to be at least one |
401 | // post-protocol character. So strip last char off target |
402 | // before testing protocol. |
403 | if ( is_array( $flat ) ) { |
404 | // There are templates present, alas. |
405 | return count( $flat ) > 0; |
406 | } |
407 | return Utils::isProtocolValid( substr( $flat, 0, -1 ), $this->env ); |
408 | |
409 | } |
410 | private function a20($p0, $flat) { |
411 | return $this->endOffset(); |
412 | } |
413 | private function a21($p0, $flat, $p1, $sp) { |
414 | return $this->endOffset(); |
415 | } |
416 | private function a22($p0, $flat, $p1, $sp, $p2, $content) { |
417 | return $this->endOffset(); |
418 | } |
419 | private function a23($p0, $flat, $p1, $sp, $p2, $content, $p3) { |
420 | |
421 | $tsr1 = new SourceRange( $p0, $p1 ); |
422 | $tsr2 = new SourceRange( $p2, $p3 ); |
423 | $dp = new DataParsoid; |
424 | $dp->tsr = $this->tsrOffsets(); |
425 | $dp->getTemp()->extLinkContentOffsets = $tsr2; |
426 | return [ |
427 | new SelfclosingTagTk( |
428 | 'extlink', |
429 | [ |
430 | new KV( 'href', $flat, $tsr1->expandTsrV() ), |
431 | new KV( 'mw:content', $content ?? '', $tsr2->expandTsrV() ), |
432 | new KV( 'spaces', $sp ) |
433 | ], |
434 | $dp |
435 | ) |
436 | ]; |
437 | } |
438 | private function a24($r) { |
439 | return $r; |
440 | } |
441 | private function a25($b) { |
442 | |
443 | // Clear the tokenizer's backtracking cache after matching each |
444 | // toplevelblock. There won't be any backtracking as a document is just a |
445 | // sequence of toplevelblocks, so the cache for previous toplevelblocks |
446 | // will never be needed. |
447 | $end = $this->startOffset(); |
448 | for ( ; $this->prevOffset < $end; $this->prevOffset++ ) { |
449 | unset( $this->cache[$this->prevOffset] ); |
450 | } |
451 | |
452 | $tokens = null; |
453 | if ( is_array( $b ) && count( $b ) ) { |
454 | $tokens = TokenizerUtils::flattenIfArray( $b ); |
455 | } elseif ( is_string( $b ) ) { |
456 | $tokens = [ $b ]; |
457 | } |
458 | |
459 | // Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline. |
460 | return $this->emitChunk( $tokens ); |
461 | |
462 | } |
463 | private function a26() { |
464 | return [ new NlTk( $this->tsrOffsets() ) ]; |
465 | } |
466 | private function a27($c, $cEnd) { |
467 | |
468 | $data = WTUtils::encodeComment( $c ); |
469 | $dp = new DataParsoid; |
470 | $dp->tsr = $this->tsrOffsets(); |
471 | if ( $cEnd !== '-->' ) { |
472 | $dp->unclosedComment = true; |
473 | } |
474 | return [ new CommentTk( $data, $dp ) ]; |
475 | |
476 | } |
477 | private function a28($p) { |
478 | return Utils::isProtocolValid( $p, $this->env ); |
479 | } |
480 | private function a29($p) { |
481 | return $p; |
482 | } |
483 | private function a30($annOrExtTag, $h, $extlink, $intemplate, &$preproc, $equal, $table, $templateArg, $tableCellArg, $semicolon, $arrow, $linkdesc, $colon, &$th) { |
484 | |
485 | return TokenizerUtils::inlineBreaks( $this->input, $this->endOffset(), [ |
486 | 'annOrExtTag' => $annOrExtTag, |
487 | 'h' => $h, |
488 | 'extlink' => $extlink, |
489 | 'intemplate' => $intemplate, |
490 | 'preproc' => $preproc, |
491 | 'equal' => $equal, |
492 | 'table' => $table, |
493 | 'templateArg' => $templateArg, |
494 | 'tableCellArg' => $tableCellArg, |
495 | 'semicolon' => $semicolon, |
496 | 'arrow' => $arrow, |
497 | 'linkdesc' => $linkdesc, |
498 | 'colon' => $colon, |
499 | 'th' => $th |
500 | ], $this->env ); |
501 | |
502 | } |
503 | private function a31($t) { |
504 | |
505 | return $t; |
506 | |
507 | } |
508 | private function a32($cc) { |
509 | |
510 | // if this is an invalid entity, don't tag it with 'mw:Entity' |
511 | // note that some entities (like ∾̳) decode to 2 codepoints! |
512 | if ( mb_strlen( $cc ) > 2 /* decoded entity would be 1-2 codepoints */ ) { |
513 | return $cc; |
514 | } |
515 | $dpStart = new DataParsoid; |
516 | $dpStart->src = $this->text(); |
517 | $dpStart->srcContent = $cc; |
518 | $dpStart->tsr = $this->tsrOffsets( 'start' ); |
519 | $dpEnd = new DataParsoid; |
520 | $dpEnd->tsr = $this->tsrOffsets( 'end' ); |
521 | return [ |
522 | // If this changes, the nowiki extension's toDOM will need to follow suit |
523 | new TagTk( 'span', [ new KV( 'typeof', 'mw:Entity' ) ], $dpStart ), |
524 | $cc, |
525 | new EndTagTk( 'span', [], $dpEnd ) |
526 | ]; |
527 | |
528 | } |
529 | private function a33($s) { |
530 | return $this->endOffset(); |
531 | } |
532 | private function a34($s, $namePos0, $name) { |
533 | return $this->endOffset(); |
534 | } |
535 | private function a35($s, $namePos0, $name, $namePos1, $v) { |
536 | return $v; |
537 | } |
538 | private function a36($s, $namePos0, $name, $namePos1, $vd) { |
539 | |
540 | // NB: Keep in sync w/ generic_newline_attribute |
541 | $res = null; |
542 | // Encapsulate protected attributes. |
543 | if ( gettype( $name ) === 'string' ) { |
544 | $name = TokenizerUtils::protectAttrs( $name ); |
545 | } |
546 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
547 | if ( $vd !== null ) { |
548 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
549 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
550 | } else { |
551 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
552 | } |
553 | if ( is_array( $name ) ) { |
554 | $res->ksrc = $nameSO->substr( $this->input ); |
555 | } |
556 | return $res; |
557 | |
558 | } |
559 | private function a37($s) { |
560 | |
561 | if ( $s !== '' ) { |
562 | return [ $s ]; |
563 | } else { |
564 | return []; |
565 | } |
566 | |
567 | } |
568 | private function a38($c) { |
569 | return new KV( $c, '' ); |
570 | } |
571 | private function a39($namePos0, $name) { |
572 | return $this->endOffset(); |
573 | } |
574 | private function a40($namePos0, $name, $namePos1, $v) { |
575 | return $v; |
576 | } |
577 | private function a41($namePos0, $name, $namePos1, $vd) { |
578 | |
579 | // NB: Keep in sync w/ table_attibute |
580 | $res = null; |
581 | // Encapsulate protected attributes. |
582 | if ( is_string( $name ) ) { |
583 | $name = TokenizerUtils::protectAttrs( $name ); |
584 | } |
585 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
586 | if ( $vd !== null ) { |
587 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
588 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
589 | } else { |
590 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
591 | } |
592 | if ( is_array( $name ) ) { |
593 | $res->ksrc = $nameSO->substr( $this->input ); |
594 | } |
595 | return $res; |
596 | |
597 | } |
598 | private function a42($s) { |
599 | return $s; |
600 | } |
601 | private function a43($c) { |
602 | |
603 | return TokenizerUtils::flattenStringlist( $c ); |
604 | |
605 | } |
606 | private function a44($lc) { |
607 | return $lc; |
608 | } |
609 | private function a45($bullets, $colons, $d) { |
610 | |
611 | $bulletToks = []; |
612 | // Leave bullets as an array -- list handler expects this |
613 | // TSR: +1 for the leading ";" |
614 | $numBullets = count( $bullets ) + 1; |
615 | $tsr = $this->tsrOffsets( 'start' ); |
616 | $tsr->end += $numBullets; |
617 | $li1Bullets = $bullets; |
618 | $li1Bullets[] = ';'; |
619 | $dp = new DataParsoid; |
620 | $dp->tsr = $tsr; |
621 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li1Bullets, $tsr->expandTsrV() ) ], $dp ); |
622 | foreach ( $colons as $colon) { |
623 | if ( $colon[0] ) { // can be null because of "?" in dtdd_colon |
624 | $bulletToks[] = $colon[0]; |
625 | } |
626 | $cpos = $colon[1]; |
627 | // TSR: -1 for the intermediate ":" |
628 | $li2Bullets = $bullets; |
629 | $li2Bullets[] = ':'; |
630 | $tsr2 = new SourceRange( $cpos - 1, $cpos ); |
631 | $dp2 = new DataParsoid; |
632 | $dp2->tsr = $tsr2; |
633 | $dp2->stx = 'row'; |
634 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li2Bullets, $tsr2->expandTsrV() ) ], $dp2 ); |
635 | } |
636 | |
637 | if ( $d ) { |
638 | $bulletToks = array_merge( $bulletToks, $d ); |
639 | } |
640 | return $bulletToks; |
641 | |
642 | } |
643 | private function a46($bullets, $tbl, $line) { |
644 | |
645 | // Leave bullets as an array -- list handler expects this |
646 | $tsr = $this->tsrOffsets( 'start' ); |
647 | $tsr->end += count( $bullets ); |
648 | $dp = new DataParsoid; |
649 | $dp->tsr = $tsr; |
650 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
651 | return TokenizerUtils::flattenIfArray( [ $li, $tbl, $line ?: [] ] ); |
652 | |
653 | } |
654 | private function a47($bullets, $c) { |
655 | |
656 | // Leave bullets as an array -- list handler expects this |
657 | $tsr = $this->tsrOffsets( 'start' ); |
658 | $tsr->end += count( $bullets ); |
659 | $dp = new DataParsoid; |
660 | $dp->tsr = $tsr; |
661 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
662 | return array_merge( [ $li ], $c ?: [] ); |
663 | |
664 | } |
665 | private function a48() { |
666 | return $this->endOffset() === $this->inputLength; |
667 | } |
668 | private function a49($r, $cil, $bl) { |
669 | |
670 | return array_merge( [ $r ], $cil, $bl ?: [] ); |
671 | |
672 | } |
673 | private function a50($a) { |
674 | return $a; |
675 | } |
676 | private function a51($a, $b) { |
677 | return [ $a, $b ]; |
678 | } |
679 | private function a52($m) { |
680 | |
681 | return Utils::decodeWtEntities( $m ); |
682 | |
683 | } |
684 | private function a53($q, $x, $ill) { |
685 | return array_merge( [$x], $ill ?: [] ); |
686 | } |
687 | private function a54($q, $t) { |
688 | return $t; |
689 | } |
690 | private function a55($q, $r) { |
691 | return count( $r ) > 0 || $q !== ''; |
692 | } |
693 | private function a56($q, $r) { |
694 | |
695 | array_unshift( $r, $q ); |
696 | return TokenizerUtils::flattenString( $r ); |
697 | |
698 | } |
699 | private function a57($s, $t, $q) { |
700 | |
701 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() - strlen( $q ) ); |
702 | |
703 | } |
704 | private function a58($s, $t) { |
705 | |
706 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() ); |
707 | |
708 | } |
709 | private function a59($r) { |
710 | |
711 | return TokenizerUtils::flattenString( $r ); |
712 | |
713 | } |
714 | private function a60() { |
715 | |
716 | if ( preg_match( $this->reUrltextLookahead, $this->input, $m, 0, $this->currPos ) ) { |
717 | $plain = $m[1]; |
718 | $this->urltextPlainSegment = $plain; |
719 | $this->urltextFoundAutolink = ( $m[2] ?? '' ) !== ''; |
720 | return (bool)strlen( $plain ); |
721 | } else { |
722 | $this->urltextFoundAutolink = false; |
723 | return false; |
724 | } |
725 | |
726 | } |
727 | private function a61() { |
728 | |
729 | $this->currPos += strlen( $this->urltextPlainSegment ); |
730 | return $this->urltextPlainSegment; |
731 | |
732 | } |
733 | private function a62() { |
734 | return $this->urltextFoundAutolink; |
735 | } |
736 | private function a63($al) { |
737 | return $al; |
738 | } |
739 | private function a64($he) { |
740 | return $he; |
741 | } |
742 | private function a65($bs) { |
743 | return $bs; |
744 | } |
745 | private function a66($c) { |
746 | return $this->endOffset(); |
747 | } |
748 | private function a67($c, $cpos) { |
749 | |
750 | return [ $c, $cpos ]; |
751 | |
752 | } |
753 | private function a68($tl) { |
754 | |
755 | return $tl; |
756 | |
757 | } |
758 | private function a69($sp, $elc, $st) { |
759 | |
760 | return [ $sp, $elc ?? [], $st ]; |
761 | |
762 | } |
763 | private function a70() { |
764 | return $this->endOffset() === 0 && !$this->pipelineOffset; |
765 | } |
766 | private function a71($rw, $sp, $c, $wl) { |
767 | |
768 | return count( $wl ) === 1 && $wl[0] instanceof Token; |
769 | |
770 | } |
771 | private function a72($rw, $sp, $c, $wl) { |
772 | |
773 | $link = $wl[0]; |
774 | if ( $sp ) { |
775 | $rw .= $sp; |
776 | } |
777 | if ( $c ) { |
778 | $rw .= $c; |
779 | } |
780 | // Build a redirect token |
781 | $dp = new DataParsoid; |
782 | $dp->src = $rw; |
783 | $dp->tsr = $this->tsrOffsets(); |
784 | $dp->linkTk = $link; |
785 | $redirect = new SelfclosingTagTk( 'mw:redirect', |
786 | // Put 'href' into attributes so it gets template-expanded |
787 | [ $link->getAttributeKV( 'href' ) ], |
788 | $dp |
789 | ); |
790 | return $redirect; |
791 | |
792 | } |
793 | private function a73($st, $tl) { |
794 | |
795 | return array_merge( $st, $tl ); |
796 | |
797 | } |
798 | private function a74($s, $os, $so) { |
799 | return array_merge( $os, $so ); |
800 | } |
801 | private function a75($s, $s2, $bl) { |
802 | |
803 | return array_merge( $s, $s2 ?: [], $bl ); |
804 | |
805 | } |
806 | private function a76(&$preproc, $t) { |
807 | |
808 | $preproc = null; |
809 | return $t; |
810 | |
811 | } |
812 | private function a77($v) { |
813 | return $v; |
814 | } |
815 | private function a78($e) { |
816 | return $e; |
817 | } |
818 | private function a79() { |
819 | return Utils::isUniWord(Utils::lastUniChar( $this->input, $this->endOffset() ) ); |
820 | } |
821 | private function a80($bs) { |
822 | |
823 | if ( $this->siteConfig->isBehaviorSwitch( $bs ) ) { |
824 | $dp = new DataParsoid; |
825 | $dp->tsr = $this->tsrOffsets(); |
826 | $dp->src = $bs; |
827 | $dp->magicSrc = $bs; |
828 | return [ |
829 | new SelfclosingTagTk( 'behavior-switch', [ new KV( 'word', $bs ) ], $dp ) |
830 | ]; |
831 | } else { |
832 | return [ $bs ]; |
833 | } |
834 | |
835 | } |
836 | private function a81($quotes) { |
837 | |
838 | // sequences of four or more than five quotes are assumed to start |
839 | // with some number of plain-text apostrophes. |
840 | $plainticks = 0; |
841 | $result = []; |
842 | if ( strlen( $quotes ) === 4 ) { |
843 | $plainticks = 1; |
844 | } elseif ( strlen( $quotes ) > 5 ) { |
845 | $plainticks = strlen( $quotes ) - 5; |
846 | } |
847 | if ( $plainticks > 0 ) { |
848 | $result[] = substr( $quotes, 0, $plainticks ); |
849 | } |
850 | // mw-quote token will be consumed in token transforms |
851 | $tsr = $this->tsrOffsets(); |
852 | $tsr->start += $plainticks; |
853 | $dp = new DataParsoid; |
854 | $dp->tsr = $tsr; |
855 | $mwq = new SelfclosingTagTk( 'mw-quote', |
856 | [ new KV( 'value', substr( $quotes, $plainticks ) ) ], |
857 | $dp ); |
858 | if ( strlen( $quotes ) > 2 ) { |
859 | $mwq->addAttribute( 'isSpace_1', $tsr->start > 0 && substr( $this->input, $tsr->start - 1, 1 ) === ' '); |
860 | $mwq->addAttribute( 'isSpace_2', $tsr->start > 1 && substr( $this->input, $tsr->start - 2, 1 ) === ' '); |
861 | } |
862 | $result[] = $mwq; |
863 | return $result; |
864 | |
865 | } |
866 | private function a82($sc, $startPos, $p, $b) { |
867 | |
868 | $dp = new DataParsoid; |
869 | $dp->tsr = new SourceRange( $startPos, $this->endOffset() ); |
870 | $tblEnd = new EndTagTk( 'table', [], $dp ); |
871 | if ( $p !== '|' ) { |
872 | // p+"<brace-char>" is triggering some bug in pegJS |
873 | // I cannot even use that expression in the comment! |
874 | $tblEnd->dataParsoid->endTagSrc = $p . $b; |
875 | } |
876 | array_push( $sc, $tblEnd ); |
877 | return $sc; |
878 | |
879 | } |
880 | private function a83() { |
881 | |
882 | // Use the sol flag only at the start of the input |
883 | // Flag should always be an actual boolean (not falsy or undefined) |
884 | $this->assert( is_bool( $this->options['sol'] ), 'sol should be boolean' ); |
885 | return $this->endOffset() === 0 && $this->options['sol']; |
886 | |
887 | } |
888 | private function a84() { |
889 | |
890 | return []; |
891 | |
892 | } |
893 | private function a85($p, $c) { |
894 | |
895 | $dp = new DataParsoid; |
896 | $dp->tsr = new SourceRange( $p, $this->endOffset() ); |
897 | $dp->tokens = TokenizerUtils::flattenIfArray( $c ); |
898 | return [ |
899 | new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:EmptyLine' ) ], $dp ) |
900 | ]; |
901 | |
902 | } |
903 | private function a86($rw) { |
904 | |
905 | return preg_match( $this->env->getSiteConfig()->getMagicWordMatcher( 'redirect' ), $rw ); |
906 | |
907 | } |
908 | private function a87($t) { |
909 | |
910 | $tagName = mb_strtolower( $t->getName() ); |
911 | switch ( $tagName ) { |
912 | case 'includeonly': |
913 | $typeOf = 'mw:Includes/IncludeOnly'; |
914 | break; |
915 | case 'noinclude': |
916 | $typeOf = 'mw:Includes/NoInclude'; |
917 | break; |
918 | case 'onlyinclude': |
919 | $typeOf = 'mw:Includes/OnlyInclude'; |
920 | break; |
921 | default: |
922 | $this->unreachable(); |
923 | } |
924 | |
925 | $isEnd = ( $t instanceof EndTagTk ); |
926 | if ( $isEnd ) { |
927 | $typeOf .= '/End'; |
928 | } |
929 | |
930 | $dp = new DataParsoid; |
931 | $dp->tsr = $t->dataParsoid->tsr; |
932 | $dp->src = $dp->tsr->substr( $this->input ); |
933 | |
934 | $meta = new SelfclosingTagTk( |
935 | 'meta', [ new KV( 'typeof', $typeOf ) ], $dp |
936 | ); |
937 | |
938 | $startTagWithContent = false; |
939 | if ( $t instanceof TagTk ) { |
940 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
941 | $startTagWithContent = preg_match( |
942 | $endTagRE, $this->input, $content, 0, $dp->tsr->start |
943 | ); |
944 | } |
945 | |
946 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
947 | switch ( $tagName ) { |
948 | case 'includeonly': |
949 | // Drop the tag |
950 | return []; |
951 | case 'noinclude': |
952 | if ( $startTagWithContent ) { |
953 | // Skip the content |
954 | $this->currPos = $dp->tsr->start + strlen( $content[0] ); |
955 | } |
956 | // Drop it all |
957 | return []; |
958 | case 'onlyinclude': |
959 | if ( $startTagWithContent ) { |
960 | // Parse the content, strip eof, and shift tsr |
961 | $contentSrc = $content[0]; |
962 | $endOffset = $dp->tsr->start + strlen( $contentSrc ); |
963 | $endTagWidth = strlen( $content[1] ); |
964 | $tagOffsets = new DomSourceRange( |
965 | $dp->tsr->start, $endOffset, |
966 | $dp->tsr->length(), $endTagWidth |
967 | ); |
968 | $this->currPos = $tagOffsets->innerEnd(); |
969 | $justContent = $tagOffsets->stripTags( $contentSrc ); |
970 | // FIXME: What about the pipelineOpts of the current pipeline? |
971 | $tokenizer = new PegTokenizer( $this->env ); |
972 | $tokenizer->setSourceOffsets( $tagOffsets->innerRange() ); |
973 | $contentToks = $tokenizer->tokenizeSync( |
974 | $justContent, [ 'sol' => true ] |
975 | ); |
976 | TokenUtils::stripEOFTkFromTokens( $contentToks ); |
977 | array_unshift( $contentToks, $t ); |
978 | return $contentToks; |
979 | } else { |
980 | return [$t]; |
981 | } |
982 | } |
983 | } else { |
984 | $tokens = [ $meta ]; |
985 | if ( $tagName === 'includeonly' ) { |
986 | if ( $startTagWithContent ) { |
987 | // Add the content / end tag to the meta for roundtripping |
988 | $dp->tsr->end = $dp->tsr->start + strlen( $content[0] ); |
989 | $dp->src = $dp->tsr->substr( $this->input ); |
990 | $meta->dataMw = new DataMw( [ 'src' => $dp->src ] ); |
991 | $this->currPos = $dp->tsr->end; |
992 | // FIXME: We shouldn't bother with this because SelfclosingTk |
993 | // was never balanced to begin with |
994 | if ( strlen( $content[1] ) ) { |
995 | $eDp = new DataParsoid; |
996 | $eDp->tsr = new SourceRange( $dp->tsr->end, $dp->tsr->end ); |
997 | $eDp->src = $eDp->tsr->substr( $this->input ); |
998 | $tokens[] = new SelfclosingTagTk( 'meta', [ |
999 | new KV( 'typeof', 'mw:Includes/IncludeOnly/End' ) |
1000 | ], $eDp ); |
1001 | } |
1002 | } elseif ( !( $t instanceof EndTagTk ) ) { |
1003 | $meta->dataMw = new DataMw( [ 'src' => $dp->src ] ); |
1004 | } else { |
1005 | // Compatibility with the legacy parser which leaves these in |
1006 | // as strings, which the sanitizer will do for us |
1007 | array_pop( $tokens ); |
1008 | $tokens[] = $t; |
1009 | } |
1010 | } |
1011 | return $tokens; |
1012 | } |
1013 | |
1014 | } |
1015 | private function a88($t) { |
1016 | |
1017 | $end = ( $t instanceof EndTagTk ); |
1018 | $attribs = $t->attribs; |
1019 | $tagName = mb_strtolower( $t->getName() ); |
1020 | $tsr = $t->dataParsoid->tsr; |
1021 | |
1022 | // We already applied this logic in WTUtils::isAnnotationTag |
1023 | // to get here so we can make some assumptions. |
1024 | if ( !$this->siteConfig->isAnnotationTag( $tagName ) ) { |
1025 | $pipepos = strpos( $tagName, '|' ); |
1026 | $strBeforePipe = substr( $tagName, 0, $pipepos ); |
1027 | $newName = substr( $tagName, $pipepos + 1, strlen( $tagName ) - $pipepos - 1 ); |
1028 | $attribs = [ new KV( "name", $newName ) ]; |
1029 | $tagName = $strBeforePipe; |
1030 | } |
1031 | |
1032 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/' . $tagName . ( $end ? '/End' : '' ) ) ]; |
1033 | $datamw = null; |
1034 | if ( count( $attribs ) > 0 ) { |
1035 | $attrMap = []; |
1036 | foreach ( $attribs as $attr ) { |
1037 | // If the key or the value is not a string, |
1038 | // we replace it by the thing that generated it and |
1039 | // consider that wikitext as a raw string instead. |
1040 | $k = is_string( $attr->k ) ? $attr->k : $attr->ksrc; |
1041 | $v = is_string( $attr->v ) ? $attr->v : $attr->vsrc; |
1042 | $attrMap[$k] = $v; |
1043 | } |
1044 | // Possible follow-up in T295168 for attribute sanitation |
1045 | // T367616: 'attrs' should be renamed to 'extAttrs' |
1046 | $datamw = new DataMw( [ 'attrs' => (object)$attrMap ] ); |
1047 | } |
1048 | $dp = new DataParsoid(); |
1049 | $dp->tsr = $tsr; |
1050 | $this->env->hasAnnotations = true; |
1051 | |
1052 | return new SelfclosingTagTk ( 'meta', $metaAttrs, $dp, $datamw ); |
1053 | |
1054 | } |
1055 | private function a89($tag) { |
1056 | |
1057 | // FIXME: Suppress annotation meta tokens from template pipelines |
1058 | // since they may not have TSR values and won't get recognized as |
1059 | // annotation ranges. Without TSR, they might end up stuck in |
1060 | // fosterable positions and cause havoc on edits by breaking selser. |
1061 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
1062 | return $tag; |
1063 | } else { |
1064 | return ''; |
1065 | } |
1066 | |
1067 | } |
1068 | private function a90($s, $ill) { |
1069 | return $ill ?: []; |
1070 | } |
1071 | private function a91($s, $ce) { |
1072 | return $ce || strlen( $s ) > 2; |
1073 | } |
1074 | private function a92($s, $ce) { |
1075 | return $this->endOffset(); |
1076 | } |
1077 | private function a93($s, $ce, $endTPos, $spc) { |
1078 | |
1079 | $c = null; |
1080 | $e = null; |
1081 | $level = null; |
1082 | if ( $ce ) { |
1083 | $c = $ce[0]; |
1084 | $e = $ce[1]; |
1085 | $level = min( strlen( $s ), strlen( $e ) ); |
1086 | } else { |
1087 | // split up equal signs into two equal parts, with at least |
1088 | // one character in the middle. |
1089 | $level = (int)floor( ( strlen( $s ) - 1 ) / 2 ); |
1090 | $c = [ str_repeat( '=', strlen( $s ) - 2 * $level ) ]; |
1091 | $s = $e = str_repeat( '=', $level ); |
1092 | } |
1093 | $level = min( 6, $level ); |
1094 | // convert surplus equals into text |
1095 | if ( strlen( $s ) > $level ) { |
1096 | $extras1 = substr( $s, 0, strlen( $s ) - $level ); |
1097 | if ( is_string( $c[0] ) ) { |
1098 | $c[0] = $extras1 . $c[0]; |
1099 | } else { |
1100 | array_unshift( $c, $extras1 ); |
1101 | } |
1102 | } |
1103 | if ( strlen( $e ) > $level ) { |
1104 | $extras2 = substr( $e, 0, strlen( $e ) - $level ); |
1105 | $lastElem = PHPUtils::lastItem( $c ); |
1106 | if ( is_string( $lastElem ) ) { |
1107 | $c[count( $c ) - 1] .= $extras2; |
1108 | } else { |
1109 | $c[] = $extras2; |
1110 | } |
1111 | } |
1112 | |
1113 | $tagDP = new DataParsoid; |
1114 | $tagDP->tsr = $this->tsrOffsets( 'start' ); |
1115 | $tagDP->tsr->end += $level; |
1116 | // Match the old parser's behavior by |
1117 | // (a) making headingIndex part of tokenizer state |
1118 | // (don't reuse pipeline! see $this->resetState above) |
1119 | // (b) assigning the index when ==*== is tokenized, |
1120 | // even if we're inside a template argument |
1121 | // or other context which won't end up putting the heading |
1122 | // on the output page. T213468/T214538 |
1123 | $this->headingIndex++; |
1124 | $tagDP->getTemp()->headingIndex = $this->headingIndex; |
1125 | $res = [ new TagTk( 'h' . $level, [], $tagDP ) ]; |
1126 | |
1127 | PHPUtils::pushArray( $res, $c ); |
1128 | |
1129 | $endTagDP = new DataParsoid; |
1130 | $endTagDP->tsr = new SourceRange( $endTPos - $level, $endTPos ); |
1131 | $res[] = new EndTagTk( 'h' . $level, [], $endTagDP ); |
1132 | $res[] = $spc; |
1133 | return $res; |
1134 | |
1135 | } |
1136 | private function a94($d) { |
1137 | return null; |
1138 | } |
1139 | private function a95($d) { |
1140 | return true; |
1141 | } |
1142 | private function a96($d, $lineContent) { |
1143 | |
1144 | $dataParsoid = new DataParsoid; |
1145 | $dataParsoid->tsr = $this->tsrOffsets(); |
1146 | if ( $lineContent !== null ) { |
1147 | $dataParsoid->lineContent = $lineContent; |
1148 | } |
1149 | if ( strlen( $d ) > 0 ) { |
1150 | $dataParsoid->extra_dashes = strlen( $d ); |
1151 | } |
1152 | return [new SelfclosingTagTk( 'hr', [], $dataParsoid )]; |
1153 | |
1154 | } |
1155 | private function a97($p, $target) { |
1156 | return $this->endOffset(); |
1157 | } |
1158 | private function a98($p, $target, $p0, $v) { |
1159 | return $this->endOffset(); |
1160 | } |
1161 | private function a99($p, $target, $p0, $v, $p1) { |
1162 | |
1163 | // empty argument |
1164 | return [ 'tokens' => $v, 'srcOffsets' => new SourceRange( $p0, $p1 ) ]; |
1165 | |
1166 | } |
1167 | private function a100($p, $target, $r) { |
1168 | return $r; |
1169 | } |
1170 | private function a101($p, $target, $params) { |
1171 | |
1172 | $kvs = []; |
1173 | |
1174 | if ( $target === null ) { |
1175 | $target = [ 'tokens' => '', 'srcOffsets' => new SourceRange( $p, $p ) ]; |
1176 | } |
1177 | // Insert target as first positional attribute, so that it can be |
1178 | // generically expanded. The TemplateHandler then needs to shift it out |
1179 | // again. |
1180 | $kvs[] = new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ); |
1181 | |
1182 | foreach ( $params as $o ) { |
1183 | $s = $o['srcOffsets']; |
1184 | $kvs[] = new KV( '', TokenizerUtils::flattenIfArray( $o['tokens'] ), $s->expandTsrV() ); |
1185 | } |
1186 | |
1187 | $dp = new DataParsoid; |
1188 | $dp->tsr = $this->tsrOffsets(); |
1189 | $dp->src = $this->text(); |
1190 | $obj = new SelfclosingTagTk( 'templatearg', $kvs, $dp ); |
1191 | return $obj; |
1192 | |
1193 | } |
1194 | private function a102($leadWS, $target) { |
1195 | return $this->endOffset(); |
1196 | } |
1197 | private function a103($leadWS, $target, $p0, $v) { |
1198 | return $this->endOffset(); |
1199 | } |
1200 | private function a104($leadWS, $target, $p0, $v, $p1) { |
1201 | |
1202 | // empty argument |
1203 | $tsr0 = new SourceRange( $p0, $p1 ); |
1204 | return new KV( '', TokenizerUtils::flattenIfArray( $v ), $tsr0->expandTsrV() ); |
1205 | |
1206 | } |
1207 | private function a105($leadWS, $target, $r) { |
1208 | return $r; |
1209 | } |
1210 | private function a106($leadWS, $target, $params, $trailWS) { |
1211 | |
1212 | // Insert target as first positional attribute, so that it can be |
1213 | // generically expanded. The TemplateHandler then needs to shift it out |
1214 | // again. |
1215 | array_unshift( $params, new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ) ); |
1216 | $dp = new DataParsoid; |
1217 | $dp->tsr = $this->tsrOffsets(); |
1218 | $dp->src = $this->text(); |
1219 | $tmp = $dp->getTemp(); |
1220 | $tmp->leadWS = $leadWS; |
1221 | $tmp->trailWS = $trailWS; |
1222 | $obj = new SelfclosingTagTk( 'template', $params, $dp ); |
1223 | return $obj; |
1224 | |
1225 | } |
1226 | private function a107($spos, $target) { |
1227 | return $this->endOffset(); |
1228 | } |
1229 | private function a108($spos, $target, $tpos, $lcs) { |
1230 | |
1231 | $pipeTrick = count( $lcs ) === 1 && count( $lcs[0]->v ) === 0; |
1232 | $textTokens = []; |
1233 | if ( $target === null || $pipeTrick ) { |
1234 | $textTokens[] = '[['; |
1235 | if ( $target ) { |
1236 | $textTokens[] = $target; |
1237 | } |
1238 | foreach ( $lcs as $a ) { |
1239 | // a is a mw:maybeContent attribute |
1240 | $textTokens[] = '|'; |
1241 | if ( count( $a->v ) > 0 ) { |
1242 | $textTokens[] = $a->v; |
1243 | } |
1244 | } |
1245 | $textTokens[] = ']]'; |
1246 | return $textTokens; |
1247 | } |
1248 | $obj = new SelfclosingTagTk( 'wikilink' ); |
1249 | $tsr = new SourceRange( $spos, $tpos ); |
1250 | $hrefKV = new KV( 'href', $target, $tsr->expandTsrV() ); |
1251 | $hrefKV->vsrc = $tsr->substr( $this->input ); |
1252 | // XXX: Point to object with path, revision and input information |
1253 | // obj.source = input; |
1254 | $obj->attribs[] = $hrefKV; |
1255 | $obj->attribs = array_merge( $obj->attribs, $lcs ); |
1256 | $dp = new DataParsoid; |
1257 | $dp->tsr = $this->tsrOffsets(); |
1258 | $dp->src = $this->text(); |
1259 | $obj->dataParsoid = $dp; |
1260 | return [ $obj ]; |
1261 | |
1262 | } |
1263 | private function a109(&$preproc) { |
1264 | $preproc = null; return true; |
1265 | } |
1266 | private function a110(&$preproc, $a) { |
1267 | |
1268 | return $a; |
1269 | |
1270 | } |
1271 | private function a111($extToken) { |
1272 | return $extToken->getName() === 'extension'; |
1273 | } |
1274 | private function a112($extToken) { |
1275 | return $extToken; |
1276 | } |
1277 | private function a113($annOrExtTag, $start) { |
1278 | |
1279 | // Only enforce ascii alpha first char for non-extension tags. |
1280 | // See tag_name above for the details. |
1281 | list(,$name) = $start; |
1282 | return $annOrExtTag || |
1283 | ( preg_match( '/^[A-Za-z]/', $name ) && $this->isXMLTag( $name ) ); |
1284 | |
1285 | } |
1286 | private function a114($annOrExtTag, $start, $attribs, $selfclose) { |
1287 | |
1288 | list($end, $name) = $start; |
1289 | $lcName = mb_strtolower( $name ); |
1290 | |
1291 | // Extension tags don't necessarily have the same semantics as html tags, |
1292 | // so don't treat them as void elements. |
1293 | $isVoidElt = Utils::isVoidElement( $lcName ) && !$annOrExtTag; |
1294 | |
1295 | // Support </br> |
1296 | if ( $lcName === 'br' && $end ) { |
1297 | $end = null; |
1298 | } |
1299 | |
1300 | $tsr = $this->tsrOffsets(); |
1301 | $res = TokenizerUtils::buildXMLTag( |
1302 | $name, $lcName, $attribs, $end, !!$selfclose || $isVoidElt, $tsr |
1303 | ); |
1304 | |
1305 | // change up data-attribs in one scenario |
1306 | // void-elts that aren't self-closed ==> useful for accurate RT-ing |
1307 | if ( !$selfclose && $isVoidElt ) { |
1308 | unset( $res->dataParsoid->selfClose ); |
1309 | $res->dataParsoid->noClose = true; |
1310 | } |
1311 | |
1312 | return $res; |
1313 | |
1314 | } |
1315 | private function a115($proto, $addr, $rhe) { |
1316 | return $rhe === '<' || $rhe === '>' || $rhe === "\u{A0}"; |
1317 | } |
1318 | private function a116($proto, $addr, $path) { |
1319 | |
1320 | // as in Parser.php::makeFreeExternalLink, we're going to |
1321 | // yank trailing punctuation out of this match. |
1322 | $url = TokenizerUtils::flattenStringlist( array_merge( [ $proto, $addr ], $path ) ); |
1323 | // only need to look at last element; HTML entities are strip-proof. |
1324 | $last = PHPUtils::lastItem( $url ); |
1325 | $trim = 0; |
1326 | if ( is_string( $last ) ) { |
1327 | $strip = TokenizerUtils::getAutoUrlTerminatingChars( in_array( '(', $path, true ) ); |
1328 | $trim = strspn( strrev( $last ), $strip ); |
1329 | $url[ count( $url ) - 1 ] = substr( $last, 0, strlen( $last ) - $trim ); |
1330 | } |
1331 | $url = TokenizerUtils::flattenStringlist( $url ); |
1332 | if ( count( $url ) === 1 && is_string( $url[0] ) && strlen( $url[0] ) <= strlen( $proto ) ) { |
1333 | return null; // ensure we haven't stripped everything: T106945 |
1334 | } |
1335 | $this->currPos -= $trim; |
1336 | return $url; |
1337 | |
1338 | } |
1339 | private function a117($r) { |
1340 | return $r !== null; |
1341 | } |
1342 | private function a118($r) { |
1343 | |
1344 | $tsr = $this->tsrOffsets(); |
1345 | $dp = new DataParsoid; |
1346 | $dp->tsr = $tsr; |
1347 | $res = [ new SelfclosingTagTk( 'urllink', [ new KV( 'href', $r, $tsr->expandTsrV() ) ], $dp ) ]; |
1348 | return $res; |
1349 | |
1350 | } |
1351 | private function a119($ref, $sp, $identifier) { |
1352 | |
1353 | $base_urls = [ |
1354 | 'RFC' => 'https://tools.ietf.org/html/rfc%s', |
1355 | 'PMID' => '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract' |
1356 | ]; |
1357 | $tsr = $this->tsrOffsets(); |
1358 | $dp = new DataParsoid; |
1359 | $dp->tsr = $tsr; |
1360 | $dp->stx = 'magiclink'; |
1361 | $this->env->getDataAccess()->addTrackingCategory( |
1362 | $this->env->getPageConfig(), |
1363 | $this->env->getMetadata(), |
1364 | 'magiclink-tracking-' . strtolower($ref) |
1365 | ); |
1366 | return [ |
1367 | new SelfclosingTagTk( 'extlink', [ |
1368 | new KV( 'href', sprintf( $base_urls[$ref], $identifier ) ), |
1369 | new KV( 'mw:content', TokenizerUtils::flattenString( [ $ref, $sp, $identifier ] ), $tsr->expandTsrV() ), |
1370 | new KV( 'typeof', 'mw:ExtLink/' . $ref ) |
1371 | ], |
1372 | $dp |
1373 | ) |
1374 | ]; |
1375 | |
1376 | } |
1377 | private function a120() { |
1378 | return $this->siteConfig->magicLinkEnabled("ISBN"); |
1379 | } |
1380 | private function a121($sp, $isbn) { |
1381 | |
1382 | // Convert isbn token-and-entity array to stripped string. |
1383 | $stripped = ''; |
1384 | foreach ( TokenizerUtils::flattenStringlist( $isbn ) as $part ) { |
1385 | if ( is_string( $part ) ) { |
1386 | $stripped .= $part; |
1387 | } |
1388 | } |
1389 | return strtoupper( preg_replace( '/[^\dX]/i', '', $stripped ) ); |
1390 | |
1391 | } |
1392 | private function a122($sp, $isbn, $isbncode) { |
1393 | |
1394 | // ISBNs can only be 10 or 13 digits long (with a specific format) |
1395 | return strlen( $isbncode ) === 10 |
1396 | || ( strlen( $isbncode ) === 13 && preg_match( '/^97[89]/', $isbncode ) ); |
1397 | |
1398 | } |
1399 | private function a123($sp, $isbn, $isbncode) { |
1400 | |
1401 | $tsr = $this->tsrOffsets(); |
1402 | $dp = new DataParsoid; |
1403 | $dp->stx = 'magiclink'; |
1404 | $dp->tsr = $tsr; |
1405 | $this->env->getDataAccess()->addTrackingCategory( |
1406 | $this->env->getPageConfig(), |
1407 | $this->env->getMetadata(), |
1408 | 'magiclink-tracking-isbn' |
1409 | ); |
1410 | return [ |
1411 | new SelfclosingTagTk( 'extlink', [ |
1412 | new KV( 'href', 'Special:BookSources/' . $isbncode ), |
1413 | new KV( 'mw:content', TokenizerUtils::flattenString( [ 'ISBN', $sp, $isbn ] ), $tsr->expandTsrV() ), |
1414 | new KV( 'typeof', 'mw:WikiLink/ISBN' ) |
1415 | ], |
1416 | $dp |
1417 | ) |
1418 | ]; |
1419 | |
1420 | } |
1421 | private function a124($t) { |
1422 | |
1423 | $tagName = mb_strtolower( $t->getName() ); |
1424 | $dp = $t->dataParsoid; |
1425 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
1426 | |
1427 | switch ( get_class( $t ) ) { |
1428 | case EndTagTk::class: |
1429 | // Similar to TagTk, we rely on the sanitizer to convert to text |
1430 | // where necessary and emit tokens to ease the wikitext escaping |
1431 | // code. However, extension tags that shadow html tags will see |
1432 | // their unmatched end tags dropped while tree building, since |
1433 | // the sanitizer will let them through. |
1434 | return $t; // not text() |
1435 | |
1436 | case SelfclosingTagTk::class: |
1437 | $dp->src = $dp->tsr->substr( $this->input ); |
1438 | $dp->extTagOffsets = new DomSourceRange( |
1439 | $dp->tsr->start, $dp->tsr->end, |
1440 | $dp->tsr->length(), 0 |
1441 | ); |
1442 | break; |
1443 | |
1444 | case TagTk::class: |
1445 | $tagContentFound = preg_match( $endTagRE, $this->input, $tagContent, 0, $dp->tsr->start ); |
1446 | if ( !$tagContentFound ) { |
1447 | // This is undefined behaviour. The old parser currently |
1448 | // returns text here (see core commit 674e8388cba), |
1449 | // whereas this results in unclosed |
1450 | // extension tags that shadow html tags falling back to |
1451 | // their html equivalent. The sanitizer will take care |
1452 | // of converting to text where necessary. We do this to |
1453 | // simplify `hasWikitextTokens` when escaping wikitext, |
1454 | // which wants these as tokens because it's otherwise |
1455 | // lacking in context. |
1456 | return $t; // not text() |
1457 | } |
1458 | |
1459 | $extSrc = $tagContent[0]; |
1460 | $extEndOffset = $dp->tsr->start + strlen( $extSrc ); |
1461 | $extEndTagWidth = strlen( $tagContent[1] ); |
1462 | |
1463 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
1464 | // Support nesting in extensions tags while tokenizing in templates |
1465 | // to support the #tag parser function. |
1466 | // |
1467 | // It's necessary to permit this broadly in templates because |
1468 | // there's no way to distinguish whether the nesting happened |
1469 | // while expanding the #tag parser function, or just a general |
1470 | // syntax errors. In other words, |
1471 | // |
1472 | // hi<ref>ho<ref>hi</ref>ho</ref> |
1473 | // |
1474 | // and |
1475 | // |
1476 | // hi{{#tag:ref|ho<ref>hi</ref>ho}} |
1477 | // |
1478 | // found in template are returned indistinguishably after a |
1479 | // preprocessing request, though the old parser renders them |
1480 | // differently. #tag in template is probably a common enough |
1481 | // use case that we want to accept these false positives, |
1482 | // though another approach could be to drop this code here, and |
1483 | // invoke a native #tag handler and forgo those in templates. |
1484 | // |
1485 | // Expand `extSrc` as long as there is a <tagName> found in the |
1486 | // extension source body. |
1487 | $startTagRE = '~<' . preg_quote( $tagName, '~' ) . '(?:[^/>]|/(?!>))*>~i'; |
1488 | $s = substr( $extSrc, $dp->tsr->end - $dp->tsr->start ); |
1489 | $openTags = 0; |
1490 | while ( true ) { |
1491 | if ( preg_match_all( $startTagRE, $s, $matches ) ) { |
1492 | $openTags += count( $matches[0] ); |
1493 | } |
1494 | if ( !$openTags ) { |
1495 | break; |
1496 | } |
1497 | if ( !preg_match( $endTagRE, $this->input, $tagContent, 0, $extEndOffset ) ) { |
1498 | break; |
1499 | } |
1500 | $openTags -= 1; |
1501 | $s = $tagContent[0]; |
1502 | $extEndOffset += strlen( $s ); |
1503 | $extEndTagWidth = strlen( $tagContent[1] ); |
1504 | $extSrc .= $s; |
1505 | } |
1506 | } |
1507 | |
1508 | // Extension content source |
1509 | $dp->src = $extSrc; |
1510 | $dp->extTagOffsets = new DomSourceRange( |
1511 | $dp->tsr->start, $extEndOffset, |
1512 | $dp->tsr->length(), $extEndTagWidth |
1513 | ); |
1514 | |
1515 | $this->currPos = $dp->extTagOffsets->end; |
1516 | |
1517 | // update tsr->end to span the start and end tags. |
1518 | $dp->tsr->end = $this->endOffset(); // was just modified above |
1519 | break; |
1520 | |
1521 | default: |
1522 | $this->unreachable(); |
1523 | } |
1524 | |
1525 | return new SelfclosingTagTk( 'extension', [ |
1526 | new KV( 'typeof', 'mw:Extension' ), |
1527 | new KV( 'name', $tagName ), |
1528 | new KV( 'about', $this->env->newAboutId() ), |
1529 | new KV( 'source', $dp->src ), |
1530 | new KV( 'options', $t->attribs ) |
1531 | ], $dp ); |
1532 | |
1533 | } |
1534 | private function a125($p, $dashes) { |
1535 | $this->unreachable(); |
1536 | } |
1537 | private function a126($p, $dashes, $a) { |
1538 | return $this->endOffset(); |
1539 | } |
1540 | private function a127($p, $dashes, $a, $tagEndPos, $s2) { |
1541 | |
1542 | $coms = TokenizerUtils::popComments( $a ); |
1543 | if ( $coms ) { |
1544 | $tagEndPos = $coms['commentStartPos']; |
1545 | } |
1546 | |
1547 | $da = new DataParsoid; |
1548 | $da->tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1549 | $da->startTagSrc = $p . $dashes; |
1550 | |
1551 | // We rely on our tree builder to close the row as needed. This is |
1552 | // needed to support building tables from fragment templates with |
1553 | // individual cells or rows. |
1554 | $trToken = new TagTk( 'tr', $a, $da ); |
1555 | |
1556 | return array_merge( [ $trToken ], $coms ? $coms['buf'] : [], $s2 ); |
1557 | |
1558 | } |
1559 | private function a128($p, $td, $tds) { |
1560 | |
1561 | // Avoid modifying a cached result |
1562 | $td[0] = clone $td[0]; |
1563 | $da = $td[0]->dataParsoid = clone $td[0]->dataParsoid; |
1564 | $da->tsr = clone $da->tsr; |
1565 | $da->tsr->start -= strlen( $p ); // include "|" |
1566 | if ( $p !== '|' ) { |
1567 | // Variation from default |
1568 | $da->startTagSrc = $p; |
1569 | } |
1570 | return array_merge( $td, $tds ); |
1571 | |
1572 | } |
1573 | private function a129($p, $args) { |
1574 | return $this->endOffset(); |
1575 | } |
1576 | private function a130($p, $args, $tagEndPos, $c) { |
1577 | |
1578 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1579 | return TokenizerUtils::buildTableTokens( |
1580 | 'caption', '|+', $args, $tsr, $this->endOffset(), $c, true ); |
1581 | |
1582 | } |
1583 | private function a131($start) { |
1584 | |
1585 | list(,$name) = $start; |
1586 | return WTUtils::isIncludeTag( mb_strtolower( $name ) ); |
1587 | |
1588 | } |
1589 | private function a132() { |
1590 | return $this->env->hasAnnotations && $this->siteConfig->isAnnotationTag( 'tvar' ); |
1591 | } |
1592 | private function a133() { |
1593 | |
1594 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/tvar/End' ) ]; |
1595 | $dp = new DataParsoid(); |
1596 | $dp->tsr = $this->tsrOffsets(); |
1597 | return new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ); |
1598 | |
1599 | } |
1600 | private function a134($start) { |
1601 | |
1602 | list(,$name) = $start; |
1603 | return WTUtils::isAnnotationTag( $this->env, $name ); |
1604 | |
1605 | } |
1606 | private function a135($tpt) { |
1607 | |
1608 | return [ 'tokens' => $tpt, 'srcOffsets' => $this->tsrOffsets() ]; |
1609 | |
1610 | } |
1611 | private function a136($name) { |
1612 | return $this->endOffset(); |
1613 | } |
1614 | private function a137($name, $kEndPos) { |
1615 | return $this->endOffset(); |
1616 | } |
1617 | private function a138($name, $kEndPos, $vStartPos, $optSp, $tpv) { |
1618 | |
1619 | return [ |
1620 | 'kEndPos' => $kEndPos, |
1621 | 'vStartPos' => $vStartPos, |
1622 | 'value' => TokenizerUtils::flattenString( [ $optSp, $tpv['tokens'] ?? [] ] ), |
1623 | ]; |
1624 | |
1625 | } |
1626 | private function a139($name, $val) { |
1627 | |
1628 | if ( $val !== null ) { |
1629 | if ( $val['value'] !== null ) { |
1630 | $so = new KVSourceRange( |
1631 | $this->startOffset(), $val['kEndPos'], |
1632 | $val['vStartPos'], $this->endOffset() |
1633 | ); |
1634 | return new KV( |
1635 | $name, |
1636 | TokenizerUtils::flattenIfArray( $val['value'] ), |
1637 | $so |
1638 | ); |
1639 | } else { |
1640 | return new KV( |
1641 | TokenizerUtils::flattenIfArray( $name ), |
1642 | '', |
1643 | $so |
1644 | ); |
1645 | } |
1646 | } else { |
1647 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1648 | return new KV( |
1649 | '', |
1650 | TokenizerUtils::flattenIfArray( $name ), |
1651 | $so->expandTsrV() |
1652 | ); |
1653 | } |
1654 | |
1655 | } |
1656 | private function a140() { |
1657 | |
1658 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1659 | return new KV( '', '', $so->expandTsrV() ); |
1660 | |
1661 | } |
1662 | private function a141($t, $wr) { |
1663 | return $wr; |
1664 | } |
1665 | private function a142($r) { |
1666 | |
1667 | return TokenizerUtils::flattenStringlist( $r ); |
1668 | |
1669 | } |
1670 | private function a143($startPos, $lt) { |
1671 | |
1672 | $tsr = new SourceRange( $startPos, $this->endOffset() ); |
1673 | $maybeContent = new KV( 'mw:maybeContent', $lt ?? [], $tsr->expandTsrV() ); |
1674 | $maybeContent->vsrc = substr( $this->input, $startPos, $this->endOffset() - $startPos ); |
1675 | return $maybeContent; |
1676 | |
1677 | } |
1678 | private function a144($end, $name) { |
1679 | return [ $end, $name ]; |
1680 | } |
1681 | private function a145() { |
1682 | return $this->siteConfig->magicLinkEnabled("RFC"); |
1683 | } |
1684 | private function a146() { |
1685 | |
1686 | return 'RFC'; |
1687 | |
1688 | } |
1689 | private function a147() { |
1690 | return $this->siteConfig->magicLinkEnabled("PMID"); |
1691 | } |
1692 | private function a148() { |
1693 | |
1694 | return 'PMID'; |
1695 | |
1696 | } |
1697 | private function a149($he) { |
1698 | return is_array( $he ) && $he[ 1 ] === "\u{A0}"; |
1699 | } |
1700 | private function a150($start) { |
1701 | |
1702 | list(,$name) = $start; |
1703 | return isset( $this->extTags[mb_strtolower( $name )] ) && |
1704 | // NOTE: This check is redundant with the precedence of the current |
1705 | // rules ( annotation_tag / *_extension_tag ) but kept as a precaution |
1706 | // since annotation tags are in extTags and we want them handled |
1707 | // elsewhere. |
1708 | !WTUtils::isAnnotationTag( $this->env, $name ); |
1709 | |
1710 | } |
1711 | private function a151() { |
1712 | return $this->startOffset(); |
1713 | } |
1714 | private function a152($lv0) { |
1715 | return $this->env->langConverterEnabled(); |
1716 | } |
1717 | private function a153($lv0, $ff) { |
1718 | |
1719 | // if flags contains 'R', then don't treat ; or : specially inside. |
1720 | if ( isset( $ff['flags'] ) ) { |
1721 | $ff['raw'] = isset( $ff['flags']['R'] ) || isset( $ff['flags']['N'] ); |
1722 | } elseif ( isset( $ff['variants'] ) ) { |
1723 | $ff['raw'] = true; |
1724 | } |
1725 | return $ff; |
1726 | |
1727 | } |
1728 | private function a154($lv0) { |
1729 | return !$this->env->langConverterEnabled(); |
1730 | } |
1731 | private function a155($lv0) { |
1732 | |
1733 | // if language converter not enabled, don't try to parse inside. |
1734 | return [ 'raw' => true ]; |
1735 | |
1736 | } |
1737 | private function a156($lv0, $f) { |
1738 | return $f['raw']; |
1739 | } |
1740 | private function a157($lv0, $f, $lv) { |
1741 | return [ [ 'text' => $lv ] ]; |
1742 | } |
1743 | private function a158($lv0, $f) { |
1744 | return !$f['raw']; |
1745 | } |
1746 | private function a159($lv0, $f, $lv) { |
1747 | return $lv; |
1748 | } |
1749 | private function a160($lv0, $f, $ts) { |
1750 | return $this->endOffset(); |
1751 | } |
1752 | private function a161($lv0, $f, $ts, $lv1) { |
1753 | |
1754 | if ( !$this->env->langConverterEnabled() ) { |
1755 | return [ '-{', $ts[0]['text']['tokens'], '}-' ]; |
1756 | } |
1757 | $lvsrc = substr( $this->input, $lv0, $lv1 - $lv0 ); |
1758 | $attribs = []; |
1759 | |
1760 | foreach ( $ts as &$t ) { |
1761 | // move token strings into KV attributes so that they are |
1762 | // properly expanded by early stages of the token pipeline |
1763 | foreach ( [ 'text', 'from', 'to' ] as $fld ) { |
1764 | if ( !isset( $t[$fld] ) ) { |
1765 | continue; |
1766 | } |
1767 | $name = 'mw:lv' . count( $attribs ); |
1768 | // Note that AttributeExpander will expect the tokens array to be |
1769 | // flattened. We do that in lang_variant_text / lang_variant_nowiki |
1770 | $attribs[] = new KV( $name, $t[$fld]['tokens'], $t[$fld]['srcOffsets']->expandTsrV() ); |
1771 | $t[$fld] = $name; |
1772 | } |
1773 | } |
1774 | unset( $t ); |
1775 | |
1776 | $flags = isset( $f['flags'] ) ? array_keys( $f['flags'] ) : []; |
1777 | sort( $flags ); |
1778 | $variants = isset( $f['variants'] ) ? array_keys( $f['variants'] ) : []; |
1779 | sort( $variants ); |
1780 | |
1781 | $dp = new DataParsoid; |
1782 | $dp->tsr = new SourceRange( $lv0, $lv1 ); |
1783 | $dp->src = $lvsrc; |
1784 | $dp->flags = $flags; |
1785 | $dp->variants = $variants; |
1786 | $dp->original = $f['original']; |
1787 | $dp->flagSp = $f['sp']; |
1788 | $dp->texts = $ts; |
1789 | |
1790 | return [ |
1791 | new SelfclosingTagTk( |
1792 | 'language-variant', |
1793 | $attribs, |
1794 | $dp |
1795 | ) |
1796 | ]; |
1797 | |
1798 | } |
1799 | private function a162($r, &$preproc) { |
1800 | |
1801 | $preproc = null; |
1802 | return $r; |
1803 | |
1804 | } |
1805 | private function a163($thTag, $thTags) { |
1806 | |
1807 | // Avoid modifying a cached result |
1808 | $thTag[0] = clone $thTag[0]; |
1809 | $da = $thTag[0]->dataParsoid = clone $thTag[0]->dataParsoid; |
1810 | $da->tsr = clone $da->tsr; |
1811 | $da->tsr->start--; // include "!" |
1812 | array_unshift( $thTags, $thTag ); |
1813 | return $thTags; |
1814 | |
1815 | } |
1816 | private function a164($arg) { |
1817 | return $this->endOffset(); |
1818 | } |
1819 | private function a165($arg, $tagEndPos, $td) { |
1820 | |
1821 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1822 | return TokenizerUtils::buildTableTokens( 'td', '|', $arg, |
1823 | $tsr, $this->endOffset(), $td ); |
1824 | |
1825 | } |
1826 | private function a166($pp, $tdt) { |
1827 | |
1828 | // Avoid modifying cached dataParsoid object |
1829 | $tdt[0] = clone $tdt[0]; |
1830 | $da = $tdt[0]->dataParsoid = clone $tdt[0]->dataParsoid; |
1831 | $da->tsr = clone $da->tsr; |
1832 | $da->stx = 'row'; |
1833 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
1834 | $da->tsr->start -= strlen( $pp ); // include "||" |
1835 | if ( $pp !== '||' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
1836 | // Variation from default |
1837 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
1838 | } |
1839 | return $tdt; |
1840 | |
1841 | } |
1842 | private function a167($b) { |
1843 | |
1844 | return $b; |
1845 | |
1846 | } |
1847 | private function a168($il) { |
1848 | |
1849 | // il is guaranteed to be an array -- so, tu.flattenIfArray will |
1850 | // always return an array |
1851 | $r = TokenizerUtils::flattenIfArray( $il ); |
1852 | if ( count( $r ) === 1 && is_string( $r[0] ) ) { |
1853 | $r = $r[0]; |
1854 | } |
1855 | return $r; |
1856 | |
1857 | } |
1858 | private function a169() { |
1859 | return ''; |
1860 | } |
1861 | private function a170($ff) { |
1862 | return $ff; |
1863 | } |
1864 | private function a171($f) { |
1865 | |
1866 | // Collect & separate flags and variants into a hashtable (by key) and ordered list |
1867 | $flags = []; |
1868 | $variants = []; |
1869 | $flagList = []; |
1870 | $flagSpace = []; |
1871 | $variantList = []; |
1872 | $variantSpace = []; |
1873 | $useVariants = false; |
1874 | if ( $f !== null ) { |
1875 | // lang_variant_flags returns arrays in reverse order. |
1876 | $spPtr = count( $f['sp'] ) - 1; |
1877 | for ( $i = count( $f['flags'] ) - 1; $i >= 0; $i--) { |
1878 | $item = $f['flags'][$i]; |
1879 | if ( isset( $item['flag'] ) ) { |
1880 | $flagSpace[] = $f['sp'][$spPtr--]; |
1881 | $flags[$item['flag']] = true; |
1882 | $flagList[] = $item['flag']; |
1883 | $flagSpace[] = $f['sp'][$spPtr--]; |
1884 | } |
1885 | if ( isset( $item['variant'] ) ) { |
1886 | $variantSpace[] = $f['sp'][$spPtr--]; |
1887 | $variants[$item['variant']] = true; |
1888 | $variantList[] = $item['variant']; |
1889 | $variantSpace[] = $f['sp'][$spPtr--]; |
1890 | } |
1891 | } |
1892 | if ( $spPtr >= 0 ) { |
1893 | // handle space after a trailing semicolon |
1894 | $flagSpace[] = $f['sp'][$spPtr]; |
1895 | $variantSpace[] = $f['sp'][$spPtr]; |
1896 | } |
1897 | } |
1898 | // Parse flags (this logic is from core/languages/ConverterRule.php |
1899 | // in the parseFlags() function) |
1900 | if ( count( $flags ) === 0 && count( $variants ) === 0 ) { |
1901 | $flags['$S'] = true; |
1902 | } elseif ( isset( $flags['R'] ) ) { |
1903 | $flags = [ 'R' => true ]; // remove other flags |
1904 | } elseif ( isset( $flags['N'] ) ) { |
1905 | $flags = [ 'N' => true ]; // remove other flags |
1906 | } elseif ( isset( $flags['-'] ) ) { |
1907 | $flags = [ '-' => true ]; // remove other flags |
1908 | } elseif ( isset( $flags['T'] ) && count( $flags ) === 1 ) { |
1909 | $flags['H'] = true; |
1910 | } elseif ( isset( $flags['H'] ) ) { |
1911 | // Replace A flag, and remove other flags except T and D |
1912 | $nf = [ '$+' => true, 'H' => true ]; |
1913 | if ( isset( $flags['T'] ) ) { $nf['T'] = true; } |
1914 | if ( isset( $flags['D'] ) ) { $nf['D'] = true; } |
1915 | $flags = $nf; |
1916 | } elseif ( count( $variants ) > 0 ) { |
1917 | $useVariants = true; |
1918 | } else { |
1919 | if ( isset( $flags['A'] ) ) { |
1920 | $flags['$+'] = true; |
1921 | $flags['$S'] = true; |
1922 | } |
1923 | if ( isset( $flags['D'] ) ) { |
1924 | unset( $flags['$S'] ); |
1925 | } |
1926 | } |
1927 | if ( $useVariants ) { |
1928 | return [ 'variants' => $variants, 'original' => $variantList, 'sp' => $variantSpace ]; |
1929 | } else { |
1930 | return [ 'flags' => $flags, 'original' => $flagList, 'sp' => $flagSpace ]; |
1931 | } |
1932 | |
1933 | } |
1934 | private function a172($tokens) { |
1935 | |
1936 | return [ |
1937 | 'tokens' => TokenizerUtils::flattenStringlist( $tokens ), |
1938 | 'srcOffsets' => $this->tsrOffsets(), |
1939 | ]; |
1940 | |
1941 | } |
1942 | private function a173($o, $oo) { |
1943 | return $oo; |
1944 | } |
1945 | private function a174($o, $rest, $tr) { |
1946 | |
1947 | array_unshift( $rest, $o ); |
1948 | // if the last bogus option is just spaces, keep them; otherwise |
1949 | // drop all this bogus stuff on the ground |
1950 | if ( count($tr) > 0 ) { |
1951 | $last = $tr[count($tr)-1]; |
1952 | if (preg_match('/^\s*$/Du', $last[1])) { |
1953 | $rest[] = [ 'semi' => true, 'sp' => $last[1] ]; |
1954 | } |
1955 | } |
1956 | return $rest; |
1957 | |
1958 | } |
1959 | private function a175($lvtext) { |
1960 | return [ [ 'text' => $lvtext ] ]; |
1961 | } |
1962 | private function a176($arg, $tagEndPos, &$th, $d) { |
1963 | |
1964 | // Ignore newlines found in transclusions! |
1965 | // This is not perfect (since {{..}} may not always tokenize to transclusions). |
1966 | if ( $th !== false && strpos( preg_replace( "/{{[\s\S]+?}}/", "", $this->text() ), "\n" ) !== false ) { |
1967 | // There's been a newline. Remove the break and continue |
1968 | // tokenizing nested_block_in_tables. |
1969 | $th = false; |
1970 | } |
1971 | return $d; |
1972 | |
1973 | } |
1974 | private function a177($arg, $tagEndPos, $c) { |
1975 | |
1976 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1977 | return TokenizerUtils::buildTableTokens( 'th', '!', $arg, |
1978 | $tsr, $this->endOffset(), $c ); |
1979 | |
1980 | } |
1981 | private function a178($pp, $tht) { |
1982 | |
1983 | // Avoid modifying cached dataParsoid object |
1984 | $tht[0] = clone $tht[0]; |
1985 | $da = $tht[0]->dataParsoid = clone $tht[0]->dataParsoid; |
1986 | $da->tsr = clone $da->tsr; |
1987 | $da->stx = 'row'; |
1988 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
1989 | $da->tsr->start -= strlen( $pp ); // include "!!" or "||" |
1990 | if ( $pp !== '!!' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
1991 | // Variation from default |
1992 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
1993 | } |
1994 | return $tht; |
1995 | |
1996 | } |
1997 | private function a179($sp1, $f, $sp2, $more) { |
1998 | |
1999 | $r = ( $more && $more[1] ) ? $more[1] : [ 'sp' => [], 'flags' => [] ]; |
2000 | // Note that sp and flags are in reverse order, since we're using |
2001 | // right recursion and want to push instead of unshift. |
2002 | $r['sp'][] = $sp2; |
2003 | $r['sp'][] = $sp1; |
2004 | $r['flags'][] = $f; |
2005 | return $r; |
2006 | |
2007 | } |
2008 | private function a180($sp) { |
2009 | |
2010 | return [ 'sp' => [ $sp ], 'flags' => [] ]; |
2011 | |
2012 | } |
2013 | private function a181($sp1, $lang, $sp2, $sp3, $lvtext) { |
2014 | |
2015 | return [ |
2016 | 'twoway' => true, |
2017 | 'lang' => $lang, |
2018 | 'text' => $lvtext, |
2019 | 'sp' => [ $sp1, $sp2, $sp3 ] |
2020 | ]; |
2021 | |
2022 | } |
2023 | private function a182($sp1, $from, $sp2, $lang, $sp3, $sp4, $to) { |
2024 | |
2025 | return [ |
2026 | 'oneway' => true, |
2027 | 'from' => $from, |
2028 | 'lang' => $lang, |
2029 | 'to' => $to, |
2030 | 'sp' => [ $sp1, $sp2, $sp3, $sp4 ] |
2031 | ]; |
2032 | |
2033 | } |
2034 | private function a183($r) { |
2035 | |
2036 | return $r; |
2037 | |
2038 | } |
2039 | private function a184($f) { |
2040 | return [ 'flag' => $f ]; |
2041 | } |
2042 | private function a185($v) { |
2043 | return [ 'variant' => $v ]; |
2044 | } |
2045 | private function a186($b) { |
2046 | return [ 'bogus' => $b ]; /* bad flag */ |
2047 | } |
2048 | private function a187($n, $sp) { |
2049 | |
2050 | $tsr = $this->tsrOffsets(); |
2051 | $tsr->end -= strlen( $sp ); |
2052 | return [ |
2053 | 'tokens' => [ $n ], |
2054 | 'srcOffsets' => $tsr, |
2055 | ]; |
2056 | |
2057 | } |
2058 | private function a188($ext) { |
2059 | return $ext; |
2060 | } |
2061 | private function a189($extToken) { |
2062 | |
2063 | $txt = Utils::extractExtBody( $extToken ); |
2064 | return Utils::decodeWtEntities( $txt ); |
2065 | |
2066 | } |
2067 | private function a190($start) { |
2068 | |
2069 | list(,$name) = $start; |
2070 | return ( mb_strtolower( $name ) === 'nowiki' ); |
2071 | |
2072 | } |
2073 | |
2074 | // generated |
2075 | private function streamstart_async($silence, &$param_preproc) { |
2076 | for (;;) { |
2077 | // start choice_1 |
2078 | $p2 = $this->currPos; |
2079 | // start seq_1 |
2080 | $p3 = $this->currPos; |
2081 | $this->savedPos = $this->currPos; |
2082 | $r4 = $this->a0(); |
2083 | if ($r4) { |
2084 | $r4 = false; |
2085 | } else { |
2086 | $r4 = self::$FAILED; |
2087 | $r1 = self::$FAILED; |
2088 | goto seq_1; |
2089 | } |
2090 | $r5 = $this->parsetlb($silence, $param_preproc); |
2091 | // t <- $r5 |
2092 | if ($r5===self::$FAILED) { |
2093 | $this->currPos = $p3; |
2094 | $r1 = self::$FAILED; |
2095 | goto seq_1; |
2096 | } |
2097 | $this->savedPos = $this->currPos; |
2098 | $r6 = $this->a1($r5); |
2099 | if ($r6) { |
2100 | $r6 = false; |
2101 | } else { |
2102 | $r6 = self::$FAILED; |
2103 | $this->currPos = $p3; |
2104 | $r1 = self::$FAILED; |
2105 | goto seq_1; |
2106 | } |
2107 | $r1 = true; |
2108 | seq_1: |
2109 | if ($r1!==self::$FAILED) { |
2110 | $this->savedPos = $p2; |
2111 | $r1 = $this->a2($r5); |
2112 | goto choice_1; |
2113 | } |
2114 | // free $p3 |
2115 | // start seq_2 |
2116 | $p3 = $this->currPos; |
2117 | $r7 = []; |
2118 | for (;;) { |
2119 | $r8 = $this->parsenewlineToken($silence); |
2120 | if ($r8!==self::$FAILED) { |
2121 | $r7[] = $r8; |
2122 | } else { |
2123 | break; |
2124 | } |
2125 | } |
2126 | // free $r8 |
2127 | $this->savedPos = $this->currPos; |
2128 | $r8 = $this->a3(); |
2129 | if ($r8) { |
2130 | $r8 = false; |
2131 | } else { |
2132 | $r8 = self::$FAILED; |
2133 | $this->currPos = $p3; |
2134 | $r1 = self::$FAILED; |
2135 | goto seq_2; |
2136 | } |
2137 | $r1 = [$r7,$r8]; |
2138 | seq_2: |
2139 | // free $p3 |
2140 | choice_1: |
2141 | if ($r1!==self::$FAILED) { |
2142 | yield $r1; |
2143 | } else { |
2144 | if ($this->currPos < $this->inputLength) { |
2145 | $this->fail(0); |
2146 | throw $this->buildParseException(); |
2147 | } |
2148 | break; |
2149 | } |
2150 | } |
2151 | } |
2152 | private function parsestart($silence, &$param_preproc) { |
2153 | $key = json_encode([298, $param_preproc]); |
2154 | $bucket = $this->currPos; |
2155 | $cached = $this->cache[$bucket][$key] ?? null; |
2156 | if ($cached) { |
2157 | $this->currPos = $cached->nextPos; |
2158 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2159 | return $cached->result; |
2160 | } |
2161 | $saved_preproc=$param_preproc; |
2162 | $p2 = $this->currPos; |
2163 | // start seq_1 |
2164 | $p3 = $this->currPos; |
2165 | $r4 = []; |
2166 | for (;;) { |
2167 | $r5 = $this->parsetlb(true, $param_preproc); |
2168 | if ($r5!==self::$FAILED) { |
2169 | $r4[] = $r5; |
2170 | } else { |
2171 | break; |
2172 | } |
2173 | } |
2174 | // t <- $r4 |
2175 | // free $r5 |
2176 | $r5 = []; |
2177 | for (;;) { |
2178 | $r6 = $this->parsenewlineToken(true); |
2179 | if ($r6!==self::$FAILED) { |
2180 | $r5[] = $r6; |
2181 | } else { |
2182 | break; |
2183 | } |
2184 | } |
2185 | // n <- $r5 |
2186 | // free $r6 |
2187 | $r1 = true; |
2188 | seq_1: |
2189 | if ($r1!==self::$FAILED) { |
2190 | $this->savedPos = $p2; |
2191 | $r1 = $this->a4($r4, $r5); |
2192 | } else { |
2193 | if (!$silence) {$this->fail(1);} |
2194 | } |
2195 | // free $p3 |
2196 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2197 | $this->currPos, |
2198 | $r1, |
2199 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2200 | self::$UNDEFINED |
2201 | ); |
2202 | return $r1; |
2203 | } |
2204 | private function parsetable_start_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
2205 | $key = json_encode([498, $boolParams & 0x1fbf, $param_preproc, $param_th]); |
2206 | $bucket = $this->currPos; |
2207 | $cached = $this->cache[$bucket][$key] ?? null; |
2208 | if ($cached) { |
2209 | $this->currPos = $cached->nextPos; |
2210 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2211 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2212 | return $cached->result; |
2213 | } |
2214 | $saved_preproc=$param_preproc; |
2215 | $saved_th=$param_th; |
2216 | $p2 = $this->currPos; |
2217 | // start seq_1 |
2218 | $p3 = $this->currPos; |
2219 | $r4 = []; |
2220 | for (;;) { |
2221 | // start choice_1 |
2222 | $r5 = $this->parsespace(true); |
2223 | if ($r5!==self::$FAILED) { |
2224 | goto choice_1; |
2225 | } |
2226 | $r5 = $this->parsecomment(true); |
2227 | choice_1: |
2228 | if ($r5!==self::$FAILED) { |
2229 | $r4[] = $r5; |
2230 | } else { |
2231 | break; |
2232 | } |
2233 | } |
2234 | // sc <- $r4 |
2235 | // free $r5 |
2236 | $p6 = $this->currPos; |
2237 | $r5 = ''; |
2238 | // startPos <- $r5 |
2239 | if ($r5!==self::$FAILED) { |
2240 | $this->savedPos = $p6; |
2241 | $r5 = $this->a5($r4); |
2242 | } else { |
2243 | $this->currPos = $p3; |
2244 | $r1 = self::$FAILED; |
2245 | goto seq_1; |
2246 | } |
2247 | // b <- $r7 |
2248 | if (($this->input[$this->currPos] ?? null) === "{") { |
2249 | $this->currPos++; |
2250 | $r7 = "{"; |
2251 | } else { |
2252 | $r7 = self::$FAILED; |
2253 | $this->currPos = $p3; |
2254 | $r1 = self::$FAILED; |
2255 | goto seq_1; |
2256 | } |
2257 | $r8 = $this->parsepipe(true); |
2258 | // p <- $r8 |
2259 | if ($r8===self::$FAILED) { |
2260 | $this->currPos = $p3; |
2261 | $r1 = self::$FAILED; |
2262 | goto seq_1; |
2263 | } |
2264 | // start choice_2 |
2265 | $r9 = $this->parsetable_attributes(true, $boolParams & ~0x40, $param_preproc, $param_th); |
2266 | if ($r9!==self::$FAILED) { |
2267 | goto choice_2; |
2268 | } |
2269 | $this->savedPos = $this->currPos; |
2270 | $r9 = $this->a6($r4, $r5, $r7, $r8); |
2271 | if ($r9) { |
2272 | $r9 = false; |
2273 | } else { |
2274 | $r9 = self::$FAILED; |
2275 | } |
2276 | choice_2: |
2277 | // ta <- $r9 |
2278 | if ($r9===self::$FAILED) { |
2279 | $this->currPos = $p3; |
2280 | $r1 = self::$FAILED; |
2281 | goto seq_1; |
2282 | } |
2283 | $p11 = $this->currPos; |
2284 | $r10 = ''; |
2285 | // tsEndPos <- $r10 |
2286 | if ($r10!==self::$FAILED) { |
2287 | $this->savedPos = $p11; |
2288 | $r10 = $this->a7($r4, $r5, $r7, $r8, $r9); |
2289 | } else { |
2290 | $this->currPos = $p3; |
2291 | $r1 = self::$FAILED; |
2292 | goto seq_1; |
2293 | } |
2294 | $r12 = []; |
2295 | for (;;) { |
2296 | $r13 = $this->parsespace(true); |
2297 | if ($r13!==self::$FAILED) { |
2298 | $r12[] = $r13; |
2299 | } else { |
2300 | break; |
2301 | } |
2302 | } |
2303 | // s2 <- $r12 |
2304 | // free $r13 |
2305 | $r1 = true; |
2306 | seq_1: |
2307 | if ($r1!==self::$FAILED) { |
2308 | $this->savedPos = $p2; |
2309 | $r1 = $this->a8($r4, $r5, $r7, $r8, $r9, $r10, $r12); |
2310 | } else { |
2311 | if (!$silence) {$this->fail(2);} |
2312 | } |
2313 | // free $p3 |
2314 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2315 | $this->currPos, |
2316 | $r1, |
2317 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2318 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2319 | ); |
2320 | return $r1; |
2321 | } |
2322 | private function parseurl($silence, &$param_preproc) { |
2323 | $key = json_encode([358, $param_preproc]); |
2324 | $bucket = $this->currPos; |
2325 | $cached = $this->cache[$bucket][$key] ?? null; |
2326 | if ($cached) { |
2327 | $this->currPos = $cached->nextPos; |
2328 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2329 | return $cached->result; |
2330 | } |
2331 | $saved_preproc=$param_preproc; |
2332 | $p2 = $this->currPos; |
2333 | // start seq_1 |
2334 | $p3 = $this->currPos; |
2335 | $r4 = $this->parseurl_protocol($silence); |
2336 | // proto <- $r4 |
2337 | if ($r4===self::$FAILED) { |
2338 | $r1 = self::$FAILED; |
2339 | goto seq_1; |
2340 | } |
2341 | // start choice_1 |
2342 | $r5 = $this->parseipv6urladdr($silence); |
2343 | if ($r5!==self::$FAILED) { |
2344 | goto choice_1; |
2345 | } |
2346 | $r5 = ''; |
2347 | choice_1: |
2348 | // addr <- $r5 |
2349 | if ($r5===self::$FAILED) { |
2350 | $this->currPos = $p3; |
2351 | $r1 = self::$FAILED; |
2352 | goto seq_1; |
2353 | } |
2354 | $r6 = []; |
2355 | for (;;) { |
2356 | $p8 = $this->currPos; |
2357 | // start seq_2 |
2358 | $p9 = $this->currPos; |
2359 | $p10 = $this->currPos; |
2360 | $r11 = $this->discardinline_breaks(true, 0x0, $param_preproc, self::newRef(null)); |
2361 | if ($r11 === self::$FAILED) { |
2362 | $r11 = false; |
2363 | } else { |
2364 | $r11 = self::$FAILED; |
2365 | $this->currPos = $p10; |
2366 | $r7 = self::$FAILED; |
2367 | goto seq_2; |
2368 | } |
2369 | // free $p10 |
2370 | // start choice_2 |
2371 | $r12 = $this->parseno_punctuation_char($silence); |
2372 | if ($r12!==self::$FAILED) { |
2373 | goto choice_2; |
2374 | } |
2375 | $r12 = $this->parsecomment($silence); |
2376 | if ($r12!==self::$FAILED) { |
2377 | goto choice_2; |
2378 | } |
2379 | $r12 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2380 | if ($r12!==self::$FAILED) { |
2381 | goto choice_2; |
2382 | } |
2383 | $r12 = $this->input[$this->currPos] ?? ''; |
2384 | if ($r12 === "'" || $r12 === "{") { |
2385 | $this->currPos++; |
2386 | goto choice_2; |
2387 | } else { |
2388 | $r12 = self::$FAILED; |
2389 | if (!$silence) {$this->fail(3);} |
2390 | } |
2391 | $p10 = $this->currPos; |
2392 | // start seq_3 |
2393 | $p13 = $this->currPos; |
2394 | $p14 = $this->currPos; |
2395 | // start seq_4 |
2396 | $p16 = $this->currPos; |
2397 | if (($this->input[$this->currPos] ?? null) === "&") { |
2398 | $this->currPos++; |
2399 | $r17 = "&"; |
2400 | } else { |
2401 | $r17 = self::$FAILED; |
2402 | $r15 = self::$FAILED; |
2403 | goto seq_4; |
2404 | } |
2405 | // start choice_3 |
2406 | // start seq_5 |
2407 | $p19 = $this->currPos; |
2408 | $r20 = $this->input[$this->currPos] ?? ''; |
2409 | if ($r20 === "l" || $r20 === "L") { |
2410 | $this->currPos++; |
2411 | } else { |
2412 | $r20 = self::$FAILED; |
2413 | $r18 = self::$FAILED; |
2414 | goto seq_5; |
2415 | } |
2416 | $r21 = $this->input[$this->currPos] ?? ''; |
2417 | if ($r21 === "t" || $r21 === "T") { |
2418 | $this->currPos++; |
2419 | } else { |
2420 | $r21 = self::$FAILED; |
2421 | $this->currPos = $p19; |
2422 | $r18 = self::$FAILED; |
2423 | goto seq_5; |
2424 | } |
2425 | $r18 = true; |
2426 | seq_5: |
2427 | if ($r18!==self::$FAILED) { |
2428 | goto choice_3; |
2429 | } |
2430 | // free $p19 |
2431 | // start seq_6 |
2432 | $p19 = $this->currPos; |
2433 | $r22 = $this->input[$this->currPos] ?? ''; |
2434 | if ($r22 === "g" || $r22 === "G") { |
2435 | $this->currPos++; |
2436 | } else { |
2437 | $r22 = self::$FAILED; |
2438 | $r18 = self::$FAILED; |
2439 | goto seq_6; |
2440 | } |
2441 | $r23 = $this->input[$this->currPos] ?? ''; |
2442 | if ($r23 === "t" || $r23 === "T") { |
2443 | $this->currPos++; |
2444 | } else { |
2445 | $r23 = self::$FAILED; |
2446 | $this->currPos = $p19; |
2447 | $r18 = self::$FAILED; |
2448 | goto seq_6; |
2449 | } |
2450 | $r18 = true; |
2451 | seq_6: |
2452 | // free $p19 |
2453 | choice_3: |
2454 | if ($r18===self::$FAILED) { |
2455 | $this->currPos = $p16; |
2456 | $r15 = self::$FAILED; |
2457 | goto seq_4; |
2458 | } |
2459 | if (($this->input[$this->currPos] ?? null) === ";") { |
2460 | $this->currPos++; |
2461 | $r24 = ";"; |
2462 | } else { |
2463 | $r24 = self::$FAILED; |
2464 | $this->currPos = $p16; |
2465 | $r15 = self::$FAILED; |
2466 | goto seq_4; |
2467 | } |
2468 | $r15 = true; |
2469 | seq_4: |
2470 | // free $p16 |
2471 | if ($r15 === self::$FAILED) { |
2472 | $r15 = false; |
2473 | } else { |
2474 | $r15 = self::$FAILED; |
2475 | $this->currPos = $p14; |
2476 | $r12 = self::$FAILED; |
2477 | goto seq_3; |
2478 | } |
2479 | // free $p14 |
2480 | // start choice_4 |
2481 | $p14 = $this->currPos; |
2482 | // start seq_7 |
2483 | $p16 = $this->currPos; |
2484 | $p19 = $this->currPos; |
2485 | if (($this->input[$this->currPos] ?? null) === "&") { |
2486 | $this->currPos++; |
2487 | $r26 = "&"; |
2488 | $r26 = false; |
2489 | $this->currPos = $p19; |
2490 | } else { |
2491 | $r26 = self::$FAILED; |
2492 | $r25 = self::$FAILED; |
2493 | goto seq_7; |
2494 | } |
2495 | // free $p19 |
2496 | $r27 = $this->parsehtmlentity($silence); |
2497 | // he <- $r27 |
2498 | if ($r27===self::$FAILED) { |
2499 | $this->currPos = $p16; |
2500 | $r25 = self::$FAILED; |
2501 | goto seq_7; |
2502 | } |
2503 | $r25 = true; |
2504 | seq_7: |
2505 | if ($r25!==self::$FAILED) { |
2506 | $this->savedPos = $p14; |
2507 | $r25 = $this->a9($r4, $r5, $r27); |
2508 | goto choice_4; |
2509 | } |
2510 | // free $p16 |
2511 | if (($this->input[$this->currPos] ?? null) === "&") { |
2512 | $this->currPos++; |
2513 | $r25 = "&"; |
2514 | } else { |
2515 | if (!$silence) {$this->fail(4);} |
2516 | $r25 = self::$FAILED; |
2517 | } |
2518 | choice_4: |
2519 | // r <- $r25 |
2520 | if ($r25===self::$FAILED) { |
2521 | $this->currPos = $p13; |
2522 | $r12 = self::$FAILED; |
2523 | goto seq_3; |
2524 | } |
2525 | $r12 = true; |
2526 | seq_3: |
2527 | if ($r12!==self::$FAILED) { |
2528 | $this->savedPos = $p10; |
2529 | $r12 = $this->a10($r4, $r5, $r25); |
2530 | } |
2531 | // free $p13 |
2532 | choice_2: |
2533 | // c <- $r12 |
2534 | if ($r12===self::$FAILED) { |
2535 | $this->currPos = $p9; |
2536 | $r7 = self::$FAILED; |
2537 | goto seq_2; |
2538 | } |
2539 | $r7 = true; |
2540 | seq_2: |
2541 | if ($r7!==self::$FAILED) { |
2542 | $this->savedPos = $p8; |
2543 | $r7 = $this->a11($r4, $r5, $r12); |
2544 | $r6[] = $r7; |
2545 | } else { |
2546 | break; |
2547 | } |
2548 | // free $p9 |
2549 | } |
2550 | // path <- $r6 |
2551 | // free $r7 |
2552 | $this->savedPos = $this->currPos; |
2553 | $r7 = $this->a12($r4, $r5, $r6); |
2554 | if ($r7) { |
2555 | $r7 = false; |
2556 | } else { |
2557 | $r7 = self::$FAILED; |
2558 | $this->currPos = $p3; |
2559 | $r1 = self::$FAILED; |
2560 | goto seq_1; |
2561 | } |
2562 | $r1 = true; |
2563 | seq_1: |
2564 | if ($r1!==self::$FAILED) { |
2565 | $this->savedPos = $p2; |
2566 | $r1 = $this->a13($r4, $r5, $r6); |
2567 | } |
2568 | // free $p3 |
2569 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2570 | $this->currPos, |
2571 | $r1, |
2572 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2573 | self::$UNDEFINED |
2574 | ); |
2575 | return $r1; |
2576 | } |
2577 | private function parserow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) { |
2578 | $key = json_encode([520, $boolParams & 0x1eff, $param_preproc, $param_th]); |
2579 | $bucket = $this->currPos; |
2580 | $cached = $this->cache[$bucket][$key] ?? null; |
2581 | if ($cached) { |
2582 | $this->currPos = $cached->nextPos; |
2583 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2584 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2585 | return $cached->result; |
2586 | } |
2587 | $saved_preproc=$param_preproc; |
2588 | $saved_th=$param_th; |
2589 | $p2 = $this->currPos; |
2590 | // start seq_1 |
2591 | $p3 = $this->currPos; |
2592 | $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th); |
2593 | // as <- $r4 |
2594 | if ($r4===self::$FAILED) { |
2595 | $r1 = self::$FAILED; |
2596 | goto seq_1; |
2597 | } |
2598 | $r5 = $this->parseoptional_spaces($silence); |
2599 | // s <- $r5 |
2600 | if ($r5===self::$FAILED) { |
2601 | $this->currPos = $p3; |
2602 | $r1 = self::$FAILED; |
2603 | goto seq_1; |
2604 | } |
2605 | $r6 = $this->parsepipe($silence); |
2606 | // p <- $r6 |
2607 | if ($r6===self::$FAILED) { |
2608 | $this->currPos = $p3; |
2609 | $r1 = self::$FAILED; |
2610 | goto seq_1; |
2611 | } |
2612 | $p7 = $this->currPos; |
2613 | $r8 = $this->discardpipe(true); |
2614 | if ($r8 === self::$FAILED) { |
2615 | $r8 = false; |
2616 | } else { |
2617 | $r8 = self::$FAILED; |
2618 | $this->currPos = $p7; |
2619 | $this->currPos = $p3; |
2620 | $r1 = self::$FAILED; |
2621 | goto seq_1; |
2622 | } |
2623 | // free $p7 |
2624 | $r1 = true; |
2625 | seq_1: |
2626 | if ($r1!==self::$FAILED) { |
2627 | $this->savedPos = $p2; |
2628 | $r1 = $this->a14($r4, $r5, $r6); |
2629 | } |
2630 | // free $p3 |
2631 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2632 | $this->currPos, |
2633 | $r1, |
2634 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2635 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2636 | ); |
2637 | return $r1; |
2638 | } |
2639 | private function parsetable_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2640 | $key = json_encode([302, $boolParams & 0x1fff, $param_preproc, $param_th]); |
2641 | $bucket = $this->currPos; |
2642 | $cached = $this->cache[$bucket][$key] ?? null; |
2643 | if ($cached) { |
2644 | $this->currPos = $cached->nextPos; |
2645 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2646 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2647 | return $cached->result; |
2648 | } |
2649 | $saved_preproc=$param_preproc; |
2650 | $saved_th=$param_th; |
2651 | $r1 = []; |
2652 | for (;;) { |
2653 | // start choice_1 |
2654 | $r2 = $this->parsetable_attribute(true, $boolParams, $param_preproc, $param_th); |
2655 | if ($r2!==self::$FAILED) { |
2656 | goto choice_1; |
2657 | } |
2658 | $p3 = $this->currPos; |
2659 | // start seq_1 |
2660 | $p4 = $this->currPos; |
2661 | $r5 = $this->discardoptionalSpaceToken(true); |
2662 | if ($r5===self::$FAILED) { |
2663 | $r2 = self::$FAILED; |
2664 | goto seq_1; |
2665 | } |
2666 | $r6 = $this->parsebroken_table_attribute_name_char(true); |
2667 | // b <- $r6 |
2668 | if ($r6===self::$FAILED) { |
2669 | $this->currPos = $p4; |
2670 | $r2 = self::$FAILED; |
2671 | goto seq_1; |
2672 | } |
2673 | $r2 = true; |
2674 | seq_1: |
2675 | if ($r2!==self::$FAILED) { |
2676 | $this->savedPos = $p3; |
2677 | $r2 = $this->a15($r6); |
2678 | } |
2679 | // free $p4 |
2680 | choice_1: |
2681 | if ($r2!==self::$FAILED) { |
2682 | $r1[] = $r2; |
2683 | } else { |
2684 | break; |
2685 | } |
2686 | } |
2687 | // free $r2 |
2688 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2689 | $this->currPos, |
2690 | $r1, |
2691 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2692 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2693 | ); |
2694 | return $r1; |
2695 | } |
2696 | private function parsegeneric_newline_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2697 | $key = json_encode([300, $boolParams & 0x1fff, $param_preproc, $param_th]); |
2698 | $bucket = $this->currPos; |
2699 | $cached = $this->cache[$bucket][$key] ?? null; |
2700 | if ($cached) { |
2701 | $this->currPos = $cached->nextPos; |
2702 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2703 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2704 | return $cached->result; |
2705 | } |
2706 | $saved_preproc=$param_preproc; |
2707 | $saved_th=$param_th; |
2708 | $r1 = []; |
2709 | for (;;) { |
2710 | $r2 = $this->parsegeneric_newline_attribute(true, $boolParams, $param_preproc, $param_th); |
2711 | if ($r2!==self::$FAILED) { |
2712 | $r1[] = $r2; |
2713 | } else { |
2714 | break; |
2715 | } |
2716 | } |
2717 | // free $r2 |
2718 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2719 | $this->currPos, |
2720 | $r1, |
2721 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2722 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2723 | ); |
2724 | return $r1; |
2725 | } |
2726 | private function parsetplarg_or_template_or_bust($silence, &$param_preproc) { |
2727 | $key = json_encode([368, $param_preproc]); |
2728 | $bucket = $this->currPos; |
2729 | $cached = $this->cache[$bucket][$key] ?? null; |
2730 | if ($cached) { |
2731 | $this->currPos = $cached->nextPos; |
2732 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2733 | return $cached->result; |
2734 | } |
2735 | $saved_preproc=$param_preproc; |
2736 | $p2 = $this->currPos; |
2737 | $r3 = []; |
2738 | for (;;) { |
2739 | // start choice_1 |
2740 | $r4 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2741 | if ($r4!==self::$FAILED) { |
2742 | goto choice_1; |
2743 | } |
2744 | if ($this->currPos < $this->inputLength) { |
2745 | $r4 = self::consumeChar($this->input, $this->currPos);; |
2746 | } else { |
2747 | $r4 = self::$FAILED; |
2748 | if (!$silence) {$this->fail(7);} |
2749 | } |
2750 | choice_1: |
2751 | if ($r4!==self::$FAILED) { |
2752 | $r3[] = $r4; |
2753 | } else { |
2754 | break; |
2755 | } |
2756 | } |
2757 | if (count($r3) === 0) { |
2758 | $r3 = self::$FAILED; |
2759 | } |
2760 | // r <- $r3 |
2761 | // free $r4 |
2762 | $r1 = $r3; |
2763 | if ($r1!==self::$FAILED) { |
2764 | $this->savedPos = $p2; |
2765 | $r1 = $this->a16($r3); |
2766 | } |
2767 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2768 | $this->currPos, |
2769 | $r1, |
2770 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2771 | self::$UNDEFINED |
2772 | ); |
2773 | return $r1; |
2774 | } |
2775 | private function parseextlink($silence, $boolParams, &$param_preproc, &$param_th) { |
2776 | $key = json_encode([344, $boolParams & 0x1fff, $param_preproc, $param_th]); |
2777 | $bucket = $this->currPos; |
2778 | $cached = $this->cache[$bucket][$key] ?? null; |
2779 | if ($cached) { |
2780 | $this->currPos = $cached->nextPos; |
2781 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2782 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2783 | return $cached->result; |
2784 | } |
2785 | $saved_preproc=$param_preproc; |
2786 | $saved_th=$param_th; |
2787 | $p2 = $this->currPos; |
2788 | // start seq_1 |
2789 | $p3 = $this->currPos; |
2790 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
2791 | $r4 = false; |
2792 | } else { |
2793 | $r4 = self::$FAILED; |
2794 | $r1 = self::$FAILED; |
2795 | goto seq_1; |
2796 | } |
2797 | $p6 = $this->currPos; |
2798 | // start seq_2 |
2799 | $p7 = $this->currPos; |
2800 | if (($this->input[$this->currPos] ?? null) === "[") { |
2801 | $this->currPos++; |
2802 | $r8 = "["; |
2803 | } else { |
2804 | $r8 = self::$FAILED; |
2805 | $r5 = self::$FAILED; |
2806 | goto seq_2; |
2807 | } |
2808 | $p10 = $this->currPos; |
2809 | $r9 = ''; |
2810 | // p0 <- $r9 |
2811 | if ($r9!==self::$FAILED) { |
2812 | $this->savedPos = $p10; |
2813 | $r9 = $this->a17(); |
2814 | } else { |
2815 | $this->currPos = $p7; |
2816 | $r5 = self::$FAILED; |
2817 | goto seq_2; |
2818 | } |
2819 | $p12 = $this->currPos; |
2820 | // start seq_3 |
2821 | $p13 = $this->currPos; |
2822 | // start choice_1 |
2823 | // start seq_4 |
2824 | $p15 = $this->currPos; |
2825 | $r16 = $this->parseurl_protocol(true); |
2826 | if ($r16===self::$FAILED) { |
2827 | $r14 = self::$FAILED; |
2828 | goto seq_4; |
2829 | } |
2830 | $r17 = $this->parseipv6urladdr(true); |
2831 | if ($r17===self::$FAILED) { |
2832 | $this->currPos = $p15; |
2833 | $r14 = self::$FAILED; |
2834 | goto seq_4; |
2835 | } |
2836 | $r14 = [$r16,$r17]; |
2837 | seq_4: |
2838 | if ($r14!==self::$FAILED) { |
2839 | goto choice_1; |
2840 | } |
2841 | // free $p15 |
2842 | $r14 = ''; |
2843 | choice_1: |
2844 | // addr <- $r14 |
2845 | if ($r14===self::$FAILED) { |
2846 | $r11 = self::$FAILED; |
2847 | goto seq_3; |
2848 | } |
2849 | // start choice_2 |
2850 | $r18 = $this->parseextlink_nonipv6url(true, $boolParams | 0x8, $param_preproc, $param_th); |
2851 | if ($r18!==self::$FAILED) { |
2852 | goto choice_2; |
2853 | } |
2854 | $r18 = ''; |
2855 | choice_2: |
2856 | // target <- $r18 |
2857 | if ($r18===self::$FAILED) { |
2858 | $this->currPos = $p13; |
2859 | $r11 = self::$FAILED; |
2860 | goto seq_3; |
2861 | } |
2862 | $r11 = true; |
2863 | seq_3: |
2864 | // flat <- $r11 |
2865 | if ($r11!==self::$FAILED) { |
2866 | $this->savedPos = $p12; |
2867 | $r11 = $this->a18($r9, $r14, $r18); |
2868 | } else { |
2869 | $this->currPos = $p7; |
2870 | $r5 = self::$FAILED; |
2871 | goto seq_2; |
2872 | } |
2873 | // free $p13 |
2874 | $this->savedPos = $this->currPos; |
2875 | $r19 = $this->a19($r9, $r11); |
2876 | if ($r19) { |
2877 | $r19 = false; |
2878 | } else { |
2879 | $r19 = self::$FAILED; |
2880 | $this->currPos = $p7; |
2881 | $r5 = self::$FAILED; |
2882 | goto seq_2; |
2883 | } |
2884 | $p13 = $this->currPos; |
2885 | $r20 = ''; |
2886 | // p1 <- $r20 |
2887 | if ($r20!==self::$FAILED) { |
2888 | $this->savedPos = $p13; |
2889 | $r20 = $this->a20($r9, $r11); |
2890 | } else { |
2891 | $this->currPos = $p7; |
2892 | $r5 = self::$FAILED; |
2893 | goto seq_2; |
2894 | } |
2895 | $p15 = $this->currPos; |
2896 | for (;;) { |
2897 | // start choice_3 |
2898 | $r22 = $this->discardspace(true); |
2899 | if ($r22!==self::$FAILED) { |
2900 | goto choice_3; |
2901 | } |
2902 | $r22 = $this->discardunispace(true); |
2903 | choice_3: |
2904 | if ($r22===self::$FAILED) { |
2905 | break; |
2906 | } |
2907 | } |
2908 | // free $r22 |
2909 | $r21 = true; |
2910 | // sp <- $r21 |
2911 | if ($r21!==self::$FAILED) { |
2912 | $r21 = substr($this->input, $p15, $this->currPos - $p15); |
2913 | } else { |
2914 | $r21 = self::$FAILED; |
2915 | $this->currPos = $p7; |
2916 | $r5 = self::$FAILED; |
2917 | goto seq_2; |
2918 | } |
2919 | // free $p15 |
2920 | $p15 = $this->currPos; |
2921 | $r22 = ''; |
2922 | // p2 <- $r22 |
2923 | if ($r22!==self::$FAILED) { |
2924 | $this->savedPos = $p15; |
2925 | $r22 = $this->a21($r9, $r11, $r20, $r21); |
2926 | } else { |
2927 | $this->currPos = $p7; |
2928 | $r5 = self::$FAILED; |
2929 | goto seq_2; |
2930 | } |
2931 | $r23 = $this->parseinlineline(true, $boolParams | 0x8, $param_preproc, $param_th); |
2932 | if ($r23===self::$FAILED) { |
2933 | $r23 = null; |
2934 | } |
2935 | // content <- $r23 |
2936 | $p25 = $this->currPos; |
2937 | $r24 = ''; |
2938 | // p3 <- $r24 |
2939 | if ($r24!==self::$FAILED) { |
2940 | $this->savedPos = $p25; |
2941 | $r24 = $this->a22($r9, $r11, $r20, $r21, $r22, $r23); |
2942 | } else { |
2943 | $this->currPos = $p7; |
2944 | $r5 = self::$FAILED; |
2945 | goto seq_2; |
2946 | } |
2947 | if (($this->input[$this->currPos] ?? null) === "]") { |
2948 | $this->currPos++; |
2949 | $r26 = "]"; |
2950 | } else { |
2951 | $r26 = self::$FAILED; |
2952 | $this->currPos = $p7; |
2953 | $r5 = self::$FAILED; |
2954 | goto seq_2; |
2955 | } |
2956 | $r5 = true; |
2957 | seq_2: |
2958 | // r <- $r5 |
2959 | if ($r5!==self::$FAILED) { |
2960 | $this->savedPos = $p6; |
2961 | $r5 = $this->a23($r9, $r11, $r20, $r21, $r22, $r23, $r24); |
2962 | } else { |
2963 | $this->currPos = $p3; |
2964 | $r1 = self::$FAILED; |
2965 | goto seq_1; |
2966 | } |
2967 | // free $p7 |
2968 | $r1 = true; |
2969 | seq_1: |
2970 | if ($r1!==self::$FAILED) { |
2971 | $this->savedPos = $p2; |
2972 | $r1 = $this->a24($r5); |
2973 | } else { |
2974 | if (!$silence) {$this->fail(8);} |
2975 | } |
2976 | // free $p3 |
2977 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2978 | $this->currPos, |
2979 | $r1, |
2980 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2981 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2982 | ); |
2983 | return $r1; |
2984 | } |
2985 | private function parselist_item($silence, $boolParams, &$param_preproc, &$param_th) { |
2986 | $key = json_encode([476, $boolParams & 0x1fff, $param_preproc, $param_th]); |
2987 | $bucket = $this->currPos; |
2988 | $cached = $this->cache[$bucket][$key] ?? null; |
2989 | if ($cached) { |
2990 | $this->currPos = $cached->nextPos; |
2991 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2992 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2993 | return $cached->result; |
2994 | } |
2995 | $saved_preproc=$param_preproc; |
2996 | $saved_th=$param_th; |
2997 | // start choice_1 |
2998 | $r1 = $this->parsedtdd($silence, $boolParams, $param_preproc, $param_th); |
2999 | if ($r1!==self::$FAILED) { |
3000 | goto choice_1; |
3001 | } |
3002 | $r1 = $this->parsehacky_dl_uses($silence, $boolParams, $param_preproc, $param_th); |
3003 | if ($r1!==self::$FAILED) { |
3004 | goto choice_1; |
3005 | } |
3006 | $r1 = $this->parseli($silence, $boolParams, $param_preproc, $param_th); |
3007 | choice_1: |
3008 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3009 | $this->currPos, |
3010 | $r1, |
3011 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3012 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3013 | ); |
3014 | return $r1; |
3015 | } |
3016 | private function parsetlb($silence, &$param_preproc) { |
3017 | $key = json_encode([306, $param_preproc]); |
3018 | $bucket = $this->currPos; |
3019 | $cached = $this->cache[$bucket][$key] ?? null; |
3020 | if ($cached) { |
3021 | $this->currPos = $cached->nextPos; |
3022 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3023 | return $cached->result; |
3024 | } |
3025 | $saved_preproc=$param_preproc; |
3026 | $p2 = $this->currPos; |
3027 | // start seq_1 |
3028 | $p3 = $this->currPos; |
3029 | $p4 = $this->currPos; |
3030 | $r5 = $this->discardeof(true); |
3031 | if ($r5 === self::$FAILED) { |
3032 | $r5 = false; |
3033 | } else { |
3034 | $r5 = self::$FAILED; |
3035 | $this->currPos = $p4; |
3036 | $r1 = self::$FAILED; |
3037 | goto seq_1; |
3038 | } |
3039 | // free $p4 |
3040 | $r6 = $this->parseblock(true, 0x0, self::newRef(null), $param_preproc); |
3041 | // b <- $r6 |
3042 | if ($r6===self::$FAILED) { |
3043 | $this->currPos = $p3; |
3044 | $r1 = self::$FAILED; |
3045 | goto seq_1; |
3046 | } |
3047 | $r1 = true; |
3048 | seq_1: |
3049 | if ($r1!==self::$FAILED) { |
3050 | $this->savedPos = $p2; |
3051 | $r1 = $this->a25($r6); |
3052 | } else { |
3053 | if (!$silence) {$this->fail(9);} |
3054 | } |
3055 | // free $p3 |
3056 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3057 | $this->currPos, |
3058 | $r1, |
3059 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3060 | self::$UNDEFINED |
3061 | ); |
3062 | return $r1; |
3063 | } |
3064 | private function parsenewlineToken($silence) { |
3065 | $key = 568; |
3066 | $bucket = $this->currPos; |
3067 | $cached = $this->cache[$bucket][$key] ?? null; |
3068 | if ($cached) { |
3069 | $this->currPos = $cached->nextPos; |
3070 | |
3071 | return $cached->result; |
3072 | } |
3073 | |
3074 | $p2 = $this->currPos; |
3075 | $r1 = $this->discardnewline($silence); |
3076 | if ($r1!==self::$FAILED) { |
3077 | $this->savedPos = $p2; |
3078 | $r1 = $this->a26(); |
3079 | } |
3080 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3081 | $this->currPos, |
3082 | $r1, |
3083 | self::$UNDEFINED, |
3084 | self::$UNDEFINED |
3085 | ); |
3086 | return $r1; |
3087 | } |
3088 | private function parsespace($silence) { |
3089 | $key = 558; |
3090 | $bucket = $this->currPos; |
3091 | $cached = $this->cache[$bucket][$key] ?? null; |
3092 | if ($cached) { |
3093 | $this->currPos = $cached->nextPos; |
3094 | |
3095 | return $cached->result; |
3096 | } |
3097 | |
3098 | $r1 = $this->input[$this->currPos] ?? ''; |
3099 | if ($r1 === " " || $r1 === "\x09") { |
3100 | $this->currPos++; |
3101 | } else { |
3102 | $r1 = self::$FAILED; |
3103 | if (!$silence) {$this->fail(10);} |
3104 | } |
3105 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3106 | $this->currPos, |
3107 | $r1, |
3108 | self::$UNDEFINED, |
3109 | self::$UNDEFINED |
3110 | ); |
3111 | return $r1; |
3112 | } |
3113 | private function parsecomment($silence) { |
3114 | $key = 572; |
3115 | $bucket = $this->currPos; |
3116 | $cached = $this->cache[$bucket][$key] ?? null; |
3117 | if ($cached) { |
3118 | $this->currPos = $cached->nextPos; |
3119 | |
3120 | return $cached->result; |
3121 | } |
3122 | |
3123 | $p2 = $this->currPos; |
3124 | // start seq_1 |
3125 | $p3 = $this->currPos; |
3126 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
3127 | $r4 = "<!--"; |
3128 | $this->currPos += 4; |
3129 | } else { |
3130 | if (!$silence) {$this->fail(11);} |
3131 | $r4 = self::$FAILED; |
3132 | $r1 = self::$FAILED; |
3133 | goto seq_1; |
3134 | } |
3135 | $p6 = $this->currPos; |
3136 | for (;;) { |
3137 | // start seq_2 |
3138 | $p8 = $this->currPos; |
3139 | $p9 = $this->currPos; |
3140 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3141 | $r10 = "-->"; |
3142 | $this->currPos += 3; |
3143 | } else { |
3144 | $r10 = self::$FAILED; |
3145 | } |
3146 | if ($r10 === self::$FAILED) { |
3147 | $r10 = false; |
3148 | } else { |
3149 | $r10 = self::$FAILED; |
3150 | $this->currPos = $p9; |
3151 | $r7 = self::$FAILED; |
3152 | goto seq_2; |
3153 | } |
3154 | // free $p9 |
3155 | if ($this->currPos < $this->inputLength) { |
3156 | $r11 = self::consumeChar($this->input, $this->currPos);; |
3157 | } else { |
3158 | $r11 = self::$FAILED; |
3159 | if (!$silence) {$this->fail(7);} |
3160 | $this->currPos = $p8; |
3161 | $r7 = self::$FAILED; |
3162 | goto seq_2; |
3163 | } |
3164 | $r7 = true; |
3165 | seq_2: |
3166 | if ($r7===self::$FAILED) { |
3167 | break; |
3168 | } |
3169 | // free $p8 |
3170 | } |
3171 | // free $r7 |
3172 | $r5 = true; |
3173 | // c <- $r5 |
3174 | if ($r5!==self::$FAILED) { |
3175 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
3176 | } else { |
3177 | $r5 = self::$FAILED; |
3178 | $this->currPos = $p3; |
3179 | $r1 = self::$FAILED; |
3180 | goto seq_1; |
3181 | } |
3182 | // free $p6 |
3183 | $p6 = $this->currPos; |
3184 | // start choice_1 |
3185 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3186 | $r7 = "-->"; |
3187 | $this->currPos += 3; |
3188 | goto choice_1; |
3189 | } else { |
3190 | if (!$silence) {$this->fail(12);} |
3191 | $r7 = self::$FAILED; |
3192 | } |
3193 | $r7 = $this->discardeof($silence); |
3194 | choice_1: |
3195 | // cEnd <- $r7 |
3196 | if ($r7!==self::$FAILED) { |
3197 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
3198 | } else { |
3199 | $r7 = self::$FAILED; |
3200 | $this->currPos = $p3; |
3201 | $r1 = self::$FAILED; |
3202 | goto seq_1; |
3203 | } |
3204 | // free $p6 |
3205 | $r1 = true; |
3206 | seq_1: |
3207 | if ($r1!==self::$FAILED) { |
3208 | $this->savedPos = $p2; |
3209 | $r1 = $this->a27($r5, $r7); |
3210 | } |
3211 | // free $p3 |
3212 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3213 | $this->currPos, |
3214 | $r1, |
3215 | self::$UNDEFINED, |
3216 | self::$UNDEFINED |
3217 | ); |
3218 | return $r1; |
3219 | } |
3220 | private function parsepipe($silence) { |
3221 | $key = 554; |
3222 | $bucket = $this->currPos; |
3223 | $cached = $this->cache[$bucket][$key] ?? null; |
3224 | if ($cached) { |
3225 | $this->currPos = $cached->nextPos; |
3226 | |
3227 | return $cached->result; |
3228 | } |
3229 | |
3230 | // start choice_1 |
3231 | if (($this->input[$this->currPos] ?? null) === "|") { |
3232 | $this->currPos++; |
3233 | $r1 = "|"; |
3234 | goto choice_1; |
3235 | } else { |
3236 | if (!$silence) {$this->fail(13);} |
3237 | $r1 = self::$FAILED; |
3238 | } |
3239 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3240 | $r1 = "{{!}}"; |
3241 | $this->currPos += 5; |
3242 | } else { |
3243 | if (!$silence) {$this->fail(14);} |
3244 | $r1 = self::$FAILED; |
3245 | } |
3246 | choice_1: |
3247 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3248 | $this->currPos, |
3249 | $r1, |
3250 | self::$UNDEFINED, |
3251 | self::$UNDEFINED |
3252 | ); |
3253 | return $r1; |
3254 | } |
3255 | private function parseurl_protocol($silence) { |
3256 | $key = 354; |
3257 | $bucket = $this->currPos; |
3258 | $cached = $this->cache[$bucket][$key] ?? null; |
3259 | if ($cached) { |
3260 | $this->currPos = $cached->nextPos; |
3261 | |
3262 | return $cached->result; |
3263 | } |
3264 | |
3265 | $p2 = $this->currPos; |
3266 | // start seq_1 |
3267 | $p3 = $this->currPos; |
3268 | $p5 = $this->currPos; |
3269 | // start choice_1 |
3270 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3271 | $r4 = "//"; |
3272 | $this->currPos += 2; |
3273 | goto choice_1; |
3274 | } else { |
3275 | if (!$silence) {$this->fail(15);} |
3276 | $r4 = self::$FAILED; |
3277 | } |
3278 | // start seq_2 |
3279 | $p6 = $this->currPos; |
3280 | $r7 = $this->input[$this->currPos] ?? ''; |
3281 | if (preg_match("/^[A-Za-z]/", $r7)) { |
3282 | $this->currPos++; |
3283 | } else { |
3284 | $r7 = self::$FAILED; |
3285 | if (!$silence) {$this->fail(16);} |
3286 | $r4 = self::$FAILED; |
3287 | goto seq_2; |
3288 | } |
3289 | for (;;) { |
3290 | $r9 = $this->input[$this->currPos] ?? ''; |
3291 | if (preg_match("/^[\\-A-Za-z0-9+.]/", $r9)) { |
3292 | $this->currPos++; |
3293 | } else { |
3294 | $r9 = self::$FAILED; |
3295 | if (!$silence) {$this->fail(17);} |
3296 | break; |
3297 | } |
3298 | } |
3299 | // free $r9 |
3300 | $r8 = true; |
3301 | if ($r8===self::$FAILED) { |
3302 | $this->currPos = $p6; |
3303 | $r4 = self::$FAILED; |
3304 | goto seq_2; |
3305 | } |
3306 | // free $r8 |
3307 | if (($this->input[$this->currPos] ?? null) === ":") { |
3308 | $this->currPos++; |
3309 | $r8 = ":"; |
3310 | } else { |
3311 | if (!$silence) {$this->fail(18);} |
3312 | $r8 = self::$FAILED; |
3313 | $this->currPos = $p6; |
3314 | $r4 = self::$FAILED; |
3315 | goto seq_2; |
3316 | } |
3317 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3318 | $r9 = "//"; |
3319 | $this->currPos += 2; |
3320 | } else { |
3321 | if (!$silence) {$this->fail(15);} |
3322 | $r9 = self::$FAILED; |
3323 | $r9 = null; |
3324 | } |
3325 | $r4 = true; |
3326 | seq_2: |
3327 | // free $p6 |
3328 | choice_1: |
3329 | // p <- $r4 |
3330 | if ($r4!==self::$FAILED) { |
3331 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
3332 | } else { |
3333 | $r4 = self::$FAILED; |
3334 | $r1 = self::$FAILED; |
3335 | goto seq_1; |
3336 | } |
3337 | // free $p5 |
3338 | $this->savedPos = $this->currPos; |
3339 | $r10 = $this->a28($r4); |
3340 | if ($r10) { |
3341 | $r10 = false; |
3342 | } else { |
3343 | $r10 = self::$FAILED; |
3344 | $this->currPos = $p3; |
3345 | $r1 = self::$FAILED; |
3346 | goto seq_1; |
3347 | } |
3348 | $r1 = true; |
3349 | seq_1: |
3350 | if ($r1!==self::$FAILED) { |
3351 | $this->savedPos = $p2; |
3352 | $r1 = $this->a29($r4); |
3353 | } |
3354 | // free $p3 |
3355 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3356 | $this->currPos, |
3357 | $r1, |
3358 | self::$UNDEFINED, |
3359 | self::$UNDEFINED |
3360 | ); |
3361 | return $r1; |
3362 | } |
3363 | private function parseipv6urladdr($silence) { |
3364 | $key = 362; |
3365 | $bucket = $this->currPos; |
3366 | $cached = $this->cache[$bucket][$key] ?? null; |
3367 | if ($cached) { |
3368 | $this->currPos = $cached->nextPos; |
3369 | |
3370 | return $cached->result; |
3371 | } |
3372 | |
3373 | $p1 = $this->currPos; |
3374 | // start seq_1 |
3375 | $p3 = $this->currPos; |
3376 | if (($this->input[$this->currPos] ?? null) === "[") { |
3377 | $this->currPos++; |
3378 | $r4 = "["; |
3379 | } else { |
3380 | if (!$silence) {$this->fail(19);} |
3381 | $r4 = self::$FAILED; |
3382 | $r2 = self::$FAILED; |
3383 | goto seq_1; |
3384 | } |
3385 | $r5 = self::$FAILED; |
3386 | for (;;) { |
3387 | $r6 = $this->input[$this->currPos] ?? ''; |
3388 | if (preg_match("/^[0-9A-Fa-f:.]/", $r6)) { |
3389 | $this->currPos++; |
3390 | $r5 = true; |
3391 | } else { |
3392 | $r6 = self::$FAILED; |
3393 | if (!$silence) {$this->fail(20);} |
3394 | break; |
3395 | } |
3396 | } |
3397 | if ($r5===self::$FAILED) { |
3398 | $this->currPos = $p3; |
3399 | $r2 = self::$FAILED; |
3400 | goto seq_1; |
3401 | } |
3402 | // free $r6 |
3403 | if (($this->input[$this->currPos] ?? null) === "]") { |
3404 | $this->currPos++; |
3405 | $r6 = "]"; |
3406 | } else { |
3407 | if (!$silence) {$this->fail(21);} |
3408 | $r6 = self::$FAILED; |
3409 | $this->currPos = $p3; |
3410 | $r2 = self::$FAILED; |
3411 | goto seq_1; |
3412 | } |
3413 | $r2 = true; |
3414 | seq_1: |
3415 | if ($r2!==self::$FAILED) { |
3416 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3417 | } else { |
3418 | $r2 = self::$FAILED; |
3419 | } |
3420 | // free $p3 |
3421 | // free $p1 |
3422 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3423 | $this->currPos, |
3424 | $r2, |
3425 | self::$UNDEFINED, |
3426 | self::$UNDEFINED |
3427 | ); |
3428 | return $r2; |
3429 | } |
3430 | private function discardinline_breaks($silence, $boolParams, &$param_preproc, &$param_th) { |
3431 | $key = json_encode([327, $boolParams & 0x1ffe, $param_preproc, $param_th]); |
3432 | $bucket = $this->currPos; |
3433 | $cached = $this->cache[$bucket][$key] ?? null; |
3434 | if ($cached) { |
3435 | $this->currPos = $cached->nextPos; |
3436 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3437 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3438 | return $cached->result; |
3439 | } |
3440 | $saved_preproc=$param_preproc; |
3441 | $saved_th=$param_th; |
3442 | // start seq_1 |
3443 | $p1 = $this->currPos; |
3444 | $p3 = $this->currPos; |
3445 | if (strspn($this->input, "=|!{}:;\x0d\x0a[]-", $this->currPos, 1) !== 0) { |
3446 | $r4 = $this->input[$this->currPos++]; |
3447 | $r4 = false; |
3448 | $this->currPos = $p3; |
3449 | } else { |
3450 | $r4 = self::$FAILED; |
3451 | $r2 = self::$FAILED; |
3452 | goto seq_1; |
3453 | } |
3454 | // free $p3 |
3455 | // start seq_2 |
3456 | $p3 = $this->currPos; |
3457 | $this->savedPos = $this->currPos; |
3458 | $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); |
3459 | if ($r6) { |
3460 | $r6 = false; |
3461 | } else { |
3462 | $r6 = self::$FAILED; |
3463 | $this->currPos = $p3; |
3464 | $r5 = self::$FAILED; |
3465 | goto seq_2; |
3466 | } |
3467 | $r5 = true; |
3468 | seq_2: |
3469 | if ($r5===self::$FAILED) { |
3470 | $this->currPos = $p1; |
3471 | $r2 = self::$FAILED; |
3472 | goto seq_1; |
3473 | } |
3474 | // free $r5,$p3 |
3475 | $r2 = true; |
3476 | seq_1: |
3477 | // free $r2,$p1 |
3478 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3479 | $this->currPos, |
3480 | $r2, |
3481 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3482 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3483 | ); |
3484 | return $r2; |
3485 | } |
3486 | private function parseno_punctuation_char($silence) { |
3487 | $key = 356; |
3488 | $bucket = $this->currPos; |
3489 | $cached = $this->cache[$bucket][$key] ?? null; |
3490 | if ($cached) { |
3491 | $this->currPos = $cached->nextPos; |
3492 | |
3493 | return $cached->result; |
3494 | } |
3495 | |
3496 | $r1 = self::charAt($this->input, $this->currPos); |
3497 | 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)) { |
3498 | $this->currPos += strlen($r1); |
3499 | } else { |
3500 | $r1 = self::$FAILED; |
3501 | if (!$silence) {$this->fail(22);} |
3502 | } |
3503 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3504 | $this->currPos, |
3505 | $r1, |
3506 | self::$UNDEFINED, |
3507 | self::$UNDEFINED |
3508 | ); |
3509 | return $r1; |
3510 | } |
3511 | private function parsetplarg_or_template($silence, $boolParams, &$param_th, &$param_preproc) { |
3512 | $key = json_encode([364, $boolParams & 0x1fef, $param_th, $param_preproc]); |
3513 | $bucket = $this->currPos; |
3514 | $cached = $this->cache[$bucket][$key] ?? null; |
3515 | if ($cached) { |
3516 | $this->currPos = $cached->nextPos; |
3517 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3518 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3519 | return $cached->result; |
3520 | } |
3521 | $saved_th=$param_th; |
3522 | $saved_preproc=$param_preproc; |
3523 | $p2 = $this->currPos; |
3524 | // start seq_1 |
3525 | $p3 = $this->currPos; |
3526 | $p4 = $this->currPos; |
3527 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
3528 | $r5 = "{{"; |
3529 | $this->currPos += 2; |
3530 | $r5 = false; |
3531 | $this->currPos = $p4; |
3532 | } else { |
3533 | $r5 = self::$FAILED; |
3534 | $r1 = self::$FAILED; |
3535 | goto seq_1; |
3536 | } |
3537 | // free $p4 |
3538 | $r6 = $this->parsetplarg_or_template_guarded($silence, $boolParams | 0x10, $param_th, $param_preproc); |
3539 | // t <- $r6 |
3540 | if ($r6===self::$FAILED) { |
3541 | $this->currPos = $p3; |
3542 | $r1 = self::$FAILED; |
3543 | goto seq_1; |
3544 | } |
3545 | $r1 = true; |
3546 | seq_1: |
3547 | if ($r1!==self::$FAILED) { |
3548 | $this->savedPos = $p2; |
3549 | $r1 = $this->a31($r6); |
3550 | } |
3551 | // free $p3 |
3552 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3553 | $this->currPos, |
3554 | $r1, |
3555 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3556 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3557 | ); |
3558 | return $r1; |
3559 | } |
3560 | private function parsehtmlentity($silence) { |
3561 | $key = 528; |
3562 | $bucket = $this->currPos; |
3563 | $cached = $this->cache[$bucket][$key] ?? null; |
3564 | if ($cached) { |
3565 | $this->currPos = $cached->nextPos; |
3566 | |
3567 | return $cached->result; |
3568 | } |
3569 | |
3570 | $p2 = $this->currPos; |
3571 | $r3 = $this->parseraw_htmlentity($silence); |
3572 | // cc <- $r3 |
3573 | $r1 = $r3; |
3574 | if ($r1!==self::$FAILED) { |
3575 | $this->savedPos = $p2; |
3576 | $r1 = $this->a32($r3); |
3577 | } |
3578 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3579 | $this->currPos, |
3580 | $r1, |
3581 | self::$UNDEFINED, |
3582 | self::$UNDEFINED |
3583 | ); |
3584 | return $r1; |
3585 | } |
3586 | private function parseoptional_spaces($silence) { |
3587 | $key = 560; |
3588 | $bucket = $this->currPos; |
3589 | $cached = $this->cache[$bucket][$key] ?? null; |
3590 | if ($cached) { |
3591 | $this->currPos = $cached->nextPos; |
3592 | |
3593 | return $cached->result; |
3594 | } |
3595 | |
3596 | $p1 = $this->currPos; |
3597 | for (;;) { |
3598 | $r3 = $this->input[$this->currPos] ?? ''; |
3599 | if ($r3 === " " || $r3 === "\x09") { |
3600 | $this->currPos++; |
3601 | } else { |
3602 | $r3 = self::$FAILED; |
3603 | if (!$silence) {$this->fail(10);} |
3604 | break; |
3605 | } |
3606 | } |
3607 | // free $r3 |
3608 | $r2 = true; |
3609 | if ($r2!==self::$FAILED) { |
3610 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3611 | } else { |
3612 | $r2 = self::$FAILED; |
3613 | } |
3614 | // free $p1 |
3615 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3616 | $this->currPos, |
3617 | $r2, |
3618 | self::$UNDEFINED, |
3619 | self::$UNDEFINED |
3620 | ); |
3621 | return $r2; |
3622 | } |
3623 | private function discardpipe($silence) { |
3624 | $key = 555; |
3625 | $bucket = $this->currPos; |
3626 | $cached = $this->cache[$bucket][$key] ?? null; |
3627 | if ($cached) { |
3628 | $this->currPos = $cached->nextPos; |
3629 | |
3630 | return $cached->result; |
3631 | } |
3632 | |
3633 | // start choice_1 |
3634 | if (($this->input[$this->currPos] ?? null) === "|") { |
3635 | $this->currPos++; |
3636 | $r1 = "|"; |
3637 | goto choice_1; |
3638 | } else { |
3639 | if (!$silence) {$this->fail(13);} |
3640 | $r1 = self::$FAILED; |
3641 | } |
3642 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3643 | $r1 = "{{!}}"; |
3644 | $this->currPos += 5; |
3645 | } else { |
3646 | if (!$silence) {$this->fail(14);} |
3647 | $r1 = self::$FAILED; |
3648 | } |
3649 | choice_1: |
3650 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3651 | $this->currPos, |
3652 | $r1, |
3653 | self::$UNDEFINED, |
3654 | self::$UNDEFINED |
3655 | ); |
3656 | return $r1; |
3657 | } |
3658 | private function parsetable_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3659 | $key = json_encode([462, $boolParams & 0x1fff, $param_preproc, $param_th]); |
3660 | $bucket = $this->currPos; |
3661 | $cached = $this->cache[$bucket][$key] ?? null; |
3662 | if ($cached) { |
3663 | $this->currPos = $cached->nextPos; |
3664 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3665 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3666 | return $cached->result; |
3667 | } |
3668 | $saved_preproc=$param_preproc; |
3669 | $saved_th=$param_th; |
3670 | $p2 = $this->currPos; |
3671 | // start seq_1 |
3672 | $p3 = $this->currPos; |
3673 | $r4 = $this->parseoptionalSpaceToken($silence); |
3674 | // s <- $r4 |
3675 | if ($r4===self::$FAILED) { |
3676 | $r1 = self::$FAILED; |
3677 | goto seq_1; |
3678 | } |
3679 | $p6 = $this->currPos; |
3680 | $r5 = ''; |
3681 | // namePos0 <- $r5 |
3682 | if ($r5!==self::$FAILED) { |
3683 | $this->savedPos = $p6; |
3684 | $r5 = $this->a33($r4); |
3685 | } else { |
3686 | $this->currPos = $p3; |
3687 | $r1 = self::$FAILED; |
3688 | goto seq_1; |
3689 | } |
3690 | $r7 = $this->parsetable_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3691 | // name <- $r7 |
3692 | if ($r7===self::$FAILED) { |
3693 | $this->currPos = $p3; |
3694 | $r1 = self::$FAILED; |
3695 | goto seq_1; |
3696 | } |
3697 | $p9 = $this->currPos; |
3698 | $r8 = ''; |
3699 | // namePos1 <- $r8 |
3700 | if ($r8!==self::$FAILED) { |
3701 | $this->savedPos = $p9; |
3702 | $r8 = $this->a34($r4, $r5, $r7); |
3703 | } else { |
3704 | $this->currPos = $p3; |
3705 | $r1 = self::$FAILED; |
3706 | goto seq_1; |
3707 | } |
3708 | $p11 = $this->currPos; |
3709 | // start seq_2 |
3710 | $p12 = $this->currPos; |
3711 | $r13 = $this->discardoptionalSpaceToken($silence); |
3712 | if ($r13===self::$FAILED) { |
3713 | $r10 = self::$FAILED; |
3714 | goto seq_2; |
3715 | } |
3716 | if (($this->input[$this->currPos] ?? null) === "=") { |
3717 | $this->currPos++; |
3718 | $r14 = "="; |
3719 | } else { |
3720 | if (!$silence) {$this->fail(23);} |
3721 | $r14 = self::$FAILED; |
3722 | $this->currPos = $p12; |
3723 | $r10 = self::$FAILED; |
3724 | goto seq_2; |
3725 | } |
3726 | $r15 = $this->parsetable_att_value($silence, $boolParams, $param_preproc, $param_th); |
3727 | if ($r15===self::$FAILED) { |
3728 | $r15 = null; |
3729 | } |
3730 | // v <- $r15 |
3731 | $r10 = true; |
3732 | seq_2: |
3733 | if ($r10!==self::$FAILED) { |
3734 | $this->savedPos = $p11; |
3735 | $r10 = $this->a35($r4, $r5, $r7, $r8, $r15); |
3736 | } else { |
3737 | $r10 = null; |
3738 | } |
3739 | // free $p12 |
3740 | // vd <- $r10 |
3741 | $r1 = true; |
3742 | seq_1: |
3743 | if ($r1!==self::$FAILED) { |
3744 | $this->savedPos = $p2; |
3745 | $r1 = $this->a36($r4, $r5, $r7, $r8, $r10); |
3746 | } |
3747 | // free $p3 |
3748 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3749 | $this->currPos, |
3750 | $r1, |
3751 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3752 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3753 | ); |
3754 | return $r1; |
3755 | } |
3756 | private function discardoptionalSpaceToken($silence) { |
3757 | $key = 577; |
3758 | $bucket = $this->currPos; |
3759 | $cached = $this->cache[$bucket][$key] ?? null; |
3760 | if ($cached) { |
3761 | $this->currPos = $cached->nextPos; |
3762 | |
3763 | return $cached->result; |
3764 | } |
3765 | |
3766 | $p2 = $this->currPos; |
3767 | $r3 = $this->parseoptional_spaces($silence); |
3768 | // s <- $r3 |
3769 | $r1 = $r3; |
3770 | if ($r1!==self::$FAILED) { |
3771 | $this->savedPos = $p2; |
3772 | $r1 = $this->a37($r3); |
3773 | } |
3774 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3775 | $this->currPos, |
3776 | $r1, |
3777 | self::$UNDEFINED, |
3778 | self::$UNDEFINED |
3779 | ); |
3780 | return $r1; |
3781 | } |
3782 | private function parsebroken_table_attribute_name_char($silence) { |
3783 | $key = 468; |
3784 | $bucket = $this->currPos; |
3785 | $cached = $this->cache[$bucket][$key] ?? null; |
3786 | if ($cached) { |
3787 | $this->currPos = $cached->nextPos; |
3788 | |
3789 | return $cached->result; |
3790 | } |
3791 | |
3792 | $p2 = $this->currPos; |
3793 | // c <- $r3 |
3794 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
3795 | $r3 = $this->input[$this->currPos++]; |
3796 | } else { |
3797 | $r3 = self::$FAILED; |
3798 | if (!$silence) {$this->fail(24);} |
3799 | } |
3800 | $r1 = $r3; |
3801 | if ($r1!==self::$FAILED) { |
3802 | $this->savedPos = $p2; |
3803 | $r1 = $this->a38($r3); |
3804 | } |
3805 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3806 | $this->currPos, |
3807 | $r1, |
3808 | self::$UNDEFINED, |
3809 | self::$UNDEFINED |
3810 | ); |
3811 | return $r1; |
3812 | } |
3813 | private function parsegeneric_newline_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3814 | $key = json_encode([460, $boolParams & 0x1fff, $param_preproc, $param_th]); |
3815 | $bucket = $this->currPos; |
3816 | $cached = $this->cache[$bucket][$key] ?? null; |
3817 | if ($cached) { |
3818 | $this->currPos = $cached->nextPos; |
3819 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3820 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3821 | return $cached->result; |
3822 | } |
3823 | $saved_preproc=$param_preproc; |
3824 | $saved_th=$param_th; |
3825 | $p2 = $this->currPos; |
3826 | // start seq_1 |
3827 | $p3 = $this->currPos; |
3828 | for (;;) { |
3829 | $r5 = $this->discardspace_or_newline_or_solidus($silence); |
3830 | if ($r5===self::$FAILED) { |
3831 | break; |
3832 | } |
3833 | } |
3834 | // free $r5 |
3835 | $r4 = true; |
3836 | if ($r4===self::$FAILED) { |
3837 | $r1 = self::$FAILED; |
3838 | goto seq_1; |
3839 | } |
3840 | // free $r4 |
3841 | $p6 = $this->currPos; |
3842 | $r4 = ''; |
3843 | // namePos0 <- $r4 |
3844 | if ($r4!==self::$FAILED) { |
3845 | $this->savedPos = $p6; |
3846 | $r4 = $this->a17(); |
3847 | } else { |
3848 | $this->currPos = $p3; |
3849 | $r1 = self::$FAILED; |
3850 | goto seq_1; |
3851 | } |
3852 | $r5 = $this->parsegeneric_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3853 | // name <- $r5 |
3854 | if ($r5===self::$FAILED) { |
3855 | $this->currPos = $p3; |
3856 | $r1 = self::$FAILED; |
3857 | goto seq_1; |
3858 | } |
3859 | $p8 = $this->currPos; |
3860 | $r7 = ''; |
3861 | // namePos1 <- $r7 |
3862 | if ($r7!==self::$FAILED) { |
3863 | $this->savedPos = $p8; |
3864 | $r7 = $this->a39($r4, $r5); |
3865 | } else { |
3866 | $this->currPos = $p3; |
3867 | $r1 = self::$FAILED; |
3868 | goto seq_1; |
3869 | } |
3870 | $p10 = $this->currPos; |
3871 | // start seq_2 |
3872 | $p11 = $this->currPos; |
3873 | for (;;) { |
3874 | $r13 = $this->discardspace_or_newline($silence); |
3875 | if ($r13===self::$FAILED) { |
3876 | break; |
3877 | } |
3878 | } |
3879 | // free $r13 |
3880 | $r12 = true; |
3881 | if ($r12===self::$FAILED) { |
3882 | $r9 = self::$FAILED; |
3883 | goto seq_2; |
3884 | } |
3885 | // free $r12 |
3886 | if (($this->input[$this->currPos] ?? null) === "=") { |
3887 | $this->currPos++; |
3888 | $r12 = "="; |
3889 | } else { |
3890 | if (!$silence) {$this->fail(23);} |
3891 | $r12 = self::$FAILED; |
3892 | $this->currPos = $p11; |
3893 | $r9 = self::$FAILED; |
3894 | goto seq_2; |
3895 | } |
3896 | $r13 = $this->parsegeneric_att_value($silence, $boolParams, $param_preproc, $param_th); |
3897 | if ($r13===self::$FAILED) { |
3898 | $r13 = null; |
3899 | } |
3900 | // v <- $r13 |
3901 | $r9 = true; |
3902 | seq_2: |
3903 | if ($r9!==self::$FAILED) { |
3904 | $this->savedPos = $p10; |
3905 | $r9 = $this->a40($r4, $r5, $r7, $r13); |
3906 | } else { |
3907 | $r9 = null; |
3908 | } |
3909 | // free $p11 |
3910 | // vd <- $r9 |
3911 | $r1 = true; |
3912 | seq_1: |
3913 | if ($r1!==self::$FAILED) { |
3914 | $this->savedPos = $p2; |
3915 | $r1 = $this->a41($r4, $r5, $r7, $r9); |
3916 | } |
3917 | // free $p3 |
3918 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3919 | $this->currPos, |
3920 | $r1, |
3921 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3922 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3923 | ); |
3924 | return $r1; |
3925 | } |
3926 | private function parseextlink_nonipv6url($silence, $boolParams, &$param_preproc, &$param_th) { |
3927 | $key = json_encode([538, $boolParams & 0x17ff, $param_preproc, $param_th]); |
3928 | $bucket = $this->currPos; |
3929 | $cached = $this->cache[$bucket][$key] ?? null; |
3930 | if ($cached) { |
3931 | $this->currPos = $cached->nextPos; |
3932 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3933 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3934 | return $cached->result; |
3935 | } |
3936 | $saved_preproc=$param_preproc; |
3937 | $saved_th=$param_th; |
3938 | $r1 = $this->parseextlink_nonipv6url_parameterized($silence, $boolParams & ~0x800, $param_preproc, $param_th); |
3939 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3940 | $this->currPos, |
3941 | $r1, |
3942 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3943 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3944 | ); |
3945 | return $r1; |
3946 | } |
3947 | private function discardspace($silence) { |
3948 | $key = 559; |
3949 | $bucket = $this->currPos; |
3950 | $cached = $this->cache[$bucket][$key] ?? null; |
3951 | if ($cached) { |
3952 | $this->currPos = $cached->nextPos; |
3953 | |
3954 | return $cached->result; |
3955 | } |
3956 | |
3957 | $r1 = $this->input[$this->currPos] ?? ''; |
3958 | if ($r1 === " " || $r1 === "\x09") { |
3959 | $this->currPos++; |
3960 | } else { |
3961 | $r1 = self::$FAILED; |
3962 | if (!$silence) {$this->fail(10);} |
3963 | } |
3964 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3965 | $this->currPos, |
3966 | $r1, |
3967 | self::$UNDEFINED, |
3968 | self::$UNDEFINED |
3969 | ); |
3970 | return $r1; |
3971 | } |
3972 | private function discardunispace($silence) { |
3973 | $key = 583; |
3974 | $bucket = $this->currPos; |
3975 | $cached = $this->cache[$bucket][$key] ?? null; |
3976 | if ($cached) { |
3977 | $this->currPos = $cached->nextPos; |
3978 | |
3979 | return $cached->result; |
3980 | } |
3981 | |
3982 | $r1 = self::charAt($this->input, $this->currPos); |
3983 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
3984 | $this->currPos += strlen($r1); |
3985 | } else { |
3986 | $r1 = self::$FAILED; |
3987 | if (!$silence) {$this->fail(25);} |
3988 | } |
3989 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3990 | $this->currPos, |
3991 | $r1, |
3992 | self::$UNDEFINED, |
3993 | self::$UNDEFINED |
3994 | ); |
3995 | return $r1; |
3996 | } |
3997 | private function parseinlineline($silence, $boolParams, &$param_preproc, &$param_th) { |
3998 | $key = json_encode([328, $boolParams & 0x1fff, $param_preproc, $param_th]); |
3999 | $bucket = $this->currPos; |
4000 | $cached = $this->cache[$bucket][$key] ?? null; |
4001 | if ($cached) { |
4002 | $this->currPos = $cached->nextPos; |
4003 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4004 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4005 | return $cached->result; |
4006 | } |
4007 | $saved_preproc=$param_preproc; |
4008 | $saved_th=$param_th; |
4009 | $p2 = $this->currPos; |
4010 | $r3 = []; |
4011 | for (;;) { |
4012 | // start choice_1 |
4013 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
4014 | if ($r4!==self::$FAILED) { |
4015 | goto choice_1; |
4016 | } |
4017 | $p5 = $this->currPos; |
4018 | // start seq_1 |
4019 | $p6 = $this->currPos; |
4020 | $p7 = $this->currPos; |
4021 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4022 | if ($r8 === self::$FAILED) { |
4023 | $r8 = false; |
4024 | } else { |
4025 | $r8 = self::$FAILED; |
4026 | $this->currPos = $p7; |
4027 | $r4 = self::$FAILED; |
4028 | goto seq_1; |
4029 | } |
4030 | // free $p7 |
4031 | // start choice_2 |
4032 | $r9 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
4033 | if ($r9!==self::$FAILED) { |
4034 | goto choice_2; |
4035 | } |
4036 | $p7 = $this->currPos; |
4037 | // start seq_2 |
4038 | $p10 = $this->currPos; |
4039 | $p11 = $this->currPos; |
4040 | $r12 = $this->discardnewline(true); |
4041 | if ($r12 === self::$FAILED) { |
4042 | $r12 = false; |
4043 | } else { |
4044 | $r12 = self::$FAILED; |
4045 | $this->currPos = $p11; |
4046 | $r9 = self::$FAILED; |
4047 | goto seq_2; |
4048 | } |
4049 | // free $p11 |
4050 | // s <- $r13 |
4051 | if ($this->currPos < $this->inputLength) { |
4052 | $r13 = self::consumeChar($this->input, $this->currPos);; |
4053 | } else { |
4054 | $r13 = self::$FAILED; |
4055 | if (!$silence) {$this->fail(7);} |
4056 | $this->currPos = $p10; |
4057 | $r9 = self::$FAILED; |
4058 | goto seq_2; |
4059 | } |
4060 | $r9 = true; |
4061 | seq_2: |
4062 | if ($r9!==self::$FAILED) { |
4063 | $this->savedPos = $p7; |
4064 | $r9 = $this->a42($r13); |
4065 | } |
4066 | // free $p10 |
4067 | choice_2: |
4068 | // r <- $r9 |
4069 | if ($r9===self::$FAILED) { |
4070 | $this->currPos = $p6; |
4071 | $r4 = self::$FAILED; |
4072 | goto seq_1; |
4073 | } |
4074 | $r4 = true; |
4075 | seq_1: |
4076 | if ($r4!==self::$FAILED) { |
4077 | $this->savedPos = $p5; |
4078 | $r4 = $this->a24($r9); |
4079 | } |
4080 | // free $p6 |
4081 | choice_1: |
4082 | if ($r4!==self::$FAILED) { |
4083 | $r3[] = $r4; |
4084 | } else { |
4085 | break; |
4086 | } |
4087 | } |
4088 | if (count($r3) === 0) { |
4089 | $r3 = self::$FAILED; |
4090 | } |
4091 | // c <- $r3 |
4092 | // free $r4 |
4093 | $r1 = $r3; |
4094 | if ($r1!==self::$FAILED) { |
4095 | $this->savedPos = $p2; |
4096 | $r1 = $this->a43($r3); |
4097 | } |
4098 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4099 | $this->currPos, |
4100 | $r1, |
4101 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4102 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4103 | ); |
4104 | return $r1; |
4105 | } |
4106 | private function parsedtdd($silence, $boolParams, &$param_preproc, &$param_th) { |
4107 | $key = json_encode([484, $boolParams & 0x1fff, $param_preproc, $param_th]); |
4108 | $bucket = $this->currPos; |
4109 | $cached = $this->cache[$bucket][$key] ?? null; |
4110 | if ($cached) { |
4111 | $this->currPos = $cached->nextPos; |
4112 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4113 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4114 | return $cached->result; |
4115 | } |
4116 | $saved_preproc=$param_preproc; |
4117 | $saved_th=$param_th; |
4118 | $p2 = $this->currPos; |
4119 | // start seq_1 |
4120 | $p3 = $this->currPos; |
4121 | $r4 = []; |
4122 | for (;;) { |
4123 | $p6 = $this->currPos; |
4124 | // start seq_2 |
4125 | $p7 = $this->currPos; |
4126 | $p8 = $this->currPos; |
4127 | // start seq_3 |
4128 | $p10 = $this->currPos; |
4129 | if (($this->input[$this->currPos] ?? null) === ";") { |
4130 | $this->currPos++; |
4131 | $r11 = ";"; |
4132 | } else { |
4133 | $r11 = self::$FAILED; |
4134 | $r9 = self::$FAILED; |
4135 | goto seq_3; |
4136 | } |
4137 | $p12 = $this->currPos; |
4138 | $r13 = $this->discardlist_char(true); |
4139 | if ($r13 === self::$FAILED) { |
4140 | $r13 = false; |
4141 | } else { |
4142 | $r13 = self::$FAILED; |
4143 | $this->currPos = $p12; |
4144 | $this->currPos = $p10; |
4145 | $r9 = self::$FAILED; |
4146 | goto seq_3; |
4147 | } |
4148 | // free $p12 |
4149 | $r9 = true; |
4150 | seq_3: |
4151 | // free $p10 |
4152 | if ($r9 === self::$FAILED) { |
4153 | $r9 = false; |
4154 | } else { |
4155 | $r9 = self::$FAILED; |
4156 | $this->currPos = $p8; |
4157 | $r5 = self::$FAILED; |
4158 | goto seq_2; |
4159 | } |
4160 | // free $p8 |
4161 | $r14 = $this->parselist_char($silence); |
4162 | // lc <- $r14 |
4163 | if ($r14===self::$FAILED) { |
4164 | $this->currPos = $p7; |
4165 | $r5 = self::$FAILED; |
4166 | goto seq_2; |
4167 | } |
4168 | $r5 = true; |
4169 | seq_2: |
4170 | if ($r5!==self::$FAILED) { |
4171 | $this->savedPos = $p6; |
4172 | $r5 = $this->a44($r14); |
4173 | $r4[] = $r5; |
4174 | } else { |
4175 | break; |
4176 | } |
4177 | // free $p7 |
4178 | } |
4179 | // bullets <- $r4 |
4180 | // free $r5 |
4181 | if (($this->input[$this->currPos] ?? null) === ";") { |
4182 | $this->currPos++; |
4183 | $r5 = ";"; |
4184 | } else { |
4185 | if (!$silence) {$this->fail(26);} |
4186 | $r5 = self::$FAILED; |
4187 | $this->currPos = $p3; |
4188 | $r1 = self::$FAILED; |
4189 | goto seq_1; |
4190 | } |
4191 | $r15 = []; |
4192 | for (;;) { |
4193 | $r16 = $this->parsedtdd_colon($silence, $boolParams, $param_preproc, $param_th); |
4194 | if ($r16!==self::$FAILED) { |
4195 | $r15[] = $r16; |
4196 | } else { |
4197 | break; |
4198 | } |
4199 | } |
4200 | // colons <- $r15 |
4201 | // free $r16 |
4202 | $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4203 | if ($r16===self::$FAILED) { |
4204 | $r16 = null; |
4205 | } |
4206 | // d <- $r16 |
4207 | $p7 = $this->currPos; |
4208 | $r17 = $this->discardeolf(true); |
4209 | if ($r17!==self::$FAILED) { |
4210 | $r17 = false; |
4211 | $this->currPos = $p7; |
4212 | } else { |
4213 | $this->currPos = $p3; |
4214 | $r1 = self::$FAILED; |
4215 | goto seq_1; |
4216 | } |
4217 | // free $p7 |
4218 | $r1 = true; |
4219 | seq_1: |
4220 | if ($r1!==self::$FAILED) { |
4221 | $this->savedPos = $p2; |
4222 | $r1 = $this->a45($r4, $r15, $r16); |
4223 | } |
4224 | // free $p3 |
4225 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4226 | $this->currPos, |
4227 | $r1, |
4228 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4229 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4230 | ); |
4231 | return $r1; |
4232 | } |
4233 | private function parsehacky_dl_uses($silence, $boolParams, &$param_preproc, &$param_th) { |
4234 | $key = json_encode([480, $boolParams & 0x1fff, $param_preproc, $param_th]); |
4235 | $bucket = $this->currPos; |
4236 | $cached = $this->cache[$bucket][$key] ?? null; |
4237 | if ($cached) { |
4238 | $this->currPos = $cached->nextPos; |
4239 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4240 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4241 | return $cached->result; |
4242 | } |
4243 | $saved_preproc=$param_preproc; |
4244 | $saved_th=$param_th; |
4245 | $p2 = $this->currPos; |
4246 | // start seq_1 |
4247 | $p3 = $this->currPos; |
4248 | $r4 = []; |
4249 | for (;;) { |
4250 | if (($this->input[$this->currPos] ?? null) === ":") { |
4251 | $this->currPos++; |
4252 | $r5 = ":"; |
4253 | $r4[] = $r5; |
4254 | } else { |
4255 | if (!$silence) {$this->fail(18);} |
4256 | $r5 = self::$FAILED; |
4257 | break; |
4258 | } |
4259 | } |
4260 | if (count($r4) === 0) { |
4261 | $r4 = self::$FAILED; |
4262 | } |
4263 | // bullets <- $r4 |
4264 | if ($r4===self::$FAILED) { |
4265 | $r1 = self::$FAILED; |
4266 | goto seq_1; |
4267 | } |
4268 | // free $r5 |
4269 | // start seq_2 |
4270 | $p6 = $this->currPos; |
4271 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4272 | if ($r7===self::$FAILED) { |
4273 | $r5 = self::$FAILED; |
4274 | goto seq_2; |
4275 | } |
4276 | $r8 = []; |
4277 | for (;;) { |
4278 | // start seq_3 |
4279 | $p10 = $this->currPos; |
4280 | $r11 = []; |
4281 | for (;;) { |
4282 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4283 | if ($r12!==self::$FAILED) { |
4284 | $r11[] = $r12; |
4285 | } else { |
4286 | break; |
4287 | } |
4288 | } |
4289 | if (count($r11) === 0) { |
4290 | $r11 = self::$FAILED; |
4291 | } |
4292 | if ($r11===self::$FAILED) { |
4293 | $r9 = self::$FAILED; |
4294 | goto seq_3; |
4295 | } |
4296 | // free $r12 |
4297 | $r12 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4298 | if ($r12===self::$FAILED) { |
4299 | $this->currPos = $p10; |
4300 | $r9 = self::$FAILED; |
4301 | goto seq_3; |
4302 | } |
4303 | $r9 = [$r11,$r12]; |
4304 | seq_3: |
4305 | if ($r9!==self::$FAILED) { |
4306 | $r8[] = $r9; |
4307 | } else { |
4308 | break; |
4309 | } |
4310 | // free $p10 |
4311 | } |
4312 | // free $r9 |
4313 | $r5 = [$r7,$r8]; |
4314 | seq_2: |
4315 | // tbl <- $r5 |
4316 | if ($r5===self::$FAILED) { |
4317 | $this->currPos = $p3; |
4318 | $r1 = self::$FAILED; |
4319 | goto seq_1; |
4320 | } |
4321 | // free $p6 |
4322 | $r9 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4323 | if ($r9===self::$FAILED) { |
4324 | $r9 = null; |
4325 | } |
4326 | // line <- $r9 |
4327 | $p6 = $this->currPos; |
4328 | // start seq_4 |
4329 | $p10 = $this->currPos; |
4330 | for (;;) { |
4331 | // start choice_1 |
4332 | $r15 = $this->discardspace(true); |
4333 | if ($r15!==self::$FAILED) { |
4334 | goto choice_1; |
4335 | } |
4336 | $r15 = $this->discardcomment(true); |
4337 | choice_1: |
4338 | if ($r15===self::$FAILED) { |
4339 | break; |
4340 | } |
4341 | } |
4342 | // free $r15 |
4343 | $r14 = true; |
4344 | if ($r14===self::$FAILED) { |
4345 | $r13 = self::$FAILED; |
4346 | goto seq_4; |
4347 | } |
4348 | // free $r14 |
4349 | $r14 = $this->discardeolf(true); |
4350 | if ($r14===self::$FAILED) { |
4351 | $this->currPos = $p10; |
4352 | $r13 = self::$FAILED; |
4353 | goto seq_4; |
4354 | } |
4355 | $r13 = true; |
4356 | seq_4: |
4357 | if ($r13!==self::$FAILED) { |
4358 | $r13 = false; |
4359 | $this->currPos = $p6; |
4360 | } else { |
4361 | $this->currPos = $p3; |
4362 | $r1 = self::$FAILED; |
4363 | goto seq_1; |
4364 | } |
4365 | // free $p10 |
4366 | // free $p6 |
4367 | $r1 = true; |
4368 | seq_1: |
4369 | if ($r1!==self::$FAILED) { |
4370 | $this->savedPos = $p2; |
4371 | $r1 = $this->a46($r4, $r5, $r9); |
4372 | } |
4373 | // free $p3 |
4374 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4375 | $this->currPos, |
4376 | $r1, |
4377 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4378 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4379 | ); |
4380 | return $r1; |
4381 | } |
4382 | private function parseli($silence, $boolParams, &$param_preproc, &$param_th) { |
4383 | $key = json_encode([478, $boolParams & 0x1fff, $param_preproc, $param_th]); |
4384 | $bucket = $this->currPos; |
4385 | $cached = $this->cache[$bucket][$key] ?? null; |
4386 | if ($cached) { |
4387 | $this->currPos = $cached->nextPos; |
4388 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4389 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4390 | return $cached->result; |
4391 | } |
4392 | $saved_preproc=$param_preproc; |
4393 | $saved_th=$param_th; |
4394 | $p2 = $this->currPos; |
4395 | // start seq_1 |
4396 | $p3 = $this->currPos; |
4397 | $r4 = []; |
4398 | for (;;) { |
4399 | $r5 = $this->parselist_char($silence); |
4400 | if ($r5!==self::$FAILED) { |
4401 | $r4[] = $r5; |
4402 | } else { |
4403 | break; |
4404 | } |
4405 | } |
4406 | if (count($r4) === 0) { |
4407 | $r4 = self::$FAILED; |
4408 | } |
4409 | // bullets <- $r4 |
4410 | if ($r4===self::$FAILED) { |
4411 | $r1 = self::$FAILED; |
4412 | goto seq_1; |
4413 | } |
4414 | // free $r5 |
4415 | $r5 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4416 | if ($r5===self::$FAILED) { |
4417 | $r5 = null; |
4418 | } |
4419 | // c <- $r5 |
4420 | $p6 = $this->currPos; |
4421 | // start choice_1 |
4422 | $r7 = $this->discardeolf(true); |
4423 | if ($r7!==self::$FAILED) { |
4424 | goto choice_1; |
4425 | } |
4426 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4427 | choice_1: |
4428 | if ($r7!==self::$FAILED) { |
4429 | $r7 = false; |
4430 | $this->currPos = $p6; |
4431 | } else { |
4432 | $this->currPos = $p3; |
4433 | $r1 = self::$FAILED; |
4434 | goto seq_1; |
4435 | } |
4436 | // free $p6 |
4437 | $r1 = true; |
4438 | seq_1: |
4439 | if ($r1!==self::$FAILED) { |
4440 | $this->savedPos = $p2; |
4441 | $r1 = $this->a47($r4, $r5); |
4442 | } |
4443 | // free $p3 |
4444 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4445 | $this->currPos, |
4446 | $r1, |
4447 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4448 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4449 | ); |
4450 | return $r1; |
4451 | } |
4452 | private function discardeof($silence) { |
4453 | $key = 565; |
4454 | $bucket = $this->currPos; |
4455 | $cached = $this->cache[$bucket][$key] ?? null; |
4456 | if ($cached) { |
4457 | $this->currPos = $cached->nextPos; |
4458 | |
4459 | return $cached->result; |
4460 | } |
4461 | |
4462 | $this->savedPos = $this->currPos; |
4463 | $r1 = $this->a48(); |
4464 | if ($r1) { |
4465 | $r1 = false; |
4466 | } else { |
4467 | $r1 = self::$FAILED; |
4468 | } |
4469 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4470 | $this->currPos, |
4471 | $r1, |
4472 | self::$UNDEFINED, |
4473 | self::$UNDEFINED |
4474 | ); |
4475 | return $r1; |
4476 | } |
4477 | private function parseblock($silence, $boolParams, &$param_th, &$param_preproc) { |
4478 | $key = json_encode([312, $boolParams & 0x1fff, $param_th, $param_preproc]); |
4479 | $bucket = $this->currPos; |
4480 | $cached = $this->cache[$bucket][$key] ?? null; |
4481 | if ($cached) { |
4482 | $this->currPos = $cached->nextPos; |
4483 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4484 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4485 | return $cached->result; |
4486 | } |
4487 | $saved_th=$param_th; |
4488 | $saved_preproc=$param_preproc; |
4489 | // start choice_1 |
4490 | $p2 = $this->currPos; |
4491 | // start seq_1 |
4492 | $p3 = $this->currPos; |
4493 | $p4 = $this->currPos; |
4494 | $r5 = $this->discardsof(true); |
4495 | if ($r5!==self::$FAILED) { |
4496 | $r5 = false; |
4497 | $this->currPos = $p4; |
4498 | } else { |
4499 | $r1 = self::$FAILED; |
4500 | goto seq_1; |
4501 | } |
4502 | // free $p4 |
4503 | $r6 = $this->parseredirect($silence, $boolParams, $param_th, $param_preproc); |
4504 | // r <- $r6 |
4505 | if ($r6===self::$FAILED) { |
4506 | $this->currPos = $p3; |
4507 | $r1 = self::$FAILED; |
4508 | goto seq_1; |
4509 | } |
4510 | $r7 = []; |
4511 | for (;;) { |
4512 | $r8 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
4513 | if ($r8!==self::$FAILED) { |
4514 | $r7[] = $r8; |
4515 | } else { |
4516 | break; |
4517 | } |
4518 | } |
4519 | // cil <- $r7 |
4520 | // free $r8 |
4521 | $r8 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
4522 | if ($r8===self::$FAILED) { |
4523 | $r8 = null; |
4524 | } |
4525 | // bl <- $r8 |
4526 | $r1 = true; |
4527 | seq_1: |
4528 | if ($r1!==self::$FAILED) { |
4529 | $this->savedPos = $p2; |
4530 | $r1 = $this->a49($r6, $r7, $r8); |
4531 | goto choice_1; |
4532 | } |
4533 | // free $p3 |
4534 | $r1 = $this->parseblock_lines($silence, $boolParams, $param_preproc, $param_th); |
4535 | if ($r1!==self::$FAILED) { |
4536 | goto choice_1; |
4537 | } |
4538 | $r1 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4539 | if ($r1!==self::$FAILED) { |
4540 | goto choice_1; |
4541 | } |
4542 | $p3 = $this->currPos; |
4543 | // start seq_2 |
4544 | $p4 = $this->currPos; |
4545 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4546 | // s <- $r9 |
4547 | if ($r9===self::$FAILED) { |
4548 | $r1 = self::$FAILED; |
4549 | goto seq_2; |
4550 | } |
4551 | $p10 = $this->currPos; |
4552 | $r11 = $this->discardsof(true); |
4553 | if ($r11 === self::$FAILED) { |
4554 | $r11 = false; |
4555 | } else { |
4556 | $r11 = self::$FAILED; |
4557 | $this->currPos = $p10; |
4558 | $this->currPos = $p4; |
4559 | $r1 = self::$FAILED; |
4560 | goto seq_2; |
4561 | } |
4562 | // free $p10 |
4563 | $p10 = $this->currPos; |
4564 | $r12 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4565 | if ($r12 === self::$FAILED) { |
4566 | $r12 = false; |
4567 | } else { |
4568 | $r12 = self::$FAILED; |
4569 | $this->currPos = $p10; |
4570 | $this->currPos = $p4; |
4571 | $r1 = self::$FAILED; |
4572 | goto seq_2; |
4573 | } |
4574 | // free $p10 |
4575 | $r1 = true; |
4576 | seq_2: |
4577 | if ($r1!==self::$FAILED) { |
4578 | $this->savedPos = $p3; |
4579 | $r1 = $this->a42($r9); |
4580 | } |
4581 | // free $p4 |
4582 | choice_1: |
4583 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4584 | $this->currPos, |
4585 | $r1, |
4586 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4587 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4588 | ); |
4589 | return $r1; |
4590 | } |
4591 | private function discardnewline($silence) { |
4592 | $key = 567; |
4593 | $bucket = $this->currPos; |
4594 | $cached = $this->cache[$bucket][$key] ?? null; |
4595 | if ($cached) { |
4596 | $this->currPos = $cached->nextPos; |
4597 | |
4598 | return $cached->result; |
4599 | } |
4600 | |
4601 | // start choice_1 |
4602 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
4603 | $this->currPos++; |
4604 | $r1 = "\x0a"; |
4605 | goto choice_1; |
4606 | } else { |
4607 | if (!$silence) {$this->fail(27);} |
4608 | $r1 = self::$FAILED; |
4609 | } |
4610 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
4611 | $r1 = "\x0d\x0a"; |
4612 | $this->currPos += 2; |
4613 | } else { |
4614 | if (!$silence) {$this->fail(28);} |
4615 | $r1 = self::$FAILED; |
4616 | } |
4617 | choice_1: |
4618 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4619 | $this->currPos, |
4620 | $r1, |
4621 | self::$UNDEFINED, |
4622 | self::$UNDEFINED |
4623 | ); |
4624 | return $r1; |
4625 | } |
4626 | private function parsetplarg_or_template_guarded($silence, $boolParams, &$param_th, &$param_preproc) { |
4627 | $key = json_encode([366, $boolParams & 0x1fff, $param_th, $param_preproc]); |
4628 | $bucket = $this->currPos; |
4629 | $cached = $this->cache[$bucket][$key] ?? null; |
4630 | if ($cached) { |
4631 | $this->currPos = $cached->nextPos; |
4632 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4633 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4634 | return $cached->result; |
4635 | } |
4636 | $saved_th=$param_th; |
4637 | $saved_preproc=$param_preproc; |
4638 | // start choice_1 |
4639 | $p2 = $this->currPos; |
4640 | // start seq_1 |
4641 | $p3 = $this->currPos; |
4642 | $p4 = $this->currPos; |
4643 | // start seq_2 |
4644 | $p6 = $this->currPos; |
4645 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4646 | $r7 = "{{"; |
4647 | $this->currPos += 2; |
4648 | } else { |
4649 | $r7 = self::$FAILED; |
4650 | $r5 = self::$FAILED; |
4651 | goto seq_2; |
4652 | } |
4653 | $p8 = $this->currPos; |
4654 | // start seq_3 |
4655 | $p10 = $this->currPos; |
4656 | $r11 = self::$FAILED; |
4657 | for (;;) { |
4658 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4659 | $r12 = "{{{"; |
4660 | $this->currPos += 3; |
4661 | $r11 = true; |
4662 | } else { |
4663 | $r12 = self::$FAILED; |
4664 | break; |
4665 | } |
4666 | } |
4667 | if ($r11===self::$FAILED) { |
4668 | $r9 = self::$FAILED; |
4669 | goto seq_3; |
4670 | } |
4671 | // free $r12 |
4672 | $p13 = $this->currPos; |
4673 | if (($this->input[$this->currPos] ?? null) === "{") { |
4674 | $this->currPos++; |
4675 | $r12 = "{"; |
4676 | } else { |
4677 | $r12 = self::$FAILED; |
4678 | } |
4679 | if ($r12 === self::$FAILED) { |
4680 | $r12 = false; |
4681 | } else { |
4682 | $r12 = self::$FAILED; |
4683 | $this->currPos = $p13; |
4684 | $this->currPos = $p10; |
4685 | $r9 = self::$FAILED; |
4686 | goto seq_3; |
4687 | } |
4688 | // free $p13 |
4689 | $r9 = true; |
4690 | seq_3: |
4691 | if ($r9!==self::$FAILED) { |
4692 | $r9 = false; |
4693 | $this->currPos = $p8; |
4694 | } else { |
4695 | $this->currPos = $p6; |
4696 | $r5 = self::$FAILED; |
4697 | goto seq_2; |
4698 | } |
4699 | // free $p10 |
4700 | // free $p8 |
4701 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
4702 | if ($r14===self::$FAILED) { |
4703 | $this->currPos = $p6; |
4704 | $r5 = self::$FAILED; |
4705 | goto seq_2; |
4706 | } |
4707 | $r5 = true; |
4708 | seq_2: |
4709 | if ($r5!==self::$FAILED) { |
4710 | $r5 = false; |
4711 | $this->currPos = $p4; |
4712 | } else { |
4713 | $r1 = self::$FAILED; |
4714 | goto seq_1; |
4715 | } |
4716 | // free $p6 |
4717 | // free $p4 |
4718 | // start choice_2 |
4719 | $r15 = $this->parsetemplate($silence, $boolParams, $param_th); |
4720 | if ($r15!==self::$FAILED) { |
4721 | goto choice_2; |
4722 | } |
4723 | $r15 = $this->parsebroken_template($silence, $param_preproc); |
4724 | choice_2: |
4725 | // a <- $r15 |
4726 | if ($r15===self::$FAILED) { |
4727 | $this->currPos = $p3; |
4728 | $r1 = self::$FAILED; |
4729 | goto seq_1; |
4730 | } |
4731 | $r1 = true; |
4732 | seq_1: |
4733 | if ($r1!==self::$FAILED) { |
4734 | $this->savedPos = $p2; |
4735 | $r1 = $this->a50($r15); |
4736 | goto choice_1; |
4737 | } |
4738 | // free $p3 |
4739 | $p3 = $this->currPos; |
4740 | // start seq_4 |
4741 | $p4 = $this->currPos; |
4742 | $p6 = $this->currPos; |
4743 | // start seq_5 |
4744 | $p8 = $this->currPos; |
4745 | if (($this->input[$this->currPos] ?? null) === "{") { |
4746 | $this->currPos++; |
4747 | $r17 = "{"; |
4748 | } else { |
4749 | if (!$silence) {$this->fail(29);} |
4750 | $r17 = self::$FAILED; |
4751 | $r16 = self::$FAILED; |
4752 | goto seq_5; |
4753 | } |
4754 | $p10 = $this->currPos; |
4755 | // start seq_6 |
4756 | $p13 = $this->currPos; |
4757 | $r19 = self::$FAILED; |
4758 | for (;;) { |
4759 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4760 | $r20 = "{{{"; |
4761 | $this->currPos += 3; |
4762 | $r19 = true; |
4763 | } else { |
4764 | $r20 = self::$FAILED; |
4765 | break; |
4766 | } |
4767 | } |
4768 | if ($r19===self::$FAILED) { |
4769 | $r18 = self::$FAILED; |
4770 | goto seq_6; |
4771 | } |
4772 | // free $r20 |
4773 | $p21 = $this->currPos; |
4774 | if (($this->input[$this->currPos] ?? null) === "{") { |
4775 | $this->currPos++; |
4776 | $r20 = "{"; |
4777 | } else { |
4778 | $r20 = self::$FAILED; |
4779 | } |
4780 | if ($r20 === self::$FAILED) { |
4781 | $r20 = false; |
4782 | } else { |
4783 | $r20 = self::$FAILED; |
4784 | $this->currPos = $p21; |
4785 | $this->currPos = $p13; |
4786 | $r18 = self::$FAILED; |
4787 | goto seq_6; |
4788 | } |
4789 | // free $p21 |
4790 | $r18 = true; |
4791 | seq_6: |
4792 | if ($r18!==self::$FAILED) { |
4793 | $r18 = false; |
4794 | $this->currPos = $p10; |
4795 | } else { |
4796 | $this->currPos = $p8; |
4797 | $r16 = self::$FAILED; |
4798 | goto seq_5; |
4799 | } |
4800 | // free $p13 |
4801 | // free $p10 |
4802 | $r16 = true; |
4803 | seq_5: |
4804 | if ($r16===self::$FAILED) { |
4805 | $r16 = null; |
4806 | } |
4807 | // free $p8 |
4808 | // a <- $r16 |
4809 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
4810 | // free $p6 |
4811 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
4812 | // b <- $r22 |
4813 | if ($r22===self::$FAILED) { |
4814 | $this->currPos = $p4; |
4815 | $r1 = self::$FAILED; |
4816 | goto seq_4; |
4817 | } |
4818 | $r1 = true; |
4819 | seq_4: |
4820 | if ($r1!==self::$FAILED) { |
4821 | $this->savedPos = $p3; |
4822 | $r1 = $this->a51($r16, $r22); |
4823 | goto choice_1; |
4824 | } |
4825 | // free $p4 |
4826 | $p4 = $this->currPos; |
4827 | // start seq_7 |
4828 | $p6 = $this->currPos; |
4829 | $p8 = $this->currPos; |
4830 | // start seq_8 |
4831 | $p10 = $this->currPos; |
4832 | if (($this->input[$this->currPos] ?? null) === "{") { |
4833 | $this->currPos++; |
4834 | $r24 = "{"; |
4835 | } else { |
4836 | if (!$silence) {$this->fail(29);} |
4837 | $r24 = self::$FAILED; |
4838 | $r23 = self::$FAILED; |
4839 | goto seq_8; |
4840 | } |
4841 | $p13 = $this->currPos; |
4842 | // start seq_9 |
4843 | $p21 = $this->currPos; |
4844 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4845 | $r26 = "{{"; |
4846 | $this->currPos += 2; |
4847 | } else { |
4848 | $r26 = self::$FAILED; |
4849 | $r25 = self::$FAILED; |
4850 | goto seq_9; |
4851 | } |
4852 | $p27 = $this->currPos; |
4853 | if (($this->input[$this->currPos] ?? null) === "{") { |
4854 | $this->currPos++; |
4855 | $r28 = "{"; |
4856 | } else { |
4857 | $r28 = self::$FAILED; |
4858 | } |
4859 | if ($r28 === self::$FAILED) { |
4860 | $r28 = false; |
4861 | } else { |
4862 | $r28 = self::$FAILED; |
4863 | $this->currPos = $p27; |
4864 | $this->currPos = $p21; |
4865 | $r25 = self::$FAILED; |
4866 | goto seq_9; |
4867 | } |
4868 | // free $p27 |
4869 | $r25 = true; |
4870 | seq_9: |
4871 | if ($r25!==self::$FAILED) { |
4872 | $r25 = false; |
4873 | $this->currPos = $p13; |
4874 | } else { |
4875 | $this->currPos = $p10; |
4876 | $r23 = self::$FAILED; |
4877 | goto seq_8; |
4878 | } |
4879 | // free $p21 |
4880 | // free $p13 |
4881 | $r23 = true; |
4882 | seq_8: |
4883 | if ($r23===self::$FAILED) { |
4884 | $r23 = null; |
4885 | } |
4886 | // free $p10 |
4887 | // a <- $r23 |
4888 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
4889 | // free $p8 |
4890 | $r29 = $this->parsetemplate($silence, $boolParams, $param_th); |
4891 | // b <- $r29 |
4892 | if ($r29===self::$FAILED) { |
4893 | $this->currPos = $p6; |
4894 | $r1 = self::$FAILED; |
4895 | goto seq_7; |
4896 | } |
4897 | $r1 = true; |
4898 | seq_7: |
4899 | if ($r1!==self::$FAILED) { |
4900 | $this->savedPos = $p4; |
4901 | $r1 = $this->a51($r23, $r29); |
4902 | goto choice_1; |
4903 | } |
4904 | // free $p6 |
4905 | $r1 = $this->parsebroken_template($silence, $param_preproc); |
4906 | choice_1: |
4907 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4908 | $this->currPos, |
4909 | $r1, |
4910 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4911 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4912 | ); |
4913 | return $r1; |
4914 | } |
4915 | private function parseraw_htmlentity($silence) { |
4916 | $key = 526; |
4917 | $bucket = $this->currPos; |
4918 | $cached = $this->cache[$bucket][$key] ?? null; |
4919 | if ($cached) { |
4920 | $this->currPos = $cached->nextPos; |
4921 | |
4922 | return $cached->result; |
4923 | } |
4924 | |
4925 | $p2 = $this->currPos; |
4926 | $p4 = $this->currPos; |
4927 | // start seq_1 |
4928 | $p5 = $this->currPos; |
4929 | if (($this->input[$this->currPos] ?? null) === "&") { |
4930 | $this->currPos++; |
4931 | $r6 = "&"; |
4932 | } else { |
4933 | if (!$silence) {$this->fail(4);} |
4934 | $r6 = self::$FAILED; |
4935 | $r3 = self::$FAILED; |
4936 | goto seq_1; |
4937 | } |
4938 | $r7 = self::$FAILED; |
4939 | for (;;) { |
4940 | $r8 = self::charAt($this->input, $this->currPos); |
4941 | if (preg_match("/^[#0-9a-zA-Z\\x{5e8}\\x{5dc}\\x{5de}\\x{631}\\x{644}\\x{645}]/u", $r8)) { |
4942 | $this->currPos += strlen($r8); |
4943 | $r7 = true; |
4944 | } else { |
4945 | $r8 = self::$FAILED; |
4946 | if (!$silence) {$this->fail(30);} |
4947 | break; |
4948 | } |
4949 | } |
4950 | if ($r7===self::$FAILED) { |
4951 | $this->currPos = $p5; |
4952 | $r3 = self::$FAILED; |
4953 | goto seq_1; |
4954 | } |
4955 | // free $r8 |
4956 | if (($this->input[$this->currPos] ?? null) === ";") { |
4957 | $this->currPos++; |
4958 | $r8 = ";"; |
4959 | } else { |
4960 | if (!$silence) {$this->fail(26);} |
4961 | $r8 = self::$FAILED; |
4962 | $this->currPos = $p5; |
4963 | $r3 = self::$FAILED; |
4964 | goto seq_1; |
4965 | } |
4966 | $r3 = true; |
4967 | seq_1: |
4968 | // m <- $r3 |
4969 | if ($r3!==self::$FAILED) { |
4970 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
4971 | } else { |
4972 | $r3 = self::$FAILED; |
4973 | } |
4974 | // free $p5 |
4975 | // free $p4 |
4976 | $r1 = $r3; |
4977 | if ($r1!==self::$FAILED) { |
4978 | $this->savedPos = $p2; |
4979 | $r1 = $this->a52($r3); |
4980 | } |
4981 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4982 | $this->currPos, |
4983 | $r1, |
4984 | self::$UNDEFINED, |
4985 | self::$UNDEFINED |
4986 | ); |
4987 | return $r1; |
4988 | } |
4989 | private function parseoptionalSpaceToken($silence) { |
4990 | $key = 576; |
4991 | $bucket = $this->currPos; |
4992 | $cached = $this->cache[$bucket][$key] ?? null; |
4993 | if ($cached) { |
4994 | $this->currPos = $cached->nextPos; |
4995 | |
4996 | return $cached->result; |
4997 | } |
4998 | |
4999 | $p2 = $this->currPos; |
5000 | $r3 = $this->parseoptional_spaces($silence); |
5001 | // s <- $r3 |
5002 | $r1 = $r3; |
5003 | if ($r1!==self::$FAILED) { |
5004 | $this->savedPos = $p2; |
5005 | $r1 = $this->a37($r3); |
5006 | } |
5007 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5008 | $this->currPos, |
5009 | $r1, |
5010 | self::$UNDEFINED, |
5011 | self::$UNDEFINED |
5012 | ); |
5013 | return $r1; |
5014 | } |
5015 | private function parsetable_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
5016 | $key = json_encode([470, $boolParams & 0x1fff, $param_preproc, $param_th]); |
5017 | $bucket = $this->currPos; |
5018 | $cached = $this->cache[$bucket][$key] ?? null; |
5019 | if ($cached) { |
5020 | $this->currPos = $cached->nextPos; |
5021 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5022 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5023 | return $cached->result; |
5024 | } |
5025 | $saved_preproc=$param_preproc; |
5026 | $saved_th=$param_th; |
5027 | $p2 = $this->currPos; |
5028 | // start seq_1 |
5029 | $p3 = $this->currPos; |
5030 | $p5 = $this->currPos; |
5031 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
5032 | $r4 = $this->input[$this->currPos++]; |
5033 | } else { |
5034 | $r4 = self::$FAILED; |
5035 | if (!$silence) {$this->fail(31);} |
5036 | $r4 = null; |
5037 | } |
5038 | // q <- $r4 |
5039 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5040 | // free $p5 |
5041 | $r6 = []; |
5042 | for (;;) { |
5043 | // start choice_1 |
5044 | $p5 = $this->currPos; |
5045 | $r7 = self::$FAILED; |
5046 | for (;;) { |
5047 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|[", $this->currPos, 1) !== 0) { |
5048 | $r8 = self::consumeChar($this->input, $this->currPos); |
5049 | $r7 = true; |
5050 | } else { |
5051 | $r8 = self::$FAILED; |
5052 | if (!$silence) {$this->fail(32);} |
5053 | break; |
5054 | } |
5055 | } |
5056 | if ($r7!==self::$FAILED) { |
5057 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
5058 | goto choice_1; |
5059 | } else { |
5060 | $r7 = self::$FAILED; |
5061 | } |
5062 | // free $r8 |
5063 | // free $p5 |
5064 | $p5 = $this->currPos; |
5065 | // start seq_2 |
5066 | $p9 = $this->currPos; |
5067 | $p10 = $this->currPos; |
5068 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5069 | if ($r8 === self::$FAILED) { |
5070 | $r8 = false; |
5071 | } else { |
5072 | $r8 = self::$FAILED; |
5073 | $this->currPos = $p10; |
5074 | $r7 = self::$FAILED; |
5075 | goto seq_2; |
5076 | } |
5077 | // free $p10 |
5078 | // start choice_2 |
5079 | $p10 = $this->currPos; |
5080 | $r11 = $this->discardwikilink($silence, $boolParams, $param_th, $param_preproc); |
5081 | if ($r11!==self::$FAILED) { |
5082 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
5083 | goto choice_2; |
5084 | } else { |
5085 | $r11 = self::$FAILED; |
5086 | } |
5087 | // free $p10 |
5088 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5089 | if ($r11!==self::$FAILED) { |
5090 | goto choice_2; |
5091 | } |
5092 | $p10 = $this->currPos; |
5093 | // start seq_3 |
5094 | $p12 = $this->currPos; |
5095 | $p13 = $this->currPos; |
5096 | if (($this->input[$this->currPos] ?? null) === "<") { |
5097 | $this->currPos++; |
5098 | $r14 = "<"; |
5099 | $r14 = false; |
5100 | $this->currPos = $p13; |
5101 | } else { |
5102 | $r14 = self::$FAILED; |
5103 | $r11 = self::$FAILED; |
5104 | goto seq_3; |
5105 | } |
5106 | // free $p13 |
5107 | $r15 = $this->parsehtml_tag($silence, $boolParams, $param_preproc, $param_th); |
5108 | // x <- $r15 |
5109 | if ($r15===self::$FAILED) { |
5110 | $this->currPos = $p12; |
5111 | $r11 = self::$FAILED; |
5112 | goto seq_3; |
5113 | } |
5114 | $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
5115 | if ($r16===self::$FAILED) { |
5116 | $r16 = null; |
5117 | } |
5118 | // ill <- $r16 |
5119 | $r11 = true; |
5120 | seq_3: |
5121 | if ($r11!==self::$FAILED) { |
5122 | $this->savedPos = $p10; |
5123 | $r11 = $this->a53($r4, $r15, $r16); |
5124 | goto choice_2; |
5125 | } |
5126 | // free $p12 |
5127 | $p12 = $this->currPos; |
5128 | // start seq_4 |
5129 | $p13 = $this->currPos; |
5130 | $p17 = $this->currPos; |
5131 | // start choice_3 |
5132 | $r18 = $this->discardspace_or_newline(true); |
5133 | if ($r18!==self::$FAILED) { |
5134 | goto choice_3; |
5135 | } |
5136 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
5137 | $r18 = $this->input[$this->currPos++]; |
5138 | } else { |
5139 | $r18 = self::$FAILED; |
5140 | } |
5141 | choice_3: |
5142 | if ($r18 === self::$FAILED) { |
5143 | $r18 = false; |
5144 | } else { |
5145 | $r18 = self::$FAILED; |
5146 | $this->currPos = $p17; |
5147 | $r11 = self::$FAILED; |
5148 | goto seq_4; |
5149 | } |
5150 | // free $p17 |
5151 | if ($this->currPos < $this->inputLength) { |
5152 | $r19 = self::consumeChar($this->input, $this->currPos);; |
5153 | } else { |
5154 | $r19 = self::$FAILED; |
5155 | if (!$silence) {$this->fail(7);} |
5156 | $this->currPos = $p13; |
5157 | $r11 = self::$FAILED; |
5158 | goto seq_4; |
5159 | } |
5160 | $r11 = true; |
5161 | seq_4: |
5162 | if ($r11!==self::$FAILED) { |
5163 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
5164 | } else { |
5165 | $r11 = self::$FAILED; |
5166 | } |
5167 | // free $p13 |
5168 | // free $p12 |
5169 | choice_2: |
5170 | // t <- $r11 |
5171 | if ($r11===self::$FAILED) { |
5172 | $this->currPos = $p9; |
5173 | $r7 = self::$FAILED; |
5174 | goto seq_2; |
5175 | } |
5176 | $r7 = true; |
5177 | seq_2: |
5178 | if ($r7!==self::$FAILED) { |
5179 | $this->savedPos = $p5; |
5180 | $r7 = $this->a54($r4, $r11); |
5181 | } |
5182 | // free $p9 |
5183 | choice_1: |
5184 | if ($r7!==self::$FAILED) { |
5185 | $r6[] = $r7; |
5186 | } else { |
5187 | break; |
5188 | } |
5189 | } |
5190 | // r <- $r6 |
5191 | // free $r7 |
5192 | $this->savedPos = $this->currPos; |
5193 | $r7 = $this->a55($r4, $r6); |
5194 | if ($r7) { |
5195 | $r7 = false; |
5196 | } else { |
5197 | $r7 = self::$FAILED; |
5198 | $this->currPos = $p3; |
5199 | $r1 = self::$FAILED; |
5200 | goto seq_1; |
5201 | } |
5202 | $r1 = true; |
5203 | seq_1: |
5204 | if ($r1!==self::$FAILED) { |
5205 | $this->savedPos = $p2; |
5206 | $r1 = $this->a56($r4, $r6); |
5207 | } |
5208 | // free $p3 |
5209 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5210 | $this->currPos, |
5211 | $r1, |
5212 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5213 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5214 | ); |
5215 | return $r1; |
5216 | } |
5217 | private function parsetable_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5218 | $key = json_encode([474, $boolParams & 0x1fff, $param_preproc, $param_th]); |
5219 | $bucket = $this->currPos; |
5220 | $cached = $this->cache[$bucket][$key] ?? null; |
5221 | if ($cached) { |
5222 | $this->currPos = $cached->nextPos; |
5223 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5224 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5225 | return $cached->result; |
5226 | } |
5227 | $saved_preproc=$param_preproc; |
5228 | $saved_th=$param_th; |
5229 | // start choice_1 |
5230 | $p2 = $this->currPos; |
5231 | // start seq_1 |
5232 | $p3 = $this->currPos; |
5233 | $p5 = $this->currPos; |
5234 | // start seq_2 |
5235 | $p6 = $this->currPos; |
5236 | for (;;) { |
5237 | $r8 = $this->discardspace($silence); |
5238 | if ($r8===self::$FAILED) { |
5239 | break; |
5240 | } |
5241 | } |
5242 | // free $r8 |
5243 | $r7 = true; |
5244 | if ($r7===self::$FAILED) { |
5245 | $r4 = self::$FAILED; |
5246 | goto seq_2; |
5247 | } |
5248 | // free $r7 |
5249 | if (($this->input[$this->currPos] ?? null) === "'") { |
5250 | $this->currPos++; |
5251 | $r7 = "'"; |
5252 | } else { |
5253 | if (!$silence) {$this->fail(33);} |
5254 | $r7 = self::$FAILED; |
5255 | $this->currPos = $p6; |
5256 | $r4 = self::$FAILED; |
5257 | goto seq_2; |
5258 | } |
5259 | $r4 = true; |
5260 | seq_2: |
5261 | // s <- $r4 |
5262 | if ($r4!==self::$FAILED) { |
5263 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5264 | } else { |
5265 | $r4 = self::$FAILED; |
5266 | $r1 = self::$FAILED; |
5267 | goto seq_1; |
5268 | } |
5269 | // free $p6 |
5270 | // free $p5 |
5271 | $r8 = $this->parsetable_attribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5272 | if ($r8===self::$FAILED) { |
5273 | $r8 = null; |
5274 | } |
5275 | // t <- $r8 |
5276 | $p5 = $this->currPos; |
5277 | // start choice_2 |
5278 | if (($this->input[$this->currPos] ?? null) === "'") { |
5279 | $this->currPos++; |
5280 | $r9 = "'"; |
5281 | goto choice_2; |
5282 | } else { |
5283 | if (!$silence) {$this->fail(33);} |
5284 | $r9 = self::$FAILED; |
5285 | } |
5286 | $p6 = $this->currPos; |
5287 | // start choice_3 |
5288 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5289 | $r9 = "!!"; |
5290 | $this->currPos += 2; |
5291 | goto choice_3; |
5292 | } else { |
5293 | $r9 = self::$FAILED; |
5294 | } |
5295 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5296 | $r9 = $this->input[$this->currPos++]; |
5297 | } else { |
5298 | $r9 = self::$FAILED; |
5299 | } |
5300 | choice_3: |
5301 | if ($r9!==self::$FAILED) { |
5302 | $r9 = false; |
5303 | $this->currPos = $p6; |
5304 | } |
5305 | // free $p6 |
5306 | choice_2: |
5307 | // q <- $r9 |
5308 | if ($r9!==self::$FAILED) { |
5309 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5310 | } else { |
5311 | $r9 = self::$FAILED; |
5312 | $this->currPos = $p3; |
5313 | $r1 = self::$FAILED; |
5314 | goto seq_1; |
5315 | } |
5316 | // free $p5 |
5317 | $r1 = true; |
5318 | seq_1: |
5319 | if ($r1!==self::$FAILED) { |
5320 | $this->savedPos = $p2; |
5321 | $r1 = $this->a57($r4, $r8, $r9); |
5322 | goto choice_1; |
5323 | } |
5324 | // free $p3 |
5325 | $p3 = $this->currPos; |
5326 | // start seq_3 |
5327 | $p5 = $this->currPos; |
5328 | $p6 = $this->currPos; |
5329 | // start seq_4 |
5330 | $p11 = $this->currPos; |
5331 | for (;;) { |
5332 | $r13 = $this->discardspace($silence); |
5333 | if ($r13===self::$FAILED) { |
5334 | break; |
5335 | } |
5336 | } |
5337 | // free $r13 |
5338 | $r12 = true; |
5339 | if ($r12===self::$FAILED) { |
5340 | $r10 = self::$FAILED; |
5341 | goto seq_4; |
5342 | } |
5343 | // free $r12 |
5344 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5345 | $this->currPos++; |
5346 | $r12 = "\""; |
5347 | } else { |
5348 | if (!$silence) {$this->fail(34);} |
5349 | $r12 = self::$FAILED; |
5350 | $this->currPos = $p11; |
5351 | $r10 = self::$FAILED; |
5352 | goto seq_4; |
5353 | } |
5354 | $r10 = true; |
5355 | seq_4: |
5356 | // s <- $r10 |
5357 | if ($r10!==self::$FAILED) { |
5358 | $r10 = substr($this->input, $p6, $this->currPos - $p6); |
5359 | } else { |
5360 | $r10 = self::$FAILED; |
5361 | $r1 = self::$FAILED; |
5362 | goto seq_3; |
5363 | } |
5364 | // free $p11 |
5365 | // free $p6 |
5366 | $r13 = $this->parsetable_attribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5367 | if ($r13===self::$FAILED) { |
5368 | $r13 = null; |
5369 | } |
5370 | // t <- $r13 |
5371 | $p6 = $this->currPos; |
5372 | // start choice_4 |
5373 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5374 | $this->currPos++; |
5375 | $r14 = "\""; |
5376 | goto choice_4; |
5377 | } else { |
5378 | if (!$silence) {$this->fail(34);} |
5379 | $r14 = self::$FAILED; |
5380 | } |
5381 | $p11 = $this->currPos; |
5382 | // start choice_5 |
5383 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5384 | $r14 = "!!"; |
5385 | $this->currPos += 2; |
5386 | goto choice_5; |
5387 | } else { |
5388 | $r14 = self::$FAILED; |
5389 | } |
5390 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5391 | $r14 = $this->input[$this->currPos++]; |
5392 | } else { |
5393 | $r14 = self::$FAILED; |
5394 | } |
5395 | choice_5: |
5396 | if ($r14!==self::$FAILED) { |
5397 | $r14 = false; |
5398 | $this->currPos = $p11; |
5399 | } |
5400 | // free $p11 |
5401 | choice_4: |
5402 | // q <- $r14 |
5403 | if ($r14!==self::$FAILED) { |
5404 | $r14 = substr($this->input, $p6, $this->currPos - $p6); |
5405 | } else { |
5406 | $r14 = self::$FAILED; |
5407 | $this->currPos = $p5; |
5408 | $r1 = self::$FAILED; |
5409 | goto seq_3; |
5410 | } |
5411 | // free $p6 |
5412 | $r1 = true; |
5413 | seq_3: |
5414 | if ($r1!==self::$FAILED) { |
5415 | $this->savedPos = $p3; |
5416 | $r1 = $this->a57($r10, $r13, $r14); |
5417 | goto choice_1; |
5418 | } |
5419 | // free $p5 |
5420 | $p5 = $this->currPos; |
5421 | // start seq_5 |
5422 | $p6 = $this->currPos; |
5423 | $p11 = $this->currPos; |
5424 | for (;;) { |
5425 | $r16 = $this->discardspace($silence); |
5426 | if ($r16===self::$FAILED) { |
5427 | break; |
5428 | } |
5429 | } |
5430 | // free $r16 |
5431 | $r15 = true; |
5432 | // s <- $r15 |
5433 | if ($r15!==self::$FAILED) { |
5434 | $r15 = substr($this->input, $p11, $this->currPos - $p11); |
5435 | } else { |
5436 | $r15 = self::$FAILED; |
5437 | $r1 = self::$FAILED; |
5438 | goto seq_5; |
5439 | } |
5440 | // free $p11 |
5441 | $r16 = $this->parsetable_attribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
5442 | // t <- $r16 |
5443 | if ($r16===self::$FAILED) { |
5444 | $this->currPos = $p6; |
5445 | $r1 = self::$FAILED; |
5446 | goto seq_5; |
5447 | } |
5448 | $p11 = $this->currPos; |
5449 | // start choice_6 |
5450 | $r17 = $this->discardspace_or_newline(true); |
5451 | if ($r17!==self::$FAILED) { |
5452 | goto choice_6; |
5453 | } |
5454 | $r17 = $this->discardeof(true); |
5455 | if ($r17!==self::$FAILED) { |
5456 | goto choice_6; |
5457 | } |
5458 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5459 | $r17 = "!!"; |
5460 | $this->currPos += 2; |
5461 | goto choice_6; |
5462 | } else { |
5463 | $r17 = self::$FAILED; |
5464 | } |
5465 | if (($this->input[$this->currPos] ?? null) === "|") { |
5466 | $this->currPos++; |
5467 | $r17 = "|"; |
5468 | } else { |
5469 | $r17 = self::$FAILED; |
5470 | } |
5471 | choice_6: |
5472 | if ($r17!==self::$FAILED) { |
5473 | $r17 = false; |
5474 | $this->currPos = $p11; |
5475 | } else { |
5476 | $this->currPos = $p6; |
5477 | $r1 = self::$FAILED; |
5478 | goto seq_5; |
5479 | } |
5480 | // free $p11 |
5481 | $r1 = true; |
5482 | seq_5: |
5483 | if ($r1!==self::$FAILED) { |
5484 | $this->savedPos = $p5; |
5485 | $r1 = $this->a58($r15, $r16); |
5486 | } |
5487 | // free $p6 |
5488 | choice_1: |
5489 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5490 | $this->currPos, |
5491 | $r1, |
5492 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5493 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5494 | ); |
5495 | return $r1; |
5496 | } |
5497 | private function discardspace_or_newline_or_solidus($silence) { |
5498 | $key = 455; |
5499 | $bucket = $this->currPos; |
5500 | $cached = $this->cache[$bucket][$key] ?? null; |
5501 | if ($cached) { |
5502 | $this->currPos = $cached->nextPos; |
5503 | |
5504 | return $cached->result; |
5505 | } |
5506 | |
5507 | // start choice_1 |
5508 | $r1 = $this->discardspace_or_newline($silence); |
5509 | if ($r1!==self::$FAILED) { |
5510 | goto choice_1; |
5511 | } |
5512 | $p2 = $this->currPos; |
5513 | // start seq_1 |
5514 | $p3 = $this->currPos; |
5515 | // s <- $r4 |
5516 | if (($this->input[$this->currPos] ?? null) === "/") { |
5517 | $this->currPos++; |
5518 | $r4 = "/"; |
5519 | } else { |
5520 | if (!$silence) {$this->fail(35);} |
5521 | $r4 = self::$FAILED; |
5522 | $r1 = self::$FAILED; |
5523 | goto seq_1; |
5524 | } |
5525 | $p5 = $this->currPos; |
5526 | if (($this->input[$this->currPos] ?? null) === ">") { |
5527 | $this->currPos++; |
5528 | $r6 = ">"; |
5529 | } else { |
5530 | $r6 = self::$FAILED; |
5531 | } |
5532 | if ($r6 === self::$FAILED) { |
5533 | $r6 = false; |
5534 | } else { |
5535 | $r6 = self::$FAILED; |
5536 | $this->currPos = $p5; |
5537 | $this->currPos = $p3; |
5538 | $r1 = self::$FAILED; |
5539 | goto seq_1; |
5540 | } |
5541 | // free $p5 |
5542 | $r1 = true; |
5543 | seq_1: |
5544 | if ($r1!==self::$FAILED) { |
5545 | $this->savedPos = $p2; |
5546 | $r1 = $this->a42($r4); |
5547 | } |
5548 | // free $p3 |
5549 | choice_1: |
5550 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5551 | $this->currPos, |
5552 | $r1, |
5553 | self::$UNDEFINED, |
5554 | self::$UNDEFINED |
5555 | ); |
5556 | return $r1; |
5557 | } |
5558 | private function parsegeneric_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
5559 | $key = json_encode([466, $boolParams & 0x1fff, $param_preproc, $param_th]); |
5560 | $bucket = $this->currPos; |
5561 | $cached = $this->cache[$bucket][$key] ?? null; |
5562 | if ($cached) { |
5563 | $this->currPos = $cached->nextPos; |
5564 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5565 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5566 | return $cached->result; |
5567 | } |
5568 | $saved_preproc=$param_preproc; |
5569 | $saved_th=$param_th; |
5570 | $p2 = $this->currPos; |
5571 | // start seq_1 |
5572 | $p3 = $this->currPos; |
5573 | $p5 = $this->currPos; |
5574 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
5575 | $r4 = $this->input[$this->currPos++]; |
5576 | } else { |
5577 | $r4 = self::$FAILED; |
5578 | if (!$silence) {$this->fail(31);} |
5579 | $r4 = null; |
5580 | } |
5581 | // q <- $r4 |
5582 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5583 | // free $p5 |
5584 | $r6 = []; |
5585 | for (;;) { |
5586 | // start choice_1 |
5587 | $p5 = $this->currPos; |
5588 | $r7 = self::$FAILED; |
5589 | for (;;) { |
5590 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|", $this->currPos, 1) !== 0) { |
5591 | $r8 = self::consumeChar($this->input, $this->currPos); |
5592 | $r7 = true; |
5593 | } else { |
5594 | $r8 = self::$FAILED; |
5595 | if (!$silence) {$this->fail(36);} |
5596 | break; |
5597 | } |
5598 | } |
5599 | if ($r7!==self::$FAILED) { |
5600 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
5601 | goto choice_1; |
5602 | } else { |
5603 | $r7 = self::$FAILED; |
5604 | } |
5605 | // free $r8 |
5606 | // free $p5 |
5607 | $p5 = $this->currPos; |
5608 | // start seq_2 |
5609 | $p9 = $this->currPos; |
5610 | $p10 = $this->currPos; |
5611 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5612 | if ($r8 === self::$FAILED) { |
5613 | $r8 = false; |
5614 | } else { |
5615 | $r8 = self::$FAILED; |
5616 | $this->currPos = $p10; |
5617 | $r7 = self::$FAILED; |
5618 | goto seq_2; |
5619 | } |
5620 | // free $p10 |
5621 | // start choice_2 |
5622 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5623 | if ($r11!==self::$FAILED) { |
5624 | goto choice_2; |
5625 | } |
5626 | $r11 = $this->parseless_than($silence, $boolParams); |
5627 | if ($r11!==self::$FAILED) { |
5628 | goto choice_2; |
5629 | } |
5630 | $p10 = $this->currPos; |
5631 | // start seq_3 |
5632 | $p12 = $this->currPos; |
5633 | $p13 = $this->currPos; |
5634 | // start choice_3 |
5635 | $r14 = $this->discardspace_or_newline(true); |
5636 | if ($r14!==self::$FAILED) { |
5637 | goto choice_3; |
5638 | } |
5639 | if (strspn($this->input, "\x00/=><", $this->currPos, 1) !== 0) { |
5640 | $r14 = $this->input[$this->currPos++]; |
5641 | } else { |
5642 | $r14 = self::$FAILED; |
5643 | } |
5644 | choice_3: |
5645 | if ($r14 === self::$FAILED) { |
5646 | $r14 = false; |
5647 | } else { |
5648 | $r14 = self::$FAILED; |
5649 | $this->currPos = $p13; |
5650 | $r11 = self::$FAILED; |
5651 | goto seq_3; |
5652 | } |
5653 | // free $p13 |
5654 | if ($this->currPos < $this->inputLength) { |
5655 | $r15 = self::consumeChar($this->input, $this->currPos);; |
5656 | } else { |
5657 | $r15 = self::$FAILED; |
5658 | if (!$silence) {$this->fail(7);} |
5659 | $this->currPos = $p12; |
5660 | $r11 = self::$FAILED; |
5661 | goto seq_3; |
5662 | } |
5663 | $r11 = true; |
5664 | seq_3: |
5665 | if ($r11!==self::$FAILED) { |
5666 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
5667 | } else { |
5668 | $r11 = self::$FAILED; |
5669 | } |
5670 | // free $p12 |
5671 | // free $p10 |
5672 | choice_2: |
5673 | // t <- $r11 |
5674 | if ($r11===self::$FAILED) { |
5675 | $this->currPos = $p9; |
5676 | $r7 = self::$FAILED; |
5677 | goto seq_2; |
5678 | } |
5679 | $r7 = true; |
5680 | seq_2: |
5681 | if ($r7!==self::$FAILED) { |
5682 | $this->savedPos = $p5; |
5683 | $r7 = $this->a54($r4, $r11); |
5684 | } |
5685 | // free $p9 |
5686 | choice_1: |
5687 | if ($r7!==self::$FAILED) { |
5688 | $r6[] = $r7; |
5689 | } else { |
5690 | break; |
5691 | } |
5692 | } |
5693 | // r <- $r6 |
5694 | // free $r7 |
5695 | $this->savedPos = $this->currPos; |
5696 | $r7 = $this->a55($r4, $r6); |
5697 | if ($r7) { |
5698 | $r7 = false; |
5699 | } else { |
5700 | $r7 = self::$FAILED; |
5701 | $this->currPos = $p3; |
5702 | $r1 = self::$FAILED; |
5703 | goto seq_1; |
5704 | } |
5705 | $r1 = true; |
5706 | seq_1: |
5707 | if ($r1!==self::$FAILED) { |
5708 | $this->savedPos = $p2; |
5709 | $r1 = $this->a56($r4, $r6); |
5710 | } |
5711 | // free $p3 |
5712 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5713 | $this->currPos, |
5714 | $r1, |
5715 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5716 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5717 | ); |
5718 | return $r1; |
5719 | } |
5720 | private function discardspace_or_newline($silence) { |
5721 | $key = 579; |
5722 | $bucket = $this->currPos; |
5723 | $cached = $this->cache[$bucket][$key] ?? null; |
5724 | if ($cached) { |
5725 | $this->currPos = $cached->nextPos; |
5726 | |
5727 | return $cached->result; |
5728 | } |
5729 | |
5730 | if (strspn($this->input, " \x09\x0a\x0d\x0c", $this->currPos, 1) !== 0) { |
5731 | $r1 = $this->input[$this->currPos++]; |
5732 | } else { |
5733 | $r1 = self::$FAILED; |
5734 | if (!$silence) {$this->fail(37);} |
5735 | } |
5736 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5737 | $this->currPos, |
5738 | $r1, |
5739 | self::$UNDEFINED, |
5740 | self::$UNDEFINED |
5741 | ); |
5742 | return $r1; |
5743 | } |
5744 | private function parsegeneric_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5745 | $key = json_encode([472, $boolParams & 0x1fff, $param_preproc, $param_th]); |
5746 | $bucket = $this->currPos; |
5747 | $cached = $this->cache[$bucket][$key] ?? null; |
5748 | if ($cached) { |
5749 | $this->currPos = $cached->nextPos; |
5750 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5751 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5752 | return $cached->result; |
5753 | } |
5754 | $saved_preproc=$param_preproc; |
5755 | $saved_th=$param_th; |
5756 | // start choice_1 |
5757 | $p2 = $this->currPos; |
5758 | // start seq_1 |
5759 | $p3 = $this->currPos; |
5760 | $p5 = $this->currPos; |
5761 | // start seq_2 |
5762 | $p6 = $this->currPos; |
5763 | for (;;) { |
5764 | $r8 = $this->discardspace_or_newline($silence); |
5765 | if ($r8===self::$FAILED) { |
5766 | break; |
5767 | } |
5768 | } |
5769 | // free $r8 |
5770 | $r7 = true; |
5771 | if ($r7===self::$FAILED) { |
5772 | $r4 = self::$FAILED; |
5773 | goto seq_2; |
5774 | } |
5775 | // free $r7 |
5776 | if (($this->input[$this->currPos] ?? null) === "'") { |
5777 | $this->currPos++; |
5778 | $r7 = "'"; |
5779 | } else { |
5780 | if (!$silence) {$this->fail(33);} |
5781 | $r7 = self::$FAILED; |
5782 | $this->currPos = $p6; |
5783 | $r4 = self::$FAILED; |
5784 | goto seq_2; |
5785 | } |
5786 | $r4 = true; |
5787 | seq_2: |
5788 | // s <- $r4 |
5789 | if ($r4!==self::$FAILED) { |
5790 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5791 | } else { |
5792 | $r4 = self::$FAILED; |
5793 | $r1 = self::$FAILED; |
5794 | goto seq_1; |
5795 | } |
5796 | // free $p6 |
5797 | // free $p5 |
5798 | $r8 = $this->parseattribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5799 | if ($r8===self::$FAILED) { |
5800 | $r8 = null; |
5801 | } |
5802 | // t <- $r8 |
5803 | $p5 = $this->currPos; |
5804 | // start choice_2 |
5805 | if (($this->input[$this->currPos] ?? null) === "'") { |
5806 | $this->currPos++; |
5807 | $r9 = "'"; |
5808 | goto choice_2; |
5809 | } else { |
5810 | if (!$silence) {$this->fail(33);} |
5811 | $r9 = self::$FAILED; |
5812 | } |
5813 | $p6 = $this->currPos; |
5814 | // start seq_3 |
5815 | $p10 = $this->currPos; |
5816 | if (($this->input[$this->currPos] ?? null) === "/") { |
5817 | $this->currPos++; |
5818 | $r11 = "/"; |
5819 | } else { |
5820 | $r11 = self::$FAILED; |
5821 | $r11 = null; |
5822 | } |
5823 | if (($this->input[$this->currPos] ?? null) === ">") { |
5824 | $this->currPos++; |
5825 | $r12 = ">"; |
5826 | } else { |
5827 | $r12 = self::$FAILED; |
5828 | $this->currPos = $p10; |
5829 | $r9 = self::$FAILED; |
5830 | goto seq_3; |
5831 | } |
5832 | $r9 = true; |
5833 | seq_3: |
5834 | if ($r9!==self::$FAILED) { |
5835 | $r9 = false; |
5836 | $this->currPos = $p6; |
5837 | } |
5838 | // free $p10 |
5839 | // free $p6 |
5840 | choice_2: |
5841 | // q <- $r9 |
5842 | if ($r9!==self::$FAILED) { |
5843 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5844 | } else { |
5845 | $r9 = self::$FAILED; |
5846 | $this->currPos = $p3; |
5847 | $r1 = self::$FAILED; |
5848 | goto seq_1; |
5849 | } |
5850 | // free $p5 |
5851 | $r1 = true; |
5852 | seq_1: |
5853 | if ($r1!==self::$FAILED) { |
5854 | $this->savedPos = $p2; |
5855 | $r1 = $this->a57($r4, $r8, $r9); |
5856 | goto choice_1; |
5857 | } |
5858 | // free $p3 |
5859 | $p3 = $this->currPos; |
5860 | // start seq_4 |
5861 | $p5 = $this->currPos; |
5862 | $p6 = $this->currPos; |
5863 | // start seq_5 |
5864 | $p10 = $this->currPos; |
5865 | for (;;) { |
5866 | $r15 = $this->discardspace_or_newline($silence); |
5867 | if ($r15===self::$FAILED) { |
5868 | break; |
5869 | } |
5870 | } |
5871 | // free $r15 |
5872 | $r14 = true; |
5873 | if ($r14===self::$FAILED) { |
5874 | $r13 = self::$FAILED; |
5875 | goto seq_5; |
5876 | } |
5877 | // free $r14 |
5878 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5879 | $this->currPos++; |
5880 | $r14 = "\""; |
5881 | } else { |
5882 | if (!$silence) {$this->fail(34);} |
5883 | $r14 = self::$FAILED; |
5884 | $this->currPos = $p10; |
5885 | $r13 = self::$FAILED; |
5886 | goto seq_5; |
5887 | } |
5888 | $r13 = true; |
5889 | seq_5: |
5890 | // s <- $r13 |
5891 | if ($r13!==self::$FAILED) { |
5892 | $r13 = substr($this->input, $p6, $this->currPos - $p6); |
5893 | } else { |
5894 | $r13 = self::$FAILED; |
5895 | $r1 = self::$FAILED; |
5896 | goto seq_4; |
5897 | } |
5898 | // free $p10 |
5899 | // free $p6 |
5900 | $r15 = $this->parseattribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5901 | if ($r15===self::$FAILED) { |
5902 | $r15 = null; |
5903 | } |
5904 | // t <- $r15 |
5905 | $p6 = $this->currPos; |
5906 | // start choice_3 |
5907 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5908 | $this->currPos++; |
5909 | $r16 = "\""; |
5910 | goto choice_3; |
5911 | } else { |
5912 | if (!$silence) {$this->fail(34);} |
5913 | $r16 = self::$FAILED; |
5914 | } |
5915 | $p10 = $this->currPos; |
5916 | // start seq_6 |
5917 | $p17 = $this->currPos; |
5918 | if (($this->input[$this->currPos] ?? null) === "/") { |
5919 | $this->currPos++; |
5920 | $r18 = "/"; |
5921 | } else { |
5922 | $r18 = self::$FAILED; |
5923 | $r18 = null; |
5924 | } |
5925 | if (($this->input[$this->currPos] ?? null) === ">") { |
5926 | $this->currPos++; |
5927 | $r19 = ">"; |
5928 | } else { |
5929 | $r19 = self::$FAILED; |
5930 | $this->currPos = $p17; |
5931 | $r16 = self::$FAILED; |
5932 | goto seq_6; |
5933 | } |
5934 | $r16 = true; |
5935 | seq_6: |
5936 | if ($r16!==self::$FAILED) { |
5937 | $r16 = false; |
5938 | $this->currPos = $p10; |
5939 | } |
5940 | // free $p17 |
5941 | // free $p10 |
5942 | choice_3: |
5943 | // q <- $r16 |
5944 | if ($r16!==self::$FAILED) { |
5945 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
5946 | } else { |
5947 | $r16 = self::$FAILED; |
5948 | $this->currPos = $p5; |
5949 | $r1 = self::$FAILED; |
5950 | goto seq_4; |
5951 | } |
5952 | // free $p6 |
5953 | $r1 = true; |
5954 | seq_4: |
5955 | if ($r1!==self::$FAILED) { |
5956 | $this->savedPos = $p3; |
5957 | $r1 = $this->a57($r13, $r15, $r16); |
5958 | goto choice_1; |
5959 | } |
5960 | // free $p5 |
5961 | $p5 = $this->currPos; |
5962 | // start seq_7 |
5963 | $p6 = $this->currPos; |
5964 | $p10 = $this->currPos; |
5965 | for (;;) { |
5966 | $r21 = $this->discardspace_or_newline($silence); |
5967 | if ($r21===self::$FAILED) { |
5968 | break; |
5969 | } |
5970 | } |
5971 | // free $r21 |
5972 | $r20 = true; |
5973 | // s <- $r20 |
5974 | if ($r20!==self::$FAILED) { |
5975 | $r20 = substr($this->input, $p10, $this->currPos - $p10); |
5976 | } else { |
5977 | $r20 = self::$FAILED; |
5978 | $r1 = self::$FAILED; |
5979 | goto seq_7; |
5980 | } |
5981 | // free $p10 |
5982 | $r21 = $this->parseattribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
5983 | // t <- $r21 |
5984 | if ($r21===self::$FAILED) { |
5985 | $this->currPos = $p6; |
5986 | $r1 = self::$FAILED; |
5987 | goto seq_7; |
5988 | } |
5989 | $p10 = $this->currPos; |
5990 | // start choice_4 |
5991 | $r22 = $this->discardspace_or_newline(true); |
5992 | if ($r22!==self::$FAILED) { |
5993 | goto choice_4; |
5994 | } |
5995 | $r22 = $this->discardeof(true); |
5996 | if ($r22!==self::$FAILED) { |
5997 | goto choice_4; |
5998 | } |
5999 | // start seq_8 |
6000 | $p17 = $this->currPos; |
6001 | if (($this->input[$this->currPos] ?? null) === "/") { |
6002 | $this->currPos++; |
6003 | $r23 = "/"; |
6004 | } else { |
6005 | $r23 = self::$FAILED; |
6006 | $r23 = null; |
6007 | } |
6008 | if (($this->input[$this->currPos] ?? null) === ">") { |
6009 | $this->currPos++; |
6010 | $r24 = ">"; |
6011 | } else { |
6012 | $r24 = self::$FAILED; |
6013 | $this->currPos = $p17; |
6014 | $r22 = self::$FAILED; |
6015 | goto seq_8; |
6016 | } |
6017 | $r22 = true; |
6018 | seq_8: |
6019 | // free $p17 |
6020 | choice_4: |
6021 | if ($r22!==self::$FAILED) { |
6022 | $r22 = false; |
6023 | $this->currPos = $p10; |
6024 | } else { |
6025 | $this->currPos = $p6; |
6026 | $r1 = self::$FAILED; |
6027 | goto seq_7; |
6028 | } |
6029 | // free $p10 |
6030 | $r1 = true; |
6031 | seq_7: |
6032 | if ($r1!==self::$FAILED) { |
6033 | $this->savedPos = $p5; |
6034 | $r1 = $this->a58($r20, $r21); |
6035 | } |
6036 | // free $p6 |
6037 | choice_1: |
6038 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6039 | $this->currPos, |
6040 | $r1, |
6041 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6042 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6043 | ); |
6044 | return $r1; |
6045 | } |
6046 | private function parseextlink_nonipv6url_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
6047 | $key = json_encode([540, $boolParams & 0x1fff, $param_preproc, $param_th]); |
6048 | $bucket = $this->currPos; |
6049 | $cached = $this->cache[$bucket][$key] ?? null; |
6050 | if ($cached) { |
6051 | $this->currPos = $cached->nextPos; |
6052 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6053 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6054 | return $cached->result; |
6055 | } |
6056 | $saved_preproc=$param_preproc; |
6057 | $saved_th=$param_th; |
6058 | $p2 = $this->currPos; |
6059 | $r3 = []; |
6060 | for (;;) { |
6061 | // start choice_1 |
6062 | $p5 = $this->currPos; |
6063 | $r4 = self::$FAILED; |
6064 | for (;;) { |
6065 | $r6 = self::charAt($this->input, $this->currPos); |
6066 | if (preg_match("/^[^<\\[{\\x0a\\x0d|!\\]}\\-\\x09&=\"' \\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r6)) { |
6067 | $this->currPos += strlen($r6); |
6068 | $r4 = true; |
6069 | } else { |
6070 | $r6 = self::$FAILED; |
6071 | if (!$silence) {$this->fail(38);} |
6072 | break; |
6073 | } |
6074 | } |
6075 | if ($r4!==self::$FAILED) { |
6076 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
6077 | goto choice_1; |
6078 | } else { |
6079 | $r4 = self::$FAILED; |
6080 | } |
6081 | // free $r6 |
6082 | // free $p5 |
6083 | $p5 = $this->currPos; |
6084 | // start seq_1 |
6085 | $p7 = $this->currPos; |
6086 | $p8 = $this->currPos; |
6087 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
6088 | if ($r6 === self::$FAILED) { |
6089 | $r6 = false; |
6090 | } else { |
6091 | $r6 = self::$FAILED; |
6092 | $this->currPos = $p8; |
6093 | $r4 = self::$FAILED; |
6094 | goto seq_1; |
6095 | } |
6096 | // free $p8 |
6097 | // start choice_2 |
6098 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
6099 | if ($r9!==self::$FAILED) { |
6100 | goto choice_2; |
6101 | } |
6102 | if (strspn($this->input, "&|{-!}=", $this->currPos, 1) !== 0) { |
6103 | $r9 = $this->input[$this->currPos++]; |
6104 | } else { |
6105 | $r9 = self::$FAILED; |
6106 | if (!$silence) {$this->fail(39);} |
6107 | } |
6108 | choice_2: |
6109 | // s <- $r9 |
6110 | if ($r9===self::$FAILED) { |
6111 | $this->currPos = $p7; |
6112 | $r4 = self::$FAILED; |
6113 | goto seq_1; |
6114 | } |
6115 | $r4 = true; |
6116 | seq_1: |
6117 | if ($r4!==self::$FAILED) { |
6118 | $this->savedPos = $p5; |
6119 | $r4 = $this->a42($r9); |
6120 | goto choice_1; |
6121 | } |
6122 | // free $p7 |
6123 | $p7 = $this->currPos; |
6124 | // start seq_2 |
6125 | $p8 = $this->currPos; |
6126 | $r10 = $this->input[$this->currPos] ?? ''; |
6127 | if ($r10 === "'") { |
6128 | $this->currPos++; |
6129 | } else { |
6130 | $r10 = self::$FAILED; |
6131 | if (!$silence) {$this->fail(40);} |
6132 | $r4 = self::$FAILED; |
6133 | goto seq_2; |
6134 | } |
6135 | $p11 = $this->currPos; |
6136 | $r12 = $this->input[$this->currPos] ?? ''; |
6137 | if ($r12 === "'") { |
6138 | $this->currPos++; |
6139 | } else { |
6140 | $r12 = self::$FAILED; |
6141 | } |
6142 | if ($r12 === self::$FAILED) { |
6143 | $r12 = false; |
6144 | } else { |
6145 | $r12 = self::$FAILED; |
6146 | $this->currPos = $p11; |
6147 | $this->currPos = $p8; |
6148 | $r4 = self::$FAILED; |
6149 | goto seq_2; |
6150 | } |
6151 | // free $p11 |
6152 | $r4 = true; |
6153 | seq_2: |
6154 | if ($r4!==self::$FAILED) { |
6155 | $r4 = substr($this->input, $p7, $this->currPos - $p7); |
6156 | } else { |
6157 | $r4 = self::$FAILED; |
6158 | } |
6159 | // free $p8 |
6160 | // free $p7 |
6161 | choice_1: |
6162 | if ($r4!==self::$FAILED) { |
6163 | $r3[] = $r4; |
6164 | } else { |
6165 | break; |
6166 | } |
6167 | } |
6168 | if (count($r3) === 0) { |
6169 | $r3 = self::$FAILED; |
6170 | } |
6171 | // r <- $r3 |
6172 | // free $r4 |
6173 | $r1 = $r3; |
6174 | if ($r1!==self::$FAILED) { |
6175 | $this->savedPos = $p2; |
6176 | $r1 = $this->a59($r3); |
6177 | } |
6178 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6179 | $this->currPos, |
6180 | $r1, |
6181 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6182 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6183 | ); |
6184 | return $r1; |
6185 | } |
6186 | private function parseurltext($silence, $boolParams, &$param_preproc, &$param_th) { |
6187 | $key = json_encode([524, $boolParams & 0x1fff, $param_preproc, $param_th]); |
6188 | $bucket = $this->currPos; |
6189 | $cached = $this->cache[$bucket][$key] ?? null; |
6190 | if ($cached) { |
6191 | $this->currPos = $cached->nextPos; |
6192 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6193 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6194 | return $cached->result; |
6195 | } |
6196 | $saved_preproc=$param_preproc; |
6197 | $saved_th=$param_th; |
6198 | $r1 = []; |
6199 | for (;;) { |
6200 | // start choice_1 |
6201 | $p3 = $this->currPos; |
6202 | // start seq_1 |
6203 | $p4 = $this->currPos; |
6204 | $this->savedPos = $this->currPos; |
6205 | $r5 = $this->a60(); |
6206 | if ($r5) { |
6207 | $r5 = false; |
6208 | } else { |
6209 | $r5 = self::$FAILED; |
6210 | $r2 = self::$FAILED; |
6211 | goto seq_1; |
6212 | } |
6213 | $r2 = true; |
6214 | seq_1: |
6215 | if ($r2!==self::$FAILED) { |
6216 | $this->savedPos = $p3; |
6217 | $r2 = $this->a61(); |
6218 | goto choice_1; |
6219 | } |
6220 | // free $p4 |
6221 | $p4 = $this->currPos; |
6222 | // start seq_2 |
6223 | $p6 = $this->currPos; |
6224 | $this->savedPos = $this->currPos; |
6225 | $r7 = $this->a62(); |
6226 | if ($r7) { |
6227 | $r7 = false; |
6228 | } else { |
6229 | $r7 = self::$FAILED; |
6230 | $r2 = self::$FAILED; |
6231 | goto seq_2; |
6232 | } |
6233 | $r8 = $this->parseautolink($silence, $boolParams, $param_preproc, $param_th); |
6234 | // al <- $r8 |
6235 | if ($r8===self::$FAILED) { |
6236 | $this->currPos = $p6; |
6237 | $r2 = self::$FAILED; |
6238 | goto seq_2; |
6239 | } |
6240 | $r2 = true; |
6241 | seq_2: |
6242 | if ($r2!==self::$FAILED) { |
6243 | $this->savedPos = $p4; |
6244 | $r2 = $this->a63($r8); |
6245 | goto choice_1; |
6246 | } |
6247 | // free $p6 |
6248 | $p6 = $this->currPos; |
6249 | // start seq_3 |
6250 | $p9 = $this->currPos; |
6251 | $p10 = $this->currPos; |
6252 | if (($this->input[$this->currPos] ?? null) === "&") { |
6253 | $this->currPos++; |
6254 | $r11 = "&"; |
6255 | $r11 = false; |
6256 | $this->currPos = $p10; |
6257 | } else { |
6258 | $r11 = self::$FAILED; |
6259 | $r2 = self::$FAILED; |
6260 | goto seq_3; |
6261 | } |
6262 | // free $p10 |
6263 | $r12 = $this->parsehtmlentity($silence); |
6264 | // he <- $r12 |
6265 | if ($r12===self::$FAILED) { |
6266 | $this->currPos = $p9; |
6267 | $r2 = self::$FAILED; |
6268 | goto seq_3; |
6269 | } |
6270 | $r2 = true; |
6271 | seq_3: |
6272 | if ($r2!==self::$FAILED) { |
6273 | $this->savedPos = $p6; |
6274 | $r2 = $this->a64($r12); |
6275 | goto choice_1; |
6276 | } |
6277 | // free $p9 |
6278 | $p9 = $this->currPos; |
6279 | // start seq_4 |
6280 | $p10 = $this->currPos; |
6281 | $p13 = $this->currPos; |
6282 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
6283 | $r14 = "__"; |
6284 | $this->currPos += 2; |
6285 | $r14 = false; |
6286 | $this->currPos = $p13; |
6287 | } else { |
6288 | $r14 = self::$FAILED; |
6289 | $r2 = self::$FAILED; |
6290 | goto seq_4; |
6291 | } |
6292 | // free $p13 |
6293 | $r15 = $this->parsebehavior_switch($silence); |
6294 | // bs <- $r15 |
6295 | if ($r15===self::$FAILED) { |
6296 | $this->currPos = $p10; |
6297 | $r2 = self::$FAILED; |
6298 | goto seq_4; |
6299 | } |
6300 | $r2 = true; |
6301 | seq_4: |
6302 | if ($r2!==self::$FAILED) { |
6303 | $this->savedPos = $p9; |
6304 | $r2 = $this->a65($r15); |
6305 | goto choice_1; |
6306 | } |
6307 | // free $p10 |
6308 | $r2 = $this->parsetext_char($silence); |
6309 | choice_1: |
6310 | if ($r2!==self::$FAILED) { |
6311 | $r1[] = $r2; |
6312 | } else { |
6313 | break; |
6314 | } |
6315 | } |
6316 | if (count($r1) === 0) { |
6317 | $r1 = self::$FAILED; |
6318 | } |
6319 | // free $r2 |
6320 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6321 | $this->currPos, |
6322 | $r1, |
6323 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6324 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6325 | ); |
6326 | return $r1; |
6327 | } |
6328 | private function parseinline_element($silence, $boolParams, &$param_preproc, &$param_th) { |
6329 | $key = json_encode([334, $boolParams & 0x1fff, $param_preproc, $param_th]); |
6330 | $bucket = $this->currPos; |
6331 | $cached = $this->cache[$bucket][$key] ?? null; |
6332 | if ($cached) { |
6333 | $this->currPos = $cached->nextPos; |
6334 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6335 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6336 | return $cached->result; |
6337 | } |
6338 | $saved_preproc=$param_preproc; |
6339 | $saved_th=$param_th; |
6340 | // start choice_1 |
6341 | $p2 = $this->currPos; |
6342 | // start seq_1 |
6343 | $p3 = $this->currPos; |
6344 | $p4 = $this->currPos; |
6345 | if (($this->input[$this->currPos] ?? null) === "<") { |
6346 | $this->currPos++; |
6347 | $r5 = "<"; |
6348 | $r5 = false; |
6349 | $this->currPos = $p4; |
6350 | } else { |
6351 | $r5 = self::$FAILED; |
6352 | $r1 = self::$FAILED; |
6353 | goto seq_1; |
6354 | } |
6355 | // free $p4 |
6356 | $r6 = $this->parseangle_bracket_markup($silence, $boolParams, $param_preproc, $param_th); |
6357 | // r <- $r6 |
6358 | if ($r6===self::$FAILED) { |
6359 | $this->currPos = $p3; |
6360 | $r1 = self::$FAILED; |
6361 | goto seq_1; |
6362 | } |
6363 | $r1 = true; |
6364 | seq_1: |
6365 | if ($r1!==self::$FAILED) { |
6366 | $this->savedPos = $p2; |
6367 | $r1 = $this->a24($r6); |
6368 | goto choice_1; |
6369 | } |
6370 | // free $p3 |
6371 | $p3 = $this->currPos; |
6372 | // start seq_2 |
6373 | $p4 = $this->currPos; |
6374 | $p7 = $this->currPos; |
6375 | if (($this->input[$this->currPos] ?? null) === "{") { |
6376 | $this->currPos++; |
6377 | $r8 = "{"; |
6378 | $r8 = false; |
6379 | $this->currPos = $p7; |
6380 | } else { |
6381 | $r8 = self::$FAILED; |
6382 | $r1 = self::$FAILED; |
6383 | goto seq_2; |
6384 | } |
6385 | // free $p7 |
6386 | $r9 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
6387 | // r <- $r9 |
6388 | if ($r9===self::$FAILED) { |
6389 | $this->currPos = $p4; |
6390 | $r1 = self::$FAILED; |
6391 | goto seq_2; |
6392 | } |
6393 | $r1 = true; |
6394 | seq_2: |
6395 | if ($r1!==self::$FAILED) { |
6396 | $this->savedPos = $p3; |
6397 | $r1 = $this->a24($r9); |
6398 | goto choice_1; |
6399 | } |
6400 | // free $p4 |
6401 | $p4 = $this->currPos; |
6402 | // start seq_3 |
6403 | $p7 = $this->currPos; |
6404 | $p10 = $this->currPos; |
6405 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
6406 | $r11 = "-{"; |
6407 | $this->currPos += 2; |
6408 | $r11 = false; |
6409 | $this->currPos = $p10; |
6410 | } else { |
6411 | $r11 = self::$FAILED; |
6412 | $r1 = self::$FAILED; |
6413 | goto seq_3; |
6414 | } |
6415 | // free $p10 |
6416 | $r12 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
6417 | // r <- $r12 |
6418 | if ($r12===self::$FAILED) { |
6419 | $this->currPos = $p7; |
6420 | $r1 = self::$FAILED; |
6421 | goto seq_3; |
6422 | } |
6423 | $r1 = true; |
6424 | seq_3: |
6425 | if ($r1!==self::$FAILED) { |
6426 | $this->savedPos = $p4; |
6427 | $r1 = $this->a24($r12); |
6428 | goto choice_1; |
6429 | } |
6430 | // free $p7 |
6431 | $p7 = $this->currPos; |
6432 | $r1 = self::$FAILED; |
6433 | for (;;) { |
6434 | // start seq_4 |
6435 | $p10 = $this->currPos; |
6436 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
6437 | $r14 = "[["; |
6438 | $this->currPos += 2; |
6439 | } else { |
6440 | if (!$silence) {$this->fail(41);} |
6441 | $r14 = self::$FAILED; |
6442 | $r13 = self::$FAILED; |
6443 | goto seq_4; |
6444 | } |
6445 | $p15 = $this->currPos; |
6446 | if (($this->input[$this->currPos] ?? null) === "[") { |
6447 | $this->currPos++; |
6448 | $r16 = "["; |
6449 | $r16 = false; |
6450 | $this->currPos = $p15; |
6451 | } else { |
6452 | $r16 = self::$FAILED; |
6453 | $this->currPos = $p10; |
6454 | $r13 = self::$FAILED; |
6455 | goto seq_4; |
6456 | } |
6457 | // free $p15 |
6458 | $r13 = true; |
6459 | seq_4: |
6460 | if ($r13!==self::$FAILED) { |
6461 | $r1 = true; |
6462 | } else { |
6463 | break; |
6464 | } |
6465 | // free $p10 |
6466 | } |
6467 | if ($r1!==self::$FAILED) { |
6468 | $r1 = substr($this->input, $p7, $this->currPos - $p7); |
6469 | goto choice_1; |
6470 | } else { |
6471 | $r1 = self::$FAILED; |
6472 | } |
6473 | // free $r13 |
6474 | // free $p7 |
6475 | $p7 = $this->currPos; |
6476 | // start seq_5 |
6477 | $p10 = $this->currPos; |
6478 | $p15 = $this->currPos; |
6479 | if (($this->input[$this->currPos] ?? null) === "[") { |
6480 | $this->currPos++; |
6481 | $r13 = "["; |
6482 | $r13 = false; |
6483 | $this->currPos = $p15; |
6484 | } else { |
6485 | $r13 = self::$FAILED; |
6486 | $r1 = self::$FAILED; |
6487 | goto seq_5; |
6488 | } |
6489 | // free $p15 |
6490 | // start choice_2 |
6491 | $r17 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
6492 | if ($r17!==self::$FAILED) { |
6493 | goto choice_2; |
6494 | } |
6495 | $r17 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
6496 | choice_2: |
6497 | // r <- $r17 |
6498 | if ($r17===self::$FAILED) { |
6499 | $this->currPos = $p10; |
6500 | $r1 = self::$FAILED; |
6501 | goto seq_5; |
6502 | } |
6503 | $r1 = true; |
6504 | seq_5: |
6505 | if ($r1!==self::$FAILED) { |
6506 | $this->savedPos = $p7; |
6507 | $r1 = $this->a24($r17); |
6508 | goto choice_1; |
6509 | } |
6510 | // free $p10 |
6511 | $p10 = $this->currPos; |
6512 | // start seq_6 |
6513 | $p15 = $this->currPos; |
6514 | $p18 = $this->currPos; |
6515 | if (($this->input[$this->currPos] ?? null) === "'") { |
6516 | $this->currPos++; |
6517 | $r19 = "'"; |
6518 | $r19 = false; |
6519 | $this->currPos = $p18; |
6520 | } else { |
6521 | $r19 = self::$FAILED; |
6522 | $r1 = self::$FAILED; |
6523 | goto seq_6; |
6524 | } |
6525 | // free $p18 |
6526 | $r20 = $this->parsequote($silence); |
6527 | // r <- $r20 |
6528 | if ($r20===self::$FAILED) { |
6529 | $this->currPos = $p15; |
6530 | $r1 = self::$FAILED; |
6531 | goto seq_6; |
6532 | } |
6533 | $r1 = true; |
6534 | seq_6: |
6535 | if ($r1!==self::$FAILED) { |
6536 | $this->savedPos = $p10; |
6537 | $r1 = $this->a24($r20); |
6538 | } |
6539 | // free $p15 |
6540 | choice_1: |
6541 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6542 | $this->currPos, |
6543 | $r1, |
6544 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6545 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6546 | ); |
6547 | return $r1; |
6548 | } |
6549 | private function discardlist_char($silence) { |
6550 | $key = 487; |
6551 | $bucket = $this->currPos; |
6552 | $cached = $this->cache[$bucket][$key] ?? null; |
6553 | if ($cached) { |
6554 | $this->currPos = $cached->nextPos; |
6555 | |
6556 | return $cached->result; |
6557 | } |
6558 | |
6559 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6560 | $r1 = $this->input[$this->currPos++]; |
6561 | } else { |
6562 | $r1 = self::$FAILED; |
6563 | if (!$silence) {$this->fail(42);} |
6564 | } |
6565 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6566 | $this->currPos, |
6567 | $r1, |
6568 | self::$UNDEFINED, |
6569 | self::$UNDEFINED |
6570 | ); |
6571 | return $r1; |
6572 | } |
6573 | private function parselist_char($silence) { |
6574 | $key = 486; |
6575 | $bucket = $this->currPos; |
6576 | $cached = $this->cache[$bucket][$key] ?? null; |
6577 | if ($cached) { |
6578 | $this->currPos = $cached->nextPos; |
6579 | |
6580 | return $cached->result; |
6581 | } |
6582 | |
6583 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6584 | $r1 = $this->input[$this->currPos++]; |
6585 | } else { |
6586 | $r1 = self::$FAILED; |
6587 | if (!$silence) {$this->fail(42);} |
6588 | } |
6589 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6590 | $this->currPos, |
6591 | $r1, |
6592 | self::$UNDEFINED, |
6593 | self::$UNDEFINED |
6594 | ); |
6595 | return $r1; |
6596 | } |
6597 | private function parsedtdd_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
6598 | $key = json_encode([482, $boolParams & 0xfff, $param_preproc, $param_th]); |
6599 | $bucket = $this->currPos; |
6600 | $cached = $this->cache[$bucket][$key] ?? null; |
6601 | if ($cached) { |
6602 | $this->currPos = $cached->nextPos; |
6603 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6604 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6605 | return $cached->result; |
6606 | } |
6607 | $saved_preproc=$param_preproc; |
6608 | $saved_th=$param_th; |
6609 | $p2 = $this->currPos; |
6610 | // start seq_1 |
6611 | $p3 = $this->currPos; |
6612 | $r4 = $this->parseinlineline_break_on_colon($silence, $boolParams, $param_preproc, $param_th); |
6613 | if ($r4===self::$FAILED) { |
6614 | $r4 = null; |
6615 | } |
6616 | // c <- $r4 |
6617 | $p6 = $this->currPos; |
6618 | // cpos <- $r5 |
6619 | if (($this->input[$this->currPos] ?? null) === ":") { |
6620 | $this->currPos++; |
6621 | $r5 = ":"; |
6622 | $this->savedPos = $p6; |
6623 | $r5 = $this->a66($r4); |
6624 | } else { |
6625 | if (!$silence) {$this->fail(18);} |
6626 | $r5 = self::$FAILED; |
6627 | $this->currPos = $p3; |
6628 | $r1 = self::$FAILED; |
6629 | goto seq_1; |
6630 | } |
6631 | $r1 = true; |
6632 | seq_1: |
6633 | if ($r1!==self::$FAILED) { |
6634 | $this->savedPos = $p2; |
6635 | $r1 = $this->a67($r4, $r5); |
6636 | } |
6637 | // free $p3 |
6638 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6639 | $this->currPos, |
6640 | $r1, |
6641 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6642 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6643 | ); |
6644 | return $r1; |
6645 | } |
6646 | private function discardeolf($silence) { |
6647 | $key = 571; |
6648 | $bucket = $this->currPos; |
6649 | $cached = $this->cache[$bucket][$key] ?? null; |
6650 | if ($cached) { |
6651 | $this->currPos = $cached->nextPos; |
6652 | |
6653 | return $cached->result; |
6654 | } |
6655 | |
6656 | // start choice_1 |
6657 | $r1 = $this->discardnewline($silence); |
6658 | if ($r1!==self::$FAILED) { |
6659 | goto choice_1; |
6660 | } |
6661 | $r1 = $this->discardeof($silence); |
6662 | choice_1: |
6663 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6664 | $this->currPos, |
6665 | $r1, |
6666 | self::$UNDEFINED, |
6667 | self::$UNDEFINED |
6668 | ); |
6669 | return $r1; |
6670 | } |
6671 | private function parsetable_line($silence, $boolParams, &$param_preproc, &$param_th) { |
6672 | $key = json_encode([494, $boolParams & 0x1fff, $param_preproc, $param_th]); |
6673 | $bucket = $this->currPos; |
6674 | $cached = $this->cache[$bucket][$key] ?? null; |
6675 | if ($cached) { |
6676 | $this->currPos = $cached->nextPos; |
6677 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6678 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6679 | return $cached->result; |
6680 | } |
6681 | $saved_preproc=$param_preproc; |
6682 | $saved_th=$param_th; |
6683 | $p2 = $this->currPos; |
6684 | // start seq_1 |
6685 | $p3 = $this->currPos; |
6686 | // start choice_1 |
6687 | $p5 = $this->currPos; |
6688 | $r4 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
6689 | if ($r4 === self::$FAILED) { |
6690 | $r4 = false; |
6691 | goto choice_1; |
6692 | } else { |
6693 | $r4 = self::$FAILED; |
6694 | $this->currPos = $p5; |
6695 | } |
6696 | // free $p5 |
6697 | $p5 = $this->currPos; |
6698 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
6699 | $r4 = "{{!}}"; |
6700 | $this->currPos += 5; |
6701 | $r4 = false; |
6702 | $this->currPos = $p5; |
6703 | } else { |
6704 | $r4 = self::$FAILED; |
6705 | } |
6706 | // free $p5 |
6707 | choice_1: |
6708 | if ($r4===self::$FAILED) { |
6709 | $r1 = self::$FAILED; |
6710 | goto seq_1; |
6711 | } |
6712 | // start choice_2 |
6713 | $r6 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
6714 | if ($r6!==self::$FAILED) { |
6715 | goto choice_2; |
6716 | } |
6717 | $r6 = $this->parsetable_content_line($silence, $boolParams | 0x40, $param_preproc, $param_th); |
6718 | if ($r6!==self::$FAILED) { |
6719 | goto choice_2; |
6720 | } |
6721 | $r6 = $this->parsetable_end_tag($silence); |
6722 | choice_2: |
6723 | // tl <- $r6 |
6724 | if ($r6===self::$FAILED) { |
6725 | $this->currPos = $p3; |
6726 | $r1 = self::$FAILED; |
6727 | goto seq_1; |
6728 | } |
6729 | $r1 = true; |
6730 | seq_1: |
6731 | if ($r1!==self::$FAILED) { |
6732 | $this->savedPos = $p2; |
6733 | $r1 = $this->a68($r6); |
6734 | } |
6735 | // free $p3 |
6736 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6737 | $this->currPos, |
6738 | $r1, |
6739 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6740 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6741 | ); |
6742 | return $r1; |
6743 | } |
6744 | private function parsesol($silence, $boolParams, &$param_preproc, &$param_th) { |
6745 | $key = json_encode([590, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
6746 | $bucket = $this->currPos; |
6747 | $cached = $this->cache[$bucket][$key] ?? null; |
6748 | if ($cached) { |
6749 | $this->currPos = $cached->nextPos; |
6750 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6751 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6752 | return $cached->result; |
6753 | } |
6754 | $saved_preproc=$param_preproc; |
6755 | $saved_th=$param_th; |
6756 | $p2 = $this->currPos; |
6757 | // start seq_1 |
6758 | $p3 = $this->currPos; |
6759 | $r4 = $this->parsesol_prefix($silence); |
6760 | // sp <- $r4 |
6761 | if ($r4===self::$FAILED) { |
6762 | $r1 = self::$FAILED; |
6763 | goto seq_1; |
6764 | } |
6765 | $r5 = $this->parseempty_lines_with_comments($silence); |
6766 | if ($r5===self::$FAILED) { |
6767 | $r5 = null; |
6768 | } |
6769 | // elc <- $r5 |
6770 | $r6 = []; |
6771 | for (;;) { |
6772 | $r7 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
6773 | if ($r7!==self::$FAILED) { |
6774 | $r6[] = $r7; |
6775 | } else { |
6776 | break; |
6777 | } |
6778 | } |
6779 | // st <- $r6 |
6780 | // free $r7 |
6781 | $r1 = true; |
6782 | seq_1: |
6783 | if ($r1!==self::$FAILED) { |
6784 | $this->savedPos = $p2; |
6785 | $r1 = $this->a69($r4, $r5, $r6); |
6786 | } |
6787 | // free $p3 |
6788 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6789 | $this->currPos, |
6790 | $r1, |
6791 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6792 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6793 | ); |
6794 | return $r1; |
6795 | } |
6796 | private function discardcomment($silence) { |
6797 | $key = 573; |
6798 | $bucket = $this->currPos; |
6799 | $cached = $this->cache[$bucket][$key] ?? null; |
6800 | if ($cached) { |
6801 | $this->currPos = $cached->nextPos; |
6802 | |
6803 | return $cached->result; |
6804 | } |
6805 | |
6806 | $p2 = $this->currPos; |
6807 | // start seq_1 |
6808 | $p3 = $this->currPos; |
6809 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
6810 | $r4 = "<!--"; |
6811 | $this->currPos += 4; |
6812 | } else { |
6813 | if (!$silence) {$this->fail(11);} |
6814 | $r4 = self::$FAILED; |
6815 | $r1 = self::$FAILED; |
6816 | goto seq_1; |
6817 | } |
6818 | $p6 = $this->currPos; |
6819 | for (;;) { |
6820 | // start seq_2 |
6821 | $p8 = $this->currPos; |
6822 | $p9 = $this->currPos; |
6823 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6824 | $r10 = "-->"; |
6825 | $this->currPos += 3; |
6826 | } else { |
6827 | $r10 = self::$FAILED; |
6828 | } |
6829 | if ($r10 === self::$FAILED) { |
6830 | $r10 = false; |
6831 | } else { |
6832 | $r10 = self::$FAILED; |
6833 | $this->currPos = $p9; |
6834 | $r7 = self::$FAILED; |
6835 | goto seq_2; |
6836 | } |
6837 | // free $p9 |
6838 | if ($this->currPos < $this->inputLength) { |
6839 | $r11 = self::consumeChar($this->input, $this->currPos);; |
6840 | } else { |
6841 | $r11 = self::$FAILED; |
6842 | if (!$silence) {$this->fail(7);} |
6843 | $this->currPos = $p8; |
6844 | $r7 = self::$FAILED; |
6845 | goto seq_2; |
6846 | } |
6847 | $r7 = true; |
6848 | seq_2: |
6849 | if ($r7===self::$FAILED) { |
6850 | break; |
6851 | } |
6852 | // free $p8 |
6853 | } |
6854 | // free $r7 |
6855 | $r5 = true; |
6856 | // c <- $r5 |
6857 | if ($r5!==self::$FAILED) { |
6858 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
6859 | } else { |
6860 | $r5 = self::$FAILED; |
6861 | $this->currPos = $p3; |
6862 | $r1 = self::$FAILED; |
6863 | goto seq_1; |
6864 | } |
6865 | // free $p6 |
6866 | $p6 = $this->currPos; |
6867 | // start choice_1 |
6868 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6869 | $r7 = "-->"; |
6870 | $this->currPos += 3; |
6871 | goto choice_1; |
6872 | } else { |
6873 | if (!$silence) {$this->fail(12);} |
6874 | $r7 = self::$FAILED; |
6875 | } |
6876 | $r7 = $this->discardeof($silence); |
6877 | choice_1: |
6878 | // cEnd <- $r7 |
6879 | if ($r7!==self::$FAILED) { |
6880 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
6881 | } else { |
6882 | $r7 = self::$FAILED; |
6883 | $this->currPos = $p3; |
6884 | $r1 = self::$FAILED; |
6885 | goto seq_1; |
6886 | } |
6887 | // free $p6 |
6888 | $r1 = true; |
6889 | seq_1: |
6890 | if ($r1!==self::$FAILED) { |
6891 | $this->savedPos = $p2; |
6892 | $r1 = $this->a27($r5, $r7); |
6893 | } |
6894 | // free $p3 |
6895 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6896 | $this->currPos, |
6897 | $r1, |
6898 | self::$UNDEFINED, |
6899 | self::$UNDEFINED |
6900 | ); |
6901 | return $r1; |
6902 | } |
6903 | private function discardsof($silence) { |
6904 | $key = 563; |
6905 | $bucket = $this->currPos; |
6906 | $cached = $this->cache[$bucket][$key] ?? null; |
6907 | if ($cached) { |
6908 | $this->currPos = $cached->nextPos; |
6909 | |
6910 | return $cached->result; |
6911 | } |
6912 | |
6913 | $this->savedPos = $this->currPos; |
6914 | $r1 = $this->a70(); |
6915 | if ($r1) { |
6916 | $r1 = false; |
6917 | } else { |
6918 | $r1 = self::$FAILED; |
6919 | } |
6920 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6921 | $this->currPos, |
6922 | $r1, |
6923 | self::$UNDEFINED, |
6924 | self::$UNDEFINED |
6925 | ); |
6926 | return $r1; |
6927 | } |
6928 | private function parseredirect($silence, $boolParams, &$param_th, &$param_preproc) { |
6929 | $key = json_encode([308, $boolParams & 0x1fff, $param_th, $param_preproc]); |
6930 | $bucket = $this->currPos; |
6931 | $cached = $this->cache[$bucket][$key] ?? null; |
6932 | if ($cached) { |
6933 | $this->currPos = $cached->nextPos; |
6934 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6935 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6936 | return $cached->result; |
6937 | } |
6938 | $saved_th=$param_th; |
6939 | $saved_preproc=$param_preproc; |
6940 | $p2 = $this->currPos; |
6941 | // start seq_1 |
6942 | $p3 = $this->currPos; |
6943 | $r4 = $this->parseredirect_word($silence); |
6944 | // rw <- $r4 |
6945 | if ($r4===self::$FAILED) { |
6946 | $r1 = self::$FAILED; |
6947 | goto seq_1; |
6948 | } |
6949 | $p6 = $this->currPos; |
6950 | for (;;) { |
6951 | $r7 = $this->discardspace_or_newline($silence); |
6952 | if ($r7===self::$FAILED) { |
6953 | break; |
6954 | } |
6955 | } |
6956 | // free $r7 |
6957 | $r5 = true; |
6958 | // sp <- $r5 |
6959 | if ($r5!==self::$FAILED) { |
6960 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
6961 | } else { |
6962 | $r5 = self::$FAILED; |
6963 | $this->currPos = $p3; |
6964 | $r1 = self::$FAILED; |
6965 | goto seq_1; |
6966 | } |
6967 | // free $p6 |
6968 | $p6 = $this->currPos; |
6969 | // start seq_2 |
6970 | $p8 = $this->currPos; |
6971 | if (($this->input[$this->currPos] ?? null) === ":") { |
6972 | $this->currPos++; |
6973 | $r9 = ":"; |
6974 | } else { |
6975 | if (!$silence) {$this->fail(18);} |
6976 | $r9 = self::$FAILED; |
6977 | $r7 = self::$FAILED; |
6978 | goto seq_2; |
6979 | } |
6980 | for (;;) { |
6981 | $r11 = $this->discardspace_or_newline($silence); |
6982 | if ($r11===self::$FAILED) { |
6983 | break; |
6984 | } |
6985 | } |
6986 | // free $r11 |
6987 | $r10 = true; |
6988 | if ($r10===self::$FAILED) { |
6989 | $this->currPos = $p8; |
6990 | $r7 = self::$FAILED; |
6991 | goto seq_2; |
6992 | } |
6993 | // free $r10 |
6994 | $r7 = true; |
6995 | seq_2: |
6996 | if ($r7===self::$FAILED) { |
6997 | $r7 = null; |
6998 | } |
6999 | // free $p8 |
7000 | // c <- $r7 |
7001 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
7002 | // free $p6 |
7003 | $r10 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
7004 | // wl <- $r10 |
7005 | if ($r10===self::$FAILED) { |
7006 | $this->currPos = $p3; |
7007 | $r1 = self::$FAILED; |
7008 | goto seq_1; |
7009 | } |
7010 | $this->savedPos = $this->currPos; |
7011 | $r11 = $this->a71($r4, $r5, $r7, $r10); |
7012 | if ($r11) { |
7013 | $r11 = false; |
7014 | } else { |
7015 | $r11 = self::$FAILED; |
7016 | $this->currPos = $p3; |
7017 | $r1 = self::$FAILED; |
7018 | goto seq_1; |
7019 | } |
7020 | $r1 = true; |
7021 | seq_1: |
7022 | if ($r1!==self::$FAILED) { |
7023 | $this->savedPos = $p2; |
7024 | $r1 = $this->a72($r4, $r5, $r7, $r10); |
7025 | } |
7026 | // free $p3 |
7027 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7028 | $this->currPos, |
7029 | $r1, |
7030 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7031 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7032 | ); |
7033 | return $r1; |
7034 | } |
7035 | private function parsesol_transparent($silence, $boolParams, &$param_preproc, &$param_th) { |
7036 | $key = json_encode([588, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
7037 | $bucket = $this->currPos; |
7038 | $cached = $this->cache[$bucket][$key] ?? null; |
7039 | if ($cached) { |
7040 | $this->currPos = $cached->nextPos; |
7041 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7042 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7043 | return $cached->result; |
7044 | } |
7045 | $saved_preproc=$param_preproc; |
7046 | $saved_th=$param_th; |
7047 | // start choice_1 |
7048 | $r1 = $this->parsecomment($silence); |
7049 | if ($r1!==self::$FAILED) { |
7050 | goto choice_1; |
7051 | } |
7052 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
7053 | if ($r1!==self::$FAILED) { |
7054 | goto choice_1; |
7055 | } |
7056 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
7057 | if ($r1!==self::$FAILED) { |
7058 | goto choice_1; |
7059 | } |
7060 | $r1 = $this->parsebehavior_switch($silence); |
7061 | choice_1: |
7062 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7063 | $this->currPos, |
7064 | $r1, |
7065 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7066 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7067 | ); |
7068 | return $r1; |
7069 | } |
7070 | private function parseblock_line($silence, $boolParams, &$param_preproc, &$param_th) { |
7071 | $key = json_encode([322, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7072 | $bucket = $this->currPos; |
7073 | $cached = $this->cache[$bucket][$key] ?? null; |
7074 | if ($cached) { |
7075 | $this->currPos = $cached->nextPos; |
7076 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7077 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7078 | return $cached->result; |
7079 | } |
7080 | $saved_preproc=$param_preproc; |
7081 | $saved_th=$param_th; |
7082 | // start choice_1 |
7083 | $r1 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
7084 | if ($r1!==self::$FAILED) { |
7085 | goto choice_1; |
7086 | } |
7087 | $r1 = $this->parselist_item($silence, $boolParams, $param_preproc, $param_th); |
7088 | if ($r1!==self::$FAILED) { |
7089 | goto choice_1; |
7090 | } |
7091 | $r1 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
7092 | if ($r1!==self::$FAILED) { |
7093 | goto choice_1; |
7094 | } |
7095 | $p2 = $this->currPos; |
7096 | // start seq_1 |
7097 | $p3 = $this->currPos; |
7098 | $r4 = $this->parseoptionalSpaceToken($silence); |
7099 | // st <- $r4 |
7100 | if ($r4===self::$FAILED) { |
7101 | $r1 = self::$FAILED; |
7102 | goto seq_1; |
7103 | } |
7104 | $p5 = $this->currPos; |
7105 | if (strspn($this->input, " <{}|!", $this->currPos, 1) !== 0) { |
7106 | $r6 = $this->input[$this->currPos++]; |
7107 | $r6 = false; |
7108 | $this->currPos = $p5; |
7109 | } else { |
7110 | $r6 = self::$FAILED; |
7111 | $this->currPos = $p3; |
7112 | $r1 = self::$FAILED; |
7113 | goto seq_1; |
7114 | } |
7115 | // free $p5 |
7116 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
7117 | // tl <- $r7 |
7118 | if ($r7===self::$FAILED) { |
7119 | $this->currPos = $p3; |
7120 | $r1 = self::$FAILED; |
7121 | goto seq_1; |
7122 | } |
7123 | $r1 = true; |
7124 | seq_1: |
7125 | if ($r1!==self::$FAILED) { |
7126 | $this->savedPos = $p2; |
7127 | $r1 = $this->a73($r4, $r7); |
7128 | } |
7129 | // free $p3 |
7130 | choice_1: |
7131 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7132 | $this->currPos, |
7133 | $r1, |
7134 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7135 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7136 | ); |
7137 | return $r1; |
7138 | } |
7139 | private function parseblock_lines($silence, $boolParams, &$param_preproc, &$param_th) { |
7140 | $key = json_encode([318, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7141 | $bucket = $this->currPos; |
7142 | $cached = $this->cache[$bucket][$key] ?? null; |
7143 | if ($cached) { |
7144 | $this->currPos = $cached->nextPos; |
7145 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7146 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7147 | return $cached->result; |
7148 | } |
7149 | $saved_preproc=$param_preproc; |
7150 | $saved_th=$param_th; |
7151 | $p2 = $this->currPos; |
7152 | // start seq_1 |
7153 | $p3 = $this->currPos; |
7154 | $r4 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7155 | // s <- $r4 |
7156 | if ($r4===self::$FAILED) { |
7157 | $r1 = self::$FAILED; |
7158 | goto seq_1; |
7159 | } |
7160 | $p6 = $this->currPos; |
7161 | // start seq_2 |
7162 | $p7 = $this->currPos; |
7163 | $r8 = $this->parseoptionalSpaceToken($silence); |
7164 | // os <- $r8 |
7165 | if ($r8===self::$FAILED) { |
7166 | $r5 = self::$FAILED; |
7167 | goto seq_2; |
7168 | } |
7169 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7170 | // so <- $r9 |
7171 | if ($r9===self::$FAILED) { |
7172 | $this->currPos = $p7; |
7173 | $r5 = self::$FAILED; |
7174 | goto seq_2; |
7175 | } |
7176 | $r5 = true; |
7177 | seq_2: |
7178 | if ($r5!==self::$FAILED) { |
7179 | $this->savedPos = $p6; |
7180 | $r5 = $this->a74($r4, $r8, $r9); |
7181 | } else { |
7182 | $r5 = null; |
7183 | } |
7184 | // free $p7 |
7185 | // s2 <- $r5 |
7186 | $r10 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
7187 | // bl <- $r10 |
7188 | if ($r10===self::$FAILED) { |
7189 | $this->currPos = $p3; |
7190 | $r1 = self::$FAILED; |
7191 | goto seq_1; |
7192 | } |
7193 | $r1 = true; |
7194 | seq_1: |
7195 | if ($r1!==self::$FAILED) { |
7196 | $this->savedPos = $p2; |
7197 | $r1 = $this->a75($r4, $r5, $r10); |
7198 | } |
7199 | // free $p3 |
7200 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7201 | $this->currPos, |
7202 | $r1, |
7203 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7204 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7205 | ); |
7206 | return $r1; |
7207 | } |
7208 | private function discardtplarg($silence, $boolParams, &$param_th) { |
7209 | $key = json_encode([379, $boolParams & 0x1fff, $param_th]); |
7210 | $bucket = $this->currPos; |
7211 | $cached = $this->cache[$bucket][$key] ?? null; |
7212 | if ($cached) { |
7213 | $this->currPos = $cached->nextPos; |
7214 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7215 | return $cached->result; |
7216 | } |
7217 | $saved_th=$param_th; |
7218 | $r1 = $this->discardtplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7219 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7220 | $this->currPos, |
7221 | $r1, |
7222 | self::$UNDEFINED, |
7223 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7224 | ); |
7225 | return $r1; |
7226 | } |
7227 | private function parsetemplate($silence, $boolParams, &$param_th) { |
7228 | $key = json_encode([370, $boolParams & 0x1fff, $param_th]); |
7229 | $bucket = $this->currPos; |
7230 | $cached = $this->cache[$bucket][$key] ?? null; |
7231 | if ($cached) { |
7232 | $this->currPos = $cached->nextPos; |
7233 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7234 | return $cached->result; |
7235 | } |
7236 | $saved_th=$param_th; |
7237 | $r1 = $this->parsetemplate_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7238 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7239 | $this->currPos, |
7240 | $r1, |
7241 | self::$UNDEFINED, |
7242 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7243 | ); |
7244 | return $r1; |
7245 | } |
7246 | private function parsebroken_template($silence, &$param_preproc) { |
7247 | $key = json_encode([372, $param_preproc]); |
7248 | $bucket = $this->currPos; |
7249 | $cached = $this->cache[$bucket][$key] ?? null; |
7250 | if ($cached) { |
7251 | $this->currPos = $cached->nextPos; |
7252 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7253 | return $cached->result; |
7254 | } |
7255 | $saved_preproc=$param_preproc; |
7256 | $p2 = $this->currPos; |
7257 | // start seq_1 |
7258 | $p3 = $this->currPos; |
7259 | // t <- $r4 |
7260 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
7261 | $r4 = "{{"; |
7262 | $this->currPos += 2; |
7263 | } else { |
7264 | if (!$silence) {$this->fail(43);} |
7265 | $r4 = self::$FAILED; |
7266 | $this->currPos = $p3; |
7267 | $r1 = self::$FAILED; |
7268 | goto seq_1; |
7269 | } |
7270 | $r1 = true; |
7271 | seq_1: |
7272 | if ($r1!==self::$FAILED) { |
7273 | $this->savedPos = $p2; |
7274 | $r1 = $this->a76($param_preproc, $r4); |
7275 | } |
7276 | // free $p3 |
7277 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7278 | $this->currPos, |
7279 | $r1, |
7280 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7281 | self::$UNDEFINED |
7282 | ); |
7283 | return $r1; |
7284 | } |
7285 | private function parsetplarg($silence, $boolParams, &$param_th) { |
7286 | $key = json_encode([378, $boolParams & 0x1fff, $param_th]); |
7287 | $bucket = $this->currPos; |
7288 | $cached = $this->cache[$bucket][$key] ?? null; |
7289 | if ($cached) { |
7290 | $this->currPos = $cached->nextPos; |
7291 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7292 | return $cached->result; |
7293 | } |
7294 | $saved_th=$param_th; |
7295 | $r1 = $this->parsetplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7296 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7297 | $this->currPos, |
7298 | $r1, |
7299 | self::$UNDEFINED, |
7300 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7301 | ); |
7302 | return $r1; |
7303 | } |
7304 | private function discardwikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
7305 | $key = json_encode([423, $boolParams & 0x1fff, $param_th, $param_preproc]); |
7306 | $bucket = $this->currPos; |
7307 | $cached = $this->cache[$bucket][$key] ?? null; |
7308 | if ($cached) { |
7309 | $this->currPos = $cached->nextPos; |
7310 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7311 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7312 | return $cached->result; |
7313 | } |
7314 | $saved_th=$param_th; |
7315 | $saved_preproc=$param_preproc; |
7316 | // start choice_1 |
7317 | $r1 = $this->discardwikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
7318 | if ($r1!==self::$FAILED) { |
7319 | goto choice_1; |
7320 | } |
7321 | $r1 = $this->discardbroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
7322 | choice_1: |
7323 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7324 | $this->currPos, |
7325 | $r1, |
7326 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7327 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7328 | ); |
7329 | return $r1; |
7330 | } |
7331 | private function parsedirective($silence, $boolParams, &$param_preproc, &$param_th) { |
7332 | $key = json_encode([534, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7333 | $bucket = $this->currPos; |
7334 | $cached = $this->cache[$bucket][$key] ?? null; |
7335 | if ($cached) { |
7336 | $this->currPos = $cached->nextPos; |
7337 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7338 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7339 | return $cached->result; |
7340 | } |
7341 | $saved_preproc=$param_preproc; |
7342 | $saved_th=$param_th; |
7343 | // start choice_1 |
7344 | $r1 = $this->parsecomment($silence); |
7345 | if ($r1!==self::$FAILED) { |
7346 | goto choice_1; |
7347 | } |
7348 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
7349 | if ($r1!==self::$FAILED) { |
7350 | goto choice_1; |
7351 | } |
7352 | $r1 = $this->parsewellformed_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
7353 | if ($r1!==self::$FAILED) { |
7354 | goto choice_1; |
7355 | } |
7356 | $r1 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
7357 | if ($r1!==self::$FAILED) { |
7358 | goto choice_1; |
7359 | } |
7360 | $p2 = $this->currPos; |
7361 | // start seq_1 |
7362 | $p3 = $this->currPos; |
7363 | $p4 = $this->currPos; |
7364 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
7365 | $r5 = "-{"; |
7366 | $this->currPos += 2; |
7367 | $r5 = false; |
7368 | $this->currPos = $p4; |
7369 | } else { |
7370 | $r5 = self::$FAILED; |
7371 | $r1 = self::$FAILED; |
7372 | goto seq_1; |
7373 | } |
7374 | // free $p4 |
7375 | $r6 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
7376 | // v <- $r6 |
7377 | if ($r6===self::$FAILED) { |
7378 | $this->currPos = $p3; |
7379 | $r1 = self::$FAILED; |
7380 | goto seq_1; |
7381 | } |
7382 | $r1 = true; |
7383 | seq_1: |
7384 | if ($r1!==self::$FAILED) { |
7385 | $this->savedPos = $p2; |
7386 | $r1 = $this->a77($r6); |
7387 | goto choice_1; |
7388 | } |
7389 | // free $p3 |
7390 | $p3 = $this->currPos; |
7391 | // start seq_2 |
7392 | $p4 = $this->currPos; |
7393 | $p7 = $this->currPos; |
7394 | if (($this->input[$this->currPos] ?? null) === "&") { |
7395 | $this->currPos++; |
7396 | $r8 = "&"; |
7397 | $r8 = false; |
7398 | $this->currPos = $p7; |
7399 | } else { |
7400 | $r8 = self::$FAILED; |
7401 | $r1 = self::$FAILED; |
7402 | goto seq_2; |
7403 | } |
7404 | // free $p7 |
7405 | $r9 = $this->parsehtmlentity($silence); |
7406 | // e <- $r9 |
7407 | if ($r9===self::$FAILED) { |
7408 | $this->currPos = $p4; |
7409 | $r1 = self::$FAILED; |
7410 | goto seq_2; |
7411 | } |
7412 | $r1 = true; |
7413 | seq_2: |
7414 | if ($r1!==self::$FAILED) { |
7415 | $this->savedPos = $p3; |
7416 | $r1 = $this->a78($r9); |
7417 | goto choice_1; |
7418 | } |
7419 | // free $p4 |
7420 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
7421 | choice_1: |
7422 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7423 | $this->currPos, |
7424 | $r1, |
7425 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7426 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7427 | ); |
7428 | return $r1; |
7429 | } |
7430 | private function parsehtml_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
7431 | $key = json_encode([330, $boolParams & 0x1ebd, $param_preproc, $param_th]); |
7432 | $bucket = $this->currPos; |
7433 | $cached = $this->cache[$bucket][$key] ?? null; |
7434 | if ($cached) { |
7435 | $this->currPos = $cached->nextPos; |
7436 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7437 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7438 | return $cached->result; |
7439 | } |
7440 | $saved_preproc=$param_preproc; |
7441 | $saved_th=$param_th; |
7442 | $r1 = $this->parsexmlish_tag($silence, $boolParams & ~0x2, $param_preproc, $param_th); |
7443 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7444 | $this->currPos, |
7445 | $r1, |
7446 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7447 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7448 | ); |
7449 | return $r1; |
7450 | } |
7451 | private function parsetable_attribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7452 | $key = json_encode([550, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7453 | $bucket = $this->currPos; |
7454 | $cached = $this->cache[$bucket][$key] ?? null; |
7455 | if ($cached) { |
7456 | $this->currPos = $cached->nextPos; |
7457 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7458 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7459 | return $cached->result; |
7460 | } |
7461 | $saved_preproc=$param_preproc; |
7462 | $saved_th=$param_th; |
7463 | $p2 = $this->currPos; |
7464 | $r3 = []; |
7465 | for (;;) { |
7466 | // start choice_1 |
7467 | $p5 = $this->currPos; |
7468 | $r4 = self::$FAILED; |
7469 | for (;;) { |
7470 | if (strcspn($this->input, "{}&<-!['\x0d\x0a|", $this->currPos, 1) !== 0) { |
7471 | $r6 = self::consumeChar($this->input, $this->currPos); |
7472 | $r4 = true; |
7473 | } else { |
7474 | $r6 = self::$FAILED; |
7475 | if (!$silence) {$this->fail(44);} |
7476 | break; |
7477 | } |
7478 | } |
7479 | if ($r4!==self::$FAILED) { |
7480 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7481 | goto choice_1; |
7482 | } else { |
7483 | $r4 = self::$FAILED; |
7484 | } |
7485 | // free $r6 |
7486 | // free $p5 |
7487 | $p5 = $this->currPos; |
7488 | // start seq_1 |
7489 | $p7 = $this->currPos; |
7490 | $p8 = $this->currPos; |
7491 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7492 | if ($r6 === self::$FAILED) { |
7493 | $r6 = false; |
7494 | } else { |
7495 | $r6 = self::$FAILED; |
7496 | $this->currPos = $p8; |
7497 | $r4 = self::$FAILED; |
7498 | goto seq_1; |
7499 | } |
7500 | // free $p8 |
7501 | // start choice_2 |
7502 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7503 | if ($r9!==self::$FAILED) { |
7504 | goto choice_2; |
7505 | } |
7506 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7507 | $r9 = $this->input[$this->currPos++]; |
7508 | } else { |
7509 | $r9 = self::$FAILED; |
7510 | if (!$silence) {$this->fail(45);} |
7511 | } |
7512 | choice_2: |
7513 | // s <- $r9 |
7514 | if ($r9===self::$FAILED) { |
7515 | $this->currPos = $p7; |
7516 | $r4 = self::$FAILED; |
7517 | goto seq_1; |
7518 | } |
7519 | $r4 = true; |
7520 | seq_1: |
7521 | if ($r4!==self::$FAILED) { |
7522 | $this->savedPos = $p5; |
7523 | $r4 = $this->a42($r9); |
7524 | } |
7525 | // free $p7 |
7526 | choice_1: |
7527 | if ($r4!==self::$FAILED) { |
7528 | $r3[] = $r4; |
7529 | } else { |
7530 | break; |
7531 | } |
7532 | } |
7533 | // r <- $r3 |
7534 | // free $r4 |
7535 | $r1 = $r3; |
7536 | if ($r1!==self::$FAILED) { |
7537 | $this->savedPos = $p2; |
7538 | $r1 = $this->a59($r3); |
7539 | } |
7540 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7541 | $this->currPos, |
7542 | $r1, |
7543 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7544 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7545 | ); |
7546 | return $r1; |
7547 | } |
7548 | private function parsetable_attribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7549 | $key = json_encode([552, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7550 | $bucket = $this->currPos; |
7551 | $cached = $this->cache[$bucket][$key] ?? null; |
7552 | if ($cached) { |
7553 | $this->currPos = $cached->nextPos; |
7554 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7555 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7556 | return $cached->result; |
7557 | } |
7558 | $saved_preproc=$param_preproc; |
7559 | $saved_th=$param_th; |
7560 | $p2 = $this->currPos; |
7561 | $r3 = []; |
7562 | for (;;) { |
7563 | // start choice_1 |
7564 | $p5 = $this->currPos; |
7565 | $r4 = self::$FAILED; |
7566 | for (;;) { |
7567 | if (strcspn($this->input, "{}&<-![\"\x0d\x0a|", $this->currPos, 1) !== 0) { |
7568 | $r6 = self::consumeChar($this->input, $this->currPos); |
7569 | $r4 = true; |
7570 | } else { |
7571 | $r6 = self::$FAILED; |
7572 | if (!$silence) {$this->fail(46);} |
7573 | break; |
7574 | } |
7575 | } |
7576 | if ($r4!==self::$FAILED) { |
7577 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7578 | goto choice_1; |
7579 | } else { |
7580 | $r4 = self::$FAILED; |
7581 | } |
7582 | // free $r6 |
7583 | // free $p5 |
7584 | $p5 = $this->currPos; |
7585 | // start seq_1 |
7586 | $p7 = $this->currPos; |
7587 | $p8 = $this->currPos; |
7588 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7589 | if ($r6 === self::$FAILED) { |
7590 | $r6 = false; |
7591 | } else { |
7592 | $r6 = self::$FAILED; |
7593 | $this->currPos = $p8; |
7594 | $r4 = self::$FAILED; |
7595 | goto seq_1; |
7596 | } |
7597 | // free $p8 |
7598 | // start choice_2 |
7599 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7600 | if ($r9!==self::$FAILED) { |
7601 | goto choice_2; |
7602 | } |
7603 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7604 | $r9 = $this->input[$this->currPos++]; |
7605 | } else { |
7606 | $r9 = self::$FAILED; |
7607 | if (!$silence) {$this->fail(45);} |
7608 | } |
7609 | choice_2: |
7610 | // s <- $r9 |
7611 | if ($r9===self::$FAILED) { |
7612 | $this->currPos = $p7; |
7613 | $r4 = self::$FAILED; |
7614 | goto seq_1; |
7615 | } |
7616 | $r4 = true; |
7617 | seq_1: |
7618 | if ($r4!==self::$FAILED) { |
7619 | $this->savedPos = $p5; |
7620 | $r4 = $this->a42($r9); |
7621 | } |
7622 | // free $p7 |
7623 | choice_1: |
7624 | if ($r4!==self::$FAILED) { |
7625 | $r3[] = $r4; |
7626 | } else { |
7627 | break; |
7628 | } |
7629 | } |
7630 | // r <- $r3 |
7631 | // free $r4 |
7632 | $r1 = $r3; |
7633 | if ($r1!==self::$FAILED) { |
7634 | $this->savedPos = $p2; |
7635 | $r1 = $this->a59($r3); |
7636 | } |
7637 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7638 | $this->currPos, |
7639 | $r1, |
7640 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7641 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7642 | ); |
7643 | return $r1; |
7644 | } |
7645 | private function parsetable_attribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
7646 | $key = json_encode([548, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7647 | $bucket = $this->currPos; |
7648 | $cached = $this->cache[$bucket][$key] ?? null; |
7649 | if ($cached) { |
7650 | $this->currPos = $cached->nextPos; |
7651 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7652 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7653 | return $cached->result; |
7654 | } |
7655 | $saved_preproc=$param_preproc; |
7656 | $saved_th=$param_th; |
7657 | $p2 = $this->currPos; |
7658 | $r3 = []; |
7659 | for (;;) { |
7660 | // start choice_1 |
7661 | $p5 = $this->currPos; |
7662 | $r4 = self::$FAILED; |
7663 | for (;;) { |
7664 | if (strcspn($this->input, "{}&<-![ \x09\x0a\x0d\x0c|", $this->currPos, 1) !== 0) { |
7665 | $r6 = self::consumeChar($this->input, $this->currPos); |
7666 | $r4 = true; |
7667 | } else { |
7668 | $r6 = self::$FAILED; |
7669 | if (!$silence) {$this->fail(47);} |
7670 | break; |
7671 | } |
7672 | } |
7673 | if ($r4!==self::$FAILED) { |
7674 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7675 | goto choice_1; |
7676 | } else { |
7677 | $r4 = self::$FAILED; |
7678 | } |
7679 | // free $r6 |
7680 | // free $p5 |
7681 | $p5 = $this->currPos; |
7682 | // start seq_1 |
7683 | $p7 = $this->currPos; |
7684 | $p8 = $this->currPos; |
7685 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7686 | if ($r6 === self::$FAILED) { |
7687 | $r6 = false; |
7688 | } else { |
7689 | $r6 = self::$FAILED; |
7690 | $this->currPos = $p8; |
7691 | $r4 = self::$FAILED; |
7692 | goto seq_1; |
7693 | } |
7694 | // free $p8 |
7695 | // start choice_2 |
7696 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7697 | if ($r9!==self::$FAILED) { |
7698 | goto choice_2; |
7699 | } |
7700 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7701 | $r9 = $this->input[$this->currPos++]; |
7702 | } else { |
7703 | $r9 = self::$FAILED; |
7704 | if (!$silence) {$this->fail(45);} |
7705 | } |
7706 | choice_2: |
7707 | // s <- $r9 |
7708 | if ($r9===self::$FAILED) { |
7709 | $this->currPos = $p7; |
7710 | $r4 = self::$FAILED; |
7711 | goto seq_1; |
7712 | } |
7713 | $r4 = true; |
7714 | seq_1: |
7715 | if ($r4!==self::$FAILED) { |
7716 | $this->savedPos = $p5; |
7717 | $r4 = $this->a42($r9); |
7718 | } |
7719 | // free $p7 |
7720 | choice_1: |
7721 | if ($r4!==self::$FAILED) { |
7722 | $r3[] = $r4; |
7723 | } else { |
7724 | break; |
7725 | } |
7726 | } |
7727 | if (count($r3) === 0) { |
7728 | $r3 = self::$FAILED; |
7729 | } |
7730 | // r <- $r3 |
7731 | // free $r4 |
7732 | $r1 = $r3; |
7733 | if ($r1!==self::$FAILED) { |
7734 | $this->savedPos = $p2; |
7735 | $r1 = $this->a59($r3); |
7736 | } |
7737 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7738 | $this->currPos, |
7739 | $r1, |
7740 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7741 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7742 | ); |
7743 | return $r1; |
7744 | } |
7745 | private function parseless_than($silence, $boolParams) { |
7746 | $key = json_encode([464, $boolParams & 0x2]); |
7747 | $bucket = $this->currPos; |
7748 | $cached = $this->cache[$bucket][$key] ?? null; |
7749 | if ($cached) { |
7750 | $this->currPos = $cached->nextPos; |
7751 | |
7752 | return $cached->result; |
7753 | } |
7754 | |
7755 | $p1 = $this->currPos; |
7756 | // start seq_1 |
7757 | $p3 = $this->currPos; |
7758 | if (/*annOrExtTag*/($boolParams & 0x2) !== 0) { |
7759 | $r4 = false; |
7760 | } else { |
7761 | $r4 = self::$FAILED; |
7762 | $r2 = self::$FAILED; |
7763 | goto seq_1; |
7764 | } |
7765 | if (($this->input[$this->currPos] ?? null) === "<") { |
7766 | $this->currPos++; |
7767 | $r5 = "<"; |
7768 | } else { |
7769 | if (!$silence) {$this->fail(48);} |
7770 | $r5 = self::$FAILED; |
7771 | $this->currPos = $p3; |
7772 | $r2 = self::$FAILED; |
7773 | goto seq_1; |
7774 | } |
7775 | $r2 = true; |
7776 | seq_1: |
7777 | if ($r2!==self::$FAILED) { |
7778 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
7779 | } else { |
7780 | $r2 = self::$FAILED; |
7781 | } |
7782 | // free $p3 |
7783 | // free $p1 |
7784 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7785 | $this->currPos, |
7786 | $r2, |
7787 | self::$UNDEFINED, |
7788 | self::$UNDEFINED |
7789 | ); |
7790 | return $r2; |
7791 | } |
7792 | private function parseattribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7793 | $key = json_encode([544, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7794 | $bucket = $this->currPos; |
7795 | $cached = $this->cache[$bucket][$key] ?? null; |
7796 | if ($cached) { |
7797 | $this->currPos = $cached->nextPos; |
7798 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7799 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7800 | return $cached->result; |
7801 | } |
7802 | $saved_preproc=$param_preproc; |
7803 | $saved_th=$param_th; |
7804 | $p2 = $this->currPos; |
7805 | $r3 = []; |
7806 | for (;;) { |
7807 | // start choice_1 |
7808 | $p5 = $this->currPos; |
7809 | $r4 = self::$FAILED; |
7810 | for (;;) { |
7811 | if (strcspn($this->input, "{}&<-|/'>", $this->currPos, 1) !== 0) { |
7812 | $r6 = self::consumeChar($this->input, $this->currPos); |
7813 | $r4 = true; |
7814 | } else { |
7815 | $r6 = self::$FAILED; |
7816 | if (!$silence) {$this->fail(49);} |
7817 | break; |
7818 | } |
7819 | } |
7820 | if ($r4!==self::$FAILED) { |
7821 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7822 | goto choice_1; |
7823 | } else { |
7824 | $r4 = self::$FAILED; |
7825 | } |
7826 | // free $r6 |
7827 | // free $p5 |
7828 | $p5 = $this->currPos; |
7829 | // start seq_1 |
7830 | $p7 = $this->currPos; |
7831 | $p8 = $this->currPos; |
7832 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7833 | if ($r6 === self::$FAILED) { |
7834 | $r6 = false; |
7835 | } else { |
7836 | $r6 = self::$FAILED; |
7837 | $this->currPos = $p8; |
7838 | $r4 = self::$FAILED; |
7839 | goto seq_1; |
7840 | } |
7841 | // free $p8 |
7842 | $p8 = $this->currPos; |
7843 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7844 | $r9 = "/>"; |
7845 | $this->currPos += 2; |
7846 | } else { |
7847 | $r9 = self::$FAILED; |
7848 | } |
7849 | if ($r9 === self::$FAILED) { |
7850 | $r9 = false; |
7851 | } else { |
7852 | $r9 = self::$FAILED; |
7853 | $this->currPos = $p8; |
7854 | $this->currPos = $p7; |
7855 | $r4 = self::$FAILED; |
7856 | goto seq_1; |
7857 | } |
7858 | // free $p8 |
7859 | // start choice_2 |
7860 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7861 | if ($r10!==self::$FAILED) { |
7862 | goto choice_2; |
7863 | } |
7864 | $r10 = $this->parseless_than($silence, $boolParams); |
7865 | if ($r10!==self::$FAILED) { |
7866 | goto choice_2; |
7867 | } |
7868 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
7869 | $r10 = $this->input[$this->currPos++]; |
7870 | } else { |
7871 | $r10 = self::$FAILED; |
7872 | if (!$silence) {$this->fail(50);} |
7873 | } |
7874 | choice_2: |
7875 | // s <- $r10 |
7876 | if ($r10===self::$FAILED) { |
7877 | $this->currPos = $p7; |
7878 | $r4 = self::$FAILED; |
7879 | goto seq_1; |
7880 | } |
7881 | $r4 = true; |
7882 | seq_1: |
7883 | if ($r4!==self::$FAILED) { |
7884 | $this->savedPos = $p5; |
7885 | $r4 = $this->a42($r10); |
7886 | } |
7887 | // free $p7 |
7888 | choice_1: |
7889 | if ($r4!==self::$FAILED) { |
7890 | $r3[] = $r4; |
7891 | } else { |
7892 | break; |
7893 | } |
7894 | } |
7895 | // r <- $r3 |
7896 | // free $r4 |
7897 | $r1 = $r3; |
7898 | if ($r1!==self::$FAILED) { |
7899 | $this->savedPos = $p2; |
7900 | $r1 = $this->a59($r3); |
7901 | } |
7902 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7903 | $this->currPos, |
7904 | $r1, |
7905 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7906 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7907 | ); |
7908 | return $r1; |
7909 | } |
7910 | private function parseattribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7911 | $key = json_encode([546, $boolParams & 0x1fff, $param_preproc, $param_th]); |
7912 | $bucket = $this->currPos; |
7913 | $cached = $this->cache[$bucket][$key] ?? null; |
7914 | if ($cached) { |
7915 | $this->currPos = $cached->nextPos; |
7916 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7917 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7918 | return $cached->result; |
7919 | } |
7920 | $saved_preproc=$param_preproc; |
7921 | $saved_th=$param_th; |
7922 | $p2 = $this->currPos; |
7923 | $r3 = []; |
7924 | for (;;) { |
7925 | // start choice_1 |
7926 | $p5 = $this->currPos; |
7927 | $r4 = self::$FAILED; |
7928 | for (;;) { |
7929 | if (strcspn($this->input, "{}&<-|/\">", $this->currPos, 1) !== 0) { |
7930 | $r6 = self::consumeChar($this->input, $this->currPos); |
7931 | $r4 = true; |
7932 | } else { |
7933 | $r6 = self::$FAILED; |
7934 | if (!$silence) {$this->fail(51);} |
7935 | break; |
7936 | } |
7937 | } |
7938 | if ($r4!==self::$FAILED) { |
7939 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7940 | goto choice_1; |
7941 | } else { |
7942 | $r4 = self::$FAILED; |
7943 | } |
7944 | // free $r6 |
7945 | // free $p5 |
7946 | $p5 = $this->currPos; |
7947 | // start seq_1 |
7948 | $p7 = $this->currPos; |
7949 | $p8 = $this->currPos; |
7950 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7951 | if ($r6 === self::$FAILED) { |
7952 | $r6 = false; |
7953 | } else { |
7954 | $r6 = self::$FAILED; |
7955 | $this->currPos = $p8; |
7956 | $r4 = self::$FAILED; |
7957 | goto seq_1; |
7958 | } |
7959 | // free $p8 |
7960 | $p8 = $this->currPos; |
7961 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7962 | $r9 = "/>"; |
7963 | $this->currPos += 2; |
7964 | } else { |
7965 | $r9 = self::$FAILED; |
7966 | } |
7967 | if ($r9 === self::$FAILED) { |
7968 | $r9 = false; |
7969 | } else { |
7970 | $r9 = self::$FAILED; |
7971 | $this->currPos = $p8; |
7972 | $this->currPos = $p7; |
7973 | $r4 = self::$FAILED; |
7974 | goto seq_1; |
7975 | } |
7976 | // free $p8 |
7977 | // start choice_2 |
7978 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7979 | if ($r10!==self::$FAILED) { |
7980 | goto choice_2; |
7981 | } |
7982 | $r10 = $this->parseless_than($silence, $boolParams); |
7983 | if ($r10!==self::$FAILED) { |
7984 | goto choice_2; |
7985 | } |
7986 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
7987 | $r10 = $this->input[$this->currPos++]; |
7988 | } else { |
7989 | $r10 = self::$FAILED; |
7990 | if (!$silence) {$this->fail(50);} |
7991 | } |
7992 | choice_2: |
7993 | // s <- $r10 |
7994 | if ($r10===self::$FAILED) { |
7995 | $this->currPos = $p7; |
7996 | $r4 = self::$FAILED; |
7997 | goto seq_1; |
7998 | } |
7999 | $r4 = true; |
8000 | seq_1: |
8001 | if ($r4!==self::$FAILED) { |
8002 | $this->savedPos = $p5; |
8003 | $r4 = $this->a42($r10); |
8004 | } |
8005 | // free $p7 |
8006 | choice_1: |
8007 | if ($r4!==self::$FAILED) { |
8008 | $r3[] = $r4; |
8009 | } else { |
8010 | break; |
8011 | } |
8012 | } |
8013 | // r <- $r3 |
8014 | // free $r4 |
8015 | $r1 = $r3; |
8016 | if ($r1!==self::$FAILED) { |
8017 | $this->savedPos = $p2; |
8018 | $r1 = $this->a59($r3); |
8019 | } |
8020 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8021 | $this->currPos, |
8022 | $r1, |
8023 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8024 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8025 | ); |
8026 | return $r1; |
8027 | } |
8028 | private function parseattribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
8029 | $key = json_encode([542, $boolParams & 0x1fff, $param_preproc, $param_th]); |
8030 | $bucket = $this->currPos; |
8031 | $cached = $this->cache[$bucket][$key] ?? null; |
8032 | if ($cached) { |
8033 | $this->currPos = $cached->nextPos; |
8034 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8035 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8036 | return $cached->result; |
8037 | } |
8038 | $saved_preproc=$param_preproc; |
8039 | $saved_th=$param_th; |
8040 | $p2 = $this->currPos; |
8041 | $r3 = []; |
8042 | for (;;) { |
8043 | // start choice_1 |
8044 | $p5 = $this->currPos; |
8045 | $r4 = self::$FAILED; |
8046 | for (;;) { |
8047 | if (strcspn($this->input, "{}&<-|/ \x09\x0a\x0d\x0c>", $this->currPos, 1) !== 0) { |
8048 | $r6 = self::consumeChar($this->input, $this->currPos); |
8049 | $r4 = true; |
8050 | } else { |
8051 | $r6 = self::$FAILED; |
8052 | if (!$silence) {$this->fail(52);} |
8053 | break; |
8054 | } |
8055 | } |
8056 | if ($r4!==self::$FAILED) { |
8057 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
8058 | goto choice_1; |
8059 | } else { |
8060 | $r4 = self::$FAILED; |
8061 | } |
8062 | // free $r6 |
8063 | // free $p5 |
8064 | $p5 = $this->currPos; |
8065 | // start seq_1 |
8066 | $p7 = $this->currPos; |
8067 | $p8 = $this->currPos; |
8068 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
8069 | if ($r6 === self::$FAILED) { |
8070 | $r6 = false; |
8071 | } else { |
8072 | $r6 = self::$FAILED; |
8073 | $this->currPos = $p8; |
8074 | $r4 = self::$FAILED; |
8075 | goto seq_1; |
8076 | } |
8077 | // free $p8 |
8078 | $p8 = $this->currPos; |
8079 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
8080 | $r9 = "/>"; |
8081 | $this->currPos += 2; |
8082 | } else { |
8083 | $r9 = self::$FAILED; |
8084 | } |
8085 | if ($r9 === self::$FAILED) { |
8086 | $r9 = false; |
8087 | } else { |
8088 | $r9 = self::$FAILED; |
8089 | $this->currPos = $p8; |
8090 | $this->currPos = $p7; |
8091 | $r4 = self::$FAILED; |
8092 | goto seq_1; |
8093 | } |
8094 | // free $p8 |
8095 | // start choice_2 |
8096 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
8097 | if ($r10!==self::$FAILED) { |
8098 | goto choice_2; |
8099 | } |
8100 | $r10 = $this->parseless_than($silence, $boolParams); |
8101 | if ($r10!==self::$FAILED) { |
8102 | goto choice_2; |
8103 | } |
8104 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
8105 | $r10 = $this->input[$this->currPos++]; |
8106 | } else { |
8107 | $r10 = self::$FAILED; |
8108 | if (!$silence) {$this->fail(50);} |
8109 | } |
8110 | choice_2: |
8111 | // s <- $r10 |
8112 | if ($r10===self::$FAILED) { |
8113 | $this->currPos = $p7; |
8114 | $r4 = self::$FAILED; |
8115 | goto seq_1; |
8116 | } |
8117 | $r4 = true; |
8118 | seq_1: |
8119 | if ($r4!==self::$FAILED) { |
8120 | $this->savedPos = $p5; |
8121 | $r4 = $this->a42($r10); |
8122 | } |
8123 | // free $p7 |
8124 | choice_1: |
8125 | if ($r4!==self::$FAILED) { |
8126 | $r3[] = $r4; |
8127 | } else { |
8128 | break; |
8129 | } |
8130 | } |
8131 | if (count($r3) === 0) { |
8132 | $r3 = self::$FAILED; |
8133 | } |
8134 | // r <- $r3 |
8135 | // free $r4 |
8136 | $r1 = $r3; |
8137 | if ($r1!==self::$FAILED) { |
8138 | $this->savedPos = $p2; |
8139 | $r1 = $this->a59($r3); |
8140 | } |
8141 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8142 | $this->currPos, |
8143 | $r1, |
8144 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8145 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8146 | ); |
8147 | return $r1; |
8148 | } |
8149 | private function parseautolink($silence, $boolParams, &$param_preproc, &$param_th) { |
8150 | $key = json_encode([342, $boolParams & 0x1fff, $param_preproc, $param_th]); |
8151 | $bucket = $this->currPos; |
8152 | $cached = $this->cache[$bucket][$key] ?? null; |
8153 | if ($cached) { |
8154 | $this->currPos = $cached->nextPos; |
8155 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8156 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8157 | return $cached->result; |
8158 | } |
8159 | $saved_preproc=$param_preproc; |
8160 | $saved_th=$param_th; |
8161 | $p2 = $this->currPos; |
8162 | // start seq_1 |
8163 | $p3 = $this->currPos; |
8164 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
8165 | $r4 = false; |
8166 | } else { |
8167 | $r4 = self::$FAILED; |
8168 | $r1 = self::$FAILED; |
8169 | goto seq_1; |
8170 | } |
8171 | $this->savedPos = $this->currPos; |
8172 | $r5 = $this->a79(); |
8173 | if (!$r5) { |
8174 | $r5 = false; |
8175 | } else { |
8176 | $r5 = self::$FAILED; |
8177 | $this->currPos = $p3; |
8178 | $r1 = self::$FAILED; |
8179 | goto seq_1; |
8180 | } |
8181 | // start choice_1 |
8182 | $r6 = $this->parseautourl($silence, $boolParams, $param_preproc, $param_th); |
8183 | if ($r6!==self::$FAILED) { |
8184 | goto choice_1; |
8185 | } |
8186 | $r6 = $this->parseautoref($silence); |
8187 | if ($r6!==self::$FAILED) { |
8188 | goto choice_1; |
8189 | } |
8190 | $r6 = $this->parseisbn($silence); |
8191 | choice_1: |
8192 | // r <- $r6 |
8193 | if ($r6===self::$FAILED) { |
8194 | $this->currPos = $p3; |
8195 | $r1 = self::$FAILED; |
8196 | goto seq_1; |
8197 | } |
8198 | $r1 = true; |
8199 | seq_1: |
8200 | if ($r1!==self::$FAILED) { |
8201 | $this->savedPos = $p2; |
8202 | $r1 = $this->a24($r6); |
8203 | } |
8204 | // free $p3 |
8205 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8206 | $this->currPos, |
8207 | $r1, |
8208 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8209 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8210 | ); |
8211 | return $r1; |
8212 | } |
8213 | private function parsebehavior_switch($silence) { |
8214 | $key = 338; |
8215 | $bucket = $this->currPos; |
8216 | $cached = $this->cache[$bucket][$key] ?? null; |
8217 | if ($cached) { |
8218 | $this->currPos = $cached->nextPos; |
8219 | |
8220 | return $cached->result; |
8221 | } |
8222 | |
8223 | $p2 = $this->currPos; |
8224 | $p4 = $this->currPos; |
8225 | // start seq_1 |
8226 | $p5 = $this->currPos; |
8227 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8228 | $r6 = "__"; |
8229 | $this->currPos += 2; |
8230 | } else { |
8231 | if (!$silence) {$this->fail(53);} |
8232 | $r6 = self::$FAILED; |
8233 | $r3 = self::$FAILED; |
8234 | goto seq_1; |
8235 | } |
8236 | $r7 = $this->discardbehavior_text($silence); |
8237 | if ($r7===self::$FAILED) { |
8238 | $this->currPos = $p5; |
8239 | $r3 = self::$FAILED; |
8240 | goto seq_1; |
8241 | } |
8242 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8243 | $r8 = "__"; |
8244 | $this->currPos += 2; |
8245 | } else { |
8246 | if (!$silence) {$this->fail(53);} |
8247 | $r8 = self::$FAILED; |
8248 | $this->currPos = $p5; |
8249 | $r3 = self::$FAILED; |
8250 | goto seq_1; |
8251 | } |
8252 | $r3 = true; |
8253 | seq_1: |
8254 | // bs <- $r3 |
8255 | if ($r3!==self::$FAILED) { |
8256 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8257 | } else { |
8258 | $r3 = self::$FAILED; |
8259 | } |
8260 | // free $p5 |
8261 | // free $p4 |
8262 | $r1 = $r3; |
8263 | if ($r1!==self::$FAILED) { |
8264 | $this->savedPos = $p2; |
8265 | $r1 = $this->a80($r3); |
8266 | } |
8267 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8268 | $this->currPos, |
8269 | $r1, |
8270 | self::$UNDEFINED, |
8271 | self::$UNDEFINED |
8272 | ); |
8273 | return $r1; |
8274 | } |
8275 | private function parsetext_char($silence) { |
8276 | $key = 522; |
8277 | $bucket = $this->currPos; |
8278 | $cached = $this->cache[$bucket][$key] ?? null; |
8279 | if ($cached) { |
8280 | $this->currPos = $cached->nextPos; |
8281 | |
8282 | return $cached->result; |
8283 | } |
8284 | |
8285 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
8286 | $r1 = self::consumeChar($this->input, $this->currPos); |
8287 | } else { |
8288 | $r1 = self::$FAILED; |
8289 | if (!$silence) {$this->fail(54);} |
8290 | } |
8291 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8292 | $this->currPos, |
8293 | $r1, |
8294 | self::$UNDEFINED, |
8295 | self::$UNDEFINED |
8296 | ); |
8297 | return $r1; |
8298 | } |
8299 | private function parseangle_bracket_markup($silence, $boolParams, &$param_preproc, &$param_th) { |
8300 | $key = json_encode([332, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
8301 | $bucket = $this->currPos; |
8302 | $cached = $this->cache[$bucket][$key] ?? null; |
8303 | if ($cached) { |
8304 | $this->currPos = $cached->nextPos; |
8305 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8306 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8307 | return $cached->result; |
8308 | } |
8309 | $saved_preproc=$param_preproc; |
8310 | $saved_th=$param_th; |
8311 | // start choice_1 |
8312 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
8313 | if ($r1!==self::$FAILED) { |
8314 | goto choice_1; |
8315 | } |
8316 | $r1 = $this->parsemaybe_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
8317 | if ($r1!==self::$FAILED) { |
8318 | goto choice_1; |
8319 | } |
8320 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
8321 | if ($r1!==self::$FAILED) { |
8322 | goto choice_1; |
8323 | } |
8324 | $r1 = $this->parsehtml_tag($silence, $boolParams, $param_preproc, $param_th); |
8325 | if ($r1!==self::$FAILED) { |
8326 | goto choice_1; |
8327 | } |
8328 | $r1 = $this->parsecomment($silence); |
8329 | choice_1: |
8330 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8331 | $this->currPos, |
8332 | $r1, |
8333 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8334 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8335 | ); |
8336 | return $r1; |
8337 | } |
8338 | private function parselang_variant_or_tpl($silence, $boolParams, &$param_th, &$param_preproc) { |
8339 | $key = json_encode([390, $boolParams & 0x1fff, $param_th, $param_preproc]); |
8340 | $bucket = $this->currPos; |
8341 | $cached = $this->cache[$bucket][$key] ?? null; |
8342 | if ($cached) { |
8343 | $this->currPos = $cached->nextPos; |
8344 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8345 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8346 | return $cached->result; |
8347 | } |
8348 | $saved_th=$param_th; |
8349 | $saved_preproc=$param_preproc; |
8350 | // start choice_1 |
8351 | $p2 = $this->currPos; |
8352 | // start seq_1 |
8353 | $p3 = $this->currPos; |
8354 | $p4 = $this->currPos; |
8355 | // start seq_2 |
8356 | $p6 = $this->currPos; |
8357 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8358 | $r7 = "-{"; |
8359 | $this->currPos += 2; |
8360 | } else { |
8361 | $r7 = self::$FAILED; |
8362 | $r5 = self::$FAILED; |
8363 | goto seq_2; |
8364 | } |
8365 | $p8 = $this->currPos; |
8366 | // start seq_3 |
8367 | $p10 = $this->currPos; |
8368 | $r11 = self::$FAILED; |
8369 | for (;;) { |
8370 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8371 | $r12 = "{{{"; |
8372 | $this->currPos += 3; |
8373 | $r11 = true; |
8374 | } else { |
8375 | $r12 = self::$FAILED; |
8376 | break; |
8377 | } |
8378 | } |
8379 | if ($r11===self::$FAILED) { |
8380 | $r9 = self::$FAILED; |
8381 | goto seq_3; |
8382 | } |
8383 | // free $r12 |
8384 | $p13 = $this->currPos; |
8385 | if (($this->input[$this->currPos] ?? null) === "{") { |
8386 | $this->currPos++; |
8387 | $r12 = "{"; |
8388 | } else { |
8389 | $r12 = self::$FAILED; |
8390 | } |
8391 | if ($r12 === self::$FAILED) { |
8392 | $r12 = false; |
8393 | } else { |
8394 | $r12 = self::$FAILED; |
8395 | $this->currPos = $p13; |
8396 | $this->currPos = $p10; |
8397 | $r9 = self::$FAILED; |
8398 | goto seq_3; |
8399 | } |
8400 | // free $p13 |
8401 | $r9 = true; |
8402 | seq_3: |
8403 | if ($r9!==self::$FAILED) { |
8404 | $r9 = false; |
8405 | $this->currPos = $p8; |
8406 | } else { |
8407 | $this->currPos = $p6; |
8408 | $r5 = self::$FAILED; |
8409 | goto seq_2; |
8410 | } |
8411 | // free $p10 |
8412 | // free $p8 |
8413 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
8414 | if ($r14===self::$FAILED) { |
8415 | $this->currPos = $p6; |
8416 | $r5 = self::$FAILED; |
8417 | goto seq_2; |
8418 | } |
8419 | $r5 = true; |
8420 | seq_2: |
8421 | if ($r5!==self::$FAILED) { |
8422 | $r5 = false; |
8423 | $this->currPos = $p4; |
8424 | } else { |
8425 | $r1 = self::$FAILED; |
8426 | goto seq_1; |
8427 | } |
8428 | // free $p6 |
8429 | // free $p4 |
8430 | $r15 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8431 | // a <- $r15 |
8432 | if ($r15===self::$FAILED) { |
8433 | $this->currPos = $p3; |
8434 | $r1 = self::$FAILED; |
8435 | goto seq_1; |
8436 | } |
8437 | $r1 = true; |
8438 | seq_1: |
8439 | if ($r1!==self::$FAILED) { |
8440 | $this->savedPos = $p2; |
8441 | $r1 = $this->a50($r15); |
8442 | goto choice_1; |
8443 | } |
8444 | // free $p3 |
8445 | $p3 = $this->currPos; |
8446 | // start seq_4 |
8447 | $p4 = $this->currPos; |
8448 | $p6 = $this->currPos; |
8449 | // start seq_5 |
8450 | $p8 = $this->currPos; |
8451 | if (($this->input[$this->currPos] ?? null) === "-") { |
8452 | $this->currPos++; |
8453 | $r17 = "-"; |
8454 | } else { |
8455 | if (!$silence) {$this->fail(55);} |
8456 | $r17 = self::$FAILED; |
8457 | $r16 = self::$FAILED; |
8458 | goto seq_5; |
8459 | } |
8460 | $p10 = $this->currPos; |
8461 | // start seq_6 |
8462 | $p13 = $this->currPos; |
8463 | $r19 = self::$FAILED; |
8464 | for (;;) { |
8465 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8466 | $r20 = "{{{"; |
8467 | $this->currPos += 3; |
8468 | $r19 = true; |
8469 | } else { |
8470 | $r20 = self::$FAILED; |
8471 | break; |
8472 | } |
8473 | } |
8474 | if ($r19===self::$FAILED) { |
8475 | $r18 = self::$FAILED; |
8476 | goto seq_6; |
8477 | } |
8478 | // free $r20 |
8479 | $p21 = $this->currPos; |
8480 | if (($this->input[$this->currPos] ?? null) === "{") { |
8481 | $this->currPos++; |
8482 | $r20 = "{"; |
8483 | } else { |
8484 | $r20 = self::$FAILED; |
8485 | } |
8486 | if ($r20 === self::$FAILED) { |
8487 | $r20 = false; |
8488 | } else { |
8489 | $r20 = self::$FAILED; |
8490 | $this->currPos = $p21; |
8491 | $this->currPos = $p13; |
8492 | $r18 = self::$FAILED; |
8493 | goto seq_6; |
8494 | } |
8495 | // free $p21 |
8496 | $r18 = true; |
8497 | seq_6: |
8498 | if ($r18!==self::$FAILED) { |
8499 | $r18 = false; |
8500 | $this->currPos = $p10; |
8501 | } else { |
8502 | $this->currPos = $p8; |
8503 | $r16 = self::$FAILED; |
8504 | goto seq_5; |
8505 | } |
8506 | // free $p13 |
8507 | // free $p10 |
8508 | $r16 = true; |
8509 | seq_5: |
8510 | // a <- $r16 |
8511 | if ($r16!==self::$FAILED) { |
8512 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
8513 | } else { |
8514 | $r16 = self::$FAILED; |
8515 | $r1 = self::$FAILED; |
8516 | goto seq_4; |
8517 | } |
8518 | // free $p8 |
8519 | // free $p6 |
8520 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
8521 | // b <- $r22 |
8522 | if ($r22===self::$FAILED) { |
8523 | $this->currPos = $p4; |
8524 | $r1 = self::$FAILED; |
8525 | goto seq_4; |
8526 | } |
8527 | $r1 = true; |
8528 | seq_4: |
8529 | if ($r1!==self::$FAILED) { |
8530 | $this->savedPos = $p3; |
8531 | $r1 = $this->a51($r16, $r22); |
8532 | goto choice_1; |
8533 | } |
8534 | // free $p4 |
8535 | $p4 = $this->currPos; |
8536 | // start seq_7 |
8537 | $p6 = $this->currPos; |
8538 | $p8 = $this->currPos; |
8539 | // start seq_8 |
8540 | $p10 = $this->currPos; |
8541 | if (($this->input[$this->currPos] ?? null) === "-") { |
8542 | $this->currPos++; |
8543 | $r24 = "-"; |
8544 | } else { |
8545 | if (!$silence) {$this->fail(55);} |
8546 | $r24 = self::$FAILED; |
8547 | $r23 = self::$FAILED; |
8548 | goto seq_8; |
8549 | } |
8550 | $p13 = $this->currPos; |
8551 | // start seq_9 |
8552 | $p21 = $this->currPos; |
8553 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
8554 | $r26 = "{{"; |
8555 | $this->currPos += 2; |
8556 | } else { |
8557 | $r26 = self::$FAILED; |
8558 | $r25 = self::$FAILED; |
8559 | goto seq_9; |
8560 | } |
8561 | for (;;) { |
8562 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8563 | $r28 = "{{{"; |
8564 | $this->currPos += 3; |
8565 | } else { |
8566 | $r28 = self::$FAILED; |
8567 | break; |
8568 | } |
8569 | } |
8570 | // free $r28 |
8571 | $r27 = true; |
8572 | if ($r27===self::$FAILED) { |
8573 | $this->currPos = $p21; |
8574 | $r25 = self::$FAILED; |
8575 | goto seq_9; |
8576 | } |
8577 | // free $r27 |
8578 | $p29 = $this->currPos; |
8579 | if (($this->input[$this->currPos] ?? null) === "{") { |
8580 | $this->currPos++; |
8581 | $r27 = "{"; |
8582 | } else { |
8583 | $r27 = self::$FAILED; |
8584 | } |
8585 | if ($r27 === self::$FAILED) { |
8586 | $r27 = false; |
8587 | } else { |
8588 | $r27 = self::$FAILED; |
8589 | $this->currPos = $p29; |
8590 | $this->currPos = $p21; |
8591 | $r25 = self::$FAILED; |
8592 | goto seq_9; |
8593 | } |
8594 | // free $p29 |
8595 | $r25 = true; |
8596 | seq_9: |
8597 | if ($r25!==self::$FAILED) { |
8598 | $r25 = false; |
8599 | $this->currPos = $p13; |
8600 | } else { |
8601 | $this->currPos = $p10; |
8602 | $r23 = self::$FAILED; |
8603 | goto seq_8; |
8604 | } |
8605 | // free $p21 |
8606 | // free $p13 |
8607 | $r23 = true; |
8608 | seq_8: |
8609 | // a <- $r23 |
8610 | if ($r23!==self::$FAILED) { |
8611 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
8612 | } else { |
8613 | $r23 = self::$FAILED; |
8614 | $r1 = self::$FAILED; |
8615 | goto seq_7; |
8616 | } |
8617 | // free $p10 |
8618 | // free $p8 |
8619 | $r28 = $this->parsetemplate($silence, $boolParams, $param_th); |
8620 | // b <- $r28 |
8621 | if ($r28===self::$FAILED) { |
8622 | $this->currPos = $p6; |
8623 | $r1 = self::$FAILED; |
8624 | goto seq_7; |
8625 | } |
8626 | $r1 = true; |
8627 | seq_7: |
8628 | if ($r1!==self::$FAILED) { |
8629 | $this->savedPos = $p4; |
8630 | $r1 = $this->a51($r23, $r28); |
8631 | goto choice_1; |
8632 | } |
8633 | // free $p6 |
8634 | $p6 = $this->currPos; |
8635 | // start seq_10 |
8636 | $p8 = $this->currPos; |
8637 | $p10 = $this->currPos; |
8638 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8639 | $r30 = "-{"; |
8640 | $this->currPos += 2; |
8641 | $r30 = false; |
8642 | $this->currPos = $p10; |
8643 | } else { |
8644 | $r30 = self::$FAILED; |
8645 | $r1 = self::$FAILED; |
8646 | goto seq_10; |
8647 | } |
8648 | // free $p10 |
8649 | $r31 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8650 | // a <- $r31 |
8651 | if ($r31===self::$FAILED) { |
8652 | $this->currPos = $p8; |
8653 | $r1 = self::$FAILED; |
8654 | goto seq_10; |
8655 | } |
8656 | $r1 = true; |
8657 | seq_10: |
8658 | if ($r1!==self::$FAILED) { |
8659 | $this->savedPos = $p6; |
8660 | $r1 = $this->a50($r31); |
8661 | } |
8662 | // free $p8 |
8663 | choice_1: |
8664 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8665 | $this->currPos, |
8666 | $r1, |
8667 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8668 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8669 | ); |
8670 | return $r1; |
8671 | } |
8672 | private function parsewikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
8673 | $key = json_encode([422, $boolParams & 0x1fff, $param_th, $param_preproc]); |
8674 | $bucket = $this->currPos; |
8675 | $cached = $this->cache[$bucket][$key] ?? null; |
8676 | if ($cached) { |
8677 | $this->currPos = $cached->nextPos; |
8678 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8679 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8680 | return $cached->result; |
8681 | } |
8682 | $saved_th=$param_th; |
8683 | $saved_preproc=$param_preproc; |
8684 | // start choice_1 |
8685 | $r1 = $this->parsewikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
8686 | if ($r1!==self::$FAILED) { |
8687 | goto choice_1; |
8688 | } |
8689 | $r1 = $this->parsebroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
8690 | choice_1: |
8691 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8692 | $this->currPos, |
8693 | $r1, |
8694 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8695 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8696 | ); |
8697 | return $r1; |
8698 | } |
8699 | private function parsequote($silence) { |
8700 | $key = 432; |
8701 | $bucket = $this->currPos; |
8702 | $cached = $this->cache[$bucket][$key] ?? null; |
8703 | if ($cached) { |
8704 | $this->currPos = $cached->nextPos; |
8705 | |
8706 | return $cached->result; |
8707 | } |
8708 | |
8709 | $p2 = $this->currPos; |
8710 | $p4 = $this->currPos; |
8711 | // start seq_1 |
8712 | $p5 = $this->currPos; |
8713 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "''", $this->currPos, 2, false) === 0) { |
8714 | $r6 = "''"; |
8715 | $this->currPos += 2; |
8716 | } else { |
8717 | if (!$silence) {$this->fail(56);} |
8718 | $r6 = self::$FAILED; |
8719 | $r3 = self::$FAILED; |
8720 | goto seq_1; |
8721 | } |
8722 | for (;;) { |
8723 | if (($this->input[$this->currPos] ?? null) === "'") { |
8724 | $this->currPos++; |
8725 | $r8 = "'"; |
8726 | } else { |
8727 | if (!$silence) {$this->fail(33);} |
8728 | $r8 = self::$FAILED; |
8729 | break; |
8730 | } |
8731 | } |
8732 | // free $r8 |
8733 | $r7 = true; |
8734 | if ($r7===self::$FAILED) { |
8735 | $this->currPos = $p5; |
8736 | $r3 = self::$FAILED; |
8737 | goto seq_1; |
8738 | } |
8739 | // free $r7 |
8740 | $r3 = true; |
8741 | seq_1: |
8742 | // quotes <- $r3 |
8743 | if ($r3!==self::$FAILED) { |
8744 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8745 | } else { |
8746 | $r3 = self::$FAILED; |
8747 | } |
8748 | // free $p5 |
8749 | // free $p4 |
8750 | $r1 = $r3; |
8751 | if ($r1!==self::$FAILED) { |
8752 | $this->savedPos = $p2; |
8753 | $r1 = $this->a81($r3); |
8754 | } |
8755 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8756 | $this->currPos, |
8757 | $r1, |
8758 | self::$UNDEFINED, |
8759 | self::$UNDEFINED |
8760 | ); |
8761 | return $r1; |
8762 | } |
8763 | private function parseinlineline_break_on_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
8764 | $key = json_encode([488, $boolParams & 0xfff, $param_preproc, $param_th]); |
8765 | $bucket = $this->currPos; |
8766 | $cached = $this->cache[$bucket][$key] ?? null; |
8767 | if ($cached) { |
8768 | $this->currPos = $cached->nextPos; |
8769 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8770 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8771 | return $cached->result; |
8772 | } |
8773 | $saved_preproc=$param_preproc; |
8774 | $saved_th=$param_th; |
8775 | $r1 = $this->parseinlineline($silence, $boolParams | 0x1000, $param_preproc, $param_th); |
8776 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8777 | $this->currPos, |
8778 | $r1, |
8779 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8780 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8781 | ); |
8782 | return $r1; |
8783 | } |
8784 | private function parsetable_content_line($silence, $boolParams, &$param_preproc, &$param_th) { |
8785 | $key = json_encode([496, $boolParams & 0x1fff, $param_preproc, $param_th]); |
8786 | $bucket = $this->currPos; |
8787 | $cached = $this->cache[$bucket][$key] ?? null; |
8788 | if ($cached) { |
8789 | $this->currPos = $cached->nextPos; |
8790 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8791 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8792 | return $cached->result; |
8793 | } |
8794 | $saved_preproc=$param_preproc; |
8795 | $saved_th=$param_th; |
8796 | // start seq_1 |
8797 | $p1 = $this->currPos; |
8798 | $r3 = []; |
8799 | for (;;) { |
8800 | // start choice_1 |
8801 | $r4 = $this->parsespace($silence); |
8802 | if ($r4!==self::$FAILED) { |
8803 | goto choice_1; |
8804 | } |
8805 | $r4 = $this->parsecomment($silence); |
8806 | choice_1: |
8807 | if ($r4!==self::$FAILED) { |
8808 | $r3[] = $r4; |
8809 | } else { |
8810 | break; |
8811 | } |
8812 | } |
8813 | // free $r4 |
8814 | // start choice_2 |
8815 | $r4 = $this->parsetable_heading_tags($silence, $boolParams, $param_preproc); |
8816 | if ($r4!==self::$FAILED) { |
8817 | goto choice_2; |
8818 | } |
8819 | $r4 = $this->parsetable_row_tag($silence, $boolParams, $param_preproc, $param_th); |
8820 | if ($r4!==self::$FAILED) { |
8821 | goto choice_2; |
8822 | } |
8823 | $r4 = $this->parsetable_data_tags($silence, $boolParams, $param_preproc, $param_th); |
8824 | if ($r4!==self::$FAILED) { |
8825 | goto choice_2; |
8826 | } |
8827 | $r4 = $this->parsetable_caption_tag($silence, $boolParams, $param_preproc, $param_th); |
8828 | choice_2: |
8829 | if ($r4===self::$FAILED) { |
8830 | $this->currPos = $p1; |
8831 | $r2 = self::$FAILED; |
8832 | goto seq_1; |
8833 | } |
8834 | $r2 = [$r3,$r4]; |
8835 | seq_1: |
8836 | // free $r2,$p1 |
8837 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8838 | $this->currPos, |
8839 | $r2, |
8840 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8841 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8842 | ); |
8843 | return $r2; |
8844 | } |
8845 | private function parsetable_end_tag($silence) { |
8846 | $key = 518; |
8847 | $bucket = $this->currPos; |
8848 | $cached = $this->cache[$bucket][$key] ?? null; |
8849 | if ($cached) { |
8850 | $this->currPos = $cached->nextPos; |
8851 | |
8852 | return $cached->result; |
8853 | } |
8854 | |
8855 | $p2 = $this->currPos; |
8856 | // start seq_1 |
8857 | $p3 = $this->currPos; |
8858 | $r4 = []; |
8859 | for (;;) { |
8860 | // start choice_1 |
8861 | $r5 = $this->parsespace($silence); |
8862 | if ($r5!==self::$FAILED) { |
8863 | goto choice_1; |
8864 | } |
8865 | $r5 = $this->parsecomment($silence); |
8866 | choice_1: |
8867 | if ($r5!==self::$FAILED) { |
8868 | $r4[] = $r5; |
8869 | } else { |
8870 | break; |
8871 | } |
8872 | } |
8873 | // sc <- $r4 |
8874 | // free $r5 |
8875 | $p6 = $this->currPos; |
8876 | $r5 = ''; |
8877 | // startPos <- $r5 |
8878 | if ($r5!==self::$FAILED) { |
8879 | $this->savedPos = $p6; |
8880 | $r5 = $this->a5($r4); |
8881 | } else { |
8882 | $this->currPos = $p3; |
8883 | $r1 = self::$FAILED; |
8884 | goto seq_1; |
8885 | } |
8886 | $r7 = $this->parsepipe($silence); |
8887 | // p <- $r7 |
8888 | if ($r7===self::$FAILED) { |
8889 | $this->currPos = $p3; |
8890 | $r1 = self::$FAILED; |
8891 | goto seq_1; |
8892 | } |
8893 | // b <- $r8 |
8894 | if (($this->input[$this->currPos] ?? null) === "}") { |
8895 | $this->currPos++; |
8896 | $r8 = "}"; |
8897 | } else { |
8898 | if (!$silence) {$this->fail(57);} |
8899 | $r8 = self::$FAILED; |
8900 | $this->currPos = $p3; |
8901 | $r1 = self::$FAILED; |
8902 | goto seq_1; |
8903 | } |
8904 | $r1 = true; |
8905 | seq_1: |
8906 | if ($r1!==self::$FAILED) { |
8907 | $this->savedPos = $p2; |
8908 | $r1 = $this->a82($r4, $r5, $r7, $r8); |
8909 | } |
8910 | // free $p3 |
8911 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8912 | $this->currPos, |
8913 | $r1, |
8914 | self::$UNDEFINED, |
8915 | self::$UNDEFINED |
8916 | ); |
8917 | return $r1; |
8918 | } |
8919 | private function parsesol_prefix($silence) { |
8920 | $key = 592; |
8921 | $bucket = $this->currPos; |
8922 | $cached = $this->cache[$bucket][$key] ?? null; |
8923 | if ($cached) { |
8924 | $this->currPos = $cached->nextPos; |
8925 | |
8926 | return $cached->result; |
8927 | } |
8928 | |
8929 | // start choice_1 |
8930 | $r1 = $this->parsenewlineToken($silence); |
8931 | if ($r1!==self::$FAILED) { |
8932 | goto choice_1; |
8933 | } |
8934 | $p2 = $this->currPos; |
8935 | $this->savedPos = $this->currPos; |
8936 | $r1 = $this->a83(); |
8937 | if ($r1) { |
8938 | $r1 = false; |
8939 | $this->savedPos = $p2; |
8940 | $r1 = $this->a84(); |
8941 | } else { |
8942 | $r1 = self::$FAILED; |
8943 | } |
8944 | choice_1: |
8945 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8946 | $this->currPos, |
8947 | $r1, |
8948 | self::$UNDEFINED, |
8949 | self::$UNDEFINED |
8950 | ); |
8951 | return $r1; |
8952 | } |
8953 | private function parseempty_lines_with_comments($silence) { |
8954 | $key = 594; |
8955 | $bucket = $this->currPos; |
8956 | $cached = $this->cache[$bucket][$key] ?? null; |
8957 | if ($cached) { |
8958 | $this->currPos = $cached->nextPos; |
8959 | |
8960 | return $cached->result; |
8961 | } |
8962 | |
8963 | $p2 = $this->currPos; |
8964 | // start seq_1 |
8965 | $p3 = $this->currPos; |
8966 | $p5 = $this->currPos; |
8967 | $r4 = ''; |
8968 | // p <- $r4 |
8969 | if ($r4!==self::$FAILED) { |
8970 | $this->savedPos = $p5; |
8971 | $r4 = $this->a17(); |
8972 | } else { |
8973 | $r1 = self::$FAILED; |
8974 | goto seq_1; |
8975 | } |
8976 | $r6 = []; |
8977 | for (;;) { |
8978 | // start seq_2 |
8979 | $p8 = $this->currPos; |
8980 | $r9 = []; |
8981 | for (;;) { |
8982 | $r10 = $this->parsespace($silence); |
8983 | if ($r10!==self::$FAILED) { |
8984 | $r9[] = $r10; |
8985 | } else { |
8986 | break; |
8987 | } |
8988 | } |
8989 | // free $r10 |
8990 | $r10 = $this->parsecomment($silence); |
8991 | if ($r10===self::$FAILED) { |
8992 | $this->currPos = $p8; |
8993 | $r7 = self::$FAILED; |
8994 | goto seq_2; |
8995 | } |
8996 | $r11 = []; |
8997 | for (;;) { |
8998 | // start choice_1 |
8999 | $r12 = $this->parsespace($silence); |
9000 | if ($r12!==self::$FAILED) { |
9001 | goto choice_1; |
9002 | } |
9003 | $r12 = $this->parsecomment($silence); |
9004 | choice_1: |
9005 | if ($r12!==self::$FAILED) { |
9006 | $r11[] = $r12; |
9007 | } else { |
9008 | break; |
9009 | } |
9010 | } |
9011 | // free $r12 |
9012 | $r12 = $this->parsenewline($silence); |
9013 | if ($r12===self::$FAILED) { |
9014 | $this->currPos = $p8; |
9015 | $r7 = self::$FAILED; |
9016 | goto seq_2; |
9017 | } |
9018 | $r7 = [$r9,$r10,$r11,$r12]; |
9019 | seq_2: |
9020 | if ($r7!==self::$FAILED) { |
9021 | $r6[] = $r7; |
9022 | } else { |
9023 | break; |
9024 | } |
9025 | // free $p8 |
9026 | } |
9027 | if (count($r6) === 0) { |
9028 | $r6 = self::$FAILED; |
9029 | } |
9030 | // c <- $r6 |
9031 | if ($r6===self::$FAILED) { |
9032 | $this->currPos = $p3; |
9033 | $r1 = self::$FAILED; |
9034 | goto seq_1; |
9035 | } |
9036 | // free $r7 |
9037 | $r1 = true; |
9038 | seq_1: |
9039 | if ($r1!==self::$FAILED) { |
9040 | $this->savedPos = $p2; |
9041 | $r1 = $this->a85($r4, $r6); |
9042 | } |
9043 | // free $p3 |
9044 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9045 | $this->currPos, |
9046 | $r1, |
9047 | self::$UNDEFINED, |
9048 | self::$UNDEFINED |
9049 | ); |
9050 | return $r1; |
9051 | } |
9052 | private function parseredirect_word($silence) { |
9053 | $key = 310; |
9054 | $bucket = $this->currPos; |
9055 | $cached = $this->cache[$bucket][$key] ?? null; |
9056 | if ($cached) { |
9057 | $this->currPos = $cached->nextPos; |
9058 | |
9059 | return $cached->result; |
9060 | } |
9061 | |
9062 | $p1 = $this->currPos; |
9063 | // start seq_1 |
9064 | $p3 = $this->currPos; |
9065 | for (;;) { |
9066 | if (strspn($this->input, " \x09\x0a\x0d\x00\x0b", $this->currPos, 1) !== 0) { |
9067 | $r5 = $this->input[$this->currPos++]; |
9068 | } else { |
9069 | $r5 = self::$FAILED; |
9070 | if (!$silence) {$this->fail(58);} |
9071 | break; |
9072 | } |
9073 | } |
9074 | // free $r5 |
9075 | $r4 = true; |
9076 | if ($r4===self::$FAILED) { |
9077 | $r2 = self::$FAILED; |
9078 | goto seq_1; |
9079 | } |
9080 | // free $r4 |
9081 | $p6 = $this->currPos; |
9082 | $r4 = self::$FAILED; |
9083 | for (;;) { |
9084 | // start seq_2 |
9085 | $p7 = $this->currPos; |
9086 | $p8 = $this->currPos; |
9087 | $r9 = $this->discardspace_or_newline(true); |
9088 | if ($r9 === self::$FAILED) { |
9089 | $r9 = false; |
9090 | } else { |
9091 | $r9 = self::$FAILED; |
9092 | $this->currPos = $p8; |
9093 | $r5 = self::$FAILED; |
9094 | goto seq_2; |
9095 | } |
9096 | // free $p8 |
9097 | $p8 = $this->currPos; |
9098 | $r10 = $this->input[$this->currPos] ?? ''; |
9099 | if ($r10 === ":" || $r10 === "[") { |
9100 | $this->currPos++; |
9101 | } else { |
9102 | $r10 = self::$FAILED; |
9103 | } |
9104 | if ($r10 === self::$FAILED) { |
9105 | $r10 = false; |
9106 | } else { |
9107 | $r10 = self::$FAILED; |
9108 | $this->currPos = $p8; |
9109 | $this->currPos = $p7; |
9110 | $r5 = self::$FAILED; |
9111 | goto seq_2; |
9112 | } |
9113 | // free $p8 |
9114 | if ($this->currPos < $this->inputLength) { |
9115 | $r11 = self::consumeChar($this->input, $this->currPos);; |
9116 | } else { |
9117 | $r11 = self::$FAILED; |
9118 | if (!$silence) {$this->fail(7);} |
9119 | $this->currPos = $p7; |
9120 | $r5 = self::$FAILED; |
9121 | goto seq_2; |
9122 | } |
9123 | $r5 = true; |
9124 | seq_2: |
9125 | if ($r5!==self::$FAILED) { |
9126 | $r4 = true; |
9127 | } else { |
9128 | break; |
9129 | } |
9130 | // free $p7 |
9131 | } |
9132 | // rw <- $r4 |
9133 | if ($r4!==self::$FAILED) { |
9134 | $r4 = substr($this->input, $p6, $this->currPos - $p6); |
9135 | } else { |
9136 | $r4 = self::$FAILED; |
9137 | $this->currPos = $p3; |
9138 | $r2 = self::$FAILED; |
9139 | goto seq_1; |
9140 | } |
9141 | // free $r5 |
9142 | // free $p6 |
9143 | $this->savedPos = $this->currPos; |
9144 | $r5 = $this->a86($r4); |
9145 | if ($r5) { |
9146 | $r5 = false; |
9147 | } else { |
9148 | $r5 = self::$FAILED; |
9149 | $this->currPos = $p3; |
9150 | $r2 = self::$FAILED; |
9151 | goto seq_1; |
9152 | } |
9153 | $r2 = true; |
9154 | seq_1: |
9155 | if ($r2!==self::$FAILED) { |
9156 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
9157 | } else { |
9158 | $r2 = self::$FAILED; |
9159 | } |
9160 | // free $p3 |
9161 | // free $p1 |
9162 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9163 | $this->currPos, |
9164 | $r2, |
9165 | self::$UNDEFINED, |
9166 | self::$UNDEFINED |
9167 | ); |
9168 | return $r2; |
9169 | } |
9170 | private function parseinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) { |
9171 | $key = json_encode([532, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
9172 | $bucket = $this->currPos; |
9173 | $cached = $this->cache[$bucket][$key] ?? null; |
9174 | if ($cached) { |
9175 | $this->currPos = $cached->nextPos; |
9176 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9177 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9178 | return $cached->result; |
9179 | } |
9180 | $saved_preproc=$param_preproc; |
9181 | $saved_th=$param_th; |
9182 | $p2 = $this->currPos; |
9183 | // start seq_1 |
9184 | $p3 = $this->currPos; |
9185 | $p4 = $this->currPos; |
9186 | $r5 = $this->discardinclude_check(true, $boolParams); |
9187 | if ($r5!==self::$FAILED) { |
9188 | $r5 = false; |
9189 | $this->currPos = $p4; |
9190 | } else { |
9191 | $r1 = self::$FAILED; |
9192 | goto seq_1; |
9193 | } |
9194 | // free $p4 |
9195 | $r6 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
9196 | // t <- $r6 |
9197 | if ($r6===self::$FAILED) { |
9198 | $this->currPos = $p3; |
9199 | $r1 = self::$FAILED; |
9200 | goto seq_1; |
9201 | } |
9202 | $r1 = true; |
9203 | seq_1: |
9204 | if ($r1!==self::$FAILED) { |
9205 | $this->savedPos = $p2; |
9206 | $r1 = $this->a87($r6); |
9207 | } |
9208 | // free $p3 |
9209 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9210 | $this->currPos, |
9211 | $r1, |
9212 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9213 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9214 | ); |
9215 | return $r1; |
9216 | } |
9217 | private function parseannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
9218 | $key = json_encode([438, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
9219 | $bucket = $this->currPos; |
9220 | $cached = $this->cache[$bucket][$key] ?? null; |
9221 | if ($cached) { |
9222 | $this->currPos = $cached->nextPos; |
9223 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9224 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9225 | return $cached->result; |
9226 | } |
9227 | $saved_preproc=$param_preproc; |
9228 | $saved_th=$param_th; |
9229 | $p2 = $this->currPos; |
9230 | // start choice_1 |
9231 | $r3 = $this->parsetvar_old_syntax_closing_HACK($silence, $boolParams); |
9232 | if ($r3!==self::$FAILED) { |
9233 | goto choice_1; |
9234 | } |
9235 | $p4 = $this->currPos; |
9236 | // start seq_1 |
9237 | $p5 = $this->currPos; |
9238 | $p6 = $this->currPos; |
9239 | $r7 = $this->discardannotation_check(true, $boolParams); |
9240 | if ($r7!==self::$FAILED) { |
9241 | $r7 = false; |
9242 | $this->currPos = $p6; |
9243 | } else { |
9244 | $r3 = self::$FAILED; |
9245 | goto seq_1; |
9246 | } |
9247 | // free $p6 |
9248 | $r8 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
9249 | // t <- $r8 |
9250 | if ($r8===self::$FAILED) { |
9251 | $this->currPos = $p5; |
9252 | $r3 = self::$FAILED; |
9253 | goto seq_1; |
9254 | } |
9255 | $r3 = true; |
9256 | seq_1: |
9257 | if ($r3!==self::$FAILED) { |
9258 | $this->savedPos = $p4; |
9259 | $r3 = $this->a88($r8); |
9260 | } |
9261 | // free $p5 |
9262 | choice_1: |
9263 | // tag <- $r3 |
9264 | $r1 = $r3; |
9265 | if ($r1!==self::$FAILED) { |
9266 | $this->savedPos = $p2; |
9267 | $r1 = $this->a89($r3); |
9268 | } |
9269 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9270 | $this->currPos, |
9271 | $r1, |
9272 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9273 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9274 | ); |
9275 | return $r1; |
9276 | } |
9277 | private function parseheading($silence, $boolParams, &$param_preproc, &$param_th) { |
9278 | $key = json_encode([336, $boolParams & 0x1fff, $param_preproc, $param_th]); |
9279 | $bucket = $this->currPos; |
9280 | $cached = $this->cache[$bucket][$key] ?? null; |
9281 | if ($cached) { |
9282 | $this->currPos = $cached->nextPos; |
9283 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9284 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9285 | return $cached->result; |
9286 | } |
9287 | $saved_preproc=$param_preproc; |
9288 | $saved_th=$param_th; |
9289 | $p2 = $this->currPos; |
9290 | // start seq_1 |
9291 | $p3 = $this->currPos; |
9292 | $p4 = $this->currPos; |
9293 | if (($this->input[$this->currPos] ?? null) === "=") { |
9294 | $this->currPos++; |
9295 | $r5 = "="; |
9296 | $r5 = false; |
9297 | $this->currPos = $p4; |
9298 | } else { |
9299 | $r5 = self::$FAILED; |
9300 | $r1 = self::$FAILED; |
9301 | goto seq_1; |
9302 | } |
9303 | // free $p4 |
9304 | $p4 = $this->currPos; |
9305 | // start seq_2 |
9306 | $p7 = $this->currPos; |
9307 | $p9 = $this->currPos; |
9308 | $r8 = self::$FAILED; |
9309 | for (;;) { |
9310 | if (($this->input[$this->currPos] ?? null) === "=") { |
9311 | $this->currPos++; |
9312 | $r10 = "="; |
9313 | $r8 = true; |
9314 | } else { |
9315 | if (!$silence) {$this->fail(23);} |
9316 | $r10 = self::$FAILED; |
9317 | break; |
9318 | } |
9319 | } |
9320 | // s <- $r8 |
9321 | if ($r8!==self::$FAILED) { |
9322 | $r8 = substr($this->input, $p9, $this->currPos - $p9); |
9323 | } else { |
9324 | $r8 = self::$FAILED; |
9325 | $r6 = self::$FAILED; |
9326 | goto seq_2; |
9327 | } |
9328 | // free $r10 |
9329 | // free $p9 |
9330 | // start seq_3 |
9331 | $p9 = $this->currPos; |
9332 | $p12 = $this->currPos; |
9333 | $r13 = $this->parseinlineline($silence, $boolParams | 0x4, $param_preproc, $param_th); |
9334 | if ($r13===self::$FAILED) { |
9335 | $r13 = null; |
9336 | } |
9337 | // ill <- $r13 |
9338 | $r11 = $r13; |
9339 | if ($r11!==self::$FAILED) { |
9340 | $this->savedPos = $p12; |
9341 | $r11 = $this->a90($r8, $r13); |
9342 | } else { |
9343 | $r10 = self::$FAILED; |
9344 | goto seq_3; |
9345 | } |
9346 | $p14 = $this->currPos; |
9347 | $r15 = self::$FAILED; |
9348 | for (;;) { |
9349 | if (($this->input[$this->currPos] ?? null) === "=") { |
9350 | $this->currPos++; |
9351 | $r16 = "="; |
9352 | $r15 = true; |
9353 | } else { |
9354 | if (!$silence) {$this->fail(23);} |
9355 | $r16 = self::$FAILED; |
9356 | break; |
9357 | } |
9358 | } |
9359 | if ($r15!==self::$FAILED) { |
9360 | $r15 = substr($this->input, $p14, $this->currPos - $p14); |
9361 | } else { |
9362 | $r15 = self::$FAILED; |
9363 | $this->currPos = $p9; |
9364 | $r10 = self::$FAILED; |
9365 | goto seq_3; |
9366 | } |
9367 | // free $r16 |
9368 | // free $p14 |
9369 | $r10 = [$r11,$r15]; |
9370 | seq_3: |
9371 | if ($r10===self::$FAILED) { |
9372 | $r10 = null; |
9373 | } |
9374 | // free $p9 |
9375 | // ce <- $r10 |
9376 | $this->savedPos = $this->currPos; |
9377 | $r16 = $this->a91($r8, $r10); |
9378 | if ($r16) { |
9379 | $r16 = false; |
9380 | } else { |
9381 | $r16 = self::$FAILED; |
9382 | $this->currPos = $p7; |
9383 | $r6 = self::$FAILED; |
9384 | goto seq_2; |
9385 | } |
9386 | $p9 = $this->currPos; |
9387 | $r17 = ''; |
9388 | // endTPos <- $r17 |
9389 | if ($r17!==self::$FAILED) { |
9390 | $this->savedPos = $p9; |
9391 | $r17 = $this->a92($r8, $r10); |
9392 | } else { |
9393 | $this->currPos = $p7; |
9394 | $r6 = self::$FAILED; |
9395 | goto seq_2; |
9396 | } |
9397 | $r18 = []; |
9398 | for (;;) { |
9399 | // start choice_1 |
9400 | $r19 = $this->parsespace($silence); |
9401 | if ($r19!==self::$FAILED) { |
9402 | goto choice_1; |
9403 | } |
9404 | $r19 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
9405 | choice_1: |
9406 | if ($r19!==self::$FAILED) { |
9407 | $r18[] = $r19; |
9408 | } else { |
9409 | break; |
9410 | } |
9411 | } |
9412 | // spc <- $r18 |
9413 | // free $r19 |
9414 | $p14 = $this->currPos; |
9415 | $r19 = $this->discardeolf(true); |
9416 | if ($r19!==self::$FAILED) { |
9417 | $r19 = false; |
9418 | $this->currPos = $p14; |
9419 | } else { |
9420 | $this->currPos = $p7; |
9421 | $r6 = self::$FAILED; |
9422 | goto seq_2; |
9423 | } |
9424 | // free $p14 |
9425 | $r6 = true; |
9426 | seq_2: |
9427 | // r <- $r6 |
9428 | if ($r6!==self::$FAILED) { |
9429 | $this->savedPos = $p4; |
9430 | $r6 = $this->a93($r8, $r10, $r17, $r18); |
9431 | } else { |
9432 | $this->currPos = $p3; |
9433 | $r1 = self::$FAILED; |
9434 | goto seq_1; |
9435 | } |
9436 | // free $p7 |
9437 | $r1 = true; |
9438 | seq_1: |
9439 | if ($r1!==self::$FAILED) { |
9440 | $this->savedPos = $p2; |
9441 | $r1 = $this->a24($r6); |
9442 | } |
9443 | // free $p3 |
9444 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9445 | $this->currPos, |
9446 | $r1, |
9447 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9448 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9449 | ); |
9450 | return $r1; |
9451 | } |
9452 | private function parsehr($silence, $boolParams, &$param_preproc, &$param_th) { |
9453 | $key = json_encode([320, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
9454 | $bucket = $this->currPos; |
9455 | $cached = $this->cache[$bucket][$key] ?? null; |
9456 | if ($cached) { |
9457 | $this->currPos = $cached->nextPos; |
9458 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9459 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9460 | return $cached->result; |
9461 | } |
9462 | $saved_preproc=$param_preproc; |
9463 | $saved_th=$param_th; |
9464 | $p2 = $this->currPos; |
9465 | // start seq_1 |
9466 | $p3 = $this->currPos; |
9467 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "----", $this->currPos, 4, false) === 0) { |
9468 | $r4 = "----"; |
9469 | $this->currPos += 4; |
9470 | } else { |
9471 | if (!$silence) {$this->fail(59);} |
9472 | $r4 = self::$FAILED; |
9473 | $r1 = self::$FAILED; |
9474 | goto seq_1; |
9475 | } |
9476 | $p6 = $this->currPos; |
9477 | for (;;) { |
9478 | if (($this->input[$this->currPos] ?? null) === "-") { |
9479 | $this->currPos++; |
9480 | $r7 = "-"; |
9481 | } else { |
9482 | if (!$silence) {$this->fail(55);} |
9483 | $r7 = self::$FAILED; |
9484 | break; |
9485 | } |
9486 | } |
9487 | // free $r7 |
9488 | $r5 = true; |
9489 | // d <- $r5 |
9490 | if ($r5!==self::$FAILED) { |
9491 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9492 | } else { |
9493 | $r5 = self::$FAILED; |
9494 | $this->currPos = $p3; |
9495 | $r1 = self::$FAILED; |
9496 | goto seq_1; |
9497 | } |
9498 | // free $p6 |
9499 | // start choice_1 |
9500 | $p6 = $this->currPos; |
9501 | // start seq_2 |
9502 | $p8 = $this->currPos; |
9503 | $p9 = $this->currPos; |
9504 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
9505 | if ($r10!==self::$FAILED) { |
9506 | $r10 = false; |
9507 | $this->currPos = $p9; |
9508 | } else { |
9509 | $r7 = self::$FAILED; |
9510 | goto seq_2; |
9511 | } |
9512 | // free $p9 |
9513 | $r7 = true; |
9514 | seq_2: |
9515 | if ($r7!==self::$FAILED) { |
9516 | $this->savedPos = $p6; |
9517 | $r7 = $this->a94($r5); |
9518 | goto choice_1; |
9519 | } |
9520 | // free $p8 |
9521 | $p8 = $this->currPos; |
9522 | $r7 = ''; |
9523 | if ($r7!==self::$FAILED) { |
9524 | $this->savedPos = $p8; |
9525 | $r7 = $this->a95($r5); |
9526 | } |
9527 | choice_1: |
9528 | // lineContent <- $r7 |
9529 | if ($r7===self::$FAILED) { |
9530 | $this->currPos = $p3; |
9531 | $r1 = self::$FAILED; |
9532 | goto seq_1; |
9533 | } |
9534 | $r1 = true; |
9535 | seq_1: |
9536 | if ($r1!==self::$FAILED) { |
9537 | $this->savedPos = $p2; |
9538 | $r1 = $this->a96($r5, $r7); |
9539 | } |
9540 | // free $p3 |
9541 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9542 | $this->currPos, |
9543 | $r1, |
9544 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9545 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9546 | ); |
9547 | return $r1; |
9548 | } |
9549 | private function discardtplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9550 | $key = json_encode([381, $boolParams & 0x1fff, $param_preproc, $param_th]); |
9551 | $bucket = $this->currPos; |
9552 | $cached = $this->cache[$bucket][$key] ?? null; |
9553 | if ($cached) { |
9554 | $this->currPos = $cached->nextPos; |
9555 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9556 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9557 | return $cached->result; |
9558 | } |
9559 | $saved_preproc=$param_preproc; |
9560 | $saved_th=$param_th; |
9561 | $p2 = $this->currPos; |
9562 | // start seq_1 |
9563 | $p3 = $this->currPos; |
9564 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
9565 | $r4 = "{{{"; |
9566 | $this->currPos += 3; |
9567 | } else { |
9568 | if (!$silence) {$this->fail(60);} |
9569 | $r4 = self::$FAILED; |
9570 | $r1 = self::$FAILED; |
9571 | goto seq_1; |
9572 | } |
9573 | $p6 = $this->currPos; |
9574 | $r5 = ''; |
9575 | // p <- $r5 |
9576 | if ($r5!==self::$FAILED) { |
9577 | $this->savedPos = $p6; |
9578 | $r5 = $this->a17(); |
9579 | } else { |
9580 | $this->currPos = $p3; |
9581 | $r1 = self::$FAILED; |
9582 | goto seq_1; |
9583 | } |
9584 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9585 | if ($r7===self::$FAILED) { |
9586 | $r7 = null; |
9587 | } |
9588 | // target <- $r7 |
9589 | $r8 = []; |
9590 | for (;;) { |
9591 | $p10 = $this->currPos; |
9592 | // start seq_2 |
9593 | $p11 = $this->currPos; |
9594 | for (;;) { |
9595 | $r13 = $this->discardnl_comment_space($silence); |
9596 | if ($r13===self::$FAILED) { |
9597 | break; |
9598 | } |
9599 | } |
9600 | // free $r13 |
9601 | $r12 = true; |
9602 | if ($r12===self::$FAILED) { |
9603 | $r9 = self::$FAILED; |
9604 | goto seq_2; |
9605 | } |
9606 | // free $r12 |
9607 | if (($this->input[$this->currPos] ?? null) === "|") { |
9608 | $this->currPos++; |
9609 | $r12 = "|"; |
9610 | } else { |
9611 | if (!$silence) {$this->fail(13);} |
9612 | $r12 = self::$FAILED; |
9613 | $this->currPos = $p11; |
9614 | $r9 = self::$FAILED; |
9615 | goto seq_2; |
9616 | } |
9617 | // start choice_1 |
9618 | $p14 = $this->currPos; |
9619 | // start seq_3 |
9620 | $p15 = $this->currPos; |
9621 | $p17 = $this->currPos; |
9622 | $r16 = ''; |
9623 | // p0 <- $r16 |
9624 | if ($r16!==self::$FAILED) { |
9625 | $this->savedPos = $p17; |
9626 | $r16 = $this->a97($r5, $r7); |
9627 | } else { |
9628 | $r13 = self::$FAILED; |
9629 | goto seq_3; |
9630 | } |
9631 | $r18 = []; |
9632 | for (;;) { |
9633 | $r19 = $this->parsenl_comment_space($silence); |
9634 | if ($r19!==self::$FAILED) { |
9635 | $r18[] = $r19; |
9636 | } else { |
9637 | break; |
9638 | } |
9639 | } |
9640 | // v <- $r18 |
9641 | // free $r19 |
9642 | $p20 = $this->currPos; |
9643 | $r19 = ''; |
9644 | // p1 <- $r19 |
9645 | if ($r19!==self::$FAILED) { |
9646 | $this->savedPos = $p20; |
9647 | $r19 = $this->a98($r5, $r7, $r16, $r18); |
9648 | } else { |
9649 | $this->currPos = $p15; |
9650 | $r13 = self::$FAILED; |
9651 | goto seq_3; |
9652 | } |
9653 | $p21 = $this->currPos; |
9654 | // start choice_2 |
9655 | if (($this->input[$this->currPos] ?? null) === "|") { |
9656 | $this->currPos++; |
9657 | $r22 = "|"; |
9658 | goto choice_2; |
9659 | } else { |
9660 | $r22 = self::$FAILED; |
9661 | } |
9662 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9663 | $r22 = "}}}"; |
9664 | $this->currPos += 3; |
9665 | } else { |
9666 | $r22 = self::$FAILED; |
9667 | } |
9668 | choice_2: |
9669 | if ($r22!==self::$FAILED) { |
9670 | $r22 = false; |
9671 | $this->currPos = $p21; |
9672 | } else { |
9673 | $this->currPos = $p15; |
9674 | $r13 = self::$FAILED; |
9675 | goto seq_3; |
9676 | } |
9677 | // free $p21 |
9678 | $r13 = true; |
9679 | seq_3: |
9680 | if ($r13!==self::$FAILED) { |
9681 | $this->savedPos = $p14; |
9682 | $r13 = $this->a99($r5, $r7, $r16, $r18, $r19); |
9683 | goto choice_1; |
9684 | } |
9685 | // free $p15 |
9686 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9687 | choice_1: |
9688 | // r <- $r13 |
9689 | if ($r13===self::$FAILED) { |
9690 | $this->currPos = $p11; |
9691 | $r9 = self::$FAILED; |
9692 | goto seq_2; |
9693 | } |
9694 | $r9 = true; |
9695 | seq_2: |
9696 | if ($r9!==self::$FAILED) { |
9697 | $this->savedPos = $p10; |
9698 | $r9 = $this->a100($r5, $r7, $r13); |
9699 | $r8[] = $r9; |
9700 | } else { |
9701 | break; |
9702 | } |
9703 | // free $p11 |
9704 | } |
9705 | // params <- $r8 |
9706 | // free $r9 |
9707 | for (;;) { |
9708 | $r23 = $this->discardnl_comment_space($silence); |
9709 | if ($r23===self::$FAILED) { |
9710 | break; |
9711 | } |
9712 | } |
9713 | // free $r23 |
9714 | $r9 = true; |
9715 | if ($r9===self::$FAILED) { |
9716 | $this->currPos = $p3; |
9717 | $r1 = self::$FAILED; |
9718 | goto seq_1; |
9719 | } |
9720 | // free $r9 |
9721 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
9722 | if ($r9===self::$FAILED) { |
9723 | $this->currPos = $p3; |
9724 | $r1 = self::$FAILED; |
9725 | goto seq_1; |
9726 | } |
9727 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9728 | $r23 = "}}}"; |
9729 | $this->currPos += 3; |
9730 | } else { |
9731 | if (!$silence) {$this->fail(61);} |
9732 | $r23 = self::$FAILED; |
9733 | $this->currPos = $p3; |
9734 | $r1 = self::$FAILED; |
9735 | goto seq_1; |
9736 | } |
9737 | $r1 = true; |
9738 | seq_1: |
9739 | if ($r1!==self::$FAILED) { |
9740 | $this->savedPos = $p2; |
9741 | $r1 = $this->a101($r5, $r7, $r8); |
9742 | } |
9743 | // free $p3 |
9744 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9745 | $this->currPos, |
9746 | $r1, |
9747 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9748 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9749 | ); |
9750 | return $r1; |
9751 | } |
9752 | private function parsetemplate_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9753 | $key = json_encode([374, $boolParams & 0x1fff, $param_preproc, $param_th]); |
9754 | $bucket = $this->currPos; |
9755 | $cached = $this->cache[$bucket][$key] ?? null; |
9756 | if ($cached) { |
9757 | $this->currPos = $cached->nextPos; |
9758 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9759 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9760 | return $cached->result; |
9761 | } |
9762 | $saved_preproc=$param_preproc; |
9763 | $saved_th=$param_th; |
9764 | // start choice_1 |
9765 | $p2 = $this->currPos; |
9766 | // start seq_1 |
9767 | $p3 = $this->currPos; |
9768 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
9769 | $r4 = "{{"; |
9770 | $this->currPos += 2; |
9771 | } else { |
9772 | if (!$silence) {$this->fail(43);} |
9773 | $r4 = self::$FAILED; |
9774 | $r1 = self::$FAILED; |
9775 | goto seq_1; |
9776 | } |
9777 | $p6 = $this->currPos; |
9778 | for (;;) { |
9779 | $r7 = $this->discardnl_comment_space($silence); |
9780 | if ($r7===self::$FAILED) { |
9781 | break; |
9782 | } |
9783 | } |
9784 | // free $r7 |
9785 | $r5 = true; |
9786 | // leadWS <- $r5 |
9787 | if ($r5!==self::$FAILED) { |
9788 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9789 | } else { |
9790 | $r5 = self::$FAILED; |
9791 | $this->currPos = $p3; |
9792 | $r1 = self::$FAILED; |
9793 | goto seq_1; |
9794 | } |
9795 | // free $p6 |
9796 | // start choice_2 |
9797 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9798 | if ($r7!==self::$FAILED) { |
9799 | goto choice_2; |
9800 | } |
9801 | $r7 = $this->parseparsoid_fragment_marker($silence); |
9802 | choice_2: |
9803 | // target <- $r7 |
9804 | if ($r7===self::$FAILED) { |
9805 | $this->currPos = $p3; |
9806 | $r1 = self::$FAILED; |
9807 | goto seq_1; |
9808 | } |
9809 | $r8 = []; |
9810 | for (;;) { |
9811 | $p6 = $this->currPos; |
9812 | // start seq_2 |
9813 | $p10 = $this->currPos; |
9814 | for (;;) { |
9815 | $r12 = $this->discardnl_comment_space($silence); |
9816 | if ($r12===self::$FAILED) { |
9817 | break; |
9818 | } |
9819 | } |
9820 | // free $r12 |
9821 | $r11 = true; |
9822 | if ($r11===self::$FAILED) { |
9823 | $r9 = self::$FAILED; |
9824 | goto seq_2; |
9825 | } |
9826 | // free $r11 |
9827 | if (($this->input[$this->currPos] ?? null) === "|") { |
9828 | $this->currPos++; |
9829 | $r11 = "|"; |
9830 | } else { |
9831 | if (!$silence) {$this->fail(13);} |
9832 | $r11 = self::$FAILED; |
9833 | $this->currPos = $p10; |
9834 | $r9 = self::$FAILED; |
9835 | goto seq_2; |
9836 | } |
9837 | // start choice_3 |
9838 | $p13 = $this->currPos; |
9839 | // start seq_3 |
9840 | $p14 = $this->currPos; |
9841 | $p16 = $this->currPos; |
9842 | $r15 = ''; |
9843 | // p0 <- $r15 |
9844 | if ($r15!==self::$FAILED) { |
9845 | $this->savedPos = $p16; |
9846 | $r15 = $this->a102($r5, $r7); |
9847 | } else { |
9848 | $r12 = self::$FAILED; |
9849 | goto seq_3; |
9850 | } |
9851 | $r17 = []; |
9852 | for (;;) { |
9853 | $r18 = $this->parsenl_comment_space($silence); |
9854 | if ($r18!==self::$FAILED) { |
9855 | $r17[] = $r18; |
9856 | } else { |
9857 | break; |
9858 | } |
9859 | } |
9860 | // v <- $r17 |
9861 | // free $r18 |
9862 | $p19 = $this->currPos; |
9863 | $r18 = ''; |
9864 | // p1 <- $r18 |
9865 | if ($r18!==self::$FAILED) { |
9866 | $this->savedPos = $p19; |
9867 | $r18 = $this->a103($r5, $r7, $r15, $r17); |
9868 | } else { |
9869 | $this->currPos = $p14; |
9870 | $r12 = self::$FAILED; |
9871 | goto seq_3; |
9872 | } |
9873 | $p20 = $this->currPos; |
9874 | // start choice_4 |
9875 | if (($this->input[$this->currPos] ?? null) === "|") { |
9876 | $this->currPos++; |
9877 | $r21 = "|"; |
9878 | goto choice_4; |
9879 | } else { |
9880 | $r21 = self::$FAILED; |
9881 | } |
9882 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9883 | $r21 = "}}"; |
9884 | $this->currPos += 2; |
9885 | } else { |
9886 | $r21 = self::$FAILED; |
9887 | } |
9888 | choice_4: |
9889 | if ($r21!==self::$FAILED) { |
9890 | $r21 = false; |
9891 | $this->currPos = $p20; |
9892 | } else { |
9893 | $this->currPos = $p14; |
9894 | $r12 = self::$FAILED; |
9895 | goto seq_3; |
9896 | } |
9897 | // free $p20 |
9898 | $r12 = true; |
9899 | seq_3: |
9900 | if ($r12!==self::$FAILED) { |
9901 | $this->savedPos = $p13; |
9902 | $r12 = $this->a104($r5, $r7, $r15, $r17, $r18); |
9903 | goto choice_3; |
9904 | } |
9905 | // free $p14 |
9906 | $r12 = $this->parsetemplate_param($silence, $boolParams, $param_preproc, $param_th); |
9907 | choice_3: |
9908 | // r <- $r12 |
9909 | if ($r12===self::$FAILED) { |
9910 | $this->currPos = $p10; |
9911 | $r9 = self::$FAILED; |
9912 | goto seq_2; |
9913 | } |
9914 | $r9 = true; |
9915 | seq_2: |
9916 | if ($r9!==self::$FAILED) { |
9917 | $this->savedPos = $p6; |
9918 | $r9 = $this->a105($r5, $r7, $r12); |
9919 | $r8[] = $r9; |
9920 | } else { |
9921 | break; |
9922 | } |
9923 | // free $p10 |
9924 | } |
9925 | // params <- $r8 |
9926 | // free $r9 |
9927 | $p10 = $this->currPos; |
9928 | for (;;) { |
9929 | $r22 = $this->discardnl_comment_space($silence); |
9930 | if ($r22===self::$FAILED) { |
9931 | break; |
9932 | } |
9933 | } |
9934 | // free $r22 |
9935 | $r9 = true; |
9936 | // trailWS <- $r9 |
9937 | if ($r9!==self::$FAILED) { |
9938 | $r9 = substr($this->input, $p10, $this->currPos - $p10); |
9939 | } else { |
9940 | $r9 = self::$FAILED; |
9941 | $this->currPos = $p3; |
9942 | $r1 = self::$FAILED; |
9943 | goto seq_1; |
9944 | } |
9945 | // free $p10 |
9946 | $r22 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
9947 | if ($r22===self::$FAILED) { |
9948 | $this->currPos = $p3; |
9949 | $r1 = self::$FAILED; |
9950 | goto seq_1; |
9951 | } |
9952 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9953 | $r23 = "}}"; |
9954 | $this->currPos += 2; |
9955 | } else { |
9956 | if (!$silence) {$this->fail(62);} |
9957 | $r23 = self::$FAILED; |
9958 | $this->currPos = $p3; |
9959 | $r1 = self::$FAILED; |
9960 | goto seq_1; |
9961 | } |
9962 | $r1 = true; |
9963 | seq_1: |
9964 | if ($r1!==self::$FAILED) { |
9965 | $this->savedPos = $p2; |
9966 | $r1 = $this->a106($r5, $r7, $r8, $r9); |
9967 | goto choice_1; |
9968 | } |
9969 | // free $p3 |
9970 | $p3 = $this->currPos; |
9971 | // start seq_4 |
9972 | $p10 = $this->currPos; |
9973 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
9974 | $r24 = "{{"; |
9975 | $this->currPos += 2; |
9976 | } else { |
9977 | if (!$silence) {$this->fail(43);} |
9978 | $r24 = self::$FAILED; |
9979 | $r1 = self::$FAILED; |
9980 | goto seq_4; |
9981 | } |
9982 | for (;;) { |
9983 | $r26 = $this->discardspace_or_newline($silence); |
9984 | if ($r26===self::$FAILED) { |
9985 | break; |
9986 | } |
9987 | } |
9988 | // free $r26 |
9989 | $r25 = true; |
9990 | if ($r25===self::$FAILED) { |
9991 | $this->currPos = $p10; |
9992 | $r1 = self::$FAILED; |
9993 | goto seq_4; |
9994 | } |
9995 | // free $r25 |
9996 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9997 | $r25 = "}}"; |
9998 | $this->currPos += 2; |
9999 | } else { |
10000 | if (!$silence) {$this->fail(62);} |
10001 | $r25 = self::$FAILED; |
10002 | $this->currPos = $p10; |
10003 | $r1 = self::$FAILED; |
10004 | goto seq_4; |
10005 | } |
10006 | $r1 = true; |
10007 | seq_4: |
10008 | if ($r1!==self::$FAILED) { |
10009 | $r1 = substr($this->input, $p3, $this->currPos - $p3); |
10010 | } else { |
10011 | $r1 = self::$FAILED; |
10012 | } |
10013 | // free $p10 |
10014 | // free $p3 |
10015 | choice_1: |
10016 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10017 | $this->currPos, |
10018 | $r1, |
10019 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10020 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10021 | ); |
10022 | return $r1; |
10023 | } |
10024 | private function parsetplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
10025 | $key = json_encode([380, $boolParams & 0x1fff, $param_preproc, $param_th]); |
10026 | $bucket = $this->currPos; |
10027 | $cached = $this->cache[$bucket][$key] ?? null; |
10028 | if ($cached) { |
10029 | $this->currPos = $cached->nextPos; |
10030 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10031 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10032 | return $cached->result; |
10033 | } |
10034 | $saved_preproc=$param_preproc; |
10035 | $saved_th=$param_th; |
10036 | $p2 = $this->currPos; |
10037 | // start seq_1 |
10038 | $p3 = $this->currPos; |
10039 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
10040 | $r4 = "{{{"; |
10041 | $this->currPos += 3; |
10042 | } else { |
10043 | if (!$silence) {$this->fail(60);} |
10044 | $r4 = self::$FAILED; |
10045 | $r1 = self::$FAILED; |
10046 | goto seq_1; |
10047 | } |
10048 | $p6 = $this->currPos; |
10049 | $r5 = ''; |
10050 | // p <- $r5 |
10051 | if ($r5!==self::$FAILED) { |
10052 | $this->savedPos = $p6; |
10053 | $r5 = $this->a17(); |
10054 | } else { |
10055 | $this->currPos = $p3; |
10056 | $r1 = self::$FAILED; |
10057 | goto seq_1; |
10058 | } |
10059 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
10060 | if ($r7===self::$FAILED) { |
10061 | $r7 = null; |
10062 | } |
10063 | // target <- $r7 |
10064 | $r8 = []; |
10065 | for (;;) { |
10066 | $p10 = $this->currPos; |
10067 | // start seq_2 |
10068 | $p11 = $this->currPos; |
10069 | for (;;) { |
10070 | $r13 = $this->discardnl_comment_space($silence); |
10071 | if ($r13===self::$FAILED) { |
10072 | break; |
10073 | } |
10074 | } |
10075 | // free $r13 |
10076 | $r12 = true; |
10077 | if ($r12===self::$FAILED) { |
10078 | $r9 = self::$FAILED; |
10079 | goto seq_2; |
10080 | } |
10081 | // free $r12 |
10082 | if (($this->input[$this->currPos] ?? null) === "|") { |
10083 | $this->currPos++; |
10084 | $r12 = "|"; |
10085 | } else { |
10086 | if (!$silence) {$this->fail(13);} |
10087 | $r12 = self::$FAILED; |
10088 | $this->currPos = $p11; |
10089 | $r9 = self::$FAILED; |
10090 | goto seq_2; |
10091 | } |
10092 | // start choice_1 |
10093 | $p14 = $this->currPos; |
10094 | // start seq_3 |
10095 | $p15 = $this->currPos; |
10096 | $p17 = $this->currPos; |
10097 | $r16 = ''; |
10098 | // p0 <- $r16 |
10099 | if ($r16!==self::$FAILED) { |
10100 | $this->savedPos = $p17; |
10101 | $r16 = $this->a97($r5, $r7); |
10102 | } else { |
10103 | $r13 = self::$FAILED; |
10104 | goto seq_3; |
10105 | } |
10106 | $r18 = []; |
10107 | for (;;) { |
10108 | $r19 = $this->parsenl_comment_space($silence); |
10109 | if ($r19!==self::$FAILED) { |
10110 | $r18[] = $r19; |
10111 | } else { |
10112 | break; |
10113 | } |
10114 | } |
10115 | // v <- $r18 |
10116 | // free $r19 |
10117 | $p20 = $this->currPos; |
10118 | $r19 = ''; |
10119 | // p1 <- $r19 |
10120 | if ($r19!==self::$FAILED) { |
10121 | $this->savedPos = $p20; |
10122 | $r19 = $this->a98($r5, $r7, $r16, $r18); |
10123 | } else { |
10124 | $this->currPos = $p15; |
10125 | $r13 = self::$FAILED; |
10126 | goto seq_3; |
10127 | } |
10128 | $p21 = $this->currPos; |
10129 | // start choice_2 |
10130 | if (($this->input[$this->currPos] ?? null) === "|") { |
10131 | $this->currPos++; |
10132 | $r22 = "|"; |
10133 | goto choice_2; |
10134 | } else { |
10135 | $r22 = self::$FAILED; |
10136 | } |
10137 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10138 | $r22 = "}}}"; |
10139 | $this->currPos += 3; |
10140 | } else { |
10141 | $r22 = self::$FAILED; |
10142 | } |
10143 | choice_2: |
10144 | if ($r22!==self::$FAILED) { |
10145 | $r22 = false; |
10146 | $this->currPos = $p21; |
10147 | } else { |
10148 | $this->currPos = $p15; |
10149 | $r13 = self::$FAILED; |
10150 | goto seq_3; |
10151 | } |
10152 | // free $p21 |
10153 | $r13 = true; |
10154 | seq_3: |
10155 | if ($r13!==self::$FAILED) { |
10156 | $this->savedPos = $p14; |
10157 | $r13 = $this->a99($r5, $r7, $r16, $r18, $r19); |
10158 | goto choice_1; |
10159 | } |
10160 | // free $p15 |
10161 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
10162 | choice_1: |
10163 | // r <- $r13 |
10164 | if ($r13===self::$FAILED) { |
10165 | $this->currPos = $p11; |
10166 | $r9 = self::$FAILED; |
10167 | goto seq_2; |
10168 | } |
10169 | $r9 = true; |
10170 | seq_2: |
10171 | if ($r9!==self::$FAILED) { |
10172 | $this->savedPos = $p10; |
10173 | $r9 = $this->a100($r5, $r7, $r13); |
10174 | $r8[] = $r9; |
10175 | } else { |
10176 | break; |
10177 | } |
10178 | // free $p11 |
10179 | } |
10180 | // params <- $r8 |
10181 | // free $r9 |
10182 | for (;;) { |
10183 | $r23 = $this->discardnl_comment_space($silence); |
10184 | if ($r23===self::$FAILED) { |
10185 | break; |
10186 | } |
10187 | } |
10188 | // free $r23 |
10189 | $r9 = true; |
10190 | if ($r9===self::$FAILED) { |
10191 | $this->currPos = $p3; |
10192 | $r1 = self::$FAILED; |
10193 | goto seq_1; |
10194 | } |
10195 | // free $r9 |
10196 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10197 | if ($r9===self::$FAILED) { |
10198 | $this->currPos = $p3; |
10199 | $r1 = self::$FAILED; |
10200 | goto seq_1; |
10201 | } |
10202 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10203 | $r23 = "}}}"; |
10204 | $this->currPos += 3; |
10205 | } else { |
10206 | if (!$silence) {$this->fail(61);} |
10207 | $r23 = self::$FAILED; |
10208 | $this->currPos = $p3; |
10209 | $r1 = self::$FAILED; |
10210 | goto seq_1; |
10211 | } |
10212 | $r1 = true; |
10213 | seq_1: |
10214 | if ($r1!==self::$FAILED) { |
10215 | $this->savedPos = $p2; |
10216 | $r1 = $this->a101($r5, $r7, $r8); |
10217 | } |
10218 | // free $p3 |
10219 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10220 | $this->currPos, |
10221 | $r1, |
10222 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10223 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10224 | ); |
10225 | return $r1; |
10226 | } |
10227 | private function discardwikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
10228 | $key = json_encode([427, $boolParams & 0x1fff, $param_preproc, $param_th]); |
10229 | $bucket = $this->currPos; |
10230 | $cached = $this->cache[$bucket][$key] ?? null; |
10231 | if ($cached) { |
10232 | $this->currPos = $cached->nextPos; |
10233 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10234 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10235 | return $cached->result; |
10236 | } |
10237 | $saved_preproc=$param_preproc; |
10238 | $saved_th=$param_th; |
10239 | $p2 = $this->currPos; |
10240 | // start seq_1 |
10241 | $p3 = $this->currPos; |
10242 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10243 | $r4 = "[["; |
10244 | $this->currPos += 2; |
10245 | } else { |
10246 | if (!$silence) {$this->fail(41);} |
10247 | $r4 = self::$FAILED; |
10248 | $r1 = self::$FAILED; |
10249 | goto seq_1; |
10250 | } |
10251 | $p6 = $this->currPos; |
10252 | $r5 = ''; |
10253 | // spos <- $r5 |
10254 | if ($r5!==self::$FAILED) { |
10255 | $this->savedPos = $p6; |
10256 | $r5 = $this->a17(); |
10257 | } else { |
10258 | $this->currPos = $p3; |
10259 | $r1 = self::$FAILED; |
10260 | goto seq_1; |
10261 | } |
10262 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
10263 | if ($r7===self::$FAILED) { |
10264 | $r7 = null; |
10265 | } |
10266 | // target <- $r7 |
10267 | $p9 = $this->currPos; |
10268 | $r8 = ''; |
10269 | // tpos <- $r8 |
10270 | if ($r8!==self::$FAILED) { |
10271 | $this->savedPos = $p9; |
10272 | $r8 = $this->a107($r5, $r7); |
10273 | } else { |
10274 | $this->currPos = $p3; |
10275 | $r1 = self::$FAILED; |
10276 | goto seq_1; |
10277 | } |
10278 | $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
10279 | // lcs <- $r10 |
10280 | if ($r10===self::$FAILED) { |
10281 | $this->currPos = $p3; |
10282 | $r1 = self::$FAILED; |
10283 | goto seq_1; |
10284 | } |
10285 | $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10286 | if ($r11===self::$FAILED) { |
10287 | $this->currPos = $p3; |
10288 | $r1 = self::$FAILED; |
10289 | goto seq_1; |
10290 | } |
10291 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
10292 | $r12 = "]]"; |
10293 | $this->currPos += 2; |
10294 | } else { |
10295 | if (!$silence) {$this->fail(63);} |
10296 | $r12 = self::$FAILED; |
10297 | $this->currPos = $p3; |
10298 | $r1 = self::$FAILED; |
10299 | goto seq_1; |
10300 | } |
10301 | $r1 = true; |
10302 | seq_1: |
10303 | if ($r1!==self::$FAILED) { |
10304 | $this->savedPos = $p2; |
10305 | $r1 = $this->a108($r5, $r7, $r8, $r10); |
10306 | } |
10307 | // free $p3 |
10308 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10309 | $this->currPos, |
10310 | $r1, |
10311 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10312 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10313 | ); |
10314 | return $r1; |
10315 | } |
10316 | private function discardbroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
10317 | $key = json_encode([425, $boolParams & 0x1fff, $param_preproc, $param_th]); |
10318 | $bucket = $this->currPos; |
10319 | $cached = $this->cache[$bucket][$key] ?? null; |
10320 | if ($cached) { |
10321 | $this->currPos = $cached->nextPos; |
10322 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10323 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10324 | return $cached->result; |
10325 | } |
10326 | $saved_preproc=$param_preproc; |
10327 | $saved_th=$param_th; |
10328 | $p2 = $this->currPos; |
10329 | // start seq_1 |
10330 | $p3 = $this->currPos; |
10331 | $p4 = $this->currPos; |
10332 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10333 | $r5 = "[["; |
10334 | $this->currPos += 2; |
10335 | $r5 = false; |
10336 | $this->currPos = $p4; |
10337 | } else { |
10338 | $r5 = self::$FAILED; |
10339 | $r1 = self::$FAILED; |
10340 | goto seq_1; |
10341 | } |
10342 | // free $p4 |
10343 | $this->savedPos = $this->currPos; |
10344 | $r6 = $this->a109($param_preproc); |
10345 | if ($r6) { |
10346 | $r6 = false; |
10347 | } else { |
10348 | $r6 = self::$FAILED; |
10349 | $this->currPos = $p3; |
10350 | $r1 = self::$FAILED; |
10351 | goto seq_1; |
10352 | } |
10353 | // start seq_2 |
10354 | $p4 = $this->currPos; |
10355 | if (($this->input[$this->currPos] ?? null) === "[") { |
10356 | $this->currPos++; |
10357 | $r8 = "["; |
10358 | } else { |
10359 | if (!$silence) {$this->fail(19);} |
10360 | $r8 = self::$FAILED; |
10361 | $r7 = self::$FAILED; |
10362 | goto seq_2; |
10363 | } |
10364 | // start choice_1 |
10365 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
10366 | if ($r9!==self::$FAILED) { |
10367 | goto choice_1; |
10368 | } |
10369 | if (($this->input[$this->currPos] ?? null) === "[") { |
10370 | $this->currPos++; |
10371 | $r9 = "["; |
10372 | } else { |
10373 | if (!$silence) {$this->fail(19);} |
10374 | $r9 = self::$FAILED; |
10375 | } |
10376 | choice_1: |
10377 | if ($r9===self::$FAILED) { |
10378 | $this->currPos = $p4; |
10379 | $r7 = self::$FAILED; |
10380 | goto seq_2; |
10381 | } |
10382 | $r7 = [$r8,$r9]; |
10383 | seq_2: |
10384 | // a <- $r7 |
10385 | if ($r7===self::$FAILED) { |
10386 | $this->currPos = $p3; |
10387 | $r1 = self::$FAILED; |
10388 | goto seq_1; |
10389 | } |
10390 | // free $p4 |
10391 | $r1 = true; |
10392 | seq_1: |
10393 | if ($r1!==self::$FAILED) { |
10394 | $this->savedPos = $p2; |
10395 | $r1 = $this->a110($param_preproc, $r7); |
10396 | } |
10397 | // free $p3 |
10398 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10399 | $this->currPos, |
10400 | $r1, |
10401 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10402 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10403 | ); |
10404 | return $r1; |
10405 | } |
10406 | private function parsewellformed_extension_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10407 | $key = json_encode([444, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
10408 | $bucket = $this->currPos; |
10409 | $cached = $this->cache[$bucket][$key] ?? null; |
10410 | if ($cached) { |
10411 | $this->currPos = $cached->nextPos; |
10412 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10413 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10414 | return $cached->result; |
10415 | } |
10416 | $saved_preproc=$param_preproc; |
10417 | $saved_th=$param_th; |
10418 | $p2 = $this->currPos; |
10419 | // start seq_1 |
10420 | $p3 = $this->currPos; |
10421 | $r4 = $this->parsemaybe_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
10422 | // extToken <- $r4 |
10423 | if ($r4===self::$FAILED) { |
10424 | $r1 = self::$FAILED; |
10425 | goto seq_1; |
10426 | } |
10427 | $this->savedPos = $this->currPos; |
10428 | $r5 = $this->a111($r4); |
10429 | if ($r5) { |
10430 | $r5 = false; |
10431 | } else { |
10432 | $r5 = self::$FAILED; |
10433 | $this->currPos = $p3; |
10434 | $r1 = self::$FAILED; |
10435 | goto seq_1; |
10436 | } |
10437 | $r1 = true; |
10438 | seq_1: |
10439 | if ($r1!==self::$FAILED) { |
10440 | $this->savedPos = $p2; |
10441 | $r1 = $this->a112($r4); |
10442 | } |
10443 | // free $p3 |
10444 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10445 | $this->currPos, |
10446 | $r1, |
10447 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10448 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10449 | ); |
10450 | return $r1; |
10451 | } |
10452 | private function parsexmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10453 | $key = json_encode([458, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
10454 | $bucket = $this->currPos; |
10455 | $cached = $this->cache[$bucket][$key] ?? null; |
10456 | if ($cached) { |
10457 | $this->currPos = $cached->nextPos; |
10458 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10459 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10460 | return $cached->result; |
10461 | } |
10462 | $saved_preproc=$param_preproc; |
10463 | $saved_th=$param_th; |
10464 | $p2 = $this->currPos; |
10465 | // start seq_1 |
10466 | $p3 = $this->currPos; |
10467 | $r4 = $this->parsexmlish_start($silence); |
10468 | // start <- $r4 |
10469 | if ($r4===self::$FAILED) { |
10470 | $this->currPos = $p3; |
10471 | $r1 = self::$FAILED; |
10472 | goto seq_1; |
10473 | } |
10474 | $this->savedPos = $this->currPos; |
10475 | $r5 = $this->a113(/*annOrExtTag*/($boolParams & 0x2) !== 0, $r4); |
10476 | if ($r5) { |
10477 | $r5 = false; |
10478 | } else { |
10479 | $r5 = self::$FAILED; |
10480 | $this->currPos = $p3; |
10481 | $r1 = self::$FAILED; |
10482 | goto seq_1; |
10483 | } |
10484 | $r6 = $this->parsegeneric_newline_attributes($silence, $boolParams & ~0x140, $param_preproc, $param_th); |
10485 | // attribs <- $r6 |
10486 | if ($r6===self::$FAILED) { |
10487 | $this->currPos = $p3; |
10488 | $r1 = self::$FAILED; |
10489 | goto seq_1; |
10490 | } |
10491 | for (;;) { |
10492 | $r8 = $this->discardspace_or_newline_or_solidus($silence); |
10493 | if ($r8===self::$FAILED) { |
10494 | break; |
10495 | } |
10496 | } |
10497 | // free $r8 |
10498 | $r7 = true; |
10499 | if ($r7===self::$FAILED) { |
10500 | $this->currPos = $p3; |
10501 | $r1 = self::$FAILED; |
10502 | goto seq_1; |
10503 | } |
10504 | // free $r7 |
10505 | if (($this->input[$this->currPos] ?? null) === "/") { |
10506 | $this->currPos++; |
10507 | $r7 = "/"; |
10508 | } else { |
10509 | if (!$silence) {$this->fail(35);} |
10510 | $r7 = self::$FAILED; |
10511 | $r7 = null; |
10512 | } |
10513 | // selfclose <- $r7 |
10514 | for (;;) { |
10515 | $r9 = $this->discardspace($silence); |
10516 | if ($r9===self::$FAILED) { |
10517 | break; |
10518 | } |
10519 | } |
10520 | // free $r9 |
10521 | $r8 = true; |
10522 | if ($r8===self::$FAILED) { |
10523 | $this->currPos = $p3; |
10524 | $r1 = self::$FAILED; |
10525 | goto seq_1; |
10526 | } |
10527 | // free $r8 |
10528 | if (($this->input[$this->currPos] ?? null) === ">") { |
10529 | $this->currPos++; |
10530 | $r8 = ">"; |
10531 | } else { |
10532 | if (!$silence) {$this->fail(64);} |
10533 | $r8 = self::$FAILED; |
10534 | $this->currPos = $p3; |
10535 | $r1 = self::$FAILED; |
10536 | goto seq_1; |
10537 | } |
10538 | $r1 = true; |
10539 | seq_1: |
10540 | if ($r1!==self::$FAILED) { |
10541 | $this->savedPos = $p2; |
10542 | $r1 = $this->a114(/*annOrExtTag*/($boolParams & 0x2) !== 0, $r4, $r6, $r7); |
10543 | } |
10544 | // free $p3 |
10545 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10546 | $this->currPos, |
10547 | $r1, |
10548 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10549 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10550 | ); |
10551 | return $r1; |
10552 | } |
10553 | private function parseautourl($silence, $boolParams, &$param_preproc, &$param_th) { |
10554 | $key = json_encode([360, $boolParams & 0x1fff, $param_preproc, $param_th]); |
10555 | $bucket = $this->currPos; |
10556 | $cached = $this->cache[$bucket][$key] ?? null; |
10557 | if ($cached) { |
10558 | $this->currPos = $cached->nextPos; |
10559 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10560 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10561 | return $cached->result; |
10562 | } |
10563 | $saved_preproc=$param_preproc; |
10564 | $saved_th=$param_th; |
10565 | $p2 = $this->currPos; |
10566 | // start seq_1 |
10567 | $p3 = $this->currPos; |
10568 | $p4 = $this->currPos; |
10569 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
10570 | $r5 = "//"; |
10571 | $this->currPos += 2; |
10572 | } else { |
10573 | $r5 = self::$FAILED; |
10574 | } |
10575 | if ($r5 === self::$FAILED) { |
10576 | $r5 = false; |
10577 | } else { |
10578 | $r5 = self::$FAILED; |
10579 | $this->currPos = $p4; |
10580 | $r1 = self::$FAILED; |
10581 | goto seq_1; |
10582 | } |
10583 | // free $p4 |
10584 | $p4 = $this->currPos; |
10585 | // start seq_2 |
10586 | $p7 = $this->currPos; |
10587 | $r8 = $this->parseurl_protocol($silence); |
10588 | // proto <- $r8 |
10589 | if ($r8===self::$FAILED) { |
10590 | $r6 = self::$FAILED; |
10591 | goto seq_2; |
10592 | } |
10593 | // start choice_1 |
10594 | $r9 = $this->parseipv6urladdr($silence); |
10595 | if ($r9!==self::$FAILED) { |
10596 | goto choice_1; |
10597 | } |
10598 | $r9 = ''; |
10599 | choice_1: |
10600 | // addr <- $r9 |
10601 | if ($r9===self::$FAILED) { |
10602 | $this->currPos = $p7; |
10603 | $r6 = self::$FAILED; |
10604 | goto seq_2; |
10605 | } |
10606 | $r10 = []; |
10607 | for (;;) { |
10608 | $p12 = $this->currPos; |
10609 | // start seq_3 |
10610 | $p13 = $this->currPos; |
10611 | $p14 = $this->currPos; |
10612 | $r15 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
10613 | if ($r15 === self::$FAILED) { |
10614 | $r15 = false; |
10615 | } else { |
10616 | $r15 = self::$FAILED; |
10617 | $this->currPos = $p14; |
10618 | $r11 = self::$FAILED; |
10619 | goto seq_3; |
10620 | } |
10621 | // free $p14 |
10622 | // start choice_2 |
10623 | $r16 = $this->parseno_punctuation_char($silence); |
10624 | if ($r16!==self::$FAILED) { |
10625 | goto choice_2; |
10626 | } |
10627 | $r16 = $this->parsecomment($silence); |
10628 | if ($r16!==self::$FAILED) { |
10629 | goto choice_2; |
10630 | } |
10631 | $r16 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
10632 | if ($r16!==self::$FAILED) { |
10633 | goto choice_2; |
10634 | } |
10635 | $p14 = $this->currPos; |
10636 | // start seq_4 |
10637 | $p17 = $this->currPos; |
10638 | if (($this->input[$this->currPos] ?? null) === "'") { |
10639 | $this->currPos++; |
10640 | $r18 = "'"; |
10641 | } else { |
10642 | if (!$silence) {$this->fail(33);} |
10643 | $r18 = self::$FAILED; |
10644 | $r16 = self::$FAILED; |
10645 | goto seq_4; |
10646 | } |
10647 | $p19 = $this->currPos; |
10648 | if (($this->input[$this->currPos] ?? null) === "'") { |
10649 | $this->currPos++; |
10650 | $r20 = "'"; |
10651 | } else { |
10652 | $r20 = self::$FAILED; |
10653 | } |
10654 | if ($r20 === self::$FAILED) { |
10655 | $r20 = false; |
10656 | } else { |
10657 | $r20 = self::$FAILED; |
10658 | $this->currPos = $p19; |
10659 | $this->currPos = $p17; |
10660 | $r16 = self::$FAILED; |
10661 | goto seq_4; |
10662 | } |
10663 | // free $p19 |
10664 | $r16 = true; |
10665 | seq_4: |
10666 | if ($r16!==self::$FAILED) { |
10667 | $r16 = substr($this->input, $p14, $this->currPos - $p14); |
10668 | goto choice_2; |
10669 | } else { |
10670 | $r16 = self::$FAILED; |
10671 | } |
10672 | // free $p17 |
10673 | // free $p14 |
10674 | if (($this->input[$this->currPos] ?? null) === "{") { |
10675 | $this->currPos++; |
10676 | $r16 = "{"; |
10677 | goto choice_2; |
10678 | } else { |
10679 | if (!$silence) {$this->fail(29);} |
10680 | $r16 = self::$FAILED; |
10681 | } |
10682 | $p14 = $this->currPos; |
10683 | // start seq_5 |
10684 | $p17 = $this->currPos; |
10685 | $p19 = $this->currPos; |
10686 | // start seq_6 |
10687 | $p22 = $this->currPos; |
10688 | $r23 = $this->parseraw_htmlentity(true); |
10689 | // rhe <- $r23 |
10690 | if ($r23===self::$FAILED) { |
10691 | $r21 = self::$FAILED; |
10692 | goto seq_6; |
10693 | } |
10694 | $this->savedPos = $this->currPos; |
10695 | $r24 = $this->a115($r8, $r9, $r23); |
10696 | if ($r24) { |
10697 | $r24 = false; |
10698 | } else { |
10699 | $r24 = self::$FAILED; |
10700 | $this->currPos = $p22; |
10701 | $r21 = self::$FAILED; |
10702 | goto seq_6; |
10703 | } |
10704 | $r21 = true; |
10705 | seq_6: |
10706 | // free $p22 |
10707 | if ($r21 === self::$FAILED) { |
10708 | $r21 = false; |
10709 | } else { |
10710 | $r21 = self::$FAILED; |
10711 | $this->currPos = $p19; |
10712 | $r16 = self::$FAILED; |
10713 | goto seq_5; |
10714 | } |
10715 | // free $p19 |
10716 | // start choice_3 |
10717 | $p19 = $this->currPos; |
10718 | // start seq_7 |
10719 | $p22 = $this->currPos; |
10720 | $p26 = $this->currPos; |
10721 | if (($this->input[$this->currPos] ?? null) === "&") { |
10722 | $this->currPos++; |
10723 | $r27 = "&"; |
10724 | $r27 = false; |
10725 | $this->currPos = $p26; |
10726 | } else { |
10727 | $r27 = self::$FAILED; |
10728 | $r25 = self::$FAILED; |
10729 | goto seq_7; |
10730 | } |
10731 | // free $p26 |
10732 | $r28 = $this->parsehtmlentity($silence); |
10733 | // he <- $r28 |
10734 | if ($r28===self::$FAILED) { |
10735 | $this->currPos = $p22; |
10736 | $r25 = self::$FAILED; |
10737 | goto seq_7; |
10738 | } |
10739 | $r25 = true; |
10740 | seq_7: |
10741 | if ($r25!==self::$FAILED) { |
10742 | $this->savedPos = $p19; |
10743 | $r25 = $this->a9($r8, $r9, $r28); |
10744 | goto choice_3; |
10745 | } |
10746 | // free $p22 |
10747 | if (($this->input[$this->currPos] ?? null) === "&") { |
10748 | $this->currPos++; |
10749 | $r25 = "&"; |
10750 | } else { |
10751 | if (!$silence) {$this->fail(4);} |
10752 | $r25 = self::$FAILED; |
10753 | } |
10754 | choice_3: |
10755 | // r <- $r25 |
10756 | if ($r25===self::$FAILED) { |
10757 | $this->currPos = $p17; |
10758 | $r16 = self::$FAILED; |
10759 | goto seq_5; |
10760 | } |
10761 | $r16 = true; |
10762 | seq_5: |
10763 | if ($r16!==self::$FAILED) { |
10764 | $this->savedPos = $p14; |
10765 | $r16 = $this->a10($r8, $r9, $r25); |
10766 | } |
10767 | // free $p17 |
10768 | choice_2: |
10769 | // c <- $r16 |
10770 | if ($r16===self::$FAILED) { |
10771 | $this->currPos = $p13; |
10772 | $r11 = self::$FAILED; |
10773 | goto seq_3; |
10774 | } |
10775 | $r11 = true; |
10776 | seq_3: |
10777 | if ($r11!==self::$FAILED) { |
10778 | $this->savedPos = $p12; |
10779 | $r11 = $this->a11($r8, $r9, $r16); |
10780 | $r10[] = $r11; |
10781 | } else { |
10782 | break; |
10783 | } |
10784 | // free $p13 |
10785 | } |
10786 | // path <- $r10 |
10787 | // free $r11 |
10788 | $r6 = true; |
10789 | seq_2: |
10790 | // r <- $r6 |
10791 | if ($r6!==self::$FAILED) { |
10792 | $this->savedPos = $p4; |
10793 | $r6 = $this->a116($r8, $r9, $r10); |
10794 | } else { |
10795 | $this->currPos = $p3; |
10796 | $r1 = self::$FAILED; |
10797 | goto seq_1; |
10798 | } |
10799 | // free $p7 |
10800 | $this->savedPos = $this->currPos; |
10801 | $r11 = $this->a117($r6); |
10802 | if ($r11) { |
10803 | $r11 = false; |
10804 | } else { |
10805 | $r11 = self::$FAILED; |
10806 | $this->currPos = $p3; |
10807 | $r1 = self::$FAILED; |
10808 | goto seq_1; |
10809 | } |
10810 | $r1 = true; |
10811 | seq_1: |
10812 | if ($r1!==self::$FAILED) { |
10813 | $this->savedPos = $p2; |
10814 | $r1 = $this->a118($r6); |
10815 | } |
10816 | // free $p3 |
10817 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10818 | $this->currPos, |
10819 | $r1, |
10820 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10821 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10822 | ); |
10823 | return $r1; |
10824 | } |
10825 | private function parseautoref($silence) { |
10826 | $key = 350; |
10827 | $bucket = $this->currPos; |
10828 | $cached = $this->cache[$bucket][$key] ?? null; |
10829 | if ($cached) { |
10830 | $this->currPos = $cached->nextPos; |
10831 | |
10832 | return $cached->result; |
10833 | } |
10834 | |
10835 | $p2 = $this->currPos; |
10836 | // start seq_1 |
10837 | $p3 = $this->currPos; |
10838 | // start choice_1 |
10839 | $r4 = $this->parseRFC($silence); |
10840 | if ($r4!==self::$FAILED) { |
10841 | goto choice_1; |
10842 | } |
10843 | $r4 = $this->parsePMID($silence); |
10844 | choice_1: |
10845 | // ref <- $r4 |
10846 | if ($r4===self::$FAILED) { |
10847 | $r1 = self::$FAILED; |
10848 | goto seq_1; |
10849 | } |
10850 | $r5 = []; |
10851 | for (;;) { |
10852 | $r6 = $this->parsespace_or_nbsp($silence); |
10853 | if ($r6!==self::$FAILED) { |
10854 | $r5[] = $r6; |
10855 | } else { |
10856 | break; |
10857 | } |
10858 | } |
10859 | if (count($r5) === 0) { |
10860 | $r5 = self::$FAILED; |
10861 | } |
10862 | // sp <- $r5 |
10863 | if ($r5===self::$FAILED) { |
10864 | $this->currPos = $p3; |
10865 | $r1 = self::$FAILED; |
10866 | goto seq_1; |
10867 | } |
10868 | // free $r6 |
10869 | $p7 = $this->currPos; |
10870 | $r6 = self::$FAILED; |
10871 | for (;;) { |
10872 | $r8 = $this->input[$this->currPos] ?? ''; |
10873 | if (preg_match("/^[0-9]/", $r8)) { |
10874 | $this->currPos++; |
10875 | $r6 = true; |
10876 | } else { |
10877 | $r8 = self::$FAILED; |
10878 | if (!$silence) {$this->fail(65);} |
10879 | break; |
10880 | } |
10881 | } |
10882 | // identifier <- $r6 |
10883 | if ($r6!==self::$FAILED) { |
10884 | $r6 = substr($this->input, $p7, $this->currPos - $p7); |
10885 | } else { |
10886 | $r6 = self::$FAILED; |
10887 | $this->currPos = $p3; |
10888 | $r1 = self::$FAILED; |
10889 | goto seq_1; |
10890 | } |
10891 | // free $r8 |
10892 | // free $p7 |
10893 | $r8 = $this->discardend_of_word($silence); |
10894 | if ($r8===self::$FAILED) { |
10895 | $this->currPos = $p3; |
10896 | $r1 = self::$FAILED; |
10897 | goto seq_1; |
10898 | } |
10899 | $r1 = true; |
10900 | seq_1: |
10901 | if ($r1!==self::$FAILED) { |
10902 | $this->savedPos = $p2; |
10903 | $r1 = $this->a119($r4, $r5, $r6); |
10904 | } |
10905 | // free $p3 |
10906 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10907 | $this->currPos, |
10908 | $r1, |
10909 | self::$UNDEFINED, |
10910 | self::$UNDEFINED |
10911 | ); |
10912 | return $r1; |
10913 | } |
10914 | private function parseisbn($silence) { |
10915 | $key = 352; |
10916 | $bucket = $this->currPos; |
10917 | $cached = $this->cache[$bucket][$key] ?? null; |
10918 | if ($cached) { |
10919 | $this->currPos = $cached->nextPos; |
10920 | |
10921 | return $cached->result; |
10922 | } |
10923 | |
10924 | $p2 = $this->currPos; |
10925 | // start seq_1 |
10926 | $p3 = $this->currPos; |
10927 | $this->savedPos = $this->currPos; |
10928 | $r4 = $this->a120(); |
10929 | if ($r4) { |
10930 | $r4 = false; |
10931 | } else { |
10932 | $r4 = self::$FAILED; |
10933 | $r1 = self::$FAILED; |
10934 | goto seq_1; |
10935 | } |
10936 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "ISBN", $this->currPos, 4, false) === 0) { |
10937 | $r5 = "ISBN"; |
10938 | $this->currPos += 4; |
10939 | } else { |
10940 | if (!$silence) {$this->fail(66);} |
10941 | $r5 = self::$FAILED; |
10942 | $this->currPos = $p3; |
10943 | $r1 = self::$FAILED; |
10944 | goto seq_1; |
10945 | } |
10946 | $r6 = []; |
10947 | for (;;) { |
10948 | $r7 = $this->parsespace_or_nbsp($silence); |
10949 | if ($r7!==self::$FAILED) { |
10950 | $r6[] = $r7; |
10951 | } else { |
10952 | break; |
10953 | } |
10954 | } |
10955 | if (count($r6) === 0) { |
10956 | $r6 = self::$FAILED; |
10957 | } |
10958 | // sp <- $r6 |
10959 | if ($r6===self::$FAILED) { |
10960 | $this->currPos = $p3; |
10961 | $r1 = self::$FAILED; |
10962 | goto seq_1; |
10963 | } |
10964 | // free $r7 |
10965 | // start seq_2 |
10966 | $p8 = $this->currPos; |
10967 | $r9 = $this->input[$this->currPos] ?? ''; |
10968 | if (preg_match("/^[0-9]/", $r9)) { |
10969 | $this->currPos++; |
10970 | } else { |
10971 | $r9 = self::$FAILED; |
10972 | if (!$silence) {$this->fail(65);} |
10973 | $r7 = self::$FAILED; |
10974 | goto seq_2; |
10975 | } |
10976 | $r10 = []; |
10977 | for (;;) { |
10978 | // start seq_3 |
10979 | $p12 = $this->currPos; |
10980 | // start choice_1 |
10981 | $r13 = $this->parsespace_or_nbsp_or_dash($silence); |
10982 | if ($r13!==self::$FAILED) { |
10983 | goto choice_1; |
10984 | } |
10985 | $r13 = ''; |
10986 | choice_1: |
10987 | if ($r13===self::$FAILED) { |
10988 | $r11 = self::$FAILED; |
10989 | goto seq_3; |
10990 | } |
10991 | $r14 = $this->input[$this->currPos] ?? ''; |
10992 | if (preg_match("/^[0-9]/", $r14)) { |
10993 | $this->currPos++; |
10994 | } else { |
10995 | $r14 = self::$FAILED; |
10996 | if (!$silence) {$this->fail(65);} |
10997 | $this->currPos = $p12; |
10998 | $r11 = self::$FAILED; |
10999 | goto seq_3; |
11000 | } |
11001 | $r11 = [$r13,$r14]; |
11002 | seq_3: |
11003 | if ($r11!==self::$FAILED) { |
11004 | $r10[] = $r11; |
11005 | } else { |
11006 | break; |
11007 | } |
11008 | // free $p12 |
11009 | } |
11010 | if (count($r10) === 0) { |
11011 | $r10 = self::$FAILED; |
11012 | } |
11013 | if ($r10===self::$FAILED) { |
11014 | $this->currPos = $p8; |
11015 | $r7 = self::$FAILED; |
11016 | goto seq_2; |
11017 | } |
11018 | // free $r11 |
11019 | // start choice_2 |
11020 | // start seq_4 |
11021 | $p12 = $this->currPos; |
11022 | // start choice_3 |
11023 | $r15 = $this->parsespace_or_nbsp_or_dash($silence); |
11024 | if ($r15!==self::$FAILED) { |
11025 | goto choice_3; |
11026 | } |
11027 | $r15 = ''; |
11028 | choice_3: |
11029 | if ($r15===self::$FAILED) { |
11030 | $r11 = self::$FAILED; |
11031 | goto seq_4; |
11032 | } |
11033 | $r16 = $this->input[$this->currPos] ?? ''; |
11034 | if ($r16 === "x" || $r16 === "X") { |
11035 | $this->currPos++; |
11036 | } else { |
11037 | $r16 = self::$FAILED; |
11038 | if (!$silence) {$this->fail(67);} |
11039 | $this->currPos = $p12; |
11040 | $r11 = self::$FAILED; |
11041 | goto seq_4; |
11042 | } |
11043 | $r11 = [$r15,$r16]; |
11044 | seq_4: |
11045 | if ($r11!==self::$FAILED) { |
11046 | goto choice_2; |
11047 | } |
11048 | // free $p12 |
11049 | $r11 = ''; |
11050 | choice_2: |
11051 | if ($r11===self::$FAILED) { |
11052 | $this->currPos = $p8; |
11053 | $r7 = self::$FAILED; |
11054 | goto seq_2; |
11055 | } |
11056 | $r7 = [$r9,$r10,$r11]; |
11057 | seq_2: |
11058 | // isbn <- $r7 |
11059 | if ($r7===self::$FAILED) { |
11060 | $this->currPos = $p3; |
11061 | $r1 = self::$FAILED; |
11062 | goto seq_1; |
11063 | } |
11064 | // free $p8 |
11065 | $p8 = $this->currPos; |
11066 | $r17 = $this->discardend_of_word($silence); |
11067 | // isbncode <- $r17 |
11068 | if ($r17!==self::$FAILED) { |
11069 | $this->savedPos = $p8; |
11070 | $r17 = $this->a121($r6, $r7); |
11071 | } else { |
11072 | $this->currPos = $p3; |
11073 | $r1 = self::$FAILED; |
11074 | goto seq_1; |
11075 | } |
11076 | $this->savedPos = $this->currPos; |
11077 | $r18 = $this->a122($r6, $r7, $r17); |
11078 | if ($r18) { |
11079 | $r18 = false; |
11080 | } else { |
11081 | $r18 = self::$FAILED; |
11082 | $this->currPos = $p3; |
11083 | $r1 = self::$FAILED; |
11084 | goto seq_1; |
11085 | } |
11086 | $r1 = true; |
11087 | seq_1: |
11088 | if ($r1!==self::$FAILED) { |
11089 | $this->savedPos = $p2; |
11090 | $r1 = $this->a123($r6, $r7, $r17); |
11091 | } |
11092 | // free $p3 |
11093 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11094 | $this->currPos, |
11095 | $r1, |
11096 | self::$UNDEFINED, |
11097 | self::$UNDEFINED |
11098 | ); |
11099 | return $r1; |
11100 | } |
11101 | private function discardbehavior_text($silence) { |
11102 | $key = 341; |
11103 | $bucket = $this->currPos; |
11104 | $cached = $this->cache[$bucket][$key] ?? null; |
11105 | if ($cached) { |
11106 | $this->currPos = $cached->nextPos; |
11107 | |
11108 | return $cached->result; |
11109 | } |
11110 | |
11111 | $p1 = $this->currPos; |
11112 | $r2 = self::$FAILED; |
11113 | for (;;) { |
11114 | // start seq_1 |
11115 | $p4 = $this->currPos; |
11116 | $p5 = $this->currPos; |
11117 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
11118 | $r6 = "__"; |
11119 | $this->currPos += 2; |
11120 | } else { |
11121 | $r6 = self::$FAILED; |
11122 | } |
11123 | if ($r6 === self::$FAILED) { |
11124 | $r6 = false; |
11125 | } else { |
11126 | $r6 = self::$FAILED; |
11127 | $this->currPos = $p5; |
11128 | $r3 = self::$FAILED; |
11129 | goto seq_1; |
11130 | } |
11131 | // free $p5 |
11132 | // start choice_1 |
11133 | $r7 = $this->discardtext_char($silence); |
11134 | if ($r7!==self::$FAILED) { |
11135 | goto choice_1; |
11136 | } |
11137 | if (($this->input[$this->currPos] ?? null) === "-") { |
11138 | $this->currPos++; |
11139 | $r7 = "-"; |
11140 | } else { |
11141 | if (!$silence) {$this->fail(55);} |
11142 | $r7 = self::$FAILED; |
11143 | } |
11144 | choice_1: |
11145 | if ($r7===self::$FAILED) { |
11146 | $this->currPos = $p4; |
11147 | $r3 = self::$FAILED; |
11148 | goto seq_1; |
11149 | } |
11150 | $r3 = true; |
11151 | seq_1: |
11152 | if ($r3!==self::$FAILED) { |
11153 | $r2 = true; |
11154 | } else { |
11155 | break; |
11156 | } |
11157 | // free $p4 |
11158 | } |
11159 | if ($r2!==self::$FAILED) { |
11160 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
11161 | } else { |
11162 | $r2 = self::$FAILED; |
11163 | } |
11164 | // free $r3 |
11165 | // free $p1 |
11166 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11167 | $this->currPos, |
11168 | $r2, |
11169 | self::$UNDEFINED, |
11170 | self::$UNDEFINED |
11171 | ); |
11172 | return $r2; |
11173 | } |
11174 | private function parsemaybe_extension_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
11175 | $key = json_encode([442, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
11176 | $bucket = $this->currPos; |
11177 | $cached = $this->cache[$bucket][$key] ?? null; |
11178 | if ($cached) { |
11179 | $this->currPos = $cached->nextPos; |
11180 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11181 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11182 | return $cached->result; |
11183 | } |
11184 | $saved_preproc=$param_preproc; |
11185 | $saved_th=$param_th; |
11186 | $p2 = $this->currPos; |
11187 | // start seq_1 |
11188 | $p3 = $this->currPos; |
11189 | $p4 = $this->currPos; |
11190 | $r5 = $this->discardextension_check(true, $boolParams); |
11191 | if ($r5!==self::$FAILED) { |
11192 | $r5 = false; |
11193 | $this->currPos = $p4; |
11194 | } else { |
11195 | $r1 = self::$FAILED; |
11196 | goto seq_1; |
11197 | } |
11198 | // free $p4 |
11199 | $r6 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
11200 | // t <- $r6 |
11201 | if ($r6===self::$FAILED) { |
11202 | $this->currPos = $p3; |
11203 | $r1 = self::$FAILED; |
11204 | goto seq_1; |
11205 | } |
11206 | $r1 = true; |
11207 | seq_1: |
11208 | if ($r1!==self::$FAILED) { |
11209 | $this->savedPos = $p2; |
11210 | $r1 = $this->a124($r6); |
11211 | } |
11212 | // free $p3 |
11213 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11214 | $this->currPos, |
11215 | $r1, |
11216 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11217 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11218 | ); |
11219 | return $r1; |
11220 | } |
11221 | private function parselang_variant($silence, $boolParams, &$param_th, &$param_preproc) { |
11222 | $key = json_encode([394, $boolParams & 0x1ff7, $param_th, $param_preproc]); |
11223 | $bucket = $this->currPos; |
11224 | $cached = $this->cache[$bucket][$key] ?? null; |
11225 | if ($cached) { |
11226 | $this->currPos = $cached->nextPos; |
11227 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11228 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11229 | return $cached->result; |
11230 | } |
11231 | $saved_th=$param_th; |
11232 | $saved_preproc=$param_preproc; |
11233 | // start choice_1 |
11234 | $r1 = $this->parselang_variant_preproc($silence, $boolParams & ~0x8, self::newRef("}-"), $param_th); |
11235 | if ($r1!==self::$FAILED) { |
11236 | goto choice_1; |
11237 | } |
11238 | $r1 = $this->parsebroken_lang_variant($silence, $param_preproc); |
11239 | choice_1: |
11240 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11241 | $this->currPos, |
11242 | $r1, |
11243 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11244 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11245 | ); |
11246 | return $r1; |
11247 | } |
11248 | private function parsewikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
11249 | $key = json_encode([426, $boolParams & 0x1fff, $param_preproc, $param_th]); |
11250 | $bucket = $this->currPos; |
11251 | $cached = $this->cache[$bucket][$key] ?? null; |
11252 | if ($cached) { |
11253 | $this->currPos = $cached->nextPos; |
11254 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11255 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11256 | return $cached->result; |
11257 | } |
11258 | $saved_preproc=$param_preproc; |
11259 | $saved_th=$param_th; |
11260 | $p2 = $this->currPos; |
11261 | // start seq_1 |
11262 | $p3 = $this->currPos; |
11263 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
11264 | $r4 = "[["; |
11265 | $this->currPos += 2; |
11266 | } else { |
11267 | if (!$silence) {$this->fail(41);} |
11268 | $r4 = self::$FAILED; |
11269 | $r1 = self::$FAILED; |
11270 | goto seq_1; |
11271 | } |
11272 | $p6 = $this->currPos; |
11273 | $r5 = ''; |
11274 | // spos <- $r5 |
11275 | if ($r5!==self::$FAILED) { |
11276 | $this->savedPos = $p6; |
11277 | $r5 = $this->a17(); |
11278 | } else { |
11279 | $this->currPos = $p3; |
11280 | $r1 = self::$FAILED; |
11281 | goto seq_1; |
11282 | } |
11283 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
11284 | if ($r7===self::$FAILED) { |
11285 | $r7 = null; |
11286 | } |
11287 | // target <- $r7 |
11288 | $p9 = $this->currPos; |
11289 | $r8 = ''; |
11290 | // tpos <- $r8 |
11291 | if ($r8!==self::$FAILED) { |
11292 | $this->savedPos = $p9; |
11293 | $r8 = $this->a107($r5, $r7); |
11294 | } else { |
11295 | $this->currPos = $p3; |
11296 | $r1 = self::$FAILED; |
11297 | goto seq_1; |
11298 | } |
11299 | $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
11300 | // lcs <- $r10 |
11301 | if ($r10===self::$FAILED) { |
11302 | $this->currPos = $p3; |
11303 | $r1 = self::$FAILED; |
11304 | goto seq_1; |
11305 | } |
11306 | $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
11307 | if ($r11===self::$FAILED) { |
11308 | $this->currPos = $p3; |
11309 | $r1 = self::$FAILED; |
11310 | goto seq_1; |
11311 | } |
11312 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
11313 | $r12 = "]]"; |
11314 | $this->currPos += 2; |
11315 | } else { |
11316 | if (!$silence) {$this->fail(63);} |
11317 | $r12 = self::$FAILED; |
11318 | $this->currPos = $p3; |
11319 | $r1 = self::$FAILED; |
11320 | goto seq_1; |
11321 | } |
11322 | $r1 = true; |
11323 | seq_1: |
11324 | if ($r1!==self::$FAILED) { |
11325 | $this->savedPos = $p2; |
11326 | $r1 = $this->a108($r5, $r7, $r8, $r10); |
11327 | } |
11328 | // free $p3 |
11329 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11330 | $this->currPos, |
11331 | $r1, |
11332 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11333 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11334 | ); |
11335 | return $r1; |
11336 | } |
11337 | private function parsebroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
11338 | $key = json_encode([424, $boolParams & 0x1fff, $param_preproc, $param_th]); |
11339 | $bucket = $this->currPos; |
11340 | $cached = $this->cache[$bucket][$key] ?? null; |
11341 | if ($cached) { |
11342 | $this->currPos = $cached->nextPos; |
11343 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11344 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11345 | return $cached->result; |
11346 | } |
11347 | $saved_preproc=$param_preproc; |
11348 | $saved_th=$param_th; |
11349 | $p2 = $this->currPos; |
11350 | // start seq_1 |
11351 | $p3 = $this->currPos; |
11352 | $p4 = $this->currPos; |
11353 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
11354 | $r5 = "[["; |
11355 | $this->currPos += 2; |
11356 | $r5 = false; |
11357 | $this->currPos = $p4; |
11358 | } else { |
11359 | $r5 = self::$FAILED; |
11360 | $r1 = self::$FAILED; |
11361 | goto seq_1; |
11362 | } |
11363 | // free $p4 |
11364 | $this->savedPos = $this->currPos; |
11365 | $r6 = $this->a109($param_preproc); |
11366 | if ($r6) { |
11367 | $r6 = false; |
11368 | } else { |
11369 | $r6 = self::$FAILED; |
11370 | $this->currPos = $p3; |
11371 | $r1 = self::$FAILED; |
11372 | goto seq_1; |
11373 | } |
11374 | // start seq_2 |
11375 | $p4 = $this->currPos; |
11376 | if (($this->input[$this->currPos] ?? null) === "[") { |
11377 | $this->currPos++; |
11378 | $r8 = "["; |
11379 | } else { |
11380 | if (!$silence) {$this->fail(19);} |
11381 | $r8 = self::$FAILED; |
11382 | $r7 = self::$FAILED; |
11383 | goto seq_2; |
11384 | } |
11385 | // start choice_1 |
11386 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
11387 | if ($r9!==self::$FAILED) { |
11388 | goto choice_1; |
11389 | } |
11390 | if (($this->input[$this->currPos] ?? null) === "[") { |
11391 | $this->currPos++; |
11392 | $r9 = "["; |
11393 | } else { |
11394 | if (!$silence) {$this->fail(19);} |
11395 | $r9 = self::$FAILED; |
11396 | } |
11397 | choice_1: |
11398 | if ($r9===self::$FAILED) { |
11399 | $this->currPos = $p4; |
11400 | $r7 = self::$FAILED; |
11401 | goto seq_2; |
11402 | } |
11403 | $r7 = [$r8,$r9]; |
11404 | seq_2: |
11405 | // a <- $r7 |
11406 | if ($r7===self::$FAILED) { |
11407 | $this->currPos = $p3; |
11408 | $r1 = self::$FAILED; |
11409 | goto seq_1; |
11410 | } |
11411 | // free $p4 |
11412 | $r1 = true; |
11413 | seq_1: |
11414 | if ($r1!==self::$FAILED) { |
11415 | $this->savedPos = $p2; |
11416 | $r1 = $this->a110($param_preproc, $r7); |
11417 | } |
11418 | // free $p3 |
11419 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11420 | $this->currPos, |
11421 | $r1, |
11422 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11423 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11424 | ); |
11425 | return $r1; |
11426 | } |
11427 | private function parsetable_heading_tags($silence, $boolParams, &$param_preproc) { |
11428 | $key = json_encode([504, $boolParams & 0x1fff, $param_preproc]); |
11429 | $bucket = $this->currPos; |
11430 | $cached = $this->cache[$bucket][$key] ?? null; |
11431 | if ($cached) { |
11432 | $this->currPos = $cached->nextPos; |
11433 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11434 | return $cached->result; |
11435 | } |
11436 | $saved_preproc=$param_preproc; |
11437 | $r1 = $this->parsetable_heading_tags_parameterized($silence, $boolParams, $param_preproc, self::newRef(true)); |
11438 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11439 | $this->currPos, |
11440 | $r1, |
11441 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11442 | self::$UNDEFINED |
11443 | ); |
11444 | return $r1; |
11445 | } |
11446 | private function parsetable_row_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
11447 | $key = json_encode([502, $boolParams & 0x1fbf, $param_preproc, $param_th]); |
11448 | $bucket = $this->currPos; |
11449 | $cached = $this->cache[$bucket][$key] ?? null; |
11450 | if ($cached) { |
11451 | $this->currPos = $cached->nextPos; |
11452 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11453 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11454 | return $cached->result; |
11455 | } |
11456 | $saved_preproc=$param_preproc; |
11457 | $saved_th=$param_th; |
11458 | $p2 = $this->currPos; |
11459 | // start seq_1 |
11460 | $p3 = $this->currPos; |
11461 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11462 | $r4 = false; |
11463 | } else { |
11464 | $r4 = self::$FAILED; |
11465 | $r1 = self::$FAILED; |
11466 | goto seq_1; |
11467 | } |
11468 | $r5 = $this->parsepipe($silence); |
11469 | // p <- $r5 |
11470 | if ($r5===self::$FAILED) { |
11471 | $this->currPos = $p3; |
11472 | $r1 = self::$FAILED; |
11473 | goto seq_1; |
11474 | } |
11475 | $p7 = $this->currPos; |
11476 | $r6 = self::$FAILED; |
11477 | for (;;) { |
11478 | if (($this->input[$this->currPos] ?? null) === "-") { |
11479 | $this->currPos++; |
11480 | $r8 = "-"; |
11481 | $r6 = true; |
11482 | } else { |
11483 | if (!$silence) {$this->fail(55);} |
11484 | $r8 = self::$FAILED; |
11485 | break; |
11486 | } |
11487 | } |
11488 | // dashes <- $r6 |
11489 | if ($r6!==self::$FAILED) { |
11490 | $r6 = substr($this->input, $p7, $this->currPos - $p7); |
11491 | } else { |
11492 | $r6 = self::$FAILED; |
11493 | $this->currPos = $p3; |
11494 | $r1 = self::$FAILED; |
11495 | goto seq_1; |
11496 | } |
11497 | // free $r8 |
11498 | // free $p7 |
11499 | // start choice_1 |
11500 | $r8 = $this->parsetable_attributes($silence, $boolParams & ~0x40, $param_preproc, $param_th); |
11501 | if ($r8!==self::$FAILED) { |
11502 | goto choice_1; |
11503 | } |
11504 | $this->savedPos = $this->currPos; |
11505 | $r8 = $this->a125($r5, $r6); |
11506 | if ($r8) { |
11507 | $r8 = false; |
11508 | } else { |
11509 | $r8 = self::$FAILED; |
11510 | } |
11511 | choice_1: |
11512 | // a <- $r8 |
11513 | if ($r8===self::$FAILED) { |
11514 | $this->currPos = $p3; |
11515 | $r1 = self::$FAILED; |
11516 | goto seq_1; |
11517 | } |
11518 | $p7 = $this->currPos; |
11519 | $r9 = ''; |
11520 | // tagEndPos <- $r9 |
11521 | if ($r9!==self::$FAILED) { |
11522 | $this->savedPos = $p7; |
11523 | $r9 = $this->a126($r5, $r6, $r8); |
11524 | } else { |
11525 | $this->currPos = $p3; |
11526 | $r1 = self::$FAILED; |
11527 | goto seq_1; |
11528 | } |
11529 | $r10 = []; |
11530 | for (;;) { |
11531 | $r11 = $this->parsespace($silence); |
11532 | if ($r11!==self::$FAILED) { |
11533 | $r10[] = $r11; |
11534 | } else { |
11535 | break; |
11536 | } |
11537 | } |
11538 | // s2 <- $r10 |
11539 | // free $r11 |
11540 | $r1 = true; |
11541 | seq_1: |
11542 | if ($r1!==self::$FAILED) { |
11543 | $this->savedPos = $p2; |
11544 | $r1 = $this->a127($r5, $r6, $r8, $r9, $r10); |
11545 | } |
11546 | // free $p3 |
11547 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11548 | $this->currPos, |
11549 | $r1, |
11550 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11551 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11552 | ); |
11553 | return $r1; |
11554 | } |
11555 | private function parsetable_data_tags($silence, $boolParams, &$param_preproc, &$param_th) { |
11556 | $key = json_encode([512, $boolParams & 0x1fff, $param_preproc, $param_th]); |
11557 | $bucket = $this->currPos; |
11558 | $cached = $this->cache[$bucket][$key] ?? null; |
11559 | if ($cached) { |
11560 | $this->currPos = $cached->nextPos; |
11561 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11562 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11563 | return $cached->result; |
11564 | } |
11565 | $saved_preproc=$param_preproc; |
11566 | $saved_th=$param_th; |
11567 | $p2 = $this->currPos; |
11568 | // start seq_1 |
11569 | $p3 = $this->currPos; |
11570 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11571 | $r4 = false; |
11572 | } else { |
11573 | $r4 = self::$FAILED; |
11574 | $r1 = self::$FAILED; |
11575 | goto seq_1; |
11576 | } |
11577 | $r5 = $this->parsepipe($silence); |
11578 | // p <- $r5 |
11579 | if ($r5===self::$FAILED) { |
11580 | $this->currPos = $p3; |
11581 | $r1 = self::$FAILED; |
11582 | goto seq_1; |
11583 | } |
11584 | $p6 = $this->currPos; |
11585 | $r7 = $this->input[$this->currPos] ?? ''; |
11586 | if ($r7 === "+" || $r7 === "-") { |
11587 | $this->currPos++; |
11588 | } else { |
11589 | $r7 = self::$FAILED; |
11590 | } |
11591 | if ($r7 === self::$FAILED) { |
11592 | $r7 = false; |
11593 | } else { |
11594 | $r7 = self::$FAILED; |
11595 | $this->currPos = $p6; |
11596 | $this->currPos = $p3; |
11597 | $r1 = self::$FAILED; |
11598 | goto seq_1; |
11599 | } |
11600 | // free $p6 |
11601 | $r8 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th); |
11602 | // td <- $r8 |
11603 | if ($r8===self::$FAILED) { |
11604 | $this->currPos = $p3; |
11605 | $r1 = self::$FAILED; |
11606 | goto seq_1; |
11607 | } |
11608 | $r9 = $this->parsetds($silence, $boolParams, $param_preproc, $param_th); |
11609 | // tds <- $r9 |
11610 | if ($r9===self::$FAILED) { |
11611 | $this->currPos = $p3; |
11612 | $r1 = self::$FAILED; |
11613 | goto seq_1; |
11614 | } |
11615 | $r1 = true; |
11616 | seq_1: |
11617 | if ($r1!==self::$FAILED) { |
11618 | $this->savedPos = $p2; |
11619 | $r1 = $this->a128($r5, $r8, $r9); |
11620 | } |
11621 | // free $p3 |
11622 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11623 | $this->currPos, |
11624 | $r1, |
11625 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11626 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11627 | ); |
11628 | return $r1; |
11629 | } |
11630 | private function parsetable_caption_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
11631 | $key = json_encode([500, $boolParams & 0x1fff, $param_preproc, $param_th]); |
11632 | $bucket = $this->currPos; |
11633 | $cached = $this->cache[$bucket][$key] ?? null; |
11634 | if ($cached) { |
11635 | $this->currPos = $cached->nextPos; |
11636 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11637 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11638 | return $cached->result; |
11639 | } |
11640 | $saved_preproc=$param_preproc; |
11641 | $saved_th=$param_th; |
11642 | $p2 = $this->currPos; |
11643 | // start seq_1 |
11644 | $p3 = $this->currPos; |
11645 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
11646 | $r4 = false; |
11647 | } else { |
11648 | $r4 = self::$FAILED; |
11649 | $r1 = self::$FAILED; |
11650 | goto seq_1; |
11651 | } |
11652 | $r5 = $this->parsepipe($silence); |
11653 | // p <- $r5 |
11654 | if ($r5===self::$FAILED) { |
11655 | $this->currPos = $p3; |
11656 | $r1 = self::$FAILED; |
11657 | goto seq_1; |
11658 | } |
11659 | if (($this->input[$this->currPos] ?? null) === "+") { |
11660 | $this->currPos++; |
11661 | $r6 = "+"; |
11662 | } else { |
11663 | if (!$silence) {$this->fail(68);} |
11664 | $r6 = self::$FAILED; |
11665 | $this->currPos = $p3; |
11666 | $r1 = self::$FAILED; |
11667 | goto seq_1; |
11668 | } |
11669 | $r7 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
11670 | if ($r7===self::$FAILED) { |
11671 | $r7 = null; |
11672 | } |
11673 | // args <- $r7 |
11674 | $p9 = $this->currPos; |
11675 | $r8 = ''; |
11676 | // tagEndPos <- $r8 |
11677 | if ($r8!==self::$FAILED) { |
11678 | $this->savedPos = $p9; |
11679 | $r8 = $this->a129($r5, $r7); |
11680 | } else { |
11681 | $this->currPos = $p3; |
11682 | $r1 = self::$FAILED; |
11683 | goto seq_1; |
11684 | } |
11685 | $r10 = []; |
11686 | for (;;) { |
11687 | $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
11688 | if ($r11!==self::$FAILED) { |
11689 | $r10[] = $r11; |
11690 | } else { |
11691 | break; |
11692 | } |
11693 | } |
11694 | // c <- $r10 |
11695 | // free $r11 |
11696 | $r1 = true; |
11697 | seq_1: |
11698 | if ($r1!==self::$FAILED) { |
11699 | $this->savedPos = $p2; |
11700 | $r1 = $this->a130($r5, $r7, $r8, $r10); |
11701 | } |
11702 | // free $p3 |
11703 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11704 | $this->currPos, |
11705 | $r1, |
11706 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11707 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11708 | ); |
11709 | return $r1; |
11710 | } |
11711 | private function parsenewline($silence) { |
11712 | $key = 566; |
11713 | $bucket = $this->currPos; |
11714 | $cached = $this->cache[$bucket][$key] ?? null; |
11715 | if ($cached) { |
11716 | $this->currPos = $cached->nextPos; |
11717 | |
11718 | return $cached->result; |
11719 | } |
11720 | |
11721 | // start choice_1 |
11722 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
11723 | $this->currPos++; |
11724 | $r1 = "\x0a"; |
11725 | goto choice_1; |
11726 | } else { |
11727 | if (!$silence) {$this->fail(27);} |
11728 | $r1 = self::$FAILED; |
11729 | } |
11730 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
11731 | $r1 = "\x0d\x0a"; |
11732 | $this->currPos += 2; |
11733 | } else { |
11734 | if (!$silence) {$this->fail(28);} |
11735 | $r1 = self::$FAILED; |
11736 | } |
11737 | choice_1: |
11738 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11739 | $this->currPos, |
11740 | $r1, |
11741 | self::$UNDEFINED, |
11742 | self::$UNDEFINED |
11743 | ); |
11744 | return $r1; |
11745 | } |
11746 | private function discardinclude_check($silence, $boolParams) { |
11747 | $key = json_encode([531, $boolParams & 0x2]); |
11748 | $bucket = $this->currPos; |
11749 | $cached = $this->cache[$bucket][$key] ?? null; |
11750 | if ($cached) { |
11751 | $this->currPos = $cached->nextPos; |
11752 | |
11753 | return $cached->result; |
11754 | } |
11755 | |
11756 | // start seq_1 |
11757 | $p1 = $this->currPos; |
11758 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
11759 | $r3 = false; |
11760 | } else { |
11761 | $r3 = self::$FAILED; |
11762 | $r2 = self::$FAILED; |
11763 | goto seq_1; |
11764 | } |
11765 | $r4 = $this->parsexmlish_start($silence); |
11766 | // start <- $r4 |
11767 | if ($r4===self::$FAILED) { |
11768 | $this->currPos = $p1; |
11769 | $r2 = self::$FAILED; |
11770 | goto seq_1; |
11771 | } |
11772 | $this->savedPos = $this->currPos; |
11773 | $r5 = $this->a131($r4); |
11774 | if ($r5) { |
11775 | $r5 = false; |
11776 | } else { |
11777 | $r5 = self::$FAILED; |
11778 | $this->currPos = $p1; |
11779 | $r2 = self::$FAILED; |
11780 | goto seq_1; |
11781 | } |
11782 | $r2 = true; |
11783 | seq_1: |
11784 | // free $r2,$p1 |
11785 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11786 | $this->currPos, |
11787 | $r2, |
11788 | self::$UNDEFINED, |
11789 | self::$UNDEFINED |
11790 | ); |
11791 | return $r2; |
11792 | } |
11793 | private function parsetvar_old_syntax_closing_HACK($silence, $boolParams) { |
11794 | $key = json_encode([434, $boolParams & 0x2]); |
11795 | $bucket = $this->currPos; |
11796 | $cached = $this->cache[$bucket][$key] ?? null; |
11797 | if ($cached) { |
11798 | $this->currPos = $cached->nextPos; |
11799 | |
11800 | return $cached->result; |
11801 | } |
11802 | |
11803 | $p2 = $this->currPos; |
11804 | // start seq_1 |
11805 | $p3 = $this->currPos; |
11806 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
11807 | $r4 = false; |
11808 | } else { |
11809 | $r4 = self::$FAILED; |
11810 | $r1 = self::$FAILED; |
11811 | goto seq_1; |
11812 | } |
11813 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "</>", $this->currPos, 3, false) === 0) { |
11814 | $r5 = "</>"; |
11815 | $this->currPos += 3; |
11816 | } else { |
11817 | if (!$silence) {$this->fail(69);} |
11818 | $r5 = self::$FAILED; |
11819 | $this->currPos = $p3; |
11820 | $r1 = self::$FAILED; |
11821 | goto seq_1; |
11822 | } |
11823 | $this->savedPos = $this->currPos; |
11824 | $r6 = $this->a132(); |
11825 | if ($r6) { |
11826 | $r6 = false; |
11827 | } else { |
11828 | $r6 = self::$FAILED; |
11829 | $this->currPos = $p3; |
11830 | $r1 = self::$FAILED; |
11831 | goto seq_1; |
11832 | } |
11833 | $r1 = true; |
11834 | seq_1: |
11835 | if ($r1!==self::$FAILED) { |
11836 | $this->savedPos = $p2; |
11837 | $r1 = $this->a133(); |
11838 | } |
11839 | // free $p3 |
11840 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11841 | $this->currPos, |
11842 | $r1, |
11843 | self::$UNDEFINED, |
11844 | self::$UNDEFINED |
11845 | ); |
11846 | return $r1; |
11847 | } |
11848 | private function discardannotation_check($silence, $boolParams) { |
11849 | $key = json_encode([437, $boolParams & 0x2]); |
11850 | $bucket = $this->currPos; |
11851 | $cached = $this->cache[$bucket][$key] ?? null; |
11852 | if ($cached) { |
11853 | $this->currPos = $cached->nextPos; |
11854 | |
11855 | return $cached->result; |
11856 | } |
11857 | |
11858 | // start seq_1 |
11859 | $p1 = $this->currPos; |
11860 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
11861 | $r3 = false; |
11862 | } else { |
11863 | $r3 = self::$FAILED; |
11864 | $r2 = self::$FAILED; |
11865 | goto seq_1; |
11866 | } |
11867 | $r4 = $this->parsexmlish_start($silence); |
11868 | // start <- $r4 |
11869 | if ($r4===self::$FAILED) { |
11870 | $this->currPos = $p1; |
11871 | $r2 = self::$FAILED; |
11872 | goto seq_1; |
11873 | } |
11874 | $this->savedPos = $this->currPos; |
11875 | $r5 = $this->a134($r4); |
11876 | if ($r5) { |
11877 | $r5 = false; |
11878 | } else { |
11879 | $r5 = self::$FAILED; |
11880 | $this->currPos = $p1; |
11881 | $r2 = self::$FAILED; |
11882 | goto seq_1; |
11883 | } |
11884 | $r2 = true; |
11885 | seq_1: |
11886 | // free $r2,$p1 |
11887 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11888 | $this->currPos, |
11889 | $r2, |
11890 | self::$UNDEFINED, |
11891 | self::$UNDEFINED |
11892 | ); |
11893 | return $r2; |
11894 | } |
11895 | private function discardsol($silence, $boolParams, &$param_preproc, &$param_th) { |
11896 | $key = json_encode([591, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
11897 | $bucket = $this->currPos; |
11898 | $cached = $this->cache[$bucket][$key] ?? null; |
11899 | if ($cached) { |
11900 | $this->currPos = $cached->nextPos; |
11901 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11902 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11903 | return $cached->result; |
11904 | } |
11905 | $saved_preproc=$param_preproc; |
11906 | $saved_th=$param_th; |
11907 | $p2 = $this->currPos; |
11908 | // start seq_1 |
11909 | $p3 = $this->currPos; |
11910 | $r4 = $this->parsesol_prefix($silence); |
11911 | // sp <- $r4 |
11912 | if ($r4===self::$FAILED) { |
11913 | $r1 = self::$FAILED; |
11914 | goto seq_1; |
11915 | } |
11916 | $r5 = $this->parseempty_lines_with_comments($silence); |
11917 | if ($r5===self::$FAILED) { |
11918 | $r5 = null; |
11919 | } |
11920 | // elc <- $r5 |
11921 | $r6 = []; |
11922 | for (;;) { |
11923 | $r7 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
11924 | if ($r7!==self::$FAILED) { |
11925 | $r6[] = $r7; |
11926 | } else { |
11927 | break; |
11928 | } |
11929 | } |
11930 | // st <- $r6 |
11931 | // free $r7 |
11932 | $r1 = true; |
11933 | seq_1: |
11934 | if ($r1!==self::$FAILED) { |
11935 | $this->savedPos = $p2; |
11936 | $r1 = $this->a69($r4, $r5, $r6); |
11937 | } |
11938 | // free $p3 |
11939 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11940 | $this->currPos, |
11941 | $r1, |
11942 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11943 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11944 | ); |
11945 | return $r1; |
11946 | } |
11947 | private function parsetemplate_param_value($silence, $boolParams, &$param_preproc, &$param_th) { |
11948 | $key = json_encode([386, $boolParams & 0x1e17, $param_preproc, $param_th]); |
11949 | $bucket = $this->currPos; |
11950 | $cached = $this->cache[$bucket][$key] ?? null; |
11951 | if ($cached) { |
11952 | $this->currPos = $cached->nextPos; |
11953 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
11954 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
11955 | return $cached->result; |
11956 | } |
11957 | $saved_preproc=$param_preproc; |
11958 | $saved_th=$param_th; |
11959 | $p2 = $this->currPos; |
11960 | $r3 = $this->parsetemplate_param_text($silence, $boolParams & ~0x20, $param_preproc, $param_th); |
11961 | // tpt <- $r3 |
11962 | $r1 = $r3; |
11963 | if ($r1!==self::$FAILED) { |
11964 | $this->savedPos = $p2; |
11965 | $r1 = $this->a135($r3); |
11966 | } |
11967 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11968 | $this->currPos, |
11969 | $r1, |
11970 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
11971 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
11972 | ); |
11973 | return $r1; |
11974 | } |
11975 | private function discardnl_comment_space($silence) { |
11976 | $key = 575; |
11977 | $bucket = $this->currPos; |
11978 | $cached = $this->cache[$bucket][$key] ?? null; |
11979 | if ($cached) { |
11980 | $this->currPos = $cached->nextPos; |
11981 | |
11982 | return $cached->result; |
11983 | } |
11984 | |
11985 | // start choice_1 |
11986 | $r1 = $this->discardnewlineToken($silence); |
11987 | if ($r1!==self::$FAILED) { |
11988 | goto choice_1; |
11989 | } |
11990 | $r1 = $this->discardspace($silence); |
11991 | if ($r1!==self::$FAILED) { |
11992 | goto choice_1; |
11993 | } |
11994 | $r1 = $this->discardcomment($silence); |
11995 | choice_1: |
11996 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
11997 | $this->currPos, |
11998 | $r1, |
11999 | self::$UNDEFINED, |
12000 | self::$UNDEFINED |
12001 | ); |
12002 | return $r1; |
12003 | } |
12004 | private function parsenl_comment_space($silence) { |
12005 | $key = 574; |
12006 | $bucket = $this->currPos; |
12007 | $cached = $this->cache[$bucket][$key] ?? null; |
12008 | if ($cached) { |
12009 | $this->currPos = $cached->nextPos; |
12010 | |
12011 | return $cached->result; |
12012 | } |
12013 | |
12014 | // start choice_1 |
12015 | $r1 = $this->parsenewlineToken($silence); |
12016 | if ($r1!==self::$FAILED) { |
12017 | goto choice_1; |
12018 | } |
12019 | $r1 = $this->parsespace($silence); |
12020 | if ($r1!==self::$FAILED) { |
12021 | goto choice_1; |
12022 | } |
12023 | $r1 = $this->parsecomment($silence); |
12024 | choice_1: |
12025 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12026 | $this->currPos, |
12027 | $r1, |
12028 | self::$UNDEFINED, |
12029 | self::$UNDEFINED |
12030 | ); |
12031 | return $r1; |
12032 | } |
12033 | private function parseparsoid_fragment_marker($silence) { |
12034 | $key = 376; |
12035 | $bucket = $this->currPos; |
12036 | $cached = $this->cache[$bucket][$key] ?? null; |
12037 | if ($cached) { |
12038 | $this->currPos = $cached->nextPos; |
12039 | |
12040 | return $cached->result; |
12041 | } |
12042 | |
12043 | $p1 = $this->currPos; |
12044 | // start seq_1 |
12045 | $p3 = $this->currPos; |
12046 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "#parsoid\x00fragment:", $this->currPos, 18, false) === 0) { |
12047 | $r4 = "#parsoid\x00fragment:"; |
12048 | $this->currPos += 18; |
12049 | } else { |
12050 | if (!$silence) {$this->fail(70);} |
12051 | $r4 = self::$FAILED; |
12052 | $r2 = self::$FAILED; |
12053 | goto seq_1; |
12054 | } |
12055 | $r5 = self::$FAILED; |
12056 | for (;;) { |
12057 | $r6 = $this->input[$this->currPos] ?? ''; |
12058 | if (preg_match("/^[0-9]/", $r6)) { |
12059 | $this->currPos++; |
12060 | $r5 = true; |
12061 | } else { |
12062 | $r6 = self::$FAILED; |
12063 | if (!$silence) {$this->fail(65);} |
12064 | break; |
12065 | } |
12066 | } |
12067 | if ($r5===self::$FAILED) { |
12068 | $this->currPos = $p3; |
12069 | $r2 = self::$FAILED; |
12070 | goto seq_1; |
12071 | } |
12072 | // free $r6 |
12073 | $r2 = true; |
12074 | seq_1: |
12075 | if ($r2!==self::$FAILED) { |
12076 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
12077 | } else { |
12078 | $r2 = self::$FAILED; |
12079 | } |
12080 | // free $p3 |
12081 | // free $p1 |
12082 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12083 | $this->currPos, |
12084 | $r2, |
12085 | self::$UNDEFINED, |
12086 | self::$UNDEFINED |
12087 | ); |
12088 | return $r2; |
12089 | } |
12090 | private function parsetemplate_param($silence, $boolParams, &$param_preproc, &$param_th) { |
12091 | $key = json_encode([382, $boolParams & 0x1e17, $param_preproc, $param_th]); |
12092 | $bucket = $this->currPos; |
12093 | $cached = $this->cache[$bucket][$key] ?? null; |
12094 | if ($cached) { |
12095 | $this->currPos = $cached->nextPos; |
12096 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12097 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12098 | return $cached->result; |
12099 | } |
12100 | $saved_preproc=$param_preproc; |
12101 | $saved_th=$param_th; |
12102 | // start choice_1 |
12103 | $p2 = $this->currPos; |
12104 | // start seq_1 |
12105 | $p3 = $this->currPos; |
12106 | $r4 = $this->parsetemplate_param_name($silence, $boolParams, $param_preproc, $param_th); |
12107 | // name <- $r4 |
12108 | if ($r4===self::$FAILED) { |
12109 | $r1 = self::$FAILED; |
12110 | goto seq_1; |
12111 | } |
12112 | $p6 = $this->currPos; |
12113 | // start seq_2 |
12114 | $p7 = $this->currPos; |
12115 | $p9 = $this->currPos; |
12116 | $r8 = ''; |
12117 | // kEndPos <- $r8 |
12118 | if ($r8!==self::$FAILED) { |
12119 | $this->savedPos = $p9; |
12120 | $r8 = $this->a136($r4); |
12121 | } else { |
12122 | $r5 = self::$FAILED; |
12123 | goto seq_2; |
12124 | } |
12125 | if (($this->input[$this->currPos] ?? null) === "=") { |
12126 | $this->currPos++; |
12127 | $r10 = "="; |
12128 | } else { |
12129 | if (!$silence) {$this->fail(23);} |
12130 | $r10 = self::$FAILED; |
12131 | $this->currPos = $p7; |
12132 | $r5 = self::$FAILED; |
12133 | goto seq_2; |
12134 | } |
12135 | $p12 = $this->currPos; |
12136 | $r11 = ''; |
12137 | // vStartPos <- $r11 |
12138 | if ($r11!==self::$FAILED) { |
12139 | $this->savedPos = $p12; |
12140 | $r11 = $this->a137($r4, $r8); |
12141 | } else { |
12142 | $this->currPos = $p7; |
12143 | $r5 = self::$FAILED; |
12144 | goto seq_2; |
12145 | } |
12146 | $r13 = $this->parseoptionalSpaceToken($silence); |
12147 | // optSp <- $r13 |
12148 | if ($r13===self::$FAILED) { |
12149 | $this->currPos = $p7; |
12150 | $r5 = self::$FAILED; |
12151 | goto seq_2; |
12152 | } |
12153 | $r14 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
12154 | if ($r14===self::$FAILED) { |
12155 | $r14 = null; |
12156 | } |
12157 | // tpv <- $r14 |
12158 | $r5 = true; |
12159 | seq_2: |
12160 | if ($r5!==self::$FAILED) { |
12161 | $this->savedPos = $p6; |
12162 | $r5 = $this->a138($r4, $r8, $r11, $r13, $r14); |
12163 | } else { |
12164 | $r5 = null; |
12165 | } |
12166 | // free $p7 |
12167 | // val <- $r5 |
12168 | $r1 = true; |
12169 | seq_1: |
12170 | if ($r1!==self::$FAILED) { |
12171 | $this->savedPos = $p2; |
12172 | $r1 = $this->a139($r4, $r5); |
12173 | goto choice_1; |
12174 | } |
12175 | // free $p3 |
12176 | $p3 = $this->currPos; |
12177 | $p7 = $this->currPos; |
12178 | $r1 = $this->input[$this->currPos] ?? ''; |
12179 | if ($r1 === "|" || $r1 === "}") { |
12180 | $this->currPos++; |
12181 | $r1 = false; |
12182 | $this->currPos = $p7; |
12183 | $this->savedPos = $p3; |
12184 | $r1 = $this->a140(); |
12185 | } else { |
12186 | $r1 = self::$FAILED; |
12187 | } |
12188 | // free $p7 |
12189 | choice_1: |
12190 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12191 | $this->currPos, |
12192 | $r1, |
12193 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12194 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12195 | ); |
12196 | return $r1; |
12197 | } |
12198 | private function parsewikilink_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
12199 | $key = json_encode([536, $boolParams & 0x1fff, $param_preproc, $param_th]); |
12200 | $bucket = $this->currPos; |
12201 | $cached = $this->cache[$bucket][$key] ?? null; |
12202 | if ($cached) { |
12203 | $this->currPos = $cached->nextPos; |
12204 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12205 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12206 | return $cached->result; |
12207 | } |
12208 | $saved_preproc=$param_preproc; |
12209 | $saved_th=$param_th; |
12210 | $p2 = $this->currPos; |
12211 | $r3 = []; |
12212 | for (;;) { |
12213 | // start choice_1 |
12214 | $p6 = $this->currPos; |
12215 | $r5 = self::$FAILED; |
12216 | for (;;) { |
12217 | if (strcspn($this->input, "<[{\x0a\x0d\x09|!]}{ &-", $this->currPos, 1) !== 0) { |
12218 | $r7 = self::consumeChar($this->input, $this->currPos); |
12219 | $r5 = true; |
12220 | } else { |
12221 | $r7 = self::$FAILED; |
12222 | if (!$silence) {$this->fail(71);} |
12223 | break; |
12224 | } |
12225 | } |
12226 | // t <- $r5 |
12227 | if ($r5!==self::$FAILED) { |
12228 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
12229 | } else { |
12230 | $r5 = self::$FAILED; |
12231 | } |
12232 | // free $r7 |
12233 | // free $p6 |
12234 | $r4 = $r5; |
12235 | if ($r4!==self::$FAILED) { |
12236 | goto choice_1; |
12237 | } |
12238 | $p6 = $this->currPos; |
12239 | // start seq_1 |
12240 | $p8 = $this->currPos; |
12241 | $p9 = $this->currPos; |
12242 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
12243 | if ($r7 === self::$FAILED) { |
12244 | $r7 = false; |
12245 | } else { |
12246 | $r7 = self::$FAILED; |
12247 | $this->currPos = $p9; |
12248 | $r4 = self::$FAILED; |
12249 | goto seq_1; |
12250 | } |
12251 | // free $p9 |
12252 | // start choice_2 |
12253 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
12254 | if ($r10!==self::$FAILED) { |
12255 | goto choice_2; |
12256 | } |
12257 | $p9 = $this->currPos; |
12258 | // start seq_2 |
12259 | $p11 = $this->currPos; |
12260 | $p12 = $this->currPos; |
12261 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
12262 | $r13 = "]]"; |
12263 | $this->currPos += 2; |
12264 | } else { |
12265 | $r13 = self::$FAILED; |
12266 | } |
12267 | if ($r13 === self::$FAILED) { |
12268 | $r13 = false; |
12269 | } else { |
12270 | $r13 = self::$FAILED; |
12271 | $this->currPos = $p12; |
12272 | $r10 = self::$FAILED; |
12273 | goto seq_2; |
12274 | } |
12275 | // free $p12 |
12276 | // start choice_3 |
12277 | $r14 = $this->discardtext_char($silence); |
12278 | if ($r14!==self::$FAILED) { |
12279 | goto choice_3; |
12280 | } |
12281 | if (strspn($this->input, "!<-}]\x0a\x0d", $this->currPos, 1) !== 0) { |
12282 | $r14 = $this->input[$this->currPos++]; |
12283 | } else { |
12284 | $r14 = self::$FAILED; |
12285 | if (!$silence) {$this->fail(72);} |
12286 | } |
12287 | choice_3: |
12288 | if ($r14===self::$FAILED) { |
12289 | $this->currPos = $p11; |
12290 | $r10 = self::$FAILED; |
12291 | goto seq_2; |
12292 | } |
12293 | $r10 = true; |
12294 | seq_2: |
12295 | if ($r10!==self::$FAILED) { |
12296 | $r10 = substr($this->input, $p9, $this->currPos - $p9); |
12297 | } else { |
12298 | $r10 = self::$FAILED; |
12299 | } |
12300 | // free $p11 |
12301 | // free $p9 |
12302 | choice_2: |
12303 | // wr <- $r10 |
12304 | if ($r10===self::$FAILED) { |
12305 | $this->currPos = $p8; |
12306 | $r4 = self::$FAILED; |
12307 | goto seq_1; |
12308 | } |
12309 | $r4 = true; |
12310 | seq_1: |
12311 | if ($r4!==self::$FAILED) { |
12312 | $this->savedPos = $p6; |
12313 | $r4 = $this->a141($r5, $r10); |
12314 | } |
12315 | // free $p8 |
12316 | choice_1: |
12317 | if ($r4!==self::$FAILED) { |
12318 | $r3[] = $r4; |
12319 | } else { |
12320 | break; |
12321 | } |
12322 | } |
12323 | if (count($r3) === 0) { |
12324 | $r3 = self::$FAILED; |
12325 | } |
12326 | // r <- $r3 |
12327 | // free $r4 |
12328 | $r1 = $r3; |
12329 | if ($r1!==self::$FAILED) { |
12330 | $this->savedPos = $p2; |
12331 | $r1 = $this->a142($r3); |
12332 | } |
12333 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12334 | $this->currPos, |
12335 | $r1, |
12336 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12337 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12338 | ); |
12339 | return $r1; |
12340 | } |
12341 | private function parsewikilink_content($silence, $boolParams, &$param_preproc, &$param_th) { |
12342 | $key = json_encode([420, $boolParams & 0x17df, $param_preproc, $param_th]); |
12343 | $bucket = $this->currPos; |
12344 | $cached = $this->cache[$bucket][$key] ?? null; |
12345 | if ($cached) { |
12346 | $this->currPos = $cached->nextPos; |
12347 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12348 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12349 | return $cached->result; |
12350 | } |
12351 | $saved_preproc=$param_preproc; |
12352 | $saved_th=$param_th; |
12353 | $r1 = []; |
12354 | for (;;) { |
12355 | $p3 = $this->currPos; |
12356 | // start seq_1 |
12357 | $p4 = $this->currPos; |
12358 | $r5 = $this->discardpipe($silence); |
12359 | if ($r5===self::$FAILED) { |
12360 | $r2 = self::$FAILED; |
12361 | goto seq_1; |
12362 | } |
12363 | $p7 = $this->currPos; |
12364 | $r6 = ''; |
12365 | // startPos <- $r6 |
12366 | if ($r6!==self::$FAILED) { |
12367 | $this->savedPos = $p7; |
12368 | $r6 = $this->a17(); |
12369 | } else { |
12370 | $this->currPos = $p4; |
12371 | $r2 = self::$FAILED; |
12372 | goto seq_1; |
12373 | } |
12374 | $r8 = $this->parselink_text($silence, $boolParams, $param_preproc, $param_th); |
12375 | if ($r8===self::$FAILED) { |
12376 | $r8 = null; |
12377 | } |
12378 | // lt <- $r8 |
12379 | $r2 = true; |
12380 | seq_1: |
12381 | if ($r2!==self::$FAILED) { |
12382 | $this->savedPos = $p3; |
12383 | $r2 = $this->a143($r6, $r8); |
12384 | $r1[] = $r2; |
12385 | } else { |
12386 | break; |
12387 | } |
12388 | // free $p4 |
12389 | } |
12390 | // free $r2 |
12391 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12392 | $this->currPos, |
12393 | $r1, |
12394 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12395 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12396 | ); |
12397 | return $r1; |
12398 | } |
12399 | private function parsexmlish_start($silence) { |
12400 | $key = 456; |
12401 | $bucket = $this->currPos; |
12402 | $cached = $this->cache[$bucket][$key] ?? null; |
12403 | if ($cached) { |
12404 | $this->currPos = $cached->nextPos; |
12405 | |
12406 | return $cached->result; |
12407 | } |
12408 | |
12409 | $p2 = $this->currPos; |
12410 | // start seq_1 |
12411 | $p3 = $this->currPos; |
12412 | if (($this->input[$this->currPos] ?? null) === "<") { |
12413 | $this->currPos++; |
12414 | $r4 = "<"; |
12415 | } else { |
12416 | if (!$silence) {$this->fail(48);} |
12417 | $r4 = self::$FAILED; |
12418 | $r1 = self::$FAILED; |
12419 | goto seq_1; |
12420 | } |
12421 | if (($this->input[$this->currPos] ?? null) === "/") { |
12422 | $this->currPos++; |
12423 | $r5 = "/"; |
12424 | } else { |
12425 | if (!$silence) {$this->fail(35);} |
12426 | $r5 = self::$FAILED; |
12427 | $r5 = null; |
12428 | } |
12429 | // end <- $r5 |
12430 | $r6 = $this->parsetag_name($silence); |
12431 | // name <- $r6 |
12432 | if ($r6===self::$FAILED) { |
12433 | $this->currPos = $p3; |
12434 | $r1 = self::$FAILED; |
12435 | goto seq_1; |
12436 | } |
12437 | $r1 = true; |
12438 | seq_1: |
12439 | if ($r1!==self::$FAILED) { |
12440 | $this->savedPos = $p2; |
12441 | $r1 = $this->a144($r5, $r6); |
12442 | } |
12443 | // free $p3 |
12444 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12445 | $this->currPos, |
12446 | $r1, |
12447 | self::$UNDEFINED, |
12448 | self::$UNDEFINED |
12449 | ); |
12450 | return $r1; |
12451 | } |
12452 | private function parseRFC($silence) { |
12453 | $key = 346; |
12454 | $bucket = $this->currPos; |
12455 | $cached = $this->cache[$bucket][$key] ?? null; |
12456 | if ($cached) { |
12457 | $this->currPos = $cached->nextPos; |
12458 | |
12459 | return $cached->result; |
12460 | } |
12461 | |
12462 | $p2 = $this->currPos; |
12463 | // start seq_1 |
12464 | $p3 = $this->currPos; |
12465 | $this->savedPos = $this->currPos; |
12466 | $r4 = $this->a145(); |
12467 | if ($r4) { |
12468 | $r4 = false; |
12469 | } else { |
12470 | $r4 = self::$FAILED; |
12471 | $r1 = self::$FAILED; |
12472 | goto seq_1; |
12473 | } |
12474 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "RFC", $this->currPos, 3, false) === 0) { |
12475 | $r5 = "RFC"; |
12476 | $this->currPos += 3; |
12477 | } else { |
12478 | if (!$silence) {$this->fail(73);} |
12479 | $r5 = self::$FAILED; |
12480 | $this->currPos = $p3; |
12481 | $r1 = self::$FAILED; |
12482 | goto seq_1; |
12483 | } |
12484 | $r1 = true; |
12485 | seq_1: |
12486 | if ($r1!==self::$FAILED) { |
12487 | $this->savedPos = $p2; |
12488 | $r1 = $this->a146(); |
12489 | } |
12490 | // free $p3 |
12491 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12492 | $this->currPos, |
12493 | $r1, |
12494 | self::$UNDEFINED, |
12495 | self::$UNDEFINED |
12496 | ); |
12497 | return $r1; |
12498 | } |
12499 | private function parsePMID($silence) { |
12500 | $key = 348; |
12501 | $bucket = $this->currPos; |
12502 | $cached = $this->cache[$bucket][$key] ?? null; |
12503 | if ($cached) { |
12504 | $this->currPos = $cached->nextPos; |
12505 | |
12506 | return $cached->result; |
12507 | } |
12508 | |
12509 | $p2 = $this->currPos; |
12510 | // start seq_1 |
12511 | $p3 = $this->currPos; |
12512 | $this->savedPos = $this->currPos; |
12513 | $r4 = $this->a147(); |
12514 | if ($r4) { |
12515 | $r4 = false; |
12516 | } else { |
12517 | $r4 = self::$FAILED; |
12518 | $r1 = self::$FAILED; |
12519 | goto seq_1; |
12520 | } |
12521 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "PMID", $this->currPos, 4, false) === 0) { |
12522 | $r5 = "PMID"; |
12523 | $this->currPos += 4; |
12524 | } else { |
12525 | if (!$silence) {$this->fail(74);} |
12526 | $r5 = self::$FAILED; |
12527 | $this->currPos = $p3; |
12528 | $r1 = self::$FAILED; |
12529 | goto seq_1; |
12530 | } |
12531 | $r1 = true; |
12532 | seq_1: |
12533 | if ($r1!==self::$FAILED) { |
12534 | $this->savedPos = $p2; |
12535 | $r1 = $this->a148(); |
12536 | } |
12537 | // free $p3 |
12538 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12539 | $this->currPos, |
12540 | $r1, |
12541 | self::$UNDEFINED, |
12542 | self::$UNDEFINED |
12543 | ); |
12544 | return $r1; |
12545 | } |
12546 | private function parsespace_or_nbsp($silence) { |
12547 | $key = 584; |
12548 | $bucket = $this->currPos; |
12549 | $cached = $this->cache[$bucket][$key] ?? null; |
12550 | if ($cached) { |
12551 | $this->currPos = $cached->nextPos; |
12552 | |
12553 | return $cached->result; |
12554 | } |
12555 | |
12556 | // start choice_1 |
12557 | $r1 = $this->parsespace($silence); |
12558 | if ($r1!==self::$FAILED) { |
12559 | goto choice_1; |
12560 | } |
12561 | $r1 = $this->parseunispace($silence); |
12562 | if ($r1!==self::$FAILED) { |
12563 | goto choice_1; |
12564 | } |
12565 | $p2 = $this->currPos; |
12566 | // start seq_1 |
12567 | $p3 = $this->currPos; |
12568 | $p4 = $this->currPos; |
12569 | if (($this->input[$this->currPos] ?? null) === "&") { |
12570 | $this->currPos++; |
12571 | $r5 = "&"; |
12572 | $r5 = false; |
12573 | $this->currPos = $p4; |
12574 | } else { |
12575 | $r5 = self::$FAILED; |
12576 | $r1 = self::$FAILED; |
12577 | goto seq_1; |
12578 | } |
12579 | // free $p4 |
12580 | $r6 = $this->parsehtmlentity($silence); |
12581 | // he <- $r6 |
12582 | if ($r6===self::$FAILED) { |
12583 | $this->currPos = $p3; |
12584 | $r1 = self::$FAILED; |
12585 | goto seq_1; |
12586 | } |
12587 | $this->savedPos = $this->currPos; |
12588 | $r7 = $this->a149($r6); |
12589 | if ($r7) { |
12590 | $r7 = false; |
12591 | } else { |
12592 | $r7 = self::$FAILED; |
12593 | $this->currPos = $p3; |
12594 | $r1 = self::$FAILED; |
12595 | goto seq_1; |
12596 | } |
12597 | $r1 = true; |
12598 | seq_1: |
12599 | if ($r1!==self::$FAILED) { |
12600 | $this->savedPos = $p2; |
12601 | $r1 = $this->a64($r6); |
12602 | } |
12603 | // free $p3 |
12604 | choice_1: |
12605 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12606 | $this->currPos, |
12607 | $r1, |
12608 | self::$UNDEFINED, |
12609 | self::$UNDEFINED |
12610 | ); |
12611 | return $r1; |
12612 | } |
12613 | private function discardend_of_word($silence) { |
12614 | $key = 581; |
12615 | $bucket = $this->currPos; |
12616 | $cached = $this->cache[$bucket][$key] ?? null; |
12617 | if ($cached) { |
12618 | $this->currPos = $cached->nextPos; |
12619 | |
12620 | return $cached->result; |
12621 | } |
12622 | |
12623 | // start choice_1 |
12624 | $r1 = $this->discardeof($silence); |
12625 | if ($r1!==self::$FAILED) { |
12626 | goto choice_1; |
12627 | } |
12628 | $p2 = $this->currPos; |
12629 | $r1 = $this->input[$this->currPos] ?? ''; |
12630 | if (preg_match("/^[A-Za-z0-9_]/", $r1)) { |
12631 | $this->currPos++; |
12632 | } else { |
12633 | $r1 = self::$FAILED; |
12634 | } |
12635 | if ($r1 === self::$FAILED) { |
12636 | $r1 = false; |
12637 | } else { |
12638 | $r1 = self::$FAILED; |
12639 | $this->currPos = $p2; |
12640 | } |
12641 | // free $p2 |
12642 | choice_1: |
12643 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12644 | $this->currPos, |
12645 | $r1, |
12646 | self::$UNDEFINED, |
12647 | self::$UNDEFINED |
12648 | ); |
12649 | return $r1; |
12650 | } |
12651 | private function parsespace_or_nbsp_or_dash($silence) { |
12652 | $key = 586; |
12653 | $bucket = $this->currPos; |
12654 | $cached = $this->cache[$bucket][$key] ?? null; |
12655 | if ($cached) { |
12656 | $this->currPos = $cached->nextPos; |
12657 | |
12658 | return $cached->result; |
12659 | } |
12660 | |
12661 | // start choice_1 |
12662 | $r1 = $this->parsespace_or_nbsp($silence); |
12663 | if ($r1!==self::$FAILED) { |
12664 | goto choice_1; |
12665 | } |
12666 | if (($this->input[$this->currPos] ?? null) === "-") { |
12667 | $this->currPos++; |
12668 | $r1 = "-"; |
12669 | } else { |
12670 | if (!$silence) {$this->fail(55);} |
12671 | $r1 = self::$FAILED; |
12672 | } |
12673 | choice_1: |
12674 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12675 | $this->currPos, |
12676 | $r1, |
12677 | self::$UNDEFINED, |
12678 | self::$UNDEFINED |
12679 | ); |
12680 | return $r1; |
12681 | } |
12682 | private function discardtext_char($silence) { |
12683 | $key = 523; |
12684 | $bucket = $this->currPos; |
12685 | $cached = $this->cache[$bucket][$key] ?? null; |
12686 | if ($cached) { |
12687 | $this->currPos = $cached->nextPos; |
12688 | |
12689 | return $cached->result; |
12690 | } |
12691 | |
12692 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
12693 | $r1 = self::consumeChar($this->input, $this->currPos); |
12694 | } else { |
12695 | $r1 = self::$FAILED; |
12696 | if (!$silence) {$this->fail(54);} |
12697 | } |
12698 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12699 | $this->currPos, |
12700 | $r1, |
12701 | self::$UNDEFINED, |
12702 | self::$UNDEFINED |
12703 | ); |
12704 | return $r1; |
12705 | } |
12706 | private function discardextension_check($silence, $boolParams) { |
12707 | $key = json_encode([441, $boolParams & 0x2]); |
12708 | $bucket = $this->currPos; |
12709 | $cached = $this->cache[$bucket][$key] ?? null; |
12710 | if ($cached) { |
12711 | $this->currPos = $cached->nextPos; |
12712 | |
12713 | return $cached->result; |
12714 | } |
12715 | |
12716 | // start seq_1 |
12717 | $p1 = $this->currPos; |
12718 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
12719 | $r3 = false; |
12720 | } else { |
12721 | $r3 = self::$FAILED; |
12722 | $r2 = self::$FAILED; |
12723 | goto seq_1; |
12724 | } |
12725 | $r4 = $this->parsexmlish_start($silence); |
12726 | // start <- $r4 |
12727 | if ($r4===self::$FAILED) { |
12728 | $this->currPos = $p1; |
12729 | $r2 = self::$FAILED; |
12730 | goto seq_1; |
12731 | } |
12732 | $this->savedPos = $this->currPos; |
12733 | $r5 = $this->a150($r4); |
12734 | if ($r5) { |
12735 | $r5 = false; |
12736 | } else { |
12737 | $r5 = self::$FAILED; |
12738 | $this->currPos = $p1; |
12739 | $r2 = self::$FAILED; |
12740 | goto seq_1; |
12741 | } |
12742 | $r2 = true; |
12743 | seq_1: |
12744 | // free $r2,$p1 |
12745 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12746 | $this->currPos, |
12747 | $r2, |
12748 | self::$UNDEFINED, |
12749 | self::$UNDEFINED |
12750 | ); |
12751 | return $r2; |
12752 | } |
12753 | private function parselang_variant_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
12754 | $key = json_encode([396, $boolParams & 0x1fff, $param_preproc, $param_th]); |
12755 | $bucket = $this->currPos; |
12756 | $cached = $this->cache[$bucket][$key] ?? null; |
12757 | if ($cached) { |
12758 | $this->currPos = $cached->nextPos; |
12759 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12760 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12761 | return $cached->result; |
12762 | } |
12763 | $saved_preproc=$param_preproc; |
12764 | $saved_th=$param_th; |
12765 | $p2 = $this->currPos; |
12766 | // start seq_1 |
12767 | $p3 = $this->currPos; |
12768 | $p5 = $this->currPos; |
12769 | // lv0 <- $r4 |
12770 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
12771 | $r4 = "-{"; |
12772 | $this->currPos += 2; |
12773 | $this->savedPos = $p5; |
12774 | $r4 = $this->a151(); |
12775 | } else { |
12776 | if (!$silence) {$this->fail(75);} |
12777 | $r4 = self::$FAILED; |
12778 | $r1 = self::$FAILED; |
12779 | goto seq_1; |
12780 | } |
12781 | // start choice_1 |
12782 | $p7 = $this->currPos; |
12783 | // start seq_2 |
12784 | $p8 = $this->currPos; |
12785 | $this->savedPos = $this->currPos; |
12786 | $r9 = $this->a152($r4); |
12787 | if ($r9) { |
12788 | $r9 = false; |
12789 | } else { |
12790 | $r9 = self::$FAILED; |
12791 | $r6 = self::$FAILED; |
12792 | goto seq_2; |
12793 | } |
12794 | $r10 = $this->parseopt_lang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
12795 | // ff <- $r10 |
12796 | if ($r10===self::$FAILED) { |
12797 | $this->currPos = $p8; |
12798 | $r6 = self::$FAILED; |
12799 | goto seq_2; |
12800 | } |
12801 | $r6 = true; |
12802 | seq_2: |
12803 | if ($r6!==self::$FAILED) { |
12804 | $this->savedPos = $p7; |
12805 | $r6 = $this->a153($r4, $r10); |
12806 | goto choice_1; |
12807 | } |
12808 | // free $p8 |
12809 | $p8 = $this->currPos; |
12810 | // start seq_3 |
12811 | $p11 = $this->currPos; |
12812 | $this->savedPos = $this->currPos; |
12813 | $r12 = $this->a154($r4); |
12814 | if ($r12) { |
12815 | $r12 = false; |
12816 | } else { |
12817 | $r12 = self::$FAILED; |
12818 | $r6 = self::$FAILED; |
12819 | goto seq_3; |
12820 | } |
12821 | $r6 = true; |
12822 | seq_3: |
12823 | if ($r6!==self::$FAILED) { |
12824 | $this->savedPos = $p8; |
12825 | $r6 = $this->a155($r4); |
12826 | } |
12827 | // free $p11 |
12828 | choice_1: |
12829 | // f <- $r6 |
12830 | if ($r6===self::$FAILED) { |
12831 | $this->currPos = $p3; |
12832 | $r1 = self::$FAILED; |
12833 | goto seq_1; |
12834 | } |
12835 | // start choice_2 |
12836 | $p11 = $this->currPos; |
12837 | // start seq_4 |
12838 | $p14 = $this->currPos; |
12839 | $this->savedPos = $this->currPos; |
12840 | $r15 = $this->a156($r4, $r6); |
12841 | if ($r15) { |
12842 | $r15 = false; |
12843 | } else { |
12844 | $r15 = self::$FAILED; |
12845 | $r13 = self::$FAILED; |
12846 | goto seq_4; |
12847 | } |
12848 | $r16 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
12849 | // lv <- $r16 |
12850 | if ($r16===self::$FAILED) { |
12851 | $this->currPos = $p14; |
12852 | $r13 = self::$FAILED; |
12853 | goto seq_4; |
12854 | } |
12855 | $r13 = true; |
12856 | seq_4: |
12857 | if ($r13!==self::$FAILED) { |
12858 | $this->savedPos = $p11; |
12859 | $r13 = $this->a157($r4, $r6, $r16); |
12860 | goto choice_2; |
12861 | } |
12862 | // free $p14 |
12863 | $p14 = $this->currPos; |
12864 | // start seq_5 |
12865 | $p17 = $this->currPos; |
12866 | $this->savedPos = $this->currPos; |
12867 | $r18 = $this->a158($r4, $r6); |
12868 | if ($r18) { |
12869 | $r18 = false; |
12870 | } else { |
12871 | $r18 = self::$FAILED; |
12872 | $r13 = self::$FAILED; |
12873 | goto seq_5; |
12874 | } |
12875 | $r19 = $this->parselang_variant_option_list($silence, $boolParams, $param_preproc, $param_th); |
12876 | // lv <- $r19 |
12877 | if ($r19===self::$FAILED) { |
12878 | $this->currPos = $p17; |
12879 | $r13 = self::$FAILED; |
12880 | goto seq_5; |
12881 | } |
12882 | $r13 = true; |
12883 | seq_5: |
12884 | if ($r13!==self::$FAILED) { |
12885 | $this->savedPos = $p14; |
12886 | $r13 = $this->a159($r4, $r6, $r19); |
12887 | } |
12888 | // free $p17 |
12889 | choice_2: |
12890 | // ts <- $r13 |
12891 | if ($r13===self::$FAILED) { |
12892 | $this->currPos = $p3; |
12893 | $r1 = self::$FAILED; |
12894 | goto seq_1; |
12895 | } |
12896 | $r20 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
12897 | if ($r20===self::$FAILED) { |
12898 | $this->currPos = $p3; |
12899 | $r1 = self::$FAILED; |
12900 | goto seq_1; |
12901 | } |
12902 | $p17 = $this->currPos; |
12903 | // lv1 <- $r21 |
12904 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}-", $this->currPos, 2, false) === 0) { |
12905 | $r21 = "}-"; |
12906 | $this->currPos += 2; |
12907 | $this->savedPos = $p17; |
12908 | $r21 = $this->a160($r4, $r6, $r13); |
12909 | } else { |
12910 | if (!$silence) {$this->fail(76);} |
12911 | $r21 = self::$FAILED; |
12912 | $this->currPos = $p3; |
12913 | $r1 = self::$FAILED; |
12914 | goto seq_1; |
12915 | } |
12916 | $r1 = true; |
12917 | seq_1: |
12918 | if ($r1!==self::$FAILED) { |
12919 | $this->savedPos = $p2; |
12920 | $r1 = $this->a161($r4, $r6, $r13, $r21); |
12921 | } |
12922 | // free $p3 |
12923 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12924 | $this->currPos, |
12925 | $r1, |
12926 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12927 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
12928 | ); |
12929 | return $r1; |
12930 | } |
12931 | private function parsebroken_lang_variant($silence, &$param_preproc) { |
12932 | $key = json_encode([392, $param_preproc]); |
12933 | $bucket = $this->currPos; |
12934 | $cached = $this->cache[$bucket][$key] ?? null; |
12935 | if ($cached) { |
12936 | $this->currPos = $cached->nextPos; |
12937 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12938 | return $cached->result; |
12939 | } |
12940 | $saved_preproc=$param_preproc; |
12941 | $p2 = $this->currPos; |
12942 | // start seq_1 |
12943 | $p3 = $this->currPos; |
12944 | // r <- $r4 |
12945 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
12946 | $r4 = "-{"; |
12947 | $this->currPos += 2; |
12948 | } else { |
12949 | if (!$silence) {$this->fail(75);} |
12950 | $r4 = self::$FAILED; |
12951 | $r1 = self::$FAILED; |
12952 | goto seq_1; |
12953 | } |
12954 | $r1 = true; |
12955 | seq_1: |
12956 | if ($r1!==self::$FAILED) { |
12957 | $this->savedPos = $p2; |
12958 | $r1 = $this->a162($r4, $param_preproc); |
12959 | } |
12960 | // free $p3 |
12961 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
12962 | $this->currPos, |
12963 | $r1, |
12964 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
12965 | self::$UNDEFINED |
12966 | ); |
12967 | return $r1; |
12968 | } |
12969 | private function parsetable_heading_tags_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
12970 | $key = json_encode([506, $boolParams & 0x1fff, $param_preproc, $param_th]); |
12971 | $bucket = $this->currPos; |
12972 | $cached = $this->cache[$bucket][$key] ?? null; |
12973 | if ($cached) { |
12974 | $this->currPos = $cached->nextPos; |
12975 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
12976 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
12977 | return $cached->result; |
12978 | } |
12979 | $saved_preproc=$param_preproc; |
12980 | $saved_th=$param_th; |
12981 | $p2 = $this->currPos; |
12982 | // start seq_1 |
12983 | $p3 = $this->currPos; |
12984 | if (($this->input[$this->currPos] ?? null) === "!") { |
12985 | $this->currPos++; |
12986 | $r4 = "!"; |
12987 | } else { |
12988 | if (!$silence) {$this->fail(77);} |
12989 | $r4 = self::$FAILED; |
12990 | $r1 = self::$FAILED; |
12991 | goto seq_1; |
12992 | } |
12993 | $r5 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th); |
12994 | // thTag <- $r5 |
12995 | if ($r5===self::$FAILED) { |
12996 | $this->currPos = $p3; |
12997 | $r1 = self::$FAILED; |
12998 | goto seq_1; |
12999 | } |
13000 | $r6 = $this->parseths($silence, $boolParams, $param_preproc, $param_th); |
13001 | // thTags <- $r6 |
13002 | if ($r6===self::$FAILED) { |
13003 | $this->currPos = $p3; |
13004 | $r1 = self::$FAILED; |
13005 | goto seq_1; |
13006 | } |
13007 | $r1 = true; |
13008 | seq_1: |
13009 | if ($r1!==self::$FAILED) { |
13010 | $this->savedPos = $p2; |
13011 | $r1 = $this->a163($r5, $r6); |
13012 | } |
13013 | // free $p3 |
13014 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13015 | $this->currPos, |
13016 | $r1, |
13017 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13018 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13019 | ); |
13020 | return $r1; |
13021 | } |
13022 | private function parsetable_data_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
13023 | $key = json_encode([514, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13024 | $bucket = $this->currPos; |
13025 | $cached = $this->cache[$bucket][$key] ?? null; |
13026 | if ($cached) { |
13027 | $this->currPos = $cached->nextPos; |
13028 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13029 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13030 | return $cached->result; |
13031 | } |
13032 | $saved_preproc=$param_preproc; |
13033 | $saved_th=$param_th; |
13034 | $p2 = $this->currPos; |
13035 | // start seq_1 |
13036 | $p3 = $this->currPos; |
13037 | $p4 = $this->currPos; |
13038 | if (($this->input[$this->currPos] ?? null) === "}") { |
13039 | $this->currPos++; |
13040 | $r5 = "}"; |
13041 | } else { |
13042 | $r5 = self::$FAILED; |
13043 | } |
13044 | if ($r5 === self::$FAILED) { |
13045 | $r5 = false; |
13046 | } else { |
13047 | $r5 = self::$FAILED; |
13048 | $this->currPos = $p4; |
13049 | $r1 = self::$FAILED; |
13050 | goto seq_1; |
13051 | } |
13052 | // free $p4 |
13053 | $r6 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
13054 | if ($r6===self::$FAILED) { |
13055 | $r6 = null; |
13056 | } |
13057 | // arg <- $r6 |
13058 | $p4 = $this->currPos; |
13059 | $r7 = ''; |
13060 | // tagEndPos <- $r7 |
13061 | if ($r7!==self::$FAILED) { |
13062 | $this->savedPos = $p4; |
13063 | $r7 = $this->a164($r6); |
13064 | } else { |
13065 | $this->currPos = $p3; |
13066 | $r1 = self::$FAILED; |
13067 | goto seq_1; |
13068 | } |
13069 | $r8 = []; |
13070 | for (;;) { |
13071 | $r9 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
13072 | if ($r9!==self::$FAILED) { |
13073 | $r8[] = $r9; |
13074 | } else { |
13075 | break; |
13076 | } |
13077 | } |
13078 | // td <- $r8 |
13079 | // free $r9 |
13080 | $r1 = true; |
13081 | seq_1: |
13082 | if ($r1!==self::$FAILED) { |
13083 | $this->savedPos = $p2; |
13084 | $r1 = $this->a165($r6, $r7, $r8); |
13085 | } |
13086 | // free $p3 |
13087 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13088 | $this->currPos, |
13089 | $r1, |
13090 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13091 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13092 | ); |
13093 | return $r1; |
13094 | } |
13095 | private function parsetds($silence, $boolParams, &$param_preproc, &$param_th) { |
13096 | $key = json_encode([516, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13097 | $bucket = $this->currPos; |
13098 | $cached = $this->cache[$bucket][$key] ?? null; |
13099 | if ($cached) { |
13100 | $this->currPos = $cached->nextPos; |
13101 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13102 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13103 | return $cached->result; |
13104 | } |
13105 | $saved_preproc=$param_preproc; |
13106 | $saved_th=$param_th; |
13107 | $r1 = []; |
13108 | for (;;) { |
13109 | $p3 = $this->currPos; |
13110 | // start seq_1 |
13111 | $p4 = $this->currPos; |
13112 | $r5 = $this->parsepipe_pipe($silence); |
13113 | // pp <- $r5 |
13114 | if ($r5===self::$FAILED) { |
13115 | $r2 = self::$FAILED; |
13116 | goto seq_1; |
13117 | } |
13118 | $r6 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th); |
13119 | // tdt <- $r6 |
13120 | if ($r6===self::$FAILED) { |
13121 | $this->currPos = $p4; |
13122 | $r2 = self::$FAILED; |
13123 | goto seq_1; |
13124 | } |
13125 | $r2 = true; |
13126 | seq_1: |
13127 | if ($r2!==self::$FAILED) { |
13128 | $this->savedPos = $p3; |
13129 | $r2 = $this->a166($r5, $r6); |
13130 | $r1[] = $r2; |
13131 | } else { |
13132 | break; |
13133 | } |
13134 | // free $p4 |
13135 | } |
13136 | // free $r2 |
13137 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13138 | $this->currPos, |
13139 | $r1, |
13140 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13141 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13142 | ); |
13143 | return $r1; |
13144 | } |
13145 | private function parsenested_block_in_table($silence, $boolParams, &$param_preproc, &$param_th) { |
13146 | $key = json_encode([316, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13147 | $bucket = $this->currPos; |
13148 | $cached = $this->cache[$bucket][$key] ?? null; |
13149 | if ($cached) { |
13150 | $this->currPos = $cached->nextPos; |
13151 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13152 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13153 | return $cached->result; |
13154 | } |
13155 | $saved_preproc=$param_preproc; |
13156 | $saved_th=$param_th; |
13157 | $p2 = $this->currPos; |
13158 | // start seq_1 |
13159 | $p3 = $this->currPos; |
13160 | $p4 = $this->currPos; |
13161 | // start seq_2 |
13162 | $p6 = $this->currPos; |
13163 | $r7 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
13164 | if ($r7===self::$FAILED) { |
13165 | $r5 = self::$FAILED; |
13166 | goto seq_2; |
13167 | } |
13168 | // start seq_3 |
13169 | $p9 = $this->currPos; |
13170 | for (;;) { |
13171 | $r11 = $this->discardspace(true); |
13172 | if ($r11===self::$FAILED) { |
13173 | break; |
13174 | } |
13175 | } |
13176 | // free $r11 |
13177 | $r10 = true; |
13178 | if ($r10===self::$FAILED) { |
13179 | $r8 = self::$FAILED; |
13180 | goto seq_3; |
13181 | } |
13182 | // free $r10 |
13183 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
13184 | if ($r10===self::$FAILED) { |
13185 | $this->currPos = $p9; |
13186 | $r8 = self::$FAILED; |
13187 | goto seq_3; |
13188 | } |
13189 | $r8 = true; |
13190 | seq_3: |
13191 | if ($r8===self::$FAILED) { |
13192 | $r8 = null; |
13193 | } |
13194 | // free $p9 |
13195 | for (;;) { |
13196 | $r12 = $this->discardspace(true); |
13197 | if ($r12===self::$FAILED) { |
13198 | break; |
13199 | } |
13200 | } |
13201 | // free $r12 |
13202 | $r11 = true; |
13203 | if ($r11===self::$FAILED) { |
13204 | $this->currPos = $p6; |
13205 | $r5 = self::$FAILED; |
13206 | goto seq_2; |
13207 | } |
13208 | // free $r11 |
13209 | // start choice_1 |
13210 | $r11 = $this->discardpipe(true); |
13211 | if ($r11!==self::$FAILED) { |
13212 | goto choice_1; |
13213 | } |
13214 | if (($this->input[$this->currPos] ?? null) === "!") { |
13215 | $this->currPos++; |
13216 | $r11 = "!"; |
13217 | } else { |
13218 | $r11 = self::$FAILED; |
13219 | } |
13220 | choice_1: |
13221 | if ($r11===self::$FAILED) { |
13222 | $this->currPos = $p6; |
13223 | $r5 = self::$FAILED; |
13224 | goto seq_2; |
13225 | } |
13226 | $r5 = true; |
13227 | seq_2: |
13228 | // free $p6 |
13229 | if ($r5 === self::$FAILED) { |
13230 | $r5 = false; |
13231 | } else { |
13232 | $r5 = self::$FAILED; |
13233 | $this->currPos = $p4; |
13234 | $r1 = self::$FAILED; |
13235 | goto seq_1; |
13236 | } |
13237 | // free $p4 |
13238 | $r12 = $this->parsenested_block($silence, $boolParams | 0x1, $param_preproc, $param_th); |
13239 | // b <- $r12 |
13240 | if ($r12===self::$FAILED) { |
13241 | $this->currPos = $p3; |
13242 | $r1 = self::$FAILED; |
13243 | goto seq_1; |
13244 | } |
13245 | $r1 = true; |
13246 | seq_1: |
13247 | if ($r1!==self::$FAILED) { |
13248 | $this->savedPos = $p2; |
13249 | $r1 = $this->a167($r12); |
13250 | } |
13251 | // free $p3 |
13252 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13253 | $this->currPos, |
13254 | $r1, |
13255 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13256 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13257 | ); |
13258 | return $r1; |
13259 | } |
13260 | private function parsetemplate_param_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13261 | $key = json_encode([388, $boolParams & 0x1e37, $param_preproc, $param_th]); |
13262 | $bucket = $this->currPos; |
13263 | $cached = $this->cache[$bucket][$key] ?? null; |
13264 | if ($cached) { |
13265 | $this->currPos = $cached->nextPos; |
13266 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13267 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13268 | return $cached->result; |
13269 | } |
13270 | $saved_preproc=$param_preproc; |
13271 | $saved_th=$param_th; |
13272 | $p2 = $this->currPos; |
13273 | $r3 = []; |
13274 | for (;;) { |
13275 | // start choice_1 |
13276 | $r4 = $this->parsenested_block($silence, ($boolParams & ~0x148) | 0x80, $param_preproc, $param_th); |
13277 | if ($r4!==self::$FAILED) { |
13278 | goto choice_1; |
13279 | } |
13280 | $r4 = $this->parsenewlineToken($silence); |
13281 | choice_1: |
13282 | if ($r4!==self::$FAILED) { |
13283 | $r3[] = $r4; |
13284 | } else { |
13285 | break; |
13286 | } |
13287 | } |
13288 | if (count($r3) === 0) { |
13289 | $r3 = self::$FAILED; |
13290 | } |
13291 | // il <- $r3 |
13292 | // free $r4 |
13293 | $r1 = $r3; |
13294 | if ($r1!==self::$FAILED) { |
13295 | $this->savedPos = $p2; |
13296 | $r1 = $this->a168($r3); |
13297 | } |
13298 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13299 | $this->currPos, |
13300 | $r1, |
13301 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13302 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13303 | ); |
13304 | return $r1; |
13305 | } |
13306 | private function discardnewlineToken($silence) { |
13307 | $key = 569; |
13308 | $bucket = $this->currPos; |
13309 | $cached = $this->cache[$bucket][$key] ?? null; |
13310 | if ($cached) { |
13311 | $this->currPos = $cached->nextPos; |
13312 | |
13313 | return $cached->result; |
13314 | } |
13315 | |
13316 | $p2 = $this->currPos; |
13317 | $r1 = $this->discardnewline($silence); |
13318 | if ($r1!==self::$FAILED) { |
13319 | $this->savedPos = $p2; |
13320 | $r1 = $this->a26(); |
13321 | } |
13322 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13323 | $this->currPos, |
13324 | $r1, |
13325 | self::$UNDEFINED, |
13326 | self::$UNDEFINED |
13327 | ); |
13328 | return $r1; |
13329 | } |
13330 | private function parsetemplate_param_name($silence, $boolParams, &$param_preproc, &$param_th) { |
13331 | $key = json_encode([384, $boolParams & 0x1e17, $param_preproc, $param_th]); |
13332 | $bucket = $this->currPos; |
13333 | $cached = $this->cache[$bucket][$key] ?? null; |
13334 | if ($cached) { |
13335 | $this->currPos = $cached->nextPos; |
13336 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13337 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13338 | return $cached->result; |
13339 | } |
13340 | $saved_preproc=$param_preproc; |
13341 | $saved_th=$param_th; |
13342 | // start choice_1 |
13343 | $r1 = $this->parsetemplate_param_text($silence, $boolParams | 0x20, $param_preproc, $param_th); |
13344 | if ($r1!==self::$FAILED) { |
13345 | goto choice_1; |
13346 | } |
13347 | $p2 = $this->currPos; |
13348 | $p3 = $this->currPos; |
13349 | if (($this->input[$this->currPos] ?? null) === "=") { |
13350 | $this->currPos++; |
13351 | $r1 = "="; |
13352 | $r1 = false; |
13353 | $this->currPos = $p3; |
13354 | $this->savedPos = $p2; |
13355 | $r1 = $this->a169(); |
13356 | } else { |
13357 | $r1 = self::$FAILED; |
13358 | } |
13359 | // free $p3 |
13360 | choice_1: |
13361 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13362 | $this->currPos, |
13363 | $r1, |
13364 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13365 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13366 | ); |
13367 | return $r1; |
13368 | } |
13369 | private function parselink_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13370 | $key = json_encode([428, $boolParams & 0x17df, $param_preproc, $param_th]); |
13371 | $bucket = $this->currPos; |
13372 | $cached = $this->cache[$bucket][$key] ?? null; |
13373 | if ($cached) { |
13374 | $this->currPos = $cached->nextPos; |
13375 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13376 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13377 | return $cached->result; |
13378 | } |
13379 | $saved_preproc=$param_preproc; |
13380 | $saved_th=$param_th; |
13381 | $r1 = $this->parselink_text_parameterized($silence, ($boolParams & ~0x20) | 0x800, $param_preproc, $param_th); |
13382 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13383 | $this->currPos, |
13384 | $r1, |
13385 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13386 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13387 | ); |
13388 | return $r1; |
13389 | } |
13390 | private function parsetag_name($silence) { |
13391 | $key = 452; |
13392 | $bucket = $this->currPos; |
13393 | $cached = $this->cache[$bucket][$key] ?? null; |
13394 | if ($cached) { |
13395 | $this->currPos = $cached->nextPos; |
13396 | |
13397 | return $cached->result; |
13398 | } |
13399 | |
13400 | $p1 = $this->currPos; |
13401 | $r2 = self::$FAILED; |
13402 | for (;;) { |
13403 | if (strcspn($this->input, "\x09\x0a\x0b />\x00", $this->currPos, 1) !== 0) { |
13404 | $r3 = self::consumeChar($this->input, $this->currPos); |
13405 | $r2 = true; |
13406 | } else { |
13407 | $r3 = self::$FAILED; |
13408 | if (!$silence) {$this->fail(78);} |
13409 | break; |
13410 | } |
13411 | } |
13412 | if ($r2!==self::$FAILED) { |
13413 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
13414 | } else { |
13415 | $r2 = self::$FAILED; |
13416 | } |
13417 | // free $r3 |
13418 | // free $p1 |
13419 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13420 | $this->currPos, |
13421 | $r2, |
13422 | self::$UNDEFINED, |
13423 | self::$UNDEFINED |
13424 | ); |
13425 | return $r2; |
13426 | } |
13427 | private function parseunispace($silence) { |
13428 | $key = 582; |
13429 | $bucket = $this->currPos; |
13430 | $cached = $this->cache[$bucket][$key] ?? null; |
13431 | if ($cached) { |
13432 | $this->currPos = $cached->nextPos; |
13433 | |
13434 | return $cached->result; |
13435 | } |
13436 | |
13437 | $r1 = self::charAt($this->input, $this->currPos); |
13438 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
13439 | $this->currPos += strlen($r1); |
13440 | } else { |
13441 | $r1 = self::$FAILED; |
13442 | if (!$silence) {$this->fail(25);} |
13443 | } |
13444 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13445 | $this->currPos, |
13446 | $r1, |
13447 | self::$UNDEFINED, |
13448 | self::$UNDEFINED |
13449 | ); |
13450 | return $r1; |
13451 | } |
13452 | private function parseopt_lang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) { |
13453 | $key = json_encode([398, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
13454 | $bucket = $this->currPos; |
13455 | $cached = $this->cache[$bucket][$key] ?? null; |
13456 | if ($cached) { |
13457 | $this->currPos = $cached->nextPos; |
13458 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13459 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13460 | return $cached->result; |
13461 | } |
13462 | $saved_preproc=$param_preproc; |
13463 | $saved_th=$param_th; |
13464 | $p2 = $this->currPos; |
13465 | $p4 = $this->currPos; |
13466 | // start seq_1 |
13467 | $p5 = $this->currPos; |
13468 | $r6 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
13469 | // ff <- $r6 |
13470 | if ($r6===self::$FAILED) { |
13471 | $r3 = self::$FAILED; |
13472 | goto seq_1; |
13473 | } |
13474 | if (($this->input[$this->currPos] ?? null) === "|") { |
13475 | $this->currPos++; |
13476 | $r7 = "|"; |
13477 | } else { |
13478 | if (!$silence) {$this->fail(13);} |
13479 | $r7 = self::$FAILED; |
13480 | $this->currPos = $p5; |
13481 | $r3 = self::$FAILED; |
13482 | goto seq_1; |
13483 | } |
13484 | $r3 = true; |
13485 | seq_1: |
13486 | if ($r3!==self::$FAILED) { |
13487 | $this->savedPos = $p4; |
13488 | $r3 = $this->a170($r6); |
13489 | } else { |
13490 | $r3 = null; |
13491 | } |
13492 | // free $p5 |
13493 | // f <- $r3 |
13494 | $r1 = $r3; |
13495 | if ($r1!==self::$FAILED) { |
13496 | $this->savedPos = $p2; |
13497 | $r1 = $this->a171($r3); |
13498 | } |
13499 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13500 | $this->currPos, |
13501 | $r1, |
13502 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13503 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13504 | ); |
13505 | return $r1; |
13506 | } |
13507 | private function parselang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) { |
13508 | $key = json_encode([414, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13509 | $bucket = $this->currPos; |
13510 | $cached = $this->cache[$bucket][$key] ?? null; |
13511 | if ($cached) { |
13512 | $this->currPos = $cached->nextPos; |
13513 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13514 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13515 | return $cached->result; |
13516 | } |
13517 | $saved_preproc=$param_preproc; |
13518 | $saved_th=$param_th; |
13519 | $p2 = $this->currPos; |
13520 | $r3 = []; |
13521 | for (;;) { |
13522 | // start choice_1 |
13523 | $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
13524 | if ($r4!==self::$FAILED) { |
13525 | goto choice_1; |
13526 | } |
13527 | if (($this->input[$this->currPos] ?? null) === "|") { |
13528 | $this->currPos++; |
13529 | $r4 = "|"; |
13530 | } else { |
13531 | if (!$silence) {$this->fail(13);} |
13532 | $r4 = self::$FAILED; |
13533 | } |
13534 | choice_1: |
13535 | if ($r4!==self::$FAILED) { |
13536 | $r3[] = $r4; |
13537 | } else { |
13538 | break; |
13539 | } |
13540 | } |
13541 | // tokens <- $r3 |
13542 | // free $r4 |
13543 | $r1 = $r3; |
13544 | if ($r1!==self::$FAILED) { |
13545 | $this->savedPos = $p2; |
13546 | $r1 = $this->a172($r3); |
13547 | } |
13548 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13549 | $this->currPos, |
13550 | $r1, |
13551 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13552 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13553 | ); |
13554 | return $r1; |
13555 | } |
13556 | private function parselang_variant_option_list($silence, $boolParams, &$param_preproc, &$param_th) { |
13557 | $key = json_encode([406, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13558 | $bucket = $this->currPos; |
13559 | $cached = $this->cache[$bucket][$key] ?? null; |
13560 | if ($cached) { |
13561 | $this->currPos = $cached->nextPos; |
13562 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13563 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13564 | return $cached->result; |
13565 | } |
13566 | $saved_preproc=$param_preproc; |
13567 | $saved_th=$param_th; |
13568 | // start choice_1 |
13569 | $p2 = $this->currPos; |
13570 | // start seq_1 |
13571 | $p3 = $this->currPos; |
13572 | $r4 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13573 | // o <- $r4 |
13574 | if ($r4===self::$FAILED) { |
13575 | $r1 = self::$FAILED; |
13576 | goto seq_1; |
13577 | } |
13578 | $r5 = []; |
13579 | for (;;) { |
13580 | $p7 = $this->currPos; |
13581 | // start seq_2 |
13582 | $p8 = $this->currPos; |
13583 | if (($this->input[$this->currPos] ?? null) === ";") { |
13584 | $this->currPos++; |
13585 | $r9 = ";"; |
13586 | } else { |
13587 | if (!$silence) {$this->fail(26);} |
13588 | $r9 = self::$FAILED; |
13589 | $r6 = self::$FAILED; |
13590 | goto seq_2; |
13591 | } |
13592 | $r10 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13593 | // oo <- $r10 |
13594 | if ($r10===self::$FAILED) { |
13595 | $this->currPos = $p8; |
13596 | $r6 = self::$FAILED; |
13597 | goto seq_2; |
13598 | } |
13599 | $r6 = true; |
13600 | seq_2: |
13601 | if ($r6!==self::$FAILED) { |
13602 | $this->savedPos = $p7; |
13603 | $r6 = $this->a173($r4, $r10); |
13604 | $r5[] = $r6; |
13605 | } else { |
13606 | break; |
13607 | } |
13608 | // free $p8 |
13609 | } |
13610 | // rest <- $r5 |
13611 | // free $r6 |
13612 | $r6 = []; |
13613 | for (;;) { |
13614 | // start seq_3 |
13615 | $p8 = $this->currPos; |
13616 | if (($this->input[$this->currPos] ?? null) === ";") { |
13617 | $this->currPos++; |
13618 | $r12 = ";"; |
13619 | } else { |
13620 | if (!$silence) {$this->fail(26);} |
13621 | $r12 = self::$FAILED; |
13622 | $r11 = self::$FAILED; |
13623 | goto seq_3; |
13624 | } |
13625 | $p13 = $this->currPos; |
13626 | $r14 = $this->discardbogus_lang_variant_option($silence, $boolParams, $param_preproc, $param_th); |
13627 | if ($r14!==self::$FAILED) { |
13628 | $r14 = substr($this->input, $p13, $this->currPos - $p13); |
13629 | } else { |
13630 | $r14 = self::$FAILED; |
13631 | $this->currPos = $p8; |
13632 | $r11 = self::$FAILED; |
13633 | goto seq_3; |
13634 | } |
13635 | // free $p13 |
13636 | $r11 = [$r12,$r14]; |
13637 | seq_3: |
13638 | if ($r11!==self::$FAILED) { |
13639 | $r6[] = $r11; |
13640 | } else { |
13641 | break; |
13642 | } |
13643 | // free $p8 |
13644 | } |
13645 | // tr <- $r6 |
13646 | // free $r11 |
13647 | $r1 = true; |
13648 | seq_1: |
13649 | if ($r1!==self::$FAILED) { |
13650 | $this->savedPos = $p2; |
13651 | $r1 = $this->a174($r4, $r5, $r6); |
13652 | goto choice_1; |
13653 | } |
13654 | // free $p3 |
13655 | $p3 = $this->currPos; |
13656 | $r11 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
13657 | // lvtext <- $r11 |
13658 | $r1 = $r11; |
13659 | if ($r1!==self::$FAILED) { |
13660 | $this->savedPos = $p3; |
13661 | $r1 = $this->a175($r11); |
13662 | } |
13663 | choice_1: |
13664 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13665 | $this->currPos, |
13666 | $r1, |
13667 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13668 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13669 | ); |
13670 | return $r1; |
13671 | } |
13672 | private function parsetable_heading_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
13673 | $key = json_encode([508, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13674 | $bucket = $this->currPos; |
13675 | $cached = $this->cache[$bucket][$key] ?? null; |
13676 | if ($cached) { |
13677 | $this->currPos = $cached->nextPos; |
13678 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13679 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13680 | return $cached->result; |
13681 | } |
13682 | $saved_preproc=$param_preproc; |
13683 | $saved_th=$param_th; |
13684 | $p2 = $this->currPos; |
13685 | // start seq_1 |
13686 | $p3 = $this->currPos; |
13687 | $r4 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th); |
13688 | if ($r4===self::$FAILED) { |
13689 | $r4 = null; |
13690 | } |
13691 | // arg <- $r4 |
13692 | $p6 = $this->currPos; |
13693 | $r5 = ''; |
13694 | // tagEndPos <- $r5 |
13695 | if ($r5!==self::$FAILED) { |
13696 | $this->savedPos = $p6; |
13697 | $r5 = $this->a164($r4); |
13698 | } else { |
13699 | $this->currPos = $p3; |
13700 | $r1 = self::$FAILED; |
13701 | goto seq_1; |
13702 | } |
13703 | $r7 = []; |
13704 | for (;;) { |
13705 | $p9 = $this->currPos; |
13706 | // start seq_2 |
13707 | $p10 = $this->currPos; |
13708 | $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th); |
13709 | // d <- $r11 |
13710 | if ($r11===self::$FAILED) { |
13711 | $this->currPos = $p10; |
13712 | $r8 = self::$FAILED; |
13713 | goto seq_2; |
13714 | } |
13715 | $r8 = true; |
13716 | seq_2: |
13717 | if ($r8!==self::$FAILED) { |
13718 | $this->savedPos = $p9; |
13719 | $r8 = $this->a176($r4, $r5, $param_th, $r11); |
13720 | $r7[] = $r8; |
13721 | } else { |
13722 | break; |
13723 | } |
13724 | // free $p10 |
13725 | } |
13726 | // c <- $r7 |
13727 | // free $r8 |
13728 | $r1 = true; |
13729 | seq_1: |
13730 | if ($r1!==self::$FAILED) { |
13731 | $this->savedPos = $p2; |
13732 | $r1 = $this->a177($r4, $r5, $r7); |
13733 | } |
13734 | // free $p3 |
13735 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13736 | $this->currPos, |
13737 | $r1, |
13738 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13739 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13740 | ); |
13741 | return $r1; |
13742 | } |
13743 | private function parseths($silence, $boolParams, &$param_preproc, &$param_th) { |
13744 | $key = json_encode([510, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13745 | $bucket = $this->currPos; |
13746 | $cached = $this->cache[$bucket][$key] ?? null; |
13747 | if ($cached) { |
13748 | $this->currPos = $cached->nextPos; |
13749 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13750 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13751 | return $cached->result; |
13752 | } |
13753 | $saved_preproc=$param_preproc; |
13754 | $saved_th=$param_th; |
13755 | $r1 = []; |
13756 | for (;;) { |
13757 | $p3 = $this->currPos; |
13758 | // start seq_1 |
13759 | $p4 = $this->currPos; |
13760 | // start choice_1 |
13761 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
13762 | $r5 = "!!"; |
13763 | $this->currPos += 2; |
13764 | goto choice_1; |
13765 | } else { |
13766 | if (!$silence) {$this->fail(79);} |
13767 | $r5 = self::$FAILED; |
13768 | } |
13769 | $r5 = $this->parsepipe_pipe($silence); |
13770 | choice_1: |
13771 | // pp <- $r5 |
13772 | if ($r5===self::$FAILED) { |
13773 | $r2 = self::$FAILED; |
13774 | goto seq_1; |
13775 | } |
13776 | $r6 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th); |
13777 | // tht <- $r6 |
13778 | if ($r6===self::$FAILED) { |
13779 | $this->currPos = $p4; |
13780 | $r2 = self::$FAILED; |
13781 | goto seq_1; |
13782 | } |
13783 | $r2 = true; |
13784 | seq_1: |
13785 | if ($r2!==self::$FAILED) { |
13786 | $this->savedPos = $p3; |
13787 | $r2 = $this->a178($r5, $r6); |
13788 | $r1[] = $r2; |
13789 | } else { |
13790 | break; |
13791 | } |
13792 | // free $p4 |
13793 | } |
13794 | // free $r2 |
13795 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13796 | $this->currPos, |
13797 | $r1, |
13798 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13799 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13800 | ); |
13801 | return $r1; |
13802 | } |
13803 | private function parsepipe_pipe($silence) { |
13804 | $key = 556; |
13805 | $bucket = $this->currPos; |
13806 | $cached = $this->cache[$bucket][$key] ?? null; |
13807 | if ($cached) { |
13808 | $this->currPos = $cached->nextPos; |
13809 | |
13810 | return $cached->result; |
13811 | } |
13812 | |
13813 | // start choice_1 |
13814 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "||", $this->currPos, 2, false) === 0) { |
13815 | $r1 = "||"; |
13816 | $this->currPos += 2; |
13817 | goto choice_1; |
13818 | } else { |
13819 | if (!$silence) {$this->fail(80);} |
13820 | $r1 = self::$FAILED; |
13821 | } |
13822 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}{{!}}", $this->currPos, 10, false) === 0) { |
13823 | $r1 = "{{!}}{{!}}"; |
13824 | $this->currPos += 10; |
13825 | } else { |
13826 | if (!$silence) {$this->fail(81);} |
13827 | $r1 = self::$FAILED; |
13828 | } |
13829 | choice_1: |
13830 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13831 | $this->currPos, |
13832 | $r1, |
13833 | self::$UNDEFINED, |
13834 | self::$UNDEFINED |
13835 | ); |
13836 | return $r1; |
13837 | } |
13838 | private function parsenested_block($silence, $boolParams, &$param_preproc, &$param_th) { |
13839 | $key = json_encode([314, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13840 | $bucket = $this->currPos; |
13841 | $cached = $this->cache[$bucket][$key] ?? null; |
13842 | if ($cached) { |
13843 | $this->currPos = $cached->nextPos; |
13844 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13845 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13846 | return $cached->result; |
13847 | } |
13848 | $saved_preproc=$param_preproc; |
13849 | $saved_th=$param_th; |
13850 | $p2 = $this->currPos; |
13851 | // start seq_1 |
13852 | $p3 = $this->currPos; |
13853 | $p4 = $this->currPos; |
13854 | $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
13855 | if ($r5 === self::$FAILED) { |
13856 | $r5 = false; |
13857 | } else { |
13858 | $r5 = self::$FAILED; |
13859 | $this->currPos = $p4; |
13860 | $r1 = self::$FAILED; |
13861 | goto seq_1; |
13862 | } |
13863 | // free $p4 |
13864 | $r6 = $this->parseblock($silence, $boolParams, $param_th, $param_preproc); |
13865 | // b <- $r6 |
13866 | if ($r6===self::$FAILED) { |
13867 | $this->currPos = $p3; |
13868 | $r1 = self::$FAILED; |
13869 | goto seq_1; |
13870 | } |
13871 | $r1 = true; |
13872 | seq_1: |
13873 | if ($r1!==self::$FAILED) { |
13874 | $this->savedPos = $p2; |
13875 | $r1 = $this->a15($r6); |
13876 | } |
13877 | // free $p3 |
13878 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
13879 | $this->currPos, |
13880 | $r1, |
13881 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
13882 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
13883 | ); |
13884 | return $r1; |
13885 | } |
13886 | private function parselink_text_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
13887 | $key = json_encode([430, $boolParams & 0x1fff, $param_preproc, $param_th]); |
13888 | $bucket = $this->currPos; |
13889 | $cached = $this->cache[$bucket][$key] ?? null; |
13890 | if ($cached) { |
13891 | $this->currPos = $cached->nextPos; |
13892 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
13893 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
13894 | return $cached->result; |
13895 | } |
13896 | $saved_preproc=$param_preproc; |
13897 | $saved_th=$param_th; |
13898 | $p2 = $this->currPos; |
13899 | $r3 = []; |
13900 | for (;;) { |
13901 | // start choice_1 |
13902 | // start seq_1 |
13903 | $p5 = $this->currPos; |
13904 | $r6 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
13905 | if ($r6===self::$FAILED) { |
13906 | $r4 = self::$FAILED; |
13907 | goto seq_1; |
13908 | } |
13909 | // start choice_2 |
13910 | $r7 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
13911 | if ($r7!==self::$FAILED) { |
13912 | goto choice_2; |
13913 | } |
13914 | $r7 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
13915 | if ($r7!==self::$FAILED) { |
13916 | goto choice_2; |
13917 | } |
13918 | $r7 = $this->parsefull_table_in_link_caption($silence, $boolParams, $param_preproc, $param_th); |
13919 | choice_2: |
13920 | if ($r7===self::$FAILED) { |
13921 | $this->currPos = $p5; |
13922 | $r4 = self::$FAILED; |
13923 | goto seq_1; |
13924 | } |
13925 | $r4 = [$r6,$r7]; |
13926 | seq_1: |
13927 | if ($r4!==self::$FAILED) { |
13928 | goto choice_1; |
13929 | } |
13930 | // free $p5 |
13931 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
13932 | if ($r4!==self::$FAILED) { |
13933 | goto choice_1; |
13934 | } |
13935 | $p5 = $this->currPos; |
13936 | // start seq_2 |
13937 | $p8 = $this->currPos; |
13938 | $p9 = $this->currPos; |
13939 | $r10 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
13940 | if ($r10 === self::$FAILED) { |
13941 | $r10 = false; |
13942 | } else { |
13943 | $r10 = self::$FAILED; |
13944 | $this->currPos = $p9; |
13945 | $r4 = self::$FAILED; |
13946 | goto seq_2; |
13947 | } |
13948 | // free $p9 |
13949 | // start choice_3 |
13950 | $r11 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
13951 | if ($r11!==self::$FAILED) { |
13952 | goto choice_3; |
13953 | } |
13954 | // start seq_3 |
13955 | $p9 = $this->currPos; |
13956 | if (($this->input[$this->currPos] ?? null) === "[") { |
13957 | $this->currPos++; |
13958 | $r12 = "["; |
13959 | } else { |
13960 | if (!$silence) {$this->fail(19);} |
13961 | $r12 = self::$FAILED; |
13962 | $r11 = self::$FAILED; |
13963 | goto seq_3; |
13964 | } |
13965 | $r13 = []; |
13966 | for (;;) { |
13967 | $r14 = $this->parsetext_char($silence); |
13968 | if ($r14!==self::$FAILED) { |
13969 | $r13[] = $r14; |
13970 | } else { |
13971 | break; |
13972 | } |
13973 | } |
13974 | if (count($r13) === 0) { |
13975 | $r13 = self::$FAILED; |
13976 | } |
13977 | if ($r13===self::$FAILED) { |
13978 | $this->currPos = $p9; |
13979 | $r11 = self::$FAILED; |
13980 | goto seq_3; |
13981 | } |
13982 | // free $r14 |
13983 | if (($this->input[$this->currPos] ?? null) === "]") { |
13984 | $this->currPos++; |
13985 | $r14 = "]"; |
13986 | } else { |
13987 | if (!$silence) {$this->fail(21);} |
13988 | $r14 = self::$FAILED; |
13989 | $this->currPos = $p9; |
13990 | $r11 = self::$FAILED; |
13991 | goto seq_3; |
13992 | } |
13993 | $p15 = $this->currPos; |
13994 | $p17 = $this->currPos; |
13995 | // start choice_4 |
13996 | $p18 = $this->currPos; |
13997 | if (($this->input[$this->currPos] ?? null) === "]") { |
13998 | $this->currPos++; |
13999 | $r16 = "]"; |
14000 | } else { |
14001 | $r16 = self::$FAILED; |
14002 | } |
14003 | if ($r16 === self::$FAILED) { |
14004 | $r16 = false; |
14005 | goto choice_4; |
14006 | } else { |
14007 | $r16 = self::$FAILED; |
14008 | $this->currPos = $p18; |
14009 | } |
14010 | // free $p18 |
14011 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
14012 | $r16 = "]]"; |
14013 | $this->currPos += 2; |
14014 | } else { |
14015 | $r16 = self::$FAILED; |
14016 | } |
14017 | choice_4: |
14018 | if ($r16!==self::$FAILED) { |
14019 | $r16 = false; |
14020 | $this->currPos = $p17; |
14021 | $r16 = substr($this->input, $p15, $this->currPos - $p15); |
14022 | } else { |
14023 | $r16 = self::$FAILED; |
14024 | $this->currPos = $p9; |
14025 | $r11 = self::$FAILED; |
14026 | goto seq_3; |
14027 | } |
14028 | // free $p17 |
14029 | // free $p15 |
14030 | $r11 = [$r12,$r13,$r14,$r16]; |
14031 | seq_3: |
14032 | if ($r11!==self::$FAILED) { |
14033 | goto choice_3; |
14034 | } |
14035 | // free $p9 |
14036 | if ($this->currPos < $this->inputLength) { |
14037 | $r11 = self::consumeChar($this->input, $this->currPos);; |
14038 | } else { |
14039 | $r11 = self::$FAILED; |
14040 | if (!$silence) {$this->fail(7);} |
14041 | } |
14042 | choice_3: |
14043 | // r <- $r11 |
14044 | if ($r11===self::$FAILED) { |
14045 | $this->currPos = $p8; |
14046 | $r4 = self::$FAILED; |
14047 | goto seq_2; |
14048 | } |
14049 | $r4 = true; |
14050 | seq_2: |
14051 | if ($r4!==self::$FAILED) { |
14052 | $this->savedPos = $p5; |
14053 | $r4 = $this->a24($r11); |
14054 | } |
14055 | // free $p8 |
14056 | choice_1: |
14057 | if ($r4!==self::$FAILED) { |
14058 | $r3[] = $r4; |
14059 | } else { |
14060 | break; |
14061 | } |
14062 | } |
14063 | if (count($r3) === 0) { |
14064 | $r3 = self::$FAILED; |
14065 | } |
14066 | // c <- $r3 |
14067 | // free $r4 |
14068 | $r1 = $r3; |
14069 | if ($r1!==self::$FAILED) { |
14070 | $this->savedPos = $p2; |
14071 | $r1 = $this->a43($r3); |
14072 | } |
14073 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14074 | $this->currPos, |
14075 | $r1, |
14076 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14077 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14078 | ); |
14079 | return $r1; |
14080 | } |
14081 | private function parselang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) { |
14082 | $key = json_encode([400, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
14083 | $bucket = $this->currPos; |
14084 | $cached = $this->cache[$bucket][$key] ?? null; |
14085 | if ($cached) { |
14086 | $this->currPos = $cached->nextPos; |
14087 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14088 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14089 | return $cached->result; |
14090 | } |
14091 | $saved_preproc=$param_preproc; |
14092 | $saved_th=$param_th; |
14093 | // start choice_1 |
14094 | $p2 = $this->currPos; |
14095 | // start seq_1 |
14096 | $p3 = $this->currPos; |
14097 | $p5 = $this->currPos; |
14098 | for (;;) { |
14099 | $r6 = $this->discardspace_or_newline($silence); |
14100 | if ($r6===self::$FAILED) { |
14101 | break; |
14102 | } |
14103 | } |
14104 | // free $r6 |
14105 | $r4 = true; |
14106 | // sp1 <- $r4 |
14107 | if ($r4!==self::$FAILED) { |
14108 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
14109 | } else { |
14110 | $r4 = self::$FAILED; |
14111 | $r1 = self::$FAILED; |
14112 | goto seq_1; |
14113 | } |
14114 | // free $p5 |
14115 | $r6 = $this->parselang_variant_flag($silence, $boolParams, $param_preproc, $param_th); |
14116 | // f <- $r6 |
14117 | if ($r6===self::$FAILED) { |
14118 | $this->currPos = $p3; |
14119 | $r1 = self::$FAILED; |
14120 | goto seq_1; |
14121 | } |
14122 | $p5 = $this->currPos; |
14123 | for (;;) { |
14124 | $r8 = $this->discardspace_or_newline($silence); |
14125 | if ($r8===self::$FAILED) { |
14126 | break; |
14127 | } |
14128 | } |
14129 | // free $r8 |
14130 | $r7 = true; |
14131 | // sp2 <- $r7 |
14132 | if ($r7!==self::$FAILED) { |
14133 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
14134 | } else { |
14135 | $r7 = self::$FAILED; |
14136 | $this->currPos = $p3; |
14137 | $r1 = self::$FAILED; |
14138 | goto seq_1; |
14139 | } |
14140 | // free $p5 |
14141 | // start seq_2 |
14142 | $p5 = $this->currPos; |
14143 | if (($this->input[$this->currPos] ?? null) === ";") { |
14144 | $this->currPos++; |
14145 | $r9 = ";"; |
14146 | } else { |
14147 | if (!$silence) {$this->fail(26);} |
14148 | $r9 = self::$FAILED; |
14149 | $r8 = self::$FAILED; |
14150 | goto seq_2; |
14151 | } |
14152 | $r10 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th); |
14153 | if ($r10===self::$FAILED) { |
14154 | $r10 = null; |
14155 | } |
14156 | $r8 = [$r9,$r10]; |
14157 | seq_2: |
14158 | if ($r8===self::$FAILED) { |
14159 | $r8 = null; |
14160 | } |
14161 | // free $p5 |
14162 | // more <- $r8 |
14163 | $r1 = true; |
14164 | seq_1: |
14165 | if ($r1!==self::$FAILED) { |
14166 | $this->savedPos = $p2; |
14167 | $r1 = $this->a179($r4, $r6, $r7, $r8); |
14168 | goto choice_1; |
14169 | } |
14170 | // free $p3 |
14171 | $p3 = $this->currPos; |
14172 | $p5 = $this->currPos; |
14173 | for (;;) { |
14174 | $r12 = $this->discardspace_or_newline($silence); |
14175 | if ($r12===self::$FAILED) { |
14176 | break; |
14177 | } |
14178 | } |
14179 | // free $r12 |
14180 | $r11 = true; |
14181 | // sp <- $r11 |
14182 | if ($r11!==self::$FAILED) { |
14183 | $r11 = substr($this->input, $p5, $this->currPos - $p5); |
14184 | } else { |
14185 | $r11 = self::$FAILED; |
14186 | } |
14187 | // free $p5 |
14188 | $r1 = $r11; |
14189 | if ($r1!==self::$FAILED) { |
14190 | $this->savedPos = $p3; |
14191 | $r1 = $this->a180($r11); |
14192 | } |
14193 | choice_1: |
14194 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14195 | $this->currPos, |
14196 | $r1, |
14197 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14198 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14199 | ); |
14200 | return $r1; |
14201 | } |
14202 | private function parselang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) { |
14203 | $key = json_encode([410, $boolParams & 0x1fff, $param_preproc, $param_th]); |
14204 | $bucket = $this->currPos; |
14205 | $cached = $this->cache[$bucket][$key] ?? null; |
14206 | if ($cached) { |
14207 | $this->currPos = $cached->nextPos; |
14208 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14209 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14210 | return $cached->result; |
14211 | } |
14212 | $saved_preproc=$param_preproc; |
14213 | $saved_th=$param_th; |
14214 | // start choice_1 |
14215 | $p2 = $this->currPos; |
14216 | // start seq_1 |
14217 | $p3 = $this->currPos; |
14218 | $p5 = $this->currPos; |
14219 | for (;;) { |
14220 | $r6 = $this->discardspace_or_newline($silence); |
14221 | if ($r6===self::$FAILED) { |
14222 | break; |
14223 | } |
14224 | } |
14225 | // free $r6 |
14226 | $r4 = true; |
14227 | // sp1 <- $r4 |
14228 | if ($r4!==self::$FAILED) { |
14229 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
14230 | } else { |
14231 | $r4 = self::$FAILED; |
14232 | $r1 = self::$FAILED; |
14233 | goto seq_1; |
14234 | } |
14235 | // free $p5 |
14236 | $r6 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14237 | // lang <- $r6 |
14238 | if ($r6===self::$FAILED) { |
14239 | $this->currPos = $p3; |
14240 | $r1 = self::$FAILED; |
14241 | goto seq_1; |
14242 | } |
14243 | $p5 = $this->currPos; |
14244 | for (;;) { |
14245 | $r8 = $this->discardspace_or_newline($silence); |
14246 | if ($r8===self::$FAILED) { |
14247 | break; |
14248 | } |
14249 | } |
14250 | // free $r8 |
14251 | $r7 = true; |
14252 | // sp2 <- $r7 |
14253 | if ($r7!==self::$FAILED) { |
14254 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
14255 | } else { |
14256 | $r7 = self::$FAILED; |
14257 | $this->currPos = $p3; |
14258 | $r1 = self::$FAILED; |
14259 | goto seq_1; |
14260 | } |
14261 | // free $p5 |
14262 | if (($this->input[$this->currPos] ?? null) === ":") { |
14263 | $this->currPos++; |
14264 | $r8 = ":"; |
14265 | } else { |
14266 | if (!$silence) {$this->fail(18);} |
14267 | $r8 = self::$FAILED; |
14268 | $this->currPos = $p3; |
14269 | $r1 = self::$FAILED; |
14270 | goto seq_1; |
14271 | } |
14272 | $p5 = $this->currPos; |
14273 | for (;;) { |
14274 | $r10 = $this->discardspace_or_newline($silence); |
14275 | if ($r10===self::$FAILED) { |
14276 | break; |
14277 | } |
14278 | } |
14279 | // free $r10 |
14280 | $r9 = true; |
14281 | // sp3 <- $r9 |
14282 | if ($r9!==self::$FAILED) { |
14283 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
14284 | } else { |
14285 | $r9 = self::$FAILED; |
14286 | $this->currPos = $p3; |
14287 | $r1 = self::$FAILED; |
14288 | goto seq_1; |
14289 | } |
14290 | // free $p5 |
14291 | // start choice_2 |
14292 | $r10 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14293 | if ($r10!==self::$FAILED) { |
14294 | goto choice_2; |
14295 | } |
14296 | $r10 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th); |
14297 | choice_2: |
14298 | // lvtext <- $r10 |
14299 | if ($r10===self::$FAILED) { |
14300 | $this->currPos = $p3; |
14301 | $r1 = self::$FAILED; |
14302 | goto seq_1; |
14303 | } |
14304 | $r1 = true; |
14305 | seq_1: |
14306 | if ($r1!==self::$FAILED) { |
14307 | $this->savedPos = $p2; |
14308 | $r1 = $this->a181($r4, $r6, $r7, $r9, $r10); |
14309 | goto choice_1; |
14310 | } |
14311 | // free $p3 |
14312 | $p3 = $this->currPos; |
14313 | // start seq_2 |
14314 | $p5 = $this->currPos; |
14315 | $p12 = $this->currPos; |
14316 | for (;;) { |
14317 | $r13 = $this->discardspace_or_newline($silence); |
14318 | if ($r13===self::$FAILED) { |
14319 | break; |
14320 | } |
14321 | } |
14322 | // free $r13 |
14323 | $r11 = true; |
14324 | // sp1 <- $r11 |
14325 | if ($r11!==self::$FAILED) { |
14326 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
14327 | } else { |
14328 | $r11 = self::$FAILED; |
14329 | $r1 = self::$FAILED; |
14330 | goto seq_2; |
14331 | } |
14332 | // free $p12 |
14333 | // start choice_3 |
14334 | $r13 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14335 | if ($r13!==self::$FAILED) { |
14336 | goto choice_3; |
14337 | } |
14338 | $r13 = $this->parselang_variant_text_no_semi_or_arrow($silence, $boolParams, $param_preproc, $param_th); |
14339 | choice_3: |
14340 | // from <- $r13 |
14341 | if ($r13===self::$FAILED) { |
14342 | $this->currPos = $p5; |
14343 | $r1 = self::$FAILED; |
14344 | goto seq_2; |
14345 | } |
14346 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "=>", $this->currPos, 2, false) === 0) { |
14347 | $r14 = "=>"; |
14348 | $this->currPos += 2; |
14349 | } else { |
14350 | if (!$silence) {$this->fail(82);} |
14351 | $r14 = self::$FAILED; |
14352 | $this->currPos = $p5; |
14353 | $r1 = self::$FAILED; |
14354 | goto seq_2; |
14355 | } |
14356 | $p12 = $this->currPos; |
14357 | for (;;) { |
14358 | $r16 = $this->discardspace_or_newline($silence); |
14359 | if ($r16===self::$FAILED) { |
14360 | break; |
14361 | } |
14362 | } |
14363 | // free $r16 |
14364 | $r15 = true; |
14365 | // sp2 <- $r15 |
14366 | if ($r15!==self::$FAILED) { |
14367 | $r15 = substr($this->input, $p12, $this->currPos - $p12); |
14368 | } else { |
14369 | $r15 = self::$FAILED; |
14370 | $this->currPos = $p5; |
14371 | $r1 = self::$FAILED; |
14372 | goto seq_2; |
14373 | } |
14374 | // free $p12 |
14375 | $r16 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14376 | // lang <- $r16 |
14377 | if ($r16===self::$FAILED) { |
14378 | $this->currPos = $p5; |
14379 | $r1 = self::$FAILED; |
14380 | goto seq_2; |
14381 | } |
14382 | $p12 = $this->currPos; |
14383 | for (;;) { |
14384 | $r18 = $this->discardspace_or_newline($silence); |
14385 | if ($r18===self::$FAILED) { |
14386 | break; |
14387 | } |
14388 | } |
14389 | // free $r18 |
14390 | $r17 = true; |
14391 | // sp3 <- $r17 |
14392 | if ($r17!==self::$FAILED) { |
14393 | $r17 = substr($this->input, $p12, $this->currPos - $p12); |
14394 | } else { |
14395 | $r17 = self::$FAILED; |
14396 | $this->currPos = $p5; |
14397 | $r1 = self::$FAILED; |
14398 | goto seq_2; |
14399 | } |
14400 | // free $p12 |
14401 | if (($this->input[$this->currPos] ?? null) === ":") { |
14402 | $this->currPos++; |
14403 | $r18 = ":"; |
14404 | } else { |
14405 | if (!$silence) {$this->fail(18);} |
14406 | $r18 = self::$FAILED; |
14407 | $this->currPos = $p5; |
14408 | $r1 = self::$FAILED; |
14409 | goto seq_2; |
14410 | } |
14411 | $p12 = $this->currPos; |
14412 | for (;;) { |
14413 | $r20 = $this->discardspace_or_newline($silence); |
14414 | if ($r20===self::$FAILED) { |
14415 | break; |
14416 | } |
14417 | } |
14418 | // free $r20 |
14419 | $r19 = true; |
14420 | // sp4 <- $r19 |
14421 | if ($r19!==self::$FAILED) { |
14422 | $r19 = substr($this->input, $p12, $this->currPos - $p12); |
14423 | } else { |
14424 | $r19 = self::$FAILED; |
14425 | $this->currPos = $p5; |
14426 | $r1 = self::$FAILED; |
14427 | goto seq_2; |
14428 | } |
14429 | // free $p12 |
14430 | // start choice_4 |
14431 | $r20 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th); |
14432 | if ($r20!==self::$FAILED) { |
14433 | goto choice_4; |
14434 | } |
14435 | $r20 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th); |
14436 | choice_4: |
14437 | // to <- $r20 |
14438 | if ($r20===self::$FAILED) { |
14439 | $this->currPos = $p5; |
14440 | $r1 = self::$FAILED; |
14441 | goto seq_2; |
14442 | } |
14443 | $r1 = true; |
14444 | seq_2: |
14445 | if ($r1!==self::$FAILED) { |
14446 | $this->savedPos = $p3; |
14447 | $r1 = $this->a182($r11, $r13, $r15, $r16, $r17, $r19, $r20); |
14448 | } |
14449 | // free $p5 |
14450 | choice_1: |
14451 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14452 | $this->currPos, |
14453 | $r1, |
14454 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14455 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14456 | ); |
14457 | return $r1; |
14458 | } |
14459 | private function discardbogus_lang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) { |
14460 | $key = json_encode([409, $boolParams & 0x1fff, $param_preproc, $param_th]); |
14461 | $bucket = $this->currPos; |
14462 | $cached = $this->cache[$bucket][$key] ?? null; |
14463 | if ($cached) { |
14464 | $this->currPos = $cached->nextPos; |
14465 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14466 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14467 | return $cached->result; |
14468 | } |
14469 | $saved_preproc=$param_preproc; |
14470 | $saved_th=$param_th; |
14471 | $r1 = $this->discardlang_variant_text($silence, $boolParams, $param_preproc, $param_th); |
14472 | if ($r1===self::$FAILED) { |
14473 | $r1 = null; |
14474 | } |
14475 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14476 | $this->currPos, |
14477 | $r1, |
14478 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14479 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14480 | ); |
14481 | return $r1; |
14482 | } |
14483 | private function parsefull_table_in_link_caption($silence, $boolParams, &$param_preproc, &$param_th) { |
14484 | $key = json_encode([490, $boolParams & 0x1ffe, $param_preproc, $param_th]); |
14485 | $bucket = $this->currPos; |
14486 | $cached = $this->cache[$bucket][$key] ?? null; |
14487 | if ($cached) { |
14488 | $this->currPos = $cached->nextPos; |
14489 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14490 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14491 | return $cached->result; |
14492 | } |
14493 | $saved_preproc=$param_preproc; |
14494 | $saved_th=$param_th; |
14495 | $p2 = $this->currPos; |
14496 | // start seq_1 |
14497 | $p3 = $this->currPos; |
14498 | $p4 = $this->currPos; |
14499 | $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
14500 | if ($r5 === self::$FAILED) { |
14501 | $r5 = false; |
14502 | } else { |
14503 | $r5 = self::$FAILED; |
14504 | $this->currPos = $p4; |
14505 | $r1 = self::$FAILED; |
14506 | goto seq_1; |
14507 | } |
14508 | // free $p4 |
14509 | $r6 = $this->parsefull_table_in_link_caption_parameterized($silence, ($boolParams & ~0x801) | 0x40, $param_preproc, $param_th); |
14510 | // r <- $r6 |
14511 | if ($r6===self::$FAILED) { |
14512 | $this->currPos = $p3; |
14513 | $r1 = self::$FAILED; |
14514 | goto seq_1; |
14515 | } |
14516 | $r1 = true; |
14517 | seq_1: |
14518 | if ($r1!==self::$FAILED) { |
14519 | $this->savedPos = $p2; |
14520 | $r1 = $this->a183($r6); |
14521 | } |
14522 | // free $p3 |
14523 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14524 | $this->currPos, |
14525 | $r1, |
14526 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14527 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14528 | ); |
14529 | return $r1; |
14530 | } |
14531 | private function parselang_variant_flag($silence, $boolParams, &$param_preproc, &$param_th) { |
14532 | $key = json_encode([402, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
14533 | $bucket = $this->currPos; |
14534 | $cached = $this->cache[$bucket][$key] ?? null; |
14535 | if ($cached) { |
14536 | $this->currPos = $cached->nextPos; |
14537 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14538 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14539 | return $cached->result; |
14540 | } |
14541 | $saved_preproc=$param_preproc; |
14542 | $saved_th=$param_th; |
14543 | // start choice_1 |
14544 | $p2 = $this->currPos; |
14545 | $r3 = $this->input[$this->currPos] ?? ''; |
14546 | // f <- $r3 |
14547 | if (preg_match("/^[\\-+A-Z]/", $r3)) { |
14548 | $this->currPos++; |
14549 | } else { |
14550 | $r3 = self::$FAILED; |
14551 | if (!$silence) {$this->fail(83);} |
14552 | } |
14553 | $r1 = $r3; |
14554 | if ($r1!==self::$FAILED) { |
14555 | $this->savedPos = $p2; |
14556 | $r1 = $this->a184($r3); |
14557 | goto choice_1; |
14558 | } |
14559 | $p4 = $this->currPos; |
14560 | $r5 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th); |
14561 | // v <- $r5 |
14562 | $r1 = $r5; |
14563 | if ($r1!==self::$FAILED) { |
14564 | $this->savedPos = $p4; |
14565 | $r1 = $this->a185($r5); |
14566 | goto choice_1; |
14567 | } |
14568 | $p6 = $this->currPos; |
14569 | $p8 = $this->currPos; |
14570 | $r7 = self::$FAILED; |
14571 | for (;;) { |
14572 | // start seq_1 |
14573 | $p10 = $this->currPos; |
14574 | $p11 = $this->currPos; |
14575 | $r12 = $this->discardspace_or_newline(true); |
14576 | if ($r12 === self::$FAILED) { |
14577 | $r12 = false; |
14578 | } else { |
14579 | $r12 = self::$FAILED; |
14580 | $this->currPos = $p11; |
14581 | $r9 = self::$FAILED; |
14582 | goto seq_1; |
14583 | } |
14584 | // free $p11 |
14585 | $p11 = $this->currPos; |
14586 | $r13 = $this->discardnowiki(true, $boolParams, $param_preproc, $param_th); |
14587 | if ($r13 === self::$FAILED) { |
14588 | $r13 = false; |
14589 | } else { |
14590 | $r13 = self::$FAILED; |
14591 | $this->currPos = $p11; |
14592 | $this->currPos = $p10; |
14593 | $r9 = self::$FAILED; |
14594 | goto seq_1; |
14595 | } |
14596 | // free $p11 |
14597 | if (strcspn($this->input, "{}|;", $this->currPos, 1) !== 0) { |
14598 | $r14 = self::consumeChar($this->input, $this->currPos); |
14599 | } else { |
14600 | $r14 = self::$FAILED; |
14601 | if (!$silence) {$this->fail(84);} |
14602 | $this->currPos = $p10; |
14603 | $r9 = self::$FAILED; |
14604 | goto seq_1; |
14605 | } |
14606 | $r9 = true; |
14607 | seq_1: |
14608 | if ($r9!==self::$FAILED) { |
14609 | $r7 = true; |
14610 | } else { |
14611 | break; |
14612 | } |
14613 | // free $p10 |
14614 | } |
14615 | // b <- $r7 |
14616 | if ($r7!==self::$FAILED) { |
14617 | $r7 = substr($this->input, $p8, $this->currPos - $p8); |
14618 | } else { |
14619 | $r7 = self::$FAILED; |
14620 | } |
14621 | // free $r9 |
14622 | // free $p8 |
14623 | $r1 = $r7; |
14624 | if ($r1!==self::$FAILED) { |
14625 | $this->savedPos = $p6; |
14626 | $r1 = $this->a186($r7); |
14627 | } |
14628 | choice_1: |
14629 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14630 | $this->currPos, |
14631 | $r1, |
14632 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14633 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14634 | ); |
14635 | return $r1; |
14636 | } |
14637 | private function parselang_variant_name($silence, $boolParams, &$param_preproc, &$param_th) { |
14638 | $key = json_encode([404, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
14639 | $bucket = $this->currPos; |
14640 | $cached = $this->cache[$bucket][$key] ?? null; |
14641 | if ($cached) { |
14642 | $this->currPos = $cached->nextPos; |
14643 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14644 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14645 | return $cached->result; |
14646 | } |
14647 | $saved_preproc=$param_preproc; |
14648 | $saved_th=$param_th; |
14649 | // start choice_1 |
14650 | $p2 = $this->currPos; |
14651 | // start seq_1 |
14652 | $p3 = $this->currPos; |
14653 | $r4 = $this->input[$this->currPos] ?? ''; |
14654 | if (preg_match("/^[a-z]/", $r4)) { |
14655 | $this->currPos++; |
14656 | } else { |
14657 | $r4 = self::$FAILED; |
14658 | if (!$silence) {$this->fail(85);} |
14659 | $r1 = self::$FAILED; |
14660 | goto seq_1; |
14661 | } |
14662 | $r5 = self::$FAILED; |
14663 | for (;;) { |
14664 | $r6 = $this->input[$this->currPos] ?? ''; |
14665 | if (preg_match("/^[\\-a-zA-Z]/", $r6)) { |
14666 | $this->currPos++; |
14667 | $r5 = true; |
14668 | } else { |
14669 | $r6 = self::$FAILED; |
14670 | if (!$silence) {$this->fail(86);} |
14671 | break; |
14672 | } |
14673 | } |
14674 | if ($r5===self::$FAILED) { |
14675 | $this->currPos = $p3; |
14676 | $r1 = self::$FAILED; |
14677 | goto seq_1; |
14678 | } |
14679 | // free $r6 |
14680 | $r1 = true; |
14681 | seq_1: |
14682 | if ($r1!==self::$FAILED) { |
14683 | $r1 = substr($this->input, $p2, $this->currPos - $p2); |
14684 | goto choice_1; |
14685 | } else { |
14686 | $r1 = self::$FAILED; |
14687 | } |
14688 | // free $p3 |
14689 | // free $p2 |
14690 | $r1 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th); |
14691 | choice_1: |
14692 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14693 | $this->currPos, |
14694 | $r1, |
14695 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14696 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14697 | ); |
14698 | return $r1; |
14699 | } |
14700 | private function parselang_variant_nowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
14701 | $key = json_encode([412, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
14702 | $bucket = $this->currPos; |
14703 | $cached = $this->cache[$bucket][$key] ?? null; |
14704 | if ($cached) { |
14705 | $this->currPos = $cached->nextPos; |
14706 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14707 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14708 | return $cached->result; |
14709 | } |
14710 | $saved_preproc=$param_preproc; |
14711 | $saved_th=$param_th; |
14712 | $p2 = $this->currPos; |
14713 | // start seq_1 |
14714 | $p3 = $this->currPos; |
14715 | $r4 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th); |
14716 | // n <- $r4 |
14717 | if ($r4===self::$FAILED) { |
14718 | $r1 = self::$FAILED; |
14719 | goto seq_1; |
14720 | } |
14721 | $p6 = $this->currPos; |
14722 | for (;;) { |
14723 | $r7 = $this->discardspace_or_newline($silence); |
14724 | if ($r7===self::$FAILED) { |
14725 | break; |
14726 | } |
14727 | } |
14728 | // free $r7 |
14729 | $r5 = true; |
14730 | // sp <- $r5 |
14731 | if ($r5!==self::$FAILED) { |
14732 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
14733 | } else { |
14734 | $r5 = self::$FAILED; |
14735 | $this->currPos = $p3; |
14736 | $r1 = self::$FAILED; |
14737 | goto seq_1; |
14738 | } |
14739 | // free $p6 |
14740 | $r1 = true; |
14741 | seq_1: |
14742 | if ($r1!==self::$FAILED) { |
14743 | $this->savedPos = $p2; |
14744 | $r1 = $this->a187($r4, $r5); |
14745 | } |
14746 | // free $p3 |
14747 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14748 | $this->currPos, |
14749 | $r1, |
14750 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14751 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14752 | ); |
14753 | return $r1; |
14754 | } |
14755 | private function parselang_variant_text_no_semi($silence, $boolParams, &$param_preproc, &$param_th) { |
14756 | $key = json_encode([416, $boolParams & 0x1dff, $param_preproc, $param_th]); |
14757 | $bucket = $this->currPos; |
14758 | $cached = $this->cache[$bucket][$key] ?? null; |
14759 | if ($cached) { |
14760 | $this->currPos = $cached->nextPos; |
14761 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14762 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14763 | return $cached->result; |
14764 | } |
14765 | $saved_preproc=$param_preproc; |
14766 | $saved_th=$param_th; |
14767 | $r1 = $this->parselang_variant_text($silence, $boolParams | 0x200, $param_preproc, $param_th); |
14768 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14769 | $this->currPos, |
14770 | $r1, |
14771 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14772 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14773 | ); |
14774 | return $r1; |
14775 | } |
14776 | private function parselang_variant_text_no_semi_or_arrow($silence, $boolParams, &$param_preproc, &$param_th) { |
14777 | $key = json_encode([418, $boolParams & 0x19ff, $param_preproc, $param_th]); |
14778 | $bucket = $this->currPos; |
14779 | $cached = $this->cache[$bucket][$key] ?? null; |
14780 | if ($cached) { |
14781 | $this->currPos = $cached->nextPos; |
14782 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14783 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14784 | return $cached->result; |
14785 | } |
14786 | $saved_preproc=$param_preproc; |
14787 | $saved_th=$param_th; |
14788 | $r1 = $this->parselang_variant_text_no_semi($silence, $boolParams | 0x400, $param_preproc, $param_th); |
14789 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14790 | $this->currPos, |
14791 | $r1, |
14792 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14793 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14794 | ); |
14795 | return $r1; |
14796 | } |
14797 | private function discardlang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) { |
14798 | $key = json_encode([415, $boolParams & 0x1fff, $param_preproc, $param_th]); |
14799 | $bucket = $this->currPos; |
14800 | $cached = $this->cache[$bucket][$key] ?? null; |
14801 | if ($cached) { |
14802 | $this->currPos = $cached->nextPos; |
14803 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14804 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14805 | return $cached->result; |
14806 | } |
14807 | $saved_preproc=$param_preproc; |
14808 | $saved_th=$param_th; |
14809 | $p2 = $this->currPos; |
14810 | $r3 = []; |
14811 | for (;;) { |
14812 | // start choice_1 |
14813 | $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
14814 | if ($r4!==self::$FAILED) { |
14815 | goto choice_1; |
14816 | } |
14817 | if (($this->input[$this->currPos] ?? null) === "|") { |
14818 | $this->currPos++; |
14819 | $r4 = "|"; |
14820 | } else { |
14821 | if (!$silence) {$this->fail(13);} |
14822 | $r4 = self::$FAILED; |
14823 | } |
14824 | choice_1: |
14825 | if ($r4!==self::$FAILED) { |
14826 | $r3[] = $r4; |
14827 | } else { |
14828 | break; |
14829 | } |
14830 | } |
14831 | // tokens <- $r3 |
14832 | // free $r4 |
14833 | $r1 = $r3; |
14834 | if ($r1!==self::$FAILED) { |
14835 | $this->savedPos = $p2; |
14836 | $r1 = $this->a172($r3); |
14837 | } |
14838 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14839 | $this->currPos, |
14840 | $r1, |
14841 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14842 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14843 | ); |
14844 | return $r1; |
14845 | } |
14846 | private function parsefull_table_in_link_caption_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
14847 | $key = json_encode([492, $boolParams & 0x1fff, $param_preproc, $param_th]); |
14848 | $bucket = $this->currPos; |
14849 | $cached = $this->cache[$bucket][$key] ?? null; |
14850 | if ($cached) { |
14851 | $this->currPos = $cached->nextPos; |
14852 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14853 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14854 | return $cached->result; |
14855 | } |
14856 | $saved_preproc=$param_preproc; |
14857 | $saved_th=$param_th; |
14858 | // start seq_1 |
14859 | $p1 = $this->currPos; |
14860 | $r3 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
14861 | if ($r3===self::$FAILED) { |
14862 | $r2 = self::$FAILED; |
14863 | goto seq_1; |
14864 | } |
14865 | $r4 = []; |
14866 | for (;;) { |
14867 | // start seq_2 |
14868 | $p6 = $this->currPos; |
14869 | $r7 = []; |
14870 | for (;;) { |
14871 | // start seq_3 |
14872 | $p9 = $this->currPos; |
14873 | $r10 = []; |
14874 | for (;;) { |
14875 | $r11 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
14876 | if ($r11!==self::$FAILED) { |
14877 | $r10[] = $r11; |
14878 | } else { |
14879 | break; |
14880 | } |
14881 | } |
14882 | if (count($r10) === 0) { |
14883 | $r10 = self::$FAILED; |
14884 | } |
14885 | if ($r10===self::$FAILED) { |
14886 | $r8 = self::$FAILED; |
14887 | goto seq_3; |
14888 | } |
14889 | // free $r11 |
14890 | // start choice_1 |
14891 | $r11 = $this->parsetable_content_line($silence, $boolParams, $param_preproc, $param_th); |
14892 | if ($r11!==self::$FAILED) { |
14893 | goto choice_1; |
14894 | } |
14895 | $r11 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
14896 | choice_1: |
14897 | if ($r11===self::$FAILED) { |
14898 | $this->currPos = $p9; |
14899 | $r8 = self::$FAILED; |
14900 | goto seq_3; |
14901 | } |
14902 | $r8 = [$r10,$r11]; |
14903 | seq_3: |
14904 | if ($r8!==self::$FAILED) { |
14905 | $r7[] = $r8; |
14906 | } else { |
14907 | break; |
14908 | } |
14909 | // free $p9 |
14910 | } |
14911 | // free $r8 |
14912 | $r8 = []; |
14913 | for (;;) { |
14914 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
14915 | if ($r12!==self::$FAILED) { |
14916 | $r8[] = $r12; |
14917 | } else { |
14918 | break; |
14919 | } |
14920 | } |
14921 | if (count($r8) === 0) { |
14922 | $r8 = self::$FAILED; |
14923 | } |
14924 | if ($r8===self::$FAILED) { |
14925 | $this->currPos = $p6; |
14926 | $r5 = self::$FAILED; |
14927 | goto seq_2; |
14928 | } |
14929 | // free $r12 |
14930 | $r12 = $this->parsetable_end_tag($silence); |
14931 | if ($r12===self::$FAILED) { |
14932 | $this->currPos = $p6; |
14933 | $r5 = self::$FAILED; |
14934 | goto seq_2; |
14935 | } |
14936 | $r5 = [$r7,$r8,$r12]; |
14937 | seq_2: |
14938 | if ($r5!==self::$FAILED) { |
14939 | $r4[] = $r5; |
14940 | } else { |
14941 | break; |
14942 | } |
14943 | // free $p6 |
14944 | } |
14945 | if (count($r4) === 0) { |
14946 | $r4 = self::$FAILED; |
14947 | } |
14948 | if ($r4===self::$FAILED) { |
14949 | $this->currPos = $p1; |
14950 | $r2 = self::$FAILED; |
14951 | goto seq_1; |
14952 | } |
14953 | // free $r5 |
14954 | $r2 = [$r3,$r4]; |
14955 | seq_1: |
14956 | // free $r2,$p1 |
14957 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
14958 | $this->currPos, |
14959 | $r2, |
14960 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
14961 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
14962 | ); |
14963 | return $r2; |
14964 | } |
14965 | private function discardnowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
14966 | $key = json_encode([449, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
14967 | $bucket = $this->currPos; |
14968 | $cached = $this->cache[$bucket][$key] ?? null; |
14969 | if ($cached) { |
14970 | $this->currPos = $cached->nextPos; |
14971 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
14972 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
14973 | return $cached->result; |
14974 | } |
14975 | $saved_preproc=$param_preproc; |
14976 | $saved_th=$param_th; |
14977 | $p2 = $this->currPos; |
14978 | // start seq_1 |
14979 | $p3 = $this->currPos; |
14980 | $p4 = $this->currPos; |
14981 | $r5 = $this->discardnowiki_check(true, $boolParams); |
14982 | if ($r5!==self::$FAILED) { |
14983 | $r5 = false; |
14984 | $this->currPos = $p4; |
14985 | } else { |
14986 | $r1 = self::$FAILED; |
14987 | goto seq_1; |
14988 | } |
14989 | // free $p4 |
14990 | $r6 = $this->parsewellformed_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
14991 | // ext <- $r6 |
14992 | if ($r6===self::$FAILED) { |
14993 | $this->currPos = $p3; |
14994 | $r1 = self::$FAILED; |
14995 | goto seq_1; |
14996 | } |
14997 | $r1 = true; |
14998 | seq_1: |
14999 | if ($r1!==self::$FAILED) { |
15000 | $this->savedPos = $p2; |
15001 | $r1 = $this->a188($r6); |
15002 | } |
15003 | // free $p3 |
15004 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15005 | $this->currPos, |
15006 | $r1, |
15007 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15008 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15009 | ); |
15010 | return $r1; |
15011 | } |
15012 | private function parsenowiki_text($silence, $boolParams, &$param_preproc, &$param_th) { |
15013 | $key = json_encode([450, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
15014 | $bucket = $this->currPos; |
15015 | $cached = $this->cache[$bucket][$key] ?? null; |
15016 | if ($cached) { |
15017 | $this->currPos = $cached->nextPos; |
15018 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
15019 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
15020 | return $cached->result; |
15021 | } |
15022 | $saved_preproc=$param_preproc; |
15023 | $saved_th=$param_th; |
15024 | $p2 = $this->currPos; |
15025 | $r3 = $this->parsenowiki($silence, $boolParams, $param_preproc, $param_th); |
15026 | // extToken <- $r3 |
15027 | $r1 = $r3; |
15028 | if ($r1!==self::$FAILED) { |
15029 | $this->savedPos = $p2; |
15030 | $r1 = $this->a189($r3); |
15031 | } |
15032 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15033 | $this->currPos, |
15034 | $r1, |
15035 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15036 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15037 | ); |
15038 | return $r1; |
15039 | } |
15040 | private function discardnowiki_check($silence, $boolParams) { |
15041 | $key = json_encode([447, $boolParams & 0x2]); |
15042 | $bucket = $this->currPos; |
15043 | $cached = $this->cache[$bucket][$key] ?? null; |
15044 | if ($cached) { |
15045 | $this->currPos = $cached->nextPos; |
15046 | |
15047 | return $cached->result; |
15048 | } |
15049 | |
15050 | // start seq_1 |
15051 | $p1 = $this->currPos; |
15052 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
15053 | $r3 = false; |
15054 | } else { |
15055 | $r3 = self::$FAILED; |
15056 | $r2 = self::$FAILED; |
15057 | goto seq_1; |
15058 | } |
15059 | $r4 = $this->parsexmlish_start($silence); |
15060 | // start <- $r4 |
15061 | if ($r4===self::$FAILED) { |
15062 | $this->currPos = $p1; |
15063 | $r2 = self::$FAILED; |
15064 | goto seq_1; |
15065 | } |
15066 | $this->savedPos = $this->currPos; |
15067 | $r5 = $this->a190($r4); |
15068 | if ($r5) { |
15069 | $r5 = false; |
15070 | } else { |
15071 | $r5 = self::$FAILED; |
15072 | $this->currPos = $p1; |
15073 | $r2 = self::$FAILED; |
15074 | goto seq_1; |
15075 | } |
15076 | $r2 = true; |
15077 | seq_1: |
15078 | // free $r2,$p1 |
15079 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15080 | $this->currPos, |
15081 | $r2, |
15082 | self::$UNDEFINED, |
15083 | self::$UNDEFINED |
15084 | ); |
15085 | return $r2; |
15086 | } |
15087 | private function parsenowiki($silence, $boolParams, &$param_preproc, &$param_th) { |
15088 | $key = json_encode([448, $boolParams & 0x1ebf, $param_preproc, $param_th]); |
15089 | $bucket = $this->currPos; |
15090 | $cached = $this->cache[$bucket][$key] ?? null; |
15091 | if ($cached) { |
15092 | $this->currPos = $cached->nextPos; |
15093 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
15094 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
15095 | return $cached->result; |
15096 | } |
15097 | $saved_preproc=$param_preproc; |
15098 | $saved_th=$param_th; |
15099 | $p2 = $this->currPos; |
15100 | // start seq_1 |
15101 | $p3 = $this->currPos; |
15102 | $p4 = $this->currPos; |
15103 | $r5 = $this->discardnowiki_check(true, $boolParams); |
15104 | if ($r5!==self::$FAILED) { |
15105 | $r5 = false; |
15106 | $this->currPos = $p4; |
15107 | } else { |
15108 | $r1 = self::$FAILED; |
15109 | goto seq_1; |
15110 | } |
15111 | // free $p4 |
15112 | $r6 = $this->parsewellformed_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
15113 | // ext <- $r6 |
15114 | if ($r6===self::$FAILED) { |
15115 | $this->currPos = $p3; |
15116 | $r1 = self::$FAILED; |
15117 | goto seq_1; |
15118 | } |
15119 | $r1 = true; |
15120 | seq_1: |
15121 | if ($r1!==self::$FAILED) { |
15122 | $this->savedPos = $p2; |
15123 | $r1 = $this->a188($r6); |
15124 | } |
15125 | // free $p3 |
15126 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
15127 | $this->currPos, |
15128 | $r1, |
15129 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
15130 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
15131 | ); |
15132 | return $r1; |
15133 | } |
15134 | |
15135 | public function parse( $input, $options = [] ) { |
15136 | $this->initInternal( $input, $options ); |
15137 | $startRule = $options['startRule'] ?? '(DEFAULT)'; |
15138 | $result = null; |
15139 | |
15140 | if ( !empty( $options['stream'] ) ) { |
15141 | switch ( $startRule ) { |
15142 | case '(DEFAULT)': |
15143 | case "start_async": |
15144 | return $this->streamstart_async(false, self::newRef(null)); |
15145 | break; |
15146 | default: |
15147 | throw new \Wikimedia\WikiPEG\InternalError( "Can't stream rule $startRule." ); |
15148 | } |
15149 | } else { |
15150 | switch ( $startRule ) { |
15151 | case '(DEFAULT)': |
15152 | case "start": |
15153 | $result = $this->parsestart(false, self::newRef(null)); |
15154 | break; |
15155 | |
15156 | case "table_start_tag": |
15157 | $result = $this->parsetable_start_tag(false, 0, self::newRef(null), self::newRef(null)); |
15158 | break; |
15159 | |
15160 | case "url": |
15161 | $result = $this->parseurl(false, self::newRef(null)); |
15162 | break; |
15163 | |
15164 | case "row_syntax_table_args": |
15165 | $result = $this->parserow_syntax_table_args(false, 0, self::newRef(null), self::newRef(null)); |
15166 | break; |
15167 | |
15168 | case "table_attributes": |
15169 | $result = $this->parsetable_attributes(false, 0, self::newRef(null), self::newRef(null)); |
15170 | break; |
15171 | |
15172 | case "generic_newline_attributes": |
15173 | $result = $this->parsegeneric_newline_attributes(false, 0, self::newRef(null), self::newRef(null)); |
15174 | break; |
15175 | |
15176 | case "tplarg_or_template_or_bust": |
15177 | $result = $this->parsetplarg_or_template_or_bust(false, self::newRef(null)); |
15178 | break; |
15179 | |
15180 | case "extlink": |
15181 | $result = $this->parseextlink(false, 0, self::newRef(null), self::newRef(null)); |
15182 | break; |
15183 | |
15184 | case "list_item": |
15185 | $result = $this->parselist_item(false, 0, self::newRef(null), self::newRef(null)); |
15186 | break; |
15187 | default: |
15188 | throw new \Wikimedia\WikiPEG\InternalError( "Can't start parsing from rule $startRule." ); |
15189 | } |
15190 | } |
15191 | |
15192 | if ( $result !== self::$FAILED && $this->currPos === $this->inputLength ) { |
15193 | return $result; |
15194 | } else { |
15195 | if ( $result !== self::$FAILED && $this->currPos < $this->inputLength ) { |
15196 | $this->fail( 0 ); |
15197 | } |
15198 | throw $this->buildParseException(); |
15199 | } |
15200 | } |
15201 | } |