ruby-changes:49781
From: nobu <ko1@a...>
Date: Thu, 18 Jan 2018 12:25:26 +0900 (JST)
Subject: [ruby-changes:49781] nobu:r61899 (trunk): parse.y: REQUIRED_KEYWORD
nobu 2018-01-18 12:25:20 +0900 (Thu, 18 Jan 2018) New Revision: 61899 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61899 Log: parse.y: REQUIRED_KEYWORD * parse.y (REQUIRED_KEYWORD): special argument for required keyword argument, for core and ripper. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61898) +++ parse.y (revision 61899) @@ -474,7 +474,6 @@ static ID ripper_get_id(VALUE); https://github.com/ruby/ruby/blob/trunk/parse.y#L474 static VALUE ripper_get_value(VALUE); #define get_value(val) ripper_get_value(val) static VALUE assignable(struct parser_params*,VALUE,VALUE,const YYLTYPE*); -#define assignable(p,id,val,loc) assignable((p),(id),(VALUE)(val),(loc)) static int id_is_var(struct parser_params *p, ID id); #define method_cond(p,node,loc) (node) @@ -725,10 +724,12 @@ static VALUE heredoc_dedent(struct parse https://github.com/ruby/ruby/blob/trunk/parse.y#L724 #ifndef RIPPER # define Qnone 0 # define Qnull 0 +# define REQUIRED_KEYWORD NODE_SPECIAL_REQUIRED_KEYWORD # define ifndef_ripper(x) (x) #else # define Qnone Qnil # define Qnull Qundef +# define REQUIRED_KEYWORD Qundef # define ifndef_ripper(x) #endif @@ -4179,7 +4180,7 @@ f_kw : f_label arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4180 | f_label { p->cur_arg = 0; - $$ = assignable(p, $1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$); + $$ = assignable(p, $1, REQUIRED_KEYWORD, &@$); /*%%%*/ $$ = new_kw_arg(p, $$, &@$); /*% @@ -4199,7 +4200,7 @@ f_block_kw : f_label primary_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4200 } | f_label { - $$ = assignable(p, $1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$); + $$ = assignable(p, $1, REQUIRED_KEYWORD, &@$); /*%%%*/ $$ = new_kw_arg(p, $$, &@$); /*% -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/