aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2005-02-02 15:37:43 +0000
committerMichael Meskes <meskes@postgresql.org>2005-02-02 15:37:43 +0000
commit4b56bd85c01707d70cd7bcbecdeba80790614cb0 (patch)
tree8911085698cc4d06616b07d1b0b9335ced2040c2 /src
parentcde6056e34ac45a3d76028deabdfa09c5404db78 (diff)
downloadpostgresql-4b56bd85c01707d70cd7bcbecdeba80790614cb0.tar.gz
postgresql-4b56bd85c01707d70cd7bcbecdeba80790614cb0.zip
Fixed bug in parsing of #line statement in declare section.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l8
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y4
3 files changed, 11 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 3e04df895cc..14a7c9af256 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1898,5 +1898,9 @@ Mon Jan 10 13:55:32 CET 2005
Tue Jan 25 13:47:45 CET 2005
- Fixed segfault in preprocessor due to free a struct twice.
+
+Wed Feb 2 16:35:27 CET 2005
+
+ - Fixed bug in parsing of #line statement in declare section.
- Set ecpg version to 3.2.1.
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index fad995fbd72..ce1b4eb885a 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.134 2004/12/31 22:03:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.135 2005/02/02 15:37:43 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -288,8 +288,8 @@ ip {ipdigit}\.{ipdigit}\.{ipdigit}\.{ipdigit}
/* we might want to parse all cpp include files */
cppinclude {space}*#{include}{space}*
-/* Take care of cpp continuation lines */
-cppline {space}*#(.*\\{space})+.*
+/* Take care of cpp lines, they may also be continuated */
+cppline {space}*#(.*\\{space})*.*{newline}
/*
* Dollar quoted strings are totally opaque, and no escaping is done on them.
@@ -685,7 +685,7 @@ cppline {space}*#(.*\\{space})+.*
return(CPP_LINE);
}
}
-<C>{cppline} {
+<C,SQL>{cppline} {
yylval.str = mm_strdup(yytext);
return(CPP_LINE);
}
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 6797787d8ea..b70fa948720 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.304 2005/01/25 12:51:31 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.305 2005/02/02 15:37:43 meskes Exp $ */
/* Copyright comment */
%{
@@ -4635,12 +4635,14 @@ sql_enddeclare: ecpgstart END_P DECLARE SQL_SECTION ';' {};
var_type_declarations: /*EMPTY*/ { $$ = EMPTY; }
| vt_declarations { $$ = $1; }
+ | CPP_LINE { $$ = $1; }
;
vt_declarations: var_declaration { $$ = $1; }
| type_declaration { $$ = $1; }
| vt_declarations var_declaration { $$ = cat2_str($1, $2); }
| vt_declarations type_declaration { $$ = cat2_str($1, $2); }
+ | vt_declarations CPP_LINE { $$ = cat2_str($1, $2); }
;
variable_declarations: var_declaration { $$ = $1; }