mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Do not continue line if last expression is an endless range
Fixes [Bug #14824] https://github.com/ruby/irb/commit/63414f8465
This commit is contained in:
parent
45b3a5f7de
commit
2cc5827fdc
1 changed files with 2 additions and 1 deletions
|
@ -277,8 +277,9 @@ class RubyLex
|
|||
return true
|
||||
elsif tokens.size >= 1 and tokens[-1][1] == :on_heredoc_end # "EOH\n"
|
||||
return false
|
||||
elsif tokens.size >= 2 and defined?(Ripper::EXPR_BEG) and tokens[-2][3].anybits?(Ripper::EXPR_BEG | Ripper::EXPR_FNAME)
|
||||
elsif tokens.size >= 2 and defined?(Ripper::EXPR_BEG) and tokens[-2][3].anybits?(Ripper::EXPR_BEG | Ripper::EXPR_FNAME) and tokens[-2][2] !~ /\A\.\.\.?\z/
|
||||
# end of literal except for regexp
|
||||
# endless range at end of line is not a continue
|
||||
return true
|
||||
end
|
||||
false
|
||||
|
|
Loading…
Add table
Reference in a new issue