mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Add %option nodefault to all our flex lexers. Fix a couple of rule gaps
exposed thereby. AFAICT these would not lead to any worse problems than junk emitted on the backend's stdout, but we should have the option to catch possible worse errors in future.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* procedural language
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.30 2003/11/29 19:52:12 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.31 2004/02/24 22:06:32 tgl Exp $
|
||||
*
|
||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||
*
|
||||
@@ -63,6 +63,7 @@ int plpgsql_SpaceScanned = 0;
|
||||
|
||||
%option 8bit
|
||||
%option never-interactive
|
||||
%option nodefault
|
||||
%option nounput
|
||||
%option noyywrap
|
||||
|
||||
@@ -272,6 +273,7 @@ dump { return O_DUMP; }
|
||||
BEGIN IN_STRING;
|
||||
}
|
||||
<IN_STRING>\\. { }
|
||||
<IN_STRING>\\ { /* can only happen with \ at EOF */ }
|
||||
<IN_STRING>'' { }
|
||||
<IN_STRING>' {
|
||||
yyleng -= (yytext - start_charpos);
|
||||
@@ -279,13 +281,13 @@ dump { return O_DUMP; }
|
||||
BEGIN INITIAL;
|
||||
return T_STRING;
|
||||
}
|
||||
<IN_STRING>[^'\\]+ { }
|
||||
<IN_STRING><<EOF>> {
|
||||
plpgsql_error_lineno = start_lineno;
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("unterminated string")));
|
||||
}
|
||||
<IN_STRING>[^'\\]* { }
|
||||
|
||||
/* ----------
|
||||
* Any unmatched character is returned as is
|
||||
|
Reference in New Issue
Block a user