diff options
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
-rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index b9a6cfa60b1..d89bbad9782 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.141 2006/02/04 02:32:38 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.142 2006/02/04 20:54:42 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -787,6 +787,7 @@ cppline {space}*#(.*\\{space})*.*{newline} } } } +<C>":" { return(':'); } <C>";" { return(';'); } <C>"," { return(','); } <C>"*" { return('*'); } @@ -1001,8 +1002,7 @@ cppline {space}*#(.*\\{space})*.*{newline} for (defptr = defines; defptr != NULL && strcmp(yytext, defptr->old) != 0; - defptr = defptr->next) - ; + defptr = defptr->next); preproc_tos++; stacked_if_value[preproc_tos].else_branch = FALSE; @@ -1016,11 +1016,19 @@ cppline {space}*#(.*\\{space})*.*{newline} BEGIN(xskip); } +<xcond>{other} { + mmerror(PARSE_ERROR, ET_FATAL, "Missing identifier in 'EXEC SQL IFDEF' command"); + yyterminate(); + } <def_ident>{identifier} { old = mm_strdup(yytext); BEGIN(def); startlit(); } +<def_ident>{other} { + mmerror(PARSE_ERROR, ET_FATAL, "Missing identifier in 'EXEC SQL DEFINE' command"); + yyterminate(); + } <def>{space}*";" { struct _defines *ptr, *this; @@ -1048,10 +1056,13 @@ cppline {space}*#(.*\\{space})*.*{newline} BEGIN(C); } <def>[^;] { addlit(yytext, yyleng); } - <incl>\<[^\>]+\>{space}*";"? { parse_include(); } <incl>{dquote}{xdinside}{dquote}{space}*";"? { parse_include(); } <incl>[^;\<\>\"]+";" { parse_include(); } +<incl>{other} { + mmerror(PARSE_ERROR, ET_FATAL, "Incorrect 'EXEC SQL INCLUDE' command"); + yyterminate(); + } <<EOF>> { if (yy_buffer == NULL) |