Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9966 |
|
0.00% |
0 / 364 |
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 / 9962 |
|
0.00% |
0 / 363 |
7330556 | |
0.00% |
0 / 1 |
| initialize | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
| resetState | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| assert | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| unreachable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| startOffset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| endOffset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| tsrOffsets | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
| emitChunk | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
12 | |||
| isXMLTag | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| maybeAnnotationOrExtensionTag | |
0.00% |
0 / 105 |
|
0.00% |
0 / 1 |
930 | |||
| a0 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
| a1 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
| a2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a3 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a4 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
12 | |||
| a5 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a6 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a7 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a8 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
| a9 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a10 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a11 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a12 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a13 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a14 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a15 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a16 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a17 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a18 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a19 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| a20 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a21 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a22 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a23 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |||
| a24 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a25 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
| a26 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a27 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| a28 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a29 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a30 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |||
| a31 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a32 | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
6 | |||
| a33 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a34 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a35 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a36 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
| a37 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| a38 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a39 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a40 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a41 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
| a42 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a43 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a44 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a45 | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
20 | |||
| a46 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| a47 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| a48 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a49 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a50 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a51 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a52 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a53 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a54 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a55 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a56 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a57 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a58 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a59 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a60 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
| a61 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a62 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a63 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a64 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a65 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a66 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a67 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a68 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a69 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a70 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a71 | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
12 | |||
| a72 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a73 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a74 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a75 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a76 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a77 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a78 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a79 | |
0.00% |
0 / 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 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a84 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
| a85 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| a86 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a87 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a88 | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
56 | |||
| a89 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a90 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a91 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a92 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a93 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a94 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a95 | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
42 | |||
| a96 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a97 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a98 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
12 | |||
| a99 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a100 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a101 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a102 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a103 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |||
| a104 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a105 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a106 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a107 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a108 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
| a109 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a110 | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
| a111 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a112 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a113 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
20 | |||
| a114 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a115 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| a116 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
| a117 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
72 | |||
| a118 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a119 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
| a120 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |||
| a121 | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
30 | |||
| a122 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a123 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| a124 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
2 | |||
| a125 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a126 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
| a127 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
12 | |||
| a128 | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 | |||
| a129 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a130 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a131 | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
| a132 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 | |||
| a133 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a134 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| a135 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a136 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a137 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a138 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| a139 | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
12 | |||
| a140 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a141 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a142 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a143 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| a144 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a145 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a146 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a147 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a148 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a149 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a150 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a151 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
| a152 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a153 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a154 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a155 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a156 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a157 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a158 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a159 | |
0.00% |
0 / 31 |
|
0.00% |
0 / 1 |
56 | |||
| a160 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| a161 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| a162 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a163 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| a164 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
| a165 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a166 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| a167 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a168 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a169 | |
0.00% |
0 / 49 |
|
0.00% |
0 / 1 |
420 | |||
| a170 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| a171 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a172 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
| a173 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a174 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
| a175 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| a176 | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
30 | |||
| a177 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
| a178 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a179 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| a180 | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
| a181 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a182 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a183 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a184 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a185 | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| a186 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a187 | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| streamstart_async | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
132 | |||
| parsestart | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
110 | |||
| parsetable_start_tag | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
420 | |||
| parseurl | |
0.00% |
0 / 171 |
|
0.00% |
0 / 1 |
1560 | |||
| parserow_syntax_table_args | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
132 | |||
| parsetable_attributes | |
0.00% |
0 / 39 |
|
0.00% |
0 / 1 |
156 | |||
| parsegeneric_newline_attributes | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
72 | |||
| parsetplarg_or_template_or_bust | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
132 | |||
| parseextlink | |
0.00% |
0 / 142 |
|
0.00% |
0 / 1 |
870 | |||
| parselist_item | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
72 | |||
| parsetlb | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
72 | |||
| parsenewlineToken | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
| parsespace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
30 | |||
| parsecomment | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
342 | |||
| parsepipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
| parseurl_protocol | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
| parseipv6urladdr | |
0.00% |
0 / 46 |
|
0.00% |
0 / 1 |
132 | |||
| discardinline_breaks | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
90 | |||
| parseno_punctuation_char | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
| parsetplarg_or_template | |
0.00% |
0 / 37 |
|
0.00% |
0 / 1 |
110 | |||
| parsehtmlentity | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
| parseoptional_spaces | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
| discardpipe | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
| parsetable_attribute | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
272 | |||
| discardoptionalSpaceToken | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
| parsebroken_table_attribute_name_char | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
30 | |||
| parsegeneric_newline_attribute | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
420 | |||
| parseextlink_nonipv6url | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
| discardspace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
30 | |||
| discardunispace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
| parseinlineline | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
| parsedtdd | |
0.00% |
0 / 85 |
|
0.00% |
0 / 1 |
380 | |||
| parsehacky_dl_uses | |
0.00% |
0 / 94 |
|
0.00% |
0 / 1 |
812 | |||
| parseli | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
210 | |||
| discardeof | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
| parseblock | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
342 | |||
| discardnewline | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
| parsetplarg_or_template_guarded | |
0.00% |
0 / 191 |
|
0.00% |
0 / 1 |
1806 | |||
| parseraw_htmlentity | |
0.00% |
0 / 51 |
|
0.00% |
0 / 1 |
156 | |||
| parseoptionalSpaceToken | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
12 | |||
| parsetable_attribute_name | |
0.00% |
0 / 121 |
|
0.00% |
0 / 1 |
930 | |||
| parsetable_att_value | |
0.00% |
0 / 176 |
|
0.00% |
0 / 1 |
2256 | |||
| discardspace_or_newline_or_solidus | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
72 | |||
| parsegeneric_attribute_name | |
0.00% |
0 / 104 |
|
0.00% |
0 / 1 |
756 | |||
| discardspace_or_newline | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
| parsegeneric_att_value | |
0.00% |
0 / 193 |
|
0.00% |
0 / 1 |
1980 | |||
| parseextlink_nonipv6url_parameterized | |
0.00% |
0 / 92 |
|
0.00% |
0 / 1 |
650 | |||
| parseurltext | |
0.00% |
0 / 99 |
|
0.00% |
0 / 1 |
462 | |||
| parseinline_element | |
0.00% |
0 / 155 |
|
0.00% |
0 / 1 |
992 | |||
| discardlist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
| parselist_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
| 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 / 31 |
|
0.00% |
0 / 1 |
110 | |||
| discardcomment | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
342 | |||
| discardsof | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
| parseredirect | |
0.00% |
0 / 72 |
|
0.00% |
0 / 1 |
380 | |||
| parsesol_transparent | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
90 | |||
| parseblock_line | |
0.00% |
0 / 50 |
|
0.00% |
0 / 1 |
182 | |||
| parseblock_lines | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
156 | |||
| discardtplarg | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
| parsetemplate | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
| parsebroken_template | |
0.00% |
0 / 29 |
|
0.00% |
0 / 1 |
72 | |||
| parsetplarg | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
| discardwikilink | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
| parsedirective | |
0.00% |
0 / 69 |
|
0.00% |
0 / 1 |
272 | |||
| parseinline_xmlish_tag | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
156 | |||
| parsetable_attribute_preprocessor_text_single | |
0.00% |
0 / 63 |
|
0.00% |
0 / 1 |
380 | |||
| parsetable_attribute_preprocessor_text_double | |
0.00% |
0 / 63 |
|
0.00% |
0 / 1 |
380 | |||
| parsetable_attribute_preprocessor_text | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
420 | |||
| parseless_than | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
42 | |||
| parseattribute_preprocessor_text_single | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
552 | |||
| parseattribute_preprocessor_text_double | |
0.00% |
0 / 78 |
|
0.00% |
0 / 1 |
552 | |||
| parseattribute_preprocessor_text | |
0.00% |
0 / 80 |
|
0.00% |
0 / 1 |
600 | |||
| parseautolink | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
156 | |||
| parsebehavior_switch | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
132 | |||
| parsetext_char | |
0.00% |
0 / 17 |
|
0.00% |
0 / 1 |
20 | |||
| parselang_variant_or_tpl | |
0.00% |
0 / 221 |
|
0.00% |
0 / 1 |
2450 | |||
| parsewikilink | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
| parsequote | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
132 | |||
| 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 | |||
| parseempty_line_with_comments | |
0.00% |
0 / 66 |
|
0.00% |
0 / 1 |
272 | |||
| parsesol_prefix | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
20 | |||
| parseredirect_word | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
306 | |||
| parseinclude_limits | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
462 | |||
| parseannotation_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
| parseheading | |
0.00% |
0 / 116 |
|
0.00% |
0 / 1 |
702 | |||
| parsehr | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
| discardtplarg_preproc | |
0.00% |
0 / 134 |
|
0.00% |
0 / 1 |
1332 | |||
| parsetemplate_preproc | |
0.00% |
0 / 172 |
|
0.00% |
0 / 1 |
2352 | |||
| parsetplarg_preproc | |
0.00% |
0 / 134 |
|
0.00% |
0 / 1 |
1332 | |||
| discardwikilink_preproc | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
| discardbroken_wikilink | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
306 | |||
| parseextension_annotation_tag | |
0.00% |
0 / 60 |
|
0.00% |
0 / 1 |
210 | |||
| parsexmlish_tag | |
0.00% |
0 / 84 |
|
0.00% |
0 / 1 |
552 | |||
| parsetvar_old_syntax_closing_HACK | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
56 | |||
| parseautourl | |
0.00% |
0 / 182 |
|
0.00% |
0 / 1 |
1560 | |||
| parseautoref | |
0.00% |
0 / 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 | |||
| parselang_variant | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
| parsewikilink_preproc | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
342 | |||
| parsebroken_wikilink | |
0.00% |
0 / 65 |
|
0.00% |
0 / 1 |
306 | |||
| parsetable_heading_tags | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
20 | |||
| parsetable_row_tag | |
0.00% |
0 / 73 |
|
0.00% |
0 / 1 |
380 | |||
| parsetable_data_tags | |
0.00% |
0 / 55 |
|
0.00% |
0 / 1 |
210 | |||
| parsetable_caption_tag | |
0.00% |
0 / 57 |
|
0.00% |
0 / 1 |
240 | |||
| parsenewline | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
56 | |||
| discardsol | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
132 | |||
| parsetemplate_param_value | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
| discardnl_comment_space | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
20 | |||
| parsenl_comment_space | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
20 | |||
| parsetemplate_param | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
306 | |||
| parsewikilink_preprocessor_text | |
0.00% |
0 / 91 |
|
0.00% |
0 / 1 |
756 | |||
| parsewikilink_content | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
132 | |||
| parsetag_name | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
42 | |||
| 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 | |||
| 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 | |||
| discardempty_line_with_comments | |
0.00% |
0 / 66 |
|
0.00% |
0 / 1 |
272 | |||
| discardsol_prefix | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
20 | |||
| discardsol_transparent | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
90 | |||
| parsetemplate_param_text | |
0.00% |
0 / 32 |
|
0.00% |
0 / 1 |
132 | |||
| discardnewlineToken | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
| parsetemplate_param_name | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
72 | |||
| parselink_text | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
| parseunispace | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
20 | |||
| parseopt_lang_variant_flags | |
0.00% |
0 / 41 |
|
0.00% |
0 / 1 |
132 | |||
| parselang_variant_text | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
156 | |||
| parselang_variant_option_list | |
0.00% |
0 / 76 |
|
0.00% |
0 / 1 |
380 | |||
| parsetable_heading_tag | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
156 | |||
| 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 | |||
| discardinclude_limits | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
462 | |||
| discardannotation_tag | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
90 | |||
| discardbehavior_switch | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
132 | |||
| parselink_text_parameterized | |
0.00% |
0 / 129 |
|
0.00% |
0 / 1 |
1332 | |||
| parselang_variant_flags | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
506 | |||
| parselang_variant_option | |
0.00% |
0 / 163 |
|
0.00% |
0 / 1 |
1980 | |||
| discardbogus_lang_variant_option | |
0.00% |
0 / 20 |
|
0.00% |
0 / 1 |
56 | |||
| parsefull_table_in_link_caption | |
0.00% |
0 / 36 |
|
0.00% |
0 / 1 |
90 | |||
| parselang_variant_flag | |
0.00% |
0 / 74 |
|
0.00% |
0 / 1 |
342 | |||
| parselang_variant_name | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
182 | |||
| parselang_variant_nowiki | |
0.00% |
0 / 38 |
|
0.00% |
0 / 1 |
132 | |||
| parselang_variant_text_no_semi | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
| parselang_variant_text_no_semi_or_arrow | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
42 | |||
| discardlang_variant_text | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
156 | |||
| parsefull_table_in_link_caption_parameterized | |
0.00% |
0 / 75 |
|
0.00% |
0 / 1 |
600 | |||
| discardnowiki | |
0.00% |
0 / 54 |
|
0.00% |
0 / 1 |
182 | |||
| parsenowiki_text | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
56 | |||
| parsenowiki | |
0.00% |
0 / 54 |
|
0.00% |
0 / 1 |
182 | |||
| parse | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
420 | |||
| 1 | <?php |
| 2 | /* |
| 3 | * DO NOT EDIT MANUALLY. |
| 4 | * File generated from Grammar.pegphp with `npm run regen-php-tokenizer`. |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | namespace Wikimedia\Parsoid\Wt2Html; |
| 9 | |
| 10 | |
| 11 | use Wikimedia\Assert\UnreachableException; |
| 12 | use Wikimedia\JsonCodec\JsonCodec; |
| 13 | use Wikimedia\Parsoid\Config\Env; |
| 14 | use Wikimedia\Parsoid\Config\SiteConfig; |
| 15 | use Wikimedia\Parsoid\Core\DomSourceRange; |
| 16 | use Wikimedia\Parsoid\NodeData\DataMw; |
| 17 | use Wikimedia\Parsoid\NodeData\DataParsoid; |
| 18 | use Wikimedia\Parsoid\NodeData\TempData; |
| 19 | use Wikimedia\Parsoid\Tokens\CommentTk; |
| 20 | use Wikimedia\Parsoid\Tokens\EOFTk; |
| 21 | use Wikimedia\Parsoid\Tokens\EndTagTk; |
| 22 | use Wikimedia\Parsoid\Tokens\KV; |
| 23 | use Wikimedia\Parsoid\Tokens\KVSourceRange; |
| 24 | use Wikimedia\Parsoid\Tokens\NlTk; |
| 25 | use Wikimedia\Parsoid\Tokens\SelfclosingTagTk; |
| 26 | use Wikimedia\Parsoid\Tokens\SourceRange; |
| 27 | use Wikimedia\Parsoid\Tokens\TagTk; |
| 28 | use Wikimedia\Parsoid\Tokens\Token; |
| 29 | use Wikimedia\Parsoid\Utils\DOMDataUtils; |
| 30 | use Wikimedia\Parsoid\Utils\PHPUtils; |
| 31 | use Wikimedia\Parsoid\Utils\TokenUtils; |
| 32 | use Wikimedia\Parsoid\Utils\Utils; |
| 33 | use Wikimedia\Parsoid\Utils\WTUtils; |
| 34 | use Wikimedia\Parsoid\Wikitext\Consts; |
| 35 | |
| 36 | |
| 37 | |
| 38 | class GrammarCacheEntry { |
| 39 | public $nextPos; |
| 40 | public $result; |
| 41 | public $preproc; |
| 42 | public $th; |
| 43 | |
| 44 | |
| 45 | public function __construct( $nextPos, $result, $preproc, $th ) { |
| 46 | $this->nextPos = $nextPos; |
| 47 | $this->result = $result; |
| 48 | $this->preproc = $preproc; |
| 49 | $this->th = $th; |
| 50 | |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | |
| 55 | class Grammar extends \Wikimedia\WikiPEG\PEGParserBase { |
| 56 | // initializer |
| 57 | |
| 58 | /** @var Env */ |
| 59 | private $env; |
| 60 | |
| 61 | /** @var SiteConfig */ |
| 62 | private $siteConfig; |
| 63 | |
| 64 | /** @var array */ |
| 65 | private $pipelineOpts; |
| 66 | |
| 67 | /** @var int */ |
| 68 | private $pipelineOffset; |
| 69 | |
| 70 | private $extTags; |
| 71 | |
| 72 | private $startTime; |
| 73 | |
| 74 | /** @var string */ |
| 75 | private $reUrltextLookahead; |
| 76 | |
| 77 | /** @var string */ |
| 78 | private $urltextPlainSegment = ''; |
| 79 | |
| 80 | /** @var bool */ |
| 81 | private $urltextFoundAutolink = false; |
| 82 | |
| 83 | protected function initialize() { |
| 84 | $this->env = $this->options['env']; |
| 85 | $this->siteConfig = $this->env->getSiteConfig(); |
| 86 | |
| 87 | $tokenizer = $this->options['pegTokenizer']; |
| 88 | $this->pipelineOpts = $tokenizer->getOptions(); |
| 89 | // FIXME: inTemplate option may not always be set in |
| 90 | // standalone tokenizers user by some pipelines handlers. |
| 91 | $this->pipelineOffset = $this->options['pipelineOffset'] ?? 0; |
| 92 | $this->extTags = $this->siteConfig->getExtensionTagNameMap(); |
| 93 | |
| 94 | // Non-greedy text_char sequence: stop at ampersand, double-underscore, |
| 95 | // magic link prefix or protocol |
| 96 | $this->reUrltextLookahead = '!(?:' . |
| 97 | '([^-\'<[{\n\r:;\]}|\!=&]*?)' . |
| 98 | '(?:__|$|[-\'<[{\n\r:;\]}|\!=&]|(RFC|PMID|ISBN|' . |
| 99 | '(?i)' . $this->siteConfig->getProtocolsRegex( true ) . |
| 100 | ')))!A'; |
| 101 | } |
| 102 | |
| 103 | private $prevOffset = 0; |
| 104 | private $headingIndex = 0; |
| 105 | |
| 106 | public function resetState() { |
| 107 | $this->prevOffset = 0; |
| 108 | $this->headingIndex = 0; |
| 109 | } |
| 110 | |
| 111 | private function assert( $condition, $text ) { |
| 112 | if ( !$condition ) { |
| 113 | throw new \RuntimeException( "Grammar.pegphp assertion failure: $text" ); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | private function unreachable() { |
| 118 | throw new UnreachableException( "Grammar.pegphp: this should be unreachable" ); |
| 119 | } |
| 120 | |
| 121 | // Some shorthands for legibility |
| 122 | private function startOffset() { |
| 123 | return $this->savedPos; |
| 124 | } |
| 125 | |
| 126 | private function endOffset() { |
| 127 | return $this->currPos; |
| 128 | } |
| 129 | |
| 130 | private function tsrOffsets( $flag = 'default' ): SourceRange { |
| 131 | switch ( $flag ) { |
| 132 | case 'start': |
| 133 | return new SourceRange( $this->savedPos, $this->savedPos ); |
| 134 | case 'end': |
| 135 | return new SourceRange( $this->currPos, $this->currPos ); |
| 136 | default: |
| 137 | return new SourceRange( $this->savedPos, $this->currPos ); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | * Emit a chunk of tokens to our consumers. Once this has been done, the |
| 143 | * current expression can return an empty list (true). |
| 144 | */ |
| 145 | private function emitChunk( $tokens ) { |
| 146 | // FIXME: We don't expect nulls here, but looks like |
| 147 | // hack from I1c695ab6cdd3655e98877c175ddbabdee9dc44b7 |
| 148 | // introduces them. Work around it for now! |
| 149 | if ( !$tokens ) { |
| 150 | return []; |
| 151 | } |
| 152 | |
| 153 | // Shift tsr of all tokens by the pipeline offset |
| 154 | TokenUtils::shiftTokenTSR( $tokens, $this->pipelineOffset ); |
| 155 | $this->env->log( 'trace/peg', $this->options['pipelineId'] ?? '0', '----> ', $tokens ); |
| 156 | |
| 157 | $i = null; |
| 158 | $n = count( $tokens ); |
| 159 | |
| 160 | // Enforce parsing resource limits |
| 161 | for ( $i = 0; $i < $n; $i++ ) { |
| 162 | TokenizerUtils::enforceParserResourceLimits( $this->env, $tokens[ $i ] ); |
| 163 | } |
| 164 | |
| 165 | return $tokens; |
| 166 | } |
| 167 | |
| 168 | /* ------------------------------------------------------------------------ |
| 169 | * Extension tags should be parsed with higher priority than anything else. |
| 170 | * |
| 171 | * The trick we use is to strip out the content inside a matching tag-pair |
| 172 | * and not tokenize it. The content, if it needs to parsed (for example, |
| 173 | * for <ref>, <*include*> tags), is parsed in a fresh tokenizer context |
| 174 | * which means any error correction that needs to happen is restricted to |
| 175 | * the scope of the extension content and doesn't spill over to the higher |
| 176 | * level. Ex: <math><!--foo</math>. |
| 177 | * |
| 178 | * IGNORE: {{ this just balances the blocks in this comment for pegjs |
| 179 | * |
| 180 | * This trick also lets us prevent extension content (that don't accept WT) |
| 181 | * from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>) |
| 182 | * We don't want the "}}" being treated as a template closing tag and |
| 183 | * closing outer templates. |
| 184 | * --------------------------------------------------------------------- */ |
| 185 | |
| 186 | private function isXMLTag( string $name ): bool { |
| 187 | $lName = mb_strtolower( $name ); |
| 188 | return isset( Consts::$HTML['HTML5Tags'][$lName] ) || |
| 189 | isset( Consts::$HTML['OlderHTMLTags'][$lName] ); |
| 190 | } |
| 191 | |
| 192 | private function maybeAnnotationOrExtensionTag( Token $t, ?bool $end, array $attribs, SourceRange $tsr ) { |
| 193 | $tagName = mb_strtolower( $t->getName() ); |
| 194 | |
| 195 | $isAnnotationTag = $this->siteConfig->isAnnotationTag( $tagName ); |
| 196 | if ( !$isAnnotationTag ) { |
| 197 | $pipepos = strpos( $tagName, '|' ); |
| 198 | if ( $pipepos ) { |
| 199 | $strBeforePipe = substr( $tagName, 0, $pipepos ); |
| 200 | $isAnnotationTag = $this->siteConfig->isAnnotationTag( $strBeforePipe ); |
| 201 | if ( $isAnnotationTag ) { |
| 202 | $attribs = [ new KV( "name", substr( $tagName, $pipepos + 1, strlen( $tagName ) - $pipepos - 1 ) ) ]; |
| 203 | $tagName = $strBeforePipe; |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | if ( $isAnnotationTag ) { |
| 209 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/' . $tagName . ($end ? '/End' : '') ) ]; |
| 210 | $datamw = null; |
| 211 | if ( count( $attribs ) > 0 ) { |
| 212 | $attrMap = []; |
| 213 | foreach ( $attribs as $attr ) { |
| 214 | // If the key or the value is not a string, we replace it by the thing that generated it and |
| 215 | // consider that wikitext as a raw string instead. |
| 216 | $k = is_string( $attr->k ) ? $attr->k : $attr->ksrc; |
| 217 | $v = is_string( $attr->v ) ? $attr->v : $attr->vsrc; |
| 218 | $attrMap[$k] = $v; |
| 219 | } |
| 220 | // Possible follow-up in T295168 for attribute sanitation |
| 221 | // T367616: 'attrs' should be renamed to 'extAttrs' |
| 222 | $datamw = new DataMw( [ 'attrs' => (object)$attrMap ] ); |
| 223 | } |
| 224 | $dp = new DataParsoid(); |
| 225 | $dp->tsr = $tsr; |
| 226 | $this->env->hasAnnotations = true; |
| 227 | // FIXME: Suppress annotation meta tokens from template pipelines |
| 228 | // since they may not have TSR values and won't get recognized as |
| 229 | // annotation ranges. Without TSR, they might end up stuck in |
| 230 | // fosterable positions and cause havoc on edits by breaking selser. |
| 231 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
| 232 | return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp, $datamw ) ]; |
| 233 | } else { |
| 234 | return []; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | $isInstalledExt = isset( $this->extTags[$tagName] ); |
| 239 | $isIncludeTag = WTUtils::isIncludeTag( $tagName ); |
| 240 | |
| 241 | // Extensions have higher precedence when they shadow html tags. |
| 242 | if ( !( $isInstalledExt || $isIncludeTag ) ) { |
| 243 | return $t; |
| 244 | } |
| 245 | |
| 246 | $dp = $t->dataParsoid; |
| 247 | $skipPos = $this->currPos; |
| 248 | |
| 249 | switch ( get_class( $t ) ) { |
| 250 | case EndTagTk::class: |
| 251 | if ( $isIncludeTag ) { |
| 252 | return $t; |
| 253 | } |
| 254 | // Similar to TagTk, we rely on the sanitizer to convert to text |
| 255 | // where necessary and emit tokens to ease the wikitext escaping |
| 256 | // code. However, extension tags that shadow html tags will see |
| 257 | // their unmatched end tags dropped while tree building, since |
| 258 | // the sanitizer will let them through. |
| 259 | return $t; // not text() |
| 260 | |
| 261 | case SelfclosingTagTk::class: |
| 262 | $dp->src = $dp->tsr->substr( $this->input ); |
| 263 | $dp->extTagOffsets = new DomSourceRange( |
| 264 | $dp->tsr->start, $dp->tsr->end, |
| 265 | $dp->tsr->length(), 0 |
| 266 | ); |
| 267 | if ( $isIncludeTag ) { |
| 268 | return $t; |
| 269 | } |
| 270 | break; |
| 271 | |
| 272 | case TagTk::class: |
| 273 | $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA'; |
| 274 | $tagContentFound = preg_match( $endTagRE, $this->input, $tagContent, 0, $dp->tsr->start ); |
| 275 | |
| 276 | if ( !$tagContentFound ) { |
| 277 | $dp->src = $dp->tsr->substr( $this->input ); |
| 278 | $dp->extTagOffsets = new DomSourceRange( |
| 279 | $dp->tsr->start, $dp->tsr->end, |
| 280 | $dp->tsr->length(), 0 |
| 281 | ); |
| 282 | if ( $isIncludeTag ) { |
| 283 | return $t; |
| 284 | } else { |
| 285 | // This is undefined behaviour. The old parser currently |
| 286 | // returns text here (see core commit 674e8388cba), |
| 287 | // whereas this results in unclosed |
| 288 | // extension tags that shadow html tags falling back to |
| 289 | // their html equivalent. The sanitizer will take care |
| 290 | // of converting to text where necessary. We do this to |
| 291 | // simplify `hasWikitextTokens` when escaping wikitext, |
| 292 | // which wants these as tokens because it's otherwise |
| 293 | // lacking in context. |
| 294 | return $t; // not text() |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | $extSrc = $tagContent[0]; |
| 299 | $extEndOffset = $dp->tsr->start + strlen( $extSrc ); |
| 300 | $extEndTagWidth = strlen( $tagContent[1] ); |
| 301 | |
| 302 | if ( !empty( $this->pipelineOpts['inTemplate'] ) ) { |
| 303 | // Support nesting in extensions tags while tokenizing in templates |
| 304 | // to support the #tag parser function. |
| 305 | // |
| 306 | // It's necessary to permit this broadly in templates because |
| 307 | // there's no way to distinguish whether the nesting happened |
| 308 | // while expanding the #tag parser function, or just a general |
| 309 | // syntax errors. In other words, |
| 310 | // |
| 311 | // hi<ref>ho<ref>hi</ref>ho</ref> |
| 312 | // |
| 313 | // and |
| 314 | // |
| 315 | // hi{{#tag:ref|ho<ref>hi</ref>ho}} |
| 316 | // |
| 317 | // found in template are returned indistinguishably after a |
| 318 | // preprocessing request, though the old parser renders them |
| 319 | // differently. #tag in template is probably a common enough |
| 320 | // use case that we want to accept these false positives, |
| 321 | // though another approach could be to drop this code here, and |
| 322 | // invoke a native #tag handler and forgo those in templates. |
| 323 | // |
| 324 | // Expand `extSrc` as long as there is a <tagName> found in the |
| 325 | // extension source body. |
| 326 | $startTagRE = '~<' . preg_quote( $tagName, '~' ) . '(?:[^/>]|/(?!>))*>~i'; |
| 327 | $s = substr( $extSrc, $dp->tsr->end - $dp->tsr->start ); |
| 328 | $openTags = 0; |
| 329 | while ( true ) { |
| 330 | if ( preg_match_all( $startTagRE, $s, $matches ) ) { |
| 331 | $openTags += count( $matches[0] ); |
| 332 | } |
| 333 | if ( !$openTags ) { |
| 334 | break; |
| 335 | } |
| 336 | if ( !preg_match( $endTagRE, $this->input, $tagContent, 0, $extEndOffset ) ) { |
| 337 | break; |
| 338 | } |
| 339 | $openTags -= 1; |
| 340 | $s = $tagContent[0]; |
| 341 | $extEndOffset += strlen( $s ); |
| 342 | $extEndTagWidth = strlen( $tagContent[1] ); |
| 343 | $extSrc .= $s; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | // Extension content source |
| 348 | $dp->src = $extSrc; |
| 349 | $dp->extTagOffsets = new DomSourceRange( |
| 350 | $dp->tsr->start, $extEndOffset, |
| 351 | $dp->tsr->length(), $extEndTagWidth |
| 352 | ); |
| 353 | |
| 354 | $skipPos = $dp->extTagOffsets->innerEnd(); |
| 355 | |
| 356 | // If the xml-tag is a known installed (not native) extension, |
| 357 | // skip the end-tag as well. |
| 358 | if ( $isInstalledExt ) { |
| 359 | $skipPos = $dp->extTagOffsets->end; |
| 360 | } |
| 361 | break; |
| 362 | |
| 363 | default: |
| 364 | $this->unreachable(); |
| 365 | } |
| 366 | |
| 367 | $this->currPos = $skipPos; |
| 368 | |
| 369 | if ( $isInstalledExt ) { |
| 370 | // update tsr->end to span the start and end tags. |
| 371 | $dp->tsr->end = $this->endOffset(); // was just modified above |
| 372 | return new SelfclosingTagTk( 'extension', [ |
| 373 | new KV( 'typeof', 'mw:Extension' ), |
| 374 | new KV( 'name', $tagName ), |
| 375 | new KV( 'about', $this->env->newAboutId() ), |
| 376 | new KV( 'source', $dp->src ), |
| 377 | new KV( 'options', $t->attribs ) |
| 378 | ], $dp |
| 379 | ); |
| 380 | } elseif ( $isIncludeTag ) { |
| 381 | // Parse ext-content, strip eof, and shift tsr |
| 382 | $extContent = $dp->extTagOffsets->stripTags( $dp->src ); |
| 383 | $tokenizer = new PegTokenizer( $this->env ); |
| 384 | $tokenizer->setSourceOffsets( new SourceRange( $dp->extTagOffsets->innerStart(), $dp->extTagOffsets->innerEnd() ) ); |
| 385 | $extContentToks = $tokenizer->tokenizeSync( $extContent, [ 'sol' => true ] ); |
| 386 | if ( $dp->extTagOffsets->closeWidth > 0 ) { |
| 387 | TokenUtils::stripEOFTkFromTokens( $extContentToks ); |
| 388 | } |
| 389 | array_unshift( $extContentToks, $t ); |
| 390 | return $extContentToks; |
| 391 | } else { |
| 392 | $this->unreachable(); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | |
| 397 | // cache init |
| 398 | protected $cache = []; |
| 399 | |
| 400 | // expectations |
| 401 | protected $expectations = [ |
| 402 | 0 => ["type" => "end", "description" => "end of input"], |
| 403 | 1 => ["type" => "other", "description" => "start"], |
| 404 | 2 => ["type" => "other", "description" => "table_start_tag"], |
| 405 | 3 => ["type" => "class", "value" => "['{]", "description" => "['{]"], |
| 406 | 4 => ["type" => "literal", "value" => "&", "description" => "\"&\""], |
| 407 | 5 => ["type" => "other", "description" => "table_attributes"], |
| 408 | 6 => ["type" => "other", "description" => "generic_newline_attributes"], |
| 409 | 7 => ["type" => "any", "description" => "any character"], |
| 410 | 8 => ["type" => "other", "description" => "extlink"], |
| 411 | 9 => ["type" => "other", "description" => "tlb"], |
| 412 | 10 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"], |
| 413 | 11 => ["type" => "literal", "value" => "<!--", "description" => "\"<!--\""], |
| 414 | 12 => ["type" => "literal", "value" => "-->", "description" => "\"-->\""], |
| 415 | 13 => ["type" => "literal", "value" => "|", "description" => "\"|\""], |
| 416 | 14 => ["type" => "literal", "value" => "{{!}}", "description" => "\"{{!}}\""], |
| 417 | 15 => ["type" => "literal", "value" => "//", "description" => "\"//\""], |
| 418 | 16 => ["type" => "class", "value" => "[A-Za-z]", "description" => "[A-Za-z]"], |
| 419 | 17 => ["type" => "class", "value" => "[-A-Za-z0-9+.]", "description" => "[-A-Za-z0-9+.]"], |
| 420 | 18 => ["type" => "literal", "value" => ":", "description" => "\":\""], |
| 421 | 19 => ["type" => "literal", "value" => "[", "description" => "\"[\""], |
| 422 | 20 => ["type" => "class", "value" => "[0-9A-Fa-f:.]", "description" => "[0-9A-Fa-f:.]"], |
| 423 | 21 => ["type" => "literal", "value" => "]", "description" => "\"]\""], |
| 424 | 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{]"], |
| 425 | 23 => ["type" => "literal", "value" => "=", "description" => "\"=\""], |
| 426 | 24 => ["type" => "class", "value" => "[\\0/=>]", "description" => "[\\0/=>]"], |
| 427 | 25 => ["type" => "class", "value" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]"], |
| 428 | 26 => ["type" => "literal", "value" => ";", "description" => "\";\""], |
| 429 | 27 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""], |
| 430 | 28 => ["type" => "literal", "value" => "\x0d\x0a", "description" => "\"\\r\\n\""], |
| 431 | 29 => ["type" => "literal", "value" => "{", "description" => "\"{\""], |
| 432 | 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}]"], |
| 433 | 31 => ["type" => "class", "value" => "[\"'=]", "description" => "[\"'=]"], |
| 434 | 32 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]"], |
| 435 | 33 => ["type" => "literal", "value" => "'", "description" => "\"'\""], |
| 436 | 34 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""], |
| 437 | 35 => ["type" => "literal", "value" => "/", "description" => "\"/\""], |
| 438 | 36 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]"], |
| 439 | 37 => ["type" => "class", "value" => "[ \\t\\n\\r\\x0c]", "description" => "[ \\t\\n\\r\\x0c]"], |
| 440 | 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]"], |
| 441 | 39 => ["type" => "class", "value" => "[&|{\\-!}=]", "description" => "[&|{\\-!}=]"], |
| 442 | 40 => ["type" => "class", "value" => "[']", "description" => "[']"], |
| 443 | 41 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""], |
| 444 | 42 => ["type" => "class", "value" => "[*#:;]", "description" => "[*#:;]"], |
| 445 | 43 => ["type" => "literal", "value" => "{{", "description" => "\"{{\""], |
| 446 | 44 => ["type" => "literal", "value" => "<", "description" => "\"<\""], |
| 447 | 45 => ["type" => "class", "value" => "[^{}&<\\-!\\['\\r\\n|]", "description" => "[^{}&<\\-!\\['\\r\\n|]"], |
| 448 | 46 => ["type" => "class", "value" => "[{}&<\\-!\\[]", "description" => "[{}&<\\-!\\[]"], |
| 449 | 47 => ["type" => "class", "value" => "[^{}&<\\-!\\[\"\\r\\n|]", "description" => "[^{}&<\\-!\\[\"\\r\\n|]"], |
| 450 | 48 => ["type" => "class", "value" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]", "description" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]"], |
| 451 | 49 => ["type" => "class", "value" => "[^{}&<\\-|/'>]", "description" => "[^{}&<\\-|/'>]"], |
| 452 | 50 => ["type" => "class", "value" => "[{}&\\-|/]", "description" => "[{}&\\-|/]"], |
| 453 | 51 => ["type" => "class", "value" => "[^{}&<\\-|/\">]", "description" => "[^{}&<\\-|/\">]"], |
| 454 | 52 => ["type" => "class", "value" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]", "description" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]"], |
| 455 | 53 => ["type" => "literal", "value" => "__", "description" => "\"__\""], |
| 456 | 54 => ["type" => "class", "value" => "[^-'<[{\\n\\r:;\\]}|!=]", "description" => "[^-'<[{\\n\\r:;\\]}|!=]"], |
| 457 | 55 => ["type" => "literal", "value" => "-", "description" => "\"-\""], |
| 458 | 56 => ["type" => "literal", "value" => "''", "description" => "\"''\""], |
| 459 | 57 => ["type" => "literal", "value" => "}", "description" => "\"}\""], |
| 460 | 58 => ["type" => "class", "value" => "[ \\t\\n\\r\\0\\x0b]", "description" => "[ \\t\\n\\r\\0\\x0b]"], |
| 461 | 59 => ["type" => "literal", "value" => "----", "description" => "\"----\""], |
| 462 | 60 => ["type" => "literal", "value" => "{{{", "description" => "\"{{{\""], |
| 463 | 61 => ["type" => "literal", "value" => "}}}", "description" => "\"}}}\""], |
| 464 | 62 => ["type" => "literal", "value" => "}}", "description" => "\"}}\""], |
| 465 | 63 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""], |
| 466 | 64 => ["type" => "literal", "value" => ">", "description" => "\">\""], |
| 467 | 65 => ["type" => "literal", "value" => "/>", "description" => "\"/>\""], |
| 468 | 66 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"], |
| 469 | 67 => ["type" => "literal", "value" => "ISBN", "description" => "\"ISBN\""], |
| 470 | 68 => ["type" => "class", "value" => "[xX]", "description" => "[xX]"], |
| 471 | 69 => ["type" => "literal", "value" => "+", "description" => "\"+\""], |
| 472 | 70 => ["type" => "class", "value" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]", "description" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]"], |
| 473 | 71 => ["type" => "class", "value" => "[!<\\-\\}\\]\\n\\r]", "description" => "[!<\\-\\}\\]\\n\\r]"], |
| 474 | 72 => ["type" => "class", "value" => "[^\\t\\n\\v />\\0]", "description" => "[^\\t\\n\\v />\\0]"], |
| 475 | 73 => ["type" => "literal", "value" => "RFC", "description" => "\"RFC\""], |
| 476 | 74 => ["type" => "literal", "value" => "PMID", "description" => "\"PMID\""], |
| 477 | 75 => ["type" => "literal", "value" => "-{", "description" => "\"-{\""], |
| 478 | 76 => ["type" => "literal", "value" => "}-", "description" => "\"}-\""], |
| 479 | 77 => ["type" => "literal", "value" => "!", "description" => "\"!\""], |
| 480 | 78 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""], |
| 481 | 79 => ["type" => "literal", "value" => "||", "description" => "\"||\""], |
| 482 | 80 => ["type" => "literal", "value" => "{{!}}{{!}}", "description" => "\"{{!}}{{!}}\""], |
| 483 | 81 => ["type" => "literal", "value" => "=>", "description" => "\"=>\""], |
| 484 | 82 => ["type" => "class", "value" => "[-+A-Z]", "description" => "[-+A-Z]"], |
| 485 | 83 => ["type" => "class", "value" => "[^{}|;]", "description" => "[^{}|;]"], |
| 486 | 84 => ["type" => "class", "value" => "[a-z]", "description" => "[a-z]"], |
| 487 | 85 => ["type" => "class", "value" => "[-a-zA-Z]", "description" => "[-a-zA-Z]"], |
| 488 | ]; |
| 489 | |
| 490 | // actions |
| 491 | private function a0() { |
| 492 | |
| 493 | $this->startTime = null; |
| 494 | if ( $this->env->profiling() ) { |
| 495 | $profile = $this->env->getCurrentProfile(); |
| 496 | $this->startTime = microtime( true ); |
| 497 | } |
| 498 | return true; |
| 499 | |
| 500 | } |
| 501 | private function a1($t) { |
| 502 | |
| 503 | if ( $this->env->profiling() ) { |
| 504 | $profile = $this->env->getCurrentProfile(); |
| 505 | $profile->bumpTimeUse( |
| 506 | 'PEG', 1000 * ( microtime( true ) - $this->startTime ), 'PEG' ); |
| 507 | } |
| 508 | return true; |
| 509 | |
| 510 | } |
| 511 | private function a2($t) { |
| 512 | return $t; |
| 513 | } |
| 514 | private function a3() { |
| 515 | |
| 516 | // "tlb" matches "block" matches "sol" matches "newlineToken" |
| 517 | // But, "tlb" is prefixed with a !eof clause, so, we should only |
| 518 | // get here on eof. So, safe to unconditionally terminate the |
| 519 | // generator loop here. |
| 520 | return false; |
| 521 | |
| 522 | } |
| 523 | private function a4($t, $n) { |
| 524 | |
| 525 | if ( count( $t ) ) { |
| 526 | $ret = TokenizerUtils::flattenIfArray( $t ); |
| 527 | } else { |
| 528 | $ret = []; |
| 529 | } |
| 530 | if ( count( $n ) ) { |
| 531 | PHPUtils::pushArray($ret, $n); |
| 532 | } |
| 533 | $ret[] = new EOFTk(); |
| 534 | return $ret; |
| 535 | |
| 536 | } |
| 537 | private function a5($sc) { |
| 538 | return $this->endOffset(); |
| 539 | } |
| 540 | private function a6($sc, $startPos, $b, $p) { |
| 541 | $this->unreachable(); |
| 542 | } |
| 543 | private function a7($sc, $startPos, $b, $p, $ta) { |
| 544 | return $this->endOffset(); |
| 545 | } |
| 546 | private function a8($sc, $startPos, $b, $p, $ta, $tsEndPos, $s2) { |
| 547 | |
| 548 | $coms = TokenizerUtils::popComments( $ta ); |
| 549 | if ( $coms ) { |
| 550 | $tsEndPos = $coms['commentStartPos']; |
| 551 | } |
| 552 | |
| 553 | $dp = new DataParsoid; |
| 554 | $dp->tsr = new SourceRange( $startPos, $tsEndPos ); |
| 555 | if ( $p !== '|' ) { |
| 556 | // Variation from default |
| 557 | $dp->startTagSrc = $b . $p; |
| 558 | } |
| 559 | |
| 560 | return array_merge( $sc, |
| 561 | [ new TagTk( 'table', $ta, $dp ) ], |
| 562 | $coms ? $coms['buf'] : [], |
| 563 | $s2 ); |
| 564 | |
| 565 | } |
| 566 | private function a9($proto, $addr, $he) { |
| 567 | return $he; |
| 568 | } |
| 569 | private function a10($proto, $addr, $r) { |
| 570 | return $r; |
| 571 | } |
| 572 | private function a11($proto, $addr, $c) { |
| 573 | return $c; |
| 574 | } |
| 575 | private function a12($proto, $addr, $path) { |
| 576 | return $addr !== '' || count( $path ) > 0; |
| 577 | } |
| 578 | private function a13($proto, $addr, $path) { |
| 579 | |
| 580 | return TokenizerUtils::flattenString( array_merge( [ $proto, $addr ], $path ) ); |
| 581 | |
| 582 | } |
| 583 | private function a14($as, $s, $p) { |
| 584 | |
| 585 | return [ $as, $s, $p ]; |
| 586 | |
| 587 | } |
| 588 | private function a15($b) { |
| 589 | return $b; |
| 590 | } |
| 591 | private function a16($r) { |
| 592 | return TokenizerUtils::flattenIfArray( $r ); |
| 593 | } |
| 594 | private function a17() { |
| 595 | return $this->endOffset(); |
| 596 | } |
| 597 | private function a18($p0, $addr, $target) { |
| 598 | return TokenizerUtils::flattenString( [ $addr, $target ] ); |
| 599 | } |
| 600 | private function a19($p0, $flat) { |
| 601 | |
| 602 | // Protocol must be valid and there ought to be at least one |
| 603 | // post-protocol character. So strip last char off target |
| 604 | // before testing protocol. |
| 605 | if ( is_array( $flat ) ) { |
| 606 | // There are templates present, alas. |
| 607 | return count( $flat ) > 0; |
| 608 | } |
| 609 | return Utils::isProtocolValid( substr( $flat, 0, -1 ), $this->env ); |
| 610 | |
| 611 | } |
| 612 | private function a20($p0, $flat) { |
| 613 | return $this->endOffset(); |
| 614 | } |
| 615 | private function a21($p0, $flat, $p1, $sp) { |
| 616 | return $this->endOffset(); |
| 617 | } |
| 618 | private function a22($p0, $flat, $p1, $sp, $p2, $content) { |
| 619 | return $this->endOffset(); |
| 620 | } |
| 621 | private function a23($p0, $flat, $p1, $sp, $p2, $content, $p3) { |
| 622 | |
| 623 | $tsr1 = new SourceRange( $p0, $p1 ); |
| 624 | $tsr2 = new SourceRange( $p2, $p3 ); |
| 625 | $dp = new DataParsoid; |
| 626 | $dp->tsr = $this->tsrOffsets(); |
| 627 | $dp->getTemp()->extLinkContentOffsets = $tsr2; |
| 628 | return [ |
| 629 | new SelfclosingTagTk( |
| 630 | 'extlink', |
| 631 | [ |
| 632 | new KV( 'href', $flat, $tsr1->expandTsrV() ), |
| 633 | new KV( 'mw:content', $content ?? '', $tsr2->expandTsrV() ), |
| 634 | new KV( 'spaces', $sp ) |
| 635 | ], |
| 636 | $dp |
| 637 | ) |
| 638 | ]; |
| 639 | } |
| 640 | private function a24($r) { |
| 641 | return $r; |
| 642 | } |
| 643 | private function a25($b) { |
| 644 | |
| 645 | // Clear the tokenizer's backtracking cache after matching each |
| 646 | // toplevelblock. There won't be any backtracking as a document is just a |
| 647 | // sequence of toplevelblocks, so the cache for previous toplevelblocks |
| 648 | // will never be needed. |
| 649 | $end = $this->startOffset(); |
| 650 | for ( ; $this->prevOffset < $end; $this->prevOffset++ ) { |
| 651 | unset( $this->cache[$this->prevOffset] ); |
| 652 | } |
| 653 | |
| 654 | $tokens = null; |
| 655 | if ( is_array( $b ) && count( $b ) ) { |
| 656 | $tokens = TokenizerUtils::flattenIfArray( $b ); |
| 657 | } elseif ( is_string( $b ) ) { |
| 658 | $tokens = [ $b ]; |
| 659 | } |
| 660 | |
| 661 | // Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline. |
| 662 | return $this->emitChunk( $tokens ); |
| 663 | |
| 664 | } |
| 665 | private function a26() { |
| 666 | return [ new NlTk( $this->tsrOffsets() ) ]; |
| 667 | } |
| 668 | private function a27($c, $cEnd) { |
| 669 | |
| 670 | $data = WTUtils::encodeComment( $c ); |
| 671 | $dp = new DataParsoid; |
| 672 | $dp->tsr = $this->tsrOffsets(); |
| 673 | if ( $cEnd !== '-->' ) { |
| 674 | $dp->unclosedComment = true; |
| 675 | } |
| 676 | return [ new CommentTk( $data, $dp ) ]; |
| 677 | |
| 678 | } |
| 679 | private function a28($p) { |
| 680 | return Utils::isProtocolValid( $p, $this->env ); |
| 681 | } |
| 682 | private function a29($p) { |
| 683 | return $p; |
| 684 | } |
| 685 | private function a30($annOrExtTag, $h, $extlink, $intemplate, &$preproc, $equal, $table, $templateArg, $tableCellArg, $semicolon, $arrow, $linkdesc, $colon, &$th) { |
| 686 | |
| 687 | return TokenizerUtils::inlineBreaks( $this->input, $this->endOffset(), [ |
| 688 | 'annOrExtTag' => $annOrExtTag, |
| 689 | 'h' => $h, |
| 690 | 'extlink' => $extlink, |
| 691 | 'intemplate' => $intemplate, |
| 692 | 'preproc' => $preproc, |
| 693 | 'equal' => $equal, |
| 694 | 'table' => $table, |
| 695 | 'templateArg' => $templateArg, |
| 696 | 'tableCellArg' => $tableCellArg, |
| 697 | 'semicolon' => $semicolon, |
| 698 | 'arrow' => $arrow, |
| 699 | 'linkdesc' => $linkdesc, |
| 700 | 'colon' => $colon, |
| 701 | 'th' => $th |
| 702 | ], $this->env ); |
| 703 | |
| 704 | } |
| 705 | private function a31($t) { |
| 706 | |
| 707 | return $t; |
| 708 | |
| 709 | } |
| 710 | private function a32($cc) { |
| 711 | |
| 712 | // if this is an invalid entity, don't tag it with 'mw:Entity' |
| 713 | // note that some entities (like ∾̳) decode to 2 codepoints! |
| 714 | if ( mb_strlen( $cc ) > 2 /* decoded entity would be 1-2 codepoints */ ) { |
| 715 | return $cc; |
| 716 | } |
| 717 | $dpStart = new DataParsoid; |
| 718 | $dpStart->src = $this->text(); |
| 719 | $dpStart->srcContent = $cc; |
| 720 | $dpStart->tsr = $this->tsrOffsets( 'start' ); |
| 721 | $dpEnd = new DataParsoid; |
| 722 | $dpEnd->tsr = $this->tsrOffsets( 'end' ); |
| 723 | return [ |
| 724 | // If this changes, the nowiki extension's toDOM will need to follow suit |
| 725 | new TagTk( 'span', [ new KV( 'typeof', 'mw:Entity' ) ], $dpStart ), |
| 726 | $cc, |
| 727 | new EndTagTk( 'span', [], $dpEnd ) |
| 728 | ]; |
| 729 | |
| 730 | } |
| 731 | private function a33($s) { |
| 732 | return $this->endOffset(); |
| 733 | } |
| 734 | private function a34($s, $namePos0, $name) { |
| 735 | return $this->endOffset(); |
| 736 | } |
| 737 | private function a35($s, $namePos0, $name, $namePos1, $v) { |
| 738 | return $v; |
| 739 | } |
| 740 | private function a36($s, $namePos0, $name, $namePos1, $vd) { |
| 741 | |
| 742 | // NB: Keep in sync w/ generic_newline_attribute |
| 743 | $res = null; |
| 744 | // Encapsulate protected attributes. |
| 745 | if ( gettype( $name ) === 'string' ) { |
| 746 | $name = TokenizerUtils::protectAttrs( $name ); |
| 747 | } |
| 748 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
| 749 | if ( $vd !== null ) { |
| 750 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
| 751 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
| 752 | } else { |
| 753 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
| 754 | } |
| 755 | if ( is_array( $name ) ) { |
| 756 | $res->ksrc = $nameSO->substr( $this->input ); |
| 757 | } |
| 758 | return $res; |
| 759 | |
| 760 | } |
| 761 | private function a37($s) { |
| 762 | |
| 763 | if ( $s !== '' ) { |
| 764 | return [ $s ]; |
| 765 | } else { |
| 766 | return []; |
| 767 | } |
| 768 | |
| 769 | } |
| 770 | private function a38($c) { |
| 771 | return new KV( $c, '' ); |
| 772 | } |
| 773 | private function a39($namePos0, $name) { |
| 774 | return $this->endOffset(); |
| 775 | } |
| 776 | private function a40($namePos0, $name, $namePos1, $v) { |
| 777 | return $v; |
| 778 | } |
| 779 | private function a41($namePos0, $name, $namePos1, $vd) { |
| 780 | |
| 781 | // NB: Keep in sync w/ table_attibute |
| 782 | $res = null; |
| 783 | // Encapsulate protected attributes. |
| 784 | if ( is_string( $name ) ) { |
| 785 | $name = TokenizerUtils::protectAttrs( $name ); |
| 786 | } |
| 787 | $nameSO = new SourceRange( $namePos0, $namePos1 ); |
| 788 | if ( $vd !== null ) { |
| 789 | $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) ); |
| 790 | $res->vsrc = $vd['srcOffsets']->substr( $this->input ); |
| 791 | } else { |
| 792 | $res = new KV( $name, '', $nameSO->expandTsrK() ); |
| 793 | } |
| 794 | if ( is_array( $name ) ) { |
| 795 | $res->ksrc = $nameSO->substr( $this->input ); |
| 796 | } |
| 797 | return $res; |
| 798 | |
| 799 | } |
| 800 | private function a42($s) { |
| 801 | return $s; |
| 802 | } |
| 803 | private function a43($c) { |
| 804 | |
| 805 | return TokenizerUtils::flattenStringlist( $c ); |
| 806 | |
| 807 | } |
| 808 | private function a44($lc) { |
| 809 | return $lc; |
| 810 | } |
| 811 | private function a45($bullets, $colons, $d) { |
| 812 | |
| 813 | $bulletToks = []; |
| 814 | // Leave bullets as an array -- list handler expects this |
| 815 | // TSR: +1 for the leading ";" |
| 816 | $numBullets = count( $bullets ) + 1; |
| 817 | $tsr = $this->tsrOffsets( 'start' ); |
| 818 | $tsr->end += $numBullets; |
| 819 | $li1Bullets = $bullets; |
| 820 | $li1Bullets[] = ';'; |
| 821 | $dp = new DataParsoid; |
| 822 | $dp->tsr = $tsr; |
| 823 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li1Bullets, $tsr->expandTsrV() ) ], $dp ); |
| 824 | foreach ( $colons as $colon) { |
| 825 | if ( $colon[0] ) { // can be null because of "?" in dtdd_colon |
| 826 | $bulletToks[] = $colon[0]; |
| 827 | } |
| 828 | $cpos = $colon[1]; |
| 829 | // TSR: -1 for the intermediate ":" |
| 830 | $li2Bullets = $bullets; |
| 831 | $li2Bullets[] = ':'; |
| 832 | $tsr2 = new SourceRange( $cpos - 1, $cpos ); |
| 833 | $dp2 = new DataParsoid; |
| 834 | $dp2->tsr = $tsr2; |
| 835 | $dp2->stx = 'row'; |
| 836 | $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li2Bullets, $tsr2->expandTsrV() ) ], $dp2 ); |
| 837 | } |
| 838 | |
| 839 | if ( $d ) { |
| 840 | $bulletToks = array_merge( $bulletToks, $d ); |
| 841 | } |
| 842 | return $bulletToks; |
| 843 | |
| 844 | } |
| 845 | private function a46($bullets, $tbl, $line) { |
| 846 | |
| 847 | // Leave bullets as an array -- list handler expects this |
| 848 | $tsr = $this->tsrOffsets( 'start' ); |
| 849 | $tsr->end += count( $bullets ); |
| 850 | $dp = new DataParsoid; |
| 851 | $dp->tsr = $tsr; |
| 852 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
| 853 | return TokenizerUtils::flattenIfArray( [ $li, $tbl, $line ?: [] ] ); |
| 854 | |
| 855 | } |
| 856 | private function a47($bullets, $c) { |
| 857 | |
| 858 | // Leave bullets as an array -- list handler expects this |
| 859 | $tsr = $this->tsrOffsets( 'start' ); |
| 860 | $tsr->end += count( $bullets ); |
| 861 | $dp = new DataParsoid; |
| 862 | $dp->tsr = $tsr; |
| 863 | $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp ); |
| 864 | return array_merge( [ $li ], $c ?: [] ); |
| 865 | |
| 866 | } |
| 867 | private function a48() { |
| 868 | return $this->endOffset() === $this->inputLength; |
| 869 | } |
| 870 | private function a49($r, $cil, $bl) { |
| 871 | |
| 872 | return array_merge( [ $r ], $cil, $bl ?: [] ); |
| 873 | |
| 874 | } |
| 875 | private function a50($a) { |
| 876 | return $a; |
| 877 | } |
| 878 | private function a51($a, $b) { |
| 879 | return [ $a, $b ]; |
| 880 | } |
| 881 | private function a52($m) { |
| 882 | |
| 883 | return Utils::decodeWtEntities( $m ); |
| 884 | |
| 885 | } |
| 886 | private function a53($q, $x, $ill) { |
| 887 | return array_merge( $x, $ill ?: [] ); |
| 888 | } |
| 889 | private function a54($q, $t) { |
| 890 | return $t; |
| 891 | } |
| 892 | private function a55($q, $r) { |
| 893 | return count( $r ) > 0 || $q !== ''; |
| 894 | } |
| 895 | private function a56($q, $r) { |
| 896 | |
| 897 | array_unshift( $r, $q ); |
| 898 | return TokenizerUtils::flattenString( $r ); |
| 899 | |
| 900 | } |
| 901 | private function a57($s, $t, $q) { |
| 902 | |
| 903 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() - strlen( $q ) ); |
| 904 | |
| 905 | } |
| 906 | private function a58($s, $t) { |
| 907 | |
| 908 | return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() ); |
| 909 | |
| 910 | } |
| 911 | private function a59($r) { |
| 912 | |
| 913 | return TokenizerUtils::flattenString( $r ); |
| 914 | |
| 915 | } |
| 916 | private function a60() { |
| 917 | |
| 918 | if ( preg_match( $this->reUrltextLookahead, $this->input, $m, 0, $this->currPos ) ) { |
| 919 | $plain = $m[1]; |
| 920 | $this->urltextPlainSegment = $plain; |
| 921 | $this->urltextFoundAutolink = ( $m[2] ?? '' ) !== ''; |
| 922 | return (bool)strlen( $plain ); |
| 923 | } else { |
| 924 | $this->urltextFoundAutolink = false; |
| 925 | return false; |
| 926 | } |
| 927 | |
| 928 | } |
| 929 | private function a61() { |
| 930 | |
| 931 | $this->currPos += strlen( $this->urltextPlainSegment ); |
| 932 | return $this->urltextPlainSegment; |
| 933 | |
| 934 | } |
| 935 | private function a62() { |
| 936 | return $this->urltextFoundAutolink; |
| 937 | } |
| 938 | private function a63($al) { |
| 939 | return $al; |
| 940 | } |
| 941 | private function a64($he) { |
| 942 | return $he; |
| 943 | } |
| 944 | private function a65($bs) { |
| 945 | return $bs; |
| 946 | } |
| 947 | private function a66($c) { |
| 948 | return $this->endOffset(); |
| 949 | } |
| 950 | private function a67($c, $cpos) { |
| 951 | |
| 952 | return [ $c, $cpos ]; |
| 953 | |
| 954 | } |
| 955 | private function a68($tl) { |
| 956 | |
| 957 | return $tl; |
| 958 | |
| 959 | } |
| 960 | private function a69() { |
| 961 | return $this->endOffset() === 0 && !$this->pipelineOffset; |
| 962 | } |
| 963 | private function a70($rw, $sp, $c, $wl) { |
| 964 | |
| 965 | return count( $wl ) === 1 && $wl[0] instanceof Token; |
| 966 | |
| 967 | } |
| 968 | private function a71($rw, $sp, $c, $wl) { |
| 969 | |
| 970 | $link = $wl[0]; |
| 971 | if ( $sp ) { |
| 972 | $rw .= $sp; |
| 973 | } |
| 974 | if ( $c ) { |
| 975 | $rw .= $c; |
| 976 | } |
| 977 | // Build a redirect token |
| 978 | $dp = new DataParsoid; |
| 979 | $dp->src = $rw; |
| 980 | $dp->tsr = $this->tsrOffsets(); |
| 981 | $dp->linkTk = $link; |
| 982 | $redirect = new SelfclosingTagTk( 'mw:redirect', |
| 983 | // Put 'href' into attributes so it gets template-expanded |
| 984 | [ $link->getAttributeKV( 'href' ) ], |
| 985 | $dp |
| 986 | ); |
| 987 | return $redirect; |
| 988 | |
| 989 | } |
| 990 | private function a72($st, $tl) { |
| 991 | |
| 992 | return array_merge( $st, $tl ); |
| 993 | |
| 994 | } |
| 995 | private function a73($s, $os, $so) { |
| 996 | return array_merge( $os, $so ); |
| 997 | } |
| 998 | private function a74($s, $s2, $bl) { |
| 999 | |
| 1000 | return array_merge( $s, $s2 ?: [], $bl ); |
| 1001 | |
| 1002 | } |
| 1003 | private function a75(&$preproc, $t) { |
| 1004 | |
| 1005 | $preproc = null; |
| 1006 | return $t; |
| 1007 | |
| 1008 | } |
| 1009 | private function a76($v) { |
| 1010 | return $v; |
| 1011 | } |
| 1012 | private function a77($e) { |
| 1013 | return $e; |
| 1014 | } |
| 1015 | private function a78($tag) { |
| 1016 | return $tag; |
| 1017 | } |
| 1018 | private function a79() { |
| 1019 | return Utils::isUniWord(Utils::lastUniChar( $this->input, $this->endOffset() ) ); |
| 1020 | } |
| 1021 | private function a80($bs) { |
| 1022 | |
| 1023 | if ( $this->siteConfig->isBehaviorSwitch( $bs ) ) { |
| 1024 | $dp = new DataParsoid; |
| 1025 | $dp->tsr = $this->tsrOffsets(); |
| 1026 | $dp->src = $bs; |
| 1027 | $dp->magicSrc = $bs; |
| 1028 | return [ |
| 1029 | new SelfclosingTagTk( 'behavior-switch', [ new KV( 'word', $bs ) ], $dp ) |
| 1030 | ]; |
| 1031 | } else { |
| 1032 | return [ $bs ]; |
| 1033 | } |
| 1034 | |
| 1035 | } |
| 1036 | private function a81($quotes) { |
| 1037 | |
| 1038 | // sequences of four or more than five quotes are assumed to start |
| 1039 | // with some number of plain-text apostrophes. |
| 1040 | $plainticks = 0; |
| 1041 | $result = []; |
| 1042 | if ( strlen( $quotes ) === 4 ) { |
| 1043 | $plainticks = 1; |
| 1044 | } elseif ( strlen( $quotes ) > 5 ) { |
| 1045 | $plainticks = strlen( $quotes ) - 5; |
| 1046 | } |
| 1047 | if ( $plainticks > 0 ) { |
| 1048 | $result[] = substr( $quotes, 0, $plainticks ); |
| 1049 | } |
| 1050 | // mw-quote token will be consumed in token transforms |
| 1051 | $tsr = $this->tsrOffsets(); |
| 1052 | $tsr->start += $plainticks; |
| 1053 | $dp = new DataParsoid; |
| 1054 | $dp->tsr = $tsr; |
| 1055 | $mwq = new SelfclosingTagTk( 'mw-quote', |
| 1056 | [ new KV( 'value', substr( $quotes, $plainticks ) ) ], |
| 1057 | $dp ); |
| 1058 | if ( strlen( $quotes ) > 2 ) { |
| 1059 | $mwq->addAttribute( 'isSpace_1', $tsr->start > 0 && substr( $this->input, $tsr->start - 1, 1 ) === ' '); |
| 1060 | $mwq->addAttribute( 'isSpace_2', $tsr->start > 1 && substr( $this->input, $tsr->start - 2, 1 ) === ' '); |
| 1061 | } |
| 1062 | $result[] = $mwq; |
| 1063 | return $result; |
| 1064 | |
| 1065 | } |
| 1066 | private function a82($sc, $startPos, $p, $b) { |
| 1067 | |
| 1068 | $dp = new DataParsoid; |
| 1069 | $dp->tsr = new SourceRange( $startPos, $this->endOffset() ); |
| 1070 | $tblEnd = new EndTagTk( 'table', [], $dp ); |
| 1071 | if ( $p !== '|' ) { |
| 1072 | // p+"<brace-char>" is triggering some bug in pegJS |
| 1073 | // I cannot even use that expression in the comment! |
| 1074 | $tblEnd->dataParsoid->endTagSrc = $p . $b; |
| 1075 | } |
| 1076 | array_push( $sc, $tblEnd ); |
| 1077 | return $sc; |
| 1078 | |
| 1079 | } |
| 1080 | private function a83($sp) { |
| 1081 | return $this->endOffset(); |
| 1082 | } |
| 1083 | private function a84($sp, $p, $c) { |
| 1084 | |
| 1085 | $dp = new DataParsoid; |
| 1086 | $dp->tsr = new SourceRange( $p, $this->endOffset() ); |
| 1087 | $dp->tokens = TokenizerUtils::flattenIfArray( $c ); |
| 1088 | return [ |
| 1089 | $sp, |
| 1090 | new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:EmptyLine' ) ], $dp ) |
| 1091 | ]; |
| 1092 | |
| 1093 | } |
| 1094 | private function a85() { |
| 1095 | |
| 1096 | // Use the sol flag only at the start of the input |
| 1097 | // Flag should always be an actual boolean (not falsy or undefined) |
| 1098 | $this->assert( is_bool( $this->options['sol'] ), 'sol should be boolean' ); |
| 1099 | return $this->endOffset() === 0 && $this->options['sol']; |
| 1100 | |
| 1101 | } |
| 1102 | private function a86() { |
| 1103 | |
| 1104 | return []; |
| 1105 | |
| 1106 | } |
| 1107 | private function a87($rw) { |
| 1108 | |
| 1109 | return preg_match( $this->env->getSiteConfig()->getMagicWordMatcher( 'redirect' ), $rw ); |
| 1110 | |
| 1111 | } |
| 1112 | private function a88($il, $sol_il) { |
| 1113 | |
| 1114 | $il = $il[0]; |
| 1115 | $lname = mb_strtolower( $il->getName() ); |
| 1116 | if ( !WTUtils::isIncludeTag( $lname ) ) { return false; } |
| 1117 | // Preserve SOL where necessary (for onlyinclude and noinclude) |
| 1118 | // Note that this only works because we encounter <*include*> tags in |
| 1119 | // the toplevel content and we rely on the php preprocessor to expand |
| 1120 | // templates, so we shouldn't ever be tokenizing inInclude. |
| 1121 | // Last line should be empty (except for comments) |
| 1122 | if ( $lname !== 'includeonly' && $sol_il && $il instanceof TagTk ) { |
| 1123 | $dp = $il->dataParsoid; |
| 1124 | $inclContent = $dp->extTagOffsets->stripTags( $dp->src ); |
| 1125 | $nlpos = strrpos( $inclContent, "\n" ); |
| 1126 | $last = $nlpos === false ? $inclContent : substr( $inclContent, $nlpos + 1 ); |
| 1127 | if ( !preg_match( '/^(<!--([^-]|-(?!->))*-->)*$/D', $last ) ) { |
| 1128 | return false; |
| 1129 | } |
| 1130 | } |
| 1131 | return true; |
| 1132 | |
| 1133 | } |
| 1134 | private function a89($il, $sol_il) { |
| 1135 | |
| 1136 | return $il; |
| 1137 | |
| 1138 | } |
| 1139 | private function a90($annToken) { |
| 1140 | |
| 1141 | return ( $annToken instanceof Token && $annToken->getName() !== 'extension' ); |
| 1142 | |
| 1143 | } |
| 1144 | private function a91($annToken) { |
| 1145 | return $annToken; |
| 1146 | } |
| 1147 | private function a92($s, $ill) { |
| 1148 | return $ill ?: []; |
| 1149 | } |
| 1150 | private function a93($s, $ce) { |
| 1151 | return $ce || strlen( $s ) > 2; |
| 1152 | } |
| 1153 | private function a94($s, $ce) { |
| 1154 | return $this->endOffset(); |
| 1155 | } |
| 1156 | private function a95($s, $ce, $endTPos, $spc) { |
| 1157 | |
| 1158 | $c = null; |
| 1159 | $e = null; |
| 1160 | $level = null; |
| 1161 | if ( $ce ) { |
| 1162 | $c = $ce[0]; |
| 1163 | $e = $ce[1]; |
| 1164 | $level = min( strlen( $s ), strlen( $e ) ); |
| 1165 | } else { |
| 1166 | // split up equal signs into two equal parts, with at least |
| 1167 | // one character in the middle. |
| 1168 | $level = (int)floor( ( strlen( $s ) - 1 ) / 2 ); |
| 1169 | $c = [ str_repeat( '=', strlen( $s ) - 2 * $level ) ]; |
| 1170 | $s = $e = str_repeat( '=', $level ); |
| 1171 | } |
| 1172 | $level = min( 6, $level ); |
| 1173 | // convert surplus equals into text |
| 1174 | if ( strlen( $s ) > $level ) { |
| 1175 | $extras1 = substr( $s, 0, strlen( $s ) - $level ); |
| 1176 | if ( is_string( $c[0] ) ) { |
| 1177 | $c[0] = $extras1 . $c[0]; |
| 1178 | } else { |
| 1179 | array_unshift( $c, $extras1 ); |
| 1180 | } |
| 1181 | } |
| 1182 | if ( strlen( $e ) > $level ) { |
| 1183 | $extras2 = substr( $e, 0, strlen( $e ) - $level ); |
| 1184 | $lastElem = PHPUtils::lastItem( $c ); |
| 1185 | if ( is_string( $lastElem ) ) { |
| 1186 | $c[count( $c ) - 1] .= $extras2; |
| 1187 | } else { |
| 1188 | $c[] = $extras2; |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | $tagDP = new DataParsoid; |
| 1193 | $tagDP->tsr = $this->tsrOffsets( 'start' ); |
| 1194 | $tagDP->tsr->end += $level; |
| 1195 | // Match the old parser's behavior by |
| 1196 | // (a) making headingIndex part of tokenizer state |
| 1197 | // (don't reuse pipeline! see $this->resetState above) |
| 1198 | // (b) assigning the index when ==*== is tokenized, |
| 1199 | // even if we're inside a template argument |
| 1200 | // or other context which won't end up putting the heading |
| 1201 | // on the output page. T213468/T214538 |
| 1202 | $this->headingIndex++; |
| 1203 | $tagDP->getTemp()->headingIndex = $this->headingIndex; |
| 1204 | $res = [ new TagTk( 'h' . $level, [], $tagDP ) ]; |
| 1205 | |
| 1206 | PHPUtils::pushArray( $res, $c ); |
| 1207 | |
| 1208 | $endTagDP = new DataParsoid; |
| 1209 | $endTagDP->tsr = new SourceRange( $endTPos - $level, $endTPos ); |
| 1210 | $res[] = new EndTagTk( 'h' . $level, [], $endTagDP ); |
| 1211 | $res[] = $spc; |
| 1212 | return $res; |
| 1213 | |
| 1214 | } |
| 1215 | private function a96($d) { |
| 1216 | return null; |
| 1217 | } |
| 1218 | private function a97($d) { |
| 1219 | return true; |
| 1220 | } |
| 1221 | private function a98($d, $lineContent) { |
| 1222 | |
| 1223 | $dataParsoid = new DataParsoid; |
| 1224 | $dataParsoid->tsr = $this->tsrOffsets(); |
| 1225 | if ( $lineContent !== null ) { |
| 1226 | $dataParsoid->lineContent = $lineContent; |
| 1227 | } |
| 1228 | if ( strlen( $d ) > 0 ) { |
| 1229 | $dataParsoid->extra_dashes = strlen( $d ); |
| 1230 | } |
| 1231 | return [new SelfclosingTagTk( 'hr', [], $dataParsoid )]; |
| 1232 | |
| 1233 | } |
| 1234 | private function a99($p, $target) { |
| 1235 | return $this->endOffset(); |
| 1236 | } |
| 1237 | private function a100($p, $target, $p0, $v) { |
| 1238 | return $this->endOffset(); |
| 1239 | } |
| 1240 | private function a101($p, $target, $p0, $v, $p1) { |
| 1241 | |
| 1242 | // empty argument |
| 1243 | return [ 'tokens' => $v, 'srcOffsets' => new SourceRange( $p0, $p1 ) ]; |
| 1244 | |
| 1245 | } |
| 1246 | private function a102($p, $target, $r) { |
| 1247 | return $r; |
| 1248 | } |
| 1249 | private function a103($p, $target, $params) { |
| 1250 | |
| 1251 | $kvs = []; |
| 1252 | |
| 1253 | if ( $target === null ) { |
| 1254 | $target = [ 'tokens' => '', 'srcOffsets' => new SourceRange( $p, $p ) ]; |
| 1255 | } |
| 1256 | // Insert target as first positional attribute, so that it can be |
| 1257 | // generically expanded. The TemplateHandler then needs to shift it out |
| 1258 | // again. |
| 1259 | $kvs[] = new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ); |
| 1260 | |
| 1261 | foreach ( $params as $o ) { |
| 1262 | $s = $o['srcOffsets']; |
| 1263 | $kvs[] = new KV( '', TokenizerUtils::flattenIfArray( $o['tokens'] ), $s->expandTsrV() ); |
| 1264 | } |
| 1265 | |
| 1266 | $dp = new DataParsoid; |
| 1267 | $dp->tsr = $this->tsrOffsets(); |
| 1268 | $dp->src = $this->text(); |
| 1269 | $obj = new SelfclosingTagTk( 'templatearg', $kvs, $dp ); |
| 1270 | return $obj; |
| 1271 | |
| 1272 | } |
| 1273 | private function a104($leadWS, $target) { |
| 1274 | return $this->endOffset(); |
| 1275 | } |
| 1276 | private function a105($leadWS, $target, $p0, $v) { |
| 1277 | return $this->endOffset(); |
| 1278 | } |
| 1279 | private function a106($leadWS, $target, $p0, $v, $p1) { |
| 1280 | |
| 1281 | // empty argument |
| 1282 | $tsr0 = new SourceRange( $p0, $p1 ); |
| 1283 | return new KV( '', TokenizerUtils::flattenIfArray( $v ), $tsr0->expandTsrV() ); |
| 1284 | |
| 1285 | } |
| 1286 | private function a107($leadWS, $target, $r) { |
| 1287 | return $r; |
| 1288 | } |
| 1289 | private function a108($leadWS, $target, $params, $trailWS) { |
| 1290 | |
| 1291 | // Insert target as first positional attribute, so that it can be |
| 1292 | // generically expanded. The TemplateHandler then needs to shift it out |
| 1293 | // again. |
| 1294 | array_unshift( $params, new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ) ); |
| 1295 | $dp = new DataParsoid; |
| 1296 | $dp->tsr = $this->tsrOffsets(); |
| 1297 | $dp->src = $this->text(); |
| 1298 | $tmp = $dp->getTemp(); |
| 1299 | $tmp->leadWS = $leadWS; |
| 1300 | $tmp->trailWS = $trailWS; |
| 1301 | $obj = new SelfclosingTagTk( 'template', $params, $dp ); |
| 1302 | return $obj; |
| 1303 | |
| 1304 | } |
| 1305 | private function a109($spos, $target) { |
| 1306 | return $this->endOffset(); |
| 1307 | } |
| 1308 | private function a110($spos, $target, $tpos, $lcs) { |
| 1309 | |
| 1310 | $pipeTrick = count( $lcs ) === 1 && count( $lcs[0]->v ) === 0; |
| 1311 | $textTokens = []; |
| 1312 | if ( $target === null || $pipeTrick ) { |
| 1313 | $textTokens[] = '[['; |
| 1314 | if ( $target ) { |
| 1315 | $textTokens[] = $target; |
| 1316 | } |
| 1317 | foreach ( $lcs as $a ) { |
| 1318 | // a is a mw:maybeContent attribute |
| 1319 | $textTokens[] = '|'; |
| 1320 | if ( count( $a->v ) > 0 ) { |
| 1321 | $textTokens[] = $a->v; |
| 1322 | } |
| 1323 | } |
| 1324 | $textTokens[] = ']]'; |
| 1325 | return $textTokens; |
| 1326 | } |
| 1327 | $obj = new SelfclosingTagTk( 'wikilink' ); |
| 1328 | $tsr = new SourceRange( $spos, $tpos ); |
| 1329 | $hrefKV = new KV( 'href', $target, $tsr->expandTsrV() ); |
| 1330 | $hrefKV->vsrc = $tsr->substr( $this->input ); |
| 1331 | // XXX: Point to object with path, revision and input information |
| 1332 | // obj.source = input; |
| 1333 | $obj->attribs[] = $hrefKV; |
| 1334 | $obj->attribs = array_merge( $obj->attribs, $lcs ); |
| 1335 | $dp = new DataParsoid; |
| 1336 | $dp->tsr = $this->tsrOffsets(); |
| 1337 | $dp->src = $this->text(); |
| 1338 | $obj->dataParsoid = $dp; |
| 1339 | return [ $obj ]; |
| 1340 | |
| 1341 | } |
| 1342 | private function a111(&$preproc) { |
| 1343 | $preproc = null; return true; |
| 1344 | } |
| 1345 | private function a112(&$preproc, $a) { |
| 1346 | |
| 1347 | return $a; |
| 1348 | |
| 1349 | } |
| 1350 | private function a113($extToken) { |
| 1351 | return !$extToken || $extToken[0]->getName() === 'extension' || |
| 1352 | ($extToken[0]->getName() === 'meta' && preg_match( WTUtils::ANNOTATION_META_TYPE_REGEXP, $extToken[0]->getAttributeV( 'typeof' ) ?? '' ) > 0); |
| 1353 | } |
| 1354 | private function a114($extToken) { |
| 1355 | return !$extToken ? '' : $extToken[0]; |
| 1356 | } |
| 1357 | private function a115() { |
| 1358 | |
| 1359 | $this->assert( |
| 1360 | $this->input[$this->currPos - 1] === '<', |
| 1361 | 'Failed to open xmlish_tag before entering.' |
| 1362 | ); |
| 1363 | return true; |
| 1364 | |
| 1365 | } |
| 1366 | private function a116($end, $name, $annOrExtTag) { |
| 1367 | |
| 1368 | if ( $annOrExtTag ) { |
| 1369 | return WTUtils::isAnnOrExtTag( $this->env, $name ); |
| 1370 | } else { |
| 1371 | // Only enforce ascii alpha first char for non-extension tags. |
| 1372 | // See tag_name above for the details. |
| 1373 | return preg_match( '/^[A-Za-z]/', $name ) && $this->isXMLTag( $name ); |
| 1374 | } |
| 1375 | |
| 1376 | } |
| 1377 | private function a117($end, $name, $annOrExtTag, $attribs, $selfclose) { |
| 1378 | |
| 1379 | $lcName = mb_strtolower( $name ); |
| 1380 | |
| 1381 | // Extension tags don't necessarily have the same semantics as html tags, |
| 1382 | // so don't treat them as void elements. |
| 1383 | $isVoidElt = Utils::isVoidElement( $lcName ) && !$annOrExtTag; |
| 1384 | |
| 1385 | // Support </br> |
| 1386 | if ( $lcName === 'br' && $end ) { |
| 1387 | $end = null; |
| 1388 | } |
| 1389 | |
| 1390 | $tsr = $this->tsrOffsets(); |
| 1391 | $tsr->start--; // For "<" matched at the start of xmlish_tag rule |
| 1392 | $res = TokenizerUtils::buildXMLTag( $name, $lcName, $attribs, $end, !!$selfclose || $isVoidElt, $tsr ); |
| 1393 | |
| 1394 | // change up data-attribs in one scenario |
| 1395 | // void-elts that aren't self-closed ==> useful for accurate RT-ing |
| 1396 | if ( !$selfclose && $isVoidElt ) { |
| 1397 | unset( $res->dataParsoid->selfClose ); |
| 1398 | $res->dataParsoid->noClose = true; |
| 1399 | } |
| 1400 | |
| 1401 | $met = $this->maybeAnnotationOrExtensionTag( $res, $end, $attribs, $tsr ); |
| 1402 | return is_array( $met ) ? $met : [ $met ]; |
| 1403 | |
| 1404 | } |
| 1405 | private function a118() { |
| 1406 | return $this->env->hasAnnotations && $this->siteConfig->isAnnotationTag( 'tvar' ); |
| 1407 | } |
| 1408 | private function a119() { |
| 1409 | |
| 1410 | $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/tvar/End' ) ]; |
| 1411 | $dp = new DataParsoid(); |
| 1412 | $dp->tsr = $this->tsrOffsets(); |
| 1413 | $dp->tsr->start--; // For "<" matched at the start of xmlish_tag rule |
| 1414 | if ( empty( $this->pipelineOpts['inTemplate'] ) ) { |
| 1415 | return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ) ]; |
| 1416 | } else { |
| 1417 | // suppress meta tags from pipeline output |
| 1418 | return []; |
| 1419 | } |
| 1420 | |
| 1421 | } |
| 1422 | private function a120($proto, $addr, $rhe) { |
| 1423 | return $rhe === '<' || $rhe === '>' || $rhe === "\u{A0}"; |
| 1424 | } |
| 1425 | private function a121($proto, $addr, $path) { |
| 1426 | |
| 1427 | // as in Parser.php::makeFreeExternalLink, we're going to |
| 1428 | // yank trailing punctuation out of this match. |
| 1429 | $url = TokenizerUtils::flattenStringlist( array_merge( [ $proto, $addr ], $path ) ); |
| 1430 | // only need to look at last element; HTML entities are strip-proof. |
| 1431 | $last = PHPUtils::lastItem( $url ); |
| 1432 | $trim = 0; |
| 1433 | if ( is_string( $last ) ) { |
| 1434 | $strip = TokenizerUtils::getAutoUrlTerminatingChars( in_array( '(', $path, true ) ); |
| 1435 | $trim = strspn( strrev( $last ), $strip ); |
| 1436 | $url[ count( $url ) - 1 ] = substr( $last, 0, strlen( $last ) - $trim ); |
| 1437 | } |
| 1438 | $url = TokenizerUtils::flattenStringlist( $url ); |
| 1439 | if ( count( $url ) === 1 && is_string( $url[0] ) && strlen( $url[0] ) <= strlen( $proto ) ) { |
| 1440 | return null; // ensure we haven't stripped everything: T106945 |
| 1441 | } |
| 1442 | $this->currPos -= $trim; |
| 1443 | return $url; |
| 1444 | |
| 1445 | } |
| 1446 | private function a122($r) { |
| 1447 | return $r !== null; |
| 1448 | } |
| 1449 | private function a123($r) { |
| 1450 | |
| 1451 | $tsr = $this->tsrOffsets(); |
| 1452 | $dp = new DataParsoid; |
| 1453 | $dp->tsr = $tsr; |
| 1454 | $res = [ new SelfclosingTagTk( 'urllink', [ new KV( 'href', $r, $tsr->expandTsrV() ) ], $dp ) ]; |
| 1455 | return $res; |
| 1456 | |
| 1457 | } |
| 1458 | private function a124($ref, $sp, $identifier) { |
| 1459 | |
| 1460 | $base_urls = [ |
| 1461 | 'RFC' => 'https://datatracker.ietf.org/doc/html/rfc%s', |
| 1462 | 'PMID' => '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract' |
| 1463 | ]; |
| 1464 | $tsr = $this->tsrOffsets(); |
| 1465 | $dp = new DataParsoid; |
| 1466 | $dp->tsr = $tsr; |
| 1467 | $dp->stx = 'magiclink'; |
| 1468 | $this->env->getDataAccess()->addTrackingCategory( |
| 1469 | $this->env->getPageConfig(), |
| 1470 | $this->env->getMetadata(), |
| 1471 | 'magiclink-tracking-' . strtolower($ref) |
| 1472 | ); |
| 1473 | return [ |
| 1474 | new SelfclosingTagTk( 'extlink', [ |
| 1475 | new KV( 'href', sprintf( $base_urls[$ref], $identifier ) ), |
| 1476 | new KV( 'mw:content', TokenizerUtils::flattenString( [ $ref, $sp, $identifier ] ), $tsr->expandTsrV() ), |
| 1477 | new KV( 'typeof', 'mw:ExtLink/' . $ref ) |
| 1478 | ], |
| 1479 | $dp |
| 1480 | ) |
| 1481 | ]; |
| 1482 | |
| 1483 | } |
| 1484 | private function a125() { |
| 1485 | return $this->siteConfig->magicLinkEnabled("ISBN"); |
| 1486 | } |
| 1487 | private function a126($sp, $isbn) { |
| 1488 | |
| 1489 | // Convert isbn token-and-entity array to stripped string. |
| 1490 | $stripped = ''; |
| 1491 | foreach ( TokenizerUtils::flattenStringlist( $isbn ) as $part ) { |
| 1492 | if ( is_string( $part ) ) { |
| 1493 | $stripped .= $part; |
| 1494 | } |
| 1495 | } |
| 1496 | return strtoupper( preg_replace( '/[^\dX]/i', '', $stripped ) ); |
| 1497 | |
| 1498 | } |
| 1499 | private function a127($sp, $isbn, $isbncode) { |
| 1500 | |
| 1501 | // ISBNs can only be 10 or 13 digits long (with a specific format) |
| 1502 | return strlen( $isbncode ) === 10 |
| 1503 | || ( strlen( $isbncode ) === 13 && preg_match( '/^97[89]/', $isbncode ) ); |
| 1504 | |
| 1505 | } |
| 1506 | private function a128($sp, $isbn, $isbncode) { |
| 1507 | |
| 1508 | $tsr = $this->tsrOffsets(); |
| 1509 | $dp = new DataParsoid; |
| 1510 | $dp->stx = 'magiclink'; |
| 1511 | $dp->tsr = $tsr; |
| 1512 | $this->env->getDataAccess()->addTrackingCategory( |
| 1513 | $this->env->getPageConfig(), |
| 1514 | $this->env->getMetadata(), |
| 1515 | 'magiclink-tracking-isbn' |
| 1516 | ); |
| 1517 | return [ |
| 1518 | new SelfclosingTagTk( 'extlink', [ |
| 1519 | new KV( 'href', 'Special:BookSources/' . $isbncode ), |
| 1520 | new KV( 'mw:content', TokenizerUtils::flattenString( [ 'ISBN', $sp, $isbn ] ), $tsr->expandTsrV() ), |
| 1521 | new KV( 'typeof', 'mw:WikiLink/ISBN' ) |
| 1522 | ], |
| 1523 | $dp |
| 1524 | ) |
| 1525 | ]; |
| 1526 | |
| 1527 | } |
| 1528 | private function a129($p, $dashes) { |
| 1529 | $this->unreachable(); |
| 1530 | } |
| 1531 | private function a130($p, $dashes, $a) { |
| 1532 | return $this->endOffset(); |
| 1533 | } |
| 1534 | private function a131($p, $dashes, $a, $tagEndPos, $s2) { |
| 1535 | |
| 1536 | $coms = TokenizerUtils::popComments( $a ); |
| 1537 | if ( $coms ) { |
| 1538 | $tagEndPos = $coms['commentStartPos']; |
| 1539 | } |
| 1540 | |
| 1541 | $da = new DataParsoid; |
| 1542 | $da->tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
| 1543 | $da->startTagSrc = $p . $dashes; |
| 1544 | |
| 1545 | // We rely on our tree builder to close the row as needed. This is |
| 1546 | // needed to support building tables from fragment templates with |
| 1547 | // individual cells or rows. |
| 1548 | $trToken = new TagTk( 'tr', $a, $da ); |
| 1549 | |
| 1550 | return array_merge( [ $trToken ], $coms ? $coms['buf'] : [], $s2 ); |
| 1551 | |
| 1552 | } |
| 1553 | private function a132($p, $td, $tds) { |
| 1554 | |
| 1555 | // Avoid modifying a cached result |
| 1556 | $td[0] = clone $td[0]; |
| 1557 | $da = $td[0]->dataParsoid = clone $td[0]->dataParsoid; |
| 1558 | $da->tsr = clone $da->tsr; |
| 1559 | $da->tsr->start -= strlen( $p ); // include "|" |
| 1560 | if ( $p !== '|' ) { |
| 1561 | // Variation from default |
| 1562 | $da->startTagSrc = $p; |
| 1563 | } |
| 1564 | return array_merge( $td, $tds ); |
| 1565 | |
| 1566 | } |
| 1567 | private function a133($p, $args) { |
| 1568 | return $this->endOffset(); |
| 1569 | } |
| 1570 | private function a134($p, $args, $tagEndPos, $c) { |
| 1571 | |
| 1572 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
| 1573 | return TokenizerUtils::buildTableTokens( |
| 1574 | 'caption', '|+', $args, $tsr, $this->endOffset(), $c, true ); |
| 1575 | |
| 1576 | } |
| 1577 | private function a135($tpt) { |
| 1578 | |
| 1579 | return [ 'tokens' => $tpt, 'srcOffsets' => $this->tsrOffsets() ]; |
| 1580 | |
| 1581 | } |
| 1582 | private function a136($name) { |
| 1583 | return $this->endOffset(); |
| 1584 | } |
| 1585 | private function a137($name, $kEndPos) { |
| 1586 | return $this->endOffset(); |
| 1587 | } |
| 1588 | private function a138($name, $kEndPos, $vStartPos, $optSp, $tpv) { |
| 1589 | |
| 1590 | return [ |
| 1591 | 'kEndPos' => $kEndPos, |
| 1592 | 'vStartPos' => $vStartPos, |
| 1593 | 'value' => TokenizerUtils::flattenString( [ $optSp, $tpv['tokens'] ?? [] ] ), |
| 1594 | ]; |
| 1595 | |
| 1596 | } |
| 1597 | private function a139($name, $val) { |
| 1598 | |
| 1599 | if ( $val !== null ) { |
| 1600 | if ( $val['value'] !== null ) { |
| 1601 | $so = new KVSourceRange( |
| 1602 | $this->startOffset(), $val['kEndPos'], |
| 1603 | $val['vStartPos'], $this->endOffset() |
| 1604 | ); |
| 1605 | return new KV( |
| 1606 | $name, |
| 1607 | TokenizerUtils::flattenIfArray( $val['value'] ), |
| 1608 | $so |
| 1609 | ); |
| 1610 | } else { |
| 1611 | return new KV( |
| 1612 | TokenizerUtils::flattenIfArray( $name ), |
| 1613 | '', |
| 1614 | $so |
| 1615 | ); |
| 1616 | } |
| 1617 | } else { |
| 1618 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
| 1619 | return new KV( |
| 1620 | '', |
| 1621 | TokenizerUtils::flattenIfArray( $name ), |
| 1622 | $so->expandTsrV() |
| 1623 | ); |
| 1624 | } |
| 1625 | |
| 1626 | } |
| 1627 | private function a140() { |
| 1628 | |
| 1629 | $so = new SourceRange( $this->startOffset(), $this->endOffset() ); |
| 1630 | return new KV( '', '', $so->expandTsrV() ); |
| 1631 | |
| 1632 | } |
| 1633 | private function a141($t, $wr) { |
| 1634 | return $wr; |
| 1635 | } |
| 1636 | private function a142($r) { |
| 1637 | |
| 1638 | return TokenizerUtils::flattenStringlist( $r ); |
| 1639 | |
| 1640 | } |
| 1641 | private function a143($startPos, $lt) { |
| 1642 | |
| 1643 | $tsr = new SourceRange( $startPos, $this->endOffset() ); |
| 1644 | $maybeContent = new KV( 'mw:maybeContent', $lt ?? [], $tsr->expandTsrV() ); |
| 1645 | $maybeContent->vsrc = substr( $this->input, $startPos, $this->endOffset() - $startPos ); |
| 1646 | return $maybeContent; |
| 1647 | |
| 1648 | } |
| 1649 | private function a144() { |
| 1650 | return $this->siteConfig->magicLinkEnabled("RFC"); |
| 1651 | } |
| 1652 | private function a145() { |
| 1653 | |
| 1654 | return 'RFC'; |
| 1655 | |
| 1656 | } |
| 1657 | private function a146() { |
| 1658 | return $this->siteConfig->magicLinkEnabled("PMID"); |
| 1659 | } |
| 1660 | private function a147() { |
| 1661 | |
| 1662 | return 'PMID'; |
| 1663 | |
| 1664 | } |
| 1665 | private function a148($he) { |
| 1666 | return is_array( $he ) && $he[ 1 ] === "\u{A0}"; |
| 1667 | } |
| 1668 | private function a149() { |
| 1669 | return $this->startOffset(); |
| 1670 | } |
| 1671 | private function a150($lv0) { |
| 1672 | return $this->env->langConverterEnabled(); |
| 1673 | } |
| 1674 | private function a151($lv0, $ff) { |
| 1675 | |
| 1676 | // if flags contains 'R', then don't treat ; or : specially inside. |
| 1677 | if ( isset( $ff['flags'] ) ) { |
| 1678 | $ff['raw'] = isset( $ff['flags']['R'] ) || isset( $ff['flags']['N'] ); |
| 1679 | } elseif ( isset( $ff['variants'] ) ) { |
| 1680 | $ff['raw'] = true; |
| 1681 | } |
| 1682 | return $ff; |
| 1683 | |
| 1684 | } |
| 1685 | private function a152($lv0) { |
| 1686 | return !$this->env->langConverterEnabled(); |
| 1687 | } |
| 1688 | private function a153($lv0) { |
| 1689 | |
| 1690 | // if language converter not enabled, don't try to parse inside. |
| 1691 | return [ 'raw' => true ]; |
| 1692 | |
| 1693 | } |
| 1694 | private function a154($lv0, $f) { |
| 1695 | return $f['raw']; |
| 1696 | } |
| 1697 | private function a155($lv0, $f, $lv) { |
| 1698 | return [ [ 'text' => $lv ] ]; |
| 1699 | } |
| 1700 | private function a156($lv0, $f) { |
| 1701 | return !$f['raw']; |
| 1702 | } |
| 1703 | private function a157($lv0, $f, $lv) { |
| 1704 | return $lv; |
| 1705 | } |
| 1706 | private function a158($lv0, $f, $ts) { |
| 1707 | return $this->endOffset(); |
| 1708 | } |
| 1709 | private function a159($lv0, $f, $ts, $lv1) { |
| 1710 | |
| 1711 | if ( !$this->env->langConverterEnabled() ) { |
| 1712 | return [ '-{', $ts[0]['text']['tokens'], '}-' ]; |
| 1713 | } |
| 1714 | $lvsrc = substr( $this->input, $lv0, $lv1 - $lv0 ); |
| 1715 | $attribs = []; |
| 1716 | |
| 1717 | foreach ( $ts as &$t ) { |
| 1718 | // move token strings into KV attributes so that they are |
| 1719 | // properly expanded by early stages of the token pipeline |
| 1720 | foreach ( [ 'text', 'from', 'to' ] as $fld ) { |
| 1721 | if ( !isset( $t[$fld] ) ) { |
| 1722 | continue; |
| 1723 | } |
| 1724 | $name = 'mw:lv' . count( $attribs ); |
| 1725 | // Note that AttributeExpander will expect the tokens array to be |
| 1726 | // flattened. We do that in lang_variant_text / lang_variant_nowiki |
| 1727 | $attribs[] = new KV( $name, $t[$fld]['tokens'], $t[$fld]['srcOffsets']->expandTsrV() ); |
| 1728 | $t[$fld] = $name; |
| 1729 | } |
| 1730 | } |
| 1731 | unset( $t ); |
| 1732 | |
| 1733 | $flags = isset( $f['flags'] ) ? array_keys( $f['flags'] ) : []; |
| 1734 | sort( $flags ); |
| 1735 | $variants = isset( $f['variants'] ) ? array_keys( $f['variants'] ) : []; |
| 1736 | sort( $variants ); |
| 1737 | |
| 1738 | $dp = new DataParsoid; |
| 1739 | $dp->tsr = new SourceRange( $lv0, $lv1 ); |
| 1740 | $dp->src = $lvsrc; |
| 1741 | $dp->flags = $flags; |
| 1742 | $dp->variants = $variants; |
| 1743 | $dp->original = $f['original']; |
| 1744 | $dp->flagSp = $f['sp']; |
| 1745 | $dp->texts = $ts; |
| 1746 | |
| 1747 | return [ |
| 1748 | new SelfclosingTagTk( |
| 1749 | 'language-variant', |
| 1750 | $attribs, |
| 1751 | $dp |
| 1752 | ) |
| 1753 | ]; |
| 1754 | |
| 1755 | } |
| 1756 | private function a160($r, &$preproc) { |
| 1757 | |
| 1758 | $preproc = null; |
| 1759 | return $r; |
| 1760 | |
| 1761 | } |
| 1762 | private function a161($thTag, $thTags) { |
| 1763 | |
| 1764 | // Avoid modifying a cached result |
| 1765 | $thTag[0] = clone $thTag[0]; |
| 1766 | $da = $thTag[0]->dataParsoid = clone $thTag[0]->dataParsoid; |
| 1767 | $da->tsr = clone $da->tsr; |
| 1768 | $da->tsr->start--; // include "!" |
| 1769 | array_unshift( $thTags, $thTag ); |
| 1770 | return $thTags; |
| 1771 | |
| 1772 | } |
| 1773 | private function a162($arg) { |
| 1774 | return $this->endOffset(); |
| 1775 | } |
| 1776 | private function a163($arg, $tagEndPos, $td) { |
| 1777 | |
| 1778 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
| 1779 | return TokenizerUtils::buildTableTokens( 'td', '|', $arg, |
| 1780 | $tsr, $this->endOffset(), $td ); |
| 1781 | |
| 1782 | } |
| 1783 | private function a164($pp, $tdt) { |
| 1784 | |
| 1785 | // Avoid modifying cached dataParsoid object |
| 1786 | $tdt[0] = clone $tdt[0]; |
| 1787 | $da = $tdt[0]->dataParsoid = clone $tdt[0]->dataParsoid; |
| 1788 | $da->tsr = clone $da->tsr; |
| 1789 | $da->stx = 'row'; |
| 1790 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
| 1791 | $da->tsr->start -= strlen( $pp ); // include "||" |
| 1792 | if ( $pp !== '||' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
| 1793 | // Variation from default |
| 1794 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
| 1795 | } |
| 1796 | return $tdt; |
| 1797 | |
| 1798 | } |
| 1799 | private function a165($b) { |
| 1800 | |
| 1801 | return $b; |
| 1802 | |
| 1803 | } |
| 1804 | private function a166($il) { |
| 1805 | |
| 1806 | // il is guaranteed to be an array -- so, tu.flattenIfArray will |
| 1807 | // always return an array |
| 1808 | $r = TokenizerUtils::flattenIfArray( $il ); |
| 1809 | if ( count( $r ) === 1 && is_string( $r[0] ) ) { |
| 1810 | $r = $r[0]; |
| 1811 | } |
| 1812 | return $r; |
| 1813 | |
| 1814 | } |
| 1815 | private function a167() { |
| 1816 | return ''; |
| 1817 | } |
| 1818 | private function a168($ff) { |
| 1819 | return $ff; |
| 1820 | } |
| 1821 | private function a169($f) { |
| 1822 | |
| 1823 | // Collect & separate flags and variants into a hashtable (by key) and ordered list |
| 1824 | $flags = []; |
| 1825 | $variants = []; |
| 1826 | $flagList = []; |
| 1827 | $flagSpace = []; |
| 1828 | $variantList = []; |
| 1829 | $variantSpace = []; |
| 1830 | $useVariants = false; |
| 1831 | if ( $f !== null ) { |
| 1832 | // lang_variant_flags returns arrays in reverse order. |
| 1833 | $spPtr = count( $f['sp'] ) - 1; |
| 1834 | for ( $i = count( $f['flags'] ) - 1; $i >= 0; $i--) { |
| 1835 | $item = $f['flags'][$i]; |
| 1836 | if ( isset( $item['flag'] ) ) { |
| 1837 | $flagSpace[] = $f['sp'][$spPtr--]; |
| 1838 | $flags[$item['flag']] = true; |
| 1839 | $flagList[] = $item['flag']; |
| 1840 | $flagSpace[] = $f['sp'][$spPtr--]; |
| 1841 | } |
| 1842 | if ( isset( $item['variant'] ) ) { |
| 1843 | $variantSpace[] = $f['sp'][$spPtr--]; |
| 1844 | $variants[$item['variant']] = true; |
| 1845 | $variantList[] = $item['variant']; |
| 1846 | $variantSpace[] = $f['sp'][$spPtr--]; |
| 1847 | } |
| 1848 | } |
| 1849 | if ( $spPtr >= 0 ) { |
| 1850 | // handle space after a trailing semicolon |
| 1851 | $flagSpace[] = $f['sp'][$spPtr]; |
| 1852 | $variantSpace[] = $f['sp'][$spPtr]; |
| 1853 | } |
| 1854 | } |
| 1855 | // Parse flags (this logic is from core/languages/ConverterRule.php |
| 1856 | // in the parseFlags() function) |
| 1857 | if ( count( $flags ) === 0 && count( $variants ) === 0 ) { |
| 1858 | $flags['$S'] = true; |
| 1859 | } elseif ( isset( $flags['R'] ) ) { |
| 1860 | $flags = [ 'R' => true ]; // remove other flags |
| 1861 | } elseif ( isset( $flags['N'] ) ) { |
| 1862 | $flags = [ 'N' => true ]; // remove other flags |
| 1863 | } elseif ( isset( $flags['-'] ) ) { |
| 1864 | $flags = [ '-' => true ]; // remove other flags |
| 1865 | } elseif ( isset( $flags['T'] ) && count( $flags ) === 1 ) { |
| 1866 | $flags['H'] = true; |
| 1867 | } elseif ( isset( $flags['H'] ) ) { |
| 1868 | // Replace A flag, and remove other flags except T and D |
| 1869 | $nf = [ '$+' => true, 'H' => true ]; |
| 1870 | if ( isset( $flags['T'] ) ) { $nf['T'] = true; } |
| 1871 | if ( isset( $flags['D'] ) ) { $nf['D'] = true; } |
| 1872 | $flags = $nf; |
| 1873 | } elseif ( count( $variants ) > 0 ) { |
| 1874 | $useVariants = true; |
| 1875 | } else { |
| 1876 | if ( isset( $flags['A'] ) ) { |
| 1877 | $flags['$+'] = true; |
| 1878 | $flags['$S'] = true; |
| 1879 | } |
| 1880 | if ( isset( $flags['D'] ) ) { |
| 1881 | unset( $flags['$S'] ); |
| 1882 | } |
| 1883 | } |
| 1884 | if ( $useVariants ) { |
| 1885 | return [ 'variants' => $variants, 'original' => $variantList, 'sp' => $variantSpace ]; |
| 1886 | } else { |
| 1887 | return [ 'flags' => $flags, 'original' => $flagList, 'sp' => $flagSpace ]; |
| 1888 | } |
| 1889 | |
| 1890 | } |
| 1891 | private function a170($tokens) { |
| 1892 | |
| 1893 | return [ |
| 1894 | 'tokens' => TokenizerUtils::flattenStringlist( $tokens ), |
| 1895 | 'srcOffsets' => $this->tsrOffsets(), |
| 1896 | ]; |
| 1897 | |
| 1898 | } |
| 1899 | private function a171($o, $oo) { |
| 1900 | return $oo; |
| 1901 | } |
| 1902 | private function a172($o, $rest, $tr) { |
| 1903 | |
| 1904 | array_unshift( $rest, $o ); |
| 1905 | // if the last bogus option is just spaces, keep them; otherwise |
| 1906 | // drop all this bogus stuff on the ground |
| 1907 | if ( count($tr) > 0 ) { |
| 1908 | $last = $tr[count($tr)-1]; |
| 1909 | if (preg_match('/^\s*$/Du', $last[1])) { |
| 1910 | $rest[] = [ 'semi' => true, 'sp' => $last[1] ]; |
| 1911 | } |
| 1912 | } |
| 1913 | return $rest; |
| 1914 | |
| 1915 | } |
| 1916 | private function a173($lvtext) { |
| 1917 | return [ [ 'text' => $lvtext ] ]; |
| 1918 | } |
| 1919 | private function a174($arg, $tagEndPos, &$th, $d) { |
| 1920 | |
| 1921 | // Ignore newlines found in transclusions! |
| 1922 | // This is not perfect (since {{..}} may not always tokenize to transclusions). |
| 1923 | if ( $th !== false && strpos( preg_replace( "/{{[\s\S]+?}}/", "", $this->text() ), "\n" ) !== false ) { |
| 1924 | // There's been a newline. Remove the break and continue |
| 1925 | // tokenizing nested_block_in_tables. |
| 1926 | $th = false; |
| 1927 | } |
| 1928 | return $d; |
| 1929 | |
| 1930 | } |
| 1931 | private function a175($arg, $tagEndPos, $c) { |
| 1932 | |
| 1933 | $tsr = new SourceRange( $this->startOffset(), $tagEndPos ); |
| 1934 | return TokenizerUtils::buildTableTokens( 'th', '!', $arg, |
| 1935 | $tsr, $this->endOffset(), $c ); |
| 1936 | |
| 1937 | } |
| 1938 | private function a176($pp, $tht) { |
| 1939 | |
| 1940 | // Avoid modifying cached dataParsoid object |
| 1941 | $tht[0] = clone $tht[0]; |
| 1942 | $da = $tht[0]->dataParsoid = clone $tht[0]->dataParsoid; |
| 1943 | $da->tsr = clone $da->tsr; |
| 1944 | $da->stx = 'row'; |
| 1945 | $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL ); |
| 1946 | $da->tsr->start -= strlen( $pp ); // include "!!" or "||" |
| 1947 | if ( $pp !== '!!' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) { |
| 1948 | // Variation from default |
| 1949 | $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' ); |
| 1950 | } |
| 1951 | return $tht; |
| 1952 | |
| 1953 | } |
| 1954 | private function a177($sp1, $f, $sp2, $more) { |
| 1955 | |
| 1956 | $r = ( $more && $more[1] ) ? $more[1] : [ 'sp' => [], 'flags' => [] ]; |
| 1957 | // Note that sp and flags are in reverse order, since we're using |
| 1958 | // right recursion and want to push instead of unshift. |
| 1959 | $r['sp'][] = $sp2; |
| 1960 | $r['sp'][] = $sp1; |
| 1961 | $r['flags'][] = $f; |
| 1962 | return $r; |
| 1963 | |
| 1964 | } |
| 1965 | private function a178($sp) { |
| 1966 | |
| 1967 | return [ 'sp' => [ $sp ], 'flags' => [] ]; |
| 1968 | |
| 1969 | } |
| 1970 | private function a179($sp1, $lang, $sp2, $sp3, $lvtext) { |
| 1971 | |
| 1972 | return [ |
| 1973 | 'twoway' => true, |
| 1974 | 'lang' => $lang, |
| 1975 | 'text' => $lvtext, |
| 1976 | 'sp' => [ $sp1, $sp2, $sp3 ] |
| 1977 | ]; |
| 1978 | |
| 1979 | } |
| 1980 | private function a180($sp1, $from, $sp2, $lang, $sp3, $sp4, $to) { |
| 1981 | |
| 1982 | return [ |
| 1983 | 'oneway' => true, |
| 1984 | 'from' => $from, |
| 1985 | 'lang' => $lang, |
| 1986 | 'to' => $to, |
| 1987 | 'sp' => [ $sp1, $sp2, $sp3, $sp4 ] |
| 1988 | ]; |
| 1989 | |
| 1990 | } |
| 1991 | private function a181($r) { |
| 1992 | |
| 1993 | return $r; |
| 1994 | |
| 1995 | } |
| 1996 | private function a182($f) { |
| 1997 | return [ 'flag' => $f ]; |
| 1998 | } |
| 1999 | private function a183($v) { |
| 2000 | return [ 'variant' => $v ]; |
| 2001 | } |
| 2002 | private function a184($b) { |
| 2003 | return [ 'bogus' => $b ]; /* bad flag */ |
| 2004 | } |
| 2005 | private function a185($n, $sp) { |
| 2006 | |
| 2007 | $tsr = $this->tsrOffsets(); |
| 2008 | $tsr->end -= strlen( $sp ); |
| 2009 | return [ |
| 2010 | 'tokens' => [ $n ], |
| 2011 | 'srcOffsets' => $tsr, |
| 2012 | ]; |
| 2013 | |
| 2014 | } |
| 2015 | private function a186($extToken) { |
| 2016 | return $extToken; |
| 2017 | } |
| 2018 | private function a187($extToken) { |
| 2019 | |
| 2020 | $txt = Utils::extractExtBody( $extToken ); |
| 2021 | return Utils::decodeWtEntities( $txt ); |
| 2022 | |
| 2023 | } |
| 2024 | |
| 2025 | // generated |
| 2026 | private function streamstart_async($silence, &$param_preproc) { |
| 2027 | for (;;) { |
| 2028 | // start choice_1 |
| 2029 | $p2 = $this->currPos; |
| 2030 | // start seq_1 |
| 2031 | $p3 = $this->currPos; |
| 2032 | $this->savedPos = $this->currPos; |
| 2033 | $r4 = $this->a0(); |
| 2034 | if ($r4) { |
| 2035 | $r4 = false; |
| 2036 | } else { |
| 2037 | $r4 = self::$FAILED; |
| 2038 | $r1 = self::$FAILED; |
| 2039 | goto seq_1; |
| 2040 | } |
| 2041 | $r5 = $this->parsetlb($silence, $param_preproc); |
| 2042 | // t <- $r5 |
| 2043 | if ($r5===self::$FAILED) { |
| 2044 | $this->currPos = $p3; |
| 2045 | $r1 = self::$FAILED; |
| 2046 | goto seq_1; |
| 2047 | } |
| 2048 | $this->savedPos = $this->currPos; |
| 2049 | $r6 = $this->a1($r5); |
| 2050 | if ($r6) { |
| 2051 | $r6 = false; |
| 2052 | } else { |
| 2053 | $r6 = self::$FAILED; |
| 2054 | $this->currPos = $p3; |
| 2055 | $r1 = self::$FAILED; |
| 2056 | goto seq_1; |
| 2057 | } |
| 2058 | $r1 = true; |
| 2059 | seq_1: |
| 2060 | if ($r1!==self::$FAILED) { |
| 2061 | $this->savedPos = $p2; |
| 2062 | $r1 = $this->a2($r5); |
| 2063 | goto choice_1; |
| 2064 | } |
| 2065 | // free $p3 |
| 2066 | // start seq_2 |
| 2067 | $p3 = $this->currPos; |
| 2068 | $r7 = []; |
| 2069 | for (;;) { |
| 2070 | $r8 = $this->parsenewlineToken($silence); |
| 2071 | if ($r8!==self::$FAILED) { |
| 2072 | $r7[] = $r8; |
| 2073 | } else { |
| 2074 | break; |
| 2075 | } |
| 2076 | } |
| 2077 | // free $r8 |
| 2078 | $this->savedPos = $this->currPos; |
| 2079 | $r8 = $this->a3(); |
| 2080 | if ($r8) { |
| 2081 | $r8 = false; |
| 2082 | } else { |
| 2083 | $r8 = self::$FAILED; |
| 2084 | $this->currPos = $p3; |
| 2085 | $r1 = self::$FAILED; |
| 2086 | goto seq_2; |
| 2087 | } |
| 2088 | $r1 = [$r7,$r8]; |
| 2089 | seq_2: |
| 2090 | // free $p3 |
| 2091 | choice_1: |
| 2092 | if ($r1!==self::$FAILED) { |
| 2093 | yield $r1; |
| 2094 | } else { |
| 2095 | if ($this->currPos < $this->inputLength) { |
| 2096 | $this->fail(0); |
| 2097 | throw $this->buildParseException(); |
| 2098 | } |
| 2099 | break; |
| 2100 | } |
| 2101 | } |
| 2102 | } |
| 2103 | private function parsestart($silence, &$param_preproc) { |
| 2104 | $key = json_encode([282, $param_preproc]); |
| 2105 | $bucket = $this->currPos; |
| 2106 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2107 | if ($cached) { |
| 2108 | $this->currPos = $cached->nextPos; |
| 2109 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2110 | return $cached->result; |
| 2111 | } |
| 2112 | $saved_preproc=$param_preproc; |
| 2113 | $p2 = $this->currPos; |
| 2114 | // start seq_1 |
| 2115 | $p3 = $this->currPos; |
| 2116 | $r4 = []; |
| 2117 | for (;;) { |
| 2118 | $r5 = $this->parsetlb(true, $param_preproc); |
| 2119 | if ($r5!==self::$FAILED) { |
| 2120 | $r4[] = $r5; |
| 2121 | } else { |
| 2122 | break; |
| 2123 | } |
| 2124 | } |
| 2125 | // t <- $r4 |
| 2126 | // free $r5 |
| 2127 | $r5 = []; |
| 2128 | for (;;) { |
| 2129 | $r6 = $this->parsenewlineToken(true); |
| 2130 | if ($r6!==self::$FAILED) { |
| 2131 | $r5[] = $r6; |
| 2132 | } else { |
| 2133 | break; |
| 2134 | } |
| 2135 | } |
| 2136 | // n <- $r5 |
| 2137 | // free $r6 |
| 2138 | $r1 = true; |
| 2139 | seq_1: |
| 2140 | if ($r1!==self::$FAILED) { |
| 2141 | $this->savedPos = $p2; |
| 2142 | $r1 = $this->a4($r4, $r5); |
| 2143 | } else { |
| 2144 | if (!$silence) {$this->fail(1);} |
| 2145 | } |
| 2146 | // free $p3 |
| 2147 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2148 | $this->currPos, |
| 2149 | $r1, |
| 2150 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2151 | self::$UNDEFINED |
| 2152 | ); |
| 2153 | return $r1; |
| 2154 | } |
| 2155 | private function parsetable_start_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2156 | $key = json_encode([468, $boolParams & 0x3fbf, $param_preproc, $param_th]); |
| 2157 | $bucket = $this->currPos; |
| 2158 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2159 | if ($cached) { |
| 2160 | $this->currPos = $cached->nextPos; |
| 2161 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2162 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2163 | return $cached->result; |
| 2164 | } |
| 2165 | $saved_preproc=$param_preproc; |
| 2166 | $saved_th=$param_th; |
| 2167 | $p2 = $this->currPos; |
| 2168 | // start seq_1 |
| 2169 | $p3 = $this->currPos; |
| 2170 | $r4 = []; |
| 2171 | for (;;) { |
| 2172 | // start choice_1 |
| 2173 | $r5 = $this->parsespace(true); |
| 2174 | if ($r5!==self::$FAILED) { |
| 2175 | goto choice_1; |
| 2176 | } |
| 2177 | $r5 = $this->parsecomment(true); |
| 2178 | choice_1: |
| 2179 | if ($r5!==self::$FAILED) { |
| 2180 | $r4[] = $r5; |
| 2181 | } else { |
| 2182 | break; |
| 2183 | } |
| 2184 | } |
| 2185 | // sc <- $r4 |
| 2186 | // free $r5 |
| 2187 | $p6 = $this->currPos; |
| 2188 | $r5 = ''; |
| 2189 | // startPos <- $r5 |
| 2190 | if ($r5!==self::$FAILED) { |
| 2191 | $this->savedPos = $p6; |
| 2192 | $r5 = $this->a5($r4); |
| 2193 | } else { |
| 2194 | $this->currPos = $p3; |
| 2195 | $r1 = self::$FAILED; |
| 2196 | goto seq_1; |
| 2197 | } |
| 2198 | // b <- $r7 |
| 2199 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 2200 | $this->currPos++; |
| 2201 | $r7 = "{"; |
| 2202 | } else { |
| 2203 | $r7 = self::$FAILED; |
| 2204 | $this->currPos = $p3; |
| 2205 | $r1 = self::$FAILED; |
| 2206 | goto seq_1; |
| 2207 | } |
| 2208 | $r8 = $this->parsepipe(true); |
| 2209 | // p <- $r8 |
| 2210 | if ($r8===self::$FAILED) { |
| 2211 | $this->currPos = $p3; |
| 2212 | $r1 = self::$FAILED; |
| 2213 | goto seq_1; |
| 2214 | } |
| 2215 | // start choice_2 |
| 2216 | $r9 = $this->parsetable_attributes(true, $boolParams & ~0x40, $param_preproc, $param_th); |
| 2217 | if ($r9!==self::$FAILED) { |
| 2218 | goto choice_2; |
| 2219 | } |
| 2220 | $this->savedPos = $this->currPos; |
| 2221 | $r9 = $this->a6($r4, $r5, $r7, $r8); |
| 2222 | if ($r9) { |
| 2223 | $r9 = false; |
| 2224 | } else { |
| 2225 | $r9 = self::$FAILED; |
| 2226 | } |
| 2227 | choice_2: |
| 2228 | // ta <- $r9 |
| 2229 | if ($r9===self::$FAILED) { |
| 2230 | $this->currPos = $p3; |
| 2231 | $r1 = self::$FAILED; |
| 2232 | goto seq_1; |
| 2233 | } |
| 2234 | $p11 = $this->currPos; |
| 2235 | $r10 = ''; |
| 2236 | // tsEndPos <- $r10 |
| 2237 | if ($r10!==self::$FAILED) { |
| 2238 | $this->savedPos = $p11; |
| 2239 | $r10 = $this->a7($r4, $r5, $r7, $r8, $r9); |
| 2240 | } else { |
| 2241 | $this->currPos = $p3; |
| 2242 | $r1 = self::$FAILED; |
| 2243 | goto seq_1; |
| 2244 | } |
| 2245 | $r12 = []; |
| 2246 | for (;;) { |
| 2247 | $r13 = $this->parsespace(true); |
| 2248 | if ($r13!==self::$FAILED) { |
| 2249 | $r12[] = $r13; |
| 2250 | } else { |
| 2251 | break; |
| 2252 | } |
| 2253 | } |
| 2254 | // s2 <- $r12 |
| 2255 | // free $r13 |
| 2256 | $r1 = true; |
| 2257 | seq_1: |
| 2258 | if ($r1!==self::$FAILED) { |
| 2259 | $this->savedPos = $p2; |
| 2260 | $r1 = $this->a8($r4, $r5, $r7, $r8, $r9, $r10, $r12); |
| 2261 | } else { |
| 2262 | if (!$silence) {$this->fail(2);} |
| 2263 | } |
| 2264 | // free $p3 |
| 2265 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2266 | $this->currPos, |
| 2267 | $r1, |
| 2268 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2269 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2270 | ); |
| 2271 | return $r1; |
| 2272 | } |
| 2273 | private function parseurl($silence, &$param_preproc) { |
| 2274 | $key = json_encode([340, $param_preproc]); |
| 2275 | $bucket = $this->currPos; |
| 2276 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2277 | if ($cached) { |
| 2278 | $this->currPos = $cached->nextPos; |
| 2279 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2280 | return $cached->result; |
| 2281 | } |
| 2282 | $saved_preproc=$param_preproc; |
| 2283 | $p2 = $this->currPos; |
| 2284 | // start seq_1 |
| 2285 | $p3 = $this->currPos; |
| 2286 | $r4 = $this->parseurl_protocol($silence); |
| 2287 | // proto <- $r4 |
| 2288 | if ($r4===self::$FAILED) { |
| 2289 | $r1 = self::$FAILED; |
| 2290 | goto seq_1; |
| 2291 | } |
| 2292 | // start choice_1 |
| 2293 | $r5 = $this->parseipv6urladdr($silence); |
| 2294 | if ($r5!==self::$FAILED) { |
| 2295 | goto choice_1; |
| 2296 | } |
| 2297 | $r5 = ''; |
| 2298 | choice_1: |
| 2299 | // addr <- $r5 |
| 2300 | if ($r5===self::$FAILED) { |
| 2301 | $this->currPos = $p3; |
| 2302 | $r1 = self::$FAILED; |
| 2303 | goto seq_1; |
| 2304 | } |
| 2305 | $r6 = []; |
| 2306 | for (;;) { |
| 2307 | $p8 = $this->currPos; |
| 2308 | // start seq_2 |
| 2309 | $p9 = $this->currPos; |
| 2310 | $p10 = $this->currPos; |
| 2311 | $r11 = $this->discardinline_breaks(true, 0x0, $param_preproc, self::newRef(null)); |
| 2312 | if ($r11 === self::$FAILED) { |
| 2313 | $r11 = false; |
| 2314 | } else { |
| 2315 | $r11 = self::$FAILED; |
| 2316 | $this->currPos = $p10; |
| 2317 | $r7 = self::$FAILED; |
| 2318 | goto seq_2; |
| 2319 | } |
| 2320 | // free $p10 |
| 2321 | // start choice_2 |
| 2322 | $r12 = $this->parseno_punctuation_char($silence); |
| 2323 | if ($r12!==self::$FAILED) { |
| 2324 | goto choice_2; |
| 2325 | } |
| 2326 | $r12 = $this->parsecomment($silence); |
| 2327 | if ($r12!==self::$FAILED) { |
| 2328 | goto choice_2; |
| 2329 | } |
| 2330 | $r12 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
| 2331 | if ($r12!==self::$FAILED) { |
| 2332 | goto choice_2; |
| 2333 | } |
| 2334 | $r12 = $this->input[$this->currPos] ?? ''; |
| 2335 | if ($r12 === "'" || $r12 === "{") { |
| 2336 | $this->currPos++; |
| 2337 | goto choice_2; |
| 2338 | } else { |
| 2339 | $r12 = self::$FAILED; |
| 2340 | if (!$silence) {$this->fail(3);} |
| 2341 | } |
| 2342 | $p10 = $this->currPos; |
| 2343 | // start seq_3 |
| 2344 | $p13 = $this->currPos; |
| 2345 | $p14 = $this->currPos; |
| 2346 | // start seq_4 |
| 2347 | $p16 = $this->currPos; |
| 2348 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 2349 | $this->currPos++; |
| 2350 | $r17 = "&"; |
| 2351 | } else { |
| 2352 | $r17 = self::$FAILED; |
| 2353 | $r15 = self::$FAILED; |
| 2354 | goto seq_4; |
| 2355 | } |
| 2356 | // start choice_3 |
| 2357 | // start seq_5 |
| 2358 | $p19 = $this->currPos; |
| 2359 | $r20 = $this->input[$this->currPos] ?? ''; |
| 2360 | if ($r20 === "l" || $r20 === "L") { |
| 2361 | $this->currPos++; |
| 2362 | } else { |
| 2363 | $r20 = self::$FAILED; |
| 2364 | $r18 = self::$FAILED; |
| 2365 | goto seq_5; |
| 2366 | } |
| 2367 | $r21 = $this->input[$this->currPos] ?? ''; |
| 2368 | if ($r21 === "t" || $r21 === "T") { |
| 2369 | $this->currPos++; |
| 2370 | } else { |
| 2371 | $r21 = self::$FAILED; |
| 2372 | $this->currPos = $p19; |
| 2373 | $r18 = self::$FAILED; |
| 2374 | goto seq_5; |
| 2375 | } |
| 2376 | $r18 = true; |
| 2377 | seq_5: |
| 2378 | if ($r18!==self::$FAILED) { |
| 2379 | goto choice_3; |
| 2380 | } |
| 2381 | // free $p19 |
| 2382 | // start seq_6 |
| 2383 | $p19 = $this->currPos; |
| 2384 | $r22 = $this->input[$this->currPos] ?? ''; |
| 2385 | if ($r22 === "g" || $r22 === "G") { |
| 2386 | $this->currPos++; |
| 2387 | } else { |
| 2388 | $r22 = self::$FAILED; |
| 2389 | $r18 = self::$FAILED; |
| 2390 | goto seq_6; |
| 2391 | } |
| 2392 | $r23 = $this->input[$this->currPos] ?? ''; |
| 2393 | if ($r23 === "t" || $r23 === "T") { |
| 2394 | $this->currPos++; |
| 2395 | } else { |
| 2396 | $r23 = self::$FAILED; |
| 2397 | $this->currPos = $p19; |
| 2398 | $r18 = self::$FAILED; |
| 2399 | goto seq_6; |
| 2400 | } |
| 2401 | $r18 = true; |
| 2402 | seq_6: |
| 2403 | // free $p19 |
| 2404 | choice_3: |
| 2405 | if ($r18===self::$FAILED) { |
| 2406 | $this->currPos = $p16; |
| 2407 | $r15 = self::$FAILED; |
| 2408 | goto seq_4; |
| 2409 | } |
| 2410 | if (($this->input[$this->currPos] ?? null) === ";") { |
| 2411 | $this->currPos++; |
| 2412 | $r24 = ";"; |
| 2413 | } else { |
| 2414 | $r24 = self::$FAILED; |
| 2415 | $this->currPos = $p16; |
| 2416 | $r15 = self::$FAILED; |
| 2417 | goto seq_4; |
| 2418 | } |
| 2419 | $r15 = true; |
| 2420 | seq_4: |
| 2421 | // free $p16 |
| 2422 | if ($r15 === self::$FAILED) { |
| 2423 | $r15 = false; |
| 2424 | } else { |
| 2425 | $r15 = self::$FAILED; |
| 2426 | $this->currPos = $p14; |
| 2427 | $r12 = self::$FAILED; |
| 2428 | goto seq_3; |
| 2429 | } |
| 2430 | // free $p14 |
| 2431 | // start choice_4 |
| 2432 | $p14 = $this->currPos; |
| 2433 | // start seq_7 |
| 2434 | $p16 = $this->currPos; |
| 2435 | $p19 = $this->currPos; |
| 2436 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 2437 | $this->currPos++; |
| 2438 | $r26 = "&"; |
| 2439 | $r26 = false; |
| 2440 | $this->currPos = $p19; |
| 2441 | } else { |
| 2442 | $r26 = self::$FAILED; |
| 2443 | $r25 = self::$FAILED; |
| 2444 | goto seq_7; |
| 2445 | } |
| 2446 | // free $p19 |
| 2447 | $r27 = $this->parsehtmlentity($silence); |
| 2448 | // he <- $r27 |
| 2449 | if ($r27===self::$FAILED) { |
| 2450 | $this->currPos = $p16; |
| 2451 | $r25 = self::$FAILED; |
| 2452 | goto seq_7; |
| 2453 | } |
| 2454 | $r25 = true; |
| 2455 | seq_7: |
| 2456 | if ($r25!==self::$FAILED) { |
| 2457 | $this->savedPos = $p14; |
| 2458 | $r25 = $this->a9($r4, $r5, $r27); |
| 2459 | goto choice_4; |
| 2460 | } |
| 2461 | // free $p16 |
| 2462 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 2463 | $this->currPos++; |
| 2464 | $r25 = "&"; |
| 2465 | } else { |
| 2466 | if (!$silence) {$this->fail(4);} |
| 2467 | $r25 = self::$FAILED; |
| 2468 | } |
| 2469 | choice_4: |
| 2470 | // r <- $r25 |
| 2471 | if ($r25===self::$FAILED) { |
| 2472 | $this->currPos = $p13; |
| 2473 | $r12 = self::$FAILED; |
| 2474 | goto seq_3; |
| 2475 | } |
| 2476 | $r12 = true; |
| 2477 | seq_3: |
| 2478 | if ($r12!==self::$FAILED) { |
| 2479 | $this->savedPos = $p10; |
| 2480 | $r12 = $this->a10($r4, $r5, $r25); |
| 2481 | } |
| 2482 | // free $p13 |
| 2483 | choice_2: |
| 2484 | // c <- $r12 |
| 2485 | if ($r12===self::$FAILED) { |
| 2486 | $this->currPos = $p9; |
| 2487 | $r7 = self::$FAILED; |
| 2488 | goto seq_2; |
| 2489 | } |
| 2490 | $r7 = true; |
| 2491 | seq_2: |
| 2492 | if ($r7!==self::$FAILED) { |
| 2493 | $this->savedPos = $p8; |
| 2494 | $r7 = $this->a11($r4, $r5, $r12); |
| 2495 | $r6[] = $r7; |
| 2496 | } else { |
| 2497 | break; |
| 2498 | } |
| 2499 | // free $p9 |
| 2500 | } |
| 2501 | // path <- $r6 |
| 2502 | // free $r7 |
| 2503 | $this->savedPos = $this->currPos; |
| 2504 | $r7 = $this->a12($r4, $r5, $r6); |
| 2505 | if ($r7) { |
| 2506 | $r7 = false; |
| 2507 | } else { |
| 2508 | $r7 = self::$FAILED; |
| 2509 | $this->currPos = $p3; |
| 2510 | $r1 = self::$FAILED; |
| 2511 | goto seq_1; |
| 2512 | } |
| 2513 | $r1 = true; |
| 2514 | seq_1: |
| 2515 | if ($r1!==self::$FAILED) { |
| 2516 | $this->savedPos = $p2; |
| 2517 | $r1 = $this->a13($r4, $r5, $r6); |
| 2518 | } |
| 2519 | // free $p3 |
| 2520 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2521 | $this->currPos, |
| 2522 | $r1, |
| 2523 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2524 | self::$UNDEFINED |
| 2525 | ); |
| 2526 | return $r1; |
| 2527 | } |
| 2528 | private function parserow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2529 | $key = json_encode([490, $boolParams & 0x3eff, $param_preproc, $param_th]); |
| 2530 | $bucket = $this->currPos; |
| 2531 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2532 | if ($cached) { |
| 2533 | $this->currPos = $cached->nextPos; |
| 2534 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2535 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2536 | return $cached->result; |
| 2537 | } |
| 2538 | $saved_preproc=$param_preproc; |
| 2539 | $saved_th=$param_th; |
| 2540 | $p2 = $this->currPos; |
| 2541 | // start seq_1 |
| 2542 | $p3 = $this->currPos; |
| 2543 | $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th); |
| 2544 | // as <- $r4 |
| 2545 | if ($r4===self::$FAILED) { |
| 2546 | $r1 = self::$FAILED; |
| 2547 | goto seq_1; |
| 2548 | } |
| 2549 | $r5 = $this->parseoptional_spaces($silence); |
| 2550 | // s <- $r5 |
| 2551 | if ($r5===self::$FAILED) { |
| 2552 | $this->currPos = $p3; |
| 2553 | $r1 = self::$FAILED; |
| 2554 | goto seq_1; |
| 2555 | } |
| 2556 | $r6 = $this->parsepipe($silence); |
| 2557 | // p <- $r6 |
| 2558 | if ($r6===self::$FAILED) { |
| 2559 | $this->currPos = $p3; |
| 2560 | $r1 = self::$FAILED; |
| 2561 | goto seq_1; |
| 2562 | } |
| 2563 | $p7 = $this->currPos; |
| 2564 | $r8 = $this->discardpipe(true); |
| 2565 | if ($r8 === self::$FAILED) { |
| 2566 | $r8 = false; |
| 2567 | } else { |
| 2568 | $r8 = self::$FAILED; |
| 2569 | $this->currPos = $p7; |
| 2570 | $this->currPos = $p3; |
| 2571 | $r1 = self::$FAILED; |
| 2572 | goto seq_1; |
| 2573 | } |
| 2574 | // free $p7 |
| 2575 | $r1 = true; |
| 2576 | seq_1: |
| 2577 | if ($r1!==self::$FAILED) { |
| 2578 | $this->savedPos = $p2; |
| 2579 | $r1 = $this->a14($r4, $r5, $r6); |
| 2580 | } |
| 2581 | // free $p3 |
| 2582 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2583 | $this->currPos, |
| 2584 | $r1, |
| 2585 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2586 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2587 | ); |
| 2588 | return $r1; |
| 2589 | } |
| 2590 | private function parsetable_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2591 | $key = json_encode([286, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 2592 | $bucket = $this->currPos; |
| 2593 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2594 | if ($cached) { |
| 2595 | $this->currPos = $cached->nextPos; |
| 2596 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2597 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2598 | return $cached->result; |
| 2599 | } |
| 2600 | $saved_preproc=$param_preproc; |
| 2601 | $saved_th=$param_th; |
| 2602 | $r1 = []; |
| 2603 | for (;;) { |
| 2604 | // start choice_1 |
| 2605 | $r2 = $this->parsetable_attribute(true, $boolParams, $param_preproc, $param_th); |
| 2606 | if ($r2!==self::$FAILED) { |
| 2607 | goto choice_1; |
| 2608 | } |
| 2609 | $p3 = $this->currPos; |
| 2610 | // start seq_1 |
| 2611 | $p4 = $this->currPos; |
| 2612 | $r5 = $this->discardoptionalSpaceToken(true); |
| 2613 | if ($r5===self::$FAILED) { |
| 2614 | $r2 = self::$FAILED; |
| 2615 | goto seq_1; |
| 2616 | } |
| 2617 | $r6 = $this->parsebroken_table_attribute_name_char(true); |
| 2618 | // b <- $r6 |
| 2619 | if ($r6===self::$FAILED) { |
| 2620 | $this->currPos = $p4; |
| 2621 | $r2 = self::$FAILED; |
| 2622 | goto seq_1; |
| 2623 | } |
| 2624 | $r2 = true; |
| 2625 | seq_1: |
| 2626 | if ($r2!==self::$FAILED) { |
| 2627 | $this->savedPos = $p3; |
| 2628 | $r2 = $this->a15($r6); |
| 2629 | } |
| 2630 | // free $p4 |
| 2631 | choice_1: |
| 2632 | if ($r2!==self::$FAILED) { |
| 2633 | $r1[] = $r2; |
| 2634 | } else { |
| 2635 | break; |
| 2636 | } |
| 2637 | } |
| 2638 | // free $r2 |
| 2639 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2640 | $this->currPos, |
| 2641 | $r1, |
| 2642 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2643 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2644 | ); |
| 2645 | return $r1; |
| 2646 | } |
| 2647 | private function parsegeneric_newline_attributes($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2648 | $key = json_encode([284, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 2649 | $bucket = $this->currPos; |
| 2650 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2651 | if ($cached) { |
| 2652 | $this->currPos = $cached->nextPos; |
| 2653 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2654 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2655 | return $cached->result; |
| 2656 | } |
| 2657 | $saved_preproc=$param_preproc; |
| 2658 | $saved_th=$param_th; |
| 2659 | $r1 = []; |
| 2660 | for (;;) { |
| 2661 | $r2 = $this->parsegeneric_newline_attribute(true, $boolParams, $param_preproc, $param_th); |
| 2662 | if ($r2!==self::$FAILED) { |
| 2663 | $r1[] = $r2; |
| 2664 | } else { |
| 2665 | break; |
| 2666 | } |
| 2667 | } |
| 2668 | // free $r2 |
| 2669 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2670 | $this->currPos, |
| 2671 | $r1, |
| 2672 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2673 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2674 | ); |
| 2675 | return $r1; |
| 2676 | } |
| 2677 | private function parsetplarg_or_template_or_bust($silence, &$param_preproc) { |
| 2678 | $key = json_encode([350, $param_preproc]); |
| 2679 | $bucket = $this->currPos; |
| 2680 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2681 | if ($cached) { |
| 2682 | $this->currPos = $cached->nextPos; |
| 2683 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2684 | return $cached->result; |
| 2685 | } |
| 2686 | $saved_preproc=$param_preproc; |
| 2687 | $p2 = $this->currPos; |
| 2688 | $r3 = []; |
| 2689 | for (;;) { |
| 2690 | // start choice_1 |
| 2691 | $r4 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc); |
| 2692 | if ($r4!==self::$FAILED) { |
| 2693 | goto choice_1; |
| 2694 | } |
| 2695 | if ($this->currPos < $this->inputLength) { |
| 2696 | $r4 = self::consumeChar($this->input, $this->currPos);; |
| 2697 | } else { |
| 2698 | $r4 = self::$FAILED; |
| 2699 | if (!$silence) {$this->fail(7);} |
| 2700 | } |
| 2701 | choice_1: |
| 2702 | if ($r4!==self::$FAILED) { |
| 2703 | $r3[] = $r4; |
| 2704 | } else { |
| 2705 | break; |
| 2706 | } |
| 2707 | } |
| 2708 | if (count($r3) === 0) { |
| 2709 | $r3 = self::$FAILED; |
| 2710 | } |
| 2711 | // r <- $r3 |
| 2712 | // free $r4 |
| 2713 | $r1 = $r3; |
| 2714 | if ($r1!==self::$FAILED) { |
| 2715 | $this->savedPos = $p2; |
| 2716 | $r1 = $this->a16($r3); |
| 2717 | } |
| 2718 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2719 | $this->currPos, |
| 2720 | $r1, |
| 2721 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2722 | self::$UNDEFINED |
| 2723 | ); |
| 2724 | return $r1; |
| 2725 | } |
| 2726 | private function parseextlink($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2727 | $key = json_encode([326, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 2728 | $bucket = $this->currPos; |
| 2729 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2730 | if ($cached) { |
| 2731 | $this->currPos = $cached->nextPos; |
| 2732 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2733 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2734 | return $cached->result; |
| 2735 | } |
| 2736 | $saved_preproc=$param_preproc; |
| 2737 | $saved_th=$param_th; |
| 2738 | $p2 = $this->currPos; |
| 2739 | // start seq_1 |
| 2740 | $p3 = $this->currPos; |
| 2741 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
| 2742 | $r4 = false; |
| 2743 | } else { |
| 2744 | $r4 = self::$FAILED; |
| 2745 | $r1 = self::$FAILED; |
| 2746 | goto seq_1; |
| 2747 | } |
| 2748 | $p6 = $this->currPos; |
| 2749 | // start seq_2 |
| 2750 | $p7 = $this->currPos; |
| 2751 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 2752 | $this->currPos++; |
| 2753 | $r8 = "["; |
| 2754 | } else { |
| 2755 | $r8 = self::$FAILED; |
| 2756 | $r5 = self::$FAILED; |
| 2757 | goto seq_2; |
| 2758 | } |
| 2759 | $p10 = $this->currPos; |
| 2760 | $r9 = ''; |
| 2761 | // p0 <- $r9 |
| 2762 | if ($r9!==self::$FAILED) { |
| 2763 | $this->savedPos = $p10; |
| 2764 | $r9 = $this->a17(); |
| 2765 | } else { |
| 2766 | $this->currPos = $p7; |
| 2767 | $r5 = self::$FAILED; |
| 2768 | goto seq_2; |
| 2769 | } |
| 2770 | $p12 = $this->currPos; |
| 2771 | // start seq_3 |
| 2772 | $p13 = $this->currPos; |
| 2773 | // start choice_1 |
| 2774 | // start seq_4 |
| 2775 | $p15 = $this->currPos; |
| 2776 | $r16 = $this->parseurl_protocol(true); |
| 2777 | if ($r16===self::$FAILED) { |
| 2778 | $r14 = self::$FAILED; |
| 2779 | goto seq_4; |
| 2780 | } |
| 2781 | $r17 = $this->parseipv6urladdr(true); |
| 2782 | if ($r17===self::$FAILED) { |
| 2783 | $this->currPos = $p15; |
| 2784 | $r14 = self::$FAILED; |
| 2785 | goto seq_4; |
| 2786 | } |
| 2787 | $r14 = [$r16,$r17]; |
| 2788 | seq_4: |
| 2789 | if ($r14!==self::$FAILED) { |
| 2790 | goto choice_1; |
| 2791 | } |
| 2792 | // free $p15 |
| 2793 | $r14 = ''; |
| 2794 | choice_1: |
| 2795 | // addr <- $r14 |
| 2796 | if ($r14===self::$FAILED) { |
| 2797 | $r11 = self::$FAILED; |
| 2798 | goto seq_3; |
| 2799 | } |
| 2800 | // start choice_2 |
| 2801 | $r18 = $this->parseextlink_nonipv6url(true, $boolParams | 0x8, $param_preproc, $param_th); |
| 2802 | if ($r18!==self::$FAILED) { |
| 2803 | goto choice_2; |
| 2804 | } |
| 2805 | $r18 = ''; |
| 2806 | choice_2: |
| 2807 | // target <- $r18 |
| 2808 | if ($r18===self::$FAILED) { |
| 2809 | $this->currPos = $p13; |
| 2810 | $r11 = self::$FAILED; |
| 2811 | goto seq_3; |
| 2812 | } |
| 2813 | $r11 = true; |
| 2814 | seq_3: |
| 2815 | // flat <- $r11 |
| 2816 | if ($r11!==self::$FAILED) { |
| 2817 | $this->savedPos = $p12; |
| 2818 | $r11 = $this->a18($r9, $r14, $r18); |
| 2819 | } else { |
| 2820 | $this->currPos = $p7; |
| 2821 | $r5 = self::$FAILED; |
| 2822 | goto seq_2; |
| 2823 | } |
| 2824 | // free $p13 |
| 2825 | $this->savedPos = $this->currPos; |
| 2826 | $r19 = $this->a19($r9, $r11); |
| 2827 | if ($r19) { |
| 2828 | $r19 = false; |
| 2829 | } else { |
| 2830 | $r19 = self::$FAILED; |
| 2831 | $this->currPos = $p7; |
| 2832 | $r5 = self::$FAILED; |
| 2833 | goto seq_2; |
| 2834 | } |
| 2835 | $p13 = $this->currPos; |
| 2836 | $r20 = ''; |
| 2837 | // p1 <- $r20 |
| 2838 | if ($r20!==self::$FAILED) { |
| 2839 | $this->savedPos = $p13; |
| 2840 | $r20 = $this->a20($r9, $r11); |
| 2841 | } else { |
| 2842 | $this->currPos = $p7; |
| 2843 | $r5 = self::$FAILED; |
| 2844 | goto seq_2; |
| 2845 | } |
| 2846 | $p15 = $this->currPos; |
| 2847 | for (;;) { |
| 2848 | // start choice_3 |
| 2849 | $r22 = $this->discardspace(true); |
| 2850 | if ($r22!==self::$FAILED) { |
| 2851 | goto choice_3; |
| 2852 | } |
| 2853 | $r22 = $this->discardunispace(true); |
| 2854 | choice_3: |
| 2855 | if ($r22===self::$FAILED) { |
| 2856 | break; |
| 2857 | } |
| 2858 | } |
| 2859 | // free $r22 |
| 2860 | $r21 = true; |
| 2861 | // sp <- $r21 |
| 2862 | if ($r21!==self::$FAILED) { |
| 2863 | $r21 = substr($this->input, $p15, $this->currPos - $p15); |
| 2864 | } else { |
| 2865 | $r21 = self::$FAILED; |
| 2866 | $this->currPos = $p7; |
| 2867 | $r5 = self::$FAILED; |
| 2868 | goto seq_2; |
| 2869 | } |
| 2870 | // free $p15 |
| 2871 | $p15 = $this->currPos; |
| 2872 | $r22 = ''; |
| 2873 | // p2 <- $r22 |
| 2874 | if ($r22!==self::$FAILED) { |
| 2875 | $this->savedPos = $p15; |
| 2876 | $r22 = $this->a21($r9, $r11, $r20, $r21); |
| 2877 | } else { |
| 2878 | $this->currPos = $p7; |
| 2879 | $r5 = self::$FAILED; |
| 2880 | goto seq_2; |
| 2881 | } |
| 2882 | $r23 = $this->parseinlineline(true, $boolParams | 0x8, $param_preproc, $param_th); |
| 2883 | if ($r23===self::$FAILED) { |
| 2884 | $r23 = null; |
| 2885 | } |
| 2886 | // content <- $r23 |
| 2887 | $p25 = $this->currPos; |
| 2888 | $r24 = ''; |
| 2889 | // p3 <- $r24 |
| 2890 | if ($r24!==self::$FAILED) { |
| 2891 | $this->savedPos = $p25; |
| 2892 | $r24 = $this->a22($r9, $r11, $r20, $r21, $r22, $r23); |
| 2893 | } else { |
| 2894 | $this->currPos = $p7; |
| 2895 | $r5 = self::$FAILED; |
| 2896 | goto seq_2; |
| 2897 | } |
| 2898 | if (($this->input[$this->currPos] ?? null) === "]") { |
| 2899 | $this->currPos++; |
| 2900 | $r26 = "]"; |
| 2901 | } else { |
| 2902 | $r26 = self::$FAILED; |
| 2903 | $this->currPos = $p7; |
| 2904 | $r5 = self::$FAILED; |
| 2905 | goto seq_2; |
| 2906 | } |
| 2907 | $r5 = true; |
| 2908 | seq_2: |
| 2909 | // r <- $r5 |
| 2910 | if ($r5!==self::$FAILED) { |
| 2911 | $this->savedPos = $p6; |
| 2912 | $r5 = $this->a23($r9, $r11, $r20, $r21, $r22, $r23, $r24); |
| 2913 | } else { |
| 2914 | $this->currPos = $p3; |
| 2915 | $r1 = self::$FAILED; |
| 2916 | goto seq_1; |
| 2917 | } |
| 2918 | // free $p7 |
| 2919 | $r1 = true; |
| 2920 | seq_1: |
| 2921 | if ($r1!==self::$FAILED) { |
| 2922 | $this->savedPos = $p2; |
| 2923 | $r1 = $this->a24($r5); |
| 2924 | } else { |
| 2925 | if (!$silence) {$this->fail(8);} |
| 2926 | } |
| 2927 | // free $p3 |
| 2928 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2929 | $this->currPos, |
| 2930 | $r1, |
| 2931 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2932 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2933 | ); |
| 2934 | return $r1; |
| 2935 | } |
| 2936 | private function parselist_item($silence, $boolParams, &$param_preproc, &$param_th) { |
| 2937 | $key = json_encode([446, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 2938 | $bucket = $this->currPos; |
| 2939 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2940 | if ($cached) { |
| 2941 | $this->currPos = $cached->nextPos; |
| 2942 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2943 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 2944 | return $cached->result; |
| 2945 | } |
| 2946 | $saved_preproc=$param_preproc; |
| 2947 | $saved_th=$param_th; |
| 2948 | // start choice_1 |
| 2949 | $r1 = $this->parsedtdd($silence, $boolParams, $param_preproc, $param_th); |
| 2950 | if ($r1!==self::$FAILED) { |
| 2951 | goto choice_1; |
| 2952 | } |
| 2953 | $r1 = $this->parsehacky_dl_uses($silence, $boolParams, $param_preproc, $param_th); |
| 2954 | if ($r1!==self::$FAILED) { |
| 2955 | goto choice_1; |
| 2956 | } |
| 2957 | $r1 = $this->parseli($silence, $boolParams, $param_preproc, $param_th); |
| 2958 | choice_1: |
| 2959 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 2960 | $this->currPos, |
| 2961 | $r1, |
| 2962 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 2963 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 2964 | ); |
| 2965 | return $r1; |
| 2966 | } |
| 2967 | private function parsetlb($silence, &$param_preproc) { |
| 2968 | $key = json_encode([290, $param_preproc]); |
| 2969 | $bucket = $this->currPos; |
| 2970 | $cached = $this->cache[$bucket][$key] ?? null; |
| 2971 | if ($cached) { |
| 2972 | $this->currPos = $cached->nextPos; |
| 2973 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 2974 | return $cached->result; |
| 2975 | } |
| 2976 | $saved_preproc=$param_preproc; |
| 2977 | $p2 = $this->currPos; |
| 2978 | // start seq_1 |
| 2979 | $p3 = $this->currPos; |
| 2980 | $p4 = $this->currPos; |
| 2981 | $r5 = $this->discardeof(true); |
| 2982 | if ($r5 === self::$FAILED) { |
| 2983 | $r5 = false; |
| 2984 | } else { |
| 2985 | $r5 = self::$FAILED; |
| 2986 | $this->currPos = $p4; |
| 2987 | $r1 = self::$FAILED; |
| 2988 | goto seq_1; |
| 2989 | } |
| 2990 | // free $p4 |
| 2991 | $r6 = $this->parseblock(true, 0x0, self::newRef(null), $param_preproc); |
| 2992 | // b <- $r6 |
| 2993 | if ($r6===self::$FAILED) { |
| 2994 | $this->currPos = $p3; |
| 2995 | $r1 = self::$FAILED; |
| 2996 | goto seq_1; |
| 2997 | } |
| 2998 | $r1 = true; |
| 2999 | seq_1: |
| 3000 | if ($r1!==self::$FAILED) { |
| 3001 | $this->savedPos = $p2; |
| 3002 | $r1 = $this->a25($r6); |
| 3003 | } else { |
| 3004 | if (!$silence) {$this->fail(9);} |
| 3005 | } |
| 3006 | // free $p3 |
| 3007 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3008 | $this->currPos, |
| 3009 | $r1, |
| 3010 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3011 | self::$UNDEFINED |
| 3012 | ); |
| 3013 | return $r1; |
| 3014 | } |
| 3015 | private function parsenewlineToken($silence) { |
| 3016 | $key = 536; |
| 3017 | $bucket = $this->currPos; |
| 3018 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3019 | if ($cached) { |
| 3020 | $this->currPos = $cached->nextPos; |
| 3021 | |
| 3022 | return $cached->result; |
| 3023 | } |
| 3024 | |
| 3025 | $p2 = $this->currPos; |
| 3026 | $r1 = $this->discardnewline($silence); |
| 3027 | if ($r1!==self::$FAILED) { |
| 3028 | $this->savedPos = $p2; |
| 3029 | $r1 = $this->a26(); |
| 3030 | } |
| 3031 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3032 | $this->currPos, |
| 3033 | $r1, |
| 3034 | self::$UNDEFINED, |
| 3035 | self::$UNDEFINED |
| 3036 | ); |
| 3037 | return $r1; |
| 3038 | } |
| 3039 | private function parsespace($silence) { |
| 3040 | $key = 526; |
| 3041 | $bucket = $this->currPos; |
| 3042 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3043 | if ($cached) { |
| 3044 | $this->currPos = $cached->nextPos; |
| 3045 | |
| 3046 | return $cached->result; |
| 3047 | } |
| 3048 | |
| 3049 | $r1 = $this->input[$this->currPos] ?? ''; |
| 3050 | if ($r1 === " " || $r1 === "\x09") { |
| 3051 | $this->currPos++; |
| 3052 | } else { |
| 3053 | $r1 = self::$FAILED; |
| 3054 | if (!$silence) {$this->fail(10);} |
| 3055 | } |
| 3056 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3057 | $this->currPos, |
| 3058 | $r1, |
| 3059 | self::$UNDEFINED, |
| 3060 | self::$UNDEFINED |
| 3061 | ); |
| 3062 | return $r1; |
| 3063 | } |
| 3064 | private function parsecomment($silence) { |
| 3065 | $key = 540; |
| 3066 | $bucket = $this->currPos; |
| 3067 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3068 | if ($cached) { |
| 3069 | $this->currPos = $cached->nextPos; |
| 3070 | |
| 3071 | return $cached->result; |
| 3072 | } |
| 3073 | |
| 3074 | $p2 = $this->currPos; |
| 3075 | // start seq_1 |
| 3076 | $p3 = $this->currPos; |
| 3077 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
| 3078 | $r4 = "<!--"; |
| 3079 | $this->currPos += 4; |
| 3080 | } else { |
| 3081 | if (!$silence) {$this->fail(11);} |
| 3082 | $r4 = self::$FAILED; |
| 3083 | $r1 = self::$FAILED; |
| 3084 | goto seq_1; |
| 3085 | } |
| 3086 | $p6 = $this->currPos; |
| 3087 | for (;;) { |
| 3088 | // start seq_2 |
| 3089 | $p8 = $this->currPos; |
| 3090 | $p9 = $this->currPos; |
| 3091 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
| 3092 | $r10 = "-->"; |
| 3093 | $this->currPos += 3; |
| 3094 | } else { |
| 3095 | $r10 = self::$FAILED; |
| 3096 | } |
| 3097 | if ($r10 === self::$FAILED) { |
| 3098 | $r10 = false; |
| 3099 | } else { |
| 3100 | $r10 = self::$FAILED; |
| 3101 | $this->currPos = $p9; |
| 3102 | $r7 = self::$FAILED; |
| 3103 | goto seq_2; |
| 3104 | } |
| 3105 | // free $p9 |
| 3106 | if ($this->currPos < $this->inputLength) { |
| 3107 | $r11 = self::consumeChar($this->input, $this->currPos);; |
| 3108 | } else { |
| 3109 | $r11 = self::$FAILED; |
| 3110 | if (!$silence) {$this->fail(7);} |
| 3111 | $this->currPos = $p8; |
| 3112 | $r7 = self::$FAILED; |
| 3113 | goto seq_2; |
| 3114 | } |
| 3115 | $r7 = true; |
| 3116 | seq_2: |
| 3117 | if ($r7===self::$FAILED) { |
| 3118 | break; |
| 3119 | } |
| 3120 | // free $p8 |
| 3121 | } |
| 3122 | // free $r7 |
| 3123 | $r5 = true; |
| 3124 | // c <- $r5 |
| 3125 | if ($r5!==self::$FAILED) { |
| 3126 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 3127 | } else { |
| 3128 | $r5 = self::$FAILED; |
| 3129 | $this->currPos = $p3; |
| 3130 | $r1 = self::$FAILED; |
| 3131 | goto seq_1; |
| 3132 | } |
| 3133 | // free $p6 |
| 3134 | $p6 = $this->currPos; |
| 3135 | // start choice_1 |
| 3136 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
| 3137 | $r7 = "-->"; |
| 3138 | $this->currPos += 3; |
| 3139 | goto choice_1; |
| 3140 | } else { |
| 3141 | if (!$silence) {$this->fail(12);} |
| 3142 | $r7 = self::$FAILED; |
| 3143 | } |
| 3144 | $r7 = $this->discardeof($silence); |
| 3145 | choice_1: |
| 3146 | // cEnd <- $r7 |
| 3147 | if ($r7!==self::$FAILED) { |
| 3148 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
| 3149 | } else { |
| 3150 | $r7 = self::$FAILED; |
| 3151 | $this->currPos = $p3; |
| 3152 | $r1 = self::$FAILED; |
| 3153 | goto seq_1; |
| 3154 | } |
| 3155 | // free $p6 |
| 3156 | $r1 = true; |
| 3157 | seq_1: |
| 3158 | if ($r1!==self::$FAILED) { |
| 3159 | $this->savedPos = $p2; |
| 3160 | $r1 = $this->a27($r5, $r7); |
| 3161 | } |
| 3162 | // free $p3 |
| 3163 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3164 | $this->currPos, |
| 3165 | $r1, |
| 3166 | self::$UNDEFINED, |
| 3167 | self::$UNDEFINED |
| 3168 | ); |
| 3169 | return $r1; |
| 3170 | } |
| 3171 | private function parsepipe($silence) { |
| 3172 | $key = 522; |
| 3173 | $bucket = $this->currPos; |
| 3174 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3175 | if ($cached) { |
| 3176 | $this->currPos = $cached->nextPos; |
| 3177 | |
| 3178 | return $cached->result; |
| 3179 | } |
| 3180 | |
| 3181 | // start choice_1 |
| 3182 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 3183 | $this->currPos++; |
| 3184 | $r1 = "|"; |
| 3185 | goto choice_1; |
| 3186 | } else { |
| 3187 | if (!$silence) {$this->fail(13);} |
| 3188 | $r1 = self::$FAILED; |
| 3189 | } |
| 3190 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
| 3191 | $r1 = "{{!}}"; |
| 3192 | $this->currPos += 5; |
| 3193 | } else { |
| 3194 | if (!$silence) {$this->fail(14);} |
| 3195 | $r1 = self::$FAILED; |
| 3196 | } |
| 3197 | choice_1: |
| 3198 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3199 | $this->currPos, |
| 3200 | $r1, |
| 3201 | self::$UNDEFINED, |
| 3202 | self::$UNDEFINED |
| 3203 | ); |
| 3204 | return $r1; |
| 3205 | } |
| 3206 | private function parseurl_protocol($silence) { |
| 3207 | $key = 336; |
| 3208 | $bucket = $this->currPos; |
| 3209 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3210 | if ($cached) { |
| 3211 | $this->currPos = $cached->nextPos; |
| 3212 | |
| 3213 | return $cached->result; |
| 3214 | } |
| 3215 | |
| 3216 | $p2 = $this->currPos; |
| 3217 | // start seq_1 |
| 3218 | $p3 = $this->currPos; |
| 3219 | $p5 = $this->currPos; |
| 3220 | // start choice_1 |
| 3221 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
| 3222 | $r4 = "//"; |
| 3223 | $this->currPos += 2; |
| 3224 | goto choice_1; |
| 3225 | } else { |
| 3226 | if (!$silence) {$this->fail(15);} |
| 3227 | $r4 = self::$FAILED; |
| 3228 | } |
| 3229 | // start seq_2 |
| 3230 | $p6 = $this->currPos; |
| 3231 | $r7 = $this->input[$this->currPos] ?? ''; |
| 3232 | if (preg_match("/^[A-Za-z]/", $r7)) { |
| 3233 | $this->currPos++; |
| 3234 | } else { |
| 3235 | $r7 = self::$FAILED; |
| 3236 | if (!$silence) {$this->fail(16);} |
| 3237 | $r4 = self::$FAILED; |
| 3238 | goto seq_2; |
| 3239 | } |
| 3240 | for (;;) { |
| 3241 | $r9 = $this->input[$this->currPos] ?? ''; |
| 3242 | if (preg_match("/^[\\-A-Za-z0-9+.]/", $r9)) { |
| 3243 | $this->currPos++; |
| 3244 | } else { |
| 3245 | $r9 = self::$FAILED; |
| 3246 | if (!$silence) {$this->fail(17);} |
| 3247 | break; |
| 3248 | } |
| 3249 | } |
| 3250 | // free $r9 |
| 3251 | $r8 = true; |
| 3252 | if ($r8===self::$FAILED) { |
| 3253 | $this->currPos = $p6; |
| 3254 | $r4 = self::$FAILED; |
| 3255 | goto seq_2; |
| 3256 | } |
| 3257 | // free $r8 |
| 3258 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 3259 | $this->currPos++; |
| 3260 | $r8 = ":"; |
| 3261 | } else { |
| 3262 | if (!$silence) {$this->fail(18);} |
| 3263 | $r8 = self::$FAILED; |
| 3264 | $this->currPos = $p6; |
| 3265 | $r4 = self::$FAILED; |
| 3266 | goto seq_2; |
| 3267 | } |
| 3268 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
| 3269 | $r9 = "//"; |
| 3270 | $this->currPos += 2; |
| 3271 | } else { |
| 3272 | if (!$silence) {$this->fail(15);} |
| 3273 | $r9 = self::$FAILED; |
| 3274 | $r9 = null; |
| 3275 | } |
| 3276 | $r4 = true; |
| 3277 | seq_2: |
| 3278 | // free $p6 |
| 3279 | choice_1: |
| 3280 | // p <- $r4 |
| 3281 | if ($r4!==self::$FAILED) { |
| 3282 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 3283 | } else { |
| 3284 | $r4 = self::$FAILED; |
| 3285 | $r1 = self::$FAILED; |
| 3286 | goto seq_1; |
| 3287 | } |
| 3288 | // free $p5 |
| 3289 | $this->savedPos = $this->currPos; |
| 3290 | $r10 = $this->a28($r4); |
| 3291 | if ($r10) { |
| 3292 | $r10 = false; |
| 3293 | } else { |
| 3294 | $r10 = self::$FAILED; |
| 3295 | $this->currPos = $p3; |
| 3296 | $r1 = self::$FAILED; |
| 3297 | goto seq_1; |
| 3298 | } |
| 3299 | $r1 = true; |
| 3300 | seq_1: |
| 3301 | if ($r1!==self::$FAILED) { |
| 3302 | $this->savedPos = $p2; |
| 3303 | $r1 = $this->a29($r4); |
| 3304 | } |
| 3305 | // free $p3 |
| 3306 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3307 | $this->currPos, |
| 3308 | $r1, |
| 3309 | self::$UNDEFINED, |
| 3310 | self::$UNDEFINED |
| 3311 | ); |
| 3312 | return $r1; |
| 3313 | } |
| 3314 | private function parseipv6urladdr($silence) { |
| 3315 | $key = 344; |
| 3316 | $bucket = $this->currPos; |
| 3317 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3318 | if ($cached) { |
| 3319 | $this->currPos = $cached->nextPos; |
| 3320 | |
| 3321 | return $cached->result; |
| 3322 | } |
| 3323 | |
| 3324 | $p1 = $this->currPos; |
| 3325 | // start seq_1 |
| 3326 | $p3 = $this->currPos; |
| 3327 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 3328 | $this->currPos++; |
| 3329 | $r4 = "["; |
| 3330 | } else { |
| 3331 | if (!$silence) {$this->fail(19);} |
| 3332 | $r4 = self::$FAILED; |
| 3333 | $r2 = self::$FAILED; |
| 3334 | goto seq_1; |
| 3335 | } |
| 3336 | $r5 = self::$FAILED; |
| 3337 | for (;;) { |
| 3338 | $r6 = $this->input[$this->currPos] ?? ''; |
| 3339 | if (preg_match("/^[0-9A-Fa-f:.]/", $r6)) { |
| 3340 | $this->currPos++; |
| 3341 | $r5 = true; |
| 3342 | } else { |
| 3343 | $r6 = self::$FAILED; |
| 3344 | if (!$silence) {$this->fail(20);} |
| 3345 | break; |
| 3346 | } |
| 3347 | } |
| 3348 | if ($r5===self::$FAILED) { |
| 3349 | $this->currPos = $p3; |
| 3350 | $r2 = self::$FAILED; |
| 3351 | goto seq_1; |
| 3352 | } |
| 3353 | // free $r6 |
| 3354 | if (($this->input[$this->currPos] ?? null) === "]") { |
| 3355 | $this->currPos++; |
| 3356 | $r6 = "]"; |
| 3357 | } else { |
| 3358 | if (!$silence) {$this->fail(21);} |
| 3359 | $r6 = self::$FAILED; |
| 3360 | $this->currPos = $p3; |
| 3361 | $r2 = self::$FAILED; |
| 3362 | goto seq_1; |
| 3363 | } |
| 3364 | $r2 = true; |
| 3365 | seq_1: |
| 3366 | if ($r2!==self::$FAILED) { |
| 3367 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
| 3368 | } else { |
| 3369 | $r2 = self::$FAILED; |
| 3370 | } |
| 3371 | // free $p3 |
| 3372 | // free $p1 |
| 3373 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3374 | $this->currPos, |
| 3375 | $r2, |
| 3376 | self::$UNDEFINED, |
| 3377 | self::$UNDEFINED |
| 3378 | ); |
| 3379 | return $r2; |
| 3380 | } |
| 3381 | private function discardinline_breaks($silence, $boolParams, &$param_preproc, &$param_th) { |
| 3382 | $key = json_encode([311, $boolParams & 0x1ffe, $param_preproc, $param_th]); |
| 3383 | $bucket = $this->currPos; |
| 3384 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3385 | if ($cached) { |
| 3386 | $this->currPos = $cached->nextPos; |
| 3387 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3388 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3389 | return $cached->result; |
| 3390 | } |
| 3391 | $saved_preproc=$param_preproc; |
| 3392 | $saved_th=$param_th; |
| 3393 | // start seq_1 |
| 3394 | $p1 = $this->currPos; |
| 3395 | $p3 = $this->currPos; |
| 3396 | if (strspn($this->input, "=|!{}:;\x0d\x0a[]-", $this->currPos, 1) !== 0) { |
| 3397 | $r4 = $this->input[$this->currPos++]; |
| 3398 | $r4 = false; |
| 3399 | $this->currPos = $p3; |
| 3400 | } else { |
| 3401 | $r4 = self::$FAILED; |
| 3402 | $r2 = self::$FAILED; |
| 3403 | goto seq_1; |
| 3404 | } |
| 3405 | // free $p3 |
| 3406 | // start seq_2 |
| 3407 | $p3 = $this->currPos; |
| 3408 | $this->savedPos = $this->currPos; |
| 3409 | $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); |
| 3410 | if ($r6) { |
| 3411 | $r6 = false; |
| 3412 | } else { |
| 3413 | $r6 = self::$FAILED; |
| 3414 | $this->currPos = $p3; |
| 3415 | $r5 = self::$FAILED; |
| 3416 | goto seq_2; |
| 3417 | } |
| 3418 | $r5 = true; |
| 3419 | seq_2: |
| 3420 | if ($r5===self::$FAILED) { |
| 3421 | $this->currPos = $p1; |
| 3422 | $r2 = self::$FAILED; |
| 3423 | goto seq_1; |
| 3424 | } |
| 3425 | // free $r5,$p3 |
| 3426 | $r2 = true; |
| 3427 | seq_1: |
| 3428 | // free $r2,$p1 |
| 3429 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3430 | $this->currPos, |
| 3431 | $r2, |
| 3432 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3433 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 3434 | ); |
| 3435 | return $r2; |
| 3436 | } |
| 3437 | private function parseno_punctuation_char($silence) { |
| 3438 | $key = 338; |
| 3439 | $bucket = $this->currPos; |
| 3440 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3441 | if ($cached) { |
| 3442 | $this->currPos = $cached->nextPos; |
| 3443 | |
| 3444 | return $cached->result; |
| 3445 | } |
| 3446 | |
| 3447 | $r1 = self::charAt($this->input, $this->currPos); |
| 3448 | 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)) { |
| 3449 | $this->currPos += strlen($r1); |
| 3450 | } else { |
| 3451 | $r1 = self::$FAILED; |
| 3452 | if (!$silence) {$this->fail(22);} |
| 3453 | } |
| 3454 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3455 | $this->currPos, |
| 3456 | $r1, |
| 3457 | self::$UNDEFINED, |
| 3458 | self::$UNDEFINED |
| 3459 | ); |
| 3460 | return $r1; |
| 3461 | } |
| 3462 | private function parsetplarg_or_template($silence, $boolParams, &$param_th, &$param_preproc) { |
| 3463 | $key = json_encode([346, $boolParams & 0x3fef, $param_th, $param_preproc]); |
| 3464 | $bucket = $this->currPos; |
| 3465 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3466 | if ($cached) { |
| 3467 | $this->currPos = $cached->nextPos; |
| 3468 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3469 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3470 | return $cached->result; |
| 3471 | } |
| 3472 | $saved_th=$param_th; |
| 3473 | $saved_preproc=$param_preproc; |
| 3474 | $p2 = $this->currPos; |
| 3475 | // start seq_1 |
| 3476 | $p3 = $this->currPos; |
| 3477 | $p4 = $this->currPos; |
| 3478 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 3479 | $r5 = "{{"; |
| 3480 | $this->currPos += 2; |
| 3481 | $r5 = false; |
| 3482 | $this->currPos = $p4; |
| 3483 | } else { |
| 3484 | $r5 = self::$FAILED; |
| 3485 | $r1 = self::$FAILED; |
| 3486 | goto seq_1; |
| 3487 | } |
| 3488 | // free $p4 |
| 3489 | $r6 = $this->parsetplarg_or_template_guarded($silence, $boolParams | 0x10, $param_th, $param_preproc); |
| 3490 | // t <- $r6 |
| 3491 | if ($r6===self::$FAILED) { |
| 3492 | $this->currPos = $p3; |
| 3493 | $r1 = self::$FAILED; |
| 3494 | goto seq_1; |
| 3495 | } |
| 3496 | $r1 = true; |
| 3497 | seq_1: |
| 3498 | if ($r1!==self::$FAILED) { |
| 3499 | $this->savedPos = $p2; |
| 3500 | $r1 = $this->a31($r6); |
| 3501 | } |
| 3502 | // free $p3 |
| 3503 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3504 | $this->currPos, |
| 3505 | $r1, |
| 3506 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3507 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 3508 | ); |
| 3509 | return $r1; |
| 3510 | } |
| 3511 | private function parsehtmlentity($silence) { |
| 3512 | $key = 498; |
| 3513 | $bucket = $this->currPos; |
| 3514 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3515 | if ($cached) { |
| 3516 | $this->currPos = $cached->nextPos; |
| 3517 | |
| 3518 | return $cached->result; |
| 3519 | } |
| 3520 | |
| 3521 | $p2 = $this->currPos; |
| 3522 | $r3 = $this->parseraw_htmlentity($silence); |
| 3523 | // cc <- $r3 |
| 3524 | $r1 = $r3; |
| 3525 | if ($r1!==self::$FAILED) { |
| 3526 | $this->savedPos = $p2; |
| 3527 | $r1 = $this->a32($r3); |
| 3528 | } |
| 3529 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3530 | $this->currPos, |
| 3531 | $r1, |
| 3532 | self::$UNDEFINED, |
| 3533 | self::$UNDEFINED |
| 3534 | ); |
| 3535 | return $r1; |
| 3536 | } |
| 3537 | private function parseoptional_spaces($silence) { |
| 3538 | $key = 528; |
| 3539 | $bucket = $this->currPos; |
| 3540 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3541 | if ($cached) { |
| 3542 | $this->currPos = $cached->nextPos; |
| 3543 | |
| 3544 | return $cached->result; |
| 3545 | } |
| 3546 | |
| 3547 | $p1 = $this->currPos; |
| 3548 | for (;;) { |
| 3549 | $r3 = $this->input[$this->currPos] ?? ''; |
| 3550 | if ($r3 === " " || $r3 === "\x09") { |
| 3551 | $this->currPos++; |
| 3552 | } else { |
| 3553 | $r3 = self::$FAILED; |
| 3554 | if (!$silence) {$this->fail(10);} |
| 3555 | break; |
| 3556 | } |
| 3557 | } |
| 3558 | // free $r3 |
| 3559 | $r2 = true; |
| 3560 | if ($r2!==self::$FAILED) { |
| 3561 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
| 3562 | } else { |
| 3563 | $r2 = self::$FAILED; |
| 3564 | } |
| 3565 | // free $p1 |
| 3566 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3567 | $this->currPos, |
| 3568 | $r2, |
| 3569 | self::$UNDEFINED, |
| 3570 | self::$UNDEFINED |
| 3571 | ); |
| 3572 | return $r2; |
| 3573 | } |
| 3574 | private function discardpipe($silence) { |
| 3575 | $key = 523; |
| 3576 | $bucket = $this->currPos; |
| 3577 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3578 | if ($cached) { |
| 3579 | $this->currPos = $cached->nextPos; |
| 3580 | |
| 3581 | return $cached->result; |
| 3582 | } |
| 3583 | |
| 3584 | // start choice_1 |
| 3585 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 3586 | $this->currPos++; |
| 3587 | $r1 = "|"; |
| 3588 | goto choice_1; |
| 3589 | } else { |
| 3590 | if (!$silence) {$this->fail(13);} |
| 3591 | $r1 = self::$FAILED; |
| 3592 | } |
| 3593 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
| 3594 | $r1 = "{{!}}"; |
| 3595 | $this->currPos += 5; |
| 3596 | } else { |
| 3597 | if (!$silence) {$this->fail(14);} |
| 3598 | $r1 = self::$FAILED; |
| 3599 | } |
| 3600 | choice_1: |
| 3601 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3602 | $this->currPos, |
| 3603 | $r1, |
| 3604 | self::$UNDEFINED, |
| 3605 | self::$UNDEFINED |
| 3606 | ); |
| 3607 | return $r1; |
| 3608 | } |
| 3609 | private function parsetable_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
| 3610 | $key = json_encode([432, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 3611 | $bucket = $this->currPos; |
| 3612 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3613 | if ($cached) { |
| 3614 | $this->currPos = $cached->nextPos; |
| 3615 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3616 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3617 | return $cached->result; |
| 3618 | } |
| 3619 | $saved_preproc=$param_preproc; |
| 3620 | $saved_th=$param_th; |
| 3621 | $p2 = $this->currPos; |
| 3622 | // start seq_1 |
| 3623 | $p3 = $this->currPos; |
| 3624 | $r4 = $this->parseoptionalSpaceToken($silence); |
| 3625 | // s <- $r4 |
| 3626 | if ($r4===self::$FAILED) { |
| 3627 | $r1 = self::$FAILED; |
| 3628 | goto seq_1; |
| 3629 | } |
| 3630 | $p6 = $this->currPos; |
| 3631 | $r5 = ''; |
| 3632 | // namePos0 <- $r5 |
| 3633 | if ($r5!==self::$FAILED) { |
| 3634 | $this->savedPos = $p6; |
| 3635 | $r5 = $this->a33($r4); |
| 3636 | } else { |
| 3637 | $this->currPos = $p3; |
| 3638 | $r1 = self::$FAILED; |
| 3639 | goto seq_1; |
| 3640 | } |
| 3641 | $r7 = $this->parsetable_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
| 3642 | // name <- $r7 |
| 3643 | if ($r7===self::$FAILED) { |
| 3644 | $this->currPos = $p3; |
| 3645 | $r1 = self::$FAILED; |
| 3646 | goto seq_1; |
| 3647 | } |
| 3648 | $p9 = $this->currPos; |
| 3649 | $r8 = ''; |
| 3650 | // namePos1 <- $r8 |
| 3651 | if ($r8!==self::$FAILED) { |
| 3652 | $this->savedPos = $p9; |
| 3653 | $r8 = $this->a34($r4, $r5, $r7); |
| 3654 | } else { |
| 3655 | $this->currPos = $p3; |
| 3656 | $r1 = self::$FAILED; |
| 3657 | goto seq_1; |
| 3658 | } |
| 3659 | $p11 = $this->currPos; |
| 3660 | // start seq_2 |
| 3661 | $p12 = $this->currPos; |
| 3662 | $r13 = $this->discardoptionalSpaceToken($silence); |
| 3663 | if ($r13===self::$FAILED) { |
| 3664 | $r10 = self::$FAILED; |
| 3665 | goto seq_2; |
| 3666 | } |
| 3667 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 3668 | $this->currPos++; |
| 3669 | $r14 = "="; |
| 3670 | } else { |
| 3671 | if (!$silence) {$this->fail(23);} |
| 3672 | $r14 = self::$FAILED; |
| 3673 | $this->currPos = $p12; |
| 3674 | $r10 = self::$FAILED; |
| 3675 | goto seq_2; |
| 3676 | } |
| 3677 | $r15 = $this->parsetable_att_value($silence, $boolParams, $param_preproc, $param_th); |
| 3678 | if ($r15===self::$FAILED) { |
| 3679 | $r15 = null; |
| 3680 | } |
| 3681 | // v <- $r15 |
| 3682 | $r10 = true; |
| 3683 | seq_2: |
| 3684 | if ($r10!==self::$FAILED) { |
| 3685 | $this->savedPos = $p11; |
| 3686 | $r10 = $this->a35($r4, $r5, $r7, $r8, $r15); |
| 3687 | } else { |
| 3688 | $r10 = null; |
| 3689 | } |
| 3690 | // free $p12 |
| 3691 | // vd <- $r10 |
| 3692 | $r1 = true; |
| 3693 | seq_1: |
| 3694 | if ($r1!==self::$FAILED) { |
| 3695 | $this->savedPos = $p2; |
| 3696 | $r1 = $this->a36($r4, $r5, $r7, $r8, $r10); |
| 3697 | } |
| 3698 | // free $p3 |
| 3699 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3700 | $this->currPos, |
| 3701 | $r1, |
| 3702 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3703 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 3704 | ); |
| 3705 | return $r1; |
| 3706 | } |
| 3707 | private function discardoptionalSpaceToken($silence) { |
| 3708 | $key = 545; |
| 3709 | $bucket = $this->currPos; |
| 3710 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3711 | if ($cached) { |
| 3712 | $this->currPos = $cached->nextPos; |
| 3713 | |
| 3714 | return $cached->result; |
| 3715 | } |
| 3716 | |
| 3717 | $p2 = $this->currPos; |
| 3718 | $r3 = $this->parseoptional_spaces($silence); |
| 3719 | // s <- $r3 |
| 3720 | $r1 = $r3; |
| 3721 | if ($r1!==self::$FAILED) { |
| 3722 | $this->savedPos = $p2; |
| 3723 | $r1 = $this->a37($r3); |
| 3724 | } |
| 3725 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3726 | $this->currPos, |
| 3727 | $r1, |
| 3728 | self::$UNDEFINED, |
| 3729 | self::$UNDEFINED |
| 3730 | ); |
| 3731 | return $r1; |
| 3732 | } |
| 3733 | private function parsebroken_table_attribute_name_char($silence) { |
| 3734 | $key = 438; |
| 3735 | $bucket = $this->currPos; |
| 3736 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3737 | if ($cached) { |
| 3738 | $this->currPos = $cached->nextPos; |
| 3739 | |
| 3740 | return $cached->result; |
| 3741 | } |
| 3742 | |
| 3743 | $p2 = $this->currPos; |
| 3744 | // c <- $r3 |
| 3745 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
| 3746 | $r3 = $this->input[$this->currPos++]; |
| 3747 | } else { |
| 3748 | $r3 = self::$FAILED; |
| 3749 | if (!$silence) {$this->fail(24);} |
| 3750 | } |
| 3751 | $r1 = $r3; |
| 3752 | if ($r1!==self::$FAILED) { |
| 3753 | $this->savedPos = $p2; |
| 3754 | $r1 = $this->a38($r3); |
| 3755 | } |
| 3756 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3757 | $this->currPos, |
| 3758 | $r1, |
| 3759 | self::$UNDEFINED, |
| 3760 | self::$UNDEFINED |
| 3761 | ); |
| 3762 | return $r1; |
| 3763 | } |
| 3764 | private function parsegeneric_newline_attribute($silence, $boolParams, &$param_preproc, &$param_th) { |
| 3765 | $key = json_encode([430, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 3766 | $bucket = $this->currPos; |
| 3767 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3768 | if ($cached) { |
| 3769 | $this->currPos = $cached->nextPos; |
| 3770 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3771 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3772 | return $cached->result; |
| 3773 | } |
| 3774 | $saved_preproc=$param_preproc; |
| 3775 | $saved_th=$param_th; |
| 3776 | $p2 = $this->currPos; |
| 3777 | // start seq_1 |
| 3778 | $p3 = $this->currPos; |
| 3779 | for (;;) { |
| 3780 | $r5 = $this->discardspace_or_newline_or_solidus($silence); |
| 3781 | if ($r5===self::$FAILED) { |
| 3782 | break; |
| 3783 | } |
| 3784 | } |
| 3785 | // free $r5 |
| 3786 | $r4 = true; |
| 3787 | if ($r4===self::$FAILED) { |
| 3788 | $r1 = self::$FAILED; |
| 3789 | goto seq_1; |
| 3790 | } |
| 3791 | // free $r4 |
| 3792 | $p6 = $this->currPos; |
| 3793 | $r4 = ''; |
| 3794 | // namePos0 <- $r4 |
| 3795 | if ($r4!==self::$FAILED) { |
| 3796 | $this->savedPos = $p6; |
| 3797 | $r4 = $this->a17(); |
| 3798 | } else { |
| 3799 | $this->currPos = $p3; |
| 3800 | $r1 = self::$FAILED; |
| 3801 | goto seq_1; |
| 3802 | } |
| 3803 | $r5 = $this->parsegeneric_attribute_name($silence, $boolParams, $param_preproc, $param_th); |
| 3804 | // name <- $r5 |
| 3805 | if ($r5===self::$FAILED) { |
| 3806 | $this->currPos = $p3; |
| 3807 | $r1 = self::$FAILED; |
| 3808 | goto seq_1; |
| 3809 | } |
| 3810 | $p8 = $this->currPos; |
| 3811 | $r7 = ''; |
| 3812 | // namePos1 <- $r7 |
| 3813 | if ($r7!==self::$FAILED) { |
| 3814 | $this->savedPos = $p8; |
| 3815 | $r7 = $this->a39($r4, $r5); |
| 3816 | } else { |
| 3817 | $this->currPos = $p3; |
| 3818 | $r1 = self::$FAILED; |
| 3819 | goto seq_1; |
| 3820 | } |
| 3821 | $p10 = $this->currPos; |
| 3822 | // start seq_2 |
| 3823 | $p11 = $this->currPos; |
| 3824 | for (;;) { |
| 3825 | $r13 = $this->discardspace_or_newline($silence); |
| 3826 | if ($r13===self::$FAILED) { |
| 3827 | break; |
| 3828 | } |
| 3829 | } |
| 3830 | // free $r13 |
| 3831 | $r12 = true; |
| 3832 | if ($r12===self::$FAILED) { |
| 3833 | $r9 = self::$FAILED; |
| 3834 | goto seq_2; |
| 3835 | } |
| 3836 | // free $r12 |
| 3837 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 3838 | $this->currPos++; |
| 3839 | $r12 = "="; |
| 3840 | } else { |
| 3841 | if (!$silence) {$this->fail(23);} |
| 3842 | $r12 = self::$FAILED; |
| 3843 | $this->currPos = $p11; |
| 3844 | $r9 = self::$FAILED; |
| 3845 | goto seq_2; |
| 3846 | } |
| 3847 | $r13 = $this->parsegeneric_att_value($silence, $boolParams, $param_preproc, $param_th); |
| 3848 | if ($r13===self::$FAILED) { |
| 3849 | $r13 = null; |
| 3850 | } |
| 3851 | // v <- $r13 |
| 3852 | $r9 = true; |
| 3853 | seq_2: |
| 3854 | if ($r9!==self::$FAILED) { |
| 3855 | $this->savedPos = $p10; |
| 3856 | $r9 = $this->a40($r4, $r5, $r7, $r13); |
| 3857 | } else { |
| 3858 | $r9 = null; |
| 3859 | } |
| 3860 | // free $p11 |
| 3861 | // vd <- $r9 |
| 3862 | $r1 = true; |
| 3863 | seq_1: |
| 3864 | if ($r1!==self::$FAILED) { |
| 3865 | $this->savedPos = $p2; |
| 3866 | $r1 = $this->a41($r4, $r5, $r7, $r9); |
| 3867 | } |
| 3868 | // free $p3 |
| 3869 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3870 | $this->currPos, |
| 3871 | $r1, |
| 3872 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3873 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 3874 | ); |
| 3875 | return $r1; |
| 3876 | } |
| 3877 | private function parseextlink_nonipv6url($silence, $boolParams, &$param_preproc, &$param_th) { |
| 3878 | $key = json_encode([506, $boolParams & 0x37ff, $param_preproc, $param_th]); |
| 3879 | $bucket = $this->currPos; |
| 3880 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3881 | if ($cached) { |
| 3882 | $this->currPos = $cached->nextPos; |
| 3883 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3884 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3885 | return $cached->result; |
| 3886 | } |
| 3887 | $saved_preproc=$param_preproc; |
| 3888 | $saved_th=$param_th; |
| 3889 | $r1 = $this->parseextlink_nonipv6url_parameterized($silence, $boolParams & ~0x800, $param_preproc, $param_th); |
| 3890 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3891 | $this->currPos, |
| 3892 | $r1, |
| 3893 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 3894 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 3895 | ); |
| 3896 | return $r1; |
| 3897 | } |
| 3898 | private function discardspace($silence) { |
| 3899 | $key = 527; |
| 3900 | $bucket = $this->currPos; |
| 3901 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3902 | if ($cached) { |
| 3903 | $this->currPos = $cached->nextPos; |
| 3904 | |
| 3905 | return $cached->result; |
| 3906 | } |
| 3907 | |
| 3908 | $r1 = $this->input[$this->currPos] ?? ''; |
| 3909 | if ($r1 === " " || $r1 === "\x09") { |
| 3910 | $this->currPos++; |
| 3911 | } else { |
| 3912 | $r1 = self::$FAILED; |
| 3913 | if (!$silence) {$this->fail(10);} |
| 3914 | } |
| 3915 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3916 | $this->currPos, |
| 3917 | $r1, |
| 3918 | self::$UNDEFINED, |
| 3919 | self::$UNDEFINED |
| 3920 | ); |
| 3921 | return $r1; |
| 3922 | } |
| 3923 | private function discardunispace($silence) { |
| 3924 | $key = 551; |
| 3925 | $bucket = $this->currPos; |
| 3926 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3927 | if ($cached) { |
| 3928 | $this->currPos = $cached->nextPos; |
| 3929 | |
| 3930 | return $cached->result; |
| 3931 | } |
| 3932 | |
| 3933 | $r1 = self::charAt($this->input, $this->currPos); |
| 3934 | if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) { |
| 3935 | $this->currPos += strlen($r1); |
| 3936 | } else { |
| 3937 | $r1 = self::$FAILED; |
| 3938 | if (!$silence) {$this->fail(25);} |
| 3939 | } |
| 3940 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 3941 | $this->currPos, |
| 3942 | $r1, |
| 3943 | self::$UNDEFINED, |
| 3944 | self::$UNDEFINED |
| 3945 | ); |
| 3946 | return $r1; |
| 3947 | } |
| 3948 | private function parseinlineline($silence, $boolParams, &$param_preproc, &$param_th) { |
| 3949 | $key = json_encode([312, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 3950 | $bucket = $this->currPos; |
| 3951 | $cached = $this->cache[$bucket][$key] ?? null; |
| 3952 | if ($cached) { |
| 3953 | $this->currPos = $cached->nextPos; |
| 3954 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 3955 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 3956 | return $cached->result; |
| 3957 | } |
| 3958 | $saved_preproc=$param_preproc; |
| 3959 | $saved_th=$param_th; |
| 3960 | $p2 = $this->currPos; |
| 3961 | $r3 = []; |
| 3962 | for (;;) { |
| 3963 | // start choice_1 |
| 3964 | $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th); |
| 3965 | if ($r4!==self::$FAILED) { |
| 3966 | goto choice_1; |
| 3967 | } |
| 3968 | $p5 = $this->currPos; |
| 3969 | // start seq_1 |
| 3970 | $p6 = $this->currPos; |
| 3971 | $p7 = $this->currPos; |
| 3972 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 3973 | if ($r8 === self::$FAILED) { |
| 3974 | $r8 = false; |
| 3975 | } else { |
| 3976 | $r8 = self::$FAILED; |
| 3977 | $this->currPos = $p7; |
| 3978 | $r4 = self::$FAILED; |
| 3979 | goto seq_1; |
| 3980 | } |
| 3981 | // free $p7 |
| 3982 | // start choice_2 |
| 3983 | $r9 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th); |
| 3984 | if ($r9!==self::$FAILED) { |
| 3985 | goto choice_2; |
| 3986 | } |
| 3987 | $p7 = $this->currPos; |
| 3988 | // start seq_2 |
| 3989 | $p10 = $this->currPos; |
| 3990 | $p11 = $this->currPos; |
| 3991 | $r12 = $this->discardnewline(true); |
| 3992 | if ($r12 === self::$FAILED) { |
| 3993 | $r12 = false; |
| 3994 | } else { |
| 3995 | $r12 = self::$FAILED; |
| 3996 | $this->currPos = $p11; |
| 3997 | $r9 = self::$FAILED; |
| 3998 | goto seq_2; |
| 3999 | } |
| 4000 | // free $p11 |
| 4001 | // s <- $r13 |
| 4002 | if ($this->currPos < $this->inputLength) { |
| 4003 | $r13 = self::consumeChar($this->input, $this->currPos);; |
| 4004 | } else { |
| 4005 | $r13 = self::$FAILED; |
| 4006 | if (!$silence) {$this->fail(7);} |
| 4007 | $this->currPos = $p10; |
| 4008 | $r9 = self::$FAILED; |
| 4009 | goto seq_2; |
| 4010 | } |
| 4011 | $r9 = true; |
| 4012 | seq_2: |
| 4013 | if ($r9!==self::$FAILED) { |
| 4014 | $this->savedPos = $p7; |
| 4015 | $r9 = $this->a42($r13); |
| 4016 | } |
| 4017 | // free $p10 |
| 4018 | choice_2: |
| 4019 | // r <- $r9 |
| 4020 | if ($r9===self::$FAILED) { |
| 4021 | $this->currPos = $p6; |
| 4022 | $r4 = self::$FAILED; |
| 4023 | goto seq_1; |
| 4024 | } |
| 4025 | $r4 = true; |
| 4026 | seq_1: |
| 4027 | if ($r4!==self::$FAILED) { |
| 4028 | $this->savedPos = $p5; |
| 4029 | $r4 = $this->a24($r9); |
| 4030 | } |
| 4031 | // free $p6 |
| 4032 | choice_1: |
| 4033 | if ($r4!==self::$FAILED) { |
| 4034 | $r3[] = $r4; |
| 4035 | } else { |
| 4036 | break; |
| 4037 | } |
| 4038 | } |
| 4039 | if (count($r3) === 0) { |
| 4040 | $r3 = self::$FAILED; |
| 4041 | } |
| 4042 | // c <- $r3 |
| 4043 | // free $r4 |
| 4044 | $r1 = $r3; |
| 4045 | if ($r1!==self::$FAILED) { |
| 4046 | $this->savedPos = $p2; |
| 4047 | $r1 = $this->a43($r3); |
| 4048 | } |
| 4049 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4050 | $this->currPos, |
| 4051 | $r1, |
| 4052 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4053 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4054 | ); |
| 4055 | return $r1; |
| 4056 | } |
| 4057 | private function parsedtdd($silence, $boolParams, &$param_preproc, &$param_th) { |
| 4058 | $key = json_encode([454, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 4059 | $bucket = $this->currPos; |
| 4060 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4061 | if ($cached) { |
| 4062 | $this->currPos = $cached->nextPos; |
| 4063 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4064 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4065 | return $cached->result; |
| 4066 | } |
| 4067 | $saved_preproc=$param_preproc; |
| 4068 | $saved_th=$param_th; |
| 4069 | $p2 = $this->currPos; |
| 4070 | // start seq_1 |
| 4071 | $p3 = $this->currPos; |
| 4072 | $r4 = []; |
| 4073 | for (;;) { |
| 4074 | $p6 = $this->currPos; |
| 4075 | // start seq_2 |
| 4076 | $p7 = $this->currPos; |
| 4077 | $p8 = $this->currPos; |
| 4078 | // start seq_3 |
| 4079 | $p10 = $this->currPos; |
| 4080 | if (($this->input[$this->currPos] ?? null) === ";") { |
| 4081 | $this->currPos++; |
| 4082 | $r11 = ";"; |
| 4083 | } else { |
| 4084 | $r11 = self::$FAILED; |
| 4085 | $r9 = self::$FAILED; |
| 4086 | goto seq_3; |
| 4087 | } |
| 4088 | $p12 = $this->currPos; |
| 4089 | $r13 = $this->discardlist_char(true); |
| 4090 | if ($r13 === self::$FAILED) { |
| 4091 | $r13 = false; |
| 4092 | } else { |
| 4093 | $r13 = self::$FAILED; |
| 4094 | $this->currPos = $p12; |
| 4095 | $this->currPos = $p10; |
| 4096 | $r9 = self::$FAILED; |
| 4097 | goto seq_3; |
| 4098 | } |
| 4099 | // free $p12 |
| 4100 | $r9 = true; |
| 4101 | seq_3: |
| 4102 | // free $p10 |
| 4103 | if ($r9 === self::$FAILED) { |
| 4104 | $r9 = false; |
| 4105 | } else { |
| 4106 | $r9 = self::$FAILED; |
| 4107 | $this->currPos = $p8; |
| 4108 | $r5 = self::$FAILED; |
| 4109 | goto seq_2; |
| 4110 | } |
| 4111 | // free $p8 |
| 4112 | $r14 = $this->parselist_char($silence); |
| 4113 | // lc <- $r14 |
| 4114 | if ($r14===self::$FAILED) { |
| 4115 | $this->currPos = $p7; |
| 4116 | $r5 = self::$FAILED; |
| 4117 | goto seq_2; |
| 4118 | } |
| 4119 | $r5 = true; |
| 4120 | seq_2: |
| 4121 | if ($r5!==self::$FAILED) { |
| 4122 | $this->savedPos = $p6; |
| 4123 | $r5 = $this->a44($r14); |
| 4124 | $r4[] = $r5; |
| 4125 | } else { |
| 4126 | break; |
| 4127 | } |
| 4128 | // free $p7 |
| 4129 | } |
| 4130 | // bullets <- $r4 |
| 4131 | // free $r5 |
| 4132 | if (($this->input[$this->currPos] ?? null) === ";") { |
| 4133 | $this->currPos++; |
| 4134 | $r5 = ";"; |
| 4135 | } else { |
| 4136 | if (!$silence) {$this->fail(26);} |
| 4137 | $r5 = self::$FAILED; |
| 4138 | $this->currPos = $p3; |
| 4139 | $r1 = self::$FAILED; |
| 4140 | goto seq_1; |
| 4141 | } |
| 4142 | $r15 = []; |
| 4143 | for (;;) { |
| 4144 | $r16 = $this->parsedtdd_colon($silence, $boolParams, $param_preproc, $param_th); |
| 4145 | if ($r16!==self::$FAILED) { |
| 4146 | $r15[] = $r16; |
| 4147 | } else { |
| 4148 | break; |
| 4149 | } |
| 4150 | } |
| 4151 | // colons <- $r15 |
| 4152 | // free $r16 |
| 4153 | $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
| 4154 | if ($r16===self::$FAILED) { |
| 4155 | $r16 = null; |
| 4156 | } |
| 4157 | // d <- $r16 |
| 4158 | $p7 = $this->currPos; |
| 4159 | $r17 = $this->discardeolf(true); |
| 4160 | if ($r17!==self::$FAILED) { |
| 4161 | $r17 = false; |
| 4162 | $this->currPos = $p7; |
| 4163 | } else { |
| 4164 | $this->currPos = $p3; |
| 4165 | $r1 = self::$FAILED; |
| 4166 | goto seq_1; |
| 4167 | } |
| 4168 | // free $p7 |
| 4169 | $r1 = true; |
| 4170 | seq_1: |
| 4171 | if ($r1!==self::$FAILED) { |
| 4172 | $this->savedPos = $p2; |
| 4173 | $r1 = $this->a45($r4, $r15, $r16); |
| 4174 | } |
| 4175 | // free $p3 |
| 4176 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4177 | $this->currPos, |
| 4178 | $r1, |
| 4179 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4180 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4181 | ); |
| 4182 | return $r1; |
| 4183 | } |
| 4184 | private function parsehacky_dl_uses($silence, $boolParams, &$param_preproc, &$param_th) { |
| 4185 | $key = json_encode([450, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 4186 | $bucket = $this->currPos; |
| 4187 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4188 | if ($cached) { |
| 4189 | $this->currPos = $cached->nextPos; |
| 4190 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4191 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4192 | return $cached->result; |
| 4193 | } |
| 4194 | $saved_preproc=$param_preproc; |
| 4195 | $saved_th=$param_th; |
| 4196 | $p2 = $this->currPos; |
| 4197 | // start seq_1 |
| 4198 | $p3 = $this->currPos; |
| 4199 | $r4 = []; |
| 4200 | for (;;) { |
| 4201 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 4202 | $this->currPos++; |
| 4203 | $r5 = ":"; |
| 4204 | $r4[] = $r5; |
| 4205 | } else { |
| 4206 | if (!$silence) {$this->fail(18);} |
| 4207 | $r5 = self::$FAILED; |
| 4208 | break; |
| 4209 | } |
| 4210 | } |
| 4211 | if (count($r4) === 0) { |
| 4212 | $r4 = self::$FAILED; |
| 4213 | } |
| 4214 | // bullets <- $r4 |
| 4215 | if ($r4===self::$FAILED) { |
| 4216 | $r1 = self::$FAILED; |
| 4217 | goto seq_1; |
| 4218 | } |
| 4219 | // free $r5 |
| 4220 | // start seq_2 |
| 4221 | $p6 = $this->currPos; |
| 4222 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
| 4223 | if ($r7===self::$FAILED) { |
| 4224 | $r5 = self::$FAILED; |
| 4225 | goto seq_2; |
| 4226 | } |
| 4227 | $r8 = []; |
| 4228 | for (;;) { |
| 4229 | // start seq_3 |
| 4230 | $p10 = $this->currPos; |
| 4231 | $r11 = []; |
| 4232 | for (;;) { |
| 4233 | $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
| 4234 | if ($r12!==self::$FAILED) { |
| 4235 | $r11[] = $r12; |
| 4236 | } else { |
| 4237 | break; |
| 4238 | } |
| 4239 | } |
| 4240 | if (count($r11) === 0) { |
| 4241 | $r11 = self::$FAILED; |
| 4242 | } |
| 4243 | if ($r11===self::$FAILED) { |
| 4244 | $r9 = self::$FAILED; |
| 4245 | goto seq_3; |
| 4246 | } |
| 4247 | // free $r12 |
| 4248 | $r12 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
| 4249 | if ($r12===self::$FAILED) { |
| 4250 | $this->currPos = $p10; |
| 4251 | $r9 = self::$FAILED; |
| 4252 | goto seq_3; |
| 4253 | } |
| 4254 | $r9 = [$r11,$r12]; |
| 4255 | seq_3: |
| 4256 | if ($r9!==self::$FAILED) { |
| 4257 | $r8[] = $r9; |
| 4258 | } else { |
| 4259 | break; |
| 4260 | } |
| 4261 | // free $p10 |
| 4262 | } |
| 4263 | // free $r9 |
| 4264 | $r5 = [$r7,$r8]; |
| 4265 | seq_2: |
| 4266 | // tbl <- $r5 |
| 4267 | if ($r5===self::$FAILED) { |
| 4268 | $this->currPos = $p3; |
| 4269 | $r1 = self::$FAILED; |
| 4270 | goto seq_1; |
| 4271 | } |
| 4272 | // free $p6 |
| 4273 | $r9 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
| 4274 | if ($r9===self::$FAILED) { |
| 4275 | $r9 = null; |
| 4276 | } |
| 4277 | // line <- $r9 |
| 4278 | $p6 = $this->currPos; |
| 4279 | // start seq_4 |
| 4280 | $p10 = $this->currPos; |
| 4281 | for (;;) { |
| 4282 | // start choice_1 |
| 4283 | $r15 = $this->discardspace(true); |
| 4284 | if ($r15!==self::$FAILED) { |
| 4285 | goto choice_1; |
| 4286 | } |
| 4287 | $r15 = $this->discardcomment(true); |
| 4288 | choice_1: |
| 4289 | if ($r15===self::$FAILED) { |
| 4290 | break; |
| 4291 | } |
| 4292 | } |
| 4293 | // free $r15 |
| 4294 | $r14 = true; |
| 4295 | if ($r14===self::$FAILED) { |
| 4296 | $r13 = self::$FAILED; |
| 4297 | goto seq_4; |
| 4298 | } |
| 4299 | // free $r14 |
| 4300 | $r14 = $this->discardeolf(true); |
| 4301 | if ($r14===self::$FAILED) { |
| 4302 | $this->currPos = $p10; |
| 4303 | $r13 = self::$FAILED; |
| 4304 | goto seq_4; |
| 4305 | } |
| 4306 | $r13 = true; |
| 4307 | seq_4: |
| 4308 | if ($r13!==self::$FAILED) { |
| 4309 | $r13 = false; |
| 4310 | $this->currPos = $p6; |
| 4311 | } else { |
| 4312 | $this->currPos = $p3; |
| 4313 | $r1 = self::$FAILED; |
| 4314 | goto seq_1; |
| 4315 | } |
| 4316 | // free $p10 |
| 4317 | // free $p6 |
| 4318 | $r1 = true; |
| 4319 | seq_1: |
| 4320 | if ($r1!==self::$FAILED) { |
| 4321 | $this->savedPos = $p2; |
| 4322 | $r1 = $this->a46($r4, $r5, $r9); |
| 4323 | } |
| 4324 | // free $p3 |
| 4325 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4326 | $this->currPos, |
| 4327 | $r1, |
| 4328 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4329 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4330 | ); |
| 4331 | return $r1; |
| 4332 | } |
| 4333 | private function parseli($silence, $boolParams, &$param_preproc, &$param_th) { |
| 4334 | $key = json_encode([448, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 4335 | $bucket = $this->currPos; |
| 4336 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4337 | if ($cached) { |
| 4338 | $this->currPos = $cached->nextPos; |
| 4339 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4340 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4341 | return $cached->result; |
| 4342 | } |
| 4343 | $saved_preproc=$param_preproc; |
| 4344 | $saved_th=$param_th; |
| 4345 | $p2 = $this->currPos; |
| 4346 | // start seq_1 |
| 4347 | $p3 = $this->currPos; |
| 4348 | $r4 = []; |
| 4349 | for (;;) { |
| 4350 | $r5 = $this->parselist_char($silence); |
| 4351 | if ($r5!==self::$FAILED) { |
| 4352 | $r4[] = $r5; |
| 4353 | } else { |
| 4354 | break; |
| 4355 | } |
| 4356 | } |
| 4357 | if (count($r4) === 0) { |
| 4358 | $r4 = self::$FAILED; |
| 4359 | } |
| 4360 | // bullets <- $r4 |
| 4361 | if ($r4===self::$FAILED) { |
| 4362 | $r1 = self::$FAILED; |
| 4363 | goto seq_1; |
| 4364 | } |
| 4365 | // free $r5 |
| 4366 | $r5 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
| 4367 | if ($r5===self::$FAILED) { |
| 4368 | $r5 = null; |
| 4369 | } |
| 4370 | // c <- $r5 |
| 4371 | $p6 = $this->currPos; |
| 4372 | // start choice_1 |
| 4373 | $r7 = $this->discardeolf(true); |
| 4374 | if ($r7!==self::$FAILED) { |
| 4375 | goto choice_1; |
| 4376 | } |
| 4377 | $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 4378 | choice_1: |
| 4379 | if ($r7!==self::$FAILED) { |
| 4380 | $r7 = false; |
| 4381 | $this->currPos = $p6; |
| 4382 | } else { |
| 4383 | $this->currPos = $p3; |
| 4384 | $r1 = self::$FAILED; |
| 4385 | goto seq_1; |
| 4386 | } |
| 4387 | // free $p6 |
| 4388 | $r1 = true; |
| 4389 | seq_1: |
| 4390 | if ($r1!==self::$FAILED) { |
| 4391 | $this->savedPos = $p2; |
| 4392 | $r1 = $this->a47($r4, $r5); |
| 4393 | } |
| 4394 | // free $p3 |
| 4395 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4396 | $this->currPos, |
| 4397 | $r1, |
| 4398 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4399 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4400 | ); |
| 4401 | return $r1; |
| 4402 | } |
| 4403 | private function discardeof($silence) { |
| 4404 | $key = 533; |
| 4405 | $bucket = $this->currPos; |
| 4406 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4407 | if ($cached) { |
| 4408 | $this->currPos = $cached->nextPos; |
| 4409 | |
| 4410 | return $cached->result; |
| 4411 | } |
| 4412 | |
| 4413 | $this->savedPos = $this->currPos; |
| 4414 | $r1 = $this->a48(); |
| 4415 | if ($r1) { |
| 4416 | $r1 = false; |
| 4417 | } else { |
| 4418 | $r1 = self::$FAILED; |
| 4419 | } |
| 4420 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4421 | $this->currPos, |
| 4422 | $r1, |
| 4423 | self::$UNDEFINED, |
| 4424 | self::$UNDEFINED |
| 4425 | ); |
| 4426 | return $r1; |
| 4427 | } |
| 4428 | private function parseblock($silence, $boolParams, &$param_th, &$param_preproc) { |
| 4429 | $key = json_encode([296, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 4430 | $bucket = $this->currPos; |
| 4431 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4432 | if ($cached) { |
| 4433 | $this->currPos = $cached->nextPos; |
| 4434 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4435 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4436 | return $cached->result; |
| 4437 | } |
| 4438 | $saved_th=$param_th; |
| 4439 | $saved_preproc=$param_preproc; |
| 4440 | // start choice_1 |
| 4441 | $p2 = $this->currPos; |
| 4442 | // start seq_1 |
| 4443 | $p3 = $this->currPos; |
| 4444 | $p4 = $this->currPos; |
| 4445 | $r5 = $this->discardsof(true); |
| 4446 | if ($r5!==self::$FAILED) { |
| 4447 | $r5 = false; |
| 4448 | $this->currPos = $p4; |
| 4449 | } else { |
| 4450 | $r1 = self::$FAILED; |
| 4451 | goto seq_1; |
| 4452 | } |
| 4453 | // free $p4 |
| 4454 | $r6 = $this->parseredirect($silence, $boolParams, $param_th, $param_preproc); |
| 4455 | // r <- $r6 |
| 4456 | if ($r6===self::$FAILED) { |
| 4457 | $this->currPos = $p3; |
| 4458 | $r1 = self::$FAILED; |
| 4459 | goto seq_1; |
| 4460 | } |
| 4461 | $r7 = []; |
| 4462 | for (;;) { |
| 4463 | $r8 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
| 4464 | if ($r8!==self::$FAILED) { |
| 4465 | $r7[] = $r8; |
| 4466 | } else { |
| 4467 | break; |
| 4468 | } |
| 4469 | } |
| 4470 | // cil <- $r7 |
| 4471 | // free $r8 |
| 4472 | $r8 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
| 4473 | if ($r8===self::$FAILED) { |
| 4474 | $r8 = null; |
| 4475 | } |
| 4476 | // bl <- $r8 |
| 4477 | $r1 = true; |
| 4478 | seq_1: |
| 4479 | if ($r1!==self::$FAILED) { |
| 4480 | $this->savedPos = $p2; |
| 4481 | $r1 = $this->a49($r6, $r7, $r8); |
| 4482 | goto choice_1; |
| 4483 | } |
| 4484 | // free $p3 |
| 4485 | $r1 = $this->parseblock_lines($silence, $boolParams, $param_preproc, $param_th); |
| 4486 | if ($r1!==self::$FAILED) { |
| 4487 | goto choice_1; |
| 4488 | } |
| 4489 | $r1 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
| 4490 | if ($r1!==self::$FAILED) { |
| 4491 | goto choice_1; |
| 4492 | } |
| 4493 | $p3 = $this->currPos; |
| 4494 | // start seq_2 |
| 4495 | $p4 = $this->currPos; |
| 4496 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
| 4497 | // s <- $r9 |
| 4498 | if ($r9===self::$FAILED) { |
| 4499 | $r1 = self::$FAILED; |
| 4500 | goto seq_2; |
| 4501 | } |
| 4502 | $p10 = $this->currPos; |
| 4503 | $r11 = $this->discardsof(true); |
| 4504 | if ($r11 === self::$FAILED) { |
| 4505 | $r11 = false; |
| 4506 | } else { |
| 4507 | $r11 = self::$FAILED; |
| 4508 | $this->currPos = $p10; |
| 4509 | $this->currPos = $p4; |
| 4510 | $r1 = self::$FAILED; |
| 4511 | goto seq_2; |
| 4512 | } |
| 4513 | // free $p10 |
| 4514 | $p10 = $this->currPos; |
| 4515 | $r12 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 4516 | if ($r12 === self::$FAILED) { |
| 4517 | $r12 = false; |
| 4518 | } else { |
| 4519 | $r12 = self::$FAILED; |
| 4520 | $this->currPos = $p10; |
| 4521 | $this->currPos = $p4; |
| 4522 | $r1 = self::$FAILED; |
| 4523 | goto seq_2; |
| 4524 | } |
| 4525 | // free $p10 |
| 4526 | $r1 = true; |
| 4527 | seq_2: |
| 4528 | if ($r1!==self::$FAILED) { |
| 4529 | $this->savedPos = $p3; |
| 4530 | $r1 = $this->a42($r9); |
| 4531 | } |
| 4532 | // free $p4 |
| 4533 | choice_1: |
| 4534 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4535 | $this->currPos, |
| 4536 | $r1, |
| 4537 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4538 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4539 | ); |
| 4540 | return $r1; |
| 4541 | } |
| 4542 | private function discardnewline($silence) { |
| 4543 | $key = 535; |
| 4544 | $bucket = $this->currPos; |
| 4545 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4546 | if ($cached) { |
| 4547 | $this->currPos = $cached->nextPos; |
| 4548 | |
| 4549 | return $cached->result; |
| 4550 | } |
| 4551 | |
| 4552 | // start choice_1 |
| 4553 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
| 4554 | $this->currPos++; |
| 4555 | $r1 = "\x0a"; |
| 4556 | goto choice_1; |
| 4557 | } else { |
| 4558 | if (!$silence) {$this->fail(27);} |
| 4559 | $r1 = self::$FAILED; |
| 4560 | } |
| 4561 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) { |
| 4562 | $r1 = "\x0d\x0a"; |
| 4563 | $this->currPos += 2; |
| 4564 | } else { |
| 4565 | if (!$silence) {$this->fail(28);} |
| 4566 | $r1 = self::$FAILED; |
| 4567 | } |
| 4568 | choice_1: |
| 4569 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4570 | $this->currPos, |
| 4571 | $r1, |
| 4572 | self::$UNDEFINED, |
| 4573 | self::$UNDEFINED |
| 4574 | ); |
| 4575 | return $r1; |
| 4576 | } |
| 4577 | private function parsetplarg_or_template_guarded($silence, $boolParams, &$param_th, &$param_preproc) { |
| 4578 | $key = json_encode([348, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 4579 | $bucket = $this->currPos; |
| 4580 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4581 | if ($cached) { |
| 4582 | $this->currPos = $cached->nextPos; |
| 4583 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4584 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4585 | return $cached->result; |
| 4586 | } |
| 4587 | $saved_th=$param_th; |
| 4588 | $saved_preproc=$param_preproc; |
| 4589 | // start choice_1 |
| 4590 | $p2 = $this->currPos; |
| 4591 | // start seq_1 |
| 4592 | $p3 = $this->currPos; |
| 4593 | $p4 = $this->currPos; |
| 4594 | // start seq_2 |
| 4595 | $p6 = $this->currPos; |
| 4596 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 4597 | $r7 = "{{"; |
| 4598 | $this->currPos += 2; |
| 4599 | } else { |
| 4600 | $r7 = self::$FAILED; |
| 4601 | $r5 = self::$FAILED; |
| 4602 | goto seq_2; |
| 4603 | } |
| 4604 | $p8 = $this->currPos; |
| 4605 | // start seq_3 |
| 4606 | $p10 = $this->currPos; |
| 4607 | $r11 = self::$FAILED; |
| 4608 | for (;;) { |
| 4609 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 4610 | $r12 = "{{{"; |
| 4611 | $this->currPos += 3; |
| 4612 | $r11 = true; |
| 4613 | } else { |
| 4614 | $r12 = self::$FAILED; |
| 4615 | break; |
| 4616 | } |
| 4617 | } |
| 4618 | if ($r11===self::$FAILED) { |
| 4619 | $r9 = self::$FAILED; |
| 4620 | goto seq_3; |
| 4621 | } |
| 4622 | // free $r12 |
| 4623 | $p13 = $this->currPos; |
| 4624 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 4625 | $this->currPos++; |
| 4626 | $r12 = "{"; |
| 4627 | } else { |
| 4628 | $r12 = self::$FAILED; |
| 4629 | } |
| 4630 | if ($r12 === self::$FAILED) { |
| 4631 | $r12 = false; |
| 4632 | } else { |
| 4633 | $r12 = self::$FAILED; |
| 4634 | $this->currPos = $p13; |
| 4635 | $this->currPos = $p10; |
| 4636 | $r9 = self::$FAILED; |
| 4637 | goto seq_3; |
| 4638 | } |
| 4639 | // free $p13 |
| 4640 | $r9 = true; |
| 4641 | seq_3: |
| 4642 | if ($r9!==self::$FAILED) { |
| 4643 | $r9 = false; |
| 4644 | $this->currPos = $p8; |
| 4645 | } else { |
| 4646 | $this->currPos = $p6; |
| 4647 | $r5 = self::$FAILED; |
| 4648 | goto seq_2; |
| 4649 | } |
| 4650 | // free $p10 |
| 4651 | // free $p8 |
| 4652 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
| 4653 | if ($r14===self::$FAILED) { |
| 4654 | $this->currPos = $p6; |
| 4655 | $r5 = self::$FAILED; |
| 4656 | goto seq_2; |
| 4657 | } |
| 4658 | $r5 = true; |
| 4659 | seq_2: |
| 4660 | if ($r5!==self::$FAILED) { |
| 4661 | $r5 = false; |
| 4662 | $this->currPos = $p4; |
| 4663 | } else { |
| 4664 | $r1 = self::$FAILED; |
| 4665 | goto seq_1; |
| 4666 | } |
| 4667 | // free $p6 |
| 4668 | // free $p4 |
| 4669 | // start choice_2 |
| 4670 | $r15 = $this->parsetemplate($silence, $boolParams, $param_th); |
| 4671 | if ($r15!==self::$FAILED) { |
| 4672 | goto choice_2; |
| 4673 | } |
| 4674 | $r15 = $this->parsebroken_template($silence, $param_preproc); |
| 4675 | choice_2: |
| 4676 | // a <- $r15 |
| 4677 | if ($r15===self::$FAILED) { |
| 4678 | $this->currPos = $p3; |
| 4679 | $r1 = self::$FAILED; |
| 4680 | goto seq_1; |
| 4681 | } |
| 4682 | $r1 = true; |
| 4683 | seq_1: |
| 4684 | if ($r1!==self::$FAILED) { |
| 4685 | $this->savedPos = $p2; |
| 4686 | $r1 = $this->a50($r15); |
| 4687 | goto choice_1; |
| 4688 | } |
| 4689 | // free $p3 |
| 4690 | $p3 = $this->currPos; |
| 4691 | // start seq_4 |
| 4692 | $p4 = $this->currPos; |
| 4693 | $p6 = $this->currPos; |
| 4694 | // start seq_5 |
| 4695 | $p8 = $this->currPos; |
| 4696 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 4697 | $this->currPos++; |
| 4698 | $r17 = "{"; |
| 4699 | } else { |
| 4700 | if (!$silence) {$this->fail(29);} |
| 4701 | $r17 = self::$FAILED; |
| 4702 | $r16 = self::$FAILED; |
| 4703 | goto seq_5; |
| 4704 | } |
| 4705 | $p10 = $this->currPos; |
| 4706 | // start seq_6 |
| 4707 | $p13 = $this->currPos; |
| 4708 | $r19 = self::$FAILED; |
| 4709 | for (;;) { |
| 4710 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 4711 | $r20 = "{{{"; |
| 4712 | $this->currPos += 3; |
| 4713 | $r19 = true; |
| 4714 | } else { |
| 4715 | $r20 = self::$FAILED; |
| 4716 | break; |
| 4717 | } |
| 4718 | } |
| 4719 | if ($r19===self::$FAILED) { |
| 4720 | $r18 = self::$FAILED; |
| 4721 | goto seq_6; |
| 4722 | } |
| 4723 | // free $r20 |
| 4724 | $p21 = $this->currPos; |
| 4725 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 4726 | $this->currPos++; |
| 4727 | $r20 = "{"; |
| 4728 | } else { |
| 4729 | $r20 = self::$FAILED; |
| 4730 | } |
| 4731 | if ($r20 === self::$FAILED) { |
| 4732 | $r20 = false; |
| 4733 | } else { |
| 4734 | $r20 = self::$FAILED; |
| 4735 | $this->currPos = $p21; |
| 4736 | $this->currPos = $p13; |
| 4737 | $r18 = self::$FAILED; |
| 4738 | goto seq_6; |
| 4739 | } |
| 4740 | // free $p21 |
| 4741 | $r18 = true; |
| 4742 | seq_6: |
| 4743 | if ($r18!==self::$FAILED) { |
| 4744 | $r18 = false; |
| 4745 | $this->currPos = $p10; |
| 4746 | } else { |
| 4747 | $this->currPos = $p8; |
| 4748 | $r16 = self::$FAILED; |
| 4749 | goto seq_5; |
| 4750 | } |
| 4751 | // free $p13 |
| 4752 | // free $p10 |
| 4753 | $r16 = true; |
| 4754 | seq_5: |
| 4755 | if ($r16===self::$FAILED) { |
| 4756 | $r16 = null; |
| 4757 | } |
| 4758 | // free $p8 |
| 4759 | // a <- $r16 |
| 4760 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
| 4761 | // free $p6 |
| 4762 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
| 4763 | // b <- $r22 |
| 4764 | if ($r22===self::$FAILED) { |
| 4765 | $this->currPos = $p4; |
| 4766 | $r1 = self::$FAILED; |
| 4767 | goto seq_4; |
| 4768 | } |
| 4769 | $r1 = true; |
| 4770 | seq_4: |
| 4771 | if ($r1!==self::$FAILED) { |
| 4772 | $this->savedPos = $p3; |
| 4773 | $r1 = $this->a51($r16, $r22); |
| 4774 | goto choice_1; |
| 4775 | } |
| 4776 | // free $p4 |
| 4777 | $p4 = $this->currPos; |
| 4778 | // start seq_7 |
| 4779 | $p6 = $this->currPos; |
| 4780 | $p8 = $this->currPos; |
| 4781 | // start seq_8 |
| 4782 | $p10 = $this->currPos; |
| 4783 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 4784 | $this->currPos++; |
| 4785 | $r24 = "{"; |
| 4786 | } else { |
| 4787 | if (!$silence) {$this->fail(29);} |
| 4788 | $r24 = self::$FAILED; |
| 4789 | $r23 = self::$FAILED; |
| 4790 | goto seq_8; |
| 4791 | } |
| 4792 | $p13 = $this->currPos; |
| 4793 | // start seq_9 |
| 4794 | $p21 = $this->currPos; |
| 4795 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 4796 | $r26 = "{{"; |
| 4797 | $this->currPos += 2; |
| 4798 | } else { |
| 4799 | $r26 = self::$FAILED; |
| 4800 | $r25 = self::$FAILED; |
| 4801 | goto seq_9; |
| 4802 | } |
| 4803 | $p27 = $this->currPos; |
| 4804 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 4805 | $this->currPos++; |
| 4806 | $r28 = "{"; |
| 4807 | } else { |
| 4808 | $r28 = self::$FAILED; |
| 4809 | } |
| 4810 | if ($r28 === self::$FAILED) { |
| 4811 | $r28 = false; |
| 4812 | } else { |
| 4813 | $r28 = self::$FAILED; |
| 4814 | $this->currPos = $p27; |
| 4815 | $this->currPos = $p21; |
| 4816 | $r25 = self::$FAILED; |
| 4817 | goto seq_9; |
| 4818 | } |
| 4819 | // free $p27 |
| 4820 | $r25 = true; |
| 4821 | seq_9: |
| 4822 | if ($r25!==self::$FAILED) { |
| 4823 | $r25 = false; |
| 4824 | $this->currPos = $p13; |
| 4825 | } else { |
| 4826 | $this->currPos = $p10; |
| 4827 | $r23 = self::$FAILED; |
| 4828 | goto seq_8; |
| 4829 | } |
| 4830 | // free $p21 |
| 4831 | // free $p13 |
| 4832 | $r23 = true; |
| 4833 | seq_8: |
| 4834 | if ($r23===self::$FAILED) { |
| 4835 | $r23 = null; |
| 4836 | } |
| 4837 | // free $p10 |
| 4838 | // a <- $r23 |
| 4839 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
| 4840 | // free $p8 |
| 4841 | $r29 = $this->parsetemplate($silence, $boolParams, $param_th); |
| 4842 | // b <- $r29 |
| 4843 | if ($r29===self::$FAILED) { |
| 4844 | $this->currPos = $p6; |
| 4845 | $r1 = self::$FAILED; |
| 4846 | goto seq_7; |
| 4847 | } |
| 4848 | $r1 = true; |
| 4849 | seq_7: |
| 4850 | if ($r1!==self::$FAILED) { |
| 4851 | $this->savedPos = $p4; |
| 4852 | $r1 = $this->a51($r23, $r29); |
| 4853 | goto choice_1; |
| 4854 | } |
| 4855 | // free $p6 |
| 4856 | $r1 = $this->parsebroken_template($silence, $param_preproc); |
| 4857 | choice_1: |
| 4858 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4859 | $this->currPos, |
| 4860 | $r1, |
| 4861 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 4862 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 4863 | ); |
| 4864 | return $r1; |
| 4865 | } |
| 4866 | private function parseraw_htmlentity($silence) { |
| 4867 | $key = 496; |
| 4868 | $bucket = $this->currPos; |
| 4869 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4870 | if ($cached) { |
| 4871 | $this->currPos = $cached->nextPos; |
| 4872 | |
| 4873 | return $cached->result; |
| 4874 | } |
| 4875 | |
| 4876 | $p2 = $this->currPos; |
| 4877 | $p4 = $this->currPos; |
| 4878 | // start seq_1 |
| 4879 | $p5 = $this->currPos; |
| 4880 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 4881 | $this->currPos++; |
| 4882 | $r6 = "&"; |
| 4883 | } else { |
| 4884 | if (!$silence) {$this->fail(4);} |
| 4885 | $r6 = self::$FAILED; |
| 4886 | $r3 = self::$FAILED; |
| 4887 | goto seq_1; |
| 4888 | } |
| 4889 | $r7 = self::$FAILED; |
| 4890 | for (;;) { |
| 4891 | $r8 = self::charAt($this->input, $this->currPos); |
| 4892 | if (preg_match("/^[#0-9a-zA-Z\\x{5e8}\\x{5dc}\\x{5de}\\x{631}\\x{644}\\x{645}]/u", $r8)) { |
| 4893 | $this->currPos += strlen($r8); |
| 4894 | $r7 = true; |
| 4895 | } else { |
| 4896 | $r8 = self::$FAILED; |
| 4897 | if (!$silence) {$this->fail(30);} |
| 4898 | break; |
| 4899 | } |
| 4900 | } |
| 4901 | if ($r7===self::$FAILED) { |
| 4902 | $this->currPos = $p5; |
| 4903 | $r3 = self::$FAILED; |
| 4904 | goto seq_1; |
| 4905 | } |
| 4906 | // free $r8 |
| 4907 | if (($this->input[$this->currPos] ?? null) === ";") { |
| 4908 | $this->currPos++; |
| 4909 | $r8 = ";"; |
| 4910 | } else { |
| 4911 | if (!$silence) {$this->fail(26);} |
| 4912 | $r8 = self::$FAILED; |
| 4913 | $this->currPos = $p5; |
| 4914 | $r3 = self::$FAILED; |
| 4915 | goto seq_1; |
| 4916 | } |
| 4917 | $r3 = true; |
| 4918 | seq_1: |
| 4919 | // m <- $r3 |
| 4920 | if ($r3!==self::$FAILED) { |
| 4921 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
| 4922 | } else { |
| 4923 | $r3 = self::$FAILED; |
| 4924 | } |
| 4925 | // free $p5 |
| 4926 | // free $p4 |
| 4927 | $r1 = $r3; |
| 4928 | if ($r1!==self::$FAILED) { |
| 4929 | $this->savedPos = $p2; |
| 4930 | $r1 = $this->a52($r3); |
| 4931 | } |
| 4932 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4933 | $this->currPos, |
| 4934 | $r1, |
| 4935 | self::$UNDEFINED, |
| 4936 | self::$UNDEFINED |
| 4937 | ); |
| 4938 | return $r1; |
| 4939 | } |
| 4940 | private function parseoptionalSpaceToken($silence) { |
| 4941 | $key = 544; |
| 4942 | $bucket = $this->currPos; |
| 4943 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4944 | if ($cached) { |
| 4945 | $this->currPos = $cached->nextPos; |
| 4946 | |
| 4947 | return $cached->result; |
| 4948 | } |
| 4949 | |
| 4950 | $p2 = $this->currPos; |
| 4951 | $r3 = $this->parseoptional_spaces($silence); |
| 4952 | // s <- $r3 |
| 4953 | $r1 = $r3; |
| 4954 | if ($r1!==self::$FAILED) { |
| 4955 | $this->savedPos = $p2; |
| 4956 | $r1 = $this->a37($r3); |
| 4957 | } |
| 4958 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 4959 | $this->currPos, |
| 4960 | $r1, |
| 4961 | self::$UNDEFINED, |
| 4962 | self::$UNDEFINED |
| 4963 | ); |
| 4964 | return $r1; |
| 4965 | } |
| 4966 | private function parsetable_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
| 4967 | $key = json_encode([440, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 4968 | $bucket = $this->currPos; |
| 4969 | $cached = $this->cache[$bucket][$key] ?? null; |
| 4970 | if ($cached) { |
| 4971 | $this->currPos = $cached->nextPos; |
| 4972 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 4973 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 4974 | return $cached->result; |
| 4975 | } |
| 4976 | $saved_preproc=$param_preproc; |
| 4977 | $saved_th=$param_th; |
| 4978 | $p2 = $this->currPos; |
| 4979 | // start seq_1 |
| 4980 | $p3 = $this->currPos; |
| 4981 | $p5 = $this->currPos; |
| 4982 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
| 4983 | $r4 = $this->input[$this->currPos++]; |
| 4984 | } else { |
| 4985 | $r4 = self::$FAILED; |
| 4986 | if (!$silence) {$this->fail(31);} |
| 4987 | $r4 = null; |
| 4988 | } |
| 4989 | // q <- $r4 |
| 4990 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 4991 | // free $p5 |
| 4992 | $r6 = []; |
| 4993 | for (;;) { |
| 4994 | // start choice_1 |
| 4995 | $p5 = $this->currPos; |
| 4996 | $r7 = self::$FAILED; |
| 4997 | for (;;) { |
| 4998 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|[", $this->currPos, 1) !== 0) { |
| 4999 | $r8 = self::consumeChar($this->input, $this->currPos); |
| 5000 | $r7 = true; |
| 5001 | } else { |
| 5002 | $r8 = self::$FAILED; |
| 5003 | if (!$silence) {$this->fail(32);} |
| 5004 | break; |
| 5005 | } |
| 5006 | } |
| 5007 | if ($r7!==self::$FAILED) { |
| 5008 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
| 5009 | goto choice_1; |
| 5010 | } else { |
| 5011 | $r7 = self::$FAILED; |
| 5012 | } |
| 5013 | // free $r8 |
| 5014 | // free $p5 |
| 5015 | $p5 = $this->currPos; |
| 5016 | // start seq_2 |
| 5017 | $p9 = $this->currPos; |
| 5018 | $p10 = $this->currPos; |
| 5019 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 5020 | if ($r8 === self::$FAILED) { |
| 5021 | $r8 = false; |
| 5022 | } else { |
| 5023 | $r8 = self::$FAILED; |
| 5024 | $this->currPos = $p10; |
| 5025 | $r7 = self::$FAILED; |
| 5026 | goto seq_2; |
| 5027 | } |
| 5028 | // free $p10 |
| 5029 | // start choice_2 |
| 5030 | $p10 = $this->currPos; |
| 5031 | $r11 = $this->discardwikilink($silence, $boolParams, $param_th, $param_preproc); |
| 5032 | if ($r11!==self::$FAILED) { |
| 5033 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
| 5034 | goto choice_2; |
| 5035 | } else { |
| 5036 | $r11 = self::$FAILED; |
| 5037 | } |
| 5038 | // free $p10 |
| 5039 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 5040 | if ($r11!==self::$FAILED) { |
| 5041 | goto choice_2; |
| 5042 | } |
| 5043 | $p10 = $this->currPos; |
| 5044 | // start seq_3 |
| 5045 | $p12 = $this->currPos; |
| 5046 | $r13 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th); |
| 5047 | // x <- $r13 |
| 5048 | if ($r13===self::$FAILED) { |
| 5049 | $r11 = self::$FAILED; |
| 5050 | goto seq_3; |
| 5051 | } |
| 5052 | $r14 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th); |
| 5053 | if ($r14===self::$FAILED) { |
| 5054 | $r14 = null; |
| 5055 | } |
| 5056 | // ill <- $r14 |
| 5057 | $r11 = true; |
| 5058 | seq_3: |
| 5059 | if ($r11!==self::$FAILED) { |
| 5060 | $this->savedPos = $p10; |
| 5061 | $r11 = $this->a53($r4, $r13, $r14); |
| 5062 | goto choice_2; |
| 5063 | } |
| 5064 | // free $p12 |
| 5065 | $p12 = $this->currPos; |
| 5066 | // start seq_4 |
| 5067 | $p15 = $this->currPos; |
| 5068 | $p16 = $this->currPos; |
| 5069 | // start choice_3 |
| 5070 | $r17 = $this->discardspace_or_newline(true); |
| 5071 | if ($r17!==self::$FAILED) { |
| 5072 | goto choice_3; |
| 5073 | } |
| 5074 | if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) { |
| 5075 | $r17 = $this->input[$this->currPos++]; |
| 5076 | } else { |
| 5077 | $r17 = self::$FAILED; |
| 5078 | } |
| 5079 | choice_3: |
| 5080 | if ($r17 === self::$FAILED) { |
| 5081 | $r17 = false; |
| 5082 | } else { |
| 5083 | $r17 = self::$FAILED; |
| 5084 | $this->currPos = $p16; |
| 5085 | $r11 = self::$FAILED; |
| 5086 | goto seq_4; |
| 5087 | } |
| 5088 | // free $p16 |
| 5089 | if ($this->currPos < $this->inputLength) { |
| 5090 | $r18 = self::consumeChar($this->input, $this->currPos);; |
| 5091 | } else { |
| 5092 | $r18 = self::$FAILED; |
| 5093 | if (!$silence) {$this->fail(7);} |
| 5094 | $this->currPos = $p15; |
| 5095 | $r11 = self::$FAILED; |
| 5096 | goto seq_4; |
| 5097 | } |
| 5098 | $r11 = true; |
| 5099 | seq_4: |
| 5100 | if ($r11!==self::$FAILED) { |
| 5101 | $r11 = substr($this->input, $p12, $this->currPos - $p12); |
| 5102 | } else { |
| 5103 | $r11 = self::$FAILED; |
| 5104 | } |
| 5105 | // free $p15 |
| 5106 | // free $p12 |
| 5107 | choice_2: |
| 5108 | // t <- $r11 |
| 5109 | if ($r11===self::$FAILED) { |
| 5110 | $this->currPos = $p9; |
| 5111 | $r7 = self::$FAILED; |
| 5112 | goto seq_2; |
| 5113 | } |
| 5114 | $r7 = true; |
| 5115 | seq_2: |
| 5116 | if ($r7!==self::$FAILED) { |
| 5117 | $this->savedPos = $p5; |
| 5118 | $r7 = $this->a54($r4, $r11); |
| 5119 | } |
| 5120 | // free $p9 |
| 5121 | choice_1: |
| 5122 | if ($r7!==self::$FAILED) { |
| 5123 | $r6[] = $r7; |
| 5124 | } else { |
| 5125 | break; |
| 5126 | } |
| 5127 | } |
| 5128 | // r <- $r6 |
| 5129 | // free $r7 |
| 5130 | $this->savedPos = $this->currPos; |
| 5131 | $r7 = $this->a55($r4, $r6); |
| 5132 | if ($r7) { |
| 5133 | $r7 = false; |
| 5134 | } else { |
| 5135 | $r7 = self::$FAILED; |
| 5136 | $this->currPos = $p3; |
| 5137 | $r1 = self::$FAILED; |
| 5138 | goto seq_1; |
| 5139 | } |
| 5140 | $r1 = true; |
| 5141 | seq_1: |
| 5142 | if ($r1!==self::$FAILED) { |
| 5143 | $this->savedPos = $p2; |
| 5144 | $r1 = $this->a56($r4, $r6); |
| 5145 | } |
| 5146 | // free $p3 |
| 5147 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5148 | $this->currPos, |
| 5149 | $r1, |
| 5150 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 5151 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 5152 | ); |
| 5153 | return $r1; |
| 5154 | } |
| 5155 | private function parsetable_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
| 5156 | $key = json_encode([444, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 5157 | $bucket = $this->currPos; |
| 5158 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5159 | if ($cached) { |
| 5160 | $this->currPos = $cached->nextPos; |
| 5161 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 5162 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 5163 | return $cached->result; |
| 5164 | } |
| 5165 | $saved_preproc=$param_preproc; |
| 5166 | $saved_th=$param_th; |
| 5167 | // start choice_1 |
| 5168 | $p2 = $this->currPos; |
| 5169 | // start seq_1 |
| 5170 | $p3 = $this->currPos; |
| 5171 | $p5 = $this->currPos; |
| 5172 | // start seq_2 |
| 5173 | $p6 = $this->currPos; |
| 5174 | for (;;) { |
| 5175 | $r8 = $this->discardspace($silence); |
| 5176 | if ($r8===self::$FAILED) { |
| 5177 | break; |
| 5178 | } |
| 5179 | } |
| 5180 | // free $r8 |
| 5181 | $r7 = true; |
| 5182 | if ($r7===self::$FAILED) { |
| 5183 | $r4 = self::$FAILED; |
| 5184 | goto seq_2; |
| 5185 | } |
| 5186 | // free $r7 |
| 5187 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 5188 | $this->currPos++; |
| 5189 | $r7 = "'"; |
| 5190 | } else { |
| 5191 | if (!$silence) {$this->fail(33);} |
| 5192 | $r7 = self::$FAILED; |
| 5193 | $this->currPos = $p6; |
| 5194 | $r4 = self::$FAILED; |
| 5195 | goto seq_2; |
| 5196 | } |
| 5197 | $r4 = true; |
| 5198 | seq_2: |
| 5199 | // s <- $r4 |
| 5200 | if ($r4!==self::$FAILED) { |
| 5201 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 5202 | } else { |
| 5203 | $r4 = self::$FAILED; |
| 5204 | $r1 = self::$FAILED; |
| 5205 | goto seq_1; |
| 5206 | } |
| 5207 | // free $p6 |
| 5208 | // free $p5 |
| 5209 | $r8 = $this->parsetable_attribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
| 5210 | if ($r8===self::$FAILED) { |
| 5211 | $r8 = null; |
| 5212 | } |
| 5213 | // t <- $r8 |
| 5214 | $p5 = $this->currPos; |
| 5215 | // start choice_2 |
| 5216 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 5217 | $this->currPos++; |
| 5218 | $r9 = "'"; |
| 5219 | goto choice_2; |
| 5220 | } else { |
| 5221 | if (!$silence) {$this->fail(33);} |
| 5222 | $r9 = self::$FAILED; |
| 5223 | } |
| 5224 | $p6 = $this->currPos; |
| 5225 | // start choice_3 |
| 5226 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 5227 | $r9 = "!!"; |
| 5228 | $this->currPos += 2; |
| 5229 | goto choice_3; |
| 5230 | } else { |
| 5231 | $r9 = self::$FAILED; |
| 5232 | } |
| 5233 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
| 5234 | $r9 = $this->input[$this->currPos++]; |
| 5235 | } else { |
| 5236 | $r9 = self::$FAILED; |
| 5237 | } |
| 5238 | choice_3: |
| 5239 | if ($r9!==self::$FAILED) { |
| 5240 | $r9 = false; |
| 5241 | $this->currPos = $p6; |
| 5242 | } |
| 5243 | // free $p6 |
| 5244 | choice_2: |
| 5245 | // q <- $r9 |
| 5246 | if ($r9!==self::$FAILED) { |
| 5247 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
| 5248 | } else { |
| 5249 | $r9 = self::$FAILED; |
| 5250 | $this->currPos = $p3; |
| 5251 | $r1 = self::$FAILED; |
| 5252 | goto seq_1; |
| 5253 | } |
| 5254 | // free $p5 |
| 5255 | $r1 = true; |
| 5256 | seq_1: |
| 5257 | if ($r1!==self::$FAILED) { |
| 5258 | $this->savedPos = $p2; |
| 5259 | $r1 = $this->a57($r4, $r8, $r9); |
| 5260 | goto choice_1; |
| 5261 | } |
| 5262 | // free $p3 |
| 5263 | $p3 = $this->currPos; |
| 5264 | // start seq_3 |
| 5265 | $p5 = $this->currPos; |
| 5266 | $p6 = $this->currPos; |
| 5267 | // start seq_4 |
| 5268 | $p11 = $this->currPos; |
| 5269 | for (;;) { |
| 5270 | $r13 = $this->discardspace($silence); |
| 5271 | if ($r13===self::$FAILED) { |
| 5272 | break; |
| 5273 | } |
| 5274 | } |
| 5275 | // free $r13 |
| 5276 | $r12 = true; |
| 5277 | if ($r12===self::$FAILED) { |
| 5278 | $r10 = self::$FAILED; |
| 5279 | goto seq_4; |
| 5280 | } |
| 5281 | // free $r12 |
| 5282 | if (($this->input[$this->currPos] ?? null) === "\"") { |
| 5283 | $this->currPos++; |
| 5284 | $r12 = "\""; |
| 5285 | } else { |
| 5286 | if (!$silence) {$this->fail(34);} |
| 5287 | $r12 = self::$FAILED; |
| 5288 | $this->currPos = $p11; |
| 5289 | $r10 = self::$FAILED; |
| 5290 | goto seq_4; |
| 5291 | } |
| 5292 | $r10 = true; |
| 5293 | seq_4: |
| 5294 | // s <- $r10 |
| 5295 | if ($r10!==self::$FAILED) { |
| 5296 | $r10 = substr($this->input, $p6, $this->currPos - $p6); |
| 5297 | } else { |
| 5298 | $r10 = self::$FAILED; |
| 5299 | $r1 = self::$FAILED; |
| 5300 | goto seq_3; |
| 5301 | } |
| 5302 | // free $p11 |
| 5303 | // free $p6 |
| 5304 | $r13 = $this->parsetable_attribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
| 5305 | if ($r13===self::$FAILED) { |
| 5306 | $r13 = null; |
| 5307 | } |
| 5308 | // t <- $r13 |
| 5309 | $p6 = $this->currPos; |
| 5310 | // start choice_4 |
| 5311 | if (($this->input[$this->currPos] ?? null) === "\"") { |
| 5312 | $this->currPos++; |
| 5313 | $r14 = "\""; |
| 5314 | goto choice_4; |
| 5315 | } else { |
| 5316 | if (!$silence) {$this->fail(34);} |
| 5317 | $r14 = self::$FAILED; |
| 5318 | } |
| 5319 | $p11 = $this->currPos; |
| 5320 | // start choice_5 |
| 5321 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 5322 | $r14 = "!!"; |
| 5323 | $this->currPos += 2; |
| 5324 | goto choice_5; |
| 5325 | } else { |
| 5326 | $r14 = self::$FAILED; |
| 5327 | } |
| 5328 | if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) { |
| 5329 | $r14 = $this->input[$this->currPos++]; |
| 5330 | } else { |
| 5331 | $r14 = self::$FAILED; |
| 5332 | } |
| 5333 | choice_5: |
| 5334 | if ($r14!==self::$FAILED) { |
| 5335 | $r14 = false; |
| 5336 | $this->currPos = $p11; |
| 5337 | } |
| 5338 | // free $p11 |
| 5339 | choice_4: |
| 5340 | // q <- $r14 |
| 5341 | if ($r14!==self::$FAILED) { |
| 5342 | $r14 = substr($this->input, $p6, $this->currPos - $p6); |
| 5343 | } else { |
| 5344 | $r14 = self::$FAILED; |
| 5345 | $this->currPos = $p5; |
| 5346 | $r1 = self::$FAILED; |
| 5347 | goto seq_3; |
| 5348 | } |
| 5349 | // free $p6 |
| 5350 | $r1 = true; |
| 5351 | seq_3: |
| 5352 | if ($r1!==self::$FAILED) { |
| 5353 | $this->savedPos = $p3; |
| 5354 | $r1 = $this->a57($r10, $r13, $r14); |
| 5355 | goto choice_1; |
| 5356 | } |
| 5357 | // free $p5 |
| 5358 | $p5 = $this->currPos; |
| 5359 | // start seq_5 |
| 5360 | $p6 = $this->currPos; |
| 5361 | $p11 = $this->currPos; |
| 5362 | for (;;) { |
| 5363 | $r16 = $this->discardspace($silence); |
| 5364 | if ($r16===self::$FAILED) { |
| 5365 | break; |
| 5366 | } |
| 5367 | } |
| 5368 | // free $r16 |
| 5369 | $r15 = true; |
| 5370 | // s <- $r15 |
| 5371 | if ($r15!==self::$FAILED) { |
| 5372 | $r15 = substr($this->input, $p11, $this->currPos - $p11); |
| 5373 | } else { |
| 5374 | $r15 = self::$FAILED; |
| 5375 | $r1 = self::$FAILED; |
| 5376 | goto seq_5; |
| 5377 | } |
| 5378 | // free $p11 |
| 5379 | $r16 = $this->parsetable_attribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
| 5380 | // t <- $r16 |
| 5381 | if ($r16===self::$FAILED) { |
| 5382 | $this->currPos = $p6; |
| 5383 | $r1 = self::$FAILED; |
| 5384 | goto seq_5; |
| 5385 | } |
| 5386 | $p11 = $this->currPos; |
| 5387 | // start choice_6 |
| 5388 | $r17 = $this->discardspace_or_newline(true); |
| 5389 | if ($r17!==self::$FAILED) { |
| 5390 | goto choice_6; |
| 5391 | } |
| 5392 | $r17 = $this->discardeof(true); |
| 5393 | if ($r17!==self::$FAILED) { |
| 5394 | goto choice_6; |
| 5395 | } |
| 5396 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 5397 | $r17 = "!!"; |
| 5398 | $this->currPos += 2; |
| 5399 | goto choice_6; |
| 5400 | } else { |
| 5401 | $r17 = self::$FAILED; |
| 5402 | } |
| 5403 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 5404 | $this->currPos++; |
| 5405 | $r17 = "|"; |
| 5406 | } else { |
| 5407 | $r17 = self::$FAILED; |
| 5408 | } |
| 5409 | choice_6: |
| 5410 | if ($r17!==self::$FAILED) { |
| 5411 | $r17 = false; |
| 5412 | $this->currPos = $p11; |
| 5413 | } else { |
| 5414 | $this->currPos = $p6; |
| 5415 | $r1 = self::$FAILED; |
| 5416 | goto seq_5; |
| 5417 | } |
| 5418 | // free $p11 |
| 5419 | $r1 = true; |
| 5420 | seq_5: |
| 5421 | if ($r1!==self::$FAILED) { |
| 5422 | $this->savedPos = $p5; |
| 5423 | $r1 = $this->a58($r15, $r16); |
| 5424 | } |
| 5425 | // free $p6 |
| 5426 | choice_1: |
| 5427 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5428 | $this->currPos, |
| 5429 | $r1, |
| 5430 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 5431 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 5432 | ); |
| 5433 | return $r1; |
| 5434 | } |
| 5435 | private function discardspace_or_newline_or_solidus($silence) { |
| 5436 | $key = 427; |
| 5437 | $bucket = $this->currPos; |
| 5438 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5439 | if ($cached) { |
| 5440 | $this->currPos = $cached->nextPos; |
| 5441 | |
| 5442 | return $cached->result; |
| 5443 | } |
| 5444 | |
| 5445 | // start choice_1 |
| 5446 | $r1 = $this->discardspace_or_newline($silence); |
| 5447 | if ($r1!==self::$FAILED) { |
| 5448 | goto choice_1; |
| 5449 | } |
| 5450 | $p2 = $this->currPos; |
| 5451 | // start seq_1 |
| 5452 | $p3 = $this->currPos; |
| 5453 | // s <- $r4 |
| 5454 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 5455 | $this->currPos++; |
| 5456 | $r4 = "/"; |
| 5457 | } else { |
| 5458 | if (!$silence) {$this->fail(35);} |
| 5459 | $r4 = self::$FAILED; |
| 5460 | $r1 = self::$FAILED; |
| 5461 | goto seq_1; |
| 5462 | } |
| 5463 | $p5 = $this->currPos; |
| 5464 | if (($this->input[$this->currPos] ?? null) === ">") { |
| 5465 | $this->currPos++; |
| 5466 | $r6 = ">"; |
| 5467 | } else { |
| 5468 | $r6 = self::$FAILED; |
| 5469 | } |
| 5470 | if ($r6 === self::$FAILED) { |
| 5471 | $r6 = false; |
| 5472 | } else { |
| 5473 | $r6 = self::$FAILED; |
| 5474 | $this->currPos = $p5; |
| 5475 | $this->currPos = $p3; |
| 5476 | $r1 = self::$FAILED; |
| 5477 | goto seq_1; |
| 5478 | } |
| 5479 | // free $p5 |
| 5480 | $r1 = true; |
| 5481 | seq_1: |
| 5482 | if ($r1!==self::$FAILED) { |
| 5483 | $this->savedPos = $p2; |
| 5484 | $r1 = $this->a42($r4); |
| 5485 | } |
| 5486 | // free $p3 |
| 5487 | choice_1: |
| 5488 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5489 | $this->currPos, |
| 5490 | $r1, |
| 5491 | self::$UNDEFINED, |
| 5492 | self::$UNDEFINED |
| 5493 | ); |
| 5494 | return $r1; |
| 5495 | } |
| 5496 | private function parsegeneric_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) { |
| 5497 | $key = json_encode([436, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 5498 | $bucket = $this->currPos; |
| 5499 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5500 | if ($cached) { |
| 5501 | $this->currPos = $cached->nextPos; |
| 5502 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 5503 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 5504 | return $cached->result; |
| 5505 | } |
| 5506 | $saved_preproc=$param_preproc; |
| 5507 | $saved_th=$param_th; |
| 5508 | $p2 = $this->currPos; |
| 5509 | // start seq_1 |
| 5510 | $p3 = $this->currPos; |
| 5511 | $p5 = $this->currPos; |
| 5512 | if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) { |
| 5513 | $r4 = $this->input[$this->currPos++]; |
| 5514 | } else { |
| 5515 | $r4 = self::$FAILED; |
| 5516 | if (!$silence) {$this->fail(31);} |
| 5517 | $r4 = null; |
| 5518 | } |
| 5519 | // q <- $r4 |
| 5520 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 5521 | // free $p5 |
| 5522 | $r6 = []; |
| 5523 | for (;;) { |
| 5524 | // start choice_1 |
| 5525 | $p5 = $this->currPos; |
| 5526 | $r7 = self::$FAILED; |
| 5527 | for (;;) { |
| 5528 | if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|", $this->currPos, 1) !== 0) { |
| 5529 | $r8 = self::consumeChar($this->input, $this->currPos); |
| 5530 | $r7 = true; |
| 5531 | } else { |
| 5532 | $r8 = self::$FAILED; |
| 5533 | if (!$silence) {$this->fail(36);} |
| 5534 | break; |
| 5535 | } |
| 5536 | } |
| 5537 | if ($r7!==self::$FAILED) { |
| 5538 | $r7 = substr($this->input, $p5, $this->currPos - $p5); |
| 5539 | goto choice_1; |
| 5540 | } else { |
| 5541 | $r7 = self::$FAILED; |
| 5542 | } |
| 5543 | // free $r8 |
| 5544 | // free $p5 |
| 5545 | $p5 = $this->currPos; |
| 5546 | // start seq_2 |
| 5547 | $p9 = $this->currPos; |
| 5548 | $p10 = $this->currPos; |
| 5549 | $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 5550 | if ($r8 === self::$FAILED) { |
| 5551 | $r8 = false; |
| 5552 | } else { |
| 5553 | $r8 = self::$FAILED; |
| 5554 | $this->currPos = $p10; |
| 5555 | $r7 = self::$FAILED; |
| 5556 | goto seq_2; |
| 5557 | } |
| 5558 | // free $p10 |
| 5559 | // start choice_2 |
| 5560 | $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 5561 | if ($r11!==self::$FAILED) { |
| 5562 | goto choice_2; |
| 5563 | } |
| 5564 | $r11 = $this->parseless_than($silence, $boolParams); |
| 5565 | if ($r11!==self::$FAILED) { |
| 5566 | goto choice_2; |
| 5567 | } |
| 5568 | $p10 = $this->currPos; |
| 5569 | // start seq_3 |
| 5570 | $p12 = $this->currPos; |
| 5571 | $p13 = $this->currPos; |
| 5572 | // start choice_3 |
| 5573 | $r14 = $this->discardspace_or_newline(true); |
| 5574 | if ($r14!==self::$FAILED) { |
| 5575 | goto choice_3; |
| 5576 | } |
| 5577 | if (strspn($this->input, "\x00/=><", $this->currPos, 1) !== 0) { |
| 5578 | $r14 = $this->input[$this->currPos++]; |
| 5579 | } else { |
| 5580 | $r14 = self::$FAILED; |
| 5581 | } |
| 5582 | choice_3: |
| 5583 | if ($r14 === self::$FAILED) { |
| 5584 | $r14 = false; |
| 5585 | } else { |
| 5586 | $r14 = self::$FAILED; |
| 5587 | $this->currPos = $p13; |
| 5588 | $r11 = self::$FAILED; |
| 5589 | goto seq_3; |
| 5590 | } |
| 5591 | // free $p13 |
| 5592 | if ($this->currPos < $this->inputLength) { |
| 5593 | $r15 = self::consumeChar($this->input, $this->currPos);; |
| 5594 | } else { |
| 5595 | $r15 = self::$FAILED; |
| 5596 | if (!$silence) {$this->fail(7);} |
| 5597 | $this->currPos = $p12; |
| 5598 | $r11 = self::$FAILED; |
| 5599 | goto seq_3; |
| 5600 | } |
| 5601 | $r11 = true; |
| 5602 | seq_3: |
| 5603 | if ($r11!==self::$FAILED) { |
| 5604 | $r11 = substr($this->input, $p10, $this->currPos - $p10); |
| 5605 | } else { |
| 5606 | $r11 = self::$FAILED; |
| 5607 | } |
| 5608 | // free $p12 |
| 5609 | // free $p10 |
| 5610 | choice_2: |
| 5611 | // t <- $r11 |
| 5612 | if ($r11===self::$FAILED) { |
| 5613 | $this->currPos = $p9; |
| 5614 | $r7 = self::$FAILED; |
| 5615 | goto seq_2; |
| 5616 | } |
| 5617 | $r7 = true; |
| 5618 | seq_2: |
| 5619 | if ($r7!==self::$FAILED) { |
| 5620 | $this->savedPos = $p5; |
| 5621 | $r7 = $this->a54($r4, $r11); |
| 5622 | } |
| 5623 | // free $p9 |
| 5624 | choice_1: |
| 5625 | if ($r7!==self::$FAILED) { |
| 5626 | $r6[] = $r7; |
| 5627 | } else { |
| 5628 | break; |
| 5629 | } |
| 5630 | } |
| 5631 | // r <- $r6 |
| 5632 | // free $r7 |
| 5633 | $this->savedPos = $this->currPos; |
| 5634 | $r7 = $this->a55($r4, $r6); |
| 5635 | if ($r7) { |
| 5636 | $r7 = false; |
| 5637 | } else { |
| 5638 | $r7 = self::$FAILED; |
| 5639 | $this->currPos = $p3; |
| 5640 | $r1 = self::$FAILED; |
| 5641 | goto seq_1; |
| 5642 | } |
| 5643 | $r1 = true; |
| 5644 | seq_1: |
| 5645 | if ($r1!==self::$FAILED) { |
| 5646 | $this->savedPos = $p2; |
| 5647 | $r1 = $this->a56($r4, $r6); |
| 5648 | } |
| 5649 | // free $p3 |
| 5650 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5651 | $this->currPos, |
| 5652 | $r1, |
| 5653 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 5654 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 5655 | ); |
| 5656 | return $r1; |
| 5657 | } |
| 5658 | private function discardspace_or_newline($silence) { |
| 5659 | $key = 547; |
| 5660 | $bucket = $this->currPos; |
| 5661 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5662 | if ($cached) { |
| 5663 | $this->currPos = $cached->nextPos; |
| 5664 | |
| 5665 | return $cached->result; |
| 5666 | } |
| 5667 | |
| 5668 | if (strspn($this->input, " \x09\x0a\x0d\x0c", $this->currPos, 1) !== 0) { |
| 5669 | $r1 = $this->input[$this->currPos++]; |
| 5670 | } else { |
| 5671 | $r1 = self::$FAILED; |
| 5672 | if (!$silence) {$this->fail(37);} |
| 5673 | } |
| 5674 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5675 | $this->currPos, |
| 5676 | $r1, |
| 5677 | self::$UNDEFINED, |
| 5678 | self::$UNDEFINED |
| 5679 | ); |
| 5680 | return $r1; |
| 5681 | } |
| 5682 | private function parsegeneric_att_value($silence, $boolParams, &$param_preproc, &$param_th) { |
| 5683 | $key = json_encode([442, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 5684 | $bucket = $this->currPos; |
| 5685 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5686 | if ($cached) { |
| 5687 | $this->currPos = $cached->nextPos; |
| 5688 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 5689 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 5690 | return $cached->result; |
| 5691 | } |
| 5692 | $saved_preproc=$param_preproc; |
| 5693 | $saved_th=$param_th; |
| 5694 | // start choice_1 |
| 5695 | $p2 = $this->currPos; |
| 5696 | // start seq_1 |
| 5697 | $p3 = $this->currPos; |
| 5698 | $p5 = $this->currPos; |
| 5699 | // start seq_2 |
| 5700 | $p6 = $this->currPos; |
| 5701 | for (;;) { |
| 5702 | $r8 = $this->discardspace_or_newline($silence); |
| 5703 | if ($r8===self::$FAILED) { |
| 5704 | break; |
| 5705 | } |
| 5706 | } |
| 5707 | // free $r8 |
| 5708 | $r7 = true; |
| 5709 | if ($r7===self::$FAILED) { |
| 5710 | $r4 = self::$FAILED; |
| 5711 | goto seq_2; |
| 5712 | } |
| 5713 | // free $r7 |
| 5714 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 5715 | $this->currPos++; |
| 5716 | $r7 = "'"; |
| 5717 | } else { |
| 5718 | if (!$silence) {$this->fail(33);} |
| 5719 | $r7 = self::$FAILED; |
| 5720 | $this->currPos = $p6; |
| 5721 | $r4 = self::$FAILED; |
| 5722 | goto seq_2; |
| 5723 | } |
| 5724 | $r4 = true; |
| 5725 | seq_2: |
| 5726 | // s <- $r4 |
| 5727 | if ($r4!==self::$FAILED) { |
| 5728 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 5729 | } else { |
| 5730 | $r4 = self::$FAILED; |
| 5731 | $r1 = self::$FAILED; |
| 5732 | goto seq_1; |
| 5733 | } |
| 5734 | // free $p6 |
| 5735 | // free $p5 |
| 5736 | $r8 = $this->parseattribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th); |
| 5737 | if ($r8===self::$FAILED) { |
| 5738 | $r8 = null; |
| 5739 | } |
| 5740 | // t <- $r8 |
| 5741 | $p5 = $this->currPos; |
| 5742 | // start choice_2 |
| 5743 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 5744 | $this->currPos++; |
| 5745 | $r9 = "'"; |
| 5746 | goto choice_2; |
| 5747 | } else { |
| 5748 | if (!$silence) {$this->fail(33);} |
| 5749 | $r9 = self::$FAILED; |
| 5750 | } |
| 5751 | $p6 = $this->currPos; |
| 5752 | // start seq_3 |
| 5753 | $p10 = $this->currPos; |
| 5754 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 5755 | $this->currPos++; |
| 5756 | $r11 = "/"; |
| 5757 | } else { |
| 5758 | $r11 = self::$FAILED; |
| 5759 | $r11 = null; |
| 5760 | } |
| 5761 | if (($this->input[$this->currPos] ?? null) === ">") { |
| 5762 | $this->currPos++; |
| 5763 | $r12 = ">"; |
| 5764 | } else { |
| 5765 | $r12 = self::$FAILED; |
| 5766 | $this->currPos = $p10; |
| 5767 | $r9 = self::$FAILED; |
| 5768 | goto seq_3; |
| 5769 | } |
| 5770 | $r9 = true; |
| 5771 | seq_3: |
| 5772 | if ($r9!==self::$FAILED) { |
| 5773 | $r9 = false; |
| 5774 | $this->currPos = $p6; |
| 5775 | } |
| 5776 | // free $p10 |
| 5777 | // free $p6 |
| 5778 | choice_2: |
| 5779 | // q <- $r9 |
| 5780 | if ($r9!==self::$FAILED) { |
| 5781 | $r9 = substr($this->input, $p5, $this->currPos - $p5); |
| 5782 | } else { |
| 5783 | $r9 = self::$FAILED; |
| 5784 | $this->currPos = $p3; |
| 5785 | $r1 = self::$FAILED; |
| 5786 | goto seq_1; |
| 5787 | } |
| 5788 | // free $p5 |
| 5789 | $r1 = true; |
| 5790 | seq_1: |
| 5791 | if ($r1!==self::$FAILED) { |
| 5792 | $this->savedPos = $p2; |
| 5793 | $r1 = $this->a57($r4, $r8, $r9); |
| 5794 | goto choice_1; |
| 5795 | } |
| 5796 | // free $p3 |
| 5797 | $p3 = $this->currPos; |
| 5798 | // start seq_4 |
| 5799 | $p5 = $this->currPos; |
| 5800 | $p6 = $this->currPos; |
| 5801 | // start seq_5 |
| 5802 | $p10 = $this->currPos; |
| 5803 | for (;;) { |
| 5804 | $r15 = $this->discardspace_or_newline($silence); |
| 5805 | if ($r15===self::$FAILED) { |
| 5806 | break; |
| 5807 | } |
| 5808 | } |
| 5809 | // free $r15 |
| 5810 | $r14 = true; |
| 5811 | if ($r14===self::$FAILED) { |
| 5812 | $r13 = self::$FAILED; |
| 5813 | goto seq_5; |
| 5814 | } |
| 5815 | // free $r14 |
| 5816 | if (($this->input[$this->currPos] ?? null) === "\"") { |
| 5817 | $this->currPos++; |
| 5818 | $r14 = "\""; |
| 5819 | } else { |
| 5820 | if (!$silence) {$this->fail(34);} |
| 5821 | $r14 = self::$FAILED; |
| 5822 | $this->currPos = $p10; |
| 5823 | $r13 = self::$FAILED; |
| 5824 | goto seq_5; |
| 5825 | } |
| 5826 | $r13 = true; |
| 5827 | seq_5: |
| 5828 | // s <- $r13 |
| 5829 | if ($r13!==self::$FAILED) { |
| 5830 | $r13 = substr($this->input, $p6, $this->currPos - $p6); |
| 5831 | } else { |
| 5832 | $r13 = self::$FAILED; |
| 5833 | $r1 = self::$FAILED; |
| 5834 | goto seq_4; |
| 5835 | } |
| 5836 | // free $p10 |
| 5837 | // free $p6 |
| 5838 | $r15 = $this->parseattribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th); |
| 5839 | if ($r15===self::$FAILED) { |
| 5840 | $r15 = null; |
| 5841 | } |
| 5842 | // t <- $r15 |
| 5843 | $p6 = $this->currPos; |
| 5844 | // start choice_3 |
| 5845 | if (($this->input[$this->currPos] ?? null) === "\"") { |
| 5846 | $this->currPos++; |
| 5847 | $r16 = "\""; |
| 5848 | goto choice_3; |
| 5849 | } else { |
| 5850 | if (!$silence) {$this->fail(34);} |
| 5851 | $r16 = self::$FAILED; |
| 5852 | } |
| 5853 | $p10 = $this->currPos; |
| 5854 | // start seq_6 |
| 5855 | $p17 = $this->currPos; |
| 5856 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 5857 | $this->currPos++; |
| 5858 | $r18 = "/"; |
| 5859 | } else { |
| 5860 | $r18 = self::$FAILED; |
| 5861 | $r18 = null; |
| 5862 | } |
| 5863 | if (($this->input[$this->currPos] ?? null) === ">") { |
| 5864 | $this->currPos++; |
| 5865 | $r19 = ">"; |
| 5866 | } else { |
| 5867 | $r19 = self::$FAILED; |
| 5868 | $this->currPos = $p17; |
| 5869 | $r16 = self::$FAILED; |
| 5870 | goto seq_6; |
| 5871 | } |
| 5872 | $r16 = true; |
| 5873 | seq_6: |
| 5874 | if ($r16!==self::$FAILED) { |
| 5875 | $r16 = false; |
| 5876 | $this->currPos = $p10; |
| 5877 | } |
| 5878 | // free $p17 |
| 5879 | // free $p10 |
| 5880 | choice_3: |
| 5881 | // q <- $r16 |
| 5882 | if ($r16!==self::$FAILED) { |
| 5883 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
| 5884 | } else { |
| 5885 | $r16 = self::$FAILED; |
| 5886 | $this->currPos = $p5; |
| 5887 | $r1 = self::$FAILED; |
| 5888 | goto seq_4; |
| 5889 | } |
| 5890 | // free $p6 |
| 5891 | $r1 = true; |
| 5892 | seq_4: |
| 5893 | if ($r1!==self::$FAILED) { |
| 5894 | $this->savedPos = $p3; |
| 5895 | $r1 = $this->a57($r13, $r15, $r16); |
| 5896 | goto choice_1; |
| 5897 | } |
| 5898 | // free $p5 |
| 5899 | $p5 = $this->currPos; |
| 5900 | // start seq_7 |
| 5901 | $p6 = $this->currPos; |
| 5902 | $p10 = $this->currPos; |
| 5903 | for (;;) { |
| 5904 | $r21 = $this->discardspace_or_newline($silence); |
| 5905 | if ($r21===self::$FAILED) { |
| 5906 | break; |
| 5907 | } |
| 5908 | } |
| 5909 | // free $r21 |
| 5910 | $r20 = true; |
| 5911 | // s <- $r20 |
| 5912 | if ($r20!==self::$FAILED) { |
| 5913 | $r20 = substr($this->input, $p10, $this->currPos - $p10); |
| 5914 | } else { |
| 5915 | $r20 = self::$FAILED; |
| 5916 | $r1 = self::$FAILED; |
| 5917 | goto seq_7; |
| 5918 | } |
| 5919 | // free $p10 |
| 5920 | $r21 = $this->parseattribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
| 5921 | // t <- $r21 |
| 5922 | if ($r21===self::$FAILED) { |
| 5923 | $this->currPos = $p6; |
| 5924 | $r1 = self::$FAILED; |
| 5925 | goto seq_7; |
| 5926 | } |
| 5927 | $p10 = $this->currPos; |
| 5928 | // start choice_4 |
| 5929 | $r22 = $this->discardspace_or_newline(true); |
| 5930 | if ($r22!==self::$FAILED) { |
| 5931 | goto choice_4; |
| 5932 | } |
| 5933 | $r22 = $this->discardeof(true); |
| 5934 | if ($r22!==self::$FAILED) { |
| 5935 | goto choice_4; |
| 5936 | } |
| 5937 | // start seq_8 |
| 5938 | $p17 = $this->currPos; |
| 5939 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 5940 | $this->currPos++; |
| 5941 | $r23 = "/"; |
| 5942 | } else { |
| 5943 | $r23 = self::$FAILED; |
| 5944 | $r23 = null; |
| 5945 | } |
| 5946 | if (($this->input[$this->currPos] ?? null) === ">") { |
| 5947 | $this->currPos++; |
| 5948 | $r24 = ">"; |
| 5949 | } else { |
| 5950 | $r24 = self::$FAILED; |
| 5951 | $this->currPos = $p17; |
| 5952 | $r22 = self::$FAILED; |
| 5953 | goto seq_8; |
| 5954 | } |
| 5955 | $r22 = true; |
| 5956 | seq_8: |
| 5957 | // free $p17 |
| 5958 | choice_4: |
| 5959 | if ($r22!==self::$FAILED) { |
| 5960 | $r22 = false; |
| 5961 | $this->currPos = $p10; |
| 5962 | } else { |
| 5963 | $this->currPos = $p6; |
| 5964 | $r1 = self::$FAILED; |
| 5965 | goto seq_7; |
| 5966 | } |
| 5967 | // free $p10 |
| 5968 | $r1 = true; |
| 5969 | seq_7: |
| 5970 | if ($r1!==self::$FAILED) { |
| 5971 | $this->savedPos = $p5; |
| 5972 | $r1 = $this->a58($r20, $r21); |
| 5973 | } |
| 5974 | // free $p6 |
| 5975 | choice_1: |
| 5976 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 5977 | $this->currPos, |
| 5978 | $r1, |
| 5979 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 5980 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 5981 | ); |
| 5982 | return $r1; |
| 5983 | } |
| 5984 | private function parseextlink_nonipv6url_parameterized($silence, $boolParams, &$param_preproc, &$param_th) { |
| 5985 | $key = json_encode([508, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 5986 | $bucket = $this->currPos; |
| 5987 | $cached = $this->cache[$bucket][$key] ?? null; |
| 5988 | if ($cached) { |
| 5989 | $this->currPos = $cached->nextPos; |
| 5990 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 5991 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 5992 | return $cached->result; |
| 5993 | } |
| 5994 | $saved_preproc=$param_preproc; |
| 5995 | $saved_th=$param_th; |
| 5996 | $p2 = $this->currPos; |
| 5997 | $r3 = []; |
| 5998 | for (;;) { |
| 5999 | // start choice_1 |
| 6000 | $p5 = $this->currPos; |
| 6001 | $r4 = self::$FAILED; |
| 6002 | for (;;) { |
| 6003 | $r6 = self::charAt($this->input, $this->currPos); |
| 6004 | if (preg_match("/^[^<\\[{\\x0a\\x0d|!\\]}\\-\\x09&=\"' \\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r6)) { |
| 6005 | $this->currPos += strlen($r6); |
| 6006 | $r4 = true; |
| 6007 | } else { |
| 6008 | $r6 = self::$FAILED; |
| 6009 | if (!$silence) {$this->fail(38);} |
| 6010 | break; |
| 6011 | } |
| 6012 | } |
| 6013 | if ($r4!==self::$FAILED) { |
| 6014 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 6015 | goto choice_1; |
| 6016 | } else { |
| 6017 | $r4 = self::$FAILED; |
| 6018 | } |
| 6019 | // free $r6 |
| 6020 | // free $p5 |
| 6021 | $p5 = $this->currPos; |
| 6022 | // start seq_1 |
| 6023 | $p7 = $this->currPos; |
| 6024 | $p8 = $this->currPos; |
| 6025 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 6026 | if ($r6 === self::$FAILED) { |
| 6027 | $r6 = false; |
| 6028 | } else { |
| 6029 | $r6 = self::$FAILED; |
| 6030 | $this->currPos = $p8; |
| 6031 | $r4 = self::$FAILED; |
| 6032 | goto seq_1; |
| 6033 | } |
| 6034 | // free $p8 |
| 6035 | // start choice_2 |
| 6036 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 6037 | if ($r9!==self::$FAILED) { |
| 6038 | goto choice_2; |
| 6039 | } |
| 6040 | if (strspn($this->input, "&|{-!}=", $this->currPos, 1) !== 0) { |
| 6041 | $r9 = $this->input[$this->currPos++]; |
| 6042 | } else { |
| 6043 | $r9 = self::$FAILED; |
| 6044 | if (!$silence) {$this->fail(39);} |
| 6045 | } |
| 6046 | choice_2: |
| 6047 | // s <- $r9 |
| 6048 | if ($r9===self::$FAILED) { |
| 6049 | $this->currPos = $p7; |
| 6050 | $r4 = self::$FAILED; |
| 6051 | goto seq_1; |
| 6052 | } |
| 6053 | $r4 = true; |
| 6054 | seq_1: |
| 6055 | if ($r4!==self::$FAILED) { |
| 6056 | $this->savedPos = $p5; |
| 6057 | $r4 = $this->a42($r9); |
| 6058 | goto choice_1; |
| 6059 | } |
| 6060 | // free $p7 |
| 6061 | $p7 = $this->currPos; |
| 6062 | // start seq_2 |
| 6063 | $p8 = $this->currPos; |
| 6064 | $r10 = $this->input[$this->currPos] ?? ''; |
| 6065 | if ($r10 === "'") { |
| 6066 | $this->currPos++; |
| 6067 | } else { |
| 6068 | $r10 = self::$FAILED; |
| 6069 | if (!$silence) {$this->fail(40);} |
| 6070 | $r4 = self::$FAILED; |
| 6071 | goto seq_2; |
| 6072 | } |
| 6073 | $p11 = $this->currPos; |
| 6074 | $r12 = $this->input[$this->currPos] ?? ''; |
| 6075 | if ($r12 === "'") { |
| 6076 | $this->currPos++; |
| 6077 | } else { |
| 6078 | $r12 = self::$FAILED; |
| 6079 | } |
| 6080 | if ($r12 === self::$FAILED) { |
| 6081 | $r12 = false; |
| 6082 | } else { |
| 6083 | $r12 = self::$FAILED; |
| 6084 | $this->currPos = $p11; |
| 6085 | $this->currPos = $p8; |
| 6086 | $r4 = self::$FAILED; |
| 6087 | goto seq_2; |
| 6088 | } |
| 6089 | // free $p11 |
| 6090 | $r4 = true; |
| 6091 | seq_2: |
| 6092 | if ($r4!==self::$FAILED) { |
| 6093 | $r4 = substr($this->input, $p7, $this->currPos - $p7); |
| 6094 | } else { |
| 6095 | $r4 = self::$FAILED; |
| 6096 | } |
| 6097 | // free $p8 |
| 6098 | // free $p7 |
| 6099 | choice_1: |
| 6100 | if ($r4!==self::$FAILED) { |
| 6101 | $r3[] = $r4; |
| 6102 | } else { |
| 6103 | break; |
| 6104 | } |
| 6105 | } |
| 6106 | if (count($r3) === 0) { |
| 6107 | $r3 = self::$FAILED; |
| 6108 | } |
| 6109 | // r <- $r3 |
| 6110 | // free $r4 |
| 6111 | $r1 = $r3; |
| 6112 | if ($r1!==self::$FAILED) { |
| 6113 | $this->savedPos = $p2; |
| 6114 | $r1 = $this->a59($r3); |
| 6115 | } |
| 6116 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6117 | $this->currPos, |
| 6118 | $r1, |
| 6119 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6120 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6121 | ); |
| 6122 | return $r1; |
| 6123 | } |
| 6124 | private function parseurltext($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6125 | $key = json_encode([494, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 6126 | $bucket = $this->currPos; |
| 6127 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6128 | if ($cached) { |
| 6129 | $this->currPos = $cached->nextPos; |
| 6130 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6131 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6132 | return $cached->result; |
| 6133 | } |
| 6134 | $saved_preproc=$param_preproc; |
| 6135 | $saved_th=$param_th; |
| 6136 | $r1 = []; |
| 6137 | for (;;) { |
| 6138 | // start choice_1 |
| 6139 | $p3 = $this->currPos; |
| 6140 | // start seq_1 |
| 6141 | $p4 = $this->currPos; |
| 6142 | $this->savedPos = $this->currPos; |
| 6143 | $r5 = $this->a60(); |
| 6144 | if ($r5) { |
| 6145 | $r5 = false; |
| 6146 | } else { |
| 6147 | $r5 = self::$FAILED; |
| 6148 | $r2 = self::$FAILED; |
| 6149 | goto seq_1; |
| 6150 | } |
| 6151 | $r2 = true; |
| 6152 | seq_1: |
| 6153 | if ($r2!==self::$FAILED) { |
| 6154 | $this->savedPos = $p3; |
| 6155 | $r2 = $this->a61(); |
| 6156 | goto choice_1; |
| 6157 | } |
| 6158 | // free $p4 |
| 6159 | $p4 = $this->currPos; |
| 6160 | // start seq_2 |
| 6161 | $p6 = $this->currPos; |
| 6162 | $this->savedPos = $this->currPos; |
| 6163 | $r7 = $this->a62(); |
| 6164 | if ($r7) { |
| 6165 | $r7 = false; |
| 6166 | } else { |
| 6167 | $r7 = self::$FAILED; |
| 6168 | $r2 = self::$FAILED; |
| 6169 | goto seq_2; |
| 6170 | } |
| 6171 | $r8 = $this->parseautolink($silence, $boolParams, $param_preproc, $param_th); |
| 6172 | // al <- $r8 |
| 6173 | if ($r8===self::$FAILED) { |
| 6174 | $this->currPos = $p6; |
| 6175 | $r2 = self::$FAILED; |
| 6176 | goto seq_2; |
| 6177 | } |
| 6178 | $r2 = true; |
| 6179 | seq_2: |
| 6180 | if ($r2!==self::$FAILED) { |
| 6181 | $this->savedPos = $p4; |
| 6182 | $r2 = $this->a63($r8); |
| 6183 | goto choice_1; |
| 6184 | } |
| 6185 | // free $p6 |
| 6186 | $p6 = $this->currPos; |
| 6187 | // start seq_3 |
| 6188 | $p9 = $this->currPos; |
| 6189 | $p10 = $this->currPos; |
| 6190 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 6191 | $this->currPos++; |
| 6192 | $r11 = "&"; |
| 6193 | $r11 = false; |
| 6194 | $this->currPos = $p10; |
| 6195 | } else { |
| 6196 | $r11 = self::$FAILED; |
| 6197 | $r2 = self::$FAILED; |
| 6198 | goto seq_3; |
| 6199 | } |
| 6200 | // free $p10 |
| 6201 | $r12 = $this->parsehtmlentity($silence); |
| 6202 | // he <- $r12 |
| 6203 | if ($r12===self::$FAILED) { |
| 6204 | $this->currPos = $p9; |
| 6205 | $r2 = self::$FAILED; |
| 6206 | goto seq_3; |
| 6207 | } |
| 6208 | $r2 = true; |
| 6209 | seq_3: |
| 6210 | if ($r2!==self::$FAILED) { |
| 6211 | $this->savedPos = $p6; |
| 6212 | $r2 = $this->a64($r12); |
| 6213 | goto choice_1; |
| 6214 | } |
| 6215 | // free $p9 |
| 6216 | $p9 = $this->currPos; |
| 6217 | // start seq_4 |
| 6218 | $p10 = $this->currPos; |
| 6219 | $p13 = $this->currPos; |
| 6220 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
| 6221 | $r14 = "__"; |
| 6222 | $this->currPos += 2; |
| 6223 | $r14 = false; |
| 6224 | $this->currPos = $p13; |
| 6225 | } else { |
| 6226 | $r14 = self::$FAILED; |
| 6227 | $r2 = self::$FAILED; |
| 6228 | goto seq_4; |
| 6229 | } |
| 6230 | // free $p13 |
| 6231 | $r15 = $this->parsebehavior_switch($silence); |
| 6232 | // bs <- $r15 |
| 6233 | if ($r15===self::$FAILED) { |
| 6234 | $this->currPos = $p10; |
| 6235 | $r2 = self::$FAILED; |
| 6236 | goto seq_4; |
| 6237 | } |
| 6238 | $r2 = true; |
| 6239 | seq_4: |
| 6240 | if ($r2!==self::$FAILED) { |
| 6241 | $this->savedPos = $p9; |
| 6242 | $r2 = $this->a65($r15); |
| 6243 | goto choice_1; |
| 6244 | } |
| 6245 | // free $p10 |
| 6246 | $r2 = $this->parsetext_char($silence); |
| 6247 | choice_1: |
| 6248 | if ($r2!==self::$FAILED) { |
| 6249 | $r1[] = $r2; |
| 6250 | } else { |
| 6251 | break; |
| 6252 | } |
| 6253 | } |
| 6254 | if (count($r1) === 0) { |
| 6255 | $r1 = self::$FAILED; |
| 6256 | } |
| 6257 | // free $r2 |
| 6258 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6259 | $this->currPos, |
| 6260 | $r1, |
| 6261 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6262 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6263 | ); |
| 6264 | return $r1; |
| 6265 | } |
| 6266 | private function parseinline_element($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6267 | $key = json_encode([316, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 6268 | $bucket = $this->currPos; |
| 6269 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6270 | if ($cached) { |
| 6271 | $this->currPos = $cached->nextPos; |
| 6272 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6273 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6274 | return $cached->result; |
| 6275 | } |
| 6276 | $saved_preproc=$param_preproc; |
| 6277 | $saved_th=$param_th; |
| 6278 | // start choice_1 |
| 6279 | $p2 = $this->currPos; |
| 6280 | // start seq_1 |
| 6281 | $p3 = $this->currPos; |
| 6282 | $p4 = $this->currPos; |
| 6283 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 6284 | $this->currPos++; |
| 6285 | $r5 = "<"; |
| 6286 | $r5 = false; |
| 6287 | $this->currPos = $p4; |
| 6288 | } else { |
| 6289 | $r5 = self::$FAILED; |
| 6290 | $r1 = self::$FAILED; |
| 6291 | goto seq_1; |
| 6292 | } |
| 6293 | // free $p4 |
| 6294 | // start choice_2 |
| 6295 | $r6 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th); |
| 6296 | if ($r6!==self::$FAILED) { |
| 6297 | goto choice_2; |
| 6298 | } |
| 6299 | $r6 = $this->parsecomment($silence); |
| 6300 | choice_2: |
| 6301 | // r <- $r6 |
| 6302 | if ($r6===self::$FAILED) { |
| 6303 | $this->currPos = $p3; |
| 6304 | $r1 = self::$FAILED; |
| 6305 | goto seq_1; |
| 6306 | } |
| 6307 | $r1 = true; |
| 6308 | seq_1: |
| 6309 | if ($r1!==self::$FAILED) { |
| 6310 | $this->savedPos = $p2; |
| 6311 | $r1 = $this->a24($r6); |
| 6312 | goto choice_1; |
| 6313 | } |
| 6314 | // free $p3 |
| 6315 | $p3 = $this->currPos; |
| 6316 | // start seq_2 |
| 6317 | $p4 = $this->currPos; |
| 6318 | $p7 = $this->currPos; |
| 6319 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 6320 | $this->currPos++; |
| 6321 | $r8 = "{"; |
| 6322 | $r8 = false; |
| 6323 | $this->currPos = $p7; |
| 6324 | } else { |
| 6325 | $r8 = self::$FAILED; |
| 6326 | $r1 = self::$FAILED; |
| 6327 | goto seq_2; |
| 6328 | } |
| 6329 | // free $p7 |
| 6330 | $r9 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
| 6331 | // r <- $r9 |
| 6332 | if ($r9===self::$FAILED) { |
| 6333 | $this->currPos = $p4; |
| 6334 | $r1 = self::$FAILED; |
| 6335 | goto seq_2; |
| 6336 | } |
| 6337 | $r1 = true; |
| 6338 | seq_2: |
| 6339 | if ($r1!==self::$FAILED) { |
| 6340 | $this->savedPos = $p3; |
| 6341 | $r1 = $this->a24($r9); |
| 6342 | goto choice_1; |
| 6343 | } |
| 6344 | // free $p4 |
| 6345 | $p4 = $this->currPos; |
| 6346 | // start seq_3 |
| 6347 | $p7 = $this->currPos; |
| 6348 | $p10 = $this->currPos; |
| 6349 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
| 6350 | $r11 = "-{"; |
| 6351 | $this->currPos += 2; |
| 6352 | $r11 = false; |
| 6353 | $this->currPos = $p10; |
| 6354 | } else { |
| 6355 | $r11 = self::$FAILED; |
| 6356 | $r1 = self::$FAILED; |
| 6357 | goto seq_3; |
| 6358 | } |
| 6359 | // free $p10 |
| 6360 | $r12 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
| 6361 | // r <- $r12 |
| 6362 | if ($r12===self::$FAILED) { |
| 6363 | $this->currPos = $p7; |
| 6364 | $r1 = self::$FAILED; |
| 6365 | goto seq_3; |
| 6366 | } |
| 6367 | $r1 = true; |
| 6368 | seq_3: |
| 6369 | if ($r1!==self::$FAILED) { |
| 6370 | $this->savedPos = $p4; |
| 6371 | $r1 = $this->a24($r12); |
| 6372 | goto choice_1; |
| 6373 | } |
| 6374 | // free $p7 |
| 6375 | $p7 = $this->currPos; |
| 6376 | $r1 = self::$FAILED; |
| 6377 | for (;;) { |
| 6378 | // start seq_4 |
| 6379 | $p10 = $this->currPos; |
| 6380 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
| 6381 | $r14 = "[["; |
| 6382 | $this->currPos += 2; |
| 6383 | } else { |
| 6384 | if (!$silence) {$this->fail(41);} |
| 6385 | $r14 = self::$FAILED; |
| 6386 | $r13 = self::$FAILED; |
| 6387 | goto seq_4; |
| 6388 | } |
| 6389 | $p15 = $this->currPos; |
| 6390 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 6391 | $this->currPos++; |
| 6392 | $r16 = "["; |
| 6393 | $r16 = false; |
| 6394 | $this->currPos = $p15; |
| 6395 | } else { |
| 6396 | $r16 = self::$FAILED; |
| 6397 | $this->currPos = $p10; |
| 6398 | $r13 = self::$FAILED; |
| 6399 | goto seq_4; |
| 6400 | } |
| 6401 | // free $p15 |
| 6402 | $r13 = true; |
| 6403 | seq_4: |
| 6404 | if ($r13!==self::$FAILED) { |
| 6405 | $r1 = true; |
| 6406 | } else { |
| 6407 | break; |
| 6408 | } |
| 6409 | // free $p10 |
| 6410 | } |
| 6411 | if ($r1!==self::$FAILED) { |
| 6412 | $r1 = substr($this->input, $p7, $this->currPos - $p7); |
| 6413 | goto choice_1; |
| 6414 | } else { |
| 6415 | $r1 = self::$FAILED; |
| 6416 | } |
| 6417 | // free $r13 |
| 6418 | // free $p7 |
| 6419 | $p7 = $this->currPos; |
| 6420 | // start seq_5 |
| 6421 | $p10 = $this->currPos; |
| 6422 | $p15 = $this->currPos; |
| 6423 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 6424 | $this->currPos++; |
| 6425 | $r13 = "["; |
| 6426 | $r13 = false; |
| 6427 | $this->currPos = $p15; |
| 6428 | } else { |
| 6429 | $r13 = self::$FAILED; |
| 6430 | $r1 = self::$FAILED; |
| 6431 | goto seq_5; |
| 6432 | } |
| 6433 | // free $p15 |
| 6434 | // start choice_3 |
| 6435 | $r17 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
| 6436 | if ($r17!==self::$FAILED) { |
| 6437 | goto choice_3; |
| 6438 | } |
| 6439 | $r17 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
| 6440 | choice_3: |
| 6441 | // r <- $r17 |
| 6442 | if ($r17===self::$FAILED) { |
| 6443 | $this->currPos = $p10; |
| 6444 | $r1 = self::$FAILED; |
| 6445 | goto seq_5; |
| 6446 | } |
| 6447 | $r1 = true; |
| 6448 | seq_5: |
| 6449 | if ($r1!==self::$FAILED) { |
| 6450 | $this->savedPos = $p7; |
| 6451 | $r1 = $this->a24($r17); |
| 6452 | goto choice_1; |
| 6453 | } |
| 6454 | // free $p10 |
| 6455 | $p10 = $this->currPos; |
| 6456 | // start seq_6 |
| 6457 | $p15 = $this->currPos; |
| 6458 | $p18 = $this->currPos; |
| 6459 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 6460 | $this->currPos++; |
| 6461 | $r19 = "'"; |
| 6462 | $r19 = false; |
| 6463 | $this->currPos = $p18; |
| 6464 | } else { |
| 6465 | $r19 = self::$FAILED; |
| 6466 | $r1 = self::$FAILED; |
| 6467 | goto seq_6; |
| 6468 | } |
| 6469 | // free $p18 |
| 6470 | $r20 = $this->parsequote($silence); |
| 6471 | // r <- $r20 |
| 6472 | if ($r20===self::$FAILED) { |
| 6473 | $this->currPos = $p15; |
| 6474 | $r1 = self::$FAILED; |
| 6475 | goto seq_6; |
| 6476 | } |
| 6477 | $r1 = true; |
| 6478 | seq_6: |
| 6479 | if ($r1!==self::$FAILED) { |
| 6480 | $this->savedPos = $p10; |
| 6481 | $r1 = $this->a24($r20); |
| 6482 | } |
| 6483 | // free $p15 |
| 6484 | choice_1: |
| 6485 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6486 | $this->currPos, |
| 6487 | $r1, |
| 6488 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6489 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6490 | ); |
| 6491 | return $r1; |
| 6492 | } |
| 6493 | private function discardlist_char($silence) { |
| 6494 | $key = 457; |
| 6495 | $bucket = $this->currPos; |
| 6496 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6497 | if ($cached) { |
| 6498 | $this->currPos = $cached->nextPos; |
| 6499 | |
| 6500 | return $cached->result; |
| 6501 | } |
| 6502 | |
| 6503 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
| 6504 | $r1 = $this->input[$this->currPos++]; |
| 6505 | } else { |
| 6506 | $r1 = self::$FAILED; |
| 6507 | if (!$silence) {$this->fail(42);} |
| 6508 | } |
| 6509 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6510 | $this->currPos, |
| 6511 | $r1, |
| 6512 | self::$UNDEFINED, |
| 6513 | self::$UNDEFINED |
| 6514 | ); |
| 6515 | return $r1; |
| 6516 | } |
| 6517 | private function parselist_char($silence) { |
| 6518 | $key = 456; |
| 6519 | $bucket = $this->currPos; |
| 6520 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6521 | if ($cached) { |
| 6522 | $this->currPos = $cached->nextPos; |
| 6523 | |
| 6524 | return $cached->result; |
| 6525 | } |
| 6526 | |
| 6527 | if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) { |
| 6528 | $r1 = $this->input[$this->currPos++]; |
| 6529 | } else { |
| 6530 | $r1 = self::$FAILED; |
| 6531 | if (!$silence) {$this->fail(42);} |
| 6532 | } |
| 6533 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6534 | $this->currPos, |
| 6535 | $r1, |
| 6536 | self::$UNDEFINED, |
| 6537 | self::$UNDEFINED |
| 6538 | ); |
| 6539 | return $r1; |
| 6540 | } |
| 6541 | private function parsedtdd_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6542 | $key = json_encode([452, $boolParams & 0x2fff, $param_preproc, $param_th]); |
| 6543 | $bucket = $this->currPos; |
| 6544 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6545 | if ($cached) { |
| 6546 | $this->currPos = $cached->nextPos; |
| 6547 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6548 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6549 | return $cached->result; |
| 6550 | } |
| 6551 | $saved_preproc=$param_preproc; |
| 6552 | $saved_th=$param_th; |
| 6553 | $p2 = $this->currPos; |
| 6554 | // start seq_1 |
| 6555 | $p3 = $this->currPos; |
| 6556 | $r4 = $this->parseinlineline_break_on_colon($silence, $boolParams, $param_preproc, $param_th); |
| 6557 | if ($r4===self::$FAILED) { |
| 6558 | $r4 = null; |
| 6559 | } |
| 6560 | // c <- $r4 |
| 6561 | $p6 = $this->currPos; |
| 6562 | // cpos <- $r5 |
| 6563 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 6564 | $this->currPos++; |
| 6565 | $r5 = ":"; |
| 6566 | $this->savedPos = $p6; |
| 6567 | $r5 = $this->a66($r4); |
| 6568 | } else { |
| 6569 | if (!$silence) {$this->fail(18);} |
| 6570 | $r5 = self::$FAILED; |
| 6571 | $this->currPos = $p3; |
| 6572 | $r1 = self::$FAILED; |
| 6573 | goto seq_1; |
| 6574 | } |
| 6575 | $r1 = true; |
| 6576 | seq_1: |
| 6577 | if ($r1!==self::$FAILED) { |
| 6578 | $this->savedPos = $p2; |
| 6579 | $r1 = $this->a67($r4, $r5); |
| 6580 | } |
| 6581 | // free $p3 |
| 6582 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6583 | $this->currPos, |
| 6584 | $r1, |
| 6585 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6586 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6587 | ); |
| 6588 | return $r1; |
| 6589 | } |
| 6590 | private function discardeolf($silence) { |
| 6591 | $key = 539; |
| 6592 | $bucket = $this->currPos; |
| 6593 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6594 | if ($cached) { |
| 6595 | $this->currPos = $cached->nextPos; |
| 6596 | |
| 6597 | return $cached->result; |
| 6598 | } |
| 6599 | |
| 6600 | // start choice_1 |
| 6601 | $r1 = $this->discardnewline($silence); |
| 6602 | if ($r1!==self::$FAILED) { |
| 6603 | goto choice_1; |
| 6604 | } |
| 6605 | $r1 = $this->discardeof($silence); |
| 6606 | choice_1: |
| 6607 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6608 | $this->currPos, |
| 6609 | $r1, |
| 6610 | self::$UNDEFINED, |
| 6611 | self::$UNDEFINED |
| 6612 | ); |
| 6613 | return $r1; |
| 6614 | } |
| 6615 | private function parsetable_line($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6616 | $key = json_encode([464, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 6617 | $bucket = $this->currPos; |
| 6618 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6619 | if ($cached) { |
| 6620 | $this->currPos = $cached->nextPos; |
| 6621 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6622 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6623 | return $cached->result; |
| 6624 | } |
| 6625 | $saved_preproc=$param_preproc; |
| 6626 | $saved_th=$param_th; |
| 6627 | $p2 = $this->currPos; |
| 6628 | // start seq_1 |
| 6629 | $p3 = $this->currPos; |
| 6630 | // start choice_1 |
| 6631 | $p5 = $this->currPos; |
| 6632 | $r4 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 6633 | if ($r4 === self::$FAILED) { |
| 6634 | $r4 = false; |
| 6635 | goto choice_1; |
| 6636 | } else { |
| 6637 | $r4 = self::$FAILED; |
| 6638 | $this->currPos = $p5; |
| 6639 | } |
| 6640 | // free $p5 |
| 6641 | $p5 = $this->currPos; |
| 6642 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) { |
| 6643 | $r4 = "{{!}}"; |
| 6644 | $this->currPos += 5; |
| 6645 | $r4 = false; |
| 6646 | $this->currPos = $p5; |
| 6647 | } else { |
| 6648 | $r4 = self::$FAILED; |
| 6649 | } |
| 6650 | // free $p5 |
| 6651 | choice_1: |
| 6652 | if ($r4===self::$FAILED) { |
| 6653 | $r1 = self::$FAILED; |
| 6654 | goto seq_1; |
| 6655 | } |
| 6656 | // start choice_2 |
| 6657 | $r6 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th); |
| 6658 | if ($r6!==self::$FAILED) { |
| 6659 | goto choice_2; |
| 6660 | } |
| 6661 | $r6 = $this->parsetable_content_line($silence, $boolParams | 0x40, $param_preproc, $param_th); |
| 6662 | if ($r6!==self::$FAILED) { |
| 6663 | goto choice_2; |
| 6664 | } |
| 6665 | $r6 = $this->parsetable_end_tag($silence); |
| 6666 | choice_2: |
| 6667 | // tl <- $r6 |
| 6668 | if ($r6===self::$FAILED) { |
| 6669 | $this->currPos = $p3; |
| 6670 | $r1 = self::$FAILED; |
| 6671 | goto seq_1; |
| 6672 | } |
| 6673 | $r1 = true; |
| 6674 | seq_1: |
| 6675 | if ($r1!==self::$FAILED) { |
| 6676 | $this->savedPos = $p2; |
| 6677 | $r1 = $this->a68($r6); |
| 6678 | } |
| 6679 | // free $p3 |
| 6680 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6681 | $this->currPos, |
| 6682 | $r1, |
| 6683 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6684 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6685 | ); |
| 6686 | return $r1; |
| 6687 | } |
| 6688 | private function parsesol($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6689 | $key = json_encode([558, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 6690 | $bucket = $this->currPos; |
| 6691 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6692 | if ($cached) { |
| 6693 | $this->currPos = $cached->nextPos; |
| 6694 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6695 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6696 | return $cached->result; |
| 6697 | } |
| 6698 | $saved_preproc=$param_preproc; |
| 6699 | $saved_th=$param_th; |
| 6700 | // start seq_1 |
| 6701 | $p1 = $this->currPos; |
| 6702 | // start choice_1 |
| 6703 | $r3 = $this->parseempty_line_with_comments($silence); |
| 6704 | if ($r3!==self::$FAILED) { |
| 6705 | goto choice_1; |
| 6706 | } |
| 6707 | $r3 = $this->parsesol_prefix($silence); |
| 6708 | choice_1: |
| 6709 | if ($r3===self::$FAILED) { |
| 6710 | $r2 = self::$FAILED; |
| 6711 | goto seq_1; |
| 6712 | } |
| 6713 | $r4 = []; |
| 6714 | for (;;) { |
| 6715 | $r5 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
| 6716 | if ($r5!==self::$FAILED) { |
| 6717 | $r4[] = $r5; |
| 6718 | } else { |
| 6719 | break; |
| 6720 | } |
| 6721 | } |
| 6722 | // free $r5 |
| 6723 | $r2 = [$r3,$r4]; |
| 6724 | seq_1: |
| 6725 | // free $r2,$p1 |
| 6726 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6727 | $this->currPos, |
| 6728 | $r2, |
| 6729 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6730 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6731 | ); |
| 6732 | return $r2; |
| 6733 | } |
| 6734 | private function discardcomment($silence) { |
| 6735 | $key = 541; |
| 6736 | $bucket = $this->currPos; |
| 6737 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6738 | if ($cached) { |
| 6739 | $this->currPos = $cached->nextPos; |
| 6740 | |
| 6741 | return $cached->result; |
| 6742 | } |
| 6743 | |
| 6744 | $p2 = $this->currPos; |
| 6745 | // start seq_1 |
| 6746 | $p3 = $this->currPos; |
| 6747 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) { |
| 6748 | $r4 = "<!--"; |
| 6749 | $this->currPos += 4; |
| 6750 | } else { |
| 6751 | if (!$silence) {$this->fail(11);} |
| 6752 | $r4 = self::$FAILED; |
| 6753 | $r1 = self::$FAILED; |
| 6754 | goto seq_1; |
| 6755 | } |
| 6756 | $p6 = $this->currPos; |
| 6757 | for (;;) { |
| 6758 | // start seq_2 |
| 6759 | $p8 = $this->currPos; |
| 6760 | $p9 = $this->currPos; |
| 6761 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
| 6762 | $r10 = "-->"; |
| 6763 | $this->currPos += 3; |
| 6764 | } else { |
| 6765 | $r10 = self::$FAILED; |
| 6766 | } |
| 6767 | if ($r10 === self::$FAILED) { |
| 6768 | $r10 = false; |
| 6769 | } else { |
| 6770 | $r10 = self::$FAILED; |
| 6771 | $this->currPos = $p9; |
| 6772 | $r7 = self::$FAILED; |
| 6773 | goto seq_2; |
| 6774 | } |
| 6775 | // free $p9 |
| 6776 | if ($this->currPos < $this->inputLength) { |
| 6777 | $r11 = self::consumeChar($this->input, $this->currPos);; |
| 6778 | } else { |
| 6779 | $r11 = self::$FAILED; |
| 6780 | if (!$silence) {$this->fail(7);} |
| 6781 | $this->currPos = $p8; |
| 6782 | $r7 = self::$FAILED; |
| 6783 | goto seq_2; |
| 6784 | } |
| 6785 | $r7 = true; |
| 6786 | seq_2: |
| 6787 | if ($r7===self::$FAILED) { |
| 6788 | break; |
| 6789 | } |
| 6790 | // free $p8 |
| 6791 | } |
| 6792 | // free $r7 |
| 6793 | $r5 = true; |
| 6794 | // c <- $r5 |
| 6795 | if ($r5!==self::$FAILED) { |
| 6796 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 6797 | } else { |
| 6798 | $r5 = self::$FAILED; |
| 6799 | $this->currPos = $p3; |
| 6800 | $r1 = self::$FAILED; |
| 6801 | goto seq_1; |
| 6802 | } |
| 6803 | // free $p6 |
| 6804 | $p6 = $this->currPos; |
| 6805 | // start choice_1 |
| 6806 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) { |
| 6807 | $r7 = "-->"; |
| 6808 | $this->currPos += 3; |
| 6809 | goto choice_1; |
| 6810 | } else { |
| 6811 | if (!$silence) {$this->fail(12);} |
| 6812 | $r7 = self::$FAILED; |
| 6813 | } |
| 6814 | $r7 = $this->discardeof($silence); |
| 6815 | choice_1: |
| 6816 | // cEnd <- $r7 |
| 6817 | if ($r7!==self::$FAILED) { |
| 6818 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
| 6819 | } else { |
| 6820 | $r7 = self::$FAILED; |
| 6821 | $this->currPos = $p3; |
| 6822 | $r1 = self::$FAILED; |
| 6823 | goto seq_1; |
| 6824 | } |
| 6825 | // free $p6 |
| 6826 | $r1 = true; |
| 6827 | seq_1: |
| 6828 | if ($r1!==self::$FAILED) { |
| 6829 | $this->savedPos = $p2; |
| 6830 | $r1 = $this->a27($r5, $r7); |
| 6831 | } |
| 6832 | // free $p3 |
| 6833 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6834 | $this->currPos, |
| 6835 | $r1, |
| 6836 | self::$UNDEFINED, |
| 6837 | self::$UNDEFINED |
| 6838 | ); |
| 6839 | return $r1; |
| 6840 | } |
| 6841 | private function discardsof($silence) { |
| 6842 | $key = 531; |
| 6843 | $bucket = $this->currPos; |
| 6844 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6845 | if ($cached) { |
| 6846 | $this->currPos = $cached->nextPos; |
| 6847 | |
| 6848 | return $cached->result; |
| 6849 | } |
| 6850 | |
| 6851 | $this->savedPos = $this->currPos; |
| 6852 | $r1 = $this->a69(); |
| 6853 | if ($r1) { |
| 6854 | $r1 = false; |
| 6855 | } else { |
| 6856 | $r1 = self::$FAILED; |
| 6857 | } |
| 6858 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6859 | $this->currPos, |
| 6860 | $r1, |
| 6861 | self::$UNDEFINED, |
| 6862 | self::$UNDEFINED |
| 6863 | ); |
| 6864 | return $r1; |
| 6865 | } |
| 6866 | private function parseredirect($silence, $boolParams, &$param_th, &$param_preproc) { |
| 6867 | $key = json_encode([292, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 6868 | $bucket = $this->currPos; |
| 6869 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6870 | if ($cached) { |
| 6871 | $this->currPos = $cached->nextPos; |
| 6872 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6873 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6874 | return $cached->result; |
| 6875 | } |
| 6876 | $saved_th=$param_th; |
| 6877 | $saved_preproc=$param_preproc; |
| 6878 | $p2 = $this->currPos; |
| 6879 | // start seq_1 |
| 6880 | $p3 = $this->currPos; |
| 6881 | $r4 = $this->parseredirect_word($silence); |
| 6882 | // rw <- $r4 |
| 6883 | if ($r4===self::$FAILED) { |
| 6884 | $r1 = self::$FAILED; |
| 6885 | goto seq_1; |
| 6886 | } |
| 6887 | $p6 = $this->currPos; |
| 6888 | for (;;) { |
| 6889 | $r7 = $this->discardspace_or_newline($silence); |
| 6890 | if ($r7===self::$FAILED) { |
| 6891 | break; |
| 6892 | } |
| 6893 | } |
| 6894 | // free $r7 |
| 6895 | $r5 = true; |
| 6896 | // sp <- $r5 |
| 6897 | if ($r5!==self::$FAILED) { |
| 6898 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 6899 | } else { |
| 6900 | $r5 = self::$FAILED; |
| 6901 | $this->currPos = $p3; |
| 6902 | $r1 = self::$FAILED; |
| 6903 | goto seq_1; |
| 6904 | } |
| 6905 | // free $p6 |
| 6906 | $p6 = $this->currPos; |
| 6907 | // start seq_2 |
| 6908 | $p8 = $this->currPos; |
| 6909 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 6910 | $this->currPos++; |
| 6911 | $r9 = ":"; |
| 6912 | } else { |
| 6913 | if (!$silence) {$this->fail(18);} |
| 6914 | $r9 = self::$FAILED; |
| 6915 | $r7 = self::$FAILED; |
| 6916 | goto seq_2; |
| 6917 | } |
| 6918 | for (;;) { |
| 6919 | $r11 = $this->discardspace_or_newline($silence); |
| 6920 | if ($r11===self::$FAILED) { |
| 6921 | break; |
| 6922 | } |
| 6923 | } |
| 6924 | // free $r11 |
| 6925 | $r10 = true; |
| 6926 | if ($r10===self::$FAILED) { |
| 6927 | $this->currPos = $p8; |
| 6928 | $r7 = self::$FAILED; |
| 6929 | goto seq_2; |
| 6930 | } |
| 6931 | // free $r10 |
| 6932 | $r7 = true; |
| 6933 | seq_2: |
| 6934 | if ($r7===self::$FAILED) { |
| 6935 | $r7 = null; |
| 6936 | } |
| 6937 | // free $p8 |
| 6938 | // c <- $r7 |
| 6939 | $r7 = substr($this->input, $p6, $this->currPos - $p6); |
| 6940 | // free $p6 |
| 6941 | $r10 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc); |
| 6942 | // wl <- $r10 |
| 6943 | if ($r10===self::$FAILED) { |
| 6944 | $this->currPos = $p3; |
| 6945 | $r1 = self::$FAILED; |
| 6946 | goto seq_1; |
| 6947 | } |
| 6948 | $this->savedPos = $this->currPos; |
| 6949 | $r11 = $this->a70($r4, $r5, $r7, $r10); |
| 6950 | if ($r11) { |
| 6951 | $r11 = false; |
| 6952 | } else { |
| 6953 | $r11 = self::$FAILED; |
| 6954 | $this->currPos = $p3; |
| 6955 | $r1 = self::$FAILED; |
| 6956 | goto seq_1; |
| 6957 | } |
| 6958 | $r1 = true; |
| 6959 | seq_1: |
| 6960 | if ($r1!==self::$FAILED) { |
| 6961 | $this->savedPos = $p2; |
| 6962 | $r1 = $this->a71($r4, $r5, $r7, $r10); |
| 6963 | } |
| 6964 | // free $p3 |
| 6965 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 6966 | $this->currPos, |
| 6967 | $r1, |
| 6968 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 6969 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 6970 | ); |
| 6971 | return $r1; |
| 6972 | } |
| 6973 | private function parsesol_transparent($silence, $boolParams, &$param_preproc, &$param_th) { |
| 6974 | $key = json_encode([556, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 6975 | $bucket = $this->currPos; |
| 6976 | $cached = $this->cache[$bucket][$key] ?? null; |
| 6977 | if ($cached) { |
| 6978 | $this->currPos = $cached->nextPos; |
| 6979 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 6980 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 6981 | return $cached->result; |
| 6982 | } |
| 6983 | $saved_preproc=$param_preproc; |
| 6984 | $saved_th=$param_th; |
| 6985 | // start choice_1 |
| 6986 | $r1 = $this->parsecomment($silence); |
| 6987 | if ($r1!==self::$FAILED) { |
| 6988 | goto choice_1; |
| 6989 | } |
| 6990 | $r1 = $this->parseinclude_limits($silence, $boolParams | 0x2000, $param_preproc, $param_th); |
| 6991 | if ($r1!==self::$FAILED) { |
| 6992 | goto choice_1; |
| 6993 | } |
| 6994 | $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th); |
| 6995 | if ($r1!==self::$FAILED) { |
| 6996 | goto choice_1; |
| 6997 | } |
| 6998 | $r1 = $this->parsebehavior_switch($silence); |
| 6999 | choice_1: |
| 7000 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7001 | $this->currPos, |
| 7002 | $r1, |
| 7003 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7004 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7005 | ); |
| 7006 | return $r1; |
| 7007 | } |
| 7008 | private function parseblock_line($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7009 | $key = json_encode([306, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7010 | $bucket = $this->currPos; |
| 7011 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7012 | if ($cached) { |
| 7013 | $this->currPos = $cached->nextPos; |
| 7014 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7015 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7016 | return $cached->result; |
| 7017 | } |
| 7018 | $saved_preproc=$param_preproc; |
| 7019 | $saved_th=$param_th; |
| 7020 | // start choice_1 |
| 7021 | $r1 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th); |
| 7022 | if ($r1!==self::$FAILED) { |
| 7023 | goto choice_1; |
| 7024 | } |
| 7025 | $r1 = $this->parselist_item($silence, $boolParams, $param_preproc, $param_th); |
| 7026 | if ($r1!==self::$FAILED) { |
| 7027 | goto choice_1; |
| 7028 | } |
| 7029 | $r1 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th); |
| 7030 | if ($r1!==self::$FAILED) { |
| 7031 | goto choice_1; |
| 7032 | } |
| 7033 | $p2 = $this->currPos; |
| 7034 | // start seq_1 |
| 7035 | $p3 = $this->currPos; |
| 7036 | $r4 = $this->parseoptionalSpaceToken($silence); |
| 7037 | // st <- $r4 |
| 7038 | if ($r4===self::$FAILED) { |
| 7039 | $r1 = self::$FAILED; |
| 7040 | goto seq_1; |
| 7041 | } |
| 7042 | $p5 = $this->currPos; |
| 7043 | if (strspn($this->input, " <{}|!", $this->currPos, 1) !== 0) { |
| 7044 | $r6 = $this->input[$this->currPos++]; |
| 7045 | $r6 = false; |
| 7046 | $this->currPos = $p5; |
| 7047 | } else { |
| 7048 | $r6 = self::$FAILED; |
| 7049 | $this->currPos = $p3; |
| 7050 | $r1 = self::$FAILED; |
| 7051 | goto seq_1; |
| 7052 | } |
| 7053 | // free $p5 |
| 7054 | $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th); |
| 7055 | // tl <- $r7 |
| 7056 | if ($r7===self::$FAILED) { |
| 7057 | $this->currPos = $p3; |
| 7058 | $r1 = self::$FAILED; |
| 7059 | goto seq_1; |
| 7060 | } |
| 7061 | $r1 = true; |
| 7062 | seq_1: |
| 7063 | if ($r1!==self::$FAILED) { |
| 7064 | $this->savedPos = $p2; |
| 7065 | $r1 = $this->a72($r4, $r7); |
| 7066 | } |
| 7067 | // free $p3 |
| 7068 | choice_1: |
| 7069 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7070 | $this->currPos, |
| 7071 | $r1, |
| 7072 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7073 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7074 | ); |
| 7075 | return $r1; |
| 7076 | } |
| 7077 | private function parseblock_lines($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7078 | $key = json_encode([302, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7079 | $bucket = $this->currPos; |
| 7080 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7081 | if ($cached) { |
| 7082 | $this->currPos = $cached->nextPos; |
| 7083 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7084 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7085 | return $cached->result; |
| 7086 | } |
| 7087 | $saved_preproc=$param_preproc; |
| 7088 | $saved_th=$param_th; |
| 7089 | $p2 = $this->currPos; |
| 7090 | // start seq_1 |
| 7091 | $p3 = $this->currPos; |
| 7092 | $r4 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
| 7093 | // s <- $r4 |
| 7094 | if ($r4===self::$FAILED) { |
| 7095 | $r1 = self::$FAILED; |
| 7096 | goto seq_1; |
| 7097 | } |
| 7098 | $p6 = $this->currPos; |
| 7099 | // start seq_2 |
| 7100 | $p7 = $this->currPos; |
| 7101 | $r8 = $this->parseoptionalSpaceToken($silence); |
| 7102 | // os <- $r8 |
| 7103 | if ($r8===self::$FAILED) { |
| 7104 | $r5 = self::$FAILED; |
| 7105 | goto seq_2; |
| 7106 | } |
| 7107 | $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th); |
| 7108 | // so <- $r9 |
| 7109 | if ($r9===self::$FAILED) { |
| 7110 | $this->currPos = $p7; |
| 7111 | $r5 = self::$FAILED; |
| 7112 | goto seq_2; |
| 7113 | } |
| 7114 | $r5 = true; |
| 7115 | seq_2: |
| 7116 | if ($r5!==self::$FAILED) { |
| 7117 | $this->savedPos = $p6; |
| 7118 | $r5 = $this->a73($r4, $r8, $r9); |
| 7119 | } else { |
| 7120 | $r5 = null; |
| 7121 | } |
| 7122 | // free $p7 |
| 7123 | // s2 <- $r5 |
| 7124 | $r10 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th); |
| 7125 | // bl <- $r10 |
| 7126 | if ($r10===self::$FAILED) { |
| 7127 | $this->currPos = $p3; |
| 7128 | $r1 = self::$FAILED; |
| 7129 | goto seq_1; |
| 7130 | } |
| 7131 | $r1 = true; |
| 7132 | seq_1: |
| 7133 | if ($r1!==self::$FAILED) { |
| 7134 | $this->savedPos = $p2; |
| 7135 | $r1 = $this->a74($r4, $r5, $r10); |
| 7136 | } |
| 7137 | // free $p3 |
| 7138 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7139 | $this->currPos, |
| 7140 | $r1, |
| 7141 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7142 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7143 | ); |
| 7144 | return $r1; |
| 7145 | } |
| 7146 | private function discardtplarg($silence, $boolParams, &$param_th) { |
| 7147 | $key = json_encode([359, $boolParams & 0x3fff, $param_th]); |
| 7148 | $bucket = $this->currPos; |
| 7149 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7150 | if ($cached) { |
| 7151 | $this->currPos = $cached->nextPos; |
| 7152 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7153 | return $cached->result; |
| 7154 | } |
| 7155 | $saved_th=$param_th; |
| 7156 | $r1 = $this->discardtplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
| 7157 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7158 | $this->currPos, |
| 7159 | $r1, |
| 7160 | self::$UNDEFINED, |
| 7161 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7162 | ); |
| 7163 | return $r1; |
| 7164 | } |
| 7165 | private function parsetemplate($silence, $boolParams, &$param_th) { |
| 7166 | $key = json_encode([352, $boolParams & 0x3fff, $param_th]); |
| 7167 | $bucket = $this->currPos; |
| 7168 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7169 | if ($cached) { |
| 7170 | $this->currPos = $cached->nextPos; |
| 7171 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7172 | return $cached->result; |
| 7173 | } |
| 7174 | $saved_th=$param_th; |
| 7175 | $r1 = $this->parsetemplate_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
| 7176 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7177 | $this->currPos, |
| 7178 | $r1, |
| 7179 | self::$UNDEFINED, |
| 7180 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7181 | ); |
| 7182 | return $r1; |
| 7183 | } |
| 7184 | private function parsebroken_template($silence, &$param_preproc) { |
| 7185 | $key = json_encode([354, $param_preproc]); |
| 7186 | $bucket = $this->currPos; |
| 7187 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7188 | if ($cached) { |
| 7189 | $this->currPos = $cached->nextPos; |
| 7190 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7191 | return $cached->result; |
| 7192 | } |
| 7193 | $saved_preproc=$param_preproc; |
| 7194 | $p2 = $this->currPos; |
| 7195 | // start seq_1 |
| 7196 | $p3 = $this->currPos; |
| 7197 | // t <- $r4 |
| 7198 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 7199 | $r4 = "{{"; |
| 7200 | $this->currPos += 2; |
| 7201 | } else { |
| 7202 | if (!$silence) {$this->fail(43);} |
| 7203 | $r4 = self::$FAILED; |
| 7204 | $this->currPos = $p3; |
| 7205 | $r1 = self::$FAILED; |
| 7206 | goto seq_1; |
| 7207 | } |
| 7208 | $r1 = true; |
| 7209 | seq_1: |
| 7210 | if ($r1!==self::$FAILED) { |
| 7211 | $this->savedPos = $p2; |
| 7212 | $r1 = $this->a75($param_preproc, $r4); |
| 7213 | } |
| 7214 | // free $p3 |
| 7215 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7216 | $this->currPos, |
| 7217 | $r1, |
| 7218 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7219 | self::$UNDEFINED |
| 7220 | ); |
| 7221 | return $r1; |
| 7222 | } |
| 7223 | private function parsetplarg($silence, $boolParams, &$param_th) { |
| 7224 | $key = json_encode([358, $boolParams & 0x3fff, $param_th]); |
| 7225 | $bucket = $this->currPos; |
| 7226 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7227 | if ($cached) { |
| 7228 | $this->currPos = $cached->nextPos; |
| 7229 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7230 | return $cached->result; |
| 7231 | } |
| 7232 | $saved_th=$param_th; |
| 7233 | $r1 = $this->parsetplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th); |
| 7234 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7235 | $this->currPos, |
| 7236 | $r1, |
| 7237 | self::$UNDEFINED, |
| 7238 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7239 | ); |
| 7240 | return $r1; |
| 7241 | } |
| 7242 | private function discardwikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
| 7243 | $key = json_encode([403, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 7244 | $bucket = $this->currPos; |
| 7245 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7246 | if ($cached) { |
| 7247 | $this->currPos = $cached->nextPos; |
| 7248 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7249 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7250 | return $cached->result; |
| 7251 | } |
| 7252 | $saved_th=$param_th; |
| 7253 | $saved_preproc=$param_preproc; |
| 7254 | // start choice_1 |
| 7255 | $r1 = $this->discardwikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
| 7256 | if ($r1!==self::$FAILED) { |
| 7257 | goto choice_1; |
| 7258 | } |
| 7259 | $r1 = $this->discardbroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
| 7260 | choice_1: |
| 7261 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7262 | $this->currPos, |
| 7263 | $r1, |
| 7264 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7265 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7266 | ); |
| 7267 | return $r1; |
| 7268 | } |
| 7269 | private function parsedirective($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7270 | $key = json_encode([502, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7271 | $bucket = $this->currPos; |
| 7272 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7273 | if ($cached) { |
| 7274 | $this->currPos = $cached->nextPos; |
| 7275 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7276 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7277 | return $cached->result; |
| 7278 | } |
| 7279 | $saved_preproc=$param_preproc; |
| 7280 | $saved_th=$param_th; |
| 7281 | // start choice_1 |
| 7282 | $r1 = $this->parsecomment($silence); |
| 7283 | if ($r1!==self::$FAILED) { |
| 7284 | goto choice_1; |
| 7285 | } |
| 7286 | $r1 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
| 7287 | if ($r1!==self::$FAILED) { |
| 7288 | goto choice_1; |
| 7289 | } |
| 7290 | $r1 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
| 7291 | if ($r1!==self::$FAILED) { |
| 7292 | goto choice_1; |
| 7293 | } |
| 7294 | $p2 = $this->currPos; |
| 7295 | // start seq_1 |
| 7296 | $p3 = $this->currPos; |
| 7297 | $p4 = $this->currPos; |
| 7298 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
| 7299 | $r5 = "-{"; |
| 7300 | $this->currPos += 2; |
| 7301 | $r5 = false; |
| 7302 | $this->currPos = $p4; |
| 7303 | } else { |
| 7304 | $r5 = self::$FAILED; |
| 7305 | $r1 = self::$FAILED; |
| 7306 | goto seq_1; |
| 7307 | } |
| 7308 | // free $p4 |
| 7309 | $r6 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc); |
| 7310 | // v <- $r6 |
| 7311 | if ($r6===self::$FAILED) { |
| 7312 | $this->currPos = $p3; |
| 7313 | $r1 = self::$FAILED; |
| 7314 | goto seq_1; |
| 7315 | } |
| 7316 | $r1 = true; |
| 7317 | seq_1: |
| 7318 | if ($r1!==self::$FAILED) { |
| 7319 | $this->savedPos = $p2; |
| 7320 | $r1 = $this->a76($r6); |
| 7321 | goto choice_1; |
| 7322 | } |
| 7323 | // free $p3 |
| 7324 | $p3 = $this->currPos; |
| 7325 | // start seq_2 |
| 7326 | $p4 = $this->currPos; |
| 7327 | $p7 = $this->currPos; |
| 7328 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 7329 | $this->currPos++; |
| 7330 | $r8 = "&"; |
| 7331 | $r8 = false; |
| 7332 | $this->currPos = $p7; |
| 7333 | } else { |
| 7334 | $r8 = self::$FAILED; |
| 7335 | $r1 = self::$FAILED; |
| 7336 | goto seq_2; |
| 7337 | } |
| 7338 | // free $p7 |
| 7339 | $r9 = $this->parsehtmlentity($silence); |
| 7340 | // e <- $r9 |
| 7341 | if ($r9===self::$FAILED) { |
| 7342 | $this->currPos = $p4; |
| 7343 | $r1 = self::$FAILED; |
| 7344 | goto seq_2; |
| 7345 | } |
| 7346 | $r1 = true; |
| 7347 | seq_2: |
| 7348 | if ($r1!==self::$FAILED) { |
| 7349 | $this->savedPos = $p3; |
| 7350 | $r1 = $this->a77($r9); |
| 7351 | goto choice_1; |
| 7352 | } |
| 7353 | // free $p4 |
| 7354 | $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th); |
| 7355 | choice_1: |
| 7356 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7357 | $this->currPos, |
| 7358 | $r1, |
| 7359 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7360 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7361 | ); |
| 7362 | return $r1; |
| 7363 | } |
| 7364 | private function parseinline_xmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7365 | $key = json_encode([314, $boolParams & 0x3ebd, $param_preproc, $param_th]); |
| 7366 | $bucket = $this->currPos; |
| 7367 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7368 | if ($cached) { |
| 7369 | $this->currPos = $cached->nextPos; |
| 7370 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7371 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7372 | return $cached->result; |
| 7373 | } |
| 7374 | $saved_preproc=$param_preproc; |
| 7375 | $saved_th=$param_th; |
| 7376 | $p2 = $this->currPos; |
| 7377 | // start seq_1 |
| 7378 | $p3 = $this->currPos; |
| 7379 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 7380 | $this->currPos++; |
| 7381 | $r4 = "<"; |
| 7382 | } else { |
| 7383 | if (!$silence) {$this->fail(44);} |
| 7384 | $r4 = self::$FAILED; |
| 7385 | $r1 = self::$FAILED; |
| 7386 | goto seq_1; |
| 7387 | } |
| 7388 | // start choice_1 |
| 7389 | $r5 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
| 7390 | if ($r5!==self::$FAILED) { |
| 7391 | goto choice_1; |
| 7392 | } |
| 7393 | $r5 = $this->parsexmlish_tag($silence, $boolParams & ~0x2, $param_preproc, $param_th); |
| 7394 | if ($r5!==self::$FAILED) { |
| 7395 | goto choice_1; |
| 7396 | } |
| 7397 | $r5 = $this->parsetvar_old_syntax_closing_HACK($silence); |
| 7398 | choice_1: |
| 7399 | // tag <- $r5 |
| 7400 | if ($r5===self::$FAILED) { |
| 7401 | $this->currPos = $p3; |
| 7402 | $r1 = self::$FAILED; |
| 7403 | goto seq_1; |
| 7404 | } |
| 7405 | $r1 = true; |
| 7406 | seq_1: |
| 7407 | if ($r1!==self::$FAILED) { |
| 7408 | $this->savedPos = $p2; |
| 7409 | $r1 = $this->a78($r5); |
| 7410 | } |
| 7411 | // free $p3 |
| 7412 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7413 | $this->currPos, |
| 7414 | $r1, |
| 7415 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7416 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7417 | ); |
| 7418 | return $r1; |
| 7419 | } |
| 7420 | private function parsetable_attribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7421 | $key = json_encode([518, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7422 | $bucket = $this->currPos; |
| 7423 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7424 | if ($cached) { |
| 7425 | $this->currPos = $cached->nextPos; |
| 7426 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7427 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7428 | return $cached->result; |
| 7429 | } |
| 7430 | $saved_preproc=$param_preproc; |
| 7431 | $saved_th=$param_th; |
| 7432 | $p2 = $this->currPos; |
| 7433 | $r3 = []; |
| 7434 | for (;;) { |
| 7435 | // start choice_1 |
| 7436 | $p5 = $this->currPos; |
| 7437 | $r4 = self::$FAILED; |
| 7438 | for (;;) { |
| 7439 | if (strcspn($this->input, "{}&<-!['\x0d\x0a|", $this->currPos, 1) !== 0) { |
| 7440 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 7441 | $r4 = true; |
| 7442 | } else { |
| 7443 | $r6 = self::$FAILED; |
| 7444 | if (!$silence) {$this->fail(45);} |
| 7445 | break; |
| 7446 | } |
| 7447 | } |
| 7448 | if ($r4!==self::$FAILED) { |
| 7449 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 7450 | goto choice_1; |
| 7451 | } else { |
| 7452 | $r4 = self::$FAILED; |
| 7453 | } |
| 7454 | // free $r6 |
| 7455 | // free $p5 |
| 7456 | $p5 = $this->currPos; |
| 7457 | // start seq_1 |
| 7458 | $p7 = $this->currPos; |
| 7459 | $p8 = $this->currPos; |
| 7460 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 7461 | if ($r6 === self::$FAILED) { |
| 7462 | $r6 = false; |
| 7463 | } else { |
| 7464 | $r6 = self::$FAILED; |
| 7465 | $this->currPos = $p8; |
| 7466 | $r4 = self::$FAILED; |
| 7467 | goto seq_1; |
| 7468 | } |
| 7469 | // free $p8 |
| 7470 | // start choice_2 |
| 7471 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 7472 | if ($r9!==self::$FAILED) { |
| 7473 | goto choice_2; |
| 7474 | } |
| 7475 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
| 7476 | $r9 = $this->input[$this->currPos++]; |
| 7477 | } else { |
| 7478 | $r9 = self::$FAILED; |
| 7479 | if (!$silence) {$this->fail(46);} |
| 7480 | } |
| 7481 | choice_2: |
| 7482 | // s <- $r9 |
| 7483 | if ($r9===self::$FAILED) { |
| 7484 | $this->currPos = $p7; |
| 7485 | $r4 = self::$FAILED; |
| 7486 | goto seq_1; |
| 7487 | } |
| 7488 | $r4 = true; |
| 7489 | seq_1: |
| 7490 | if ($r4!==self::$FAILED) { |
| 7491 | $this->savedPos = $p5; |
| 7492 | $r4 = $this->a42($r9); |
| 7493 | } |
| 7494 | // free $p7 |
| 7495 | choice_1: |
| 7496 | if ($r4!==self::$FAILED) { |
| 7497 | $r3[] = $r4; |
| 7498 | } else { |
| 7499 | break; |
| 7500 | } |
| 7501 | } |
| 7502 | // r <- $r3 |
| 7503 | // free $r4 |
| 7504 | $r1 = $r3; |
| 7505 | if ($r1!==self::$FAILED) { |
| 7506 | $this->savedPos = $p2; |
| 7507 | $r1 = $this->a59($r3); |
| 7508 | } |
| 7509 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7510 | $this->currPos, |
| 7511 | $r1, |
| 7512 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7513 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7514 | ); |
| 7515 | return $r1; |
| 7516 | } |
| 7517 | private function parsetable_attribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7518 | $key = json_encode([520, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7519 | $bucket = $this->currPos; |
| 7520 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7521 | if ($cached) { |
| 7522 | $this->currPos = $cached->nextPos; |
| 7523 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7524 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7525 | return $cached->result; |
| 7526 | } |
| 7527 | $saved_preproc=$param_preproc; |
| 7528 | $saved_th=$param_th; |
| 7529 | $p2 = $this->currPos; |
| 7530 | $r3 = []; |
| 7531 | for (;;) { |
| 7532 | // start choice_1 |
| 7533 | $p5 = $this->currPos; |
| 7534 | $r4 = self::$FAILED; |
| 7535 | for (;;) { |
| 7536 | if (strcspn($this->input, "{}&<-![\"\x0d\x0a|", $this->currPos, 1) !== 0) { |
| 7537 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 7538 | $r4 = true; |
| 7539 | } else { |
| 7540 | $r6 = self::$FAILED; |
| 7541 | if (!$silence) {$this->fail(47);} |
| 7542 | break; |
| 7543 | } |
| 7544 | } |
| 7545 | if ($r4!==self::$FAILED) { |
| 7546 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 7547 | goto choice_1; |
| 7548 | } else { |
| 7549 | $r4 = self::$FAILED; |
| 7550 | } |
| 7551 | // free $r6 |
| 7552 | // free $p5 |
| 7553 | $p5 = $this->currPos; |
| 7554 | // start seq_1 |
| 7555 | $p7 = $this->currPos; |
| 7556 | $p8 = $this->currPos; |
| 7557 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 7558 | if ($r6 === self::$FAILED) { |
| 7559 | $r6 = false; |
| 7560 | } else { |
| 7561 | $r6 = self::$FAILED; |
| 7562 | $this->currPos = $p8; |
| 7563 | $r4 = self::$FAILED; |
| 7564 | goto seq_1; |
| 7565 | } |
| 7566 | // free $p8 |
| 7567 | // start choice_2 |
| 7568 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 7569 | if ($r9!==self::$FAILED) { |
| 7570 | goto choice_2; |
| 7571 | } |
| 7572 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
| 7573 | $r9 = $this->input[$this->currPos++]; |
| 7574 | } else { |
| 7575 | $r9 = self::$FAILED; |
| 7576 | if (!$silence) {$this->fail(46);} |
| 7577 | } |
| 7578 | choice_2: |
| 7579 | // s <- $r9 |
| 7580 | if ($r9===self::$FAILED) { |
| 7581 | $this->currPos = $p7; |
| 7582 | $r4 = self::$FAILED; |
| 7583 | goto seq_1; |
| 7584 | } |
| 7585 | $r4 = true; |
| 7586 | seq_1: |
| 7587 | if ($r4!==self::$FAILED) { |
| 7588 | $this->savedPos = $p5; |
| 7589 | $r4 = $this->a42($r9); |
| 7590 | } |
| 7591 | // free $p7 |
| 7592 | choice_1: |
| 7593 | if ($r4!==self::$FAILED) { |
| 7594 | $r3[] = $r4; |
| 7595 | } else { |
| 7596 | break; |
| 7597 | } |
| 7598 | } |
| 7599 | // r <- $r3 |
| 7600 | // free $r4 |
| 7601 | $r1 = $r3; |
| 7602 | if ($r1!==self::$FAILED) { |
| 7603 | $this->savedPos = $p2; |
| 7604 | $r1 = $this->a59($r3); |
| 7605 | } |
| 7606 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7607 | $this->currPos, |
| 7608 | $r1, |
| 7609 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7610 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7611 | ); |
| 7612 | return $r1; |
| 7613 | } |
| 7614 | private function parsetable_attribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7615 | $key = json_encode([516, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7616 | $bucket = $this->currPos; |
| 7617 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7618 | if ($cached) { |
| 7619 | $this->currPos = $cached->nextPos; |
| 7620 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7621 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7622 | return $cached->result; |
| 7623 | } |
| 7624 | $saved_preproc=$param_preproc; |
| 7625 | $saved_th=$param_th; |
| 7626 | $p2 = $this->currPos; |
| 7627 | $r3 = []; |
| 7628 | for (;;) { |
| 7629 | // start choice_1 |
| 7630 | $p5 = $this->currPos; |
| 7631 | $r4 = self::$FAILED; |
| 7632 | for (;;) { |
| 7633 | if (strcspn($this->input, "{}&<-![ \x09\x0a\x0d\x0c|", $this->currPos, 1) !== 0) { |
| 7634 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 7635 | $r4 = true; |
| 7636 | } else { |
| 7637 | $r6 = self::$FAILED; |
| 7638 | if (!$silence) {$this->fail(48);} |
| 7639 | break; |
| 7640 | } |
| 7641 | } |
| 7642 | if ($r4!==self::$FAILED) { |
| 7643 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 7644 | goto choice_1; |
| 7645 | } else { |
| 7646 | $r4 = self::$FAILED; |
| 7647 | } |
| 7648 | // free $r6 |
| 7649 | // free $p5 |
| 7650 | $p5 = $this->currPos; |
| 7651 | // start seq_1 |
| 7652 | $p7 = $this->currPos; |
| 7653 | $p8 = $this->currPos; |
| 7654 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 7655 | if ($r6 === self::$FAILED) { |
| 7656 | $r6 = false; |
| 7657 | } else { |
| 7658 | $r6 = self::$FAILED; |
| 7659 | $this->currPos = $p8; |
| 7660 | $r4 = self::$FAILED; |
| 7661 | goto seq_1; |
| 7662 | } |
| 7663 | // free $p8 |
| 7664 | // start choice_2 |
| 7665 | $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 7666 | if ($r9!==self::$FAILED) { |
| 7667 | goto choice_2; |
| 7668 | } |
| 7669 | if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) { |
| 7670 | $r9 = $this->input[$this->currPos++]; |
| 7671 | } else { |
| 7672 | $r9 = self::$FAILED; |
| 7673 | if (!$silence) {$this->fail(46);} |
| 7674 | } |
| 7675 | choice_2: |
| 7676 | // s <- $r9 |
| 7677 | if ($r9===self::$FAILED) { |
| 7678 | $this->currPos = $p7; |
| 7679 | $r4 = self::$FAILED; |
| 7680 | goto seq_1; |
| 7681 | } |
| 7682 | $r4 = true; |
| 7683 | seq_1: |
| 7684 | if ($r4!==self::$FAILED) { |
| 7685 | $this->savedPos = $p5; |
| 7686 | $r4 = $this->a42($r9); |
| 7687 | } |
| 7688 | // free $p7 |
| 7689 | choice_1: |
| 7690 | if ($r4!==self::$FAILED) { |
| 7691 | $r3[] = $r4; |
| 7692 | } else { |
| 7693 | break; |
| 7694 | } |
| 7695 | } |
| 7696 | if (count($r3) === 0) { |
| 7697 | $r3 = self::$FAILED; |
| 7698 | } |
| 7699 | // r <- $r3 |
| 7700 | // free $r4 |
| 7701 | $r1 = $r3; |
| 7702 | if ($r1!==self::$FAILED) { |
| 7703 | $this->savedPos = $p2; |
| 7704 | $r1 = $this->a59($r3); |
| 7705 | } |
| 7706 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7707 | $this->currPos, |
| 7708 | $r1, |
| 7709 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7710 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7711 | ); |
| 7712 | return $r1; |
| 7713 | } |
| 7714 | private function parseless_than($silence, $boolParams) { |
| 7715 | $key = json_encode([434, $boolParams & 0x2]); |
| 7716 | $bucket = $this->currPos; |
| 7717 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7718 | if ($cached) { |
| 7719 | $this->currPos = $cached->nextPos; |
| 7720 | |
| 7721 | return $cached->result; |
| 7722 | } |
| 7723 | |
| 7724 | $p1 = $this->currPos; |
| 7725 | // start seq_1 |
| 7726 | $p3 = $this->currPos; |
| 7727 | if (/*annOrExtTag*/($boolParams & 0x2) !== 0) { |
| 7728 | $r4 = false; |
| 7729 | } else { |
| 7730 | $r4 = self::$FAILED; |
| 7731 | $r2 = self::$FAILED; |
| 7732 | goto seq_1; |
| 7733 | } |
| 7734 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 7735 | $this->currPos++; |
| 7736 | $r5 = "<"; |
| 7737 | } else { |
| 7738 | if (!$silence) {$this->fail(44);} |
| 7739 | $r5 = self::$FAILED; |
| 7740 | $this->currPos = $p3; |
| 7741 | $r2 = self::$FAILED; |
| 7742 | goto seq_1; |
| 7743 | } |
| 7744 | $r2 = true; |
| 7745 | seq_1: |
| 7746 | if ($r2!==self::$FAILED) { |
| 7747 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
| 7748 | } else { |
| 7749 | $r2 = self::$FAILED; |
| 7750 | } |
| 7751 | // free $p3 |
| 7752 | // free $p1 |
| 7753 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7754 | $this->currPos, |
| 7755 | $r2, |
| 7756 | self::$UNDEFINED, |
| 7757 | self::$UNDEFINED |
| 7758 | ); |
| 7759 | return $r2; |
| 7760 | } |
| 7761 | private function parseattribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7762 | $key = json_encode([512, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7763 | $bucket = $this->currPos; |
| 7764 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7765 | if ($cached) { |
| 7766 | $this->currPos = $cached->nextPos; |
| 7767 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7768 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7769 | return $cached->result; |
| 7770 | } |
| 7771 | $saved_preproc=$param_preproc; |
| 7772 | $saved_th=$param_th; |
| 7773 | $p2 = $this->currPos; |
| 7774 | $r3 = []; |
| 7775 | for (;;) { |
| 7776 | // start choice_1 |
| 7777 | $p5 = $this->currPos; |
| 7778 | $r4 = self::$FAILED; |
| 7779 | for (;;) { |
| 7780 | if (strcspn($this->input, "{}&<-|/'>", $this->currPos, 1) !== 0) { |
| 7781 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 7782 | $r4 = true; |
| 7783 | } else { |
| 7784 | $r6 = self::$FAILED; |
| 7785 | if (!$silence) {$this->fail(49);} |
| 7786 | break; |
| 7787 | } |
| 7788 | } |
| 7789 | if ($r4!==self::$FAILED) { |
| 7790 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 7791 | goto choice_1; |
| 7792 | } else { |
| 7793 | $r4 = self::$FAILED; |
| 7794 | } |
| 7795 | // free $r6 |
| 7796 | // free $p5 |
| 7797 | $p5 = $this->currPos; |
| 7798 | // start seq_1 |
| 7799 | $p7 = $this->currPos; |
| 7800 | $p8 = $this->currPos; |
| 7801 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 7802 | if ($r6 === self::$FAILED) { |
| 7803 | $r6 = false; |
| 7804 | } else { |
| 7805 | $r6 = self::$FAILED; |
| 7806 | $this->currPos = $p8; |
| 7807 | $r4 = self::$FAILED; |
| 7808 | goto seq_1; |
| 7809 | } |
| 7810 | // free $p8 |
| 7811 | $p8 = $this->currPos; |
| 7812 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
| 7813 | $r9 = "/>"; |
| 7814 | $this->currPos += 2; |
| 7815 | } else { |
| 7816 | $r9 = self::$FAILED; |
| 7817 | } |
| 7818 | if ($r9 === self::$FAILED) { |
| 7819 | $r9 = false; |
| 7820 | } else { |
| 7821 | $r9 = self::$FAILED; |
| 7822 | $this->currPos = $p8; |
| 7823 | $this->currPos = $p7; |
| 7824 | $r4 = self::$FAILED; |
| 7825 | goto seq_1; |
| 7826 | } |
| 7827 | // free $p8 |
| 7828 | // start choice_2 |
| 7829 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 7830 | if ($r10!==self::$FAILED) { |
| 7831 | goto choice_2; |
| 7832 | } |
| 7833 | $r10 = $this->parseless_than($silence, $boolParams); |
| 7834 | if ($r10!==self::$FAILED) { |
| 7835 | goto choice_2; |
| 7836 | } |
| 7837 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
| 7838 | $r10 = $this->input[$this->currPos++]; |
| 7839 | } else { |
| 7840 | $r10 = self::$FAILED; |
| 7841 | if (!$silence) {$this->fail(50);} |
| 7842 | } |
| 7843 | choice_2: |
| 7844 | // s <- $r10 |
| 7845 | if ($r10===self::$FAILED) { |
| 7846 | $this->currPos = $p7; |
| 7847 | $r4 = self::$FAILED; |
| 7848 | goto seq_1; |
| 7849 | } |
| 7850 | $r4 = true; |
| 7851 | seq_1: |
| 7852 | if ($r4!==self::$FAILED) { |
| 7853 | $this->savedPos = $p5; |
| 7854 | $r4 = $this->a42($r10); |
| 7855 | } |
| 7856 | // free $p7 |
| 7857 | choice_1: |
| 7858 | if ($r4!==self::$FAILED) { |
| 7859 | $r3[] = $r4; |
| 7860 | } else { |
| 7861 | break; |
| 7862 | } |
| 7863 | } |
| 7864 | // r <- $r3 |
| 7865 | // free $r4 |
| 7866 | $r1 = $r3; |
| 7867 | if ($r1!==self::$FAILED) { |
| 7868 | $this->savedPos = $p2; |
| 7869 | $r1 = $this->a59($r3); |
| 7870 | } |
| 7871 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7872 | $this->currPos, |
| 7873 | $r1, |
| 7874 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7875 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7876 | ); |
| 7877 | return $r1; |
| 7878 | } |
| 7879 | private function parseattribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7880 | $key = json_encode([514, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7881 | $bucket = $this->currPos; |
| 7882 | $cached = $this->cache[$bucket][$key] ?? null; |
| 7883 | if ($cached) { |
| 7884 | $this->currPos = $cached->nextPos; |
| 7885 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 7886 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 7887 | return $cached->result; |
| 7888 | } |
| 7889 | $saved_preproc=$param_preproc; |
| 7890 | $saved_th=$param_th; |
| 7891 | $p2 = $this->currPos; |
| 7892 | $r3 = []; |
| 7893 | for (;;) { |
| 7894 | // start choice_1 |
| 7895 | $p5 = $this->currPos; |
| 7896 | $r4 = self::$FAILED; |
| 7897 | for (;;) { |
| 7898 | if (strcspn($this->input, "{}&<-|/\">", $this->currPos, 1) !== 0) { |
| 7899 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 7900 | $r4 = true; |
| 7901 | } else { |
| 7902 | $r6 = self::$FAILED; |
| 7903 | if (!$silence) {$this->fail(51);} |
| 7904 | break; |
| 7905 | } |
| 7906 | } |
| 7907 | if ($r4!==self::$FAILED) { |
| 7908 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 7909 | goto choice_1; |
| 7910 | } else { |
| 7911 | $r4 = self::$FAILED; |
| 7912 | } |
| 7913 | // free $r6 |
| 7914 | // free $p5 |
| 7915 | $p5 = $this->currPos; |
| 7916 | // start seq_1 |
| 7917 | $p7 = $this->currPos; |
| 7918 | $p8 = $this->currPos; |
| 7919 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 7920 | if ($r6 === self::$FAILED) { |
| 7921 | $r6 = false; |
| 7922 | } else { |
| 7923 | $r6 = self::$FAILED; |
| 7924 | $this->currPos = $p8; |
| 7925 | $r4 = self::$FAILED; |
| 7926 | goto seq_1; |
| 7927 | } |
| 7928 | // free $p8 |
| 7929 | $p8 = $this->currPos; |
| 7930 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
| 7931 | $r9 = "/>"; |
| 7932 | $this->currPos += 2; |
| 7933 | } else { |
| 7934 | $r9 = self::$FAILED; |
| 7935 | } |
| 7936 | if ($r9 === self::$FAILED) { |
| 7937 | $r9 = false; |
| 7938 | } else { |
| 7939 | $r9 = self::$FAILED; |
| 7940 | $this->currPos = $p8; |
| 7941 | $this->currPos = $p7; |
| 7942 | $r4 = self::$FAILED; |
| 7943 | goto seq_1; |
| 7944 | } |
| 7945 | // free $p8 |
| 7946 | // start choice_2 |
| 7947 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 7948 | if ($r10!==self::$FAILED) { |
| 7949 | goto choice_2; |
| 7950 | } |
| 7951 | $r10 = $this->parseless_than($silence, $boolParams); |
| 7952 | if ($r10!==self::$FAILED) { |
| 7953 | goto choice_2; |
| 7954 | } |
| 7955 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
| 7956 | $r10 = $this->input[$this->currPos++]; |
| 7957 | } else { |
| 7958 | $r10 = self::$FAILED; |
| 7959 | if (!$silence) {$this->fail(50);} |
| 7960 | } |
| 7961 | choice_2: |
| 7962 | // s <- $r10 |
| 7963 | if ($r10===self::$FAILED) { |
| 7964 | $this->currPos = $p7; |
| 7965 | $r4 = self::$FAILED; |
| 7966 | goto seq_1; |
| 7967 | } |
| 7968 | $r4 = true; |
| 7969 | seq_1: |
| 7970 | if ($r4!==self::$FAILED) { |
| 7971 | $this->savedPos = $p5; |
| 7972 | $r4 = $this->a42($r10); |
| 7973 | } |
| 7974 | // free $p7 |
| 7975 | choice_1: |
| 7976 | if ($r4!==self::$FAILED) { |
| 7977 | $r3[] = $r4; |
| 7978 | } else { |
| 7979 | break; |
| 7980 | } |
| 7981 | } |
| 7982 | // r <- $r3 |
| 7983 | // free $r4 |
| 7984 | $r1 = $r3; |
| 7985 | if ($r1!==self::$FAILED) { |
| 7986 | $this->savedPos = $p2; |
| 7987 | $r1 = $this->a59($r3); |
| 7988 | } |
| 7989 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 7990 | $this->currPos, |
| 7991 | $r1, |
| 7992 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 7993 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 7994 | ); |
| 7995 | return $r1; |
| 7996 | } |
| 7997 | private function parseattribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) { |
| 7998 | $key = json_encode([510, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 7999 | $bucket = $this->currPos; |
| 8000 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8001 | if ($cached) { |
| 8002 | $this->currPos = $cached->nextPos; |
| 8003 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8004 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8005 | return $cached->result; |
| 8006 | } |
| 8007 | $saved_preproc=$param_preproc; |
| 8008 | $saved_th=$param_th; |
| 8009 | $p2 = $this->currPos; |
| 8010 | $r3 = []; |
| 8011 | for (;;) { |
| 8012 | // start choice_1 |
| 8013 | $p5 = $this->currPos; |
| 8014 | $r4 = self::$FAILED; |
| 8015 | for (;;) { |
| 8016 | if (strcspn($this->input, "{}&<-|/ \x09\x0a\x0d\x0c>", $this->currPos, 1) !== 0) { |
| 8017 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 8018 | $r4 = true; |
| 8019 | } else { |
| 8020 | $r6 = self::$FAILED; |
| 8021 | if (!$silence) {$this->fail(52);} |
| 8022 | break; |
| 8023 | } |
| 8024 | } |
| 8025 | if ($r4!==self::$FAILED) { |
| 8026 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 8027 | goto choice_1; |
| 8028 | } else { |
| 8029 | $r4 = self::$FAILED; |
| 8030 | } |
| 8031 | // free $r6 |
| 8032 | // free $p5 |
| 8033 | $p5 = $this->currPos; |
| 8034 | // start seq_1 |
| 8035 | $p7 = $this->currPos; |
| 8036 | $p8 = $this->currPos; |
| 8037 | $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 8038 | if ($r6 === self::$FAILED) { |
| 8039 | $r6 = false; |
| 8040 | } else { |
| 8041 | $r6 = self::$FAILED; |
| 8042 | $this->currPos = $p8; |
| 8043 | $r4 = self::$FAILED; |
| 8044 | goto seq_1; |
| 8045 | } |
| 8046 | // free $p8 |
| 8047 | $p8 = $this->currPos; |
| 8048 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
| 8049 | $r9 = "/>"; |
| 8050 | $this->currPos += 2; |
| 8051 | } else { |
| 8052 | $r9 = self::$FAILED; |
| 8053 | } |
| 8054 | if ($r9 === self::$FAILED) { |
| 8055 | $r9 = false; |
| 8056 | } else { |
| 8057 | $r9 = self::$FAILED; |
| 8058 | $this->currPos = $p8; |
| 8059 | $this->currPos = $p7; |
| 8060 | $r4 = self::$FAILED; |
| 8061 | goto seq_1; |
| 8062 | } |
| 8063 | // free $p8 |
| 8064 | // start choice_2 |
| 8065 | $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th); |
| 8066 | if ($r10!==self::$FAILED) { |
| 8067 | goto choice_2; |
| 8068 | } |
| 8069 | $r10 = $this->parseless_than($silence, $boolParams); |
| 8070 | if ($r10!==self::$FAILED) { |
| 8071 | goto choice_2; |
| 8072 | } |
| 8073 | if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) { |
| 8074 | $r10 = $this->input[$this->currPos++]; |
| 8075 | } else { |
| 8076 | $r10 = self::$FAILED; |
| 8077 | if (!$silence) {$this->fail(50);} |
| 8078 | } |
| 8079 | choice_2: |
| 8080 | // s <- $r10 |
| 8081 | if ($r10===self::$FAILED) { |
| 8082 | $this->currPos = $p7; |
| 8083 | $r4 = self::$FAILED; |
| 8084 | goto seq_1; |
| 8085 | } |
| 8086 | $r4 = true; |
| 8087 | seq_1: |
| 8088 | if ($r4!==self::$FAILED) { |
| 8089 | $this->savedPos = $p5; |
| 8090 | $r4 = $this->a42($r10); |
| 8091 | } |
| 8092 | // free $p7 |
| 8093 | choice_1: |
| 8094 | if ($r4!==self::$FAILED) { |
| 8095 | $r3[] = $r4; |
| 8096 | } else { |
| 8097 | break; |
| 8098 | } |
| 8099 | } |
| 8100 | if (count($r3) === 0) { |
| 8101 | $r3 = self::$FAILED; |
| 8102 | } |
| 8103 | // r <- $r3 |
| 8104 | // free $r4 |
| 8105 | $r1 = $r3; |
| 8106 | if ($r1!==self::$FAILED) { |
| 8107 | $this->savedPos = $p2; |
| 8108 | $r1 = $this->a59($r3); |
| 8109 | } |
| 8110 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8111 | $this->currPos, |
| 8112 | $r1, |
| 8113 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8114 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8115 | ); |
| 8116 | return $r1; |
| 8117 | } |
| 8118 | private function parseautolink($silence, $boolParams, &$param_preproc, &$param_th) { |
| 8119 | $key = json_encode([324, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 8120 | $bucket = $this->currPos; |
| 8121 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8122 | if ($cached) { |
| 8123 | $this->currPos = $cached->nextPos; |
| 8124 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8125 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8126 | return $cached->result; |
| 8127 | } |
| 8128 | $saved_preproc=$param_preproc; |
| 8129 | $saved_th=$param_th; |
| 8130 | $p2 = $this->currPos; |
| 8131 | // start seq_1 |
| 8132 | $p3 = $this->currPos; |
| 8133 | if (!(/*extlink*/($boolParams & 0x8) !== 0)) { |
| 8134 | $r4 = false; |
| 8135 | } else { |
| 8136 | $r4 = self::$FAILED; |
| 8137 | $r1 = self::$FAILED; |
| 8138 | goto seq_1; |
| 8139 | } |
| 8140 | $this->savedPos = $this->currPos; |
| 8141 | $r5 = $this->a79(); |
| 8142 | if (!$r5) { |
| 8143 | $r5 = false; |
| 8144 | } else { |
| 8145 | $r5 = self::$FAILED; |
| 8146 | $this->currPos = $p3; |
| 8147 | $r1 = self::$FAILED; |
| 8148 | goto seq_1; |
| 8149 | } |
| 8150 | // start choice_1 |
| 8151 | $r6 = $this->parseautourl($silence, $boolParams, $param_preproc, $param_th); |
| 8152 | if ($r6!==self::$FAILED) { |
| 8153 | goto choice_1; |
| 8154 | } |
| 8155 | $r6 = $this->parseautoref($silence); |
| 8156 | if ($r6!==self::$FAILED) { |
| 8157 | goto choice_1; |
| 8158 | } |
| 8159 | $r6 = $this->parseisbn($silence); |
| 8160 | choice_1: |
| 8161 | // r <- $r6 |
| 8162 | if ($r6===self::$FAILED) { |
| 8163 | $this->currPos = $p3; |
| 8164 | $r1 = self::$FAILED; |
| 8165 | goto seq_1; |
| 8166 | } |
| 8167 | $r1 = true; |
| 8168 | seq_1: |
| 8169 | if ($r1!==self::$FAILED) { |
| 8170 | $this->savedPos = $p2; |
| 8171 | $r1 = $this->a24($r6); |
| 8172 | } |
| 8173 | // free $p3 |
| 8174 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8175 | $this->currPos, |
| 8176 | $r1, |
| 8177 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8178 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8179 | ); |
| 8180 | return $r1; |
| 8181 | } |
| 8182 | private function parsebehavior_switch($silence) { |
| 8183 | $key = 320; |
| 8184 | $bucket = $this->currPos; |
| 8185 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8186 | if ($cached) { |
| 8187 | $this->currPos = $cached->nextPos; |
| 8188 | |
| 8189 | return $cached->result; |
| 8190 | } |
| 8191 | |
| 8192 | $p2 = $this->currPos; |
| 8193 | $p4 = $this->currPos; |
| 8194 | // start seq_1 |
| 8195 | $p5 = $this->currPos; |
| 8196 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
| 8197 | $r6 = "__"; |
| 8198 | $this->currPos += 2; |
| 8199 | } else { |
| 8200 | if (!$silence) {$this->fail(53);} |
| 8201 | $r6 = self::$FAILED; |
| 8202 | $r3 = self::$FAILED; |
| 8203 | goto seq_1; |
| 8204 | } |
| 8205 | $r7 = $this->discardbehavior_text($silence); |
| 8206 | if ($r7===self::$FAILED) { |
| 8207 | $this->currPos = $p5; |
| 8208 | $r3 = self::$FAILED; |
| 8209 | goto seq_1; |
| 8210 | } |
| 8211 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) { |
| 8212 | $r8 = "__"; |
| 8213 | $this->currPos += 2; |
| 8214 | } else { |
| 8215 | if (!$silence) {$this->fail(53);} |
| 8216 | $r8 = self::$FAILED; |
| 8217 | $this->currPos = $p5; |
| 8218 | $r3 = self::$FAILED; |
| 8219 | goto seq_1; |
| 8220 | } |
| 8221 | $r3 = true; |
| 8222 | seq_1: |
| 8223 | // bs <- $r3 |
| 8224 | if ($r3!==self::$FAILED) { |
| 8225 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
| 8226 | } else { |
| 8227 | $r3 = self::$FAILED; |
| 8228 | } |
| 8229 | // free $p5 |
| 8230 | // free $p4 |
| 8231 | $r1 = $r3; |
| 8232 | if ($r1!==self::$FAILED) { |
| 8233 | $this->savedPos = $p2; |
| 8234 | $r1 = $this->a80($r3); |
| 8235 | } |
| 8236 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8237 | $this->currPos, |
| 8238 | $r1, |
| 8239 | self::$UNDEFINED, |
| 8240 | self::$UNDEFINED |
| 8241 | ); |
| 8242 | return $r1; |
| 8243 | } |
| 8244 | private function parsetext_char($silence) { |
| 8245 | $key = 492; |
| 8246 | $bucket = $this->currPos; |
| 8247 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8248 | if ($cached) { |
| 8249 | $this->currPos = $cached->nextPos; |
| 8250 | |
| 8251 | return $cached->result; |
| 8252 | } |
| 8253 | |
| 8254 | if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) { |
| 8255 | $r1 = self::consumeChar($this->input, $this->currPos); |
| 8256 | } else { |
| 8257 | $r1 = self::$FAILED; |
| 8258 | if (!$silence) {$this->fail(54);} |
| 8259 | } |
| 8260 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8261 | $this->currPos, |
| 8262 | $r1, |
| 8263 | self::$UNDEFINED, |
| 8264 | self::$UNDEFINED |
| 8265 | ); |
| 8266 | return $r1; |
| 8267 | } |
| 8268 | private function parselang_variant_or_tpl($silence, $boolParams, &$param_th, &$param_preproc) { |
| 8269 | $key = json_encode([370, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 8270 | $bucket = $this->currPos; |
| 8271 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8272 | if ($cached) { |
| 8273 | $this->currPos = $cached->nextPos; |
| 8274 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8275 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8276 | return $cached->result; |
| 8277 | } |
| 8278 | $saved_th=$param_th; |
| 8279 | $saved_preproc=$param_preproc; |
| 8280 | // start choice_1 |
| 8281 | $p2 = $this->currPos; |
| 8282 | // start seq_1 |
| 8283 | $p3 = $this->currPos; |
| 8284 | $p4 = $this->currPos; |
| 8285 | // start seq_2 |
| 8286 | $p6 = $this->currPos; |
| 8287 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
| 8288 | $r7 = "-{"; |
| 8289 | $this->currPos += 2; |
| 8290 | } else { |
| 8291 | $r7 = self::$FAILED; |
| 8292 | $r5 = self::$FAILED; |
| 8293 | goto seq_2; |
| 8294 | } |
| 8295 | $p8 = $this->currPos; |
| 8296 | // start seq_3 |
| 8297 | $p10 = $this->currPos; |
| 8298 | $r11 = self::$FAILED; |
| 8299 | for (;;) { |
| 8300 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 8301 | $r12 = "{{{"; |
| 8302 | $this->currPos += 3; |
| 8303 | $r11 = true; |
| 8304 | } else { |
| 8305 | $r12 = self::$FAILED; |
| 8306 | break; |
| 8307 | } |
| 8308 | } |
| 8309 | if ($r11===self::$FAILED) { |
| 8310 | $r9 = self::$FAILED; |
| 8311 | goto seq_3; |
| 8312 | } |
| 8313 | // free $r12 |
| 8314 | $p13 = $this->currPos; |
| 8315 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 8316 | $this->currPos++; |
| 8317 | $r12 = "{"; |
| 8318 | } else { |
| 8319 | $r12 = self::$FAILED; |
| 8320 | } |
| 8321 | if ($r12 === self::$FAILED) { |
| 8322 | $r12 = false; |
| 8323 | } else { |
| 8324 | $r12 = self::$FAILED; |
| 8325 | $this->currPos = $p13; |
| 8326 | $this->currPos = $p10; |
| 8327 | $r9 = self::$FAILED; |
| 8328 | goto seq_3; |
| 8329 | } |
| 8330 | // free $p13 |
| 8331 | $r9 = true; |
| 8332 | seq_3: |
| 8333 | if ($r9!==self::$FAILED) { |
| 8334 | $r9 = false; |
| 8335 | $this->currPos = $p8; |
| 8336 | } else { |
| 8337 | $this->currPos = $p6; |
| 8338 | $r5 = self::$FAILED; |
| 8339 | goto seq_2; |
| 8340 | } |
| 8341 | // free $p10 |
| 8342 | // free $p8 |
| 8343 | $r14 = $this->discardtplarg(true, $boolParams, $param_th); |
| 8344 | if ($r14===self::$FAILED) { |
| 8345 | $this->currPos = $p6; |
| 8346 | $r5 = self::$FAILED; |
| 8347 | goto seq_2; |
| 8348 | } |
| 8349 | $r5 = true; |
| 8350 | seq_2: |
| 8351 | if ($r5!==self::$FAILED) { |
| 8352 | $r5 = false; |
| 8353 | $this->currPos = $p4; |
| 8354 | } else { |
| 8355 | $r1 = self::$FAILED; |
| 8356 | goto seq_1; |
| 8357 | } |
| 8358 | // free $p6 |
| 8359 | // free $p4 |
| 8360 | $r15 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
| 8361 | // a <- $r15 |
| 8362 | if ($r15===self::$FAILED) { |
| 8363 | $this->currPos = $p3; |
| 8364 | $r1 = self::$FAILED; |
| 8365 | goto seq_1; |
| 8366 | } |
| 8367 | $r1 = true; |
| 8368 | seq_1: |
| 8369 | if ($r1!==self::$FAILED) { |
| 8370 | $this->savedPos = $p2; |
| 8371 | $r1 = $this->a50($r15); |
| 8372 | goto choice_1; |
| 8373 | } |
| 8374 | // free $p3 |
| 8375 | $p3 = $this->currPos; |
| 8376 | // start seq_4 |
| 8377 | $p4 = $this->currPos; |
| 8378 | $p6 = $this->currPos; |
| 8379 | // start seq_5 |
| 8380 | $p8 = $this->currPos; |
| 8381 | if (($this->input[$this->currPos] ?? null) === "-") { |
| 8382 | $this->currPos++; |
| 8383 | $r17 = "-"; |
| 8384 | } else { |
| 8385 | if (!$silence) {$this->fail(55);} |
| 8386 | $r17 = self::$FAILED; |
| 8387 | $r16 = self::$FAILED; |
| 8388 | goto seq_5; |
| 8389 | } |
| 8390 | $p10 = $this->currPos; |
| 8391 | // start seq_6 |
| 8392 | $p13 = $this->currPos; |
| 8393 | $r19 = self::$FAILED; |
| 8394 | for (;;) { |
| 8395 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 8396 | $r20 = "{{{"; |
| 8397 | $this->currPos += 3; |
| 8398 | $r19 = true; |
| 8399 | } else { |
| 8400 | $r20 = self::$FAILED; |
| 8401 | break; |
| 8402 | } |
| 8403 | } |
| 8404 | if ($r19===self::$FAILED) { |
| 8405 | $r18 = self::$FAILED; |
| 8406 | goto seq_6; |
| 8407 | } |
| 8408 | // free $r20 |
| 8409 | $p21 = $this->currPos; |
| 8410 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 8411 | $this->currPos++; |
| 8412 | $r20 = "{"; |
| 8413 | } else { |
| 8414 | $r20 = self::$FAILED; |
| 8415 | } |
| 8416 | if ($r20 === self::$FAILED) { |
| 8417 | $r20 = false; |
| 8418 | } else { |
| 8419 | $r20 = self::$FAILED; |
| 8420 | $this->currPos = $p21; |
| 8421 | $this->currPos = $p13; |
| 8422 | $r18 = self::$FAILED; |
| 8423 | goto seq_6; |
| 8424 | } |
| 8425 | // free $p21 |
| 8426 | $r18 = true; |
| 8427 | seq_6: |
| 8428 | if ($r18!==self::$FAILED) { |
| 8429 | $r18 = false; |
| 8430 | $this->currPos = $p10; |
| 8431 | } else { |
| 8432 | $this->currPos = $p8; |
| 8433 | $r16 = self::$FAILED; |
| 8434 | goto seq_5; |
| 8435 | } |
| 8436 | // free $p13 |
| 8437 | // free $p10 |
| 8438 | $r16 = true; |
| 8439 | seq_5: |
| 8440 | // a <- $r16 |
| 8441 | if ($r16!==self::$FAILED) { |
| 8442 | $r16 = substr($this->input, $p6, $this->currPos - $p6); |
| 8443 | } else { |
| 8444 | $r16 = self::$FAILED; |
| 8445 | $r1 = self::$FAILED; |
| 8446 | goto seq_4; |
| 8447 | } |
| 8448 | // free $p8 |
| 8449 | // free $p6 |
| 8450 | $r22 = $this->parsetplarg($silence, $boolParams, $param_th); |
| 8451 | // b <- $r22 |
| 8452 | if ($r22===self::$FAILED) { |
| 8453 | $this->currPos = $p4; |
| 8454 | $r1 = self::$FAILED; |
| 8455 | goto seq_4; |
| 8456 | } |
| 8457 | $r1 = true; |
| 8458 | seq_4: |
| 8459 | if ($r1!==self::$FAILED) { |
| 8460 | $this->savedPos = $p3; |
| 8461 | $r1 = $this->a51($r16, $r22); |
| 8462 | goto choice_1; |
| 8463 | } |
| 8464 | // free $p4 |
| 8465 | $p4 = $this->currPos; |
| 8466 | // start seq_7 |
| 8467 | $p6 = $this->currPos; |
| 8468 | $p8 = $this->currPos; |
| 8469 | // start seq_8 |
| 8470 | $p10 = $this->currPos; |
| 8471 | if (($this->input[$this->currPos] ?? null) === "-") { |
| 8472 | $this->currPos++; |
| 8473 | $r24 = "-"; |
| 8474 | } else { |
| 8475 | if (!$silence) {$this->fail(55);} |
| 8476 | $r24 = self::$FAILED; |
| 8477 | $r23 = self::$FAILED; |
| 8478 | goto seq_8; |
| 8479 | } |
| 8480 | $p13 = $this->currPos; |
| 8481 | // start seq_9 |
| 8482 | $p21 = $this->currPos; |
| 8483 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 8484 | $r26 = "{{"; |
| 8485 | $this->currPos += 2; |
| 8486 | } else { |
| 8487 | $r26 = self::$FAILED; |
| 8488 | $r25 = self::$FAILED; |
| 8489 | goto seq_9; |
| 8490 | } |
| 8491 | for (;;) { |
| 8492 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 8493 | $r28 = "{{{"; |
| 8494 | $this->currPos += 3; |
| 8495 | } else { |
| 8496 | $r28 = self::$FAILED; |
| 8497 | break; |
| 8498 | } |
| 8499 | } |
| 8500 | // free $r28 |
| 8501 | $r27 = true; |
| 8502 | if ($r27===self::$FAILED) { |
| 8503 | $this->currPos = $p21; |
| 8504 | $r25 = self::$FAILED; |
| 8505 | goto seq_9; |
| 8506 | } |
| 8507 | // free $r27 |
| 8508 | $p29 = $this->currPos; |
| 8509 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 8510 | $this->currPos++; |
| 8511 | $r27 = "{"; |
| 8512 | } else { |
| 8513 | $r27 = self::$FAILED; |
| 8514 | } |
| 8515 | if ($r27 === self::$FAILED) { |
| 8516 | $r27 = false; |
| 8517 | } else { |
| 8518 | $r27 = self::$FAILED; |
| 8519 | $this->currPos = $p29; |
| 8520 | $this->currPos = $p21; |
| 8521 | $r25 = self::$FAILED; |
| 8522 | goto seq_9; |
| 8523 | } |
| 8524 | // free $p29 |
| 8525 | $r25 = true; |
| 8526 | seq_9: |
| 8527 | if ($r25!==self::$FAILED) { |
| 8528 | $r25 = false; |
| 8529 | $this->currPos = $p13; |
| 8530 | } else { |
| 8531 | $this->currPos = $p10; |
| 8532 | $r23 = self::$FAILED; |
| 8533 | goto seq_8; |
| 8534 | } |
| 8535 | // free $p21 |
| 8536 | // free $p13 |
| 8537 | $r23 = true; |
| 8538 | seq_8: |
| 8539 | // a <- $r23 |
| 8540 | if ($r23!==self::$FAILED) { |
| 8541 | $r23 = substr($this->input, $p8, $this->currPos - $p8); |
| 8542 | } else { |
| 8543 | $r23 = self::$FAILED; |
| 8544 | $r1 = self::$FAILED; |
| 8545 | goto seq_7; |
| 8546 | } |
| 8547 | // free $p10 |
| 8548 | // free $p8 |
| 8549 | $r28 = $this->parsetemplate($silence, $boolParams, $param_th); |
| 8550 | // b <- $r28 |
| 8551 | if ($r28===self::$FAILED) { |
| 8552 | $this->currPos = $p6; |
| 8553 | $r1 = self::$FAILED; |
| 8554 | goto seq_7; |
| 8555 | } |
| 8556 | $r1 = true; |
| 8557 | seq_7: |
| 8558 | if ($r1!==self::$FAILED) { |
| 8559 | $this->savedPos = $p4; |
| 8560 | $r1 = $this->a51($r23, $r28); |
| 8561 | goto choice_1; |
| 8562 | } |
| 8563 | // free $p6 |
| 8564 | $p6 = $this->currPos; |
| 8565 | // start seq_10 |
| 8566 | $p8 = $this->currPos; |
| 8567 | $p10 = $this->currPos; |
| 8568 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) { |
| 8569 | $r30 = "-{"; |
| 8570 | $this->currPos += 2; |
| 8571 | $r30 = false; |
| 8572 | $this->currPos = $p10; |
| 8573 | } else { |
| 8574 | $r30 = self::$FAILED; |
| 8575 | $r1 = self::$FAILED; |
| 8576 | goto seq_10; |
| 8577 | } |
| 8578 | // free $p10 |
| 8579 | $r31 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc); |
| 8580 | // a <- $r31 |
| 8581 | if ($r31===self::$FAILED) { |
| 8582 | $this->currPos = $p8; |
| 8583 | $r1 = self::$FAILED; |
| 8584 | goto seq_10; |
| 8585 | } |
| 8586 | $r1 = true; |
| 8587 | seq_10: |
| 8588 | if ($r1!==self::$FAILED) { |
| 8589 | $this->savedPos = $p6; |
| 8590 | $r1 = $this->a50($r31); |
| 8591 | } |
| 8592 | // free $p8 |
| 8593 | choice_1: |
| 8594 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8595 | $this->currPos, |
| 8596 | $r1, |
| 8597 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8598 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8599 | ); |
| 8600 | return $r1; |
| 8601 | } |
| 8602 | private function parsewikilink($silence, $boolParams, &$param_th, &$param_preproc) { |
| 8603 | $key = json_encode([402, $boolParams & 0x3fff, $param_th, $param_preproc]); |
| 8604 | $bucket = $this->currPos; |
| 8605 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8606 | if ($cached) { |
| 8607 | $this->currPos = $cached->nextPos; |
| 8608 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8609 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8610 | return $cached->result; |
| 8611 | } |
| 8612 | $saved_th=$param_th; |
| 8613 | $saved_preproc=$param_preproc; |
| 8614 | // start choice_1 |
| 8615 | $r1 = $this->parsewikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th); |
| 8616 | if ($r1!==self::$FAILED) { |
| 8617 | goto choice_1; |
| 8618 | } |
| 8619 | $r1 = $this->parsebroken_wikilink($silence, $boolParams, $param_preproc, $param_th); |
| 8620 | choice_1: |
| 8621 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8622 | $this->currPos, |
| 8623 | $r1, |
| 8624 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8625 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8626 | ); |
| 8627 | return $r1; |
| 8628 | } |
| 8629 | private function parsequote($silence) { |
| 8630 | $key = 412; |
| 8631 | $bucket = $this->currPos; |
| 8632 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8633 | if ($cached) { |
| 8634 | $this->currPos = $cached->nextPos; |
| 8635 | |
| 8636 | return $cached->result; |
| 8637 | } |
| 8638 | |
| 8639 | $p2 = $this->currPos; |
| 8640 | $p4 = $this->currPos; |
| 8641 | // start seq_1 |
| 8642 | $p5 = $this->currPos; |
| 8643 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "''", $this->currPos, 2, false) === 0) { |
| 8644 | $r6 = "''"; |
| 8645 | $this->currPos += 2; |
| 8646 | } else { |
| 8647 | if (!$silence) {$this->fail(56);} |
| 8648 | $r6 = self::$FAILED; |
| 8649 | $r3 = self::$FAILED; |
| 8650 | goto seq_1; |
| 8651 | } |
| 8652 | for (;;) { |
| 8653 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 8654 | $this->currPos++; |
| 8655 | $r8 = "'"; |
| 8656 | } else { |
| 8657 | if (!$silence) {$this->fail(33);} |
| 8658 | $r8 = self::$FAILED; |
| 8659 | break; |
| 8660 | } |
| 8661 | } |
| 8662 | // free $r8 |
| 8663 | $r7 = true; |
| 8664 | if ($r7===self::$FAILED) { |
| 8665 | $this->currPos = $p5; |
| 8666 | $r3 = self::$FAILED; |
| 8667 | goto seq_1; |
| 8668 | } |
| 8669 | // free $r7 |
| 8670 | $r3 = true; |
| 8671 | seq_1: |
| 8672 | // quotes <- $r3 |
| 8673 | if ($r3!==self::$FAILED) { |
| 8674 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
| 8675 | } else { |
| 8676 | $r3 = self::$FAILED; |
| 8677 | } |
| 8678 | // free $p5 |
| 8679 | // free $p4 |
| 8680 | $r1 = $r3; |
| 8681 | if ($r1!==self::$FAILED) { |
| 8682 | $this->savedPos = $p2; |
| 8683 | $r1 = $this->a81($r3); |
| 8684 | } |
| 8685 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8686 | $this->currPos, |
| 8687 | $r1, |
| 8688 | self::$UNDEFINED, |
| 8689 | self::$UNDEFINED |
| 8690 | ); |
| 8691 | return $r1; |
| 8692 | } |
| 8693 | private function parseinlineline_break_on_colon($silence, $boolParams, &$param_preproc, &$param_th) { |
| 8694 | $key = json_encode([458, $boolParams & 0x2fff, $param_preproc, $param_th]); |
| 8695 | $bucket = $this->currPos; |
| 8696 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8697 | if ($cached) { |
| 8698 | $this->currPos = $cached->nextPos; |
| 8699 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8700 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8701 | return $cached->result; |
| 8702 | } |
| 8703 | $saved_preproc=$param_preproc; |
| 8704 | $saved_th=$param_th; |
| 8705 | $r1 = $this->parseinlineline($silence, $boolParams | 0x1000, $param_preproc, $param_th); |
| 8706 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8707 | $this->currPos, |
| 8708 | $r1, |
| 8709 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8710 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8711 | ); |
| 8712 | return $r1; |
| 8713 | } |
| 8714 | private function parsetable_content_line($silence, $boolParams, &$param_preproc, &$param_th) { |
| 8715 | $key = json_encode([466, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 8716 | $bucket = $this->currPos; |
| 8717 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8718 | if ($cached) { |
| 8719 | $this->currPos = $cached->nextPos; |
| 8720 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 8721 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 8722 | return $cached->result; |
| 8723 | } |
| 8724 | $saved_preproc=$param_preproc; |
| 8725 | $saved_th=$param_th; |
| 8726 | // start seq_1 |
| 8727 | $p1 = $this->currPos; |
| 8728 | $r3 = []; |
| 8729 | for (;;) { |
| 8730 | // start choice_1 |
| 8731 | $r4 = $this->parsespace($silence); |
| 8732 | if ($r4!==self::$FAILED) { |
| 8733 | goto choice_1; |
| 8734 | } |
| 8735 | $r4 = $this->parsecomment($silence); |
| 8736 | choice_1: |
| 8737 | if ($r4!==self::$FAILED) { |
| 8738 | $r3[] = $r4; |
| 8739 | } else { |
| 8740 | break; |
| 8741 | } |
| 8742 | } |
| 8743 | // free $r4 |
| 8744 | // start choice_2 |
| 8745 | $r4 = $this->parsetable_heading_tags($silence, $boolParams, $param_preproc); |
| 8746 | if ($r4!==self::$FAILED) { |
| 8747 | goto choice_2; |
| 8748 | } |
| 8749 | $r4 = $this->parsetable_row_tag($silence, $boolParams, $param_preproc, $param_th); |
| 8750 | if ($r4!==self::$FAILED) { |
| 8751 | goto choice_2; |
| 8752 | } |
| 8753 | $r4 = $this->parsetable_data_tags($silence, $boolParams, $param_preproc, $param_th); |
| 8754 | if ($r4!==self::$FAILED) { |
| 8755 | goto choice_2; |
| 8756 | } |
| 8757 | $r4 = $this->parsetable_caption_tag($silence, $boolParams, $param_preproc, $param_th); |
| 8758 | choice_2: |
| 8759 | if ($r4===self::$FAILED) { |
| 8760 | $this->currPos = $p1; |
| 8761 | $r2 = self::$FAILED; |
| 8762 | goto seq_1; |
| 8763 | } |
| 8764 | $r2 = [$r3,$r4]; |
| 8765 | seq_1: |
| 8766 | // free $r2,$p1 |
| 8767 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8768 | $this->currPos, |
| 8769 | $r2, |
| 8770 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 8771 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 8772 | ); |
| 8773 | return $r2; |
| 8774 | } |
| 8775 | private function parsetable_end_tag($silence) { |
| 8776 | $key = 488; |
| 8777 | $bucket = $this->currPos; |
| 8778 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8779 | if ($cached) { |
| 8780 | $this->currPos = $cached->nextPos; |
| 8781 | |
| 8782 | return $cached->result; |
| 8783 | } |
| 8784 | |
| 8785 | $p2 = $this->currPos; |
| 8786 | // start seq_1 |
| 8787 | $p3 = $this->currPos; |
| 8788 | $r4 = []; |
| 8789 | for (;;) { |
| 8790 | // start choice_1 |
| 8791 | $r5 = $this->parsespace($silence); |
| 8792 | if ($r5!==self::$FAILED) { |
| 8793 | goto choice_1; |
| 8794 | } |
| 8795 | $r5 = $this->parsecomment($silence); |
| 8796 | choice_1: |
| 8797 | if ($r5!==self::$FAILED) { |
| 8798 | $r4[] = $r5; |
| 8799 | } else { |
| 8800 | break; |
| 8801 | } |
| 8802 | } |
| 8803 | // sc <- $r4 |
| 8804 | // free $r5 |
| 8805 | $p6 = $this->currPos; |
| 8806 | $r5 = ''; |
| 8807 | // startPos <- $r5 |
| 8808 | if ($r5!==self::$FAILED) { |
| 8809 | $this->savedPos = $p6; |
| 8810 | $r5 = $this->a5($r4); |
| 8811 | } else { |
| 8812 | $this->currPos = $p3; |
| 8813 | $r1 = self::$FAILED; |
| 8814 | goto seq_1; |
| 8815 | } |
| 8816 | $r7 = $this->parsepipe($silence); |
| 8817 | // p <- $r7 |
| 8818 | if ($r7===self::$FAILED) { |
| 8819 | $this->currPos = $p3; |
| 8820 | $r1 = self::$FAILED; |
| 8821 | goto seq_1; |
| 8822 | } |
| 8823 | // b <- $r8 |
| 8824 | if (($this->input[$this->currPos] ?? null) === "}") { |
| 8825 | $this->currPos++; |
| 8826 | $r8 = "}"; |
| 8827 | } else { |
| 8828 | if (!$silence) {$this->fail(57);} |
| 8829 | $r8 = self::$FAILED; |
| 8830 | $this->currPos = $p3; |
| 8831 | $r1 = self::$FAILED; |
| 8832 | goto seq_1; |
| 8833 | } |
| 8834 | $r1 = true; |
| 8835 | seq_1: |
| 8836 | if ($r1!==self::$FAILED) { |
| 8837 | $this->savedPos = $p2; |
| 8838 | $r1 = $this->a82($r4, $r5, $r7, $r8); |
| 8839 | } |
| 8840 | // free $p3 |
| 8841 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8842 | $this->currPos, |
| 8843 | $r1, |
| 8844 | self::$UNDEFINED, |
| 8845 | self::$UNDEFINED |
| 8846 | ); |
| 8847 | return $r1; |
| 8848 | } |
| 8849 | private function parseempty_line_with_comments($silence) { |
| 8850 | $key = 562; |
| 8851 | $bucket = $this->currPos; |
| 8852 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8853 | if ($cached) { |
| 8854 | $this->currPos = $cached->nextPos; |
| 8855 | |
| 8856 | return $cached->result; |
| 8857 | } |
| 8858 | |
| 8859 | $p2 = $this->currPos; |
| 8860 | // start seq_1 |
| 8861 | $p3 = $this->currPos; |
| 8862 | $r4 = $this->parsesol_prefix($silence); |
| 8863 | // sp <- $r4 |
| 8864 | if ($r4===self::$FAILED) { |
| 8865 | $r1 = self::$FAILED; |
| 8866 | goto seq_1; |
| 8867 | } |
| 8868 | $p6 = $this->currPos; |
| 8869 | $r5 = ''; |
| 8870 | // p <- $r5 |
| 8871 | if ($r5!==self::$FAILED) { |
| 8872 | $this->savedPos = $p6; |
| 8873 | $r5 = $this->a83($r4); |
| 8874 | } else { |
| 8875 | $this->currPos = $p3; |
| 8876 | $r1 = self::$FAILED; |
| 8877 | goto seq_1; |
| 8878 | } |
| 8879 | $r7 = []; |
| 8880 | for (;;) { |
| 8881 | // start seq_2 |
| 8882 | $p9 = $this->currPos; |
| 8883 | $r10 = []; |
| 8884 | for (;;) { |
| 8885 | $r11 = $this->parsespace($silence); |
| 8886 | if ($r11!==self::$FAILED) { |
| 8887 | $r10[] = $r11; |
| 8888 | } else { |
| 8889 | break; |
| 8890 | } |
| 8891 | } |
| 8892 | // free $r11 |
| 8893 | $r11 = $this->parsecomment($silence); |
| 8894 | if ($r11===self::$FAILED) { |
| 8895 | $this->currPos = $p9; |
| 8896 | $r8 = self::$FAILED; |
| 8897 | goto seq_2; |
| 8898 | } |
| 8899 | $r12 = []; |
| 8900 | for (;;) { |
| 8901 | // start choice_1 |
| 8902 | $r13 = $this->parsespace($silence); |
| 8903 | if ($r13!==self::$FAILED) { |
| 8904 | goto choice_1; |
| 8905 | } |
| 8906 | $r13 = $this->parsecomment($silence); |
| 8907 | choice_1: |
| 8908 | if ($r13!==self::$FAILED) { |
| 8909 | $r12[] = $r13; |
| 8910 | } else { |
| 8911 | break; |
| 8912 | } |
| 8913 | } |
| 8914 | // free $r13 |
| 8915 | $r13 = $this->parsenewline($silence); |
| 8916 | if ($r13===self::$FAILED) { |
| 8917 | $this->currPos = $p9; |
| 8918 | $r8 = self::$FAILED; |
| 8919 | goto seq_2; |
| 8920 | } |
| 8921 | $r8 = [$r10,$r11,$r12,$r13]; |
| 8922 | seq_2: |
| 8923 | if ($r8!==self::$FAILED) { |
| 8924 | $r7[] = $r8; |
| 8925 | } else { |
| 8926 | break; |
| 8927 | } |
| 8928 | // free $p9 |
| 8929 | } |
| 8930 | if (count($r7) === 0) { |
| 8931 | $r7 = self::$FAILED; |
| 8932 | } |
| 8933 | // c <- $r7 |
| 8934 | if ($r7===self::$FAILED) { |
| 8935 | $this->currPos = $p3; |
| 8936 | $r1 = self::$FAILED; |
| 8937 | goto seq_1; |
| 8938 | } |
| 8939 | // free $r8 |
| 8940 | $r1 = true; |
| 8941 | seq_1: |
| 8942 | if ($r1!==self::$FAILED) { |
| 8943 | $this->savedPos = $p2; |
| 8944 | $r1 = $this->a84($r4, $r5, $r7); |
| 8945 | } |
| 8946 | // free $p3 |
| 8947 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8948 | $this->currPos, |
| 8949 | $r1, |
| 8950 | self::$UNDEFINED, |
| 8951 | self::$UNDEFINED |
| 8952 | ); |
| 8953 | return $r1; |
| 8954 | } |
| 8955 | private function parsesol_prefix($silence) { |
| 8956 | $key = 560; |
| 8957 | $bucket = $this->currPos; |
| 8958 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8959 | if ($cached) { |
| 8960 | $this->currPos = $cached->nextPos; |
| 8961 | |
| 8962 | return $cached->result; |
| 8963 | } |
| 8964 | |
| 8965 | // start choice_1 |
| 8966 | $r1 = $this->parsenewlineToken($silence); |
| 8967 | if ($r1!==self::$FAILED) { |
| 8968 | goto choice_1; |
| 8969 | } |
| 8970 | $p2 = $this->currPos; |
| 8971 | $this->savedPos = $this->currPos; |
| 8972 | $r1 = $this->a85(); |
| 8973 | if ($r1) { |
| 8974 | $r1 = false; |
| 8975 | $this->savedPos = $p2; |
| 8976 | $r1 = $this->a86(); |
| 8977 | } else { |
| 8978 | $r1 = self::$FAILED; |
| 8979 | } |
| 8980 | choice_1: |
| 8981 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 8982 | $this->currPos, |
| 8983 | $r1, |
| 8984 | self::$UNDEFINED, |
| 8985 | self::$UNDEFINED |
| 8986 | ); |
| 8987 | return $r1; |
| 8988 | } |
| 8989 | private function parseredirect_word($silence) { |
| 8990 | $key = 294; |
| 8991 | $bucket = $this->currPos; |
| 8992 | $cached = $this->cache[$bucket][$key] ?? null; |
| 8993 | if ($cached) { |
| 8994 | $this->currPos = $cached->nextPos; |
| 8995 | |
| 8996 | return $cached->result; |
| 8997 | } |
| 8998 | |
| 8999 | $p1 = $this->currPos; |
| 9000 | // start seq_1 |
| 9001 | $p3 = $this->currPos; |
| 9002 | for (;;) { |
| 9003 | if (strspn($this->input, " \x09\x0a\x0d\x00\x0b", $this->currPos, 1) !== 0) { |
| 9004 | $r5 = $this->input[$this->currPos++]; |
| 9005 | } else { |
| 9006 | $r5 = self::$FAILED; |
| 9007 | if (!$silence) {$this->fail(58);} |
| 9008 | break; |
| 9009 | } |
| 9010 | } |
| 9011 | // free $r5 |
| 9012 | $r4 = true; |
| 9013 | if ($r4===self::$FAILED) { |
| 9014 | $r2 = self::$FAILED; |
| 9015 | goto seq_1; |
| 9016 | } |
| 9017 | // free $r4 |
| 9018 | $p6 = $this->currPos; |
| 9019 | $r4 = self::$FAILED; |
| 9020 | for (;;) { |
| 9021 | // start seq_2 |
| 9022 | $p7 = $this->currPos; |
| 9023 | $p8 = $this->currPos; |
| 9024 | $r9 = $this->discardspace_or_newline(true); |
| 9025 | if ($r9 === self::$FAILED) { |
| 9026 | $r9 = false; |
| 9027 | } else { |
| 9028 | $r9 = self::$FAILED; |
| 9029 | $this->currPos = $p8; |
| 9030 | $r5 = self::$FAILED; |
| 9031 | goto seq_2; |
| 9032 | } |
| 9033 | // free $p8 |
| 9034 | $p8 = $this->currPos; |
| 9035 | $r10 = $this->input[$this->currPos] ?? ''; |
| 9036 | if ($r10 === ":" || $r10 === "[") { |
| 9037 | $this->currPos++; |
| 9038 | } else { |
| 9039 | $r10 = self::$FAILED; |
| 9040 | } |
| 9041 | if ($r10 === self::$FAILED) { |
| 9042 | $r10 = false; |
| 9043 | } else { |
| 9044 | $r10 = self::$FAILED; |
| 9045 | $this->currPos = $p8; |
| 9046 | $this->currPos = $p7; |
| 9047 | $r5 = self::$FAILED; |
| 9048 | goto seq_2; |
| 9049 | } |
| 9050 | // free $p8 |
| 9051 | if ($this->currPos < $this->inputLength) { |
| 9052 | $r11 = self::consumeChar($this->input, $this->currPos);; |
| 9053 | } else { |
| 9054 | $r11 = self::$FAILED; |
| 9055 | if (!$silence) {$this->fail(7);} |
| 9056 | $this->currPos = $p7; |
| 9057 | $r5 = self::$FAILED; |
| 9058 | goto seq_2; |
| 9059 | } |
| 9060 | $r5 = true; |
| 9061 | seq_2: |
| 9062 | if ($r5!==self::$FAILED) { |
| 9063 | $r4 = true; |
| 9064 | } else { |
| 9065 | break; |
| 9066 | } |
| 9067 | // free $p7 |
| 9068 | } |
| 9069 | // rw <- $r4 |
| 9070 | if ($r4!==self::$FAILED) { |
| 9071 | $r4 = substr($this->input, $p6, $this->currPos - $p6); |
| 9072 | } else { |
| 9073 | $r4 = self::$FAILED; |
| 9074 | $this->currPos = $p3; |
| 9075 | $r2 = self::$FAILED; |
| 9076 | goto seq_1; |
| 9077 | } |
| 9078 | // free $r5 |
| 9079 | // free $p6 |
| 9080 | $this->savedPos = $this->currPos; |
| 9081 | $r5 = $this->a87($r4); |
| 9082 | if ($r5) { |
| 9083 | $r5 = false; |
| 9084 | } else { |
| 9085 | $r5 = self::$FAILED; |
| 9086 | $this->currPos = $p3; |
| 9087 | $r2 = self::$FAILED; |
| 9088 | goto seq_1; |
| 9089 | } |
| 9090 | $r2 = true; |
| 9091 | seq_1: |
| 9092 | if ($r2!==self::$FAILED) { |
| 9093 | $r2 = substr($this->input, $p1, $this->currPos - $p1); |
| 9094 | } else { |
| 9095 | $r2 = self::$FAILED; |
| 9096 | } |
| 9097 | // free $p3 |
| 9098 | // free $p1 |
| 9099 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9100 | $this->currPos, |
| 9101 | $r2, |
| 9102 | self::$UNDEFINED, |
| 9103 | self::$UNDEFINED |
| 9104 | ); |
| 9105 | return $r2; |
| 9106 | } |
| 9107 | private function parseinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9108 | $key = json_encode([500, $boolParams & 0x3ebd, $param_preproc, $param_th]); |
| 9109 | $bucket = $this->currPos; |
| 9110 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9111 | if ($cached) { |
| 9112 | $this->currPos = $cached->nextPos; |
| 9113 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9114 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9115 | return $cached->result; |
| 9116 | } |
| 9117 | $saved_preproc=$param_preproc; |
| 9118 | $saved_th=$param_th; |
| 9119 | $p2 = $this->currPos; |
| 9120 | // start seq_1 |
| 9121 | $p3 = $this->currPos; |
| 9122 | $p4 = $this->currPos; |
| 9123 | // start seq_2 |
| 9124 | $p6 = $this->currPos; |
| 9125 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 9126 | $this->currPos++; |
| 9127 | $r7 = "<"; |
| 9128 | } else { |
| 9129 | $r7 = self::$FAILED; |
| 9130 | $r5 = self::$FAILED; |
| 9131 | goto seq_2; |
| 9132 | } |
| 9133 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 9134 | $this->currPos++; |
| 9135 | $r8 = "/"; |
| 9136 | } else { |
| 9137 | $r8 = self::$FAILED; |
| 9138 | $r8 = null; |
| 9139 | } |
| 9140 | // start choice_1 |
| 9141 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "includeonly", $this->currPos, 11, true) === 0) { |
| 9142 | $r9 = substr($this->input, $this->currPos, 11); |
| 9143 | $this->currPos += 11; |
| 9144 | goto choice_1; |
| 9145 | } else { |
| 9146 | $r9 = self::$FAILED; |
| 9147 | } |
| 9148 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "noinclude", $this->currPos, 9, true) === 0) { |
| 9149 | $r9 = substr($this->input, $this->currPos, 9); |
| 9150 | $this->currPos += 9; |
| 9151 | goto choice_1; |
| 9152 | } else { |
| 9153 | $r9 = self::$FAILED; |
| 9154 | } |
| 9155 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "onlyinclude", $this->currPos, 11, true) === 0) { |
| 9156 | $r9 = substr($this->input, $this->currPos, 11); |
| 9157 | $this->currPos += 11; |
| 9158 | } else { |
| 9159 | $r9 = self::$FAILED; |
| 9160 | } |
| 9161 | choice_1: |
| 9162 | if ($r9===self::$FAILED) { |
| 9163 | $this->currPos = $p6; |
| 9164 | $r5 = self::$FAILED; |
| 9165 | goto seq_2; |
| 9166 | } |
| 9167 | $r5 = true; |
| 9168 | seq_2: |
| 9169 | if ($r5!==self::$FAILED) { |
| 9170 | $r5 = false; |
| 9171 | $this->currPos = $p4; |
| 9172 | } else { |
| 9173 | $r1 = self::$FAILED; |
| 9174 | goto seq_1; |
| 9175 | } |
| 9176 | // free $p6 |
| 9177 | // free $p4 |
| 9178 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 9179 | $this->currPos++; |
| 9180 | $r10 = "<"; |
| 9181 | } else { |
| 9182 | if (!$silence) {$this->fail(44);} |
| 9183 | $r10 = self::$FAILED; |
| 9184 | $this->currPos = $p3; |
| 9185 | $r1 = self::$FAILED; |
| 9186 | goto seq_1; |
| 9187 | } |
| 9188 | $r11 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
| 9189 | // il <- $r11 |
| 9190 | if ($r11===self::$FAILED) { |
| 9191 | $this->currPos = $p3; |
| 9192 | $r1 = self::$FAILED; |
| 9193 | goto seq_1; |
| 9194 | } |
| 9195 | $this->savedPos = $this->currPos; |
| 9196 | $r12 = $this->a88($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
| 9197 | if ($r12) { |
| 9198 | $r12 = false; |
| 9199 | } else { |
| 9200 | $r12 = self::$FAILED; |
| 9201 | $this->currPos = $p3; |
| 9202 | $r1 = self::$FAILED; |
| 9203 | goto seq_1; |
| 9204 | } |
| 9205 | $r1 = true; |
| 9206 | seq_1: |
| 9207 | if ($r1!==self::$FAILED) { |
| 9208 | $this->savedPos = $p2; |
| 9209 | $r1 = $this->a89($r11, /*sol_il*/($boolParams & 0x2000) !== 0); |
| 9210 | } |
| 9211 | // free $p3 |
| 9212 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9213 | $this->currPos, |
| 9214 | $r1, |
| 9215 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 9216 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 9217 | ); |
| 9218 | return $r1; |
| 9219 | } |
| 9220 | private function parseannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9221 | $key = json_encode([416, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 9222 | $bucket = $this->currPos; |
| 9223 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9224 | if ($cached) { |
| 9225 | $this->currPos = $cached->nextPos; |
| 9226 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9227 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9228 | return $cached->result; |
| 9229 | } |
| 9230 | $saved_preproc=$param_preproc; |
| 9231 | $saved_th=$param_th; |
| 9232 | $p2 = $this->currPos; |
| 9233 | // start seq_1 |
| 9234 | $p3 = $this->currPos; |
| 9235 | $r4 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th); |
| 9236 | // annToken <- $r4 |
| 9237 | if ($r4===self::$FAILED) { |
| 9238 | $r1 = self::$FAILED; |
| 9239 | goto seq_1; |
| 9240 | } |
| 9241 | $this->savedPos = $this->currPos; |
| 9242 | $r5 = $this->a90($r4); |
| 9243 | if ($r5) { |
| 9244 | $r5 = false; |
| 9245 | } else { |
| 9246 | $r5 = self::$FAILED; |
| 9247 | $this->currPos = $p3; |
| 9248 | $r1 = self::$FAILED; |
| 9249 | goto seq_1; |
| 9250 | } |
| 9251 | $r1 = true; |
| 9252 | seq_1: |
| 9253 | if ($r1!==self::$FAILED) { |
| 9254 | $this->savedPos = $p2; |
| 9255 | $r1 = $this->a91($r4); |
| 9256 | } |
| 9257 | // free $p3 |
| 9258 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9259 | $this->currPos, |
| 9260 | $r1, |
| 9261 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 9262 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 9263 | ); |
| 9264 | return $r1; |
| 9265 | } |
| 9266 | private function parseheading($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9267 | $key = json_encode([318, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 9268 | $bucket = $this->currPos; |
| 9269 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9270 | if ($cached) { |
| 9271 | $this->currPos = $cached->nextPos; |
| 9272 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9273 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9274 | return $cached->result; |
| 9275 | } |
| 9276 | $saved_preproc=$param_preproc; |
| 9277 | $saved_th=$param_th; |
| 9278 | $p2 = $this->currPos; |
| 9279 | // start seq_1 |
| 9280 | $p3 = $this->currPos; |
| 9281 | $p4 = $this->currPos; |
| 9282 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 9283 | $this->currPos++; |
| 9284 | $r5 = "="; |
| 9285 | $r5 = false; |
| 9286 | $this->currPos = $p4; |
| 9287 | } else { |
| 9288 | $r5 = self::$FAILED; |
| 9289 | $r1 = self::$FAILED; |
| 9290 | goto seq_1; |
| 9291 | } |
| 9292 | // free $p4 |
| 9293 | $p4 = $this->currPos; |
| 9294 | // start seq_2 |
| 9295 | $p7 = $this->currPos; |
| 9296 | $p9 = $this->currPos; |
| 9297 | $r8 = self::$FAILED; |
| 9298 | for (;;) { |
| 9299 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 9300 | $this->currPos++; |
| 9301 | $r10 = "="; |
| 9302 | $r8 = true; |
| 9303 | } else { |
| 9304 | if (!$silence) {$this->fail(23);} |
| 9305 | $r10 = self::$FAILED; |
| 9306 | break; |
| 9307 | } |
| 9308 | } |
| 9309 | // s <- $r8 |
| 9310 | if ($r8!==self::$FAILED) { |
| 9311 | $r8 = substr($this->input, $p9, $this->currPos - $p9); |
| 9312 | } else { |
| 9313 | $r8 = self::$FAILED; |
| 9314 | $r6 = self::$FAILED; |
| 9315 | goto seq_2; |
| 9316 | } |
| 9317 | // free $r10 |
| 9318 | // free $p9 |
| 9319 | // start seq_3 |
| 9320 | $p9 = $this->currPos; |
| 9321 | $p12 = $this->currPos; |
| 9322 | $r13 = $this->parseinlineline($silence, $boolParams | 0x4, $param_preproc, $param_th); |
| 9323 | if ($r13===self::$FAILED) { |
| 9324 | $r13 = null; |
| 9325 | } |
| 9326 | // ill <- $r13 |
| 9327 | $r11 = $r13; |
| 9328 | if ($r11!==self::$FAILED) { |
| 9329 | $this->savedPos = $p12; |
| 9330 | $r11 = $this->a92($r8, $r13); |
| 9331 | } else { |
| 9332 | $r10 = self::$FAILED; |
| 9333 | goto seq_3; |
| 9334 | } |
| 9335 | $p14 = $this->currPos; |
| 9336 | $r15 = self::$FAILED; |
| 9337 | for (;;) { |
| 9338 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 9339 | $this->currPos++; |
| 9340 | $r16 = "="; |
| 9341 | $r15 = true; |
| 9342 | } else { |
| 9343 | if (!$silence) {$this->fail(23);} |
| 9344 | $r16 = self::$FAILED; |
| 9345 | break; |
| 9346 | } |
| 9347 | } |
| 9348 | if ($r15!==self::$FAILED) { |
| 9349 | $r15 = substr($this->input, $p14, $this->currPos - $p14); |
| 9350 | } else { |
| 9351 | $r15 = self::$FAILED; |
| 9352 | $this->currPos = $p9; |
| 9353 | $r10 = self::$FAILED; |
| 9354 | goto seq_3; |
| 9355 | } |
| 9356 | // free $r16 |
| 9357 | // free $p14 |
| 9358 | $r10 = [$r11,$r15]; |
| 9359 | seq_3: |
| 9360 | if ($r10===self::$FAILED) { |
| 9361 | $r10 = null; |
| 9362 | } |
| 9363 | // free $p9 |
| 9364 | // ce <- $r10 |
| 9365 | $this->savedPos = $this->currPos; |
| 9366 | $r16 = $this->a93($r8, $r10); |
| 9367 | if ($r16) { |
| 9368 | $r16 = false; |
| 9369 | } else { |
| 9370 | $r16 = self::$FAILED; |
| 9371 | $this->currPos = $p7; |
| 9372 | $r6 = self::$FAILED; |
| 9373 | goto seq_2; |
| 9374 | } |
| 9375 | $p9 = $this->currPos; |
| 9376 | $r17 = ''; |
| 9377 | // endTPos <- $r17 |
| 9378 | if ($r17!==self::$FAILED) { |
| 9379 | $this->savedPos = $p9; |
| 9380 | $r17 = $this->a94($r8, $r10); |
| 9381 | } else { |
| 9382 | $this->currPos = $p7; |
| 9383 | $r6 = self::$FAILED; |
| 9384 | goto seq_2; |
| 9385 | } |
| 9386 | $r18 = []; |
| 9387 | for (;;) { |
| 9388 | // start choice_1 |
| 9389 | $r19 = $this->parsespace($silence); |
| 9390 | if ($r19!==self::$FAILED) { |
| 9391 | goto choice_1; |
| 9392 | } |
| 9393 | $r19 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th); |
| 9394 | choice_1: |
| 9395 | if ($r19!==self::$FAILED) { |
| 9396 | $r18[] = $r19; |
| 9397 | } else { |
| 9398 | break; |
| 9399 | } |
| 9400 | } |
| 9401 | // spc <- $r18 |
| 9402 | // free $r19 |
| 9403 | $p14 = $this->currPos; |
| 9404 | $r19 = $this->discardeolf(true); |
| 9405 | if ($r19!==self::$FAILED) { |
| 9406 | $r19 = false; |
| 9407 | $this->currPos = $p14; |
| 9408 | } else { |
| 9409 | $this->currPos = $p7; |
| 9410 | $r6 = self::$FAILED; |
| 9411 | goto seq_2; |
| 9412 | } |
| 9413 | // free $p14 |
| 9414 | $r6 = true; |
| 9415 | seq_2: |
| 9416 | // r <- $r6 |
| 9417 | if ($r6!==self::$FAILED) { |
| 9418 | $this->savedPos = $p4; |
| 9419 | $r6 = $this->a95($r8, $r10, $r17, $r18); |
| 9420 | } else { |
| 9421 | $this->currPos = $p3; |
| 9422 | $r1 = self::$FAILED; |
| 9423 | goto seq_1; |
| 9424 | } |
| 9425 | // free $p7 |
| 9426 | $r1 = true; |
| 9427 | seq_1: |
| 9428 | if ($r1!==self::$FAILED) { |
| 9429 | $this->savedPos = $p2; |
| 9430 | $r1 = $this->a24($r6); |
| 9431 | } |
| 9432 | // free $p3 |
| 9433 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9434 | $this->currPos, |
| 9435 | $r1, |
| 9436 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 9437 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 9438 | ); |
| 9439 | return $r1; |
| 9440 | } |
| 9441 | private function parsehr($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9442 | $key = json_encode([304, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 9443 | $bucket = $this->currPos; |
| 9444 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9445 | if ($cached) { |
| 9446 | $this->currPos = $cached->nextPos; |
| 9447 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9448 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9449 | return $cached->result; |
| 9450 | } |
| 9451 | $saved_preproc=$param_preproc; |
| 9452 | $saved_th=$param_th; |
| 9453 | $p2 = $this->currPos; |
| 9454 | // start seq_1 |
| 9455 | $p3 = $this->currPos; |
| 9456 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "----", $this->currPos, 4, false) === 0) { |
| 9457 | $r4 = "----"; |
| 9458 | $this->currPos += 4; |
| 9459 | } else { |
| 9460 | if (!$silence) {$this->fail(59);} |
| 9461 | $r4 = self::$FAILED; |
| 9462 | $r1 = self::$FAILED; |
| 9463 | goto seq_1; |
| 9464 | } |
| 9465 | $p6 = $this->currPos; |
| 9466 | for (;;) { |
| 9467 | if (($this->input[$this->currPos] ?? null) === "-") { |
| 9468 | $this->currPos++; |
| 9469 | $r7 = "-"; |
| 9470 | } else { |
| 9471 | if (!$silence) {$this->fail(55);} |
| 9472 | $r7 = self::$FAILED; |
| 9473 | break; |
| 9474 | } |
| 9475 | } |
| 9476 | // free $r7 |
| 9477 | $r5 = true; |
| 9478 | // d <- $r5 |
| 9479 | if ($r5!==self::$FAILED) { |
| 9480 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 9481 | } else { |
| 9482 | $r5 = self::$FAILED; |
| 9483 | $this->currPos = $p3; |
| 9484 | $r1 = self::$FAILED; |
| 9485 | goto seq_1; |
| 9486 | } |
| 9487 | // free $p6 |
| 9488 | // start choice_1 |
| 9489 | $p6 = $this->currPos; |
| 9490 | // start seq_2 |
| 9491 | $p8 = $this->currPos; |
| 9492 | $p9 = $this->currPos; |
| 9493 | $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th); |
| 9494 | if ($r10!==self::$FAILED) { |
| 9495 | $r10 = false; |
| 9496 | $this->currPos = $p9; |
| 9497 | } else { |
| 9498 | $r7 = self::$FAILED; |
| 9499 | goto seq_2; |
| 9500 | } |
| 9501 | // free $p9 |
| 9502 | $r7 = true; |
| 9503 | seq_2: |
| 9504 | if ($r7!==self::$FAILED) { |
| 9505 | $this->savedPos = $p6; |
| 9506 | $r7 = $this->a96($r5); |
| 9507 | goto choice_1; |
| 9508 | } |
| 9509 | // free $p8 |
| 9510 | $p8 = $this->currPos; |
| 9511 | $r7 = ''; |
| 9512 | if ($r7!==self::$FAILED) { |
| 9513 | $this->savedPos = $p8; |
| 9514 | $r7 = $this->a97($r5); |
| 9515 | } |
| 9516 | choice_1: |
| 9517 | // lineContent <- $r7 |
| 9518 | if ($r7===self::$FAILED) { |
| 9519 | $this->currPos = $p3; |
| 9520 | $r1 = self::$FAILED; |
| 9521 | goto seq_1; |
| 9522 | } |
| 9523 | $r1 = true; |
| 9524 | seq_1: |
| 9525 | if ($r1!==self::$FAILED) { |
| 9526 | $this->savedPos = $p2; |
| 9527 | $r1 = $this->a98($r5, $r7); |
| 9528 | } |
| 9529 | // free $p3 |
| 9530 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9531 | $this->currPos, |
| 9532 | $r1, |
| 9533 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 9534 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 9535 | ); |
| 9536 | return $r1; |
| 9537 | } |
| 9538 | private function discardtplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9539 | $key = json_encode([361, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 9540 | $bucket = $this->currPos; |
| 9541 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9542 | if ($cached) { |
| 9543 | $this->currPos = $cached->nextPos; |
| 9544 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9545 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9546 | return $cached->result; |
| 9547 | } |
| 9548 | $saved_preproc=$param_preproc; |
| 9549 | $saved_th=$param_th; |
| 9550 | $p2 = $this->currPos; |
| 9551 | // start seq_1 |
| 9552 | $p3 = $this->currPos; |
| 9553 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 9554 | $r4 = "{{{"; |
| 9555 | $this->currPos += 3; |
| 9556 | } else { |
| 9557 | if (!$silence) {$this->fail(60);} |
| 9558 | $r4 = self::$FAILED; |
| 9559 | $r1 = self::$FAILED; |
| 9560 | goto seq_1; |
| 9561 | } |
| 9562 | $p6 = $this->currPos; |
| 9563 | $r5 = ''; |
| 9564 | // p <- $r5 |
| 9565 | if ($r5!==self::$FAILED) { |
| 9566 | $this->savedPos = $p6; |
| 9567 | $r5 = $this->a17(); |
| 9568 | } else { |
| 9569 | $this->currPos = $p3; |
| 9570 | $r1 = self::$FAILED; |
| 9571 | goto seq_1; |
| 9572 | } |
| 9573 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
| 9574 | if ($r7===self::$FAILED) { |
| 9575 | $r7 = null; |
| 9576 | } |
| 9577 | // target <- $r7 |
| 9578 | $r8 = []; |
| 9579 | for (;;) { |
| 9580 | $p10 = $this->currPos; |
| 9581 | // start seq_2 |
| 9582 | $p11 = $this->currPos; |
| 9583 | for (;;) { |
| 9584 | $r13 = $this->discardnl_comment_space($silence); |
| 9585 | if ($r13===self::$FAILED) { |
| 9586 | break; |
| 9587 | } |
| 9588 | } |
| 9589 | // free $r13 |
| 9590 | $r12 = true; |
| 9591 | if ($r12===self::$FAILED) { |
| 9592 | $r9 = self::$FAILED; |
| 9593 | goto seq_2; |
| 9594 | } |
| 9595 | // free $r12 |
| 9596 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 9597 | $this->currPos++; |
| 9598 | $r12 = "|"; |
| 9599 | } else { |
| 9600 | if (!$silence) {$this->fail(13);} |
| 9601 | $r12 = self::$FAILED; |
| 9602 | $this->currPos = $p11; |
| 9603 | $r9 = self::$FAILED; |
| 9604 | goto seq_2; |
| 9605 | } |
| 9606 | // start choice_1 |
| 9607 | $p14 = $this->currPos; |
| 9608 | // start seq_3 |
| 9609 | $p15 = $this->currPos; |
| 9610 | $p17 = $this->currPos; |
| 9611 | $r16 = ''; |
| 9612 | // p0 <- $r16 |
| 9613 | if ($r16!==self::$FAILED) { |
| 9614 | $this->savedPos = $p17; |
| 9615 | $r16 = $this->a99($r5, $r7); |
| 9616 | } else { |
| 9617 | $r13 = self::$FAILED; |
| 9618 | goto seq_3; |
| 9619 | } |
| 9620 | $r18 = []; |
| 9621 | for (;;) { |
| 9622 | $r19 = $this->parsenl_comment_space($silence); |
| 9623 | if ($r19!==self::$FAILED) { |
| 9624 | $r18[] = $r19; |
| 9625 | } else { |
| 9626 | break; |
| 9627 | } |
| 9628 | } |
| 9629 | // v <- $r18 |
| 9630 | // free $r19 |
| 9631 | $p20 = $this->currPos; |
| 9632 | $r19 = ''; |
| 9633 | // p1 <- $r19 |
| 9634 | if ($r19!==self::$FAILED) { |
| 9635 | $this->savedPos = $p20; |
| 9636 | $r19 = $this->a100($r5, $r7, $r16, $r18); |
| 9637 | } else { |
| 9638 | $this->currPos = $p15; |
| 9639 | $r13 = self::$FAILED; |
| 9640 | goto seq_3; |
| 9641 | } |
| 9642 | $p21 = $this->currPos; |
| 9643 | // start choice_2 |
| 9644 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 9645 | $this->currPos++; |
| 9646 | $r22 = "|"; |
| 9647 | goto choice_2; |
| 9648 | } else { |
| 9649 | $r22 = self::$FAILED; |
| 9650 | } |
| 9651 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
| 9652 | $r22 = "}}}"; |
| 9653 | $this->currPos += 3; |
| 9654 | } else { |
| 9655 | $r22 = self::$FAILED; |
| 9656 | } |
| 9657 | choice_2: |
| 9658 | if ($r22!==self::$FAILED) { |
| 9659 | $r22 = false; |
| 9660 | $this->currPos = $p21; |
| 9661 | } else { |
| 9662 | $this->currPos = $p15; |
| 9663 | $r13 = self::$FAILED; |
| 9664 | goto seq_3; |
| 9665 | } |
| 9666 | // free $p21 |
| 9667 | $r13 = true; |
| 9668 | seq_3: |
| 9669 | if ($r13!==self::$FAILED) { |
| 9670 | $this->savedPos = $p14; |
| 9671 | $r13 = $this->a101($r5, $r7, $r16, $r18, $r19); |
| 9672 | goto choice_1; |
| 9673 | } |
| 9674 | // free $p15 |
| 9675 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
| 9676 | choice_1: |
| 9677 | // r <- $r13 |
| 9678 | if ($r13===self::$FAILED) { |
| 9679 | $this->currPos = $p11; |
| 9680 | $r9 = self::$FAILED; |
| 9681 | goto seq_2; |
| 9682 | } |
| 9683 | $r9 = true; |
| 9684 | seq_2: |
| 9685 | if ($r9!==self::$FAILED) { |
| 9686 | $this->savedPos = $p10; |
| 9687 | $r9 = $this->a102($r5, $r7, $r13); |
| 9688 | $r8[] = $r9; |
| 9689 | } else { |
| 9690 | break; |
| 9691 | } |
| 9692 | // free $p11 |
| 9693 | } |
| 9694 | // params <- $r8 |
| 9695 | // free $r9 |
| 9696 | for (;;) { |
| 9697 | $r23 = $this->discardnl_comment_space($silence); |
| 9698 | if ($r23===self::$FAILED) { |
| 9699 | break; |
| 9700 | } |
| 9701 | } |
| 9702 | // free $r23 |
| 9703 | $r9 = true; |
| 9704 | if ($r9===self::$FAILED) { |
| 9705 | $this->currPos = $p3; |
| 9706 | $r1 = self::$FAILED; |
| 9707 | goto seq_1; |
| 9708 | } |
| 9709 | // free $r9 |
| 9710 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
| 9711 | if ($r9===self::$FAILED) { |
| 9712 | $this->currPos = $p3; |
| 9713 | $r1 = self::$FAILED; |
| 9714 | goto seq_1; |
| 9715 | } |
| 9716 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
| 9717 | $r23 = "}}}"; |
| 9718 | $this->currPos += 3; |
| 9719 | } else { |
| 9720 | if (!$silence) {$this->fail(61);} |
| 9721 | $r23 = self::$FAILED; |
| 9722 | $this->currPos = $p3; |
| 9723 | $r1 = self::$FAILED; |
| 9724 | goto seq_1; |
| 9725 | } |
| 9726 | $r1 = true; |
| 9727 | seq_1: |
| 9728 | if ($r1!==self::$FAILED) { |
| 9729 | $this->savedPos = $p2; |
| 9730 | $r1 = $this->a103($r5, $r7, $r8); |
| 9731 | } |
| 9732 | // free $p3 |
| 9733 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 9734 | $this->currPos, |
| 9735 | $r1, |
| 9736 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 9737 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 9738 | ); |
| 9739 | return $r1; |
| 9740 | } |
| 9741 | private function parsetemplate_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
| 9742 | $key = json_encode([356, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 9743 | $bucket = $this->currPos; |
| 9744 | $cached = $this->cache[$bucket][$key] ?? null; |
| 9745 | if ($cached) { |
| 9746 | $this->currPos = $cached->nextPos; |
| 9747 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 9748 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 9749 | return $cached->result; |
| 9750 | } |
| 9751 | $saved_preproc=$param_preproc; |
| 9752 | $saved_th=$param_th; |
| 9753 | // start choice_1 |
| 9754 | $p2 = $this->currPos; |
| 9755 | // start seq_1 |
| 9756 | $p3 = $this->currPos; |
| 9757 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 9758 | $r4 = "{{"; |
| 9759 | $this->currPos += 2; |
| 9760 | } else { |
| 9761 | if (!$silence) {$this->fail(43);} |
| 9762 | $r4 = self::$FAILED; |
| 9763 | $r1 = self::$FAILED; |
| 9764 | goto seq_1; |
| 9765 | } |
| 9766 | $p6 = $this->currPos; |
| 9767 | for (;;) { |
| 9768 | $r7 = $this->discardnl_comment_space($silence); |
| 9769 | if ($r7===self::$FAILED) { |
| 9770 | break; |
| 9771 | } |
| 9772 | } |
| 9773 | // free $r7 |
| 9774 | $r5 = true; |
| 9775 | // leadWS <- $r5 |
| 9776 | if ($r5!==self::$FAILED) { |
| 9777 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 9778 | } else { |
| 9779 | $r5 = self::$FAILED; |
| 9780 | $this->currPos = $p3; |
| 9781 | $r1 = self::$FAILED; |
| 9782 | goto seq_1; |
| 9783 | } |
| 9784 | // free $p6 |
| 9785 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
| 9786 | // target <- $r7 |
| 9787 | if ($r7===self::$FAILED) { |
| 9788 | $this->currPos = $p3; |
| 9789 | $r1 = self::$FAILED; |
| 9790 | goto seq_1; |
| 9791 | } |
| 9792 | $r8 = []; |
| 9793 | for (;;) { |
| 9794 | $p6 = $this->currPos; |
| 9795 | // start seq_2 |
| 9796 | $p10 = $this->currPos; |
| 9797 | for (;;) { |
| 9798 | $r12 = $this->discardnl_comment_space($silence); |
| 9799 | if ($r12===self::$FAILED) { |
| 9800 | break; |
| 9801 | } |
| 9802 | } |
| 9803 | // free $r12 |
| 9804 | $r11 = true; |
| 9805 | if ($r11===self::$FAILED) { |
| 9806 | $r9 = self::$FAILED; |
| 9807 | goto seq_2; |
| 9808 | } |
| 9809 | // free $r11 |
| 9810 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 9811 | $this->currPos++; |
| 9812 | $r11 = "|"; |
| 9813 | } else { |
| 9814 | if (!$silence) {$this->fail(13);} |
| 9815 | $r11 = self::$FAILED; |
| 9816 | $this->currPos = $p10; |
| 9817 | $r9 = self::$FAILED; |
| 9818 | goto seq_2; |
| 9819 | } |
| 9820 | // start choice_2 |
| 9821 | $p13 = $this->currPos; |
| 9822 | // start seq_3 |
| 9823 | $p14 = $this->currPos; |
| 9824 | $p16 = $this->currPos; |
| 9825 | $r15 = ''; |
| 9826 | // p0 <- $r15 |
| 9827 | if ($r15!==self::$FAILED) { |
| 9828 | $this->savedPos = $p16; |
| 9829 | $r15 = $this->a104($r5, $r7); |
| 9830 | } else { |
| 9831 | $r12 = self::$FAILED; |
| 9832 | goto seq_3; |
| 9833 | } |
| 9834 | $r17 = []; |
| 9835 | for (;;) { |
| 9836 | $r18 = $this->parsenl_comment_space($silence); |
| 9837 | if ($r18!==self::$FAILED) { |
| 9838 | $r17[] = $r18; |
| 9839 | } else { |
| 9840 | break; |
| 9841 | } |
| 9842 | } |
| 9843 | // v <- $r17 |
| 9844 | // free $r18 |
| 9845 | $p19 = $this->currPos; |
| 9846 | $r18 = ''; |
| 9847 | // p1 <- $r18 |
| 9848 | if ($r18!==self::$FAILED) { |
| 9849 | $this->savedPos = $p19; |
| 9850 | $r18 = $this->a105($r5, $r7, $r15, $r17); |
| 9851 | } else { |
| 9852 | $this->currPos = $p14; |
| 9853 | $r12 = self::$FAILED; |
| 9854 | goto seq_3; |
| 9855 | } |
| 9856 | $p20 = $this->currPos; |
| 9857 | // start choice_3 |
| 9858 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 9859 | $this->currPos++; |
| 9860 | $r21 = "|"; |
| 9861 | goto choice_3; |
| 9862 | } else { |
| 9863 | $r21 = self::$FAILED; |
| 9864 | } |
| 9865 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
| 9866 | $r21 = "}}"; |
| 9867 | $this->currPos += 2; |
| 9868 | } else { |
| 9869 | $r21 = self::$FAILED; |
| 9870 | } |
| 9871 | choice_3: |
| 9872 | if ($r21!==self::$FAILED) { |
| 9873 | $r21 = false; |
| 9874 | $this->currPos = $p20; |
| 9875 | } else { |
| 9876 | $this->currPos = $p14; |
| 9877 | $r12 = self::$FAILED; |
| 9878 | goto seq_3; |
| 9879 | } |
| 9880 | // free $p20 |
| 9881 | $r12 = true; |
| 9882 | seq_3: |
| 9883 | if ($r12!==self::$FAILED) { |
| 9884 | $this->savedPos = $p13; |
| 9885 | $r12 = $this->a106($r5, $r7, $r15, $r17, $r18); |
| 9886 | goto choice_2; |
| 9887 | } |
| 9888 | // free $p14 |
| 9889 | $r12 = $this->parsetemplate_param($silence, $boolParams, $param_preproc, $param_th); |
| 9890 | choice_2: |
| 9891 | // r <- $r12 |
| 9892 | if ($r12===self::$FAILED) { |
| 9893 | $this->currPos = $p10; |
| 9894 | $r9 = self::$FAILED; |
| 9895 | goto seq_2; |
| 9896 | } |
| 9897 | $r9 = true; |
| 9898 | seq_2: |
| 9899 | if ($r9!==self::$FAILED) { |
| 9900 | $this->savedPos = $p6; |
| 9901 | $r9 = $this->a107($r5, $r7, $r12); |
| 9902 | $r8[] = $r9; |
| 9903 | } else { |
| 9904 | break; |
| 9905 | } |
| 9906 | // free $p10 |
| 9907 | } |
| 9908 | // params <- $r8 |
| 9909 | // free $r9 |
| 9910 | $p10 = $this->currPos; |
| 9911 | for (;;) { |
| 9912 | $r22 = $this->discardnl_comment_space($silence); |
| 9913 | if ($r22===self::$FAILED) { |
| 9914 | break; |
| 9915 | } |
| 9916 | } |
| 9917 | // free $r22 |
| 9918 | $r9 = true; |
| 9919 | // trailWS <- $r9 |
| 9920 | if ($r9!==self::$FAILED) { |
| 9921 | $r9 = substr($this->input, $p10, $this->currPos - $p10); |
| 9922 | } else { |
| 9923 | $r9 = self::$FAILED; |
| 9924 | $this->currPos = $p3; |
| 9925 | $r1 = self::$FAILED; |
| 9926 | goto seq_1; |
| 9927 | } |
| 9928 | // free $p10 |
| 9929 | $r22 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
| 9930 | if ($r22===self::$FAILED) { |
| 9931 | $this->currPos = $p3; |
| 9932 | $r1 = self::$FAILED; |
| 9933 | goto seq_1; |
| 9934 | } |
| 9935 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
| 9936 | $r23 = "}}"; |
| 9937 | $this->currPos += 2; |
| 9938 | } else { |
| 9939 | if (!$silence) {$this->fail(62);} |
| 9940 | $r23 = self::$FAILED; |
| 9941 | $this->currPos = $p3; |
| 9942 | $r1 = self::$FAILED; |
| 9943 | goto seq_1; |
| 9944 | } |
| 9945 | $r1 = true; |
| 9946 | seq_1: |
| 9947 | if ($r1!==self::$FAILED) { |
| 9948 | $this->savedPos = $p2; |
| 9949 | $r1 = $this->a108($r5, $r7, $r8, $r9); |
| 9950 | goto choice_1; |
| 9951 | } |
| 9952 | // free $p3 |
| 9953 | $p3 = $this->currPos; |
| 9954 | // start seq_4 |
| 9955 | $p10 = $this->currPos; |
| 9956 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) { |
| 9957 | $r24 = "{{"; |
| 9958 | $this->currPos += 2; |
| 9959 | } else { |
| 9960 | if (!$silence) {$this->fail(43);} |
| 9961 | $r24 = self::$FAILED; |
| 9962 | $r1 = self::$FAILED; |
| 9963 | goto seq_4; |
| 9964 | } |
| 9965 | for (;;) { |
| 9966 | $r26 = $this->discardspace_or_newline($silence); |
| 9967 | if ($r26===self::$FAILED) { |
| 9968 | break; |
| 9969 | } |
| 9970 | } |
| 9971 | // free $r26 |
| 9972 | $r25 = true; |
| 9973 | if ($r25===self::$FAILED) { |
| 9974 | $this->currPos = $p10; |
| 9975 | $r1 = self::$FAILED; |
| 9976 | goto seq_4; |
| 9977 | } |
| 9978 | // free $r25 |
| 9979 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) { |
| 9980 | $r25 = "}}"; |
| 9981 | $this->currPos += 2; |
| 9982 | } else { |
| 9983 | if (!$silence) {$this->fail(62);} |
| 9984 | $r25 = self::$FAILED; |
| 9985 | $this->currPos = $p10; |
| 9986 | $r1 = self::$FAILED; |
| 9987 | goto seq_4; |
| 9988 | } |
| 9989 | $r1 = true; |
| 9990 | seq_4: |
| 9991 | if ($r1!==self::$FAILED) { |
| 9992 | $r1 = substr($this->input, $p3, $this->currPos - $p3); |
| 9993 | } else { |
| 9994 | $r1 = self::$FAILED; |
| 9995 | } |
| 9996 | // free $p10 |
| 9997 | // free $p3 |
| 9998 | choice_1: |
| 9999 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10000 | $this->currPos, |
| 10001 | $r1, |
| 10002 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10003 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10004 | ); |
| 10005 | return $r1; |
| 10006 | } |
| 10007 | private function parsetplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10008 | $key = json_encode([360, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 10009 | $bucket = $this->currPos; |
| 10010 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10011 | if ($cached) { |
| 10012 | $this->currPos = $cached->nextPos; |
| 10013 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10014 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10015 | return $cached->result; |
| 10016 | } |
| 10017 | $saved_preproc=$param_preproc; |
| 10018 | $saved_th=$param_th; |
| 10019 | $p2 = $this->currPos; |
| 10020 | // start seq_1 |
| 10021 | $p3 = $this->currPos; |
| 10022 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) { |
| 10023 | $r4 = "{{{"; |
| 10024 | $this->currPos += 3; |
| 10025 | } else { |
| 10026 | if (!$silence) {$this->fail(60);} |
| 10027 | $r4 = self::$FAILED; |
| 10028 | $r1 = self::$FAILED; |
| 10029 | goto seq_1; |
| 10030 | } |
| 10031 | $p6 = $this->currPos; |
| 10032 | $r5 = ''; |
| 10033 | // p <- $r5 |
| 10034 | if ($r5!==self::$FAILED) { |
| 10035 | $this->savedPos = $p6; |
| 10036 | $r5 = $this->a17(); |
| 10037 | } else { |
| 10038 | $this->currPos = $p3; |
| 10039 | $r1 = self::$FAILED; |
| 10040 | goto seq_1; |
| 10041 | } |
| 10042 | $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
| 10043 | if ($r7===self::$FAILED) { |
| 10044 | $r7 = null; |
| 10045 | } |
| 10046 | // target <- $r7 |
| 10047 | $r8 = []; |
| 10048 | for (;;) { |
| 10049 | $p10 = $this->currPos; |
| 10050 | // start seq_2 |
| 10051 | $p11 = $this->currPos; |
| 10052 | for (;;) { |
| 10053 | $r13 = $this->discardnl_comment_space($silence); |
| 10054 | if ($r13===self::$FAILED) { |
| 10055 | break; |
| 10056 | } |
| 10057 | } |
| 10058 | // free $r13 |
| 10059 | $r12 = true; |
| 10060 | if ($r12===self::$FAILED) { |
| 10061 | $r9 = self::$FAILED; |
| 10062 | goto seq_2; |
| 10063 | } |
| 10064 | // free $r12 |
| 10065 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 10066 | $this->currPos++; |
| 10067 | $r12 = "|"; |
| 10068 | } else { |
| 10069 | if (!$silence) {$this->fail(13);} |
| 10070 | $r12 = self::$FAILED; |
| 10071 | $this->currPos = $p11; |
| 10072 | $r9 = self::$FAILED; |
| 10073 | goto seq_2; |
| 10074 | } |
| 10075 | // start choice_1 |
| 10076 | $p14 = $this->currPos; |
| 10077 | // start seq_3 |
| 10078 | $p15 = $this->currPos; |
| 10079 | $p17 = $this->currPos; |
| 10080 | $r16 = ''; |
| 10081 | // p0 <- $r16 |
| 10082 | if ($r16!==self::$FAILED) { |
| 10083 | $this->savedPos = $p17; |
| 10084 | $r16 = $this->a99($r5, $r7); |
| 10085 | } else { |
| 10086 | $r13 = self::$FAILED; |
| 10087 | goto seq_3; |
| 10088 | } |
| 10089 | $r18 = []; |
| 10090 | for (;;) { |
| 10091 | $r19 = $this->parsenl_comment_space($silence); |
| 10092 | if ($r19!==self::$FAILED) { |
| 10093 | $r18[] = $r19; |
| 10094 | } else { |
| 10095 | break; |
| 10096 | } |
| 10097 | } |
| 10098 | // v <- $r18 |
| 10099 | // free $r19 |
| 10100 | $p20 = $this->currPos; |
| 10101 | $r19 = ''; |
| 10102 | // p1 <- $r19 |
| 10103 | if ($r19!==self::$FAILED) { |
| 10104 | $this->savedPos = $p20; |
| 10105 | $r19 = $this->a100($r5, $r7, $r16, $r18); |
| 10106 | } else { |
| 10107 | $this->currPos = $p15; |
| 10108 | $r13 = self::$FAILED; |
| 10109 | goto seq_3; |
| 10110 | } |
| 10111 | $p21 = $this->currPos; |
| 10112 | // start choice_2 |
| 10113 | if (($this->input[$this->currPos] ?? null) === "|") { |
| 10114 | $this->currPos++; |
| 10115 | $r22 = "|"; |
| 10116 | goto choice_2; |
| 10117 | } else { |
| 10118 | $r22 = self::$FAILED; |
| 10119 | } |
| 10120 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
| 10121 | $r22 = "}}}"; |
| 10122 | $this->currPos += 3; |
| 10123 | } else { |
| 10124 | $r22 = self::$FAILED; |
| 10125 | } |
| 10126 | choice_2: |
| 10127 | if ($r22!==self::$FAILED) { |
| 10128 | $r22 = false; |
| 10129 | $this->currPos = $p21; |
| 10130 | } else { |
| 10131 | $this->currPos = $p15; |
| 10132 | $r13 = self::$FAILED; |
| 10133 | goto seq_3; |
| 10134 | } |
| 10135 | // free $p21 |
| 10136 | $r13 = true; |
| 10137 | seq_3: |
| 10138 | if ($r13!==self::$FAILED) { |
| 10139 | $this->savedPos = $p14; |
| 10140 | $r13 = $this->a101($r5, $r7, $r16, $r18, $r19); |
| 10141 | goto choice_1; |
| 10142 | } |
| 10143 | // free $p15 |
| 10144 | $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th); |
| 10145 | choice_1: |
| 10146 | // r <- $r13 |
| 10147 | if ($r13===self::$FAILED) { |
| 10148 | $this->currPos = $p11; |
| 10149 | $r9 = self::$FAILED; |
| 10150 | goto seq_2; |
| 10151 | } |
| 10152 | $r9 = true; |
| 10153 | seq_2: |
| 10154 | if ($r9!==self::$FAILED) { |
| 10155 | $this->savedPos = $p10; |
| 10156 | $r9 = $this->a102($r5, $r7, $r13); |
| 10157 | $r8[] = $r9; |
| 10158 | } else { |
| 10159 | break; |
| 10160 | } |
| 10161 | // free $p11 |
| 10162 | } |
| 10163 | // params <- $r8 |
| 10164 | // free $r9 |
| 10165 | for (;;) { |
| 10166 | $r23 = $this->discardnl_comment_space($silence); |
| 10167 | if ($r23===self::$FAILED) { |
| 10168 | break; |
| 10169 | } |
| 10170 | } |
| 10171 | // free $r23 |
| 10172 | $r9 = true; |
| 10173 | if ($r9===self::$FAILED) { |
| 10174 | $this->currPos = $p3; |
| 10175 | $r1 = self::$FAILED; |
| 10176 | goto seq_1; |
| 10177 | } |
| 10178 | // free $r9 |
| 10179 | $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
| 10180 | if ($r9===self::$FAILED) { |
| 10181 | $this->currPos = $p3; |
| 10182 | $r1 = self::$FAILED; |
| 10183 | goto seq_1; |
| 10184 | } |
| 10185 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) { |
| 10186 | $r23 = "}}}"; |
| 10187 | $this->currPos += 3; |
| 10188 | } else { |
| 10189 | if (!$silence) {$this->fail(61);} |
| 10190 | $r23 = self::$FAILED; |
| 10191 | $this->currPos = $p3; |
| 10192 | $r1 = self::$FAILED; |
| 10193 | goto seq_1; |
| 10194 | } |
| 10195 | $r1 = true; |
| 10196 | seq_1: |
| 10197 | if ($r1!==self::$FAILED) { |
| 10198 | $this->savedPos = $p2; |
| 10199 | $r1 = $this->a103($r5, $r7, $r8); |
| 10200 | } |
| 10201 | // free $p3 |
| 10202 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10203 | $this->currPos, |
| 10204 | $r1, |
| 10205 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10206 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10207 | ); |
| 10208 | return $r1; |
| 10209 | } |
| 10210 | private function discardwikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10211 | $key = json_encode([407, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 10212 | $bucket = $this->currPos; |
| 10213 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10214 | if ($cached) { |
| 10215 | $this->currPos = $cached->nextPos; |
| 10216 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10217 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10218 | return $cached->result; |
| 10219 | } |
| 10220 | $saved_preproc=$param_preproc; |
| 10221 | $saved_th=$param_th; |
| 10222 | $p2 = $this->currPos; |
| 10223 | // start seq_1 |
| 10224 | $p3 = $this->currPos; |
| 10225 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
| 10226 | $r4 = "[["; |
| 10227 | $this->currPos += 2; |
| 10228 | } else { |
| 10229 | if (!$silence) {$this->fail(41);} |
| 10230 | $r4 = self::$FAILED; |
| 10231 | $r1 = self::$FAILED; |
| 10232 | goto seq_1; |
| 10233 | } |
| 10234 | $p6 = $this->currPos; |
| 10235 | $r5 = ''; |
| 10236 | // spos <- $r5 |
| 10237 | if ($r5!==self::$FAILED) { |
| 10238 | $this->savedPos = $p6; |
| 10239 | $r5 = $this->a17(); |
| 10240 | } else { |
| 10241 | $this->currPos = $p3; |
| 10242 | $r1 = self::$FAILED; |
| 10243 | goto seq_1; |
| 10244 | } |
| 10245 | $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th); |
| 10246 | if ($r7===self::$FAILED) { |
| 10247 | $r7 = null; |
| 10248 | } |
| 10249 | // target <- $r7 |
| 10250 | $p9 = $this->currPos; |
| 10251 | $r8 = ''; |
| 10252 | // tpos <- $r8 |
| 10253 | if ($r8!==self::$FAILED) { |
| 10254 | $this->savedPos = $p9; |
| 10255 | $r8 = $this->a109($r5, $r7); |
| 10256 | } else { |
| 10257 | $this->currPos = $p3; |
| 10258 | $r1 = self::$FAILED; |
| 10259 | goto seq_1; |
| 10260 | } |
| 10261 | $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th); |
| 10262 | // lcs <- $r10 |
| 10263 | if ($r10===self::$FAILED) { |
| 10264 | $this->currPos = $p3; |
| 10265 | $r1 = self::$FAILED; |
| 10266 | goto seq_1; |
| 10267 | } |
| 10268 | $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th); |
| 10269 | if ($r11===self::$FAILED) { |
| 10270 | $this->currPos = $p3; |
| 10271 | $r1 = self::$FAILED; |
| 10272 | goto seq_1; |
| 10273 | } |
| 10274 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
| 10275 | $r12 = "]]"; |
| 10276 | $this->currPos += 2; |
| 10277 | } else { |
| 10278 | if (!$silence) {$this->fail(63);} |
| 10279 | $r12 = self::$FAILED; |
| 10280 | $this->currPos = $p3; |
| 10281 | $r1 = self::$FAILED; |
| 10282 | goto seq_1; |
| 10283 | } |
| 10284 | $r1 = true; |
| 10285 | seq_1: |
| 10286 | if ($r1!==self::$FAILED) { |
| 10287 | $this->savedPos = $p2; |
| 10288 | $r1 = $this->a110($r5, $r7, $r8, $r10); |
| 10289 | } |
| 10290 | // free $p3 |
| 10291 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10292 | $this->currPos, |
| 10293 | $r1, |
| 10294 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10295 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10296 | ); |
| 10297 | return $r1; |
| 10298 | } |
| 10299 | private function discardbroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10300 | $key = json_encode([405, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 10301 | $bucket = $this->currPos; |
| 10302 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10303 | if ($cached) { |
| 10304 | $this->currPos = $cached->nextPos; |
| 10305 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10306 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10307 | return $cached->result; |
| 10308 | } |
| 10309 | $saved_preproc=$param_preproc; |
| 10310 | $saved_th=$param_th; |
| 10311 | $p2 = $this->currPos; |
| 10312 | // start seq_1 |
| 10313 | $p3 = $this->currPos; |
| 10314 | $p4 = $this->currPos; |
| 10315 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
| 10316 | $r5 = "[["; |
| 10317 | $this->currPos += 2; |
| 10318 | $r5 = false; |
| 10319 | $this->currPos = $p4; |
| 10320 | } else { |
| 10321 | $r5 = self::$FAILED; |
| 10322 | $r1 = self::$FAILED; |
| 10323 | goto seq_1; |
| 10324 | } |
| 10325 | // free $p4 |
| 10326 | $this->savedPos = $this->currPos; |
| 10327 | $r6 = $this->a111($param_preproc); |
| 10328 | if ($r6) { |
| 10329 | $r6 = false; |
| 10330 | } else { |
| 10331 | $r6 = self::$FAILED; |
| 10332 | $this->currPos = $p3; |
| 10333 | $r1 = self::$FAILED; |
| 10334 | goto seq_1; |
| 10335 | } |
| 10336 | // start seq_2 |
| 10337 | $p4 = $this->currPos; |
| 10338 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 10339 | $this->currPos++; |
| 10340 | $r8 = "["; |
| 10341 | } else { |
| 10342 | if (!$silence) {$this->fail(19);} |
| 10343 | $r8 = self::$FAILED; |
| 10344 | $r7 = self::$FAILED; |
| 10345 | goto seq_2; |
| 10346 | } |
| 10347 | // start choice_1 |
| 10348 | $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th); |
| 10349 | if ($r9!==self::$FAILED) { |
| 10350 | goto choice_1; |
| 10351 | } |
| 10352 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 10353 | $this->currPos++; |
| 10354 | $r9 = "["; |
| 10355 | } else { |
| 10356 | if (!$silence) {$this->fail(19);} |
| 10357 | $r9 = self::$FAILED; |
| 10358 | } |
| 10359 | choice_1: |
| 10360 | if ($r9===self::$FAILED) { |
| 10361 | $this->currPos = $p4; |
| 10362 | $r7 = self::$FAILED; |
| 10363 | goto seq_2; |
| 10364 | } |
| 10365 | $r7 = [$r8,$r9]; |
| 10366 | seq_2: |
| 10367 | // a <- $r7 |
| 10368 | if ($r7===self::$FAILED) { |
| 10369 | $this->currPos = $p3; |
| 10370 | $r1 = self::$FAILED; |
| 10371 | goto seq_1; |
| 10372 | } |
| 10373 | // free $p4 |
| 10374 | $r1 = true; |
| 10375 | seq_1: |
| 10376 | if ($r1!==self::$FAILED) { |
| 10377 | $this->savedPos = $p2; |
| 10378 | $r1 = $this->a112($param_preproc, $r7); |
| 10379 | } |
| 10380 | // free $p3 |
| 10381 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10382 | $this->currPos, |
| 10383 | $r1, |
| 10384 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10385 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10386 | ); |
| 10387 | return $r1; |
| 10388 | } |
| 10389 | private function parseextension_annotation_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10390 | $key = json_encode([418, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 10391 | $bucket = $this->currPos; |
| 10392 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10393 | if ($cached) { |
| 10394 | $this->currPos = $cached->nextPos; |
| 10395 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10396 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10397 | return $cached->result; |
| 10398 | } |
| 10399 | $saved_preproc=$param_preproc; |
| 10400 | $saved_th=$param_th; |
| 10401 | $p2 = $this->currPos; |
| 10402 | // start seq_1 |
| 10403 | $p3 = $this->currPos; |
| 10404 | if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) { |
| 10405 | $r4 = false; |
| 10406 | } else { |
| 10407 | $r4 = self::$FAILED; |
| 10408 | $r1 = self::$FAILED; |
| 10409 | goto seq_1; |
| 10410 | } |
| 10411 | if (($this->input[$this->currPos] ?? null) === "<") { |
| 10412 | $this->currPos++; |
| 10413 | $r5 = "<"; |
| 10414 | } else { |
| 10415 | if (!$silence) {$this->fail(44);} |
| 10416 | $r5 = self::$FAILED; |
| 10417 | $this->currPos = $p3; |
| 10418 | $r1 = self::$FAILED; |
| 10419 | goto seq_1; |
| 10420 | } |
| 10421 | // start choice_1 |
| 10422 | $p7 = $this->currPos; |
| 10423 | // start seq_2 |
| 10424 | $p8 = $this->currPos; |
| 10425 | $r9 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th); |
| 10426 | // extToken <- $r9 |
| 10427 | if ($r9===self::$FAILED) { |
| 10428 | $r6 = self::$FAILED; |
| 10429 | goto seq_2; |
| 10430 | } |
| 10431 | $this->savedPos = $this->currPos; |
| 10432 | $r10 = $this->a113($r9); |
| 10433 | if ($r10) { |
| 10434 | $r10 = false; |
| 10435 | } else { |
| 10436 | $r10 = self::$FAILED; |
| 10437 | $this->currPos = $p8; |
| 10438 | $r6 = self::$FAILED; |
| 10439 | goto seq_2; |
| 10440 | } |
| 10441 | $r6 = true; |
| 10442 | seq_2: |
| 10443 | if ($r6!==self::$FAILED) { |
| 10444 | $this->savedPos = $p7; |
| 10445 | $r6 = $this->a114($r9); |
| 10446 | goto choice_1; |
| 10447 | } |
| 10448 | // free $p8 |
| 10449 | $r6 = $this->parsetvar_old_syntax_closing_HACK($silence); |
| 10450 | choice_1: |
| 10451 | // tag <- $r6 |
| 10452 | if ($r6===self::$FAILED) { |
| 10453 | $this->currPos = $p3; |
| 10454 | $r1 = self::$FAILED; |
| 10455 | goto seq_1; |
| 10456 | } |
| 10457 | $r1 = true; |
| 10458 | seq_1: |
| 10459 | if ($r1!==self::$FAILED) { |
| 10460 | $this->savedPos = $p2; |
| 10461 | $r1 = $this->a78($r6); |
| 10462 | } |
| 10463 | // free $p3 |
| 10464 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10465 | $this->currPos, |
| 10466 | $r1, |
| 10467 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10468 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10469 | ); |
| 10470 | return $r1; |
| 10471 | } |
| 10472 | private function parsexmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10473 | $key = json_encode([428, $boolParams & 0x3ebf, $param_preproc, $param_th]); |
| 10474 | $bucket = $this->currPos; |
| 10475 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10476 | if ($cached) { |
| 10477 | $this->currPos = $cached->nextPos; |
| 10478 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10479 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10480 | return $cached->result; |
| 10481 | } |
| 10482 | $saved_preproc=$param_preproc; |
| 10483 | $saved_th=$param_th; |
| 10484 | $p2 = $this->currPos; |
| 10485 | // start seq_1 |
| 10486 | $p3 = $this->currPos; |
| 10487 | $this->savedPos = $this->currPos; |
| 10488 | $r4 = $this->a115(); |
| 10489 | if ($r4) { |
| 10490 | $r4 = false; |
| 10491 | } else { |
| 10492 | $r4 = self::$FAILED; |
| 10493 | $r1 = self::$FAILED; |
| 10494 | goto seq_1; |
| 10495 | } |
| 10496 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 10497 | $this->currPos++; |
| 10498 | $r5 = "/"; |
| 10499 | } else { |
| 10500 | if (!$silence) {$this->fail(35);} |
| 10501 | $r5 = self::$FAILED; |
| 10502 | $r5 = null; |
| 10503 | } |
| 10504 | // end <- $r5 |
| 10505 | $r6 = $this->parsetag_name($silence); |
| 10506 | // name <- $r6 |
| 10507 | if ($r6===self::$FAILED) { |
| 10508 | $this->currPos = $p3; |
| 10509 | $r1 = self::$FAILED; |
| 10510 | goto seq_1; |
| 10511 | } |
| 10512 | $this->savedPos = $this->currPos; |
| 10513 | $r7 = $this->a116($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0); |
| 10514 | if ($r7) { |
| 10515 | $r7 = false; |
| 10516 | } else { |
| 10517 | $r7 = self::$FAILED; |
| 10518 | $this->currPos = $p3; |
| 10519 | $r1 = self::$FAILED; |
| 10520 | goto seq_1; |
| 10521 | } |
| 10522 | $r8 = $this->parsegeneric_newline_attributes($silence, $boolParams & ~0x140, $param_preproc, $param_th); |
| 10523 | // attribs <- $r8 |
| 10524 | if ($r8===self::$FAILED) { |
| 10525 | $this->currPos = $p3; |
| 10526 | $r1 = self::$FAILED; |
| 10527 | goto seq_1; |
| 10528 | } |
| 10529 | for (;;) { |
| 10530 | $r10 = $this->discardspace_or_newline_or_solidus($silence); |
| 10531 | if ($r10===self::$FAILED) { |
| 10532 | break; |
| 10533 | } |
| 10534 | } |
| 10535 | // free $r10 |
| 10536 | $r9 = true; |
| 10537 | if ($r9===self::$FAILED) { |
| 10538 | $this->currPos = $p3; |
| 10539 | $r1 = self::$FAILED; |
| 10540 | goto seq_1; |
| 10541 | } |
| 10542 | // free $r9 |
| 10543 | if (($this->input[$this->currPos] ?? null) === "/") { |
| 10544 | $this->currPos++; |
| 10545 | $r9 = "/"; |
| 10546 | } else { |
| 10547 | if (!$silence) {$this->fail(35);} |
| 10548 | $r9 = self::$FAILED; |
| 10549 | $r9 = null; |
| 10550 | } |
| 10551 | // selfclose <- $r9 |
| 10552 | for (;;) { |
| 10553 | $r11 = $this->discardspace($silence); |
| 10554 | if ($r11===self::$FAILED) { |
| 10555 | break; |
| 10556 | } |
| 10557 | } |
| 10558 | // free $r11 |
| 10559 | $r10 = true; |
| 10560 | if ($r10===self::$FAILED) { |
| 10561 | $this->currPos = $p3; |
| 10562 | $r1 = self::$FAILED; |
| 10563 | goto seq_1; |
| 10564 | } |
| 10565 | // free $r10 |
| 10566 | if (($this->input[$this->currPos] ?? null) === ">") { |
| 10567 | $this->currPos++; |
| 10568 | $r10 = ">"; |
| 10569 | } else { |
| 10570 | if (!$silence) {$this->fail(64);} |
| 10571 | $r10 = self::$FAILED; |
| 10572 | $this->currPos = $p3; |
| 10573 | $r1 = self::$FAILED; |
| 10574 | goto seq_1; |
| 10575 | } |
| 10576 | $r1 = true; |
| 10577 | seq_1: |
| 10578 | if ($r1!==self::$FAILED) { |
| 10579 | $this->savedPos = $p2; |
| 10580 | $r1 = $this->a117($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0, $r8, $r9); |
| 10581 | } |
| 10582 | // free $p3 |
| 10583 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10584 | $this->currPos, |
| 10585 | $r1, |
| 10586 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10587 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10588 | ); |
| 10589 | return $r1; |
| 10590 | } |
| 10591 | private function parsetvar_old_syntax_closing_HACK($silence) { |
| 10592 | $key = 414; |
| 10593 | $bucket = $this->currPos; |
| 10594 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10595 | if ($cached) { |
| 10596 | $this->currPos = $cached->nextPos; |
| 10597 | |
| 10598 | return $cached->result; |
| 10599 | } |
| 10600 | |
| 10601 | $p2 = $this->currPos; |
| 10602 | // start seq_1 |
| 10603 | $p3 = $this->currPos; |
| 10604 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) { |
| 10605 | $r4 = "/>"; |
| 10606 | $this->currPos += 2; |
| 10607 | } else { |
| 10608 | if (!$silence) {$this->fail(65);} |
| 10609 | $r4 = self::$FAILED; |
| 10610 | $r1 = self::$FAILED; |
| 10611 | goto seq_1; |
| 10612 | } |
| 10613 | $this->savedPos = $this->currPos; |
| 10614 | $r5 = $this->a118(); |
| 10615 | if ($r5) { |
| 10616 | $r5 = false; |
| 10617 | } else { |
| 10618 | $r5 = self::$FAILED; |
| 10619 | $this->currPos = $p3; |
| 10620 | $r1 = self::$FAILED; |
| 10621 | goto seq_1; |
| 10622 | } |
| 10623 | $r1 = true; |
| 10624 | seq_1: |
| 10625 | if ($r1!==self::$FAILED) { |
| 10626 | $this->savedPos = $p2; |
| 10627 | $r1 = $this->a119(); |
| 10628 | } |
| 10629 | // free $p3 |
| 10630 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10631 | $this->currPos, |
| 10632 | $r1, |
| 10633 | self::$UNDEFINED, |
| 10634 | self::$UNDEFINED |
| 10635 | ); |
| 10636 | return $r1; |
| 10637 | } |
| 10638 | private function parseautourl($silence, $boolParams, &$param_preproc, &$param_th) { |
| 10639 | $key = json_encode([342, $boolParams & 0x3fff, $param_preproc, $param_th]); |
| 10640 | $bucket = $this->currPos; |
| 10641 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10642 | if ($cached) { |
| 10643 | $this->currPos = $cached->nextPos; |
| 10644 | if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; } |
| 10645 | if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; } |
| 10646 | return $cached->result; |
| 10647 | } |
| 10648 | $saved_preproc=$param_preproc; |
| 10649 | $saved_th=$param_th; |
| 10650 | $p2 = $this->currPos; |
| 10651 | // start seq_1 |
| 10652 | $p3 = $this->currPos; |
| 10653 | $p4 = $this->currPos; |
| 10654 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) { |
| 10655 | $r5 = "//"; |
| 10656 | $this->currPos += 2; |
| 10657 | } else { |
| 10658 | $r5 = self::$FAILED; |
| 10659 | } |
| 10660 | if ($r5 === self::$FAILED) { |
| 10661 | $r5 = false; |
| 10662 | } else { |
| 10663 | $r5 = self::$FAILED; |
| 10664 | $this->currPos = $p4; |
| 10665 | $r1 = self::$FAILED; |
| 10666 | goto seq_1; |
| 10667 | } |
| 10668 | // free $p4 |
| 10669 | $p4 = $this->currPos; |
| 10670 | // start seq_2 |
| 10671 | $p7 = $this->currPos; |
| 10672 | $r8 = $this->parseurl_protocol($silence); |
| 10673 | // proto <- $r8 |
| 10674 | if ($r8===self::$FAILED) { |
| 10675 | $r6 = self::$FAILED; |
| 10676 | goto seq_2; |
| 10677 | } |
| 10678 | // start choice_1 |
| 10679 | $r9 = $this->parseipv6urladdr($silence); |
| 10680 | if ($r9!==self::$FAILED) { |
| 10681 | goto choice_1; |
| 10682 | } |
| 10683 | $r9 = ''; |
| 10684 | choice_1: |
| 10685 | // addr <- $r9 |
| 10686 | if ($r9===self::$FAILED) { |
| 10687 | $this->currPos = $p7; |
| 10688 | $r6 = self::$FAILED; |
| 10689 | goto seq_2; |
| 10690 | } |
| 10691 | $r10 = []; |
| 10692 | for (;;) { |
| 10693 | $p12 = $this->currPos; |
| 10694 | // start seq_3 |
| 10695 | $p13 = $this->currPos; |
| 10696 | $p14 = $this->currPos; |
| 10697 | $r15 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th); |
| 10698 | if ($r15 === self::$FAILED) { |
| 10699 | $r15 = false; |
| 10700 | } else { |
| 10701 | $r15 = self::$FAILED; |
| 10702 | $this->currPos = $p14; |
| 10703 | $r11 = self::$FAILED; |
| 10704 | goto seq_3; |
| 10705 | } |
| 10706 | // free $p14 |
| 10707 | // start choice_2 |
| 10708 | $r16 = $this->parseno_punctuation_char($silence); |
| 10709 | if ($r16!==self::$FAILED) { |
| 10710 | goto choice_2; |
| 10711 | } |
| 10712 | $r16 = $this->parsecomment($silence); |
| 10713 | if ($r16!==self::$FAILED) { |
| 10714 | goto choice_2; |
| 10715 | } |
| 10716 | $r16 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc); |
| 10717 | if ($r16!==self::$FAILED) { |
| 10718 | goto choice_2; |
| 10719 | } |
| 10720 | $p14 = $this->currPos; |
| 10721 | // start seq_4 |
| 10722 | $p17 = $this->currPos; |
| 10723 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 10724 | $this->currPos++; |
| 10725 | $r18 = "'"; |
| 10726 | } else { |
| 10727 | if (!$silence) {$this->fail(33);} |
| 10728 | $r18 = self::$FAILED; |
| 10729 | $r16 = self::$FAILED; |
| 10730 | goto seq_4; |
| 10731 | } |
| 10732 | $p19 = $this->currPos; |
| 10733 | if (($this->input[$this->currPos] ?? null) === "'") { |
| 10734 | $this->currPos++; |
| 10735 | $r20 = "'"; |
| 10736 | } else { |
| 10737 | $r20 = self::$FAILED; |
| 10738 | } |
| 10739 | if ($r20 === self::$FAILED) { |
| 10740 | $r20 = false; |
| 10741 | } else { |
| 10742 | $r20 = self::$FAILED; |
| 10743 | $this->currPos = $p19; |
| 10744 | $this->currPos = $p17; |
| 10745 | $r16 = self::$FAILED; |
| 10746 | goto seq_4; |
| 10747 | } |
| 10748 | // free $p19 |
| 10749 | $r16 = true; |
| 10750 | seq_4: |
| 10751 | if ($r16!==self::$FAILED) { |
| 10752 | $r16 = substr($this->input, $p14, $this->currPos - $p14); |
| 10753 | goto choice_2; |
| 10754 | } else { |
| 10755 | $r16 = self::$FAILED; |
| 10756 | } |
| 10757 | // free $p17 |
| 10758 | // free $p14 |
| 10759 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 10760 | $this->currPos++; |
| 10761 | $r16 = "{"; |
| 10762 | goto choice_2; |
| 10763 | } else { |
| 10764 | if (!$silence) {$this->fail(29);} |
| 10765 | $r16 = self::$FAILED; |
| 10766 | } |
| 10767 | $p14 = $this->currPos; |
| 10768 | // start seq_5 |
| 10769 | $p17 = $this->currPos; |
| 10770 | $p19 = $this->currPos; |
| 10771 | // start seq_6 |
| 10772 | $p22 = $this->currPos; |
| 10773 | $r23 = $this->parseraw_htmlentity(true); |
| 10774 | // rhe <- $r23 |
| 10775 | if ($r23===self::$FAILED) { |
| 10776 | $r21 = self::$FAILED; |
| 10777 | goto seq_6; |
| 10778 | } |
| 10779 | $this->savedPos = $this->currPos; |
| 10780 | $r24 = $this->a120($r8, $r9, $r23); |
| 10781 | if ($r24) { |
| 10782 | $r24 = false; |
| 10783 | } else { |
| 10784 | $r24 = self::$FAILED; |
| 10785 | $this->currPos = $p22; |
| 10786 | $r21 = self::$FAILED; |
| 10787 | goto seq_6; |
| 10788 | } |
| 10789 | $r21 = true; |
| 10790 | seq_6: |
| 10791 | // free $p22 |
| 10792 | if ($r21 === self::$FAILED) { |
| 10793 | $r21 = false; |
| 10794 | } else { |
| 10795 | $r21 = self::$FAILED; |
| 10796 | $this->currPos = $p19; |
| 10797 | $r16 = self::$FAILED; |
| 10798 | goto seq_5; |
| 10799 | } |
| 10800 | // free $p19 |
| 10801 | // start choice_3 |
| 10802 | $p19 = $this->currPos; |
| 10803 | // start seq_7 |
| 10804 | $p22 = $this->currPos; |
| 10805 | $p26 = $this->currPos; |
| 10806 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 10807 | $this->currPos++; |
| 10808 | $r27 = "&"; |
| 10809 | $r27 = false; |
| 10810 | $this->currPos = $p26; |
| 10811 | } else { |
| 10812 | $r27 = self::$FAILED; |
| 10813 | $r25 = self::$FAILED; |
| 10814 | goto seq_7; |
| 10815 | } |
| 10816 | // free $p26 |
| 10817 | $r28 = $this->parsehtmlentity($silence); |
| 10818 | // he <- $r28 |
| 10819 | if ($r28===self::$FAILED) { |
| 10820 | $this->currPos = $p22; |
| 10821 | $r25 = self::$FAILED; |
| 10822 | goto seq_7; |
| 10823 | } |
| 10824 | $r25 = true; |
| 10825 | seq_7: |
| 10826 | if ($r25!==self::$FAILED) { |
| 10827 | $this->savedPos = $p19; |
| 10828 | $r25 = $this->a9($r8, $r9, $r28); |
| 10829 | goto choice_3; |
| 10830 | } |
| 10831 | // free $p22 |
| 10832 | if (($this->input[$this->currPos] ?? null) === "&") { |
| 10833 | $this->currPos++; |
| 10834 | $r25 = "&"; |
| 10835 | } else { |
| 10836 | if (!$silence) {$this->fail(4);} |
| 10837 | $r25 = self::$FAILED; |
| 10838 | } |
| 10839 | choice_3: |
| 10840 | // r <- $r25 |
| 10841 | if ($r25===self::$FAILED) { |
| 10842 | $this->currPos = $p17; |
| 10843 | $r16 = self::$FAILED; |
| 10844 | goto seq_5; |
| 10845 | } |
| 10846 | $r16 = true; |
| 10847 | seq_5: |
| 10848 | if ($r16!==self::$FAILED) { |
| 10849 | $this->savedPos = $p14; |
| 10850 | $r16 = $this->a10($r8, $r9, $r25); |
| 10851 | } |
| 10852 | // free $p17 |
| 10853 | choice_2: |
| 10854 | // c <- $r16 |
| 10855 | if ($r16===self::$FAILED) { |
| 10856 | $this->currPos = $p13; |
| 10857 | $r11 = self::$FAILED; |
| 10858 | goto seq_3; |
| 10859 | } |
| 10860 | $r11 = true; |
| 10861 | seq_3: |
| 10862 | if ($r11!==self::$FAILED) { |
| 10863 | $this->savedPos = $p12; |
| 10864 | $r11 = $this->a11($r8, $r9, $r16); |
| 10865 | $r10[] = $r11; |
| 10866 | } else { |
| 10867 | break; |
| 10868 | } |
| 10869 | // free $p13 |
| 10870 | } |
| 10871 | // path <- $r10 |
| 10872 | // free $r11 |
| 10873 | $r6 = true; |
| 10874 | seq_2: |
| 10875 | // r <- $r6 |
| 10876 | if ($r6!==self::$FAILED) { |
| 10877 | $this->savedPos = $p4; |
| 10878 | $r6 = $this->a121($r8, $r9, $r10); |
| 10879 | } else { |
| 10880 | $this->currPos = $p3; |
| 10881 | $r1 = self::$FAILED; |
| 10882 | goto seq_1; |
| 10883 | } |
| 10884 | // free $p7 |
| 10885 | $this->savedPos = $this->currPos; |
| 10886 | $r11 = $this->a122($r6); |
| 10887 | if ($r11) { |
| 10888 | $r11 = false; |
| 10889 | } else { |
| 10890 | $r11 = self::$FAILED; |
| 10891 | $this->currPos = $p3; |
| 10892 | $r1 = self::$FAILED; |
| 10893 | goto seq_1; |
| 10894 | } |
| 10895 | $r1 = true; |
| 10896 | seq_1: |
| 10897 | if ($r1!==self::$FAILED) { |
| 10898 | $this->savedPos = $p2; |
| 10899 | $r1 = $this->a123($r6); |
| 10900 | } |
| 10901 | // free $p3 |
| 10902 | $this->cache[$bucket][$key] = new GrammarCacheEntry( |
| 10903 | $this->currPos, |
| 10904 | $r1, |
| 10905 | $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED, |
| 10906 | $saved_th !== $param_th ? $param_th : self::$UNDEFINED |
| 10907 | ); |
| 10908 | return $r1; |
| 10909 | } |
| 10910 | private function parseautoref($silence) { |
| 10911 | $key = 332; |
| 10912 | $bucket = $this->currPos; |
| 10913 | $cached = $this->cache[$bucket][$key] ?? null; |
| 10914 | if ($cached) { |
| 10915 | $this->currPos = $cached->nextPos; |
| 10916 | |
| 10917 | return $cached->result; |
| 10918 | } |
| 10919 | |
| 10920 | $p2 = $this->currPos; |
| 10921 | // start seq_1 |
| 10922 | $p3 = $this->currPos; |
| 10923 | // start choice_1 |
| 10924 | $r4 = $this->parseRFC($silence); |
| 10925 | if ($r4!==self::$FAILED) { |
| 10926 | goto choice_1; |
| 10927 | } |
| 10928 | $r4 = $this->parsePMID($silence); |
| 10929 | choice_1: |
| 10930 | // ref <- $r4 |
| 10931 | if ($r4===self::$FAILED) { |
| 10932 | $r1 = self::$FAILED; |
| 10933 | goto seq_1; |
| 10934 | } |
| 10935 | $r5 = []; |
| 10936 | for (;;) { |
| 10937 | $r6 = $this->parsespace_or_nbsp($silence); |
| 10938 | if ($r6!==self::$FAILED) { |
| 10939 | $r5[] = $r6; |
| 10940 | } else { |
| 10941 | break; |
| 10942 | } |
| 10943 | } |
| 10944 | if (count($r5) === 0) { |
| 10945 | $r5 = self::$FAILED; |
| 10946 | } |
| 10947 | // sp <- $r5 |
| 10948 | if ($r5===self::$FAILED) { |
| 10949 | $this->currPos = $p3; |