lib/bibtex/parser.rb in bibtex-ruby-1.3.1 vs lib/bibtex/parser.rb in bibtex-ruby-1.3.2
- old
+ new
@@ -9,11 +9,11 @@
require 'bibtex/lexer'
module BibTeX
class Parser < Racc::Parser
-module_eval(<<'...end bibtex.y/module_eval...', 'bibtex.y', 89)
+module_eval(<<'...end bibtex.y/module_eval...', 'bibtex.y', 90)
attr_reader :lexer
def initialize(options = {})
self.options.merge!(options)
@@ -49,53 +49,53 @@
def include_errors?
@options[:include].include?(:errors)
end
def on_error(tid, val, vstack)
- #raise(ParseError, "Failed to parse BibTeX on value %s (%s) %s" % [val.inspect, token_to_str(tid) || '?', vstack.inspect])
Log.error("Failed to parse BibTeX on value %s (%s) %s" % [val.inspect, token_to_str(tid) || '?', vstack.inspect])
+ #raise(ParseError, "Failed to parse BibTeX on value %s (%s) %s" % [val.inspect, token_to_str(tid) || '?', vstack.inspect])
end
# -*- racc -*-
...end bibtex.y/module_eval...
##### State transition tables begin ###
racc_action_table = [
- 14, 52, 37, 32, 51, 38, 18, 32, 15, 33,
+ 14, 52, 37, 32, 51, 35, 18, 32, 15, 33,
4, 16, 36, 33, 6, 4, 29, 5, 32, 6,
- 32, 35, 5, 27, 33, 26, 33, 26, 24, 42,
- 47, 40, 41, 43, 44, 22, 45, 46, 21, 20,
- 53, 19, 7, 44, 29, 44, 57 ]
+ 32, 38, 5, 27, 33, 26, 33, 26, 47, 42,
+ 24, 43, 44, 40, 41, 22, 45, 46, 21, 20,
+ 53, 54, 19, 7, 44, 29, 44, 58 ]
racc_action_check = [
- 4, 38, 23, 38, 38, 26, 4, 46, 4, 38,
- 2, 4, 23, 46, 2, 0, 20, 2, 44, 0,
- 21, 22, 0, 18, 44, 17, 21, 37, 17, 28,
- 37, 27, 27, 30, 30, 16, 34, 35, 15, 14,
- 39, 7, 1, 49, 52, 55, 56 ]
+ 4, 38, 23, 38, 38, 22, 4, 46, 4, 38,
+ 2, 4, 23, 46, 2, 0, 20, 2, 21, 0,
+ 44, 26, 0, 18, 21, 37, 44, 17, 37, 28,
+ 17, 30, 30, 27, 27, 16, 34, 35, 15, 14,
+ 39, 41, 7, 1, 49, 52, 56, 57 ]
racc_action_pointer = [
- 13, 42, 8, nil, -4, nil, nil, 41, nil, nil,
- nil, nil, nil, nil, 31, 30, 27, 15, 15, nil,
- 11, 10, 11, -1, nil, nil, -2, 21, 16, nil,
- 20, nil, nil, nil, 23, 30, nil, 17, -7, 37,
- nil, nil, nil, nil, 8, nil, -3, nil, nil, 29,
- nil, nil, 39, nil, nil, 31, 33, nil ]
+ 13, 43, 8, nil, -4, nil, nil, 42, nil, nil,
+ nil, nil, nil, nil, 31, 30, 27, 17, 15, nil,
+ 11, 8, -5, -1, nil, nil, 14, 23, 16, nil,
+ 18, nil, nil, nil, 23, 30, nil, 15, -7, 37,
+ nil, 31, nil, nil, 10, nil, -3, nil, nil, 30,
+ nil, nil, 40, nil, nil, nil, 32, 34, nil ]
racc_action_default = [
- -1, -34, -2, -3, -34, -6, -7, -34, -4, -5,
- -8, -9, -10, -11, -34, -34, -34, -34, -34, 58,
- -13, -34, -34, -34, -24, -28, -34, -34, -34, -14,
- -34, -18, -20, -21, -34, -34, -22, -34, -34, -34,
- -26, -27, -12, -15, -34, -16, -34, -23, -29, -31,
- -30, -32, -13, -25, -19, -17, -34, -33 ]
+ -1, -35, -2, -3, -35, -6, -7, -35, -4, -5,
+ -8, -9, -10, -11, -35, -35, -35, -35, -35, 59,
+ -13, -35, -35, -35, -24, -29, -35, -35, -35, -14,
+ -35, -18, -20, -21, -35, -35, -22, -35, -35, -35,
+ -26, -27, -12, -15, -35, -16, -35, -23, -30, -32,
+ -31, -33, -13, -25, -28, -19, -17, -35, -34 ]
racc_goto_table = [
28, 30, 25, 3, 1, 8, 11, 12, 13, 10,
- 9, 34, 54, 17, 23, 39, 2, 50, 49, nil,
- nil, nil, 48, nil, nil, nil, 55, nil, nil, nil,
- nil, nil, 56 ]
+ 9, 34, 55, 17, 23, 39, 2, 50, 49, nil,
+ nil, nil, 48, nil, nil, nil, 56, nil, nil, nil,
+ nil, nil, 57 ]
racc_goto_check = [
9, 10, 16, 3, 1, 3, 6, 7, 8, 5,
4, 11, 12, 13, 14, 15, 2, 17, 10, nil,
nil, nil, 16, nil, nil, nil, 10, nil, nil, nil,
@@ -136,20 +136,21 @@
4, 25, :_reduce_23,
2, 25, :_reduce_24,
4, 30, :_reduce_25,
1, 32, :_reduce_26,
1, 32, :_reduce_27,
- 1, 31, :_reduce_28,
- 3, 31, :_reduce_29,
- 3, 33, :_reduce_30,
- 1, 34, :_reduce_31,
+ 2, 32, :_reduce_28,
+ 1, 31, :_reduce_29,
+ 3, 31, :_reduce_30,
+ 3, 33, :_reduce_31,
1, 34, :_reduce_32,
- 3, 34, :_reduce_33 ]
+ 1, 34, :_reduce_33,
+ 3, 34, :_reduce_34 ]
-racc_reduce_n = 34
+racc_reduce_n = 35
-racc_shift_n = 58
+racc_shift_n = 59
racc_token_table = {
false => 0,
:error => 1,
:AT => 2,
@@ -418,34 +419,34 @@
result = val[0]
result
end
.,.,
-module_eval(<<'.,.,', 'bibtex.y', 73)
+module_eval(<<'.,.,', 'bibtex.y', 72)
def _reduce_28(val, _values, result)
- result = val[0]
+ result = val[0,2].join
result
end
.,.,
module_eval(<<'.,.,', 'bibtex.y', 74)
def _reduce_29(val, _values, result)
- result.merge!(val[2])
+ result = val[0]
result
end
.,.,
-module_eval(<<'.,.,', 'bibtex.y', 76)
+module_eval(<<'.,.,', 'bibtex.y', 75)
def _reduce_30(val, _values, result)
- result = { val[0].downcase.to_sym => val[2] }
+ result.merge!(val[2])
result
end
.,.,
-module_eval(<<'.,.,', 'bibtex.y', 78)
+module_eval(<<'.,.,', 'bibtex.y', 77)
def _reduce_31(val, _values, result)
- result = val[0]
+ result = { val[0].downcase.to_sym => val[2] }
result
end
.,.,
module_eval(<<'.,.,', 'bibtex.y', 79)
@@ -455,9 +456,16 @@
end
.,.,
module_eval(<<'.,.,', 'bibtex.y', 80)
def _reduce_33(val, _values, result)
+ result = val[0]
+ result
+ end
+.,.,
+
+module_eval(<<'.,.,', 'bibtex.y', 81)
+ def _reduce_34(val, _values, result)
result = val[1]
result
end
.,.,