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

ruby-changes:44954

From: nobu <ko1@a...>
Date: Thu, 8 Dec 2016 17:31:04 +0900 (JST)
Subject: [ruby-changes:44954] nobu:r57027 (trunk): ruby-lex.rb: fix for label

nobu	2016-12-08 17:31:01 +0900 (Thu, 08 Dec 2016)

  New Revision: 57027

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57027

  Log:
    ruby-lex.rb: fix for label
    
    * lib/irb/ruby-lex.rb (identify_identifier): treat identifier just
      followed by a colon as a lable.  this is not a precise solution
      but enough for the time being.  [ruby-core:78526] [Bug #13012]

  Modified files:
    trunk/lib/irb/ruby-lex.rb
Index: lib/irb/ruby-lex.rb
===================================================================
--- lib/irb/ruby-lex.rb	(revision 57026)
+++ lib/irb/ruby-lex.rb	(revision 57027)
@@ -792,7 +792,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L792
           token_c = TkSymbol2Token[trans[1]]
           @lex_state = trans[0]
         else
-          if @lex_state != EXPR_FNAME
+          if @lex_state != EXPR_FNAME and peek(0) != ':'
             if ENINDENT_CLAUSE.include?(token)
               # check for ``class = val'' etc.
               valid = true

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

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