From 519af46806ec86fd8ec47544f2bee3790b16118f Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 8 Dec 2016 08:31:01 +0000 Subject: 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/ruby-lex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 879c45c565..ca01662eee 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -792,7 +792,7 @@ class RubyLex 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 -- cgit v1.2.3