diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-15 14:14:13 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-15 21:36:23 +0900 |
commit | e0bdd54348514ff06df88a9bac88fa56058235a4 (patch) | |
tree | 0ddf16cabf36e7b2c1421f5b3a6392b0e32236ae /ext/ripper | |
parent | 2e436982ee64301aceb97e0c8d5b06b94fc7b580 (diff) |
Ripper: Refined error callbacks [Bug #17345]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3909
Diffstat (limited to 'ext/ripper')
-rw-r--r-- | ext/ripper/lib/ripper/lexer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb index e1a21d628b..6a9a9cb39a 100644 --- a/ext/ripper/lib/ripper/lexer.rb +++ b/ext/ripper/lib/ripper/lexer.rb @@ -190,8 +190,8 @@ class Ripper e end - def on_error(mesg) - @errors.push Elem.new([lineno(), column()], __callee__, token(), state(), mesg) + def on_error(mesg, tok = token()) + @errors.push Elem.new([lineno(), column()], __callee__, tok, state(), mesg) end PARSER_EVENTS.grep(/_error\z/) do |e| alias_method "on_#{e}", :on_error |