Use idFWD_* instead of ANON_*_ID
This commit is contained in:
parent
4fc668a4f3
commit
a0e4dc52b0
Notes:
git
2022-11-29 02:22:28 +00:00
32
parse.y
32
parse.y
@ -665,10 +665,6 @@ static void token_info_drop(struct parser_params *p, const char *token, rb_code_
|
|||||||
|
|
||||||
#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
|
#define lambda_beginning_p() (p->lex.lpar_beg == p->lex.paren_nest)
|
||||||
|
|
||||||
#define ANON_BLOCK_ID '&'
|
|
||||||
#define ANON_REST_ID '*'
|
|
||||||
#define ANON_KEYWORD_REST_ID idPow
|
|
||||||
|
|
||||||
static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
|
static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
|
||||||
|
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
@ -3116,11 +3112,11 @@ block_arg : tAMPER arg_value
|
|||||||
}
|
}
|
||||||
| tAMPER
|
| tAMPER
|
||||||
{
|
{
|
||||||
if (!local_id(p, ANON_BLOCK_ID)) {
|
if (!local_id(p, idFWD_BLOCK)) {
|
||||||
compile_error(p, "no anonymous block parameter");
|
compile_error(p, "no anonymous block parameter");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = NEW_BLOCK_PASS(NEW_LVAR(ANON_BLOCK_ID, &@1), &@$);
|
$$ = NEW_BLOCK_PASS(NEW_LVAR(idFWD_BLOCK, &@1), &@$);
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: Qnil %*/
|
/*% ripper: Qnil %*/
|
||||||
}
|
}
|
||||||
@ -3153,11 +3149,11 @@ args : arg_value
|
|||||||
}
|
}
|
||||||
| tSTAR
|
| tSTAR
|
||||||
{
|
{
|
||||||
if (!local_id(p, ANON_REST_ID)) {
|
if (!local_id(p, idFWD_REST)) {
|
||||||
compile_error(p, "no anonymous rest parameter");
|
compile_error(p, "no anonymous rest parameter");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = NEW_SPLAT(NEW_LVAR(ANON_REST_ID, &@1), &@$);
|
$$ = NEW_SPLAT(NEW_LVAR(idFWD_REST, &@1), &@$);
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: args_add_star!(args_new!, Qnil) %*/
|
/*% ripper: args_add_star!(args_new!, Qnil) %*/
|
||||||
}
|
}
|
||||||
@ -3177,11 +3173,11 @@ args : arg_value
|
|||||||
}
|
}
|
||||||
| args ',' tSTAR
|
| args ',' tSTAR
|
||||||
{
|
{
|
||||||
if (!local_id(p, ANON_REST_ID)) {
|
if (!local_id(p, idFWD_REST)) {
|
||||||
compile_error(p, "no anonymous rest parameter");
|
compile_error(p, "no anonymous rest parameter");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = rest_arg_append(p, $1, NEW_LVAR(ANON_REST_ID, &@3), &@$);
|
$$ = rest_arg_append(p, $1, NEW_LVAR(idFWD_REST, &@3), &@$);
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: args_add_star!($1, Qnil) %*/
|
/*% ripper: args_add_star!($1, Qnil) %*/
|
||||||
}
|
}
|
||||||
@ -5813,9 +5809,9 @@ f_kwrest : kwrest_mark tIDENTIFIER
|
|||||||
}
|
}
|
||||||
| kwrest_mark
|
| kwrest_mark
|
||||||
{
|
{
|
||||||
arg_var(p, ANON_KEYWORD_REST_ID);
|
arg_var(p, idFWD_KWREST);
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = ANON_KEYWORD_REST_ID;
|
$$ = idFWD_KWREST;
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: kwrest_param!(Qnil) %*/
|
/*% ripper: kwrest_param!(Qnil) %*/
|
||||||
}
|
}
|
||||||
@ -5889,9 +5885,9 @@ f_rest_arg : restarg_mark tIDENTIFIER
|
|||||||
}
|
}
|
||||||
| restarg_mark
|
| restarg_mark
|
||||||
{
|
{
|
||||||
arg_var(p, ANON_REST_ID);
|
arg_var(p, idFWD_REST);
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = ANON_REST_ID;
|
$$ = idFWD_REST;
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: rest_param!(Qnil) %*/
|
/*% ripper: rest_param!(Qnil) %*/
|
||||||
}
|
}
|
||||||
@ -5911,9 +5907,9 @@ f_block_arg : blkarg_mark tIDENTIFIER
|
|||||||
}
|
}
|
||||||
| blkarg_mark
|
| blkarg_mark
|
||||||
{
|
{
|
||||||
arg_var(p, ANON_BLOCK_ID);
|
arg_var(p, idFWD_BLOCK);
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = ANON_BLOCK_ID;
|
$$ = idFWD_BLOCK;
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: blockarg!(Qnil) %*/
|
/*% ripper: blockarg!(Qnil) %*/
|
||||||
}
|
}
|
||||||
@ -6047,12 +6043,12 @@ assoc : arg_value tASSOC arg_value
|
|||||||
}
|
}
|
||||||
| tDSTAR
|
| tDSTAR
|
||||||
{
|
{
|
||||||
if (!local_id(p, ANON_KEYWORD_REST_ID)) {
|
if (!local_id(p, idFWD_KWREST)) {
|
||||||
compile_error(p, "no anonymous keyword rest parameter");
|
compile_error(p, "no anonymous keyword rest parameter");
|
||||||
}
|
}
|
||||||
/*%%%*/
|
/*%%%*/
|
||||||
$$ = list_append(p, NEW_LIST(0, &@$),
|
$$ = list_append(p, NEW_LIST(0, &@$),
|
||||||
NEW_LVAR(ANON_KEYWORD_REST_ID, &@$));
|
NEW_LVAR(idFWD_KWREST, &@$));
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: assoc_splat!(Qnil) %*/
|
/*% ripper: assoc_splat!(Qnil) %*/
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user