lib/lrama/context.rb in lrama-0.6.1 vs lib/lrama/context.rb in lrama-0.6.2
- old
+ new
@@ -39,11 +39,11 @@
# State number of final (accepted) state
def yyfinal
@states.states.find do |state|
state.items.find do |item|
- item.rule.lhs.accept_symbol? && item.end_of_rule?
+ item.lhs.accept_symbol? && item.end_of_rule?
end
end.id
end
# Number of terms
@@ -219,10 +219,10 @@
# * number < 0, reduce by "-number" rule. Rule "number" is already added by 1.
actions = Array.new(@states.terms.count, 0)
if state.reduces.map(&:selected_look_ahead).any? {|la| !la.empty? }
# Iterate reduces with reverse order so that first rule is used.
- state.reduces.reverse.each do |reduce|
+ state.reduces.reverse_each do |reduce|
reduce.look_ahead.each do |term|
actions[term.number] = rule_id_to_action_number(reduce.rule.id)
end
end
end