A preceding token of "do" of block has EXPR_CMDARG or EXPR_ENDFN

meth do # the preceding token of "do" has EXPR_CMDARG
  end

  meth() do # the preceding token of "do" has EXPR_ENDFN
  end
This commit is contained in:
aycabta 2019-11-20 09:56:13 +09:00
Родитель 49b4507fd3
Коммит 19a310b0ac
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -306,7 +306,7 @@ class RubyLex
next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
case t[2]
when 'do'
if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_CMDARG)
if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN)
# method_with_bock do; end
indent += 1
else
@ -349,7 +349,7 @@ class RubyLex
next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
case t[2]
when 'do'
if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_CMDARG)
if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN)
# method_with_bock do; end
depth_difference += 1
else