We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Ripper.lex
1 parent af40849 commit 905fb8eCopy full SHA for 905fb8e
lib/irb/ruby-lex.rb
@@ -88,9 +88,12 @@ def set_prompt(p = nil, &block)
88
89
def ripper_lex_without_warning(code)
90
verbose, $VERBOSE = $VERBOSE, nil
91
- tokens = nil
+ tokens = []
92
self.class.compile_with_errors_suppressed(code) do |inner_code, line_no|
93
- tokens = Ripper.lex(inner_code, '-', line_no)
+ lexer = Ripper::Lexer.new(inner_code, '-', line_no)
94
+ until (ts = lexer.lex).empty?
95
+ tokens.concat(ts)
96
+ end
97
end
98
$VERBOSE = verbose
99
tokens
0 commit comments