From 5f7e0e4c1955260936e19446c304d7c3bf3c2acd Mon Sep 17 00:00:00 2001 From: John Naylor Date: Thu, 27 Jun 2019 13:36:58 +0800 Subject: [PATCH v3 1/2] Remove some unneeded generality from the core Flex rules --- src/backend/parser/scan.l | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index e1cae859e8..90f96c446f 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -218,7 +218,7 @@ non_newline [^\n\r] comment ("--"{non_newline}*) -whitespace ({space}+|{comment}) +whitespace ({space}|{comment}) /* * SQL requires at least one newline in the whitespace separating @@ -227,7 +227,7 @@ whitespace ({space}+|{comment}) * it, whereas {whitespace} should generally have a * after it... */ -special_whitespace ({space}+|{comment}{newline}) +special_whitespace ({space}|{comment}{newline}) horiz_whitespace ({horiz_space}|{comment}) whitespace_with_newline ({horiz_whitespace}*{newline}{special_whitespace}*) @@ -696,8 +696,7 @@ other . {quotecontinue} { /* ignore */ } -. { - /* This is only needed for \ just before EOF */ +\\ { addlitchar(yytext[0], yyscanner); } <> { yyerror("unterminated quoted string"); } @@ -741,8 +740,7 @@ other . {dolqfailed} { addlit(yytext, yyleng, yyscanner); } -. { - /* This is only needed for $ inside the quoted text */ +\$ { addlitchar(yytext[0], yyscanner); } <> { yyerror("unterminated dollar-quoted string"); } -- 2.17.2 (Apple Git-113)