diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 05:39:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 05:39:03 +0000 |
commit | 0b8594209dfb536ee56269276c12d38ee4b85fcf (patch) | |
tree | f15b4bfff20cecc6af9c7c48c723afb9e6e4e2ab | |
parent | b5be3e78938ba17d389df1c8f4bdbcc8b4c73550 (diff) | |
download | ruby-0b8594209dfb536ee56269276c12d38ee4b85fcf.tar.gz |
dsl.rb: p
* ext/ripper/tools/dsl.rb (DSL#initialize): define `p` for `struct
parser_params *p`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/ripper/tools/dsl.rb | 3 | ||||
-rw-r--r-- | parse.y | 34 |
2 files changed, 20 insertions, 17 deletions
diff --git a/ext/ripper/tools/dsl.rb b/ext/ripper/tools/dsl.rb index 0997a09309..3857ec0702 100644 --- a/ext/ripper/tools/dsl.rb +++ b/ext/ripper/tools/dsl.rb @@ -19,6 +19,9 @@ class DSL end /#{ re }/ =~ s + # struct parser_params *p + p = "p" + @code = eval(code) end @@ -1558,14 +1558,14 @@ mlhs_node : user_variable /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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 /*%%%*/ $$ = 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_value /*%%%*/ $$ = 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)) %*/ } ; |