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

ruby-changes:50673

From: nobu <ko1@a...>
Date: Mon, 19 Mar 2018 17:37:17 +0900 (JST)
Subject: [ruby-changes:50673] nobu:r62838 (trunk): parse.y: ignore do indentations

nobu	2018-03-19 17:37:12 +0900 (Mon, 19 Mar 2018)

  New Revision: 62838

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

  Log:
    parse.y: ignore do indentations
    
    * parse.y (k_rescue, k_ensure): ignore indentations of `do`, it
      is not at the beginning of line usually.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 62837)
+++ parse.y	(revision 62838)
@@ -2721,13 +2721,15 @@ k_def		: keyword_def https://github.com/ruby/ruby/blob/trunk/parse.y#L2721
 
 k_rescue	: keyword_rescue
 		    {
-			token_info_warn(p, "rescue", p->token_info, &@$);
+			if (p->token_info && strcmp(p->token_info->token, "begin") == 0)
+			    token_info_warn(p, "rescue", p->token_info, &@$);
 		    }
 		;
 
 k_ensure	: keyword_ensure
 		    {
-			token_info_warn(p, "ensure", p->token_info, &@$);
+			if (p->token_info && strcmp(p->token_info->token, "begin") == 0)
+			    token_info_warn(p, "ensure", p->token_info, &@$);
 		    }
 		;
 

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

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