@@ -201,14 +201,14 @@ def lex
201
201
code = @line + ( line . nil? ? '' : line )
202
202
code . gsub! ( /\s *\z / , '' ) . concat ( "\n " )
203
203
@tokens = ripper_lex_without_warning ( code )
204
- @continue = process_continue ( @tokens )
205
- @code_block_open = check_code_block ( code , @tokens )
206
- @indent = process_nesting_level ( @tokens )
207
- @ltype = process_literal_type ( @tokens )
204
+ @continue = process_continue
205
+ @code_block_open = check_code_block ( code )
206
+ @indent = process_nesting_level
207
+ @ltype = process_literal_type
208
208
line
209
209
end
210
210
211
- def process_continue ( tokens )
211
+ def process_continue ( tokens = @tokens )
212
212
# last token is always newline
213
213
if tokens . size >= 2 and tokens [ -2 ] [ 1 ] == :on_regexp_end
214
214
# end of regexp literal
@@ -228,7 +228,7 @@ def process_continue(tokens)
228
228
false
229
229
end
230
230
231
- def check_code_block ( code , tokens )
231
+ def check_code_block ( code , tokens = @tokens )
232
232
return true if tokens . empty?
233
233
if tokens . last [ 1 ] == :on_heredoc_beg
234
234
return true
@@ -321,7 +321,7 @@ def check_code_block(code, tokens)
321
321
false
322
322
end
323
323
324
- def process_nesting_level ( tokens )
324
+ def process_nesting_level ( tokens = @tokens )
325
325
indent = 0
326
326
in_oneliner_def = nil
327
327
tokens . each_with_index { |t , index |
@@ -574,7 +574,7 @@ def check_string_literal(tokens)
574
574
start_token . last . nil? ? '' : start_token . last
575
575
end
576
576
577
- def process_literal_type ( tokens )
577
+ def process_literal_type ( tokens = @tokens )
578
578
start_token = check_string_literal ( tokens )
579
579
case start_token [ 1 ]
580
580
when :on_tstring_beg
0 commit comments