File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
155155 * <xus> quoted string with Unicode escapes
156156 * <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
157157 * <xeu> Unicode surrogate pair in extended quoted string
158+ *
159+ * Remember to add an <<EOF>> case whenever you add a new exclusive state!
160+ * The default one is probably not the right thing.
158161 */
159162
160163%x xb
@@ -545,12 +548,13 @@ other .
545548<xus >{quotefail } {
546549 /* throw back all but the quote */
547550 yyless (1 );
548- /* handle possible UESCAPE in xusend mode */
551+ /* xusend state looks for possible UESCAPE */
549552 BEGIN (xusend);
550553 }
551- <xusend >{whitespace }
554+ <xusend >{whitespace } { /* stay in xusend state over whitespace */ }
552555<xusend >{other } |
553- <xusend >{xustop1 } {
556+ <xusend >{xustop1 } |
557+ <xusend ><<EOF>> {
554558 /* no UESCAPE after the quote, throw back everything */
555559 yyless (0 );
556560 BEGIN (INITIAL);
@@ -725,12 +729,13 @@ other .
725729 }
726730<xui >{dquote } {
727731 yyless (1 );
728- /* handle possible UESCAPE in xuiend mode */
732+ /* xuiend state looks for possible UESCAPE */
729733 BEGIN (xuiend);
730734 }
731- <xuiend >{whitespace } { }
735+ <xuiend >{whitespace } { /* stay in xuiend state over whitespace */ }
732736<xuiend >{other } |
733- <xuiend >{xustop1 } {
737+ <xuiend >{xustop1 } |
738+ <xuiend ><<EOF>> {
734739 /* no UESCAPE after the quote, throw back everything */
735740 char *ident;
736741
Original file line number Diff line number Diff line change @@ -166,7 +166,8 @@ static void escape_variable(bool as_ident);
166166 * <xe> extended quoted strings (support backslash escape sequences)
167167 * <xdolq> $foo$ quoted strings
168168 * <xui> quoted identifier with Unicode escapes
169- * <xuiend> end of a quoted identifier with Unicode escapes, UESCAPE can follow * <xus> quoted string with Unicode escapes
169+ * <xuiend> end of a quoted identifier with Unicode escapes, UESCAPE can follow
170+ * <xus> quoted string with Unicode escapes
170171 * <xusend> end of a quoted string with Unicode escapes, UESCAPE can follow
171172 *
172173 * Note: we intentionally don't mimic the backend's <xeu> state; we have
You can’t perform that action at this time.
0 commit comments