12
12
*
13
13
*
14
14
* IDENTIFICATION
15
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.86 2002/03/06 06:10:36 momjian Exp $
15
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.87 2002/03/10 12:09:54 meskes Exp $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -352,7 +352,7 @@ cppline {space}*#(.*\\{space})*.*
352
352
353
353
<xh ><<EOF>> { mmerror (PARSE_ERROR, ET_ERROR, " Unterminated hexadecimal integer" ); }
354
354
355
- {xqstart } {
355
+ < C , SQL > {xqstart } {
356
356
state_before = YYSTATE;
357
357
BEGIN (xq);
358
358
startlit ();
@@ -412,7 +412,7 @@ cppline {space}*#(.*\\{space})*.*
412
412
addlit (yytext, yyleng);
413
413
}
414
414
<xd ,xdc ><<EOF>> { mmerror (PARSE_ERROR, ET_ERROR, " Unterminated quoted identifier" ); }
415
- {xdstart } {
415
+ < C , SQL > {xdstart } {
416
416
state_before = YYSTATE;
417
417
BEGIN (xdc);
418
418
startlit ();
@@ -789,19 +789,18 @@ cppline {space}*#(.*\\{space})*.*
789
789
790
790
/* initial definition */
791
791
this ->old = old;
792
- /* this->new = mm_strdup(scanstr(literalbuf));*/
793
792
this ->new = mm_strdup (literalbuf);
794
793
this ->next = defines;
795
794
defines = this ;
796
795
}
797
796
798
797
BEGIN (C);
799
798
}
800
- <def >[^ ";" ] {
799
+ <def >[^ ; ] {
801
800
addlit (yytext, yyleng);
802
801
}
803
802
804
- <incl >[^ ";" ]+ " ;" { /* got the include file name */
803
+ <incl >[^ ; ]+ " ;" { /* got the include file name */
805
804
struct _yy_buffer *yb;
806
805
struct _include_path *ip;
807
806
char inc_file[MAXPGPATH];
@@ -870,6 +869,7 @@ cppline {space}*#(.*\\{space})*.*
870
869
else
871
870
{
872
871
struct _yy_buffer *yb = yy_buffer;
872
+ int i;
873
873
874
874
if (yyin != NULL )
875
875
fclose (yyin);
@@ -878,13 +878,18 @@ cppline {space}*#(.*\\{space})*.*
878
878
yy_switch_to_buffer (yy_buffer->buffer );
879
879
880
880
yylineno = yy_buffer->lineno ;
881
+
882
+ /* We have to output the filename only if we change files here */
883
+ i = strcmp (input_filename, yy_buffer->filename );
881
884
882
885
free (input_filename);
883
886
input_filename = yy_buffer->filename ;
884
887
885
888
yy_buffer = yy_buffer->next ;
886
889
free (yb);
887
- output_line_number ();
890
+
891
+ if (i != 0 )
892
+ output_line_number ();
888
893
}
889
894
}
890
895
%%
0 commit comments