style: factor common bits about string scanning

* src/scan-gram.l: here.
This commit is contained in:
Akim Demaille
2020-06-13 08:50:45 +02:00
parent b7fbfd050e
commit cef13e11f5

View File

@@ -566,8 +566,6 @@ eqopt ({sp}=)?
_("POSIX Yacc does not support string literals"));
RETURN_VALUE (STRING, last_string);
}
<<EOF>> unexpected_eof (token_start, "\"");
{eol} unexpected_newline (token_start, "\"");
}
<SC_ESCAPED_TSTRING>
@@ -580,10 +578,15 @@ eqopt ({sp}=)?
_("POSIX Yacc does not support string literals"));
RETURN_VALUE (TSTRING, last_string);
}
}
<SC_ESCAPED_STRING,SC_ESCAPED_TSTRING>
{
<<EOF>> unexpected_eof (token_start, "\"");
"\n" unexpected_newline (token_start, "\"");
}
/*----------------------------------------------------------.
| Scanning a Bison character literal, decoding its escapes. |
| The initial quote is already eaten. |