lib/antelope/generation/tableizer.rb in antelope-0.1.2 vs lib/antelope/generation/tableizer.rb in antelope-0.1.3

- old
+ new

@@ -55,11 +55,11 @@ state.transitions.each do |on, to| table[state.id][on] << [:state, to.id] end state.rules.each do |rule| - @rules[rule.id] = rule + @rules[rule.production.id] = rule.production if rule.final? rule.lookahead.each do |look| table[state.id][look.name] << [:reduce, rule.production.id] end @@ -92,10 +92,10 @@ terminal = grammar.precedence_for(on) state_part = data.select { |(t, d)| t == :state }.first rule_part = data.select { |(t, d)| t == :reduce}.first - result = @rules[rule_part[1]].precedence <=> terminal + result = @rules[rule_part[1]].prec <=> terminal case result when 0 $stderr.puts \ "Could not determine move for #{on} in state #{state}"