1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Made :nil static ID

This commit is contained in:
Nobuyoshi Nakada 2019-09-01 13:37:28 +09:00
parent e5dd63ba8c
commit e80a6f65c8
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 4 additions and 3 deletions

View file

@ -54,6 +54,7 @@ firstline, predefined = __LINE__+1, %[\
fdiv fdiv
quo quo
name name
nil
_ UScore _ UScore
"/*NULL*/" NULL "/*NULL*/" NULL

View file

@ -3248,7 +3248,7 @@ block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg
} }
| f_no_kwarg opt_f_block_arg | f_no_kwarg opt_f_block_arg
{ {
$$ = new_args_tail(p, Qnone, ID2SYM(rb_intern("nil")), $2, &@1); $$ = new_args_tail(p, Qnone, ID2SYM(idNil), $2, &@1);
} }
| f_block_arg | f_block_arg
{ {
@ -4719,7 +4719,7 @@ args_tail : f_kwarg ',' f_kwrest opt_f_block_arg
} }
| f_no_kwarg opt_f_block_arg | f_no_kwarg opt_f_block_arg
{ {
$$ = new_args_tail(p, Qnone, ID2SYM(rb_intern("nil")), $2, &@1); $$ = new_args_tail(p, Qnone, ID2SYM(idNil), $2, &@1);
} }
| f_block_arg | f_block_arg
{ {
@ -11152,7 +11152,7 @@ new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block,
args->kw_rest_arg = NEW_DVAR(kw_rest_arg, loc); args->kw_rest_arg = NEW_DVAR(kw_rest_arg, loc);
args->kw_rest_arg->nd_cflag = kw_bits; args->kw_rest_arg->nd_cflag = kw_bits;
} }
else if (kw_rest_arg == ID2SYM(rb_intern("nil"))) { else if (kw_rest_arg == ID2SYM(idNil)) {
args->no_kwarg = 1; args->no_kwarg = 1;
} }
else if (kw_rest_arg) { else if (kw_rest_arg) {