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

ruby-changes:41762

From: nobu <ko1@a...>
Date: Tue, 16 Feb 2016 02:41:25 +0900 (JST)
Subject: [ruby-changes:41762] nobu:r53836 (trunk): parse.y: short circuit by result

nobu	2016-02-16 02:41:46 +0900 (Tue, 16 Feb 2016)

  New Revision: 53836

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

  Log:
    parse.y: short circuit by result
    
    * parse.y (parse_ident): short circuit by result, as only
      tIDENTIFIER can be a local variable, but tFID and tCONSTANT not.
      fix up r53834.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 53835)
+++ parse.y	(revision 53836)
@@ -8072,6 +8072,7 @@ parse_ident(struct parser_params *parser https://github.com/ruby/ruby/blob/trunk/parse.y#L8072
 
     ident = tokenize_ident(parser, last_state);
     if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
+	(result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
 	lvar_defined(ident)) {
 	SET_LEX_STATE(EXPR_END|EXPR_LABEL);
     }

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

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