Skip to content

Commit

Permalink
EXPR_LABEL also indicates non-continuation line
Browse files Browse the repository at this point in the history
Example:

  [
    1, # this is not continuation line
    2
  ]
  • Loading branch information
aycabta committed Jun 27, 2019
1 parent 0975548 commit 2fd03fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/irb/ruby-lex.rb
Expand Up @@ -308,7 +308,7 @@ def process_nesting_level

def check_newline_depth_difference
depth_difference = 0
if @tokens.size >= 2 and @tokens.last[2].end_with?("\n") and @tokens[-2][3].nobits?(Ripper::EXPR_END | Ripper::EXPR_ENDFN | Ripper::EXPR_CMDARG)
if @tokens.size >= 2 and @tokens.last[2].end_with?("\n") and @tokens[-2][3].nobits?(Ripper::EXPR_END | Ripper::EXPR_ENDFN | Ripper::EXPR_CMDARG | Ripper::EXPR_LABEL)
return 1
end
@tokens.each_with_index do |t, index|
Expand Down

0 comments on commit 2fd03fd

Please sign in to comment.