1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
parent 49b4507fd3
commit 19a310b0ac

View file

@ -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