Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9949 |
|
0.00% |
0 / 371 |
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 / 9945 |
|
0.00% |
0 / 370 |
7185080 | |
0.00% |
0 / 1 |
initialize | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
resetState | |
0.00% |
0 / 3 |
|
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 / 2 |
|
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 / 2 |
|
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 / 22 |
|
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 / 39 |
|
0.00% |
0 / 1 |
72 | |||
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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a109 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a110 | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
156 | |||
a111 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a112 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a113 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a114 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a115 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a116 | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
56 | |||
a117 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |||
a118 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
30 | |||
a119 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a120 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a121 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
2 | |||
a122 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a123 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a124 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
12 | |||
a125 | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 | |||
a126 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
132 | |||
a127 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a128 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a129 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
a130 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
a131 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a132 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a133 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a134 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a135 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a136 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a137 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a138 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a139 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a140 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a141 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
12 | |||
a142 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a143 | |
0.00% |
0 / 1 |
|
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 / 4 |
|
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 |
2 | |||
a150 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a151 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a152 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
a153 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
a154 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a155 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a156 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a162 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a163 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a164 | |
0.00% |
0 / 31 |
|
0.00% |
0 / 1 |
56 | |||
a165 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a166 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a167 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a168 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a169 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
a170 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a171 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
a172 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a173 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a174 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
420 | |||
a175 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
a176 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a177 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
a178 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a179 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
a180 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
a181 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
a182 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
a183 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a184 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a185 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
a186 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a187 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a188 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a189 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a190 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
a191 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
a192 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
a193 | |
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 / 93 |
|
0.00% |
0 / 1 |
506 | |||
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 / 83 |
|
0.00% |
0 / 1 |
462 | |||
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 / 83 |
|
0.00% |
0 / 1 |
462 | |||
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 / 100 |
|
0.00% |
0 / 1 |
812 | |||
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 | private $hasSOLTransparentAtStart = false; |
106 | |
107 | public function resetState() { |
108 | $this->prevOffset = 0; |
109 | $this->headingIndex = 0; |
110 | $this->hasSOLTransparentAtStart = false; |
111 | } |
112 | |
113 | private function assert( $condition, $text ) { |
114 | if ( !$condition ) { |
115 | throw new \RuntimeException( "Grammar.pegphp assertion failure: $text" ); |
116 | } |
117 | } |
118 | |
119 | private function unreachable() { |
120 | throw new UnreachableException( "Grammar.pegphp: this should be unreachable" ); |
121 | } |
122 | |
123 | // Some shorthands for legibility |
124 | private function startOffset() { |
125 | return $this->savedPos; |
126 | } |
127 | |
128 | private function endOffset() { |
129 | return $this->currPos; |
130 | } |
131 | |
132 | private function tsrOffsets( $flag = 'default' ): SourceRange { |
133 | switch ( $flag ) { |
134 | case 'start': |
135 | return new SourceRange( $this->savedPos, $this->savedPos ); |
136 | case 'end': |
137 | return new SourceRange( $this->currPos, $this->currPos ); |
138 | default: |
139 | return new SourceRange( $this->savedPos, $this->currPos ); |
140 | } |
141 | } |
142 | |
143 | /* |
144 | * Emit a chunk of tokens to our consumers. Once this has been done, the |
145 | * current expression can return an empty list (true). |
146 | */ |
147 | private function emitChunk( $tokens ) { |
148 | // FIXME: We don't expect nulls here, but looks like |
149 | // hack from I1c695ab6cdd3655e98877c175ddbabdee9dc44b7 |
150 | // introduces them. Work around it for now! |
151 | if ( !$tokens ) { |
152 | return []; |
153 | } |
154 | |
155 | // Shift tsr of all tokens by the pipeline offset |
156 | TokenUtils::shiftTokenTSR( $tokens, $this->pipelineOffset ); |
157 | $this->env->log( 'trace/peg', $this->options['pipelineId'] ?? '0', '----> ', $tokens ); |
158 | |
159 | $i = null; |
160 | $n = count( $tokens ); |
161 | |
162 | // Enforce parsing resource limits |
163 | for ( $i = 0; $i < $n; $i++ ) { |
164 | TokenizerUtils::enforceParserResourceLimits( $this->env, $tokens[ $i ] ); |
165 | } |
166 | |
167 | return $tokens; |
168 | } |
169 | |
170 | /* ------------------------------------------------------------------------ |
171 | * Extension tags should be parsed with higher priority than anything else. |
172 | * |
173 | * The trick we use is to strip out the content inside a matching tag-pair |
174 | * and not tokenize it. The content, if it needs to parsed (for example, |
175 | * for <ref>, <*include*> tags), is parsed in a fresh tokenizer context |
176 | * which means any error correction that needs to happen is restricted to |
177 | * the scope of the extension content and doesn't spill over to the higher |
178 | * level. Ex: <math><!--foo</math>. |
179 | * |
180 | * IGNORE: {{ this just balances the blocks in this comment for pegjs |
181 | * |
182 | * This trick also lets us prevent extension content (that don't accept WT) |
183 | * from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>) |
184 | * We don't want the "}}" being treated as a template closing tag and |
185 | * closing outer templates. |
186 | * --------------------------------------------------------------------- */ |
187 | |
188 | private function isXMLTag( string $name ): bool { |
189 | $lName = mb_strtolower( $name ); |
190 | return isset( Consts::$HTML['HTML5Tags'][$lName] ) || |
191 | isset( Consts::$HTML['OlderHTMLTags'][$lName] ); |
192 | } |
193 | |
194 | |
195 | |
196 | // cache init |
197 | protected $cache = []; |
198 | |
199 | // expectations |
200 | protected $expectations = [ |
201 | 0 => ["type" => "end", "description" => "end of input"], |
202 | 1 => ["type" => "other", "description" => "start"], |
203 | 2 => ["type" => "other", "description" => "table_start_tag"], |
204 | 3 => ["type" => "class", "value" => "['{]", "description" => "['{]"], |
205 | 4 => ["type" => "literal", "value" => "&", "description" => "\"&\""], |
206 | 5 => ["type" => "other", "description" => "table_attributes"], |
207 | 6 => ["type" => "other", "description" => "generic_newline_attributes"], |
208 | 7 => ["type" => "any", "description" => "any character"], |
209 | 8 => ["type" => "other", "description" => "extlink"], |
210 | 9 => ["type" => "other", "description" => "tlb"], |
211 | 10 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"], |
212 | 11 => ["type" => "literal", "value" => "<!--", "description" => "\"<!--\""], |
213 | 12 => ["type" => "literal", "value" => "-->", "description" => "\"-->\""], |
214 | 13 => ["type" => "literal", "value" => "|", "description" => "\"|\""], |
215 | 14 => ["type" => "literal", "value" => "{{!}}", "description" => "\"{{!}}\""], |
216 | 15 => ["type" => "literal", "value" => "//", "description" => "\"//\""], |
217 | 16 => ["type" => "class", "value" => "[A-Za-z]", "description" => "[A-Za-z]"], |
218 | 17 => ["type" => "class", "value" => "[-A-Za-z0-9+.]", "description" => "[-A-Za-z0-9+.]"], |
219 | 18 => ["type" => "literal", "value" => ":", "description" => "\":\""], |
220 | 19 => ["type" => "literal", "value" => "[", "description" => "\"[\""], |
221 | 20 => ["type" => "class", "value" => "[0-9A-Fa-f:.]", "description" => "[0-9A-Fa-f:.]"], |
222 | 21 => ["type" => "literal", "value" => "]", "description" => "\"]\""], |
223 | 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{]"], |
224 | 23 => ["type" => "literal", "value" => "=", "description" => "\"=\""], |
225 | 24 => ["type" => "class", "value" => "[\\0/=>]", "description" => "[\\0/=>]"], |
226 | 25 => ["type" => "class", "value" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]"], |
227 | 26 => ["type" => "literal", "value" => ";", "description" => "\";\""], |
228 | 27 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""], |
229 | 28 => ["type" => "literal", "value" => "\x0d\x0a", "description" => "\"\\r\\n\""], |
230 | 29 => ["type" => "literal", "value" => "{", "description" => "\"{\""], |
231 | 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}]"], |
232 | 31 => ["type" => "class", "value" => "[\"'=]", "description" => "[\"'=]"], |
233 | 32 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]"], |
234 | 33 => ["type" => "literal", "value" => "'", "description" => "\"'\""], |
235 | 34 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""], |
236 | 35 => ["type" => "literal", "value" => "/", "description" => "\"/\""], |
237 | 36 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]"], |
238 | 37 => ["type" => "class", "value" => "[ \\t\\n\\r\\x0c]", "description" => "[ \\t\\n\\r\\x0c]"], |
239 | 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]"], |
240 | 39 => ["type" => "class", "value" => "[&|{\\-!}=]", "description" => "[&|{\\-!}=]"], |
241 | 40 => ["type" => "class", "value" => "[']", "description" => "[']"], |
242 | 41 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""], |
243 | 42 => ["type" => "class", "value" => "[*#:;]", "description" => "[*#:;]"], |
244 | 43 => ["type" => "literal", "value" => "{{", "description" => "\"{{\""], |
245 | 44 => ["type" => "class", "value" => "[^{}&<\\-!\\['\\r\\n|]", "description" => "[^{}&<\\-!\\['\\r\\n|]"], |
246 | 45 => ["type" => "class", "value" => "[{}&<\\-!\\[]", "description" => "[{}&<\\-!\\[]"], |
247 | 46 => ["type" => "class", "value" => "[^{}&<\\-!\\[\"\\r\\n|]", "description" => "[^{}&<\\-!\\[\"\\r\\n|]"], |
248 | 47 => ["type" => "class", "value" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]", "description" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]"], |
249 | 48 => ["type" => "literal", "value" => "<", "description" => "\"<\""], |
250 | 49 => ["type" => "class", "value" => "[^{}&<\\-|/'>]", "description" => "[^{}&<\\-|/'>]"], |
251 | 50 => ["type" => "class", "value" => "[{}&\\-|/]", "description" => "[{}&\\-|/]"], |
252 | 51 => ["type" => "class", "value" => "[^{}&<\\-|/\">]", "description" => "[^{}&<\\-|/\">]"], |
253 | 52 => ["type" => "class", "value" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]", "description" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]"], |
254 | 53 => ["type" => "literal", "value" => "__", "description" => "\"__\""], |
255 | 54 => ["type" => "class", "value" => "[^-'<[{\\n\\r:;\\]}|!=]", "description" => "[^-'<[{\\n\\r:;\\]}|!=]"], |
256 | 55 => ["type" => "literal", "value" => "-", "description" => "\"-\""], |
257 | 56 => ["type" => "literal", "value" => "''", "description" => "\"''\""], |
258 | 57 => ["type" => "literal", "value" => "}", "description" => "\"}\""], |
259 | 58 => ["type" => "class", "value" => "[ \\t\\n\\r\\0\\x0b]", "description" => "[ \\t\\n\\r\\0\\x0b]"], |
260 | 59 => ["type" => "literal", "value" => "----", "description" => "\"----\""], |
261 | 60 => ["type" => "literal", "value" => "{{{", "description" => "\"{{{\""], |
262 | 61 => ["type" => "literal", "value" => "}}}", "description" => "\"}}}\""], |
263 | 62 => ["type" => "literal", "value" => "}}", "description" => "\"}}\""], |
264 | 63 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""], |
265 | 64 => ["type" => "literal", "value" => ">", "description" => "\">\""], |
266 | 65 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"], |
267 | 66 => ["type" => "literal", "value" => "ISBN", "description" => "\"ISBN\""], |
268 | 67 => ["type" => "class", "value" => "[xX]", "description" => "[xX]"], |
269 | 68 => ["type" => "literal", "value" => "+", "description" => "\"+\""], |
270 | 69 => ["type" => "literal", "value" => "</>", "description" => "\"</>\""], |
271 | 70 => ["type" => "literal", "value" => "#parsoid\x00fragment:", "description" => "\"#parsoid\\u0000fragment:\""], |
272 | 71 => ["type" => "class", "value" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]", "description" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]"], |
273 | 72 => ["type" => "class", "value" => "[!<\\-\\}\\]\\n\\r]", "description" => "[!<\\-\\}\\]\\n\\r]"], |
274 | 73 => ["type" => "literal", "value" => "RFC", "description" => "\"RFC\""], |
275 | 74 => ["type" => "literal", "value" => "PMID", "description" => "\"PMID\""], |
276 | 75 => ["type" => "literal", "value" => "-{", "description" => "\"-{\""], |
277 | 76 => ["type" => "literal", "value" => "}-", "description" => "\"}-\""], |
278 | 77 => ["type" => "literal", "value" => "!", "description" => "\"!\""], |
279 | 78 => ["type" => "class", "value" => "[^\\t\\n\\v />\\0]", "description" => "[^\\t\\n\\v />\\0]"], |
280 | 79 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""], |
281 | 80 => ["type" => "literal", "value" => "||", "description" => "\"||\""], |
282 | 81 => ["type" => "literal", "value" => "{{!}}{{!}}", "description" => "\"{{!}}{{!}}\""], |
283 | 82 => ["type" => "literal", "value" => "=>", "description" => "\"=>\""], |
284 | 83 => ["type" => "class", "value" => "[-+A-Z]", "description" => "[-+A-Z]"], |
285 | 84 => ["type" => "class", "value" => "[^{}|;]", "description" => "[^{}|;]"], |
286 | 85 => ["type" => "class", "value" => "[a-z]", "description" => "[a-z]"], |
287 | 86 => ["type" => "class", "value" => "[-a-zA-Z]", "description" => "[-a-zA-Z]"], |
288 | ]; |
289 | |
290 | // actions |
291 | private function a0() { |
292 | |
293 | $this->startTime = null; |
294 | if ( $this->env->profiling() ) { |
295 | $profile = $this->env->getCurrentProfile(); |
296 | $this->startTime = microtime( true ); |
297 | } |
298 | return true; |
299 | |
300 | } |
301 | private function a1($t) { |
302 | |
303 | if ( $this->env->profiling() ) { |
304 | $profile = $this->env->getCurrentProfile(); |
305 | $profile->bumpTimeUse( |
306 | 'PEG', 1000 * ( microtime( true ) - $this->startTime ), 'PEG' ); |
307 | } |
308 | return true; |
309 | |
310 | } |
311 | private function a2($t) { |
312 | return $t; |
313 | } |
314 | private function a3() { |
315 | |
316 | // "tlb" matches "block" matches "sol" matches "newlineToken" |
317 | // But, "tlb" is prefixed with a !eof clause, so, we should only |
318 | // get here on eof. So, safe to unconditionally terminate the |
319 | // generator loop here. |
320 | return false; |
321 | |
322 | } |
323 | private function a4($t, $n) { |
324 | |
325 | if ( count( $t ) ) { |
326 | $ret = TokenizerUtils::flattenIfArray( $t ); |
327 | } else { |
328 | $ret = []; |
329 | } |
330 | if ( count( $n ) ) { |
331 | PHPUtils::pushArray($ret, $n); |
332 | } |
333 | $ret[] = new EOFTk(); |
334 | return $ret; |
335 | |
336 | } |
337 | private function a5($sc) { |
338 | return $this->endOffset(); |
339 | } |
340 | private function a6($sc, $startPos, $b, $p) { |
341 | $this->unreachable(); |
342 | } |
343 | private function a7($sc, $startPos, $b, $p, $ta) { |
344 | return $this->endOffset(); |
345 | } |
346 | private function a8($sc, $startPos, $b, $p, $ta, $tsEndPos, $s2) { |
347 | |
348 | $coms = TokenizerUtils::popComments( $ta ); |
349 | if ( $coms ) { |
350 | $tsEndPos = $coms['commentStartPos']; |
351 | } |
352 | |
353 | $dp = new DataParsoid; |
354 | $dp->tsr = new SourceRange( $startPos, $tsEndPos ); |
355 | if ( $p !== '|' ) { |
356 | // Variation from default |
357 | $dp->startTagSrc = $b . $p; |
358 | } |
359 | |
360 | return array_merge( $sc, |
361 | [ new TagTk( 'table', $ta, $dp ) ], |
362 | $coms ? $coms['buf'] : [], |
363 | $s2 ); |
364 | |
365 | } |
366 | private function a9($proto, $addr, $he) { |
367 | return $he; |
368 | } |
369 | private function a10($proto, $addr, $r) { |
370 | return $r; |
371 | } |
372 | private function a11($proto, $addr, $c) { |
373 | return $c; |
374 | } |
375 | private function a12($proto, $addr, $path) { |
376 | return $addr !== '' || count( $path ) > 0; |
377 | } |
378 | private function a13($proto, $addr, $path) { |
379 | |
380 | return TokenizerUtils::flattenString( array_merge( [ $proto, $addr ], $path ) ); |
381 | |
382 | } |
383 | private function a14($as, $s, $p) { |
384 | |
385 | return [ $as, $s, $p ]; |
386 | |
387 | } |
388 | private function a15($b) { |
389 | return $b; |
390 | } |
391 | private function a16($r) { |
392 | return TokenizerUtils::flattenIfArray( $r ); |
393 | } |
394 | private function a17() { |
395 | return $this->endOffset(); |
396 | } |
397 | private function a18($p0, $addr, $target) { |
398 | return TokenizerUtils::flattenString( [ $addr, $target ] ); |
399 | } |
400 | private function a19($p0, $flat) { |
401 | |
402 | // Protocol must be valid and there ought to be at least one |
403 | // post-protocol character. So strip last char off target |
404 | // before testing protocol. |
405 | if ( is_array( $flat ) ) { |
406 | // There are templates present, alas. |
407 | return count( $flat ) > 0; |
408 | } |
409 | return Utils::isProtocolValid( substr( $flat, 0, -1 ), $this->env ); |
410 | |
411 | } |
412 | private function a20($p0, $flat) { |
413 | return $this->endOffset(); |
414 | } |
415 | private function a21($p0, $flat, $p1, $sp) { |
416 | return $this->endOffset(); |
417 | } |
418 | private function a22($p0, $flat, $p1, $sp, $p2, $content) { |
419 | return $this->endOffset(); |
420 | } |
421 | private function a23($p0, $flat, $p1, $sp, $p2, $content, $p3) { |
422 | |
423 | $tsr1 = new SourceRange( $p0, $p1 ); |
424 | $tsr2 = new SourceRange( $p2, $p3 ); |
425 | $dp = new DataParsoid; |
426 | $dp->tsr = $this->tsrOffsets(); |
427 | $dp->getTemp()->extLinkContentOffsets = $tsr2; |
428 | return [ |
429 | new SelfclosingTagTk( |
430 | 'extlink', |
431 | [ |
432 | new KV( 'href', $flat, $tsr1->expandTsrV() ), |
433 | new KV( 'mw:content', $content ?? '', $tsr2->expandTsrV() ), |
434 | new KV( 'spaces', $sp ) |
435 | ], |
436 | $dp |
437 | ) |
438 | ]; |
439 | } |
440 | private function a24($r) { |
441 | return $r; |
442 | } |
443 | private function a25($b) { |
444 | |
445 | // Clear the tokenizer's backtracking cache after matching each |
446 | // toplevelblock. There won't be any backtracking as a document is just a |
447 | // sequence of toplevelblocks, so the cache for previous toplevelblocks |
448 | // will never be needed. |
449 | $end = $this->startOffset(); |
450 | for ( ; $this->prevOffset < $end; $this->prevOffset++ ) { |
451 | unset( $this->cache[$this->prevOffset] ); |
452 | } |
453 | |
454 | $tokens = null; |
455 | if ( is_array( $b ) && count( $b ) ) { |
456 | $tokens = TokenizerUtils::flattenIfArray( $b ); |
457 | } elseif ( is_string( $b ) ) { |
458 | $tokens = [ $b ]; |
459 | } |
460 | |
461 | // Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline. |
462 | return $this->emitChunk( $tokens ); |
463 | |
464 | } |
465 | private function a26() { |
466 | return [ new NlTk( $this->tsrOffsets() ) ]; |
467 | } |
468 | private function a27($c, $cEnd) { |
469 | |
470 | $data = WTUtils::encodeComment( $c ); |
471 | $dp = new DataParsoid; |
472 | $dp->tsr = $this->tsrOffsets(); |
473 | if ( $cEnd !== '-->' ) { |
474 | $dp->unclosedComment = true; |
475 | } |
476 | return [ new CommentTk( $data, $dp ) ]; |
477 | |
478 | } |
479 | private function a28($p) { |
480 | return Utils::isProtocolValid( $p, $this->env ); |
481 | } |
482 | private function a29($p) { |
483 | return $p; |
484 | } |
485 | private function a30($annOrExtTag, $h, $extlink, $intemplate, &$preproc, $equal, $table, $templateArg, $tableCellArg, $semicolon, $arrow, $linkdesc, $colon, &$th) { |
486 | |
487 | return TokenizerUtils::inlineBreaks( $this->input, $this->endOffset(), [ |
488 | 'annOrExtTag' => $annOrExtTag, |
489 | 'h' => $h, |
490 | 'extlink' => $extlink, |
491 | 'intemplate' => $intemplate, |
492 | 'preproc' => $preproc, |
493 | 'equal' => $equal, |
494 | 'table' => $table, |
495 | 'templateArg' => $templateArg, |
496 | 'tableCellArg' => $tableCellArg, |
497 | 'semicolon' => $semicolon, |
498 | 'arrow' => $arrow, |
499 | 'linkdesc' => $linkdesc, |
500 | 'colon' => $colon, |
501 | 'th' => $th |
502 | ], $this->env ); |
503 | |
504 | } |
505 | private function a31($t) { |
506 | |
507 | return $t; |
508 | |
509 | } |
510 | private function a32($cc) { |
511 | |
512 | // if this is an invalid entity, don't tag it with 'mw:Entity' |
513 | // note that some entities (like ∾̳) decode to 2 codepoints! |
514 | if ( mb_strlen( $cc ) > 2 /* decoded entity would be 1-2 codepoints */ ) { |
515 | return $cc; |
516 | } |
517 | $dpStart = new DataParsoid; |
518 | $dpStart->src = $this->text(); |
519 | $dpStart->srcContent = $cc; |
520 | $dpStart->tsr = $this->tsrOffsets( 'start' ); |
521 | $dpEnd = new DataParsoid; |
522 | $dpEnd->tsr = $this->tsrOffsets( 'end' ); |
523 | return [ |
524 | // If this changes, the nowiki extension's toDOM will need to follow suit |
525 | new TagTk( 'span', [ new KV( 'typeof', 'mw:Entity' ) ], $dpStart ), |
526 | $cc, |
527 | new EndTagTk( 'span', [], $dpEnd ) |
528 | ]; |
529 | |
530 | } |
531 | private function a33($s) { |
532 | return $this->endOffset(); |
533 | } |
534 | private function a34($s, $namePos0, $name) { |
535 | return $this->endOffset(); |
536 | } |
537 | private function a35($s, $namePos0, $name, $namePos1, $v) { |
538 | return $v; |
539 | } |
540 | private function a36($s, $namePos0, $name, $namePos1, $vd) { |
541 | |
542 | // NB: Keep in sync w/ generic_newline_attribute |
543 | $res = null; |
544 | // Encapsulate protected attributes. |
545 | if ( gettype( $name ) === 'string' ) { |
546 | $name = TokenizerUtils::protectAttrs( $name ); |
547 | } |
548 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
549 | if ( $vd !== null ) { |
550 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
551 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
552 | } else { |
553 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
554 | } |
555 | if ( is_array( $name ) ) { |
556 | $res->ksrc = $nameSO->substr( $this->input ); |
557 | } |
558 | return $res; |
559 | |
560 | } |
561 | private function a37($s) { |
562 | |
563 | if ( $s !== '' ) { |
564 | return [ $s ]; |
565 | } else { |
566 | return []; |
567 | } |
568 | |
569 | } |
570 | private function a38($c) { |
571 | return new KV( $c, '' ); |
572 | } |
573 | private function a39($namePos0, $name) { |
574 | return $this->endOffset(); |
575 | } |
576 | private function a40($namePos0, $name, $namePos1, $v) { |
577 | return $v; |
578 | } |
579 | private function a41($namePos0, $name, $namePos1, $vd) { |
580 | |
581 | // NB: Keep in sync w/ table_attibute |
582 | $res = null; |
583 | // Encapsulate protected attributes. |
584 | if ( is_string( $name ) ) { |
585 | $name = TokenizerUtils::protectAttrs( $name ); |
586 | } |
587 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
588 | if ( $vd !== null ) { |
589 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
590 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
591 | } else { |
592 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
593 | } |
594 | if ( is_array( $name ) ) { |
595 | $res->ksrc = $nameSO->substr( $this->input ); |
596 | } |
597 | return $res; |
598 | |
599 | } |
600 | private function a42($s) { |
601 | return $s; |
602 | } |
603 | private function a43($c) { |
604 | |
605 | return TokenizerUtils::flattenStringlist( $c ); |
606 | |
607 | } |
608 | private function a44($lc) { |
609 | return $lc; |
610 | } |
611 | private function a45($bullets, $colons, $d) { |
612 | |
613 | $bulletToks = []; |
614 | // Leave bullets as an array -- list handler expects this |
615 | // TSR: +1 for the leading ";" |
616 | $numBullets = count( $bullets ) + 1; |
617 | $tsr = $this->tsrOffsets( 'start' ); |
618 | $tsr->end += $numBullets; |
619 | $li1Bullets = $bullets; |
620 | $li1Bullets[] = ';'; |
621 | $dp = new DataParsoid; |
622 | $dp->tsr = $tsr; |
623 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li1Bullets, $tsr->expandTsrV() ) ], $dp ); |
624 | foreach ( $colons as $colon) { |
625 | if ( $colon[0] ) { // can be null because of "?" in dtdd_colon |
626 | $bulletToks[] = $colon[0]; |
627 | } |
628 | $cpos = $colon[1]; |
629 | // TSR: -1 for the intermediate ":" |
630 | $li2Bullets = $bullets; |
631 | $li2Bullets[] = ':'; |
632 | $tsr2 = new SourceRange( $cpos - 1, $cpos ); |
633 | $dp2 = new DataParsoid; |
634 | $dp2->tsr = $tsr2; |
635 | $dp2->stx = 'row'; |
636 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li2Bullets, $tsr2->expandTsrV() ) ], $dp2 ); |
637 | } |
638 | |
639 | if ( $d ) { |
640 | $bulletToks = array_merge( $bulletToks, $d ); |
641 | } |
642 | return $bulletToks; |
643 | |
644 | } |
645 | private function a46($bullets, $tbl, $line) { |
646 | |
647 | // Leave bullets as an array -- list handler expects this |
648 | $tsr = $this->tsrOffsets( 'start' ); |
649 | $tsr->end += count( $bullets ); |
650 | $dp = new DataParsoid; |
651 | $dp->tsr = $tsr; |
652 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
653 | return TokenizerUtils::flattenIfArray( [ $li, $tbl, $line ?: [] ] ); |
654 | |
655 | } |
656 | private function a47($bullets, $c) { |
657 | |
658 | // Leave bullets as an array -- list handler expects this |
659 | $tsr = $this->tsrOffsets( 'start' ); |
660 | $tsr->end += count( $bullets ); |
661 | $dp = new DataParsoid; |
662 | $dp->tsr = $tsr; |
663 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
664 | return array_merge( [ $li ], $c ?: [] ); |
665 | |
666 | } |
667 | private function a48() { |
668 | return $this->endOffset() === $this->inputLength; |
669 | } |
670 | private function a49($r, $cil, $bl) { |
671 | |
672 | $this->hasSOLTransparentAtStart = true; |
673 | return array_merge( [ $r ], $cil, $bl ?: [] ); |
674 | |
675 | } |
676 | private function a50($a) { |
677 | return $a; |
678 | } |
679 | private function a51($a, $b) { |
680 | return [ $a, $b ]; |
681 | } |
682 | private function a52($m) { |
683 | |
684 | return Utils::decodeWtEntities( $m ); |
685 | |
686 | } |
687 | private function a53($q, $x, $ill) { |
688 | return array_merge( [$x], $ill ?: [] ); |
689 | } |
690 | private function a54($q, $t) { |
691 | return $t; |
692 | } |
693 | private function a55($q, $r) { |
694 | return count( $r ) > 0 || $q !== ''; |
695 | } |
696 | private function a56($q, $r) { |
697 | |
698 | array_unshift( $r, $q ); |
699 | return TokenizerUtils::flattenString( $r ); |
700 | |
701 | } |
702 | private function a57($s, $t, $q) { |
703 | |
704 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() - strlen( $q ) ); |
705 | |
706 | } |
707 | private function a58($s, $t) { |
708 | |
709 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() ); |
710 | |
711 | } |
712 | private function a59($r) { |
713 | |
714 | return TokenizerUtils::flattenString( $r ); |
715 | |
716 | } |
717 | private function a60() { |
718 | |
719 | if ( preg_match( $this->reUrltextLookahead, $this->input, $m, 0, $this->currPos ) ) { |
720 | $plain = $m[1]; |
721 | $this->urltextPlainSegment = $plain; |
722 | $this->urltextFoundAutolink = ( $m[2] ?? '' ) !== ''; |
723 | return (bool)strlen( $plain ); |
724 | } else { |
725 | $this->urltextFoundAutolink = false; |
726 | return false; |
727 | } |
728 | |
729 | } |
730 | private function a61() { |
731 | |
732 | $this->currPos += strlen( $this->urltextPlainSegment ); |
733 | return $this->urltextPlainSegment; |
734 | |
735 | } |
736 | private function a62() { |
737 | return $this->urltextFoundAutolink; |
738 | } |
739 | private function a63($al) { |
740 | return $al; |
741 | } |
742 | private function a64($he) { |
743 | return $he; |
744 | } |
745 | private function a65($bs) { |
746 | return $bs; |
747 | } |
748 | private function a66($c) { |
749 | return $this->endOffset(); |
750 | } |
751 | private function a67($c, $cpos) { |
752 | |
753 | return [ $c, $cpos ]; |
754 | |
755 | } |
756 | private function a68($tl) { |
757 | |
758 | return $tl; |
759 | |
760 | } |
761 | private function a69($sp, $elc, $st) { |
762 | |
763 | $this->hasSOLTransparentAtStart = ( count( $st ) > 0 ); |
764 | return [ $sp, $elc ?? [], $st ]; |
765 | |
766 | } |
767 | private function a70() { |
768 | return $this->endOffset() === 0 && !$this->pipelineOffset; |
769 | } |
770 | private function a71($rw, $sp, $c, $wl) { |
771 | |
772 | return count( $wl ) === 1 && $wl[0] instanceof Token; |
773 | |
774 | } |
775 | private function a72($rw, $sp, $c, $wl) { |
776 | |
777 | $link = $wl[0]; |
778 | if ( $sp ) { |
779 | $rw .= $sp; |
780 | } |
781 | if ( $c ) { |
782 | $rw .= $c; |
783 | } |
784 | // Build a redirect token |
785 | $dp = new DataParsoid; |
786 | $dp->src = $rw; |
787 | $dp->tsr = $this->tsrOffsets(); |
788 | $dp->linkTk = $link; |
789 | $redirect = new SelfclosingTagTk( 'mw:redirect', |
790 | // Put 'href' into attributes so it gets template-expanded |
791 | [ $link->getAttributeKV( 'href' ) ], |
792 | $dp |
793 | ); |
794 | return $redirect; |
795 | |
796 | } |
797 | private function a73($st, $tl) { |
798 | |
799 | return array_merge( $st, $tl ); |
800 | |
801 | } |
802 | private function a74($s, $os, $so) { |
803 | return array_merge( $os, $so ); |
804 | } |
805 | private function a75($s, $s2, $bl) { |
806 | |
807 | return array_merge( $s, $s2 ?: [], $bl ); |
808 | |
809 | } |
810 | private function a76(&$preproc, $t) { |
811 | |
812 | $preproc = null; |
813 | return $t; |
814 | |
815 | } |
816 | private function a77($v) { |
817 | return $v; |
818 | } |
819 | private function a78($e) { |
820 | return $e; |
821 | } |
822 | private function a79() { |
823 | return Utils::isUniWord(Utils::lastUniChar( $this->input, $this->endOffset() ) ); |
824 | } |
825 | private function a80($bs) { |
826 | |
827 | if ( $this->siteConfig->isBehaviorSwitch( $bs ) ) { |
828 | $dp = new DataParsoid; |
829 | $dp->tsr = $this->tsrOffsets(); |
830 | $dp->src = $bs; |
831 | $dp->magicSrc = $bs; |
832 | return [ |
833 | new SelfclosingTagTk( 'behavior-switch', [ new KV( 'word', $bs ) ], $dp ) |
834 | ]; |
835 | } else { |
836 | return [ $bs ]; |
837 | } |
838 | |
839 | } |
840 | private function a81($quotes) { |
841 | |
842 | // sequences of four or more than five quotes are assumed to start |
843 | // with some number of plain-text apostrophes. |
844 | $plainticks = 0; |
845 | $result = []; |
846 | if ( strlen( $quotes ) === 4 ) { |
847 | $plainticks = 1; |
848 | } elseif ( strlen( $quotes ) > 5 ) { |
849 | $plainticks = strlen( $quotes ) - 5; |
850 | } |
851 | if ( $plainticks > 0 ) { |
852 | $result[] = substr( $quotes, 0, $plainticks ); |
853 | } |
854 | // mw-quote token will be consumed in token transforms |
855 | $tsr = $this->tsrOffsets(); |
856 | $tsr->start += $plainticks; |
857 | $dp = new DataParsoid; |
858 | $dp->tsr = $tsr; |
859 | $mwq = new SelfclosingTagTk( 'mw-quote', |
860 | [ new KV( 'value', substr( $quotes, $plainticks ) ) ], |
861 | $dp ); |
862 | if ( strlen( $quotes ) > 2 ) { |
863 | $mwq->addAttribute( 'isSpace_1', $tsr->start > 0 && substr( $this->input, $tsr->start - 1, 1 ) === ' '); |
864 | $mwq->addAttribute( 'isSpace_2', $tsr->start > 1 && substr( $this->input, $tsr->start - 2, 1 ) === ' '); |
865 | } |
866 | $result[] = $mwq; |
867 | return $result; |
868 | |
869 | } |
870 | private function a82($sc, $startPos, $p, $b) { |
871 | |
872 | $dp = new DataParsoid; |
873 | $dp->tsr = new SourceRange( $startPos, $this->endOffset() ); |
874 | $tblEnd = new EndTagTk( 'table', [], $dp ); |
875 | if ( $p !== '|' ) { |
876 | // p+"<brace-char>" is triggering some bug in pegJS |
877 | // I cannot even use that expression in the comment! |
878 | $tblEnd->dataParsoid->endTagSrc = $p . $b; |
879 | } |
880 | array_push( $sc, $tblEnd ); |
881 | return $sc; |
882 | |
883 | } |
884 | private function a83() { |
885 | |
886 | // Use the sol flag only at the start of the input |
887 | // Flag should always be an actual boolean (not falsy or undefined) |
888 | $this->assert( is_bool( $this->options['sol'] ), 'sol should be boolean' ); |
889 | return $this->endOffset() === 0 && $this->options['sol']; |
890 | |
891 | } |
892 | private function a84() { |
893 | |
894 | return []; |
895 | |
896 | } |
897 | private function a85($p, $c) { |
898 | |
899 | $dp = new DataParsoid; |
900 | $dp->tsr = new SourceRange( $p, $this->endOffset() ); |
901 | $dp->tokens = TokenizerUtils::flattenIfArray( $c ); |
902 | return [ |
903 | new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:EmptyLine' ) ], $dp ) |
904 | ]; |
905 | |
906 | } |
907 | private function a86($rw) { |
908 | |
909 | return preg_match( $this->env->getSiteConfig()->getMagicWordMatcher( 'redirect' ), $rw ); |
910 | |
911 | } |
912 | private function a87($t) { |
913 | |
914 | $tagName = mb_strtolower( $t->getName() ); |
915 | switch ( $tagName ) { |
916 | case 'includeonly': |
917 | $typeOf = 'mw:Includes/IncludeOnly'; |
918 | break; |
919 | case 'noinclude': |
920 | $typeOf = 'mw:Includes/NoInclude'; |
921 | break; |
922 | case 'onlyinclude': |
923 | $typeOf = 'mw:Includes/OnlyInclude'; |
924 | break; |
925 | default: |
926 | $this->unreachable(); |
927 | } |
928 | |
929 | $isEnd = ( $t instanceof EndTagTk ); |
930 | if ( $isEnd ) { |
931 | $typeOf .= '/End'; |
932 | } |
933 | |
934 | $dp = new DataParsoid; |
935 | $dp->tsr = $t->dataParsoid->tsr; |
936 | $dp->src = $dp->tsr->substr( $this->input ); |
937 | |
938 | $meta = new SelfclosingTagTk( |
939 | 'meta', [ new KV( 'typeof', $typeOf ) ], $dp |
940 | ); |
941 | |
942 | $startTagWithContent = false; |
943 | if ( $t instanceof TagTk ) { |
944 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
945 | $startTagWithContent = preg_match( |
946 | $endTagRE, $this->input, $content, 0, $dp->tsr->start |
947 | ); |
948 | } |
949 | |
950 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
951 | switch ( $tagName ) { |
952 | case 'includeonly': |
953 | // Drop the tag |
954 | return []; |
955 | case 'noinclude': |
956 | if ( $startTagWithContent ) { |
957 | // Skip the content |
958 | $this->currPos = $dp->tsr->start + strlen( $content[0] ); |
959 | } |
960 | // Drop it all |
961 | return []; |
962 | case 'onlyinclude': |
963 | if ( $startTagWithContent ) { |
964 | // Parse the content, strip eof, and shift tsr |
965 | $contentSrc = $content[0]; |
966 | $endOffset = $dp->tsr->start + strlen( $contentSrc ); |
967 | $endTagWidth = strlen( $content[1] ); |
968 | $tagOffsets = new DomSourceRange( |
969 | $dp->tsr->start, $endOffset, |
970 | $dp->tsr->length(), $endTagWidth |
971 | ); |
972 | $this->currPos = $tagOffsets->innerEnd(); |
973 | $justContent = $tagOffsets->stripTags( $contentSrc ); |
974 | // FIXME: What about the pipelineOpts of the current pipeline? |
975 | $tokenizer = new PegTokenizer( $this->env ); |
976 | $tokenizer->setSourceOffsets( $tagOffsets->innerRange() ); |
977 | $contentToks = $tokenizer->tokenizeSync( |
978 | $justContent, [ 'sol' => true ] |
979 | ); |
980 | TokenUtils::stripEOFTkFromTokens( $contentToks ); |
981 | array_unshift( $contentToks, $t ); |
982 | return $contentToks; |
983 | } else { |
984 | return [$t]; |
985 | } |
986 | } |
987 | } else { |
988 | $tokens = [ $meta ]; |
989 | if ( $tagName === 'includeonly' ) { |
990 | if ( $startTagWithContent ) { |
991 | // Add the content / end tag to the meta for roundtripping |
992 | $dp->tsr->end = $dp->tsr->start + strlen( $content[0] ); |
993 | $dp->src = $dp->tsr->substr( $this->input ); |
994 | $meta->dataMw = new DataMw( [ 'src' => $dp->src ] ); |
995 | $this->currPos = $dp->tsr->end; |
996 | // FIXME: We shouldn't bother with this because SelfclosingTk |
997 | // was never balanced to begin with |
998 | if ( strlen( $content[1] ) ) { |
999 | $eDp = new DataParsoid; |
1000 | $eDp->tsr = new SourceRange( $dp->tsr->end, $dp->tsr->end ); |
1001 | $eDp->src = $eDp->tsr->substr( $this->input ); |
1002 | $tokens[] = new SelfclosingTagTk( 'meta', [ |
1003 | new KV( 'typeof', 'mw:Includes/IncludeOnly/End' ) |
1004 | ], $eDp ); |
1005 | } |
1006 | } elseif ( !( $t instanceof EndTagTk ) ) { |
1007 | $meta->dataMw = new DataMw( [ 'src' => $dp->src ] ); |
1008 | } else { |
1009 | // Compatibility with the legacy parser which leaves these in |
1010 | // as strings, which the sanitizer will do for us |
1011 | array_pop( $tokens ); |
1012 | $tokens[] = $t; |
1013 | } |
1014 | } |
1015 | return $tokens; |
1016 | } |
1017 | |
1018 | } |
1019 | private function a88($t) { |
1020 | |
1021 | $end = ( $t instanceof EndTagTk ); |
1022 | $attribs = $t->attribs; |
1023 | $tagName = mb_strtolower( $t->getName() ); |
1024 | $tsr = $t->dataParsoid->tsr; |
1025 | |
1026 | // We already applied this logic in WTUtils::isAnnotationTag |
1027 | // to get here so we can make some assumptions. |
1028 | if ( !$this->siteConfig->isAnnotationTag( $tagName ) ) { |
1029 | $pipepos = strpos( $tagName, '|' ); |
1030 | $strBeforePipe = substr( $tagName, 0, $pipepos ); |
1031 | $newName = substr( $tagName, $pipepos + 1, strlen( $tagName ) - $pipepos - 1 ); |
1032 | $attribs = [ new KV( "name", $newName ) ]; |
1033 | $tagName = $strBeforePipe; |
1034 | } |
1035 | |
1036 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/' . $tagName . ( $end ? '/End' : '' ) ) ]; |
1037 | $datamw = null; |
1038 | if ( count( $attribs ) > 0 ) { |
1039 | $datamw = new DataMw(); |
1040 | foreach ( $attribs as $attr ) { |
1041 | // If the key or the value is not a string, |
1042 | // we replace it by the thing that generated it and |
1043 | // consider that wikitext as a raw string instead. |
1044 | $k = is_string( $attr->k ) ? $attr->k : $attr->ksrc; |
1045 | $v = is_string( $attr->v ) ? $attr->v : $attr->vsrc; |
1046 | // Possible follow-up in T295168 for attribute sanitation |
1047 | $datamw->setExtAttrib( $k, $v ); |
1048 | } |
1049 | } |
1050 | $dp = new DataParsoid(); |
1051 | $dp->tsr = $tsr; |
1052 | $this->env->hasAnnotations = true; |
1053 | |
1054 | return new SelfclosingTagTk ( 'meta', $metaAttrs, $dp, $datamw ); |
1055 | |
1056 | } |
1057 | private function a89($tag) { |
1058 | |
1059 | // FIXME: Suppress annotation meta tokens from template pipelines |
1060 | // since they may not have TSR values and won't get recognized as |
1061 | // annotation ranges. Without TSR, they might end up stuck in |
1062 | // fosterable positions and cause havoc on edits by breaking selser. |
1063 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
1064 | return $tag; |
1065 | } else { |
1066 | return ''; |
1067 | } |
1068 | |
1069 | } |
1070 | private function a90($s, $ill) { |
1071 | return $ill ?: []; |
1072 | } |
1073 | private function a91($s, $ce) { |
1074 | return $ce || strlen( $s ) > 2; |
1075 | } |
1076 | private function a92($s, $ce) { |
1077 | return $this->endOffset(); |
1078 | } |
1079 | private function a93($s, $ce, $endTPos, $spc) { |
1080 | |
1081 | $c = null; |
1082 | $e = null; |
1083 | $level = null; |
1084 | if ( $ce ) { |
1085 | $c = $ce[0]; |
1086 | $e = $ce[1]; |
1087 | $level = min( strlen( $s ), strlen( $e ) ); |
1088 | } else { |
1089 | // split up equal signs into two equal parts, with at least |
1090 | // one character in the middle. |
1091 | $level = (int)floor( ( strlen( $s ) - 1 ) / 2 ); |
1092 | $c = [ str_repeat( '=', strlen( $s ) - 2 * $level ) ]; |
1093 | $s = $e = str_repeat( '=', $level ); |
1094 | } |
1095 | $level = min( 6, $level ); |
1096 | // convert surplus equals into text |
1097 | if ( strlen( $s ) > $level ) { |
1098 | $extras1 = substr( $s, 0, strlen( $s ) - $level ); |
1099 | if ( is_string( $c[0] ) ) { |
1100 | $c[0] = $extras1 . $c[0]; |
1101 | } else { |
1102 | array_unshift( $c, $extras1 ); |
1103 | } |
1104 | } |
1105 | if ( strlen( $e ) > $level ) { |
1106 | $extras2 = substr( $e, 0, strlen( $e ) - $level ); |
1107 | $lastElem = PHPUtils::lastItem( $c ); |
1108 | if ( is_string( $lastElem ) ) { |
1109 | $c[count( $c ) - 1] .= $extras2; |
1110 | } else { |
1111 | $c[] = $extras2; |
1112 | } |
1113 | } |
1114 | |
1115 | $tagDP = new DataParsoid; |
1116 | $tagDP->tsr = $this->tsrOffsets( 'start' ); |
1117 | $tagDP->tsr->end += $level; |
1118 | |
1119 | // Match the old parser's behavior by |
1120 | // (a) making headingIndex part of tokenizer state |
1121 | // (don't reuse pipeline! see $this->resetState above) |
1122 | // (b) assigning the index when ==*== is tokenized, |
1123 | // even if we're inside a template argument |
1124 | // or other context which won't end up putting the heading |
1125 | // on the output page. T213468/T214538 |
1126 | |
1127 | // Unlike hasSOLTransparentAtStart, trailing whitespace and comments |
1128 | // are allowed |
1129 | $hasSOLTransparentAtEnd = !preg_match( |
1130 | Utils::COMMENT_OR_WS_REGEXP, |
1131 | substr( $this->input, $endTPos, $this->endOffset() - $endTPos ) |
1132 | ); |
1133 | |
1134 | // If either of these are true, the legacy preprocessor won't tokenize |
1135 | // a heading and therefore won't assign them a heading index. They |
1136 | // will however parse as headings in the legacy parser's second pass, |
1137 | // once sol transparent tokens have been stripped. |
1138 | if ( !$this->hasSOLTransparentAtStart && !$hasSOLTransparentAtEnd ) { |
1139 | $this->headingIndex++; |
1140 | $tagDP->getTemp()->headingIndex = $this->headingIndex; |
1141 | } |
1142 | |
1143 | $res = [ new TagTk( 'h' . $level, [], $tagDP ) ]; |
1144 | PHPUtils::pushArray( $res, $c ); |
1145 | $endTagDP = new DataParsoid; |
1146 | $endTagDP->tsr = new SourceRange( $endTPos - $level, $endTPos ); |
1147 | $res[] = new EndTagTk( 'h' . $level, [], $endTagDP ); |
1148 | PHPUtils::pushArray( $res, $spc ); |
1149 | return $res; |
1150 | |
1151 | } |
1152 | private function a94($d) { |
1153 | return null; |
1154 | } |
1155 | private function a95($d) { |
1156 | return true; |
1157 | } |
1158 | private function a96($d, $lineContent) { |
1159 | |
1160 | $dataParsoid = new DataParsoid; |
1161 | $dataParsoid->tsr = $this->tsrOffsets(); |
1162 | if ( $lineContent !== null ) { |
1163 | $dataParsoid->lineContent = $lineContent; |
1164 | } |
1165 | if ( strlen( $d ) > 0 ) { |
1166 | $dataParsoid->extra_dashes = strlen( $d ); |
1167 | } |
1168 | return [new SelfclosingTagTk( 'hr', [], $dataParsoid )]; |
1169 | |
1170 | } |
1171 | private function a97($p, $target) { |
1172 | return $this->endOffset(); |
1173 | } |
1174 | private function a98($p, $target, $p0, $v) { |
1175 | return $this->endOffset(); |
1176 | } |
1177 | private function a99($p, $target, $p0, $v, $p1) { |
1178 | |
1179 | // empty argument |
1180 | return [ 'tokens' => $v, 'srcOffsets' => new SourceRange( $p0, $p1 ) ]; |
1181 | |
1182 | } |
1183 | private function a100($p, $target, $r) { |
1184 | return $r; |
1185 | } |
1186 | private function a101($p, $target, $params) { |
1187 | |
1188 | $kvs = []; |
1189 | |
1190 | if ( $target === null ) { |
1191 | $target = [ 'tokens' => '', 'srcOffsets' => new SourceRange( $p, $p ) ]; |
1192 | } |
1193 | // Insert target as first positional attribute, so that it can be |
1194 | // generically expanded. The TemplateHandler then needs to shift it out |
1195 | // again. |
1196 | $kvs[] = new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ); |
1197 | |
1198 | foreach ( $params as $o ) { |
1199 | $s = $o['srcOffsets']; |
1200 | $kvs[] = new KV( '', TokenizerUtils::flattenIfArray( $o['tokens'] ), $s->expandTsrV() ); |
1201 | } |
1202 | |
1203 | $dp = new DataParsoid; |
1204 | $dp->tsr = $this->tsrOffsets(); |
1205 | $dp->src = $this->text(); |
1206 | $obj = new SelfclosingTagTk( 'templatearg', $kvs, $dp ); |
1207 | return $obj; |
1208 | |
1209 | } |
1210 | private function a102($leadWS, $target) { |
1211 | return $this->endOffset(); |
1212 | } |
1213 | private function a103($leadWS, $target, $p0, $v) { |
1214 | return $this->endOffset(); |
1215 | } |
1216 | private function a104($leadWS, $target, $p0, $v, $p1) { |
1217 | |
1218 | // empty argument |
1219 | $tsr0 = new SourceRange( $p0, $p1 ); |
1220 | return new KV( '', TokenizerUtils::flattenIfArray( $v ), $tsr0->expandTsrV() ); |
1221 | |
1222 | } |
1223 | private function a105($leadWS, $target, $r) { |
1224 | return $r; |
1225 | } |
1226 | private function a106($leadWS, $target, $params, $trailWS) { |
1227 | |
1228 | // Insert target as first positional attribute, so that it can be |
1229 | // generically expanded. The TemplateHandler then needs to shift it out |
1230 | // again. |
1231 | array_unshift( $params, new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ) ); |
1232 | $dp = new DataParsoid; |
1233 | $dp->tsr = $this->tsrOffsets(); |
1234 | $dp->src = $this->text(); |
1235 | $tmp = $dp->getTemp(); |
1236 | $tmp->leadWS = $leadWS; |
1237 | $tmp->trailWS = $trailWS; |
1238 | $obj = new SelfclosingTagTk( 'template', $params, $dp ); |
1239 | return $obj; |
1240 | |
1241 | } |
1242 | private function a107($spos, $target) { |
1243 | return $this->endOffset(); |
1244 | } |
1245 | private function a108($spos, $target, $tpos, $l) { |
1246 | return [$l,null]; |
1247 | } |
1248 | private function a109($spos, $target, $tpos, $l) { |
1249 | return [null,$l]; |
1250 | } |
1251 | private function a110($spos, $target, $tpos, $lcs) { |
1252 | |
1253 | [$lcs, $not_wikilink] = $lcs; |
1254 | $pipeTrick = $lcs && count( $lcs ) === 1 && count( $lcs[0][1]->v ) === 0; |
1255 | if ( $target === null || $pipeTrick || $not_wikilink) { |
1256 | $textTokens = []; |
1257 | $textTokens[] = '[['; |
1258 | if ( $target ) { |
1259 | $textTokens[] = $target; |
1260 | } |
1261 | foreach ( $lcs ?? [] as $a ) { |
1262 | // $a[0] is a pipe |
1263 | // FIXME: Account for variation, emit a template tag |
1264 | $textTokens[] = '|'; |
1265 | // $a[1] is a mw:maybeContent attribute |
1266 | if ( count( $a[1]->v ) > 0 ) { |
1267 | $textTokens[] = $a[1]->v; |
1268 | } |
1269 | } |
1270 | if ( $not_wikilink ) { |
1271 | $textTokens[] = $not_wikilink; |
1272 | } |
1273 | $textTokens[] = ']]'; |
1274 | return $textTokens; |
1275 | } |
1276 | $tsr = new SourceRange( $spos, $tpos ); |
1277 | $hrefKV = new KV( |
1278 | 'href', $target, $tsr->expandTsrV(), null, |
1279 | $tsr->substr( $this->input ) |
1280 | ); |
1281 | $obj = new SelfclosingTagTk( 'wikilink' ); |
1282 | $attribs = array_map( static fn ( $lc ) => $lc[1], $lcs ); |
1283 | $obj->attribs = array_merge( [$hrefKV], $attribs ); |
1284 | $dp = new DataParsoid; |
1285 | $dp->tsr = $this->tsrOffsets(); |
1286 | $dp->src = $this->text(); |
1287 | // Capture a variation in the separator between target |
1288 | // and contents. Note that target might have other templates |
1289 | // that emit pipes, so this might not actually be the first |
1290 | // separator, but the WikiLinkHandler doesn't support that |
1291 | // yet, see onWikiLink. |
1292 | if ( $lcs && $lcs[0][0] !== '|' ) { |
1293 | $dp->firstPipeSrc = $lcs[0][0]; |
1294 | } |
1295 | $obj->dataParsoid = $dp; |
1296 | return [ $obj ]; |
1297 | |
1298 | } |
1299 | private function a111(&$preproc) { |
1300 | $preproc = null; return true; |
1301 | } |
1302 | private function a112(&$preproc, $a) { |
1303 | |
1304 | return $a; |
1305 | |
1306 | } |
1307 | private function a113($extToken) { |
1308 | return $extToken->getName() === 'extension'; |
1309 | } |
1310 | private function a114($extToken) { |
1311 | return $extToken; |
1312 | } |
1313 | private function a115($annOrExtTag, $start) { |
1314 | |
1315 | // Only enforce ascii alpha first char for non-extension tags. |
1316 | // See tag_name above for the details. |
1317 | list(,$name) = $start; |
1318 | return $annOrExtTag || |
1319 | ( preg_match( '/^[A-Za-z]/', $name ) && $this->isXMLTag( $name ) ); |
1320 | |
1321 | } |
1322 | private function a116($annOrExtTag, $start, $attribs, $selfclose) { |
1323 | |
1324 | list($end, $name) = $start; |
1325 | $lcName = mb_strtolower( $name ); |
1326 | |
1327 | // Extension tags don't necessarily have the same semantics as html tags, |
1328 | // so don't treat them as void elements. |
1329 | $isVoidElt = Utils::isVoidElement( $lcName ) && !$annOrExtTag; |
1330 | |
1331 | // Support </br> |
1332 | if ( $lcName === 'br' && $end ) { |
1333 | $end = null; |
1334 | } |
1335 | |
1336 | $tsr = $this->tsrOffsets(); |
1337 | $res = TokenizerUtils::buildXMLTag( |
1338 | $name, $lcName, $attribs, $end, !!$selfclose || $isVoidElt, $tsr |
1339 | ); |
1340 | |
1341 | // change up data-attribs in one scenario |
1342 | // void-elts that aren't self-closed ==> useful for accurate RT-ing |
1343 | if ( !$selfclose && $isVoidElt ) { |
1344 | unset( $res->dataParsoid->selfClose ); |
1345 | $res->dataParsoid->noClose = true; |
1346 | } |
1347 | |
1348 | return $res; |
1349 | |
1350 | } |
1351 | private function a117($proto, $addr, $rhe) { |
1352 | return $rhe === '<' || $rhe === '>' || $rhe === "\u{A0}"; |
1353 | } |
1354 | private function a118($proto, $addr, $path) { |
1355 | |
1356 | // as in Parser.php::makeFreeExternalLink, we're going to |
1357 | // yank trailing punctuation out of this match. |
1358 | $url = TokenizerUtils::flattenStringlist( array_merge( [ $proto, $addr ], $path ) ); |
1359 | // only need to look at last element; HTML entities are strip-proof. |
1360 | $last = PHPUtils::lastItem( $url ); |
1361 | $trim = 0; |
1362 | if ( is_string( $last ) ) { |
1363 | $strip = TokenizerUtils::getAutoUrlTerminatingChars( in_array( '(', $path, true ) ); |
1364 | $trim = strspn( strrev( $last ), $strip ); |
1365 | $url[ count( $url ) - 1 ] = substr( $last, 0, strlen( $last ) - $trim ); |
1366 | } |
1367 | $url = TokenizerUtils::flattenStringlist( $url ); |
1368 | if ( count( $url ) === 1 && is_string( $url[0] ) && strlen( $url[0] ) <= strlen( $proto ) ) { |
1369 | return null; // ensure we haven't stripped everything: T106945 |
1370 | } |
1371 | $this->currPos -= $trim; |
1372 | return $url; |
1373 | |
1374 | } |
1375 | private function a119($r) { |
1376 | return $r !== null; |
1377 | } |
1378 | private function a120($r) { |
1379 | |
1380 | $tsr = $this->tsrOffsets(); |
1381 | $dp = new DataParsoid; |
1382 | $dp->tsr = $tsr; |
1383 | $res = [ new SelfclosingTagTk( 'urllink', [ new KV( 'href', $r, $tsr->expandTsrV() ) ], $dp ) ]; |
1384 | return $res; |
1385 | |
1386 | } |
1387 | private function a121($ref, $sp, $identifier) { |
1388 | |
1389 | $base_urls = [ |
1390 | 'RFC' => 'https://datatracker.ietf.org/doc/html/rfc%s', |
1391 | 'PMID' => '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract' |
1392 | ]; |
1393 | $tsr = $this->tsrOffsets(); |
1394 | $dp = new DataParsoid; |
1395 | $dp->tsr = $tsr; |
1396 | $dp->stx = 'magiclink'; |
1397 | $this->env->getDataAccess()->addTrackingCategory( |
1398 | $this->env->getPageConfig(), |
1399 | $this->env->getMetadata(), |
1400 | 'magiclink-tracking-' . strtolower($ref) |
1401 | ); |
1402 | return [ |
1403 | new SelfclosingTagTk( 'extlink', [ |
1404 | new KV( 'href', sprintf( $base_urls[$ref], $identifier ) ), |
1405 | new KV( 'mw:content', TokenizerUtils::flattenString( [ $ref, $sp, $identifier ] ), $tsr->expandTsrV() ), |
1406 | new KV( 'typeof', 'mw:ExtLink/' . $ref ) |
1407 | ], |
1408 | $dp |
1409 | ) |
1410 | ]; |
1411 | |
1412 | } |
1413 | private function a122() { |
1414 | return $this->siteConfig->magicLinkEnabled("ISBN"); |
1415 | } |
1416 | private function a123($sp, $isbn) { |
1417 | |
1418 | // Convert isbn token-and-entity array to stripped string. |
1419 | $stripped = ''; |
1420 | foreach ( TokenizerUtils::flattenStringlist( $isbn ) as $part ) { |
1421 | if ( is_string( $part ) ) { |
1422 | $stripped .= $part; |
1423 | } |
1424 | } |
1425 | return strtoupper( preg_replace( '/[^\dX]/i', '', $stripped ) ); |
1426 | |
1427 | } |
1428 | private function a124($sp, $isbn, $isbncode) { |
1429 | |
1430 | // ISBNs can only be 10 or 13 digits long (with a specific format) |
1431 | return strlen( $isbncode ) === 10 |
1432 | || ( strlen( $isbncode ) === 13 && preg_match( '/^97[89]/', $isbncode ) ); |
1433 | |
1434 | } |
1435 | private function a125($sp, $isbn, $isbncode) { |
1436 | |
1437 | $tsr = $this->tsrOffsets(); |
1438 | $dp = new DataParsoid; |
1439 | $dp->stx = 'magiclink'; |
1440 | $dp->tsr = $tsr; |
1441 | $this->env->getDataAccess()->addTrackingCategory( |
1442 | $this->env->getPageConfig(), |
1443 | $this->env->getMetadata(), |
1444 | 'magiclink-tracking-isbn' |
1445 | ); |
1446 | return [ |
1447 | new SelfclosingTagTk( 'extlink', [ |
1448 | new KV( 'href', 'Special:BookSources/' . $isbncode ), |
1449 | new KV( 'mw:content', TokenizerUtils::flattenString( [ 'ISBN', $sp, $isbn ] ), $tsr->expandTsrV() ), |
1450 | new KV( 'typeof', 'mw:WikiLink/ISBN' ) |
1451 | ], |
1452 | $dp |
1453 | ) |
1454 | ]; |
1455 | |
1456 | } |
1457 | private function a126($t) { |
1458 | |
1459 | $tagName = mb_strtolower( $t->getName() ); |
1460 | $dp = $t->dataParsoid; |
1461 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
1462 | |
1463 | switch ( get_class( $t ) ) { |
1464 | case EndTagTk::class: |
1465 | // Similar to TagTk, we rely on the sanitizer to convert to text |
1466 | // where necessary and emit tokens to ease the wikitext escaping |
1467 | // code. However, extension tags that shadow html tags will see |
1468 | // their unmatched end tags dropped while tree building, since |
1469 | // the sanitizer will let them through. |
1470 | return $t; // not text() |
1471 | |
1472 | case SelfclosingTagTk::class: |
1473 | $dp->src = $dp->tsr->substr( $this->input ); |
1474 | $dp->extTagOffsets = new DomSourceRange( |
1475 | $dp->tsr->start, $dp->tsr->end, |
1476 | $dp->tsr->length(), 0 |
1477 | ); |
1478 | break; |
1479 | |
1480 | case TagTk::class: |
1481 | $tagContentFound = preg_match( $endTagRE, $this->input, $tagContent, 0, $dp->tsr->start ); |
1482 | if ( !$tagContentFound ) { |
1483 | // This is undefined behaviour. The old parser currently |
1484 | // returns text here (see core commit 674e8388cba), |
1485 | // whereas this results in unclosed |
1486 | // extension tags that shadow html tags falling back to |
1487 | // their html equivalent. The sanitizer will take care |
1488 | // of converting to text where necessary. We do this to |
1489 | // simplify `hasWikitextTokens` when escaping wikitext, |
1490 | // which wants these as tokens because it's otherwise |
1491 | // lacking in context. |
1492 | return $t; // not text() |
1493 | } |
1494 | |
1495 | $extSrc = $tagContent[0]; |
1496 | $extEndOffset = $dp->tsr->start + strlen( $extSrc ); |
1497 | $extEndTagWidth = strlen( $tagContent[1] ); |
1498 | |
1499 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
1500 | // Support nesting in extensions tags while tokenizing in templates |
1501 | // to support the #tag parser function. |
1502 | // |
1503 | // It's necessary to permit this broadly in templates because |
1504 | // there's no way to distinguish whether the nesting happened |
1505 | // while expanding the #tag parser function, or just a general |
1506 | // syntax errors. In other words, |
1507 | // |
1508 | // hi<ref>ho<ref>hi</ref>ho</ref> |
1509 | // |
1510 | // and |
1511 | // |
1512 | // hi{{#tag:ref|ho<ref>hi</ref>ho}} |
1513 | // |
1514 | // found in template are returned indistinguishably after a |
1515 | // preprocessing request, though the old parser renders them |
1516 | // differently. #tag in template is probably a common enough |
1517 | // use case that we want to accept these false positives, |
1518 | // though another approach could be to drop this code here, and |
1519 | // invoke a native #tag handler and forgo those in templates. |
1520 | // |
1521 | // Expand `extSrc` as long as there is a <tagName> found in the |
1522 | // extension source body. |
1523 | $startTagRE = '~<' . preg_quote( $tagName, '~' ) . '(?:[^/>]|/(?!>))*>~i'; |
1524 | $s = substr( $extSrc, $dp->tsr->end - $dp->tsr->start ); |
1525 | $openTags = 0; |
1526 | while ( true ) { |
1527 | if ( preg_match_all( $startTagRE, $s, $matches ) ) { |
1528 | $openTags += count( $matches[0] ); |
1529 | } |
1530 | if ( !$openTags ) { |
1531 | break; |
1532 | } |
1533 | if ( !preg_match( $endTagRE, $this->input, $tagContent, 0, $extEndOffset ) ) { |
1534 | break; |
1535 | } |
1536 | $openTags -= 1; |
1537 | $s = $tagContent[0]; |
1538 | $extEndOffset += strlen( $s ); |
1539 | $extEndTagWidth = strlen( $tagContent[1] ); |
1540 | $extSrc .= $s; |
1541 | } |
1542 | } |
1543 | |
1544 | // Extension content source |
1545 | $dp->src = $extSrc; |
1546 | $dp->extTagOffsets = new DomSourceRange( |
1547 | $dp->tsr->start, $extEndOffset, |
1548 | $dp->tsr->length(), $extEndTagWidth |
1549 | ); |
1550 | |
1551 | $this->currPos = $dp->extTagOffsets->end; |
1552 | |
1553 | // update tsr->end to span the start and end tags. |
1554 | $dp->tsr->end = $this->endOffset(); // was just modified above |
1555 | break; |
1556 | |
1557 | default: |
1558 | $this->unreachable(); |
1559 | } |
1560 | |
1561 | return new SelfclosingTagTk( 'extension', [ |
1562 | new KV( 'typeof', 'mw:Extension' ), |
1563 | new KV( 'name', $tagName ), |
1564 | new KV( 'about', $this->env->newAboutId() ), |
1565 | new KV( 'source', $dp->src ), |
1566 | new KV( 'options', $t->attribs ) |
1567 | ], $dp ); |
1568 | |
1569 | } |
1570 | private function a127($p, $dashes) { |
1571 | $this->unreachable(); |
1572 | } |
1573 | private function a128($p, $dashes, $a) { |
1574 | return $this->endOffset(); |
1575 | } |
1576 | private function a129($p, $dashes, $a, $tagEndPos, $s2) { |
1577 | |
1578 | $coms = TokenizerUtils::popComments( $a ); |
1579 | if ( $coms ) { |
1580 | $tagEndPos = $coms['commentStartPos']; |
1581 | } |
1582 | |
1583 | $da = new DataParsoid; |
1584 | $da->tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1585 | $da->startTagSrc = $p . $dashes; |
1586 | |
1587 | // We rely on our tree builder to close the row as needed. This is |
1588 | // needed to support building tables from fragment templates with |
1589 | // individual cells or rows. |
1590 | $trToken = new TagTk( 'tr', $a, $da ); |
1591 | |
1592 | return array_merge( [ $trToken ], $coms ? $coms['buf'] : [], $s2 ); |
1593 | |
1594 | } |
1595 | private function a130($p, $td, $tds) { |
1596 | |
1597 | // Avoid modifying a cached result |
1598 | $td[0] = clone $td[0]; |
1599 | $da = $td[0]->dataParsoid = clone $td[0]->dataParsoid; |
1600 | $da->tsr = clone $da->tsr; |
1601 | $da->tsr->start -= strlen( $p ); // include "|" |
1602 | if ( $p !== '|' ) { |
1603 | // Variation from default |
1604 | $da->startTagSrc = $p; |
1605 | } |
1606 | return array_merge( $td, $tds ); |
1607 | |
1608 | } |
1609 | private function a131($p, $args) { |
1610 | return $this->endOffset(); |
1611 | } |
1612 | private function a132($p, $args, $tagEndPos, $c) { |
1613 | |
1614 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
1615 | return TokenizerUtils::buildTableTokens( |
1616 | $this->input, 'caption', '|+', $args, $tsr, $this->endOffset(), $c, true |
1617 | ); |
1618 | |
1619 | } |
1620 | private function a133($start) { |
1621 | |
1622 | list(,$name) = $start; |
1623 | return WTUtils::isIncludeTag( mb_strtolower( $name ) ); |
1624 | |
1625 | } |
1626 | private function a134() { |
1627 | return $this->env->hasAnnotations && $this->siteConfig->isAnnotationTag( 'tvar' ); |
1628 | } |
1629 | private function a135() { |
1630 | |
1631 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/tvar/End' ) ]; |
1632 | $dp = new DataParsoid(); |
1633 | $dp->tsr = $this->tsrOffsets(); |
1634 | return new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ); |
1635 | |
1636 | } |
1637 | private function a136($start) { |
1638 | |
1639 | list(,$name) = $start; |
1640 | return WTUtils::isAnnotationTag( $this->env, $name ); |
1641 | |
1642 | } |
1643 | private function a137($tpt) { |
1644 | |
1645 | return [ 'tokens' => $tpt, 'srcOffsets' => $this->tsrOffsets() ]; |
1646 | |
1647 | } |
1648 | private function a138($name) { |
1649 | return $this->endOffset(); |
1650 | } |
1651 | private function a139($name, $kEndPos) { |
1652 | return $this->endOffset(); |
1653 | } |
1654 | private function a140($name, $kEndPos, $vStartPos, $optSp, $tpv) { |
1655 | |
1656 | return [ |
1657 | 'kEndPos' => $kEndPos, |
1658 | 'vStartPos' => $vStartPos, |
1659 | 'value' => TokenizerUtils::flattenString( [ $optSp, $tpv['tokens'] ?? [] ] ), |
1660 | ]; |
1661 | |
1662 | } |
1663 | private function a141($name, $val) { |
1664 | |
1665 | if ( $val !== null ) { |
1666 | if ( $val['value'] !== null ) { |
1667 | $so = new KVSourceRange( |
1668 | $this->startOffset(), $val['kEndPos'], |
1669 | $val['vStartPos'], $this->endOffset() |
1670 | ); |
1671 | return new KV( |
1672 | $name, |
1673 | TokenizerUtils::flattenIfArray( $val['value'] ), |
1674 | $so |
1675 | ); |
1676 | } else { |
1677 | return new KV( |
1678 | TokenizerUtils::flattenIfArray( $name ), |
1679 | '', |
1680 | $so |
1681 | ); |
1682 | } |
1683 | } else { |
1684 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1685 | return new KV( |
1686 | '', |
1687 | TokenizerUtils::flattenIfArray( $name ), |
1688 | $so->expandTsrV() |
1689 | ); |
1690 | } |
1691 | |
1692 | } |
1693 | private function a142() { |
1694 | |
1695 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
1696 | return new KV( '', '', $so->expandTsrV() ); |
1697 | |
1698 | } |
1699 | private function a143($t, $wr) { |
1700 | return $wr; |
1701 | } |
1702 | private function a144($r) { |
1703 | |
1704 | return TokenizerUtils::flattenStringlist( $r ); |
1705 | |
1706 | } |
1707 | private function a145($p) { |
1708 | return $this->endOffset(); |
1709 | } |
1710 | private function a146($p, $startPos, $lt) { |
1711 | |
1712 | $tsr = new SourceRange( $startPos, $this->endOffset() ); |
1713 | $maybeContent = new KV( 'mw:maybeContent', $lt ?? [], $tsr->expandTsrV() ); |
1714 | $maybeContent->vsrc = substr( $this->input, $startPos, $this->endOffset() - $startPos ); |
1715 | return [$p, $maybeContent]; |
1716 | |
1717 | } |
1718 | private function a147($end, $name) { |
1719 | return [ $end, $name ]; |
1720 | } |
1721 | private function a148() { |
1722 | return $this->siteConfig->magicLinkEnabled("RFC"); |
1723 | } |
1724 | private function a149() { |
1725 | |
1726 | return 'RFC'; |
1727 | |
1728 | } |
1729 | private function a150() { |
1730 | return $this->siteConfig->magicLinkEnabled("PMID"); |
1731 | } |
1732 | private function a151() { |
1733 | |
1734 | return 'PMID'; |
1735 | |
1736 | } |
1737 | private function a152($he) { |
1738 | return is_array( $he ) && $he[ 1 ] === "\u{A0}"; |
1739 | } |
1740 | private function a153($start) { |
1741 | |
1742 | list(,$name) = $start; |
1743 | return isset( $this->extTags[mb_strtolower( $name )] ) && |
1744 | // NOTE: This check is redundant with the precedence of the current |
1745 | // rules ( annotation_tag / *_extension_tag ) but kept as a precaution |
1746 | // since annotation tags are in extTags and we want them handled |
1747 | // elsewhere. |
1748 | !WTUtils::isAnnotationTag( $this->env, $name ); |
1749 | |
1750 | } |
1751 | private function a154() { |
1752 | return $this->startOffset(); |
1753 | } |
1754 | private function a155($lv0) { |
1755 | return $this->env->langConverterEnabled(); |
1756 | } |
1757 | private function a156($lv0, $ff) { |
1758 | |
1759 | // if flags contains 'R', then don't treat ; or : specially inside. |
1760 | if ( isset( $ff['flags'] ) ) { |
1761 | $ff['raw'] = isset( $ff['flags']['R'] ) || isset( $ff['flags']['N'] ); |
1762 | } elseif ( isset( $ff['variants'] ) ) { |
1763 | $ff['raw'] = true; |
1764 | } |
1765 | return $ff; |
1766 | |
1767 | } |
1768 | private function a157($lv0) { |
1769 | return !$this->env->langConverterEnabled(); |
1770 | } |
1771 | private function a158($lv0) { |
1772 | |
1773 | // if language converter not enabled, don't try to parse inside. |
1774 | return [ 'raw' => true ]; |
1775 | |
1776 | } |
1777 | private function a159($lv0, $f) { |
1778 | return $f['raw']; |
1779 | } |
1780 | private function a160($lv0, $f, $lv) { |
1781 | return [ [ 'text' => $lv ] ]; |
1782 | } |
1783 | private function a161($lv0, $f) { |
1784 | return !$f['raw']; |
1785 | } |
1786 | private function a162($lv0, $f, $lv) { |
1787 | return $lv; |
1788 | } |
1789 | private function a163($lv0, $f, $ts) { |
1790 | return $this->endOffset(); |
1791 | } |
1792 | private function a164($lv0, $f, $ts, $lv1) { |
1793 | |
1794 | if ( !$this->env->langConverterEnabled() ) { |
1795 | return [ '-{', $ts[0]['text']['tokens'], '}-' ]; |
1796 | } |
1797 | $lvsrc = substr( $this->input, $lv0, $lv1 - $lv0 ); |
1798 | $attribs = []; |
1799 | |
1800 | foreach ( $ts as &$t ) { |
1801 | // move token strings into KV attributes so that they are |
1802 | // properly expanded by early stages of the token pipeline |
1803 | foreach ( [ 'text', 'from', 'to' ] as $fld ) { |
1804 | if ( !isset( $t[$fld] ) ) { |
1805 | continue; |
1806 | } |
1807 | $name = 'mw:lv' . count( $attribs ); |
1808 | // Note that AttributeExpander will expect the tokens array to be |
1809 | // flattened. We do that in lang_variant_text / lang_variant_nowiki |
1810 | $attribs[] = new KV( $name, $t[$fld]['tokens'], $t[$fld]['srcOffsets']->expandTsrV() ); |
1811 | $t[$fld] = $name; |
1812 | } |
1813 | } |
1814 | unset( $t ); |
1815 | |
1816 | $flags = isset( $f['flags'] ) ? array_keys( $f['flags'] ) : []; |
1817 | sort( $flags ); |
1818 | $variants = isset( $f['variants'] ) ? array_keys( $f['variants'] ) : []; |
1819 | sort( $variants ); |
1820 | |
1821 | $dp = new DataParsoid; |
1822 | $dp->tsr = new SourceRange( $lv0, $lv1 ); |
1823 | $dp->src = $lvsrc; |
1824 | $dp->flags = $flags; |
1825 | $dp->variants = $variants; |
1826 | $dp->original = $f['original']; |
1827 | $dp->flagSp = $f['sp']; |
1828 | $dp->texts = $ts; |
1829 | |
1830 | return [ |
1831 | new SelfclosingTagTk( |
1832 | 'language-variant', |
1833 | $attribs, |
1834 | $dp |
1835 | ) |
1836 | ]; |
1837 | |
1838 | } |
1839 | private function a165($r, &$preproc) { |
1840 | |
1841 | $preproc = null; |
1842 | return $r; |
1843 | |
1844 | } |
1845 | private function a166($thTag, $thTags) { |
1846 | |
1847 | // Avoid modifying a cached result |
1848 | $thTag[0] = clone $thTag[0]; |
1849 | $da = $thTag[0]->dataParsoid = clone $thTag[0]->dataParsoid; |
1850 | $da->tsr = clone $da->tsr; |
1851 | $da->tsr->start--; // include "!" |
1852 | array_unshift( $thTags, $thTag ); |
1853 | return $thTags; |
1854 | |
1855 | } |
1856 | private function a167($arg) { |
1857 | return $this->endOffset(); |
1858 | } |
1859 | private function a168($arg, $tagEndPos, $td) { |
1860 | |
1861 | $tagStart = $this->startOffset(); |
1862 | $tsr = new SourceRange( $tagStart, $tagEndPos ); |
1863 | return TokenizerUtils::buildTableTokens( |
1864 | $this->input, 'td', '|', $arg, $tsr, $this->endOffset(), $td |
1865 | ); |
1866 | |
1867 | } |
1868 | private function a169($pp, $tdt) { |
1869 | |
1870 | // Avoid modifying cached dataParsoid object |
1871 | $tdt[0] = clone $tdt[0]; |
1872 | $da = $tdt[0]->dataParsoid = clone $tdt[0]->dataParsoid; |
1873 | $da->tsr = clone $da->tsr; |
1874 | $da->stx = 'row'; |
1875 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
1876 | $da->tsr->start -= strlen( $pp ); // include "||" |
1877 | if ( $pp !== '||' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
1878 | // Variation from default |
1879 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
1880 | } |
1881 | return $tdt; |
1882 | |
1883 | } |
1884 | private function a170($b) { |
1885 | |
1886 | return $b; |
1887 | |
1888 | } |
1889 | private function a171($il) { |
1890 | |
1891 | // il is guaranteed to be an array -- so, tu.flattenIfArray will |
1892 | // always return an array |
1893 | $r = TokenizerUtils::flattenIfArray( $il ); |
1894 | if ( count( $r ) === 1 && is_string( $r[0] ) ) { |
1895 | $r = $r[0]; |
1896 | } |
1897 | return $r; |
1898 | |
1899 | } |
1900 | private function a172() { |
1901 | return ''; |
1902 | } |
1903 | private function a173($ff) { |
1904 | return $ff; |
1905 | } |
1906 | private function a174($f) { |
1907 | |
1908 | // Collect & separate flags and variants into a hashtable (by key) and ordered list |
1909 | $flags = []; |
1910 | $variants = []; |
1911 | $flagList = []; |
1912 | $flagSpace = []; |
1913 | $variantList = []; |
1914 | $variantSpace = []; |
1915 | $useVariants = false; |
1916 | if ( $f !== null ) { |
1917 | // lang_variant_flags returns arrays in reverse order. |
1918 | $spPtr = count( $f['sp'] ) - 1; |
1919 | for ( $i = count( $f['flags'] ) - 1; $i >= 0; $i--) { |
1920 | $item = $f['flags'][$i]; |
1921 | if ( isset( $item['flag'] ) ) { |
1922 | $flagSpace[] = $f['sp'][$spPtr--]; |
1923 | $flags[$item['flag']] = true; |
1924 | $flagList[] = $item['flag']; |
1925 | $flagSpace[] = $f['sp'][$spPtr--]; |
1926 | } |
1927 | if ( isset( $item['variant'] ) ) { |
1928 | $variantSpace[] = $f['sp'][$spPtr--]; |
1929 | $variants[$item['variant']] = true; |
1930 | $variantList[] = $item['variant']; |
1931 | $variantSpace[] = $f['sp'][$spPtr--]; |
1932 | } |
1933 | } |
1934 | if ( $spPtr >= 0 ) { |
1935 | // handle space after a trailing semicolon |
1936 | $flagSpace[] = $f['sp'][$spPtr]; |
1937 | $variantSpace[] = $f['sp'][$spPtr]; |
1938 | } |
1939 | } |
1940 | // Parse flags (this logic is from core/languages/ConverterRule.php |
1941 | // in the parseFlags() function) |
1942 | if ( count( $flags ) === 0 && count( $variants ) === 0 ) { |
1943 | $flags['$S'] = true; |
1944 | } elseif ( isset( $flags['R'] ) ) { |
1945 | $flags = [ 'R' => true ]; // remove other flags |
1946 | } elseif ( isset( $flags['N'] ) ) { |
1947 | $flags = [ 'N' => true ]; // remove other flags |
1948 | } elseif ( isset( $flags['-'] ) ) { |
1949 | $flags = [ '-' => true ]; // remove other flags |
1950 | } elseif ( isset( $flags['T'] ) && count( $flags ) === 1 ) { |
1951 | $flags['H'] = true; |
1952 | } elseif ( isset( $flags['H'] ) ) { |
1953 | // Replace A flag, and remove other flags except T and D |
1954 | $nf = [ '$+' => true, 'H' => true ]; |
1955 | if ( isset( $flags['T'] ) ) { $nf['T'] = true; } |
1956 | if ( isset( $flags['D'] ) ) { $nf['D'] = true; } |
1957 | $flags = $nf; |
1958 | } elseif ( count( $variants ) > 0 ) { |
1959 | $useVariants = true; |
1960 | } else { |
1961 | if ( isset( $flags['A'] ) ) { |
1962 | $flags['$+'] = true; |
1963 | $flags['$S'] = true; |
1964 | } |
1965 | if ( isset( $flags['D'] ) ) { |
1966 | unset( $flags['$S'] ); |
1967 | } |
1968 | } |
1969 | if ( $useVariants ) { |
1970 | return [ 'variants' => $variants, 'original' => $variantList, 'sp' => $variantSpace ]; |
1971 | } else { |
1972 | return [ 'flags' => $flags, 'original' => $flagList, 'sp' => $flagSpace ]; |
1973 | } |
1974 | |
1975 | } |
1976 | private function a175($tokens) { |
1977 | |
1978 | return [ |
1979 | 'tokens' => TokenizerUtils::flattenStringlist( $tokens ), |
1980 | 'srcOffsets' => $this->tsrOffsets(), |
1981 | ]; |
1982 | |
1983 | } |
1984 | private function a176($o, $oo) { |
1985 | return $oo; |
1986 | } |
1987 | private function a177($o, $rest, $tr) { |
1988 | |
1989 | array_unshift( $rest, $o ); |
1990 | // if the last bogus option is just spaces, keep them; otherwise |
1991 | // drop all this bogus stuff on the ground |
1992 | if ( count($tr) > 0 ) { |
1993 | $last = $tr[count($tr)-1]; |
1994 | if (preg_match('/^\s*$/Du', $last[1])) { |
1995 | $rest[] = [ 'semi' => true, 'sp' => $last[1] ]; |
1996 | } |
1997 | } |
1998 | return $rest; |
1999 | |
2000 | } |
2001 | private function a178($lvtext) { |
2002 | return [ [ 'text' => $lvtext ] ]; |
2003 | } |
2004 | private function a179($arg, $tagEndPos, &$th, $d) { |
2005 | |
2006 | // Ignore newlines found in transclusions! |
2007 | // This is not perfect (since {{..}} may not always tokenize to transclusions). |
2008 | if ( $th !== false && strpos( preg_replace( "/{{[\s\S]+?}}/", "", $this->text() ), "\n" ) !== false ) { |
2009 | // There's been a newline. Remove the break and continue |
2010 | // tokenizing nested_block_in_tables. |
2011 | $th = false; |
2012 | } |
2013 | return $d; |
2014 | |
2015 | } |
2016 | private function a180($arg, $tagEndPos, $c) { |
2017 | |
2018 | $tagStart = $this->startOffset(); |
2019 | $tsr = new SourceRange( $tagStart, $tagEndPos ); |
2020 | return TokenizerUtils::buildTableTokens( |
2021 | $this->input, 'th', '!', $arg, $tsr, $this->endOffset(), $c |
2022 | ); |
2023 | |
2024 | } |
2025 | private function a181($pp, $tht) { |
2026 | |
2027 | // Avoid modifying cached dataParsoid object |
2028 | $tht[0] = clone $tht[0]; |
2029 | $da = $tht[0]->dataParsoid = clone $tht[0]->dataParsoid; |
2030 | $da->tsr = clone $da->tsr; |
2031 | $da->stx = 'row'; |
2032 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
2033 | $da->tsr->start -= strlen( $pp ); // include "!!" or "||" |
2034 | if ( $pp !== '!!' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
2035 | // Variation from default |
2036 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
2037 | } |
2038 | return $tht; |
2039 | |
2040 | } |
2041 | private function a182($sp1, $f, $sp2, $more) { |
2042 | |
2043 | $r = ( $more && $more[1] ) ? $more[1] : [ 'sp' => [], 'flags' => [] ]; |
2044 | // Note that sp and flags are in reverse order, since we're using |
2045 | // right recursion and want to push instead of unshift. |
2046 | $r['sp'][] = $sp2; |
2047 | $r['sp'][] = $sp1; |
2048 | $r['flags'][] = $f; |
2049 | return $r; |
2050 | |
2051 | } |
2052 | private function a183($sp) { |
2053 | |
2054 | return [ 'sp' => [ $sp ], 'flags' => [] ]; |
2055 | |
2056 | } |
2057 | private function a184($sp1, $lang, $sp2, $sp3, $lvtext) { |
2058 | |
2059 | return [ |
2060 | 'twoway' => true, |
2061 | 'lang' => $lang, |
2062 | 'text' => $lvtext, |
2063 | 'sp' => [ $sp1, $sp2, $sp3 ] |
2064 | ]; |
2065 | |
2066 | } |
2067 | private function a185($sp1, $from, $sp2, $lang, $sp3, $sp4, $to) { |
2068 | |
2069 | return [ |
2070 | 'oneway' => true, |
2071 | 'from' => $from, |
2072 | 'lang' => $lang, |
2073 | 'to' => $to, |
2074 | 'sp' => [ $sp1, $sp2, $sp3, $sp4 ] |
2075 | ]; |
2076 | |
2077 | } |
2078 | private function a186($r) { |
2079 | |
2080 | return $r; |
2081 | |
2082 | } |
2083 | private function a187($f) { |
2084 | return [ 'flag' => $f ]; |
2085 | } |
2086 | private function a188($v) { |
2087 | return [ 'variant' => $v ]; |
2088 | } |
2089 | private function a189($b) { |
2090 | return [ 'bogus' => $b ]; /* bad flag */ |
2091 | } |
2092 | private function a190($n, $sp) { |
2093 | |
2094 | $tsr = $this->tsrOffsets(); |
2095 | $tsr->end -= strlen( $sp ); |
2096 | return [ |
2097 | 'tokens' => [ $n ], |
2098 | 'srcOffsets' => $tsr, |
2099 | ]; |
2100 | |
2101 | } |
2102 | private function a191($ext) { |
2103 | return $ext; |
2104 | } |
2105 | private function a192($extToken) { |
2106 | |
2107 | $txt = Utils::extractExtBody( $extToken ); |
2108 | return Utils::decodeWtEntities( $txt ); |
2109 | |
2110 | } |
2111 | private function a193($start) { |
2112 | |
2113 | list(,$name) = $start; |
2114 | return ( mb_strtolower( $name ) === 'nowiki' ); |
2115 | |
2116 | } |
2117 | |
2118 | // generated |
2119 | private function streamstart_async($silence, &$param_preproc) { |
2120 | for (;;) { |
2121 | // start choice_1 |
2122 | $p2 = $this->currPos; |
2123 | // start seq_1 |
2124 | $p3 = $this->currPos; |
2125 | $this->savedPos = $this->currPos; |
2126 | $r4 = $this->a0(); |
2127 | if ($r4) { |
2128 | $r4 = false; |
2129 | } else { |
2130 | $r4 = self::$FAILED; |
2131 | $r1 = self::$FAILED; |
2132 | goto seq_1; |
2133 | } |
2134 | $r5 = $this->parsetlb($silence, $param_preproc); |
2135 | // t <- $r5 |
2136 | if ($r5===self::$FAILED) { |
2137 | $this->currPos = $p3; |
2138 | $r1 = self::$FAILED; |
2139 | goto seq_1; |
2140 | } |
2141 | $this->savedPos = $this->currPos; |
2142 | $r6 = $this->a1($r5); |
2143 | if ($r6) { |
2144 | $r6 = false; |
2145 | } else { |
2146 | $r6 = self::$FAILED; |
2147 | $this->currPos = $p3; |
2148 | $r1 = self::$FAILED; |
2149 | goto seq_1; |
2150 | } |
2151 | $r1 = true; |
2152 | seq_1: |
2153 | if ($r1!==self::$FAILED) { |
2154 | $this->savedPos = $p2; |
2155 | $r1 = $this->a2($r5); |
2156 | goto choice_1; |
2157 | } |
2158 | // free $p3 |
2159 | // start seq_2 |
2160 | $p3 = $this->currPos; |
2161 | $r7 = []; |
2162 | for (;;) { |
2163 | $r8 = $this->parsenewlineToken($silence); |
2164 | if ($r8!==self::$FAILED) { |
2165 | $r7[] = $r8; |
2166 | } else { |
2167 | break; |
2168 | } |
2169 | } |
2170 | // free $r8 |
2171 | $this->savedPos = $this->currPos; |
2172 | $r8 = $this->a3(); |
2173 | if ($r8) { |
2174 | $r8 = false; |
2175 | } else { |
2176 | $r8 = self::$FAILED; |
2177 | $this->currPos = $p3; |
2178 | $r1 = self::$FAILED; |
2179 | goto seq_2; |
2180 | } |
2181 | $r1 = [$r7,$r8]; |
2182 | seq_2: |
2183 | // free $p3 |
2184 | choice_1: |
2185 | if ($r1!==self::$FAILED) { |
2186 | yield $r1; |
2187 | } else { |
2188 | if ($this->currPos < $this->inputLength) { |
2189 | $this->fail(0); |
2190 | throw $this->buildParseException(); |
2191 | } |
2192 | break; |
2193 | } |
2194 | } |
2195 | } |
2196 | private function parsestart($silence, &$param_preproc) { |
2197 | $key = json_encode([298, $param_preproc]); |
2198 | $bucket = $this->currPos; |
2199 | $cached = $this->cache[$bucket][$key] ?? null; |
2200 | if ($cached) { |
2201 | $this->currPos = $cached->nextPos; |
2202 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2203 | return $cached->result; |
2204 | } |
2205 | $saved_preproc=$param_preproc; |
2206 | $p2 = $this->currPos; |
2207 | // start seq_1 |
2208 | $p3 = $this->currPos; |
2209 | $r4 = []; |
2210 | for (;;) { |
2211 | $r5 = $this->parsetlb(true, $param_preproc); |
2212 | if ($r5!==self::$FAILED) { |
2213 | $r4[] = $r5; |
2214 | } else { |
2215 | break; |
2216 | } |
2217 | } |
2218 | // t <- $r4 |
2219 | // free $r5 |
2220 | $r5 = []; |
2221 | for (;;) { |
2222 | $r6 = $this->parsenewlineToken(true); |
2223 | if ($r6!==self::$FAILED) { |
2224 | $r5[] = $r6; |
2225 | } else { |
2226 | break; |
2227 | } |
2228 | } |
2229 | // n <- $r5 |
2230 | // free $r6 |
2231 | $r1 = true; |
2232 | seq_1: |
2233 | if ($r1!==self::$FAILED) { |
2234 | $this->savedPos = $p2; |
2235 | $r1 = $this->a4($r4, $r5); |
2236 | } else { |
2237 | if (!$silence) {$this->fail(1);} |
2238 | } |
2239 | // free $p3 |
2240 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2241 | $this->currPos, |
2242 | $r1, |
2243 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2244 | self::$UNDEFINED |
2245 | ); |
2246 | return $r1; |
2247 | } |
2248 | private function parsetable_start_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
2249 | $key = json_encode([498, $boolParams & 0x7fbf, $param_preproc, $param_th]); |
2250 | $bucket = $this->currPos; |
2251 | $cached = $this->cache[$bucket][$key] ?? null; |
2252 | if ($cached) { |
2253 | $this->currPos = $cached->nextPos; |
2254 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2255 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2256 | return $cached->result; |
2257 | } |
2258 | $saved_preproc=$param_preproc; |
2259 | $saved_th=$param_th; |
2260 | $p2 = $this->currPos; |
2261 | // start seq_1 |
2262 | $p3 = $this->currPos; |
2263 | $r4 = []; |
2264 | for (;;) { |
2265 | // start choice_1 |
2266 | $r5 = $this->parsespace(true); |
2267 | if ($r5!==self::$FAILED) { |
2268 | goto choice_1; |
2269 | } |
2270 | $r5 = $this->parsecomment(true); |
2271 | choice_1: |
2272 | if ($r5!==self::$FAILED) { |
2273 | $r4[] = $r5; |
2274 | } else { |
2275 | break; |
2276 | } |
2277 | } |
2278 | // sc <- $r4 |
2279 | // free $r5 |
2280 | $p6 = $this->currPos; |
2281 | $r5 = ''; |
2282 | // startPos <- $r5 |
2283 | if ($r5!==self::$FAILED) { |
2284 | $this->savedPos = $p6; |
2285 | $r5 = $this->a5($r4); |
2286 | } else { |
2287 | $this->currPos = $p3; |
2288 | $r1 = self::$FAILED; |
2289 | goto seq_1; |
2290 | } |
2291 | // b <- $r7 |
2292 | if (($this->input[$this->currPos] ?? null) === "{") { |
2293 | $this->currPos++; |
2294 | $r7 = "{"; |
2295 | } else { |
2296 | $r7 = self::$FAILED; |
2297 | $this->currPos = $p3; |
2298 | $r1 = self::$FAILED; |
2299 | goto seq_1; |
2300 | } |
2301 | $r8 = $this->parsepipe(true); |
2302 | // p <- $r8 |
2303 | if ($r8===self::$FAILED) { |
2304 | $this->currPos = $p3; |
2305 | $r1 = self::$FAILED; |
2306 | goto seq_1; |
2307 | } |
2308 | // start choice_2 |
2309 | $r9 = $this->parsetable_attributes(true, $boolParams & ~0x40, $param_preproc, $param_th); |
2310 | if ($r9!==self::$FAILED) { |
2311 | goto choice_2; |
2312 | } |
2313 | $this->savedPos = $this->currPos; |
2314 | $r9 = $this->a6($r4, $r5, $r7, $r8); |
2315 | if ($r9) { |
2316 | $r9 = false; |
2317 | } else { |
2318 | $r9 = self::$FAILED; |
2319 | } |
2320 | choice_2: |
2321 | // ta <- $r9 |
2322 | if ($r9===self::$FAILED) { |
2323 | $this->currPos = $p3; |
2324 | $r1 = self::$FAILED; |
2325 | goto seq_1; |
2326 | } |
2327 | $p11 = $this->currPos; |
2328 | $r10 = ''; |
2329 | // tsEndPos <- $r10 |
2330 | if ($r10!==self::$FAILED) { |
2331 | $this->savedPos = $p11; |
2332 | $r10 = $this->a7($r4, $r5, $r7, $r8, $r9); |
2333 | } else { |
2334 | $this->currPos = $p3; |
2335 | $r1 = self::$FAILED; |
2336 | goto seq_1; |
2337 | } |
2338 | $r12 = []; |
2339 | for (;;) { |
2340 | $r13 = $this->parsespace(true); |
2341 | if ($r13!==self::$FAILED) { |
2342 | $r12[] = $r13; |
2343 | } else { |
2344 | break; |
2345 | } |
2346 | } |
2347 | // s2 <- $r12 |
2348 | // free $r13 |
2349 | $r1 = true; |
2350 | seq_1: |
2351 | if ($r1!==self::$FAILED) { |
2352 | $this->savedPos = $p2; |
2353 | $r1 = $this->a8($r4, $r5, $r7, $r8, $r9, $r10, $r12); |
2354 | } else { |
2355 | if (!$silence) {$this->fail(2);} |
2356 | } |
2357 | // free $p3 |
2358 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2359 | $this->currPos, |
2360 | $r1, |
2361 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2362 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2363 | ); |
2364 | return $r1; |
2365 | } |
2366 | private function parseurl($silence, &$param_preproc) { |
2367 | $key = json_encode([358, $param_preproc]); |
2368 | $bucket = $this->currPos; |
2369 | $cached = $this->cache[$bucket][$key] ?? null; |
2370 | if ($cached) { |
2371 | $this->currPos = $cached->nextPos; |
2372 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2373 | return $cached->result; |
2374 | } |
2375 | $saved_preproc=$param_preproc; |
2376 | $p2 = $this->currPos; |
2377 | // start seq_1 |
2378 | $p3 = $this->currPos; |
2379 | $r4 = $this->parseurl_protocol($silence); |
2380 | // proto <- $r4 |
2381 | if ($r4===self::$FAILED) { |
2382 | $r1 = self::$FAILED; |
2383 | goto seq_1; |
2384 | } |
2385 | // start choice_1 |
2386 | $r5 = $this->parseipv6urladdr($silence); |
2387 | if ($r5!==self::$FAILED) { |
2388 | goto choice_1; |
2389 | } |
2390 | $r5 = ''; |
2391 | choice_1: |
2392 | // addr <- $r5 |
2393 | if ($r5===self::$FAILED) { |
2394 | $this->currPos = $p3; |
2395 | $r1 = self::$FAILED; |
2396 | goto seq_1; |
2397 | } |
2398 | $r6 = []; |
2399 | for (;;) { |
2400 | $p8 = $this->currPos; |
2401 | // start seq_2 |
2402 | $p9 = $this->currPos; |
2403 | $p10 = $this->currPos; |
2404 | $r11 = $this->discardinline_breaks(true, 0x0, $param_preproc, self::newRef(null)); |
2405 | if ($r11 === self::$FAILED) { |
2406 | $r11 = false; |
2407 | } else { |
2408 | $r11 = self::$FAILED; |
2409 | $this->currPos = $p10; |
2410 | $r7 = self::$FAILED; |
2411 | goto seq_2; |
2412 | } |
2413 | // free $p10 |
2414 | // start choice_2 |
2415 | $r12 = $this->parseno_punctuation_char($silence); |
2416 | if ($r12!==self::$FAILED) { |
2417 | goto choice_2; |
2418 | } |
2419 | $r12 = $this->parsecomment($silence); |
2420 | if ($r12!==self::$FAILED) { |
2421 | goto choice_2; |
2422 | } |
2423 | $r12 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2424 | if ($r12!==self::$FAILED) { |
2425 | goto choice_2; |
2426 | } |
2427 | $r12 = $this->input[$this->currPos] ?? ''; |
2428 | if ($r12 === "'" || $r12 === "{") { |
2429 | $this->currPos++; |
2430 | goto choice_2; |
2431 | } else { |
2432 | $r12 = self::$FAILED; |
2433 | if (!$silence) {$this->fail(3);} |
2434 | } |
2435 | $p10 = $this->currPos; |
2436 | // start seq_3 |
2437 | $p13 = $this->currPos; |
2438 | $p14 = $this->currPos; |
2439 | // start seq_4 |
2440 | $p16 = $this->currPos; |
2441 | if (($this->input[$this->currPos] ?? null) === "&") { |
2442 | $this->currPos++; |
2443 | $r17 = "&"; |
2444 | } else { |
2445 | $r17 = self::$FAILED; |
2446 | $r15 = self::$FAILED; |
2447 | goto seq_4; |
2448 | } |
2449 | // start choice_3 |
2450 | // start seq_5 |
2451 | $p19 = $this->currPos; |
2452 | $r20 = $this->input[$this->currPos] ?? ''; |
2453 | if ($r20 === "l" || $r20 === "L") { |
2454 | $this->currPos++; |
2455 | } else { |
2456 | $r20 = self::$FAILED; |
2457 | $r18 = self::$FAILED; |
2458 | goto seq_5; |
2459 | } |
2460 | $r21 = $this->input[$this->currPos] ?? ''; |
2461 | if ($r21 === "t" || $r21 === "T") { |
2462 | $this->currPos++; |
2463 | } else { |
2464 | $r21 = self::$FAILED; |
2465 | $this->currPos = $p19; |
2466 | $r18 = self::$FAILED; |
2467 | goto seq_5; |
2468 | } |
2469 | $r18 = true; |
2470 | seq_5: |
2471 | if ($r18!==self::$FAILED) { |
2472 | goto choice_3; |
2473 | } |
2474 | // free $p19 |
2475 | // start seq_6 |
2476 | $p19 = $this->currPos; |
2477 | $r22 = $this->input[$this->currPos] ?? ''; |
2478 | if ($r22 === "g" || $r22 === "G") { |
2479 | $this->currPos++; |
2480 | } else { |
2481 | $r22 = self::$FAILED; |
2482 | $r18 = self::$FAILED; |
2483 | goto seq_6; |
2484 | } |
2485 | $r23 = $this->input[$this->currPos] ?? ''; |
2486 | if ($r23 === "t" || $r23 === "T") { |
2487 | $this->currPos++; |
2488 | } else { |
2489 | $r23 = self::$FAILED; |
2490 | $this->currPos = $p19; |
2491 | $r18 = self::$FAILED; |
2492 | goto seq_6; |
2493 | } |
2494 | $r18 = true; |
2495 | seq_6: |
2496 | // free $p19 |
2497 | choice_3: |
2498 | if ($r18===self::$FAILED) { |
2499 | $this->currPos = $p16; |
2500 | $r15 = self::$FAILED; |
2501 | goto seq_4; |
2502 | } |
2503 | if (($this->input[$this->currPos] ?? null) === ";") { |
2504 | $this->currPos++; |
2505 | $r24 = ";"; |
2506 | } else { |
2507 | $r24 = self::$FAILED; |
2508 | $this->currPos = $p16; |
2509 | $r15 = self::$FAILED; |
2510 | goto seq_4; |
2511 | } |
2512 | $r15 = true; |
2513 | seq_4: |
2514 | // free $p16 |
2515 | if ($r15 === self::$FAILED) { |
2516 | $r15 = false; |
2517 | } else { |
2518 | $r15 = self::$FAILED; |
2519 | $this->currPos = $p14; |
2520 | $r12 = self::$FAILED; |
2521 | goto seq_3; |
2522 | } |
2523 | // free $p14 |
2524 | // start choice_4 |
2525 | $p14 = $this->currPos; |
2526 | // start seq_7 |
2527 | $p16 = $this->currPos; |
2528 | $p19 = $this->currPos; |
2529 | if (($this->input[$this->currPos] ?? null) === "&") { |
2530 | $this->currPos++; |
2531 | $r26 = "&"; |
2532 | $r26 = false; |
2533 | $this->currPos = $p19; |
2534 | } else { |
2535 | $r26 = self::$FAILED; |
2536 | $r25 = self::$FAILED; |
2537 | goto seq_7; |
2538 | } |
2539 | // free $p19 |
2540 | $r27 = $this->parsehtmlentity($silence); |
2541 | // he <- $r27 |
2542 | if ($r27===self::$FAILED) { |
2543 | $this->currPos = $p16; |
2544 | $r25 = self::$FAILED; |
2545 | goto seq_7; |
2546 | } |
2547 | $r25 = true; |
2548 | seq_7: |
2549 | if ($r25!==self::$FAILED) { |
2550 | $this->savedPos = $p14; |
2551 | $r25 = $this->a9($r4, $r5, $r27); |
2552 | goto choice_4; |
2553 | } |
2554 | // free $p16 |
2555 | if (($this->input[$this->currPos] ?? null) === "&") { |
2556 | $this->currPos++; |
2557 | $r25 = "&"; |
2558 | } else { |
2559 | if (!$silence) {$this->fail(4);} |
2560 | $r25 = self::$FAILED; |
2561 | } |
2562 | choice_4: |
2563 | // r <- $r25 |
2564 | if ($r25===self::$FAILED) { |
2565 | $this->currPos = $p13; |
2566 | $r12 = self::$FAILED; |
2567 | goto seq_3; |
2568 | } |
2569 | $r12 = true; |
2570 | seq_3: |
2571 | if ($r12!==self::$FAILED) { |
2572 | $this->savedPos = $p10; |
2573 | $r12 = $this->a10($r4, $r5, $r25); |
2574 | } |
2575 | // free $p13 |
2576 | choice_2: |
2577 | // c <- $r12 |
2578 | if ($r12===self::$FAILED) { |
2579 | $this->currPos = $p9; |
2580 | $r7 = self::$FAILED; |
2581 | goto seq_2; |
2582 | } |
2583 | $r7 = true; |
2584 | seq_2: |
2585 | if ($r7!==self::$FAILED) { |
2586 | $this->savedPos = $p8; |
2587 | $r7 = $this->a11($r4, $r5, $r12); |
2588 | $r6[] = $r7; |
2589 | } else { |
2590 | break; |
2591 | } |
2592 | // free $p9 |
2593 | } |
2594 | // path <- $r6 |
2595 | // free $r7 |
2596 | $this->savedPos = $this->currPos; |
2597 | $r7 = $this->a12($r4, $r5, $r6); |
2598 | if ($r7) { |
2599 | $r7 = false; |
2600 | } else { |
2601 | $r7 = self::$FAILED; |
2602 | $this->currPos = $p3; |
2603 | $r1 = self::$FAILED; |
2604 | goto seq_1; |
2605 | } |
2606 | $r1 = true; |
2607 | seq_1: |
2608 | if ($r1!==self::$FAILED) { |
2609 | $this->savedPos = $p2; |
2610 | $r1 = $this->a13($r4, $r5, $r6); |
2611 | } |
2612 | // free $p3 |
2613 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2614 | $this->currPos, |
2615 | $r1, |
2616 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2617 | self::$UNDEFINED |
2618 | ); |
2619 | return $r1; |
2620 | } |
2621 | private function parserow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) { |
2622 | $key = json_encode([520, $boolParams & 0x7eff, $param_preproc, $param_th]); |
2623 | $bucket = $this->currPos; |
2624 | $cached = $this->cache[$bucket][$key] ?? null; |
2625 | if ($cached) { |
2626 | $this->currPos = $cached->nextPos; |
2627 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2628 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2629 | return $cached->result; |
2630 | } |
2631 | $saved_preproc=$param_preproc; |
2632 | $saved_th=$param_th; |
2633 | $p2 = $this->currPos; |
2634 | // start seq_1 |
2635 | $p3 = $this->currPos; |
2636 | $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th); |
2637 | // as <- $r4 |
2638 | if ($r4===self::$FAILED) { |
2639 | $r1 = self::$FAILED; |
2640 | goto seq_1; |
2641 | } |
2642 | $r5 = $this->parseoptional_spaces($silence); |
2643 | // s <- $r5 |
2644 | if ($r5===self::$FAILED) { |
2645 | $this->currPos = $p3; |
2646 | $r1 = self::$FAILED; |
2647 | goto seq_1; |
2648 | } |
2649 | $r6 = $this->parsepipe($silence); |
2650 | // p <- $r6 |
2651 | if ($r6===self::$FAILED) { |
2652 | $this->currPos = $p3; |
2653 | $r1 = self::$FAILED; |
2654 | goto seq_1; |
2655 | } |
2656 | $p7 = $this->currPos; |
2657 | $r8 = $this->discardpipe(true); |
2658 | if ($r8 === self::$FAILED) { |
2659 | $r8 = false; |
2660 | } else { |
2661 | $r8 = self::$FAILED; |
2662 | $this->currPos = $p7; |
2663 | $this->currPos = $p3; |
2664 | $r1 = self::$FAILED; |
2665 | goto seq_1; |
2666 | } |
2667 | // free $p7 |
2668 | $r1 = true; |
2669 | seq_1: |
2670 | if ($r1!==self::$FAILED) { |
2671 | $this->savedPos = $p2; |
2672 | $r1 = $this->a14($r4, $r5, $r6); |
2673 | } |
2674 | // free $p3 |
2675 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2676 | $this->currPos, |
2677 | $r1, |
2678 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2679 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2680 | ); |
2681 | return $r1; |
2682 | } |
2683 | private function parsetable_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2684 | $key = json_encode([302, $boolParams & 0x7fff, $param_preproc, $param_th]); |
2685 | $bucket = $this->currPos; |
2686 | $cached = $this->cache[$bucket][$key] ?? null; |
2687 | if ($cached) { |
2688 | $this->currPos = $cached->nextPos; |
2689 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2690 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2691 | return $cached->result; |
2692 | } |
2693 | $saved_preproc=$param_preproc; |
2694 | $saved_th=$param_th; |
2695 | $r1 = []; |
2696 | for (;;) { |
2697 | // start choice_1 |
2698 | $r2 = $this->parsetable_attribute(true, $boolParams, $param_preproc, $param_th); |
2699 | if ($r2!==self::$FAILED) { |
2700 | goto choice_1; |
2701 | } |
2702 | $p3 = $this->currPos; |
2703 | // start seq_1 |
2704 | $p4 = $this->currPos; |
2705 | $r5 = $this->discardoptionalSpaceToken(true); |
2706 | if ($r5===self::$FAILED) { |
2707 | $r2 = self::$FAILED; |
2708 | goto seq_1; |
2709 | } |
2710 | $r6 = $this->parsebroken_table_attribute_name_char(true); |
2711 | // b <- $r6 |
2712 | if ($r6===self::$FAILED) { |
2713 | $this->currPos = $p4; |
2714 | $r2 = self::$FAILED; |
2715 | goto seq_1; |
2716 | } |
2717 | $r2 = true; |
2718 | seq_1: |
2719 | if ($r2!==self::$FAILED) { |
2720 | $this->savedPos = $p3; |
2721 | $r2 = $this->a15($r6); |
2722 | } |
2723 | // free $p4 |
2724 | choice_1: |
2725 | if ($r2!==self::$FAILED) { |
2726 | $r1[] = $r2; |
2727 | } else { |
2728 | break; |
2729 | } |
2730 | } |
2731 | // free $r2 |
2732 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2733 | $this->currPos, |
2734 | $r1, |
2735 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2736 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2737 | ); |
2738 | return $r1; |
2739 | } |
2740 | private function parsegeneric_newline_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
2741 | $key = json_encode([300, $boolParams & 0x7fff, $param_preproc, $param_th]); |
2742 | $bucket = $this->currPos; |
2743 | $cached = $this->cache[$bucket][$key] ?? null; |
2744 | if ($cached) { |
2745 | $this->currPos = $cached->nextPos; |
2746 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2747 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2748 | return $cached->result; |
2749 | } |
2750 | $saved_preproc=$param_preproc; |
2751 | $saved_th=$param_th; |
2752 | $r1 = []; |
2753 | for (;;) { |
2754 | $r2 = $this->parsegeneric_newline_attribute(true, $boolParams, $param_preproc, $param_th); |
2755 | if ($r2!==self::$FAILED) { |
2756 | $r1[] = $r2; |
2757 | } else { |
2758 | break; |
2759 | } |
2760 | } |
2761 | // free $r2 |
2762 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2763 | $this->currPos, |
2764 | $r1, |
2765 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2766 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
2767 | ); |
2768 | return $r1; |
2769 | } |
2770 | private function parsetplarg_or_template_or_bust($silence, &$param_preproc) { |
2771 | $key = json_encode([368, $param_preproc]); |
2772 | $bucket = $this->currPos; |
2773 | $cached = $this->cache[$bucket][$key] ?? null; |
2774 | if ($cached) { |
2775 | $this->currPos = $cached->nextPos; |
2776 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2777 | return $cached->result; |
2778 | } |
2779 | $saved_preproc=$param_preproc; |
2780 | $p2 = $this->currPos; |
2781 | $r3 = []; |
2782 | for (;;) { |
2783 | // start choice_1 |
2784 | $r4 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
2785 | if ($r4!==self::$FAILED) { |
2786 | goto choice_1; |
2787 | } |
2788 | if ($this->currPos < $this->inputLength) { |
2789 | $r4 = self::consumeChar($this->input, $this->currPos);; |
2790 | } else { |
2791 | $r4 = self::$FAILED; |
2792 | if (!$silence) {$this->fail(7);} |
2793 | } |
2794 | choice_1: |
2795 | if ($r4!==self::$FAILED) { |
2796 | $r3[] = $r4; |
2797 | } else { |
2798 | break; |
2799 | } |
2800 | } |
2801 | if (count($r3) === 0) { |
2802 | $r3 = self::$FAILED; |
2803 | } |
2804 | // r <- $r3 |
2805 | // free $r4 |
2806 | $r1 = $r3; |
2807 | if ($r1!==self::$FAILED) { |
2808 | $this->savedPos = $p2; |
2809 | $r1 = $this->a16($r3); |
2810 | } |
2811 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
2812 | $this->currPos, |
2813 | $r1, |
2814 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
2815 | self::$UNDEFINED |
2816 | ); |
2817 | return $r1; |
2818 | } |
2819 | private function parseextlink($silence, $boolParams, &$param_preproc, &$param_th) { |
2820 | $key = json_encode([344, $boolParams & 0x7fff, $param_preproc, $param_th]); |
2821 | $bucket = $this->currPos; |
2822 | $cached = $this->cache[$bucket][$key] ?? null; |
2823 | if ($cached) { |
2824 | $this->currPos = $cached->nextPos; |
2825 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
2826 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
2827 | return $cached->result; |
2828 | } |
2829 | $saved_preproc=$param_preproc; |
2830 | $saved_th=$param_th; |
2831 | $p2 = $this->currPos; |
2832 | // start seq_1 |
2833 | $p3 = $this->currPos; |
2834 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
2835 | $r4 = false; |
2836 | } else { |
2837 | $r4 = self::$FAILED; |
2838 | $r1 = self::$FAILED; |
2839 | goto seq_1; |
2840 | } |
2841 | $p6 = $this->currPos; |
2842 | // start seq_2 |
2843 | $p7 = $this->currPos; |
2844 | if (($this->input[$this->currPos] ?? null) === "[") { |
2845 | $this->currPos++; |
2846 | $r8 = "["; |
2847 | } else { |
2848 | $r8 = self::$FAILED; |
2849 | $r5 = self::$FAILED; |
2850 | goto seq_2; |
2851 | } |
2852 | $p10 = $this->currPos; |
2853 | $r9 = ''; |
2854 | // p0 <- $r9 |
2855 | if ($r9!==self::$FAILED) { |
2856 | $this->savedPos = $p10; |
2857 | $r9 = $this->a17(); |
2858 | } else { |
2859 | $this->currPos = $p7; |
2860 | $r5 = self::$FAILED; |
2861 | goto seq_2; |
2862 | } |
2863 | $p12 = $this->currPos; |
2864 | // start seq_3 |
2865 | $p13 = $this->currPos; |
2866 | // start choice_1 |
2867 | // start seq_4 |
2868 | $p15 = $this->currPos; |
2869 | $r16 = $this->parseurl_protocol(true); |
2870 | if ($r16===self::$FAILED) { |
2871 | $r14 = self::$FAILED; |
2872 | goto seq_4; |
2873 | } |
2874 | $r17 = $this->parseipv6urladdr(true); |
2875 | if ($r17===self::$FAILED) { |
2876 | $this->currPos = $p15; |
2877 | $r14 = self::$FAILED; |
2878 | goto seq_4; |
2879 | } |
2880 | $r14 = [$r16,$r17]; |
2881 | seq_4: |
2882 | if ($r14!==self::$FAILED) { |
2883 | goto choice_1; |
2884 | } |
2885 | // free $p15 |
2886 | $r14 = ''; |
2887 | choice_1: |
2888 | // addr <- $r14 |
2889 | if ($r14===self::$FAILED) { |
2890 | $r11 = self::$FAILED; |
2891 | goto seq_3; |
2892 | } |
2893 | // start choice_2 |
2894 | $r18 = $this->parseextlink_nonipv6url(true, $boolParams | 0x8, $param_preproc, $param_th); |
2895 | if ($r18!==self::$FAILED) { |
2896 | goto choice_2; |
2897 | } |
2898 | $r18 = ''; |
2899 | choice_2: |
2900 | // target <- $r18 |
2901 | if ($r18===self::$FAILED) { |
2902 | $this->currPos = $p13; |
2903 | $r11 = self::$FAILED; |
2904 | goto seq_3; |
2905 | } |
2906 | $r11 = true; |
2907 | seq_3: |
2908 | // flat <- $r11 |
2909 | if ($r11!==self::$FAILED) { |
2910 | $this->savedPos = $p12; |
2911 | $r11 = $this->a18($r9, $r14, $r18); |
2912 | } else { |
2913 | $this->currPos = $p7; |
2914 | $r5 = self::$FAILED; |
2915 | goto seq_2; |
2916 | } |
2917 | // free $p13 |
2918 | $this->savedPos = $this->currPos; |
2919 | $r19 = $this->a19($r9, $r11); |
2920 | if ($r19) { |
2921 | $r19 = false; |
2922 | } else { |
2923 | $r19 = self::$FAILED; |
2924 | $this->currPos = $p7; |
2925 | $r5 = self::$FAILED; |
2926 | goto seq_2; |
2927 | } |
2928 | $p13 = $this->currPos; |
2929 | $r20 = ''; |
2930 | // p1 <- $r20 |
2931 | if ($r20!==self::$FAILED) { |
2932 | $this->savedPos = $p13; |
2933 | $r20 = $this->a20($r9, $r11); |
2934 | } else { |
2935 | $this->currPos = $p7; |
2936 | $r5 = self::$FAILED; |
2937 | goto seq_2; |
2938 | } |
2939 | $p15 = $this->currPos; |
2940 | for (;;) { |
2941 | // start choice_3 |
2942 | $r22 = $this->discardspace(true); |
2943 | if ($r22!==self::$FAILED) { |
2944 | goto choice_3; |
2945 | } |
2946 | $r22 = $this->discardunispace(true); |
2947 | choice_3: |
2948 | if ($r22===self::$FAILED) { |
2949 | break; |
2950 | } |
2951 | } |
2952 | // free $r22 |
2953 | $r21 = true; |
2954 | // sp <- $r21 |
2955 | if ($r21!==self::$FAILED) { |
2956 | $r21 = substr($this->input, $p15, $this->currPos - $p15); |
2957 | } else { |
2958 | $r21 = self::$FAILED; |
2959 | $this->currPos = $p7; |
2960 | $r5 = self::$FAILED; |
2961 | goto seq_2; |
2962 | } |
2963 | // free $p15 |
2964 | $p15 = $this->currPos; |
2965 | $r22 = ''; |
2966 | // p2 <- $r22 |
2967 | if ($r22!==self::$FAILED) { |
2968 | $this->savedPos = $p15; |
2969 | $r22 = $this->a21($r9, $r11, $r20, $r21); |
2970 | } else { |
2971 | $this->currPos = $p7; |
2972 | $r5 = self::$FAILED; |
2973 | goto seq_2; |
2974 | } |
2975 | $r23 = $this->parseinlineline(true, $boolParams | 0x8, $param_preproc, $param_th); |
2976 | if ($r23===self::$FAILED) { |
2977 | $r23 = null; |
2978 | } |
2979 | // content <- $r23 |
2980 | $p25 = $this->currPos; |
2981 | $r24 = ''; |
2982 | // p3 <- $r24 |
2983 | if ($r24!==self::$FAILED) { |
2984 | $this->savedPos = $p25; |
2985 | $r24 = $this->a22($r9, $r11, $r20, $r21, $r22, $r23); |
2986 | } else { |
2987 | $this->currPos = $p7; |
2988 | $r5 = self::$FAILED; |
2989 | goto seq_2; |
2990 | } |
2991 | if (($this->input[$this->currPos] ?? null) === "]") { |
2992 | $this->currPos++; |
2993 | $r26 = "]"; |
2994 | } else { |
2995 | $r26 = self::$FAILED; |
2996 | $this->currPos = $p7; |
2997 | $r5 = self::$FAILED; |
2998 | goto seq_2; |
2999 | } |
3000 | $r5 = true; |
3001 | seq_2: |
3002 | // r <- $r5 |
3003 | if ($r5!==self::$FAILED) { |
3004 | $this->savedPos = $p6; |
3005 | $r5 = $this->a23($r9, $r11, $r20, $r21, $r22, $r23, $r24); |
3006 | } else { |
3007 | $this->currPos = $p3; |
3008 | $r1 = self::$FAILED; |
3009 | goto seq_1; |
3010 | } |
3011 | // free $p7 |
3012 | $r1 = true; |
3013 | seq_1: |
3014 | if ($r1!==self::$FAILED) { |
3015 | $this->savedPos = $p2; |
3016 | $r1 = $this->a24($r5); |
3017 | } else { |
3018 | if (!$silence) {$this->fail(8);} |
3019 | } |
3020 | // free $p3 |
3021 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3022 | $this->currPos, |
3023 | $r1, |
3024 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3025 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3026 | ); |
3027 | return $r1; |
3028 | } |
3029 | private function parselist_item($silence, $boolParams, &$param_preproc, &$param_th) { |
3030 | $key = json_encode([476, $boolParams & 0x7fff, $param_preproc, $param_th]); |
3031 | $bucket = $this->currPos; |
3032 | $cached = $this->cache[$bucket][$key] ?? null; |
3033 | if ($cached) { |
3034 | $this->currPos = $cached->nextPos; |
3035 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3036 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3037 | return $cached->result; |
3038 | } |
3039 | $saved_preproc=$param_preproc; |
3040 | $saved_th=$param_th; |
3041 | // start choice_1 |
3042 | $r1 = $this->parsedtdd($silence, $boolParams, $param_preproc, $param_th); |
3043 | if ($r1!==self::$FAILED) { |
3044 | goto choice_1; |
3045 | } |
3046 | $r1 = $this->parsehacky_dl_uses($silence, $boolParams, $param_preproc, $param_th); |
3047 | if ($r1!==self::$FAILED) { |
3048 | goto choice_1; |
3049 | } |
3050 | $r1 = $this->parseli($silence, $boolParams, $param_preproc, $param_th); |
3051 | choice_1: |
3052 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3053 | $this->currPos, |
3054 | $r1, |
3055 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3056 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3057 | ); |
3058 | return $r1; |
3059 | } |
3060 | private function parsetlb($silence, &$param_preproc) { |
3061 | $key = json_encode([306, $param_preproc]); |
3062 | $bucket = $this->currPos; |
3063 | $cached = $this->cache[$bucket][$key] ?? null; |
3064 | if ($cached) { |
3065 | $this->currPos = $cached->nextPos; |
3066 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3067 | return $cached->result; |
3068 | } |
3069 | $saved_preproc=$param_preproc; |
3070 | $p2 = $this->currPos; |
3071 | // start seq_1 |
3072 | $p3 = $this->currPos; |
3073 | $p4 = $this->currPos; |
3074 | $r5 = $this->discardeof(true); |
3075 | if ($r5 === self::$FAILED) { |
3076 | $r5 = false; |
3077 | } else { |
3078 | $r5 = self::$FAILED; |
3079 | $this->currPos = $p4; |
3080 | $r1 = self::$FAILED; |
3081 | goto seq_1; |
3082 | } |
3083 | // free $p4 |
3084 | $r6 = $this->parseblock(true, 0x0, self::newRef(null), $param_preproc); |
3085 | // b <- $r6 |
3086 | if ($r6===self::$FAILED) { |
3087 | $this->currPos = $p3; |
3088 | $r1 = self::$FAILED; |
3089 | goto seq_1; |
3090 | } |
3091 | $r1 = true; |
3092 | seq_1: |
3093 | if ($r1!==self::$FAILED) { |
3094 | $this->savedPos = $p2; |
3095 | $r1 = $this->a25($r6); |
3096 | } else { |
3097 | if (!$silence) {$this->fail(9);} |
3098 | } |
3099 | // free $p3 |
3100 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3101 | $this->currPos, |
3102 | $r1, |
3103 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3104 | self::$UNDEFINED |
3105 | ); |
3106 | return $r1; |
3107 | } |
3108 | private function parsenewlineToken($silence) { |
3109 | $key = 568; |
3110 | $bucket = $this->currPos; |
3111 | $cached = $this->cache[$bucket][$key] ?? null; |
3112 | if ($cached) { |
3113 | $this->currPos = $cached->nextPos; |
3114 | |
3115 | return $cached->result; |
3116 | } |
3117 | |
3118 | $p2 = $this->currPos; |
3119 | $r1 = $this->discardnewline($silence); |
3120 | if ($r1!==self::$FAILED) { |
3121 | $this->savedPos = $p2; |
3122 | $r1 = $this->a26(); |
3123 | } |
3124 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3125 | $this->currPos, |
3126 | $r1, |
3127 | self::$UNDEFINED, |
3128 | self::$UNDEFINED |
3129 | ); |
3130 | return $r1; |
3131 | } |
3132 | private function parsespace($silence) { |
3133 | $key = 558; |
3134 | $bucket = $this->currPos; |
3135 | $cached = $this->cache[$bucket][$key] ?? null; |
3136 | if ($cached) { |
3137 | $this->currPos = $cached->nextPos; |
3138 | |
3139 | return $cached->result; |
3140 | } |
3141 | |
3142 | $r1 = $this->input[$this->currPos] ?? ''; |
3143 | if ($r1 === " " || $r1 === "\x09") { |
3144 | $this->currPos++; |
3145 | } else { |
3146 | $r1 = self::$FAILED; |
3147 | if (!$silence) {$this->fail(10);} |
3148 | } |
3149 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3150 | $this->currPos, |
3151 | $r1, |
3152 | self::$UNDEFINED, |
3153 | self::$UNDEFINED |
3154 | ); |
3155 | return $r1; |
3156 | } |
3157 | private function parsecomment($silence) { |
3158 | $key = 572; |
3159 | $bucket = $this->currPos; |
3160 | $cached = $this->cache[$bucket][$key] ?? null; |
3161 | if ($cached) { |
3162 | $this->currPos = $cached->nextPos; |
3163 | |
3164 | return $cached->result; |
3165 | } |
3166 | |
3167 | $p2 = $this->currPos; |
3168 | // start seq_1 |
3169 | $p3 = $this->currPos; |
3170 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
3171 | $r4 = "<!--"; |
3172 | $this->currPos += 4; |
3173 | } else { |
3174 | if (!$silence) {$this->fail(11);} |
3175 | $r4 = self::$FAILED; |
3176 | $r1 = self::$FAILED; |
3177 | goto seq_1; |
3178 | } |
3179 | $p6 = $this->currPos; |
3180 | for (;;) { |
3181 | // start seq_2 |
3182 | $p8 = $this->currPos; |
3183 | $p9 = $this->currPos; |
3184 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3185 | $r10 = "-->"; |
3186 | $this->currPos += 3; |
3187 | } else { |
3188 | $r10 = self::$FAILED; |
3189 | } |
3190 | if ($r10 === self::$FAILED) { |
3191 | $r10 = false; |
3192 | } else { |
3193 | $r10 = self::$FAILED; |
3194 | $this->currPos = $p9; |
3195 | $r7 = self::$FAILED; |
3196 | goto seq_2; |
3197 | } |
3198 | // free $p9 |
3199 | if ($this->currPos < $this->inputLength) { |
3200 | $r11 = self::consumeChar($this->input, $this->currPos);; |
3201 | } else { |
3202 | $r11 = self::$FAILED; |
3203 | if (!$silence) {$this->fail(7);} |
3204 | $this->currPos = $p8; |
3205 | $r7 = self::$FAILED; |
3206 | goto seq_2; |
3207 | } |
3208 | $r7 = true; |
3209 | seq_2: |
3210 | if ($r7===self::$FAILED) { |
3211 | break; |
3212 | } |
3213 | // free $p8 |
3214 | } |
3215 | // free $r7 |
3216 | $r5 = true; |
3217 | // c <- $r5 |
3218 | if ($r5!==self::$FAILED) { |
3219 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
3220 | } else { |
3221 | $r5 = self::$FAILED; |
3222 | $this->currPos = $p3; |
3223 | $r1 = self::$FAILED; |
3224 | goto seq_1; |
3225 | } |
3226 | // free $p6 |
3227 | $p6 = $this->currPos; |
3228 | // start choice_1 |
3229 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
3230 | $r7 = "-->"; |
3231 | $this->currPos += 3; |
3232 | goto choice_1; |
3233 | } else { |
3234 | if (!$silence) {$this->fail(12);} |
3235 | $r7 = self::$FAILED; |
3236 | } |
3237 | $r7 = $this->discardeof($silence); |
3238 | choice_1: |
3239 | // cEnd <- $r7 |
3240 | if ($r7!==self::$FAILED) { |
3241 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
3242 | } else { |
3243 | $r7 = self::$FAILED; |
3244 | $this->currPos = $p3; |
3245 | $r1 = self::$FAILED; |
3246 | goto seq_1; |
3247 | } |
3248 | // free $p6 |
3249 | $r1 = true; |
3250 | seq_1: |
3251 | if ($r1!==self::$FAILED) { |
3252 | $this->savedPos = $p2; |
3253 | $r1 = $this->a27($r5, $r7); |
3254 | } |
3255 | // free $p3 |
3256 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3257 | $this->currPos, |
3258 | $r1, |
3259 | self::$UNDEFINED, |
3260 | self::$UNDEFINED |
3261 | ); |
3262 | return $r1; |
3263 | } |
3264 | private function parsepipe($silence) { |
3265 | $key = 554; |
3266 | $bucket = $this->currPos; |
3267 | $cached = $this->cache[$bucket][$key] ?? null; |
3268 | if ($cached) { |
3269 | $this->currPos = $cached->nextPos; |
3270 | |
3271 | return $cached->result; |
3272 | } |
3273 | |
3274 | // start choice_1 |
3275 | if (($this->input[$this->currPos] ?? null) === "|") { |
3276 | $this->currPos++; |
3277 | $r1 = "|"; |
3278 | goto choice_1; |
3279 | } else { |
3280 | if (!$silence) {$this->fail(13);} |
3281 | $r1 = self::$FAILED; |
3282 | } |
3283 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3284 | $r1 = "{{!}}"; |
3285 | $this->currPos += 5; |
3286 | } else { |
3287 | if (!$silence) {$this->fail(14);} |
3288 | $r1 = self::$FAILED; |
3289 | } |
3290 | choice_1: |
3291 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3292 | $this->currPos, |
3293 | $r1, |
3294 | self::$UNDEFINED, |
3295 | self::$UNDEFINED |
3296 | ); |
3297 | return $r1; |
3298 | } |
3299 | private function parseurl_protocol($silence) { |
3300 | $key = 354; |
3301 | $bucket = $this->currPos; |
3302 | $cached = $this->cache[$bucket][$key] ?? null; |
3303 | if ($cached) { |
3304 | $this->currPos = $cached->nextPos; |
3305 | |
3306 | return $cached->result; |
3307 | } |
3308 | |
3309 | $p2 = $this->currPos; |
3310 | // start seq_1 |
3311 | $p3 = $this->currPos; |
3312 | $p5 = $this->currPos; |
3313 | // start choice_1 |
3314 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3315 | $r4 = "//"; |
3316 | $this->currPos += 2; |
3317 | goto choice_1; |
3318 | } else { |
3319 | if (!$silence) {$this->fail(15);} |
3320 | $r4 = self::$FAILED; |
3321 | } |
3322 | // start seq_2 |
3323 | $p6 = $this->currPos; |
3324 | $r7 = $this->input[$this->currPos] ?? ''; |
3325 | if (preg_match("/^[A-Za-z]/", $r7)) { |
3326 | $this->currPos++; |
3327 | } else { |
3328 | $r7 = self::$FAILED; |
3329 | if (!$silence) {$this->fail(16);} |
3330 | $r4 = self::$FAILED; |
3331 | goto seq_2; |
3332 | } |
3333 | for (;;) { |
3334 | $r9 = $this->input[$this->currPos] ?? ''; |
3335 | if (preg_match("/^[\\-A-Za-z0-9+.]/", $r9)) { |
3336 | $this->currPos++; |
3337 | } else { |
3338 | $r9 = self::$FAILED; |
3339 | if (!$silence) {$this->fail(17);} |
3340 | break; |
3341 | } |
3342 | } |
3343 | // free $r9 |
3344 | $r8 = true; |
3345 | if ($r8===self::$FAILED) { |
3346 | $this->currPos = $p6; |
3347 | $r4 = self::$FAILED; |
3348 | goto seq_2; |
3349 | } |
3350 | // free $r8 |
3351 | if (($this->input[$this->currPos] ?? null) === ":") { |
3352 | $this->currPos++; |
3353 | $r8 = ":"; |
3354 | } else { |
3355 | if (!$silence) {$this->fail(18);} |
3356 | $r8 = self::$FAILED; |
3357 | $this->currPos = $p6; |
3358 | $r4 = self::$FAILED; |
3359 | goto seq_2; |
3360 | } |
3361 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
3362 | $r9 = "//"; |
3363 | $this->currPos += 2; |
3364 | } else { |
3365 | if (!$silence) {$this->fail(15);} |
3366 | $r9 = self::$FAILED; |
3367 | $r9 = null; |
3368 | } |
3369 | $r4 = true; |
3370 | seq_2: |
3371 | // free $p6 |
3372 | choice_1: |
3373 | // p <- $r4 |
3374 | if ($r4!==self::$FAILED) { |
3375 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
3376 | } else { |
3377 | $r4 = self::$FAILED; |
3378 | $r1 = self::$FAILED; |
3379 | goto seq_1; |
3380 | } |
3381 | // free $p5 |
3382 | $this->savedPos = $this->currPos; |
3383 | $r10 = $this->a28($r4); |
3384 | if ($r10) { |
3385 | $r10 = false; |
3386 | } else { |
3387 | $r10 = self::$FAILED; |
3388 | $this->currPos = $p3; |
3389 | $r1 = self::$FAILED; |
3390 | goto seq_1; |
3391 | } |
3392 | $r1 = true; |
3393 | seq_1: |
3394 | if ($r1!==self::$FAILED) { |
3395 | $this->savedPos = $p2; |
3396 | $r1 = $this->a29($r4); |
3397 | } |
3398 | // free $p3 |
3399 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3400 | $this->currPos, |
3401 | $r1, |
3402 | self::$UNDEFINED, |
3403 | self::$UNDEFINED |
3404 | ); |
3405 | return $r1; |
3406 | } |
3407 | private function parseipv6urladdr($silence) { |
3408 | $key = 362; |
3409 | $bucket = $this->currPos; |
3410 | $cached = $this->cache[$bucket][$key] ?? null; |
3411 | if ($cached) { |
3412 | $this->currPos = $cached->nextPos; |
3413 | |
3414 | return $cached->result; |
3415 | } |
3416 | |
3417 | $p1 = $this->currPos; |
3418 | // start seq_1 |
3419 | $p3 = $this->currPos; |
3420 | if (($this->input[$this->currPos] ?? null) === "[") { |
3421 | $this->currPos++; |
3422 | $r4 = "["; |
3423 | } else { |
3424 | if (!$silence) {$this->fail(19);} |
3425 | $r4 = self::$FAILED; |
3426 | $r2 = self::$FAILED; |
3427 | goto seq_1; |
3428 | } |
3429 | $r5 = self::$FAILED; |
3430 | for (;;) { |
3431 | $r6 = $this->input[$this->currPos] ?? ''; |
3432 | if (preg_match("/^[0-9A-Fa-f:.]/", $r6)) { |
3433 | $this->currPos++; |
3434 | $r5 = true; |
3435 | } else { |
3436 | $r6 = self::$FAILED; |
3437 | if (!$silence) {$this->fail(20);} |
3438 | break; |
3439 | } |
3440 | } |
3441 | if ($r5===self::$FAILED) { |
3442 | $this->currPos = $p3; |
3443 | $r2 = self::$FAILED; |
3444 | goto seq_1; |
3445 | } |
3446 | // free $r6 |
3447 | if (($this->input[$this->currPos] ?? null) === "]") { |
3448 | $this->currPos++; |
3449 | $r6 = "]"; |
3450 | } else { |
3451 | if (!$silence) {$this->fail(21);} |
3452 | $r6 = self::$FAILED; |
3453 | $this->currPos = $p3; |
3454 | $r2 = self::$FAILED; |
3455 | goto seq_1; |
3456 | } |
3457 | $r2 = true; |
3458 | seq_1: |
3459 | if ($r2!==self::$FAILED) { |
3460 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3461 | } else { |
3462 | $r2 = self::$FAILED; |
3463 | } |
3464 | // free $p3 |
3465 | // free $p1 |
3466 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3467 | $this->currPos, |
3468 | $r2, |
3469 | self::$UNDEFINED, |
3470 | self::$UNDEFINED |
3471 | ); |
3472 | return $r2; |
3473 | } |
3474 | private function discardinline_breaks($silence, $boolParams, &$param_preproc, &$param_th) { |
3475 | $key = json_encode([327, $boolParams & 0x1ffe, $param_preproc, $param_th]); |
3476 | $bucket = $this->currPos; |
3477 | $cached = $this->cache[$bucket][$key] ?? null; |
3478 | if ($cached) { |
3479 | $this->currPos = $cached->nextPos; |
3480 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3481 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3482 | return $cached->result; |
3483 | } |
3484 | $saved_preproc=$param_preproc; |
3485 | $saved_th=$param_th; |
3486 | // start seq_1 |
3487 | $p1 = $this->currPos; |
3488 | $p3 = $this->currPos; |
3489 | if (strspn($this->input, "=|!{}:;\x0d\x0a[]-", $this->currPos, 1) !== 0) { |
3490 | $r4 = $this->input[$this->currPos++]; |
3491 | $r4 = false; |
3492 | $this->currPos = $p3; |
3493 | } else { |
3494 | $r4 = self::$FAILED; |
3495 | $r2 = self::$FAILED; |
3496 | goto seq_1; |
3497 | } |
3498 | // free $p3 |
3499 | // start seq_2 |
3500 | $p3 = $this->currPos; |
3501 | $this->savedPos = $this->currPos; |
3502 | $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); |
3503 | if ($r6) { |
3504 | $r6 = false; |
3505 | } else { |
3506 | $r6 = self::$FAILED; |
3507 | $this->currPos = $p3; |
3508 | $r5 = self::$FAILED; |
3509 | goto seq_2; |
3510 | } |
3511 | $r5 = true; |
3512 | seq_2: |
3513 | if ($r5===self::$FAILED) { |
3514 | $this->currPos = $p1; |
3515 | $r2 = self::$FAILED; |
3516 | goto seq_1; |
3517 | } |
3518 | // free $r5,$p3 |
3519 | $r2 = true; |
3520 | seq_1: |
3521 | // free $r2,$p1 |
3522 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3523 | $this->currPos, |
3524 | $r2, |
3525 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3526 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3527 | ); |
3528 | return $r2; |
3529 | } |
3530 | private function parseno_punctuation_char($silence) { |
3531 | $key = 356; |
3532 | $bucket = $this->currPos; |
3533 | $cached = $this->cache[$bucket][$key] ?? null; |
3534 | if ($cached) { |
3535 | $this->currPos = $cached->nextPos; |
3536 | |
3537 | return $cached->result; |
3538 | } |
3539 | |
3540 | $r1 = self::charAt($this->input, $this->currPos); |
3541 | 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)) { |
3542 | $this->currPos += strlen($r1); |
3543 | } else { |
3544 | $r1 = self::$FAILED; |
3545 | if (!$silence) {$this->fail(22);} |
3546 | } |
3547 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3548 | $this->currPos, |
3549 | $r1, |
3550 | self::$UNDEFINED, |
3551 | self::$UNDEFINED |
3552 | ); |
3553 | return $r1; |
3554 | } |
3555 | private function parsetplarg_or_template($silence, $boolParams, &$param_th, &$param_preproc) { |
3556 | $key = json_encode([364, $boolParams & 0x7fef, $param_th, $param_preproc]); |
3557 | $bucket = $this->currPos; |
3558 | $cached = $this->cache[$bucket][$key] ?? null; |
3559 | if ($cached) { |
3560 | $this->currPos = $cached->nextPos; |
3561 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3562 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3563 | return $cached->result; |
3564 | } |
3565 | $saved_th=$param_th; |
3566 | $saved_preproc=$param_preproc; |
3567 | $p2 = $this->currPos; |
3568 | // start seq_1 |
3569 | $p3 = $this->currPos; |
3570 | $p4 = $this->currPos; |
3571 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
3572 | $r5 = "{{"; |
3573 | $this->currPos += 2; |
3574 | $r5 = false; |
3575 | $this->currPos = $p4; |
3576 | } else { |
3577 | $r5 = self::$FAILED; |
3578 | $r1 = self::$FAILED; |
3579 | goto seq_1; |
3580 | } |
3581 | // free $p4 |
3582 | $r6 = $this->parsetplarg_or_template_guarded($silence, $boolParams | 0x10, $param_th, $param_preproc); |
3583 | // t <- $r6 |
3584 | if ($r6===self::$FAILED) { |
3585 | $this->currPos = $p3; |
3586 | $r1 = self::$FAILED; |
3587 | goto seq_1; |
3588 | } |
3589 | $r1 = true; |
3590 | seq_1: |
3591 | if ($r1!==self::$FAILED) { |
3592 | $this->savedPos = $p2; |
3593 | $r1 = $this->a31($r6); |
3594 | } |
3595 | // free $p3 |
3596 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3597 | $this->currPos, |
3598 | $r1, |
3599 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3600 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3601 | ); |
3602 | return $r1; |
3603 | } |
3604 | private function parsehtmlentity($silence) { |
3605 | $key = 528; |
3606 | $bucket = $this->currPos; |
3607 | $cached = $this->cache[$bucket][$key] ?? null; |
3608 | if ($cached) { |
3609 | $this->currPos = $cached->nextPos; |
3610 | |
3611 | return $cached->result; |
3612 | } |
3613 | |
3614 | $p2 = $this->currPos; |
3615 | $r3 = $this->parseraw_htmlentity($silence); |
3616 | // cc <- $r3 |
3617 | $r1 = $r3; |
3618 | if ($r1!==self::$FAILED) { |
3619 | $this->savedPos = $p2; |
3620 | $r1 = $this->a32($r3); |
3621 | } |
3622 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3623 | $this->currPos, |
3624 | $r1, |
3625 | self::$UNDEFINED, |
3626 | self::$UNDEFINED |
3627 | ); |
3628 | return $r1; |
3629 | } |
3630 | private function parseoptional_spaces($silence) { |
3631 | $key = 560; |
3632 | $bucket = $this->currPos; |
3633 | $cached = $this->cache[$bucket][$key] ?? null; |
3634 | if ($cached) { |
3635 | $this->currPos = $cached->nextPos; |
3636 | |
3637 | return $cached->result; |
3638 | } |
3639 | |
3640 | $p1 = $this->currPos; |
3641 | for (;;) { |
3642 | $r3 = $this->input[$this->currPos] ?? ''; |
3643 | if ($r3 === " " || $r3 === "\x09") { |
3644 | $this->currPos++; |
3645 | } else { |
3646 | $r3 = self::$FAILED; |
3647 | if (!$silence) {$this->fail(10);} |
3648 | break; |
3649 | } |
3650 | } |
3651 | // free $r3 |
3652 | $r2 = true; |
3653 | if ($r2!==self::$FAILED) { |
3654 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
3655 | } else { |
3656 | $r2 = self::$FAILED; |
3657 | } |
3658 | // free $p1 |
3659 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3660 | $this->currPos, |
3661 | $r2, |
3662 | self::$UNDEFINED, |
3663 | self::$UNDEFINED |
3664 | ); |
3665 | return $r2; |
3666 | } |
3667 | private function discardpipe($silence) { |
3668 | $key = 555; |
3669 | $bucket = $this->currPos; |
3670 | $cached = $this->cache[$bucket][$key] ?? null; |
3671 | if ($cached) { |
3672 | $this->currPos = $cached->nextPos; |
3673 | |
3674 | return $cached->result; |
3675 | } |
3676 | |
3677 | // start choice_1 |
3678 | if (($this->input[$this->currPos] ?? null) === "|") { |
3679 | $this->currPos++; |
3680 | $r1 = "|"; |
3681 | goto choice_1; |
3682 | } else { |
3683 | if (!$silence) {$this->fail(13);} |
3684 | $r1 = self::$FAILED; |
3685 | } |
3686 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
3687 | $r1 = "{{!}}"; |
3688 | $this->currPos += 5; |
3689 | } else { |
3690 | if (!$silence) {$this->fail(14);} |
3691 | $r1 = self::$FAILED; |
3692 | } |
3693 | choice_1: |
3694 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3695 | $this->currPos, |
3696 | $r1, |
3697 | self::$UNDEFINED, |
3698 | self::$UNDEFINED |
3699 | ); |
3700 | return $r1; |
3701 | } |
3702 | private function parsetable_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3703 | $key = json_encode([462, $boolParams & 0x7fff, $param_preproc, $param_th]); |
3704 | $bucket = $this->currPos; |
3705 | $cached = $this->cache[$bucket][$key] ?? null; |
3706 | if ($cached) { |
3707 | $this->currPos = $cached->nextPos; |
3708 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3709 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3710 | return $cached->result; |
3711 | } |
3712 | $saved_preproc=$param_preproc; |
3713 | $saved_th=$param_th; |
3714 | $p2 = $this->currPos; |
3715 | // start seq_1 |
3716 | $p3 = $this->currPos; |
3717 | $r4 = $this->parseoptionalSpaceToken($silence); |
3718 | // s <- $r4 |
3719 | if ($r4===self::$FAILED) { |
3720 | $r1 = self::$FAILED; |
3721 | goto seq_1; |
3722 | } |
3723 | $p6 = $this->currPos; |
3724 | $r5 = ''; |
3725 | // namePos0 <- $r5 |
3726 | if ($r5!==self::$FAILED) { |
3727 | $this->savedPos = $p6; |
3728 | $r5 = $this->a33($r4); |
3729 | } else { |
3730 | $this->currPos = $p3; |
3731 | $r1 = self::$FAILED; |
3732 | goto seq_1; |
3733 | } |
3734 | $r7 = $this->parsetable_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3735 | // name <- $r7 |
3736 | if ($r7===self::$FAILED) { |
3737 | $this->currPos = $p3; |
3738 | $r1 = self::$FAILED; |
3739 | goto seq_1; |
3740 | } |
3741 | $p9 = $this->currPos; |
3742 | $r8 = ''; |
3743 | // namePos1 <- $r8 |
3744 | if ($r8!==self::$FAILED) { |
3745 | $this->savedPos = $p9; |
3746 | $r8 = $this->a34($r4, $r5, $r7); |
3747 | } else { |
3748 | $this->currPos = $p3; |
3749 | $r1 = self::$FAILED; |
3750 | goto seq_1; |
3751 | } |
3752 | $p11 = $this->currPos; |
3753 | // start seq_2 |
3754 | $p12 = $this->currPos; |
3755 | $r13 = $this->discardoptionalSpaceToken($silence); |
3756 | if ($r13===self::$FAILED) { |
3757 | $r10 = self::$FAILED; |
3758 | goto seq_2; |
3759 | } |
3760 | if (($this->input[$this->currPos] ?? null) === "=") { |
3761 | $this->currPos++; |
3762 | $r14 = "="; |
3763 | } else { |
3764 | if (!$silence) {$this->fail(23);} |
3765 | $r14 = self::$FAILED; |
3766 | $this->currPos = $p12; |
3767 | $r10 = self::$FAILED; |
3768 | goto seq_2; |
3769 | } |
3770 | $r15 = $this->parsetable_att_value($silence, $boolParams, $param_preproc, $param_th); |
3771 | if ($r15===self::$FAILED) { |
3772 | $r15 = null; |
3773 | } |
3774 | // v <- $r15 |
3775 | $r10 = true; |
3776 | seq_2: |
3777 | if ($r10!==self::$FAILED) { |
3778 | $this->savedPos = $p11; |
3779 | $r10 = $this->a35($r4, $r5, $r7, $r8, $r15); |
3780 | } else { |
3781 | $r10 = null; |
3782 | } |
3783 | // free $p12 |
3784 | // vd <- $r10 |
3785 | $r1 = true; |
3786 | seq_1: |
3787 | if ($r1!==self::$FAILED) { |
3788 | $this->savedPos = $p2; |
3789 | $r1 = $this->a36($r4, $r5, $r7, $r8, $r10); |
3790 | } |
3791 | // free $p3 |
3792 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3793 | $this->currPos, |
3794 | $r1, |
3795 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3796 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3797 | ); |
3798 | return $r1; |
3799 | } |
3800 | private function discardoptionalSpaceToken($silence) { |
3801 | $key = 577; |
3802 | $bucket = $this->currPos; |
3803 | $cached = $this->cache[$bucket][$key] ?? null; |
3804 | if ($cached) { |
3805 | $this->currPos = $cached->nextPos; |
3806 | |
3807 | return $cached->result; |
3808 | } |
3809 | |
3810 | $p2 = $this->currPos; |
3811 | $r3 = $this->parseoptional_spaces($silence); |
3812 | // s <- $r3 |
3813 | $r1 = $r3; |
3814 | if ($r1!==self::$FAILED) { |
3815 | $this->savedPos = $p2; |
3816 | $r1 = $this->a37($r3); |
3817 | } |
3818 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3819 | $this->currPos, |
3820 | $r1, |
3821 | self::$UNDEFINED, |
3822 | self::$UNDEFINED |
3823 | ); |
3824 | return $r1; |
3825 | } |
3826 | private function parsebroken_table_attribute_name_char($silence) { |
3827 | $key = 468; |
3828 | $bucket = $this->currPos; |
3829 | $cached = $this->cache[$bucket][$key] ?? null; |
3830 | if ($cached) { |
3831 | $this->currPos = $cached->nextPos; |
3832 | |
3833 | return $cached->result; |
3834 | } |
3835 | |
3836 | $p2 = $this->currPos; |
3837 | // c <- $r3 |
3838 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
3839 | $r3 = $this->input[$this->currPos++]; |
3840 | } else { |
3841 | $r3 = self::$FAILED; |
3842 | if (!$silence) {$this->fail(24);} |
3843 | } |
3844 | $r1 = $r3; |
3845 | if ($r1!==self::$FAILED) { |
3846 | $this->savedPos = $p2; |
3847 | $r1 = $this->a38($r3); |
3848 | } |
3849 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3850 | $this->currPos, |
3851 | $r1, |
3852 | self::$UNDEFINED, |
3853 | self::$UNDEFINED |
3854 | ); |
3855 | return $r1; |
3856 | } |
3857 | private function parsegeneric_newline_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
3858 | $key = json_encode([460, $boolParams & 0x7fff, $param_preproc, $param_th]); |
3859 | $bucket = $this->currPos; |
3860 | $cached = $this->cache[$bucket][$key] ?? null; |
3861 | if ($cached) { |
3862 | $this->currPos = $cached->nextPos; |
3863 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3864 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3865 | return $cached->result; |
3866 | } |
3867 | $saved_preproc=$param_preproc; |
3868 | $saved_th=$param_th; |
3869 | $p2 = $this->currPos; |
3870 | // start seq_1 |
3871 | $p3 = $this->currPos; |
3872 | for (;;) { |
3873 | $r5 = $this->discardspace_or_newline_or_solidus($silence); |
3874 | if ($r5===self::$FAILED) { |
3875 | break; |
3876 | } |
3877 | } |
3878 | // free $r5 |
3879 | $r4 = true; |
3880 | if ($r4===self::$FAILED) { |
3881 | $r1 = self::$FAILED; |
3882 | goto seq_1; |
3883 | } |
3884 | // free $r4 |
3885 | $p6 = $this->currPos; |
3886 | $r4 = ''; |
3887 | // namePos0 <- $r4 |
3888 | if ($r4!==self::$FAILED) { |
3889 | $this->savedPos = $p6; |
3890 | $r4 = $this->a17(); |
3891 | } else { |
3892 | $this->currPos = $p3; |
3893 | $r1 = self::$FAILED; |
3894 | goto seq_1; |
3895 | } |
3896 | $r5 = $this->parsegeneric_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
3897 | // name <- $r5 |
3898 | if ($r5===self::$FAILED) { |
3899 | $this->currPos = $p3; |
3900 | $r1 = self::$FAILED; |
3901 | goto seq_1; |
3902 | } |
3903 | $p8 = $this->currPos; |
3904 | $r7 = ''; |
3905 | // namePos1 <- $r7 |
3906 | if ($r7!==self::$FAILED) { |
3907 | $this->savedPos = $p8; |
3908 | $r7 = $this->a39($r4, $r5); |
3909 | } else { |
3910 | $this->currPos = $p3; |
3911 | $r1 = self::$FAILED; |
3912 | goto seq_1; |
3913 | } |
3914 | $p10 = $this->currPos; |
3915 | // start seq_2 |
3916 | $p11 = $this->currPos; |
3917 | for (;;) { |
3918 | $r13 = $this->discardspace_or_newline($silence); |
3919 | if ($r13===self::$FAILED) { |
3920 | break; |
3921 | } |
3922 | } |
3923 | // free $r13 |
3924 | $r12 = true; |
3925 | if ($r12===self::$FAILED) { |
3926 | $r9 = self::$FAILED; |
3927 | goto seq_2; |
3928 | } |
3929 | // free $r12 |
3930 | if (($this->input[$this->currPos] ?? null) === "=") { |
3931 | $this->currPos++; |
3932 | $r12 = "="; |
3933 | } else { |
3934 | if (!$silence) {$this->fail(23);} |
3935 | $r12 = self::$FAILED; |
3936 | $this->currPos = $p11; |
3937 | $r9 = self::$FAILED; |
3938 | goto seq_2; |
3939 | } |
3940 | $r13 = $this->parsegeneric_att_value($silence, $boolParams, $param_preproc, $param_th); |
3941 | if ($r13===self::$FAILED) { |
3942 | $r13 = null; |
3943 | } |
3944 | // v <- $r13 |
3945 | $r9 = true; |
3946 | seq_2: |
3947 | if ($r9!==self::$FAILED) { |
3948 | $this->savedPos = $p10; |
3949 | $r9 = $this->a40($r4, $r5, $r7, $r13); |
3950 | } else { |
3951 | $r9 = null; |
3952 | } |
3953 | // free $p11 |
3954 | // vd <- $r9 |
3955 | $r1 = true; |
3956 | seq_1: |
3957 | if ($r1!==self::$FAILED) { |
3958 | $this->savedPos = $p2; |
3959 | $r1 = $this->a41($r4, $r5, $r7, $r9); |
3960 | } |
3961 | // free $p3 |
3962 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3963 | $this->currPos, |
3964 | $r1, |
3965 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3966 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3967 | ); |
3968 | return $r1; |
3969 | } |
3970 | private function parseextlink_nonipv6url($silence, $boolParams, &$param_preproc, &$param_th) { |
3971 | $key = json_encode([538, $boolParams & 0x77ff, $param_preproc, $param_th]); |
3972 | $bucket = $this->currPos; |
3973 | $cached = $this->cache[$bucket][$key] ?? null; |
3974 | if ($cached) { |
3975 | $this->currPos = $cached->nextPos; |
3976 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
3977 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
3978 | return $cached->result; |
3979 | } |
3980 | $saved_preproc=$param_preproc; |
3981 | $saved_th=$param_th; |
3982 | $r1 = $this->parseextlink_nonipv6url_parameterized($silence, $boolParams & ~0x800, $param_preproc, $param_th); |
3983 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
3984 | $this->currPos, |
3985 | $r1, |
3986 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
3987 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
3988 | ); |
3989 | return $r1; |
3990 | } |
3991 | private function discardspace($silence) { |
3992 | $key = 559; |
3993 | $bucket = $this->currPos; |
3994 | $cached = $this->cache[$bucket][$key] ?? null; |
3995 | if ($cached) { |
3996 | $this->currPos = $cached->nextPos; |
3997 | |
3998 | return $cached->result; |
3999 | } |
4000 | |
4001 | $r1 = $this->input[$this->currPos] ?? ''; |
4002 | if ($r1 === " " || $r1 === "\x09") { |
4003 | $this->currPos++; |
4004 | } else { |
4005 | $r1 = self::$FAILED; |
4006 | if (!$silence) {$this->fail(10);} |
4007 | } |
4008 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4009 | $this->currPos, |
4010 | $r1, |
4011 | self::$UNDEFINED, |
4012 | self::$UNDEFINED |
4013 | ); |
4014 | return $r1; |
4015 | } |
4016 | private function discardunispace($silence) { |
4017 | $key = 583; |
4018 | $bucket = $this->currPos; |
4019 | $cached = $this->cache[$bucket][$key] ?? null; |
4020 | if ($cached) { |
4021 | $this->currPos = $cached->nextPos; |
4022 | |
4023 | return $cached->result; |
4024 | } |
4025 | |
4026 | $r1 = self::charAt($this->input, $this->currPos); |
4027 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
4028 | $this->currPos += strlen($r1); |
4029 | } else { |
4030 | $r1 = self::$FAILED; |
4031 | if (!$silence) {$this->fail(25);} |
4032 | } |
4033 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4034 | $this->currPos, |
4035 | $r1, |
4036 | self::$UNDEFINED, |
4037 | self::$UNDEFINED |
4038 | ); |
4039 | return $r1; |
4040 | } |
4041 | private function parseinlineline($silence, $boolParams, &$param_preproc, &$param_th) { |
4042 | $key = json_encode([328, $boolParams & 0x7fff, $param_preproc, $param_th]); |
4043 | $bucket = $this->currPos; |
4044 | $cached = $this->cache[$bucket][$key] ?? null; |
4045 | if ($cached) { |
4046 | $this->currPos = $cached->nextPos; |
4047 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4048 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4049 | return $cached->result; |
4050 | } |
4051 | $saved_preproc=$param_preproc; |
4052 | $saved_th=$param_th; |
4053 | $p2 = $this->currPos; |
4054 | $r3 = []; |
4055 | for (;;) { |
4056 | // start choice_1 |
4057 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
4058 | if ($r4!==self::$FAILED) { |
4059 | goto choice_1; |
4060 | } |
4061 | $p5 = $this->currPos; |
4062 | // start seq_1 |
4063 | $p6 = $this->currPos; |
4064 | $p7 = $this->currPos; |
4065 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4066 | if ($r8 === self::$FAILED) { |
4067 | $r8 = false; |
4068 | } else { |
4069 | $r8 = self::$FAILED; |
4070 | $this->currPos = $p7; |
4071 | $r4 = self::$FAILED; |
4072 | goto seq_1; |
4073 | } |
4074 | // free $p7 |
4075 | // start choice_2 |
4076 | $r9 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
4077 | if ($r9!==self::$FAILED) { |
4078 | goto choice_2; |
4079 | } |
4080 | $p7 = $this->currPos; |
4081 | // start seq_2 |
4082 | $p10 = $this->currPos; |
4083 | $p11 = $this->currPos; |
4084 | $r12 = $this->discardnewline(true); |
4085 | if ($r12 === self::$FAILED) { |
4086 | $r12 = false; |
4087 | } else { |
4088 | $r12 = self::$FAILED; |
4089 | $this->currPos = $p11; |
4090 | $r9 = self::$FAILED; |
4091 | goto seq_2; |
4092 | } |
4093 | // free $p11 |
4094 | // s <- $r13 |
4095 | if ($this->currPos < $this->inputLength) { |
4096 | $r13 = self::consumeChar($this->input, $this->currPos);; |
4097 | } else { |
4098 | $r13 = self::$FAILED; |
4099 | if (!$silence) {$this->fail(7);} |
4100 | $this->currPos = $p10; |
4101 | $r9 = self::$FAILED; |
4102 | goto seq_2; |
4103 | } |
4104 | $r9 = true; |
4105 | seq_2: |
4106 | if ($r9!==self::$FAILED) { |
4107 | $this->savedPos = $p7; |
4108 | $r9 = $this->a42($r13); |
4109 | } |
4110 | // free $p10 |
4111 | choice_2: |
4112 | // r <- $r9 |
4113 | if ($r9===self::$FAILED) { |
4114 | $this->currPos = $p6; |
4115 | $r4 = self::$FAILED; |
4116 | goto seq_1; |
4117 | } |
4118 | $r4 = true; |
4119 | seq_1: |
4120 | if ($r4!==self::$FAILED) { |
4121 | $this->savedPos = $p5; |
4122 | $r4 = $this->a24($r9); |
4123 | } |
4124 | // free $p6 |
4125 | choice_1: |
4126 | if ($r4!==self::$FAILED) { |
4127 | $r3[] = $r4; |
4128 | } else { |
4129 | break; |
4130 | } |
4131 | } |
4132 | if (count($r3) === 0) { |
4133 | $r3 = self::$FAILED; |
4134 | } |
4135 | // c <- $r3 |
4136 | // free $r4 |
4137 | $r1 = $r3; |
4138 | if ($r1!==self::$FAILED) { |
4139 | $this->savedPos = $p2; |
4140 | $r1 = $this->a43($r3); |
4141 | } |
4142 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4143 | $this->currPos, |
4144 | $r1, |
4145 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4146 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4147 | ); |
4148 | return $r1; |
4149 | } |
4150 | private function parsedtdd($silence, $boolParams, &$param_preproc, &$param_th) { |
4151 | $key = json_encode([484, $boolParams & 0x7fff, $param_preproc, $param_th]); |
4152 | $bucket = $this->currPos; |
4153 | $cached = $this->cache[$bucket][$key] ?? null; |
4154 | if ($cached) { |
4155 | $this->currPos = $cached->nextPos; |
4156 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4157 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4158 | return $cached->result; |
4159 | } |
4160 | $saved_preproc=$param_preproc; |
4161 | $saved_th=$param_th; |
4162 | $p2 = $this->currPos; |
4163 | // start seq_1 |
4164 | $p3 = $this->currPos; |
4165 | $r4 = []; |
4166 | for (;;) { |
4167 | $p6 = $this->currPos; |
4168 | // start seq_2 |
4169 | $p7 = $this->currPos; |
4170 | $p8 = $this->currPos; |
4171 | // start seq_3 |
4172 | $p10 = $this->currPos; |
4173 | if (($this->input[$this->currPos] ?? null) === ";") { |
4174 | $this->currPos++; |
4175 | $r11 = ";"; |
4176 | } else { |
4177 | $r11 = self::$FAILED; |
4178 | $r9 = self::$FAILED; |
4179 | goto seq_3; |
4180 | } |
4181 | $p12 = $this->currPos; |
4182 | $r13 = $this->discardlist_char(true); |
4183 | if ($r13 === self::$FAILED) { |
4184 | $r13 = false; |
4185 | } else { |
4186 | $r13 = self::$FAILED; |
4187 | $this->currPos = $p12; |
4188 | $this->currPos = $p10; |
4189 | $r9 = self::$FAILED; |
4190 | goto seq_3; |
4191 | } |
4192 | // free $p12 |
4193 | $r9 = true; |
4194 | seq_3: |
4195 | // free $p10 |
4196 | if ($r9 === self::$FAILED) { |
4197 | $r9 = false; |
4198 | } else { |
4199 | $r9 = self::$FAILED; |
4200 | $this->currPos = $p8; |
4201 | $r5 = self::$FAILED; |
4202 | goto seq_2; |
4203 | } |
4204 | // free $p8 |
4205 | $r14 = $this->parselist_char($silence); |
4206 | // lc <- $r14 |
4207 | if ($r14===self::$FAILED) { |
4208 | $this->currPos = $p7; |
4209 | $r5 = self::$FAILED; |
4210 | goto seq_2; |
4211 | } |
4212 | $r5 = true; |
4213 | seq_2: |
4214 | if ($r5!==self::$FAILED) { |
4215 | $this->savedPos = $p6; |
4216 | $r5 = $this->a44($r14); |
4217 | $r4[] = $r5; |
4218 | } else { |
4219 | break; |
4220 | } |
4221 | // free $p7 |
4222 | } |
4223 | // bullets <- $r4 |
4224 | // free $r5 |
4225 | if (($this->input[$this->currPos] ?? null) === ";") { |
4226 | $this->currPos++; |
4227 | $r5 = ";"; |
4228 | } else { |
4229 | if (!$silence) {$this->fail(26);} |
4230 | $r5 = self::$FAILED; |
4231 | $this->currPos = $p3; |
4232 | $r1 = self::$FAILED; |
4233 | goto seq_1; |
4234 | } |
4235 | $r15 = []; |
4236 | for (;;) { |
4237 | $r16 = $this->parsedtdd_colon($silence, $boolParams, $param_preproc, $param_th); |
4238 | if ($r16!==self::$FAILED) { |
4239 | $r15[] = $r16; |
4240 | } else { |
4241 | break; |
4242 | } |
4243 | } |
4244 | // colons <- $r15 |
4245 | // free $r16 |
4246 | $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4247 | if ($r16===self::$FAILED) { |
4248 | $r16 = null; |
4249 | } |
4250 | // d <- $r16 |
4251 | $p7 = $this->currPos; |
4252 | $r17 = $this->discardeolf(true); |
4253 | if ($r17!==self::$FAILED) { |
4254 | $r17 = false; |
4255 | $this->currPos = $p7; |
4256 | } else { |
4257 | $this->currPos = $p3; |
4258 | $r1 = self::$FAILED; |
4259 | goto seq_1; |
4260 | } |
4261 | // free $p7 |
4262 | $r1 = true; |
4263 | seq_1: |
4264 | if ($r1!==self::$FAILED) { |
4265 | $this->savedPos = $p2; |
4266 | $r1 = $this->a45($r4, $r15, $r16); |
4267 | } |
4268 | // free $p3 |
4269 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4270 | $this->currPos, |
4271 | $r1, |
4272 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4273 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4274 | ); |
4275 | return $r1; |
4276 | } |
4277 | private function parsehacky_dl_uses($silence, $boolParams, &$param_preproc, &$param_th) { |
4278 | $key = json_encode([480, $boolParams & 0x7fff, $param_preproc, $param_th]); |
4279 | $bucket = $this->currPos; |
4280 | $cached = $this->cache[$bucket][$key] ?? null; |
4281 | if ($cached) { |
4282 | $this->currPos = $cached->nextPos; |
4283 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4284 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4285 | return $cached->result; |
4286 | } |
4287 | $saved_preproc=$param_preproc; |
4288 | $saved_th=$param_th; |
4289 | $p2 = $this->currPos; |
4290 | // start seq_1 |
4291 | $p3 = $this->currPos; |
4292 | $r4 = []; |
4293 | for (;;) { |
4294 | if (($this->input[$this->currPos] ?? null) === ":") { |
4295 | $this->currPos++; |
4296 | $r5 = ":"; |
4297 | $r4[] = $r5; |
4298 | } else { |
4299 | if (!$silence) {$this->fail(18);} |
4300 | $r5 = self::$FAILED; |
4301 | break; |
4302 | } |
4303 | } |
4304 | if (count($r4) === 0) { |
4305 | $r4 = self::$FAILED; |
4306 | } |
4307 | // bullets <- $r4 |
4308 | if ($r4===self::$FAILED) { |
4309 | $r1 = self::$FAILED; |
4310 | goto seq_1; |
4311 | } |
4312 | // free $r5 |
4313 | // start seq_2 |
4314 | $p6 = $this->currPos; |
4315 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4316 | if ($r7===self::$FAILED) { |
4317 | $r5 = self::$FAILED; |
4318 | goto seq_2; |
4319 | } |
4320 | $r8 = []; |
4321 | for (;;) { |
4322 | // start seq_3 |
4323 | $p10 = $this->currPos; |
4324 | $r11 = []; |
4325 | for (;;) { |
4326 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4327 | if ($r12!==self::$FAILED) { |
4328 | $r11[] = $r12; |
4329 | } else { |
4330 | break; |
4331 | } |
4332 | } |
4333 | if (count($r11) === 0) { |
4334 | $r11 = self::$FAILED; |
4335 | } |
4336 | if ($r11===self::$FAILED) { |
4337 | $r9 = self::$FAILED; |
4338 | goto seq_3; |
4339 | } |
4340 | // free $r12 |
4341 | $r12 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
4342 | if ($r12===self::$FAILED) { |
4343 | $this->currPos = $p10; |
4344 | $r9 = self::$FAILED; |
4345 | goto seq_3; |
4346 | } |
4347 | $r9 = [$r11,$r12]; |
4348 | seq_3: |
4349 | if ($r9!==self::$FAILED) { |
4350 | $r8[] = $r9; |
4351 | } else { |
4352 | break; |
4353 | } |
4354 | // free $p10 |
4355 | } |
4356 | // free $r9 |
4357 | $r5 = [$r7,$r8]; |
4358 | seq_2: |
4359 | // tbl <- $r5 |
4360 | if ($r5===self::$FAILED) { |
4361 | $this->currPos = $p3; |
4362 | $r1 = self::$FAILED; |
4363 | goto seq_1; |
4364 | } |
4365 | // free $p6 |
4366 | $r9 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4367 | if ($r9===self::$FAILED) { |
4368 | $r9 = null; |
4369 | } |
4370 | // line <- $r9 |
4371 | $p6 = $this->currPos; |
4372 | // start seq_4 |
4373 | $p10 = $this->currPos; |
4374 | for (;;) { |
4375 | // start choice_1 |
4376 | $r15 = $this->discardspace(true); |
4377 | if ($r15!==self::$FAILED) { |
4378 | goto choice_1; |
4379 | } |
4380 | $r15 = $this->discardcomment(true); |
4381 | choice_1: |
4382 | if ($r15===self::$FAILED) { |
4383 | break; |
4384 | } |
4385 | } |
4386 | // free $r15 |
4387 | $r14 = true; |
4388 | if ($r14===self::$FAILED) { |
4389 | $r13 = self::$FAILED; |
4390 | goto seq_4; |
4391 | } |
4392 | // free $r14 |
4393 | $r14 = $this->discardeolf(true); |
4394 | if ($r14===self::$FAILED) { |
4395 | $this->currPos = $p10; |
4396 | $r13 = self::$FAILED; |
4397 | goto seq_4; |
4398 | } |
4399 | $r13 = true; |
4400 | seq_4: |
4401 | if ($r13!==self::$FAILED) { |
4402 | $r13 = false; |
4403 | $this->currPos = $p6; |
4404 | } else { |
4405 | $this->currPos = $p3; |
4406 | $r1 = self::$FAILED; |
4407 | goto seq_1; |
4408 | } |
4409 | // free $p10 |
4410 | // free $p6 |
4411 | $r1 = true; |
4412 | seq_1: |
4413 | if ($r1!==self::$FAILED) { |
4414 | $this->savedPos = $p2; |
4415 | $r1 = $this->a46($r4, $r5, $r9); |
4416 | } |
4417 | // free $p3 |
4418 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4419 | $this->currPos, |
4420 | $r1, |
4421 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4422 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4423 | ); |
4424 | return $r1; |
4425 | } |
4426 | private function parseli($silence, $boolParams, &$param_preproc, &$param_th) { |
4427 | $key = json_encode([478, $boolParams & 0x7fff, $param_preproc, $param_th]); |
4428 | $bucket = $this->currPos; |
4429 | $cached = $this->cache[$bucket][$key] ?? null; |
4430 | if ($cached) { |
4431 | $this->currPos = $cached->nextPos; |
4432 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4433 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4434 | return $cached->result; |
4435 | } |
4436 | $saved_preproc=$param_preproc; |
4437 | $saved_th=$param_th; |
4438 | $p2 = $this->currPos; |
4439 | // start seq_1 |
4440 | $p3 = $this->currPos; |
4441 | $r4 = []; |
4442 | for (;;) { |
4443 | $r5 = $this->parselist_char($silence); |
4444 | if ($r5!==self::$FAILED) { |
4445 | $r4[] = $r5; |
4446 | } else { |
4447 | break; |
4448 | } |
4449 | } |
4450 | if (count($r4) === 0) { |
4451 | $r4 = self::$FAILED; |
4452 | } |
4453 | // bullets <- $r4 |
4454 | if ($r4===self::$FAILED) { |
4455 | $r1 = self::$FAILED; |
4456 | goto seq_1; |
4457 | } |
4458 | // free $r5 |
4459 | $r5 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4460 | if ($r5===self::$FAILED) { |
4461 | $r5 = null; |
4462 | } |
4463 | // c <- $r5 |
4464 | $p6 = $this->currPos; |
4465 | // start choice_1 |
4466 | $r7 = $this->discardeolf(true); |
4467 | if ($r7!==self::$FAILED) { |
4468 | goto choice_1; |
4469 | } |
4470 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4471 | choice_1: |
4472 | if ($r7!==self::$FAILED) { |
4473 | $r7 = false; |
4474 | $this->currPos = $p6; |
4475 | } else { |
4476 | $this->currPos = $p3; |
4477 | $r1 = self::$FAILED; |
4478 | goto seq_1; |
4479 | } |
4480 | // free $p6 |
4481 | $r1 = true; |
4482 | seq_1: |
4483 | if ($r1!==self::$FAILED) { |
4484 | $this->savedPos = $p2; |
4485 | $r1 = $this->a47($r4, $r5); |
4486 | } |
4487 | // free $p3 |
4488 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4489 | $this->currPos, |
4490 | $r1, |
4491 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4492 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4493 | ); |
4494 | return $r1; |
4495 | } |
4496 | private function discardeof($silence) { |
4497 | $key = 565; |
4498 | $bucket = $this->currPos; |
4499 | $cached = $this->cache[$bucket][$key] ?? null; |
4500 | if ($cached) { |
4501 | $this->currPos = $cached->nextPos; |
4502 | |
4503 | return $cached->result; |
4504 | } |
4505 | |
4506 | $this->savedPos = $this->currPos; |
4507 | $r1 = $this->a48(); |
4508 | if ($r1) { |
4509 | $r1 = false; |
4510 | } else { |
4511 | $r1 = self::$FAILED; |
4512 | } |
4513 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4514 | $this->currPos, |
4515 | $r1, |
4516 | self::$UNDEFINED, |
4517 | self::$UNDEFINED |
4518 | ); |
4519 | return $r1; |
4520 | } |
4521 | private function parseblock($silence, $boolParams, &$param_th, &$param_preproc) { |
4522 | $key = json_encode([312, $boolParams & 0x7fff, $param_th, $param_preproc]); |
4523 | $bucket = $this->currPos; |
4524 | $cached = $this->cache[$bucket][$key] ?? null; |
4525 | if ($cached) { |
4526 | $this->currPos = $cached->nextPos; |
4527 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4528 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4529 | return $cached->result; |
4530 | } |
4531 | $saved_th=$param_th; |
4532 | $saved_preproc=$param_preproc; |
4533 | // start choice_1 |
4534 | $p2 = $this->currPos; |
4535 | // start seq_1 |
4536 | $p3 = $this->currPos; |
4537 | $p4 = $this->currPos; |
4538 | $r5 = $this->discardsof(true); |
4539 | if ($r5!==self::$FAILED) { |
4540 | $r5 = false; |
4541 | $this->currPos = $p4; |
4542 | } else { |
4543 | $r1 = self::$FAILED; |
4544 | goto seq_1; |
4545 | } |
4546 | // free $p4 |
4547 | $r6 = $this->parseredirect($silence, $boolParams, $param_th, $param_preproc); |
4548 | // r <- $r6 |
4549 | if ($r6===self::$FAILED) { |
4550 | $this->currPos = $p3; |
4551 | $r1 = self::$FAILED; |
4552 | goto seq_1; |
4553 | } |
4554 | $r7 = []; |
4555 | for (;;) { |
4556 | $r8 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
4557 | if ($r8!==self::$FAILED) { |
4558 | $r7[] = $r8; |
4559 | } else { |
4560 | break; |
4561 | } |
4562 | } |
4563 | // cil <- $r7 |
4564 | // free $r8 |
4565 | $r8 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
4566 | if ($r8===self::$FAILED) { |
4567 | $r8 = null; |
4568 | } |
4569 | // bl <- $r8 |
4570 | $r1 = true; |
4571 | seq_1: |
4572 | if ($r1!==self::$FAILED) { |
4573 | $this->savedPos = $p2; |
4574 | $r1 = $this->a49($r6, $r7, $r8); |
4575 | goto choice_1; |
4576 | } |
4577 | // free $p3 |
4578 | $r1 = $this->parseblock_lines($silence, $boolParams, $param_preproc, $param_th); |
4579 | if ($r1!==self::$FAILED) { |
4580 | goto choice_1; |
4581 | } |
4582 | $r1 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
4583 | if ($r1!==self::$FAILED) { |
4584 | goto choice_1; |
4585 | } |
4586 | $p3 = $this->currPos; |
4587 | // start seq_2 |
4588 | $p4 = $this->currPos; |
4589 | // start choice_2 |
4590 | if (/*tableCaption*/($boolParams & 0x4000) !== 0) { |
4591 | $r9 = false; |
4592 | goto choice_2; |
4593 | } else { |
4594 | $r9 = self::$FAILED; |
4595 | } |
4596 | if (/*fullTable*/($boolParams & 0x2000) !== 0) { |
4597 | $r9 = false; |
4598 | goto choice_2; |
4599 | } else { |
4600 | $r9 = self::$FAILED; |
4601 | } |
4602 | if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) { |
4603 | $r9 = false; |
4604 | } else { |
4605 | $r9 = self::$FAILED; |
4606 | } |
4607 | choice_2: |
4608 | if ($r9===self::$FAILED) { |
4609 | $r1 = self::$FAILED; |
4610 | goto seq_2; |
4611 | } |
4612 | $r10 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
4613 | // s <- $r10 |
4614 | if ($r10===self::$FAILED) { |
4615 | $this->currPos = $p4; |
4616 | $r1 = self::$FAILED; |
4617 | goto seq_2; |
4618 | } |
4619 | $p11 = $this->currPos; |
4620 | $r12 = $this->discardsof(true); |
4621 | if ($r12 === self::$FAILED) { |
4622 | $r12 = false; |
4623 | } else { |
4624 | $r12 = self::$FAILED; |
4625 | $this->currPos = $p11; |
4626 | $this->currPos = $p4; |
4627 | $r1 = self::$FAILED; |
4628 | goto seq_2; |
4629 | } |
4630 | // free $p11 |
4631 | $p11 = $this->currPos; |
4632 | $r13 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
4633 | if ($r13 === self::$FAILED) { |
4634 | $r13 = false; |
4635 | } else { |
4636 | $r13 = self::$FAILED; |
4637 | $this->currPos = $p11; |
4638 | $this->currPos = $p4; |
4639 | $r1 = self::$FAILED; |
4640 | goto seq_2; |
4641 | } |
4642 | // free $p11 |
4643 | $r1 = true; |
4644 | seq_2: |
4645 | if ($r1!==self::$FAILED) { |
4646 | $this->savedPos = $p3; |
4647 | $r1 = $this->a42($r10); |
4648 | } |
4649 | // free $p4 |
4650 | choice_1: |
4651 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4652 | $this->currPos, |
4653 | $r1, |
4654 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4655 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4656 | ); |
4657 | return $r1; |
4658 | } |
4659 | private function discardnewline($silence) { |
4660 | $key = 567; |
4661 | $bucket = $this->currPos; |
4662 | $cached = $this->cache[$bucket][$key] ?? null; |
4663 | if ($cached) { |
4664 | $this->currPos = $cached->nextPos; |
4665 | |
4666 | return $cached->result; |
4667 | } |
4668 | |
4669 | // start choice_1 |
4670 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
4671 | $this->currPos++; |
4672 | $r1 = "\x0a"; |
4673 | goto choice_1; |
4674 | } else { |
4675 | if (!$silence) {$this->fail(27);} |
4676 | $r1 = self::$FAILED; |
4677 | } |
4678 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
4679 | $r1 = "\x0d\x0a"; |
4680 | $this->currPos += 2; |
4681 | } else { |
4682 | if (!$silence) {$this->fail(28);} |
4683 | $r1 = self::$FAILED; |
4684 | } |
4685 | choice_1: |
4686 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4687 | $this->currPos, |
4688 | $r1, |
4689 | self::$UNDEFINED, |
4690 | self::$UNDEFINED |
4691 | ); |
4692 | return $r1; |
4693 | } |
4694 | private function parsetplarg_or_template_guarded($silence, $boolParams, &$param_th, &$param_preproc) { |
4695 | $key = json_encode([366, $boolParams & 0x7fff, $param_th, $param_preproc]); |
4696 | $bucket = $this->currPos; |
4697 | $cached = $this->cache[$bucket][$key] ?? null; |
4698 | if ($cached) { |
4699 | $this->currPos = $cached->nextPos; |
4700 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
4701 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
4702 | return $cached->result; |
4703 | } |
4704 | $saved_th=$param_th; |
4705 | $saved_preproc=$param_preproc; |
4706 | // start choice_1 |
4707 | $p2 = $this->currPos; |
4708 | // start seq_1 |
4709 | $p3 = $this->currPos; |
4710 | $p4 = $this->currPos; |
4711 | // start seq_2 |
4712 | $p6 = $this->currPos; |
4713 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4714 | $r7 = "{{"; |
4715 | $this->currPos += 2; |
4716 | } else { |
4717 | $r7 = self::$FAILED; |
4718 | $r5 = self::$FAILED; |
4719 | goto seq_2; |
4720 | } |
4721 | $p8 = $this->currPos; |
4722 | // start seq_3 |
4723 | $p10 = $this->currPos; |
4724 | $r11 = self::$FAILED; |
4725 | for (;;) { |
4726 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4727 | $r12 = "{{{"; |
4728 | $this->currPos += 3; |
4729 | $r11 = true; |
4730 | } else { |
4731 | $r12 = self::$FAILED; |
4732 | break; |
4733 | } |
4734 | } |
4735 | if ($r11===self::$FAILED) { |
4736 | $r9 = self::$FAILED; |
4737 | goto seq_3; |
4738 | } |
4739 | // free $r12 |
4740 | $p13 = $this->currPos; |
4741 | if (($this->input[$this->currPos] ?? null) === "{") { |
4742 | $this->currPos++; |
4743 | $r12 = "{"; |
4744 | } else { |
4745 | $r12 = self::$FAILED; |
4746 | } |
4747 | if ($r12 === self::$FAILED) { |
4748 | $r12 = false; |
4749 | } else { |
4750 | $r12 = self::$FAILED; |
4751 | $this->currPos = $p13; |
4752 | $this->currPos = $p10; |
4753 | $r9 = self::$FAILED; |
4754 | goto seq_3; |
4755 | } |
4756 | // free $p13 |
4757 | $r9 = true; |
4758 | seq_3: |
4759 | if ($r9!==self::$FAILED) { |
4760 | $r9 = false; |
4761 | $this->currPos = $p8; |
4762 | } else { |
4763 | $this->currPos = $p6; |
4764 | $r5 = self::$FAILED; |
4765 | goto seq_2; |
4766 | } |
4767 | // free $p10 |
4768 | // free $p8 |
4769 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
4770 | if ($r14===self::$FAILED) { |
4771 | $this->currPos = $p6; |
4772 | $r5 = self::$FAILED; |
4773 | goto seq_2; |
4774 | } |
4775 | $r5 = true; |
4776 | seq_2: |
4777 | if ($r5!==self::$FAILED) { |
4778 | $r5 = false; |
4779 | $this->currPos = $p4; |
4780 | } else { |
4781 | $r1 = self::$FAILED; |
4782 | goto seq_1; |
4783 | } |
4784 | // free $p6 |
4785 | // free $p4 |
4786 | // start choice_2 |
4787 | $r15 = $this->parsetemplate($silence, $boolParams, $param_th); |
4788 | if ($r15!==self::$FAILED) { |
4789 | goto choice_2; |
4790 | } |
4791 | $r15 = $this->parsebroken_template($silence, $param_preproc); |
4792 | choice_2: |
4793 | // a <- $r15 |
4794 | if ($r15===self::$FAILED) { |
4795 | $this->currPos = $p3; |
4796 | $r1 = self::$FAILED; |
4797 | goto seq_1; |
4798 | } |
4799 | $r1 = true; |
4800 | seq_1: |
4801 | if ($r1!==self::$FAILED) { |
4802 | $this->savedPos = $p2; |
4803 | $r1 = $this->a50($r15); |
4804 | goto choice_1; |
4805 | } |
4806 | // free $p3 |
4807 | $p3 = $this->currPos; |
4808 | // start seq_4 |
4809 | $p4 = $this->currPos; |
4810 | $p6 = $this->currPos; |
4811 | // start seq_5 |
4812 | $p8 = $this->currPos; |
4813 | if (($this->input[$this->currPos] ?? null) === "{") { |
4814 | $this->currPos++; |
4815 | $r17 = "{"; |
4816 | } else { |
4817 | if (!$silence) {$this->fail(29);} |
4818 | $r17 = self::$FAILED; |
4819 | $r16 = self::$FAILED; |
4820 | goto seq_5; |
4821 | } |
4822 | $p10 = $this->currPos; |
4823 | // start seq_6 |
4824 | $p13 = $this->currPos; |
4825 | $r19 = self::$FAILED; |
4826 | for (;;) { |
4827 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
4828 | $r20 = "{{{"; |
4829 | $this->currPos += 3; |
4830 | $r19 = true; |
4831 | } else { |
4832 | $r20 = self::$FAILED; |
4833 | break; |
4834 | } |
4835 | } |
4836 | if ($r19===self::$FAILED) { |
4837 | $r18 = self::$FAILED; |
4838 | goto seq_6; |
4839 | } |
4840 | // free $r20 |
4841 | $p21 = $this->currPos; |
4842 | if (($this->input[$this->currPos] ?? null) === "{") { |
4843 | $this->currPos++; |
4844 | $r20 = "{"; |
4845 | } else { |
4846 | $r20 = self::$FAILED; |
4847 | } |
4848 | if ($r20 === self::$FAILED) { |
4849 | $r20 = false; |
4850 | } else { |
4851 | $r20 = self::$FAILED; |
4852 | $this->currPos = $p21; |
4853 | $this->currPos = $p13; |
4854 | $r18 = self::$FAILED; |
4855 | goto seq_6; |
4856 | } |
4857 | // free $p21 |
4858 | $r18 = true; |
4859 | seq_6: |
4860 | if ($r18!==self::$FAILED) { |
4861 | $r18 = false; |
4862 | $this->currPos = $p10; |
4863 | } else { |
4864 | $this->currPos = $p8; |
4865 | $r16 = self::$FAILED; |
4866 | goto seq_5; |
4867 | } |
4868 | // free $p13 |
4869 | // free $p10 |
4870 | $r16 = true; |
4871 | seq_5: |
4872 | if ($r16===self::$FAILED) { |
4873 | $r16 = null; |
4874 | } |
4875 | // free $p8 |
4876 | // a <- $r16 |
4877 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
4878 | // free $p6 |
4879 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
4880 | // b <- $r22 |
4881 | if ($r22===self::$FAILED) { |
4882 | $this->currPos = $p4; |
4883 | $r1 = self::$FAILED; |
4884 | goto seq_4; |
4885 | } |
4886 | $r1 = true; |
4887 | seq_4: |
4888 | if ($r1!==self::$FAILED) { |
4889 | $this->savedPos = $p3; |
4890 | $r1 = $this->a51($r16, $r22); |
4891 | goto choice_1; |
4892 | } |
4893 | // free $p4 |
4894 | $p4 = $this->currPos; |
4895 | // start seq_7 |
4896 | $p6 = $this->currPos; |
4897 | $p8 = $this->currPos; |
4898 | // start seq_8 |
4899 | $p10 = $this->currPos; |
4900 | if (($this->input[$this->currPos] ?? null) === "{") { |
4901 | $this->currPos++; |
4902 | $r24 = "{"; |
4903 | } else { |
4904 | if (!$silence) {$this->fail(29);} |
4905 | $r24 = self::$FAILED; |
4906 | $r23 = self::$FAILED; |
4907 | goto seq_8; |
4908 | } |
4909 | $p13 = $this->currPos; |
4910 | // start seq_9 |
4911 | $p21 = $this->currPos; |
4912 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
4913 | $r26 = "{{"; |
4914 | $this->currPos += 2; |
4915 | } else { |
4916 | $r26 = self::$FAILED; |
4917 | $r25 = self::$FAILED; |
4918 | goto seq_9; |
4919 | } |
4920 | $p27 = $this->currPos; |
4921 | if (($this->input[$this->currPos] ?? null) === "{") { |
4922 | $this->currPos++; |
4923 | $r28 = "{"; |
4924 | } else { |
4925 | $r28 = self::$FAILED; |
4926 | } |
4927 | if ($r28 === self::$FAILED) { |
4928 | $r28 = false; |
4929 | } else { |
4930 | $r28 = self::$FAILED; |
4931 | $this->currPos = $p27; |
4932 | $this->currPos = $p21; |
4933 | $r25 = self::$FAILED; |
4934 | goto seq_9; |
4935 | } |
4936 | // free $p27 |
4937 | $r25 = true; |
4938 | seq_9: |
4939 | if ($r25!==self::$FAILED) { |
4940 | $r25 = false; |
4941 | $this->currPos = $p13; |
4942 | } else { |
4943 | $this->currPos = $p10; |
4944 | $r23 = self::$FAILED; |
4945 | goto seq_8; |
4946 | } |
4947 | // free $p21 |
4948 | // free $p13 |
4949 | $r23 = true; |
4950 | seq_8: |
4951 | if ($r23===self::$FAILED) { |
4952 | $r23 = null; |
4953 | } |
4954 | // free $p10 |
4955 | // a <- $r23 |
4956 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
4957 | // free $p8 |
4958 | $r29 = $this->parsetemplate($silence, $boolParams, $param_th); |
4959 | // b <- $r29 |
4960 | if ($r29===self::$FAILED) { |
4961 | $this->currPos = $p6; |
4962 | $r1 = self::$FAILED; |
4963 | goto seq_7; |
4964 | } |
4965 | $r1 = true; |
4966 | seq_7: |
4967 | if ($r1!==self::$FAILED) { |
4968 | $this->savedPos = $p4; |
4969 | $r1 = $this->a51($r23, $r29); |
4970 | goto choice_1; |
4971 | } |
4972 | // free $p6 |
4973 | $r1 = $this->parsebroken_template($silence, $param_preproc); |
4974 | choice_1: |
4975 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
4976 | $this->currPos, |
4977 | $r1, |
4978 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
4979 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
4980 | ); |
4981 | return $r1; |
4982 | } |
4983 | private function parseraw_htmlentity($silence) { |
4984 | $key = 526; |
4985 | $bucket = $this->currPos; |
4986 | $cached = $this->cache[$bucket][$key] ?? null; |
4987 | if ($cached) { |
4988 | $this->currPos = $cached->nextPos; |
4989 | |
4990 | return $cached->result; |
4991 | } |
4992 | |
4993 | $p2 = $this->currPos; |
4994 | $p4 = $this->currPos; |
4995 | // start seq_1 |
4996 | $p5 = $this->currPos; |
4997 | if (($this->input[$this->currPos] ?? null) === "&") { |
4998 | $this->currPos++; |
4999 | $r6 = "&"; |
5000 | } else { |
5001 | if (!$silence) {$this->fail(4);} |
5002 | $r6 = self::$FAILED; |
5003 | $r3 = self::$FAILED; |
5004 | goto seq_1; |
5005 | } |
5006 | $r7 = self::$FAILED; |
5007 | for (;;) { |
5008 | $r8 = self::charAt($this->input, $this->currPos); |
5009 | if (preg_match("/^[#0-9a-zA-Z\\x{5e8}\\x{5dc}\\x{5de}\\x{631}\\x{644}\\x{645}]/u", $r8)) { |
5010 | $this->currPos += strlen($r8); |
5011 | $r7 = true; |
5012 | } else { |
5013 | $r8 = self::$FAILED; |
5014 | if (!$silence) {$this->fail(30);} |
5015 | break; |
5016 | } |
5017 | } |
5018 | if ($r7===self::$FAILED) { |
5019 | $this->currPos = $p5; |
5020 | $r3 = self::$FAILED; |
5021 | goto seq_1; |
5022 | } |
5023 | // free $r8 |
5024 | if (($this->input[$this->currPos] ?? null) === ";") { |
5025 | $this->currPos++; |
5026 | $r8 = ";"; |
5027 | } else { |
5028 | if (!$silence) {$this->fail(26);} |
5029 | $r8 = self::$FAILED; |
5030 | $this->currPos = $p5; |
5031 | $r3 = self::$FAILED; |
5032 | goto seq_1; |
5033 | } |
5034 | $r3 = true; |
5035 | seq_1: |
5036 | // m <- $r3 |
5037 | if ($r3!==self::$FAILED) { |
5038 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
5039 | } else { |
5040 | $r3 = self::$FAILED; |
5041 | } |
5042 | // free $p5 |
5043 | // free $p4 |
5044 | $r1 = $r3; |
5045 | if ($r1!==self::$FAILED) { |
5046 | $this->savedPos = $p2; |
5047 | $r1 = $this->a52($r3); |
5048 | } |
5049 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5050 | $this->currPos, |
5051 | $r1, |
5052 | self::$UNDEFINED, |
5053 | self::$UNDEFINED |
5054 | ); |
5055 | return $r1; |
5056 | } |
5057 | private function parseoptionalSpaceToken($silence) { |
5058 | $key = 576; |
5059 | $bucket = $this->currPos; |
5060 | $cached = $this->cache[$bucket][$key] ?? null; |
5061 | if ($cached) { |
5062 | $this->currPos = $cached->nextPos; |
5063 | |
5064 | return $cached->result; |
5065 | } |
5066 | |
5067 | $p2 = $this->currPos; |
5068 | $r3 = $this->parseoptional_spaces($silence); |
5069 | // s <- $r3 |
5070 | $r1 = $r3; |
5071 | if ($r1!==self::$FAILED) { |
5072 | $this->savedPos = $p2; |
5073 | $r1 = $this->a37($r3); |
5074 | } |
5075 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5076 | $this->currPos, |
5077 | $r1, |
5078 | self::$UNDEFINED, |
5079 | self::$UNDEFINED |
5080 | ); |
5081 | return $r1; |
5082 | } |
5083 | private function parsetable_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
5084 | $key = json_encode([470, $boolParams & 0x7fff, $param_preproc, $param_th]); |
5085 | $bucket = $this->currPos; |
5086 | $cached = $this->cache[$bucket][$key] ?? null; |
5087 | if ($cached) { |
5088 | $this->currPos = $cached->nextPos; |
5089 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5090 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5091 | return $cached->result; |
5092 | } |
5093 | $saved_preproc=$param_preproc; |
5094 | $saved_th=$param_th; |
5095 | $p2 = $this->currPos; |
5096 | // start seq_1 |
5097 | $p3 = $this->currPos; |
5098 | $p5 = $this->currPos; |
5099 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
5100 | $r4 = $this->input[$this->currPos++]; |
5101 | } else { |
5102 | $r4 = self::$FAILED; |
5103 | if (!$silence) {$this->fail(31);} |
5104 | $r4 = null; |
5105 | } |
5106 | // q <- $r4 |
5107 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5108 | // free $p5 |
5109 | $r6 = []; |
5110 | for (;;) { |
5111 | // start choice_1 |
5112 | $p5 = $this->currPos; |
5113 | $r7 = self::$FAILED; |
5114 | for (;;) { |
5115 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|[", $this->currPos, 1) !== 0) { |
5116 | $r8 = self::consumeChar($this->input, $this->currPos); |
5117 | $r7 = true; |
5118 | } else { |
5119 | $r8 = self::$FAILED; |
5120 | if (!$silence) {$this->fail(32);} |
5121 | break; |
5122 | } |
5123 | } |
5124 | if ($r7!==self::$FAILED) { |
5125 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
5126 | goto choice_1; |
5127 | } else { |
5128 | $r7 = self::$FAILED; |
5129 | } |
5130 | // free $r8 |
5131 | // free $p5 |
5132 | $p5 = $this->currPos; |
5133 | // start seq_2 |
5134 | $p9 = $this->currPos; |
5135 | $p10 = $this->currPos; |
5136 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5137 | if ($r8 === self::$FAILED) { |
5138 | $r8 = false; |
5139 | } else { |
5140 | $r8 = self::$FAILED; |
5141 | $this->currPos = $p10; |
5142 | $r7 = self::$FAILED; |
5143 | goto seq_2; |
5144 | } |
5145 | // free $p10 |
5146 | // start choice_2 |
5147 | $p10 = $this->currPos; |
5148 | $r11 = $this->discardwikilink($silence, $boolParams, $param_th, $param_preproc); |
5149 | if ($r11!==self::$FAILED) { |
5150 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
5151 | goto choice_2; |
5152 | } else { |
5153 | $r11 = self::$FAILED; |
5154 | } |
5155 | // free $p10 |
5156 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5157 | if ($r11!==self::$FAILED) { |
5158 | goto choice_2; |
5159 | } |
5160 | $p10 = $this->currPos; |
5161 | // start seq_3 |
5162 | $p12 = $this->currPos; |
5163 | $p13 = $this->currPos; |
5164 | if (($this->input[$this->currPos] ?? null) === "<") { |
5165 | $this->currPos++; |
5166 | $r14 = "<"; |
5167 | $r14 = false; |
5168 | $this->currPos = $p13; |
5169 | } else { |
5170 | $r14 = self::$FAILED; |
5171 | $r11 = self::$FAILED; |
5172 | goto seq_3; |
5173 | } |
5174 | // free $p13 |
5175 | $r15 = $this->parsehtml_tag($silence, $boolParams, $param_preproc, $param_th); |
5176 | // x <- $r15 |
5177 | if ($r15===self::$FAILED) { |
5178 | $this->currPos = $p12; |
5179 | $r11 = self::$FAILED; |
5180 | goto seq_3; |
5181 | } |
5182 | $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
5183 | if ($r16===self::$FAILED) { |
5184 | $r16 = null; |
5185 | } |
5186 | // ill <- $r16 |
5187 | $r11 = true; |
5188 | seq_3: |
5189 | if ($r11!==self::$FAILED) { |
5190 | $this->savedPos = $p10; |
5191 | $r11 = $this->a53($r4, $r15, $r16); |
5192 | goto choice_2; |
5193 | } |
5194 | // free $p12 |
5195 | $p12 = $this->currPos; |
5196 | // start seq_4 |
5197 | $p13 = $this->currPos; |
5198 | $p17 = $this->currPos; |
5199 | // start choice_3 |
5200 | $r18 = $this->discardspace_or_newline(true); |
5201 | if ($r18!==self::$FAILED) { |
5202 | goto choice_3; |
5203 | } |
5204 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
5205 | $r18 = $this->input[$this->currPos++]; |
5206 | } else { |
5207 | $r18 = self::$FAILED; |
5208 | } |
5209 | choice_3: |
5210 | if ($r18 === self::$FAILED) { |
5211 | $r18 = false; |
5212 | } else { |
5213 | $r18 = self::$FAILED; |
5214 | $this->currPos = $p17; |
5215 | $r11 = self::$FAILED; |
5216 | goto seq_4; |
5217 | } |
5218 | // free $p17 |
5219 | if ($this->currPos < $this->inputLength) { |
5220 | $r19 = self::consumeChar($this->input, $this->currPos);; |
5221 | } else { |
5222 | $r19 = self::$FAILED; |
5223 | if (!$silence) {$this->fail(7);} |
5224 | $this->currPos = $p13; |
5225 | $r11 = self::$FAILED; |
5226 | goto seq_4; |
5227 | } |
5228 | $r11 = true; |
5229 | seq_4: |
5230 | if ($r11!==self::$FAILED) { |
5231 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
5232 | } else { |
5233 | $r11 = self::$FAILED; |
5234 | } |
5235 | // free $p13 |
5236 | // free $p12 |
5237 | choice_2: |
5238 | // t <- $r11 |
5239 | if ($r11===self::$FAILED) { |
5240 | $this->currPos = $p9; |
5241 | $r7 = self::$FAILED; |
5242 | goto seq_2; |
5243 | } |
5244 | $r7 = true; |
5245 | seq_2: |
5246 | if ($r7!==self::$FAILED) { |
5247 | $this->savedPos = $p5; |
5248 | $r7 = $this->a54($r4, $r11); |
5249 | } |
5250 | // free $p9 |
5251 | choice_1: |
5252 | if ($r7!==self::$FAILED) { |
5253 | $r6[] = $r7; |
5254 | } else { |
5255 | break; |
5256 | } |
5257 | } |
5258 | // r <- $r6 |
5259 | // free $r7 |
5260 | $this->savedPos = $this->currPos; |
5261 | $r7 = $this->a55($r4, $r6); |
5262 | if ($r7) { |
5263 | $r7 = false; |
5264 | } else { |
5265 | $r7 = self::$FAILED; |
5266 | $this->currPos = $p3; |
5267 | $r1 = self::$FAILED; |
5268 | goto seq_1; |
5269 | } |
5270 | $r1 = true; |
5271 | seq_1: |
5272 | if ($r1!==self::$FAILED) { |
5273 | $this->savedPos = $p2; |
5274 | $r1 = $this->a56($r4, $r6); |
5275 | } |
5276 | // free $p3 |
5277 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5278 | $this->currPos, |
5279 | $r1, |
5280 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5281 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5282 | ); |
5283 | return $r1; |
5284 | } |
5285 | private function parsetable_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5286 | $key = json_encode([474, $boolParams & 0x7fff, $param_preproc, $param_th]); |
5287 | $bucket = $this->currPos; |
5288 | $cached = $this->cache[$bucket][$key] ?? null; |
5289 | if ($cached) { |
5290 | $this->currPos = $cached->nextPos; |
5291 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5292 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5293 | return $cached->result; |
5294 | } |
5295 | $saved_preproc=$param_preproc; |
5296 | $saved_th=$param_th; |
5297 | // start choice_1 |
5298 | $p2 = $this->currPos; |
5299 | // start seq_1 |
5300 | $p3 = $this->currPos; |
5301 | $p5 = $this->currPos; |
5302 | // start seq_2 |
5303 | $p6 = $this->currPos; |
5304 | for (;;) { |
5305 | $r8 = $this->discardspace($silence); |
5306 | if ($r8===self::$FAILED) { |
5307 | break; |
5308 | } |
5309 | } |
5310 | // free $r8 |
5311 | $r7 = true; |
5312 | if ($r7===self::$FAILED) { |
5313 | $r4 = self::$FAILED; |
5314 | goto seq_2; |
5315 | } |
5316 | // free $r7 |
5317 | if (($this->input[$this->currPos] ?? null) === "'") { |
5318 | $this->currPos++; |
5319 | $r7 = "'"; |
5320 | } else { |
5321 | if (!$silence) {$this->fail(33);} |
5322 | $r7 = self::$FAILED; |
5323 | $this->currPos = $p6; |
5324 | $r4 = self::$FAILED; |
5325 | goto seq_2; |
5326 | } |
5327 | $r4 = true; |
5328 | seq_2: |
5329 | // s <- $r4 |
5330 | if ($r4!==self::$FAILED) { |
5331 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5332 | } else { |
5333 | $r4 = self::$FAILED; |
5334 | $r1 = self::$FAILED; |
5335 | goto seq_1; |
5336 | } |
5337 | // free $p6 |
5338 | // free $p5 |
5339 | $r8 = $this->parsetable_attribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5340 | if ($r8===self::$FAILED) { |
5341 | $r8 = null; |
5342 | } |
5343 | // t <- $r8 |
5344 | $p5 = $this->currPos; |
5345 | // start choice_2 |
5346 | if (($this->input[$this->currPos] ?? null) === "'") { |
5347 | $this->currPos++; |
5348 | $r9 = "'"; |
5349 | goto choice_2; |
5350 | } else { |
5351 | if (!$silence) {$this->fail(33);} |
5352 | $r9 = self::$FAILED; |
5353 | } |
5354 | $p6 = $this->currPos; |
5355 | // start choice_3 |
5356 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5357 | $r9 = "!!"; |
5358 | $this->currPos += 2; |
5359 | goto choice_3; |
5360 | } else { |
5361 | $r9 = self::$FAILED; |
5362 | } |
5363 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5364 | $r9 = $this->input[$this->currPos++]; |
5365 | } else { |
5366 | $r9 = self::$FAILED; |
5367 | } |
5368 | choice_3: |
5369 | if ($r9!==self::$FAILED) { |
5370 | $r9 = false; |
5371 | $this->currPos = $p6; |
5372 | } |
5373 | // free $p6 |
5374 | choice_2: |
5375 | // q <- $r9 |
5376 | if ($r9!==self::$FAILED) { |
5377 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5378 | } else { |
5379 | $r9 = self::$FAILED; |
5380 | $this->currPos = $p3; |
5381 | $r1 = self::$FAILED; |
5382 | goto seq_1; |
5383 | } |
5384 | // free $p5 |
5385 | $r1 = true; |
5386 | seq_1: |
5387 | if ($r1!==self::$FAILED) { |
5388 | $this->savedPos = $p2; |
5389 | $r1 = $this->a57($r4, $r8, $r9); |
5390 | goto choice_1; |
5391 | } |
5392 | // free $p3 |
5393 | $p3 = $this->currPos; |
5394 | // start seq_3 |
5395 | $p5 = $this->currPos; |
5396 | $p6 = $this->currPos; |
5397 | // start seq_4 |
5398 | $p11 = $this->currPos; |
5399 | for (;;) { |
5400 | $r13 = $this->discardspace($silence); |
5401 | if ($r13===self::$FAILED) { |
5402 | break; |
5403 | } |
5404 | } |
5405 | // free $r13 |
5406 | $r12 = true; |
5407 | if ($r12===self::$FAILED) { |
5408 | $r10 = self::$FAILED; |
5409 | goto seq_4; |
5410 | } |
5411 | // free $r12 |
5412 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5413 | $this->currPos++; |
5414 | $r12 = "\""; |
5415 | } else { |
5416 | if (!$silence) {$this->fail(34);} |
5417 | $r12 = self::$FAILED; |
5418 | $this->currPos = $p11; |
5419 | $r10 = self::$FAILED; |
5420 | goto seq_4; |
5421 | } |
5422 | $r10 = true; |
5423 | seq_4: |
5424 | // s <- $r10 |
5425 | if ($r10!==self::$FAILED) { |
5426 | $r10 = substr($this->input, $p6, $this->currPos - $p6); |
5427 | } else { |
5428 | $r10 = self::$FAILED; |
5429 | $r1 = self::$FAILED; |
5430 | goto seq_3; |
5431 | } |
5432 | // free $p11 |
5433 | // free $p6 |
5434 | $r13 = $this->parsetable_attribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5435 | if ($r13===self::$FAILED) { |
5436 | $r13 = null; |
5437 | } |
5438 | // t <- $r13 |
5439 | $p6 = $this->currPos; |
5440 | // start choice_4 |
5441 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5442 | $this->currPos++; |
5443 | $r14 = "\""; |
5444 | goto choice_4; |
5445 | } else { |
5446 | if (!$silence) {$this->fail(34);} |
5447 | $r14 = self::$FAILED; |
5448 | } |
5449 | $p11 = $this->currPos; |
5450 | // start choice_5 |
5451 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5452 | $r14 = "!!"; |
5453 | $this->currPos += 2; |
5454 | goto choice_5; |
5455 | } else { |
5456 | $r14 = self::$FAILED; |
5457 | } |
5458 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
5459 | $r14 = $this->input[$this->currPos++]; |
5460 | } else { |
5461 | $r14 = self::$FAILED; |
5462 | } |
5463 | choice_5: |
5464 | if ($r14!==self::$FAILED) { |
5465 | $r14 = false; |
5466 | $this->currPos = $p11; |
5467 | } |
5468 | // free $p11 |
5469 | choice_4: |
5470 | // q <- $r14 |
5471 | if ($r14!==self::$FAILED) { |
5472 | $r14 = substr($this->input, $p6, $this->currPos - $p6); |
5473 | } else { |
5474 | $r14 = self::$FAILED; |
5475 | $this->currPos = $p5; |
5476 | $r1 = self::$FAILED; |
5477 | goto seq_3; |
5478 | } |
5479 | // free $p6 |
5480 | $r1 = true; |
5481 | seq_3: |
5482 | if ($r1!==self::$FAILED) { |
5483 | $this->savedPos = $p3; |
5484 | $r1 = $this->a57($r10, $r13, $r14); |
5485 | goto choice_1; |
5486 | } |
5487 | // free $p5 |
5488 | $p5 = $this->currPos; |
5489 | // start seq_5 |
5490 | $p6 = $this->currPos; |
5491 | $p11 = $this->currPos; |
5492 | for (;;) { |
5493 | $r16 = $this->discardspace($silence); |
5494 | if ($r16===self::$FAILED) { |
5495 | break; |
5496 | } |
5497 | } |
5498 | // free $r16 |
5499 | $r15 = true; |
5500 | // s <- $r15 |
5501 | if ($r15!==self::$FAILED) { |
5502 | $r15 = substr($this->input, $p11, $this->currPos - $p11); |
5503 | } else { |
5504 | $r15 = self::$FAILED; |
5505 | $r1 = self::$FAILED; |
5506 | goto seq_5; |
5507 | } |
5508 | // free $p11 |
5509 | $r16 = $this->parsetable_attribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
5510 | // t <- $r16 |
5511 | if ($r16===self::$FAILED) { |
5512 | $this->currPos = $p6; |
5513 | $r1 = self::$FAILED; |
5514 | goto seq_5; |
5515 | } |
5516 | $p11 = $this->currPos; |
5517 | // start choice_6 |
5518 | $r17 = $this->discardspace_or_newline(true); |
5519 | if ($r17!==self::$FAILED) { |
5520 | goto choice_6; |
5521 | } |
5522 | $r17 = $this->discardeof(true); |
5523 | if ($r17!==self::$FAILED) { |
5524 | goto choice_6; |
5525 | } |
5526 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
5527 | $r17 = "!!"; |
5528 | $this->currPos += 2; |
5529 | goto choice_6; |
5530 | } else { |
5531 | $r17 = self::$FAILED; |
5532 | } |
5533 | if (($this->input[$this->currPos] ?? null) === "|") { |
5534 | $this->currPos++; |
5535 | $r17 = "|"; |
5536 | } else { |
5537 | $r17 = self::$FAILED; |
5538 | } |
5539 | choice_6: |
5540 | if ($r17!==self::$FAILED) { |
5541 | $r17 = false; |
5542 | $this->currPos = $p11; |
5543 | } else { |
5544 | $this->currPos = $p6; |
5545 | $r1 = self::$FAILED; |
5546 | goto seq_5; |
5547 | } |
5548 | // free $p11 |
5549 | $r1 = true; |
5550 | seq_5: |
5551 | if ($r1!==self::$FAILED) { |
5552 | $this->savedPos = $p5; |
5553 | $r1 = $this->a58($r15, $r16); |
5554 | } |
5555 | // free $p6 |
5556 | choice_1: |
5557 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5558 | $this->currPos, |
5559 | $r1, |
5560 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5561 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5562 | ); |
5563 | return $r1; |
5564 | } |
5565 | private function discardspace_or_newline_or_solidus($silence) { |
5566 | $key = 455; |
5567 | $bucket = $this->currPos; |
5568 | $cached = $this->cache[$bucket][$key] ?? null; |
5569 | if ($cached) { |
5570 | $this->currPos = $cached->nextPos; |
5571 | |
5572 | return $cached->result; |
5573 | } |
5574 | |
5575 | // start choice_1 |
5576 | $r1 = $this->discardspace_or_newline($silence); |
5577 | if ($r1!==self::$FAILED) { |
5578 | goto choice_1; |
5579 | } |
5580 | $p2 = $this->currPos; |
5581 | // start seq_1 |
5582 | $p3 = $this->currPos; |
5583 | // s <- $r4 |
5584 | if (($this->input[$this->currPos] ?? null) === "/") { |
5585 | $this->currPos++; |
5586 | $r4 = "/"; |
5587 | } else { |
5588 | if (!$silence) {$this->fail(35);} |
5589 | $r4 = self::$FAILED; |
5590 | $r1 = self::$FAILED; |
5591 | goto seq_1; |
5592 | } |
5593 | $p5 = $this->currPos; |
5594 | if (($this->input[$this->currPos] ?? null) === ">") { |
5595 | $this->currPos++; |
5596 | $r6 = ">"; |
5597 | } else { |
5598 | $r6 = self::$FAILED; |
5599 | } |
5600 | if ($r6 === self::$FAILED) { |
5601 | $r6 = false; |
5602 | } else { |
5603 | $r6 = self::$FAILED; |
5604 | $this->currPos = $p5; |
5605 | $this->currPos = $p3; |
5606 | $r1 = self::$FAILED; |
5607 | goto seq_1; |
5608 | } |
5609 | // free $p5 |
5610 | $r1 = true; |
5611 | seq_1: |
5612 | if ($r1!==self::$FAILED) { |
5613 | $this->savedPos = $p2; |
5614 | $r1 = $this->a42($r4); |
5615 | } |
5616 | // free $p3 |
5617 | choice_1: |
5618 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5619 | $this->currPos, |
5620 | $r1, |
5621 | self::$UNDEFINED, |
5622 | self::$UNDEFINED |
5623 | ); |
5624 | return $r1; |
5625 | } |
5626 | private function parsegeneric_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
5627 | $key = json_encode([466, $boolParams & 0x7fff, $param_preproc, $param_th]); |
5628 | $bucket = $this->currPos; |
5629 | $cached = $this->cache[$bucket][$key] ?? null; |
5630 | if ($cached) { |
5631 | $this->currPos = $cached->nextPos; |
5632 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5633 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5634 | return $cached->result; |
5635 | } |
5636 | $saved_preproc=$param_preproc; |
5637 | $saved_th=$param_th; |
5638 | $p2 = $this->currPos; |
5639 | // start seq_1 |
5640 | $p3 = $this->currPos; |
5641 | $p5 = $this->currPos; |
5642 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
5643 | $r4 = $this->input[$this->currPos++]; |
5644 | } else { |
5645 | $r4 = self::$FAILED; |
5646 | if (!$silence) {$this->fail(31);} |
5647 | $r4 = null; |
5648 | } |
5649 | // q <- $r4 |
5650 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5651 | // free $p5 |
5652 | $r6 = []; |
5653 | for (;;) { |
5654 | // start choice_1 |
5655 | $p5 = $this->currPos; |
5656 | $r7 = self::$FAILED; |
5657 | for (;;) { |
5658 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|", $this->currPos, 1) !== 0) { |
5659 | $r8 = self::consumeChar($this->input, $this->currPos); |
5660 | $r7 = true; |
5661 | } else { |
5662 | $r8 = self::$FAILED; |
5663 | if (!$silence) {$this->fail(36);} |
5664 | break; |
5665 | } |
5666 | } |
5667 | if ($r7!==self::$FAILED) { |
5668 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
5669 | goto choice_1; |
5670 | } else { |
5671 | $r7 = self::$FAILED; |
5672 | } |
5673 | // free $r8 |
5674 | // free $p5 |
5675 | $p5 = $this->currPos; |
5676 | // start seq_2 |
5677 | $p9 = $this->currPos; |
5678 | $p10 = $this->currPos; |
5679 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
5680 | if ($r8 === self::$FAILED) { |
5681 | $r8 = false; |
5682 | } else { |
5683 | $r8 = self::$FAILED; |
5684 | $this->currPos = $p10; |
5685 | $r7 = self::$FAILED; |
5686 | goto seq_2; |
5687 | } |
5688 | // free $p10 |
5689 | // start choice_2 |
5690 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
5691 | if ($r11!==self::$FAILED) { |
5692 | goto choice_2; |
5693 | } |
5694 | $r11 = $this->parseless_than($silence, $boolParams); |
5695 | if ($r11!==self::$FAILED) { |
5696 | goto choice_2; |
5697 | } |
5698 | $p10 = $this->currPos; |
5699 | // start seq_3 |
5700 | $p12 = $this->currPos; |
5701 | $p13 = $this->currPos; |
5702 | // start choice_3 |
5703 | $r14 = $this->discardspace_or_newline(true); |
5704 | if ($r14!==self::$FAILED) { |
5705 | goto choice_3; |
5706 | } |
5707 | if (strspn($this->input, "\x00/=><", $this->currPos, 1) !== 0) { |
5708 | $r14 = $this->input[$this->currPos++]; |
5709 | } else { |
5710 | $r14 = self::$FAILED; |
5711 | } |
5712 | choice_3: |
5713 | if ($r14 === self::$FAILED) { |
5714 | $r14 = false; |
5715 | } else { |
5716 | $r14 = self::$FAILED; |
5717 | $this->currPos = $p13; |
5718 | $r11 = self::$FAILED; |
5719 | goto seq_3; |
5720 | } |
5721 | // free $p13 |
5722 | if ($this->currPos < $this->inputLength) { |
5723 | $r15 = self::consumeChar($this->input, $this->currPos);; |
5724 | } else { |
5725 | $r15 = self::$FAILED; |
5726 | if (!$silence) {$this->fail(7);} |
5727 | $this->currPos = $p12; |
5728 | $r11 = self::$FAILED; |
5729 | goto seq_3; |
5730 | } |
5731 | $r11 = true; |
5732 | seq_3: |
5733 | if ($r11!==self::$FAILED) { |
5734 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
5735 | } else { |
5736 | $r11 = self::$FAILED; |
5737 | } |
5738 | // free $p12 |
5739 | // free $p10 |
5740 | choice_2: |
5741 | // t <- $r11 |
5742 | if ($r11===self::$FAILED) { |
5743 | $this->currPos = $p9; |
5744 | $r7 = self::$FAILED; |
5745 | goto seq_2; |
5746 | } |
5747 | $r7 = true; |
5748 | seq_2: |
5749 | if ($r7!==self::$FAILED) { |
5750 | $this->savedPos = $p5; |
5751 | $r7 = $this->a54($r4, $r11); |
5752 | } |
5753 | // free $p9 |
5754 | choice_1: |
5755 | if ($r7!==self::$FAILED) { |
5756 | $r6[] = $r7; |
5757 | } else { |
5758 | break; |
5759 | } |
5760 | } |
5761 | // r <- $r6 |
5762 | // free $r7 |
5763 | $this->savedPos = $this->currPos; |
5764 | $r7 = $this->a55($r4, $r6); |
5765 | if ($r7) { |
5766 | $r7 = false; |
5767 | } else { |
5768 | $r7 = self::$FAILED; |
5769 | $this->currPos = $p3; |
5770 | $r1 = self::$FAILED; |
5771 | goto seq_1; |
5772 | } |
5773 | $r1 = true; |
5774 | seq_1: |
5775 | if ($r1!==self::$FAILED) { |
5776 | $this->savedPos = $p2; |
5777 | $r1 = $this->a56($r4, $r6); |
5778 | } |
5779 | // free $p3 |
5780 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5781 | $this->currPos, |
5782 | $r1, |
5783 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
5784 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
5785 | ); |
5786 | return $r1; |
5787 | } |
5788 | private function discardspace_or_newline($silence) { |
5789 | $key = 579; |
5790 | $bucket = $this->currPos; |
5791 | $cached = $this->cache[$bucket][$key] ?? null; |
5792 | if ($cached) { |
5793 | $this->currPos = $cached->nextPos; |
5794 | |
5795 | return $cached->result; |
5796 | } |
5797 | |
5798 | if (strspn($this->input, " \x09\x0a\x0d\x0c", $this->currPos, 1) !== 0) { |
5799 | $r1 = $this->input[$this->currPos++]; |
5800 | } else { |
5801 | $r1 = self::$FAILED; |
5802 | if (!$silence) {$this->fail(37);} |
5803 | } |
5804 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
5805 | $this->currPos, |
5806 | $r1, |
5807 | self::$UNDEFINED, |
5808 | self::$UNDEFINED |
5809 | ); |
5810 | return $r1; |
5811 | } |
5812 | private function parsegeneric_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
5813 | $key = json_encode([472, $boolParams & 0x7fff, $param_preproc, $param_th]); |
5814 | $bucket = $this->currPos; |
5815 | $cached = $this->cache[$bucket][$key] ?? null; |
5816 | if ($cached) { |
5817 | $this->currPos = $cached->nextPos; |
5818 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
5819 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
5820 | return $cached->result; |
5821 | } |
5822 | $saved_preproc=$param_preproc; |
5823 | $saved_th=$param_th; |
5824 | // start choice_1 |
5825 | $p2 = $this->currPos; |
5826 | // start seq_1 |
5827 | $p3 = $this->currPos; |
5828 | $p5 = $this->currPos; |
5829 | // start seq_2 |
5830 | $p6 = $this->currPos; |
5831 | for (;;) { |
5832 | $r8 = $this->discardspace_or_newline($silence); |
5833 | if ($r8===self::$FAILED) { |
5834 | break; |
5835 | } |
5836 | } |
5837 | // free $r8 |
5838 | $r7 = true; |
5839 | if ($r7===self::$FAILED) { |
5840 | $r4 = self::$FAILED; |
5841 | goto seq_2; |
5842 | } |
5843 | // free $r7 |
5844 | if (($this->input[$this->currPos] ?? null) === "'") { |
5845 | $this->currPos++; |
5846 | $r7 = "'"; |
5847 | } else { |
5848 | if (!$silence) {$this->fail(33);} |
5849 | $r7 = self::$FAILED; |
5850 | $this->currPos = $p6; |
5851 | $r4 = self::$FAILED; |
5852 | goto seq_2; |
5853 | } |
5854 | $r4 = true; |
5855 | seq_2: |
5856 | // s <- $r4 |
5857 | if ($r4!==self::$FAILED) { |
5858 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
5859 | } else { |
5860 | $r4 = self::$FAILED; |
5861 | $r1 = self::$FAILED; |
5862 | goto seq_1; |
5863 | } |
5864 | // free $p6 |
5865 | // free $p5 |
5866 | $r8 = $this->parseattribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
5867 | if ($r8===self::$FAILED) { |
5868 | $r8 = null; |
5869 | } |
5870 | // t <- $r8 |
5871 | $p5 = $this->currPos; |
5872 | // start choice_2 |
5873 | if (($this->input[$this->currPos] ?? null) === "'") { |
5874 | $this->currPos++; |
5875 | $r9 = "'"; |
5876 | goto choice_2; |
5877 | } else { |
5878 | if (!$silence) {$this->fail(33);} |
5879 | $r9 = self::$FAILED; |
5880 | } |
5881 | $p6 = $this->currPos; |
5882 | // start seq_3 |
5883 | $p10 = $this->currPos; |
5884 | if (($this->input[$this->currPos] ?? null) === "/") { |
5885 | $this->currPos++; |
5886 | $r11 = "/"; |
5887 | } else { |
5888 | $r11 = self::$FAILED; |
5889 | $r11 = null; |
5890 | } |
5891 | if (($this->input[$this->currPos] ?? null) === ">") { |
5892 | $this->currPos++; |
5893 | $r12 = ">"; |
5894 | } else { |
5895 | $r12 = self::$FAILED; |
5896 | $this->currPos = $p10; |
5897 | $r9 = self::$FAILED; |
5898 | goto seq_3; |
5899 | } |
5900 | $r9 = true; |
5901 | seq_3: |
5902 | if ($r9!==self::$FAILED) { |
5903 | $r9 = false; |
5904 | $this->currPos = $p6; |
5905 | } |
5906 | // free $p10 |
5907 | // free $p6 |
5908 | choice_2: |
5909 | // q <- $r9 |
5910 | if ($r9!==self::$FAILED) { |
5911 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
5912 | } else { |
5913 | $r9 = self::$FAILED; |
5914 | $this->currPos = $p3; |
5915 | $r1 = self::$FAILED; |
5916 | goto seq_1; |
5917 | } |
5918 | // free $p5 |
5919 | $r1 = true; |
5920 | seq_1: |
5921 | if ($r1!==self::$FAILED) { |
5922 | $this->savedPos = $p2; |
5923 | $r1 = $this->a57($r4, $r8, $r9); |
5924 | goto choice_1; |
5925 | } |
5926 | // free $p3 |
5927 | $p3 = $this->currPos; |
5928 | // start seq_4 |
5929 | $p5 = $this->currPos; |
5930 | $p6 = $this->currPos; |
5931 | // start seq_5 |
5932 | $p10 = $this->currPos; |
5933 | for (;;) { |
5934 | $r15 = $this->discardspace_or_newline($silence); |
5935 | if ($r15===self::$FAILED) { |
5936 | break; |
5937 | } |
5938 | } |
5939 | // free $r15 |
5940 | $r14 = true; |
5941 | if ($r14===self::$FAILED) { |
5942 | $r13 = self::$FAILED; |
5943 | goto seq_5; |
5944 | } |
5945 | // free $r14 |
5946 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5947 | $this->currPos++; |
5948 | $r14 = "\""; |
5949 | } else { |
5950 | if (!$silence) {$this->fail(34);} |
5951 | $r14 = self::$FAILED; |
5952 | $this->currPos = $p10; |
5953 | $r13 = self::$FAILED; |
5954 | goto seq_5; |
5955 | } |
5956 | $r13 = true; |
5957 | seq_5: |
5958 | // s <- $r13 |
5959 | if ($r13!==self::$FAILED) { |
5960 | $r13 = substr($this->input, $p6, $this->currPos - $p6); |
5961 | } else { |
5962 | $r13 = self::$FAILED; |
5963 | $r1 = self::$FAILED; |
5964 | goto seq_4; |
5965 | } |
5966 | // free $p10 |
5967 | // free $p6 |
5968 | $r15 = $this->parseattribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
5969 | if ($r15===self::$FAILED) { |
5970 | $r15 = null; |
5971 | } |
5972 | // t <- $r15 |
5973 | $p6 = $this->currPos; |
5974 | // start choice_3 |
5975 | if (($this->input[$this->currPos] ?? null) === "\"") { |
5976 | $this->currPos++; |
5977 | $r16 = "\""; |
5978 | goto choice_3; |
5979 | } else { |
5980 | if (!$silence) {$this->fail(34);} |
5981 | $r16 = self::$FAILED; |
5982 | } |
5983 | $p10 = $this->currPos; |
5984 | // start seq_6 |
5985 | $p17 = $this->currPos; |
5986 | if (($this->input[$this->currPos] ?? null) === "/") { |
5987 | $this->currPos++; |
5988 | $r18 = "/"; |
5989 | } else { |
5990 | $r18 = self::$FAILED; |
5991 | $r18 = null; |
5992 | } |
5993 | if (($this->input[$this->currPos] ?? null) === ">") { |
5994 | $this->currPos++; |
5995 | $r19 = ">"; |
5996 | } else { |
5997 | $r19 = self::$FAILED; |
5998 | $this->currPos = $p17; |
5999 | $r16 = self::$FAILED; |
6000 | goto seq_6; |
6001 | } |
6002 | $r16 = true; |
6003 | seq_6: |
6004 | if ($r16!==self::$FAILED) { |
6005 | $r16 = false; |
6006 | $this->currPos = $p10; |
6007 | } |
6008 | // free $p17 |
6009 | // free $p10 |
6010 | choice_3: |
6011 | // q <- $r16 |
6012 | if ($r16!==self::$FAILED) { |
6013 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
6014 | } else { |
6015 | $r16 = self::$FAILED; |
6016 | $this->currPos = $p5; |
6017 | $r1 = self::$FAILED; |
6018 | goto seq_4; |
6019 | } |
6020 | // free $p6 |
6021 | $r1 = true; |
6022 | seq_4: |
6023 | if ($r1!==self::$FAILED) { |
6024 | $this->savedPos = $p3; |
6025 | $r1 = $this->a57($r13, $r15, $r16); |
6026 | goto choice_1; |
6027 | } |
6028 | // free $p5 |
6029 | $p5 = $this->currPos; |
6030 | // start seq_7 |
6031 | $p6 = $this->currPos; |
6032 | $p10 = $this->currPos; |
6033 | for (;;) { |
6034 | $r21 = $this->discardspace_or_newline($silence); |
6035 | if ($r21===self::$FAILED) { |
6036 | break; |
6037 | } |
6038 | } |
6039 | // free $r21 |
6040 | $r20 = true; |
6041 | // s <- $r20 |
6042 | if ($r20!==self::$FAILED) { |
6043 | $r20 = substr($this->input, $p10, $this->currPos - $p10); |
6044 | } else { |
6045 | $r20 = self::$FAILED; |
6046 | $r1 = self::$FAILED; |
6047 | goto seq_7; |
6048 | } |
6049 | // free $p10 |
6050 | $r21 = $this->parseattribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
6051 | // t <- $r21 |
6052 | if ($r21===self::$FAILED) { |
6053 | $this->currPos = $p6; |
6054 | $r1 = self::$FAILED; |
6055 | goto seq_7; |
6056 | } |
6057 | $p10 = $this->currPos; |
6058 | // start choice_4 |
6059 | $r22 = $this->discardspace_or_newline(true); |
6060 | if ($r22!==self::$FAILED) { |
6061 | goto choice_4; |
6062 | } |
6063 | $r22 = $this->discardeof(true); |
6064 | if ($r22!==self::$FAILED) { |
6065 | goto choice_4; |
6066 | } |
6067 | // start seq_8 |
6068 | $p17 = $this->currPos; |
6069 | if (($this->input[$this->currPos] ?? null) === "/") { |
6070 | $this->currPos++; |
6071 | $r23 = "/"; |
6072 | } else { |
6073 | $r23 = self::$FAILED; |
6074 | $r23 = null; |
6075 | } |
6076 | if (($this->input[$this->currPos] ?? null) === ">") { |
6077 | $this->currPos++; |
6078 | $r24 = ">"; |
6079 | } else { |
6080 | $r24 = self::$FAILED; |
6081 | $this->currPos = $p17; |
6082 | $r22 = self::$FAILED; |
6083 | goto seq_8; |
6084 | } |
6085 | $r22 = true; |
6086 | seq_8: |
6087 | // free $p17 |
6088 | choice_4: |
6089 | if ($r22!==self::$FAILED) { |
6090 | $r22 = false; |
6091 | $this->currPos = $p10; |
6092 | } else { |
6093 | $this->currPos = $p6; |
6094 | $r1 = self::$FAILED; |
6095 | goto seq_7; |
6096 | } |
6097 | // free $p10 |
6098 | $r1 = true; |
6099 | seq_7: |
6100 | if ($r1!==self::$FAILED) { |
6101 | $this->savedPos = $p5; |
6102 | $r1 = $this->a58($r20, $r21); |
6103 | } |
6104 | // free $p6 |
6105 | choice_1: |
6106 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6107 | $this->currPos, |
6108 | $r1, |
6109 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6110 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6111 | ); |
6112 | return $r1; |
6113 | } |
6114 | private function parseextlink_nonipv6url_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
6115 | $key = json_encode([540, $boolParams & 0x7fff, $param_preproc, $param_th]); |
6116 | $bucket = $this->currPos; |
6117 | $cached = $this->cache[$bucket][$key] ?? null; |
6118 | if ($cached) { |
6119 | $this->currPos = $cached->nextPos; |
6120 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6121 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6122 | return $cached->result; |
6123 | } |
6124 | $saved_preproc=$param_preproc; |
6125 | $saved_th=$param_th; |
6126 | $p2 = $this->currPos; |
6127 | $r3 = []; |
6128 | for (;;) { |
6129 | // start choice_1 |
6130 | $p5 = $this->currPos; |
6131 | $r4 = self::$FAILED; |
6132 | for (;;) { |
6133 | $r6 = self::charAt($this->input, $this->currPos); |
6134 | if (preg_match("/^[^<\\[{\\x0a\\x0d|!\\]}\\-\\x09&=\"' \\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r6)) { |
6135 | $this->currPos += strlen($r6); |
6136 | $r4 = true; |
6137 | } else { |
6138 | $r6 = self::$FAILED; |
6139 | if (!$silence) {$this->fail(38);} |
6140 | break; |
6141 | } |
6142 | } |
6143 | if ($r4!==self::$FAILED) { |
6144 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
6145 | goto choice_1; |
6146 | } else { |
6147 | $r4 = self::$FAILED; |
6148 | } |
6149 | // free $r6 |
6150 | // free $p5 |
6151 | $p5 = $this->currPos; |
6152 | // start seq_1 |
6153 | $p7 = $this->currPos; |
6154 | $p8 = $this->currPos; |
6155 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
6156 | if ($r6 === self::$FAILED) { |
6157 | $r6 = false; |
6158 | } else { |
6159 | $r6 = self::$FAILED; |
6160 | $this->currPos = $p8; |
6161 | $r4 = self::$FAILED; |
6162 | goto seq_1; |
6163 | } |
6164 | // free $p8 |
6165 | // start choice_2 |
6166 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
6167 | if ($r9!==self::$FAILED) { |
6168 | goto choice_2; |
6169 | } |
6170 | if (strspn($this->input, "&|{-!}=", $this->currPos, 1) !== 0) { |
6171 | $r9 = $this->input[$this->currPos++]; |
6172 | } else { |
6173 | $r9 = self::$FAILED; |
6174 | if (!$silence) {$this->fail(39);} |
6175 | } |
6176 | choice_2: |
6177 | // s <- $r9 |
6178 | if ($r9===self::$FAILED) { |
6179 | $this->currPos = $p7; |
6180 | $r4 = self::$FAILED; |
6181 | goto seq_1; |
6182 | } |
6183 | $r4 = true; |
6184 | seq_1: |
6185 | if ($r4!==self::$FAILED) { |
6186 | $this->savedPos = $p5; |
6187 | $r4 = $this->a42($r9); |
6188 | goto choice_1; |
6189 | } |
6190 | // free $p7 |
6191 | $p7 = $this->currPos; |
6192 | // start seq_2 |
6193 | $p8 = $this->currPos; |
6194 | $r10 = $this->input[$this->currPos] ?? ''; |
6195 | if ($r10 === "'") { |
6196 | $this->currPos++; |
6197 | } else { |
6198 | $r10 = self::$FAILED; |
6199 | if (!$silence) {$this->fail(40);} |
6200 | $r4 = self::$FAILED; |
6201 | goto seq_2; |
6202 | } |
6203 | $p11 = $this->currPos; |
6204 | $r12 = $this->input[$this->currPos] ?? ''; |
6205 | if ($r12 === "'") { |
6206 | $this->currPos++; |
6207 | } else { |
6208 | $r12 = self::$FAILED; |
6209 | } |
6210 | if ($r12 === self::$FAILED) { |
6211 | $r12 = false; |
6212 | } else { |
6213 | $r12 = self::$FAILED; |
6214 | $this->currPos = $p11; |
6215 | $this->currPos = $p8; |
6216 | $r4 = self::$FAILED; |
6217 | goto seq_2; |
6218 | } |
6219 | // free $p11 |
6220 | $r4 = true; |
6221 | seq_2: |
6222 | if ($r4!==self::$FAILED) { |
6223 | $r4 = substr($this->input, $p7, $this->currPos - $p7); |
6224 | } else { |
6225 | $r4 = self::$FAILED; |
6226 | } |
6227 | // free $p8 |
6228 | // free $p7 |
6229 | choice_1: |
6230 | if ($r4!==self::$FAILED) { |
6231 | $r3[] = $r4; |
6232 | } else { |
6233 | break; |
6234 | } |
6235 | } |
6236 | if (count($r3) === 0) { |
6237 | $r3 = self::$FAILED; |
6238 | } |
6239 | // r <- $r3 |
6240 | // free $r4 |
6241 | $r1 = $r3; |
6242 | if ($r1!==self::$FAILED) { |
6243 | $this->savedPos = $p2; |
6244 | $r1 = $this->a59($r3); |
6245 | } |
6246 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6247 | $this->currPos, |
6248 | $r1, |
6249 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6250 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6251 | ); |
6252 | return $r1; |
6253 | } |
6254 | private function parseurltext($silence, $boolParams, &$param_preproc, &$param_th) { |
6255 | $key = json_encode([524, $boolParams & 0x7fff, $param_preproc, $param_th]); |
6256 | $bucket = $this->currPos; |
6257 | $cached = $this->cache[$bucket][$key] ?? null; |
6258 | if ($cached) { |
6259 | $this->currPos = $cached->nextPos; |
6260 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6261 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6262 | return $cached->result; |
6263 | } |
6264 | $saved_preproc=$param_preproc; |
6265 | $saved_th=$param_th; |
6266 | $r1 = []; |
6267 | for (;;) { |
6268 | // start choice_1 |
6269 | $p3 = $this->currPos; |
6270 | // start seq_1 |
6271 | $p4 = $this->currPos; |
6272 | $this->savedPos = $this->currPos; |
6273 | $r5 = $this->a60(); |
6274 | if ($r5) { |
6275 | $r5 = false; |
6276 | } else { |
6277 | $r5 = self::$FAILED; |
6278 | $r2 = self::$FAILED; |
6279 | goto seq_1; |
6280 | } |
6281 | $r2 = true; |
6282 | seq_1: |
6283 | if ($r2!==self::$FAILED) { |
6284 | $this->savedPos = $p3; |
6285 | $r2 = $this->a61(); |
6286 | goto choice_1; |
6287 | } |
6288 | // free $p4 |
6289 | $p4 = $this->currPos; |
6290 | // start seq_2 |
6291 | $p6 = $this->currPos; |
6292 | $this->savedPos = $this->currPos; |
6293 | $r7 = $this->a62(); |
6294 | if ($r7) { |
6295 | $r7 = false; |
6296 | } else { |
6297 | $r7 = self::$FAILED; |
6298 | $r2 = self::$FAILED; |
6299 | goto seq_2; |
6300 | } |
6301 | $r8 = $this->parseautolink($silence, $boolParams, $param_preproc, $param_th); |
6302 | // al <- $r8 |
6303 | if ($r8===self::$FAILED) { |
6304 | $this->currPos = $p6; |
6305 | $r2 = self::$FAILED; |
6306 | goto seq_2; |
6307 | } |
6308 | $r2 = true; |
6309 | seq_2: |
6310 | if ($r2!==self::$FAILED) { |
6311 | $this->savedPos = $p4; |
6312 | $r2 = $this->a63($r8); |
6313 | goto choice_1; |
6314 | } |
6315 | // free $p6 |
6316 | $p6 = $this->currPos; |
6317 | // start seq_3 |
6318 | $p9 = $this->currPos; |
6319 | $p10 = $this->currPos; |
6320 | if (($this->input[$this->currPos] ?? null) === "&") { |
6321 | $this->currPos++; |
6322 | $r11 = "&"; |
6323 | $r11 = false; |
6324 | $this->currPos = $p10; |
6325 | } else { |
6326 | $r11 = self::$FAILED; |
6327 | $r2 = self::$FAILED; |
6328 | goto seq_3; |
6329 | } |
6330 | // free $p10 |
6331 | $r12 = $this->parsehtmlentity($silence); |
6332 | // he <- $r12 |
6333 | if ($r12===self::$FAILED) { |
6334 | $this->currPos = $p9; |
6335 | $r2 = self::$FAILED; |
6336 | goto seq_3; |
6337 | } |
6338 | $r2 = true; |
6339 | seq_3: |
6340 | if ($r2!==self::$FAILED) { |
6341 | $this->savedPos = $p6; |
6342 | $r2 = $this->a64($r12); |
6343 | goto choice_1; |
6344 | } |
6345 | // free $p9 |
6346 | $p9 = $this->currPos; |
6347 | // start seq_4 |
6348 | $p10 = $this->currPos; |
6349 | $p13 = $this->currPos; |
6350 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
6351 | $r14 = "__"; |
6352 | $this->currPos += 2; |
6353 | $r14 = false; |
6354 | $this->currPos = $p13; |
6355 | } else { |
6356 | $r14 = self::$FAILED; |
6357 | $r2 = self::$FAILED; |
6358 | goto seq_4; |
6359 | } |
6360 | // free $p13 |
6361 | $r15 = $this->parsebehavior_switch($silence); |
6362 | // bs <- $r15 |
6363 | if ($r15===self::$FAILED) { |
6364 | $this->currPos = $p10; |
6365 | $r2 = self::$FAILED; |
6366 | goto seq_4; |
6367 | } |
6368 | $r2 = true; |
6369 | seq_4: |
6370 | if ($r2!==self::$FAILED) { |
6371 | $this->savedPos = $p9; |
6372 | $r2 = $this->a65($r15); |
6373 | goto choice_1; |
6374 | } |
6375 | // free $p10 |
6376 | $r2 = $this->parsetext_char($silence); |
6377 | choice_1: |
6378 | if ($r2!==self::$FAILED) { |
6379 | $r1[] = $r2; |
6380 | } else { |
6381 | break; |
6382 | } |
6383 | } |
6384 | if (count($r1) === 0) { |
6385 | $r1 = self::$FAILED; |
6386 | } |
6387 | // free $r2 |
6388 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6389 | $this->currPos, |
6390 | $r1, |
6391 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6392 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6393 | ); |
6394 | return $r1; |
6395 | } |
6396 | private function parseinline_element($silence, $boolParams, &$param_preproc, &$param_th) { |
6397 | $key = json_encode([334, $boolParams & 0x7fff, $param_preproc, $param_th]); |
6398 | $bucket = $this->currPos; |
6399 | $cached = $this->cache[$bucket][$key] ?? null; |
6400 | if ($cached) { |
6401 | $this->currPos = $cached->nextPos; |
6402 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6403 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6404 | return $cached->result; |
6405 | } |
6406 | $saved_preproc=$param_preproc; |
6407 | $saved_th=$param_th; |
6408 | // start choice_1 |
6409 | $p2 = $this->currPos; |
6410 | // start seq_1 |
6411 | $p3 = $this->currPos; |
6412 | $p4 = $this->currPos; |
6413 | if (($this->input[$this->currPos] ?? null) === "<") { |
6414 | $this->currPos++; |
6415 | $r5 = "<"; |
6416 | $r5 = false; |
6417 | $this->currPos = $p4; |
6418 | } else { |
6419 | $r5 = self::$FAILED; |
6420 | $r1 = self::$FAILED; |
6421 | goto seq_1; |
6422 | } |
6423 | // free $p4 |
6424 | $r6 = $this->parseangle_bracket_markup($silence, $boolParams, $param_preproc, $param_th); |
6425 | // r <- $r6 |
6426 | if ($r6===self::$FAILED) { |
6427 | $this->currPos = $p3; |
6428 | $r1 = self::$FAILED; |
6429 | goto seq_1; |
6430 | } |
6431 | $r1 = true; |
6432 | seq_1: |
6433 | if ($r1!==self::$FAILED) { |
6434 | $this->savedPos = $p2; |
6435 | $r1 = $this->a24($r6); |
6436 | goto choice_1; |
6437 | } |
6438 | // free $p3 |
6439 | $p3 = $this->currPos; |
6440 | // start seq_2 |
6441 | $p4 = $this->currPos; |
6442 | $p7 = $this->currPos; |
6443 | if (($this->input[$this->currPos] ?? null) === "{") { |
6444 | $this->currPos++; |
6445 | $r8 = "{"; |
6446 | $r8 = false; |
6447 | $this->currPos = $p7; |
6448 | } else { |
6449 | $r8 = self::$FAILED; |
6450 | $r1 = self::$FAILED; |
6451 | goto seq_2; |
6452 | } |
6453 | // free $p7 |
6454 | $r9 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
6455 | // r <- $r9 |
6456 | if ($r9===self::$FAILED) { |
6457 | $this->currPos = $p4; |
6458 | $r1 = self::$FAILED; |
6459 | goto seq_2; |
6460 | } |
6461 | $r1 = true; |
6462 | seq_2: |
6463 | if ($r1!==self::$FAILED) { |
6464 | $this->savedPos = $p3; |
6465 | $r1 = $this->a24($r9); |
6466 | goto choice_1; |
6467 | } |
6468 | // free $p4 |
6469 | $p4 = $this->currPos; |
6470 | // start seq_3 |
6471 | $p7 = $this->currPos; |
6472 | $p10 = $this->currPos; |
6473 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
6474 | $r11 = "-{"; |
6475 | $this->currPos += 2; |
6476 | $r11 = false; |
6477 | $this->currPos = $p10; |
6478 | } else { |
6479 | $r11 = self::$FAILED; |
6480 | $r1 = self::$FAILED; |
6481 | goto seq_3; |
6482 | } |
6483 | // free $p10 |
6484 | $r12 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
6485 | // r <- $r12 |
6486 | if ($r12===self::$FAILED) { |
6487 | $this->currPos = $p7; |
6488 | $r1 = self::$FAILED; |
6489 | goto seq_3; |
6490 | } |
6491 | $r1 = true; |
6492 | seq_3: |
6493 | if ($r1!==self::$FAILED) { |
6494 | $this->savedPos = $p4; |
6495 | $r1 = $this->a24($r12); |
6496 | goto choice_1; |
6497 | } |
6498 | // free $p7 |
6499 | $p7 = $this->currPos; |
6500 | $r1 = self::$FAILED; |
6501 | for (;;) { |
6502 | // start seq_4 |
6503 | $p10 = $this->currPos; |
6504 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
6505 | $r14 = "[["; |
6506 | $this->currPos += 2; |
6507 | } else { |
6508 | if (!$silence) {$this->fail(41);} |
6509 | $r14 = self::$FAILED; |
6510 | $r13 = self::$FAILED; |
6511 | goto seq_4; |
6512 | } |
6513 | $p15 = $this->currPos; |
6514 | if (($this->input[$this->currPos] ?? null) === "[") { |
6515 | $this->currPos++; |
6516 | $r16 = "["; |
6517 | $r16 = false; |
6518 | $this->currPos = $p15; |
6519 | } else { |
6520 | $r16 = self::$FAILED; |
6521 | $this->currPos = $p10; |
6522 | $r13 = self::$FAILED; |
6523 | goto seq_4; |
6524 | } |
6525 | // free $p15 |
6526 | $r13 = true; |
6527 | seq_4: |
6528 | if ($r13!==self::$FAILED) { |
6529 | $r1 = true; |
6530 | } else { |
6531 | break; |
6532 | } |
6533 | // free $p10 |
6534 | } |
6535 | if ($r1!==self::$FAILED) { |
6536 | $r1 = substr($this->input, $p7, $this->currPos - $p7); |
6537 | goto choice_1; |
6538 | } else { |
6539 | $r1 = self::$FAILED; |
6540 | } |
6541 | // free $r13 |
6542 | // free $p7 |
6543 | $p7 = $this->currPos; |
6544 | // start seq_5 |
6545 | $p10 = $this->currPos; |
6546 | $p15 = $this->currPos; |
6547 | if (($this->input[$this->currPos] ?? null) === "[") { |
6548 | $this->currPos++; |
6549 | $r13 = "["; |
6550 | $r13 = false; |
6551 | $this->currPos = $p15; |
6552 | } else { |
6553 | $r13 = self::$FAILED; |
6554 | $r1 = self::$FAILED; |
6555 | goto seq_5; |
6556 | } |
6557 | // free $p15 |
6558 | // start choice_2 |
6559 | $r17 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
6560 | if ($r17!==self::$FAILED) { |
6561 | goto choice_2; |
6562 | } |
6563 | $r17 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
6564 | choice_2: |
6565 | // r <- $r17 |
6566 | if ($r17===self::$FAILED) { |
6567 | $this->currPos = $p10; |
6568 | $r1 = self::$FAILED; |
6569 | goto seq_5; |
6570 | } |
6571 | $r1 = true; |
6572 | seq_5: |
6573 | if ($r1!==self::$FAILED) { |
6574 | $this->savedPos = $p7; |
6575 | $r1 = $this->a24($r17); |
6576 | goto choice_1; |
6577 | } |
6578 | // free $p10 |
6579 | $p10 = $this->currPos; |
6580 | // start seq_6 |
6581 | $p15 = $this->currPos; |
6582 | $p18 = $this->currPos; |
6583 | if (($this->input[$this->currPos] ?? null) === "'") { |
6584 | $this->currPos++; |
6585 | $r19 = "'"; |
6586 | $r19 = false; |
6587 | $this->currPos = $p18; |
6588 | } else { |
6589 | $r19 = self::$FAILED; |
6590 | $r1 = self::$FAILED; |
6591 | goto seq_6; |
6592 | } |
6593 | // free $p18 |
6594 | $r20 = $this->parsequote($silence); |
6595 | // r <- $r20 |
6596 | if ($r20===self::$FAILED) { |
6597 | $this->currPos = $p15; |
6598 | $r1 = self::$FAILED; |
6599 | goto seq_6; |
6600 | } |
6601 | $r1 = true; |
6602 | seq_6: |
6603 | if ($r1!==self::$FAILED) { |
6604 | $this->savedPos = $p10; |
6605 | $r1 = $this->a24($r20); |
6606 | } |
6607 | // free $p15 |
6608 | choice_1: |
6609 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6610 | $this->currPos, |
6611 | $r1, |
6612 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6613 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6614 | ); |
6615 | return $r1; |
6616 | } |
6617 | private function discardlist_char($silence) { |
6618 | $key = 487; |
6619 | $bucket = $this->currPos; |
6620 | $cached = $this->cache[$bucket][$key] ?? null; |
6621 | if ($cached) { |
6622 | $this->currPos = $cached->nextPos; |
6623 | |
6624 | return $cached->result; |
6625 | } |
6626 | |
6627 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6628 | $r1 = $this->input[$this->currPos++]; |
6629 | } else { |
6630 | $r1 = self::$FAILED; |
6631 | if (!$silence) {$this->fail(42);} |
6632 | } |
6633 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6634 | $this->currPos, |
6635 | $r1, |
6636 | self::$UNDEFINED, |
6637 | self::$UNDEFINED |
6638 | ); |
6639 | return $r1; |
6640 | } |
6641 | private function parselist_char($silence) { |
6642 | $key = 486; |
6643 | $bucket = $this->currPos; |
6644 | $cached = $this->cache[$bucket][$key] ?? null; |
6645 | if ($cached) { |
6646 | $this->currPos = $cached->nextPos; |
6647 | |
6648 | return $cached->result; |
6649 | } |
6650 | |
6651 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
6652 | $r1 = $this->input[$this->currPos++]; |
6653 | } else { |
6654 | $r1 = self::$FAILED; |
6655 | if (!$silence) {$this->fail(42);} |
6656 | } |
6657 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6658 | $this->currPos, |
6659 | $r1, |
6660 | self::$UNDEFINED, |
6661 | self::$UNDEFINED |
6662 | ); |
6663 | return $r1; |
6664 | } |
6665 | private function parsedtdd_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
6666 | $key = json_encode([482, $boolParams & 0x6fff, $param_preproc, $param_th]); |
6667 | $bucket = $this->currPos; |
6668 | $cached = $this->cache[$bucket][$key] ?? null; |
6669 | if ($cached) { |
6670 | $this->currPos = $cached->nextPos; |
6671 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6672 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6673 | return $cached->result; |
6674 | } |
6675 | $saved_preproc=$param_preproc; |
6676 | $saved_th=$param_th; |
6677 | $p2 = $this->currPos; |
6678 | // start seq_1 |
6679 | $p3 = $this->currPos; |
6680 | $r4 = $this->parseinlineline_break_on_colon($silence, $boolParams, $param_preproc, $param_th); |
6681 | if ($r4===self::$FAILED) { |
6682 | $r4 = null; |
6683 | } |
6684 | // c <- $r4 |
6685 | $p6 = $this->currPos; |
6686 | // cpos <- $r5 |
6687 | if (($this->input[$this->currPos] ?? null) === ":") { |
6688 | $this->currPos++; |
6689 | $r5 = ":"; |
6690 | $this->savedPos = $p6; |
6691 | $r5 = $this->a66($r4); |
6692 | } else { |
6693 | if (!$silence) {$this->fail(18);} |
6694 | $r5 = self::$FAILED; |
6695 | $this->currPos = $p3; |
6696 | $r1 = self::$FAILED; |
6697 | goto seq_1; |
6698 | } |
6699 | $r1 = true; |
6700 | seq_1: |
6701 | if ($r1!==self::$FAILED) { |
6702 | $this->savedPos = $p2; |
6703 | $r1 = $this->a67($r4, $r5); |
6704 | } |
6705 | // free $p3 |
6706 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6707 | $this->currPos, |
6708 | $r1, |
6709 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6710 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6711 | ); |
6712 | return $r1; |
6713 | } |
6714 | private function discardeolf($silence) { |
6715 | $key = 571; |
6716 | $bucket = $this->currPos; |
6717 | $cached = $this->cache[$bucket][$key] ?? null; |
6718 | if ($cached) { |
6719 | $this->currPos = $cached->nextPos; |
6720 | |
6721 | return $cached->result; |
6722 | } |
6723 | |
6724 | // start choice_1 |
6725 | $r1 = $this->discardnewline($silence); |
6726 | if ($r1!==self::$FAILED) { |
6727 | goto choice_1; |
6728 | } |
6729 | $r1 = $this->discardeof($silence); |
6730 | choice_1: |
6731 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6732 | $this->currPos, |
6733 | $r1, |
6734 | self::$UNDEFINED, |
6735 | self::$UNDEFINED |
6736 | ); |
6737 | return $r1; |
6738 | } |
6739 | private function parsetable_line($silence, $boolParams, &$param_preproc, &$param_th) { |
6740 | $key = json_encode([494, $boolParams & 0x7fff, $param_preproc, $param_th]); |
6741 | $bucket = $this->currPos; |
6742 | $cached = $this->cache[$bucket][$key] ?? null; |
6743 | if ($cached) { |
6744 | $this->currPos = $cached->nextPos; |
6745 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6746 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6747 | return $cached->result; |
6748 | } |
6749 | $saved_preproc=$param_preproc; |
6750 | $saved_th=$param_th; |
6751 | $p2 = $this->currPos; |
6752 | // start seq_1 |
6753 | $p3 = $this->currPos; |
6754 | // start choice_1 |
6755 | $p5 = $this->currPos; |
6756 | $r4 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
6757 | if ($r4 === self::$FAILED) { |
6758 | $r4 = false; |
6759 | goto choice_1; |
6760 | } else { |
6761 | $r4 = self::$FAILED; |
6762 | $this->currPos = $p5; |
6763 | } |
6764 | // free $p5 |
6765 | $p5 = $this->currPos; |
6766 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
6767 | $r4 = "{{!}}"; |
6768 | $this->currPos += 5; |
6769 | $r4 = false; |
6770 | $this->currPos = $p5; |
6771 | } else { |
6772 | $r4 = self::$FAILED; |
6773 | } |
6774 | // free $p5 |
6775 | choice_1: |
6776 | if ($r4===self::$FAILED) { |
6777 | $r1 = self::$FAILED; |
6778 | goto seq_1; |
6779 | } |
6780 | // start choice_2 |
6781 | $r6 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
6782 | if ($r6!==self::$FAILED) { |
6783 | goto choice_2; |
6784 | } |
6785 | $r6 = $this->parsetable_content_line($silence, $boolParams | 0x40, $param_preproc, $param_th); |
6786 | if ($r6!==self::$FAILED) { |
6787 | goto choice_2; |
6788 | } |
6789 | $r6 = $this->parsetable_end_tag($silence); |
6790 | choice_2: |
6791 | // tl <- $r6 |
6792 | if ($r6===self::$FAILED) { |
6793 | $this->currPos = $p3; |
6794 | $r1 = self::$FAILED; |
6795 | goto seq_1; |
6796 | } |
6797 | $r1 = true; |
6798 | seq_1: |
6799 | if ($r1!==self::$FAILED) { |
6800 | $this->savedPos = $p2; |
6801 | $r1 = $this->a68($r6); |
6802 | } |
6803 | // free $p3 |
6804 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6805 | $this->currPos, |
6806 | $r1, |
6807 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6808 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6809 | ); |
6810 | return $r1; |
6811 | } |
6812 | private function parsesol($silence, $boolParams, &$param_preproc, &$param_th) { |
6813 | $key = json_encode([590, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
6814 | $bucket = $this->currPos; |
6815 | $cached = $this->cache[$bucket][$key] ?? null; |
6816 | if ($cached) { |
6817 | $this->currPos = $cached->nextPos; |
6818 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
6819 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
6820 | return $cached->result; |
6821 | } |
6822 | $saved_preproc=$param_preproc; |
6823 | $saved_th=$param_th; |
6824 | $p2 = $this->currPos; |
6825 | // start seq_1 |
6826 | $p3 = $this->currPos; |
6827 | $r4 = $this->parsesol_prefix($silence); |
6828 | // sp <- $r4 |
6829 | if ($r4===self::$FAILED) { |
6830 | $r1 = self::$FAILED; |
6831 | goto seq_1; |
6832 | } |
6833 | $r5 = $this->parseempty_lines_with_comments($silence); |
6834 | if ($r5===self::$FAILED) { |
6835 | $r5 = null; |
6836 | } |
6837 | // elc <- $r5 |
6838 | $r6 = []; |
6839 | for (;;) { |
6840 | $r7 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
6841 | if ($r7!==self::$FAILED) { |
6842 | $r6[] = $r7; |
6843 | } else { |
6844 | break; |
6845 | } |
6846 | } |
6847 | // st <- $r6 |
6848 | // free $r7 |
6849 | $r1 = true; |
6850 | seq_1: |
6851 | if ($r1!==self::$FAILED) { |
6852 | $this->savedPos = $p2; |
6853 | $r1 = $this->a69($r4, $r5, $r6); |
6854 | } |
6855 | // free $p3 |
6856 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6857 | $this->currPos, |
6858 | $r1, |
6859 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
6860 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
6861 | ); |
6862 | return $r1; |
6863 | } |
6864 | private function discardcomment($silence) { |
6865 | $key = 573; |
6866 | $bucket = $this->currPos; |
6867 | $cached = $this->cache[$bucket][$key] ?? null; |
6868 | if ($cached) { |
6869 | $this->currPos = $cached->nextPos; |
6870 | |
6871 | return $cached->result; |
6872 | } |
6873 | |
6874 | $p2 = $this->currPos; |
6875 | // start seq_1 |
6876 | $p3 = $this->currPos; |
6877 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
6878 | $r4 = "<!--"; |
6879 | $this->currPos += 4; |
6880 | } else { |
6881 | if (!$silence) {$this->fail(11);} |
6882 | $r4 = self::$FAILED; |
6883 | $r1 = self::$FAILED; |
6884 | goto seq_1; |
6885 | } |
6886 | $p6 = $this->currPos; |
6887 | for (;;) { |
6888 | // start seq_2 |
6889 | $p8 = $this->currPos; |
6890 | $p9 = $this->currPos; |
6891 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6892 | $r10 = "-->"; |
6893 | $this->currPos += 3; |
6894 | } else { |
6895 | $r10 = self::$FAILED; |
6896 | } |
6897 | if ($r10 === self::$FAILED) { |
6898 | $r10 = false; |
6899 | } else { |
6900 | $r10 = self::$FAILED; |
6901 | $this->currPos = $p9; |
6902 | $r7 = self::$FAILED; |
6903 | goto seq_2; |
6904 | } |
6905 | // free $p9 |
6906 | if ($this->currPos < $this->inputLength) { |
6907 | $r11 = self::consumeChar($this->input, $this->currPos);; |
6908 | } else { |
6909 | $r11 = self::$FAILED; |
6910 | if (!$silence) {$this->fail(7);} |
6911 | $this->currPos = $p8; |
6912 | $r7 = self::$FAILED; |
6913 | goto seq_2; |
6914 | } |
6915 | $r7 = true; |
6916 | seq_2: |
6917 | if ($r7===self::$FAILED) { |
6918 | break; |
6919 | } |
6920 | // free $p8 |
6921 | } |
6922 | // free $r7 |
6923 | $r5 = true; |
6924 | // c <- $r5 |
6925 | if ($r5!==self::$FAILED) { |
6926 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
6927 | } else { |
6928 | $r5 = self::$FAILED; |
6929 | $this->currPos = $p3; |
6930 | $r1 = self::$FAILED; |
6931 | goto seq_1; |
6932 | } |
6933 | // free $p6 |
6934 | $p6 = $this->currPos; |
6935 | // start choice_1 |
6936 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
6937 | $r7 = "-->"; |
6938 | $this->currPos += 3; |
6939 | goto choice_1; |
6940 | } else { |
6941 | if (!$silence) {$this->fail(12);} |
6942 | $r7 = self::$FAILED; |
6943 | } |
6944 | $r7 = $this->discardeof($silence); |
6945 | choice_1: |
6946 | // cEnd <- $r7 |
6947 | if ($r7!==self::$FAILED) { |
6948 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
6949 | } else { |
6950 | $r7 = self::$FAILED; |
6951 | $this->currPos = $p3; |
6952 | $r1 = self::$FAILED; |
6953 | goto seq_1; |
6954 | } |
6955 | // free $p6 |
6956 | $r1 = true; |
6957 | seq_1: |
6958 | if ($r1!==self::$FAILED) { |
6959 | $this->savedPos = $p2; |
6960 | $r1 = $this->a27($r5, $r7); |
6961 | } |
6962 | // free $p3 |
6963 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6964 | $this->currPos, |
6965 | $r1, |
6966 | self::$UNDEFINED, |
6967 | self::$UNDEFINED |
6968 | ); |
6969 | return $r1; |
6970 | } |
6971 | private function discardsof($silence) { |
6972 | $key = 563; |
6973 | $bucket = $this->currPos; |
6974 | $cached = $this->cache[$bucket][$key] ?? null; |
6975 | if ($cached) { |
6976 | $this->currPos = $cached->nextPos; |
6977 | |
6978 | return $cached->result; |
6979 | } |
6980 | |
6981 | $this->savedPos = $this->currPos; |
6982 | $r1 = $this->a70(); |
6983 | if ($r1) { |
6984 | $r1 = false; |
6985 | } else { |
6986 | $r1 = self::$FAILED; |
6987 | } |
6988 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
6989 | $this->currPos, |
6990 | $r1, |
6991 | self::$UNDEFINED, |
6992 | self::$UNDEFINED |
6993 | ); |
6994 | return $r1; |
6995 | } |
6996 | private function parseredirect($silence, $boolParams, &$param_th, &$param_preproc) { |
6997 | $key = json_encode([308, $boolParams & 0x7fff, $param_th, $param_preproc]); |
6998 | $bucket = $this->currPos; |
6999 | $cached = $this->cache[$bucket][$key] ?? null; |
7000 | if ($cached) { |
7001 | $this->currPos = $cached->nextPos; |
7002 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7003 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7004 | return $cached->result; |
7005 | } |
7006 | $saved_th=$param_th; |
7007 | $saved_preproc=$param_preproc; |
7008 | $p2 = $this->currPos; |
7009 | // start seq_1 |
7010 | $p3 = $this->currPos; |
7011 | $r4 = $this->parseredirect_word($silence); |
7012 | // rw <- $r4 |
7013 | if ($r4===self::$FAILED) { |
7014 | $r1 = self::$FAILED; |
7015 | goto seq_1; |
7016 | } |
7017 | $p6 = $this->currPos; |
7018 | for (;;) { |
7019 | $r7 = $this->discardspace_or_newline($silence); |
7020 | if ($r7===self::$FAILED) { |
7021 | break; |
7022 | } |
7023 | } |
7024 | // free $r7 |
7025 | $r5 = true; |
7026 | // sp <- $r5 |
7027 | if ($r5!==self::$FAILED) { |
7028 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
7029 | } else { |
7030 | $r5 = self::$FAILED; |
7031 | $this->currPos = $p3; |
7032 | $r1 = self::$FAILED; |
7033 | goto seq_1; |
7034 | } |
7035 | // free $p6 |
7036 | $p6 = $this->currPos; |
7037 | // start seq_2 |
7038 | $p8 = $this->currPos; |
7039 | if (($this->input[$this->currPos] ?? null) === ":") { |
7040 | $this->currPos++; |
7041 | $r9 = ":"; |
7042 | } else { |
7043 | if (!$silence) {$this->fail(18);} |
7044 | $r9 = self::$FAILED; |
7045 | $r7 = self::$FAILED; |
7046 | goto seq_2; |
7047 | } |
7048 | for (;;) { |
7049 | $r11 = $this->discardspace_or_newline($silence); |
7050 | if ($r11===self::$FAILED) { |
7051 | break; |
7052 | } |
7053 | } |
7054 | // free $r11 |
7055 | $r10 = true; |
7056 | if ($r10===self::$FAILED) { |
7057 | $this->currPos = $p8; |
7058 | $r7 = self::$FAILED; |
7059 | goto seq_2; |
7060 | } |
7061 | // free $r10 |
7062 | $r7 = true; |
7063 | seq_2: |
7064 | if ($r7===self::$FAILED) { |
7065 | $r7 = null; |
7066 | } |
7067 | // free $p8 |
7068 | // c <- $r7 |
7069 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
7070 | // free $p6 |
7071 | $r10 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
7072 | // wl <- $r10 |
7073 | if ($r10===self::$FAILED) { |
7074 | $this->currPos = $p3; |
7075 | $r1 = self::$FAILED; |
7076 | goto seq_1; |
7077 | } |
7078 | $this->savedPos = $this->currPos; |
7079 | $r11 = $this->a71($r4, $r5, $r7, $r10); |
7080 | if ($r11) { |
7081 | $r11 = false; |
7082 | } else { |
7083 | $r11 = self::$FAILED; |
7084 | $this->currPos = $p3; |
7085 | $r1 = self::$FAILED; |
7086 | goto seq_1; |
7087 | } |
7088 | $r1 = true; |
7089 | seq_1: |
7090 | if ($r1!==self::$FAILED) { |
7091 | $this->savedPos = $p2; |
7092 | $r1 = $this->a72($r4, $r5, $r7, $r10); |
7093 | } |
7094 | // free $p3 |
7095 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7096 | $this->currPos, |
7097 | $r1, |
7098 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7099 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7100 | ); |
7101 | return $r1; |
7102 | } |
7103 | private function parsesol_transparent($silence, $boolParams, &$param_preproc, &$param_th) { |
7104 | $key = json_encode([588, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
7105 | $bucket = $this->currPos; |
7106 | $cached = $this->cache[$bucket][$key] ?? null; |
7107 | if ($cached) { |
7108 | $this->currPos = $cached->nextPos; |
7109 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7110 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7111 | return $cached->result; |
7112 | } |
7113 | $saved_preproc=$param_preproc; |
7114 | $saved_th=$param_th; |
7115 | // start choice_1 |
7116 | $r1 = $this->parsecomment($silence); |
7117 | if ($r1!==self::$FAILED) { |
7118 | goto choice_1; |
7119 | } |
7120 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
7121 | if ($r1!==self::$FAILED) { |
7122 | goto choice_1; |
7123 | } |
7124 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
7125 | if ($r1!==self::$FAILED) { |
7126 | goto choice_1; |
7127 | } |
7128 | $r1 = $this->parsebehavior_switch($silence); |
7129 | choice_1: |
7130 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7131 | $this->currPos, |
7132 | $r1, |
7133 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7134 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7135 | ); |
7136 | return $r1; |
7137 | } |
7138 | private function parseblock_line($silence, $boolParams, &$param_preproc, &$param_th) { |
7139 | $key = json_encode([322, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7140 | $bucket = $this->currPos; |
7141 | $cached = $this->cache[$bucket][$key] ?? null; |
7142 | if ($cached) { |
7143 | $this->currPos = $cached->nextPos; |
7144 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7145 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7146 | return $cached->result; |
7147 | } |
7148 | $saved_preproc=$param_preproc; |
7149 | $saved_th=$param_th; |
7150 | // start choice_1 |
7151 | $r1 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
7152 | if ($r1!==self::$FAILED) { |
7153 | goto choice_1; |
7154 | } |
7155 | $r1 = $this->parselist_item($silence, $boolParams, $param_preproc, $param_th); |
7156 | if ($r1!==self::$FAILED) { |
7157 | goto choice_1; |
7158 | } |
7159 | $r1 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
7160 | if ($r1!==self::$FAILED) { |
7161 | goto choice_1; |
7162 | } |
7163 | $p2 = $this->currPos; |
7164 | // start seq_1 |
7165 | $p3 = $this->currPos; |
7166 | $r4 = $this->parseoptionalSpaceToken($silence); |
7167 | // st <- $r4 |
7168 | if ($r4===self::$FAILED) { |
7169 | $r1 = self::$FAILED; |
7170 | goto seq_1; |
7171 | } |
7172 | $p5 = $this->currPos; |
7173 | if (strspn($this->input, " <{}|!", $this->currPos, 1) !== 0) { |
7174 | $r6 = $this->input[$this->currPos++]; |
7175 | $r6 = false; |
7176 | $this->currPos = $p5; |
7177 | } else { |
7178 | $r6 = self::$FAILED; |
7179 | $this->currPos = $p3; |
7180 | $r1 = self::$FAILED; |
7181 | goto seq_1; |
7182 | } |
7183 | // free $p5 |
7184 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
7185 | // tl <- $r7 |
7186 | if ($r7===self::$FAILED) { |
7187 | $this->currPos = $p3; |
7188 | $r1 = self::$FAILED; |
7189 | goto seq_1; |
7190 | } |
7191 | $r1 = true; |
7192 | seq_1: |
7193 | if ($r1!==self::$FAILED) { |
7194 | $this->savedPos = $p2; |
7195 | $r1 = $this->a73($r4, $r7); |
7196 | } |
7197 | // free $p3 |
7198 | choice_1: |
7199 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7200 | $this->currPos, |
7201 | $r1, |
7202 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7203 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7204 | ); |
7205 | return $r1; |
7206 | } |
7207 | private function parseblock_lines($silence, $boolParams, &$param_preproc, &$param_th) { |
7208 | $key = json_encode([318, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7209 | $bucket = $this->currPos; |
7210 | $cached = $this->cache[$bucket][$key] ?? null; |
7211 | if ($cached) { |
7212 | $this->currPos = $cached->nextPos; |
7213 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7214 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7215 | return $cached->result; |
7216 | } |
7217 | $saved_preproc=$param_preproc; |
7218 | $saved_th=$param_th; |
7219 | $p2 = $this->currPos; |
7220 | // start seq_1 |
7221 | $p3 = $this->currPos; |
7222 | $r4 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7223 | // s <- $r4 |
7224 | if ($r4===self::$FAILED) { |
7225 | $r1 = self::$FAILED; |
7226 | goto seq_1; |
7227 | } |
7228 | $p6 = $this->currPos; |
7229 | // start seq_2 |
7230 | $p7 = $this->currPos; |
7231 | $r8 = $this->parseoptionalSpaceToken($silence); |
7232 | // os <- $r8 |
7233 | if ($r8===self::$FAILED) { |
7234 | $r5 = self::$FAILED; |
7235 | goto seq_2; |
7236 | } |
7237 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
7238 | // so <- $r9 |
7239 | if ($r9===self::$FAILED) { |
7240 | $this->currPos = $p7; |
7241 | $r5 = self::$FAILED; |
7242 | goto seq_2; |
7243 | } |
7244 | $r5 = true; |
7245 | seq_2: |
7246 | if ($r5!==self::$FAILED) { |
7247 | $this->savedPos = $p6; |
7248 | $r5 = $this->a74($r4, $r8, $r9); |
7249 | } else { |
7250 | $r5 = null; |
7251 | } |
7252 | // free $p7 |
7253 | // s2 <- $r5 |
7254 | $r10 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
7255 | // bl <- $r10 |
7256 | if ($r10===self::$FAILED) { |
7257 | $this->currPos = $p3; |
7258 | $r1 = self::$FAILED; |
7259 | goto seq_1; |
7260 | } |
7261 | $r1 = true; |
7262 | seq_1: |
7263 | if ($r1!==self::$FAILED) { |
7264 | $this->savedPos = $p2; |
7265 | $r1 = $this->a75($r4, $r5, $r10); |
7266 | } |
7267 | // free $p3 |
7268 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7269 | $this->currPos, |
7270 | $r1, |
7271 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7272 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7273 | ); |
7274 | return $r1; |
7275 | } |
7276 | private function discardtplarg($silence, $boolParams, &$param_th) { |
7277 | $key = json_encode([379, $boolParams & 0x7fff, $param_th]); |
7278 | $bucket = $this->currPos; |
7279 | $cached = $this->cache[$bucket][$key] ?? null; |
7280 | if ($cached) { |
7281 | $this->currPos = $cached->nextPos; |
7282 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7283 | return $cached->result; |
7284 | } |
7285 | $saved_th=$param_th; |
7286 | $r1 = $this->discardtplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7287 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7288 | $this->currPos, |
7289 | $r1, |
7290 | self::$UNDEFINED, |
7291 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7292 | ); |
7293 | return $r1; |
7294 | } |
7295 | private function parsetemplate($silence, $boolParams, &$param_th) { |
7296 | $key = json_encode([370, $boolParams & 0x7fff, $param_th]); |
7297 | $bucket = $this->currPos; |
7298 | $cached = $this->cache[$bucket][$key] ?? null; |
7299 | if ($cached) { |
7300 | $this->currPos = $cached->nextPos; |
7301 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7302 | return $cached->result; |
7303 | } |
7304 | $saved_th=$param_th; |
7305 | $r1 = $this->parsetemplate_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7306 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7307 | $this->currPos, |
7308 | $r1, |
7309 | self::$UNDEFINED, |
7310 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7311 | ); |
7312 | return $r1; |
7313 | } |
7314 | private function parsebroken_template($silence, &$param_preproc) { |
7315 | $key = json_encode([372, $param_preproc]); |
7316 | $bucket = $this->currPos; |
7317 | $cached = $this->cache[$bucket][$key] ?? null; |
7318 | if ($cached) { |
7319 | $this->currPos = $cached->nextPos; |
7320 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7321 | return $cached->result; |
7322 | } |
7323 | $saved_preproc=$param_preproc; |
7324 | $p2 = $this->currPos; |
7325 | // start seq_1 |
7326 | $p3 = $this->currPos; |
7327 | // t <- $r4 |
7328 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
7329 | $r4 = "{{"; |
7330 | $this->currPos += 2; |
7331 | } else { |
7332 | if (!$silence) {$this->fail(43);} |
7333 | $r4 = self::$FAILED; |
7334 | $this->currPos = $p3; |
7335 | $r1 = self::$FAILED; |
7336 | goto seq_1; |
7337 | } |
7338 | $r1 = true; |
7339 | seq_1: |
7340 | if ($r1!==self::$FAILED) { |
7341 | $this->savedPos = $p2; |
7342 | $r1 = $this->a76($param_preproc, $r4); |
7343 | } |
7344 | // free $p3 |
7345 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7346 | $this->currPos, |
7347 | $r1, |
7348 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7349 | self::$UNDEFINED |
7350 | ); |
7351 | return $r1; |
7352 | } |
7353 | private function parsetplarg($silence, $boolParams, &$param_th) { |
7354 | $key = json_encode([378, $boolParams & 0x7fff, $param_th]); |
7355 | $bucket = $this->currPos; |
7356 | $cached = $this->cache[$bucket][$key] ?? null; |
7357 | if ($cached) { |
7358 | $this->currPos = $cached->nextPos; |
7359 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7360 | return $cached->result; |
7361 | } |
7362 | $saved_th=$param_th; |
7363 | $r1 = $this->parsetplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
7364 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7365 | $this->currPos, |
7366 | $r1, |
7367 | self::$UNDEFINED, |
7368 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7369 | ); |
7370 | return $r1; |
7371 | } |
7372 | private function discardwikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
7373 | $key = json_encode([423, $boolParams & 0x7fff, $param_th, $param_preproc]); |
7374 | $bucket = $this->currPos; |
7375 | $cached = $this->cache[$bucket][$key] ?? null; |
7376 | if ($cached) { |
7377 | $this->currPos = $cached->nextPos; |
7378 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7379 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7380 | return $cached->result; |
7381 | } |
7382 | $saved_th=$param_th; |
7383 | $saved_preproc=$param_preproc; |
7384 | // start choice_1 |
7385 | $r1 = $this->discardwikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
7386 | if ($r1!==self::$FAILED) { |
7387 | goto choice_1; |
7388 | } |
7389 | $r1 = $this->discardbroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
7390 | choice_1: |
7391 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7392 | $this->currPos, |
7393 | $r1, |
7394 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7395 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7396 | ); |
7397 | return $r1; |
7398 | } |
7399 | private function parsedirective($silence, $boolParams, &$param_preproc, &$param_th) { |
7400 | $key = json_encode([534, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7401 | $bucket = $this->currPos; |
7402 | $cached = $this->cache[$bucket][$key] ?? null; |
7403 | if ($cached) { |
7404 | $this->currPos = $cached->nextPos; |
7405 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7406 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7407 | return $cached->result; |
7408 | } |
7409 | $saved_preproc=$param_preproc; |
7410 | $saved_th=$param_th; |
7411 | // start choice_1 |
7412 | $r1 = $this->parsecomment($silence); |
7413 | if ($r1!==self::$FAILED) { |
7414 | goto choice_1; |
7415 | } |
7416 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
7417 | if ($r1!==self::$FAILED) { |
7418 | goto choice_1; |
7419 | } |
7420 | $r1 = $this->parsewellformed_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
7421 | if ($r1!==self::$FAILED) { |
7422 | goto choice_1; |
7423 | } |
7424 | $r1 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
7425 | if ($r1!==self::$FAILED) { |
7426 | goto choice_1; |
7427 | } |
7428 | $p2 = $this->currPos; |
7429 | // start seq_1 |
7430 | $p3 = $this->currPos; |
7431 | $p4 = $this->currPos; |
7432 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
7433 | $r5 = "-{"; |
7434 | $this->currPos += 2; |
7435 | $r5 = false; |
7436 | $this->currPos = $p4; |
7437 | } else { |
7438 | $r5 = self::$FAILED; |
7439 | $r1 = self::$FAILED; |
7440 | goto seq_1; |
7441 | } |
7442 | // free $p4 |
7443 | $r6 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
7444 | // v <- $r6 |
7445 | if ($r6===self::$FAILED) { |
7446 | $this->currPos = $p3; |
7447 | $r1 = self::$FAILED; |
7448 | goto seq_1; |
7449 | } |
7450 | $r1 = true; |
7451 | seq_1: |
7452 | if ($r1!==self::$FAILED) { |
7453 | $this->savedPos = $p2; |
7454 | $r1 = $this->a77($r6); |
7455 | goto choice_1; |
7456 | } |
7457 | // free $p3 |
7458 | $p3 = $this->currPos; |
7459 | // start seq_2 |
7460 | $p4 = $this->currPos; |
7461 | $p7 = $this->currPos; |
7462 | if (($this->input[$this->currPos] ?? null) === "&") { |
7463 | $this->currPos++; |
7464 | $r8 = "&"; |
7465 | $r8 = false; |
7466 | $this->currPos = $p7; |
7467 | } else { |
7468 | $r8 = self::$FAILED; |
7469 | $r1 = self::$FAILED; |
7470 | goto seq_2; |
7471 | } |
7472 | // free $p7 |
7473 | $r9 = $this->parsehtmlentity($silence); |
7474 | // e <- $r9 |
7475 | if ($r9===self::$FAILED) { |
7476 | $this->currPos = $p4; |
7477 | $r1 = self::$FAILED; |
7478 | goto seq_2; |
7479 | } |
7480 | $r1 = true; |
7481 | seq_2: |
7482 | if ($r1!==self::$FAILED) { |
7483 | $this->savedPos = $p3; |
7484 | $r1 = $this->a78($r9); |
7485 | goto choice_1; |
7486 | } |
7487 | // free $p4 |
7488 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
7489 | choice_1: |
7490 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7491 | $this->currPos, |
7492 | $r1, |
7493 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7494 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7495 | ); |
7496 | return $r1; |
7497 | } |
7498 | private function parsehtml_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
7499 | $key = json_encode([330, $boolParams & 0x7ebd, $param_preproc, $param_th]); |
7500 | $bucket = $this->currPos; |
7501 | $cached = $this->cache[$bucket][$key] ?? null; |
7502 | if ($cached) { |
7503 | $this->currPos = $cached->nextPos; |
7504 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7505 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7506 | return $cached->result; |
7507 | } |
7508 | $saved_preproc=$param_preproc; |
7509 | $saved_th=$param_th; |
7510 | $r1 = $this->parsexmlish_tag($silence, $boolParams & ~0x2, $param_preproc, $param_th); |
7511 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7512 | $this->currPos, |
7513 | $r1, |
7514 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7515 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7516 | ); |
7517 | return $r1; |
7518 | } |
7519 | private function parsetable_attribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7520 | $key = json_encode([550, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7521 | $bucket = $this->currPos; |
7522 | $cached = $this->cache[$bucket][$key] ?? null; |
7523 | if ($cached) { |
7524 | $this->currPos = $cached->nextPos; |
7525 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7526 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7527 | return $cached->result; |
7528 | } |
7529 | $saved_preproc=$param_preproc; |
7530 | $saved_th=$param_th; |
7531 | $p2 = $this->currPos; |
7532 | $r3 = []; |
7533 | for (;;) { |
7534 | // start choice_1 |
7535 | $p5 = $this->currPos; |
7536 | $r4 = self::$FAILED; |
7537 | for (;;) { |
7538 | if (strcspn($this->input, "{}&<-!['\x0d\x0a|", $this->currPos, 1) !== 0) { |
7539 | $r6 = self::consumeChar($this->input, $this->currPos); |
7540 | $r4 = true; |
7541 | } else { |
7542 | $r6 = self::$FAILED; |
7543 | if (!$silence) {$this->fail(44);} |
7544 | break; |
7545 | } |
7546 | } |
7547 | if ($r4!==self::$FAILED) { |
7548 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7549 | goto choice_1; |
7550 | } else { |
7551 | $r4 = self::$FAILED; |
7552 | } |
7553 | // free $r6 |
7554 | // free $p5 |
7555 | $p5 = $this->currPos; |
7556 | // start seq_1 |
7557 | $p7 = $this->currPos; |
7558 | $p8 = $this->currPos; |
7559 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7560 | if ($r6 === self::$FAILED) { |
7561 | $r6 = false; |
7562 | } else { |
7563 | $r6 = self::$FAILED; |
7564 | $this->currPos = $p8; |
7565 | $r4 = self::$FAILED; |
7566 | goto seq_1; |
7567 | } |
7568 | // free $p8 |
7569 | // start choice_2 |
7570 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7571 | if ($r9!==self::$FAILED) { |
7572 | goto choice_2; |
7573 | } |
7574 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7575 | $r9 = $this->input[$this->currPos++]; |
7576 | } else { |
7577 | $r9 = self::$FAILED; |
7578 | if (!$silence) {$this->fail(45);} |
7579 | } |
7580 | choice_2: |
7581 | // s <- $r9 |
7582 | if ($r9===self::$FAILED) { |
7583 | $this->currPos = $p7; |
7584 | $r4 = self::$FAILED; |
7585 | goto seq_1; |
7586 | } |
7587 | $r4 = true; |
7588 | seq_1: |
7589 | if ($r4!==self::$FAILED) { |
7590 | $this->savedPos = $p5; |
7591 | $r4 = $this->a42($r9); |
7592 | } |
7593 | // free $p7 |
7594 | choice_1: |
7595 | if ($r4!==self::$FAILED) { |
7596 | $r3[] = $r4; |
7597 | } else { |
7598 | break; |
7599 | } |
7600 | } |
7601 | // r <- $r3 |
7602 | // free $r4 |
7603 | $r1 = $r3; |
7604 | if ($r1!==self::$FAILED) { |
7605 | $this->savedPos = $p2; |
7606 | $r1 = $this->a59($r3); |
7607 | } |
7608 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7609 | $this->currPos, |
7610 | $r1, |
7611 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7612 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7613 | ); |
7614 | return $r1; |
7615 | } |
7616 | private function parsetable_attribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7617 | $key = json_encode([552, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7618 | $bucket = $this->currPos; |
7619 | $cached = $this->cache[$bucket][$key] ?? null; |
7620 | if ($cached) { |
7621 | $this->currPos = $cached->nextPos; |
7622 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7623 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7624 | return $cached->result; |
7625 | } |
7626 | $saved_preproc=$param_preproc; |
7627 | $saved_th=$param_th; |
7628 | $p2 = $this->currPos; |
7629 | $r3 = []; |
7630 | for (;;) { |
7631 | // start choice_1 |
7632 | $p5 = $this->currPos; |
7633 | $r4 = self::$FAILED; |
7634 | for (;;) { |
7635 | if (strcspn($this->input, "{}&<-![\"\x0d\x0a|", $this->currPos, 1) !== 0) { |
7636 | $r6 = self::consumeChar($this->input, $this->currPos); |
7637 | $r4 = true; |
7638 | } else { |
7639 | $r6 = self::$FAILED; |
7640 | if (!$silence) {$this->fail(46);} |
7641 | break; |
7642 | } |
7643 | } |
7644 | if ($r4!==self::$FAILED) { |
7645 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7646 | goto choice_1; |
7647 | } else { |
7648 | $r4 = self::$FAILED; |
7649 | } |
7650 | // free $r6 |
7651 | // free $p5 |
7652 | $p5 = $this->currPos; |
7653 | // start seq_1 |
7654 | $p7 = $this->currPos; |
7655 | $p8 = $this->currPos; |
7656 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7657 | if ($r6 === self::$FAILED) { |
7658 | $r6 = false; |
7659 | } else { |
7660 | $r6 = self::$FAILED; |
7661 | $this->currPos = $p8; |
7662 | $r4 = self::$FAILED; |
7663 | goto seq_1; |
7664 | } |
7665 | // free $p8 |
7666 | // start choice_2 |
7667 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7668 | if ($r9!==self::$FAILED) { |
7669 | goto choice_2; |
7670 | } |
7671 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7672 | $r9 = $this->input[$this->currPos++]; |
7673 | } else { |
7674 | $r9 = self::$FAILED; |
7675 | if (!$silence) {$this->fail(45);} |
7676 | } |
7677 | choice_2: |
7678 | // s <- $r9 |
7679 | if ($r9===self::$FAILED) { |
7680 | $this->currPos = $p7; |
7681 | $r4 = self::$FAILED; |
7682 | goto seq_1; |
7683 | } |
7684 | $r4 = true; |
7685 | seq_1: |
7686 | if ($r4!==self::$FAILED) { |
7687 | $this->savedPos = $p5; |
7688 | $r4 = $this->a42($r9); |
7689 | } |
7690 | // free $p7 |
7691 | choice_1: |
7692 | if ($r4!==self::$FAILED) { |
7693 | $r3[] = $r4; |
7694 | } else { |
7695 | break; |
7696 | } |
7697 | } |
7698 | // r <- $r3 |
7699 | // free $r4 |
7700 | $r1 = $r3; |
7701 | if ($r1!==self::$FAILED) { |
7702 | $this->savedPos = $p2; |
7703 | $r1 = $this->a59($r3); |
7704 | } |
7705 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7706 | $this->currPos, |
7707 | $r1, |
7708 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7709 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7710 | ); |
7711 | return $r1; |
7712 | } |
7713 | private function parsetable_attribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
7714 | $key = json_encode([548, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7715 | $bucket = $this->currPos; |
7716 | $cached = $this->cache[$bucket][$key] ?? null; |
7717 | if ($cached) { |
7718 | $this->currPos = $cached->nextPos; |
7719 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7720 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7721 | return $cached->result; |
7722 | } |
7723 | $saved_preproc=$param_preproc; |
7724 | $saved_th=$param_th; |
7725 | $p2 = $this->currPos; |
7726 | $r3 = []; |
7727 | for (;;) { |
7728 | // start choice_1 |
7729 | $p5 = $this->currPos; |
7730 | $r4 = self::$FAILED; |
7731 | for (;;) { |
7732 | if (strcspn($this->input, "{}&<-![ \x09\x0a\x0d\x0c|", $this->currPos, 1) !== 0) { |
7733 | $r6 = self::consumeChar($this->input, $this->currPos); |
7734 | $r4 = true; |
7735 | } else { |
7736 | $r6 = self::$FAILED; |
7737 | if (!$silence) {$this->fail(47);} |
7738 | break; |
7739 | } |
7740 | } |
7741 | if ($r4!==self::$FAILED) { |
7742 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7743 | goto choice_1; |
7744 | } else { |
7745 | $r4 = self::$FAILED; |
7746 | } |
7747 | // free $r6 |
7748 | // free $p5 |
7749 | $p5 = $this->currPos; |
7750 | // start seq_1 |
7751 | $p7 = $this->currPos; |
7752 | $p8 = $this->currPos; |
7753 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7754 | if ($r6 === self::$FAILED) { |
7755 | $r6 = false; |
7756 | } else { |
7757 | $r6 = self::$FAILED; |
7758 | $this->currPos = $p8; |
7759 | $r4 = self::$FAILED; |
7760 | goto seq_1; |
7761 | } |
7762 | // free $p8 |
7763 | // start choice_2 |
7764 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7765 | if ($r9!==self::$FAILED) { |
7766 | goto choice_2; |
7767 | } |
7768 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
7769 | $r9 = $this->input[$this->currPos++]; |
7770 | } else { |
7771 | $r9 = self::$FAILED; |
7772 | if (!$silence) {$this->fail(45);} |
7773 | } |
7774 | choice_2: |
7775 | // s <- $r9 |
7776 | if ($r9===self::$FAILED) { |
7777 | $this->currPos = $p7; |
7778 | $r4 = self::$FAILED; |
7779 | goto seq_1; |
7780 | } |
7781 | $r4 = true; |
7782 | seq_1: |
7783 | if ($r4!==self::$FAILED) { |
7784 | $this->savedPos = $p5; |
7785 | $r4 = $this->a42($r9); |
7786 | } |
7787 | // free $p7 |
7788 | choice_1: |
7789 | if ($r4!==self::$FAILED) { |
7790 | $r3[] = $r4; |
7791 | } else { |
7792 | break; |
7793 | } |
7794 | } |
7795 | if (count($r3) === 0) { |
7796 | $r3 = self::$FAILED; |
7797 | } |
7798 | // r <- $r3 |
7799 | // free $r4 |
7800 | $r1 = $r3; |
7801 | if ($r1!==self::$FAILED) { |
7802 | $this->savedPos = $p2; |
7803 | $r1 = $this->a59($r3); |
7804 | } |
7805 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7806 | $this->currPos, |
7807 | $r1, |
7808 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7809 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7810 | ); |
7811 | return $r1; |
7812 | } |
7813 | private function parseless_than($silence, $boolParams) { |
7814 | $key = json_encode([464, $boolParams & 0x2]); |
7815 | $bucket = $this->currPos; |
7816 | $cached = $this->cache[$bucket][$key] ?? null; |
7817 | if ($cached) { |
7818 | $this->currPos = $cached->nextPos; |
7819 | |
7820 | return $cached->result; |
7821 | } |
7822 | |
7823 | $p1 = $this->currPos; |
7824 | // start seq_1 |
7825 | $p3 = $this->currPos; |
7826 | if (/*annOrExtTag*/($boolParams & 0x2) !== 0) { |
7827 | $r4 = false; |
7828 | } else { |
7829 | $r4 = self::$FAILED; |
7830 | $r2 = self::$FAILED; |
7831 | goto seq_1; |
7832 | } |
7833 | if (($this->input[$this->currPos] ?? null) === "<") { |
7834 | $this->currPos++; |
7835 | $r5 = "<"; |
7836 | } else { |
7837 | if (!$silence) {$this->fail(48);} |
7838 | $r5 = self::$FAILED; |
7839 | $this->currPos = $p3; |
7840 | $r2 = self::$FAILED; |
7841 | goto seq_1; |
7842 | } |
7843 | $r2 = true; |
7844 | seq_1: |
7845 | if ($r2!==self::$FAILED) { |
7846 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
7847 | } else { |
7848 | $r2 = self::$FAILED; |
7849 | } |
7850 | // free $p3 |
7851 | // free $p1 |
7852 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7853 | $this->currPos, |
7854 | $r2, |
7855 | self::$UNDEFINED, |
7856 | self::$UNDEFINED |
7857 | ); |
7858 | return $r2; |
7859 | } |
7860 | private function parseattribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
7861 | $key = json_encode([544, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7862 | $bucket = $this->currPos; |
7863 | $cached = $this->cache[$bucket][$key] ?? null; |
7864 | if ($cached) { |
7865 | $this->currPos = $cached->nextPos; |
7866 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7867 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7868 | return $cached->result; |
7869 | } |
7870 | $saved_preproc=$param_preproc; |
7871 | $saved_th=$param_th; |
7872 | $p2 = $this->currPos; |
7873 | $r3 = []; |
7874 | for (;;) { |
7875 | // start choice_1 |
7876 | $p5 = $this->currPos; |
7877 | $r4 = self::$FAILED; |
7878 | for (;;) { |
7879 | if (strcspn($this->input, "{}&<-|/'>", $this->currPos, 1) !== 0) { |
7880 | $r6 = self::consumeChar($this->input, $this->currPos); |
7881 | $r4 = true; |
7882 | } else { |
7883 | $r6 = self::$FAILED; |
7884 | if (!$silence) {$this->fail(49);} |
7885 | break; |
7886 | } |
7887 | } |
7888 | if ($r4!==self::$FAILED) { |
7889 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
7890 | goto choice_1; |
7891 | } else { |
7892 | $r4 = self::$FAILED; |
7893 | } |
7894 | // free $r6 |
7895 | // free $p5 |
7896 | $p5 = $this->currPos; |
7897 | // start seq_1 |
7898 | $p7 = $this->currPos; |
7899 | $p8 = $this->currPos; |
7900 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
7901 | if ($r6 === self::$FAILED) { |
7902 | $r6 = false; |
7903 | } else { |
7904 | $r6 = self::$FAILED; |
7905 | $this->currPos = $p8; |
7906 | $r4 = self::$FAILED; |
7907 | goto seq_1; |
7908 | } |
7909 | // free $p8 |
7910 | $p8 = $this->currPos; |
7911 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
7912 | $r9 = "/>"; |
7913 | $this->currPos += 2; |
7914 | } else { |
7915 | $r9 = self::$FAILED; |
7916 | } |
7917 | if ($r9 === self::$FAILED) { |
7918 | $r9 = false; |
7919 | } else { |
7920 | $r9 = self::$FAILED; |
7921 | $this->currPos = $p8; |
7922 | $this->currPos = $p7; |
7923 | $r4 = self::$FAILED; |
7924 | goto seq_1; |
7925 | } |
7926 | // free $p8 |
7927 | // start choice_2 |
7928 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
7929 | if ($r10!==self::$FAILED) { |
7930 | goto choice_2; |
7931 | } |
7932 | $r10 = $this->parseless_than($silence, $boolParams); |
7933 | if ($r10!==self::$FAILED) { |
7934 | goto choice_2; |
7935 | } |
7936 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
7937 | $r10 = $this->input[$this->currPos++]; |
7938 | } else { |
7939 | $r10 = self::$FAILED; |
7940 | if (!$silence) {$this->fail(50);} |
7941 | } |
7942 | choice_2: |
7943 | // s <- $r10 |
7944 | if ($r10===self::$FAILED) { |
7945 | $this->currPos = $p7; |
7946 | $r4 = self::$FAILED; |
7947 | goto seq_1; |
7948 | } |
7949 | $r4 = true; |
7950 | seq_1: |
7951 | if ($r4!==self::$FAILED) { |
7952 | $this->savedPos = $p5; |
7953 | $r4 = $this->a42($r10); |
7954 | } |
7955 | // free $p7 |
7956 | choice_1: |
7957 | if ($r4!==self::$FAILED) { |
7958 | $r3[] = $r4; |
7959 | } else { |
7960 | break; |
7961 | } |
7962 | } |
7963 | // r <- $r3 |
7964 | // free $r4 |
7965 | $r1 = $r3; |
7966 | if ($r1!==self::$FAILED) { |
7967 | $this->savedPos = $p2; |
7968 | $r1 = $this->a59($r3); |
7969 | } |
7970 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
7971 | $this->currPos, |
7972 | $r1, |
7973 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
7974 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
7975 | ); |
7976 | return $r1; |
7977 | } |
7978 | private function parseattribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
7979 | $key = json_encode([546, $boolParams & 0x7fff, $param_preproc, $param_th]); |
7980 | $bucket = $this->currPos; |
7981 | $cached = $this->cache[$bucket][$key] ?? null; |
7982 | if ($cached) { |
7983 | $this->currPos = $cached->nextPos; |
7984 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
7985 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
7986 | return $cached->result; |
7987 | } |
7988 | $saved_preproc=$param_preproc; |
7989 | $saved_th=$param_th; |
7990 | $p2 = $this->currPos; |
7991 | $r3 = []; |
7992 | for (;;) { |
7993 | // start choice_1 |
7994 | $p5 = $this->currPos; |
7995 | $r4 = self::$FAILED; |
7996 | for (;;) { |
7997 | if (strcspn($this->input, "{}&<-|/\">", $this->currPos, 1) !== 0) { |
7998 | $r6 = self::consumeChar($this->input, $this->currPos); |
7999 | $r4 = true; |
8000 | } else { |
8001 | $r6 = self::$FAILED; |
8002 | if (!$silence) {$this->fail(51);} |
8003 | break; |
8004 | } |
8005 | } |
8006 | if ($r4!==self::$FAILED) { |
8007 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
8008 | goto choice_1; |
8009 | } else { |
8010 | $r4 = self::$FAILED; |
8011 | } |
8012 | // free $r6 |
8013 | // free $p5 |
8014 | $p5 = $this->currPos; |
8015 | // start seq_1 |
8016 | $p7 = $this->currPos; |
8017 | $p8 = $this->currPos; |
8018 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
8019 | if ($r6 === self::$FAILED) { |
8020 | $r6 = false; |
8021 | } else { |
8022 | $r6 = self::$FAILED; |
8023 | $this->currPos = $p8; |
8024 | $r4 = self::$FAILED; |
8025 | goto seq_1; |
8026 | } |
8027 | // free $p8 |
8028 | $p8 = $this->currPos; |
8029 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
8030 | $r9 = "/>"; |
8031 | $this->currPos += 2; |
8032 | } else { |
8033 | $r9 = self::$FAILED; |
8034 | } |
8035 | if ($r9 === self::$FAILED) { |
8036 | $r9 = false; |
8037 | } else { |
8038 | $r9 = self::$FAILED; |
8039 | $this->currPos = $p8; |
8040 | $this->currPos = $p7; |
8041 | $r4 = self::$FAILED; |
8042 | goto seq_1; |
8043 | } |
8044 | // free $p8 |
8045 | // start choice_2 |
8046 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
8047 | if ($r10!==self::$FAILED) { |
8048 | goto choice_2; |
8049 | } |
8050 | $r10 = $this->parseless_than($silence, $boolParams); |
8051 | if ($r10!==self::$FAILED) { |
8052 | goto choice_2; |
8053 | } |
8054 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
8055 | $r10 = $this->input[$this->currPos++]; |
8056 | } else { |
8057 | $r10 = self::$FAILED; |
8058 | if (!$silence) {$this->fail(50);} |
8059 | } |
8060 | choice_2: |
8061 | // s <- $r10 |
8062 | if ($r10===self::$FAILED) { |
8063 | $this->currPos = $p7; |
8064 | $r4 = self::$FAILED; |
8065 | goto seq_1; |
8066 | } |
8067 | $r4 = true; |
8068 | seq_1: |
8069 | if ($r4!==self::$FAILED) { |
8070 | $this->savedPos = $p5; |
8071 | $r4 = $this->a42($r10); |
8072 | } |
8073 | // free $p7 |
8074 | choice_1: |
8075 | if ($r4!==self::$FAILED) { |
8076 | $r3[] = $r4; |
8077 | } else { |
8078 | break; |
8079 | } |
8080 | } |
8081 | // r <- $r3 |
8082 | // free $r4 |
8083 | $r1 = $r3; |
8084 | if ($r1!==self::$FAILED) { |
8085 | $this->savedPos = $p2; |
8086 | $r1 = $this->a59($r3); |
8087 | } |
8088 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8089 | $this->currPos, |
8090 | $r1, |
8091 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8092 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8093 | ); |
8094 | return $r1; |
8095 | } |
8096 | private function parseattribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
8097 | $key = json_encode([542, $boolParams & 0x7fff, $param_preproc, $param_th]); |
8098 | $bucket = $this->currPos; |
8099 | $cached = $this->cache[$bucket][$key] ?? null; |
8100 | if ($cached) { |
8101 | $this->currPos = $cached->nextPos; |
8102 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8103 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8104 | return $cached->result; |
8105 | } |
8106 | $saved_preproc=$param_preproc; |
8107 | $saved_th=$param_th; |
8108 | $p2 = $this->currPos; |
8109 | $r3 = []; |
8110 | for (;;) { |
8111 | // start choice_1 |
8112 | $p5 = $this->currPos; |
8113 | $r4 = self::$FAILED; |
8114 | for (;;) { |
8115 | if (strcspn($this->input, "{}&<-|/ \x09\x0a\x0d\x0c>", $this->currPos, 1) !== 0) { |
8116 | $r6 = self::consumeChar($this->input, $this->currPos); |
8117 | $r4 = true; |
8118 | } else { |
8119 | $r6 = self::$FAILED; |
8120 | if (!$silence) {$this->fail(52);} |
8121 | break; |
8122 | } |
8123 | } |
8124 | if ($r4!==self::$FAILED) { |
8125 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
8126 | goto choice_1; |
8127 | } else { |
8128 | $r4 = self::$FAILED; |
8129 | } |
8130 | // free $r6 |
8131 | // free $p5 |
8132 | $p5 = $this->currPos; |
8133 | // start seq_1 |
8134 | $p7 = $this->currPos; |
8135 | $p8 = $this->currPos; |
8136 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
8137 | if ($r6 === self::$FAILED) { |
8138 | $r6 = false; |
8139 | } else { |
8140 | $r6 = self::$FAILED; |
8141 | $this->currPos = $p8; |
8142 | $r4 = self::$FAILED; |
8143 | goto seq_1; |
8144 | } |
8145 | // free $p8 |
8146 | $p8 = $this->currPos; |
8147 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
8148 | $r9 = "/>"; |
8149 | $this->currPos += 2; |
8150 | } else { |
8151 | $r9 = self::$FAILED; |
8152 | } |
8153 | if ($r9 === self::$FAILED) { |
8154 | $r9 = false; |
8155 | } else { |
8156 | $r9 = self::$FAILED; |
8157 | $this->currPos = $p8; |
8158 | $this->currPos = $p7; |
8159 | $r4 = self::$FAILED; |
8160 | goto seq_1; |
8161 | } |
8162 | // free $p8 |
8163 | // start choice_2 |
8164 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
8165 | if ($r10!==self::$FAILED) { |
8166 | goto choice_2; |
8167 | } |
8168 | $r10 = $this->parseless_than($silence, $boolParams); |
8169 | if ($r10!==self::$FAILED) { |
8170 | goto choice_2; |
8171 | } |
8172 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
8173 | $r10 = $this->input[$this->currPos++]; |
8174 | } else { |
8175 | $r10 = self::$FAILED; |
8176 | if (!$silence) {$this->fail(50);} |
8177 | } |
8178 | choice_2: |
8179 | // s <- $r10 |
8180 | if ($r10===self::$FAILED) { |
8181 | $this->currPos = $p7; |
8182 | $r4 = self::$FAILED; |
8183 | goto seq_1; |
8184 | } |
8185 | $r4 = true; |
8186 | seq_1: |
8187 | if ($r4!==self::$FAILED) { |
8188 | $this->savedPos = $p5; |
8189 | $r4 = $this->a42($r10); |
8190 | } |
8191 | // free $p7 |
8192 | choice_1: |
8193 | if ($r4!==self::$FAILED) { |
8194 | $r3[] = $r4; |
8195 | } else { |
8196 | break; |
8197 | } |
8198 | } |
8199 | if (count($r3) === 0) { |
8200 | $r3 = self::$FAILED; |
8201 | } |
8202 | // r <- $r3 |
8203 | // free $r4 |
8204 | $r1 = $r3; |
8205 | if ($r1!==self::$FAILED) { |
8206 | $this->savedPos = $p2; |
8207 | $r1 = $this->a59($r3); |
8208 | } |
8209 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8210 | $this->currPos, |
8211 | $r1, |
8212 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8213 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8214 | ); |
8215 | return $r1; |
8216 | } |
8217 | private function parseautolink($silence, $boolParams, &$param_preproc, &$param_th) { |
8218 | $key = json_encode([342, $boolParams & 0x7fff, $param_preproc, $param_th]); |
8219 | $bucket = $this->currPos; |
8220 | $cached = $this->cache[$bucket][$key] ?? null; |
8221 | if ($cached) { |
8222 | $this->currPos = $cached->nextPos; |
8223 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8224 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8225 | return $cached->result; |
8226 | } |
8227 | $saved_preproc=$param_preproc; |
8228 | $saved_th=$param_th; |
8229 | $p2 = $this->currPos; |
8230 | // start seq_1 |
8231 | $p3 = $this->currPos; |
8232 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
8233 | $r4 = false; |
8234 | } else { |
8235 | $r4 = self::$FAILED; |
8236 | $r1 = self::$FAILED; |
8237 | goto seq_1; |
8238 | } |
8239 | $this->savedPos = $this->currPos; |
8240 | $r5 = $this->a79(); |
8241 | if (!$r5) { |
8242 | $r5 = false; |
8243 | } else { |
8244 | $r5 = self::$FAILED; |
8245 | $this->currPos = $p3; |
8246 | $r1 = self::$FAILED; |
8247 | goto seq_1; |
8248 | } |
8249 | // start choice_1 |
8250 | $r6 = $this->parseautourl($silence, $boolParams, $param_preproc, $param_th); |
8251 | if ($r6!==self::$FAILED) { |
8252 | goto choice_1; |
8253 | } |
8254 | $r6 = $this->parseautoref($silence); |
8255 | if ($r6!==self::$FAILED) { |
8256 | goto choice_1; |
8257 | } |
8258 | $r6 = $this->parseisbn($silence); |
8259 | choice_1: |
8260 | // r <- $r6 |
8261 | if ($r6===self::$FAILED) { |
8262 | $this->currPos = $p3; |
8263 | $r1 = self::$FAILED; |
8264 | goto seq_1; |
8265 | } |
8266 | $r1 = true; |
8267 | seq_1: |
8268 | if ($r1!==self::$FAILED) { |
8269 | $this->savedPos = $p2; |
8270 | $r1 = $this->a24($r6); |
8271 | } |
8272 | // free $p3 |
8273 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8274 | $this->currPos, |
8275 | $r1, |
8276 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8277 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8278 | ); |
8279 | return $r1; |
8280 | } |
8281 | private function parsebehavior_switch($silence) { |
8282 | $key = 338; |
8283 | $bucket = $this->currPos; |
8284 | $cached = $this->cache[$bucket][$key] ?? null; |
8285 | if ($cached) { |
8286 | $this->currPos = $cached->nextPos; |
8287 | |
8288 | return $cached->result; |
8289 | } |
8290 | |
8291 | $p2 = $this->currPos; |
8292 | $p4 = $this->currPos; |
8293 | // start seq_1 |
8294 | $p5 = $this->currPos; |
8295 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8296 | $r6 = "__"; |
8297 | $this->currPos += 2; |
8298 | } else { |
8299 | if (!$silence) {$this->fail(53);} |
8300 | $r6 = self::$FAILED; |
8301 | $r3 = self::$FAILED; |
8302 | goto seq_1; |
8303 | } |
8304 | $r7 = $this->discardbehavior_text($silence); |
8305 | if ($r7===self::$FAILED) { |
8306 | $this->currPos = $p5; |
8307 | $r3 = self::$FAILED; |
8308 | goto seq_1; |
8309 | } |
8310 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
8311 | $r8 = "__"; |
8312 | $this->currPos += 2; |
8313 | } else { |
8314 | if (!$silence) {$this->fail(53);} |
8315 | $r8 = self::$FAILED; |
8316 | $this->currPos = $p5; |
8317 | $r3 = self::$FAILED; |
8318 | goto seq_1; |
8319 | } |
8320 | $r3 = true; |
8321 | seq_1: |
8322 | // bs <- $r3 |
8323 | if ($r3!==self::$FAILED) { |
8324 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8325 | } else { |
8326 | $r3 = self::$FAILED; |
8327 | } |
8328 | // free $p5 |
8329 | // free $p4 |
8330 | $r1 = $r3; |
8331 | if ($r1!==self::$FAILED) { |
8332 | $this->savedPos = $p2; |
8333 | $r1 = $this->a80($r3); |
8334 | } |
8335 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8336 | $this->currPos, |
8337 | $r1, |
8338 | self::$UNDEFINED, |
8339 | self::$UNDEFINED |
8340 | ); |
8341 | return $r1; |
8342 | } |
8343 | private function parsetext_char($silence) { |
8344 | $key = 522; |
8345 | $bucket = $this->currPos; |
8346 | $cached = $this->cache[$bucket][$key] ?? null; |
8347 | if ($cached) { |
8348 | $this->currPos = $cached->nextPos; |
8349 | |
8350 | return $cached->result; |
8351 | } |
8352 | |
8353 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
8354 | $r1 = self::consumeChar($this->input, $this->currPos); |
8355 | } else { |
8356 | $r1 = self::$FAILED; |
8357 | if (!$silence) {$this->fail(54);} |
8358 | } |
8359 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8360 | $this->currPos, |
8361 | $r1, |
8362 | self::$UNDEFINED, |
8363 | self::$UNDEFINED |
8364 | ); |
8365 | return $r1; |
8366 | } |
8367 | private function parseangle_bracket_markup($silence, $boolParams, &$param_preproc, &$param_th) { |
8368 | $key = json_encode([332, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
8369 | $bucket = $this->currPos; |
8370 | $cached = $this->cache[$bucket][$key] ?? null; |
8371 | if ($cached) { |
8372 | $this->currPos = $cached->nextPos; |
8373 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8374 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8375 | return $cached->result; |
8376 | } |
8377 | $saved_preproc=$param_preproc; |
8378 | $saved_th=$param_th; |
8379 | // start choice_1 |
8380 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
8381 | if ($r1!==self::$FAILED) { |
8382 | goto choice_1; |
8383 | } |
8384 | $r1 = $this->parsemaybe_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
8385 | if ($r1!==self::$FAILED) { |
8386 | goto choice_1; |
8387 | } |
8388 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
8389 | if ($r1!==self::$FAILED) { |
8390 | goto choice_1; |
8391 | } |
8392 | $r1 = $this->parsehtml_tag($silence, $boolParams, $param_preproc, $param_th); |
8393 | if ($r1!==self::$FAILED) { |
8394 | goto choice_1; |
8395 | } |
8396 | $r1 = $this->parsecomment($silence); |
8397 | choice_1: |
8398 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8399 | $this->currPos, |
8400 | $r1, |
8401 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8402 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8403 | ); |
8404 | return $r1; |
8405 | } |
8406 | private function parselang_variant_or_tpl($silence, $boolParams, &$param_th, &$param_preproc) { |
8407 | $key = json_encode([390, $boolParams & 0x7fff, $param_th, $param_preproc]); |
8408 | $bucket = $this->currPos; |
8409 | $cached = $this->cache[$bucket][$key] ?? null; |
8410 | if ($cached) { |
8411 | $this->currPos = $cached->nextPos; |
8412 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8413 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8414 | return $cached->result; |
8415 | } |
8416 | $saved_th=$param_th; |
8417 | $saved_preproc=$param_preproc; |
8418 | // start choice_1 |
8419 | $p2 = $this->currPos; |
8420 | // start seq_1 |
8421 | $p3 = $this->currPos; |
8422 | $p4 = $this->currPos; |
8423 | // start seq_2 |
8424 | $p6 = $this->currPos; |
8425 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8426 | $r7 = "-{"; |
8427 | $this->currPos += 2; |
8428 | } else { |
8429 | $r7 = self::$FAILED; |
8430 | $r5 = self::$FAILED; |
8431 | goto seq_2; |
8432 | } |
8433 | $p8 = $this->currPos; |
8434 | // start seq_3 |
8435 | $p10 = $this->currPos; |
8436 | $r11 = self::$FAILED; |
8437 | for (;;) { |
8438 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8439 | $r12 = "{{{"; |
8440 | $this->currPos += 3; |
8441 | $r11 = true; |
8442 | } else { |
8443 | $r12 = self::$FAILED; |
8444 | break; |
8445 | } |
8446 | } |
8447 | if ($r11===self::$FAILED) { |
8448 | $r9 = self::$FAILED; |
8449 | goto seq_3; |
8450 | } |
8451 | // free $r12 |
8452 | $p13 = $this->currPos; |
8453 | if (($this->input[$this->currPos] ?? null) === "{") { |
8454 | $this->currPos++; |
8455 | $r12 = "{"; |
8456 | } else { |
8457 | $r12 = self::$FAILED; |
8458 | } |
8459 | if ($r12 === self::$FAILED) { |
8460 | $r12 = false; |
8461 | } else { |
8462 | $r12 = self::$FAILED; |
8463 | $this->currPos = $p13; |
8464 | $this->currPos = $p10; |
8465 | $r9 = self::$FAILED; |
8466 | goto seq_3; |
8467 | } |
8468 | // free $p13 |
8469 | $r9 = true; |
8470 | seq_3: |
8471 | if ($r9!==self::$FAILED) { |
8472 | $r9 = false; |
8473 | $this->currPos = $p8; |
8474 | } else { |
8475 | $this->currPos = $p6; |
8476 | $r5 = self::$FAILED; |
8477 | goto seq_2; |
8478 | } |
8479 | // free $p10 |
8480 | // free $p8 |
8481 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
8482 | if ($r14===self::$FAILED) { |
8483 | $this->currPos = $p6; |
8484 | $r5 = self::$FAILED; |
8485 | goto seq_2; |
8486 | } |
8487 | $r5 = true; |
8488 | seq_2: |
8489 | if ($r5!==self::$FAILED) { |
8490 | $r5 = false; |
8491 | $this->currPos = $p4; |
8492 | } else { |
8493 | $r1 = self::$FAILED; |
8494 | goto seq_1; |
8495 | } |
8496 | // free $p6 |
8497 | // free $p4 |
8498 | $r15 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8499 | // a <- $r15 |
8500 | if ($r15===self::$FAILED) { |
8501 | $this->currPos = $p3; |
8502 | $r1 = self::$FAILED; |
8503 | goto seq_1; |
8504 | } |
8505 | $r1 = true; |
8506 | seq_1: |
8507 | if ($r1!==self::$FAILED) { |
8508 | $this->savedPos = $p2; |
8509 | $r1 = $this->a50($r15); |
8510 | goto choice_1; |
8511 | } |
8512 | // free $p3 |
8513 | $p3 = $this->currPos; |
8514 | // start seq_4 |
8515 | $p4 = $this->currPos; |
8516 | $p6 = $this->currPos; |
8517 | // start seq_5 |
8518 | $p8 = $this->currPos; |
8519 | if (($this->input[$this->currPos] ?? null) === "-") { |
8520 | $this->currPos++; |
8521 | $r17 = "-"; |
8522 | } else { |
8523 | if (!$silence) {$this->fail(55);} |
8524 | $r17 = self::$FAILED; |
8525 | $r16 = self::$FAILED; |
8526 | goto seq_5; |
8527 | } |
8528 | $p10 = $this->currPos; |
8529 | // start seq_6 |
8530 | $p13 = $this->currPos; |
8531 | $r19 = self::$FAILED; |
8532 | for (;;) { |
8533 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8534 | $r20 = "{{{"; |
8535 | $this->currPos += 3; |
8536 | $r19 = true; |
8537 | } else { |
8538 | $r20 = self::$FAILED; |
8539 | break; |
8540 | } |
8541 | } |
8542 | if ($r19===self::$FAILED) { |
8543 | $r18 = self::$FAILED; |
8544 | goto seq_6; |
8545 | } |
8546 | // free $r20 |
8547 | $p21 = $this->currPos; |
8548 | if (($this->input[$this->currPos] ?? null) === "{") { |
8549 | $this->currPos++; |
8550 | $r20 = "{"; |
8551 | } else { |
8552 | $r20 = self::$FAILED; |
8553 | } |
8554 | if ($r20 === self::$FAILED) { |
8555 | $r20 = false; |
8556 | } else { |
8557 | $r20 = self::$FAILED; |
8558 | $this->currPos = $p21; |
8559 | $this->currPos = $p13; |
8560 | $r18 = self::$FAILED; |
8561 | goto seq_6; |
8562 | } |
8563 | // free $p21 |
8564 | $r18 = true; |
8565 | seq_6: |
8566 | if ($r18!==self::$FAILED) { |
8567 | $r18 = false; |
8568 | $this->currPos = $p10; |
8569 | } else { |
8570 | $this->currPos = $p8; |
8571 | $r16 = self::$FAILED; |
8572 | goto seq_5; |
8573 | } |
8574 | // free $p13 |
8575 | // free $p10 |
8576 | $r16 = true; |
8577 | seq_5: |
8578 | // a <- $r16 |
8579 | if ($r16!==self::$FAILED) { |
8580 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
8581 | } else { |
8582 | $r16 = self::$FAILED; |
8583 | $r1 = self::$FAILED; |
8584 | goto seq_4; |
8585 | } |
8586 | // free $p8 |
8587 | // free $p6 |
8588 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
8589 | // b <- $r22 |
8590 | if ($r22===self::$FAILED) { |
8591 | $this->currPos = $p4; |
8592 | $r1 = self::$FAILED; |
8593 | goto seq_4; |
8594 | } |
8595 | $r1 = true; |
8596 | seq_4: |
8597 | if ($r1!==self::$FAILED) { |
8598 | $this->savedPos = $p3; |
8599 | $r1 = $this->a51($r16, $r22); |
8600 | goto choice_1; |
8601 | } |
8602 | // free $p4 |
8603 | $p4 = $this->currPos; |
8604 | // start seq_7 |
8605 | $p6 = $this->currPos; |
8606 | $p8 = $this->currPos; |
8607 | // start seq_8 |
8608 | $p10 = $this->currPos; |
8609 | if (($this->input[$this->currPos] ?? null) === "-") { |
8610 | $this->currPos++; |
8611 | $r24 = "-"; |
8612 | } else { |
8613 | if (!$silence) {$this->fail(55);} |
8614 | $r24 = self::$FAILED; |
8615 | $r23 = self::$FAILED; |
8616 | goto seq_8; |
8617 | } |
8618 | $p13 = $this->currPos; |
8619 | // start seq_9 |
8620 | $p21 = $this->currPos; |
8621 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
8622 | $r26 = "{{"; |
8623 | $this->currPos += 2; |
8624 | } else { |
8625 | $r26 = self::$FAILED; |
8626 | $r25 = self::$FAILED; |
8627 | goto seq_9; |
8628 | } |
8629 | for (;;) { |
8630 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
8631 | $r28 = "{{{"; |
8632 | $this->currPos += 3; |
8633 | } else { |
8634 | $r28 = self::$FAILED; |
8635 | break; |
8636 | } |
8637 | } |
8638 | // free $r28 |
8639 | $r27 = true; |
8640 | if ($r27===self::$FAILED) { |
8641 | $this->currPos = $p21; |
8642 | $r25 = self::$FAILED; |
8643 | goto seq_9; |
8644 | } |
8645 | // free $r27 |
8646 | $p29 = $this->currPos; |
8647 | if (($this->input[$this->currPos] ?? null) === "{") { |
8648 | $this->currPos++; |
8649 | $r27 = "{"; |
8650 | } else { |
8651 | $r27 = self::$FAILED; |
8652 | } |
8653 | if ($r27 === self::$FAILED) { |
8654 | $r27 = false; |
8655 | } else { |
8656 | $r27 = self::$FAILED; |
8657 | $this->currPos = $p29; |
8658 | $this->currPos = $p21; |
8659 | $r25 = self::$FAILED; |
8660 | goto seq_9; |
8661 | } |
8662 | // free $p29 |
8663 | $r25 = true; |
8664 | seq_9: |
8665 | if ($r25!==self::$FAILED) { |
8666 | $r25 = false; |
8667 | $this->currPos = $p13; |
8668 | } else { |
8669 | $this->currPos = $p10; |
8670 | $r23 = self::$FAILED; |
8671 | goto seq_8; |
8672 | } |
8673 | // free $p21 |
8674 | // free $p13 |
8675 | $r23 = true; |
8676 | seq_8: |
8677 | // a <- $r23 |
8678 | if ($r23!==self::$FAILED) { |
8679 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
8680 | } else { |
8681 | $r23 = self::$FAILED; |
8682 | $r1 = self::$FAILED; |
8683 | goto seq_7; |
8684 | } |
8685 | // free $p10 |
8686 | // free $p8 |
8687 | $r28 = $this->parsetemplate($silence, $boolParams, $param_th); |
8688 | // b <- $r28 |
8689 | if ($r28===self::$FAILED) { |
8690 | $this->currPos = $p6; |
8691 | $r1 = self::$FAILED; |
8692 | goto seq_7; |
8693 | } |
8694 | $r1 = true; |
8695 | seq_7: |
8696 | if ($r1!==self::$FAILED) { |
8697 | $this->savedPos = $p4; |
8698 | $r1 = $this->a51($r23, $r28); |
8699 | goto choice_1; |
8700 | } |
8701 | // free $p6 |
8702 | $p6 = $this->currPos; |
8703 | // start seq_10 |
8704 | $p8 = $this->currPos; |
8705 | $p10 = $this->currPos; |
8706 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
8707 | $r30 = "-{"; |
8708 | $this->currPos += 2; |
8709 | $r30 = false; |
8710 | $this->currPos = $p10; |
8711 | } else { |
8712 | $r30 = self::$FAILED; |
8713 | $r1 = self::$FAILED; |
8714 | goto seq_10; |
8715 | } |
8716 | // free $p10 |
8717 | $r31 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
8718 | // a <- $r31 |
8719 | if ($r31===self::$FAILED) { |
8720 | $this->currPos = $p8; |
8721 | $r1 = self::$FAILED; |
8722 | goto seq_10; |
8723 | } |
8724 | $r1 = true; |
8725 | seq_10: |
8726 | if ($r1!==self::$FAILED) { |
8727 | $this->savedPos = $p6; |
8728 | $r1 = $this->a50($r31); |
8729 | } |
8730 | // free $p8 |
8731 | choice_1: |
8732 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8733 | $this->currPos, |
8734 | $r1, |
8735 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8736 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8737 | ); |
8738 | return $r1; |
8739 | } |
8740 | private function parsewikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
8741 | $key = json_encode([422, $boolParams & 0x7fff, $param_th, $param_preproc]); |
8742 | $bucket = $this->currPos; |
8743 | $cached = $this->cache[$bucket][$key] ?? null; |
8744 | if ($cached) { |
8745 | $this->currPos = $cached->nextPos; |
8746 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8747 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8748 | return $cached->result; |
8749 | } |
8750 | $saved_th=$param_th; |
8751 | $saved_preproc=$param_preproc; |
8752 | // start choice_1 |
8753 | $r1 = $this->parsewikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
8754 | if ($r1!==self::$FAILED) { |
8755 | goto choice_1; |
8756 | } |
8757 | $r1 = $this->parsebroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
8758 | choice_1: |
8759 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8760 | $this->currPos, |
8761 | $r1, |
8762 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8763 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8764 | ); |
8765 | return $r1; |
8766 | } |
8767 | private function parsequote($silence) { |
8768 | $key = 432; |
8769 | $bucket = $this->currPos; |
8770 | $cached = $this->cache[$bucket][$key] ?? null; |
8771 | if ($cached) { |
8772 | $this->currPos = $cached->nextPos; |
8773 | |
8774 | return $cached->result; |
8775 | } |
8776 | |
8777 | $p2 = $this->currPos; |
8778 | $p4 = $this->currPos; |
8779 | // start seq_1 |
8780 | $p5 = $this->currPos; |
8781 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "''", $this->currPos, 2, false) === 0) { |
8782 | $r6 = "''"; |
8783 | $this->currPos += 2; |
8784 | } else { |
8785 | if (!$silence) {$this->fail(56);} |
8786 | $r6 = self::$FAILED; |
8787 | $r3 = self::$FAILED; |
8788 | goto seq_1; |
8789 | } |
8790 | for (;;) { |
8791 | if (($this->input[$this->currPos] ?? null) === "'") { |
8792 | $this->currPos++; |
8793 | $r8 = "'"; |
8794 | } else { |
8795 | if (!$silence) {$this->fail(33);} |
8796 | $r8 = self::$FAILED; |
8797 | break; |
8798 | } |
8799 | } |
8800 | // free $r8 |
8801 | $r7 = true; |
8802 | if ($r7===self::$FAILED) { |
8803 | $this->currPos = $p5; |
8804 | $r3 = self::$FAILED; |
8805 | goto seq_1; |
8806 | } |
8807 | // free $r7 |
8808 | $r3 = true; |
8809 | seq_1: |
8810 | // quotes <- $r3 |
8811 | if ($r3!==self::$FAILED) { |
8812 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
8813 | } else { |
8814 | $r3 = self::$FAILED; |
8815 | } |
8816 | // free $p5 |
8817 | // free $p4 |
8818 | $r1 = $r3; |
8819 | if ($r1!==self::$FAILED) { |
8820 | $this->savedPos = $p2; |
8821 | $r1 = $this->a81($r3); |
8822 | } |
8823 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8824 | $this->currPos, |
8825 | $r1, |
8826 | self::$UNDEFINED, |
8827 | self::$UNDEFINED |
8828 | ); |
8829 | return $r1; |
8830 | } |
8831 | private function parseinlineline_break_on_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
8832 | $key = json_encode([488, $boolParams & 0x6fff, $param_preproc, $param_th]); |
8833 | $bucket = $this->currPos; |
8834 | $cached = $this->cache[$bucket][$key] ?? null; |
8835 | if ($cached) { |
8836 | $this->currPos = $cached->nextPos; |
8837 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8838 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8839 | return $cached->result; |
8840 | } |
8841 | $saved_preproc=$param_preproc; |
8842 | $saved_th=$param_th; |
8843 | $r1 = $this->parseinlineline($silence, $boolParams | 0x1000, $param_preproc, $param_th); |
8844 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8845 | $this->currPos, |
8846 | $r1, |
8847 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8848 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8849 | ); |
8850 | return $r1; |
8851 | } |
8852 | private function parsetable_content_line($silence, $boolParams, &$param_preproc, &$param_th) { |
8853 | $key = json_encode([496, $boolParams & 0x7fff, $param_preproc, $param_th]); |
8854 | $bucket = $this->currPos; |
8855 | $cached = $this->cache[$bucket][$key] ?? null; |
8856 | if ($cached) { |
8857 | $this->currPos = $cached->nextPos; |
8858 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
8859 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
8860 | return $cached->result; |
8861 | } |
8862 | $saved_preproc=$param_preproc; |
8863 | $saved_th=$param_th; |
8864 | // start seq_1 |
8865 | $p1 = $this->currPos; |
8866 | $r3 = []; |
8867 | for (;;) { |
8868 | // start choice_1 |
8869 | $r4 = $this->parsespace($silence); |
8870 | if ($r4!==self::$FAILED) { |
8871 | goto choice_1; |
8872 | } |
8873 | $r4 = $this->parsecomment($silence); |
8874 | choice_1: |
8875 | if ($r4!==self::$FAILED) { |
8876 | $r3[] = $r4; |
8877 | } else { |
8878 | break; |
8879 | } |
8880 | } |
8881 | // free $r4 |
8882 | // start choice_2 |
8883 | $r4 = $this->parsetable_heading_tags($silence, $boolParams, $param_preproc); |
8884 | if ($r4!==self::$FAILED) { |
8885 | goto choice_2; |
8886 | } |
8887 | $r4 = $this->parsetable_row_tag($silence, $boolParams, $param_preproc, $param_th); |
8888 | if ($r4!==self::$FAILED) { |
8889 | goto choice_2; |
8890 | } |
8891 | $r4 = $this->parsetable_data_tags($silence, $boolParams, $param_preproc, $param_th); |
8892 | if ($r4!==self::$FAILED) { |
8893 | goto choice_2; |
8894 | } |
8895 | $r4 = $this->parsetable_caption_tag($silence, $boolParams, $param_preproc, $param_th); |
8896 | choice_2: |
8897 | if ($r4===self::$FAILED) { |
8898 | $this->currPos = $p1; |
8899 | $r2 = self::$FAILED; |
8900 | goto seq_1; |
8901 | } |
8902 | $r2 = [$r3,$r4]; |
8903 | seq_1: |
8904 | // free $r2,$p1 |
8905 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8906 | $this->currPos, |
8907 | $r2, |
8908 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
8909 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
8910 | ); |
8911 | return $r2; |
8912 | } |
8913 | private function parsetable_end_tag($silence) { |
8914 | $key = 518; |
8915 | $bucket = $this->currPos; |
8916 | $cached = $this->cache[$bucket][$key] ?? null; |
8917 | if ($cached) { |
8918 | $this->currPos = $cached->nextPos; |
8919 | |
8920 | return $cached->result; |
8921 | } |
8922 | |
8923 | $p2 = $this->currPos; |
8924 | // start seq_1 |
8925 | $p3 = $this->currPos; |
8926 | $r4 = []; |
8927 | for (;;) { |
8928 | // start choice_1 |
8929 | $r5 = $this->parsespace($silence); |
8930 | if ($r5!==self::$FAILED) { |
8931 | goto choice_1; |
8932 | } |
8933 | $r5 = $this->parsecomment($silence); |
8934 | choice_1: |
8935 | if ($r5!==self::$FAILED) { |
8936 | $r4[] = $r5; |
8937 | } else { |
8938 | break; |
8939 | } |
8940 | } |
8941 | // sc <- $r4 |
8942 | // free $r5 |
8943 | $p6 = $this->currPos; |
8944 | $r5 = ''; |
8945 | // startPos <- $r5 |
8946 | if ($r5!==self::$FAILED) { |
8947 | $this->savedPos = $p6; |
8948 | $r5 = $this->a5($r4); |
8949 | } else { |
8950 | $this->currPos = $p3; |
8951 | $r1 = self::$FAILED; |
8952 | goto seq_1; |
8953 | } |
8954 | $r7 = $this->parsepipe($silence); |
8955 | // p <- $r7 |
8956 | if ($r7===self::$FAILED) { |
8957 | $this->currPos = $p3; |
8958 | $r1 = self::$FAILED; |
8959 | goto seq_1; |
8960 | } |
8961 | // b <- $r8 |
8962 | if (($this->input[$this->currPos] ?? null) === "}") { |
8963 | $this->currPos++; |
8964 | $r8 = "}"; |
8965 | } else { |
8966 | if (!$silence) {$this->fail(57);} |
8967 | $r8 = self::$FAILED; |
8968 | $this->currPos = $p3; |
8969 | $r1 = self::$FAILED; |
8970 | goto seq_1; |
8971 | } |
8972 | $r1 = true; |
8973 | seq_1: |
8974 | if ($r1!==self::$FAILED) { |
8975 | $this->savedPos = $p2; |
8976 | $r1 = $this->a82($r4, $r5, $r7, $r8); |
8977 | } |
8978 | // free $p3 |
8979 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
8980 | $this->currPos, |
8981 | $r1, |
8982 | self::$UNDEFINED, |
8983 | self::$UNDEFINED |
8984 | ); |
8985 | return $r1; |
8986 | } |
8987 | private function parsesol_prefix($silence) { |
8988 | $key = 592; |
8989 | $bucket = $this->currPos; |
8990 | $cached = $this->cache[$bucket][$key] ?? null; |
8991 | if ($cached) { |
8992 | $this->currPos = $cached->nextPos; |
8993 | |
8994 | return $cached->result; |
8995 | } |
8996 | |
8997 | // start choice_1 |
8998 | $r1 = $this->parsenewlineToken($silence); |
8999 | if ($r1!==self::$FAILED) { |
9000 | goto choice_1; |
9001 | } |
9002 | $p2 = $this->currPos; |
9003 | $this->savedPos = $this->currPos; |
9004 | $r1 = $this->a83(); |
9005 | if ($r1) { |
9006 | $r1 = false; |
9007 | $this->savedPos = $p2; |
9008 | $r1 = $this->a84(); |
9009 | } else { |
9010 | $r1 = self::$FAILED; |
9011 | } |
9012 | choice_1: |
9013 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9014 | $this->currPos, |
9015 | $r1, |
9016 | self::$UNDEFINED, |
9017 | self::$UNDEFINED |
9018 | ); |
9019 | return $r1; |
9020 | } |
9021 | private function parseempty_lines_with_comments($silence) { |
9022 | $key = 594; |
9023 | $bucket = $this->currPos; |
9024 | $cached = $this->cache[$bucket][$key] ?? null; |
9025 | if ($cached) { |
9026 | $this->currPos = $cached->nextPos; |
9027 | |
9028 | return $cached->result; |
9029 | } |
9030 | |
9031 | $p2 = $this->currPos; |
9032 | // start seq_1 |
9033 | $p3 = $this->currPos; |
9034 | $p5 = $this->currPos; |
9035 | $r4 = ''; |
9036 | // p <- $r4 |
9037 | if ($r4!==self::$FAILED) { |
9038 | $this->savedPos = $p5; |
9039 | $r4 = $this->a17(); |
9040 | } else { |
9041 | $r1 = self::$FAILED; |
9042 | goto seq_1; |
9043 | } |
9044 | $r6 = []; |
9045 | for (;;) { |
9046 | // start seq_2 |
9047 | $p8 = $this->currPos; |
9048 | $r9 = []; |
9049 | for (;;) { |
9050 | $r10 = $this->parsespace($silence); |
9051 | if ($r10!==self::$FAILED) { |
9052 | $r9[] = $r10; |
9053 | } else { |
9054 | break; |
9055 | } |
9056 | } |
9057 | // free $r10 |
9058 | $r10 = $this->parsecomment($silence); |
9059 | if ($r10===self::$FAILED) { |
9060 | $this->currPos = $p8; |
9061 | $r7 = self::$FAILED; |
9062 | goto seq_2; |
9063 | } |
9064 | $r11 = []; |
9065 | for (;;) { |
9066 | // start choice_1 |
9067 | $r12 = $this->parsespace($silence); |
9068 | if ($r12!==self::$FAILED) { |
9069 | goto choice_1; |
9070 | } |
9071 | $r12 = $this->parsecomment($silence); |
9072 | choice_1: |
9073 | if ($r12!==self::$FAILED) { |
9074 | $r11[] = $r12; |
9075 | } else { |
9076 | break; |
9077 | } |
9078 | } |
9079 | // free $r12 |
9080 | $r12 = $this->parsenewline($silence); |
9081 | if ($r12===self::$FAILED) { |
9082 | $this->currPos = $p8; |
9083 | $r7 = self::$FAILED; |
9084 | goto seq_2; |
9085 | } |
9086 | $r7 = [$r9,$r10,$r11,$r12]; |
9087 | seq_2: |
9088 | if ($r7!==self::$FAILED) { |
9089 | $r6[] = $r7; |
9090 | } else { |
9091 | break; |
9092 | } |
9093 | // free $p8 |
9094 | } |
9095 | if (count($r6) === 0) { |
9096 | $r6 = self::$FAILED; |
9097 | } |
9098 | // c <- $r6 |
9099 | if ($r6===self::$FAILED) { |
9100 | $this->currPos = $p3; |
9101 | $r1 = self::$FAILED; |
9102 | goto seq_1; |
9103 | } |
9104 | // free $r7 |
9105 | $r1 = true; |
9106 | seq_1: |
9107 | if ($r1!==self::$FAILED) { |
9108 | $this->savedPos = $p2; |
9109 | $r1 = $this->a85($r4, $r6); |
9110 | } |
9111 | // free $p3 |
9112 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9113 | $this->currPos, |
9114 | $r1, |
9115 | self::$UNDEFINED, |
9116 | self::$UNDEFINED |
9117 | ); |
9118 | return $r1; |
9119 | } |
9120 | private function parseredirect_word($silence) { |
9121 | $key = 310; |
9122 | $bucket = $this->currPos; |
9123 | $cached = $this->cache[$bucket][$key] ?? null; |
9124 | if ($cached) { |
9125 | $this->currPos = $cached->nextPos; |
9126 | |
9127 | return $cached->result; |
9128 | } |
9129 | |
9130 | $p1 = $this->currPos; |
9131 | // start seq_1 |
9132 | $p3 = $this->currPos; |
9133 | for (;;) { |
9134 | if (strspn($this->input, " \x09\x0a\x0d\x00\x0b", $this->currPos, 1) !== 0) { |
9135 | $r5 = $this->input[$this->currPos++]; |
9136 | } else { |
9137 | $r5 = self::$FAILED; |
9138 | if (!$silence) {$this->fail(58);} |
9139 | break; |
9140 | } |
9141 | } |
9142 | // free $r5 |
9143 | $r4 = true; |
9144 | if ($r4===self::$FAILED) { |
9145 | $r2 = self::$FAILED; |
9146 | goto seq_1; |
9147 | } |
9148 | // free $r4 |
9149 | $p6 = $this->currPos; |
9150 | $r4 = self::$FAILED; |
9151 | for (;;) { |
9152 | // start seq_2 |
9153 | $p7 = $this->currPos; |
9154 | $p8 = $this->currPos; |
9155 | $r9 = $this->discardspace_or_newline(true); |
9156 | if ($r9 === self::$FAILED) { |
9157 | $r9 = false; |
9158 | } else { |
9159 | $r9 = self::$FAILED; |
9160 | $this->currPos = $p8; |
9161 | $r5 = self::$FAILED; |
9162 | goto seq_2; |
9163 | } |
9164 | // free $p8 |
9165 | $p8 = $this->currPos; |
9166 | $r10 = $this->input[$this->currPos] ?? ''; |
9167 | if ($r10 === ":" || $r10 === "[") { |
9168 | $this->currPos++; |
9169 | } else { |
9170 | $r10 = self::$FAILED; |
9171 | } |
9172 | if ($r10 === self::$FAILED) { |
9173 | $r10 = false; |
9174 | } else { |
9175 | $r10 = self::$FAILED; |
9176 | $this->currPos = $p8; |
9177 | $this->currPos = $p7; |
9178 | $r5 = self::$FAILED; |
9179 | goto seq_2; |
9180 | } |
9181 | // free $p8 |
9182 | if ($this->currPos < $this->inputLength) { |
9183 | $r11 = self::consumeChar($this->input, $this->currPos);; |
9184 | } else { |
9185 | $r11 = self::$FAILED; |
9186 | if (!$silence) {$this->fail(7);} |
9187 | $this->currPos = $p7; |
9188 | $r5 = self::$FAILED; |
9189 | goto seq_2; |
9190 | } |
9191 | $r5 = true; |
9192 | seq_2: |
9193 | if ($r5!==self::$FAILED) { |
9194 | $r4 = true; |
9195 | } else { |
9196 | break; |
9197 | } |
9198 | // free $p7 |
9199 | } |
9200 | // rw <- $r4 |
9201 | if ($r4!==self::$FAILED) { |
9202 | $r4 = substr($this->input, $p6, $this->currPos - $p6); |
9203 | } else { |
9204 | $r4 = self::$FAILED; |
9205 | $this->currPos = $p3; |
9206 | $r2 = self::$FAILED; |
9207 | goto seq_1; |
9208 | } |
9209 | // free $r5 |
9210 | // free $p6 |
9211 | $this->savedPos = $this->currPos; |
9212 | $r5 = $this->a86($r4); |
9213 | if ($r5) { |
9214 | $r5 = false; |
9215 | } else { |
9216 | $r5 = self::$FAILED; |
9217 | $this->currPos = $p3; |
9218 | $r2 = self::$FAILED; |
9219 | goto seq_1; |
9220 | } |
9221 | $r2 = true; |
9222 | seq_1: |
9223 | if ($r2!==self::$FAILED) { |
9224 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
9225 | } else { |
9226 | $r2 = self::$FAILED; |
9227 | } |
9228 | // free $p3 |
9229 | // free $p1 |
9230 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9231 | $this->currPos, |
9232 | $r2, |
9233 | self::$UNDEFINED, |
9234 | self::$UNDEFINED |
9235 | ); |
9236 | return $r2; |
9237 | } |
9238 | private function parseinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) { |
9239 | $key = json_encode([532, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
9240 | $bucket = $this->currPos; |
9241 | $cached = $this->cache[$bucket][$key] ?? null; |
9242 | if ($cached) { |
9243 | $this->currPos = $cached->nextPos; |
9244 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9245 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9246 | return $cached->result; |
9247 | } |
9248 | $saved_preproc=$param_preproc; |
9249 | $saved_th=$param_th; |
9250 | $p2 = $this->currPos; |
9251 | // start seq_1 |
9252 | $p3 = $this->currPos; |
9253 | $p4 = $this->currPos; |
9254 | $r5 = $this->discardinclude_check(true, $boolParams); |
9255 | if ($r5!==self::$FAILED) { |
9256 | $r5 = false; |
9257 | $this->currPos = $p4; |
9258 | } else { |
9259 | $r1 = self::$FAILED; |
9260 | goto seq_1; |
9261 | } |
9262 | // free $p4 |
9263 | $r6 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
9264 | // t <- $r6 |
9265 | if ($r6===self::$FAILED) { |
9266 | $this->currPos = $p3; |
9267 | $r1 = self::$FAILED; |
9268 | goto seq_1; |
9269 | } |
9270 | $r1 = true; |
9271 | seq_1: |
9272 | if ($r1!==self::$FAILED) { |
9273 | $this->savedPos = $p2; |
9274 | $r1 = $this->a87($r6); |
9275 | } |
9276 | // free $p3 |
9277 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9278 | $this->currPos, |
9279 | $r1, |
9280 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9281 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9282 | ); |
9283 | return $r1; |
9284 | } |
9285 | private function parseannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
9286 | $key = json_encode([438, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
9287 | $bucket = $this->currPos; |
9288 | $cached = $this->cache[$bucket][$key] ?? null; |
9289 | if ($cached) { |
9290 | $this->currPos = $cached->nextPos; |
9291 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9292 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9293 | return $cached->result; |
9294 | } |
9295 | $saved_preproc=$param_preproc; |
9296 | $saved_th=$param_th; |
9297 | $p2 = $this->currPos; |
9298 | // start choice_1 |
9299 | $r3 = $this->parsetvar_old_syntax_closing_HACK($silence, $boolParams); |
9300 | if ($r3!==self::$FAILED) { |
9301 | goto choice_1; |
9302 | } |
9303 | $p4 = $this->currPos; |
9304 | // start seq_1 |
9305 | $p5 = $this->currPos; |
9306 | $p6 = $this->currPos; |
9307 | $r7 = $this->discardannotation_check(true, $boolParams); |
9308 | if ($r7!==self::$FAILED) { |
9309 | $r7 = false; |
9310 | $this->currPos = $p6; |
9311 | } else { |
9312 | $r3 = self::$FAILED; |
9313 | goto seq_1; |
9314 | } |
9315 | // free $p6 |
9316 | $r8 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
9317 | // t <- $r8 |
9318 | if ($r8===self::$FAILED) { |
9319 | $this->currPos = $p5; |
9320 | $r3 = self::$FAILED; |
9321 | goto seq_1; |
9322 | } |
9323 | $r3 = true; |
9324 | seq_1: |
9325 | if ($r3!==self::$FAILED) { |
9326 | $this->savedPos = $p4; |
9327 | $r3 = $this->a88($r8); |
9328 | } |
9329 | // free $p5 |
9330 | choice_1: |
9331 | // tag <- $r3 |
9332 | $r1 = $r3; |
9333 | if ($r1!==self::$FAILED) { |
9334 | $this->savedPos = $p2; |
9335 | $r1 = $this->a89($r3); |
9336 | } |
9337 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9338 | $this->currPos, |
9339 | $r1, |
9340 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9341 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9342 | ); |
9343 | return $r1; |
9344 | } |
9345 | private function parseheading($silence, $boolParams, &$param_preproc, &$param_th) { |
9346 | $key = json_encode([336, $boolParams & 0x7fff, $param_preproc, $param_th]); |
9347 | $bucket = $this->currPos; |
9348 | $cached = $this->cache[$bucket][$key] ?? null; |
9349 | if ($cached) { |
9350 | $this->currPos = $cached->nextPos; |
9351 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9352 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9353 | return $cached->result; |
9354 | } |
9355 | $saved_preproc=$param_preproc; |
9356 | $saved_th=$param_th; |
9357 | $p2 = $this->currPos; |
9358 | // start seq_1 |
9359 | $p3 = $this->currPos; |
9360 | $p4 = $this->currPos; |
9361 | if (($this->input[$this->currPos] ?? null) === "=") { |
9362 | $this->currPos++; |
9363 | $r5 = "="; |
9364 | $r5 = false; |
9365 | $this->currPos = $p4; |
9366 | } else { |
9367 | $r5 = self::$FAILED; |
9368 | $r1 = self::$FAILED; |
9369 | goto seq_1; |
9370 | } |
9371 | // free $p4 |
9372 | $p4 = $this->currPos; |
9373 | // start seq_2 |
9374 | $p7 = $this->currPos; |
9375 | $p9 = $this->currPos; |
9376 | $r8 = self::$FAILED; |
9377 | for (;;) { |
9378 | if (($this->input[$this->currPos] ?? null) === "=") { |
9379 | $this->currPos++; |
9380 | $r10 = "="; |
9381 | $r8 = true; |
9382 | } else { |
9383 | if (!$silence) {$this->fail(23);} |
9384 | $r10 = self::$FAILED; |
9385 | break; |
9386 | } |
9387 | } |
9388 | // s <- $r8 |
9389 | if ($r8!==self::$FAILED) { |
9390 | $r8 = substr($this->input, $p9, $this->currPos - $p9); |
9391 | } else { |
9392 | $r8 = self::$FAILED; |
9393 | $r6 = self::$FAILED; |
9394 | goto seq_2; |
9395 | } |
9396 | // free $r10 |
9397 | // free $p9 |
9398 | // start seq_3 |
9399 | $p9 = $this->currPos; |
9400 | $p12 = $this->currPos; |
9401 | $r13 = $this->parseinlineline($silence, $boolParams | 0x4, $param_preproc, $param_th); |
9402 | if ($r13===self::$FAILED) { |
9403 | $r13 = null; |
9404 | } |
9405 | // ill <- $r13 |
9406 | $r11 = $r13; |
9407 | if ($r11!==self::$FAILED) { |
9408 | $this->savedPos = $p12; |
9409 | $r11 = $this->a90($r8, $r13); |
9410 | } else { |
9411 | $r10 = self::$FAILED; |
9412 | goto seq_3; |
9413 | } |
9414 | $p14 = $this->currPos; |
9415 | $r15 = self::$FAILED; |
9416 | for (;;) { |
9417 | if (($this->input[$this->currPos] ?? null) === "=") { |
9418 | $this->currPos++; |
9419 | $r16 = "="; |
9420 | $r15 = true; |
9421 | } else { |
9422 | if (!$silence) {$this->fail(23);} |
9423 | $r16 = self::$FAILED; |
9424 | break; |
9425 | } |
9426 | } |
9427 | if ($r15!==self::$FAILED) { |
9428 | $r15 = substr($this->input, $p14, $this->currPos - $p14); |
9429 | } else { |
9430 | $r15 = self::$FAILED; |
9431 | $this->currPos = $p9; |
9432 | $r10 = self::$FAILED; |
9433 | goto seq_3; |
9434 | } |
9435 | // free $r16 |
9436 | // free $p14 |
9437 | $r10 = [$r11,$r15]; |
9438 | seq_3: |
9439 | if ($r10===self::$FAILED) { |
9440 | $r10 = null; |
9441 | } |
9442 | // free $p9 |
9443 | // ce <- $r10 |
9444 | $this->savedPos = $this->currPos; |
9445 | $r16 = $this->a91($r8, $r10); |
9446 | if ($r16) { |
9447 | $r16 = false; |
9448 | } else { |
9449 | $r16 = self::$FAILED; |
9450 | $this->currPos = $p7; |
9451 | $r6 = self::$FAILED; |
9452 | goto seq_2; |
9453 | } |
9454 | $p9 = $this->currPos; |
9455 | $r17 = ''; |
9456 | // endTPos <- $r17 |
9457 | if ($r17!==self::$FAILED) { |
9458 | $this->savedPos = $p9; |
9459 | $r17 = $this->a92($r8, $r10); |
9460 | } else { |
9461 | $this->currPos = $p7; |
9462 | $r6 = self::$FAILED; |
9463 | goto seq_2; |
9464 | } |
9465 | $r18 = []; |
9466 | for (;;) { |
9467 | // start choice_1 |
9468 | $r19 = $this->parsespace($silence); |
9469 | if ($r19!==self::$FAILED) { |
9470 | goto choice_1; |
9471 | } |
9472 | $r19 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
9473 | choice_1: |
9474 | if ($r19!==self::$FAILED) { |
9475 | $r18[] = $r19; |
9476 | } else { |
9477 | break; |
9478 | } |
9479 | } |
9480 | // spc <- $r18 |
9481 | // free $r19 |
9482 | $p14 = $this->currPos; |
9483 | $r19 = $this->discardeolf(true); |
9484 | if ($r19!==self::$FAILED) { |
9485 | $r19 = false; |
9486 | $this->currPos = $p14; |
9487 | } else { |
9488 | $this->currPos = $p7; |
9489 | $r6 = self::$FAILED; |
9490 | goto seq_2; |
9491 | } |
9492 | // free $p14 |
9493 | $r6 = true; |
9494 | seq_2: |
9495 | // r <- $r6 |
9496 | if ($r6!==self::$FAILED) { |
9497 | $this->savedPos = $p4; |
9498 | $r6 = $this->a93($r8, $r10, $r17, $r18); |
9499 | } else { |
9500 | $this->currPos = $p3; |
9501 | $r1 = self::$FAILED; |
9502 | goto seq_1; |
9503 | } |
9504 | // free $p7 |
9505 | $r1 = true; |
9506 | seq_1: |
9507 | if ($r1!==self::$FAILED) { |
9508 | $this->savedPos = $p2; |
9509 | $r1 = $this->a24($r6); |
9510 | } |
9511 | // free $p3 |
9512 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9513 | $this->currPos, |
9514 | $r1, |
9515 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9516 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9517 | ); |
9518 | return $r1; |
9519 | } |
9520 | private function parsehr($silence, $boolParams, &$param_preproc, &$param_th) { |
9521 | $key = json_encode([320, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
9522 | $bucket = $this->currPos; |
9523 | $cached = $this->cache[$bucket][$key] ?? null; |
9524 | if ($cached) { |
9525 | $this->currPos = $cached->nextPos; |
9526 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9527 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9528 | return $cached->result; |
9529 | } |
9530 | $saved_preproc=$param_preproc; |
9531 | $saved_th=$param_th; |
9532 | $p2 = $this->currPos; |
9533 | // start seq_1 |
9534 | $p3 = $this->currPos; |
9535 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "----", $this->currPos, 4, false) === 0) { |
9536 | $r4 = "----"; |
9537 | $this->currPos += 4; |
9538 | } else { |
9539 | if (!$silence) {$this->fail(59);} |
9540 | $r4 = self::$FAILED; |
9541 | $r1 = self::$FAILED; |
9542 | goto seq_1; |
9543 | } |
9544 | $p6 = $this->currPos; |
9545 | for (;;) { |
9546 | if (($this->input[$this->currPos] ?? null) === "-") { |
9547 | $this->currPos++; |
9548 | $r7 = "-"; |
9549 | } else { |
9550 | if (!$silence) {$this->fail(55);} |
9551 | $r7 = self::$FAILED; |
9552 | break; |
9553 | } |
9554 | } |
9555 | // free $r7 |
9556 | $r5 = true; |
9557 | // d <- $r5 |
9558 | if ($r5!==self::$FAILED) { |
9559 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9560 | } else { |
9561 | $r5 = self::$FAILED; |
9562 | $this->currPos = $p3; |
9563 | $r1 = self::$FAILED; |
9564 | goto seq_1; |
9565 | } |
9566 | // free $p6 |
9567 | // start choice_1 |
9568 | $p6 = $this->currPos; |
9569 | // start seq_2 |
9570 | $p8 = $this->currPos; |
9571 | $p9 = $this->currPos; |
9572 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
9573 | if ($r10!==self::$FAILED) { |
9574 | $r10 = false; |
9575 | $this->currPos = $p9; |
9576 | } else { |
9577 | $r7 = self::$FAILED; |
9578 | goto seq_2; |
9579 | } |
9580 | // free $p9 |
9581 | $r7 = true; |
9582 | seq_2: |
9583 | if ($r7!==self::$FAILED) { |
9584 | $this->savedPos = $p6; |
9585 | $r7 = $this->a94($r5); |
9586 | goto choice_1; |
9587 | } |
9588 | // free $p8 |
9589 | $p8 = $this->currPos; |
9590 | $r7 = ''; |
9591 | if ($r7!==self::$FAILED) { |
9592 | $this->savedPos = $p8; |
9593 | $r7 = $this->a95($r5); |
9594 | } |
9595 | choice_1: |
9596 | // lineContent <- $r7 |
9597 | if ($r7===self::$FAILED) { |
9598 | $this->currPos = $p3; |
9599 | $r1 = self::$FAILED; |
9600 | goto seq_1; |
9601 | } |
9602 | $r1 = true; |
9603 | seq_1: |
9604 | if ($r1!==self::$FAILED) { |
9605 | $this->savedPos = $p2; |
9606 | $r1 = $this->a96($r5, $r7); |
9607 | } |
9608 | // free $p3 |
9609 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9610 | $this->currPos, |
9611 | $r1, |
9612 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9613 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9614 | ); |
9615 | return $r1; |
9616 | } |
9617 | private function discardtplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9618 | $key = json_encode([381, $boolParams & 0x7fff, $param_preproc, $param_th]); |
9619 | $bucket = $this->currPos; |
9620 | $cached = $this->cache[$bucket][$key] ?? null; |
9621 | if ($cached) { |
9622 | $this->currPos = $cached->nextPos; |
9623 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9624 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9625 | return $cached->result; |
9626 | } |
9627 | $saved_preproc=$param_preproc; |
9628 | $saved_th=$param_th; |
9629 | $p2 = $this->currPos; |
9630 | // start seq_1 |
9631 | $p3 = $this->currPos; |
9632 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
9633 | $r4 = "{{{"; |
9634 | $this->currPos += 3; |
9635 | } else { |
9636 | if (!$silence) {$this->fail(60);} |
9637 | $r4 = self::$FAILED; |
9638 | $r1 = self::$FAILED; |
9639 | goto seq_1; |
9640 | } |
9641 | $p6 = $this->currPos; |
9642 | $r5 = ''; |
9643 | // p <- $r5 |
9644 | if ($r5!==self::$FAILED) { |
9645 | $this->savedPos = $p6; |
9646 | $r5 = $this->a17(); |
9647 | } else { |
9648 | $this->currPos = $p3; |
9649 | $r1 = self::$FAILED; |
9650 | goto seq_1; |
9651 | } |
9652 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9653 | if ($r7===self::$FAILED) { |
9654 | $r7 = null; |
9655 | } |
9656 | // target <- $r7 |
9657 | $r8 = []; |
9658 | for (;;) { |
9659 | $p10 = $this->currPos; |
9660 | // start seq_2 |
9661 | $p11 = $this->currPos; |
9662 | for (;;) { |
9663 | $r13 = $this->discardnl_comment_space($silence); |
9664 | if ($r13===self::$FAILED) { |
9665 | break; |
9666 | } |
9667 | } |
9668 | // free $r13 |
9669 | $r12 = true; |
9670 | if ($r12===self::$FAILED) { |
9671 | $r9 = self::$FAILED; |
9672 | goto seq_2; |
9673 | } |
9674 | // free $r12 |
9675 | if (($this->input[$this->currPos] ?? null) === "|") { |
9676 | $this->currPos++; |
9677 | $r12 = "|"; |
9678 | } else { |
9679 | if (!$silence) {$this->fail(13);} |
9680 | $r12 = self::$FAILED; |
9681 | $this->currPos = $p11; |
9682 | $r9 = self::$FAILED; |
9683 | goto seq_2; |
9684 | } |
9685 | // start choice_1 |
9686 | $p14 = $this->currPos; |
9687 | // start seq_3 |
9688 | $p15 = $this->currPos; |
9689 | $p17 = $this->currPos; |
9690 | $r16 = ''; |
9691 | // p0 <- $r16 |
9692 | if ($r16!==self::$FAILED) { |
9693 | $this->savedPos = $p17; |
9694 | $r16 = $this->a97($r5, $r7); |
9695 | } else { |
9696 | $r13 = self::$FAILED; |
9697 | goto seq_3; |
9698 | } |
9699 | $r18 = []; |
9700 | for (;;) { |
9701 | $r19 = $this->parsenl_comment_space($silence); |
9702 | if ($r19!==self::$FAILED) { |
9703 | $r18[] = $r19; |
9704 | } else { |
9705 | break; |
9706 | } |
9707 | } |
9708 | // v <- $r18 |
9709 | // free $r19 |
9710 | $p20 = $this->currPos; |
9711 | $r19 = ''; |
9712 | // p1 <- $r19 |
9713 | if ($r19!==self::$FAILED) { |
9714 | $this->savedPos = $p20; |
9715 | $r19 = $this->a98($r5, $r7, $r16, $r18); |
9716 | } else { |
9717 | $this->currPos = $p15; |
9718 | $r13 = self::$FAILED; |
9719 | goto seq_3; |
9720 | } |
9721 | $p21 = $this->currPos; |
9722 | // start choice_2 |
9723 | if (($this->input[$this->currPos] ?? null) === "|") { |
9724 | $this->currPos++; |
9725 | $r22 = "|"; |
9726 | goto choice_2; |
9727 | } else { |
9728 | $r22 = self::$FAILED; |
9729 | } |
9730 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9731 | $r22 = "}}}"; |
9732 | $this->currPos += 3; |
9733 | } else { |
9734 | $r22 = self::$FAILED; |
9735 | } |
9736 | choice_2: |
9737 | if ($r22!==self::$FAILED) { |
9738 | $r22 = false; |
9739 | $this->currPos = $p21; |
9740 | } else { |
9741 | $this->currPos = $p15; |
9742 | $r13 = self::$FAILED; |
9743 | goto seq_3; |
9744 | } |
9745 | // free $p21 |
9746 | $r13 = true; |
9747 | seq_3: |
9748 | if ($r13!==self::$FAILED) { |
9749 | $this->savedPos = $p14; |
9750 | $r13 = $this->a99($r5, $r7, $r16, $r18, $r19); |
9751 | goto choice_1; |
9752 | } |
9753 | // free $p15 |
9754 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9755 | choice_1: |
9756 | // r <- $r13 |
9757 | if ($r13===self::$FAILED) { |
9758 | $this->currPos = $p11; |
9759 | $r9 = self::$FAILED; |
9760 | goto seq_2; |
9761 | } |
9762 | $r9 = true; |
9763 | seq_2: |
9764 | if ($r9!==self::$FAILED) { |
9765 | $this->savedPos = $p10; |
9766 | $r9 = $this->a100($r5, $r7, $r13); |
9767 | $r8[] = $r9; |
9768 | } else { |
9769 | break; |
9770 | } |
9771 | // free $p11 |
9772 | } |
9773 | // params <- $r8 |
9774 | // free $r9 |
9775 | for (;;) { |
9776 | $r23 = $this->discardnl_comment_space($silence); |
9777 | if ($r23===self::$FAILED) { |
9778 | break; |
9779 | } |
9780 | } |
9781 | // free $r23 |
9782 | $r9 = true; |
9783 | if ($r9===self::$FAILED) { |
9784 | $this->currPos = $p3; |
9785 | $r1 = self::$FAILED; |
9786 | goto seq_1; |
9787 | } |
9788 | // free $r9 |
9789 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
9790 | if ($r9===self::$FAILED) { |
9791 | $this->currPos = $p3; |
9792 | $r1 = self::$FAILED; |
9793 | goto seq_1; |
9794 | } |
9795 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
9796 | $r23 = "}}}"; |
9797 | $this->currPos += 3; |
9798 | } else { |
9799 | if (!$silence) {$this->fail(61);} |
9800 | $r23 = self::$FAILED; |
9801 | $this->currPos = $p3; |
9802 | $r1 = self::$FAILED; |
9803 | goto seq_1; |
9804 | } |
9805 | $r1 = true; |
9806 | seq_1: |
9807 | if ($r1!==self::$FAILED) { |
9808 | $this->savedPos = $p2; |
9809 | $r1 = $this->a101($r5, $r7, $r8); |
9810 | } |
9811 | // free $p3 |
9812 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
9813 | $this->currPos, |
9814 | $r1, |
9815 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
9816 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
9817 | ); |
9818 | return $r1; |
9819 | } |
9820 | private function parsetemplate_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
9821 | $key = json_encode([374, $boolParams & 0x7fff, $param_preproc, $param_th]); |
9822 | $bucket = $this->currPos; |
9823 | $cached = $this->cache[$bucket][$key] ?? null; |
9824 | if ($cached) { |
9825 | $this->currPos = $cached->nextPos; |
9826 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
9827 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
9828 | return $cached->result; |
9829 | } |
9830 | $saved_preproc=$param_preproc; |
9831 | $saved_th=$param_th; |
9832 | // start choice_1 |
9833 | $p2 = $this->currPos; |
9834 | // start seq_1 |
9835 | $p3 = $this->currPos; |
9836 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
9837 | $r4 = "{{"; |
9838 | $this->currPos += 2; |
9839 | } else { |
9840 | if (!$silence) {$this->fail(43);} |
9841 | $r4 = self::$FAILED; |
9842 | $r1 = self::$FAILED; |
9843 | goto seq_1; |
9844 | } |
9845 | $p6 = $this->currPos; |
9846 | for (;;) { |
9847 | $r7 = $this->discardnl_comment_space($silence); |
9848 | if ($r7===self::$FAILED) { |
9849 | break; |
9850 | } |
9851 | } |
9852 | // free $r7 |
9853 | $r5 = true; |
9854 | // leadWS <- $r5 |
9855 | if ($r5!==self::$FAILED) { |
9856 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
9857 | } else { |
9858 | $r5 = self::$FAILED; |
9859 | $this->currPos = $p3; |
9860 | $r1 = self::$FAILED; |
9861 | goto seq_1; |
9862 | } |
9863 | // free $p6 |
9864 | // start choice_2 |
9865 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
9866 | if ($r7!==self::$FAILED) { |
9867 | goto choice_2; |
9868 | } |
9869 | $r7 = $this->parseparsoid_fragment_marker($silence); |
9870 | choice_2: |
9871 | // target <- $r7 |
9872 | if ($r7===self::$FAILED) { |
9873 | $this->currPos = $p3; |
9874 | $r1 = self::$FAILED; |
9875 | goto seq_1; |
9876 | } |
9877 | $r8 = []; |
9878 | for (;;) { |
9879 | $p6 = $this->currPos; |
9880 | // start seq_2 |
9881 | $p10 = $this->currPos; |
9882 | for (;;) { |
9883 | $r12 = $this->discardnl_comment_space($silence); |
9884 | if ($r12===self::$FAILED) { |
9885 | break; |
9886 | } |
9887 | } |
9888 | // free $r12 |
9889 | $r11 = true; |
9890 | if ($r11===self::$FAILED) { |
9891 | $r9 = self::$FAILED; |
9892 | goto seq_2; |
9893 | } |
9894 | // free $r11 |
9895 | if (($this->input[$this->currPos] ?? null) === "|") { |
9896 | $this->currPos++; |
9897 | $r11 = "|"; |
9898 | } else { |
9899 | if (!$silence) {$this->fail(13);} |
9900 | $r11 = self::$FAILED; |
9901 | $this->currPos = $p10; |
9902 | $r9 = self::$FAILED; |
9903 | goto seq_2; |
9904 | } |
9905 | // start choice_3 |
9906 | $p13 = $this->currPos; |
9907 | // start seq_3 |
9908 | $p14 = $this->currPos; |
9909 | $p16 = $this->currPos; |
9910 | $r15 = ''; |
9911 | // p0 <- $r15 |
9912 | if ($r15!==self::$FAILED) { |
9913 | $this->savedPos = $p16; |
9914 | $r15 = $this->a102($r5, $r7); |
9915 | } else { |
9916 | $r12 = self::$FAILED; |
9917 | goto seq_3; |
9918 | } |
9919 | $r17 = []; |
9920 | for (;;) { |
9921 | $r18 = $this->parsenl_comment_space($silence); |
9922 | if ($r18!==self::$FAILED) { |
9923 | $r17[] = $r18; |
9924 | } else { |
9925 | break; |
9926 | } |
9927 | } |
9928 | // v <- $r17 |
9929 | // free $r18 |
9930 | $p19 = $this->currPos; |
9931 | $r18 = ''; |
9932 | // p1 <- $r18 |
9933 | if ($r18!==self::$FAILED) { |
9934 | $this->savedPos = $p19; |
9935 | $r18 = $this->a103($r5, $r7, $r15, $r17); |
9936 | } else { |
9937 | $this->currPos = $p14; |
9938 | $r12 = self::$FAILED; |
9939 | goto seq_3; |
9940 | } |
9941 | $p20 = $this->currPos; |
9942 | // start choice_4 |
9943 | if (($this->input[$this->currPos] ?? null) === "|") { |
9944 | $this->currPos++; |
9945 | $r21 = "|"; |
9946 | goto choice_4; |
9947 | } else { |
9948 | $r21 = self::$FAILED; |
9949 | } |
9950 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
9951 | $r21 = "}}"; |
9952 | $this->currPos += 2; |
9953 | } else { |
9954 | $r21 = self::$FAILED; |
9955 | } |
9956 | choice_4: |
9957 | if ($r21!==self::$FAILED) { |
9958 | $r21 = false; |
9959 | $this->currPos = $p20; |
9960 | } else { |
9961 | $this->currPos = $p14; |
9962 | $r12 = self::$FAILED; |
9963 | goto seq_3; |
9964 | } |
9965 | // free $p20 |
9966 | $r12 = true; |
9967 | seq_3: |
9968 | if ($r12!==self::$FAILED) { |
9969 | $this->savedPos = $p13; |
9970 | $r12 = $this->a104($r5, $r7, $r15, $r17, $r18); |
9971 | goto choice_3; |
9972 | } |
9973 | // free $p14 |
9974 | $r12 = $this->parsetemplate_param($silence, $boolParams, $param_preproc, $param_th); |
9975 | choice_3: |
9976 | // r <- $r12 |
9977 | if ($r12===self::$FAILED) { |
9978 | $this->currPos = $p10; |
9979 | $r9 = self::$FAILED; |
9980 | goto seq_2; |
9981 | } |
9982 | $r9 = true; |
9983 | seq_2: |
9984 | if ($r9!==self::$FAILED) { |
9985 | $this->savedPos = $p6; |
9986 | $r9 = $this->a105($r5, $r7, $r12); |
9987 | $r8[] = $r9; |
9988 | } else { |
9989 | break; |
9990 | } |
9991 | // free $p10 |
9992 | } |
9993 | // params <- $r8 |
9994 | // free $r9 |
9995 | $p10 = $this->currPos; |
9996 | for (;;) { |
9997 | $r22 = $this->discardnl_comment_space($silence); |
9998 | if ($r22===self::$FAILED) { |
9999 | break; |
10000 | } |
10001 | } |
10002 | // free $r22 |
10003 | $r9 = true; |
10004 | // trailWS <- $r9 |
10005 | if ($r9!==self::$FAILED) { |
10006 | $r9 = substr($this->input, $p10, $this->currPos - $p10); |
10007 | } else { |
10008 | $r9 = self::$FAILED; |
10009 | $this->currPos = $p3; |
10010 | $r1 = self::$FAILED; |
10011 | goto seq_1; |
10012 | } |
10013 | // free $p10 |
10014 | $r22 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10015 | if ($r22===self::$FAILED) { |
10016 | $this->currPos = $p3; |
10017 | $r1 = self::$FAILED; |
10018 | goto seq_1; |
10019 | } |
10020 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
10021 | $r23 = "}}"; |
10022 | $this->currPos += 2; |
10023 | } else { |
10024 | if (!$silence) {$this->fail(62);} |
10025 | $r23 = self::$FAILED; |
10026 | $this->currPos = $p3; |
10027 | $r1 = self::$FAILED; |
10028 | goto seq_1; |
10029 | } |
10030 | $r1 = true; |
10031 | seq_1: |
10032 | if ($r1!==self::$FAILED) { |
10033 | $this->savedPos = $p2; |
10034 | $r1 = $this->a106($r5, $r7, $r8, $r9); |
10035 | goto choice_1; |
10036 | } |
10037 | // free $p3 |
10038 | $p3 = $this->currPos; |
10039 | // start seq_4 |
10040 | $p10 = $this->currPos; |
10041 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
10042 | $r24 = "{{"; |
10043 | $this->currPos += 2; |
10044 | } else { |
10045 | if (!$silence) {$this->fail(43);} |
10046 | $r24 = self::$FAILED; |
10047 | $r1 = self::$FAILED; |
10048 | goto seq_4; |
10049 | } |
10050 | for (;;) { |
10051 | $r26 = $this->discardspace_or_newline($silence); |
10052 | if ($r26===self::$FAILED) { |
10053 | break; |
10054 | } |
10055 | } |
10056 | // free $r26 |
10057 | $r25 = true; |
10058 | if ($r25===self::$FAILED) { |
10059 | $this->currPos = $p10; |
10060 | $r1 = self::$FAILED; |
10061 | goto seq_4; |
10062 | } |
10063 | // free $r25 |
10064 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
10065 | $r25 = "}}"; |
10066 | $this->currPos += 2; |
10067 | } else { |
10068 | if (!$silence) {$this->fail(62);} |
10069 | $r25 = self::$FAILED; |
10070 | $this->currPos = $p10; |
10071 | $r1 = self::$FAILED; |
10072 | goto seq_4; |
10073 | } |
10074 | $r1 = true; |
10075 | seq_4: |
10076 | if ($r1!==self::$FAILED) { |
10077 | $r1 = substr($this->input, $p3, $this->currPos - $p3); |
10078 | } else { |
10079 | $r1 = self::$FAILED; |
10080 | } |
10081 | // free $p10 |
10082 | // free $p3 |
10083 | choice_1: |
10084 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10085 | $this->currPos, |
10086 | $r1, |
10087 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10088 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10089 | ); |
10090 | return $r1; |
10091 | } |
10092 | private function parsetplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
10093 | $key = json_encode([380, $boolParams & 0x7fff, $param_preproc, $param_th]); |
10094 | $bucket = $this->currPos; |
10095 | $cached = $this->cache[$bucket][$key] ?? null; |
10096 | if ($cached) { |
10097 | $this->currPos = $cached->nextPos; |
10098 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10099 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10100 | return $cached->result; |
10101 | } |
10102 | $saved_preproc=$param_preproc; |
10103 | $saved_th=$param_th; |
10104 | $p2 = $this->currPos; |
10105 | // start seq_1 |
10106 | $p3 = $this->currPos; |
10107 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
10108 | $r4 = "{{{"; |
10109 | $this->currPos += 3; |
10110 | } else { |
10111 | if (!$silence) {$this->fail(60);} |
10112 | $r4 = self::$FAILED; |
10113 | $r1 = self::$FAILED; |
10114 | goto seq_1; |
10115 | } |
10116 | $p6 = $this->currPos; |
10117 | $r5 = ''; |
10118 | // p <- $r5 |
10119 | if ($r5!==self::$FAILED) { |
10120 | $this->savedPos = $p6; |
10121 | $r5 = $this->a17(); |
10122 | } else { |
10123 | $this->currPos = $p3; |
10124 | $r1 = self::$FAILED; |
10125 | goto seq_1; |
10126 | } |
10127 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
10128 | if ($r7===self::$FAILED) { |
10129 | $r7 = null; |
10130 | } |
10131 | // target <- $r7 |
10132 | $r8 = []; |
10133 | for (;;) { |
10134 | $p10 = $this->currPos; |
10135 | // start seq_2 |
10136 | $p11 = $this->currPos; |
10137 | for (;;) { |
10138 | $r13 = $this->discardnl_comment_space($silence); |
10139 | if ($r13===self::$FAILED) { |
10140 | break; |
10141 | } |
10142 | } |
10143 | // free $r13 |
10144 | $r12 = true; |
10145 | if ($r12===self::$FAILED) { |
10146 | $r9 = self::$FAILED; |
10147 | goto seq_2; |
10148 | } |
10149 | // free $r12 |
10150 | if (($this->input[$this->currPos] ?? null) === "|") { |
10151 | $this->currPos++; |
10152 | $r12 = "|"; |
10153 | } else { |
10154 | if (!$silence) {$this->fail(13);} |
10155 | $r12 = self::$FAILED; |
10156 | $this->currPos = $p11; |
10157 | $r9 = self::$FAILED; |
10158 | goto seq_2; |
10159 | } |
10160 | // start choice_1 |
10161 | $p14 = $this->currPos; |
10162 | // start seq_3 |
10163 | $p15 = $this->currPos; |
10164 | $p17 = $this->currPos; |
10165 | $r16 = ''; |
10166 | // p0 <- $r16 |
10167 | if ($r16!==self::$FAILED) { |
10168 | $this->savedPos = $p17; |
10169 | $r16 = $this->a97($r5, $r7); |
10170 | } else { |
10171 | $r13 = self::$FAILED; |
10172 | goto seq_3; |
10173 | } |
10174 | $r18 = []; |
10175 | for (;;) { |
10176 | $r19 = $this->parsenl_comment_space($silence); |
10177 | if ($r19!==self::$FAILED) { |
10178 | $r18[] = $r19; |
10179 | } else { |
10180 | break; |
10181 | } |
10182 | } |
10183 | // v <- $r18 |
10184 | // free $r19 |
10185 | $p20 = $this->currPos; |
10186 | $r19 = ''; |
10187 | // p1 <- $r19 |
10188 | if ($r19!==self::$FAILED) { |
10189 | $this->savedPos = $p20; |
10190 | $r19 = $this->a98($r5, $r7, $r16, $r18); |
10191 | } else { |
10192 | $this->currPos = $p15; |
10193 | $r13 = self::$FAILED; |
10194 | goto seq_3; |
10195 | } |
10196 | $p21 = $this->currPos; |
10197 | // start choice_2 |
10198 | if (($this->input[$this->currPos] ?? null) === "|") { |
10199 | $this->currPos++; |
10200 | $r22 = "|"; |
10201 | goto choice_2; |
10202 | } else { |
10203 | $r22 = self::$FAILED; |
10204 | } |
10205 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10206 | $r22 = "}}}"; |
10207 | $this->currPos += 3; |
10208 | } else { |
10209 | $r22 = self::$FAILED; |
10210 | } |
10211 | choice_2: |
10212 | if ($r22!==self::$FAILED) { |
10213 | $r22 = false; |
10214 | $this->currPos = $p21; |
10215 | } else { |
10216 | $this->currPos = $p15; |
10217 | $r13 = self::$FAILED; |
10218 | goto seq_3; |
10219 | } |
10220 | // free $p21 |
10221 | $r13 = true; |
10222 | seq_3: |
10223 | if ($r13!==self::$FAILED) { |
10224 | $this->savedPos = $p14; |
10225 | $r13 = $this->a99($r5, $r7, $r16, $r18, $r19); |
10226 | goto choice_1; |
10227 | } |
10228 | // free $p15 |
10229 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
10230 | choice_1: |
10231 | // r <- $r13 |
10232 | if ($r13===self::$FAILED) { |
10233 | $this->currPos = $p11; |
10234 | $r9 = self::$FAILED; |
10235 | goto seq_2; |
10236 | } |
10237 | $r9 = true; |
10238 | seq_2: |
10239 | if ($r9!==self::$FAILED) { |
10240 | $this->savedPos = $p10; |
10241 | $r9 = $this->a100($r5, $r7, $r13); |
10242 | $r8[] = $r9; |
10243 | } else { |
10244 | break; |
10245 | } |
10246 | // free $p11 |
10247 | } |
10248 | // params <- $r8 |
10249 | // free $r9 |
10250 | for (;;) { |
10251 | $r23 = $this->discardnl_comment_space($silence); |
10252 | if ($r23===self::$FAILED) { |
10253 | break; |
10254 | } |
10255 | } |
10256 | // free $r23 |
10257 | $r9 = true; |
10258 | if ($r9===self::$FAILED) { |
10259 | $this->currPos = $p3; |
10260 | $r1 = self::$FAILED; |
10261 | goto seq_1; |
10262 | } |
10263 | // free $r9 |
10264 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10265 | if ($r9===self::$FAILED) { |
10266 | $this->currPos = $p3; |
10267 | $r1 = self::$FAILED; |
10268 | goto seq_1; |
10269 | } |
10270 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
10271 | $r23 = "}}}"; |
10272 | $this->currPos += 3; |
10273 | } else { |
10274 | if (!$silence) {$this->fail(61);} |
10275 | $r23 = self::$FAILED; |
10276 | $this->currPos = $p3; |
10277 | $r1 = self::$FAILED; |
10278 | goto seq_1; |
10279 | } |
10280 | $r1 = true; |
10281 | seq_1: |
10282 | if ($r1!==self::$FAILED) { |
10283 | $this->savedPos = $p2; |
10284 | $r1 = $this->a101($r5, $r7, $r8); |
10285 | } |
10286 | // free $p3 |
10287 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10288 | $this->currPos, |
10289 | $r1, |
10290 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10291 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10292 | ); |
10293 | return $r1; |
10294 | } |
10295 | private function discardwikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
10296 | $key = json_encode([427, $boolParams & 0x7fff, $param_preproc, $param_th]); |
10297 | $bucket = $this->currPos; |
10298 | $cached = $this->cache[$bucket][$key] ?? null; |
10299 | if ($cached) { |
10300 | $this->currPos = $cached->nextPos; |
10301 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10302 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10303 | return $cached->result; |
10304 | } |
10305 | $saved_preproc=$param_preproc; |
10306 | $saved_th=$param_th; |
10307 | $p2 = $this->currPos; |
10308 | // start seq_1 |
10309 | $p3 = $this->currPos; |
10310 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10311 | $r4 = "[["; |
10312 | $this->currPos += 2; |
10313 | } else { |
10314 | if (!$silence) {$this->fail(41);} |
10315 | $r4 = self::$FAILED; |
10316 | $r1 = self::$FAILED; |
10317 | goto seq_1; |
10318 | } |
10319 | $p6 = $this->currPos; |
10320 | $r5 = ''; |
10321 | // spos <- $r5 |
10322 | if ($r5!==self::$FAILED) { |
10323 | $this->savedPos = $p6; |
10324 | $r5 = $this->a17(); |
10325 | } else { |
10326 | $this->currPos = $p3; |
10327 | $r1 = self::$FAILED; |
10328 | goto seq_1; |
10329 | } |
10330 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
10331 | if ($r7===self::$FAILED) { |
10332 | $r7 = null; |
10333 | } |
10334 | // target <- $r7 |
10335 | $p9 = $this->currPos; |
10336 | $r8 = ''; |
10337 | // tpos <- $r8 |
10338 | if ($r8!==self::$FAILED) { |
10339 | $this->savedPos = $p9; |
10340 | $r8 = $this->a107($r5, $r7); |
10341 | } else { |
10342 | $this->currPos = $p3; |
10343 | $r1 = self::$FAILED; |
10344 | goto seq_1; |
10345 | } |
10346 | // start choice_1 |
10347 | $p11 = $this->currPos; |
10348 | // start seq_2 |
10349 | $p12 = $this->currPos; |
10350 | $r13 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
10351 | // l <- $r13 |
10352 | if ($r13===self::$FAILED) { |
10353 | $r10 = self::$FAILED; |
10354 | goto seq_2; |
10355 | } |
10356 | $r14 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
10357 | if ($r14===self::$FAILED) { |
10358 | $this->currPos = $p12; |
10359 | $r10 = self::$FAILED; |
10360 | goto seq_2; |
10361 | } |
10362 | $r10 = true; |
10363 | seq_2: |
10364 | if ($r10!==self::$FAILED) { |
10365 | $this->savedPos = $p11; |
10366 | $r10 = $this->a108($r5, $r7, $r8, $r13); |
10367 | goto choice_1; |
10368 | } |
10369 | // free $p12 |
10370 | $p12 = $this->currPos; |
10371 | $r15 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
10372 | // l <- $r15 |
10373 | $r10 = $r15; |
10374 | if ($r10!==self::$FAILED) { |
10375 | $this->savedPos = $p12; |
10376 | $r10 = $this->a109($r5, $r7, $r8, $r15); |
10377 | } |
10378 | choice_1: |
10379 | // lcs <- $r10 |
10380 | if ($r10===self::$FAILED) { |
10381 | $this->currPos = $p3; |
10382 | $r1 = self::$FAILED; |
10383 | goto seq_1; |
10384 | } |
10385 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
10386 | $r16 = "]]"; |
10387 | $this->currPos += 2; |
10388 | } else { |
10389 | if (!$silence) {$this->fail(63);} |
10390 | $r16 = self::$FAILED; |
10391 | $this->currPos = $p3; |
10392 | $r1 = self::$FAILED; |
10393 | goto seq_1; |
10394 | } |
10395 | $r1 = true; |
10396 | seq_1: |
10397 | if ($r1!==self::$FAILED) { |
10398 | $this->savedPos = $p2; |
10399 | $r1 = $this->a110($r5, $r7, $r8, $r10); |
10400 | } |
10401 | // free $p3 |
10402 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10403 | $this->currPos, |
10404 | $r1, |
10405 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10406 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10407 | ); |
10408 | return $r1; |
10409 | } |
10410 | private function discardbroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
10411 | $key = json_encode([425, $boolParams & 0x7fff, $param_preproc, $param_th]); |
10412 | $bucket = $this->currPos; |
10413 | $cached = $this->cache[$bucket][$key] ?? null; |
10414 | if ($cached) { |
10415 | $this->currPos = $cached->nextPos; |
10416 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10417 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10418 | return $cached->result; |
10419 | } |
10420 | $saved_preproc=$param_preproc; |
10421 | $saved_th=$param_th; |
10422 | $p2 = $this->currPos; |
10423 | // start seq_1 |
10424 | $p3 = $this->currPos; |
10425 | $p4 = $this->currPos; |
10426 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
10427 | $r5 = "[["; |
10428 | $this->currPos += 2; |
10429 | $r5 = false; |
10430 | $this->currPos = $p4; |
10431 | } else { |
10432 | $r5 = self::$FAILED; |
10433 | $r1 = self::$FAILED; |
10434 | goto seq_1; |
10435 | } |
10436 | // free $p4 |
10437 | $this->savedPos = $this->currPos; |
10438 | $r6 = $this->a111($param_preproc); |
10439 | if ($r6) { |
10440 | $r6 = false; |
10441 | } else { |
10442 | $r6 = self::$FAILED; |
10443 | $this->currPos = $p3; |
10444 | $r1 = self::$FAILED; |
10445 | goto seq_1; |
10446 | } |
10447 | // start seq_2 |
10448 | $p4 = $this->currPos; |
10449 | if (($this->input[$this->currPos] ?? null) === "[") { |
10450 | $this->currPos++; |
10451 | $r8 = "["; |
10452 | } else { |
10453 | if (!$silence) {$this->fail(19);} |
10454 | $r8 = self::$FAILED; |
10455 | $r7 = self::$FAILED; |
10456 | goto seq_2; |
10457 | } |
10458 | // start choice_1 |
10459 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
10460 | if ($r9!==self::$FAILED) { |
10461 | goto choice_1; |
10462 | } |
10463 | if (($this->input[$this->currPos] ?? null) === "[") { |
10464 | $this->currPos++; |
10465 | $r9 = "["; |
10466 | } else { |
10467 | if (!$silence) {$this->fail(19);} |
10468 | $r9 = self::$FAILED; |
10469 | } |
10470 | choice_1: |
10471 | if ($r9===self::$FAILED) { |
10472 | $this->currPos = $p4; |
10473 | $r7 = self::$FAILED; |
10474 | goto seq_2; |
10475 | } |
10476 | $r7 = [$r8,$r9]; |
10477 | seq_2: |
10478 | // a <- $r7 |
10479 | if ($r7===self::$FAILED) { |
10480 | $this->currPos = $p3; |
10481 | $r1 = self::$FAILED; |
10482 | goto seq_1; |
10483 | } |
10484 | // free $p4 |
10485 | $r1 = true; |
10486 | seq_1: |
10487 | if ($r1!==self::$FAILED) { |
10488 | $this->savedPos = $p2; |
10489 | $r1 = $this->a112($param_preproc, $r7); |
10490 | } |
10491 | // free $p3 |
10492 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10493 | $this->currPos, |
10494 | $r1, |
10495 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10496 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10497 | ); |
10498 | return $r1; |
10499 | } |
10500 | private function parsewellformed_extension_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10501 | $key = json_encode([444, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
10502 | $bucket = $this->currPos; |
10503 | $cached = $this->cache[$bucket][$key] ?? null; |
10504 | if ($cached) { |
10505 | $this->currPos = $cached->nextPos; |
10506 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10507 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10508 | return $cached->result; |
10509 | } |
10510 | $saved_preproc=$param_preproc; |
10511 | $saved_th=$param_th; |
10512 | $p2 = $this->currPos; |
10513 | // start seq_1 |
10514 | $p3 = $this->currPos; |
10515 | $r4 = $this->parsemaybe_extension_tag($silence, $boolParams, $param_preproc, $param_th); |
10516 | // extToken <- $r4 |
10517 | if ($r4===self::$FAILED) { |
10518 | $r1 = self::$FAILED; |
10519 | goto seq_1; |
10520 | } |
10521 | $this->savedPos = $this->currPos; |
10522 | $r5 = $this->a113($r4); |
10523 | if ($r5) { |
10524 | $r5 = false; |
10525 | } else { |
10526 | $r5 = self::$FAILED; |
10527 | $this->currPos = $p3; |
10528 | $r1 = self::$FAILED; |
10529 | goto seq_1; |
10530 | } |
10531 | $r1 = true; |
10532 | seq_1: |
10533 | if ($r1!==self::$FAILED) { |
10534 | $this->savedPos = $p2; |
10535 | $r1 = $this->a114($r4); |
10536 | } |
10537 | // free $p3 |
10538 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10539 | $this->currPos, |
10540 | $r1, |
10541 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10542 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10543 | ); |
10544 | return $r1; |
10545 | } |
10546 | private function parsexmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
10547 | $key = json_encode([458, $boolParams & 0x7ebf, $param_preproc, $param_th]); |
10548 | $bucket = $this->currPos; |
10549 | $cached = $this->cache[$bucket][$key] ?? null; |
10550 | if ($cached) { |
10551 | $this->currPos = $cached->nextPos; |
10552 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10553 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10554 | return $cached->result; |
10555 | } |
10556 | $saved_preproc=$param_preproc; |
10557 | $saved_th=$param_th; |
10558 | $p2 = $this->currPos; |
10559 | // start seq_1 |
10560 | $p3 = $this->currPos; |
10561 | $r4 = $this->parsexmlish_start($silence); |
10562 | // start <- $r4 |
10563 | if ($r4===self::$FAILED) { |
10564 | $this->currPos = $p3; |
10565 | $r1 = self::$FAILED; |
10566 | goto seq_1; |
10567 | } |
10568 | $this->savedPos = $this->currPos; |
10569 | $r5 = $this->a115(/*annOrExtTag*/($boolParams & 0x2) !== 0, $r4); |
10570 | if ($r5) { |
10571 | $r5 = false; |
10572 | } else { |
10573 | $r5 = self::$FAILED; |
10574 | $this->currPos = $p3; |
10575 | $r1 = self::$FAILED; |
10576 | goto seq_1; |
10577 | } |
10578 | $r6 = $this->parsegeneric_newline_attributes($silence, $boolParams & ~0x140, $param_preproc, $param_th); |
10579 | // attribs <- $r6 |
10580 | if ($r6===self::$FAILED) { |
10581 | $this->currPos = $p3; |
10582 | $r1 = self::$FAILED; |
10583 | goto seq_1; |
10584 | } |
10585 | for (;;) { |
10586 | $r8 = $this->discardspace_or_newline_or_solidus($silence); |
10587 | if ($r8===self::$FAILED) { |
10588 | break; |
10589 | } |
10590 | } |
10591 | // free $r8 |
10592 | $r7 = true; |
10593 | if ($r7===self::$FAILED) { |
10594 | $this->currPos = $p3; |
10595 | $r1 = self::$FAILED; |
10596 | goto seq_1; |
10597 | } |
10598 | // free $r7 |
10599 | if (($this->input[$this->currPos] ?? null) === "/") { |
10600 | $this->currPos++; |
10601 | $r7 = "/"; |
10602 | } else { |
10603 | if (!$silence) {$this->fail(35);} |
10604 | $r7 = self::$FAILED; |
10605 | $r7 = null; |
10606 | } |
10607 | // selfclose <- $r7 |
10608 | for (;;) { |
10609 | $r9 = $this->discardspace($silence); |
10610 | if ($r9===self::$FAILED) { |
10611 | break; |
10612 | } |
10613 | } |
10614 | // free $r9 |
10615 | $r8 = true; |
10616 | if ($r8===self::$FAILED) { |
10617 | $this->currPos = $p3; |
10618 | $r1 = self::$FAILED; |
10619 | goto seq_1; |
10620 | } |
10621 | // free $r8 |
10622 | if (($this->input[$this->currPos] ?? null) === ">") { |
10623 | $this->currPos++; |
10624 | $r8 = ">"; |
10625 | } else { |
10626 | if (!$silence) {$this->fail(64);} |
10627 | $r8 = self::$FAILED; |
10628 | $this->currPos = $p3; |
10629 | $r1 = self::$FAILED; |
10630 | goto seq_1; |
10631 | } |
10632 | $r1 = true; |
10633 | seq_1: |
10634 | if ($r1!==self::$FAILED) { |
10635 | $this->savedPos = $p2; |
10636 | $r1 = $this->a116(/*annOrExtTag*/($boolParams & 0x2) !== 0, $r4, $r6, $r7); |
10637 | } |
10638 | // free $p3 |
10639 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10640 | $this->currPos, |
10641 | $r1, |
10642 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10643 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10644 | ); |
10645 | return $r1; |
10646 | } |
10647 | private function parseautourl($silence, $boolParams, &$param_preproc, &$param_th) { |
10648 | $key = json_encode([360, $boolParams & 0x7fff, $param_preproc, $param_th]); |
10649 | $bucket = $this->currPos; |
10650 | $cached = $this->cache[$bucket][$key] ?? null; |
10651 | if ($cached) { |
10652 | $this->currPos = $cached->nextPos; |
10653 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
10654 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
10655 | return $cached->result; |
10656 | } |
10657 | $saved_preproc=$param_preproc; |
10658 | $saved_th=$param_th; |
10659 | $p2 = $this->currPos; |
10660 | // start seq_1 |
10661 | $p3 = $this->currPos; |
10662 | $p4 = $this->currPos; |
10663 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
10664 | $r5 = "//"; |
10665 | $this->currPos += 2; |
10666 | } else { |
10667 | $r5 = self::$FAILED; |
10668 | } |
10669 | if ($r5 === self::$FAILED) { |
10670 | $r5 = false; |
10671 | } else { |
10672 | $r5 = self::$FAILED; |
10673 | $this->currPos = $p4; |
10674 | $r1 = self::$FAILED; |
10675 | goto seq_1; |
10676 | } |
10677 | // free $p4 |
10678 | $p4 = $this->currPos; |
10679 | // start seq_2 |
10680 | $p7 = $this->currPos; |
10681 | $r8 = $this->parseurl_protocol($silence); |
10682 | // proto <- $r8 |
10683 | if ($r8===self::$FAILED) { |
10684 | $r6 = self::$FAILED; |
10685 | goto seq_2; |
10686 | } |
10687 | // start choice_1 |
10688 | $r9 = $this->parseipv6urladdr($silence); |
10689 | if ($r9!==self::$FAILED) { |
10690 | goto choice_1; |
10691 | } |
10692 | $r9 = ''; |
10693 | choice_1: |
10694 | // addr <- $r9 |
10695 | if ($r9===self::$FAILED) { |
10696 | $this->currPos = $p7; |
10697 | $r6 = self::$FAILED; |
10698 | goto seq_2; |
10699 | } |
10700 | $r10 = []; |
10701 | for (;;) { |
10702 | $p12 = $this->currPos; |
10703 | // start seq_3 |
10704 | $p13 = $this->currPos; |
10705 | $p14 = $this->currPos; |
10706 | $r15 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
10707 | if ($r15 === self::$FAILED) { |
10708 | $r15 = false; |
10709 | } else { |
10710 | $r15 = self::$FAILED; |
10711 | $this->currPos = $p14; |
10712 | $r11 = self::$FAILED; |
10713 | goto seq_3; |
10714 | } |
10715 | // free $p14 |
10716 | // start choice_2 |
10717 | $r16 = $this->parseno_punctuation_char($silence); |
10718 | if ($r16!==self::$FAILED) { |
10719 | goto choice_2; |
10720 | } |
10721 | $r16 = $this->parsecomment($silence); |
10722 | if ($r16!==self::$FAILED) { |
10723 | goto choice_2; |
10724 | } |
10725 | $r16 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
10726 | if ($r16!==self::$FAILED) { |
10727 | goto choice_2; |
10728 | } |
10729 | $p14 = $this->currPos; |
10730 | // start seq_4 |
10731 | $p17 = $this->currPos; |
10732 | if (($this->input[$this->currPos] ?? null) === "'") { |
10733 | $this->currPos++; |
10734 | $r18 = "'"; |
10735 | } else { |
10736 | if (!$silence) {$this->fail(33);} |
10737 | $r18 = self::$FAILED; |
10738 | $r16 = self::$FAILED; |
10739 | goto seq_4; |
10740 | } |
10741 | $p19 = $this->currPos; |
10742 | if (($this->input[$this->currPos] ?? null) === "'") { |
10743 | $this->currPos++; |
10744 | $r20 = "'"; |
10745 | } else { |
10746 | $r20 = self::$FAILED; |
10747 | } |
10748 | if ($r20 === self::$FAILED) { |
10749 | $r20 = false; |
10750 | } else { |
10751 | $r20 = self::$FAILED; |
10752 | $this->currPos = $p19; |
10753 | $this->currPos = $p17; |
10754 | $r16 = self::$FAILED; |
10755 | goto seq_4; |
10756 | } |
10757 | // free $p19 |
10758 | $r16 = true; |
10759 | seq_4: |
10760 | if ($r16!==self::$FAILED) { |
10761 | $r16 = substr($this->input, $p14, $this->currPos - $p14); |
10762 | goto choice_2; |
10763 | } else { |
10764 | $r16 = self::$FAILED; |
10765 | } |
10766 | // free $p17 |
10767 | // free $p14 |
10768 | if (($this->input[$this->currPos] ?? null) === "{") { |
10769 | $this->currPos++; |
10770 | $r16 = "{"; |
10771 | goto choice_2; |
10772 | } else { |
10773 | if (!$silence) {$this->fail(29);} |
10774 | $r16 = self::$FAILED; |
10775 | } |
10776 | $p14 = $this->currPos; |
10777 | // start seq_5 |
10778 | $p17 = $this->currPos; |
10779 | $p19 = $this->currPos; |
10780 | // start seq_6 |
10781 | $p22 = $this->currPos; |
10782 | $r23 = $this->parseraw_htmlentity(true); |
10783 | // rhe <- $r23 |
10784 | if ($r23===self::$FAILED) { |
10785 | $r21 = self::$FAILED; |
10786 | goto seq_6; |
10787 | } |
10788 | $this->savedPos = $this->currPos; |
10789 | $r24 = $this->a117($r8, $r9, $r23); |
10790 | if ($r24) { |
10791 | $r24 = false; |
10792 | } else { |
10793 | $r24 = self::$FAILED; |
10794 | $this->currPos = $p22; |
10795 | $r21 = self::$FAILED; |
10796 | goto seq_6; |
10797 | } |
10798 | $r21 = true; |
10799 | seq_6: |
10800 | // free $p22 |
10801 | if ($r21 === self::$FAILED) { |
10802 | $r21 = false; |
10803 | } else { |
10804 | $r21 = self::$FAILED; |
10805 | $this->currPos = $p19; |
10806 | $r16 = self::$FAILED; |
10807 | goto seq_5; |
10808 | } |
10809 | // free $p19 |
10810 | // start choice_3 |
10811 | $p19 = $this->currPos; |
10812 | // start seq_7 |
10813 | $p22 = $this->currPos; |
10814 | $p26 = $this->currPos; |
10815 | if (($this->input[$this->currPos] ?? null) === "&") { |
10816 | $this->currPos++; |
10817 | $r27 = "&"; |
10818 | $r27 = false; |
10819 | $this->currPos = $p26; |
10820 | } else { |
10821 | $r27 = self::$FAILED; |
10822 | $r25 = self::$FAILED; |
10823 | goto seq_7; |
10824 | } |
10825 | // free $p26 |
10826 | $r28 = $this->parsehtmlentity($silence); |
10827 | // he <- $r28 |
10828 | if ($r28===self::$FAILED) { |
10829 | $this->currPos = $p22; |
10830 | $r25 = self::$FAILED; |
10831 | goto seq_7; |
10832 | } |
10833 | $r25 = true; |
10834 | seq_7: |
10835 | if ($r25!==self::$FAILED) { |
10836 | $this->savedPos = $p19; |
10837 | $r25 = $this->a9($r8, $r9, $r28); |
10838 | goto choice_3; |
10839 | } |
10840 | // free $p22 |
10841 | if (($this->input[$this->currPos] ?? null) === "&") { |
10842 | $this->currPos++; |
10843 | $r25 = "&"; |
10844 | } else { |
10845 | if (!$silence) {$this->fail(4);} |
10846 | $r25 = self::$FAILED; |
10847 | } |
10848 | choice_3: |
10849 | // r <- $r25 |
10850 | if ($r25===self::$FAILED) { |
10851 | $this->currPos = $p17; |
10852 | $r16 = self::$FAILED; |
10853 | goto seq_5; |
10854 | } |
10855 | $r16 = true; |
10856 | seq_5: |
10857 | if ($r16!==self::$FAILED) { |
10858 | $this->savedPos = $p14; |
10859 | $r16 = $this->a10($r8, $r9, $r25); |
10860 | } |
10861 | // free $p17 |
10862 | choice_2: |
10863 | // c <- $r16 |
10864 | if ($r16===self::$FAILED) { |
10865 | $this->currPos = $p13; |
10866 | $r11 = self::$FAILED; |
10867 | goto seq_3; |
10868 | } |
10869 | $r11 = true; |
10870 | seq_3: |
10871 | if ($r11!==self::$FAILED) { |
10872 | $this->savedPos = $p12; |
10873 | $r11 = $this->a11($r8, $r9, $r16); |
10874 | $r10[] = $r11; |
10875 | } else { |
10876 | break; |
10877 | } |
10878 | // free $p13 |
10879 | } |
10880 | // path <- $r10 |
10881 | // free $r11 |
10882 | $r6 = true; |
10883 | seq_2: |
10884 | // r <- $r6 |
10885 | if ($r6!==self::$FAILED) { |
10886 | $this->savedPos = $p4; |
10887 | $r6 = $this->a118($r8, $r9, $r10); |
10888 | } else { |
10889 | $this->currPos = $p3; |
10890 | $r1 = self::$FAILED; |
10891 | goto seq_1; |
10892 | } |
10893 | // free $p7 |
10894 | $this->savedPos = $this->currPos; |
10895 | $r11 = $this->a119($r6); |
10896 | if ($r11) { |
10897 | $r11 = false; |
10898 | } else { |
10899 | $r11 = self::$FAILED; |
10900 | $this->currPos = $p3; |
10901 | $r1 = self::$FAILED; |
10902 | goto seq_1; |
10903 | } |
10904 | $r1 = true; |
10905 | seq_1: |
10906 | if ($r1!==self::$FAILED) { |
10907 | $this->savedPos = $p2; |
10908 | $r1 = $this->a120($r6); |
10909 | } |
10910 | // free $p3 |
10911 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
10912 | $this->currPos, |
10913 | $r1, |
10914 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
10915 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
10916 | ); |
10917 | return $r1; |
10918 | } |
10919 | private function parseautoref($silence) { |
10920 | $key = 350; |
10921 | $bucket = $this->currPos; |
10922 | $cached = $this->cache[$bucket][$key] ?? null; |
10923 | if ($cached) { |
10924 | $this->currPos = $cached->nextPos; |
10925 | |
10926 |