@retorquere/bibtex-parser 7.0.3 → 7.0.4

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.
Files changed (3) hide show
  1. package/grammar.js +318 -243
  2. package/index.js +9 -8
  3. package/package.json +1 -1
package/grammar.js CHANGED
@@ -198,13 +198,14 @@ function peg$parse(input, options) {
198
198
  var peg$c19 = "\r";
199
199
  var peg$c20 = "\n";
200
200
  var peg$c21 = "newcommand";
201
- var peg$c22 = "href";
202
- var peg$c23 = "begin";
203
- var peg$c24 = "end";
204
- var peg$c25 = "[";
205
- var peg$c26 = "]";
206
- var peg$c27 = "=";
207
- var peg$c28 = "#";
201
+ var peg$c22 = "url";
202
+ var peg$c23 = "href";
203
+ var peg$c24 = "begin";
204
+ var peg$c25 = "end";
205
+ var peg$c26 = "[";
206
+ var peg$c27 = "]";
207
+ var peg$c28 = "=";
208
+ var peg$c29 = "#";
208
209
 
209
210
  var peg$r0 = /^[^\n\r]/;
210
211
  var peg$r1 = /^[\n\r]/;
@@ -277,29 +278,30 @@ function peg$parse(input, options) {
277
278
  var peg$e38 = peg$classExpectation(["_", "^"], false, false);
278
279
  var peg$e39 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "\t", "\r", "\n"], true, false);
279
280
  var peg$e40 = peg$literalExpectation("newcommand", false);
280
- var peg$e41 = peg$literalExpectation("href", false);
281
- var peg$e42 = peg$literalExpectation("begin", false);
282
- var peg$e43 = peg$literalExpectation("end", false);
283
- var peg$e44 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false);
284
- var peg$e45 = peg$literalExpectation("[", false);
285
- var peg$e46 = peg$classExpectation(["]"], true, false);
286
- var peg$e47 = peg$literalExpectation("]", false);
287
- var peg$e48 = peg$classExpectation([" ", "\t", "^", "_", "$", "{", "}", "\\"], true, false);
288
- var peg$e49 = peg$classExpectation([["a", "z"], ["A", "Z"], "-", "_"], false, false);
289
- var peg$e50 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "-", "&", "_", ":"], false, false);
290
- var peg$e51 = peg$classExpectation(["'", "`", "\"", "=", "~", "^", "."], false, false);
291
- var peg$e52 = peg$classExpectation(["'", "`", "\"", "=", "~", "^", ".", "c", "b", "u", "v", "d", "r", "H", "k"], false, false);
292
- var peg$e53 = peg$literalExpectation("=", false);
293
- var peg$e54 = peg$literalExpectation("#", false);
294
- var peg$e55 = peg$classExpectation(["\r", "\n"], false, false);
295
- var peg$e56 = peg$otherExpectation("Mandatory Horizontal Whitespace");
296
- var peg$e57 = peg$classExpectation([" ", "\t"], false, false);
297
- var peg$e58 = peg$otherExpectation("Optional Horizontal Whitespace");
298
- var peg$e59 = peg$otherExpectation("Mandatory Vertical Whitespace");
299
- var peg$e60 = peg$otherExpectation("Optional Vertical Whitespace");
300
- var peg$e61 = peg$otherExpectation("Mandatory Whitespace");
301
- var peg$e62 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false);
302
- var peg$e63 = peg$otherExpectation("Optional Whitespace");
281
+ var peg$e41 = peg$literalExpectation("url", false);
282
+ var peg$e42 = peg$literalExpectation("href", false);
283
+ var peg$e43 = peg$literalExpectation("begin", false);
284
+ var peg$e44 = peg$literalExpectation("end", false);
285
+ var peg$e45 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false);
286
+ var peg$e46 = peg$literalExpectation("[", false);
287
+ var peg$e47 = peg$classExpectation(["]"], true, false);
288
+ var peg$e48 = peg$literalExpectation("]", false);
289
+ var peg$e49 = peg$classExpectation([" ", "\t", "^", "_", "$", "{", "}", "\\"], true, false);
290
+ var peg$e50 = peg$classExpectation([["a", "z"], ["A", "Z"], "-", "_"], false, false);
291
+ var peg$e51 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "-", "&", "_", ":"], false, false);
292
+ var peg$e52 = peg$classExpectation(["'", "`", "\"", "=", "~", "^", "."], false, false);
293
+ var peg$e53 = peg$classExpectation(["'", "`", "\"", "=", "~", "^", ".", "c", "b", "u", "v", "d", "r", "H", "k"], false, false);
294
+ var peg$e54 = peg$literalExpectation("=", false);
295
+ var peg$e55 = peg$literalExpectation("#", false);
296
+ var peg$e56 = peg$classExpectation(["\r", "\n"], false, false);
297
+ var peg$e57 = peg$otherExpectation("Mandatory Horizontal Whitespace");
298
+ var peg$e58 = peg$classExpectation([" ", "\t"], false, false);
299
+ var peg$e59 = peg$otherExpectation("Optional Horizontal Whitespace");
300
+ var peg$e60 = peg$otherExpectation("Mandatory Vertical Whitespace");
301
+ var peg$e61 = peg$otherExpectation("Optional Vertical Whitespace");
302
+ var peg$e62 = peg$otherExpectation("Mandatory Whitespace");
303
+ var peg$e63 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false);
304
+ var peg$e64 = peg$otherExpectation("Optional Whitespace");
303
305
 
304
306
  var peg$f0 = function(r) {
305
307
  return {
@@ -667,7 +669,23 @@ function peg$parse(input, options) {
667
669
  },
668
670
  }
669
671
  };
670
- var peg$f52 = function(cmd, url, label) {
672
+ var peg$f52 = function(cmd, url) {
673
+ // https://github.com/retorquere/zotero-better-bibtex/issues/2617
674
+ url.value = url.value.replace(/\\#/g, '#')
675
+ return {
676
+ kind: 'RegularCommand',
677
+ loc: location(),
678
+ source: text(),
679
+ command: cmd,
680
+ arguments: {
681
+ optional: [],
682
+ required: [url],
683
+ },
684
+ }
685
+ };
686
+ var peg$f53 = function(cmd, url, label) {
687
+ // https://github.com/retorquere/zotero-better-bibtex/issues/2617
688
+ url.value = url.value.replace(/\\#/g, '#')
671
689
  return {
672
690
  kind: 'RegularCommand',
673
691
  loc: location(),
@@ -679,8 +697,8 @@ function peg$parse(input, options) {
679
697
  },
680
698
  }
681
699
  };
682
- var peg$f53 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 2) };
683
- var peg$f54 = function(cmd, optional, req1, req2) {
700
+ var peg$f54 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 2) };
701
+ var peg$f55 = function(cmd, optional, req1, req2) {
684
702
  return {
685
703
  kind: 'RegularCommand',
686
704
  loc: location(),
@@ -692,8 +710,8 @@ function peg$parse(input, options) {
692
710
  },
693
711
  }
694
712
  };
695
- var peg$f55 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 1) };
696
- var peg$f56 = function(cmd, optional, req) {
713
+ var peg$f56 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 1) };
714
+ var peg$f57 = function(cmd, optional, req) {
697
715
  return {
698
716
  kind: 'RegularCommand',
699
717
  loc: location(),
@@ -705,8 +723,8 @@ function peg$parse(input, options) {
705
723
  },
706
724
  }
707
725
  };
708
- var peg$f57 = function(cmd) { return (has_arguments[cmd] === 2) };
709
- var peg$f58 = function(cmd, optional, req1, req2) {
726
+ var peg$f58 = function(cmd) { return (has_arguments[cmd] === 2) };
727
+ var peg$f59 = function(cmd, optional, req1, req2) {
710
728
  return {
711
729
  kind: 'RegularCommand',
712
730
  loc: location(),
@@ -718,8 +736,8 @@ function peg$parse(input, options) {
718
736
  },
719
737
  }
720
738
  };
721
- var peg$f59 = function(cmd) { return (has_arguments[cmd] === 1) };
722
- var peg$f60 = function(cmd, optional, req) {
739
+ var peg$f60 = function(cmd) { return (has_arguments[cmd] === 1) };
740
+ var peg$f61 = function(cmd, optional, req) {
723
741
  let m
724
742
  if (req.kind === 'Block') {
725
743
  switch (cmd) {
@@ -769,7 +787,7 @@ function peg$parse(input, options) {
769
787
  }
770
788
  }
771
789
  };
772
- var peg$f61 = function(cmd, optional) {
790
+ var peg$f62 = function(cmd, optional) {
773
791
  return {
774
792
  kind: 'RegularCommand',
775
793
  loc: location(),
@@ -781,7 +799,7 @@ function peg$parse(input, options) {
781
799
  }
782
800
  }
783
801
  };
784
- var peg$f62 = function(v) {
802
+ var peg$f63 = function(v) {
785
803
  return basicTextConversions({
786
804
  kind: 'Text', // this isn't really correct but I don't need these right now
787
805
  loc: location(),
@@ -790,7 +808,7 @@ function peg$parse(input, options) {
790
808
  mode: math.on ? 'math' : 'text',
791
809
  })
792
810
  };
793
- var peg$f63 = function(v) {
811
+ var peg$f64 = function(v) {
794
812
  return basicTextConversions({
795
813
  kind: 'Text',
796
814
  loc: location(),
@@ -799,7 +817,7 @@ function peg$parse(input, options) {
799
817
  mode: math.on ? 'math' : 'text',
800
818
  })
801
819
  };
802
- var peg$f64 = function(v) { return v };
820
+ var peg$f65 = function(v) { return v };
803
821
  var peg$currPos = 0;
804
822
  var peg$savedPos = 0;
805
823
  var peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -3382,9 +3400,9 @@ function peg$parse(input, options) {
3382
3400
  if (peg$silentFails === 0) { peg$fail(peg$e27); }
3383
3401
  }
3384
3402
  if (s1 !== peg$FAILED) {
3385
- if (input.substr(peg$currPos, 4) === peg$c22) {
3403
+ if (input.substr(peg$currPos, 3) === peg$c22) {
3386
3404
  s2 = peg$c22;
3387
- peg$currPos += 4;
3405
+ peg$currPos += 3;
3388
3406
  } else {
3389
3407
  s2 = peg$FAILED;
3390
3408
  if (peg$silentFails === 0) { peg$fail(peg$e41); }
@@ -3410,14 +3428,8 @@ function peg$parse(input, options) {
3410
3428
  if (s4 !== peg$FAILED) {
3411
3429
  s5 = peg$parseVerbatimFieldValue();
3412
3430
  if (s5 !== peg$FAILED) {
3413
- s6 = peg$parseArgument();
3414
- if (s6 !== peg$FAILED) {
3415
- peg$savedPos = s0;
3416
- s0 = peg$f52(s2, s5, s6);
3417
- } else {
3418
- peg$currPos = s0;
3419
- s0 = peg$FAILED;
3420
- }
3431
+ peg$savedPos = s0;
3432
+ s0 = peg$f52(s2, s5);
3421
3433
  } else {
3422
3434
  peg$currPos = s0;
3423
3435
  s0 = peg$FAILED;
@@ -3444,119 +3456,38 @@ function peg$parse(input, options) {
3444
3456
  if (peg$silentFails === 0) { peg$fail(peg$e27); }
3445
3457
  }
3446
3458
  if (s1 !== peg$FAILED) {
3447
- s2 = peg$currPos;
3448
- peg$silentFails++;
3449
- if (input.substr(peg$currPos, 5) === peg$c23) {
3450
- s3 = peg$c23;
3451
- peg$currPos += 5;
3452
- } else {
3453
- s3 = peg$FAILED;
3454
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
3455
- }
3456
- peg$silentFails--;
3457
- if (s3 === peg$FAILED) {
3458
- s2 = undefined;
3459
+ if (input.substr(peg$currPos, 4) === peg$c23) {
3460
+ s2 = peg$c23;
3461
+ peg$currPos += 4;
3459
3462
  } else {
3460
- peg$currPos = s2;
3461
3463
  s2 = peg$FAILED;
3464
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
3462
3465
  }
3463
3466
  if (s2 !== peg$FAILED) {
3464
- s3 = peg$currPos;
3467
+ s3 = peg$parse__h();
3468
+ s4 = peg$currPos;
3465
3469
  peg$silentFails++;
3466
- if (input.substr(peg$currPos, 3) === peg$c24) {
3467
- s4 = peg$c24;
3468
- peg$currPos += 3;
3470
+ if (input.charCodeAt(peg$currPos) === 123) {
3471
+ s5 = peg$c2;
3472
+ peg$currPos++;
3469
3473
  } else {
3470
- s4 = peg$FAILED;
3471
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
3474
+ s5 = peg$FAILED;
3475
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
3472
3476
  }
3473
3477
  peg$silentFails--;
3474
- if (s4 === peg$FAILED) {
3475
- s3 = undefined;
3478
+ if (s5 !== peg$FAILED) {
3479
+ peg$currPos = s4;
3480
+ s4 = undefined;
3476
3481
  } else {
3477
- peg$currPos = s3;
3478
- s3 = peg$FAILED;
3482
+ s4 = peg$FAILED;
3479
3483
  }
3480
- if (s3 !== peg$FAILED) {
3481
- s4 = peg$currPos;
3482
- s5 = [];
3483
- if (peg$r19.test(input.charAt(peg$currPos))) {
3484
- s6 = input.charAt(peg$currPos);
3485
- peg$currPos++;
3486
- } else {
3487
- s6 = peg$FAILED;
3488
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3489
- }
3490
- if (s6 !== peg$FAILED) {
3491
- while (s6 !== peg$FAILED) {
3492
- s5.push(s6);
3493
- if (peg$r19.test(input.charAt(peg$currPos))) {
3494
- s6 = input.charAt(peg$currPos);
3495
- peg$currPos++;
3496
- } else {
3497
- s6 = peg$FAILED;
3498
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3499
- }
3500
- }
3501
- } else {
3502
- s5 = peg$FAILED;
3503
- }
3484
+ if (s4 !== peg$FAILED) {
3485
+ s5 = peg$parseVerbatimFieldValue();
3504
3486
  if (s5 !== peg$FAILED) {
3505
- s4 = input.substring(s4, peg$currPos);
3506
- } else {
3507
- s4 = s5;
3508
- }
3509
- if (s4 !== peg$FAILED) {
3510
- peg$savedPos = peg$currPos;
3511
- s5 = peg$f53(s4);
3512
- if (s5) {
3513
- s5 = undefined;
3514
- } else {
3515
- s5 = peg$FAILED;
3516
- }
3517
- if (s5 !== peg$FAILED) {
3518
- s6 = [];
3519
- s7 = peg$parseOptionalArgument();
3520
- while (s7 !== peg$FAILED) {
3521
- s6.push(s7);
3522
- s7 = peg$parseOptionalArgument();
3523
- }
3524
- s7 = peg$parse__h();
3525
- s8 = peg$currPos;
3526
- peg$silentFails++;
3527
- if (input.charCodeAt(peg$currPos) === 123) {
3528
- s9 = peg$c2;
3529
- peg$currPos++;
3530
- } else {
3531
- s9 = peg$FAILED;
3532
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
3533
- }
3534
- peg$silentFails--;
3535
- if (s9 !== peg$FAILED) {
3536
- peg$currPos = s8;
3537
- s8 = undefined;
3538
- } else {
3539
- s8 = peg$FAILED;
3540
- }
3541
- if (s8 !== peg$FAILED) {
3542
- s9 = peg$parseVerbatimFieldValue();
3543
- if (s9 !== peg$FAILED) {
3544
- s10 = peg$parseVerbatimFieldValue();
3545
- if (s10 !== peg$FAILED) {
3546
- peg$savedPos = s0;
3547
- s0 = peg$f54(s4, s6, s9, s10);
3548
- } else {
3549
- peg$currPos = s0;
3550
- s0 = peg$FAILED;
3551
- }
3552
- } else {
3553
- peg$currPos = s0;
3554
- s0 = peg$FAILED;
3555
- }
3556
- } else {
3557
- peg$currPos = s0;
3558
- s0 = peg$FAILED;
3559
- }
3487
+ s6 = peg$parseArgument();
3488
+ if (s6 !== peg$FAILED) {
3489
+ peg$savedPos = s0;
3490
+ s0 = peg$f53(s2, s5, s6);
3560
3491
  } else {
3561
3492
  peg$currPos = s0;
3562
3493
  s0 = peg$FAILED;
@@ -3589,12 +3520,12 @@ function peg$parse(input, options) {
3589
3520
  if (s1 !== peg$FAILED) {
3590
3521
  s2 = peg$currPos;
3591
3522
  peg$silentFails++;
3592
- if (input.substr(peg$currPos, 5) === peg$c23) {
3593
- s3 = peg$c23;
3523
+ if (input.substr(peg$currPos, 5) === peg$c24) {
3524
+ s3 = peg$c24;
3594
3525
  peg$currPos += 5;
3595
3526
  } else {
3596
3527
  s3 = peg$FAILED;
3597
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
3528
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
3598
3529
  }
3599
3530
  peg$silentFails--;
3600
3531
  if (s3 === peg$FAILED) {
@@ -3606,12 +3537,12 @@ function peg$parse(input, options) {
3606
3537
  if (s2 !== peg$FAILED) {
3607
3538
  s3 = peg$currPos;
3608
3539
  peg$silentFails++;
3609
- if (input.substr(peg$currPos, 3) === peg$c24) {
3610
- s4 = peg$c24;
3540
+ if (input.substr(peg$currPos, 3) === peg$c25) {
3541
+ s4 = peg$c25;
3611
3542
  peg$currPos += 3;
3612
3543
  } else {
3613
3544
  s4 = peg$FAILED;
3614
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
3545
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
3615
3546
  }
3616
3547
  peg$silentFails--;
3617
3548
  if (s4 === peg$FAILED) {
@@ -3628,7 +3559,7 @@ function peg$parse(input, options) {
3628
3559
  peg$currPos++;
3629
3560
  } else {
3630
3561
  s6 = peg$FAILED;
3631
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3562
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3632
3563
  }
3633
3564
  if (s6 !== peg$FAILED) {
3634
3565
  while (s6 !== peg$FAILED) {
@@ -3638,7 +3569,7 @@ function peg$parse(input, options) {
3638
3569
  peg$currPos++;
3639
3570
  } else {
3640
3571
  s6 = peg$FAILED;
3641
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3572
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3642
3573
  }
3643
3574
  }
3644
3575
  } else {
@@ -3651,7 +3582,7 @@ function peg$parse(input, options) {
3651
3582
  }
3652
3583
  if (s4 !== peg$FAILED) {
3653
3584
  peg$savedPos = peg$currPos;
3654
- s5 = peg$f55(s4);
3585
+ s5 = peg$f54(s4);
3655
3586
  if (s5) {
3656
3587
  s5 = undefined;
3657
3588
  } else {
@@ -3684,8 +3615,14 @@ function peg$parse(input, options) {
3684
3615
  if (s8 !== peg$FAILED) {
3685
3616
  s9 = peg$parseVerbatimFieldValue();
3686
3617
  if (s9 !== peg$FAILED) {
3687
- peg$savedPos = s0;
3688
- s0 = peg$f56(s4, s6, s9);
3618
+ s10 = peg$parseVerbatimFieldValue();
3619
+ if (s10 !== peg$FAILED) {
3620
+ peg$savedPos = s0;
3621
+ s0 = peg$f55(s4, s6, s9, s10);
3622
+ } else {
3623
+ peg$currPos = s0;
3624
+ s0 = peg$FAILED;
3625
+ }
3689
3626
  } else {
3690
3627
  peg$currPos = s0;
3691
3628
  s0 = peg$FAILED;
@@ -3726,12 +3663,12 @@ function peg$parse(input, options) {
3726
3663
  if (s1 !== peg$FAILED) {
3727
3664
  s2 = peg$currPos;
3728
3665
  peg$silentFails++;
3729
- if (input.substr(peg$currPos, 5) === peg$c23) {
3730
- s3 = peg$c23;
3666
+ if (input.substr(peg$currPos, 5) === peg$c24) {
3667
+ s3 = peg$c24;
3731
3668
  peg$currPos += 5;
3732
3669
  } else {
3733
3670
  s3 = peg$FAILED;
3734
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
3671
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
3735
3672
  }
3736
3673
  peg$silentFails--;
3737
3674
  if (s3 === peg$FAILED) {
@@ -3743,12 +3680,12 @@ function peg$parse(input, options) {
3743
3680
  if (s2 !== peg$FAILED) {
3744
3681
  s3 = peg$currPos;
3745
3682
  peg$silentFails++;
3746
- if (input.substr(peg$currPos, 3) === peg$c24) {
3747
- s4 = peg$c24;
3683
+ if (input.substr(peg$currPos, 3) === peg$c25) {
3684
+ s4 = peg$c25;
3748
3685
  peg$currPos += 3;
3749
3686
  } else {
3750
3687
  s4 = peg$FAILED;
3751
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
3688
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
3752
3689
  }
3753
3690
  peg$silentFails--;
3754
3691
  if (s4 === peg$FAILED) {
@@ -3765,7 +3702,7 @@ function peg$parse(input, options) {
3765
3702
  peg$currPos++;
3766
3703
  } else {
3767
3704
  s6 = peg$FAILED;
3768
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3705
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3769
3706
  }
3770
3707
  if (s6 !== peg$FAILED) {
3771
3708
  while (s6 !== peg$FAILED) {
@@ -3775,7 +3712,7 @@ function peg$parse(input, options) {
3775
3712
  peg$currPos++;
3776
3713
  } else {
3777
3714
  s6 = peg$FAILED;
3778
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3715
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3779
3716
  }
3780
3717
  }
3781
3718
  } else {
@@ -3788,7 +3725,7 @@ function peg$parse(input, options) {
3788
3725
  }
3789
3726
  if (s4 !== peg$FAILED) {
3790
3727
  peg$savedPos = peg$currPos;
3791
- s5 = peg$f57(s4);
3728
+ s5 = peg$f56(s4);
3792
3729
  if (s5) {
3793
3730
  s5 = undefined;
3794
3731
  } else {
@@ -3802,12 +3739,27 @@ function peg$parse(input, options) {
3802
3739
  s7 = peg$parseOptionalArgument();
3803
3740
  }
3804
3741
  s7 = peg$parse__h();
3805
- s8 = peg$parseArgument();
3742
+ s8 = peg$currPos;
3743
+ peg$silentFails++;
3744
+ if (input.charCodeAt(peg$currPos) === 123) {
3745
+ s9 = peg$c2;
3746
+ peg$currPos++;
3747
+ } else {
3748
+ s9 = peg$FAILED;
3749
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
3750
+ }
3751
+ peg$silentFails--;
3752
+ if (s9 !== peg$FAILED) {
3753
+ peg$currPos = s8;
3754
+ s8 = undefined;
3755
+ } else {
3756
+ s8 = peg$FAILED;
3757
+ }
3806
3758
  if (s8 !== peg$FAILED) {
3807
- s9 = peg$parseArgument();
3759
+ s9 = peg$parseVerbatimFieldValue();
3808
3760
  if (s9 !== peg$FAILED) {
3809
3761
  peg$savedPos = s0;
3810
- s0 = peg$f58(s4, s6, s8, s9);
3762
+ s0 = peg$f57(s4, s6, s9);
3811
3763
  } else {
3812
3764
  peg$currPos = s0;
3813
3765
  s0 = peg$FAILED;
@@ -3848,12 +3800,12 @@ function peg$parse(input, options) {
3848
3800
  if (s1 !== peg$FAILED) {
3849
3801
  s2 = peg$currPos;
3850
3802
  peg$silentFails++;
3851
- if (input.substr(peg$currPos, 5) === peg$c23) {
3852
- s3 = peg$c23;
3803
+ if (input.substr(peg$currPos, 5) === peg$c24) {
3804
+ s3 = peg$c24;
3853
3805
  peg$currPos += 5;
3854
3806
  } else {
3855
3807
  s3 = peg$FAILED;
3856
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
3808
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
3857
3809
  }
3858
3810
  peg$silentFails--;
3859
3811
  if (s3 === peg$FAILED) {
@@ -3865,12 +3817,12 @@ function peg$parse(input, options) {
3865
3817
  if (s2 !== peg$FAILED) {
3866
3818
  s3 = peg$currPos;
3867
3819
  peg$silentFails++;
3868
- if (input.substr(peg$currPos, 3) === peg$c24) {
3869
- s4 = peg$c24;
3820
+ if (input.substr(peg$currPos, 3) === peg$c25) {
3821
+ s4 = peg$c25;
3870
3822
  peg$currPos += 3;
3871
3823
  } else {
3872
3824
  s4 = peg$FAILED;
3873
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
3825
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
3874
3826
  }
3875
3827
  peg$silentFails--;
3876
3828
  if (s4 === peg$FAILED) {
@@ -3887,7 +3839,7 @@ function peg$parse(input, options) {
3887
3839
  peg$currPos++;
3888
3840
  } else {
3889
3841
  s6 = peg$FAILED;
3890
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3842
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3891
3843
  }
3892
3844
  if (s6 !== peg$FAILED) {
3893
3845
  while (s6 !== peg$FAILED) {
@@ -3897,7 +3849,7 @@ function peg$parse(input, options) {
3897
3849
  peg$currPos++;
3898
3850
  } else {
3899
3851
  s6 = peg$FAILED;
3900
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3852
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
3901
3853
  }
3902
3854
  }
3903
3855
  } else {
@@ -3910,7 +3862,7 @@ function peg$parse(input, options) {
3910
3862
  }
3911
3863
  if (s4 !== peg$FAILED) {
3912
3864
  peg$savedPos = peg$currPos;
3913
- s5 = peg$f59(s4);
3865
+ s5 = peg$f58(s4);
3914
3866
  if (s5) {
3915
3867
  s5 = undefined;
3916
3868
  } else {
@@ -3926,8 +3878,14 @@ function peg$parse(input, options) {
3926
3878
  s7 = peg$parse__h();
3927
3879
  s8 = peg$parseArgument();
3928
3880
  if (s8 !== peg$FAILED) {
3929
- peg$savedPos = s0;
3930
- s0 = peg$f60(s4, s6, s8);
3881
+ s9 = peg$parseArgument();
3882
+ if (s9 !== peg$FAILED) {
3883
+ peg$savedPos = s0;
3884
+ s0 = peg$f59(s4, s6, s8, s9);
3885
+ } else {
3886
+ peg$currPos = s0;
3887
+ s0 = peg$FAILED;
3888
+ }
3931
3889
  } else {
3932
3890
  peg$currPos = s0;
3933
3891
  s0 = peg$FAILED;
@@ -3964,12 +3922,12 @@ function peg$parse(input, options) {
3964
3922
  if (s1 !== peg$FAILED) {
3965
3923
  s2 = peg$currPos;
3966
3924
  peg$silentFails++;
3967
- if (input.substr(peg$currPos, 5) === peg$c23) {
3968
- s3 = peg$c23;
3925
+ if (input.substr(peg$currPos, 5) === peg$c24) {
3926
+ s3 = peg$c24;
3969
3927
  peg$currPos += 5;
3970
3928
  } else {
3971
3929
  s3 = peg$FAILED;
3972
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
3930
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
3973
3931
  }
3974
3932
  peg$silentFails--;
3975
3933
  if (s3 === peg$FAILED) {
@@ -3981,12 +3939,12 @@ function peg$parse(input, options) {
3981
3939
  if (s2 !== peg$FAILED) {
3982
3940
  s3 = peg$currPos;
3983
3941
  peg$silentFails++;
3984
- if (input.substr(peg$currPos, 3) === peg$c24) {
3985
- s4 = peg$c24;
3942
+ if (input.substr(peg$currPos, 3) === peg$c25) {
3943
+ s4 = peg$c25;
3986
3944
  peg$currPos += 3;
3987
3945
  } else {
3988
3946
  s4 = peg$FAILED;
3989
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
3947
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
3990
3948
  }
3991
3949
  peg$silentFails--;
3992
3950
  if (s4 === peg$FAILED) {
@@ -4003,7 +3961,7 @@ function peg$parse(input, options) {
4003
3961
  peg$currPos++;
4004
3962
  } else {
4005
3963
  s6 = peg$FAILED;
4006
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3964
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
4007
3965
  }
4008
3966
  if (s6 !== peg$FAILED) {
4009
3967
  while (s6 !== peg$FAILED) {
@@ -4013,7 +3971,7 @@ function peg$parse(input, options) {
4013
3971
  peg$currPos++;
4014
3972
  } else {
4015
3973
  s6 = peg$FAILED;
4016
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
3974
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
4017
3975
  }
4018
3976
  }
4019
3977
  } else {
@@ -4025,15 +3983,33 @@ function peg$parse(input, options) {
4025
3983
  s4 = s5;
4026
3984
  }
4027
3985
  if (s4 !== peg$FAILED) {
4028
- s5 = [];
4029
- s6 = peg$parseOptionalArgument();
4030
- while (s6 !== peg$FAILED) {
4031
- s5.push(s6);
4032
- s6 = peg$parseOptionalArgument();
3986
+ peg$savedPos = peg$currPos;
3987
+ s5 = peg$f60(s4);
3988
+ if (s5) {
3989
+ s5 = undefined;
3990
+ } else {
3991
+ s5 = peg$FAILED;
3992
+ }
3993
+ if (s5 !== peg$FAILED) {
3994
+ s6 = [];
3995
+ s7 = peg$parseOptionalArgument();
3996
+ while (s7 !== peg$FAILED) {
3997
+ s6.push(s7);
3998
+ s7 = peg$parseOptionalArgument();
3999
+ }
4000
+ s7 = peg$parse__h();
4001
+ s8 = peg$parseArgument();
4002
+ if (s8 !== peg$FAILED) {
4003
+ peg$savedPos = s0;
4004
+ s0 = peg$f61(s4, s6, s8);
4005
+ } else {
4006
+ peg$currPos = s0;
4007
+ s0 = peg$FAILED;
4008
+ }
4009
+ } else {
4010
+ peg$currPos = s0;
4011
+ s0 = peg$FAILED;
4033
4012
  }
4034
- s6 = peg$parse__();
4035
- peg$savedPos = s0;
4036
- s0 = peg$f61(s4, s5);
4037
4013
  } else {
4038
4014
  peg$currPos = s0;
4039
4015
  s0 = peg$FAILED;
@@ -4050,6 +4026,105 @@ function peg$parse(input, options) {
4050
4026
  peg$currPos = s0;
4051
4027
  s0 = peg$FAILED;
4052
4028
  }
4029
+ if (s0 === peg$FAILED) {
4030
+ s0 = peg$currPos;
4031
+ if (input.charCodeAt(peg$currPos) === 92) {
4032
+ s1 = peg$c12;
4033
+ peg$currPos++;
4034
+ } else {
4035
+ s1 = peg$FAILED;
4036
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
4037
+ }
4038
+ if (s1 !== peg$FAILED) {
4039
+ s2 = peg$currPos;
4040
+ peg$silentFails++;
4041
+ if (input.substr(peg$currPos, 5) === peg$c24) {
4042
+ s3 = peg$c24;
4043
+ peg$currPos += 5;
4044
+ } else {
4045
+ s3 = peg$FAILED;
4046
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
4047
+ }
4048
+ peg$silentFails--;
4049
+ if (s3 === peg$FAILED) {
4050
+ s2 = undefined;
4051
+ } else {
4052
+ peg$currPos = s2;
4053
+ s2 = peg$FAILED;
4054
+ }
4055
+ if (s2 !== peg$FAILED) {
4056
+ s3 = peg$currPos;
4057
+ peg$silentFails++;
4058
+ if (input.substr(peg$currPos, 3) === peg$c25) {
4059
+ s4 = peg$c25;
4060
+ peg$currPos += 3;
4061
+ } else {
4062
+ s4 = peg$FAILED;
4063
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
4064
+ }
4065
+ peg$silentFails--;
4066
+ if (s4 === peg$FAILED) {
4067
+ s3 = undefined;
4068
+ } else {
4069
+ peg$currPos = s3;
4070
+ s3 = peg$FAILED;
4071
+ }
4072
+ if (s3 !== peg$FAILED) {
4073
+ s4 = peg$currPos;
4074
+ s5 = [];
4075
+ if (peg$r19.test(input.charAt(peg$currPos))) {
4076
+ s6 = input.charAt(peg$currPos);
4077
+ peg$currPos++;
4078
+ } else {
4079
+ s6 = peg$FAILED;
4080
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
4081
+ }
4082
+ if (s6 !== peg$FAILED) {
4083
+ while (s6 !== peg$FAILED) {
4084
+ s5.push(s6);
4085
+ if (peg$r19.test(input.charAt(peg$currPos))) {
4086
+ s6 = input.charAt(peg$currPos);
4087
+ peg$currPos++;
4088
+ } else {
4089
+ s6 = peg$FAILED;
4090
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
4091
+ }
4092
+ }
4093
+ } else {
4094
+ s5 = peg$FAILED;
4095
+ }
4096
+ if (s5 !== peg$FAILED) {
4097
+ s4 = input.substring(s4, peg$currPos);
4098
+ } else {
4099
+ s4 = s5;
4100
+ }
4101
+ if (s4 !== peg$FAILED) {
4102
+ s5 = [];
4103
+ s6 = peg$parseOptionalArgument();
4104
+ while (s6 !== peg$FAILED) {
4105
+ s5.push(s6);
4106
+ s6 = peg$parseOptionalArgument();
4107
+ }
4108
+ s6 = peg$parse__();
4109
+ peg$savedPos = s0;
4110
+ s0 = peg$f62(s4, s5);
4111
+ } else {
4112
+ peg$currPos = s0;
4113
+ s0 = peg$FAILED;
4114
+ }
4115
+ } else {
4116
+ peg$currPos = s0;
4117
+ s0 = peg$FAILED;
4118
+ }
4119
+ } else {
4120
+ peg$currPos = s0;
4121
+ s0 = peg$FAILED;
4122
+ }
4123
+ } else {
4124
+ peg$currPos = s0;
4125
+ s0 = peg$FAILED;
4126
+ }
4127
+ }
4053
4128
  }
4054
4129
  }
4055
4130
  }
@@ -4065,11 +4140,11 @@ function peg$parse(input, options) {
4065
4140
 
4066
4141
  s0 = peg$currPos;
4067
4142
  if (input.charCodeAt(peg$currPos) === 91) {
4068
- s1 = peg$c25;
4143
+ s1 = peg$c26;
4069
4144
  peg$currPos++;
4070
4145
  } else {
4071
4146
  s1 = peg$FAILED;
4072
- if (peg$silentFails === 0) { peg$fail(peg$e45); }
4147
+ if (peg$silentFails === 0) { peg$fail(peg$e46); }
4073
4148
  }
4074
4149
  if (s1 !== peg$FAILED) {
4075
4150
  s2 = peg$parse__h();
@@ -4080,7 +4155,7 @@ function peg$parse(input, options) {
4080
4155
  peg$currPos++;
4081
4156
  } else {
4082
4157
  s5 = peg$FAILED;
4083
- if (peg$silentFails === 0) { peg$fail(peg$e46); }
4158
+ if (peg$silentFails === 0) { peg$fail(peg$e47); }
4084
4159
  }
4085
4160
  if (s5 !== peg$FAILED) {
4086
4161
  while (s5 !== peg$FAILED) {
@@ -4090,7 +4165,7 @@ function peg$parse(input, options) {
4090
4165
  peg$currPos++;
4091
4166
  } else {
4092
4167
  s5 = peg$FAILED;
4093
- if (peg$silentFails === 0) { peg$fail(peg$e46); }
4168
+ if (peg$silentFails === 0) { peg$fail(peg$e47); }
4094
4169
  }
4095
4170
  }
4096
4171
  } else {
@@ -4104,15 +4179,15 @@ function peg$parse(input, options) {
4104
4179
  if (s3 !== peg$FAILED) {
4105
4180
  s4 = peg$parse__h();
4106
4181
  if (input.charCodeAt(peg$currPos) === 93) {
4107
- s5 = peg$c26;
4182
+ s5 = peg$c27;
4108
4183
  peg$currPos++;
4109
4184
  } else {
4110
4185
  s5 = peg$FAILED;
4111
- if (peg$silentFails === 0) { peg$fail(peg$e47); }
4186
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
4112
4187
  }
4113
4188
  if (s5 !== peg$FAILED) {
4114
4189
  peg$savedPos = s0;
4115
- s0 = peg$f62(s3);
4190
+ s0 = peg$f63(s3);
4116
4191
  } else {
4117
4192
  peg$currPos = s0;
4118
4193
  s0 = peg$FAILED;
@@ -4139,11 +4214,11 @@ function peg$parse(input, options) {
4139
4214
  peg$currPos++;
4140
4215
  } else {
4141
4216
  s2 = peg$FAILED;
4142
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
4217
+ if (peg$silentFails === 0) { peg$fail(peg$e49); }
4143
4218
  }
4144
4219
  if (s2 !== peg$FAILED) {
4145
4220
  peg$savedPos = s0;
4146
- s0 = peg$f63(s2);
4221
+ s0 = peg$f64(s2);
4147
4222
  } else {
4148
4223
  peg$currPos = s0;
4149
4224
  s0 = peg$FAILED;
@@ -4157,7 +4232,7 @@ function peg$parse(input, options) {
4157
4232
  }
4158
4233
  if (s2 !== peg$FAILED) {
4159
4234
  peg$savedPos = s0;
4160
- s0 = peg$f64(s2);
4235
+ s0 = peg$f65(s2);
4161
4236
  } else {
4162
4237
  peg$currPos = s0;
4163
4238
  s0 = peg$FAILED;
@@ -4177,7 +4252,7 @@ function peg$parse(input, options) {
4177
4252
  peg$currPos++;
4178
4253
  } else {
4179
4254
  s2 = peg$FAILED;
4180
- if (peg$silentFails === 0) { peg$fail(peg$e49); }
4255
+ if (peg$silentFails === 0) { peg$fail(peg$e50); }
4181
4256
  }
4182
4257
  if (s2 !== peg$FAILED) {
4183
4258
  s3 = [];
@@ -4186,7 +4261,7 @@ function peg$parse(input, options) {
4186
4261
  peg$currPos++;
4187
4262
  } else {
4188
4263
  s4 = peg$FAILED;
4189
- if (peg$silentFails === 0) { peg$fail(peg$e50); }
4264
+ if (peg$silentFails === 0) { peg$fail(peg$e51); }
4190
4265
  }
4191
4266
  while (s4 !== peg$FAILED) {
4192
4267
  s3.push(s4);
@@ -4195,7 +4270,7 @@ function peg$parse(input, options) {
4195
4270
  peg$currPos++;
4196
4271
  } else {
4197
4272
  s4 = peg$FAILED;
4198
- if (peg$silentFails === 0) { peg$fail(peg$e50); }
4273
+ if (peg$silentFails === 0) { peg$fail(peg$e51); }
4199
4274
  }
4200
4275
  }
4201
4276
  s2 = [s2, s3];
@@ -4221,7 +4296,7 @@ function peg$parse(input, options) {
4221
4296
  peg$currPos++;
4222
4297
  } else {
4223
4298
  s0 = peg$FAILED;
4224
- if (peg$silentFails === 0) { peg$fail(peg$e51); }
4299
+ if (peg$silentFails === 0) { peg$fail(peg$e52); }
4225
4300
  }
4226
4301
 
4227
4302
  return s0;
@@ -4235,7 +4310,7 @@ function peg$parse(input, options) {
4235
4310
  peg$currPos++;
4236
4311
  } else {
4237
4312
  s0 = peg$FAILED;
4238
- if (peg$silentFails === 0) { peg$fail(peg$e52); }
4313
+ if (peg$silentFails === 0) { peg$fail(peg$e53); }
4239
4314
  }
4240
4315
 
4241
4316
  return s0;
@@ -4247,11 +4322,11 @@ function peg$parse(input, options) {
4247
4322
  s0 = peg$currPos;
4248
4323
  s1 = peg$parse__();
4249
4324
  if (input.charCodeAt(peg$currPos) === 61) {
4250
- s2 = peg$c27;
4325
+ s2 = peg$c28;
4251
4326
  peg$currPos++;
4252
4327
  } else {
4253
4328
  s2 = peg$FAILED;
4254
- if (peg$silentFails === 0) { peg$fail(peg$e53); }
4329
+ if (peg$silentFails === 0) { peg$fail(peg$e54); }
4255
4330
  }
4256
4331
  if (s2 !== peg$FAILED) {
4257
4332
  s3 = peg$parse__();
@@ -4291,11 +4366,11 @@ function peg$parse(input, options) {
4291
4366
  s0 = peg$currPos;
4292
4367
  s1 = peg$parse__();
4293
4368
  if (input.charCodeAt(peg$currPos) === 35) {
4294
- s2 = peg$c28;
4369
+ s2 = peg$c29;
4295
4370
  peg$currPos++;
4296
4371
  } else {
4297
4372
  s2 = peg$FAILED;
4298
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
4373
+ if (peg$silentFails === 0) { peg$fail(peg$e55); }
4299
4374
  }
4300
4375
  if (s2 !== peg$FAILED) {
4301
4376
  s3 = peg$parse__();
@@ -4317,7 +4392,7 @@ function peg$parse(input, options) {
4317
4392
  peg$currPos++;
4318
4393
  } else {
4319
4394
  s0 = peg$FAILED;
4320
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
4395
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
4321
4396
  }
4322
4397
 
4323
4398
  return s0;
@@ -4333,7 +4408,7 @@ function peg$parse(input, options) {
4333
4408
  peg$currPos++;
4334
4409
  } else {
4335
4410
  s1 = peg$FAILED;
4336
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
4411
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
4337
4412
  }
4338
4413
  if (s1 !== peg$FAILED) {
4339
4414
  while (s1 !== peg$FAILED) {
@@ -4343,7 +4418,7 @@ function peg$parse(input, options) {
4343
4418
  peg$currPos++;
4344
4419
  } else {
4345
4420
  s1 = peg$FAILED;
4346
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
4421
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
4347
4422
  }
4348
4423
  }
4349
4424
  } else {
@@ -4352,7 +4427,7 @@ function peg$parse(input, options) {
4352
4427
  peg$silentFails--;
4353
4428
  if (s0 === peg$FAILED) {
4354
4429
  s1 = peg$FAILED;
4355
- if (peg$silentFails === 0) { peg$fail(peg$e56); }
4430
+ if (peg$silentFails === 0) { peg$fail(peg$e57); }
4356
4431
  }
4357
4432
 
4358
4433
  return s0;
@@ -4368,7 +4443,7 @@ function peg$parse(input, options) {
4368
4443
  peg$currPos++;
4369
4444
  } else {
4370
4445
  s1 = peg$FAILED;
4371
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
4446
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
4372
4447
  }
4373
4448
  while (s1 !== peg$FAILED) {
4374
4449
  s0.push(s1);
@@ -4377,12 +4452,12 @@ function peg$parse(input, options) {
4377
4452
  peg$currPos++;
4378
4453
  } else {
4379
4454
  s1 = peg$FAILED;
4380
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
4455
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
4381
4456
  }
4382
4457
  }
4383
4458
  peg$silentFails--;
4384
4459
  s1 = peg$FAILED;
4385
- if (peg$silentFails === 0) { peg$fail(peg$e58); }
4460
+ if (peg$silentFails === 0) { peg$fail(peg$e59); }
4386
4461
 
4387
4462
  return s0;
4388
4463
  }
@@ -4397,7 +4472,7 @@ function peg$parse(input, options) {
4397
4472
  peg$currPos++;
4398
4473
  } else {
4399
4474
  s1 = peg$FAILED;
4400
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
4475
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
4401
4476
  }
4402
4477
  if (s1 !== peg$FAILED) {
4403
4478
  while (s1 !== peg$FAILED) {
@@ -4407,7 +4482,7 @@ function peg$parse(input, options) {
4407
4482
  peg$currPos++;
4408
4483
  } else {
4409
4484
  s1 = peg$FAILED;
4410
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
4485
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
4411
4486
  }
4412
4487
  }
4413
4488
  } else {
@@ -4416,7 +4491,7 @@ function peg$parse(input, options) {
4416
4491
  peg$silentFails--;
4417
4492
  if (s0 === peg$FAILED) {
4418
4493
  s1 = peg$FAILED;
4419
- if (peg$silentFails === 0) { peg$fail(peg$e59); }
4494
+ if (peg$silentFails === 0) { peg$fail(peg$e60); }
4420
4495
  }
4421
4496
 
4422
4497
  return s0;
@@ -4432,7 +4507,7 @@ function peg$parse(input, options) {
4432
4507
  peg$currPos++;
4433
4508
  } else {
4434
4509
  s1 = peg$FAILED;
4435
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
4510
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
4436
4511
  }
4437
4512
  while (s1 !== peg$FAILED) {
4438
4513
  s0.push(s1);
@@ -4441,12 +4516,12 @@ function peg$parse(input, options) {
4441
4516
  peg$currPos++;
4442
4517
  } else {
4443
4518
  s1 = peg$FAILED;
4444
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
4519
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
4445
4520
  }
4446
4521
  }
4447
4522
  peg$silentFails--;
4448
4523
  s1 = peg$FAILED;
4449
- if (peg$silentFails === 0) { peg$fail(peg$e60); }
4524
+ if (peg$silentFails === 0) { peg$fail(peg$e61); }
4450
4525
 
4451
4526
  return s0;
4452
4527
  }
@@ -4461,7 +4536,7 @@ function peg$parse(input, options) {
4461
4536
  peg$currPos++;
4462
4537
  } else {
4463
4538
  s1 = peg$FAILED;
4464
- if (peg$silentFails === 0) { peg$fail(peg$e62); }
4539
+ if (peg$silentFails === 0) { peg$fail(peg$e63); }
4465
4540
  }
4466
4541
  if (s1 !== peg$FAILED) {
4467
4542
  while (s1 !== peg$FAILED) {
@@ -4471,7 +4546,7 @@ function peg$parse(input, options) {
4471
4546
  peg$currPos++;
4472
4547
  } else {
4473
4548
  s1 = peg$FAILED;
4474
- if (peg$silentFails === 0) { peg$fail(peg$e62); }
4549
+ if (peg$silentFails === 0) { peg$fail(peg$e63); }
4475
4550
  }
4476
4551
  }
4477
4552
  } else {
@@ -4480,7 +4555,7 @@ function peg$parse(input, options) {
4480
4555
  peg$silentFails--;
4481
4556
  if (s0 === peg$FAILED) {
4482
4557
  s1 = peg$FAILED;
4483
- if (peg$silentFails === 0) { peg$fail(peg$e61); }
4558
+ if (peg$silentFails === 0) { peg$fail(peg$e62); }
4484
4559
  }
4485
4560
 
4486
4561
  return s0;
@@ -4496,7 +4571,7 @@ function peg$parse(input, options) {
4496
4571
  peg$currPos++;
4497
4572
  } else {
4498
4573
  s1 = peg$FAILED;
4499
- if (peg$silentFails === 0) { peg$fail(peg$e62); }
4574
+ if (peg$silentFails === 0) { peg$fail(peg$e63); }
4500
4575
  }
4501
4576
  while (s1 !== peg$FAILED) {
4502
4577
  s0.push(s1);
@@ -4505,12 +4580,12 @@ function peg$parse(input, options) {
4505
4580
  peg$currPos++;
4506
4581
  } else {
4507
4582
  s1 = peg$FAILED;
4508
- if (peg$silentFails === 0) { peg$fail(peg$e62); }
4583
+ if (peg$silentFails === 0) { peg$fail(peg$e63); }
4509
4584
  }
4510
4585
  }
4511
4586
  peg$silentFails--;
4512
4587
  s1 = peg$FAILED;
4513
- if (peg$silentFails === 0) { peg$fail(peg$e63); }
4588
+ if (peg$silentFails === 0) { peg$fail(peg$e64); }
4514
4589
 
4515
4590
  return s0;
4516
4591
  }
package/index.js CHANGED
@@ -931,14 +931,15 @@ class Parser {
931
931
  }
932
932
  break;
933
933
  case 'href':
934
+ case 'url':
934
935
  node.arguments.required = node.arguments.required.map(a => this.clean(a));
935
936
  return node;
936
- case 'url':
937
- if (arg = this.argument(node, 'Text'))
938
- return this.text(arg);
939
- if (arg = this.argument(node, 'Block'))
940
- return this.clean(arg);
941
- break;
937
+ /*
938
+ case 'url':
939
+ if (arg = this.argument(node, 'Text')) return this.text(arg)
940
+ if (arg = this.argument(node, 'Block')) return this.clean(arg as Node)
941
+ break
942
+ */
942
943
  case 'sl':
943
944
  case 'em':
944
945
  case 'it':
@@ -1122,7 +1123,7 @@ class Parser {
1122
1123
  case 'StringDeclaration':
1123
1124
  break;
1124
1125
  default:
1125
- if (node.kind === 'RegularCommand' && node.command === 'href') {
1126
+ if (node.kind === 'RegularCommand' && (node.command === 'href' || node.command === 'url')) {
1126
1127
  this.convert_href(node);
1127
1128
  }
1128
1129
  else if (node.kind === 'RegularCommand' && node.command === 'par') {
@@ -1432,7 +1433,7 @@ class Parser {
1432
1433
  this.field.text += '<a href="';
1433
1434
  this.convert(node.arguments.required[0]);
1434
1435
  this.field.text += '">';
1435
- this.convert(node.arguments.required[1]);
1436
+ this.convert(node.arguments.required[1] || node.arguments.required[0]);
1436
1437
  this.field.text += '</a>';
1437
1438
  }
1438
1439
  convert_block(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retorquere/bibtex-parser",
3
- "version": "7.0.3",
3
+ "version": "7.0.4",
4
4
  "description": "BibTeX parser",
5
5
  "main": "index.js",
6
6
  "typings": "./index.d.ts",