mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
Revamp regular expressions so that " and '
do not confuse xgettext.
This commit is contained in:
@@ -259,7 +259,10 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
YY_STEP;
|
YY_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
^"#line "{int}" \""[^\"]*"\"\n" handle_syncline (yytext + strlen ("#line "), yylloc); YY_STEP;
|
^"#line "{int}" \"".*"\"\n" {
|
||||||
|
handle_syncline (yytext + sizeof "#line " - 1, yylloc);
|
||||||
|
YY_STEP;
|
||||||
|
}
|
||||||
|
|
||||||
"=" return EQUAL;
|
"=" return EQUAL;
|
||||||
":" rule_length = 0; return COLON;
|
":" rule_length = 0; return COLON;
|
||||||
@@ -450,7 +453,10 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
\\r obstack_1grow (&string_obstack, '\r');
|
\\r obstack_1grow (&string_obstack, '\r');
|
||||||
\\t obstack_1grow (&string_obstack, '\t');
|
\\t obstack_1grow (&string_obstack, '\t');
|
||||||
\\v obstack_1grow (&string_obstack, '\v');
|
\\v obstack_1grow (&string_obstack, '\v');
|
||||||
\\[\"\'?\\] obstack_1grow (&string_obstack, yytext[1]);
|
|
||||||
|
/* \\[\"\'?\\] would be shorter, but it confuses xgettext. */
|
||||||
|
\\("\""|"'"|"?"|"\\") obstack_1grow (&string_obstack, yytext[1]);
|
||||||
|
|
||||||
\\(u|U[0-9a-fA-F]{4})[0-9a-fA-F]{4} {
|
\\(u|U[0-9a-fA-F]{4})[0-9a-fA-F]{4} {
|
||||||
int c = convert_ucn_to_byte (yytext);
|
int c = convert_ucn_to_byte (yytext);
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
@@ -477,9 +483,9 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
|
|
||||||
<SC_CHARACTER>
|
<SC_CHARACTER>
|
||||||
{
|
{
|
||||||
"'" YY_OBS_GROW; BEGIN c_context;
|
"'" YY_OBS_GROW; BEGIN c_context;
|
||||||
\\{splice}[\'\\] YY_OBS_GROW;
|
\\{splice}[^$@\[\]] YY_OBS_GROW;
|
||||||
<<EOF>> unexpected_end_of_file (yylloc, "'");
|
<<EOF>> unexpected_end_of_file (yylloc, "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -490,9 +496,9 @@ splice (\\[ \f\t\v]*\n)*
|
|||||||
|
|
||||||
<SC_STRING>
|
<SC_STRING>
|
||||||
{
|
{
|
||||||
"\"" YY_OBS_GROW; BEGIN c_context;
|
"\"" YY_OBS_GROW; BEGIN c_context;
|
||||||
\\{splice}[\"\\] YY_OBS_GROW;
|
\\{splice}[^$@\[\]] YY_OBS_GROW;
|
||||||
<<EOF>> unexpected_end_of_file (yylloc, "\"");
|
<<EOF>> unexpected_end_of_file (yylloc, "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user