EXPR_LABEL also indicates non-continuation line

Example:

  [
    1, # this is not continuation line
    2
  ]
This commit is contained in:
aycabta 2019-06-27 16:03:43 +09:00
parent 097554855c
commit 2fd03fd7e6

View File

@ -308,7 +308,7 @@ class RubyLex
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|