aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/psql/psqlscan.l33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l
index 46141f7ddac..8439c865bfe 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -724,6 +724,23 @@ other .
}
/*
+ * These rules just avoid the need for scanner backup if one of the
+ * two rules above fails to match completely.
+ */
+
+:'[A-Za-z0-9_]* {
+ /* Throw back everything but the colon */
+ yyless(1);
+ ECHO;
+ }
+
+:\"[A-Za-z0-9_]* {
+ /* Throw back everything but the colon */
+ yyless(1);
+ ECHO;
+ }
+
+ /*
* Back to backend-compatible rules.
*/
@@ -913,7 +930,7 @@ other .
}
}
-:[A-Za-z0-9_]* {
+:[A-Za-z0-9_]+ {
/* Possible psql variable substitution */
if (option_type == OT_VERBATIM)
ECHO;
@@ -960,6 +977,20 @@ other .
}
}
+:'[A-Za-z0-9_]* {
+ /* Throw back everything but the colon */
+ yyless(1);
+ ECHO;
+ BEGIN(xslashdefaultarg);
+ }
+
+:\"[A-Za-z0-9_]* {
+ /* Throw back everything but the colon */
+ yyless(1);
+ ECHO;
+ BEGIN(xslashdefaultarg);
+ }
+
"|" {
ECHO;
if (option_type == OT_FILEPIPE)