Introduce inline_primary rule
Introduce inline_primary rule to merge the same BNF pattern
This commit is contained in:
parent
9c8c140d73
commit
d278d352f9
Notes:
git
2024-10-25 13:26:48 +00:00
Merged: https://github.com/ruby/ruby/pull/11881 Merged-By: nobu <nobu@ruby-lang.org>
15
parse.y
15
parse.y
@ -4374,7 +4374,8 @@ mrhs : args ',' arg_value
|
||||
}
|
||||
;
|
||||
|
||||
primary : literal
|
||||
%rule %inline inline_primary
|
||||
: literal
|
||||
| strings
|
||||
| xstring
|
||||
| regexp
|
||||
@ -4382,6 +4383,9 @@ primary : literal
|
||||
| qwords
|
||||
| symbols
|
||||
| qsymbols
|
||||
;
|
||||
|
||||
primary : inline_primary
|
||||
| var_ref
|
||||
| backref
|
||||
| tFID
|
||||
@ -5863,14 +5867,7 @@ p_value : p_primitive
|
||||
}
|
||||
;
|
||||
|
||||
p_primitive : literal
|
||||
| strings
|
||||
| xstring
|
||||
| regexp
|
||||
| words
|
||||
| qwords
|
||||
| symbols
|
||||
| qsymbols
|
||||
p_primitive : inline_primary
|
||||
| keyword_variable
|
||||
{
|
||||
if (!($$ = gettable(p, $1, &@$))) $$ = NEW_ERROR(&@$);
|
||||
|
Loading…
x
Reference in New Issue
Block a user