Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa96a5e

Browse files
committed
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 thanjunk emitted on the backend's stdout, but we should have the option tocatch possible worse errors in future.
1 parent58e7053 commitfa96a5e

File tree

8 files changed

+16
-7
lines changed

8 files changed

+16
-7
lines changed

‎contrib/cube/cubescan.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void cube_scanner_finish(void);
2626

2727
%option8bit
2828
%optionnever-interactive
29+
%optionnodefault
2930
%optionnounput
3031
%optionnoyywrap
3132
%optionprefix="cube_yy"
@@ -44,7 +45,7 @@ float ({integer}|{real})([eE]{integer})?
4445
\( yylval ="(";return O_PAREN;
4546
\) yylval =")";return C_PAREN;
4647
\, yylval =")";return COMMA;
47-
[]+/* discard spaces */
48+
[\t\n\r\f]+/* discard spaces */
4849
.return yytext[0];/* alert parser of the garbage*/
4950

5051
%%

‎contrib/seg/segscan.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void seg_scanner_finish(void);
2525

2626
%option8bit
2727
%optionnever-interactive
28+
%optionnodefault
2829
%optionnounput
2930
%optionnoyywrap
3031
%optionprefix="seg_yy"
@@ -44,7 +45,7 @@ float ({integer}|{real})([eE]{integer})?
4445
\< yylval.text ="<";return EXTENSION;
4546
\> yylval.text =">";return EXTENSION;
4647
\~ yylval.text ="~";return EXTENSION;
47-
[]+/* discard spaces */
48+
[\t\n\r\f]+/* discard spaces */
4849
.return yytext[0];/* alert parser of the garbage*/
4950

5051
%%

‎contrib/tsearch/parser.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
1616

1717
%option8bit
1818
%optionnever-interactive
19+
%optionnodefault
1920
%optionnounput
2021
%optionnoyywrap
2122

‎contrib/tsearch2/wordparser/parser.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
1818

1919
%option8bit
2020
%optionnever-interactive
21+
%optionnodefault
2122
%optionnounput
2223
%optionnoyywrap
2324

‎src/backend/bootstrap/bootscanner.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.32 2003/11/29 19:51:41 pgsql Exp $
12+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.33 2004/02/24 22:06:32 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -53,6 +53,7 @@ static intyyline; /* keep track of the line number for error reporting */
5353

5454
%option8bit
5555
%optionnever-interactive
56+
%optionnodefault
5657
%optionnounput
5758
%optionnoyywrap
5859

‎src/backend/utils/misc/guc-file.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.20 2003/11/29 19:52:03 pgsql Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.21 2004/02/24 22:06:32 tgl Exp $
88
*/
99

1010
%{
@@ -47,6 +47,7 @@ char *GUC_scanstr(char *);
4747

4848
%option 8bit
4949
%option never-interactive
50+
%option nodefault
5051
%option nounput
5152
%option noyywrap
5253

‎src/interfaces/ecpg/preproc/pgc.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.125 2004/02/15 13:48:54 meskes Exp $
15+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.126 2004/02/24 22:06:32 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -70,6 +70,7 @@ static struct _if_value
7070

7171
%option8bit
7272
%optionnever-interactive
73+
%optionnodefault
7374
%optionnoyywrap
7475

7576
%optionyylineno

‎src/pl/plpgsql/src/scan.l

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.30 2003/11/29 19:52:12 pgsql Exp $
7+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.31 2004/02/24 22:06:32 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -63,6 +63,7 @@ intplpgsql_SpaceScanned = 0;
6363

6464
%option8bit
6565
%optionnever-interactive
66+
%optionnodefault
6667
%optionnounput
6768
%optionnoyywrap
6869

@@ -272,20 +273,21 @@ dump{ return O_DUMP;}
272273
BEGIN IN_STRING;
273274
}
274275
<IN_STRING>\\.{ }
276+
<IN_STRING>\\{/* can only happen with \ at EOF */ }
275277
<IN_STRING>''{ }
276278
<IN_STRING>'{
277279
yyleng -= (yytext - start_charpos);
278280
yytext = start_charpos;
279281
BEGIN INITIAL;
280282
return T_STRING;
281283
}
284+
<IN_STRING>[^'\\]+{ }
282285
<IN_STRING><<EOF>>{
283286
plpgsql_error_lineno = start_lineno;
284287
ereport(ERROR,
285288
(errcode(ERRCODE_DATATYPE_MISMATCH),
286289
errmsg("unterminated string")));
287290
}
288-
<IN_STRING>[^'\\]*{ }
289291

290292
/* ----------
291293
* Any unmatched character is returned as is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp