summaryrefslogtreecommitdiff
path: root/lib/irb/color.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-29 13:34:19 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-29 13:34:19 +0900
commit068d327595814a3448290eeba897fc37a8bb2dfb (patch)
tree323bdd2fbd30efbc437bb35dbc62ace81db94232 /lib/irb/color.rb
parentcc66272e5061020cac6864bbc2f68f7d327ecfbb (diff)
Colorize compile_error as same as on_parse_error
Diffstat (limited to 'lib/irb/color.rb')
-rw-r--r--lib/irb/color.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index b53cc75035..b1f7c21743 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -56,7 +56,7 @@ module IRB # :nodoc:
on_tstring_content: [[RED], ALL],
on_tstring_end: [[RED], ALL],
on_words_beg: [[RED], ALL],
- on_parse_error: [[RED, REVERSE], ALL],
+ ERROR: [[RED, REVERSE], ALL],
}
rescue NameError
# Give up highlighting Ripper-incompatible older Ruby
@@ -67,7 +67,8 @@ module IRB # :nodoc:
class Lexer < Ripper::Lexer
if method_defined?(:token)
def on_error(mesg)
- @buf.push Elem.new([lineno(), column()], __callee__, token(), state())
+ # :ERROR comes before other :on_ symbols
+ @buf.push Elem.new([lineno(), column()], :ERROR, token(), state())
end
alias on_parse_error on_error
alias compile_error on_error