ruby-changes:50674
From: nobu <ko1@a...>
Date: Mon, 19 Mar 2018 21:40:41 +0900 (JST)
Subject: [ruby-changes:50674] nobu:r62839 (trunk): parse.y: push `do` token info
nobu 2018-03-19 21:40:34 +0900 (Mon, 19 Mar 2018) New Revision: 62839 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62839 Log: parse.y: push `do` token info * parse.y (k_rescue, k_ensure): revert r62838. * parse.y (k_do, k_do_LAMBDA, k_do_block): push token infos of `do`. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 62838) +++ parse.y (revision 62839) @@ -2719,17 +2719,27 @@ k_def : keyword_def https://github.com/ruby/ruby/blob/trunk/parse.y#L2719 } ; +k_do : keyword_do + { + token_info_push(p, "do", &@$); + } + ; + +k_do_block : keyword_do_block + { + token_info_push(p, "do", &@$); + } + ; + k_rescue : keyword_rescue { - if (p->token_info && strcmp(p->token_info->token, "begin") == 0) - token_info_warn(p, "rescue", p->token_info, &@$); + token_info_warn(p, "rescue", p->token_info, &@$); } ; k_ensure : keyword_ensure { - if (p->token_info && strcmp(p->token_info->token, "begin") == 0) - token_info_warn(p, "ensure", p->token_info, &@$); + token_info_warn(p, "ensure", p->token_info, &@$); } ; @@ -3105,7 +3115,7 @@ lambda_body : tLAMBEG compstmt '}' https://github.com/ruby/ruby/blob/trunk/parse.y#L3115 } ; -do_block : keyword_do_block do_body keyword_end +do_block : k_do_block do_body k_end { $$ = $2; /*%%%*/ @@ -3235,7 +3245,7 @@ brace_block : '{' brace_body '}' https://github.com/ruby/ruby/blob/trunk/parse.y#L3245 nd_set_line($$, @1.end_pos.lineno); /*% %*/ } - | keyword_do do_body keyword_end + | k_do do_body k_end { $$ = $2; /*%%%*/ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/