lib/ebnf/ll1.rb in ebnf-1.1.2 vs lib/ebnf/ll1.rb in ebnf-1.1.3
- old
+ new
@@ -214,11 +214,11 @@
end
@branch = {}
@already = []
@agenda = []
- @starts.each do |start|
+ Array(@starts).each do |start|
do_production(start)
while !@agenda.empty?
x = @agenda.shift
do_production(x)
end
@@ -263,10 +263,10 @@
else
"Unknown table entry type: #{table[prod].class}"
end
end
io.puts "#{ind0}}.freeze\n"
- else
+ elsif table
io.puts "#{ind0}#{name} = [\n#{ind1}" +
table.sort_by{|t| t.to_s.sub(/^_/, '')}.map(&:inspect).join(",\n#{ind1}") +
"\n#{ind0}].freeze\n"
end
end