ruby-changes:49858
From: nobu <ko1@a...>
Date: Sat, 20 Jan 2018 14:46:53 +0900 (JST)
Subject: [ruby-changes:49858] nobu:r61976 (trunk): dsl.rb: p
nobu 2018-01-20 14:39:03 +0900 (Sat, 20 Jan 2018) New Revision: 61976 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61976 Log: dsl.rb: p * ext/ripper/tools/dsl.rb (DSL#initialize): define `p` for `struct parser_params *p`. Modified files: trunk/ext/ripper/tools/dsl.rb trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61975) +++ parse.y (revision 61976) @@ -1558,14 +1558,14 @@ mlhs_node : user_variable https://github.com/ruby/ruby/blob/trunk/parse.y#L1558 /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } | keyword_variable { /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } | primary_value '[' opt_call_args rbracket { @@ -1618,14 +1618,14 @@ lhs : user_variable https://github.com/ruby/ruby/blob/trunk/parse.y#L1618 /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } | keyword_variable { /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } | primary_value '[' opt_call_args rbracket { @@ -2745,7 +2745,7 @@ f_marg : f_norm_arg https://github.com/ruby/ruby/blob/trunk/parse.y#L2745 /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper: assignable("p", $1) %*/ + /*% ripper: assignable(p, $1) %*/ } | tLPAREN f_margs rparen { @@ -2784,14 +2784,14 @@ f_margs : f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L2784 /*%%%*/ $$ = NEW_MASGN($1, assignable(p, $4, 0, &@$), &@$); /*% %*/ - /*% ripper: mlhs_add_star!($1, assignable("p", $4)) %*/ + /*% ripper: mlhs_add_star!($1, assignable(p, $4)) %*/ } | f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list { /*%%%*/ $$ = NEW_MASGN($1, NEW_POSTARG(assignable(p, $4, 0, &@$), $6, &@$), &@$); /*% %*/ - /*% ripper: mlhs_add_post!(mlhs_add_star!($1, assignable("p", $4)), $6) %*/ + /*% ripper: mlhs_add_post!(mlhs_add_star!($1, assignable(p, $4)), $6) %*/ } | f_marg_list ',' tSTAR { @@ -2812,14 +2812,14 @@ f_margs : f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L2812 /*%%%*/ $$ = NEW_MASGN(0, assignable(p, $2, 0, &@$), &@$); /*% %*/ - /*% ripper: mlhs_add_star!(mlhs_new!, assignable("p", $2)) %*/ + /*% ripper: mlhs_add_star!(mlhs_new!, assignable(p, $2)) %*/ } | tSTAR f_norm_arg ',' f_marg_list { /*%%%*/ $$ = NEW_MASGN(0, NEW_POSTARG(assignable(p, $2, 0, &@$), $4, &@$), &@$); /*% %*/ - /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, assignable("p", $2)), $4) %*/ + /*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, assignable(p, $2)), $4) %*/ } | tSTAR { @@ -3666,14 +3666,14 @@ var_lhs : user_variable https://github.com/ruby/ruby/blob/trunk/parse.y#L3666 /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } | keyword_variable { /*%%%*/ $$ = assignable(p, $1, 0, &@$); /*% %*/ - /*% ripper[var_field_1]: assignable("p", $1) %*/ + /*% ripper[var_field_1]: assignable(p, $1) %*/ } ; @@ -3925,7 +3925,7 @@ f_kw : f_label arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L3925 /*%%%*/ $$ = new_kw_arg(p, assignable(p, $1, $2, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), get_value($2)) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/ } | f_label { @@ -3933,7 +3933,7 @@ f_kw : f_label arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L3933 /*%%%*/ $$ = new_kw_arg(p, assignable(p, $1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), 0) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/ } ; @@ -3942,14 +3942,14 @@ f_block_kw : f_label primary_value https://github.com/ruby/ruby/blob/trunk/parse.y#L3942 /*%%%*/ $$ = new_kw_arg(p, assignable(p, $1, $2, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), get_value($2)) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($2)) %*/ } | f_label { /*%%%*/ $$ = new_kw_arg(p, assignable(p, $1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), 0) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), 0) %*/ } ; @@ -4014,7 +4014,7 @@ f_opt : f_arg_asgn '=' arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4014 /*%%%*/ $$ = NEW_OPT_ARG(0, assignable(p, $1, $3, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), get_value($3)) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/ } ; @@ -4024,7 +4024,7 @@ f_block_opt : f_arg_asgn '=' primary_val https://github.com/ruby/ruby/blob/trunk/parse.y#L4024 /*%%%*/ $$ = NEW_OPT_ARG(0, assignable(p, $1, $3, &@$), &@$); /*% %*/ - /*% ripper: rb_assoc_new(get_value(assignable("p", $1)), get_value($3)) %*/ + /*% ripper: rb_assoc_new(get_value(assignable(p, $1)), get_value($3)) %*/ } ; Index: ext/ripper/tools/dsl.rb =================================================================== --- ext/ripper/tools/dsl.rb (revision 61975) +++ ext/ripper/tools/dsl.rb (revision 61976) @@ -19,6 +19,9 @@ class DSL https://github.com/ruby/ruby/blob/trunk/ext/ripper/tools/dsl.rb#L19 end /#{ re }/ =~ s + # struct parser_params *p + p = "p" + @code = eval(code) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/