lib/rley/parser/grm_items_builder.rb in rley-0.3.04 vs lib/rley/parser/grm_items_builder.rb in rley-0.3.05
- old
+ new
@@ -7,17 +7,18 @@
# Build an array of dotted items from the productions in passed grammar.
def build_dotted_items(aGrammar)
items = []
aGrammar.rules.each do |prod|
rhs_size = prod.rhs.size
- if rhs_size == 0
+ if rhs_size.zero?
items << DottedItem.new(prod, 0)
else
items += (0..rhs_size).map { |i| DottedItem.new(prod, i) }
end
end
return items
end
end # module
end # module
-end # module
\ No newline at end of file
+end # module
+# End of file