Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
73.17% |
4587 / 6269 |
|
45.00% |
135 / 300 |
CRAP | |
0.00% |
0 / 2 |
MediaWiki\Extension\Math\WikiTexVC\chr_unicode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
MediaWiki\Extension\Math\WikiTexVC\ord_unicode | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
MediaWiki\Extension\Math\WikiTexVC\peg_regex_test | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
SyntaxError | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
Parser | |
73.44% |
4587 / 6246 |
|
45.61% |
135 / 296 |
68109.11 | |
0.00% |
0 / 1 |
cleanup_state | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
1 | |||
input_substr | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
4 | |||
text | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
offset | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
line | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
column | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
expected | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
error | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_advancePos | |
50.00% |
6 / 12 |
|
0.00% |
0 / 1 |
13.12 | |||
peg_computePosDetails | |
71.43% |
5 / 7 |
|
0.00% |
0 / 1 |
3.21 | |||
peg_fail | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 | |||
peg_buildException_expectedComparator | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 | |||
peg_buildException | |
100.00% |
28 / 28 |
|
100.00% |
1 / 1 |
9 | |||
peg_f0 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f1 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f2 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f3 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f4 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f5 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f6 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f7 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f8 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f9 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f10 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f11 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f12 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f13 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f14 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f15 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f16 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f17 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f18 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f19 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f20 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f21 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f22 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f23 | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
peg_f24 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f25 | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
3 | |||
peg_f26 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f27 | |
75.00% |
3 / 4 |
|
0.00% |
0 / 1 |
2.06 | |||
peg_f28 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f29 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f30 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f31 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f32 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f33 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f34 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f35 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f36 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f37 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f38 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f39 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f40 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f41 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f42 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f43 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f44 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f45 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f46 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f47 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f48 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f49 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f50 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f51 | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
peg_f52 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f53 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f54 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f55 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f56 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f57 | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
peg_f58 | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
peg_f59 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f60 | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
peg_f61 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f62 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f63 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f64 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f65 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f66 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f67 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f68 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f69 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f70 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f71 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f72 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f73 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f74 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f75 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f76 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f77 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f78 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f79 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f80 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f81 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f82 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f83 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f84 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f85 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f86 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f87 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f88 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f89 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f90 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f91 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f92 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f93 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f94 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f95 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f96 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f97 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f98 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f99 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f100 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
peg_f101 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f102 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f103 | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
peg_f104 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f105 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f106 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f107 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f108 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f109 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f110 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f111 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f112 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f113 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
peg_f114 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f115 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f116 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
peg_f117 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f118 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f119 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f120 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f121 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f122 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f123 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f124 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f125 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f126 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f127 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f128 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f129 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f130 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f131 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f132 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f133 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f134 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f135 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f136 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f137 | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
peg_f138 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f139 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f140 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f141 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f142 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_f143 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f144 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f145 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f146 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f147 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f148 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f149 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f150 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
peg_f151 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
peg_parsestart | |
78.95% |
15 / 19 |
|
0.00% |
0 / 1 |
5.23 | |||
peg_parse_ | |
90.91% |
20 / 22 |
|
0.00% |
0 / 1 |
8.05 | |||
peg_parsetex_expr | |
82.50% |
33 / 40 |
|
0.00% |
0 / 1 |
10.54 | |||
peg_parseexpr | |
86.67% |
13 / 15 |
|
0.00% |
0 / 1 |
5.06 | |||
peg_parsene_expr | |
93.33% |
42 / 45 |
|
0.00% |
0 / 1 |
11.04 | |||
peg_parselitsq_aq | |
85.71% |
12 / 14 |
|
0.00% |
0 / 1 |
6.10 | |||
peg_parselitsq_fq | |
75.00% |
30 / 40 |
|
0.00% |
0 / 1 |
11.56 | |||
peg_parselitsq_uq | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
6 | |||
peg_parselitsq_dq | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
6 | |||
peg_parselitsq_zq | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
4 | |||
peg_parseexpr_nosqc | |
88.46% |
23 / 26 |
|
0.00% |
0 / 1 |
7.08 | |||
peg_parselit_aq | |
88.89% |
16 / 18 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parselit_fq | |
77.19% |
44 / 57 |
|
0.00% |
0 / 1 |
16.33 | |||
peg_parselit_uq | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
6 | |||
peg_parselit_dq | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
6 | |||
peg_parselit_uqn | |
73.68% |
14 / 19 |
|
0.00% |
0 / 1 |
5.46 | |||
peg_parselit_dqn | |
94.74% |
18 / 19 |
|
0.00% |
0 / 1 |
5.00 | |||
peg_parseleft | |
90.62% |
29 / 32 |
|
0.00% |
0 / 1 |
8.05 | |||
peg_parseright | |
78.12% |
25 / 32 |
|
0.00% |
0 / 1 |
8.67 | |||
peg_parselit | |
86.90% |
557 / 641 |
|
0.00% |
0 / 1 |
222.79 | |||
peg_parsearray | |
84.21% |
16 / 19 |
|
0.00% |
0 / 1 |
5.10 | |||
peg_parsealignat | |
73.68% |
14 / 19 |
|
0.00% |
0 / 1 |
5.46 | |||
peg_parsematrix | |
81.25% |
26 / 32 |
|
0.00% |
0 / 1 |
8.42 | |||
peg_parseline_start | |
85.71% |
18 / 21 |
|
0.00% |
0 / 1 |
6.10 | |||
peg_parseline | |
81.25% |
26 / 32 |
|
0.00% |
0 / 1 |
8.42 | |||
peg_parsecolumn_spec | |
85.29% |
29 / 34 |
|
0.00% |
0 / 1 |
9.26 | |||
peg_parseone_col | |
40.72% |
79 / 194 |
|
0.00% |
0 / 1 |
733.77 | |||
peg_parsealignat_spec | |
72.92% |
35 / 48 |
|
0.00% |
0 / 1 |
17.89 | |||
peg_parseopt_pos | |
29.41% |
15 / 51 |
|
0.00% |
0 / 1 |
106.04 | |||
peg_parsechem_lit | |
78.26% |
18 / 23 |
|
0.00% |
0 / 1 |
6.37 | |||
peg_parsechem_sentence | |
79.59% |
39 / 49 |
|
0.00% |
0 / 1 |
14.44 | |||
peg_parsechem_phrase | |
82.46% |
47 / 57 |
|
0.00% |
0 / 1 |
18.56 | |||
peg_parsechem_word | |
94.44% |
34 / 36 |
|
0.00% |
0 / 1 |
9.01 | |||
peg_parsechem_word_nt | |
90.00% |
18 / 20 |
|
0.00% |
0 / 1 |
6.04 | |||
peg_parsechem_char | |
90.00% |
18 / 20 |
|
0.00% |
0 / 1 |
6.04 | |||
peg_parsechem_char_nl | |
55.41% |
41 / 74 |
|
0.00% |
0 / 1 |
51.02 | |||
peg_parsechem_bond | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
42 | |||
peg_parsechem_script | |
52.83% |
28 / 53 |
|
0.00% |
0 / 1 |
30.74 | |||
peg_parsechem_macro | |
35.44% |
28 / 79 |
|
0.00% |
0 / 1 |
127.62 | |||
peg_parsechem_text | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
42 | |||
peg_parseCHEM_COLOR | |
0.00% |
0 / 51 |
|
0.00% |
0 / 1 |
240 | |||
peg_parsealpha | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseliteral_id | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseliteral_mn | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
5 | |||
peg_parseliteral_uf_lt | |
69.23% |
9 / 13 |
|
0.00% |
0 / 1 |
5.73 | |||
peg_parsedelimiter_uf_lt | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseliteral_uf_op | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parsedelimiter_uf_op | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseboxchars | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseBOX | |
76.27% |
45 / 59 |
|
0.00% |
0 / 1 |
20.86 | |||
peg_parseLITERAL | |
84.56% |
241 / 285 |
|
0.00% |
0 / 1 |
101.97 | |||
peg_parseDELIMITER | |
93.81% |
91 / 97 |
|
0.00% |
0 / 1 |
27.17 | |||
peg_parseFUN_AR1nb | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseFUN_AR1opt | |
90.00% |
36 / 40 |
|
0.00% |
0 / 1 |
11.12 | |||
peg_parseNEXT_CELL | |
86.96% |
20 / 23 |
|
0.00% |
0 / 1 |
7.11 | |||
peg_parseLATEX_LENGTH | |
76.00% |
19 / 25 |
|
0.00% |
0 / 1 |
7.68 | |||
peg_parseLATEX_SIGN | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseLATEX_NUMBER | |
53.23% |
33 / 62 |
|
0.00% |
0 / 1 |
55.94 | |||
peg_parseLATEX_UNIT | |
67.31% |
70 / 104 |
|
0.00% |
0 / 1 |
111.65 | |||
peg_parseNEXT_ROW | |
83.64% |
46 / 55 |
|
0.00% |
0 / 1 |
17.12 | |||
peg_parseBEGIN | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
7 | |||
peg_parseEND | |
65.22% |
15 / 23 |
|
0.00% |
0 / 1 |
9.06 | |||
peg_parseBEGIN_MATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_MATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_PMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_PMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_BMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_BMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_BBMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_BBMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_VMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_VMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_VVMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_VVMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_ARRAY | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_ARRAY | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_ALIGN | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_ALIGN | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_ALIGNED | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_ALIGNED | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_ALIGNAT | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_ALIGNAT | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_ALIGNEDAT | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_ALIGNEDAT | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_SMALLMATRIX | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_SMALLMATRIX | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseBEGIN_CASES | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
8.09 | |||
peg_parseEND_CASES | |
66.67% |
18 / 27 |
|
0.00% |
0 / 1 |
10.37 | |||
peg_parseSQ_CLOSE | |
86.96% |
20 / 23 |
|
0.00% |
0 / 1 |
7.11 | |||
peg_parseCURLY_OPEN | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
7 | |||
peg_parseCURLY_CLOSE | |
86.96% |
20 / 23 |
|
0.00% |
0 / 1 |
7.11 | |||
peg_parseSUP | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
7 | |||
peg_parseSUB | |
95.65% |
22 / 23 |
|
0.00% |
0 / 1 |
7 | |||
peg_parsegeneric_func | |
100.00% |
30 / 30 |
|
100.00% |
1 / 1 |
9 | |||
peg_parseBIG | |
96.30% |
26 / 27 |
|
0.00% |
0 / 1 |
7 | |||
peg_parseFUN_AR1 | |
82.61% |
57 / 69 |
|
0.00% |
0 / 1 |
18.52 | |||
peg_parseFUN_MHCHEM | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseFUN_AR2 | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseFUN_AR4_MHCHEM_TEXIFIED | |
62.96% |
17 / 27 |
|
0.00% |
0 / 1 |
9.49 | |||
peg_parseFUN_INFIX | |
74.07% |
20 / 27 |
|
0.00% |
0 / 1 |
7.85 | |||
peg_parseDECLh | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseFUN_AR2nb | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseLEFTI | |
96.15% |
25 / 26 |
|
0.00% |
0 / 1 |
7 | |||
peg_parseRIGHTI | |
80.77% |
21 / 26 |
|
0.00% |
0 / 1 |
7.35 | |||
peg_parseHLINE | |
88.89% |
24 / 27 |
|
0.00% |
0 / 1 |
7.07 | |||
peg_parseCOLOR | |
90.32% |
28 / 31 |
|
0.00% |
0 / 1 |
8.06 | |||
peg_parseDEFINECOLOR | |
50.58% |
130 / 257 |
|
0.00% |
0 / 1 |
716.07 | |||
peg_parseCOLOR_SPEC | |
73.79% |
183 / 248 |
|
0.00% |
0 / 1 |
168.95 | |||
peg_parseCOLOR_SPEC_NAMED | |
78.43% |
40 / 51 |
|
0.00% |
0 / 1 |
17.26 | |||
peg_parseCOLOR_SPEC_GRAY | |
67.44% |
29 / 43 |
|
0.00% |
0 / 1 |
18.83 | |||
peg_parseCOLOR_SPEC_rgb | |
70.67% |
53 / 75 |
|
0.00% |
0 / 1 |
34.22 | |||
peg_parseCOLOR_SPEC_RGBI | |
66.67% |
50 / 75 |
|
0.00% |
0 / 1 |
39.93 | |||
peg_parseCOLOR_SPEC_CMYK | |
65.22% |
60 / 92 |
|
0.00% |
0 / 1 |
57.68 | |||
peg_parseCNUM255 | |
75.32% |
58 / 77 |
|
0.00% |
0 / 1 |
30.95 | |||
peg_parseCNUM | |
91.35% |
95 / 104 |
|
0.00% |
0 / 1 |
31.62 | |||
peg_parseCHEM_SINGLE_MACRO | |
67.39% |
31 / 46 |
|
0.00% |
0 / 1 |
18.86 | |||
peg_parseCHEM_BONDI | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
19.23 | |||
peg_parseCHEM_MACRO_1P | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
19.23 | |||
peg_parseCHEM_MACRO_2P | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
19.23 | |||
peg_parseCHEM_MACRO_2PU | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
19.23 | |||
peg_parseCHEM_MACRO_2PC | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
19.23 | |||
peg_parseCHEM_SCRIPT_FOLLOW | |
41.18% |
7 / 17 |
|
0.00% |
0 / 1 |
16.97 | |||
peg_parseCHEM_SUPERSUB | |
90.00% |
18 / 20 |
|
0.00% |
0 / 1 |
8.06 | |||
peg_parseCHEM_BOND_TYPE | |
0.00% |
0 / 111 |
|
0.00% |
0 / 1 |
2256 | |||
peg_parseBEGIN_MATH | |
37.04% |
10 / 27 |
|
0.00% |
0 / 1 |
23.97 | |||
peg_parseEND_MATH | |
0.00% |
0 / 27 |
|
0.00% |
0 / 1 |
72 | |||
peg_parseCHEM_LETTER | |
84.62% |
11 / 13 |
|
0.00% |
0 / 1 |
5.09 | |||
peg_parseCHEM_NONLETTER | |
68.92% |
51 / 74 |
|
0.00% |
0 / 1 |
38.88 | |||
peg_parseimpossible | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
20 | |||
peg_parseEOF | |
83.33% |
10 / 12 |
|
0.00% |
0 / 1 |
4.07 | |||
parse | |
97.67% |
210 / 215 |
|
0.00% |
0 / 1 |
9 |
1 | <?php |
2 | /* |
3 | * Generated by peggy 1.0.0 with phpeggy plugin |
4 | * |
5 | * https://peggyjs.org/ |
6 | */ |
7 | |
8 | namespace MediaWiki\Extension\Math\WikiTexVC; |
9 | |
10 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Box; |
11 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Big; |
12 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemFun2u; |
13 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemWord; |
14 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Declh; |
15 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Dollar; |
16 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\DQ; |
17 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\FQ; |
18 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1; |
19 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb; |
20 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2; |
21 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2nb; |
22 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq; |
23 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun4; |
24 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Infix; |
25 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal; |
26 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Lr; |
27 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\LengthSpec; |
28 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Matrix; |
29 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\Mhchem; |
30 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\UQ; |
31 | use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray; |
32 | use MediaWiki\Extension\Math\WikiTexVC\TexUtil; |
33 | use MediaWiki\Extension\Math\WikiTexVC\ParserUtil; |
34 | /* Useful functions: */ |
35 | |
36 | /* chr_unicode - get unicode character from its char code */ |
37 | if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\chr_unicode")) { |
38 | function chr_unicode($code) { |
39 | return html_entity_decode("&#$code;", ENT_QUOTES, "UTF-8"); |
40 | } |
41 | } |
42 | /* ord_unicode - get unicode char code from string */ |
43 | if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\ord_unicode")) { |
44 | function ord_unicode($character) { |
45 | if (strlen($character) === 1) { |
46 | return ord($character); |
47 | } |
48 | $json = json_encode($character); |
49 | $utf16_1 = hexdec(substr($json, 3, 4)); |
50 | if (substr($json, 7, 2) === "\u") { |
51 | $utf16_2 = hexdec(substr($json, 9, 4)); |
52 | return 0x10000 + (($utf16_1 & 0x3ff) << 10) + ($utf16_2 & 0x3ff); |
53 | } else { |
54 | return $utf16_1; |
55 | } |
56 | } |
57 | } |
58 | /* peg_regex_test - multibyte regex test */ |
59 | if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\peg_regex_test")) { |
60 | function peg_regex_test($pattern, $string) { |
61 | if (substr($pattern, -1) == "i") { |
62 | return mb_eregi(substr($pattern, 1, -2), $string); |
63 | } else { |
64 | return mb_ereg(substr($pattern, 1, -1), $string); |
65 | } |
66 | } |
67 | } |
68 | |
69 | /* Syntax error exception */ |
70 | if (!class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\SyntaxError", false)) { |
71 | class SyntaxError extends \Exception { |
72 | public $expected; |
73 | public $found; |
74 | public $grammarOffset; |
75 | public $grammarLine; |
76 | public $grammarColumn; |
77 | public $name; |
78 | public function __construct($message, $expected, $found, $offset, $line, $column) { |
79 | parent::__construct($message, 0); |
80 | $this->expected = $expected; |
81 | $this->found = $found; |
82 | $this->grammarOffset = $offset; |
83 | $this->grammarLine = $line; |
84 | $this->grammarColumn = $column; |
85 | $this->name = "SyntaxError"; |
86 | } |
87 | } |
88 | } |
89 | |
90 | class Parser { |
91 | private $tu; |
92 | private $options; |
93 | private $peg_currPos = 0; |
94 | private $peg_reportedPos = 0; |
95 | private $peg_cachedPos = 0; |
96 | private $peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false ); |
97 | private $peg_maxFailPos = 0; |
98 | private $peg_maxFailExpected = array(); |
99 | private $peg_silentFails = 0; |
100 | private $input = array(); |
101 | private $input_length = 0; |
102 | public $peg_cache = array(); |
103 | |
104 | private function cleanup_state() { |
105 | $this->peg_currPos = 0; |
106 | $this->peg_reportedPos = 0; |
107 | $this->peg_cachedPos = 0; |
108 | $this->peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false ); |
109 | $this->peg_maxFailPos = 0; |
110 | $this->peg_maxFailExpected = array(); |
111 | $this->peg_silentFails = 0; |
112 | $this->input = array(); |
113 | $this->input_length = 0; |
114 | $this->peg_cache = array(); |
115 | } |
116 | |
117 | private function input_substr($start, $length) { |
118 | if ($length === 1 && $start < $this->input_length) { |
119 | return $this->input[$start]; |
120 | } |
121 | $substr = ''; |
122 | $max = min($start + $length, $this->input_length); |
123 | for ($i = $start; $i < $max; $i++) { |
124 | $substr .= $this->input[$i]; |
125 | } |
126 | return $substr; |
127 | } |
128 | |
129 | |
130 | private function text() { |
131 | return $this->input_substr($this->peg_reportedPos, $this->peg_currPos - $this->peg_reportedPos); |
132 | } |
133 | |
134 | private function offset() { |
135 | return $this->peg_reportedPos; |
136 | } |
137 | |
138 | private function line() { |
139 | $compute_pd = $this->peg_computePosDetails($this->peg_reportedPos); |
140 | return $compute_pd["line"]; |
141 | } |
142 | |
143 | private function column() { |
144 | $compute_pd = $this->peg_computePosDetails($this->peg_reportedPos); |
145 | return $compute_pd["column"]; |
146 | } |
147 | |
148 | private function expected($description) { |
149 | throw $this->peg_buildException( |
150 | null, |
151 | array(array("type" => "other", "description" => $description )), |
152 | $this->peg_reportedPos |
153 | ); |
154 | } |
155 | |
156 | private function error($message) { |
157 | throw $this->peg_buildException($message, null, $this->peg_reportedPos); |
158 | } |
159 | |
160 | private function peg_advancePos(&$details, $startPos, $endPos) { |
161 | for ($p = $startPos; $p < $endPos; $p++) { |
162 | $ch = $this->input_substr($p, 1); |
163 | if ($ch === "\n") { |
164 | if (!$details["seenCR"]) { $details["line"]++; } |
165 | $details["column"] = 1; |
166 | $details["seenCR"] = false; |
167 | } else if ($ch === "\r" || $ch === "\u2028" || $ch === "\u2029") { |
168 | $details["line"]++; |
169 | $details["column"] = 1; |
170 | $details["seenCR"] = true; |
171 | } else { |
172 | $details["column"]++; |
173 | $details["seenCR"] = false; |
174 | } |
175 | } |
176 | } |
177 | |
178 | private function peg_computePosDetails($pos) { |
179 | if ($this->peg_cachedPos !== $pos) { |
180 | if ($this->peg_cachedPos > $pos) { |
181 | $this->peg_cachedPos = 0; |
182 | $this->peg_cachedPosDetails = array( "line" => 1, "column" => 1, "seenCR" => false ); |
183 | } |
184 | $this->peg_advancePos($this->peg_cachedPosDetails, $this->peg_cachedPos, $pos); |
185 | $this->peg_cachedPos = $pos; |
186 | } |
187 | |
188 | return $this->peg_cachedPosDetails; |
189 | } |
190 | |
191 | private function peg_fail($expected) { |
192 | if ($this->peg_currPos < $this->peg_maxFailPos) { return; } |
193 | |
194 | if ($this->peg_currPos > $this->peg_maxFailPos) { |
195 | $this->peg_maxFailPos = $this->peg_currPos; |
196 | $this->peg_maxFailExpected = array(); |
197 | } |
198 | |
199 | $this->peg_maxFailExpected[] = $expected; |
200 | } |
201 | |
202 | private function peg_buildException_expectedComparator($a, $b) { |
203 | if ($a["description"] < $b["description"]) { |
204 | return -1; |
205 | } else if ($a["description"] > $b["description"]) { |
206 | return 1; |
207 | } else { |
208 | return 0; |
209 | } |
210 | } |
211 | |
212 | private function peg_buildException($message, $expected, $pos) { |
213 | $posDetails = $this->peg_computePosDetails($pos); |
214 | $found = $pos < $this->input_length ? $this->input[$pos] : null; |
215 | |
216 | if ($expected !== null) { |
217 | usort($expected, array($this, "peg_buildException_expectedComparator")); |
218 | $i = 1; |
219 | while ($i < count($expected)) { |
220 | if ($expected[$i - 1] === $expected[$i]) { |
221 | array_splice($expected, $i, 1); |
222 | } else { |
223 | $i++; |
224 | } |
225 | } |
226 | } |
227 | |
228 | if ($message === null) { |
229 | $expectedDescs = array_fill(0, count($expected), null); |
230 | |
231 | for ($i = 0; $i < count($expected); $i++) { |
232 | $expectedDescs[$i] = $expected[$i]["description"]; |
233 | } |
234 | |
235 | $expectedDesc = count($expected) > 1 |
236 | ? join(", ", array_slice($expectedDescs, 0, -1)) |
237 | . " or " |
238 | . $expectedDescs[count($expected) - 1] |
239 | : $expectedDescs[0]; |
240 | |
241 | $foundDesc = $found ? json_encode($found) : "end of input"; |
242 | |
243 | $message = "Expected " . $expectedDesc . " but " . $foundDesc . " found."; |
244 | } |
245 | |
246 | return new SyntaxError( |
247 | $message, |
248 | $expected, |
249 | $found, |
250 | $pos, |
251 | $posDetails["line"], |
252 | $posDetails["column"] |
253 | ); |
254 | } |
255 | |
256 | private $peg_FAILED; |
257 | private $peg_c0; |
258 | private $peg_c1; |
259 | private $peg_c2; |
260 | private $peg_c3; |
261 | private $peg_c4; |
262 | private $peg_c5; |
263 | private $peg_c6; |
264 | private $peg_c7; |
265 | private $peg_c8; |
266 | private $peg_c9; |
267 | private $peg_c10; |
268 | private $peg_c11; |
269 | private $peg_c12; |
270 | private $peg_c13; |
271 | private $peg_c14; |
272 | private $peg_c15; |
273 | private $peg_c16; |
274 | private $peg_c17; |
275 | private $peg_c18; |
276 | private $peg_c19; |
277 | private $peg_c20; |
278 | private $peg_c21; |
279 | private $peg_c22; |
280 | private $peg_c23; |
281 | private $peg_c24; |
282 | private $peg_c25; |
283 | private $peg_c26; |
284 | private $peg_c27; |
285 | private $peg_c28; |
286 | private $peg_c29; |
287 | private $peg_c30; |
288 | private $peg_c31; |
289 | private $peg_c32; |
290 | private $peg_c33; |
291 | private $peg_c34; |
292 | private $peg_c35; |
293 | private $peg_c36; |
294 | private $peg_c37; |
295 | private $peg_c38; |
296 | private $peg_c39; |
297 | private $peg_c40; |
298 | private $peg_c41; |
299 | private $peg_c42; |
300 | private $peg_c43; |
301 | private $peg_c44; |
302 | private $peg_c45; |
303 | private $peg_c46; |
304 | private $peg_c47; |
305 | private $peg_c48; |
306 | private $peg_c49; |
307 | private $peg_c50; |
308 | private $peg_c51; |
309 | private $peg_c52; |
310 | private $peg_c53; |
311 | private $peg_c54; |
312 | private $peg_c55; |
313 | private $peg_c56; |
314 | private $peg_c57; |
315 | private $peg_c58; |
316 | private $peg_c59; |
317 | private $peg_c60; |
318 | private $peg_c61; |
319 | private $peg_c62; |
320 | private $peg_c63; |
321 | private $peg_c64; |
322 | private $peg_c65; |
323 | private $peg_c66; |
324 | private $peg_c67; |
325 | private $peg_c68; |
326 | private $peg_c69; |
327 | private $peg_c70; |
328 | private $peg_c71; |
329 | private $peg_c72; |
330 | private $peg_c73; |
331 | private $peg_c74; |
332 | private $peg_c75; |
333 | private $peg_c76; |
334 | private $peg_c77; |
335 | private $peg_c78; |
336 | private $peg_c79; |
337 | private $peg_c80; |
338 | private $peg_c81; |
339 | private $peg_c82; |
340 | private $peg_c83; |
341 | private $peg_c84; |
342 | private $peg_c85; |
343 | private $peg_c86; |
344 | private $peg_c87; |
345 | private $peg_c88; |
346 | private $peg_c89; |
347 | private $peg_c90; |
348 | private $peg_c91; |
349 | private $peg_c92; |
350 | private $peg_c93; |
351 | private $peg_c94; |
352 | private $peg_c95; |
353 | private $peg_c96; |
354 | private $peg_c97; |
355 | private $peg_c98; |
356 | private $peg_c99; |
357 | private $peg_c100; |
358 | private $peg_c101; |
359 | private $peg_c102; |
360 | private $peg_c103; |
361 | private $peg_c104; |
362 | private $peg_c105; |
363 | private $peg_c106; |
364 | private $peg_c107; |
365 | private $peg_c108; |
366 | private $peg_c109; |
367 | private $peg_c110; |
368 | private $peg_c111; |
369 | private $peg_c112; |
370 | private $peg_c113; |
371 | private $peg_c114; |
372 | private $peg_c115; |
373 | private $peg_c116; |
374 | private $peg_c117; |
375 | private $peg_c118; |
376 | private $peg_c119; |
377 | private $peg_c120; |
378 | private $peg_c121; |
379 | private $peg_c122; |
380 | private $peg_c123; |
381 | private $peg_c124; |
382 | private $peg_c125; |
383 | private $peg_c126; |
384 | private $peg_c127; |
385 | private $peg_c128; |
386 | private $peg_c129; |
387 | private $peg_c130; |
388 | private $peg_c131; |
389 | private $peg_c132; |
390 | private $peg_c133; |
391 | private $peg_c134; |
392 | private $peg_c135; |
393 | private $peg_c136; |
394 | private $peg_c137; |
395 | private $peg_c138; |
396 | private $peg_c139; |
397 | private $peg_c140; |
398 | private $peg_c141; |
399 | private $peg_c142; |
400 | private $peg_c143; |
401 | private $peg_c144; |
402 | private $peg_c145; |
403 | private $peg_c146; |
404 | private $peg_c147; |
405 | private $peg_c148; |
406 | private $peg_c149; |
407 | private $peg_c150; |
408 | private $peg_c151; |
409 | private $peg_c152; |
410 | private $peg_c153; |
411 | private $peg_c154; |
412 | private $peg_c155; |
413 | private $peg_c156; |
414 | private $peg_c157; |
415 | private $peg_c158; |
416 | private $peg_c159; |
417 | private $peg_c160; |
418 | private $peg_c161; |
419 | private $peg_c162; |
420 | private $peg_c163; |
421 | private $peg_c164; |
422 | private $peg_c165; |
423 | private $peg_c166; |
424 | private $peg_c167; |
425 | private $peg_c168; |
426 | private $peg_c169; |
427 | private $peg_c170; |
428 | private $peg_c171; |
429 | private $peg_c172; |
430 | private $peg_c173; |
431 | private $peg_c174; |
432 | private $peg_c175; |
433 | private $peg_c176; |
434 | private $peg_c177; |
435 | private $peg_c178; |
436 | private $peg_c179; |
437 | private $peg_c180; |
438 | private $peg_c181; |
439 | private $peg_c182; |
440 | private $peg_c183; |
441 | private $peg_c184; |
442 | |
443 | private function peg_f0($t) { |
444 | assert($t instanceof TexArray); |
445 | return $t; |
446 | } |
447 | private function peg_f1($e) { return $e; } |
448 | private function peg_f2($e1, $name, $e2) { return new TexArray( new Infix($name, $e1, $e2)); } |
449 | private function peg_f3() { return new TexArray(); } |
450 | private function peg_f4($h, $t) { return $t->unshift($h); } |
451 | private function peg_f5($d, $e) { return new TexArray(new Declh($d->getFname(), $e)); } |
452 | private function peg_f6($l1, $l2) { return new FQ($l1->getBase(), $l1->getDown(), $l2); } |
453 | private function peg_f7($l1, $l2) { return new FQ($l1->getBase(), $l2, $l1->getUp()); } |
454 | private function peg_f8($base, $upi) { return new UQ($base, $upi); } |
455 | private function peg_f9($base, $downi) { return new DQ($base, $downi); } |
456 | private function peg_f10() { return new Literal( "]"); } |
457 | private function peg_f11($l, $e) { return $e ->unshift( $l ); } |
458 | private function peg_f12($l1, $l2) { return new FQ ($l1->getBase(), $l2, $l1->getUp()); } |
459 | private function peg_f13($l1, $l2) { return new FQ(new TexArray(), $l1->getDown(), $l2); } |
460 | private function peg_f14($l) { return new UQ(new TexArray(),$l); } |
461 | private function peg_f15($l) { return new DQ(new TexArray(),$l); } |
462 | private function peg_f16($d) { return $d; } |
463 | private function peg_f17() { return "]"; } |
464 | private function peg_f18($r) { return new Literal($r); } |
465 | private function peg_f19($f) { return $this->tu->latex_function_names($f); } |
466 | private function peg_f20($f) { return " ";} |
467 | private function peg_f21($f, $c) { return new TexArray( new Literal( $f ) , new Literal( $c ) ) ; } |
468 | private function peg_f22($f) { return $this->tu->nullary_macro_aliase($f); } |
469 | private function peg_f23($f) { |
470 | $parser = new Parser(); |
471 | $ast = $parser->parse($this->tu->nullary_macro_aliase($f), $this->options); |
472 | assert($ast instanceof TexArray && $ast->getLength() === 1); |
473 | return $ast->first(); |
474 | } |
475 | private function peg_f24($f) { return $this->tu->deprecated_nullary_macro_aliase($f); } |
476 | private function peg_f25($f) { |
477 | $parser = new Parser(); |
478 | $ast = $parser->parse($this->tu->deprecated_nullary_macro_aliase($f), $this->options); |
479 | assert($ast instanceof TexArray && $ast->getLength() === 1); |
480 | if ($this->options['oldtexvc']){ |
481 | return $ast->first(); |
482 | } else { |
483 | throw new SyntaxError("Deprecation: Alias no longer supported.", [], $this->text(), $this->offset(), |
484 | $this->line(), $this->column()); |
485 | } |
486 | } |
487 | private function peg_f26($f) { return $this->tu->mediawiki_function_names($f); } |
488 | private function peg_f27($f) { |
489 | if(is_array($f)) { |
490 | // This is an unexpected case, but covers the ambiguity of slice in javascript. |
491 | $fProcessed = implode(array_slice($f, 1)); |
492 | } else { |
493 | $fProcessed = substr($f,1); |
494 | } |
495 | return new Fun1nb( '\\operatorname', new Literal( $fProcessed ) ); |
496 | } |
497 | private function peg_f28($b, $r) { return new Big($b, $r); } |
498 | private function peg_f29($b) { return new Big($b, "]"); } |
499 | private function peg_f30($l, $e, $r) {return new Lr($l, $r, $e); } |
500 | private function peg_f31($name, $e, $l) { return new Fun2sq($name, $e->setCurly(), $l); } |
501 | private function peg_f32($name, $l) { return new Fun1($name, $l); } |
502 | private function peg_f33($name, $l) { return new Fun1nb($name, $l); } |
503 | private function peg_f34($name, $l) { return new Mhchem($name, $l); } |
504 | private function peg_f35($name, $l1, $l2) { return new Fun2($name, $l1, $l2); } |
505 | private function peg_f36($name, $l1, $l2, $l3, $l4) { return new Fun4($name, $l1, $l2, $l3, $l4); } |
506 | private function peg_f37($name, $l1, $l2) { return new Fun2nb($name, $l1, $l2); } |
507 | private function peg_f38($e) { return $e->setCurly(); } |
508 | private function peg_f39($e1, $name, $e2) { return new Infix($name, $e1, $e2); } |
509 | private function peg_f40($m) { return $m->setTop( 'matrix' ); } |
510 | private function peg_f41($m) { return $m->setTop( 'pmatrix' ); } |
511 | private function peg_f42($m) { return $m->setTop( 'bmatrix' ); } |
512 | private function peg_f43($m) { return $m->setTop( 'Bmatrix' ); } |
513 | private function peg_f44($m) { return $m->setTop( 'vmatrix' ); } |
514 | private function peg_f45($m) { return $m->setTop( 'Vmatrix' ); } |
515 | private function peg_f46($m) { return $m->setTop( 'array' ); } |
516 | private function peg_f47($m) { return $m->setTop( 'aligned' ); } |
517 | private function peg_f48($m) { return $m->setTop( 'alignedat' ); } |
518 | private function peg_f49($m) { return $m->setTop( 'smallmatrix' ); } |
519 | private function peg_f50($m) { return $m->setTop( 'cases' ); } |
520 | private function peg_f51() { throw new SyntaxError("Illegal TeX function", [], $this->text(), $this->offset(), |
521 | $this->line(), $this->column()); } |
522 | private function peg_f52($f) { return !$this->tu->getAllFunctionsAt($f); } |
523 | private function peg_f53($f) { throw new SyntaxError("Illegal TeX function", [], $f, $this->offset(), $this->line(), $this->column()); } |
524 | private function peg_f54($cs, $m) { return $m->setColumnSpecs( $cs ); } |
525 | private function peg_f55($as, $m) { return $m->setColumnSpecs( $as ); } |
526 | private function peg_f56($l, $r, $m) { return [$m,$r]; } |
527 | private function peg_f57($l, $tail) { if ($tail === null) { return new Matrix( 'matrix', new TexArray( $l ) ); } |
528 | return new Matrix( 'matrix', $tail[0]->unshift($l), $tail[1] ); } |
529 | private function peg_f58($f, $l) { |
530 | if ($l->first() === null ) { |
531 | $l->push(new TexArray()); |
532 | } |
533 | $l->first()->unshift(new Literal($f . " ")); return $l;} |
534 | private function peg_f59($e, $l) { return $l; } |
535 | private function peg_f60($e, $tail) { |
536 | if ($tail === null) { return new TexArray( $e ) ; } |
537 | return $tail->unshift($e); |
538 | } |
539 | private function peg_f61() { return $this->text(); } |
540 | private function peg_f62($cs) { return TexArray::newCurly(new Literal($cs)); } |
541 | private function peg_f63($num) { return TexArray::newCurly(new Literal($num)); } |
542 | private function peg_f64($p, $s) { return new TexArray($p,new TexArray(new Literal(" "),$s)); } |
543 | private function peg_f65($p) { return new TexArray($p,new TexArray()); } |
544 | private function peg_f66($m) { return new Literal($m); } |
545 | private function peg_f67($m, $n) { return new ChemWord($m, new Literal($n)); } |
546 | private function peg_f68($m) { return $m; } |
547 | private function peg_f69($m, $n) { return new ChemWord($m, $n); } |
548 | private function peg_f70($m, $n, $o) { return new ChemWord(new ChemWord(new Literal($m), $n), $o); } |
549 | private function peg_f71() { return new Literal(""); } |
550 | private function peg_f72($m) { return $m;} |
551 | private function peg_f73($c) { return new Literal($c); } |
552 | private function peg_f74($c) { return TexArray::newCurly($c); } |
553 | private function peg_f75($c) { return new Dollar($c); } |
554 | private function peg_f76($e) { return TexArray::newCurly(new Literal($e)); } |
555 | private function peg_f77($a, $b) { return new ChemWord(new Literal($a), new Literal($b)); } |
556 | private function peg_f78($a, $b) { return new ChemWord(new Literal($a), $b); } |
557 | private function peg_f79($a, $b) { return new ChemWord(new Literal($a), new Dollar($b)); } |
558 | private function peg_f80($name, $l1, $l2) { return new ChemFun2u($name, $l1, $l2); } |
559 | private function peg_f81($cs) { return new Literal(join('',$cs)); } |
560 | private function peg_f82($name) { return new Literal(join('',$name)); } |
561 | private function peg_f83($b) { return $this->tu->box_functions($b); } |
562 | private function peg_f84($b, $cs) { return new Box($b, join('', $cs)); } |
563 | private function peg_f85($c) { return $c; } |
564 | private function peg_f86($f) { return $this->tu->nullary_macro($f); } |
565 | private function peg_f87($f) { return $f . " "; } |
566 | private function peg_f88($f) { return $this->options['usemathrm'] && $this->tu->nullary_macro_in_mbox($f); } |
567 | private function peg_f89($f) { return "\\mathrm {" . $f . "} "; } |
568 | private function peg_f90($mathrm) { return $this->options['usemathrm'] && $mathrm === "\\mathrm"; } |
569 | private function peg_f91($mathrm, $f) { return $this->options['usemathrm'] && $this->tu->nullary_macro_in_mbox($f); } |
570 | private function peg_f92($mathrm, $f) { return $this->options['usemathrm'] ? "\\mathrm {" . $f . "} " : false;} |
571 | private function peg_f93($f) { return $this->tu->nullary_macro_in_mbox($f); } |
572 | private function peg_f94($f) { return "\\mbox{" . $f . "} "; } |
573 | private function peg_f95($mbox) { return $mbox === "\\mbox"; } |
574 | private function peg_f96($mbox, $f) { return $this->tu->nullary_macro_in_mbox($f); } |
575 | private function peg_f97($mbox, $f) { return "\\mbox{" . $f . "} "; } |
576 | private function peg_f98($f) { return $f; } |
577 | private function peg_f99($c) { return "\\" . $c; } |
578 | private function peg_f100($c) { if($this->options['oldtexvc']) { |
579 | return "\\" . $c; /* escape dangerous chars */ |
580 | } else { |
581 | throw new SyntaxError("Deprecation: % and $ need to be escaped.", [], $this->text(), $this->offset(), |
582 | $this->line(), $this->column()); |
583 | }} |
584 | private function peg_f101($f) { return $this->tu->other_delimiters1($f); } |
585 | private function peg_f102($f) { return $this->tu->other_delimiters2($f); } |
586 | private function peg_f103($f) { |
587 | $parser = new Parser(); |
588 | $p = $parser->parse($this->tu->other_delimiters2($f), $this->options); |
589 | # assert.ok(p instanceof TexArray && p.length === 1); |
590 | assert($p instanceof TexArray && count($p->getArgs()) === 1); |
591 | |
592 | # assert.ok(p.first() instanceof Literal); |
593 | assert($p->first() instanceof Literal); |
594 | |
595 | return $p->first()->getArg(); |
596 | } |
597 | private function peg_f104($f) { return $this->tu->fun_ar1nb($f); } |
598 | private function peg_f105($f) { return $this->tu->fun_ar1opt($f); } |
599 | private function peg_f106($s, $n, $u) { return new LengthSpec($s, $n, $u); } |
600 | private function peg_f107($l) { return $l; } |
601 | private function peg_f108($s) {return $s; } |
602 | private function peg_f109($f) { return $this->tu->big_literals($f); } |
603 | private function peg_f110($f) { return $this->tu->fun_ar1($f); } |
604 | private function peg_f111($f) { return $this->options['oldmhchem'] && $this->tu->fun_mhchem($f);} |
605 | private function peg_f112($f) { return $this->tu->other_fun_ar1($f); } |
606 | private function peg_f113($f) { if ($this->options['oldtexvc']) { |
607 | return $this->tu->other_fun_ar1($f); |
608 | } else { |
609 | throw new SyntaxError("Deprecation: \\Bbb and \\bold are not allowed in math mode.", [], |
610 | $this->text(), $this->offset(), $this->line(),$this->column()); |
611 | } |
612 | } |
613 | private function peg_f114($f) { return $this->tu->fun_mhchem($f); } |
614 | private function peg_f115($f) { return $this->tu->fun_ar2($f); } |
615 | private function peg_f116($f) { return $this->tu->fun_ar4($f) && $this->tu->mhchemtexified_required($f); } |
616 | private function peg_f117($f) { return $this->tu->fun_infix($f); } |
617 | private function peg_f118($f) { return $this->tu->declh_function($f); } |
618 | private function peg_f119($f) { return new Declh($f, new TexArray()); } |
619 | private function peg_f120($f) { return $this->tu->fun_ar2nb($f); } |
620 | private function peg_f121($f) { return $this->tu->left_function($f); } |
621 | private function peg_f122($f) { return $this->tu->right_function($f); } |
622 | private function peg_f123($f) { return $this->tu->hline_function($f); } |
623 | private function peg_f124($f) { return $this->tu->color_function($f); } |
624 | private function peg_f125($f, $cs) { return $f . " " . $cs; } |
625 | private function peg_f126($f) { return $this->tu->definecolor_function($f); } |
626 | private function peg_f127($f, $name, $cs) { return "{named}" . $cs; } |
627 | private function peg_f128($f, $name, $cs) { return "{gray}" . $cs; } |
628 | private function peg_f129($f, $name, $cs) { return "{rgb}" . $cs; } |
629 | private function peg_f130($f, $name, $cs) { return "{cmyk}" . $cs; } |
630 | private function peg_f131($f, $name, $a) { return $f . " {" . join('',$name) . "}" . $a; } |
631 | private function peg_f132($cs) { return "[named]" . $cs; } |
632 | private function peg_f133($cs) { return "[gray]" . $cs; } |
633 | private function peg_f134($cs) { return "[rgb]" . $cs; } |
634 | private function peg_f135($cs) { return "[cmyk]" . $cs; } |
635 | private function peg_f136($name) { return "{" . join('', $name) . "}"; } |
636 | private function peg_f137($k) { $s = is_array($k) ? $k[0] : $k; |
637 | return "{" . $s . "}";} |
638 | private function peg_f138($r, $g, $b) { return "{" . $r . "," . $g . "," . $b . "}"; } |
639 | private function peg_f139($c, $m, $y, $k) { return "{" . $c . "," . $m . "," . $y . "," . $k . "}"; } |
640 | private function peg_f140($n) { return intval($n, 10) <= 255; } |
641 | private function peg_f141($n) { return $n / 255; } |
642 | private function peg_f142($n) { return $n; } |
643 | private function peg_f143($f) { return $this->tu->mhchem_single_macro($f); } |
644 | private function peg_f144($f) { return $this->tu->mhchem_bond($f); } |
645 | private function peg_f145($f) { return $this->tu->mhchem_macro_1p($f); } |
646 | private function peg_f146($f) { return $this->tu->mhchem_macro_2p($f); } |
647 | private function peg_f147($f) { return $this->tu->mhchem_macro_2pu($f); } |
648 | private function peg_f148($f) { return $this->tu->mhchem_macro_2pc($f); } |
649 | private function peg_f149() { return "{}"; } |
650 | private function peg_f150() { return false; } |
651 | private function peg_f151() { return $this->peg_currPos === $this->input_length; } |
652 | |
653 | private function peg_parsestart() { |
654 | |
655 | $key = $this->peg_currPos * 130 + 0; |
656 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
657 | |
658 | if ($cached) { |
659 | $this->peg_currPos = $cached["nextPos"]; |
660 | return $cached["result"]; |
661 | } |
662 | |
663 | $s0 = $this->peg_currPos; |
664 | $s1 = $this->peg_parse_(); |
665 | if ($s1 !== $this->peg_FAILED) { |
666 | $s2 = $this->peg_parsetex_expr(); |
667 | if ($s2 !== $this->peg_FAILED) { |
668 | $this->peg_reportedPos = $s0; |
669 | $s1 = $this->peg_f0($s2); |
670 | $s0 = $s1; |
671 | } else { |
672 | $this->peg_currPos = $s0; |
673 | $s0 = $this->peg_FAILED; |
674 | } |
675 | } else { |
676 | $this->peg_currPos = $s0; |
677 | $s0 = $this->peg_FAILED; |
678 | } |
679 | |
680 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
681 | |
682 | return $s0; |
683 | } |
684 | |
685 | private function peg_parse_() { |
686 | |
687 | $key = $this->peg_currPos * 130 + 1; |
688 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
689 | |
690 | if ($cached) { |
691 | $this->peg_currPos = $cached["nextPos"]; |
692 | return $cached["result"]; |
693 | } |
694 | |
695 | $s0 = array(); |
696 | if (peg_regex_test($this->peg_c0, $this->input_substr($this->peg_currPos, 1))) { |
697 | $s1 = $this->input_substr($this->peg_currPos, 1); |
698 | $this->peg_currPos++; |
699 | } else { |
700 | $s1 = $this->peg_FAILED; |
701 | if ($this->peg_silentFails === 0) { |
702 | $this->peg_fail($this->peg_c1); |
703 | } |
704 | } |
705 | while ($s1 !== $this->peg_FAILED) { |
706 | $s0[] = $s1; |
707 | if (peg_regex_test($this->peg_c0, $this->input_substr($this->peg_currPos, 1))) { |
708 | $s1 = $this->input_substr($this->peg_currPos, 1); |
709 | $this->peg_currPos++; |
710 | } else { |
711 | $s1 = $this->peg_FAILED; |
712 | if ($this->peg_silentFails === 0) { |
713 | $this->peg_fail($this->peg_c1); |
714 | } |
715 | } |
716 | } |
717 | |
718 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
719 | |
720 | return $s0; |
721 | } |
722 | |
723 | private function peg_parsetex_expr() { |
724 | |
725 | $key = $this->peg_currPos * 130 + 2; |
726 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
727 | |
728 | if ($cached) { |
729 | $this->peg_currPos = $cached["nextPos"]; |
730 | return $cached["result"]; |
731 | } |
732 | |
733 | $s0 = $this->peg_currPos; |
734 | $s1 = $this->peg_parseexpr(); |
735 | if ($s1 !== $this->peg_FAILED) { |
736 | $s2 = $this->peg_parseEOF(); |
737 | if ($s2 !== $this->peg_FAILED) { |
738 | $this->peg_reportedPos = $s0; |
739 | $s1 = $this->peg_f1($s1); |
740 | $s0 = $s1; |
741 | } else { |
742 | $this->peg_currPos = $s0; |
743 | $s0 = $this->peg_FAILED; |
744 | } |
745 | } else { |
746 | $this->peg_currPos = $s0; |
747 | $s0 = $this->peg_FAILED; |
748 | } |
749 | if ($s0 === $this->peg_FAILED) { |
750 | $s0 = $this->peg_currPos; |
751 | $s1 = $this->peg_parsene_expr(); |
752 | if ($s1 !== $this->peg_FAILED) { |
753 | $s2 = $this->peg_parseFUN_INFIX(); |
754 | if ($s2 !== $this->peg_FAILED) { |
755 | $s3 = $this->peg_parsene_expr(); |
756 | if ($s3 !== $this->peg_FAILED) { |
757 | $s4 = $this->peg_parseEOF(); |
758 | if ($s4 !== $this->peg_FAILED) { |
759 | $this->peg_reportedPos = $s0; |
760 | $s1 = $this->peg_f2($s1, $s2, $s3); |
761 | $s0 = $s1; |
762 | } else { |
763 | $this->peg_currPos = $s0; |
764 | $s0 = $this->peg_FAILED; |
765 | } |
766 | } else { |
767 | $this->peg_currPos = $s0; |
768 | $s0 = $this->peg_FAILED; |
769 | } |
770 | } else { |
771 | $this->peg_currPos = $s0; |
772 | $s0 = $this->peg_FAILED; |
773 | } |
774 | } else { |
775 | $this->peg_currPos = $s0; |
776 | $s0 = $this->peg_FAILED; |
777 | } |
778 | } |
779 | |
780 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
781 | |
782 | return $s0; |
783 | } |
784 | |
785 | private function peg_parseexpr() { |
786 | |
787 | $key = $this->peg_currPos * 130 + 3; |
788 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
789 | |
790 | if ($cached) { |
791 | $this->peg_currPos = $cached["nextPos"]; |
792 | return $cached["result"]; |
793 | } |
794 | |
795 | $s0 = $this->peg_parsene_expr(); |
796 | if ($s0 === $this->peg_FAILED) { |
797 | $s0 = $this->peg_currPos; |
798 | $s1 = $this->peg_c2; |
799 | if ($s1 !== $this->peg_FAILED) { |
800 | $this->peg_reportedPos = $s0; |
801 | $s1 = $this->peg_f3(); |
802 | } |
803 | $s0 = $s1; |
804 | } |
805 | |
806 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
807 | |
808 | return $s0; |
809 | } |
810 | |
811 | private function peg_parsene_expr() { |
812 | |
813 | $key = $this->peg_currPos * 130 + 4; |
814 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
815 | |
816 | if ($cached) { |
817 | $this->peg_currPos = $cached["nextPos"]; |
818 | return $cached["result"]; |
819 | } |
820 | |
821 | $s0 = $this->peg_currPos; |
822 | $s1 = $this->peg_parselit_aq(); |
823 | if ($s1 !== $this->peg_FAILED) { |
824 | $s2 = $this->peg_parseexpr(); |
825 | if ($s2 !== $this->peg_FAILED) { |
826 | $this->peg_reportedPos = $s0; |
827 | $s1 = $this->peg_f4($s1, $s2); |
828 | $s0 = $s1; |
829 | } else { |
830 | $this->peg_currPos = $s0; |
831 | $s0 = $this->peg_FAILED; |
832 | } |
833 | } else { |
834 | $this->peg_currPos = $s0; |
835 | $s0 = $this->peg_FAILED; |
836 | } |
837 | if ($s0 === $this->peg_FAILED) { |
838 | $s0 = $this->peg_currPos; |
839 | $s1 = $this->peg_parselitsq_aq(); |
840 | if ($s1 !== $this->peg_FAILED) { |
841 | $s2 = $this->peg_parseexpr(); |
842 | if ($s2 !== $this->peg_FAILED) { |
843 | $this->peg_reportedPos = $s0; |
844 | $s1 = $this->peg_f4($s1, $s2); |
845 | $s0 = $s1; |
846 | } else { |
847 | $this->peg_currPos = $s0; |
848 | $s0 = $this->peg_FAILED; |
849 | } |
850 | } else { |
851 | $this->peg_currPos = $s0; |
852 | $s0 = $this->peg_FAILED; |
853 | } |
854 | if ($s0 === $this->peg_FAILED) { |
855 | $s0 = $this->peg_currPos; |
856 | $s1 = $this->peg_parseDECLh(); |
857 | if ($s1 !== $this->peg_FAILED) { |
858 | $s2 = $this->peg_parseexpr(); |
859 | if ($s2 !== $this->peg_FAILED) { |
860 | $this->peg_reportedPos = $s0; |
861 | $s1 = $this->peg_f5($s1, $s2); |
862 | $s0 = $s1; |
863 | } else { |
864 | $this->peg_currPos = $s0; |
865 | $s0 = $this->peg_FAILED; |
866 | } |
867 | } else { |
868 | $this->peg_currPos = $s0; |
869 | $s0 = $this->peg_FAILED; |
870 | } |
871 | } |
872 | } |
873 | |
874 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
875 | |
876 | return $s0; |
877 | } |
878 | |
879 | private function peg_parselitsq_aq() { |
880 | |
881 | $key = $this->peg_currPos * 130 + 5; |
882 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
883 | |
884 | if ($cached) { |
885 | $this->peg_currPos = $cached["nextPos"]; |
886 | return $cached["result"]; |
887 | } |
888 | |
889 | $s0 = $this->peg_parselitsq_fq(); |
890 | if ($s0 === $this->peg_FAILED) { |
891 | $s0 = $this->peg_parselitsq_dq(); |
892 | if ($s0 === $this->peg_FAILED) { |
893 | $s0 = $this->peg_parselitsq_uq(); |
894 | if ($s0 === $this->peg_FAILED) { |
895 | $s0 = $this->peg_parselitsq_zq(); |
896 | } |
897 | } |
898 | } |
899 | |
900 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
901 | |
902 | return $s0; |
903 | } |
904 | |
905 | private function peg_parselitsq_fq() { |
906 | |
907 | $key = $this->peg_currPos * 130 + 6; |
908 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
909 | |
910 | if ($cached) { |
911 | $this->peg_currPos = $cached["nextPos"]; |
912 | return $cached["result"]; |
913 | } |
914 | |
915 | $s0 = $this->peg_currPos; |
916 | $s1 = $this->peg_parselitsq_dq(); |
917 | if ($s1 !== $this->peg_FAILED) { |
918 | $s2 = $this->peg_parseSUP(); |
919 | if ($s2 !== $this->peg_FAILED) { |
920 | $s3 = $this->peg_parselit(); |
921 | if ($s3 !== $this->peg_FAILED) { |
922 | $this->peg_reportedPos = $s0; |
923 | $s1 = $this->peg_f6($s1, $s3); |
924 | $s0 = $s1; |
925 | } else { |
926 | $this->peg_currPos = $s0; |
927 | $s0 = $this->peg_FAILED; |
928 | } |
929 | } else { |
930 | $this->peg_currPos = $s0; |
931 | $s0 = $this->peg_FAILED; |
932 | } |
933 | } else { |
934 | $this->peg_currPos = $s0; |
935 | $s0 = $this->peg_FAILED; |
936 | } |
937 | if ($s0 === $this->peg_FAILED) { |
938 | $s0 = $this->peg_currPos; |
939 | $s1 = $this->peg_parselitsq_uq(); |
940 | if ($s1 !== $this->peg_FAILED) { |
941 | $s2 = $this->peg_parseSUB(); |
942 | if ($s2 !== $this->peg_FAILED) { |
943 | $s3 = $this->peg_parselit(); |
944 | if ($s3 !== $this->peg_FAILED) { |
945 | $this->peg_reportedPos = $s0; |
946 | $s1 = $this->peg_f7($s1, $s3); |
947 | $s0 = $s1; |
948 | } else { |
949 | $this->peg_currPos = $s0; |
950 | $s0 = $this->peg_FAILED; |
951 | } |
952 | } else { |
953 | $this->peg_currPos = $s0; |
954 | $s0 = $this->peg_FAILED; |
955 | } |
956 | } else { |
957 | $this->peg_currPos = $s0; |
958 | $s0 = $this->peg_FAILED; |
959 | } |
960 | } |
961 | |
962 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
963 | |
964 | return $s0; |
965 | } |
966 | |
967 | private function peg_parselitsq_uq() { |
968 | |
969 | $key = $this->peg_currPos * 130 + 7; |
970 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
971 | |
972 | if ($cached) { |
973 | $this->peg_currPos = $cached["nextPos"]; |
974 | return $cached["result"]; |
975 | } |
976 | |
977 | $s0 = $this->peg_currPos; |
978 | $s1 = $this->peg_parselitsq_zq(); |
979 | if ($s1 !== $this->peg_FAILED) { |
980 | $s2 = $this->peg_parseSUP(); |
981 | if ($s2 !== $this->peg_FAILED) { |
982 | $s3 = $this->peg_parselit(); |
983 | if ($s3 !== $this->peg_FAILED) { |
984 | $this->peg_reportedPos = $s0; |
985 | $s1 = $this->peg_f8($s1, $s3); |
986 | $s0 = $s1; |
987 | } else { |
988 | $this->peg_currPos = $s0; |
989 | $s0 = $this->peg_FAILED; |
990 | } |
991 | } else { |
992 | $this->peg_currPos = $s0; |
993 | $s0 = $this->peg_FAILED; |
994 | } |
995 | } else { |
996 | $this->peg_currPos = $s0; |
997 | $s0 = $this->peg_FAILED; |
998 | } |
999 | |
1000 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1001 | |
1002 | return $s0; |
1003 | } |
1004 | |
1005 | private function peg_parselitsq_dq() { |
1006 | |
1007 | $key = $this->peg_currPos * 130 + 8; |
1008 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1009 | |
1010 | if ($cached) { |
1011 | $this->peg_currPos = $cached["nextPos"]; |
1012 | return $cached["result"]; |
1013 | } |
1014 | |
1015 | $s0 = $this->peg_currPos; |
1016 | $s1 = $this->peg_parselitsq_zq(); |
1017 | if ($s1 !== $this->peg_FAILED) { |
1018 | $s2 = $this->peg_parseSUB(); |
1019 | if ($s2 !== $this->peg_FAILED) { |
1020 | $s3 = $this->peg_parselit(); |
1021 | if ($s3 !== $this->peg_FAILED) { |
1022 | $this->peg_reportedPos = $s0; |
1023 | $s1 = $this->peg_f9($s1, $s3); |
1024 | $s0 = $s1; |
1025 | } else { |
1026 | $this->peg_currPos = $s0; |
1027 | $s0 = $this->peg_FAILED; |
1028 | } |
1029 | } else { |
1030 | $this->peg_currPos = $s0; |
1031 | $s0 = $this->peg_FAILED; |
1032 | } |
1033 | } else { |
1034 | $this->peg_currPos = $s0; |
1035 | $s0 = $this->peg_FAILED; |
1036 | } |
1037 | |
1038 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1039 | |
1040 | return $s0; |
1041 | } |
1042 | |
1043 | private function peg_parselitsq_zq() { |
1044 | |
1045 | $key = $this->peg_currPos * 130 + 9; |
1046 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1047 | |
1048 | if ($cached) { |
1049 | $this->peg_currPos = $cached["nextPos"]; |
1050 | return $cached["result"]; |
1051 | } |
1052 | |
1053 | $s0 = $this->peg_currPos; |
1054 | $s1 = $this->peg_parseSQ_CLOSE(); |
1055 | if ($s1 !== $this->peg_FAILED) { |
1056 | $this->peg_reportedPos = $s0; |
1057 | $s1 = $this->peg_f10(); |
1058 | } |
1059 | $s0 = $s1; |
1060 | |
1061 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1062 | |
1063 | return $s0; |
1064 | } |
1065 | |
1066 | private function peg_parseexpr_nosqc() { |
1067 | |
1068 | $key = $this->peg_currPos * 130 + 10; |
1069 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1070 | |
1071 | if ($cached) { |
1072 | $this->peg_currPos = $cached["nextPos"]; |
1073 | return $cached["result"]; |
1074 | } |
1075 | |
1076 | $s0 = $this->peg_currPos; |
1077 | $s1 = $this->peg_parselit_aq(); |
1078 | if ($s1 !== $this->peg_FAILED) { |
1079 | $s2 = $this->peg_parseexpr_nosqc(); |
1080 | if ($s2 !== $this->peg_FAILED) { |
1081 | $this->peg_reportedPos = $s0; |
1082 | $s1 = $this->peg_f11($s1, $s2); |
1083 | $s0 = $s1; |
1084 | } else { |
1085 | $this->peg_currPos = $s0; |
1086 | $s0 = $this->peg_FAILED; |
1087 | } |
1088 | } else { |
1089 | $this->peg_currPos = $s0; |
1090 | $s0 = $this->peg_FAILED; |
1091 | } |
1092 | if ($s0 === $this->peg_FAILED) { |
1093 | $s0 = $this->peg_currPos; |
1094 | $s1 = $this->peg_c2; |
1095 | if ($s1 !== $this->peg_FAILED) { |
1096 | $this->peg_reportedPos = $s0; |
1097 | $s1 = $this->peg_f3(); |
1098 | } |
1099 | $s0 = $s1; |
1100 | } |
1101 | |
1102 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1103 | |
1104 | return $s0; |
1105 | } |
1106 | |
1107 | private function peg_parselit_aq() { |
1108 | |
1109 | $key = $this->peg_currPos * 130 + 11; |
1110 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1111 | |
1112 | if ($cached) { |
1113 | $this->peg_currPos = $cached["nextPos"]; |
1114 | return $cached["result"]; |
1115 | } |
1116 | |
1117 | $s0 = $this->peg_parselit_fq(); |
1118 | if ($s0 === $this->peg_FAILED) { |
1119 | $s0 = $this->peg_parselit_dq(); |
1120 | if ($s0 === $this->peg_FAILED) { |
1121 | $s0 = $this->peg_parselit_uq(); |
1122 | if ($s0 === $this->peg_FAILED) { |
1123 | $s0 = $this->peg_parselit_dqn(); |
1124 | if ($s0 === $this->peg_FAILED) { |
1125 | $s0 = $this->peg_parselit_uqn(); |
1126 | if ($s0 === $this->peg_FAILED) { |
1127 | $s0 = $this->peg_parselit(); |
1128 | } |
1129 | } |
1130 | } |
1131 | } |
1132 | } |
1133 | |
1134 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1135 | |
1136 | return $s0; |
1137 | } |
1138 | |
1139 | private function peg_parselit_fq() { |
1140 | |
1141 | $key = $this->peg_currPos * 130 + 12; |
1142 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1143 | |
1144 | if ($cached) { |
1145 | $this->peg_currPos = $cached["nextPos"]; |
1146 | return $cached["result"]; |
1147 | } |
1148 | |
1149 | $s0 = $this->peg_currPos; |
1150 | $s1 = $this->peg_parselit_dq(); |
1151 | if ($s1 !== $this->peg_FAILED) { |
1152 | $s2 = $this->peg_parseSUP(); |
1153 | if ($s2 !== $this->peg_FAILED) { |
1154 | $s3 = $this->peg_parselit(); |
1155 | if ($s3 !== $this->peg_FAILED) { |
1156 | $this->peg_reportedPos = $s0; |
1157 | $s1 = $this->peg_f6($s1, $s3); |
1158 | $s0 = $s1; |
1159 | } else { |
1160 | $this->peg_currPos = $s0; |
1161 | $s0 = $this->peg_FAILED; |
1162 | } |
1163 | } else { |
1164 | $this->peg_currPos = $s0; |
1165 | $s0 = $this->peg_FAILED; |
1166 | } |
1167 | } else { |
1168 | $this->peg_currPos = $s0; |
1169 | $s0 = $this->peg_FAILED; |
1170 | } |
1171 | if ($s0 === $this->peg_FAILED) { |
1172 | $s0 = $this->peg_currPos; |
1173 | $s1 = $this->peg_parselit_uq(); |
1174 | if ($s1 !== $this->peg_FAILED) { |
1175 | $s2 = $this->peg_parseSUB(); |
1176 | if ($s2 !== $this->peg_FAILED) { |
1177 | $s3 = $this->peg_parselit(); |
1178 | if ($s3 !== $this->peg_FAILED) { |
1179 | $this->peg_reportedPos = $s0; |
1180 | $s1 = $this->peg_f12($s1, $s3); |
1181 | $s0 = $s1; |
1182 | } else { |
1183 | $this->peg_currPos = $s0; |
1184 | $s0 = $this->peg_FAILED; |
1185 | } |
1186 | } else { |
1187 | $this->peg_currPos = $s0; |
1188 | $s0 = $this->peg_FAILED; |
1189 | } |
1190 | } else { |
1191 | $this->peg_currPos = $s0; |
1192 | $s0 = $this->peg_FAILED; |
1193 | } |
1194 | if ($s0 === $this->peg_FAILED) { |
1195 | $s0 = $this->peg_currPos; |
1196 | $s1 = $this->peg_parselit_dqn(); |
1197 | if ($s1 !== $this->peg_FAILED) { |
1198 | $s2 = $this->peg_parseSUP(); |
1199 | if ($s2 !== $this->peg_FAILED) { |
1200 | $s3 = $this->peg_parselit(); |
1201 | if ($s3 !== $this->peg_FAILED) { |
1202 | $this->peg_reportedPos = $s0; |
1203 | $s1 = $this->peg_f13($s1, $s3); |
1204 | $s0 = $s1; |
1205 | } else { |
1206 | $this->peg_currPos = $s0; |
1207 | $s0 = $this->peg_FAILED; |
1208 | } |
1209 | } else { |
1210 | $this->peg_currPos = $s0; |
1211 | $s0 = $this->peg_FAILED; |
1212 | } |
1213 | } else { |
1214 | $this->peg_currPos = $s0; |
1215 | $s0 = $this->peg_FAILED; |
1216 | } |
1217 | } |
1218 | } |
1219 | |
1220 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1221 | |
1222 | return $s0; |
1223 | } |
1224 | |
1225 | private function peg_parselit_uq() { |
1226 | |
1227 | $key = $this->peg_currPos * 130 + 13; |
1228 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1229 | |
1230 | if ($cached) { |
1231 | $this->peg_currPos = $cached["nextPos"]; |
1232 | return $cached["result"]; |
1233 | } |
1234 | |
1235 | $s0 = $this->peg_currPos; |
1236 | $s1 = $this->peg_parselit(); |
1237 | if ($s1 !== $this->peg_FAILED) { |
1238 | $s2 = $this->peg_parseSUP(); |
1239 | if ($s2 !== $this->peg_FAILED) { |
1240 | $s3 = $this->peg_parselit(); |
1241 | if ($s3 !== $this->peg_FAILED) { |
1242 | $this->peg_reportedPos = $s0; |
1243 | $s1 = $this->peg_f8($s1, $s3); |
1244 | $s0 = $s1; |
1245 | } else { |
1246 | $this->peg_currPos = $s0; |
1247 | $s0 = $this->peg_FAILED; |
1248 | } |
1249 | } else { |
1250 | $this->peg_currPos = $s0; |
1251 | $s0 = $this->peg_FAILED; |
1252 | } |
1253 | } else { |
1254 | $this->peg_currPos = $s0; |
1255 | $s0 = $this->peg_FAILED; |
1256 | } |
1257 | |
1258 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1259 | |
1260 | return $s0; |
1261 | } |
1262 | |
1263 | private function peg_parselit_dq() { |
1264 | |
1265 | $key = $this->peg_currPos * 130 + 14; |
1266 | $cached = isset($this->peg_cache[$key]) ? $this->peg_cache[$key] : null; |
1267 | |
1268 | if ($cached) { |
1269 | $this->peg_currPos = $cached["nextPos"]; |
1270 | return $cached["result"]; |
1271 | } |
1272 | |
1273 | $s0 = $this->peg_currPos; |
1274 | $s1 = $this->peg_parselit(); |
1275 | if ($s1 !== $this->peg_FAILED) { |
1276 | $s2 = $this->peg_parseSUB(); |
1277 | if ($s2 !== $this->peg_FAILED) { |
1278 | $s3 = $this->peg_parselit(); |
1279 | if ($s3 !== $this->peg_FAILED) { |
1280 | $this->peg_reportedPos = $s0; |
1281 | $s1 = $this->peg_f9($s1, $s3); |
1282 | $s0 = $s1; |
1283 | } else { |
1284 | $this->peg_currPos = $s0; |
1285 | $s0 = $this->peg_FAILED; |
1286 | } |
1287 | } else { |
1288 | $this->peg_currPos = $s0; |
1289 | $s0 = $this->peg_FAILED; |
1290 | } |
1291 | } else { |
1292 | $this->peg_currPos = $s0; |
1293 | $s0 = $this->peg_FAILED; |
1294 | } |
1295 | |
1296 | $this->peg_cache[$key] = array ("nextPos" => $this->peg_currPos, "result" => $s0 ); |
1297 | |
1298 | return $s0; |
1299 | } |
1300 | |
1301 | private function peg_parselit_uqn() { |
1302 | |
1303 | $key = $this->peg_currPos * 130 + 15; |