@leafo/lml 0.1.1 → 0.2.0
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/README.md +257 -38
- package/dist/grammar.d.ts.map +1 -1
- package/dist/grammar.js +1228 -268
- package/dist/grammar.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/music.d.ts +1 -0
- package/dist/music.d.ts.map +1 -1
- package/dist/music.js +7 -3
- package/dist/music.js.map +1 -1
- package/dist/noteUtils.d.ts +24 -0
- package/dist/noteUtils.d.ts.map +1 -0
- package/dist/noteUtils.js +80 -0
- package/dist/noteUtils.js.map +1 -0
- package/dist/parser.d.ts +4 -2
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +145 -23
- package/dist/parser.js.map +1 -1
- package/dist/song.d.ts +10 -1
- package/dist/song.d.ts.map +1 -1
- package/dist/song.js +39 -3
- package/dist/song.js.map +1 -1
- package/package.json +5 -3
package/dist/grammar.js
CHANGED
|
@@ -136,79 +136,113 @@ function peg$parse(input, options) {
|
|
|
136
136
|
const peg$source = options.grammarSource;
|
|
137
137
|
const peg$startRuleFunctions = {
|
|
138
138
|
start: peg$parsestart,
|
|
139
|
+
note: peg$parsenote,
|
|
139
140
|
};
|
|
140
141
|
let peg$startRuleFunction = peg$parsestart;
|
|
141
|
-
const peg$c0 = "
|
|
142
|
-
const peg$c1 = "
|
|
143
|
-
const peg$c2 = "
|
|
144
|
-
const peg$c3 = "
|
|
145
|
-
const peg$c4 = "
|
|
146
|
-
const peg$c5 = "
|
|
147
|
-
const peg$c6 = "
|
|
148
|
-
const peg$c7 = "
|
|
149
|
-
const peg$c8 = "
|
|
150
|
-
const peg$c9 = "
|
|
151
|
-
const peg$c10 = "
|
|
152
|
-
const peg$c11 = "
|
|
153
|
-
const peg$c12 = "
|
|
154
|
-
const peg$c13 = "
|
|
155
|
-
const peg$c14 = "
|
|
156
|
-
const peg$
|
|
157
|
-
const peg$
|
|
142
|
+
const peg$c0 = "#";
|
|
143
|
+
const peg$c1 = ":";
|
|
144
|
+
const peg$c2 = "\n";
|
|
145
|
+
const peg$c3 = "ks";
|
|
146
|
+
const peg$c4 = "-";
|
|
147
|
+
const peg$c5 = "ts";
|
|
148
|
+
const peg$c6 = "/";
|
|
149
|
+
const peg$c7 = "t";
|
|
150
|
+
const peg$c8 = "$";
|
|
151
|
+
const peg$c9 = "|";
|
|
152
|
+
const peg$c10 = ".";
|
|
153
|
+
const peg$c11 = "@";
|
|
154
|
+
const peg$c12 = "ht";
|
|
155
|
+
const peg$c13 = "dt";
|
|
156
|
+
const peg$c14 = "tt";
|
|
157
|
+
const peg$c15 = "m";
|
|
158
|
+
const peg$c16 = "{";
|
|
159
|
+
const peg$c17 = "}";
|
|
160
|
+
const peg$c18 = "\"";
|
|
161
|
+
const peg$c19 = "'";
|
|
162
|
+
const peg$c20 = "\\";
|
|
163
|
+
const peg$c21 = "n";
|
|
164
|
+
const peg$r0 = /^[ \t]/;
|
|
165
|
+
const peg$r1 = /^[a-zA-Z_]/;
|
|
158
166
|
const peg$r2 = /^[a-zA-Z0-9_]/;
|
|
159
|
-
const peg$r3 = /^[
|
|
160
|
-
const peg$r4 = /^[
|
|
161
|
-
const peg$r5 = /^[
|
|
162
|
-
const peg$r6 = /^[
|
|
163
|
-
const peg$r7 = /^[
|
|
164
|
-
const peg$
|
|
165
|
-
const peg$
|
|
166
|
-
const peg$
|
|
167
|
-
const peg$
|
|
168
|
-
const peg$
|
|
169
|
-
const peg$
|
|
170
|
-
const peg$
|
|
171
|
-
const peg$
|
|
172
|
-
const peg$
|
|
173
|
-
const peg$
|
|
174
|
-
const peg$
|
|
175
|
-
const peg$
|
|
176
|
-
const peg$
|
|
177
|
-
const peg$
|
|
178
|
-
const peg$
|
|
179
|
-
const peg$
|
|
180
|
-
const peg$
|
|
181
|
-
const peg$
|
|
182
|
-
const peg$
|
|
183
|
-
const peg$
|
|
184
|
-
const peg$
|
|
185
|
-
const peg$
|
|
186
|
-
const peg$
|
|
187
|
-
|
|
167
|
+
const peg$r3 = /^[^\n]/;
|
|
168
|
+
const peg$r4 = /^[0-9]/;
|
|
169
|
+
const peg$r5 = /^[gcfGCF]/;
|
|
170
|
+
const peg$r6 = /^[a-gA-G]/;
|
|
171
|
+
const peg$r7 = /^[+=\-]/;
|
|
172
|
+
const peg$r8 = /^[rR]/;
|
|
173
|
+
const peg$r9 = /^[\t\r\n ]/;
|
|
174
|
+
const peg$r10 = /^["\\]/;
|
|
175
|
+
const peg$r11 = /^['\\]/;
|
|
176
|
+
const peg$e0 = peg$literalExpectation("#", false);
|
|
177
|
+
const peg$e1 = peg$classExpectation([" ", "\t"], false, false, false);
|
|
178
|
+
const peg$e2 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
|
|
179
|
+
const peg$e3 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false, false);
|
|
180
|
+
const peg$e4 = peg$literalExpectation(":", false);
|
|
181
|
+
const peg$e5 = peg$classExpectation(["\n"], true, false, false);
|
|
182
|
+
const peg$e6 = peg$literalExpectation("\n", false);
|
|
183
|
+
const peg$e7 = peg$literalExpectation("ks", false);
|
|
184
|
+
const peg$e8 = peg$literalExpectation("-", false);
|
|
185
|
+
const peg$e9 = peg$classExpectation([["0", "9"]], false, false, false);
|
|
186
|
+
const peg$e10 = peg$literalExpectation("ts", false);
|
|
187
|
+
const peg$e11 = peg$literalExpectation("/", false);
|
|
188
|
+
const peg$e12 = peg$literalExpectation("t", false);
|
|
189
|
+
const peg$e13 = peg$classExpectation(["g", "c", "f", "G", "C", "F"], false, false, false);
|
|
190
|
+
const peg$e14 = peg$literalExpectation("$", false);
|
|
191
|
+
const peg$e15 = peg$literalExpectation("|", false);
|
|
192
|
+
const peg$e16 = peg$classExpectation([["a", "g"], ["A", "G"]], false, false, false);
|
|
193
|
+
const peg$e17 = peg$classExpectation(["+", "=", "-"], false, false, false);
|
|
194
|
+
const peg$e18 = peg$classExpectation(["r", "R"], false, false, false);
|
|
195
|
+
const peg$e19 = peg$literalExpectation(".", false);
|
|
196
|
+
const peg$e20 = peg$literalExpectation("@", false);
|
|
197
|
+
const peg$e21 = peg$literalExpectation("ht", false);
|
|
198
|
+
const peg$e22 = peg$literalExpectation("dt", false);
|
|
199
|
+
const peg$e23 = peg$literalExpectation("tt", false);
|
|
200
|
+
const peg$e24 = peg$literalExpectation("m", false);
|
|
201
|
+
const peg$e25 = peg$literalExpectation("{", false);
|
|
202
|
+
const peg$e26 = peg$literalExpectation("}", false);
|
|
203
|
+
const peg$e27 = peg$classExpectation(["\t", "\r", "\n", " "], false, false, false);
|
|
204
|
+
const peg$e28 = peg$literalExpectation("\"", false);
|
|
205
|
+
const peg$e29 = peg$literalExpectation("'", false);
|
|
206
|
+
const peg$e30 = peg$classExpectation(["\"", "\\"], false, false, false);
|
|
207
|
+
const peg$e31 = peg$anyExpectation();
|
|
208
|
+
const peg$e32 = peg$literalExpectation("\\", false);
|
|
209
|
+
const peg$e33 = peg$classExpectation(["'", "\\"], false, false, false);
|
|
210
|
+
const peg$e34 = peg$literalExpectation("n", false);
|
|
211
|
+
function peg$f0(frontmatter, commands) {
|
|
212
|
+
return frontmatter.concat(commands);
|
|
213
|
+
}
|
|
214
|
+
function peg$f1(key, value) {
|
|
215
|
+
return ["frontmatter", key, value.trim()];
|
|
216
|
+
}
|
|
217
|
+
function peg$f2(head, rest) {
|
|
188
218
|
return [head].concat(rest.map((m) => m[1]));
|
|
189
219
|
}
|
|
190
|
-
function peg$
|
|
220
|
+
function peg$f3() {
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
function peg$f4(mod) {
|
|
191
224
|
return ["keySignature", +mod];
|
|
192
225
|
}
|
|
193
|
-
function peg$
|
|
226
|
+
function peg$f5(upper, lower) {
|
|
194
227
|
return ["timeSignature", +upper, +lower];
|
|
195
228
|
}
|
|
196
|
-
function peg$
|
|
229
|
+
function peg$f6(track) {
|
|
197
230
|
return ["setTrack", +track];
|
|
198
231
|
}
|
|
199
|
-
function peg$
|
|
232
|
+
function peg$f7(clef) {
|
|
200
233
|
return ["clef", clef.toLowerCase()];
|
|
201
234
|
}
|
|
202
|
-
function peg$
|
|
235
|
+
function peg$f8(name) {
|
|
203
236
|
return ["macro", name.join("")];
|
|
204
237
|
}
|
|
205
|
-
function peg$
|
|
238
|
+
function peg$f9() {
|
|
206
239
|
return ["restoreStartPosition"];
|
|
207
240
|
}
|
|
208
|
-
function peg$
|
|
209
|
-
|
|
241
|
+
function peg$f10(name, accidental, octave, timing) {
|
|
242
|
+
let loc = location();
|
|
210
243
|
let opts = {
|
|
211
|
-
...timing
|
|
244
|
+
...timing,
|
|
245
|
+
location: [loc.start.offset, loc.end.offset]
|
|
212
246
|
};
|
|
213
247
|
if (accidental == "+") {
|
|
214
248
|
opts.sharp = true;
|
|
@@ -219,39 +253,59 @@ function peg$parse(input, options) {
|
|
|
219
253
|
else if (accidental == "=") {
|
|
220
254
|
opts.natural = true;
|
|
221
255
|
}
|
|
222
|
-
|
|
223
|
-
if (timing || accidental) {
|
|
224
|
-
note.push(opts);
|
|
225
|
-
}
|
|
226
|
-
return note;
|
|
256
|
+
return ["note", `${name.toUpperCase()}${octave ?? ""}`, opts];
|
|
227
257
|
}
|
|
228
|
-
function peg$
|
|
258
|
+
function peg$f11(timing) {
|
|
229
259
|
let rest = ["rest"];
|
|
230
260
|
if (timing) {
|
|
231
261
|
rest.push(timing);
|
|
232
262
|
}
|
|
233
263
|
return rest;
|
|
234
264
|
}
|
|
235
|
-
function peg$
|
|
236
|
-
function peg$
|
|
265
|
+
function peg$f12(d) { return +d; }
|
|
266
|
+
function peg$f13(d) { return 1 / +d; }
|
|
267
|
+
function peg$f14(duration, s) { return +s; }
|
|
268
|
+
function peg$f15(duration, start) { return duration !== null || start !== null; }
|
|
269
|
+
function peg$f16(duration, start) {
|
|
237
270
|
let timing = {};
|
|
238
|
-
if (duration)
|
|
239
|
-
timing.duration =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
271
|
+
if (duration !== null)
|
|
272
|
+
timing.duration = duration;
|
|
273
|
+
if (start !== null)
|
|
274
|
+
timing.start = start;
|
|
275
|
+
return timing;
|
|
276
|
+
}
|
|
277
|
+
function peg$f17(duration, s) { return +s; }
|
|
278
|
+
function peg$f18(duration, start) {
|
|
279
|
+
let timing = { duration: +duration };
|
|
280
|
+
if (start !== null)
|
|
281
|
+
timing.start = start;
|
|
244
282
|
return timing;
|
|
245
283
|
}
|
|
246
|
-
function peg$
|
|
247
|
-
|
|
248
|
-
function peg$f14() { return ["tripleTime"]; }
|
|
249
|
-
function peg$f15(measure) {
|
|
250
|
-
return ["measure", +measure];
|
|
284
|
+
function peg$f19(start) {
|
|
285
|
+
return { start: +start };
|
|
251
286
|
}
|
|
252
|
-
function peg$
|
|
287
|
+
function peg$f20(count) { return count ? ["halfTime", +count] : ["halfTime"]; }
|
|
288
|
+
function peg$f21(count) { return count ? ["doubleTime", +count] : ["doubleTime"]; }
|
|
289
|
+
function peg$f22(count) { return count ? ["tripleTime", +count] : ["tripleTime"]; }
|
|
290
|
+
function peg$f23(measure) { return ["measure", +measure]; }
|
|
291
|
+
function peg$f24() { return ["measure"]; }
|
|
292
|
+
function peg$f25(commands) {
|
|
253
293
|
return ["block", commands];
|
|
254
294
|
}
|
|
295
|
+
function peg$f26(chars) {
|
|
296
|
+
return ["string", chars.join("")];
|
|
297
|
+
}
|
|
298
|
+
function peg$f27(chars) {
|
|
299
|
+
return ["string", chars.join("")];
|
|
300
|
+
}
|
|
301
|
+
function peg$f28(char) { return char; }
|
|
302
|
+
function peg$f29(escape) { return escape; }
|
|
303
|
+
function peg$f30(char) { return char; }
|
|
304
|
+
function peg$f31(escape) { return escape; }
|
|
305
|
+
function peg$f32() { return '"'; }
|
|
306
|
+
function peg$f33() { return "'"; }
|
|
307
|
+
function peg$f34() { return "\\"; }
|
|
308
|
+
function peg$f35() { return "\n"; }
|
|
255
309
|
let peg$currPos = options.peg$currPos | 0;
|
|
256
310
|
let peg$savedPos = peg$currPos;
|
|
257
311
|
const peg$posDetailsCache = [{ line: 1, column: 1 }];
|
|
@@ -387,8 +441,208 @@ function peg$parse(input, options) {
|
|
|
387
441
|
return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
|
|
388
442
|
}
|
|
389
443
|
function peg$parsestart() {
|
|
390
|
-
let s0;
|
|
391
|
-
s0 = peg$
|
|
444
|
+
let s0, s1, s2;
|
|
445
|
+
s0 = peg$currPos;
|
|
446
|
+
s1 = [];
|
|
447
|
+
s2 = peg$parsefrontmatterLine();
|
|
448
|
+
while (s2 !== peg$FAILED) {
|
|
449
|
+
s1.push(s2);
|
|
450
|
+
s2 = peg$parsefrontmatterLine();
|
|
451
|
+
}
|
|
452
|
+
s2 = peg$parsecommands();
|
|
453
|
+
if (s2 !== peg$FAILED) {
|
|
454
|
+
peg$savedPos = s0;
|
|
455
|
+
s0 = peg$f0(s1, s2);
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
peg$currPos = s0;
|
|
459
|
+
s0 = peg$FAILED;
|
|
460
|
+
}
|
|
461
|
+
return s0;
|
|
462
|
+
}
|
|
463
|
+
function peg$parsefrontmatterLine() {
|
|
464
|
+
let s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
465
|
+
s0 = peg$currPos;
|
|
466
|
+
if (input.charCodeAt(peg$currPos) === 35) {
|
|
467
|
+
s1 = peg$c0;
|
|
468
|
+
peg$currPos++;
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
s1 = peg$FAILED;
|
|
472
|
+
if (peg$silentFails === 0) {
|
|
473
|
+
peg$fail(peg$e0);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (s1 !== peg$FAILED) {
|
|
477
|
+
s2 = [];
|
|
478
|
+
s3 = input.charAt(peg$currPos);
|
|
479
|
+
if (peg$r0.test(s3)) {
|
|
480
|
+
peg$currPos++;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
s3 = peg$FAILED;
|
|
484
|
+
if (peg$silentFails === 0) {
|
|
485
|
+
peg$fail(peg$e1);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
while (s3 !== peg$FAILED) {
|
|
489
|
+
s2.push(s3);
|
|
490
|
+
s3 = input.charAt(peg$currPos);
|
|
491
|
+
if (peg$r0.test(s3)) {
|
|
492
|
+
peg$currPos++;
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
s3 = peg$FAILED;
|
|
496
|
+
if (peg$silentFails === 0) {
|
|
497
|
+
peg$fail(peg$e1);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
s3 = peg$currPos;
|
|
502
|
+
s4 = peg$currPos;
|
|
503
|
+
s5 = input.charAt(peg$currPos);
|
|
504
|
+
if (peg$r1.test(s5)) {
|
|
505
|
+
peg$currPos++;
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
s5 = peg$FAILED;
|
|
509
|
+
if (peg$silentFails === 0) {
|
|
510
|
+
peg$fail(peg$e2);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (s5 !== peg$FAILED) {
|
|
514
|
+
s6 = [];
|
|
515
|
+
s7 = input.charAt(peg$currPos);
|
|
516
|
+
if (peg$r2.test(s7)) {
|
|
517
|
+
peg$currPos++;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
s7 = peg$FAILED;
|
|
521
|
+
if (peg$silentFails === 0) {
|
|
522
|
+
peg$fail(peg$e3);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
while (s7 !== peg$FAILED) {
|
|
526
|
+
s6.push(s7);
|
|
527
|
+
s7 = input.charAt(peg$currPos);
|
|
528
|
+
if (peg$r2.test(s7)) {
|
|
529
|
+
peg$currPos++;
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
s7 = peg$FAILED;
|
|
533
|
+
if (peg$silentFails === 0) {
|
|
534
|
+
peg$fail(peg$e3);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
s5 = [s5, s6];
|
|
539
|
+
s4 = s5;
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
peg$currPos = s4;
|
|
543
|
+
s4 = peg$FAILED;
|
|
544
|
+
}
|
|
545
|
+
if (s4 !== peg$FAILED) {
|
|
546
|
+
s3 = input.substring(s3, peg$currPos);
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
s3 = s4;
|
|
550
|
+
}
|
|
551
|
+
if (s3 !== peg$FAILED) {
|
|
552
|
+
s4 = [];
|
|
553
|
+
s5 = input.charAt(peg$currPos);
|
|
554
|
+
if (peg$r0.test(s5)) {
|
|
555
|
+
peg$currPos++;
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
s5 = peg$FAILED;
|
|
559
|
+
if (peg$silentFails === 0) {
|
|
560
|
+
peg$fail(peg$e1);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
while (s5 !== peg$FAILED) {
|
|
564
|
+
s4.push(s5);
|
|
565
|
+
s5 = input.charAt(peg$currPos);
|
|
566
|
+
if (peg$r0.test(s5)) {
|
|
567
|
+
peg$currPos++;
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
s5 = peg$FAILED;
|
|
571
|
+
if (peg$silentFails === 0) {
|
|
572
|
+
peg$fail(peg$e1);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (input.charCodeAt(peg$currPos) === 58) {
|
|
577
|
+
s5 = peg$c1;
|
|
578
|
+
peg$currPos++;
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
s5 = peg$FAILED;
|
|
582
|
+
if (peg$silentFails === 0) {
|
|
583
|
+
peg$fail(peg$e4);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
if (s5 !== peg$FAILED) {
|
|
587
|
+
s6 = peg$currPos;
|
|
588
|
+
s7 = [];
|
|
589
|
+
s8 = input.charAt(peg$currPos);
|
|
590
|
+
if (peg$r3.test(s8)) {
|
|
591
|
+
peg$currPos++;
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
s8 = peg$FAILED;
|
|
595
|
+
if (peg$silentFails === 0) {
|
|
596
|
+
peg$fail(peg$e5);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
while (s8 !== peg$FAILED) {
|
|
600
|
+
s7.push(s8);
|
|
601
|
+
s8 = input.charAt(peg$currPos);
|
|
602
|
+
if (peg$r3.test(s8)) {
|
|
603
|
+
peg$currPos++;
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
s8 = peg$FAILED;
|
|
607
|
+
if (peg$silentFails === 0) {
|
|
608
|
+
peg$fail(peg$e5);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
s6 = input.substring(s6, peg$currPos);
|
|
613
|
+
if (input.charCodeAt(peg$currPos) === 10) {
|
|
614
|
+
s7 = peg$c2;
|
|
615
|
+
peg$currPos++;
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
s7 = peg$FAILED;
|
|
619
|
+
if (peg$silentFails === 0) {
|
|
620
|
+
peg$fail(peg$e6);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
if (s7 !== peg$FAILED) {
|
|
624
|
+
peg$savedPos = s0;
|
|
625
|
+
s0 = peg$f1(s3, s6);
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
peg$currPos = s0;
|
|
629
|
+
s0 = peg$FAILED;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
peg$currPos = s0;
|
|
634
|
+
s0 = peg$FAILED;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
peg$currPos = s0;
|
|
639
|
+
s0 = peg$FAILED;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
peg$currPos = s0;
|
|
644
|
+
s0 = peg$FAILED;
|
|
645
|
+
}
|
|
392
646
|
return s0;
|
|
393
647
|
}
|
|
394
648
|
function peg$parsecommands() {
|
|
@@ -443,41 +697,54 @@ function peg$parse(input, options) {
|
|
|
443
697
|
s4 = null;
|
|
444
698
|
}
|
|
445
699
|
peg$savedPos = s0;
|
|
446
|
-
s0 = peg$
|
|
700
|
+
s0 = peg$f2(s2, s3);
|
|
447
701
|
}
|
|
448
702
|
else {
|
|
449
703
|
peg$currPos = s0;
|
|
450
704
|
s0 = peg$FAILED;
|
|
451
705
|
}
|
|
706
|
+
if (s0 === peg$FAILED) {
|
|
707
|
+
s0 = peg$currPos;
|
|
708
|
+
s1 = peg$parsewhite();
|
|
709
|
+
if (s1 === peg$FAILED) {
|
|
710
|
+
s1 = null;
|
|
711
|
+
}
|
|
712
|
+
peg$savedPos = s0;
|
|
713
|
+
s1 = peg$f3();
|
|
714
|
+
s0 = s1;
|
|
715
|
+
}
|
|
452
716
|
return s0;
|
|
453
717
|
}
|
|
454
718
|
function peg$parsecommand() {
|
|
455
719
|
let s0;
|
|
456
|
-
s0 = peg$
|
|
720
|
+
s0 = peg$parsekeySignature();
|
|
457
721
|
if (s0 === peg$FAILED) {
|
|
458
|
-
s0 = peg$
|
|
722
|
+
s0 = peg$parsetimeSignature();
|
|
459
723
|
if (s0 === peg$FAILED) {
|
|
460
|
-
s0 = peg$
|
|
724
|
+
s0 = peg$parsehalfTime();
|
|
461
725
|
if (s0 === peg$FAILED) {
|
|
462
|
-
s0 = peg$
|
|
726
|
+
s0 = peg$parsedoubleTime();
|
|
463
727
|
if (s0 === peg$FAILED) {
|
|
464
|
-
s0 = peg$
|
|
728
|
+
s0 = peg$parsetripleTime();
|
|
465
729
|
if (s0 === peg$FAILED) {
|
|
466
|
-
s0 = peg$
|
|
730
|
+
s0 = peg$parsemeasure();
|
|
467
731
|
if (s0 === peg$FAILED) {
|
|
468
|
-
s0 = peg$
|
|
732
|
+
s0 = peg$parseblock();
|
|
469
733
|
if (s0 === peg$FAILED) {
|
|
470
|
-
s0 = peg$
|
|
734
|
+
s0 = peg$parserestoreStartPosition();
|
|
471
735
|
if (s0 === peg$FAILED) {
|
|
472
|
-
s0 = peg$
|
|
736
|
+
s0 = peg$parsesetTrack();
|
|
473
737
|
if (s0 === peg$FAILED) {
|
|
474
|
-
s0 = peg$
|
|
738
|
+
s0 = peg$parsemacro();
|
|
475
739
|
if (s0 === peg$FAILED) {
|
|
476
|
-
s0 = peg$
|
|
740
|
+
s0 = peg$parsesetClef();
|
|
477
741
|
if (s0 === peg$FAILED) {
|
|
478
|
-
s0 = peg$
|
|
742
|
+
s0 = peg$parsestring();
|
|
479
743
|
if (s0 === peg$FAILED) {
|
|
480
|
-
s0 = peg$
|
|
744
|
+
s0 = peg$parsenote();
|
|
745
|
+
if (s0 === peg$FAILED) {
|
|
746
|
+
s0 = peg$parserest();
|
|
747
|
+
}
|
|
481
748
|
}
|
|
482
749
|
}
|
|
483
750
|
}
|
|
@@ -495,27 +762,27 @@ function peg$parse(input, options) {
|
|
|
495
762
|
function peg$parsekeySignature() {
|
|
496
763
|
let s0, s1, s2, s3, s4, s5, s6;
|
|
497
764
|
s0 = peg$currPos;
|
|
498
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
499
|
-
s1 = peg$
|
|
765
|
+
if (input.substr(peg$currPos, 2) === peg$c3) {
|
|
766
|
+
s1 = peg$c3;
|
|
500
767
|
peg$currPos += 2;
|
|
501
768
|
}
|
|
502
769
|
else {
|
|
503
770
|
s1 = peg$FAILED;
|
|
504
771
|
if (peg$silentFails === 0) {
|
|
505
|
-
peg$fail(peg$
|
|
772
|
+
peg$fail(peg$e7);
|
|
506
773
|
}
|
|
507
774
|
}
|
|
508
775
|
if (s1 !== peg$FAILED) {
|
|
509
776
|
s2 = peg$currPos;
|
|
510
777
|
s3 = peg$currPos;
|
|
511
778
|
if (input.charCodeAt(peg$currPos) === 45) {
|
|
512
|
-
s4 = peg$
|
|
779
|
+
s4 = peg$c4;
|
|
513
780
|
peg$currPos++;
|
|
514
781
|
}
|
|
515
782
|
else {
|
|
516
783
|
s4 = peg$FAILED;
|
|
517
784
|
if (peg$silentFails === 0) {
|
|
518
|
-
peg$fail(peg$
|
|
785
|
+
peg$fail(peg$e8);
|
|
519
786
|
}
|
|
520
787
|
}
|
|
521
788
|
if (s4 === peg$FAILED) {
|
|
@@ -523,26 +790,26 @@ function peg$parse(input, options) {
|
|
|
523
790
|
}
|
|
524
791
|
s5 = [];
|
|
525
792
|
s6 = input.charAt(peg$currPos);
|
|
526
|
-
if (peg$
|
|
793
|
+
if (peg$r4.test(s6)) {
|
|
527
794
|
peg$currPos++;
|
|
528
795
|
}
|
|
529
796
|
else {
|
|
530
797
|
s6 = peg$FAILED;
|
|
531
798
|
if (peg$silentFails === 0) {
|
|
532
|
-
peg$fail(peg$
|
|
799
|
+
peg$fail(peg$e9);
|
|
533
800
|
}
|
|
534
801
|
}
|
|
535
802
|
if (s6 !== peg$FAILED) {
|
|
536
803
|
while (s6 !== peg$FAILED) {
|
|
537
804
|
s5.push(s6);
|
|
538
805
|
s6 = input.charAt(peg$currPos);
|
|
539
|
-
if (peg$
|
|
806
|
+
if (peg$r4.test(s6)) {
|
|
540
807
|
peg$currPos++;
|
|
541
808
|
}
|
|
542
809
|
else {
|
|
543
810
|
s6 = peg$FAILED;
|
|
544
811
|
if (peg$silentFails === 0) {
|
|
545
|
-
peg$fail(peg$
|
|
812
|
+
peg$fail(peg$e9);
|
|
546
813
|
}
|
|
547
814
|
}
|
|
548
815
|
}
|
|
@@ -566,7 +833,7 @@ function peg$parse(input, options) {
|
|
|
566
833
|
}
|
|
567
834
|
if (s2 !== peg$FAILED) {
|
|
568
835
|
peg$savedPos = s0;
|
|
569
|
-
s0 = peg$
|
|
836
|
+
s0 = peg$f4(s2);
|
|
570
837
|
}
|
|
571
838
|
else {
|
|
572
839
|
peg$currPos = s0;
|
|
@@ -582,40 +849,40 @@ function peg$parse(input, options) {
|
|
|
582
849
|
function peg$parsetimeSignature() {
|
|
583
850
|
let s0, s1, s2, s3, s4, s5, s6;
|
|
584
851
|
s0 = peg$currPos;
|
|
585
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
586
|
-
s1 = peg$
|
|
852
|
+
if (input.substr(peg$currPos, 2) === peg$c5) {
|
|
853
|
+
s1 = peg$c5;
|
|
587
854
|
peg$currPos += 2;
|
|
588
855
|
}
|
|
589
856
|
else {
|
|
590
857
|
s1 = peg$FAILED;
|
|
591
858
|
if (peg$silentFails === 0) {
|
|
592
|
-
peg$fail(peg$
|
|
859
|
+
peg$fail(peg$e10);
|
|
593
860
|
}
|
|
594
861
|
}
|
|
595
862
|
if (s1 !== peg$FAILED) {
|
|
596
863
|
s2 = peg$currPos;
|
|
597
864
|
s3 = [];
|
|
598
865
|
s4 = input.charAt(peg$currPos);
|
|
599
|
-
if (peg$
|
|
866
|
+
if (peg$r4.test(s4)) {
|
|
600
867
|
peg$currPos++;
|
|
601
868
|
}
|
|
602
869
|
else {
|
|
603
870
|
s4 = peg$FAILED;
|
|
604
871
|
if (peg$silentFails === 0) {
|
|
605
|
-
peg$fail(peg$
|
|
872
|
+
peg$fail(peg$e9);
|
|
606
873
|
}
|
|
607
874
|
}
|
|
608
875
|
if (s4 !== peg$FAILED) {
|
|
609
876
|
while (s4 !== peg$FAILED) {
|
|
610
877
|
s3.push(s4);
|
|
611
878
|
s4 = input.charAt(peg$currPos);
|
|
612
|
-
if (peg$
|
|
879
|
+
if (peg$r4.test(s4)) {
|
|
613
880
|
peg$currPos++;
|
|
614
881
|
}
|
|
615
882
|
else {
|
|
616
883
|
s4 = peg$FAILED;
|
|
617
884
|
if (peg$silentFails === 0) {
|
|
618
|
-
peg$fail(peg$
|
|
885
|
+
peg$fail(peg$e9);
|
|
619
886
|
}
|
|
620
887
|
}
|
|
621
888
|
}
|
|
@@ -631,39 +898,39 @@ function peg$parse(input, options) {
|
|
|
631
898
|
}
|
|
632
899
|
if (s2 !== peg$FAILED) {
|
|
633
900
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
634
|
-
s3 = peg$
|
|
901
|
+
s3 = peg$c6;
|
|
635
902
|
peg$currPos++;
|
|
636
903
|
}
|
|
637
904
|
else {
|
|
638
905
|
s3 = peg$FAILED;
|
|
639
906
|
if (peg$silentFails === 0) {
|
|
640
|
-
peg$fail(peg$
|
|
907
|
+
peg$fail(peg$e11);
|
|
641
908
|
}
|
|
642
909
|
}
|
|
643
910
|
if (s3 !== peg$FAILED) {
|
|
644
911
|
s4 = peg$currPos;
|
|
645
912
|
s5 = [];
|
|
646
913
|
s6 = input.charAt(peg$currPos);
|
|
647
|
-
if (peg$
|
|
914
|
+
if (peg$r4.test(s6)) {
|
|
648
915
|
peg$currPos++;
|
|
649
916
|
}
|
|
650
917
|
else {
|
|
651
918
|
s6 = peg$FAILED;
|
|
652
919
|
if (peg$silentFails === 0) {
|
|
653
|
-
peg$fail(peg$
|
|
920
|
+
peg$fail(peg$e9);
|
|
654
921
|
}
|
|
655
922
|
}
|
|
656
923
|
if (s6 !== peg$FAILED) {
|
|
657
924
|
while (s6 !== peg$FAILED) {
|
|
658
925
|
s5.push(s6);
|
|
659
926
|
s6 = input.charAt(peg$currPos);
|
|
660
|
-
if (peg$
|
|
927
|
+
if (peg$r4.test(s6)) {
|
|
661
928
|
peg$currPos++;
|
|
662
929
|
}
|
|
663
930
|
else {
|
|
664
931
|
s6 = peg$FAILED;
|
|
665
932
|
if (peg$silentFails === 0) {
|
|
666
|
-
peg$fail(peg$
|
|
933
|
+
peg$fail(peg$e9);
|
|
667
934
|
}
|
|
668
935
|
}
|
|
669
936
|
}
|
|
@@ -679,7 +946,7 @@ function peg$parse(input, options) {
|
|
|
679
946
|
}
|
|
680
947
|
if (s4 !== peg$FAILED) {
|
|
681
948
|
peg$savedPos = s0;
|
|
682
|
-
s0 = peg$
|
|
949
|
+
s0 = peg$f5(s2, s4);
|
|
683
950
|
}
|
|
684
951
|
else {
|
|
685
952
|
peg$currPos = s0;
|
|
@@ -706,39 +973,39 @@ function peg$parse(input, options) {
|
|
|
706
973
|
let s0, s1, s2, s3, s4;
|
|
707
974
|
s0 = peg$currPos;
|
|
708
975
|
if (input.charCodeAt(peg$currPos) === 116) {
|
|
709
|
-
s1 = peg$
|
|
976
|
+
s1 = peg$c7;
|
|
710
977
|
peg$currPos++;
|
|
711
978
|
}
|
|
712
979
|
else {
|
|
713
980
|
s1 = peg$FAILED;
|
|
714
981
|
if (peg$silentFails === 0) {
|
|
715
|
-
peg$fail(peg$
|
|
982
|
+
peg$fail(peg$e12);
|
|
716
983
|
}
|
|
717
984
|
}
|
|
718
985
|
if (s1 !== peg$FAILED) {
|
|
719
986
|
s2 = peg$currPos;
|
|
720
987
|
s3 = [];
|
|
721
988
|
s4 = input.charAt(peg$currPos);
|
|
722
|
-
if (peg$
|
|
989
|
+
if (peg$r4.test(s4)) {
|
|
723
990
|
peg$currPos++;
|
|
724
991
|
}
|
|
725
992
|
else {
|
|
726
993
|
s4 = peg$FAILED;
|
|
727
994
|
if (peg$silentFails === 0) {
|
|
728
|
-
peg$fail(peg$
|
|
995
|
+
peg$fail(peg$e9);
|
|
729
996
|
}
|
|
730
997
|
}
|
|
731
998
|
if (s4 !== peg$FAILED) {
|
|
732
999
|
while (s4 !== peg$FAILED) {
|
|
733
1000
|
s3.push(s4);
|
|
734
1001
|
s4 = input.charAt(peg$currPos);
|
|
735
|
-
if (peg$
|
|
1002
|
+
if (peg$r4.test(s4)) {
|
|
736
1003
|
peg$currPos++;
|
|
737
1004
|
}
|
|
738
1005
|
else {
|
|
739
1006
|
s4 = peg$FAILED;
|
|
740
1007
|
if (peg$silentFails === 0) {
|
|
741
|
-
peg$fail(peg$
|
|
1008
|
+
peg$fail(peg$e9);
|
|
742
1009
|
}
|
|
743
1010
|
}
|
|
744
1011
|
}
|
|
@@ -754,7 +1021,7 @@ function peg$parse(input, options) {
|
|
|
754
1021
|
}
|
|
755
1022
|
if (s2 !== peg$FAILED) {
|
|
756
1023
|
peg$savedPos = s0;
|
|
757
|
-
s0 = peg$
|
|
1024
|
+
s0 = peg$f6(s2);
|
|
758
1025
|
}
|
|
759
1026
|
else {
|
|
760
1027
|
peg$currPos = s0;
|
|
@@ -771,29 +1038,29 @@ function peg$parse(input, options) {
|
|
|
771
1038
|
let s0, s1, s2;
|
|
772
1039
|
s0 = peg$currPos;
|
|
773
1040
|
if (input.charCodeAt(peg$currPos) === 47) {
|
|
774
|
-
s1 = peg$
|
|
1041
|
+
s1 = peg$c6;
|
|
775
1042
|
peg$currPos++;
|
|
776
1043
|
}
|
|
777
1044
|
else {
|
|
778
1045
|
s1 = peg$FAILED;
|
|
779
1046
|
if (peg$silentFails === 0) {
|
|
780
|
-
peg$fail(peg$
|
|
1047
|
+
peg$fail(peg$e11);
|
|
781
1048
|
}
|
|
782
1049
|
}
|
|
783
1050
|
if (s1 !== peg$FAILED) {
|
|
784
1051
|
s2 = input.charAt(peg$currPos);
|
|
785
|
-
if (peg$
|
|
1052
|
+
if (peg$r5.test(s2)) {
|
|
786
1053
|
peg$currPos++;
|
|
787
1054
|
}
|
|
788
1055
|
else {
|
|
789
1056
|
s2 = peg$FAILED;
|
|
790
1057
|
if (peg$silentFails === 0) {
|
|
791
|
-
peg$fail(peg$
|
|
1058
|
+
peg$fail(peg$e13);
|
|
792
1059
|
}
|
|
793
1060
|
}
|
|
794
1061
|
if (s2 !== peg$FAILED) {
|
|
795
1062
|
peg$savedPos = s0;
|
|
796
|
-
s0 = peg$
|
|
1063
|
+
s0 = peg$f7(s2);
|
|
797
1064
|
}
|
|
798
1065
|
else {
|
|
799
1066
|
peg$currPos = s0;
|
|
@@ -810,13 +1077,13 @@ function peg$parse(input, options) {
|
|
|
810
1077
|
let s0, s1, s2, s3;
|
|
811
1078
|
s0 = peg$currPos;
|
|
812
1079
|
if (input.charCodeAt(peg$currPos) === 36) {
|
|
813
|
-
s1 = peg$
|
|
1080
|
+
s1 = peg$c8;
|
|
814
1081
|
peg$currPos++;
|
|
815
1082
|
}
|
|
816
1083
|
else {
|
|
817
1084
|
s1 = peg$FAILED;
|
|
818
1085
|
if (peg$silentFails === 0) {
|
|
819
|
-
peg$fail(peg$
|
|
1086
|
+
peg$fail(peg$e14);
|
|
820
1087
|
}
|
|
821
1088
|
}
|
|
822
1089
|
if (s1 !== peg$FAILED) {
|
|
@@ -828,7 +1095,7 @@ function peg$parse(input, options) {
|
|
|
828
1095
|
else {
|
|
829
1096
|
s3 = peg$FAILED;
|
|
830
1097
|
if (peg$silentFails === 0) {
|
|
831
|
-
peg$fail(peg$
|
|
1098
|
+
peg$fail(peg$e3);
|
|
832
1099
|
}
|
|
833
1100
|
}
|
|
834
1101
|
if (s3 !== peg$FAILED) {
|
|
@@ -841,7 +1108,7 @@ function peg$parse(input, options) {
|
|
|
841
1108
|
else {
|
|
842
1109
|
s3 = peg$FAILED;
|
|
843
1110
|
if (peg$silentFails === 0) {
|
|
844
|
-
peg$fail(peg$
|
|
1111
|
+
peg$fail(peg$e3);
|
|
845
1112
|
}
|
|
846
1113
|
}
|
|
847
1114
|
}
|
|
@@ -851,7 +1118,7 @@ function peg$parse(input, options) {
|
|
|
851
1118
|
}
|
|
852
1119
|
if (s2 !== peg$FAILED) {
|
|
853
1120
|
peg$savedPos = s0;
|
|
854
|
-
s0 = peg$
|
|
1121
|
+
s0 = peg$f8(s2);
|
|
855
1122
|
}
|
|
856
1123
|
else {
|
|
857
1124
|
peg$currPos = s0;
|
|
@@ -868,96 +1135,68 @@ function peg$parse(input, options) {
|
|
|
868
1135
|
let s0, s1;
|
|
869
1136
|
s0 = peg$currPos;
|
|
870
1137
|
if (input.charCodeAt(peg$currPos) === 124) {
|
|
871
|
-
s1 = peg$
|
|
1138
|
+
s1 = peg$c9;
|
|
872
1139
|
peg$currPos++;
|
|
873
1140
|
}
|
|
874
1141
|
else {
|
|
875
1142
|
s1 = peg$FAILED;
|
|
876
1143
|
if (peg$silentFails === 0) {
|
|
877
|
-
peg$fail(peg$
|
|
1144
|
+
peg$fail(peg$e15);
|
|
878
1145
|
}
|
|
879
1146
|
}
|
|
880
1147
|
if (s1 !== peg$FAILED) {
|
|
881
1148
|
peg$savedPos = s0;
|
|
882
|
-
s1 = peg$
|
|
1149
|
+
s1 = peg$f9();
|
|
883
1150
|
}
|
|
884
1151
|
s0 = s1;
|
|
885
1152
|
return s0;
|
|
886
1153
|
}
|
|
887
1154
|
function peg$parsenote() {
|
|
888
|
-
let s0, s1, s2, s3, s4
|
|
1155
|
+
let s0, s1, s2, s3, s4;
|
|
889
1156
|
s0 = peg$currPos;
|
|
890
1157
|
s1 = input.charAt(peg$currPos);
|
|
891
|
-
if (peg$
|
|
1158
|
+
if (peg$r6.test(s1)) {
|
|
892
1159
|
peg$currPos++;
|
|
893
1160
|
}
|
|
894
1161
|
else {
|
|
895
1162
|
s1 = peg$FAILED;
|
|
896
1163
|
if (peg$silentFails === 0) {
|
|
897
|
-
peg$fail(peg$
|
|
1164
|
+
peg$fail(peg$e16);
|
|
898
1165
|
}
|
|
899
1166
|
}
|
|
900
1167
|
if (s1 !== peg$FAILED) {
|
|
901
1168
|
s2 = input.charAt(peg$currPos);
|
|
902
|
-
if (peg$
|
|
1169
|
+
if (peg$r7.test(s2)) {
|
|
903
1170
|
peg$currPos++;
|
|
904
1171
|
}
|
|
905
1172
|
else {
|
|
906
1173
|
s2 = peg$FAILED;
|
|
907
1174
|
if (peg$silentFails === 0) {
|
|
908
|
-
peg$fail(peg$
|
|
1175
|
+
peg$fail(peg$e17);
|
|
909
1176
|
}
|
|
910
1177
|
}
|
|
911
1178
|
if (s2 === peg$FAILED) {
|
|
912
1179
|
s2 = null;
|
|
913
1180
|
}
|
|
914
1181
|
s3 = input.charAt(peg$currPos);
|
|
915
|
-
if (peg$
|
|
1182
|
+
if (peg$r4.test(s3)) {
|
|
916
1183
|
peg$currPos++;
|
|
917
1184
|
}
|
|
918
1185
|
else {
|
|
919
1186
|
s3 = peg$FAILED;
|
|
920
1187
|
if (peg$silentFails === 0) {
|
|
921
|
-
peg$fail(peg$
|
|
1188
|
+
peg$fail(peg$e9);
|
|
922
1189
|
}
|
|
923
1190
|
}
|
|
924
|
-
if (s3
|
|
925
|
-
|
|
926
|
-
if (input.charCodeAt(peg$currPos) === 46) {
|
|
927
|
-
s5 = peg$c7;
|
|
928
|
-
peg$currPos++;
|
|
929
|
-
}
|
|
930
|
-
else {
|
|
931
|
-
s5 = peg$FAILED;
|
|
932
|
-
if (peg$silentFails === 0) {
|
|
933
|
-
peg$fail(peg$e12);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
if (s5 !== peg$FAILED) {
|
|
937
|
-
s6 = peg$parsenoteTiming();
|
|
938
|
-
if (s6 !== peg$FAILED) {
|
|
939
|
-
peg$savedPos = s4;
|
|
940
|
-
s4 = peg$f7(s1, s2, s3, s6);
|
|
941
|
-
}
|
|
942
|
-
else {
|
|
943
|
-
peg$currPos = s4;
|
|
944
|
-
s4 = peg$FAILED;
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
peg$currPos = s4;
|
|
949
|
-
s4 = peg$FAILED;
|
|
950
|
-
}
|
|
951
|
-
if (s4 === peg$FAILED) {
|
|
952
|
-
s4 = null;
|
|
953
|
-
}
|
|
954
|
-
peg$savedPos = s0;
|
|
955
|
-
s0 = peg$f8(s1, s2, s3, s4);
|
|
1191
|
+
if (s3 === peg$FAILED) {
|
|
1192
|
+
s3 = null;
|
|
956
1193
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1194
|
+
s4 = peg$parsenoteTiming();
|
|
1195
|
+
if (s4 === peg$FAILED) {
|
|
1196
|
+
s4 = null;
|
|
960
1197
|
}
|
|
1198
|
+
peg$savedPos = s0;
|
|
1199
|
+
s0 = peg$f10(s1, s2, s3, s4);
|
|
961
1200
|
}
|
|
962
1201
|
else {
|
|
963
1202
|
peg$currPos = s0;
|
|
@@ -969,22 +1208,22 @@ function peg$parse(input, options) {
|
|
|
969
1208
|
let s0, s1, s2;
|
|
970
1209
|
s0 = peg$currPos;
|
|
971
1210
|
s1 = input.charAt(peg$currPos);
|
|
972
|
-
if (peg$
|
|
1211
|
+
if (peg$r8.test(s1)) {
|
|
973
1212
|
peg$currPos++;
|
|
974
1213
|
}
|
|
975
1214
|
else {
|
|
976
1215
|
s1 = peg$FAILED;
|
|
977
1216
|
if (peg$silentFails === 0) {
|
|
978
|
-
peg$fail(peg$
|
|
1217
|
+
peg$fail(peg$e18);
|
|
979
1218
|
}
|
|
980
1219
|
}
|
|
981
1220
|
if (s1 !== peg$FAILED) {
|
|
982
|
-
s2 = peg$
|
|
1221
|
+
s2 = peg$parserestTiming();
|
|
983
1222
|
if (s2 === peg$FAILED) {
|
|
984
1223
|
s2 = null;
|
|
985
1224
|
}
|
|
986
1225
|
peg$savedPos = s0;
|
|
987
|
-
s0 = peg$
|
|
1226
|
+
s0 = peg$f11(s2);
|
|
988
1227
|
}
|
|
989
1228
|
else {
|
|
990
1229
|
peg$currPos = s0;
|
|
@@ -996,77 +1235,313 @@ function peg$parse(input, options) {
|
|
|
996
1235
|
let s0, s1, s2, s3, s4, s5, s6;
|
|
997
1236
|
s0 = peg$currPos;
|
|
998
1237
|
s1 = peg$currPos;
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
if (peg$r0.test(s3)) {
|
|
1238
|
+
if (input.charCodeAt(peg$currPos) === 46) {
|
|
1239
|
+
s2 = peg$c10;
|
|
1002
1240
|
peg$currPos++;
|
|
1003
1241
|
}
|
|
1004
1242
|
else {
|
|
1005
|
-
|
|
1243
|
+
s2 = peg$FAILED;
|
|
1006
1244
|
if (peg$silentFails === 0) {
|
|
1007
|
-
peg$fail(peg$
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
if (s3 !== peg$FAILED) {
|
|
1011
|
-
while (s3 !== peg$FAILED) {
|
|
1012
|
-
s2.push(s3);
|
|
1013
|
-
s3 = input.charAt(peg$currPos);
|
|
1014
|
-
if (peg$r0.test(s3)) {
|
|
1015
|
-
peg$currPos++;
|
|
1016
|
-
}
|
|
1017
|
-
else {
|
|
1018
|
-
s3 = peg$FAILED;
|
|
1019
|
-
if (peg$silentFails === 0) {
|
|
1020
|
-
peg$fail(peg$e2);
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1245
|
+
peg$fail(peg$e19);
|
|
1023
1246
|
}
|
|
1024
1247
|
}
|
|
1025
|
-
else {
|
|
1026
|
-
s2 = peg$FAILED;
|
|
1027
|
-
}
|
|
1028
1248
|
if (s2 !== peg$FAILED) {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
if (s1 !== peg$FAILED) {
|
|
1035
|
-
s2 = peg$currPos;
|
|
1036
|
-
if (input.charCodeAt(peg$currPos) === 46) {
|
|
1037
|
-
s3 = peg$c7;
|
|
1249
|
+
s3 = peg$currPos;
|
|
1250
|
+
s4 = peg$currPos;
|
|
1251
|
+
s5 = [];
|
|
1252
|
+
s6 = input.charAt(peg$currPos);
|
|
1253
|
+
if (peg$r4.test(s6)) {
|
|
1038
1254
|
peg$currPos++;
|
|
1039
1255
|
}
|
|
1040
1256
|
else {
|
|
1041
|
-
|
|
1257
|
+
s6 = peg$FAILED;
|
|
1042
1258
|
if (peg$silentFails === 0) {
|
|
1043
|
-
peg$fail(peg$
|
|
1259
|
+
peg$fail(peg$e9);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
while (s6 !== peg$FAILED) {
|
|
1263
|
+
s5.push(s6);
|
|
1264
|
+
if (s5.length >= 3) {
|
|
1265
|
+
s6 = peg$FAILED;
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
s6 = input.charAt(peg$currPos);
|
|
1269
|
+
if (peg$r4.test(s6)) {
|
|
1270
|
+
peg$currPos++;
|
|
1271
|
+
}
|
|
1272
|
+
else {
|
|
1273
|
+
s6 = peg$FAILED;
|
|
1274
|
+
if (peg$silentFails === 0) {
|
|
1275
|
+
peg$fail(peg$e9);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (s5.length < 1) {
|
|
1281
|
+
peg$currPos = s4;
|
|
1282
|
+
s4 = peg$FAILED;
|
|
1283
|
+
}
|
|
1284
|
+
else {
|
|
1285
|
+
s4 = s5;
|
|
1286
|
+
}
|
|
1287
|
+
if (s4 !== peg$FAILED) {
|
|
1288
|
+
s3 = input.substring(s3, peg$currPos);
|
|
1289
|
+
}
|
|
1290
|
+
else {
|
|
1291
|
+
s3 = s4;
|
|
1292
|
+
}
|
|
1293
|
+
if (s3 !== peg$FAILED) {
|
|
1294
|
+
peg$savedPos = s1;
|
|
1295
|
+
s1 = peg$f12(s3);
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
peg$currPos = s1;
|
|
1299
|
+
s1 = peg$FAILED;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
else {
|
|
1303
|
+
peg$currPos = s1;
|
|
1304
|
+
s1 = peg$FAILED;
|
|
1305
|
+
}
|
|
1306
|
+
if (s1 === peg$FAILED) {
|
|
1307
|
+
s1 = peg$currPos;
|
|
1308
|
+
if (input.charCodeAt(peg$currPos) === 47) {
|
|
1309
|
+
s2 = peg$c6;
|
|
1310
|
+
peg$currPos++;
|
|
1311
|
+
}
|
|
1312
|
+
else {
|
|
1313
|
+
s2 = peg$FAILED;
|
|
1314
|
+
if (peg$silentFails === 0) {
|
|
1315
|
+
peg$fail(peg$e11);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
if (s2 !== peg$FAILED) {
|
|
1319
|
+
s3 = peg$currPos;
|
|
1320
|
+
s4 = peg$currPos;
|
|
1321
|
+
s5 = [];
|
|
1322
|
+
s6 = input.charAt(peg$currPos);
|
|
1323
|
+
if (peg$r4.test(s6)) {
|
|
1324
|
+
peg$currPos++;
|
|
1325
|
+
}
|
|
1326
|
+
else {
|
|
1327
|
+
s6 = peg$FAILED;
|
|
1328
|
+
if (peg$silentFails === 0) {
|
|
1329
|
+
peg$fail(peg$e9);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
while (s6 !== peg$FAILED) {
|
|
1333
|
+
s5.push(s6);
|
|
1334
|
+
if (s5.length >= 3) {
|
|
1335
|
+
s6 = peg$FAILED;
|
|
1336
|
+
}
|
|
1337
|
+
else {
|
|
1338
|
+
s6 = input.charAt(peg$currPos);
|
|
1339
|
+
if (peg$r4.test(s6)) {
|
|
1340
|
+
peg$currPos++;
|
|
1341
|
+
}
|
|
1342
|
+
else {
|
|
1343
|
+
s6 = peg$FAILED;
|
|
1344
|
+
if (peg$silentFails === 0) {
|
|
1345
|
+
peg$fail(peg$e9);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
if (s5.length < 1) {
|
|
1351
|
+
peg$currPos = s4;
|
|
1352
|
+
s4 = peg$FAILED;
|
|
1353
|
+
}
|
|
1354
|
+
else {
|
|
1355
|
+
s4 = s5;
|
|
1356
|
+
}
|
|
1357
|
+
if (s4 !== peg$FAILED) {
|
|
1358
|
+
s3 = input.substring(s3, peg$currPos);
|
|
1359
|
+
}
|
|
1360
|
+
else {
|
|
1361
|
+
s3 = s4;
|
|
1362
|
+
}
|
|
1363
|
+
if (s3 !== peg$FAILED) {
|
|
1364
|
+
peg$savedPos = s1;
|
|
1365
|
+
s1 = peg$f13(s3);
|
|
1366
|
+
}
|
|
1367
|
+
else {
|
|
1368
|
+
peg$currPos = s1;
|
|
1369
|
+
s1 = peg$FAILED;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
peg$currPos = s1;
|
|
1374
|
+
s1 = peg$FAILED;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
if (s1 === peg$FAILED) {
|
|
1378
|
+
s1 = null;
|
|
1379
|
+
}
|
|
1380
|
+
s2 = peg$currPos;
|
|
1381
|
+
if (input.charCodeAt(peg$currPos) === 64) {
|
|
1382
|
+
s3 = peg$c11;
|
|
1383
|
+
peg$currPos++;
|
|
1384
|
+
}
|
|
1385
|
+
else {
|
|
1386
|
+
s3 = peg$FAILED;
|
|
1387
|
+
if (peg$silentFails === 0) {
|
|
1388
|
+
peg$fail(peg$e20);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
if (s3 !== peg$FAILED) {
|
|
1392
|
+
s4 = peg$currPos;
|
|
1393
|
+
s5 = [];
|
|
1394
|
+
s6 = input.charAt(peg$currPos);
|
|
1395
|
+
if (peg$r4.test(s6)) {
|
|
1396
|
+
peg$currPos++;
|
|
1397
|
+
}
|
|
1398
|
+
else {
|
|
1399
|
+
s6 = peg$FAILED;
|
|
1400
|
+
if (peg$silentFails === 0) {
|
|
1401
|
+
peg$fail(peg$e9);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
if (s6 !== peg$FAILED) {
|
|
1405
|
+
while (s6 !== peg$FAILED) {
|
|
1406
|
+
s5.push(s6);
|
|
1407
|
+
s6 = input.charAt(peg$currPos);
|
|
1408
|
+
if (peg$r4.test(s6)) {
|
|
1409
|
+
peg$currPos++;
|
|
1410
|
+
}
|
|
1411
|
+
else {
|
|
1412
|
+
s6 = peg$FAILED;
|
|
1413
|
+
if (peg$silentFails === 0) {
|
|
1414
|
+
peg$fail(peg$e9);
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
else {
|
|
1420
|
+
s5 = peg$FAILED;
|
|
1421
|
+
}
|
|
1422
|
+
if (s5 !== peg$FAILED) {
|
|
1423
|
+
s4 = input.substring(s4, peg$currPos);
|
|
1424
|
+
}
|
|
1425
|
+
else {
|
|
1426
|
+
s4 = s5;
|
|
1427
|
+
}
|
|
1428
|
+
if (s4 !== peg$FAILED) {
|
|
1429
|
+
peg$savedPos = s2;
|
|
1430
|
+
s2 = peg$f14(s1, s4);
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
peg$currPos = s2;
|
|
1434
|
+
s2 = peg$FAILED;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
else {
|
|
1438
|
+
peg$currPos = s2;
|
|
1439
|
+
s2 = peg$FAILED;
|
|
1440
|
+
}
|
|
1441
|
+
if (s2 === peg$FAILED) {
|
|
1442
|
+
s2 = null;
|
|
1443
|
+
}
|
|
1444
|
+
peg$savedPos = peg$currPos;
|
|
1445
|
+
s3 = peg$f15(s1, s2);
|
|
1446
|
+
if (s3) {
|
|
1447
|
+
s3 = undefined;
|
|
1448
|
+
}
|
|
1449
|
+
else {
|
|
1450
|
+
s3 = peg$FAILED;
|
|
1451
|
+
}
|
|
1452
|
+
if (s3 !== peg$FAILED) {
|
|
1453
|
+
peg$savedPos = s0;
|
|
1454
|
+
s0 = peg$f16(s1, s2);
|
|
1455
|
+
}
|
|
1456
|
+
else {
|
|
1457
|
+
peg$currPos = s0;
|
|
1458
|
+
s0 = peg$FAILED;
|
|
1459
|
+
}
|
|
1460
|
+
return s0;
|
|
1461
|
+
}
|
|
1462
|
+
function peg$parserestTiming() {
|
|
1463
|
+
let s0, s1, s2, s3, s4, s5, s6;
|
|
1464
|
+
s0 = peg$currPos;
|
|
1465
|
+
s1 = peg$currPos;
|
|
1466
|
+
s2 = peg$currPos;
|
|
1467
|
+
s3 = [];
|
|
1468
|
+
s4 = input.charAt(peg$currPos);
|
|
1469
|
+
if (peg$r4.test(s4)) {
|
|
1470
|
+
peg$currPos++;
|
|
1471
|
+
}
|
|
1472
|
+
else {
|
|
1473
|
+
s4 = peg$FAILED;
|
|
1474
|
+
if (peg$silentFails === 0) {
|
|
1475
|
+
peg$fail(peg$e9);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
while (s4 !== peg$FAILED) {
|
|
1479
|
+
s3.push(s4);
|
|
1480
|
+
if (s3.length >= 3) {
|
|
1481
|
+
s4 = peg$FAILED;
|
|
1482
|
+
}
|
|
1483
|
+
else {
|
|
1484
|
+
s4 = input.charAt(peg$currPos);
|
|
1485
|
+
if (peg$r4.test(s4)) {
|
|
1486
|
+
peg$currPos++;
|
|
1487
|
+
}
|
|
1488
|
+
else {
|
|
1489
|
+
s4 = peg$FAILED;
|
|
1490
|
+
if (peg$silentFails === 0) {
|
|
1491
|
+
peg$fail(peg$e9);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (s3.length < 1) {
|
|
1497
|
+
peg$currPos = s2;
|
|
1498
|
+
s2 = peg$FAILED;
|
|
1499
|
+
}
|
|
1500
|
+
else {
|
|
1501
|
+
s2 = s3;
|
|
1502
|
+
}
|
|
1503
|
+
if (s2 !== peg$FAILED) {
|
|
1504
|
+
s1 = input.substring(s1, peg$currPos);
|
|
1505
|
+
}
|
|
1506
|
+
else {
|
|
1507
|
+
s1 = s2;
|
|
1508
|
+
}
|
|
1509
|
+
if (s1 !== peg$FAILED) {
|
|
1510
|
+
s2 = peg$currPos;
|
|
1511
|
+
if (input.charCodeAt(peg$currPos) === 64) {
|
|
1512
|
+
s3 = peg$c11;
|
|
1513
|
+
peg$currPos++;
|
|
1514
|
+
}
|
|
1515
|
+
else {
|
|
1516
|
+
s3 = peg$FAILED;
|
|
1517
|
+
if (peg$silentFails === 0) {
|
|
1518
|
+
peg$fail(peg$e20);
|
|
1044
1519
|
}
|
|
1045
1520
|
}
|
|
1046
1521
|
if (s3 !== peg$FAILED) {
|
|
1047
1522
|
s4 = peg$currPos;
|
|
1048
1523
|
s5 = [];
|
|
1049
1524
|
s6 = input.charAt(peg$currPos);
|
|
1050
|
-
if (peg$
|
|
1525
|
+
if (peg$r4.test(s6)) {
|
|
1051
1526
|
peg$currPos++;
|
|
1052
1527
|
}
|
|
1053
1528
|
else {
|
|
1054
1529
|
s6 = peg$FAILED;
|
|
1055
1530
|
if (peg$silentFails === 0) {
|
|
1056
|
-
peg$fail(peg$
|
|
1531
|
+
peg$fail(peg$e9);
|
|
1057
1532
|
}
|
|
1058
1533
|
}
|
|
1059
1534
|
if (s6 !== peg$FAILED) {
|
|
1060
1535
|
while (s6 !== peg$FAILED) {
|
|
1061
1536
|
s5.push(s6);
|
|
1062
1537
|
s6 = input.charAt(peg$currPos);
|
|
1063
|
-
if (peg$
|
|
1538
|
+
if (peg$r4.test(s6)) {
|
|
1064
1539
|
peg$currPos++;
|
|
1065
1540
|
}
|
|
1066
1541
|
else {
|
|
1067
1542
|
s6 = peg$FAILED;
|
|
1068
1543
|
if (peg$silentFails === 0) {
|
|
1069
|
-
peg$fail(peg$
|
|
1544
|
+
peg$fail(peg$e9);
|
|
1070
1545
|
}
|
|
1071
1546
|
}
|
|
1072
1547
|
}
|
|
@@ -1082,7 +1557,7 @@ function peg$parse(input, options) {
|
|
|
1082
1557
|
}
|
|
1083
1558
|
if (s4 !== peg$FAILED) {
|
|
1084
1559
|
peg$savedPos = s2;
|
|
1085
|
-
s2 = peg$
|
|
1560
|
+
s2 = peg$f17(s1, s4);
|
|
1086
1561
|
}
|
|
1087
1562
|
else {
|
|
1088
1563
|
peg$currPos = s2;
|
|
@@ -1097,111 +1572,261 @@ function peg$parse(input, options) {
|
|
|
1097
1572
|
s2 = null;
|
|
1098
1573
|
}
|
|
1099
1574
|
peg$savedPos = s0;
|
|
1100
|
-
s0 = peg$
|
|
1575
|
+
s0 = peg$f18(s1, s2);
|
|
1101
1576
|
}
|
|
1102
1577
|
else {
|
|
1103
1578
|
peg$currPos = s0;
|
|
1104
1579
|
s0 = peg$FAILED;
|
|
1105
1580
|
}
|
|
1581
|
+
if (s0 === peg$FAILED) {
|
|
1582
|
+
s0 = peg$currPos;
|
|
1583
|
+
if (input.charCodeAt(peg$currPos) === 64) {
|
|
1584
|
+
s1 = peg$c11;
|
|
1585
|
+
peg$currPos++;
|
|
1586
|
+
}
|
|
1587
|
+
else {
|
|
1588
|
+
s1 = peg$FAILED;
|
|
1589
|
+
if (peg$silentFails === 0) {
|
|
1590
|
+
peg$fail(peg$e20);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
if (s1 !== peg$FAILED) {
|
|
1594
|
+
s2 = peg$currPos;
|
|
1595
|
+
s3 = [];
|
|
1596
|
+
s4 = input.charAt(peg$currPos);
|
|
1597
|
+
if (peg$r4.test(s4)) {
|
|
1598
|
+
peg$currPos++;
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
s4 = peg$FAILED;
|
|
1602
|
+
if (peg$silentFails === 0) {
|
|
1603
|
+
peg$fail(peg$e9);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
if (s4 !== peg$FAILED) {
|
|
1607
|
+
while (s4 !== peg$FAILED) {
|
|
1608
|
+
s3.push(s4);
|
|
1609
|
+
s4 = input.charAt(peg$currPos);
|
|
1610
|
+
if (peg$r4.test(s4)) {
|
|
1611
|
+
peg$currPos++;
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
s4 = peg$FAILED;
|
|
1615
|
+
if (peg$silentFails === 0) {
|
|
1616
|
+
peg$fail(peg$e9);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
else {
|
|
1622
|
+
s3 = peg$FAILED;
|
|
1623
|
+
}
|
|
1624
|
+
if (s3 !== peg$FAILED) {
|
|
1625
|
+
s2 = input.substring(s2, peg$currPos);
|
|
1626
|
+
}
|
|
1627
|
+
else {
|
|
1628
|
+
s2 = s3;
|
|
1629
|
+
}
|
|
1630
|
+
if (s2 !== peg$FAILED) {
|
|
1631
|
+
peg$savedPos = s0;
|
|
1632
|
+
s0 = peg$f19(s2);
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
peg$currPos = s0;
|
|
1636
|
+
s0 = peg$FAILED;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
else {
|
|
1640
|
+
peg$currPos = s0;
|
|
1641
|
+
s0 = peg$FAILED;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1106
1644
|
return s0;
|
|
1107
1645
|
}
|
|
1108
1646
|
function peg$parsehalfTime() {
|
|
1109
|
-
let s0, s1;
|
|
1647
|
+
let s0, s1, s2, s3, s4;
|
|
1110
1648
|
s0 = peg$currPos;
|
|
1111
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
1112
|
-
s1 = peg$
|
|
1649
|
+
if (input.substr(peg$currPos, 2) === peg$c12) {
|
|
1650
|
+
s1 = peg$c12;
|
|
1113
1651
|
peg$currPos += 2;
|
|
1114
1652
|
}
|
|
1115
1653
|
else {
|
|
1116
1654
|
s1 = peg$FAILED;
|
|
1117
1655
|
if (peg$silentFails === 0) {
|
|
1118
|
-
peg$fail(peg$
|
|
1656
|
+
peg$fail(peg$e21);
|
|
1119
1657
|
}
|
|
1120
1658
|
}
|
|
1121
1659
|
if (s1 !== peg$FAILED) {
|
|
1660
|
+
s2 = peg$currPos;
|
|
1661
|
+
s3 = [];
|
|
1662
|
+
s4 = input.charAt(peg$currPos);
|
|
1663
|
+
if (peg$r4.test(s4)) {
|
|
1664
|
+
peg$currPos++;
|
|
1665
|
+
}
|
|
1666
|
+
else {
|
|
1667
|
+
s4 = peg$FAILED;
|
|
1668
|
+
if (peg$silentFails === 0) {
|
|
1669
|
+
peg$fail(peg$e9);
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
while (s4 !== peg$FAILED) {
|
|
1673
|
+
s3.push(s4);
|
|
1674
|
+
s4 = input.charAt(peg$currPos);
|
|
1675
|
+
if (peg$r4.test(s4)) {
|
|
1676
|
+
peg$currPos++;
|
|
1677
|
+
}
|
|
1678
|
+
else {
|
|
1679
|
+
s4 = peg$FAILED;
|
|
1680
|
+
if (peg$silentFails === 0) {
|
|
1681
|
+
peg$fail(peg$e9);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
s2 = input.substring(s2, peg$currPos);
|
|
1122
1686
|
peg$savedPos = s0;
|
|
1123
|
-
|
|
1687
|
+
s0 = peg$f20(s2);
|
|
1688
|
+
}
|
|
1689
|
+
else {
|
|
1690
|
+
peg$currPos = s0;
|
|
1691
|
+
s0 = peg$FAILED;
|
|
1124
1692
|
}
|
|
1125
|
-
s0 = s1;
|
|
1126
1693
|
return s0;
|
|
1127
1694
|
}
|
|
1128
1695
|
function peg$parsedoubleTime() {
|
|
1129
|
-
let s0, s1;
|
|
1696
|
+
let s0, s1, s2, s3, s4;
|
|
1130
1697
|
s0 = peg$currPos;
|
|
1131
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
1132
|
-
s1 = peg$
|
|
1698
|
+
if (input.substr(peg$currPos, 2) === peg$c13) {
|
|
1699
|
+
s1 = peg$c13;
|
|
1133
1700
|
peg$currPos += 2;
|
|
1134
1701
|
}
|
|
1135
1702
|
else {
|
|
1136
1703
|
s1 = peg$FAILED;
|
|
1137
1704
|
if (peg$silentFails === 0) {
|
|
1138
|
-
peg$fail(peg$
|
|
1705
|
+
peg$fail(peg$e22);
|
|
1139
1706
|
}
|
|
1140
1707
|
}
|
|
1141
1708
|
if (s1 !== peg$FAILED) {
|
|
1709
|
+
s2 = peg$currPos;
|
|
1710
|
+
s3 = [];
|
|
1711
|
+
s4 = input.charAt(peg$currPos);
|
|
1712
|
+
if (peg$r4.test(s4)) {
|
|
1713
|
+
peg$currPos++;
|
|
1714
|
+
}
|
|
1715
|
+
else {
|
|
1716
|
+
s4 = peg$FAILED;
|
|
1717
|
+
if (peg$silentFails === 0) {
|
|
1718
|
+
peg$fail(peg$e9);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
while (s4 !== peg$FAILED) {
|
|
1722
|
+
s3.push(s4);
|
|
1723
|
+
s4 = input.charAt(peg$currPos);
|
|
1724
|
+
if (peg$r4.test(s4)) {
|
|
1725
|
+
peg$currPos++;
|
|
1726
|
+
}
|
|
1727
|
+
else {
|
|
1728
|
+
s4 = peg$FAILED;
|
|
1729
|
+
if (peg$silentFails === 0) {
|
|
1730
|
+
peg$fail(peg$e9);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
s2 = input.substring(s2, peg$currPos);
|
|
1142
1735
|
peg$savedPos = s0;
|
|
1143
|
-
|
|
1736
|
+
s0 = peg$f21(s2);
|
|
1737
|
+
}
|
|
1738
|
+
else {
|
|
1739
|
+
peg$currPos = s0;
|
|
1740
|
+
s0 = peg$FAILED;
|
|
1144
1741
|
}
|
|
1145
|
-
s0 = s1;
|
|
1146
1742
|
return s0;
|
|
1147
1743
|
}
|
|
1148
1744
|
function peg$parsetripleTime() {
|
|
1149
|
-
let s0, s1;
|
|
1745
|
+
let s0, s1, s2, s3, s4;
|
|
1150
1746
|
s0 = peg$currPos;
|
|
1151
|
-
if (input.substr(peg$currPos, 2) === peg$
|
|
1152
|
-
s1 = peg$
|
|
1747
|
+
if (input.substr(peg$currPos, 2) === peg$c14) {
|
|
1748
|
+
s1 = peg$c14;
|
|
1153
1749
|
peg$currPos += 2;
|
|
1154
1750
|
}
|
|
1155
1751
|
else {
|
|
1156
1752
|
s1 = peg$FAILED;
|
|
1157
1753
|
if (peg$silentFails === 0) {
|
|
1158
|
-
peg$fail(peg$
|
|
1754
|
+
peg$fail(peg$e23);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
if (s1 !== peg$FAILED) {
|
|
1758
|
+
s2 = peg$currPos;
|
|
1759
|
+
s3 = [];
|
|
1760
|
+
s4 = input.charAt(peg$currPos);
|
|
1761
|
+
if (peg$r4.test(s4)) {
|
|
1762
|
+
peg$currPos++;
|
|
1763
|
+
}
|
|
1764
|
+
else {
|
|
1765
|
+
s4 = peg$FAILED;
|
|
1766
|
+
if (peg$silentFails === 0) {
|
|
1767
|
+
peg$fail(peg$e9);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
while (s4 !== peg$FAILED) {
|
|
1771
|
+
s3.push(s4);
|
|
1772
|
+
s4 = input.charAt(peg$currPos);
|
|
1773
|
+
if (peg$r4.test(s4)) {
|
|
1774
|
+
peg$currPos++;
|
|
1775
|
+
}
|
|
1776
|
+
else {
|
|
1777
|
+
s4 = peg$FAILED;
|
|
1778
|
+
if (peg$silentFails === 0) {
|
|
1779
|
+
peg$fail(peg$e9);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1159
1782
|
}
|
|
1160
|
-
|
|
1161
|
-
if (s1 !== peg$FAILED) {
|
|
1783
|
+
s2 = input.substring(s2, peg$currPos);
|
|
1162
1784
|
peg$savedPos = s0;
|
|
1163
|
-
|
|
1785
|
+
s0 = peg$f22(s2);
|
|
1786
|
+
}
|
|
1787
|
+
else {
|
|
1788
|
+
peg$currPos = s0;
|
|
1789
|
+
s0 = peg$FAILED;
|
|
1164
1790
|
}
|
|
1165
|
-
s0 = s1;
|
|
1166
1791
|
return s0;
|
|
1167
1792
|
}
|
|
1168
1793
|
function peg$parsemeasure() {
|
|
1169
1794
|
let s0, s1, s2, s3, s4;
|
|
1170
1795
|
s0 = peg$currPos;
|
|
1171
1796
|
if (input.charCodeAt(peg$currPos) === 109) {
|
|
1172
|
-
s1 = peg$
|
|
1797
|
+
s1 = peg$c15;
|
|
1173
1798
|
peg$currPos++;
|
|
1174
1799
|
}
|
|
1175
1800
|
else {
|
|
1176
1801
|
s1 = peg$FAILED;
|
|
1177
1802
|
if (peg$silentFails === 0) {
|
|
1178
|
-
peg$fail(peg$
|
|
1803
|
+
peg$fail(peg$e24);
|
|
1179
1804
|
}
|
|
1180
1805
|
}
|
|
1181
1806
|
if (s1 !== peg$FAILED) {
|
|
1182
1807
|
s2 = peg$currPos;
|
|
1183
1808
|
s3 = [];
|
|
1184
1809
|
s4 = input.charAt(peg$currPos);
|
|
1185
|
-
if (peg$
|
|
1810
|
+
if (peg$r4.test(s4)) {
|
|
1186
1811
|
peg$currPos++;
|
|
1187
1812
|
}
|
|
1188
1813
|
else {
|
|
1189
1814
|
s4 = peg$FAILED;
|
|
1190
1815
|
if (peg$silentFails === 0) {
|
|
1191
|
-
peg$fail(peg$
|
|
1816
|
+
peg$fail(peg$e9);
|
|
1192
1817
|
}
|
|
1193
1818
|
}
|
|
1194
1819
|
if (s4 !== peg$FAILED) {
|
|
1195
1820
|
while (s4 !== peg$FAILED) {
|
|
1196
1821
|
s3.push(s4);
|
|
1197
1822
|
s4 = input.charAt(peg$currPos);
|
|
1198
|
-
if (peg$
|
|
1823
|
+
if (peg$r4.test(s4)) {
|
|
1199
1824
|
peg$currPos++;
|
|
1200
1825
|
}
|
|
1201
1826
|
else {
|
|
1202
1827
|
s4 = peg$FAILED;
|
|
1203
1828
|
if (peg$silentFails === 0) {
|
|
1204
|
-
peg$fail(peg$
|
|
1829
|
+
peg$fail(peg$e9);
|
|
1205
1830
|
}
|
|
1206
1831
|
}
|
|
1207
1832
|
}
|
|
@@ -1217,7 +1842,7 @@ function peg$parse(input, options) {
|
|
|
1217
1842
|
}
|
|
1218
1843
|
if (s2 !== peg$FAILED) {
|
|
1219
1844
|
peg$savedPos = s0;
|
|
1220
|
-
s0 = peg$
|
|
1845
|
+
s0 = peg$f23(s2);
|
|
1221
1846
|
}
|
|
1222
1847
|
else {
|
|
1223
1848
|
peg$currPos = s0;
|
|
@@ -1228,37 +1853,55 @@ function peg$parse(input, options) {
|
|
|
1228
1853
|
peg$currPos = s0;
|
|
1229
1854
|
s0 = peg$FAILED;
|
|
1230
1855
|
}
|
|
1856
|
+
if (s0 === peg$FAILED) {
|
|
1857
|
+
s0 = peg$currPos;
|
|
1858
|
+
if (input.charCodeAt(peg$currPos) === 109) {
|
|
1859
|
+
s1 = peg$c15;
|
|
1860
|
+
peg$currPos++;
|
|
1861
|
+
}
|
|
1862
|
+
else {
|
|
1863
|
+
s1 = peg$FAILED;
|
|
1864
|
+
if (peg$silentFails === 0) {
|
|
1865
|
+
peg$fail(peg$e24);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
if (s1 !== peg$FAILED) {
|
|
1869
|
+
peg$savedPos = s0;
|
|
1870
|
+
s1 = peg$f24();
|
|
1871
|
+
}
|
|
1872
|
+
s0 = s1;
|
|
1873
|
+
}
|
|
1231
1874
|
return s0;
|
|
1232
1875
|
}
|
|
1233
1876
|
function peg$parseblock() {
|
|
1234
1877
|
let s0, s1, s2, s3;
|
|
1235
1878
|
s0 = peg$currPos;
|
|
1236
1879
|
if (input.charCodeAt(peg$currPos) === 123) {
|
|
1237
|
-
s1 = peg$
|
|
1880
|
+
s1 = peg$c16;
|
|
1238
1881
|
peg$currPos++;
|
|
1239
1882
|
}
|
|
1240
1883
|
else {
|
|
1241
1884
|
s1 = peg$FAILED;
|
|
1242
1885
|
if (peg$silentFails === 0) {
|
|
1243
|
-
peg$fail(peg$
|
|
1886
|
+
peg$fail(peg$e25);
|
|
1244
1887
|
}
|
|
1245
1888
|
}
|
|
1246
1889
|
if (s1 !== peg$FAILED) {
|
|
1247
1890
|
s2 = peg$parsecommands();
|
|
1248
1891
|
if (s2 !== peg$FAILED) {
|
|
1249
1892
|
if (input.charCodeAt(peg$currPos) === 125) {
|
|
1250
|
-
s3 = peg$
|
|
1893
|
+
s3 = peg$c17;
|
|
1251
1894
|
peg$currPos++;
|
|
1252
1895
|
}
|
|
1253
1896
|
else {
|
|
1254
1897
|
s3 = peg$FAILED;
|
|
1255
1898
|
if (peg$silentFails === 0) {
|
|
1256
|
-
peg$fail(peg$
|
|
1899
|
+
peg$fail(peg$e26);
|
|
1257
1900
|
}
|
|
1258
1901
|
}
|
|
1259
1902
|
if (s3 !== peg$FAILED) {
|
|
1260
1903
|
peg$savedPos = s0;
|
|
1261
|
-
s0 = peg$
|
|
1904
|
+
s0 = peg$f25(s2);
|
|
1262
1905
|
}
|
|
1263
1906
|
else {
|
|
1264
1907
|
peg$currPos = s0;
|
|
@@ -1280,38 +1923,38 @@ function peg$parse(input, options) {
|
|
|
1280
1923
|
let s0, s1, s2, s3;
|
|
1281
1924
|
s0 = peg$currPos;
|
|
1282
1925
|
if (input.charCodeAt(peg$currPos) === 35) {
|
|
1283
|
-
s1 = peg$
|
|
1926
|
+
s1 = peg$c0;
|
|
1284
1927
|
peg$currPos++;
|
|
1285
1928
|
}
|
|
1286
1929
|
else {
|
|
1287
1930
|
s1 = peg$FAILED;
|
|
1288
1931
|
if (peg$silentFails === 0) {
|
|
1289
|
-
peg$fail(peg$
|
|
1932
|
+
peg$fail(peg$e0);
|
|
1290
1933
|
}
|
|
1291
1934
|
}
|
|
1292
1935
|
if (s1 !== peg$FAILED) {
|
|
1293
1936
|
s2 = [];
|
|
1294
1937
|
s3 = input.charAt(peg$currPos);
|
|
1295
|
-
if (peg$
|
|
1938
|
+
if (peg$r3.test(s3)) {
|
|
1296
1939
|
peg$currPos++;
|
|
1297
1940
|
}
|
|
1298
1941
|
else {
|
|
1299
1942
|
s3 = peg$FAILED;
|
|
1300
1943
|
if (peg$silentFails === 0) {
|
|
1301
|
-
peg$fail(peg$
|
|
1944
|
+
peg$fail(peg$e5);
|
|
1302
1945
|
}
|
|
1303
1946
|
}
|
|
1304
1947
|
if (s3 !== peg$FAILED) {
|
|
1305
1948
|
while (s3 !== peg$FAILED) {
|
|
1306
1949
|
s2.push(s3);
|
|
1307
1950
|
s3 = input.charAt(peg$currPos);
|
|
1308
|
-
if (peg$
|
|
1951
|
+
if (peg$r3.test(s3)) {
|
|
1309
1952
|
peg$currPos++;
|
|
1310
1953
|
}
|
|
1311
1954
|
else {
|
|
1312
1955
|
s3 = peg$FAILED;
|
|
1313
1956
|
if (peg$silentFails === 0) {
|
|
1314
|
-
peg$fail(peg$
|
|
1957
|
+
peg$fail(peg$e5);
|
|
1315
1958
|
}
|
|
1316
1959
|
}
|
|
1317
1960
|
}
|
|
@@ -1339,26 +1982,26 @@ function peg$parse(input, options) {
|
|
|
1339
1982
|
s0 = [];
|
|
1340
1983
|
s1 = [];
|
|
1341
1984
|
s2 = input.charAt(peg$currPos);
|
|
1342
|
-
if (peg$
|
|
1985
|
+
if (peg$r9.test(s2)) {
|
|
1343
1986
|
peg$currPos++;
|
|
1344
1987
|
}
|
|
1345
1988
|
else {
|
|
1346
1989
|
s2 = peg$FAILED;
|
|
1347
1990
|
if (peg$silentFails === 0) {
|
|
1348
|
-
peg$fail(peg$
|
|
1991
|
+
peg$fail(peg$e27);
|
|
1349
1992
|
}
|
|
1350
1993
|
}
|
|
1351
1994
|
if (s2 !== peg$FAILED) {
|
|
1352
1995
|
while (s2 !== peg$FAILED) {
|
|
1353
1996
|
s1.push(s2);
|
|
1354
1997
|
s2 = input.charAt(peg$currPos);
|
|
1355
|
-
if (peg$
|
|
1998
|
+
if (peg$r9.test(s2)) {
|
|
1356
1999
|
peg$currPos++;
|
|
1357
2000
|
}
|
|
1358
2001
|
else {
|
|
1359
2002
|
s2 = peg$FAILED;
|
|
1360
2003
|
if (peg$silentFails === 0) {
|
|
1361
|
-
peg$fail(peg$
|
|
2004
|
+
peg$fail(peg$e27);
|
|
1362
2005
|
}
|
|
1363
2006
|
}
|
|
1364
2007
|
}
|
|
@@ -1374,26 +2017,26 @@ function peg$parse(input, options) {
|
|
|
1374
2017
|
s0.push(s1);
|
|
1375
2018
|
s1 = [];
|
|
1376
2019
|
s2 = input.charAt(peg$currPos);
|
|
1377
|
-
if (peg$
|
|
2020
|
+
if (peg$r9.test(s2)) {
|
|
1378
2021
|
peg$currPos++;
|
|
1379
2022
|
}
|
|
1380
2023
|
else {
|
|
1381
2024
|
s2 = peg$FAILED;
|
|
1382
2025
|
if (peg$silentFails === 0) {
|
|
1383
|
-
peg$fail(peg$
|
|
2026
|
+
peg$fail(peg$e27);
|
|
1384
2027
|
}
|
|
1385
2028
|
}
|
|
1386
2029
|
if (s2 !== peg$FAILED) {
|
|
1387
2030
|
while (s2 !== peg$FAILED) {
|
|
1388
2031
|
s1.push(s2);
|
|
1389
2032
|
s2 = input.charAt(peg$currPos);
|
|
1390
|
-
if (peg$
|
|
2033
|
+
if (peg$r9.test(s2)) {
|
|
1391
2034
|
peg$currPos++;
|
|
1392
2035
|
}
|
|
1393
2036
|
else {
|
|
1394
2037
|
s2 = peg$FAILED;
|
|
1395
2038
|
if (peg$silentFails === 0) {
|
|
1396
|
-
peg$fail(peg$
|
|
2039
|
+
peg$fail(peg$e27);
|
|
1397
2040
|
}
|
|
1398
2041
|
}
|
|
1399
2042
|
}
|
|
@@ -1411,6 +2054,322 @@ function peg$parse(input, options) {
|
|
|
1411
2054
|
}
|
|
1412
2055
|
return s0;
|
|
1413
2056
|
}
|
|
2057
|
+
function peg$parsestring() {
|
|
2058
|
+
let s0, s1, s2, s3;
|
|
2059
|
+
s0 = peg$currPos;
|
|
2060
|
+
if (input.charCodeAt(peg$currPos) === 34) {
|
|
2061
|
+
s1 = peg$c18;
|
|
2062
|
+
peg$currPos++;
|
|
2063
|
+
}
|
|
2064
|
+
else {
|
|
2065
|
+
s1 = peg$FAILED;
|
|
2066
|
+
if (peg$silentFails === 0) {
|
|
2067
|
+
peg$fail(peg$e28);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
if (s1 !== peg$FAILED) {
|
|
2071
|
+
s2 = [];
|
|
2072
|
+
s3 = peg$parsedoubleStringChar();
|
|
2073
|
+
while (s3 !== peg$FAILED) {
|
|
2074
|
+
s2.push(s3);
|
|
2075
|
+
s3 = peg$parsedoubleStringChar();
|
|
2076
|
+
}
|
|
2077
|
+
if (input.charCodeAt(peg$currPos) === 34) {
|
|
2078
|
+
s3 = peg$c18;
|
|
2079
|
+
peg$currPos++;
|
|
2080
|
+
}
|
|
2081
|
+
else {
|
|
2082
|
+
s3 = peg$FAILED;
|
|
2083
|
+
if (peg$silentFails === 0) {
|
|
2084
|
+
peg$fail(peg$e28);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
if (s3 !== peg$FAILED) {
|
|
2088
|
+
peg$savedPos = s0;
|
|
2089
|
+
s0 = peg$f26(s2);
|
|
2090
|
+
}
|
|
2091
|
+
else {
|
|
2092
|
+
peg$currPos = s0;
|
|
2093
|
+
s0 = peg$FAILED;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
else {
|
|
2097
|
+
peg$currPos = s0;
|
|
2098
|
+
s0 = peg$FAILED;
|
|
2099
|
+
}
|
|
2100
|
+
if (s0 === peg$FAILED) {
|
|
2101
|
+
s0 = peg$currPos;
|
|
2102
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2103
|
+
s1 = peg$c19;
|
|
2104
|
+
peg$currPos++;
|
|
2105
|
+
}
|
|
2106
|
+
else {
|
|
2107
|
+
s1 = peg$FAILED;
|
|
2108
|
+
if (peg$silentFails === 0) {
|
|
2109
|
+
peg$fail(peg$e29);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
if (s1 !== peg$FAILED) {
|
|
2113
|
+
s2 = [];
|
|
2114
|
+
s3 = peg$parsesingleStringChar();
|
|
2115
|
+
while (s3 !== peg$FAILED) {
|
|
2116
|
+
s2.push(s3);
|
|
2117
|
+
s3 = peg$parsesingleStringChar();
|
|
2118
|
+
}
|
|
2119
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2120
|
+
s3 = peg$c19;
|
|
2121
|
+
peg$currPos++;
|
|
2122
|
+
}
|
|
2123
|
+
else {
|
|
2124
|
+
s3 = peg$FAILED;
|
|
2125
|
+
if (peg$silentFails === 0) {
|
|
2126
|
+
peg$fail(peg$e29);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
if (s3 !== peg$FAILED) {
|
|
2130
|
+
peg$savedPos = s0;
|
|
2131
|
+
s0 = peg$f27(s2);
|
|
2132
|
+
}
|
|
2133
|
+
else {
|
|
2134
|
+
peg$currPos = s0;
|
|
2135
|
+
s0 = peg$FAILED;
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
else {
|
|
2139
|
+
peg$currPos = s0;
|
|
2140
|
+
s0 = peg$FAILED;
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
return s0;
|
|
2144
|
+
}
|
|
2145
|
+
function peg$parsedoubleStringChar() {
|
|
2146
|
+
let s0, s1, s2;
|
|
2147
|
+
s0 = peg$currPos;
|
|
2148
|
+
s1 = peg$currPos;
|
|
2149
|
+
peg$silentFails++;
|
|
2150
|
+
s2 = input.charAt(peg$currPos);
|
|
2151
|
+
if (peg$r10.test(s2)) {
|
|
2152
|
+
peg$currPos++;
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
s2 = peg$FAILED;
|
|
2156
|
+
if (peg$silentFails === 0) {
|
|
2157
|
+
peg$fail(peg$e30);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
peg$silentFails--;
|
|
2161
|
+
if (s2 === peg$FAILED) {
|
|
2162
|
+
s1 = undefined;
|
|
2163
|
+
}
|
|
2164
|
+
else {
|
|
2165
|
+
peg$currPos = s1;
|
|
2166
|
+
s1 = peg$FAILED;
|
|
2167
|
+
}
|
|
2168
|
+
if (s1 !== peg$FAILED) {
|
|
2169
|
+
if (input.length > peg$currPos) {
|
|
2170
|
+
s2 = input.charAt(peg$currPos);
|
|
2171
|
+
peg$currPos++;
|
|
2172
|
+
}
|
|
2173
|
+
else {
|
|
2174
|
+
s2 = peg$FAILED;
|
|
2175
|
+
if (peg$silentFails === 0) {
|
|
2176
|
+
peg$fail(peg$e31);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
if (s2 !== peg$FAILED) {
|
|
2180
|
+
peg$savedPos = s0;
|
|
2181
|
+
s0 = peg$f28(s2);
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
peg$currPos = s0;
|
|
2185
|
+
s0 = peg$FAILED;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
else {
|
|
2189
|
+
peg$currPos = s0;
|
|
2190
|
+
s0 = peg$FAILED;
|
|
2191
|
+
}
|
|
2192
|
+
if (s0 === peg$FAILED) {
|
|
2193
|
+
s0 = peg$currPos;
|
|
2194
|
+
if (input.charCodeAt(peg$currPos) === 92) {
|
|
2195
|
+
s1 = peg$c20;
|
|
2196
|
+
peg$currPos++;
|
|
2197
|
+
}
|
|
2198
|
+
else {
|
|
2199
|
+
s1 = peg$FAILED;
|
|
2200
|
+
if (peg$silentFails === 0) {
|
|
2201
|
+
peg$fail(peg$e32);
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
if (s1 !== peg$FAILED) {
|
|
2205
|
+
s2 = peg$parseescapeChar();
|
|
2206
|
+
if (s2 !== peg$FAILED) {
|
|
2207
|
+
peg$savedPos = s0;
|
|
2208
|
+
s0 = peg$f29(s2);
|
|
2209
|
+
}
|
|
2210
|
+
else {
|
|
2211
|
+
peg$currPos = s0;
|
|
2212
|
+
s0 = peg$FAILED;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
else {
|
|
2216
|
+
peg$currPos = s0;
|
|
2217
|
+
s0 = peg$FAILED;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
return s0;
|
|
2221
|
+
}
|
|
2222
|
+
function peg$parsesingleStringChar() {
|
|
2223
|
+
let s0, s1, s2;
|
|
2224
|
+
s0 = peg$currPos;
|
|
2225
|
+
s1 = peg$currPos;
|
|
2226
|
+
peg$silentFails++;
|
|
2227
|
+
s2 = input.charAt(peg$currPos);
|
|
2228
|
+
if (peg$r11.test(s2)) {
|
|
2229
|
+
peg$currPos++;
|
|
2230
|
+
}
|
|
2231
|
+
else {
|
|
2232
|
+
s2 = peg$FAILED;
|
|
2233
|
+
if (peg$silentFails === 0) {
|
|
2234
|
+
peg$fail(peg$e33);
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
peg$silentFails--;
|
|
2238
|
+
if (s2 === peg$FAILED) {
|
|
2239
|
+
s1 = undefined;
|
|
2240
|
+
}
|
|
2241
|
+
else {
|
|
2242
|
+
peg$currPos = s1;
|
|
2243
|
+
s1 = peg$FAILED;
|
|
2244
|
+
}
|
|
2245
|
+
if (s1 !== peg$FAILED) {
|
|
2246
|
+
if (input.length > peg$currPos) {
|
|
2247
|
+
s2 = input.charAt(peg$currPos);
|
|
2248
|
+
peg$currPos++;
|
|
2249
|
+
}
|
|
2250
|
+
else {
|
|
2251
|
+
s2 = peg$FAILED;
|
|
2252
|
+
if (peg$silentFails === 0) {
|
|
2253
|
+
peg$fail(peg$e31);
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
if (s2 !== peg$FAILED) {
|
|
2257
|
+
peg$savedPos = s0;
|
|
2258
|
+
s0 = peg$f30(s2);
|
|
2259
|
+
}
|
|
2260
|
+
else {
|
|
2261
|
+
peg$currPos = s0;
|
|
2262
|
+
s0 = peg$FAILED;
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
else {
|
|
2266
|
+
peg$currPos = s0;
|
|
2267
|
+
s0 = peg$FAILED;
|
|
2268
|
+
}
|
|
2269
|
+
if (s0 === peg$FAILED) {
|
|
2270
|
+
s0 = peg$currPos;
|
|
2271
|
+
if (input.charCodeAt(peg$currPos) === 92) {
|
|
2272
|
+
s1 = peg$c20;
|
|
2273
|
+
peg$currPos++;
|
|
2274
|
+
}
|
|
2275
|
+
else {
|
|
2276
|
+
s1 = peg$FAILED;
|
|
2277
|
+
if (peg$silentFails === 0) {
|
|
2278
|
+
peg$fail(peg$e32);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
if (s1 !== peg$FAILED) {
|
|
2282
|
+
s2 = peg$parseescapeChar();
|
|
2283
|
+
if (s2 !== peg$FAILED) {
|
|
2284
|
+
peg$savedPos = s0;
|
|
2285
|
+
s0 = peg$f31(s2);
|
|
2286
|
+
}
|
|
2287
|
+
else {
|
|
2288
|
+
peg$currPos = s0;
|
|
2289
|
+
s0 = peg$FAILED;
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
else {
|
|
2293
|
+
peg$currPos = s0;
|
|
2294
|
+
s0 = peg$FAILED;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
return s0;
|
|
2298
|
+
}
|
|
2299
|
+
function peg$parseescapeChar() {
|
|
2300
|
+
let s0, s1;
|
|
2301
|
+
s0 = peg$currPos;
|
|
2302
|
+
if (input.charCodeAt(peg$currPos) === 34) {
|
|
2303
|
+
s1 = peg$c18;
|
|
2304
|
+
peg$currPos++;
|
|
2305
|
+
}
|
|
2306
|
+
else {
|
|
2307
|
+
s1 = peg$FAILED;
|
|
2308
|
+
if (peg$silentFails === 0) {
|
|
2309
|
+
peg$fail(peg$e28);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
if (s1 !== peg$FAILED) {
|
|
2313
|
+
peg$savedPos = s0;
|
|
2314
|
+
s1 = peg$f32();
|
|
2315
|
+
}
|
|
2316
|
+
s0 = s1;
|
|
2317
|
+
if (s0 === peg$FAILED) {
|
|
2318
|
+
s0 = peg$currPos;
|
|
2319
|
+
if (input.charCodeAt(peg$currPos) === 39) {
|
|
2320
|
+
s1 = peg$c19;
|
|
2321
|
+
peg$currPos++;
|
|
2322
|
+
}
|
|
2323
|
+
else {
|
|
2324
|
+
s1 = peg$FAILED;
|
|
2325
|
+
if (peg$silentFails === 0) {
|
|
2326
|
+
peg$fail(peg$e29);
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
if (s1 !== peg$FAILED) {
|
|
2330
|
+
peg$savedPos = s0;
|
|
2331
|
+
s1 = peg$f33();
|
|
2332
|
+
}
|
|
2333
|
+
s0 = s1;
|
|
2334
|
+
if (s0 === peg$FAILED) {
|
|
2335
|
+
s0 = peg$currPos;
|
|
2336
|
+
if (input.charCodeAt(peg$currPos) === 92) {
|
|
2337
|
+
s1 = peg$c20;
|
|
2338
|
+
peg$currPos++;
|
|
2339
|
+
}
|
|
2340
|
+
else {
|
|
2341
|
+
s1 = peg$FAILED;
|
|
2342
|
+
if (peg$silentFails === 0) {
|
|
2343
|
+
peg$fail(peg$e32);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
if (s1 !== peg$FAILED) {
|
|
2347
|
+
peg$savedPos = s0;
|
|
2348
|
+
s1 = peg$f34();
|
|
2349
|
+
}
|
|
2350
|
+
s0 = s1;
|
|
2351
|
+
if (s0 === peg$FAILED) {
|
|
2352
|
+
s0 = peg$currPos;
|
|
2353
|
+
if (input.charCodeAt(peg$currPos) === 110) {
|
|
2354
|
+
s1 = peg$c21;
|
|
2355
|
+
peg$currPos++;
|
|
2356
|
+
}
|
|
2357
|
+
else {
|
|
2358
|
+
s1 = peg$FAILED;
|
|
2359
|
+
if (peg$silentFails === 0) {
|
|
2360
|
+
peg$fail(peg$e34);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
if (s1 !== peg$FAILED) {
|
|
2364
|
+
peg$savedPos = s0;
|
|
2365
|
+
s1 = peg$f35();
|
|
2366
|
+
}
|
|
2367
|
+
s0 = s1;
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return s0;
|
|
2372
|
+
}
|
|
1414
2373
|
peg$result = peg$startRuleFunction();
|
|
1415
2374
|
const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
|
|
1416
2375
|
function peg$throw() {
|
|
@@ -1440,7 +2399,8 @@ function peg$parse(input, options) {
|
|
|
1440
2399
|
}
|
|
1441
2400
|
}
|
|
1442
2401
|
const peg$allowedStartRules = [
|
|
1443
|
-
"start"
|
|
2402
|
+
"start",
|
|
2403
|
+
"note"
|
|
1444
2404
|
];
|
|
1445
2405
|
export { peg$allowedStartRules as StartRules, peg$SyntaxError as SyntaxError, peg$parse as parse };
|
|
1446
2406
|
//# sourceMappingURL=grammar.js.map
|