[前][次][番号順一覧][スレッド一覧]

ruby-changes:59361

From: Yusuke <ko1@a...>
Date: Sun, 22 Dec 2019 05:03:02 +0900 (JST)
Subject: [ruby-changes:59361] a3cc2a2fbd (master): [ruby/irb] Fix auto-indent for `1.times do`

https://git.ruby-lang.org/ruby.git/commit/?id=a3cc2a2fbd

From a3cc2a2fbde23637fb924f75e977599b7a475118 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Sat, 14 Dec 2019 16:07:21 +0900
Subject: [ruby/irb] Fix auto-indent for `1.times do`

Fixes #47

https://github.com/ruby/irb/commit/6b8eca4635

diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 24074f3..a012d49 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -336,7 +336,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L336
         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].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN)
+          if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN | Ripper::EXPR_ARG)
             # method_with_block do; end
             depth_difference += 1
           else
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]