Kouhei Sutou
null+****@clear*****
Sat Aug 8 16:17:26 JST 2015
Kouhei Sutou 2015-08-08 16:17:26 +0900 (Sat, 08 Aug 2015) New Revision: 98ab353a80664ce831da45a6fdd08268d871f0a4 https://github.com/groonga/groonga-command-parser/commit/98ab353a80664ce831da45a6fdd08268d871f0a4 Message: Accept no after text case Modified files: lib/groonga/command/parser/error.rb Modified: lib/groonga/command/parser/error.rb (+8 -5) =================================================================== --- lib/groonga/command/parser/error.rb 2015-08-08 16:16:37 +0900 (271dac6) +++ lib/groonga/command/parser/error.rb 2015-08-08 16:17:26 +0900 (8796aeb) @@ -43,7 +43,6 @@ module Groonga location << after else before_lines = before.lines.to_a - after_lines = after.lines.to_a last_before_line = before_lines.last if last_before_line error_offset = last_before_line.bytesize @@ -53,10 +52,14 @@ module Groonga before_lines.each do |before_line| location << before_line end - location << after_lines.first - location << " " * error_offset + "^\n" - after_lines[1..-1].each do |after_line| - location << after_line + + unless after.empty? + after_lines = after.lines.to_a + location << after_lines.first + location << " " * error_offset + "^\n" + after_lines[1..-1].each do |after_line| + location << after_line + end end end location -------------- next part -------------- HTML����������������������������...Download