aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-20 09:56:13 +0900
committeraycabta <aycabta@gmail.com>2019-11-20 09:56:13 +0900
commit19a310b0ac6bfc78340d37963ea2655783760bee (patch)
treeae2a6f89ce4a8608c313d1cac1d76fc08b9d7baa
parent49b4507fd3caed356e4039da5820a7c843c6b05a (diff)
downloadruby-19a310b0ac6bfc78340d37963ea2655783760bee.tar.gz
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
-rw-r--r--lib/irb/ruby-lex.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 81024ea5bd..586123fa38 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -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