lib/raabro.rb in raabro-1.3.2 vs lib/raabro.rb in raabro-1.3.3

- old
+ new

@@ -1,9 +1,9 @@ module Raabro - VERSION = '1.3.2' + VERSION = '1.3.3' class Input attr_accessor :string, :offset attr_reader :options @@ -170,21 +170,21 @@ path = stack .compact.reverse.take(3).reverse .collect(&:inspect).join('/') "parsing failed .../#{path}" else - "parsing failed, not all input was consumed" + 'parsing failed, not all input was consumed' end visual = visual(line, column) [ line, column, err_tree.offset, err_message, visual ] end def lookup_error(stack=[]) -#print "le(): "; Raabro.pp(self, colors: true) +#print 'le(): '; Raabro.pp(self, colors: true) return nil if @result != 0 return [ self, stack ] if @children.empty? @children.each { |c| es = c.lookup_error(stack.dup.push(self.name)) return es if es } @@ -563,10 +563,10 @@ t ? rewrite(t) : nil end def rewrite(tree) - return !! methods.find { |m| m.to_s.match?(/^rewrite_/) } if tree == 0 + return !! methods.find { |m| m.to_s.start_with?('rewrite_') } if tree == 0 # return true when "rewrite_xxx" methods seem to have been provided send("rewrite_#{tree.name}", tree) end