diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-04-05 11:39:47 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-04-05 11:39:47 +0000 |
commit | 811f7df27454577d723e7f59dd840b09c5286913 (patch) | |
tree | 8e9efaa58e40263ff5087ad12812eb0bb154325d /src/interfaces/ecpg/preproc | |
parent | 3cbe6b2478d7a321e203857f255bcaf69bcc5c8d (diff) |
When a macro is replaced by the preprocessor, pgc.l reaches a end of
file, which is not the actual end of the file. One side effect of that
is that if you are i n a ifdef block, you get a wrong error telling you
that a endif is missing.
This patch corrects pgc.l and also adds a test of this problem to
test1.pgc. To convince you apply the patch to test1.pgc first then try
to compile the test the n apply the patch to pgc.l.
The patch moves the test of the scope of an ifdef block to the end of
the file b eeing parsed, including all includes files, ... .
Nicolas Bazin
Diffstat (limited to 'src/interfaces/ecpg/preproc')
-rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 5341d093018..27ba1c9375a 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.89 2002/03/24 18:22:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.90 2002/04/05 11:39:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -837,14 +837,14 @@ cppline {space}*#(.*\\{space})*.* } <<EOF>> { + if (yy_buffer == NULL) { if ( preproc_tos > 0 ) { preproc_tos = 0; mmerror(PARSE_ERROR, ET_FATAL, "Missing 'EXEC SQL ENDIF;'"); } - - if (yy_buffer == NULL) yyterminate(); + } else { struct _yy_buffer *yb = yy_buffer; |