mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 09:47:00 +02:00
Fix lexing of U& sequences just before EOF.
Commit a5ff502fce
was a brick shy of a load
in the backend lexer too, not just psql. Per further testing of bug #9068.
In passing, improve related comments.
This commit is contained in:
parent
0def2573c5
commit
0c2338abbb
@ -155,6 +155,9 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
|
|||||||
* <xus> quoted string with Unicode escapes
|
* <xus> quoted string with Unicode escapes
|
||||||
* <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
|
* <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
|
||||||
* <xeu> Unicode surrogate pair in extended quoted string
|
* <xeu> Unicode surrogate pair in extended quoted string
|
||||||
|
*
|
||||||
|
* Remember to add an <<EOF>> case whenever you add a new exclusive state!
|
||||||
|
* The default one is probably not the right thing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%x xb
|
%x xb
|
||||||
@ -545,12 +548,13 @@ other .
|
|||||||
<xus>{quotefail} {
|
<xus>{quotefail} {
|
||||||
/* throw back all but the quote */
|
/* throw back all but the quote */
|
||||||
yyless(1);
|
yyless(1);
|
||||||
/* handle possible UESCAPE in xusend mode */
|
/* xusend state looks for possible UESCAPE */
|
||||||
BEGIN(xusend);
|
BEGIN(xusend);
|
||||||
}
|
}
|
||||||
<xusend>{whitespace}
|
<xusend>{whitespace} { /* stay in xusend state over whitespace */ }
|
||||||
<xusend>{other} |
|
<xusend>{other} |
|
||||||
<xusend>{xustop1} {
|
<xusend>{xustop1} |
|
||||||
|
<xusend><<EOF>> {
|
||||||
/* no UESCAPE after the quote, throw back everything */
|
/* no UESCAPE after the quote, throw back everything */
|
||||||
yyless(0);
|
yyless(0);
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
@ -725,12 +729,13 @@ other .
|
|||||||
}
|
}
|
||||||
<xui>{dquote} {
|
<xui>{dquote} {
|
||||||
yyless(1);
|
yyless(1);
|
||||||
/* handle possible UESCAPE in xuiend mode */
|
/* xuiend state looks for possible UESCAPE */
|
||||||
BEGIN(xuiend);
|
BEGIN(xuiend);
|
||||||
}
|
}
|
||||||
<xuiend>{whitespace} { }
|
<xuiend>{whitespace} { /* stay in xuiend state over whitespace */ }
|
||||||
<xuiend>{other} |
|
<xuiend>{other} |
|
||||||
<xuiend>{xustop1} {
|
<xuiend>{xustop1} |
|
||||||
|
<xuiend><<EOF>> {
|
||||||
/* no UESCAPE after the quote, throw back everything */
|
/* no UESCAPE after the quote, throw back everything */
|
||||||
char *ident;
|
char *ident;
|
||||||
|
|
||||||
|
@ -166,7 +166,8 @@ static void escape_variable(bool as_ident);
|
|||||||
* <xe> extended quoted strings (support backslash escape sequences)
|
* <xe> extended quoted strings (support backslash escape sequences)
|
||||||
* <xdolq> $foo$ quoted strings
|
* <xdolq> $foo$ quoted strings
|
||||||
* <xui> quoted identifier with Unicode escapes
|
* <xui> quoted identifier with Unicode escapes
|
||||||
* <xuiend> end of a quoted identifier with Unicode escapes, UESCAPE can follow * <xus> quoted string with Unicode escapes
|
* <xuiend> end of a quoted identifier with Unicode escapes, UESCAPE can follow
|
||||||
|
* <xus> quoted string with Unicode escapes
|
||||||
* <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
|
* <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
|
||||||
*
|
*
|
||||||
* Note: we intentionally don't mimic the backend's <xeu> state; we have
|
* Note: we intentionally don't mimic the backend's <xeu> state; we have
|
||||||
|
Loading…
Reference in New Issue
Block a user