diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb index b7735fcc42..bb5908025d 100644 --- a/ext/ripper/lib/ripper/lexer.rb +++ b/ext/ripper/lib/ripper/lexer.rb @@ -50,8 +50,7 @@ class Ripper class Elem class List < ::Array def inspect - pos, event, tok, state = self - [pos, event, tok, Ripper.lex_state_name(state)].inspect + super.sub!(/\d+(?=\]\z)/, Ripper.lex_state_name(self[3])) end def pretty_print(q) # :nodoc: