chordsheetjs 7.5.0 → 7.7.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/lib/index.js CHANGED
@@ -41,7 +41,7 @@ $parcel$export(module.exports, "NONE", () => $af8d31735c159a26$export$c53d0f541b
41
41
  $parcel$export(module.exports, "TAB", () => $af8d31735c159a26$export$f1c9dd0f5207dd5e);
42
42
  $parcel$export(module.exports, "SYMBOL", () => $af8d31735c159a26$export$27c95a7104c1f7aa);
43
43
  $parcel$export(module.exports, "NUMERIC", () => $af8d31735c159a26$export$4d318981b5a83836);
44
- // Generated by peggy v. 1.2.0 (ts-pegjs plugin v. 1.2.2 )
44
+ // Generated by peggy v. 2.0.1 (ts-pegjs plugin v. 2.1.0 )
45
45
  //
46
46
  // https://peggyjs.org/ https://github.com/metadevpro/ts-pegjs
47
47
  "use strict";
@@ -177,93 +177,100 @@ function $1a506a341538d943$var$peg$parse(input, options) {
177
177
  comment ? {
178
178
  type: "comment",
179
179
  comment: comment
180
- } : null
180
+ } : null,
181
181
  ].filter((x)=>x)
182
182
  };
183
183
  };
184
- const peg$c3 = "#";
185
- const peg$c4 = peg$literalExpectation("#", false);
186
- const peg$c5 = /^[^\r\n]/;
187
- const peg$c6 = peg$classExpectation([
184
+ const peg$c3 = function(lyrics) {
185
+ return {
186
+ type: "chordLyricsPair",
187
+ chords: "",
188
+ lyrics: lyrics
189
+ };
190
+ };
191
+ const peg$c4 = "#";
192
+ const peg$c5 = peg$literalExpectation("#", false);
193
+ const peg$c6 = /^[^\r\n]/;
194
+ const peg$c7 = peg$classExpectation([
188
195
  "\r",
189
196
  "\n"
190
197
  ], true, false);
191
- const peg$c7 = function(comment) {
198
+ const peg$c8 = function(comment) {
192
199
  return comment;
193
200
  };
194
- const peg$c8 = function(chords, lyrics) {
201
+ const peg$c9 = function(chords, lyrics, space) {
195
202
  return {
196
203
  type: "chordLyricsPair",
197
204
  chords: chords || "",
198
- lyrics: lyrics
205
+ lyrics: lyrics + (space || "")
199
206
  };
200
207
  };
201
- const peg$c9 = function(lyrics) {
208
+ const peg$c10 = function(lyrics) {
202
209
  return lyrics.map((c)=>c.char || c).join("");
203
210
  };
204
- const peg$c10 = "[";
205
- const peg$c11 = peg$literalExpectation("[", false);
206
- const peg$c12 = "]";
207
- const peg$c13 = peg$literalExpectation("]", false);
208
- const peg$c14 = function(chords) {
211
+ const peg$c11 = "[";
212
+ const peg$c12 = peg$literalExpectation("[", false);
213
+ const peg$c13 = "]";
214
+ const peg$c14 = peg$literalExpectation("]", false);
215
+ const peg$c15 = function(chords) {
209
216
  return chords.map((c)=>c.char || c).join("");
210
217
  };
211
- const peg$c15 = /^[^\]\r\n]/;
212
- const peg$c16 = peg$classExpectation([
218
+ const peg$c16 = /^[^\]\r\n]/;
219
+ const peg$c17 = peg$classExpectation([
213
220
  "]",
214
221
  "\r",
215
222
  "\n"
216
223
  ], true, false);
217
- const peg$c17 = "\\";
218
- const peg$c18 = peg$literalExpectation("\\", false);
219
- const peg$c19 = function() {
224
+ const peg$c18 = "\\";
225
+ const peg$c19 = peg$literalExpectation("\\", false);
226
+ const peg$c20 = function() {
220
227
  return {
221
228
  type: "char",
222
229
  char: "\\"
223
230
  };
224
231
  };
225
- const peg$c20 = function() {
232
+ const peg$c21 = function() {
226
233
  return {
227
234
  type: "char",
228
235
  char: "]"
229
236
  };
230
237
  };
231
- const peg$c21 = function(sequence) {
238
+ const peg$c22 = function(sequence) {
232
239
  return sequence;
233
240
  };
234
- const peg$c22 = "%{";
235
- const peg$c23 = peg$literalExpectation("%{", false);
236
- const peg$c24 = "}";
237
- const peg$c25 = peg$literalExpectation("}", false);
238
- const peg$c26 = function(variableName, valueTest, expressions) {
241
+ const peg$c23 = "%{";
242
+ const peg$c24 = peg$literalExpectation("%{", false);
243
+ const peg$c25 = "}";
244
+ const peg$c26 = peg$literalExpectation("}", false);
245
+ const peg$c27 = function(variableName, valueTest, expressions) {
239
246
  return {
240
- "type": "ternary",
247
+ type: "ternary",
241
248
  variable: variableName.length > 0 ? variableName : null,
242
249
  valueTest: valueTest,
243
250
  ...expressions,
244
251
  location: location().start
245
252
  };
246
253
  };
247
- const peg$c27 = "=";
248
- const peg$c28 = peg$literalExpectation("=", false);
249
- const peg$c29 = function(testValue) {
254
+ const peg$c28 = "=";
255
+ const peg$c29 = peg$literalExpectation("=", false);
256
+ const peg$c30 = function(testValue) {
250
257
  return testValue;
251
258
  };
252
- const peg$c30 = "|";
253
- const peg$c31 = peg$literalExpectation("|", false);
254
- const peg$c32 = function(trueExpression, falseExpression) {
259
+ const peg$c31 = "|";
260
+ const peg$c32 = peg$literalExpectation("|", false);
261
+ const peg$c33 = function(trueExpression, falseExpression) {
255
262
  return {
256
- "type": "ternary",
263
+ type: "ternary",
257
264
  trueExpression: trueExpression,
258
265
  falseExpression: falseExpression,
259
266
  location: location().start
260
267
  };
261
268
  };
262
- const peg$c33 = function(falseExpression) {
269
+ const peg$c34 = function(falseExpression) {
263
270
  return falseExpression;
264
271
  };
265
- const peg$c34 = /^[a-zA-Z0-9\-_]/;
266
- const peg$c35 = peg$classExpectation([
272
+ const peg$c35 = /^[a-zA-Z0-9\-_]/;
273
+ const peg$c36 = peg$classExpectation([
267
274
  [
268
275
  "a",
269
276
  "z"
@@ -279,20 +286,26 @@ function $1a506a341538d943$var$peg$parse(input, options) {
279
286
  "-",
280
287
  "_"
281
288
  ], false, false);
282
- const peg$c36 = function() {
289
+ const peg$c37 = function() {
290
+ return {
291
+ type: "char",
292
+ char: "]"
293
+ };
294
+ };
295
+ const peg$c38 = function() {
283
296
  return {
284
297
  type: "char",
285
298
  char: "|"
286
299
  };
287
300
  };
288
- const peg$c37 = function() {
301
+ const peg$c39 = function() {
289
302
  return {
290
303
  type: "char",
291
304
  char: "}"
292
305
  };
293
306
  };
294
- const peg$c38 = /^[^|[\]\\{}%#\r\n]/;
295
- const peg$c39 = peg$classExpectation([
307
+ const peg$c40 = /^[^|[\]\\{}%#\r\n\t ]/;
308
+ const peg$c41 = peg$classExpectation([
296
309
  "|",
297
310
  "[",
298
311
  "]",
@@ -302,37 +315,45 @@ function $1a506a341538d943$var$peg$parse(input, options) {
302
315
  "%",
303
316
  "#",
304
317
  "\r",
305
- "\n"
318
+ "\n",
319
+ " ",
320
+ " "
306
321
  ], true, false);
307
- const peg$c40 = function() {
322
+ const peg$c42 = function() {
308
323
  return {
309
324
  type: "char",
310
- char: "["
325
+ char: "\\"
311
326
  };
312
327
  };
313
- const peg$c41 = "{";
314
- const peg$c42 = peg$literalExpectation("{", false);
315
328
  const peg$c43 = function() {
316
329
  return {
317
330
  type: "char",
318
- char: "{"
331
+ char: "["
319
332
  };
320
333
  };
321
- const peg$c44 = "%";
322
- const peg$c45 = peg$literalExpectation("%", false);
334
+ const peg$c44 = "{";
335
+ const peg$c45 = peg$literalExpectation("{", false);
323
336
  const peg$c46 = function() {
337
+ return {
338
+ type: "char",
339
+ char: "{"
340
+ };
341
+ };
342
+ const peg$c47 = "%";
343
+ const peg$c48 = peg$literalExpectation("%", false);
344
+ const peg$c49 = function() {
324
345
  return {
325
346
  type: "char",
326
347
  char: "%"
327
348
  };
328
349
  };
329
- const peg$c47 = function() {
350
+ const peg$c50 = function() {
330
351
  return {
331
352
  type: "char",
332
353
  char: "#"
333
354
  };
334
355
  };
335
- const peg$c48 = function(tagName, tagColonWithValue) {
356
+ const peg$c51 = function(tagName, tagColonWithValue) {
336
357
  return {
337
358
  type: "tag",
338
359
  name: tagName,
@@ -340,13 +361,13 @@ function $1a506a341538d943$var$peg$parse(input, options) {
340
361
  location: location().start
341
362
  };
342
363
  };
343
- const peg$c49 = ":";
344
- const peg$c50 = peg$literalExpectation(":", false);
345
- const peg$c51 = function(tagValue) {
364
+ const peg$c52 = ":";
365
+ const peg$c53 = peg$literalExpectation(":", false);
366
+ const peg$c54 = function(tagValue) {
346
367
  return tagValue.map((c)=>c.char || c).join("");
347
368
  };
348
- const peg$c52 = /^[a-zA-Z\-_]/;
349
- const peg$c53 = peg$classExpectation([
369
+ const peg$c55 = /^[a-zA-Z\-_]/;
370
+ const peg$c56 = peg$classExpectation([
350
371
  [
351
372
  "a",
352
373
  "z"
@@ -358,31 +379,31 @@ function $1a506a341538d943$var$peg$parse(input, options) {
358
379
  "-",
359
380
  "_"
360
381
  ], false, false);
361
- const peg$c54 = /^[^}\\\r\n]/;
362
- const peg$c55 = peg$classExpectation([
382
+ const peg$c57 = /^[^}\\\r\n]/;
383
+ const peg$c58 = peg$classExpectation([
363
384
  "}",
364
385
  "\\",
365
386
  "\r",
366
387
  "\n"
367
388
  ], true, false);
368
- const peg$c56 = peg$otherExpectation("whitespace");
369
- const peg$c57 = /^[ \t\n\r]/;
370
- const peg$c58 = peg$classExpectation([
389
+ const peg$c59 = peg$otherExpectation("whitespace");
390
+ const peg$c60 = /^[ \t\n\r]/;
391
+ const peg$c61 = peg$classExpectation([
371
392
  " ",
372
393
  " ",
373
394
  "\n",
374
395
  "\r"
375
396
  ], false, false);
376
- const peg$c59 = peg$otherExpectation("space");
377
- const peg$c60 = /^[ \t]/;
378
- const peg$c61 = peg$classExpectation([
397
+ const peg$c62 = peg$otherExpectation("space");
398
+ const peg$c63 = /^[ \t]/;
399
+ const peg$c64 = peg$classExpectation([
379
400
  " ",
380
401
  " "
381
402
  ], false, false);
382
- const peg$c62 = "\n";
383
- const peg$c63 = peg$literalExpectation("\n", false);
384
- const peg$c64 = "\r";
385
- const peg$c65 = peg$literalExpectation("\r", false);
403
+ const peg$c65 = "\n";
404
+ const peg$c66 = peg$literalExpectation("\n", false);
405
+ const peg$c67 = "\r";
406
+ const peg$c68 = peg$literalExpectation("\r", false);
386
407
  let peg$currPos = 0;
387
408
  let peg$savedPos = 0;
388
409
  const peg$posDetailsCache = [
@@ -549,8 +570,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
549
570
  function peg$parseLine() {
550
571
  let s0, s1, s2, s3, s4, s5, s6;
551
572
  s0 = peg$currPos;
552
- s1 = peg$parseLyrics();
553
- if (s1 === peg$FAILED) s1 = null;
573
+ s1 = peg$currPos;
574
+ s2 = peg$parseLyrics();
575
+ if (s2 === peg$FAILED) s2 = null;
576
+ if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
577
+ else s1 = s2;
554
578
  if (s1 !== peg$FAILED) {
555
579
  s2 = [];
556
580
  s3 = peg$parseToken();
@@ -598,11 +622,22 @@ function $1a506a341538d943$var$peg$parse(input, options) {
598
622
  return s0;
599
623
  }
600
624
  function peg$parseToken() {
601
- let s0;
625
+ let s0, s1;
602
626
  s0 = peg$parseTag();
603
627
  if (s0 === peg$FAILED) {
604
628
  s0 = peg$parseChordLyricsPair();
605
- if (s0 === peg$FAILED) s0 = peg$parseMetaTernary();
629
+ if (s0 === peg$FAILED) {
630
+ s0 = peg$parseMetaTernary();
631
+ if (s0 === peg$FAILED) {
632
+ s0 = peg$currPos;
633
+ s1 = peg$parseLyrics();
634
+ if (s1 !== peg$FAILED) {
635
+ peg$savedPos = s0;
636
+ s1 = peg$c3(s1);
637
+ }
638
+ s0 = s1;
639
+ }
640
+ }
606
641
  }
607
642
  return s0;
608
643
  }
@@ -613,37 +648,37 @@ function $1a506a341538d943$var$peg$parse(input, options) {
613
648
  if (s1 === peg$FAILED) s1 = null;
614
649
  if (s1 !== peg$FAILED) {
615
650
  if (input.charCodeAt(peg$currPos) === 35) {
616
- s2 = peg$c3;
651
+ s2 = peg$c4;
617
652
  peg$currPos++;
618
653
  } else {
619
654
  s2 = peg$FAILED;
620
- if (peg$silentFails === 0) peg$fail(peg$c4);
655
+ if (peg$silentFails === 0) peg$fail(peg$c5);
621
656
  }
622
657
  if (s2 !== peg$FAILED) {
623
658
  s3 = peg$currPos;
624
659
  s4 = [];
625
- if (peg$c5.test(input.charAt(peg$currPos))) {
660
+ if (peg$c6.test(input.charAt(peg$currPos))) {
626
661
  s5 = input.charAt(peg$currPos);
627
662
  peg$currPos++;
628
663
  } else {
629
664
  s5 = peg$FAILED;
630
- if (peg$silentFails === 0) peg$fail(peg$c6);
665
+ if (peg$silentFails === 0) peg$fail(peg$c7);
631
666
  }
632
667
  while(s5 !== peg$FAILED){
633
668
  s4.push(s5);
634
- if (peg$c5.test(input.charAt(peg$currPos))) {
669
+ if (peg$c6.test(input.charAt(peg$currPos))) {
635
670
  s5 = input.charAt(peg$currPos);
636
671
  peg$currPos++;
637
672
  } else {
638
673
  s5 = peg$FAILED;
639
- if (peg$silentFails === 0) peg$fail(peg$c6);
674
+ if (peg$silentFails === 0) peg$fail(peg$c7);
640
675
  }
641
676
  }
642
677
  if (s4 !== peg$FAILED) s3 = input.substring(s3, peg$currPos);
643
678
  else s3 = s4;
644
679
  if (s3 !== peg$FAILED) {
645
680
  peg$savedPos = s0;
646
- s1 = peg$c7(s3);
681
+ s1 = peg$c8(s3);
647
682
  s0 = s1;
648
683
  } else {
649
684
  peg$currPos = s0;
@@ -660,23 +695,37 @@ function $1a506a341538d943$var$peg$parse(input, options) {
660
695
  return s0;
661
696
  }
662
697
  function peg$parseChordLyricsPair() {
663
- let s0, s1, s2, s3, s4;
698
+ let s0, s1, s2, s3, s4, s5;
664
699
  s0 = peg$currPos;
665
700
  s1 = peg$parseChord();
666
701
  if (s1 !== peg$FAILED) {
667
702
  s2 = peg$currPos;
668
703
  s3 = [];
669
- s4 = peg$parseLyrics();
704
+ s4 = peg$parseLyricsChar();
670
705
  while(s4 !== peg$FAILED){
671
706
  s3.push(s4);
672
- s4 = peg$parseLyrics();
707
+ s4 = peg$parseLyricsChar();
673
708
  }
674
709
  if (s3 !== peg$FAILED) s2 = input.substring(s2, peg$currPos);
675
710
  else s2 = s3;
676
711
  if (s2 !== peg$FAILED) {
677
- peg$savedPos = s0;
678
- s1 = peg$c8(s1, s2);
679
- s0 = s1;
712
+ s3 = peg$currPos;
713
+ s4 = [];
714
+ s5 = peg$parseSpace();
715
+ while(s5 !== peg$FAILED){
716
+ s4.push(s5);
717
+ s5 = peg$parseSpace();
718
+ }
719
+ if (s4 !== peg$FAILED) s3 = input.substring(s3, peg$currPos);
720
+ else s3 = s4;
721
+ if (s3 !== peg$FAILED) {
722
+ peg$savedPos = s0;
723
+ s1 = peg$c9(s1, s2, s3);
724
+ s0 = s1;
725
+ } else {
726
+ peg$currPos = s0;
727
+ s0 = peg$FAILED;
728
+ }
680
729
  } else {
681
730
  peg$currPos = s0;
682
731
  s0 = peg$FAILED;
@@ -691,19 +740,25 @@ function $1a506a341538d943$var$peg$parse(input, options) {
691
740
  let s0, s1, s2;
692
741
  s0 = peg$currPos;
693
742
  s1 = [];
694
- s2 = peg$parseLyricsChar();
743
+ s2 = peg$parseLyricsCharOrSpace();
695
744
  if (s2 !== peg$FAILED) while(s2 !== peg$FAILED){
696
745
  s1.push(s2);
697
- s2 = peg$parseLyricsChar();
746
+ s2 = peg$parseLyricsCharOrSpace();
698
747
  }
699
748
  else s1 = peg$FAILED;
700
749
  if (s1 !== peg$FAILED) {
701
750
  peg$savedPos = s0;
702
- s1 = peg$c9(s1);
751
+ s1 = peg$c10(s1);
703
752
  }
704
753
  s0 = s1;
705
754
  return s0;
706
755
  }
756
+ function peg$parseLyricsCharOrSpace() {
757
+ let s0;
758
+ s0 = peg$parseLyricsChar();
759
+ if (s0 === peg$FAILED) s0 = peg$parseSpace();
760
+ return s0;
761
+ }
707
762
  function peg$parseChord() {
708
763
  let s0, s1, s2, s3, s4;
709
764
  s0 = peg$currPos;
@@ -718,11 +773,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
718
773
  }
719
774
  if (s1 !== peg$FAILED) {
720
775
  if (input.charCodeAt(peg$currPos) === 91) {
721
- s2 = peg$c10;
776
+ s2 = peg$c11;
722
777
  peg$currPos++;
723
778
  } else {
724
779
  s2 = peg$FAILED;
725
- if (peg$silentFails === 0) peg$fail(peg$c11);
780
+ if (peg$silentFails === 0) peg$fail(peg$c12);
726
781
  }
727
782
  if (s2 !== peg$FAILED) {
728
783
  s3 = [];
@@ -733,15 +788,15 @@ function $1a506a341538d943$var$peg$parse(input, options) {
733
788
  }
734
789
  if (s3 !== peg$FAILED) {
735
790
  if (input.charCodeAt(peg$currPos) === 93) {
736
- s4 = peg$c12;
791
+ s4 = peg$c13;
737
792
  peg$currPos++;
738
793
  } else {
739
794
  s4 = peg$FAILED;
740
- if (peg$silentFails === 0) peg$fail(peg$c13);
795
+ if (peg$silentFails === 0) peg$fail(peg$c14);
741
796
  }
742
797
  if (s4 !== peg$FAILED) {
743
798
  peg$savedPos = s0;
744
- s1 = peg$c14(s3);
799
+ s1 = peg$c15(s3);
745
800
  s0 = s1;
746
801
  } else {
747
802
  peg$currPos = s0;
@@ -763,12 +818,12 @@ function $1a506a341538d943$var$peg$parse(input, options) {
763
818
  }
764
819
  function peg$parseChordChar() {
765
820
  let s0, s1, s2, s3;
766
- if (peg$c15.test(input.charAt(peg$currPos))) {
821
+ if (peg$c16.test(input.charAt(peg$currPos))) {
767
822
  s0 = input.charAt(peg$currPos);
768
823
  peg$currPos++;
769
824
  } else {
770
825
  s0 = peg$FAILED;
771
- if (peg$silentFails === 0) peg$fail(peg$c16);
826
+ if (peg$silentFails === 0) peg$fail(peg$c17);
772
827
  }
773
828
  if (s0 === peg$FAILED) {
774
829
  s0 = peg$currPos;
@@ -776,35 +831,35 @@ function $1a506a341538d943$var$peg$parse(input, options) {
776
831
  if (s1 !== peg$FAILED) {
777
832
  s2 = peg$currPos;
778
833
  if (input.charCodeAt(peg$currPos) === 92) {
779
- s3 = peg$c17;
834
+ s3 = peg$c18;
780
835
  peg$currPos++;
781
836
  } else {
782
837
  s3 = peg$FAILED;
783
- if (peg$silentFails === 0) peg$fail(peg$c18);
838
+ if (peg$silentFails === 0) peg$fail(peg$c19);
784
839
  }
785
840
  if (s3 !== peg$FAILED) {
786
841
  peg$savedPos = s2;
787
- s3 = peg$c19();
842
+ s3 = peg$c20();
788
843
  }
789
844
  s2 = s3;
790
845
  if (s2 === peg$FAILED) {
791
846
  s2 = peg$currPos;
792
847
  if (input.charCodeAt(peg$currPos) === 93) {
793
- s3 = peg$c12;
848
+ s3 = peg$c13;
794
849
  peg$currPos++;
795
850
  } else {
796
851
  s3 = peg$FAILED;
797
- if (peg$silentFails === 0) peg$fail(peg$c13);
852
+ if (peg$silentFails === 0) peg$fail(peg$c14);
798
853
  }
799
854
  if (s3 !== peg$FAILED) {
800
855
  peg$savedPos = s2;
801
- s3 = peg$c20();
856
+ s3 = peg$c21();
802
857
  }
803
858
  s2 = s3;
804
859
  }
805
860
  if (s2 !== peg$FAILED) {
806
861
  peg$savedPos = s0;
807
- s1 = peg$c21(s2);
862
+ s1 = peg$c22(s2);
808
863
  s0 = s1;
809
864
  } else {
810
865
  peg$currPos = s0;
@@ -820,12 +875,12 @@ function $1a506a341538d943$var$peg$parse(input, options) {
820
875
  function peg$parseMetaTernary() {
821
876
  let s0, s1, s2, s3, s4, s5, s6, s7, s8;
822
877
  s0 = peg$currPos;
823
- if (input.substr(peg$currPos, 2) === peg$c22) {
824
- s1 = peg$c22;
878
+ if (input.substr(peg$currPos, 2) === peg$c23) {
879
+ s1 = peg$c23;
825
880
  peg$currPos += 2;
826
881
  } else {
827
882
  s1 = peg$FAILED;
828
- if (peg$silentFails === 0) peg$fail(peg$c23);
883
+ if (peg$silentFails === 0) peg$fail(peg$c24);
829
884
  }
830
885
  if (s1 !== peg$FAILED) {
831
886
  s2 = peg$parse_();
@@ -847,15 +902,15 @@ function $1a506a341538d943$var$peg$parse(input, options) {
847
902
  s7 = peg$parse_();
848
903
  if (s7 !== peg$FAILED) {
849
904
  if (input.charCodeAt(peg$currPos) === 125) {
850
- s8 = peg$c24;
905
+ s8 = peg$c25;
851
906
  peg$currPos++;
852
907
  } else {
853
908
  s8 = peg$FAILED;
854
- if (peg$silentFails === 0) peg$fail(peg$c25);
909
+ if (peg$silentFails === 0) peg$fail(peg$c26);
855
910
  }
856
911
  if (s8 !== peg$FAILED) {
857
912
  peg$savedPos = s0;
858
- s1 = peg$c26(s3, s4, s6);
913
+ s1 = peg$c27(s3, s4, s6);
859
914
  s0 = s1;
860
915
  } else {
861
916
  peg$currPos = s0;
@@ -895,11 +950,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
895
950
  let s0, s1, s2, s3;
896
951
  s0 = peg$currPos;
897
952
  if (input.charCodeAt(peg$currPos) === 61) {
898
- s1 = peg$c27;
953
+ s1 = peg$c28;
899
954
  peg$currPos++;
900
955
  } else {
901
956
  s1 = peg$FAILED;
902
- if (peg$silentFails === 0) peg$fail(peg$c28);
957
+ if (peg$silentFails === 0) peg$fail(peg$c29);
903
958
  }
904
959
  if (s1 !== peg$FAILED) {
905
960
  s2 = peg$parse_();
@@ -907,7 +962,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
907
962
  s3 = peg$parseMetaTestValue();
908
963
  if (s3 !== peg$FAILED) {
909
964
  peg$savedPos = s0;
910
- s1 = peg$c29(s3);
965
+ s1 = peg$c30(s3);
911
966
  s0 = s1;
912
967
  } else {
913
968
  peg$currPos = s0;
@@ -941,11 +996,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
941
996
  let s0, s1, s2, s3, s4, s5, s6;
942
997
  s0 = peg$currPos;
943
998
  if (input.charCodeAt(peg$currPos) === 124) {
944
- s1 = peg$c30;
999
+ s1 = peg$c31;
945
1000
  peg$currPos++;
946
1001
  } else {
947
1002
  s1 = peg$FAILED;
948
- if (peg$silentFails === 0) peg$fail(peg$c31);
1003
+ if (peg$silentFails === 0) peg$fail(peg$c32);
949
1004
  }
950
1005
  if (s1 !== peg$FAILED) {
951
1006
  s2 = peg$parse_();
@@ -960,7 +1015,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
960
1015
  s6 = peg$parse_();
961
1016
  if (s6 !== peg$FAILED) {
962
1017
  peg$savedPos = s0;
963
- s1 = peg$c32(s3, s5);
1018
+ s1 = peg$c33(s3, s5);
964
1019
  s0 = s1;
965
1020
  } else {
966
1021
  peg$currPos = s0;
@@ -992,11 +1047,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
992
1047
  let s0, s1, s2, s3;
993
1048
  s0 = peg$currPos;
994
1049
  if (input.charCodeAt(peg$currPos) === 124) {
995
- s1 = peg$c30;
1050
+ s1 = peg$c31;
996
1051
  peg$currPos++;
997
1052
  } else {
998
1053
  s1 = peg$FAILED;
999
- if (peg$silentFails === 0) peg$fail(peg$c31);
1054
+ if (peg$silentFails === 0) peg$fail(peg$c32);
1000
1055
  }
1001
1056
  if (s1 !== peg$FAILED) {
1002
1057
  s2 = peg$parse_();
@@ -1004,7 +1059,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1004
1059
  s3 = peg$parseMetaExpression();
1005
1060
  if (s3 !== peg$FAILED) {
1006
1061
  peg$savedPos = s0;
1007
- s1 = peg$c33(s3);
1062
+ s1 = peg$c34(s3);
1008
1063
  s0 = s1;
1009
1064
  } else {
1010
1065
  peg$currPos = s0;
@@ -1023,21 +1078,21 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1023
1078
  function peg$parseMetaVariableName() {
1024
1079
  let s0, s1;
1025
1080
  s0 = [];
1026
- if (peg$c34.test(input.charAt(peg$currPos))) {
1081
+ if (peg$c35.test(input.charAt(peg$currPos))) {
1027
1082
  s1 = input.charAt(peg$currPos);
1028
1083
  peg$currPos++;
1029
1084
  } else {
1030
1085
  s1 = peg$FAILED;
1031
- if (peg$silentFails === 0) peg$fail(peg$c35);
1086
+ if (peg$silentFails === 0) peg$fail(peg$c36);
1032
1087
  }
1033
1088
  if (s1 !== peg$FAILED) while(s1 !== peg$FAILED){
1034
1089
  s0.push(s1);
1035
- if (peg$c34.test(input.charAt(peg$currPos))) {
1090
+ if (peg$c35.test(input.charAt(peg$currPos))) {
1036
1091
  s1 = input.charAt(peg$currPos);
1037
1092
  peg$currPos++;
1038
1093
  } else {
1039
1094
  s1 = peg$FAILED;
1040
- if (peg$silentFails === 0) peg$fail(peg$c35);
1095
+ if (peg$silentFails === 0) peg$fail(peg$c36);
1041
1096
  }
1042
1097
  }
1043
1098
  else s0 = peg$FAILED;
@@ -1076,47 +1131,47 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1076
1131
  }
1077
1132
  function peg$parseLyricsChar() {
1078
1133
  let s0, s1;
1079
- s0 = peg$parseChar();
1134
+ s0 = peg$parseWordChar();
1080
1135
  if (s0 === peg$FAILED) {
1081
1136
  s0 = peg$currPos;
1082
1137
  if (input.charCodeAt(peg$currPos) === 93) {
1083
- s1 = peg$c12;
1138
+ s1 = peg$c13;
1084
1139
  peg$currPos++;
1085
1140
  } else {
1086
1141
  s1 = peg$FAILED;
1087
- if (peg$silentFails === 0) peg$fail(peg$c13);
1142
+ if (peg$silentFails === 0) peg$fail(peg$c14);
1088
1143
  }
1089
1144
  if (s1 !== peg$FAILED) {
1090
1145
  peg$savedPos = s0;
1091
- s1 = peg$c20();
1146
+ s1 = peg$c37();
1092
1147
  }
1093
1148
  s0 = s1;
1094
1149
  if (s0 === peg$FAILED) {
1095
1150
  s0 = peg$currPos;
1096
1151
  if (input.charCodeAt(peg$currPos) === 124) {
1097
- s1 = peg$c30;
1152
+ s1 = peg$c31;
1098
1153
  peg$currPos++;
1099
1154
  } else {
1100
1155
  s1 = peg$FAILED;
1101
- if (peg$silentFails === 0) peg$fail(peg$c31);
1156
+ if (peg$silentFails === 0) peg$fail(peg$c32);
1102
1157
  }
1103
1158
  if (s1 !== peg$FAILED) {
1104
1159
  peg$savedPos = s0;
1105
- s1 = peg$c36();
1160
+ s1 = peg$c38();
1106
1161
  }
1107
1162
  s0 = s1;
1108
1163
  if (s0 === peg$FAILED) {
1109
1164
  s0 = peg$currPos;
1110
1165
  if (input.charCodeAt(peg$currPos) === 125) {
1111
- s1 = peg$c24;
1166
+ s1 = peg$c25;
1112
1167
  peg$currPos++;
1113
1168
  } else {
1114
1169
  s1 = peg$FAILED;
1115
- if (peg$silentFails === 0) peg$fail(peg$c25);
1170
+ if (peg$silentFails === 0) peg$fail(peg$c26);
1116
1171
  }
1117
1172
  if (s1 !== peg$FAILED) {
1118
1173
  peg$savedPos = s0;
1119
- s1 = peg$c37();
1174
+ s1 = peg$c39();
1120
1175
  }
1121
1176
  s0 = s1;
1122
1177
  }
@@ -1125,13 +1180,19 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1125
1180
  return s0;
1126
1181
  }
1127
1182
  function peg$parseChar() {
1183
+ let s0;
1184
+ s0 = peg$parseWordChar();
1185
+ if (s0 === peg$FAILED) s0 = peg$parseSpace();
1186
+ return s0;
1187
+ }
1188
+ function peg$parseWordChar() {
1128
1189
  let s0, s1, s2, s3;
1129
- if (peg$c38.test(input.charAt(peg$currPos))) {
1190
+ if (peg$c40.test(input.charAt(peg$currPos))) {
1130
1191
  s0 = input.charAt(peg$currPos);
1131
1192
  peg$currPos++;
1132
1193
  } else {
1133
1194
  s0 = peg$FAILED;
1134
- if (peg$silentFails === 0) peg$fail(peg$c39);
1195
+ if (peg$silentFails === 0) peg$fail(peg$c41);
1135
1196
  }
1136
1197
  if (s0 === peg$FAILED) {
1137
1198
  s0 = peg$currPos;
@@ -1139,113 +1200,113 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1139
1200
  if (s1 !== peg$FAILED) {
1140
1201
  s2 = peg$currPos;
1141
1202
  if (input.charCodeAt(peg$currPos) === 92) {
1142
- s3 = peg$c17;
1203
+ s3 = peg$c18;
1143
1204
  peg$currPos++;
1144
1205
  } else {
1145
1206
  s3 = peg$FAILED;
1146
- if (peg$silentFails === 0) peg$fail(peg$c18);
1207
+ if (peg$silentFails === 0) peg$fail(peg$c19);
1147
1208
  }
1148
1209
  if (s3 !== peg$FAILED) {
1149
1210
  peg$savedPos = s2;
1150
- s3 = peg$c19();
1211
+ s3 = peg$c42();
1151
1212
  }
1152
1213
  s2 = s3;
1153
1214
  if (s2 === peg$FAILED) {
1154
1215
  s2 = peg$currPos;
1155
1216
  if (input.charCodeAt(peg$currPos) === 124) {
1156
- s3 = peg$c30;
1217
+ s3 = peg$c31;
1157
1218
  peg$currPos++;
1158
1219
  } else {
1159
1220
  s3 = peg$FAILED;
1160
- if (peg$silentFails === 0) peg$fail(peg$c31);
1221
+ if (peg$silentFails === 0) peg$fail(peg$c32);
1161
1222
  }
1162
1223
  if (s3 !== peg$FAILED) {
1163
1224
  peg$savedPos = s2;
1164
- s3 = peg$c36();
1225
+ s3 = peg$c38();
1165
1226
  }
1166
1227
  s2 = s3;
1167
1228
  if (s2 === peg$FAILED) {
1168
1229
  s2 = peg$currPos;
1169
1230
  if (input.charCodeAt(peg$currPos) === 91) {
1170
- s3 = peg$c10;
1231
+ s3 = peg$c11;
1171
1232
  peg$currPos++;
1172
1233
  } else {
1173
1234
  s3 = peg$FAILED;
1174
- if (peg$silentFails === 0) peg$fail(peg$c11);
1235
+ if (peg$silentFails === 0) peg$fail(peg$c12);
1175
1236
  }
1176
1237
  if (s3 !== peg$FAILED) {
1177
1238
  peg$savedPos = s2;
1178
- s3 = peg$c40();
1239
+ s3 = peg$c43();
1179
1240
  }
1180
1241
  s2 = s3;
1181
1242
  if (s2 === peg$FAILED) {
1182
1243
  s2 = peg$currPos;
1183
1244
  if (input.charCodeAt(peg$currPos) === 93) {
1184
- s3 = peg$c12;
1245
+ s3 = peg$c13;
1185
1246
  peg$currPos++;
1186
1247
  } else {
1187
1248
  s3 = peg$FAILED;
1188
- if (peg$silentFails === 0) peg$fail(peg$c13);
1249
+ if (peg$silentFails === 0) peg$fail(peg$c14);
1189
1250
  }
1190
1251
  if (s3 !== peg$FAILED) {
1191
1252
  peg$savedPos = s2;
1192
- s3 = peg$c20();
1253
+ s3 = peg$c37();
1193
1254
  }
1194
1255
  s2 = s3;
1195
1256
  if (s2 === peg$FAILED) {
1196
1257
  s2 = peg$currPos;
1197
1258
  if (input.charCodeAt(peg$currPos) === 123) {
1198
- s3 = peg$c41;
1259
+ s3 = peg$c44;
1199
1260
  peg$currPos++;
1200
1261
  } else {
1201
1262
  s3 = peg$FAILED;
1202
- if (peg$silentFails === 0) peg$fail(peg$c42);
1263
+ if (peg$silentFails === 0) peg$fail(peg$c45);
1203
1264
  }
1204
1265
  if (s3 !== peg$FAILED) {
1205
1266
  peg$savedPos = s2;
1206
- s3 = peg$c43();
1267
+ s3 = peg$c46();
1207
1268
  }
1208
1269
  s2 = s3;
1209
1270
  if (s2 === peg$FAILED) {
1210
1271
  s2 = peg$currPos;
1211
1272
  if (input.charCodeAt(peg$currPos) === 125) {
1212
- s3 = peg$c24;
1273
+ s3 = peg$c25;
1213
1274
  peg$currPos++;
1214
1275
  } else {
1215
1276
  s3 = peg$FAILED;
1216
- if (peg$silentFails === 0) peg$fail(peg$c25);
1277
+ if (peg$silentFails === 0) peg$fail(peg$c26);
1217
1278
  }
1218
1279
  if (s3 !== peg$FAILED) {
1219
1280
  peg$savedPos = s2;
1220
- s3 = peg$c37();
1281
+ s3 = peg$c39();
1221
1282
  }
1222
1283
  s2 = s3;
1223
1284
  if (s2 === peg$FAILED) {
1224
1285
  s2 = peg$currPos;
1225
1286
  if (input.charCodeAt(peg$currPos) === 37) {
1226
- s3 = peg$c44;
1287
+ s3 = peg$c47;
1227
1288
  peg$currPos++;
1228
1289
  } else {
1229
1290
  s3 = peg$FAILED;
1230
- if (peg$silentFails === 0) peg$fail(peg$c45);
1291
+ if (peg$silentFails === 0) peg$fail(peg$c48);
1231
1292
  }
1232
1293
  if (s3 !== peg$FAILED) {
1233
1294
  peg$savedPos = s2;
1234
- s3 = peg$c46();
1295
+ s3 = peg$c49();
1235
1296
  }
1236
1297
  s2 = s3;
1237
1298
  if (s2 === peg$FAILED) {
1238
1299
  s2 = peg$currPos;
1239
1300
  if (input.charCodeAt(peg$currPos) === 35) {
1240
- s3 = peg$c3;
1301
+ s3 = peg$c4;
1241
1302
  peg$currPos++;
1242
1303
  } else {
1243
1304
  s3 = peg$FAILED;
1244
- if (peg$silentFails === 0) peg$fail(peg$c4);
1305
+ if (peg$silentFails === 0) peg$fail(peg$c5);
1245
1306
  }
1246
1307
  if (s3 !== peg$FAILED) {
1247
1308
  peg$savedPos = s2;
1248
- s3 = peg$c47();
1309
+ s3 = peg$c50();
1249
1310
  }
1250
1311
  s2 = s3;
1251
1312
  }
@@ -1257,7 +1318,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1257
1318
  }
1258
1319
  if (s2 !== peg$FAILED) {
1259
1320
  peg$savedPos = s0;
1260
- s1 = peg$c21(s2);
1321
+ s1 = peg$c22(s2);
1261
1322
  s0 = s1;
1262
1323
  } else {
1263
1324
  peg$currPos = s0;
@@ -1274,11 +1335,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1274
1335
  let s0, s1, s2, s3, s4, s5, s6, s7;
1275
1336
  s0 = peg$currPos;
1276
1337
  if (input.charCodeAt(peg$currPos) === 123) {
1277
- s1 = peg$c41;
1338
+ s1 = peg$c44;
1278
1339
  peg$currPos++;
1279
1340
  } else {
1280
1341
  s1 = peg$FAILED;
1281
- if (peg$silentFails === 0) peg$fail(peg$c42);
1342
+ if (peg$silentFails === 0) peg$fail(peg$c45);
1282
1343
  }
1283
1344
  if (s1 !== peg$FAILED) {
1284
1345
  s2 = peg$parse_();
@@ -1296,15 +1357,15 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1296
1357
  s6 = peg$parse_();
1297
1358
  if (s6 !== peg$FAILED) {
1298
1359
  if (input.charCodeAt(peg$currPos) === 125) {
1299
- s7 = peg$c24;
1360
+ s7 = peg$c25;
1300
1361
  peg$currPos++;
1301
1362
  } else {
1302
1363
  s7 = peg$FAILED;
1303
- if (peg$silentFails === 0) peg$fail(peg$c25);
1364
+ if (peg$silentFails === 0) peg$fail(peg$c26);
1304
1365
  }
1305
1366
  if (s7 !== peg$FAILED) {
1306
1367
  peg$savedPos = s0;
1307
- s1 = peg$c48(s3, s5);
1368
+ s1 = peg$c51(s3, s5);
1308
1369
  s0 = s1;
1309
1370
  } else {
1310
1371
  peg$currPos = s0;
@@ -1340,11 +1401,11 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1340
1401
  let s0, s1, s2, s3;
1341
1402
  s0 = peg$currPos;
1342
1403
  if (input.charCodeAt(peg$currPos) === 58) {
1343
- s1 = peg$c49;
1404
+ s1 = peg$c52;
1344
1405
  peg$currPos++;
1345
1406
  } else {
1346
1407
  s1 = peg$FAILED;
1347
- if (peg$silentFails === 0) peg$fail(peg$c50);
1408
+ if (peg$silentFails === 0) peg$fail(peg$c53);
1348
1409
  }
1349
1410
  if (s1 !== peg$FAILED) {
1350
1411
  s2 = peg$parse_();
@@ -1352,7 +1413,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1352
1413
  s3 = peg$parseTagValue();
1353
1414
  if (s3 !== peg$FAILED) {
1354
1415
  peg$savedPos = s0;
1355
- s1 = peg$c51(s3);
1416
+ s1 = peg$c54(s3);
1356
1417
  s0 = s1;
1357
1418
  } else {
1358
1419
  peg$currPos = s0;
@@ -1371,21 +1432,21 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1371
1432
  function peg$parseTagName() {
1372
1433
  let s0, s1;
1373
1434
  s0 = [];
1374
- if (peg$c52.test(input.charAt(peg$currPos))) {
1435
+ if (peg$c55.test(input.charAt(peg$currPos))) {
1375
1436
  s1 = input.charAt(peg$currPos);
1376
1437
  peg$currPos++;
1377
1438
  } else {
1378
1439
  s1 = peg$FAILED;
1379
- if (peg$silentFails === 0) peg$fail(peg$c53);
1440
+ if (peg$silentFails === 0) peg$fail(peg$c56);
1380
1441
  }
1381
1442
  if (s1 !== peg$FAILED) while(s1 !== peg$FAILED){
1382
1443
  s0.push(s1);
1383
- if (peg$c52.test(input.charAt(peg$currPos))) {
1444
+ if (peg$c55.test(input.charAt(peg$currPos))) {
1384
1445
  s1 = input.charAt(peg$currPos);
1385
1446
  peg$currPos++;
1386
1447
  } else {
1387
1448
  s1 = peg$FAILED;
1388
- if (peg$silentFails === 0) peg$fail(peg$c53);
1449
+ if (peg$silentFails === 0) peg$fail(peg$c56);
1389
1450
  }
1390
1451
  }
1391
1452
  else s0 = peg$FAILED;
@@ -1403,12 +1464,12 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1403
1464
  }
1404
1465
  function peg$parseTagValueChar() {
1405
1466
  let s0, s1, s2, s3;
1406
- if (peg$c54.test(input.charAt(peg$currPos))) {
1467
+ if (peg$c57.test(input.charAt(peg$currPos))) {
1407
1468
  s0 = input.charAt(peg$currPos);
1408
1469
  peg$currPos++;
1409
1470
  } else {
1410
1471
  s0 = peg$FAILED;
1411
- if (peg$silentFails === 0) peg$fail(peg$c55);
1472
+ if (peg$silentFails === 0) peg$fail(peg$c58);
1412
1473
  }
1413
1474
  if (s0 === peg$FAILED) {
1414
1475
  s0 = peg$currPos;
@@ -1416,50 +1477,50 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1416
1477
  if (s1 !== peg$FAILED) {
1417
1478
  s2 = peg$currPos;
1418
1479
  if (input.charCodeAt(peg$currPos) === 92) {
1419
- s3 = peg$c17;
1480
+ s3 = peg$c18;
1420
1481
  peg$currPos++;
1421
1482
  } else {
1422
1483
  s3 = peg$FAILED;
1423
- if (peg$silentFails === 0) peg$fail(peg$c18);
1484
+ if (peg$silentFails === 0) peg$fail(peg$c19);
1424
1485
  }
1425
1486
  if (s3 !== peg$FAILED) {
1426
1487
  peg$savedPos = s2;
1427
- s3 = peg$c19();
1488
+ s3 = peg$c42();
1428
1489
  }
1429
1490
  s2 = s3;
1430
1491
  if (s2 === peg$FAILED) {
1431
1492
  s2 = peg$currPos;
1432
1493
  if (input.charCodeAt(peg$currPos) === 125) {
1433
- s3 = peg$c24;
1494
+ s3 = peg$c25;
1434
1495
  peg$currPos++;
1435
1496
  } else {
1436
1497
  s3 = peg$FAILED;
1437
- if (peg$silentFails === 0) peg$fail(peg$c25);
1498
+ if (peg$silentFails === 0) peg$fail(peg$c26);
1438
1499
  }
1439
1500
  if (s3 !== peg$FAILED) {
1440
1501
  peg$savedPos = s2;
1441
- s3 = peg$c37();
1502
+ s3 = peg$c39();
1442
1503
  }
1443
1504
  s2 = s3;
1444
1505
  if (s2 === peg$FAILED) {
1445
1506
  s2 = peg$currPos;
1446
1507
  if (input.charCodeAt(peg$currPos) === 123) {
1447
- s3 = peg$c41;
1508
+ s3 = peg$c44;
1448
1509
  peg$currPos++;
1449
1510
  } else {
1450
1511
  s3 = peg$FAILED;
1451
- if (peg$silentFails === 0) peg$fail(peg$c42);
1512
+ if (peg$silentFails === 0) peg$fail(peg$c45);
1452
1513
  }
1453
1514
  if (s3 !== peg$FAILED) {
1454
1515
  peg$savedPos = s2;
1455
- s3 = peg$c43();
1516
+ s3 = peg$c46();
1456
1517
  }
1457
1518
  s2 = s3;
1458
1519
  }
1459
1520
  }
1460
1521
  if (s2 !== peg$FAILED) {
1461
1522
  peg$savedPos = s0;
1462
- s1 = peg$c21(s2);
1523
+ s1 = peg$c22(s2);
1463
1524
  s0 = s1;
1464
1525
  } else {
1465
1526
  peg$currPos = s0;
@@ -1476,27 +1537,27 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1476
1537
  let s0, s1;
1477
1538
  peg$silentFails++;
1478
1539
  s0 = [];
1479
- if (peg$c57.test(input.charAt(peg$currPos))) {
1540
+ if (peg$c60.test(input.charAt(peg$currPos))) {
1480
1541
  s1 = input.charAt(peg$currPos);
1481
1542
  peg$currPos++;
1482
1543
  } else {
1483
1544
  s1 = peg$FAILED;
1484
- if (peg$silentFails === 0) peg$fail(peg$c58);
1545
+ if (peg$silentFails === 0) peg$fail(peg$c61);
1485
1546
  }
1486
1547
  while(s1 !== peg$FAILED){
1487
1548
  s0.push(s1);
1488
- if (peg$c57.test(input.charAt(peg$currPos))) {
1549
+ if (peg$c60.test(input.charAt(peg$currPos))) {
1489
1550
  s1 = input.charAt(peg$currPos);
1490
1551
  peg$currPos++;
1491
1552
  } else {
1492
1553
  s1 = peg$FAILED;
1493
- if (peg$silentFails === 0) peg$fail(peg$c58);
1554
+ if (peg$silentFails === 0) peg$fail(peg$c61);
1494
1555
  }
1495
1556
  }
1496
1557
  peg$silentFails--;
1497
1558
  if (s0 === peg$FAILED) {
1498
1559
  s1 = peg$FAILED;
1499
- if (peg$silentFails === 0) peg$fail(peg$c56);
1560
+ if (peg$silentFails === 0) peg$fail(peg$c59);
1500
1561
  }
1501
1562
  return s0;
1502
1563
  }
@@ -1504,28 +1565,28 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1504
1565
  let s0, s1;
1505
1566
  peg$silentFails++;
1506
1567
  s0 = [];
1507
- if (peg$c60.test(input.charAt(peg$currPos))) {
1568
+ if (peg$c63.test(input.charAt(peg$currPos))) {
1508
1569
  s1 = input.charAt(peg$currPos);
1509
1570
  peg$currPos++;
1510
1571
  } else {
1511
1572
  s1 = peg$FAILED;
1512
- if (peg$silentFails === 0) peg$fail(peg$c61);
1573
+ if (peg$silentFails === 0) peg$fail(peg$c64);
1513
1574
  }
1514
1575
  if (s1 !== peg$FAILED) while(s1 !== peg$FAILED){
1515
1576
  s0.push(s1);
1516
- if (peg$c60.test(input.charAt(peg$currPos))) {
1577
+ if (peg$c63.test(input.charAt(peg$currPos))) {
1517
1578
  s1 = input.charAt(peg$currPos);
1518
1579
  peg$currPos++;
1519
1580
  } else {
1520
1581
  s1 = peg$FAILED;
1521
- if (peg$silentFails === 0) peg$fail(peg$c61);
1582
+ if (peg$silentFails === 0) peg$fail(peg$c64);
1522
1583
  }
1523
1584
  }
1524
1585
  else s0 = peg$FAILED;
1525
1586
  peg$silentFails--;
1526
1587
  if (s0 === peg$FAILED) {
1527
1588
  s1 = peg$FAILED;
1528
- if (peg$silentFails === 0) peg$fail(peg$c59);
1589
+ if (peg$silentFails === 0) peg$fail(peg$c62);
1529
1590
  }
1530
1591
  return s0;
1531
1592
  }
@@ -1563,55 +1624,55 @@ function $1a506a341538d943$var$peg$parse(input, options) {
1563
1624
  function peg$parseLineFeed() {
1564
1625
  let s0;
1565
1626
  if (input.charCodeAt(peg$currPos) === 10) {
1566
- s0 = peg$c62;
1627
+ s0 = peg$c65;
1567
1628
  peg$currPos++;
1568
1629
  } else {
1569
1630
  s0 = peg$FAILED;
1570
- if (peg$silentFails === 0) peg$fail(peg$c63);
1631
+ if (peg$silentFails === 0) peg$fail(peg$c66);
1571
1632
  }
1572
1633
  return s0;
1573
1634
  }
1574
1635
  function peg$parseCarriageReturn() {
1575
1636
  let s0;
1576
1637
  if (input.charCodeAt(peg$currPos) === 13) {
1577
- s0 = peg$c64;
1638
+ s0 = peg$c67;
1578
1639
  peg$currPos++;
1579
1640
  } else {
1580
1641
  s0 = peg$FAILED;
1581
- if (peg$silentFails === 0) peg$fail(peg$c65);
1642
+ if (peg$silentFails === 0) peg$fail(peg$c68);
1582
1643
  }
1583
1644
  return s0;
1584
1645
  }
1585
1646
  function peg$parseEscape() {
1586
1647
  let s0;
1587
1648
  if (input.charCodeAt(peg$currPos) === 92) {
1588
- s0 = peg$c17;
1649
+ s0 = peg$c18;
1589
1650
  peg$currPos++;
1590
1651
  } else {
1591
1652
  s0 = peg$FAILED;
1592
- if (peg$silentFails === 0) peg$fail(peg$c18);
1653
+ if (peg$silentFails === 0) peg$fail(peg$c19);
1593
1654
  }
1594
1655
  return s0;
1595
1656
  }
1596
1657
  function peg$parsePound() {
1597
1658
  let s0;
1598
1659
  if (input.charCodeAt(peg$currPos) === 35) {
1599
- s0 = peg$c3;
1660
+ s0 = peg$c4;
1600
1661
  peg$currPos++;
1601
1662
  } else {
1602
1663
  s0 = peg$FAILED;
1603
- if (peg$silentFails === 0) peg$fail(peg$c4);
1664
+ if (peg$silentFails === 0) peg$fail(peg$c5);
1604
1665
  }
1605
1666
  return s0;
1606
1667
  }
1607
1668
  function peg$parsePercent() {
1608
1669
  let s0;
1609
1670
  if (input.charCodeAt(peg$currPos) === 37) {
1610
- s0 = peg$c44;
1671
+ s0 = peg$c47;
1611
1672
  peg$currPos++;
1612
1673
  } else {
1613
1674
  s0 = peg$FAILED;
1614
- if (peg$silentFails === 0) peg$fail(peg$c45);
1675
+ if (peg$silentFails === 0) peg$fail(peg$c48);
1615
1676
  }
1616
1677
  return s0;
1617
1678
  }
@@ -2003,7 +2064,11 @@ const $bff5407e03fdc8ee$var$regexes = [
2003
2064
  $bff5407e03fdc8ee$var$numericKeyRegex,
2004
2065
  $bff5407e03fdc8ee$var$numeralKeyRegex
2005
2066
  ];
2006
- class $bff5407e03fdc8ee$var$Key {
2067
+ /**
2068
+ * Represents a key, such as Eb (symbol), #3 (numeric) or VII (numeral).
2069
+ *
2070
+ * The only function considered public API is `Key.distance`
2071
+ */ class $bff5407e03fdc8ee$var$Key {
2007
2072
  modifier = null;
2008
2073
  minor = false;
2009
2074
  static parse(keyString) {
@@ -2016,7 +2081,12 @@ class $bff5407e03fdc8ee$var$Key {
2016
2081
  static toString(keyStringOrObject) {
2017
2082
  return `${$bff5407e03fdc8ee$var$Key.wrap(keyStringOrObject)}`;
2018
2083
  }
2019
- static distance(oneKey, otherKey) {
2084
+ /**
2085
+ * Calculates the distance in semitones between one key and another.
2086
+ * @param {Key | string} oneKey the key
2087
+ * @param {Key | string} otherKey the other key
2088
+ * @return {number} the distance in semitones
2089
+ */ static distance(oneKey, otherKey) {
2020
2090
  return this.wrap(oneKey).distanceTo(otherKey);
2021
2091
  }
2022
2092
  distanceTo(otherKey) {
@@ -3327,7 +3397,7 @@ const $26f57998457eb2d4$var$regexes = [
3327
3397
  else if (bassBase) this.bass = new (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039)({
3328
3398
  note: bassBase,
3329
3399
  modifier: bassModifier,
3330
- minor: isMinor
3400
+ minor: false
3331
3401
  });
3332
3402
  else this.bass = null;
3333
3403
  }
@@ -3408,7 +3478,7 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
3408
3478
  });
3409
3479
  }
3410
3480
  transpose(delta, key = null, { normalizeChordSuffix: normalizeChordSuffix = false } = {}) {
3411
- const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords);
3481
+ const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords.trim());
3412
3482
  if (chordObj) {
3413
3483
  let transposedChord = chordObj.transpose(delta);
3414
3484
  if (key) transposedChord = transposedChord.normalize(key, {
@@ -3501,7 +3571,6 @@ const $5e9ede69210ec54a$var$ALIASES = {
3501
3571
  [$5e9ede69210ec54a$var$END_OF_TAB_SHORT]: $5e9ede69210ec54a$export$66a0ef3ffeab32b7,
3502
3572
  [$5e9ede69210ec54a$var$NEW_KEY_SHORT]: $5e9ede69210ec54a$export$b7627374a6424f68
3503
3573
  };
3504
- const $5e9ede69210ec54a$var$META_TAG_REGEX = /^meta:\s*([^:\s]+)(\s*(.+))?$/;
3505
3574
  const $5e9ede69210ec54a$var$TAG_REGEX = /^([^:\s]+)(:?\s*(.+))?$/;
3506
3575
  const $5e9ede69210ec54a$var$CUSTOM_META_TAG_NAME_REGEX = /^x_(.+)$/;
3507
3576
  function $5e9ede69210ec54a$export$3ef04055cb4a269a(tagName) {
@@ -3516,14 +3585,25 @@ const $5e9ede69210ec54a$var$translateTagNameAlias = (name)=>{
3516
3585
  /**
3517
3586
  * Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/
3518
3587
  */ class $5e9ede69210ec54a$var$Tag extends (0, $cf00b4d3af89fa07$export$2e2bcd8739ae039) {
3588
+ _isMetaTag = false;
3519
3589
  constructor(name, value = "", traceInfo = null){
3520
3590
  super(traceInfo);
3521
- this.name = name;
3522
- this.value = value || "";
3591
+ this.parseNameValue(name, value);
3592
+ }
3593
+ parseNameValue(name, value) {
3594
+ if (name === "meta") {
3595
+ const [metaName, metaValue] = value.split(/\s(.+)/);
3596
+ this.name = metaName;
3597
+ this.value = metaValue || "";
3598
+ this._isMetaTag = true;
3599
+ } else {
3600
+ this.name = name;
3601
+ this.value = value || "";
3602
+ }
3523
3603
  }
3524
3604
  static parse(tag) {
3525
3605
  if (tag instanceof $5e9ede69210ec54a$var$Tag) return tag;
3526
- return this.parseWithRegex(tag, $5e9ede69210ec54a$var$META_TAG_REGEX) || this.parseWithRegex(tag, $5e9ede69210ec54a$var$TAG_REGEX);
3606
+ return this.parseWithRegex(tag, $5e9ede69210ec54a$var$TAG_REGEX);
3527
3607
  }
3528
3608
  static parseWithRegex(tag, regex) {
3529
3609
  const matches = tag.match(regex);
@@ -3575,7 +3655,7 @@ const $5e9ede69210ec54a$var$translateTagNameAlias = (name)=>{
3575
3655
  * Checks whether the tag is either a standard meta tag or a custom meta directive (`{x_some_name}`)
3576
3656
  * @returns {boolean}
3577
3657
  */ isMetaTag() {
3578
- return $5e9ede69210ec54a$var$CUSTOM_META_TAG_NAME_REGEX.test(this.name) || $5e9ede69210ec54a$export$57ecf0dc09effb3.indexOf(this.name) !== -1;
3658
+ return this._isMetaTag || $5e9ede69210ec54a$var$CUSTOM_META_TAG_NAME_REGEX.test(this.name) || $5e9ede69210ec54a$export$57ecf0dc09effb3.indexOf(this.name) !== -1;
3579
3659
  }
3580
3660
  /**
3581
3661
  * Returns a clone of the tag.
@@ -3792,34 +3872,34 @@ var $0c3420c6a3e8a9d7$export$2e2bcd8739ae039 = $0c3420c6a3e8a9d7$var$Paragraph;
3792
3872
 
3793
3873
  class $59abde4480df2d69$var$MetadataAccessors {
3794
3874
  get key() {
3795
- return this.getMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
3875
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
3796
3876
  }
3797
3877
  get title() {
3798
- return this.getMetadata((0, $5e9ede69210ec54a$export$f1e53f710478ceb4));
3878
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$f1e53f710478ceb4));
3799
3879
  }
3800
3880
  get subtitle() {
3801
- return this.getMetadata((0, $5e9ede69210ec54a$export$5895c693c74b9cf4));
3881
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$5895c693c74b9cf4));
3802
3882
  }
3803
3883
  get capo() {
3804
3884
  return this.getMetadata((0, $5e9ede69210ec54a$export$866f445d49bad88e));
3805
3885
  }
3806
3886
  get duration() {
3807
- return this.getMetadata((0, $5e9ede69210ec54a$export$bacc88974c736870));
3887
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$bacc88974c736870));
3808
3888
  }
3809
3889
  get tempo() {
3810
- return this.getMetadata((0, $5e9ede69210ec54a$export$bd8d57d0bc5a8478));
3890
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$bd8d57d0bc5a8478));
3811
3891
  }
3812
3892
  get time() {
3813
3893
  return this.getMetadata((0, $5e9ede69210ec54a$export$a9905336c0111a3a));
3814
3894
  }
3815
3895
  get year() {
3816
- return this.getMetadata((0, $5e9ede69210ec54a$export$90b88dc425a06a95));
3896
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$90b88dc425a06a95));
3817
3897
  }
3818
3898
  get album() {
3819
3899
  return this.getMetadata((0, $5e9ede69210ec54a$export$10227cb086d1770c));
3820
3900
  }
3821
3901
  get copyright() {
3822
- return this.getMetadata((0, $5e9ede69210ec54a$export$4ab8c75045d12480));
3902
+ return this.getSingleMetadata((0, $5e9ede69210ec54a$export$4ab8c75045d12480));
3823
3903
  }
3824
3904
  get lyricist() {
3825
3905
  return this.getMetadata((0, $5e9ede69210ec54a$export$a6901bd008617c61));
@@ -3884,6 +3964,9 @@ function $1406c61233580008$var$appendValue(array, key, value) {
3884
3964
  getMetadata(name) {
3885
3965
  return this.get(name);
3886
3966
  }
3967
+ getSingleMetadata(name) {
3968
+ return this.getSingle(name);
3969
+ }
3887
3970
  /**
3888
3971
  * Reads a metadata value by key. This method supports simple value lookup, as fetching single array values.
3889
3972
  *
@@ -4140,7 +4223,10 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
4140
4223
  return this.metadata;
4141
4224
  }
4142
4225
  getMetadata(name) {
4143
- return this.metadata[name] || null;
4226
+ return this.metadata.getMetadata(name);
4227
+ }
4228
+ getSingleMetadata(name) {
4229
+ return this.metadata.getSingleMetadata(name);
4144
4230
  }
4145
4231
  /**
4146
4232
  * Returns a copy of the song with the key value set to the specified key. It changes: