mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
I send a simple patch for PL/pgSQL parser which allow now to use
whitespaces in identifers of any kind(table names,attribute names,variables ...) in Pl/pgSQL procedural language.Explicit definition of bug can be found in Re: [HACKERS] Bug of PL/pgSQL parser TODO item completed: o -Fix PL/PgSQL to handle quoted mixed-case identifiers eutm
This commit is contained in:
parent
7ef5634701
commit
7a84053844
@ -4,7 +4,7 @@
|
||||
* procedural language
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.18 2002/07/30 16:33:08 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.19 2002/08/04 03:59:09 momjian Exp $
|
||||
*
|
||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||
*
|
||||
@ -61,9 +61,9 @@ static void plpgsql_input(char *buf, int *result, int max);
|
||||
|
||||
%option yylineno
|
||||
|
||||
|
||||
WS [\200-\377_A-Za-z"]
|
||||
WC [\200-\377_A-Za-z0-9"]
|
||||
DQUOTE \"([^\"])*\"
|
||||
WS [\200-\377_A-Za-z]
|
||||
WC [\200-\377_A-Za-z0-9]
|
||||
|
||||
%x IN_STRING IN_COMMENT
|
||||
|
||||
@ -155,17 +155,48 @@ dump { return O_DUMP; }
|
||||
* ----------
|
||||
*/
|
||||
{WS}{WC}* { return plpgsql_parse_word(yytext); }
|
||||
{DQUOTE}* { return plpgsql_parse_word(yytext); }
|
||||
|
||||
{WS}{WC}*\.{WS}{WC}* { return plpgsql_parse_dblword(yytext); }
|
||||
{WS}{WC}*\.{DQUOTE}* { return plpgsql_parse_dblword(yytext); }
|
||||
{DQUOTE}*\.{WS}{WC}* { return plpgsql_parse_dblword(yytext); }
|
||||
{DQUOTE}*\.{DQUOTE}* { return plpgsql_parse_dblword(yytext); }
|
||||
|
||||
{WS}{WC}*\.{WS}{WC}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
{WS}{WC}*\.{WS}{WC}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
{WS}{WC}*\.{DQUOTE}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
{WS}{WC}*\.{DQUOTE}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
{DQUOTE}*\.{WS}{WC}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
{DQUOTE}*\.{WS}{WC}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
{DQUOTE}*\.{DQUOTE}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
{DQUOTE}*\.{DQUOTE}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
|
||||
{WS}{WC}*%TYPE { return plpgsql_parse_wordtype(yytext); }
|
||||
{DQUOTE}*%TYPE { return plpgsql_parse_wordtype(yytext); }
|
||||
|
||||
{WS}{WC}*\.{WS}{WC}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
{WS}{WC}*\.{DQUOTE}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
{DQUOTE}*\.{WS}{WC}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
{DQUOTE}*\.{DQUOTE}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
|
||||
{WS}{WC}*%ROWTYPE { return plpgsql_parse_wordrowtype(yytext); }
|
||||
{DQUOTE}*%ROWTYPE { return plpgsql_parse_wordrowtype(yytext); }
|
||||
|
||||
\$[0-9]+ { return plpgsql_parse_word(yytext); }
|
||||
|
||||
\$[0-9]+\.{WS}{WC}* { return plpgsql_parse_dblword(yytext); }
|
||||
\$[0-9]+\.{DQUOTE}* { return plpgsql_parse_dblword(yytext); }
|
||||
|
||||
\$[0-9]+\.{WS}{WC}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
\$[0-9]+\.{WS}{WC}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
\$[0-9]+\.{DQUOTE}*\.{WS}{WC}* { return plpgsql_parse_tripword(yytext); }
|
||||
\$[0-9]+\.{DQUOTE}*\.{DQUOTE}* { return plpgsql_parse_tripword(yytext); }
|
||||
|
||||
\$[0-9]+%TYPE { return plpgsql_parse_wordtype(yytext); }
|
||||
|
||||
\$[0-9]+\.{WS}{WC}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
\$[0-9]+\.{DQUOTE}*%TYPE { return plpgsql_parse_dblwordtype(yytext); }
|
||||
|
||||
\$[0-9]+%ROWTYPE { return plpgsql_parse_wordrowtype(yytext); }
|
||||
|
||||
[0-9]+ { return T_NUMBER; }
|
||||
|
Loading…
Reference in New Issue
Block a user