bibtex-ruby 2.0.3 → 2.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 (52) hide show
  1. data/Gemfile.lock +2 -2
  2. data/History.txt +7 -0
  3. data/Manifest +3 -37
  4. data/Rakefile +1 -1
  5. data/features/issues/multiline_strings.feature +14 -0
  6. data/lib/bibtex/bibtex.y +9 -6
  7. data/lib/bibtex/filters.rb +5 -3
  8. data/lib/bibtex/filters/latex.rb +1 -1
  9. data/lib/bibtex/filters/linebreaks.rb +11 -0
  10. data/lib/bibtex/lexer.rb +254 -236
  11. data/lib/bibtex/parser.rb +9 -6
  12. data/lib/bibtex/version.rb +1 -1
  13. data/test/benchmark.rb +4 -1
  14. data/test/bibtex/test_lexer.rb +12 -2
  15. data/test/bibtex/test_parser.rb +21 -0
  16. metadata +14 -48
  17. data/Rakefile.compiled.rbc +0 -1994
  18. data/features/step_definitions/bibtex_steps.rbc +0 -2996
  19. data/features/step_definitions/name_steps.rbc +0 -544
  20. data/features/support/env.rbc +0 -144
  21. data/lib/bibtex.rbc +0 -725
  22. data/lib/bibtex/bibliography.rbc +0 -6729
  23. data/lib/bibtex/compatibility.rbc +0 -290
  24. data/lib/bibtex/elements.rbc +0 -5966
  25. data/lib/bibtex/entry.rbc +0 -11305
  26. data/lib/bibtex/error.rbc +0 -1000
  27. data/lib/bibtex/extensions.rbc +0 -127
  28. data/lib/bibtex/filters.rbc +0 -1178
  29. data/lib/bibtex/filters/latex.rbc +0 -361
  30. data/lib/bibtex/lexer.rbc +0 -5559
  31. data/lib/bibtex/name_parser.rbc +0 -2510
  32. data/lib/bibtex/names.rbc +0 -4710
  33. data/lib/bibtex/parser.rbc +0 -3336
  34. data/lib/bibtex/replaceable.rbc +0 -593
  35. data/lib/bibtex/utilities.rbc +0 -743
  36. data/lib/bibtex/value.rbc +0 -4291
  37. data/lib/bibtex/version.rbc +0 -209
  38. data/test/bibtex/test_bibliography.rbc +0 -4268
  39. data/test/bibtex/test_elements.rbc +0 -1554
  40. data/test/bibtex/test_entry.rbc +0 -11767
  41. data/test/bibtex/test_filters.rbc +0 -1017
  42. data/test/bibtex/test_lexer.rbc +0 -373
  43. data/test/bibtex/test_name_parser.rbc +0 -608
  44. data/test/bibtex/test_names.rbc +0 -797
  45. data/test/bibtex/test_parser.rbc +0 -2819
  46. data/test/bibtex/test_string.rbc +0 -706
  47. data/test/bibtex/test_utilities.rbc +0 -851
  48. data/test/bibtex/test_value.rbc +0 -4993
  49. data/test/helper.rbc +0 -430
  50. data/test/profile.dot +0 -191
  51. data/test/test_bibtex.rbc +0 -1785
  52. data/test/test_export.rbc +0 -908
@@ -1,2510 +0,0 @@
1
- !RBIX
2
- 16846133056282117387
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 46
13
- 5
14
- 7
15
- 0
16
- 64
17
- 47
18
- 49
19
- 1
20
- 1
21
- 15
22
- 5
23
- 7
24
- 2
25
- 64
26
- 47
27
- 49
28
- 1
29
- 1
30
- 15
31
- 99
32
- 7
33
- 3
34
- 65
35
- 49
36
- 4
37
- 2
38
- 13
39
- 99
40
- 12
41
- 7
42
- 5
43
- 12
44
- 7
45
- 6
46
- 12
47
- 65
48
- 12
49
- 49
50
- 7
51
- 4
52
- 15
53
- 49
54
- 5
55
- 0
56
- 15
57
- 2
58
- 11
59
- I
60
- 6
61
- I
62
- 0
63
- I
64
- 0
65
- I
66
- 0
67
- n
68
- p
69
- 8
70
- s
71
- 14
72
- racc/parser.rb
73
- x
74
- 7
75
- require
76
- s
77
- 7
78
- strscan
79
- x
80
- 6
81
- BibTeX
82
- x
83
- 11
84
- open_module
85
- x
86
- 15
87
- __module_init__
88
- M
89
- 1
90
- n
91
- n
92
- x
93
- 6
94
- BibTeX
95
- i
96
- 33
97
- 5
98
- 66
99
- 99
100
- 7
101
- 0
102
- 45
103
- 1
104
- 2
105
- 43
106
- 3
107
- 65
108
- 49
109
- 4
110
- 3
111
- 13
112
- 99
113
- 12
114
- 7
115
- 5
116
- 12
117
- 7
118
- 6
119
- 12
120
- 65
121
- 12
122
- 49
123
- 7
124
- 4
125
- 15
126
- 49
127
- 5
128
- 0
129
- 11
130
- I
131
- 6
132
- I
133
- 0
134
- I
135
- 0
136
- I
137
- 0
138
- n
139
- p
140
- 8
141
- x
142
- 10
143
- NameParser
144
- x
145
- 4
146
- Racc
147
- n
148
- x
149
- 6
150
- Parser
151
- x
152
- 10
153
- open_class
154
- x
155
- 14
156
- __class_init__
157
- M
158
- 1
159
- n
160
- n
161
- x
162
- 10
163
- NameParser
164
- i
165
- 1153
166
- 5
167
- 66
168
- 5
169
- 7
170
- 0
171
- 64
172
- 7
173
- 1
174
- 64
175
- 4
176
- 94
177
- 47
178
- 49
179
- 2
180
- 3
181
- 15
182
- 7
183
- 3
184
- 7
185
- 4
186
- 7
187
- 3
188
- 7
189
- 5
190
- 4
191
- 27
192
- 7
193
- 6
194
- 7
195
- 3
196
- 7
197
- 4
198
- 7
199
- 4
200
- 7
201
- 5
202
- 7
203
- 3
204
- 7
205
- 6
206
- 4
207
- 36
208
- 4
209
- 24
210
- 7
211
- 4
212
- 4
213
- 34
214
- 4
215
- 33
216
- 4
217
- 35
218
- 4
219
- 21
220
- 4
221
- 19
222
- 4
223
- 22
224
- 4
225
- 10
226
- 4
227
- 16
228
- 4
229
- 11
230
- 4
231
- 34
232
- 4
233
- 33
234
- 4
235
- 35
236
- 4
237
- 34
238
- 4
239
- 33
240
- 4
241
- 35
242
- 4
243
- 10
244
- 4
245
- 8
246
- 4
247
- 11
248
- 4
249
- 21
250
- 4
251
- 28
252
- 4
253
- 22
254
- 4
255
- 34
256
- 4
257
- 33
258
- 4
259
- 35
260
- 4
261
- 34
262
- 4
263
- 33
264
- 4
265
- 35
266
- 4
267
- 10
268
- 4
269
- 8
270
- 4
271
- 11
272
- 4
273
- 21
274
- 4
275
- 19
276
- 4
277
- 22
278
- 4
279
- 38
280
- 4
281
- 23
282
- 4
283
- 13
284
- 4
285
- 12
286
- 35
287
- 52
288
- 19
289
- 0
290
- 15
291
- 4
292
- 19
293
- 4
294
- 16
295
- 4
296
- 19
297
- 4
298
- 11
299
- 4
300
- 18
301
- 4
302
- 10
303
- 4
304
- 19
305
- 4
306
- 16
307
- 4
308
- 8
309
- 4
310
- 11
311
- 4
312
- 8
313
- 4
314
- 10
315
- 4
316
- 26
317
- 4
318
- 12
319
- 4
320
- 8
321
- 4
322
- 32
323
- 4
324
- 32
325
- 4
326
- 32
327
- 4
328
- 6
329
- 4
330
- 6
331
- 4
332
- 6
333
- 4
334
- 5
335
- 4
336
- 5
337
- 4
338
- 5
339
- 4
340
- 36
341
- 4
342
- 36
343
- 4
344
- 36
345
- 4
346
- 27
347
- 4
348
- 27
349
- 4
350
- 27
351
- 4
352
- 13
353
- 4
354
- 13
355
- 4
356
- 13
357
- 4
358
- 20
359
- 4
360
- 20
361
- 4
362
- 20
363
- 4
364
- 38
365
- 4
366
- 38
367
- 4
368
- 38
369
- 4
370
- 23
371
- 4
372
- 23
373
- 4
374
- 23
375
- 78
376
- 78
377
- 78
378
- 4
379
- 15
380
- 4
381
- 15
382
- 4
383
- 15
384
- 4
385
- 30
386
- 4
387
- 7
388
- 80
389
- 79
390
- 35
391
- 52
392
- 19
393
- 1
394
- 15
395
- 4
396
- 39
397
- 4
398
- 51
399
- 4
400
- 44
401
- 1
402
- 1
403
- 4
404
- 18
405
- 4
406
- 15
407
- 4
408
- 47
409
- 4
410
- 8
411
- 1
412
- 4
413
- 5
414
- 4
415
- 3
416
- 4
417
- 13
418
- 4
419
- 27
420
- 1
421
- 4
422
- 42
423
- 79
424
- 1
425
- 80
426
- 78
427
- 4
428
- 30
429
- 1
430
- 1
431
- 4
432
- 36
433
- 1
434
- 1
435
- 4
436
- 10
437
- 4
438
- 24
439
- 1
440
- 1
441
- 4
442
- 46
443
- 1
444
- 4
445
- 12
446
- 1
447
- 1
448
- 1
449
- 4
450
- 21
451
- 1
452
- 4
453
- 33
454
- 1
455
- 1
456
- 1
457
- 35
458
- 42
459
- 19
460
- 2
461
- 15
462
- 77
463
- 7
464
- 7
465
- 7
466
- 8
467
- 7
468
- 9
469
- 7
470
- 10
471
- 7
472
- 11
473
- 7
474
- 7
475
- 7
476
- 7
477
- 7
478
- 12
479
- 7
480
- 13
481
- 7
482
- 14
483
- 7
484
- 15
485
- 7
486
- 7
487
- 7
488
- 7
489
- 7
490
- 16
491
- 7
492
- 7
493
- 7
494
- 12
495
- 7
496
- 17
497
- 7
498
- 18
499
- 7
500
- 19
501
- 7
502
- 11
503
- 7
504
- 14
505
- 7
506
- 15
507
- 7
508
- 20
509
- 4
510
- 42
511
- 7
512
- 21
513
- 7
514
- 22
515
- 7
516
- 20
517
- 7
518
- 23
519
- 7
520
- 24
521
- 7
522
- 25
523
- 7
524
- 26
525
- 7
526
- 27
527
- 7
528
- 4
529
- 7
530
- 6
531
- 7
532
- 5
533
- 7
534
- 20
535
- 7
536
- 28
537
- 7
538
- 20
539
- 7
540
- 29
541
- 7
542
- 30
543
- 7
544
- 31
545
- 35
546
- 42
547
- 19
548
- 3
549
- 15
550
- 4
551
- 4
552
- 4
553
- 17
554
- 4
555
- 3
556
- 4
557
- 20
558
- 4
559
- 29
560
- 4
561
- 14
562
- 4
563
- 15
564
- 80
565
- 4
566
- 37
567
- 4
568
- 18
569
- 4
570
- 41
571
- 79
572
- 4
573
- 20
574
- 4
575
- 4
576
- 1
577
- 4
578
- 25
579
- 4
580
- 17
581
- 4
582
- 40
583
- 4
584
- 26
585
- 1
586
- 1
587
- 1
588
- 1
589
- 1
590
- 1
591
- 1
592
- 1
593
- 1
594
- 1
595
- 1
596
- 1
597
- 1
598
- 4
599
- 39
600
- 35
601
- 33
602
- 19
603
- 4
604
- 15
605
- 4
606
- 4
607
- 4
608
- 10
609
- 4
610
- 3
611
- 4
612
- 5
613
- 4
614
- 8
615
- 4
616
- 4
617
- 4
618
- 6
619
- 80
620
- 4
621
- 8
622
- 4
623
- 7
624
- 4
625
- 9
626
- 79
627
- 4
628
- 5
629
- 4
630
- 4
631
- 1
632
- 4
633
- 3
634
- 4
635
- 10
636
- 4
637
- 8
638
- 4
639
- 7
640
- 1
641
- 1
642
- 1
643
- 1
644
- 1
645
- 1
646
- 1
647
- 1
648
- 1
649
- 1
650
- 1
651
- 1
652
- 1
653
- 4
654
- 4
655
- 35
656
- 33
657
- 19
658
- 5
659
- 15
660
- 1
661
- 4
662
- 11
663
- 4
664
- 7
665
- 80
666
- 78
667
- 7
668
- 9
669
- 79
670
- 4
671
- 3
672
- 7
673
- 13
674
- 7
675
- 6
676
- 7
677
- 21
678
- 1
679
- 35
680
- 12
681
- 19
682
- 6
683
- 15
684
- 1
685
- 1
686
- 1
687
- 1
688
- 4
689
- 31
690
- 4
691
- 5
692
- 4
693
- 6
694
- 4
695
- 7
696
- 1
697
- 4
698
- 30
699
- 4
700
- 9
701
- 4
702
- 32
703
- 35
704
- 12
705
- 19
706
- 7
707
- 15
708
- 78
709
- 78
710
- 7
711
- 32
712
- 78
713
- 4
714
- 9
715
- 7
716
- 33
717
- 79
718
- 4
719
- 9
720
- 7
721
- 34
722
- 79
723
- 4
724
- 10
725
- 7
726
- 35
727
- 4
728
- 3
729
- 4
730
- 10
731
- 7
732
- 36
733
- 79
734
- 4
735
- 11
736
- 7
737
- 37
738
- 80
739
- 4
740
- 11
741
- 7
742
- 38
743
- 4
744
- 3
745
- 4
746
- 11
747
- 7
748
- 39
749
- 80
750
- 4
751
- 11
752
- 7
753
- 40
754
- 4
755
- 3
756
- 4
757
- 11
758
- 7
759
- 41
760
- 4
761
- 4
762
- 4
763
- 11
764
- 7
765
- 42
766
- 4
767
- 5
768
- 4
769
- 11
770
- 7
771
- 43
772
- 79
773
- 4
774
- 14
775
- 7
776
- 34
777
- 80
778
- 4
779
- 14
780
- 7
781
- 44
782
- 4
783
- 3
784
- 4
785
- 14
786
- 7
787
- 45
788
- 79
789
- 4
790
- 15
791
- 7
792
- 34
793
- 79
794
- 4
795
- 15
796
- 7
797
- 34
798
- 79
799
- 4
800
- 16
801
- 7
802
- 46
803
- 4
804
- 3
805
- 4
806
- 16
807
- 7
808
- 47
809
- 79
810
- 4
811
- 13
812
- 7
813
- 34
814
- 80
815
- 4
816
- 13
817
- 7
818
- 48
819
- 79
820
- 4
821
- 18
822
- 7
823
- 34
824
- 79
825
- 4
826
- 18
827
- 7
828
- 34
829
- 79
830
- 4
831
- 19
832
- 7
833
- 34
834
- 80
835
- 4
836
- 19
837
- 7
838
- 49
839
- 78
840
- 4
841
- 17
842
- 7
843
- 34
844
- 79
845
- 4
846
- 17
847
- 7
848
- 34
849
- 79
850
- 4
851
- 12
852
- 7
853
- 34
854
- 79
855
- 4
856
- 12
857
- 7
858
- 34
859
- 79
860
- 4
861
- 12
862
- 7
863
- 34
864
- 35
865
- 90
866
- 19
867
- 8
868
- 15
869
- 4
870
- 30
871
- 19
872
- 9
873
- 15
874
- 4
875
- 42
876
- 19
877
- 10
878
- 15
879
- 44
880
- 43
881
- 50
882
- 4
883
- 8
884
- 49
885
- 51
886
- 1
887
- 13
888
- 3
889
- 78
890
- 49
891
- 52
892
- 2
893
- 15
894
- 13
895
- 7
896
- 53
897
- 79
898
- 49
899
- 52
900
- 2
901
- 15
902
- 13
903
- 7
904
- 54
905
- 80
906
- 49
907
- 52
908
- 2
909
- 15
910
- 13
911
- 7
912
- 55
913
- 4
914
- 3
915
- 49
916
- 52
917
- 2
918
- 15
919
- 13
920
- 7
921
- 56
922
- 4
923
- 4
924
- 49
925
- 52
926
- 2
927
- 15
928
- 13
929
- 7
930
- 57
931
- 4
932
- 5
933
- 49
934
- 52
935
- 2
936
- 15
937
- 13
938
- 7
939
- 58
940
- 4
941
- 6
942
- 49
943
- 52
944
- 2
945
- 15
946
- 13
947
- 7
948
- 59
949
- 4
950
- 7
951
- 49
952
- 52
953
- 2
954
- 15
955
- 19
956
- 11
957
- 15
958
- 4
959
- 8
960
- 19
961
- 12
962
- 15
963
- 2
964
- 19
965
- 13
966
- 15
967
- 65
968
- 7
969
- 60
970
- 20
971
- 0
972
- 20
973
- 1
974
- 20
975
- 3
976
- 20
977
- 2
978
- 20
979
- 4
980
- 20
981
- 5
982
- 20
983
- 7
984
- 20
985
- 6
986
- 20
987
- 12
988
- 20
989
- 8
990
- 20
991
- 11
992
- 20
993
- 10
994
- 20
995
- 9
996
- 20
997
- 13
998
- 35
999
- 14
1000
- 49
1001
- 61
1002
- 2
1003
- 15
1004
- 65
1005
- 7
1006
- 62
1007
- 7
1008
- 63
1009
- 64
1010
- 7
1011
- 64
1012
- 64
1013
- 7
1014
- 65
1015
- 64
1016
- 7
1017
- 66
1018
- 64
1019
- 7
1020
- 67
1021
- 64
1022
- 7
1023
- 68
1024
- 64
1025
- 7
1026
- 69
1027
- 64
1028
- 7
1029
- 70
1030
- 64
1031
- 7
1032
- 71
1033
- 64
1034
- 7
1035
- 72
1036
- 64
1037
- 7
1038
- 73
1039
- 64
1040
- 7
1041
- 74
1042
- 64
1043
- 7
1044
- 75
1045
- 64
1046
- 7
1047
- 76
1048
- 64
1049
- 7
1050
- 77
1051
- 64
1052
- 7
1053
- 78
1054
- 64
1055
- 7
1056
- 79
1057
- 64
1058
- 7
1059
- 80
1060
- 64
1061
- 7
1062
- 81
1063
- 64
1064
- 7
1065
- 82
1066
- 64
1067
- 35
1068
- 20
1069
- 49
1070
- 61
1071
- 2
1072
- 15
1073
- 65
1074
- 7
1075
- 83
1076
- 3
1077
- 49
1078
- 61
1079
- 2
1080
- 15
1081
- 5
1082
- 7
1083
- 84
1084
- 64
1085
- 7
1086
- 1
1087
- 64
1088
- 4
1089
- 31
1090
- 47
1091
- 49
1092
- 2
1093
- 3
1094
- 15
1095
- 5
1096
- 7
1097
- 85
1098
- 64
1099
- 7
1100
- 1
1101
- 64
1102
- 4
1103
- 33
1104
- 47
1105
- 49
1106
- 2
1107
- 3
1108
- 15
1109
- 5
1110
- 7
1111
- 86
1112
- 64
1113
- 7
1114
- 1
1115
- 64
1116
- 4
1117
- 34
1118
- 47
1119
- 49
1120
- 2
1121
- 3
1122
- 15
1123
- 5
1124
- 7
1125
- 87
1126
- 64
1127
- 7
1128
- 1
1129
- 64
1130
- 4
1131
- 38
1132
- 47
1133
- 49
1134
- 2
1135
- 3
1136
- 15
1137
- 5
1138
- 7
1139
- 88
1140
- 64
1141
- 7
1142
- 1
1143
- 64
1144
- 4
1145
- 42
1146
- 47
1147
- 49
1148
- 2
1149
- 3
1150
- 15
1151
- 5
1152
- 7
1153
- 89
1154
- 64
1155
- 7
1156
- 1
1157
- 64
1158
- 4
1159
- 46
1160
- 47
1161
- 49
1162
- 2
1163
- 3
1164
- 15
1165
- 5
1166
- 7
1167
- 90
1168
- 64
1169
- 7
1170
- 1
1171
- 64
1172
- 4
1173
- 50
1174
- 47
1175
- 49
1176
- 2
1177
- 3
1178
- 15
1179
- 5
1180
- 7
1181
- 91
1182
- 64
1183
- 7
1184
- 1
1185
- 64
1186
- 4
1187
- 54
1188
- 47
1189
- 49
1190
- 2
1191
- 3
1192
- 15
1193
- 5
1194
- 7
1195
- 92
1196
- 64
1197
- 7
1198
- 1
1199
- 64
1200
- 4
1201
- 58
1202
- 47
1203
- 49
1204
- 2
1205
- 3
1206
- 15
1207
- 5
1208
- 7
1209
- 93
1210
- 64
1211
- 7
1212
- 1
1213
- 64
1214
- 4
1215
- 62
1216
- 47
1217
- 49
1218
- 2
1219
- 3
1220
- 15
1221
- 5
1222
- 7
1223
- 94
1224
- 64
1225
- 7
1226
- 1
1227
- 64
1228
- 4
1229
- 67
1230
- 47
1231
- 49
1232
- 2
1233
- 3
1234
- 15
1235
- 5
1236
- 7
1237
- 95
1238
- 64
1239
- 7
1240
- 1
1241
- 64
1242
- 4
1243
- 68
1244
- 47
1245
- 49
1246
- 2
1247
- 3
1248
- 15
1249
- 5
1250
- 7
1251
- 96
1252
- 64
1253
- 7
1254
- 1
1255
- 64
1256
- 4
1257
- 72
1258
- 47
1259
- 49
1260
- 2
1261
- 3
1262
- 15
1263
- 5
1264
- 7
1265
- 97
1266
- 64
1267
- 7
1268
- 1
1269
- 64
1270
- 4
1271
- 73
1272
- 47
1273
- 49
1274
- 2
1275
- 3
1276
- 15
1277
- 5
1278
- 7
1279
- 98
1280
- 64
1281
- 7
1282
- 1
1283
- 64
1284
- 4
1285
- 76
1286
- 47
1287
- 49
1288
- 2
1289
- 3
1290
- 15
1291
- 5
1292
- 7
1293
- 99
1294
- 64
1295
- 7
1296
- 1
1297
- 64
1298
- 4
1299
- 81
1300
- 47
1301
- 49
1302
- 2
1303
- 3
1304
- 15
1305
- 99
1306
- 7
1307
- 34
1308
- 7
1309
- 100
1310
- 65
1311
- 67
1312
- 49
1313
- 101
1314
- 0
1315
- 49
1316
- 102
1317
- 4
1318
- 11
1319
- I
1320
- 68
1321
- I
1322
- e
1323
- I
1324
- 0
1325
- I
1326
- 0
1327
- n
1328
- p
1329
- 103
1330
- s
1331
- 2421
1332
-
1333
- def initialize(options = {})
1334
- self.options.merge!(options)
1335
- end
1336
-
1337
- def options
1338
- @options ||= { :debug => ENV['DEBUG'] == true }
1339
- end
1340
-
1341
- def parse(input)
1342
- @yydebug = options[:debug]
1343
- scan(input)
1344
- do_parse
1345
- end
1346
-
1347
- def next_token
1348
- @stack.shift
1349
- end
1350
-
1351
- def on_error(tid, val, vstack)
1352
- BibTeX.log.error("Failed to parse BibTeX Name on value %s (%s) %s" % [val.inspect, token_to_str(tid) || '?', vstack.inspect])
1353
- end
1354
-
1355
- def scan(input)
1356
- @src = StringScanner.new(input)
1357
- @brace_level = 0
1358
- @stack = []
1359
- @word = [:PWORD,'']
1360
- do_scan
1361
- end
1362
-
1363
- private
1364
-
1365
- def do_scan
1366
- until @src.eos?
1367
- case
1368
- when @src.scan(/,?\s+and\s+/io)
1369
- push_word
1370
- @stack.push([:AND,@src.matched])
1371
-
1372
- when @src.scan(/[\t\r\n\s]+/o)
1373
- push_word
1374
-
1375
- when @src.scan(/,/o)
1376
- push_word
1377
- @stack.push([:COMMA,@src.matched])
1378
-
1379
- when @src.scan(/[[:lower:]][^\t\r\n\s\{\}\d\\,]*/o)
1380
- is_lowercase
1381
- @word[1] << @src.matched
1382
-
1383
- when @src.scan(/[[:upper:]][^\t\r\n\s\{\}\d\\,]*/o)
1384
- is_uppercase
1385
- @word[1] << @src.matched
1386
-
1387
- when @src.scan(/(\d|\\.)+/o)
1388
- @word[1] << @src.matched
1389
-
1390
- when @src.scan(/\{/o)
1391
- @word[1] << @src.matched
1392
- scan_literal
1393
-
1394
- when @src.scan(/\}/o)
1395
- error_unbalanced
1396
-
1397
- when @src.scan(/./o)
1398
- @word[1] << @src.matched
1399
- end
1400
- end
1401
-
1402
- push_word
1403
- @stack
1404
- end
1405
-
1406
- def push_word
1407
- unless @word[1].empty?
1408
- @stack.push(@word)
1409
- @word = [:PWORD,'']
1410
- end
1411
- end
1412
-
1413
- def is_lowercase
1414
- @word[0] = :LWORD if @word[0] == :PWORD
1415
- end
1416
-
1417
- def is_uppercase
1418
- @word[0] = :UWORD if @word[0] == :PWORD
1419
- end
1420
-
1421
- def scan_literal
1422
- @brace_level = 1
1423
-
1424
- while @brace_level > 0
1425
- @word[1] << @src.scan_until(/[\{\}]/o).to_s
1426
-
1427
- case @src.matched
1428
- when '{'
1429
- @brace_level += 1
1430
- when '}'
1431
- @brace_level -= 1
1432
- else
1433
- @brace_level = 0
1434
- error_unbalanced
1435
- end
1436
- end
1437
- end
1438
-
1439
- def error_unexpected
1440
- @stack.push [:ERROR,@src.matched]
1441
- BibTeX.log.warn("NameParser: unexpected token `#{@src.matched}' at position #{@src.pos}; brace level #{@brace_level}.")
1442
- end
1443
-
1444
- def error_unbalanced
1445
- @stack.push [:ERROR,'}']
1446
- BibTeX.log.warn("NameParser: unbalanced braces at position #{@src.pos}; brace level #{@brace_level}.")
1447
- end
1448
-
1449
- # -*- racc -*-
1450
-
1451
- s
1452
- 7
1453
- names.y
1454
- x
1455
- 11
1456
- module_eval
1457
- I
1458
- -f
1459
- I
1460
- -1b
1461
- I
1462
- -1d
1463
- I
1464
- -1c
1465
- I
1466
- -1e
1467
- I
1468
- -2
1469
- I
1470
- -3
1471
- I
1472
- -5
1473
- I
1474
- -10
1475
- I
1476
- -c
1477
- I
1478
- -13
1479
- I
1480
- -15
1481
- I
1482
- -16
1483
- I
1484
- -6
1485
- I
1486
- -14
1487
- I
1488
- -8
1489
- I
1490
- -d
1491
- I
1492
- -19
1493
- I
1494
- -4
1495
- I
1496
- -7
1497
- I
1498
- -e
1499
- I
1500
- -9
1501
- I
1502
- -11
1503
- I
1504
- -17
1505
- I
1506
- -1a
1507
- I
1508
- -a
1509
- I
1510
- -18
1511
- I
1512
- -b
1513
- I
1514
- -12
1515
- x
1516
- 10
1517
- racc_error
1518
- x
1519
- 9
1520
- _reduce_1
1521
- x
1522
- 12
1523
- _reduce_none
1524
- x
1525
- 9
1526
- _reduce_3
1527
- x
1528
- 9
1529
- _reduce_4
1530
- x
1531
- 9
1532
- _reduce_5
1533
- x
1534
- 9
1535
- _reduce_6
1536
- x
1537
- 9
1538
- _reduce_7
1539
- x
1540
- 9
1541
- _reduce_8
1542
- x
1543
- 9
1544
- _reduce_9
1545
- x
1546
- 10
1547
- _reduce_10
1548
- x
1549
- 10
1550
- _reduce_11
1551
- x
1552
- 10
1553
- _reduce_13
1554
- x
1555
- 10
1556
- _reduce_14
1557
- x
1558
- 10
1559
- _reduce_17
1560
- x
1561
- 10
1562
- _reduce_18
1563
- x
1564
- 10
1565
- _reduce_20
1566
- x
1567
- 10
1568
- _reduce_24
1569
- x
1570
- 4
1571
- Hash
1572
- x
1573
- 16
1574
- new_from_literal
1575
- x
1576
- 3
1577
- []=
1578
- x
1579
- 5
1580
- error
1581
- x
1582
- 5
1583
- COMMA
1584
- x
1585
- 5
1586
- UWORD
1587
- x
1588
- 5
1589
- LWORD
1590
- x
1591
- 5
1592
- PWORD
1593
- x
1594
- 3
1595
- AND
1596
- x
1597
- 5
1598
- ERROR
1599
- x
1600
- 8
1601
- Racc_arg
1602
- x
1603
- 9
1604
- const_set
1605
- x
1606
- 21
1607
- Racc_token_to_s_table
1608
- s
1609
- 4
1610
- $end
1611
- s
1612
- 5
1613
- error
1614
- s
1615
- 5
1616
- COMMA
1617
- s
1618
- 5
1619
- UWORD
1620
- s
1621
- 5
1622
- LWORD
1623
- s
1624
- 5
1625
- PWORD
1626
- s
1627
- 3
1628
- AND
1629
- s
1630
- 5
1631
- ERROR
1632
- s
1633
- 6
1634
- $start
1635
- s
1636
- 6
1637
- result
1638
- s
1639
- 5
1640
- names
1641
- s
1642
- 4
1643
- name
1644
- s
1645
- 4
1646
- word
1647
- s
1648
- 7
1649
- u_words
1650
- s
1651
- 3
1652
- von
1653
- s
1654
- 4
1655
- last
1656
- s
1657
- 5
1658
- first
1659
- s
1660
- 9
1661
- opt_words
1662
- s
1663
- 6
1664
- u_word
1665
- s
1666
- 5
1667
- words
1668
- x
1669
- 17
1670
- Racc_debug_parser
1671
- s
1672
- 73
1673
- def _reduce_1(val, _values, result)
1674
- result = []
1675
- result
1676
- end
1677
-
1678
- s
1679
- 79
1680
- def _reduce_3(val, _values, result)
1681
- result = [val[0]]
1682
- result
1683
- end
1684
-
1685
- s
1686
- 78
1687
- def _reduce_4(val, _values, result)
1688
- result << val[2]
1689
- result
1690
- end
1691
-
1692
- s
1693
- 111
1694
- def _reduce_5(val, _values, result)
1695
- result = Name.new(:last => val[0])
1696
-
1697
- result
1698
- end
1699
-
1700
- s
1701
- 129
1702
- def _reduce_6(val, _values, result)
1703
- result = Name.new(:first => val[0], :last => val[1])
1704
-
1705
- result
1706
- end
1707
-
1708
- s
1709
- 145
1710
- def _reduce_7(val, _values, result)
1711
- result = Name.new(:first => val[0], :von => val[1], :last => val[2])
1712
-
1713
- result
1714
- end
1715
-
1716
- s
1717
- 127
1718
- def _reduce_8(val, _values, result)
1719
- result = Name.new(:von => val[0], :last => val[1])
1720
-
1721
- result
1722
- end
1723
-
1724
- s
1725
- 150
1726
- def _reduce_9(val, _values, result)
1727
- result = Name.new(:last => val[0], :jr => val[2][0], :first => val[2][1])
1728
-
1729
- result
1730
- end
1731
-
1732
- s
1733
- 167
1734
- def _reduce_10(val, _values, result)
1735
- result = Name.new(:von => val[0], :last => val[1], :jr => val[3][0], :first => val[3][1])
1736
-
1737
- result
1738
- end
1739
-
1740
- s
1741
- 179
1742
- def _reduce_11(val, _values, result)
1743
- result = Name.new(:von => val[0,2].join(' '), :last => val[2], :jr => val[4][0], :first => val[4][1])
1744
-
1745
- result
1746
- end
1747
-
1748
- s
1749
- 85
1750
- def _reduce_13(val, _values, result)
1751
- result = val.join(' ')
1752
- result
1753
- end
1754
-
1755
- s
1756
- 85
1757
- def _reduce_14(val, _values, result)
1758
- result = val.join(' ')
1759
- result
1760
- end
1761
-
1762
- s
1763
- 84
1764
- def _reduce_17(val, _values, result)
1765
- result = [nil,val[0]]
1766
- result
1767
- end
1768
-
1769
- s
1770
- 87
1771
- def _reduce_18(val, _values, result)
1772
- result = [val[0],val[2]]
1773
- result
1774
- end
1775
-
1776
- s
1777
- 85
1778
- def _reduce_20(val, _values, result)
1779
- result = val.join(' ')
1780
- result
1781
- end
1782
-
1783
- s
1784
- 85
1785
- def _reduce_24(val, _values, result)
1786
- result = val.join(' ')
1787
- result
1788
- end
1789
-
1790
- M
1791
- 1
1792
- n
1793
- n
1794
- x
1795
- 12
1796
- _reduce_none
1797
- i
1798
- 7
1799
- 20
1800
- 0
1801
- 78
1802
- 49
1803
- 0
1804
- 1
1805
- 11
1806
- I
1807
- 5
1808
- I
1809
- 3
1810
- I
1811
- 3
1812
- I
1813
- 3
1814
- n
1815
- p
1816
- 1
1817
- x
1818
- 2
1819
- []
1820
- p
1821
- 5
1822
- I
1823
- -1
1824
- I
1825
- 1a9
1826
- I
1827
- 0
1828
- I
1829
- 1aa
1830
- I
1831
- 7
1832
- x
1833
- 59
1834
- /Users/sylvester/Work/bibtex-ruby/lib/bibtex/name_parser.rb
1835
- p
1836
- 3
1837
- x
1838
- 3
1839
- val
1840
- x
1841
- 7
1842
- _values
1843
- x
1844
- 6
1845
- result
1846
- x
1847
- 17
1848
- method_visibility
1849
- x
1850
- 15
1851
- add_defn_method
1852
- p
1853
- 285
1854
- I
1855
- 2
1856
- I
1857
- e
1858
- I
1859
- 10
1860
- I
1861
- 89
1862
- I
1863
- 24
1864
- I
1865
- 8a
1866
- I
1867
- 38
1868
- I
1869
- 8b
1870
- I
1871
- 4c
1872
- I
1873
- 8c
1874
- I
1875
- 60
1876
- I
1877
- 8d
1878
- I
1879
- 74
1880
- I
1881
- 8e
1882
- I
1883
- 7a
1884
- I
1885
- 88
1886
- I
1887
- 7d
1888
- I
1889
- 91
1890
- I
1891
- 91
1892
- I
1893
- 92
1894
- I
1895
- a5
1896
- I
1897
- 93
1898
- I
1899
- b9
1900
- I
1901
- 94
1902
- I
1903
- cd
1904
- I
1905
- 95
1906
- I
1907
- de
1908
- I
1909
- 96
1910
- I
1911
- e2
1912
- I
1913
- 90
1914
- I
1915
- e5
1916
- I
1917
- 99
1918
- I
1919
- f6
1920
- I
1921
- 9a
1922
- I
1923
- 105
1924
- I
1925
- 9b
1926
- I
1927
- 113
1928
- I
1929
- 9c
1930
- I
1931
- 121
1932
- I
1933
- 9d
1934
- I
1935
- 125
1936
- I
1937
- 98
1938
- I
1939
- 128
1940
- I
1941
- a0
1942
- I
1943
- 13b
1944
- I
1945
- a1
1946
- I
1947
- 14f
1948
- I
1949
- a2
1950
- I
1951
- 163
1952
- I
1953
- a3
1954
- I
1955
- 177
1956
- I
1957
- a4
1958
- I
1959
- 17d
1960
- I
1961
- 9f
1962
- I
1963
- 180
1964
- I
1965
- a7
1966
- I
1967
- 193
1968
- I
1969
- a8
1970
- I
1971
- 1a4
1972
- I
1973
- a9
1974
- I
1975
- 1ae
1976
- I
1977
- aa
1978
- I
1979
- 1b4
1980
- I
1981
- a6
1982
- I
1983
- 1b7
1984
- I
1985
- ad
1986
- I
1987
- 1ca
1988
- I
1989
- ae
1990
- I
1991
- 1db
1992
- I
1993
- af
1994
- I
1995
- 1e5
1996
- I
1997
- b0
1998
- I
1999
- 1eb
2000
- I
2001
- ac
2002
- I
2003
- 1ee
2004
- I
2005
- b3
2006
- I
2007
- 1fe
2008
- I
2009
- b4
2010
- I
2011
- 203
2012
- I
2013
- b2
2014
- I
2015
- 206
2016
- I
2017
- b7
2018
- I
2019
- 215
2020
- I
2021
- b8
2022
- I
2023
- 21b
2024
- I
2025
- b6
2026
- I
2027
- 21e
2028
- I
2029
- bb
2030
- I
2031
- 222
2032
- I
2033
- bc
2034
- I
2035
- 227
2036
- I
2037
- bd
2038
- I
2039
- 22c
2040
- I
2041
- be
2042
- I
2043
- 231
2044
- I
2045
- bf
2046
- I
2047
- 237
2048
- I
2049
- c0
2050
- I
2051
- 23c
2052
- I
2053
- c1
2054
- I
2055
- 241
2056
- I
2057
- c2
2058
- I
2059
- 247
2060
- I
2061
- c3
2062
- I
2063
- 24c
2064
- I
2065
- c4
2066
- I
2067
- 252
2068
- I
2069
- c5
2070
- I
2071
- 258
2072
- I
2073
- c6
2074
- I
2075
- 25e
2076
- I
2077
- c7
2078
- I
2079
- 263
2080
- I
2081
- c8
2082
- I
2083
- 268
2084
- I
2085
- c9
2086
- I
2087
- 26e
2088
- I
2089
- ca
2090
- I
2091
- 273
2092
- I
2093
- cb
2094
- I
2095
- 278
2096
- I
2097
- cc
2098
- I
2099
- 27d
2100
- I
2101
- cd
2102
- I
2103
- 283
2104
- I
2105
- ce
2106
- I
2107
- 288
2108
- I
2109
- cf
2110
- I
2111
- 28d
2112
- I
2113
- d0
2114
- I
2115
- 292
2116
- I
2117
- d1
2118
- I
2119
- 297
2120
- I
2121
- d2
2122
- I
2123
- 29c
2124
- I
2125
- d3
2126
- I
2127
- 2a1
2128
- I
2129
- d4
2130
- I
2131
- 2a6
2132
- I
2133
- d5
2134
- I
2135
- 2ab
2136
- I
2137
- d6
2138
- I
2139
- 2b0
2140
- I
2141
- d7
2142
- I
2143
- 2b5
2144
- I
2145
- d8
2146
- I
2147
- 2bc
2148
- I
2149
- ba
2150
- I
2151
- 2bf
2152
- I
2153
- da
2154
- I
2155
- 2c4
2156
- I
2157
- dc
2158
- I
2159
- 2c9
2160
- I
2161
- e6
2162
- I
2163
- 2d2
2164
- I
2165
- df
2166
- I
2167
- 2d9
2168
- I
2169
- e0
2170
- I
2171
- 2e1
2172
- I
2173
- e1
2174
- I
2175
- 2e9
2176
- I
2177
- e2
2178
- I
2179
- 2f2
2180
- I
2181
- e3
2182
- I
2183
- 2fb
2184
- I
2185
- e4
2186
- I
2187
- 304
2188
- I
2189
- e5
2190
- I
2191
- 30d
2192
- I
2193
- e6
2194
- I
2195
- 315
2196
- I
2197
- de
2198
- I
2199
- 318
2200
- I
2201
- e8
2202
- I
2203
- 31d
2204
- I
2205
- ea
2206
- I
2207
- 321
2208
- I
2209
- ec
2210
- I
2211
- 324
2212
- I
2213
- ed
2214
- I
2215
- 326
2216
- I
2217
- ee
2218
- I
2219
- 328
2220
- I
2221
- ef
2222
- I
2223
- 32a
2224
- I
2225
- f0
2226
- I
2227
- 32c
2228
- I
2229
- f1
2230
- I
2231
- 32e
2232
- I
2233
- f2
2234
- I
2235
- 330
2236
- I
2237
- f3
2238
- I
2239
- 332
2240
- I
2241
- f4
2242
- I
2243
- 334
2244
- I
2245
- f5
2246
- I
2247
- 336
2248
- I
2249
- f6
2250
- I
2251
- 338
2252
- I
2253
- f7
2254
- I
2255
- 33a
2256
- I
2257
- f8
2258
- I
2259
- 33c
2260
- I
2261
- f9
2262
- I
2263
- 33e
2264
- I
2265
- fa
2266
- I
2267
- 346
2268
- I
2269
- fc
2270
- I
2271
- 349
2272
- I
2273
- fd
2274
- I
2275
- 34c
2276
- I
2277
- fe
2278
- I
2279
- 34f
2280
- I
2281
- ff
2282
- I
2283
- 352
2284
- I
2285
- 100
2286
- I
2287
- 355
2288
- I
2289
- 101
2290
- I
2291
- 358
2292
- I
2293
- 102
2294
- I
2295
- 35b
2296
- I
2297
- 103
2298
- I
2299
- 35e
2300
- I
2301
- 104
2302
- I
2303
- 361
2304
- I
2305
- 105
2306
- I
2307
- 364
2308
- I
2309
- 106
2310
- I
2311
- 367
2312
- I
2313
- 107
2314
- I
2315
- 36a
2316
- I
2317
- 108
2318
- I
2319
- 36d
2320
- I
2321
- 109
2322
- I
2323
- 370
2324
- I
2325
- 10a
2326
- I
2327
- 373
2328
- I
2329
- 10b
2330
- I
2331
- 376
2332
- I
2333
- 10c
2334
- I
2335
- 379
2336
- I
2337
- 10d
2338
- I
2339
- 37c
2340
- I
2341
- 10e
2342
- I
2343
- 37f
2344
- I
2345
- 10f
2346
- I
2347
- 382
2348
- I
2349
- 110
2350
- I
2351
- 38b
2352
- I
2353
- 112
2354
- I
2355
- 393
2356
- I
2357
- 118
2358
- I
2359
- 3a1
2360
- I
2361
- 121
2362
- I
2363
- 3af
2364
- I
2365
- 128
2366
- I
2367
- 3bd
2368
- I
2369
- 12f
2370
- I
2371
- 3cb
2372
- I
2373
- 137
2374
- I
2375
- 3d9
2376
- I
2377
- 13f
2378
- I
2379
- 3e7
2380
- I
2381
- 147
2382
- I
2383
- 3f5
2384
- I
2385
- 14f
2386
- I
2387
- 403
2388
- I
2389
- 157
2390
- I
2391
- 411
2392
- I
2393
- 15f
2394
- I
2395
- 41f
2396
- I
2397
- 169
2398
- I
2399
- 42d
2400
- I
2401
- 170
2402
- I
2403
- 43b
2404
- I
2405
- 17b
2406
- I
2407
- 449
2408
- I
2409
- 182
2410
- I
2411
- 457
2412
- I
2413
- 18b
2414
- I
2415
- 465
2416
- I
2417
- 198
2418
- I
2419
- 473
2420
- I
2421
- 1a9
2422
- I
2423
- 481
2424
- x
2425
- 59
2426
- /Users/sylvester/Work/bibtex-ruby/lib/bibtex/name_parser.rb
2427
- p
2428
- 14
2429
- x
2430
- 17
2431
- racc_action_table
2432
- x
2433
- 17
2434
- racc_action_check
2435
- x
2436
- 19
2437
- racc_action_pointer
2438
- x
2439
- 19
2440
- racc_action_default
2441
- x
2442
- 15
2443
- racc_goto_table
2444
- x
2445
- 15
2446
- racc_goto_check
2447
- x
2448
- 17
2449
- racc_goto_pointer
2450
- x
2451
- 17
2452
- racc_goto_default
2453
- x
2454
- 17
2455
- racc_reduce_table
2456
- x
2457
- 13
2458
- racc_reduce_n
2459
- x
2460
- 12
2461
- racc_shift_n
2462
- x
2463
- 16
2464
- racc_token_table
2465
- x
2466
- 12
2467
- racc_nt_base
2468
- x
2469
- 19
2470
- racc_use_result_var
2471
- x
2472
- 13
2473
- attach_method
2474
- p
2475
- 3
2476
- I
2477
- 2
2478
- I
2479
- c
2480
- I
2481
- 21
2482
- x
2483
- 59
2484
- /Users/sylvester/Work/bibtex-ruby/lib/bibtex/name_parser.rb
2485
- p
2486
- 0
2487
- x
2488
- 13
2489
- attach_method
2490
- p
2491
- 7
2492
- I
2493
- 0
2494
- I
2495
- 7
2496
- I
2497
- 9
2498
- I
2499
- 9
2500
- I
2501
- 12
2502
- I
2503
- b
2504
- I
2505
- 2e
2506
- x
2507
- 59
2508
- /Users/sylvester/Work/bibtex-ruby/lib/bibtex/name_parser.rb
2509
- p
2510
- 0