summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-20 00:31:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-20 00:31:02 +0000
commit740248425c5a47cb3f73eda97b42d52ef1070349 (patch)
tree1682f999704a55c99f1a935d725cccdf32aad720 /parse.y
parentafa1505ca89bd350558f1f42b96f1eee781ef019 (diff)
parse.y: make tNUMPARAM id
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 3 insertions, 13 deletions
diff --git a/parse.y b/parse.y
index f43f40697c..a95337efd1 100644
--- a/parse.y
+++ b/parse.y
@@ -862,6 +862,7 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
%token <id> tCONSTANT "constant"
%token <id> tCVAR "class variable"
%token <id> tLABEL
+%token <id> tNUMPARAM "numbered parameter"
%token <node> tINTEGER "integer literal"
%token <node> tFLOAT "float literal"
%token <node> tRATIONAL "rational literal"
@@ -871,7 +872,6 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in
%token <node> tBACK_REF "back reference"
%token <node> tSTRING_CONTENT "literal content"
%token <num> tREGEXP_END
-%token <num> tNUMPARAM "numbered parameter"
%type <node> singleton strings string string1 xstring regexp
%type <node> string_contents xstring_contents regexp_contents string_content
@@ -3820,11 +3820,9 @@ string_dvar : tGVAR
}
| tNUMPARAM
{
- ID id = numparam_id(p, get_num($1));
/*%%%*/
- $$ = NEW_DVAR(id, &@1);
+ $$ = NEW_DVAR($1, &@1);
/*% %*/
- (void)id;
/*% ripper: var_ref!($1) %*/
}
| backref
@@ -3883,14 +3881,6 @@ user_variable : tIDENTIFIER
| tCONSTANT
| tCVAR
| tNUMPARAM
- {
- ID id = numparam_id(p, get_num($1));
- /*%%%*/
- $$ = id;
- /*%
- $$ = ripper_new_yylval(p, id, get_value($1), 0);
- %*/
- }
;
keyword_variable: keyword_nil {$$ = KWD2EID(nil, $1);}
@@ -7663,7 +7653,7 @@ parser_numbered_param(struct parser_params *p, unsigned long n)
compile_error(p, "ordinary parameter is defined");
return false;
}
- set_yylval_num((int)n);
+ set_yylval_name(numparam_id(p, (int)n));
SET_LEX_STATE(EXPR_ARG);
return true;
}