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

Commit 7f7fb4e

Browse files
author
Michael Meskes
committed
Fixed two bugs in define command in pgc.l
1 parent a9f268d commit 7f7fb4e

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,10 @@ Wed Jan 23 17:35:23 CET 2002
12211221
Wed Mar 6 10:40:28 CET 2002
12221222

12231223
- Synced preproc.y with gram.y.
1224+
1225+
Sun Mar 10 13:08:22 CET 2002
1226+
1227+
- Fixed two bugs in define command in lexer.
12241228
- Set ecpg version to 2.10.0.
12251229
- Set library version to 3.4.0.
12261230

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* 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 $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -352,7 +352,7 @@ cppline {space}*#(.*\\{space})*.*
352352

353353
<xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); }
354354

355-
{xqstart} {
355+
<C,SQL>{xqstart} {
356356
state_before = YYSTATE;
357357
BEGIN(xq);
358358
startlit();
@@ -412,7 +412,7 @@ cppline {space}*#(.*\\{space})*.*
412412
addlit(yytext, yyleng);
413413
}
414414
<xd,xdc><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated quoted identifier"); }
415-
{xdstart} {
415+
<C,SQL>{xdstart} {
416416
state_before = YYSTATE;
417417
BEGIN(xdc);
418418
startlit();
@@ -789,19 +789,18 @@ cppline {space}*#(.*\\{space})*.*
789789

790790
/* initial definition */
791791
this->old = old;
792-
/* this->new = mm_strdup(scanstr(literalbuf));*/
793792
this->new = mm_strdup(literalbuf);
794793
this->next = defines;
795794
defines = this;
796795
}
797796

798797
BEGIN(C);
799798
}
800-
<def>[^";"] {
799+
<def>[^;] {
801800
addlit(yytext, yyleng);
802801
}
803802

804-
<incl>[^";"]+";" { /* got the include file name */
803+
<incl>[^;]+";" { /* got the include file name */
805804
struct _yy_buffer *yb;
806805
struct _include_path *ip;
807806
char inc_file[MAXPGPATH];
@@ -870,6 +869,7 @@ cppline {space}*#(.*\\{space})*.*
870869
else
871870
{
872871
struct _yy_buffer *yb = yy_buffer;
872+
int i;
873873

874874
if (yyin != NULL)
875875
fclose(yyin);
@@ -878,13 +878,18 @@ cppline {space}*#(.*\\{space})*.*
878878
yy_switch_to_buffer(yy_buffer->buffer);
879879

880880
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);
881884

882885
free(input_filename);
883886
input_filename = yy_buffer->filename;
884887

885888
yy_buffer = yy_buffer->next;
886889
free(yb);
887-
output_line_number();
890+
891+
if (i != 0)
892+
output_line_number();
888893
}
889894
}
890895
%%

0 commit comments

Comments
 (0)