Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4b56bd8

Browse files
author
Michael Meskes
committed
Fixed bug in parsing of #line statement in declare section.
1 parent cde6056 commit 4b56bd8

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,5 +1898,9 @@ Mon Jan 10 13:55:32 CET 2005
18981898
Tue Jan 25 13:47:45 CET 2005
18991899

19001900
- Fixed segfault in preprocessor due to free a struct twice.
1901+
1902+
Wed Feb 2 16:35:27 CET 2005
1903+
1904+
- Fixed bug in parsing of #line statement in declare section.
19011905
- Set ecpg version to 3.2.1.
19021906

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 4 additions & 4 deletions
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.134 2004/12/31 22:03:48 pgsql Exp $
15+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.135 2005/02/02 15:37:43 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -288,8 +288,8 @@ ip {ipdigit}\.{ipdigit}\.{ipdigit}\.{ipdigit}
288288
/* we might want to parse all cpp include files */
289289
cppinclude {space}*#{include}{space}*
290290

291-
/* Take care of cpp continuation lines */
292-
cppline {space}*#(.*\\{space})+.*
291+
/* Take care of cpp lines, they may also be continuated */
292+
cppline {space}*#(.*\\{space})*.*{newline}
293293

294294
/*
295295
* Dollar quoted strings are totally opaque, and no escaping is done on them.
@@ -685,7 +685,7 @@ cppline {space}*#(.*\\{space})+.*
685685
return(CPP_LINE);
686686
}
687687
}
688-
<C>{cppline} {
688+
<C,SQL>{cppline} {
689689
yylval.str = mm_strdup(yytext);
690690
return(CPP_LINE);
691691
}

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.304 2005/01/25 12:51:31 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.305 2005/02/02 15:37:43 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -4635,12 +4635,14 @@ sql_enddeclare: ecpgstart END_P DECLARE SQL_SECTION ';' {};
46354635

46364636
var_type_declarations: /*EMPTY*/ { $$ = EMPTY; }
46374637
| vt_declarations { $$ = $1; }
4638+
| CPP_LINE { $$ = $1; }
46384639
;
46394640

46404641
vt_declarations: var_declaration { $$ = $1; }
46414642
| type_declaration { $$ = $1; }
46424643
| vt_declarations var_declaration { $$ = cat2_str($1, $2); }
46434644
| vt_declarations type_declaration { $$ = cat2_str($1, $2); }
4645+
| vt_declarations CPP_LINE { $$ = cat2_str($1, $2); }
46444646
;
46454647

46464648
variable_declarations: var_declaration { $$ = $1; }

0 commit comments

Comments
 (0)