@echecs/pgn 3.4.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/grammar.cjs CHANGED
@@ -1,4 +1,4 @@
1
- // @generated by Peggy 5.0.6.
1
+ // @generated by Peggy 5.1.0.
2
2
  //
3
3
  // https://peggyjs.org/
4
4
  "use strict";
@@ -284,35 +284,123 @@ function peg$parse(input, options) {
284
284
  return move;
285
285
  }
286
286
  function peg$f13(n) { return parseInt(n.replace(/\./g, ''), 10); }
287
- function peg$f14(s) {
288
- if (s.startsWith('O-O')) {
289
- const isLong = s.startsWith('O-O-O');
290
- return { castling: true, long: isLong, piece: 'K', to: isLong ? 'O-O-O' : 'O-O' };
291
- }
292
- const m = s.match(/^([KQBNPR])?([a-h][1-8]|[a-h]|[1-8])?(x)?([a-h][1-8])(?:=([NBRQ]))?([+#])?$/);
293
- const piece = (m && m[1]) ? m[1] : 'P';
294
- const from = (m && m[2]) ? m[2] : undefined;
295
- const capture = !!(m && m[3]);
296
- const to = m ? m[4] : undefined;
297
- const promotion = (m && m[5]) ? m[5] : undefined;
298
- const indication = (m && m[6]) ? m[6] : undefined;
287
+ function peg$f14() { return { castling: true, long: true, piece: 'K', to: 'O-O-O' }; }
288
+ function peg$f15() { return { castling: true, long: false, piece: 'K', to: 'O-O' }; }
289
+ function peg$f16(piece, df, dr, file, rank, promo, ind) {
290
+ const to = file + rank;
291
+ const result = { capture: true, from: df + dr, piece, to };
292
+ if (promo)
293
+ result.promotion = promo;
294
+ if (ind === '+')
295
+ result.check = true;
296
+ if (ind === '#')
297
+ result.checkmate = true;
298
+ return result;
299
+ }
300
+ function peg$f17(piece, df, dr, file, rank, promo, ind) {
301
+ const to = file + rank;
302
+ const result = { from: df + dr, piece, to };
303
+ if (promo)
304
+ result.promotion = promo;
305
+ if (ind === '+')
306
+ result.check = true;
307
+ if (ind === '#')
308
+ result.checkmate = true;
309
+ return result;
310
+ }
311
+ function peg$f18(piece, df, file, rank, promo, ind) {
312
+ const to = file + rank;
313
+ const result = { capture: true, from: df, piece, to };
314
+ if (promo)
315
+ result.promotion = promo;
316
+ if (ind === '+')
317
+ result.check = true;
318
+ if (ind === '#')
319
+ result.checkmate = true;
320
+ return result;
321
+ }
322
+ function peg$f19(piece, dr, file, rank, promo, ind) {
323
+ const to = file + rank;
324
+ const result = { capture: true, from: dr, piece, to };
325
+ if (promo)
326
+ result.promotion = promo;
327
+ if (ind === '+')
328
+ result.check = true;
329
+ if (ind === '#')
330
+ result.checkmate = true;
331
+ return result;
332
+ }
333
+ function peg$f20(piece, df, file, rank, promo, ind) {
334
+ const to = file + rank;
335
+ const result = { from: df, piece, to };
336
+ if (promo)
337
+ result.promotion = promo;
338
+ if (ind === '+')
339
+ result.check = true;
340
+ if (ind === '#')
341
+ result.checkmate = true;
342
+ return result;
343
+ }
344
+ function peg$f21(piece, dr, file, rank, promo, ind) {
345
+ const to = file + rank;
346
+ const result = { from: dr, piece, to };
347
+ if (promo)
348
+ result.promotion = promo;
349
+ if (ind === '+')
350
+ result.check = true;
351
+ if (ind === '#')
352
+ result.checkmate = true;
353
+ return result;
354
+ }
355
+ function peg$f22(piece, file, rank, promo, ind) {
356
+ const to = file + rank;
357
+ const result = { capture: true, piece, to };
358
+ if (promo)
359
+ result.promotion = promo;
360
+ if (ind === '+')
361
+ result.check = true;
362
+ if (ind === '#')
363
+ result.checkmate = true;
364
+ return result;
365
+ }
366
+ function peg$f23(piece, file, rank, promo, ind) {
367
+ const to = file + rank;
299
368
  const result = { piece, to };
300
- if (from)
301
- result.from = from;
302
- if (capture)
303
- result.capture = true;
304
- if (promotion)
305
- result.promotion = promotion;
306
- if (indication === '+')
369
+ if (promo)
370
+ result.promotion = promo;
371
+ if (ind === '+')
372
+ result.check = true;
373
+ if (ind === '#')
374
+ result.checkmate = true;
375
+ return result;
376
+ }
377
+ function peg$f24(from, file, rank, promo, ind) {
378
+ const to = file + rank;
379
+ const result = { capture: true, from, piece: 'P', to };
380
+ if (promo)
381
+ result.promotion = promo;
382
+ if (ind === '+')
307
383
  result.check = true;
308
- if (indication === '#')
384
+ if (ind === '#')
309
385
  result.checkmate = true;
310
386
  return result;
311
387
  }
312
- function peg$f15(moves) { return moves; }
313
- function peg$f16(n) { return n; }
314
- function peg$f17(text) { return text.replace(/[\n\t]/g, ' ').trim(); }
315
- function peg$f18(text) { return text.trim(); }
388
+ function peg$f25(file, rank, promo, ind) {
389
+ const to = file + rank;
390
+ const result = { piece: 'P', to };
391
+ if (promo)
392
+ result.promotion = promo;
393
+ if (ind === '+')
394
+ result.check = true;
395
+ if (ind === '#')
396
+ result.checkmate = true;
397
+ return result;
398
+ }
399
+ function peg$f26(p) { return p; }
400
+ function peg$f27(moves) { return moves; }
401
+ function peg$f28(n) { return n; }
402
+ function peg$f29(text) { return text.replace(/[\n\t]/g, ' ').trim(); }
403
+ function peg$f30(text) { return text.trim(); }
316
404
  let peg$currPos = options.peg$currPos | 0;
317
405
  let peg$savedPos = peg$currPos;
318
406
  const peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -975,235 +1063,245 @@ function peg$parse(input, options) {
975
1063
  return s0;
976
1064
  }
977
1065
  function peg$parseSAN() {
978
- let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
1066
+ let s0;
1067
+ s0 = peg$parseCASTLING();
1068
+ if (s0 === peg$FAILED) {
1069
+ s0 = peg$parsePIECE_MOVE();
1070
+ if (s0 === peg$FAILED) {
1071
+ s0 = peg$parsePAWN_CAPTURE();
1072
+ if (s0 === peg$FAILED) {
1073
+ s0 = peg$parsePAWN_PUSH();
1074
+ }
1075
+ }
1076
+ }
1077
+ return s0;
1078
+ }
1079
+ function peg$parseCASTLING() {
1080
+ let s0, s1, s2, s3;
979
1081
  s0 = peg$currPos;
980
- s1 = peg$currPos;
981
- s2 = peg$currPos;
982
1082
  if (input.substr(peg$currPos, 5) === peg$c8) {
983
- s3 = peg$c8;
1083
+ s1 = peg$c8;
984
1084
  peg$currPos += 5;
985
1085
  }
986
1086
  else {
987
- s3 = peg$FAILED;
1087
+ s1 = peg$FAILED;
988
1088
  if (peg$silentFails === 0) {
989
1089
  peg$fail(peg$e11);
990
1090
  }
991
1091
  }
992
- if (s3 !== peg$FAILED) {
993
- s4 = input.charAt(peg$currPos);
994
- if (peg$r3.test(s4)) {
1092
+ if (s1 !== peg$FAILED) {
1093
+ s2 = peg$currPos;
1094
+ s3 = input.charAt(peg$currPos);
1095
+ if (peg$r3.test(s3)) {
995
1096
  peg$currPos++;
996
1097
  }
997
1098
  else {
998
- s4 = peg$FAILED;
1099
+ s3 = peg$FAILED;
999
1100
  if (peg$silentFails === 0) {
1000
1101
  peg$fail(peg$e12);
1001
1102
  }
1002
1103
  }
1003
- if (s4 === peg$FAILED) {
1004
- s4 = null;
1104
+ if (s3 === peg$FAILED) {
1105
+ s3 = null;
1005
1106
  }
1006
- s3 = [s3, s4];
1007
- s2 = s3;
1107
+ s2 = input.substring(s2, peg$currPos);
1108
+ peg$savedPos = s0;
1109
+ s0 = peg$f14();
1008
1110
  }
1009
1111
  else {
1010
- peg$currPos = s2;
1011
- s2 = peg$FAILED;
1112
+ peg$currPos = s0;
1113
+ s0 = peg$FAILED;
1012
1114
  }
1013
- if (s2 === peg$FAILED) {
1014
- s2 = peg$currPos;
1115
+ if (s0 === peg$FAILED) {
1116
+ s0 = peg$currPos;
1015
1117
  if (input.substr(peg$currPos, 3) === peg$c9) {
1016
- s3 = peg$c9;
1118
+ s1 = peg$c9;
1017
1119
  peg$currPos += 3;
1018
1120
  }
1019
1121
  else {
1020
- s3 = peg$FAILED;
1122
+ s1 = peg$FAILED;
1021
1123
  if (peg$silentFails === 0) {
1022
1124
  peg$fail(peg$e13);
1023
1125
  }
1024
1126
  }
1025
- if (s3 !== peg$FAILED) {
1026
- s4 = input.charAt(peg$currPos);
1027
- if (peg$r3.test(s4)) {
1127
+ if (s1 !== peg$FAILED) {
1128
+ s2 = peg$currPos;
1129
+ s3 = input.charAt(peg$currPos);
1130
+ if (peg$r3.test(s3)) {
1028
1131
  peg$currPos++;
1029
1132
  }
1030
1133
  else {
1031
- s4 = peg$FAILED;
1134
+ s3 = peg$FAILED;
1032
1135
  if (peg$silentFails === 0) {
1033
1136
  peg$fail(peg$e12);
1034
1137
  }
1035
1138
  }
1036
- if (s4 === peg$FAILED) {
1037
- s4 = null;
1139
+ if (s3 === peg$FAILED) {
1140
+ s3 = null;
1038
1141
  }
1039
- s3 = [s3, s4];
1040
- s2 = s3;
1142
+ s2 = input.substring(s2, peg$currPos);
1143
+ peg$savedPos = s0;
1144
+ s0 = peg$f15();
1145
+ }
1146
+ else {
1147
+ peg$currPos = s0;
1148
+ s0 = peg$FAILED;
1149
+ }
1150
+ }
1151
+ return s0;
1152
+ }
1153
+ function peg$parsePIECE_MOVE() {
1154
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1155
+ s0 = peg$currPos;
1156
+ s1 = input.charAt(peg$currPos);
1157
+ if (peg$r4.test(s1)) {
1158
+ peg$currPos++;
1159
+ }
1160
+ else {
1161
+ s1 = peg$FAILED;
1162
+ if (peg$silentFails === 0) {
1163
+ peg$fail(peg$e14);
1164
+ }
1165
+ }
1166
+ if (s1 !== peg$FAILED) {
1167
+ s2 = input.charAt(peg$currPos);
1168
+ if (peg$r5.test(s2)) {
1169
+ peg$currPos++;
1041
1170
  }
1042
1171
  else {
1043
- peg$currPos = s2;
1044
1172
  s2 = peg$FAILED;
1173
+ if (peg$silentFails === 0) {
1174
+ peg$fail(peg$e15);
1175
+ }
1045
1176
  }
1046
- if (s2 === peg$FAILED) {
1047
- s2 = peg$currPos;
1177
+ if (s2 !== peg$FAILED) {
1048
1178
  s3 = input.charAt(peg$currPos);
1049
- if (peg$r4.test(s3)) {
1179
+ if (peg$r6.test(s3)) {
1050
1180
  peg$currPos++;
1051
1181
  }
1052
1182
  else {
1053
1183
  s3 = peg$FAILED;
1054
1184
  if (peg$silentFails === 0) {
1055
- peg$fail(peg$e14);
1185
+ peg$fail(peg$e16);
1056
1186
  }
1057
1187
  }
1058
1188
  if (s3 !== peg$FAILED) {
1059
- s4 = input.charAt(peg$currPos);
1060
- if (peg$r5.test(s4)) {
1189
+ if (input.charCodeAt(peg$currPos) === 120) {
1190
+ s4 = peg$c10;
1061
1191
  peg$currPos++;
1062
1192
  }
1063
1193
  else {
1064
1194
  s4 = peg$FAILED;
1065
1195
  if (peg$silentFails === 0) {
1066
- peg$fail(peg$e15);
1196
+ peg$fail(peg$e17);
1067
1197
  }
1068
1198
  }
1069
1199
  if (s4 !== peg$FAILED) {
1070
1200
  s5 = input.charAt(peg$currPos);
1071
- if (peg$r6.test(s5)) {
1201
+ if (peg$r5.test(s5)) {
1072
1202
  peg$currPos++;
1073
1203
  }
1074
1204
  else {
1075
1205
  s5 = peg$FAILED;
1076
1206
  if (peg$silentFails === 0) {
1077
- peg$fail(peg$e16);
1207
+ peg$fail(peg$e15);
1078
1208
  }
1079
1209
  }
1080
1210
  if (s5 !== peg$FAILED) {
1081
- if (input.charCodeAt(peg$currPos) === 120) {
1082
- s6 = peg$c10;
1211
+ s6 = input.charAt(peg$currPos);
1212
+ if (peg$r6.test(s6)) {
1083
1213
  peg$currPos++;
1084
1214
  }
1085
1215
  else {
1086
1216
  s6 = peg$FAILED;
1087
1217
  if (peg$silentFails === 0) {
1088
- peg$fail(peg$e17);
1218
+ peg$fail(peg$e16);
1089
1219
  }
1090
1220
  }
1091
1221
  if (s6 !== peg$FAILED) {
1092
- s7 = input.charAt(peg$currPos);
1093
- if (peg$r5.test(s7)) {
1222
+ s7 = peg$parsePROMO();
1223
+ if (s7 === peg$FAILED) {
1224
+ s7 = null;
1225
+ }
1226
+ s8 = peg$currPos;
1227
+ s9 = input.charAt(peg$currPos);
1228
+ if (peg$r3.test(s9)) {
1094
1229
  peg$currPos++;
1095
1230
  }
1096
1231
  else {
1097
- s7 = peg$FAILED;
1232
+ s9 = peg$FAILED;
1098
1233
  if (peg$silentFails === 0) {
1099
- peg$fail(peg$e15);
1100
- }
1101
- }
1102
- if (s7 !== peg$FAILED) {
1103
- s8 = input.charAt(peg$currPos);
1104
- if (peg$r6.test(s8)) {
1105
- peg$currPos++;
1106
- }
1107
- else {
1108
- s8 = peg$FAILED;
1109
- if (peg$silentFails === 0) {
1110
- peg$fail(peg$e16);
1111
- }
1112
- }
1113
- if (s8 !== peg$FAILED) {
1114
- s9 = peg$currPos;
1115
- if (input.charCodeAt(peg$currPos) === 61) {
1116
- s10 = peg$c11;
1117
- peg$currPos++;
1118
- }
1119
- else {
1120
- s10 = peg$FAILED;
1121
- if (peg$silentFails === 0) {
1122
- peg$fail(peg$e18);
1123
- }
1124
- }
1125
- if (s10 !== peg$FAILED) {
1126
- s11 = input.charAt(peg$currPos);
1127
- if (peg$r7.test(s11)) {
1128
- peg$currPos++;
1129
- }
1130
- else {
1131
- s11 = peg$FAILED;
1132
- if (peg$silentFails === 0) {
1133
- peg$fail(peg$e19);
1134
- }
1135
- }
1136
- if (s11 !== peg$FAILED) {
1137
- s10 = [s10, s11];
1138
- s9 = s10;
1139
- }
1140
- else {
1141
- peg$currPos = s9;
1142
- s9 = peg$FAILED;
1143
- }
1144
- }
1145
- else {
1146
- peg$currPos = s9;
1147
- s9 = peg$FAILED;
1148
- }
1149
- if (s9 === peg$FAILED) {
1150
- s9 = null;
1151
- }
1152
- s10 = input.charAt(peg$currPos);
1153
- if (peg$r3.test(s10)) {
1154
- peg$currPos++;
1155
- }
1156
- else {
1157
- s10 = peg$FAILED;
1158
- if (peg$silentFails === 0) {
1159
- peg$fail(peg$e12);
1160
- }
1161
- }
1162
- if (s10 === peg$FAILED) {
1163
- s10 = null;
1164
- }
1165
- s3 = [s3, s4, s5, s6, s7, s8, s9, s10];
1166
- s2 = s3;
1167
- }
1168
- else {
1169
- peg$currPos = s2;
1170
- s2 = peg$FAILED;
1234
+ peg$fail(peg$e12);
1171
1235
  }
1172
1236
  }
1173
- else {
1174
- peg$currPos = s2;
1175
- s2 = peg$FAILED;
1237
+ if (s9 === peg$FAILED) {
1238
+ s9 = null;
1176
1239
  }
1240
+ s8 = input.substring(s8, peg$currPos);
1241
+ peg$savedPos = s0;
1242
+ s0 = peg$f16(s1, s2, s3, s5, s6, s7, s8);
1177
1243
  }
1178
1244
  else {
1179
- peg$currPos = s2;
1180
- s2 = peg$FAILED;
1245
+ peg$currPos = s0;
1246
+ s0 = peg$FAILED;
1181
1247
  }
1182
1248
  }
1183
1249
  else {
1184
- peg$currPos = s2;
1185
- s2 = peg$FAILED;
1250
+ peg$currPos = s0;
1251
+ s0 = peg$FAILED;
1186
1252
  }
1187
1253
  }
1188
1254
  else {
1189
- peg$currPos = s2;
1190
- s2 = peg$FAILED;
1255
+ peg$currPos = s0;
1256
+ s0 = peg$FAILED;
1191
1257
  }
1192
1258
  }
1193
1259
  else {
1194
- peg$currPos = s2;
1260
+ peg$currPos = s0;
1261
+ s0 = peg$FAILED;
1262
+ }
1263
+ }
1264
+ else {
1265
+ peg$currPos = s0;
1266
+ s0 = peg$FAILED;
1267
+ }
1268
+ }
1269
+ else {
1270
+ peg$currPos = s0;
1271
+ s0 = peg$FAILED;
1272
+ }
1273
+ if (s0 === peg$FAILED) {
1274
+ s0 = peg$currPos;
1275
+ s1 = input.charAt(peg$currPos);
1276
+ if (peg$r4.test(s1)) {
1277
+ peg$currPos++;
1278
+ }
1279
+ else {
1280
+ s1 = peg$FAILED;
1281
+ if (peg$silentFails === 0) {
1282
+ peg$fail(peg$e14);
1283
+ }
1284
+ }
1285
+ if (s1 !== peg$FAILED) {
1286
+ s2 = input.charAt(peg$currPos);
1287
+ if (peg$r5.test(s2)) {
1288
+ peg$currPos++;
1289
+ }
1290
+ else {
1195
1291
  s2 = peg$FAILED;
1292
+ if (peg$silentFails === 0) {
1293
+ peg$fail(peg$e15);
1294
+ }
1196
1295
  }
1197
- if (s2 === peg$FAILED) {
1198
- s2 = peg$currPos;
1296
+ if (s2 !== peg$FAILED) {
1199
1297
  s3 = input.charAt(peg$currPos);
1200
- if (peg$r4.test(s3)) {
1298
+ if (peg$r6.test(s3)) {
1201
1299
  peg$currPos++;
1202
1300
  }
1203
1301
  else {
1204
1302
  s3 = peg$FAILED;
1205
1303
  if (peg$silentFails === 0) {
1206
- peg$fail(peg$e14);
1304
+ peg$fail(peg$e16);
1207
1305
  }
1208
1306
  }
1209
1307
  if (s3 !== peg$FAILED) {
@@ -1229,122 +1327,90 @@ function peg$parse(input, options) {
1229
1327
  }
1230
1328
  }
1231
1329
  if (s5 !== peg$FAILED) {
1232
- s6 = input.charAt(peg$currPos);
1233
- if (peg$r5.test(s6)) {
1330
+ s6 = peg$parsePROMO();
1331
+ if (s6 === peg$FAILED) {
1332
+ s6 = null;
1333
+ }
1334
+ s7 = peg$currPos;
1335
+ s8 = input.charAt(peg$currPos);
1336
+ if (peg$r3.test(s8)) {
1234
1337
  peg$currPos++;
1235
1338
  }
1236
1339
  else {
1237
- s6 = peg$FAILED;
1340
+ s8 = peg$FAILED;
1238
1341
  if (peg$silentFails === 0) {
1239
- peg$fail(peg$e15);
1240
- }
1241
- }
1242
- if (s6 !== peg$FAILED) {
1243
- s7 = input.charAt(peg$currPos);
1244
- if (peg$r6.test(s7)) {
1245
- peg$currPos++;
1246
- }
1247
- else {
1248
- s7 = peg$FAILED;
1249
- if (peg$silentFails === 0) {
1250
- peg$fail(peg$e16);
1251
- }
1252
- }
1253
- if (s7 !== peg$FAILED) {
1254
- s8 = peg$currPos;
1255
- if (input.charCodeAt(peg$currPos) === 61) {
1256
- s9 = peg$c11;
1257
- peg$currPos++;
1258
- }
1259
- else {
1260
- s9 = peg$FAILED;
1261
- if (peg$silentFails === 0) {
1262
- peg$fail(peg$e18);
1263
- }
1264
- }
1265
- if (s9 !== peg$FAILED) {
1266
- s10 = input.charAt(peg$currPos);
1267
- if (peg$r7.test(s10)) {
1268
- peg$currPos++;
1269
- }
1270
- else {
1271
- s10 = peg$FAILED;
1272
- if (peg$silentFails === 0) {
1273
- peg$fail(peg$e19);
1274
- }
1275
- }
1276
- if (s10 !== peg$FAILED) {
1277
- s9 = [s9, s10];
1278
- s8 = s9;
1279
- }
1280
- else {
1281
- peg$currPos = s8;
1282
- s8 = peg$FAILED;
1283
- }
1284
- }
1285
- else {
1286
- peg$currPos = s8;
1287
- s8 = peg$FAILED;
1288
- }
1289
- if (s8 === peg$FAILED) {
1290
- s8 = null;
1291
- }
1292
- s9 = input.charAt(peg$currPos);
1293
- if (peg$r3.test(s9)) {
1294
- peg$currPos++;
1295
- }
1296
- else {
1297
- s9 = peg$FAILED;
1298
- if (peg$silentFails === 0) {
1299
- peg$fail(peg$e12);
1300
- }
1301
- }
1302
- if (s9 === peg$FAILED) {
1303
- s9 = null;
1304
- }
1305
- s3 = [s3, s4, s5, s6, s7, s8, s9];
1306
- s2 = s3;
1307
- }
1308
- else {
1309
- peg$currPos = s2;
1310
- s2 = peg$FAILED;
1342
+ peg$fail(peg$e12);
1311
1343
  }
1312
1344
  }
1313
- else {
1314
- peg$currPos = s2;
1315
- s2 = peg$FAILED;
1345
+ if (s8 === peg$FAILED) {
1346
+ s8 = null;
1316
1347
  }
1348
+ s7 = input.substring(s7, peg$currPos);
1349
+ peg$savedPos = s0;
1350
+ s0 = peg$f17(s1, s2, s3, s4, s5, s6, s7);
1317
1351
  }
1318
1352
  else {
1319
- peg$currPos = s2;
1320
- s2 = peg$FAILED;
1353
+ peg$currPos = s0;
1354
+ s0 = peg$FAILED;
1321
1355
  }
1322
1356
  }
1323
1357
  else {
1324
- peg$currPos = s2;
1325
- s2 = peg$FAILED;
1358
+ peg$currPos = s0;
1359
+ s0 = peg$FAILED;
1326
1360
  }
1327
1361
  }
1328
1362
  else {
1329
- peg$currPos = s2;
1330
- s2 = peg$FAILED;
1363
+ peg$currPos = s0;
1364
+ s0 = peg$FAILED;
1331
1365
  }
1332
- if (s2 === peg$FAILED) {
1333
- s2 = peg$currPos;
1334
- s3 = input.charAt(peg$currPos);
1335
- if (peg$r4.test(s3)) {
1336
- peg$currPos++;
1337
- }
1338
- else {
1339
- s3 = peg$FAILED;
1340
- if (peg$silentFails === 0) {
1341
- peg$fail(peg$e14);
1342
- }
1343
- }
1344
- if (s3 !== peg$FAILED) {
1345
- s4 = input.charAt(peg$currPos);
1346
- if (peg$r5.test(s4)) {
1347
- peg$currPos++;
1366
+ }
1367
+ else {
1368
+ peg$currPos = s0;
1369
+ s0 = peg$FAILED;
1370
+ }
1371
+ }
1372
+ else {
1373
+ peg$currPos = s0;
1374
+ s0 = peg$FAILED;
1375
+ }
1376
+ if (s0 === peg$FAILED) {
1377
+ s0 = peg$currPos;
1378
+ s1 = input.charAt(peg$currPos);
1379
+ if (peg$r4.test(s1)) {
1380
+ peg$currPos++;
1381
+ }
1382
+ else {
1383
+ s1 = peg$FAILED;
1384
+ if (peg$silentFails === 0) {
1385
+ peg$fail(peg$e14);
1386
+ }
1387
+ }
1388
+ if (s1 !== peg$FAILED) {
1389
+ s2 = input.charAt(peg$currPos);
1390
+ if (peg$r5.test(s2)) {
1391
+ peg$currPos++;
1392
+ }
1393
+ else {
1394
+ s2 = peg$FAILED;
1395
+ if (peg$silentFails === 0) {
1396
+ peg$fail(peg$e15);
1397
+ }
1398
+ }
1399
+ if (s2 !== peg$FAILED) {
1400
+ if (input.charCodeAt(peg$currPos) === 120) {
1401
+ s3 = peg$c10;
1402
+ peg$currPos++;
1403
+ }
1404
+ else {
1405
+ s3 = peg$FAILED;
1406
+ if (peg$silentFails === 0) {
1407
+ peg$fail(peg$e17);
1408
+ }
1409
+ }
1410
+ if (s3 !== peg$FAILED) {
1411
+ s4 = input.charAt(peg$currPos);
1412
+ if (peg$r5.test(s4)) {
1413
+ peg$currPos++;
1348
1414
  }
1349
1415
  else {
1350
1416
  s4 = peg$FAILED;
@@ -1353,384 +1419,288 @@ function peg$parse(input, options) {
1353
1419
  }
1354
1420
  }
1355
1421
  if (s4 !== peg$FAILED) {
1356
- if (input.charCodeAt(peg$currPos) === 120) {
1357
- s5 = peg$c10;
1422
+ s5 = input.charAt(peg$currPos);
1423
+ if (peg$r6.test(s5)) {
1358
1424
  peg$currPos++;
1359
1425
  }
1360
1426
  else {
1361
1427
  s5 = peg$FAILED;
1362
1428
  if (peg$silentFails === 0) {
1363
- peg$fail(peg$e17);
1429
+ peg$fail(peg$e16);
1364
1430
  }
1365
1431
  }
1366
1432
  if (s5 !== peg$FAILED) {
1367
- s6 = input.charAt(peg$currPos);
1368
- if (peg$r5.test(s6)) {
1433
+ s6 = peg$parsePROMO();
1434
+ if (s6 === peg$FAILED) {
1435
+ s6 = null;
1436
+ }
1437
+ s7 = peg$currPos;
1438
+ s8 = input.charAt(peg$currPos);
1439
+ if (peg$r3.test(s8)) {
1369
1440
  peg$currPos++;
1370
1441
  }
1371
1442
  else {
1372
- s6 = peg$FAILED;
1443
+ s8 = peg$FAILED;
1373
1444
  if (peg$silentFails === 0) {
1374
- peg$fail(peg$e15);
1375
- }
1376
- }
1377
- if (s6 !== peg$FAILED) {
1378
- s7 = input.charAt(peg$currPos);
1379
- if (peg$r6.test(s7)) {
1380
- peg$currPos++;
1381
- }
1382
- else {
1383
- s7 = peg$FAILED;
1384
- if (peg$silentFails === 0) {
1385
- peg$fail(peg$e16);
1386
- }
1387
- }
1388
- if (s7 !== peg$FAILED) {
1389
- s8 = peg$currPos;
1390
- if (input.charCodeAt(peg$currPos) === 61) {
1391
- s9 = peg$c11;
1392
- peg$currPos++;
1393
- }
1394
- else {
1395
- s9 = peg$FAILED;
1396
- if (peg$silentFails === 0) {
1397
- peg$fail(peg$e18);
1398
- }
1399
- }
1400
- if (s9 !== peg$FAILED) {
1401
- s10 = input.charAt(peg$currPos);
1402
- if (peg$r7.test(s10)) {
1403
- peg$currPos++;
1404
- }
1405
- else {
1406
- s10 = peg$FAILED;
1407
- if (peg$silentFails === 0) {
1408
- peg$fail(peg$e19);
1409
- }
1410
- }
1411
- if (s10 !== peg$FAILED) {
1412
- s9 = [s9, s10];
1413
- s8 = s9;
1414
- }
1415
- else {
1416
- peg$currPos = s8;
1417
- s8 = peg$FAILED;
1418
- }
1419
- }
1420
- else {
1421
- peg$currPos = s8;
1422
- s8 = peg$FAILED;
1423
- }
1424
- if (s8 === peg$FAILED) {
1425
- s8 = null;
1426
- }
1427
- s9 = input.charAt(peg$currPos);
1428
- if (peg$r3.test(s9)) {
1429
- peg$currPos++;
1430
- }
1431
- else {
1432
- s9 = peg$FAILED;
1433
- if (peg$silentFails === 0) {
1434
- peg$fail(peg$e12);
1435
- }
1436
- }
1437
- if (s9 === peg$FAILED) {
1438
- s9 = null;
1439
- }
1440
- s3 = [s3, s4, s5, s6, s7, s8, s9];
1441
- s2 = s3;
1442
- }
1443
- else {
1444
- peg$currPos = s2;
1445
- s2 = peg$FAILED;
1445
+ peg$fail(peg$e12);
1446
1446
  }
1447
1447
  }
1448
- else {
1449
- peg$currPos = s2;
1450
- s2 = peg$FAILED;
1448
+ if (s8 === peg$FAILED) {
1449
+ s8 = null;
1451
1450
  }
1451
+ s7 = input.substring(s7, peg$currPos);
1452
+ peg$savedPos = s0;
1453
+ s0 = peg$f18(s1, s2, s4, s5, s6, s7);
1452
1454
  }
1453
1455
  else {
1454
- peg$currPos = s2;
1455
- s2 = peg$FAILED;
1456
+ peg$currPos = s0;
1457
+ s0 = peg$FAILED;
1456
1458
  }
1457
1459
  }
1458
1460
  else {
1459
- peg$currPos = s2;
1460
- s2 = peg$FAILED;
1461
+ peg$currPos = s0;
1462
+ s0 = peg$FAILED;
1461
1463
  }
1462
1464
  }
1463
1465
  else {
1464
- peg$currPos = s2;
1466
+ peg$currPos = s0;
1467
+ s0 = peg$FAILED;
1468
+ }
1469
+ }
1470
+ else {
1471
+ peg$currPos = s0;
1472
+ s0 = peg$FAILED;
1473
+ }
1474
+ }
1475
+ else {
1476
+ peg$currPos = s0;
1477
+ s0 = peg$FAILED;
1478
+ }
1479
+ if (s0 === peg$FAILED) {
1480
+ s0 = peg$currPos;
1481
+ s1 = input.charAt(peg$currPos);
1482
+ if (peg$r4.test(s1)) {
1483
+ peg$currPos++;
1484
+ }
1485
+ else {
1486
+ s1 = peg$FAILED;
1487
+ if (peg$silentFails === 0) {
1488
+ peg$fail(peg$e14);
1489
+ }
1490
+ }
1491
+ if (s1 !== peg$FAILED) {
1492
+ s2 = input.charAt(peg$currPos);
1493
+ if (peg$r6.test(s2)) {
1494
+ peg$currPos++;
1495
+ }
1496
+ else {
1465
1497
  s2 = peg$FAILED;
1498
+ if (peg$silentFails === 0) {
1499
+ peg$fail(peg$e16);
1500
+ }
1466
1501
  }
1467
- if (s2 === peg$FAILED) {
1468
- s2 = peg$currPos;
1469
- s3 = input.charAt(peg$currPos);
1470
- if (peg$r4.test(s3)) {
1502
+ if (s2 !== peg$FAILED) {
1503
+ if (input.charCodeAt(peg$currPos) === 120) {
1504
+ s3 = peg$c10;
1471
1505
  peg$currPos++;
1472
1506
  }
1473
1507
  else {
1474
1508
  s3 = peg$FAILED;
1475
1509
  if (peg$silentFails === 0) {
1476
- peg$fail(peg$e14);
1510
+ peg$fail(peg$e17);
1477
1511
  }
1478
1512
  }
1479
1513
  if (s3 !== peg$FAILED) {
1480
1514
  s4 = input.charAt(peg$currPos);
1481
- if (peg$r6.test(s4)) {
1515
+ if (peg$r5.test(s4)) {
1482
1516
  peg$currPos++;
1483
1517
  }
1484
1518
  else {
1485
1519
  s4 = peg$FAILED;
1486
1520
  if (peg$silentFails === 0) {
1487
- peg$fail(peg$e16);
1521
+ peg$fail(peg$e15);
1488
1522
  }
1489
1523
  }
1490
1524
  if (s4 !== peg$FAILED) {
1491
- if (input.charCodeAt(peg$currPos) === 120) {
1492
- s5 = peg$c10;
1525
+ s5 = input.charAt(peg$currPos);
1526
+ if (peg$r6.test(s5)) {
1493
1527
  peg$currPos++;
1494
1528
  }
1495
1529
  else {
1496
1530
  s5 = peg$FAILED;
1497
1531
  if (peg$silentFails === 0) {
1498
- peg$fail(peg$e17);
1532
+ peg$fail(peg$e16);
1499
1533
  }
1500
1534
  }
1501
1535
  if (s5 !== peg$FAILED) {
1502
- s6 = input.charAt(peg$currPos);
1503
- if (peg$r5.test(s6)) {
1536
+ s6 = peg$parsePROMO();
1537
+ if (s6 === peg$FAILED) {
1538
+ s6 = null;
1539
+ }
1540
+ s7 = peg$currPos;
1541
+ s8 = input.charAt(peg$currPos);
1542
+ if (peg$r3.test(s8)) {
1504
1543
  peg$currPos++;
1505
1544
  }
1506
1545
  else {
1507
- s6 = peg$FAILED;
1546
+ s8 = peg$FAILED;
1508
1547
  if (peg$silentFails === 0) {
1509
- peg$fail(peg$e15);
1510
- }
1511
- }
1512
- if (s6 !== peg$FAILED) {
1513
- s7 = input.charAt(peg$currPos);
1514
- if (peg$r6.test(s7)) {
1515
- peg$currPos++;
1516
- }
1517
- else {
1518
- s7 = peg$FAILED;
1519
- if (peg$silentFails === 0) {
1520
- peg$fail(peg$e16);
1521
- }
1522
- }
1523
- if (s7 !== peg$FAILED) {
1524
- s8 = peg$currPos;
1525
- if (input.charCodeAt(peg$currPos) === 61) {
1526
- s9 = peg$c11;
1527
- peg$currPos++;
1528
- }
1529
- else {
1530
- s9 = peg$FAILED;
1531
- if (peg$silentFails === 0) {
1532
- peg$fail(peg$e18);
1533
- }
1534
- }
1535
- if (s9 !== peg$FAILED) {
1536
- s10 = input.charAt(peg$currPos);
1537
- if (peg$r7.test(s10)) {
1538
- peg$currPos++;
1539
- }
1540
- else {
1541
- s10 = peg$FAILED;
1542
- if (peg$silentFails === 0) {
1543
- peg$fail(peg$e19);
1544
- }
1545
- }
1546
- if (s10 !== peg$FAILED) {
1547
- s9 = [s9, s10];
1548
- s8 = s9;
1549
- }
1550
- else {
1551
- peg$currPos = s8;
1552
- s8 = peg$FAILED;
1553
- }
1554
- }
1555
- else {
1556
- peg$currPos = s8;
1557
- s8 = peg$FAILED;
1558
- }
1559
- if (s8 === peg$FAILED) {
1560
- s8 = null;
1561
- }
1562
- s9 = input.charAt(peg$currPos);
1563
- if (peg$r3.test(s9)) {
1564
- peg$currPos++;
1565
- }
1566
- else {
1567
- s9 = peg$FAILED;
1568
- if (peg$silentFails === 0) {
1569
- peg$fail(peg$e12);
1570
- }
1571
- }
1572
- if (s9 === peg$FAILED) {
1573
- s9 = null;
1574
- }
1575
- s3 = [s3, s4, s5, s6, s7, s8, s9];
1576
- s2 = s3;
1577
- }
1578
- else {
1579
- peg$currPos = s2;
1580
- s2 = peg$FAILED;
1548
+ peg$fail(peg$e12);
1581
1549
  }
1582
1550
  }
1583
- else {
1584
- peg$currPos = s2;
1585
- s2 = peg$FAILED;
1551
+ if (s8 === peg$FAILED) {
1552
+ s8 = null;
1586
1553
  }
1554
+ s7 = input.substring(s7, peg$currPos);
1555
+ peg$savedPos = s0;
1556
+ s0 = peg$f19(s1, s2, s4, s5, s6, s7);
1587
1557
  }
1588
1558
  else {
1589
- peg$currPos = s2;
1590
- s2 = peg$FAILED;
1559
+ peg$currPos = s0;
1560
+ s0 = peg$FAILED;
1591
1561
  }
1592
1562
  }
1593
1563
  else {
1594
- peg$currPos = s2;
1595
- s2 = peg$FAILED;
1564
+ peg$currPos = s0;
1565
+ s0 = peg$FAILED;
1596
1566
  }
1597
1567
  }
1598
1568
  else {
1599
- peg$currPos = s2;
1569
+ peg$currPos = s0;
1570
+ s0 = peg$FAILED;
1571
+ }
1572
+ }
1573
+ else {
1574
+ peg$currPos = s0;
1575
+ s0 = peg$FAILED;
1576
+ }
1577
+ }
1578
+ else {
1579
+ peg$currPos = s0;
1580
+ s0 = peg$FAILED;
1581
+ }
1582
+ if (s0 === peg$FAILED) {
1583
+ s0 = peg$currPos;
1584
+ s1 = input.charAt(peg$currPos);
1585
+ if (peg$r4.test(s1)) {
1586
+ peg$currPos++;
1587
+ }
1588
+ else {
1589
+ s1 = peg$FAILED;
1590
+ if (peg$silentFails === 0) {
1591
+ peg$fail(peg$e14);
1592
+ }
1593
+ }
1594
+ if (s1 !== peg$FAILED) {
1595
+ s2 = input.charAt(peg$currPos);
1596
+ if (peg$r5.test(s2)) {
1597
+ peg$currPos++;
1598
+ }
1599
+ else {
1600
1600
  s2 = peg$FAILED;
1601
+ if (peg$silentFails === 0) {
1602
+ peg$fail(peg$e15);
1603
+ }
1601
1604
  }
1602
- if (s2 === peg$FAILED) {
1603
- s2 = peg$currPos;
1605
+ if (s2 !== peg$FAILED) {
1604
1606
  s3 = input.charAt(peg$currPos);
1605
- if (peg$r4.test(s3)) {
1607
+ if (peg$r5.test(s3)) {
1606
1608
  peg$currPos++;
1607
1609
  }
1608
1610
  else {
1609
1611
  s3 = peg$FAILED;
1610
1612
  if (peg$silentFails === 0) {
1611
- peg$fail(peg$e14);
1613
+ peg$fail(peg$e15);
1612
1614
  }
1613
1615
  }
1614
1616
  if (s3 !== peg$FAILED) {
1615
1617
  s4 = input.charAt(peg$currPos);
1616
- if (peg$r5.test(s4)) {
1618
+ if (peg$r6.test(s4)) {
1617
1619
  peg$currPos++;
1618
1620
  }
1619
1621
  else {
1620
1622
  s4 = peg$FAILED;
1621
1623
  if (peg$silentFails === 0) {
1622
- peg$fail(peg$e15);
1624
+ peg$fail(peg$e16);
1623
1625
  }
1624
1626
  }
1625
1627
  if (s4 !== peg$FAILED) {
1626
- s5 = input.charAt(peg$currPos);
1627
- if (peg$r5.test(s5)) {
1628
+ s5 = peg$parsePROMO();
1629
+ if (s5 === peg$FAILED) {
1630
+ s5 = null;
1631
+ }
1632
+ s6 = peg$currPos;
1633
+ s7 = input.charAt(peg$currPos);
1634
+ if (peg$r3.test(s7)) {
1628
1635
  peg$currPos++;
1629
1636
  }
1630
1637
  else {
1631
- s5 = peg$FAILED;
1638
+ s7 = peg$FAILED;
1632
1639
  if (peg$silentFails === 0) {
1633
- peg$fail(peg$e15);
1634
- }
1635
- }
1636
- if (s5 !== peg$FAILED) {
1637
- s6 = input.charAt(peg$currPos);
1638
- if (peg$r6.test(s6)) {
1639
- peg$currPos++;
1640
- }
1641
- else {
1642
- s6 = peg$FAILED;
1643
- if (peg$silentFails === 0) {
1644
- peg$fail(peg$e16);
1645
- }
1646
- }
1647
- if (s6 !== peg$FAILED) {
1648
- s7 = peg$currPos;
1649
- if (input.charCodeAt(peg$currPos) === 61) {
1650
- s8 = peg$c11;
1651
- peg$currPos++;
1652
- }
1653
- else {
1654
- s8 = peg$FAILED;
1655
- if (peg$silentFails === 0) {
1656
- peg$fail(peg$e18);
1657
- }
1658
- }
1659
- if (s8 !== peg$FAILED) {
1660
- s9 = input.charAt(peg$currPos);
1661
- if (peg$r7.test(s9)) {
1662
- peg$currPos++;
1663
- }
1664
- else {
1665
- s9 = peg$FAILED;
1666
- if (peg$silentFails === 0) {
1667
- peg$fail(peg$e19);
1668
- }
1669
- }
1670
- if (s9 !== peg$FAILED) {
1671
- s8 = [s8, s9];
1672
- s7 = s8;
1673
- }
1674
- else {
1675
- peg$currPos = s7;
1676
- s7 = peg$FAILED;
1677
- }
1678
- }
1679
- else {
1680
- peg$currPos = s7;
1681
- s7 = peg$FAILED;
1682
- }
1683
- if (s7 === peg$FAILED) {
1684
- s7 = null;
1685
- }
1686
- s8 = input.charAt(peg$currPos);
1687
- if (peg$r3.test(s8)) {
1688
- peg$currPos++;
1689
- }
1690
- else {
1691
- s8 = peg$FAILED;
1692
- if (peg$silentFails === 0) {
1693
- peg$fail(peg$e12);
1694
- }
1695
- }
1696
- if (s8 === peg$FAILED) {
1697
- s8 = null;
1698
- }
1699
- s3 = [s3, s4, s5, s6, s7, s8];
1700
- s2 = s3;
1701
- }
1702
- else {
1703
- peg$currPos = s2;
1704
- s2 = peg$FAILED;
1640
+ peg$fail(peg$e12);
1705
1641
  }
1706
1642
  }
1707
- else {
1708
- peg$currPos = s2;
1709
- s2 = peg$FAILED;
1643
+ if (s7 === peg$FAILED) {
1644
+ s7 = null;
1710
1645
  }
1646
+ s6 = input.substring(s6, peg$currPos);
1647
+ peg$savedPos = s0;
1648
+ s0 = peg$f20(s1, s2, s3, s4, s5, s6);
1711
1649
  }
1712
1650
  else {
1713
- peg$currPos = s2;
1714
- s2 = peg$FAILED;
1651
+ peg$currPos = s0;
1652
+ s0 = peg$FAILED;
1715
1653
  }
1716
1654
  }
1717
1655
  else {
1718
- peg$currPos = s2;
1719
- s2 = peg$FAILED;
1656
+ peg$currPos = s0;
1657
+ s0 = peg$FAILED;
1720
1658
  }
1721
- if (s2 === peg$FAILED) {
1722
- s2 = peg$currPos;
1723
- s3 = input.charAt(peg$currPos);
1724
- if (peg$r4.test(s3)) {
1725
- peg$currPos++;
1726
- }
1727
- else {
1728
- s3 = peg$FAILED;
1729
- if (peg$silentFails === 0) {
1730
- peg$fail(peg$e14);
1731
- }
1732
- }
1733
- if (s3 !== peg$FAILED) {
1659
+ }
1660
+ else {
1661
+ peg$currPos = s0;
1662
+ s0 = peg$FAILED;
1663
+ }
1664
+ }
1665
+ else {
1666
+ peg$currPos = s0;
1667
+ s0 = peg$FAILED;
1668
+ }
1669
+ if (s0 === peg$FAILED) {
1670
+ s0 = peg$currPos;
1671
+ s1 = input.charAt(peg$currPos);
1672
+ if (peg$r4.test(s1)) {
1673
+ peg$currPos++;
1674
+ }
1675
+ else {
1676
+ s1 = peg$FAILED;
1677
+ if (peg$silentFails === 0) {
1678
+ peg$fail(peg$e14);
1679
+ }
1680
+ }
1681
+ if (s1 !== peg$FAILED) {
1682
+ s2 = input.charAt(peg$currPos);
1683
+ if (peg$r6.test(s2)) {
1684
+ peg$currPos++;
1685
+ }
1686
+ else {
1687
+ s2 = peg$FAILED;
1688
+ if (peg$silentFails === 0) {
1689
+ peg$fail(peg$e16);
1690
+ }
1691
+ }
1692
+ if (s2 !== peg$FAILED) {
1693
+ s3 = input.charAt(peg$currPos);
1694
+ if (peg$r5.test(s3)) {
1695
+ peg$currPos++;
1696
+ }
1697
+ else {
1698
+ s3 = peg$FAILED;
1699
+ if (peg$silentFails === 0) {
1700
+ peg$fail(peg$e15);
1701
+ }
1702
+ }
1703
+ if (s3 !== peg$FAILED) {
1734
1704
  s4 = input.charAt(peg$currPos);
1735
1705
  if (peg$r6.test(s4)) {
1736
1706
  peg$currPos++;
@@ -1742,532 +1712,204 @@ function peg$parse(input, options) {
1742
1712
  }
1743
1713
  }
1744
1714
  if (s4 !== peg$FAILED) {
1745
- s5 = input.charAt(peg$currPos);
1746
- if (peg$r5.test(s5)) {
1715
+ s5 = peg$parsePROMO();
1716
+ if (s5 === peg$FAILED) {
1717
+ s5 = null;
1718
+ }
1719
+ s6 = peg$currPos;
1720
+ s7 = input.charAt(peg$currPos);
1721
+ if (peg$r3.test(s7)) {
1747
1722
  peg$currPos++;
1748
1723
  }
1749
1724
  else {
1750
- s5 = peg$FAILED;
1725
+ s7 = peg$FAILED;
1751
1726
  if (peg$silentFails === 0) {
1752
- peg$fail(peg$e15);
1753
- }
1754
- }
1755
- if (s5 !== peg$FAILED) {
1756
- s6 = input.charAt(peg$currPos);
1757
- if (peg$r6.test(s6)) {
1758
- peg$currPos++;
1759
- }
1760
- else {
1761
- s6 = peg$FAILED;
1762
- if (peg$silentFails === 0) {
1763
- peg$fail(peg$e16);
1764
- }
1765
- }
1766
- if (s6 !== peg$FAILED) {
1767
- s7 = peg$currPos;
1768
- if (input.charCodeAt(peg$currPos) === 61) {
1769
- s8 = peg$c11;
1770
- peg$currPos++;
1771
- }
1772
- else {
1773
- s8 = peg$FAILED;
1774
- if (peg$silentFails === 0) {
1775
- peg$fail(peg$e18);
1776
- }
1777
- }
1778
- if (s8 !== peg$FAILED) {
1779
- s9 = input.charAt(peg$currPos);
1780
- if (peg$r7.test(s9)) {
1781
- peg$currPos++;
1782
- }
1783
- else {
1784
- s9 = peg$FAILED;
1785
- if (peg$silentFails === 0) {
1786
- peg$fail(peg$e19);
1787
- }
1788
- }
1789
- if (s9 !== peg$FAILED) {
1790
- s8 = [s8, s9];
1791
- s7 = s8;
1792
- }
1793
- else {
1794
- peg$currPos = s7;
1795
- s7 = peg$FAILED;
1796
- }
1797
- }
1798
- else {
1799
- peg$currPos = s7;
1800
- s7 = peg$FAILED;
1801
- }
1802
- if (s7 === peg$FAILED) {
1803
- s7 = null;
1804
- }
1805
- s8 = input.charAt(peg$currPos);
1806
- if (peg$r3.test(s8)) {
1807
- peg$currPos++;
1808
- }
1809
- else {
1810
- s8 = peg$FAILED;
1811
- if (peg$silentFails === 0) {
1812
- peg$fail(peg$e12);
1813
- }
1814
- }
1815
- if (s8 === peg$FAILED) {
1816
- s8 = null;
1817
- }
1818
- s3 = [s3, s4, s5, s6, s7, s8];
1819
- s2 = s3;
1820
- }
1821
- else {
1822
- peg$currPos = s2;
1823
- s2 = peg$FAILED;
1727
+ peg$fail(peg$e12);
1824
1728
  }
1825
1729
  }
1826
- else {
1827
- peg$currPos = s2;
1828
- s2 = peg$FAILED;
1730
+ if (s7 === peg$FAILED) {
1731
+ s7 = null;
1829
1732
  }
1733
+ s6 = input.substring(s6, peg$currPos);
1734
+ peg$savedPos = s0;
1735
+ s0 = peg$f21(s1, s2, s3, s4, s5, s6);
1830
1736
  }
1831
1737
  else {
1832
- peg$currPos = s2;
1833
- s2 = peg$FAILED;
1738
+ peg$currPos = s0;
1739
+ s0 = peg$FAILED;
1834
1740
  }
1835
1741
  }
1836
1742
  else {
1837
- peg$currPos = s2;
1743
+ peg$currPos = s0;
1744
+ s0 = peg$FAILED;
1745
+ }
1746
+ }
1747
+ else {
1748
+ peg$currPos = s0;
1749
+ s0 = peg$FAILED;
1750
+ }
1751
+ }
1752
+ else {
1753
+ peg$currPos = s0;
1754
+ s0 = peg$FAILED;
1755
+ }
1756
+ if (s0 === peg$FAILED) {
1757
+ s0 = peg$currPos;
1758
+ s1 = input.charAt(peg$currPos);
1759
+ if (peg$r4.test(s1)) {
1760
+ peg$currPos++;
1761
+ }
1762
+ else {
1763
+ s1 = peg$FAILED;
1764
+ if (peg$silentFails === 0) {
1765
+ peg$fail(peg$e14);
1766
+ }
1767
+ }
1768
+ if (s1 !== peg$FAILED) {
1769
+ if (input.charCodeAt(peg$currPos) === 120) {
1770
+ s2 = peg$c10;
1771
+ peg$currPos++;
1772
+ }
1773
+ else {
1838
1774
  s2 = peg$FAILED;
1775
+ if (peg$silentFails === 0) {
1776
+ peg$fail(peg$e17);
1777
+ }
1839
1778
  }
1840
- if (s2 === peg$FAILED) {
1841
- s2 = peg$currPos;
1779
+ if (s2 !== peg$FAILED) {
1842
1780
  s3 = input.charAt(peg$currPos);
1843
- if (peg$r4.test(s3)) {
1781
+ if (peg$r5.test(s3)) {
1844
1782
  peg$currPos++;
1845
1783
  }
1846
1784
  else {
1847
1785
  s3 = peg$FAILED;
1848
1786
  if (peg$silentFails === 0) {
1849
- peg$fail(peg$e14);
1787
+ peg$fail(peg$e15);
1850
1788
  }
1851
1789
  }
1852
1790
  if (s3 !== peg$FAILED) {
1853
- if (input.charCodeAt(peg$currPos) === 120) {
1854
- s4 = peg$c10;
1791
+ s4 = input.charAt(peg$currPos);
1792
+ if (peg$r6.test(s4)) {
1855
1793
  peg$currPos++;
1856
1794
  }
1857
1795
  else {
1858
1796
  s4 = peg$FAILED;
1859
1797
  if (peg$silentFails === 0) {
1860
- peg$fail(peg$e17);
1798
+ peg$fail(peg$e16);
1861
1799
  }
1862
1800
  }
1863
1801
  if (s4 !== peg$FAILED) {
1864
- s5 = input.charAt(peg$currPos);
1865
- if (peg$r5.test(s5)) {
1802
+ s5 = peg$parsePROMO();
1803
+ if (s5 === peg$FAILED) {
1804
+ s5 = null;
1805
+ }
1806
+ s6 = peg$currPos;
1807
+ s7 = input.charAt(peg$currPos);
1808
+ if (peg$r3.test(s7)) {
1866
1809
  peg$currPos++;
1867
1810
  }
1868
1811
  else {
1869
- s5 = peg$FAILED;
1812
+ s7 = peg$FAILED;
1870
1813
  if (peg$silentFails === 0) {
1871
- peg$fail(peg$e15);
1872
- }
1873
- }
1874
- if (s5 !== peg$FAILED) {
1875
- s6 = input.charAt(peg$currPos);
1876
- if (peg$r6.test(s6)) {
1877
- peg$currPos++;
1878
- }
1879
- else {
1880
- s6 = peg$FAILED;
1881
- if (peg$silentFails === 0) {
1882
- peg$fail(peg$e16);
1883
- }
1884
- }
1885
- if (s6 !== peg$FAILED) {
1886
- s7 = peg$currPos;
1887
- if (input.charCodeAt(peg$currPos) === 61) {
1888
- s8 = peg$c11;
1889
- peg$currPos++;
1890
- }
1891
- else {
1892
- s8 = peg$FAILED;
1893
- if (peg$silentFails === 0) {
1894
- peg$fail(peg$e18);
1895
- }
1896
- }
1897
- if (s8 !== peg$FAILED) {
1898
- s9 = input.charAt(peg$currPos);
1899
- if (peg$r7.test(s9)) {
1900
- peg$currPos++;
1901
- }
1902
- else {
1903
- s9 = peg$FAILED;
1904
- if (peg$silentFails === 0) {
1905
- peg$fail(peg$e19);
1906
- }
1907
- }
1908
- if (s9 !== peg$FAILED) {
1909
- s8 = [s8, s9];
1910
- s7 = s8;
1911
- }
1912
- else {
1913
- peg$currPos = s7;
1914
- s7 = peg$FAILED;
1915
- }
1916
- }
1917
- else {
1918
- peg$currPos = s7;
1919
- s7 = peg$FAILED;
1920
- }
1921
- if (s7 === peg$FAILED) {
1922
- s7 = null;
1923
- }
1924
- s8 = input.charAt(peg$currPos);
1925
- if (peg$r3.test(s8)) {
1926
- peg$currPos++;
1927
- }
1928
- else {
1929
- s8 = peg$FAILED;
1930
- if (peg$silentFails === 0) {
1931
- peg$fail(peg$e12);
1932
- }
1933
- }
1934
- if (s8 === peg$FAILED) {
1935
- s8 = null;
1936
- }
1937
- s3 = [s3, s4, s5, s6, s7, s8];
1938
- s2 = s3;
1939
- }
1940
- else {
1941
- peg$currPos = s2;
1942
- s2 = peg$FAILED;
1814
+ peg$fail(peg$e12);
1943
1815
  }
1944
1816
  }
1945
- else {
1946
- peg$currPos = s2;
1947
- s2 = peg$FAILED;
1817
+ if (s7 === peg$FAILED) {
1818
+ s7 = null;
1948
1819
  }
1820
+ s6 = input.substring(s6, peg$currPos);
1821
+ peg$savedPos = s0;
1822
+ s0 = peg$f22(s1, s3, s4, s5, s6);
1949
1823
  }
1950
1824
  else {
1951
- peg$currPos = s2;
1952
- s2 = peg$FAILED;
1825
+ peg$currPos = s0;
1826
+ s0 = peg$FAILED;
1953
1827
  }
1954
1828
  }
1955
1829
  else {
1956
- peg$currPos = s2;
1830
+ peg$currPos = s0;
1831
+ s0 = peg$FAILED;
1832
+ }
1833
+ }
1834
+ else {
1835
+ peg$currPos = s0;
1836
+ s0 = peg$FAILED;
1837
+ }
1838
+ }
1839
+ else {
1840
+ peg$currPos = s0;
1841
+ s0 = peg$FAILED;
1842
+ }
1843
+ if (s0 === peg$FAILED) {
1844
+ s0 = peg$currPos;
1845
+ s1 = input.charAt(peg$currPos);
1846
+ if (peg$r4.test(s1)) {
1847
+ peg$currPos++;
1848
+ }
1849
+ else {
1850
+ s1 = peg$FAILED;
1851
+ if (peg$silentFails === 0) {
1852
+ peg$fail(peg$e14);
1853
+ }
1854
+ }
1855
+ if (s1 !== peg$FAILED) {
1856
+ s2 = input.charAt(peg$currPos);
1857
+ if (peg$r5.test(s2)) {
1858
+ peg$currPos++;
1859
+ }
1860
+ else {
1957
1861
  s2 = peg$FAILED;
1862
+ if (peg$silentFails === 0) {
1863
+ peg$fail(peg$e15);
1864
+ }
1958
1865
  }
1959
- if (s2 === peg$FAILED) {
1960
- s2 = peg$currPos;
1866
+ if (s2 !== peg$FAILED) {
1961
1867
  s3 = input.charAt(peg$currPos);
1962
- if (peg$r4.test(s3)) {
1868
+ if (peg$r6.test(s3)) {
1963
1869
  peg$currPos++;
1964
1870
  }
1965
1871
  else {
1966
1872
  s3 = peg$FAILED;
1967
1873
  if (peg$silentFails === 0) {
1968
- peg$fail(peg$e14);
1874
+ peg$fail(peg$e16);
1969
1875
  }
1970
1876
  }
1971
1877
  if (s3 !== peg$FAILED) {
1972
- s4 = input.charAt(peg$currPos);
1973
- if (peg$r5.test(s4)) {
1878
+ s4 = peg$parsePROMO();
1879
+ if (s4 === peg$FAILED) {
1880
+ s4 = null;
1881
+ }
1882
+ s5 = peg$currPos;
1883
+ s6 = input.charAt(peg$currPos);
1884
+ if (peg$r3.test(s6)) {
1974
1885
  peg$currPos++;
1975
1886
  }
1976
1887
  else {
1977
- s4 = peg$FAILED;
1888
+ s6 = peg$FAILED;
1978
1889
  if (peg$silentFails === 0) {
1979
- peg$fail(peg$e15);
1980
- }
1981
- }
1982
- if (s4 !== peg$FAILED) {
1983
- s5 = input.charAt(peg$currPos);
1984
- if (peg$r6.test(s5)) {
1985
- peg$currPos++;
1986
- }
1987
- else {
1988
- s5 = peg$FAILED;
1989
- if (peg$silentFails === 0) {
1990
- peg$fail(peg$e16);
1991
- }
1992
- }
1993
- if (s5 !== peg$FAILED) {
1994
- s6 = peg$currPos;
1995
- if (input.charCodeAt(peg$currPos) === 61) {
1996
- s7 = peg$c11;
1997
- peg$currPos++;
1998
- }
1999
- else {
2000
- s7 = peg$FAILED;
2001
- if (peg$silentFails === 0) {
2002
- peg$fail(peg$e18);
2003
- }
2004
- }
2005
- if (s7 !== peg$FAILED) {
2006
- s8 = input.charAt(peg$currPos);
2007
- if (peg$r7.test(s8)) {
2008
- peg$currPos++;
2009
- }
2010
- else {
2011
- s8 = peg$FAILED;
2012
- if (peg$silentFails === 0) {
2013
- peg$fail(peg$e19);
2014
- }
2015
- }
2016
- if (s8 !== peg$FAILED) {
2017
- s7 = [s7, s8];
2018
- s6 = s7;
2019
- }
2020
- else {
2021
- peg$currPos = s6;
2022
- s6 = peg$FAILED;
2023
- }
2024
- }
2025
- else {
2026
- peg$currPos = s6;
2027
- s6 = peg$FAILED;
2028
- }
2029
- if (s6 === peg$FAILED) {
2030
- s6 = null;
2031
- }
2032
- s7 = input.charAt(peg$currPos);
2033
- if (peg$r3.test(s7)) {
2034
- peg$currPos++;
2035
- }
2036
- else {
2037
- s7 = peg$FAILED;
2038
- if (peg$silentFails === 0) {
2039
- peg$fail(peg$e12);
2040
- }
2041
- }
2042
- if (s7 === peg$FAILED) {
2043
- s7 = null;
2044
- }
2045
- s3 = [s3, s4, s5, s6, s7];
2046
- s2 = s3;
2047
- }
2048
- else {
2049
- peg$currPos = s2;
2050
- s2 = peg$FAILED;
1890
+ peg$fail(peg$e12);
2051
1891
  }
2052
1892
  }
2053
- else {
2054
- peg$currPos = s2;
2055
- s2 = peg$FAILED;
1893
+ if (s6 === peg$FAILED) {
1894
+ s6 = null;
2056
1895
  }
1896
+ s5 = input.substring(s5, peg$currPos);
1897
+ peg$savedPos = s0;
1898
+ s0 = peg$f23(s1, s2, s3, s4, s5);
2057
1899
  }
2058
1900
  else {
2059
- peg$currPos = s2;
2060
- s2 = peg$FAILED;
2061
- }
2062
- if (s2 === peg$FAILED) {
2063
- s2 = peg$currPos;
2064
- s3 = input.charAt(peg$currPos);
2065
- if (peg$r5.test(s3)) {
2066
- peg$currPos++;
2067
- }
2068
- else {
2069
- s3 = peg$FAILED;
2070
- if (peg$silentFails === 0) {
2071
- peg$fail(peg$e15);
2072
- }
2073
- }
2074
- if (s3 !== peg$FAILED) {
2075
- if (input.charCodeAt(peg$currPos) === 120) {
2076
- s4 = peg$c10;
2077
- peg$currPos++;
2078
- }
2079
- else {
2080
- s4 = peg$FAILED;
2081
- if (peg$silentFails === 0) {
2082
- peg$fail(peg$e17);
2083
- }
2084
- }
2085
- if (s4 !== peg$FAILED) {
2086
- s5 = input.charAt(peg$currPos);
2087
- if (peg$r5.test(s5)) {
2088
- peg$currPos++;
2089
- }
2090
- else {
2091
- s5 = peg$FAILED;
2092
- if (peg$silentFails === 0) {
2093
- peg$fail(peg$e15);
2094
- }
2095
- }
2096
- if (s5 !== peg$FAILED) {
2097
- s6 = input.charAt(peg$currPos);
2098
- if (peg$r6.test(s6)) {
2099
- peg$currPos++;
2100
- }
2101
- else {
2102
- s6 = peg$FAILED;
2103
- if (peg$silentFails === 0) {
2104
- peg$fail(peg$e16);
2105
- }
2106
- }
2107
- if (s6 !== peg$FAILED) {
2108
- s7 = peg$currPos;
2109
- if (input.charCodeAt(peg$currPos) === 61) {
2110
- s8 = peg$c11;
2111
- peg$currPos++;
2112
- }
2113
- else {
2114
- s8 = peg$FAILED;
2115
- if (peg$silentFails === 0) {
2116
- peg$fail(peg$e18);
2117
- }
2118
- }
2119
- if (s8 !== peg$FAILED) {
2120
- s9 = input.charAt(peg$currPos);
2121
- if (peg$r7.test(s9)) {
2122
- peg$currPos++;
2123
- }
2124
- else {
2125
- s9 = peg$FAILED;
2126
- if (peg$silentFails === 0) {
2127
- peg$fail(peg$e19);
2128
- }
2129
- }
2130
- if (s9 !== peg$FAILED) {
2131
- s8 = [s8, s9];
2132
- s7 = s8;
2133
- }
2134
- else {
2135
- peg$currPos = s7;
2136
- s7 = peg$FAILED;
2137
- }
2138
- }
2139
- else {
2140
- peg$currPos = s7;
2141
- s7 = peg$FAILED;
2142
- }
2143
- if (s7 === peg$FAILED) {
2144
- s7 = null;
2145
- }
2146
- s8 = input.charAt(peg$currPos);
2147
- if (peg$r3.test(s8)) {
2148
- peg$currPos++;
2149
- }
2150
- else {
2151
- s8 = peg$FAILED;
2152
- if (peg$silentFails === 0) {
2153
- peg$fail(peg$e12);
2154
- }
2155
- }
2156
- if (s8 === peg$FAILED) {
2157
- s8 = null;
2158
- }
2159
- s3 = [s3, s4, s5, s6, s7, s8];
2160
- s2 = s3;
2161
- }
2162
- else {
2163
- peg$currPos = s2;
2164
- s2 = peg$FAILED;
2165
- }
2166
- }
2167
- else {
2168
- peg$currPos = s2;
2169
- s2 = peg$FAILED;
2170
- }
2171
- }
2172
- else {
2173
- peg$currPos = s2;
2174
- s2 = peg$FAILED;
2175
- }
2176
- }
2177
- else {
2178
- peg$currPos = s2;
2179
- s2 = peg$FAILED;
2180
- }
2181
- if (s2 === peg$FAILED) {
2182
- s2 = peg$currPos;
2183
- s3 = input.charAt(peg$currPos);
2184
- if (peg$r5.test(s3)) {
2185
- peg$currPos++;
2186
- }
2187
- else {
2188
- s3 = peg$FAILED;
2189
- if (peg$silentFails === 0) {
2190
- peg$fail(peg$e15);
2191
- }
2192
- }
2193
- if (s3 !== peg$FAILED) {
2194
- s4 = input.charAt(peg$currPos);
2195
- if (peg$r6.test(s4)) {
2196
- peg$currPos++;
2197
- }
2198
- else {
2199
- s4 = peg$FAILED;
2200
- if (peg$silentFails === 0) {
2201
- peg$fail(peg$e16);
2202
- }
2203
- }
2204
- if (s4 !== peg$FAILED) {
2205
- s5 = peg$currPos;
2206
- if (input.charCodeAt(peg$currPos) === 61) {
2207
- s6 = peg$c11;
2208
- peg$currPos++;
2209
- }
2210
- else {
2211
- s6 = peg$FAILED;
2212
- if (peg$silentFails === 0) {
2213
- peg$fail(peg$e18);
2214
- }
2215
- }
2216
- if (s6 !== peg$FAILED) {
2217
- s7 = input.charAt(peg$currPos);
2218
- if (peg$r7.test(s7)) {
2219
- peg$currPos++;
2220
- }
2221
- else {
2222
- s7 = peg$FAILED;
2223
- if (peg$silentFails === 0) {
2224
- peg$fail(peg$e19);
2225
- }
2226
- }
2227
- if (s7 !== peg$FAILED) {
2228
- s6 = [s6, s7];
2229
- s5 = s6;
2230
- }
2231
- else {
2232
- peg$currPos = s5;
2233
- s5 = peg$FAILED;
2234
- }
2235
- }
2236
- else {
2237
- peg$currPos = s5;
2238
- s5 = peg$FAILED;
2239
- }
2240
- if (s5 === peg$FAILED) {
2241
- s5 = null;
2242
- }
2243
- s6 = input.charAt(peg$currPos);
2244
- if (peg$r3.test(s6)) {
2245
- peg$currPos++;
2246
- }
2247
- else {
2248
- s6 = peg$FAILED;
2249
- if (peg$silentFails === 0) {
2250
- peg$fail(peg$e12);
2251
- }
2252
- }
2253
- if (s6 === peg$FAILED) {
2254
- s6 = null;
2255
- }
2256
- s3 = [s3, s4, s5, s6];
2257
- s2 = s3;
2258
- }
2259
- else {
2260
- peg$currPos = s2;
2261
- s2 = peg$FAILED;
2262
- }
2263
- }
2264
- else {
2265
- peg$currPos = s2;
2266
- s2 = peg$FAILED;
2267
- }
2268
- }
1901
+ peg$currPos = s0;
1902
+ s0 = peg$FAILED;
2269
1903
  }
2270
1904
  }
1905
+ else {
1906
+ peg$currPos = s0;
1907
+ s0 = peg$FAILED;
1908
+ }
1909
+ }
1910
+ else {
1911
+ peg$currPos = s0;
1912
+ s0 = peg$FAILED;
2271
1913
  }
2272
1914
  }
2273
1915
  }
@@ -2276,17 +1918,193 @@ function peg$parse(input, options) {
2276
1918
  }
2277
1919
  }
2278
1920
  }
2279
- if (s2 !== peg$FAILED) {
2280
- s1 = input.substring(s1, peg$currPos);
1921
+ return s0;
1922
+ }
1923
+ function peg$parsePAWN_CAPTURE() {
1924
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1925
+ s0 = peg$currPos;
1926
+ s1 = input.charAt(peg$currPos);
1927
+ if (peg$r5.test(s1)) {
1928
+ peg$currPos++;
2281
1929
  }
2282
1930
  else {
2283
- s1 = s2;
1931
+ s1 = peg$FAILED;
1932
+ if (peg$silentFails === 0) {
1933
+ peg$fail(peg$e15);
1934
+ }
2284
1935
  }
2285
1936
  if (s1 !== peg$FAILED) {
2286
- peg$savedPos = s0;
2287
- s1 = peg$f14(s1);
1937
+ if (input.charCodeAt(peg$currPos) === 120) {
1938
+ s2 = peg$c10;
1939
+ peg$currPos++;
1940
+ }
1941
+ else {
1942
+ s2 = peg$FAILED;
1943
+ if (peg$silentFails === 0) {
1944
+ peg$fail(peg$e17);
1945
+ }
1946
+ }
1947
+ if (s2 !== peg$FAILED) {
1948
+ s3 = input.charAt(peg$currPos);
1949
+ if (peg$r5.test(s3)) {
1950
+ peg$currPos++;
1951
+ }
1952
+ else {
1953
+ s3 = peg$FAILED;
1954
+ if (peg$silentFails === 0) {
1955
+ peg$fail(peg$e15);
1956
+ }
1957
+ }
1958
+ if (s3 !== peg$FAILED) {
1959
+ s4 = input.charAt(peg$currPos);
1960
+ if (peg$r6.test(s4)) {
1961
+ peg$currPos++;
1962
+ }
1963
+ else {
1964
+ s4 = peg$FAILED;
1965
+ if (peg$silentFails === 0) {
1966
+ peg$fail(peg$e16);
1967
+ }
1968
+ }
1969
+ if (s4 !== peg$FAILED) {
1970
+ s5 = peg$parsePROMO();
1971
+ if (s5 === peg$FAILED) {
1972
+ s5 = null;
1973
+ }
1974
+ s6 = peg$currPos;
1975
+ s7 = input.charAt(peg$currPos);
1976
+ if (peg$r3.test(s7)) {
1977
+ peg$currPos++;
1978
+ }
1979
+ else {
1980
+ s7 = peg$FAILED;
1981
+ if (peg$silentFails === 0) {
1982
+ peg$fail(peg$e12);
1983
+ }
1984
+ }
1985
+ if (s7 === peg$FAILED) {
1986
+ s7 = null;
1987
+ }
1988
+ s6 = input.substring(s6, peg$currPos);
1989
+ peg$savedPos = s0;
1990
+ s0 = peg$f24(s1, s3, s4, s5, s6);
1991
+ }
1992
+ else {
1993
+ peg$currPos = s0;
1994
+ s0 = peg$FAILED;
1995
+ }
1996
+ }
1997
+ else {
1998
+ peg$currPos = s0;
1999
+ s0 = peg$FAILED;
2000
+ }
2001
+ }
2002
+ else {
2003
+ peg$currPos = s0;
2004
+ s0 = peg$FAILED;
2005
+ }
2006
+ }
2007
+ else {
2008
+ peg$currPos = s0;
2009
+ s0 = peg$FAILED;
2010
+ }
2011
+ return s0;
2012
+ }
2013
+ function peg$parsePAWN_PUSH() {
2014
+ let s0, s1, s2, s3, s4, s5;
2015
+ s0 = peg$currPos;
2016
+ s1 = input.charAt(peg$currPos);
2017
+ if (peg$r5.test(s1)) {
2018
+ peg$currPos++;
2019
+ }
2020
+ else {
2021
+ s1 = peg$FAILED;
2022
+ if (peg$silentFails === 0) {
2023
+ peg$fail(peg$e15);
2024
+ }
2025
+ }
2026
+ if (s1 !== peg$FAILED) {
2027
+ s2 = input.charAt(peg$currPos);
2028
+ if (peg$r6.test(s2)) {
2029
+ peg$currPos++;
2030
+ }
2031
+ else {
2032
+ s2 = peg$FAILED;
2033
+ if (peg$silentFails === 0) {
2034
+ peg$fail(peg$e16);
2035
+ }
2036
+ }
2037
+ if (s2 !== peg$FAILED) {
2038
+ s3 = peg$parsePROMO();
2039
+ if (s3 === peg$FAILED) {
2040
+ s3 = null;
2041
+ }
2042
+ s4 = peg$currPos;
2043
+ s5 = input.charAt(peg$currPos);
2044
+ if (peg$r3.test(s5)) {
2045
+ peg$currPos++;
2046
+ }
2047
+ else {
2048
+ s5 = peg$FAILED;
2049
+ if (peg$silentFails === 0) {
2050
+ peg$fail(peg$e12);
2051
+ }
2052
+ }
2053
+ if (s5 === peg$FAILED) {
2054
+ s5 = null;
2055
+ }
2056
+ s4 = input.substring(s4, peg$currPos);
2057
+ peg$savedPos = s0;
2058
+ s0 = peg$f25(s1, s2, s3, s4);
2059
+ }
2060
+ else {
2061
+ peg$currPos = s0;
2062
+ s0 = peg$FAILED;
2063
+ }
2064
+ }
2065
+ else {
2066
+ peg$currPos = s0;
2067
+ s0 = peg$FAILED;
2068
+ }
2069
+ return s0;
2070
+ }
2071
+ function peg$parsePROMO() {
2072
+ let s0, s1, s2;
2073
+ s0 = peg$currPos;
2074
+ if (input.charCodeAt(peg$currPos) === 61) {
2075
+ s1 = peg$c11;
2076
+ peg$currPos++;
2077
+ }
2078
+ else {
2079
+ s1 = peg$FAILED;
2080
+ if (peg$silentFails === 0) {
2081
+ peg$fail(peg$e18);
2082
+ }
2083
+ }
2084
+ if (s1 !== peg$FAILED) {
2085
+ s2 = input.charAt(peg$currPos);
2086
+ if (peg$r7.test(s2)) {
2087
+ peg$currPos++;
2088
+ }
2089
+ else {
2090
+ s2 = peg$FAILED;
2091
+ if (peg$silentFails === 0) {
2092
+ peg$fail(peg$e19);
2093
+ }
2094
+ }
2095
+ if (s2 !== peg$FAILED) {
2096
+ peg$savedPos = s0;
2097
+ s0 = peg$f26(s2);
2098
+ }
2099
+ else {
2100
+ peg$currPos = s0;
2101
+ s0 = peg$FAILED;
2102
+ }
2103
+ }
2104
+ else {
2105
+ peg$currPos = s0;
2106
+ s0 = peg$FAILED;
2288
2107
  }
2289
- s0 = s1;
2290
2108
  return s0;
2291
2109
  }
2292
2110
  function peg$parseRAV() {
@@ -2319,7 +2137,7 @@ function peg$parse(input, options) {
2319
2137
  }
2320
2138
  if (s5 !== peg$FAILED) {
2321
2139
  peg$savedPos = s0;
2322
- s0 = peg$f15(s3);
2140
+ s0 = peg$f27(s3);
2323
2141
  }
2324
2142
  else {
2325
2143
  peg$currPos = s0;
@@ -2397,7 +2215,7 @@ function peg$parse(input, options) {
2397
2215
  }
2398
2216
  if (s2 !== peg$FAILED) {
2399
2217
  peg$savedPos = s0;
2400
- s0 = peg$f16(s2);
2218
+ s0 = peg$f28(s2);
2401
2219
  }
2402
2220
  else {
2403
2221
  peg$currPos = s0;
@@ -2568,7 +2386,7 @@ function peg$parse(input, options) {
2568
2386
  }
2569
2387
  if (s3 !== peg$FAILED) {
2570
2388
  peg$savedPos = s0;
2571
- s0 = peg$f17(s2);
2389
+ s0 = peg$f29(s2);
2572
2390
  }
2573
2391
  else {
2574
2392
  peg$currPos = s0;
@@ -2692,7 +2510,7 @@ function peg$parse(input, options) {
2692
2510
  }
2693
2511
  s2 = input.substring(s2, peg$currPos);
2694
2512
  peg$savedPos = s0;
2695
- s0 = peg$f18(s2);
2513
+ s0 = peg$f30(s2);
2696
2514
  }
2697
2515
  else {
2698
2516
  peg$currPos = s0;