diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb index 23db3a0570..cc1f74f1e3 100644 --- a/ext/ripper/lib/ripper/lexer.rb +++ b/ext/ripper/lib/ripper/lexer.rb @@ -119,6 +119,8 @@ class Ripper "#<#{self.class}: #{event}@#{pos[0]}:#{pos[1]}:#{state}: #{tok.inspect}#{": " if message}#{message}>" end + alias to_s inspect + def pretty_print(q) q.group(2, "#<#{self.class}:", ">") { q.breakable