mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
parser: no longer use the "braceless" non-terminal
The purpose of this symbol was only to factor function calls. As a
result the actions were indeed simpler, but the grammar was somewhat
uselessly obfuscated. Get rid of this symbol, but introduce functions
to simplify dependencies.
There is no (intended) changes of behavior here.
* src/parse-gram.y (strip_braces, translate_code(
(translate_code_braceless): New.
(braceless): Remove, use "{...}" instead, and one of the previous
functions depending on the context.
(STRING, "%{...%}", EPILOGUE): Declare as <code>, instead of <chars>,
the difference between both is useless (well, I couldn't make sense of
it, even after having read the initial commit that introduced them).
(%union): Remove the now useless "chars" type.
Adjust the printers.
* src/scan-gram.l: Adjust.
This commit is contained in:
@@ -512,7 +512,7 @@ eqopt ([[:space:]]*=)?
|
||||
"\"" {
|
||||
STRING_FINISH;
|
||||
loc->start = token_start;
|
||||
val->chars = last_string;
|
||||
val->code = last_string;
|
||||
BEGIN INITIAL;
|
||||
return STRING;
|
||||
}
|
||||
@@ -751,7 +751,7 @@ eqopt ([[:space:]]*=)?
|
||||
"%}" {
|
||||
STRING_FINISH;
|
||||
loc->start = code_start;
|
||||
val->chars = last_string;
|
||||
val->code = last_string;
|
||||
BEGIN INITIAL;
|
||||
return PROLOGUE;
|
||||
}
|
||||
@@ -770,7 +770,7 @@ eqopt ([[:space:]]*=)?
|
||||
<<EOF>> {
|
||||
STRING_FINISH;
|
||||
loc->start = code_start;
|
||||
val->chars = last_string;
|
||||
val->code = last_string;
|
||||
BEGIN INITIAL;
|
||||
return EPILOGUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user