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

ruby-changes:56225

From: Nobuyoshi <ko1@a...>
Date: Wed, 26 Jun 2019 15:01:48 +0900 (JST)
Subject: [ruby-changes:56225] Nobuyoshi Nakada: fe0ddf0e58 (trunk): `ensure` is not a continuos line

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

From fe0ddf0e58e65ab3ae3d6e73382c3bebcd4541e5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 26 Jun 2019 15:01:01 +0900
Subject: `ensure` is not a continuos line


diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index f8127b7..53fc656 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -175,7 +175,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L175
       return false
     elsif @tokens.size >= 2 and @tokens[-2][1] == :on_semicolon
       return false
-    elsif @tokens.size >= 2 and @tokens[-2][1] == :on_kw and (@tokens[-2][2] == 'begin' or @tokens[-2][2] == 'else')
+    elsif @tokens.size >= 2 and @tokens[-2][1] == :on_kw and ['begin', 'else', 'ensure'].include?(@tokens[-2][2])
       return false
     elsif @tokens.size >= 3 and @tokens[-3][1] == :on_symbeg and @tokens[-2][1] == :on_ivar
       # This is for :@a or :@1 because :@1 ends with EXPR_FNAME
-- 
cgit v0.10.2


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

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