@retorquere/bibtex-parser 6.1.2 → 6.1.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.
- package/grammar.js +76 -65
- package/package.json +2 -2
package/grammar.js
CHANGED
|
@@ -407,7 +407,7 @@ function peg$parse(input, options) {
|
|
|
407
407
|
kind: 'Text',
|
|
408
408
|
loc: location(),
|
|
409
409
|
source: text(),
|
|
410
|
-
value: (v || '').trim(),
|
|
410
|
+
value: normalizeWhitespace((v || '').trim()),
|
|
411
411
|
mode: 'verbatim',
|
|
412
412
|
})
|
|
413
413
|
};
|
|
@@ -416,7 +416,7 @@ function peg$parse(input, options) {
|
|
|
416
416
|
kind: 'Text',
|
|
417
417
|
loc: location(),
|
|
418
418
|
source: text(),
|
|
419
|
-
value: v.join('').trim(),
|
|
419
|
+
value: normalizeWhitespace(v.join('').trim()),
|
|
420
420
|
mode: 'verbatim',
|
|
421
421
|
})
|
|
422
422
|
};
|
|
@@ -428,6 +428,15 @@ function peg$parse(input, options) {
|
|
|
428
428
|
};
|
|
429
429
|
var peg$f22 = function(v) { return v; };
|
|
430
430
|
var peg$f23 = function(v) {
|
|
431
|
+
return basicTextConversions({
|
|
432
|
+
kind: 'Text',
|
|
433
|
+
loc: location(),
|
|
434
|
+
source: text(),
|
|
435
|
+
value: v.join('').trim(),
|
|
436
|
+
mode: 'verbatim',
|
|
437
|
+
})
|
|
438
|
+
};
|
|
439
|
+
var peg$f24 = function(v) {
|
|
431
440
|
return basicTextConversions({
|
|
432
441
|
kind: 'Text',
|
|
433
442
|
loc: location(),
|
|
@@ -436,7 +445,7 @@ function peg$parse(input, options) {
|
|
|
436
445
|
mode: math.on ? 'math' : 'text',
|
|
437
446
|
})
|
|
438
447
|
};
|
|
439
|
-
var peg$
|
|
448
|
+
var peg$f25 = function(v) {
|
|
440
449
|
return {
|
|
441
450
|
kind: 'Number',
|
|
442
451
|
loc: location(),
|
|
@@ -444,7 +453,7 @@ function peg$parse(input, options) {
|
|
|
444
453
|
value: parseInt(v, 10),
|
|
445
454
|
}
|
|
446
455
|
};
|
|
447
|
-
var peg$
|
|
456
|
+
var peg$f26 = function(v) {
|
|
448
457
|
return {
|
|
449
458
|
kind: 'StringReference',
|
|
450
459
|
loc: location(),
|
|
@@ -452,8 +461,8 @@ function peg$parse(input, options) {
|
|
|
452
461
|
name: v,
|
|
453
462
|
}
|
|
454
463
|
};
|
|
455
|
-
var peg$
|
|
456
|
-
var peg$
|
|
464
|
+
var peg$f27 = function(env, v, cenv) { return env === cenv };
|
|
465
|
+
var peg$f28 = function(env, v, cenv) {
|
|
457
466
|
if (markup[env]) {
|
|
458
467
|
return {
|
|
459
468
|
kind: 'Block',
|
|
@@ -472,7 +481,7 @@ function peg$parse(input, options) {
|
|
|
472
481
|
}
|
|
473
482
|
}
|
|
474
483
|
};
|
|
475
|
-
var peg$
|
|
484
|
+
var peg$f29 = function(mark, char) {
|
|
476
485
|
return {
|
|
477
486
|
kind: 'DiacriticCommand',
|
|
478
487
|
loc: location(),
|
|
@@ -482,7 +491,7 @@ function peg$parse(input, options) {
|
|
|
482
491
|
character: char[1] || char[0],
|
|
483
492
|
}
|
|
484
493
|
};
|
|
485
|
-
var peg$
|
|
494
|
+
var peg$f30 = function(v) {
|
|
486
495
|
return basicTextConversions({
|
|
487
496
|
kind: 'Text',
|
|
488
497
|
loc: location(),
|
|
@@ -491,7 +500,7 @@ function peg$parse(input, options) {
|
|
|
491
500
|
mode: 'verbatim',
|
|
492
501
|
})
|
|
493
502
|
};
|
|
494
|
-
var peg$
|
|
503
|
+
var peg$f31 = function(v) {
|
|
495
504
|
const block = {
|
|
496
505
|
kind: 'Block',
|
|
497
506
|
loc: location(),
|
|
@@ -525,10 +534,10 @@ function peg$parse(input, options) {
|
|
|
525
534
|
|
|
526
535
|
return handle_markup_switches(block)
|
|
527
536
|
};
|
|
528
|
-
var peg$
|
|
529
|
-
var peg$
|
|
530
|
-
var peg$
|
|
531
|
-
var peg$
|
|
537
|
+
var peg$f32 = function() { return !math.on };
|
|
538
|
+
var peg$f33 = function(mode) { return math.set(true) };
|
|
539
|
+
var peg$f34 = function(mode, v) { return math.set(false) };
|
|
540
|
+
var peg$f35 = function(mode, v) {
|
|
532
541
|
return {
|
|
533
542
|
kind: mode == '$$' ? 'DisplayMath' : 'InlineMath',
|
|
534
543
|
loc: location(),
|
|
@@ -538,7 +547,7 @@ function peg$parse(input, options) {
|
|
|
538
547
|
markup: {},
|
|
539
548
|
}
|
|
540
549
|
};
|
|
541
|
-
var peg$
|
|
550
|
+
var peg$f36 = function(v) {
|
|
542
551
|
return {
|
|
543
552
|
kind: 'LineComment',
|
|
544
553
|
loc: location(),
|
|
@@ -546,7 +555,7 @@ function peg$parse(input, options) {
|
|
|
546
555
|
value: v,
|
|
547
556
|
}
|
|
548
557
|
};
|
|
549
|
-
var peg$
|
|
558
|
+
var peg$f37 = function(mode, v) {
|
|
550
559
|
if (v.kind === 'Block') v = v.value
|
|
551
560
|
|
|
552
561
|
return {
|
|
@@ -556,7 +565,7 @@ function peg$parse(input, options) {
|
|
|
556
565
|
value: v,
|
|
557
566
|
}
|
|
558
567
|
};
|
|
559
|
-
var peg$
|
|
568
|
+
var peg$f38 = function(mark, v) {
|
|
560
569
|
return {
|
|
561
570
|
kind: 'RegularCommand',
|
|
562
571
|
loc: location(),
|
|
@@ -568,7 +577,7 @@ function peg$parse(input, options) {
|
|
|
568
577
|
},
|
|
569
578
|
}
|
|
570
579
|
};
|
|
571
|
-
var peg$
|
|
580
|
+
var peg$f39 = function(v) {
|
|
572
581
|
return {
|
|
573
582
|
kind: 'SymbolCommand',
|
|
574
583
|
loc: location(),
|
|
@@ -576,8 +585,8 @@ function peg$parse(input, options) {
|
|
|
576
585
|
command: v,
|
|
577
586
|
}
|
|
578
587
|
};
|
|
579
|
-
var peg$
|
|
580
|
-
var peg$
|
|
588
|
+
var peg$f40 = function(cmd, name) { return name.value.length == 1 && name.value[0].kind === 'RegularCommand' };
|
|
589
|
+
var peg$f41 = function(cmd, name, optional, def) {
|
|
581
590
|
return {
|
|
582
591
|
kind: 'RegularCommand',
|
|
583
592
|
loc: location(),
|
|
@@ -589,7 +598,7 @@ function peg$parse(input, options) {
|
|
|
589
598
|
},
|
|
590
599
|
}
|
|
591
600
|
};
|
|
592
|
-
var peg$
|
|
601
|
+
var peg$f42 = function(cmd, url, label) {
|
|
593
602
|
return {
|
|
594
603
|
kind: 'RegularCommand',
|
|
595
604
|
loc: location(),
|
|
@@ -601,8 +610,8 @@ function peg$parse(input, options) {
|
|
|
601
610
|
},
|
|
602
611
|
}
|
|
603
612
|
};
|
|
604
|
-
var peg$
|
|
605
|
-
var peg$
|
|
613
|
+
var peg$f43 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 2) };
|
|
614
|
+
var peg$f44 = function(cmd, optional, req1, req2) {
|
|
606
615
|
return {
|
|
607
616
|
kind: 'RegularCommand',
|
|
608
617
|
loc: location(),
|
|
@@ -614,8 +623,8 @@ function peg$parse(input, options) {
|
|
|
614
623
|
},
|
|
615
624
|
}
|
|
616
625
|
};
|
|
617
|
-
var peg$
|
|
618
|
-
var peg$
|
|
626
|
+
var peg$f45 = function(cmd) { return verbatimCommands.includes(cmd) && (has_arguments[cmd] === 1) };
|
|
627
|
+
var peg$f46 = function(cmd, optional, req) {
|
|
619
628
|
return {
|
|
620
629
|
kind: 'RegularCommand',
|
|
621
630
|
loc: location(),
|
|
@@ -627,8 +636,8 @@ function peg$parse(input, options) {
|
|
|
627
636
|
},
|
|
628
637
|
}
|
|
629
638
|
};
|
|
630
|
-
var peg$
|
|
631
|
-
var peg$
|
|
639
|
+
var peg$f47 = function(cmd) { return (has_arguments[cmd] === 2) };
|
|
640
|
+
var peg$f48 = function(cmd, optional, req1, req2) {
|
|
632
641
|
return {
|
|
633
642
|
kind: 'RegularCommand',
|
|
634
643
|
loc: location(),
|
|
@@ -640,8 +649,8 @@ function peg$parse(input, options) {
|
|
|
640
649
|
},
|
|
641
650
|
}
|
|
642
651
|
};
|
|
643
|
-
var peg$
|
|
644
|
-
var peg$
|
|
652
|
+
var peg$f49 = function(cmd) { return (has_arguments[cmd] === 1) };
|
|
653
|
+
var peg$f50 = function(cmd, optional, req) {
|
|
645
654
|
let m
|
|
646
655
|
if (req.kind === 'Block') {
|
|
647
656
|
switch (cmd) {
|
|
@@ -691,7 +700,7 @@ function peg$parse(input, options) {
|
|
|
691
700
|
}
|
|
692
701
|
}
|
|
693
702
|
};
|
|
694
|
-
var peg$
|
|
703
|
+
var peg$f51 = function(cmd, optional) {
|
|
695
704
|
return {
|
|
696
705
|
kind: 'RegularCommand',
|
|
697
706
|
loc: location(),
|
|
@@ -703,7 +712,7 @@ function peg$parse(input, options) {
|
|
|
703
712
|
}
|
|
704
713
|
}
|
|
705
714
|
};
|
|
706
|
-
var peg$
|
|
715
|
+
var peg$f52 = function(v) {
|
|
707
716
|
return basicTextConversions({
|
|
708
717
|
kind: 'Text', // this isn't really correct but I don't need these right now
|
|
709
718
|
loc: location(),
|
|
@@ -712,7 +721,7 @@ function peg$parse(input, options) {
|
|
|
712
721
|
mode: math.on ? 'math' : 'text',
|
|
713
722
|
})
|
|
714
723
|
};
|
|
715
|
-
var peg$
|
|
724
|
+
var peg$f53 = function(v) {
|
|
716
725
|
return basicTextConversions({
|
|
717
726
|
kind: 'Text',
|
|
718
727
|
loc: location(),
|
|
@@ -2034,7 +2043,7 @@ function peg$parse(input, options) {
|
|
|
2034
2043
|
s5 = null;
|
|
2035
2044
|
}
|
|
2036
2045
|
peg$savedPos = s0;
|
|
2037
|
-
s0 = peg$
|
|
2046
|
+
s0 = peg$f23(s3);
|
|
2038
2047
|
} else {
|
|
2039
2048
|
peg$currPos = s0;
|
|
2040
2049
|
s0 = peg$FAILED;
|
|
@@ -2178,7 +2187,7 @@ function peg$parse(input, options) {
|
|
|
2178
2187
|
}
|
|
2179
2188
|
if (s1 !== peg$FAILED) {
|
|
2180
2189
|
peg$savedPos = s0;
|
|
2181
|
-
s1 = peg$
|
|
2190
|
+
s1 = peg$f24(s1);
|
|
2182
2191
|
}
|
|
2183
2192
|
s0 = s1;
|
|
2184
2193
|
|
|
@@ -2213,7 +2222,7 @@ function peg$parse(input, options) {
|
|
|
2213
2222
|
}
|
|
2214
2223
|
if (s1 !== peg$FAILED) {
|
|
2215
2224
|
peg$savedPos = s0;
|
|
2216
|
-
s1 = peg$
|
|
2225
|
+
s1 = peg$f24(s1);
|
|
2217
2226
|
}
|
|
2218
2227
|
s0 = s1;
|
|
2219
2228
|
|
|
@@ -2254,7 +2263,7 @@ function peg$parse(input, options) {
|
|
|
2254
2263
|
}
|
|
2255
2264
|
if (s1 !== peg$FAILED) {
|
|
2256
2265
|
peg$savedPos = s0;
|
|
2257
|
-
s1 = peg$
|
|
2266
|
+
s1 = peg$f25(s1);
|
|
2258
2267
|
}
|
|
2259
2268
|
s0 = s1;
|
|
2260
2269
|
|
|
@@ -2268,7 +2277,7 @@ function peg$parse(input, options) {
|
|
|
2268
2277
|
s1 = peg$parseVariableName();
|
|
2269
2278
|
if (s1 !== peg$FAILED) {
|
|
2270
2279
|
peg$savedPos = s0;
|
|
2271
|
-
s1 = peg$
|
|
2280
|
+
s1 = peg$f26(s1);
|
|
2272
2281
|
}
|
|
2273
2282
|
s0 = s1;
|
|
2274
2283
|
|
|
@@ -2400,7 +2409,7 @@ function peg$parse(input, options) {
|
|
|
2400
2409
|
}
|
|
2401
2410
|
if (s7 !== peg$FAILED) {
|
|
2402
2411
|
peg$savedPos = peg$currPos;
|
|
2403
|
-
s8 = peg$
|
|
2412
|
+
s8 = peg$f27(s2, s4, s6);
|
|
2404
2413
|
if (s8) {
|
|
2405
2414
|
s8 = undefined;
|
|
2406
2415
|
} else {
|
|
@@ -2408,7 +2417,7 @@ function peg$parse(input, options) {
|
|
|
2408
2417
|
}
|
|
2409
2418
|
if (s8 !== peg$FAILED) {
|
|
2410
2419
|
peg$savedPos = s0;
|
|
2411
|
-
s0 = peg$
|
|
2420
|
+
s0 = peg$f28(s2, s4, s6);
|
|
2412
2421
|
} else {
|
|
2413
2422
|
peg$currPos = s0;
|
|
2414
2423
|
s0 = peg$FAILED;
|
|
@@ -2502,7 +2511,7 @@ function peg$parse(input, options) {
|
|
|
2502
2511
|
}
|
|
2503
2512
|
if (s5 !== peg$FAILED) {
|
|
2504
2513
|
peg$savedPos = s0;
|
|
2505
|
-
s0 = peg$
|
|
2514
|
+
s0 = peg$f29(s2, s4);
|
|
2506
2515
|
} else {
|
|
2507
2516
|
peg$currPos = s0;
|
|
2508
2517
|
s0 = peg$FAILED;
|
|
@@ -2561,7 +2570,7 @@ function peg$parse(input, options) {
|
|
|
2561
2570
|
}
|
|
2562
2571
|
if (s4 !== peg$FAILED) {
|
|
2563
2572
|
peg$savedPos = s0;
|
|
2564
|
-
s0 = peg$
|
|
2573
|
+
s0 = peg$f30(s3);
|
|
2565
2574
|
} else {
|
|
2566
2575
|
peg$currPos = s0;
|
|
2567
2576
|
s0 = peg$FAILED;
|
|
@@ -2623,7 +2632,7 @@ function peg$parse(input, options) {
|
|
|
2623
2632
|
}
|
|
2624
2633
|
if (s3 !== peg$FAILED) {
|
|
2625
2634
|
peg$savedPos = s0;
|
|
2626
|
-
s0 = peg$
|
|
2635
|
+
s0 = peg$f31(s2);
|
|
2627
2636
|
} else {
|
|
2628
2637
|
peg$currPos = s0;
|
|
2629
2638
|
s0 = peg$FAILED;
|
|
@@ -2643,7 +2652,7 @@ function peg$parse(input, options) {
|
|
|
2643
2652
|
|
|
2644
2653
|
s0 = peg$currPos;
|
|
2645
2654
|
peg$savedPos = peg$currPos;
|
|
2646
|
-
s1 = peg$
|
|
2655
|
+
s1 = peg$f32();
|
|
2647
2656
|
if (s1) {
|
|
2648
2657
|
s1 = undefined;
|
|
2649
2658
|
} else {
|
|
@@ -2677,7 +2686,7 @@ function peg$parse(input, options) {
|
|
|
2677
2686
|
}
|
|
2678
2687
|
if (s2 !== peg$FAILED) {
|
|
2679
2688
|
peg$savedPos = peg$currPos;
|
|
2680
|
-
s3 = peg$
|
|
2689
|
+
s3 = peg$f33(s2);
|
|
2681
2690
|
if (s3) {
|
|
2682
2691
|
s3 = undefined;
|
|
2683
2692
|
} else {
|
|
@@ -2729,7 +2738,7 @@ function peg$parse(input, options) {
|
|
|
2729
2738
|
}
|
|
2730
2739
|
if (s5 !== peg$FAILED) {
|
|
2731
2740
|
peg$savedPos = peg$currPos;
|
|
2732
|
-
s6 = peg$
|
|
2741
|
+
s6 = peg$f34(s2, s4);
|
|
2733
2742
|
if (s6) {
|
|
2734
2743
|
s6 = undefined;
|
|
2735
2744
|
} else {
|
|
@@ -2737,7 +2746,7 @@ function peg$parse(input, options) {
|
|
|
2737
2746
|
}
|
|
2738
2747
|
if (s6 !== peg$FAILED) {
|
|
2739
2748
|
peg$savedPos = s0;
|
|
2740
|
-
s0 = peg$
|
|
2749
|
+
s0 = peg$f35(s2, s4);
|
|
2741
2750
|
} else {
|
|
2742
2751
|
peg$currPos = s0;
|
|
2743
2752
|
s0 = peg$FAILED;
|
|
@@ -2816,7 +2825,7 @@ function peg$parse(input, options) {
|
|
|
2816
2825
|
}
|
|
2817
2826
|
if (s4 !== peg$FAILED) {
|
|
2818
2827
|
peg$savedPos = s0;
|
|
2819
|
-
s0 = peg$
|
|
2828
|
+
s0 = peg$f36(s3);
|
|
2820
2829
|
} else {
|
|
2821
2830
|
peg$currPos = s0;
|
|
2822
2831
|
s0 = peg$FAILED;
|
|
@@ -2866,7 +2875,7 @@ function peg$parse(input, options) {
|
|
|
2866
2875
|
s3 = peg$parseArgument();
|
|
2867
2876
|
if (s3 !== peg$FAILED) {
|
|
2868
2877
|
peg$savedPos = s0;
|
|
2869
|
-
s0 = peg$
|
|
2878
|
+
s0 = peg$f37(s1, s3);
|
|
2870
2879
|
} else {
|
|
2871
2880
|
peg$currPos = s0;
|
|
2872
2881
|
s0 = peg$FAILED;
|
|
@@ -2932,7 +2941,7 @@ function peg$parse(input, options) {
|
|
|
2932
2941
|
}
|
|
2933
2942
|
if (s4 !== peg$FAILED) {
|
|
2934
2943
|
peg$savedPos = s0;
|
|
2935
|
-
s0 = peg$
|
|
2944
|
+
s0 = peg$f29(s2, s4);
|
|
2936
2945
|
} else {
|
|
2937
2946
|
peg$currPos = s0;
|
|
2938
2947
|
s0 = peg$FAILED;
|
|
@@ -3011,7 +3020,7 @@ function peg$parse(input, options) {
|
|
|
3011
3020
|
}
|
|
3012
3021
|
if (s5 !== peg$FAILED) {
|
|
3013
3022
|
peg$savedPos = s0;
|
|
3014
|
-
s0 = peg$
|
|
3023
|
+
s0 = peg$f29(s2, s4);
|
|
3015
3024
|
} else {
|
|
3016
3025
|
peg$currPos = s0;
|
|
3017
3026
|
s0 = peg$FAILED;
|
|
@@ -3064,7 +3073,7 @@ function peg$parse(input, options) {
|
|
|
3064
3073
|
s4 = peg$parseRegularValue();
|
|
3065
3074
|
if (s4 !== peg$FAILED) {
|
|
3066
3075
|
peg$savedPos = s0;
|
|
3067
|
-
s0 = peg$
|
|
3076
|
+
s0 = peg$f38(s2, s4);
|
|
3068
3077
|
} else {
|
|
3069
3078
|
peg$currPos = s0;
|
|
3070
3079
|
s0 = peg$FAILED;
|
|
@@ -3114,7 +3123,7 @@ function peg$parse(input, options) {
|
|
|
3114
3123
|
}
|
|
3115
3124
|
if (s2 !== peg$FAILED) {
|
|
3116
3125
|
peg$savedPos = s0;
|
|
3117
|
-
s0 = peg$
|
|
3126
|
+
s0 = peg$f39(s2);
|
|
3118
3127
|
} else {
|
|
3119
3128
|
peg$currPos = s0;
|
|
3120
3129
|
s0 = peg$FAILED;
|
|
@@ -3150,7 +3159,7 @@ function peg$parse(input, options) {
|
|
|
3150
3159
|
s3 = peg$parseBlock();
|
|
3151
3160
|
if (s3 !== peg$FAILED) {
|
|
3152
3161
|
peg$savedPos = peg$currPos;
|
|
3153
|
-
s4 = peg$
|
|
3162
|
+
s4 = peg$f40(s2, s3);
|
|
3154
3163
|
if (s4) {
|
|
3155
3164
|
s4 = undefined;
|
|
3156
3165
|
} else {
|
|
@@ -3166,7 +3175,7 @@ function peg$parse(input, options) {
|
|
|
3166
3175
|
s6 = peg$parseArgument();
|
|
3167
3176
|
if (s6 !== peg$FAILED) {
|
|
3168
3177
|
peg$savedPos = s0;
|
|
3169
|
-
s0 = peg$
|
|
3178
|
+
s0 = peg$f41(s2, s3, s5, s6);
|
|
3170
3179
|
} else {
|
|
3171
3180
|
peg$currPos = s0;
|
|
3172
3181
|
s0 = peg$FAILED;
|
|
@@ -3228,7 +3237,7 @@ function peg$parse(input, options) {
|
|
|
3228
3237
|
s6 = peg$parseArgument();
|
|
3229
3238
|
if (s6 !== peg$FAILED) {
|
|
3230
3239
|
peg$savedPos = s0;
|
|
3231
|
-
s0 = peg$
|
|
3240
|
+
s0 = peg$f42(s2, s5, s6);
|
|
3232
3241
|
} else {
|
|
3233
3242
|
peg$currPos = s0;
|
|
3234
3243
|
s0 = peg$FAILED;
|
|
@@ -3323,7 +3332,7 @@ function peg$parse(input, options) {
|
|
|
3323
3332
|
}
|
|
3324
3333
|
if (s4 !== peg$FAILED) {
|
|
3325
3334
|
peg$savedPos = peg$currPos;
|
|
3326
|
-
s5 = peg$
|
|
3335
|
+
s5 = peg$f43(s4);
|
|
3327
3336
|
if (s5) {
|
|
3328
3337
|
s5 = undefined;
|
|
3329
3338
|
} else {
|
|
@@ -3359,7 +3368,7 @@ function peg$parse(input, options) {
|
|
|
3359
3368
|
s10 = peg$parseVerbatimFieldValue();
|
|
3360
3369
|
if (s10 !== peg$FAILED) {
|
|
3361
3370
|
peg$savedPos = s0;
|
|
3362
|
-
s0 = peg$
|
|
3371
|
+
s0 = peg$f44(s4, s6, s9, s10);
|
|
3363
3372
|
} else {
|
|
3364
3373
|
peg$currPos = s0;
|
|
3365
3374
|
s0 = peg$FAILED;
|
|
@@ -3466,7 +3475,7 @@ function peg$parse(input, options) {
|
|
|
3466
3475
|
}
|
|
3467
3476
|
if (s4 !== peg$FAILED) {
|
|
3468
3477
|
peg$savedPos = peg$currPos;
|
|
3469
|
-
s5 = peg$
|
|
3478
|
+
s5 = peg$f45(s4);
|
|
3470
3479
|
if (s5) {
|
|
3471
3480
|
s5 = undefined;
|
|
3472
3481
|
} else {
|
|
@@ -3500,7 +3509,7 @@ function peg$parse(input, options) {
|
|
|
3500
3509
|
s9 = peg$parseVerbatimFieldValue();
|
|
3501
3510
|
if (s9 !== peg$FAILED) {
|
|
3502
3511
|
peg$savedPos = s0;
|
|
3503
|
-
s0 = peg$
|
|
3512
|
+
s0 = peg$f46(s4, s6, s9);
|
|
3504
3513
|
} else {
|
|
3505
3514
|
peg$currPos = s0;
|
|
3506
3515
|
s0 = peg$FAILED;
|
|
@@ -3603,7 +3612,7 @@ function peg$parse(input, options) {
|
|
|
3603
3612
|
}
|
|
3604
3613
|
if (s4 !== peg$FAILED) {
|
|
3605
3614
|
peg$savedPos = peg$currPos;
|
|
3606
|
-
s5 = peg$
|
|
3615
|
+
s5 = peg$f47(s4);
|
|
3607
3616
|
if (s5) {
|
|
3608
3617
|
s5 = undefined;
|
|
3609
3618
|
} else {
|
|
@@ -3622,7 +3631,7 @@ function peg$parse(input, options) {
|
|
|
3622
3631
|
s9 = peg$parseArgument();
|
|
3623
3632
|
if (s9 !== peg$FAILED) {
|
|
3624
3633
|
peg$savedPos = s0;
|
|
3625
|
-
s0 = peg$
|
|
3634
|
+
s0 = peg$f48(s4, s6, s8, s9);
|
|
3626
3635
|
} else {
|
|
3627
3636
|
peg$currPos = s0;
|
|
3628
3637
|
s0 = peg$FAILED;
|
|
@@ -3725,7 +3734,7 @@ function peg$parse(input, options) {
|
|
|
3725
3734
|
}
|
|
3726
3735
|
if (s4 !== peg$FAILED) {
|
|
3727
3736
|
peg$savedPos = peg$currPos;
|
|
3728
|
-
s5 = peg$
|
|
3737
|
+
s5 = peg$f49(s4);
|
|
3729
3738
|
if (s5) {
|
|
3730
3739
|
s5 = undefined;
|
|
3731
3740
|
} else {
|
|
@@ -3742,7 +3751,7 @@ function peg$parse(input, options) {
|
|
|
3742
3751
|
s8 = peg$parseArgument();
|
|
3743
3752
|
if (s8 !== peg$FAILED) {
|
|
3744
3753
|
peg$savedPos = s0;
|
|
3745
|
-
s0 = peg$
|
|
3754
|
+
s0 = peg$f50(s4, s6, s8);
|
|
3746
3755
|
} else {
|
|
3747
3756
|
peg$currPos = s0;
|
|
3748
3757
|
s0 = peg$FAILED;
|
|
@@ -3848,7 +3857,7 @@ function peg$parse(input, options) {
|
|
|
3848
3857
|
}
|
|
3849
3858
|
s6 = peg$parse__();
|
|
3850
3859
|
peg$savedPos = s0;
|
|
3851
|
-
s0 = peg$
|
|
3860
|
+
s0 = peg$f51(s4, s5);
|
|
3852
3861
|
} else {
|
|
3853
3862
|
peg$currPos = s0;
|
|
3854
3863
|
s0 = peg$FAILED;
|
|
@@ -3927,7 +3936,7 @@ function peg$parse(input, options) {
|
|
|
3927
3936
|
}
|
|
3928
3937
|
if (s5 !== peg$FAILED) {
|
|
3929
3938
|
peg$savedPos = s0;
|
|
3930
|
-
s0 = peg$
|
|
3939
|
+
s0 = peg$f52(s3);
|
|
3931
3940
|
} else {
|
|
3932
3941
|
peg$currPos = s0;
|
|
3933
3942
|
s0 = peg$FAILED;
|
|
@@ -3958,7 +3967,7 @@ function peg$parse(input, options) {
|
|
|
3958
3967
|
}
|
|
3959
3968
|
if (s2 !== peg$FAILED) {
|
|
3960
3969
|
peg$savedPos = s0;
|
|
3961
|
-
s0 = peg$
|
|
3970
|
+
s0 = peg$f53(s2);
|
|
3962
3971
|
} else {
|
|
3963
3972
|
peg$currPos = s0;
|
|
3964
3973
|
s0 = peg$FAILED;
|
|
@@ -4394,6 +4403,8 @@ function peg$parse(input, options) {
|
|
|
4394
4403
|
}
|
|
4395
4404
|
|
|
4396
4405
|
function normalizeWhitespace(textArr) {
|
|
4406
|
+
if (typeof textArr === 'string') textArr = Array.from(textArr)
|
|
4407
|
+
|
|
4397
4408
|
return textArr.reduce((prev, curr) => {
|
|
4398
4409
|
if (/\s/.test(curr)) {
|
|
4399
4410
|
if (/\s/.test(prev[prev.length - 1])) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retorquere/bibtex-parser",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
4
4
|
"description": "BibTeX parser",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"start": "tsc -d",
|
|
10
10
|
"poststart": "npm run docs",
|
|
11
11
|
"pretest": "npm start",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "tap test/tap --no-timeout --no-coverage",
|
|
13
13
|
"snap": "npm test --snapshot",
|
|
14
14
|
"snap:big": "npm test --snapshot --big",
|
|
15
15
|
"minitest": "peggy grammar.peggy && tsc -d && node i.js",
|