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

ruby-changes:58958

From: aycabta <ko1@a...>
Date: Fri, 29 Nov 2019 17:39:38 +0900 (JST)
Subject: [ruby-changes:58958] c4686b9235 (master): Revert "Treat :@1, :@@1, @1, and @@1 correctly to check termination"

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

From c4686b92359d298f281f3943ba205858e183e7af Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Fri, 29 Nov 2019 17:36:54 +0900
Subject: Revert "Treat :@1, :@@1, @1, and @@1 correctly to check termination"

This reverts commit 5e275dd2af4d9d24cdb1cfc0f232f348dae9c2cd.

...The @1 type numberd parameter is reverted from Ruby syntax.

diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index ad6cb93..1761afe 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -186,15 +186,6 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L186
       return false
     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
-      return false
-    elsif @tokens.size >= 2 and @tokens[-2][1] == :on_ivar and @tokens[-2][2] =~ /\A@\d+\z/
-      # This is for @1
-      return false
-    elsif @tokens.size >= 2 and @tokens[-2][1] == :on_cvar and @tokens[-1][1] == :on_int
-      # This is for @@1 or :@@1 and ends with on_int because it's syntax error
-      return false
     elsif !@tokens.empty? and @tokens.last[2] == "\\\n"
       return true
     elsif @tokens.size >= 1 and @tokens[-1][1] == :on_heredoc_end # "EOH\n"
@@ -265,12 +256,6 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L256
         #   example:
         #     method / f /
         return false
-      when /numbered parameter outside block/
-        # "numbered parameter outside block"
-        #
-        #   example:
-        #     :@1
-        return false
       end
     ensure
       $VERBOSE = verbose
-- 
cgit v0.10.2


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

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