From d278d352f91203483b8b9a8870207f97003e5b93 Mon Sep 17 00:00:00 2001 From: "S.H." Date: Fri, 25 Oct 2024 22:26:29 +0900 Subject: [PATCH] Introduce inline_primary rule Introduce inline_primary rule to merge the same BNF pattern --- parse.y | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/parse.y b/parse.y index 47854476b4..244ffff795 100644 --- a/parse.y +++ b/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(&@$);