Skip to content

Commit 3a81a1a

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent 85b2875 commit 3a81a1a

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

doc/src/sgml/ecpg.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<DocInfo>
33
<AuthorGroup>
44
<Author>
5-
<FirstName>Linux</FirstName>
5+
<FirstName>Linus</FirstName>
66
<Surname>Tolke</Surname>
77
</Author>
88
<Author>

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,5 +848,9 @@ Thu Mar 2 17:42:16 CET 2000
848848

849849
- Print error message if an indicator array is given for input
850850
variables.
851+
852+
Fri Mar 3 10:47:06 CET 2000
853+
854+
- Fixed handling of double quote in C code.
851855
- Set library version to 3.1.0.
852856
- Set ecpg version to 2.7.0.

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 18 additions & 27 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.51 2000/02/22 19:57:10 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.52 2000/03/03 09:56:03 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -51,7 +51,7 @@ static int literalalloc; /* current allocated buffer size */
5151
#define startlit() (literalbuf[0] = '\0', literallen = 0)
5252
static void addlit(char *ytext, int yleng);
5353

54-
int before_comment;
54+
int state_before;
5555

5656
struct _yy_buffer { YY_BUFFER_STATE buffer;
5757
long lineno;
@@ -268,12 +268,12 @@ cppline {space}*#(.*\\{line_end})*.*
268268
{xcline} { ECHO; }
269269

270270
{xcstart} {
271-
before_comment = YYSTATE;
271+
state_before = YYSTATE;
272272
ECHO;
273273
BEGIN(xc);
274274
}
275275

276-
<xc>{xcstop} { ECHO; BEGIN(before_comment); }
276+
<xc>{xcstop} { ECHO; BEGIN(state_before); }
277277

278278
<xc>{xcinside} { ECHO; }
279279

@@ -303,7 +303,7 @@ cppline {space}*#(.*\\{line_end})*.*
303303
BEGIN(xh);
304304
startlit();
305305
}
306-
<xh>{xhstop} {
306+
<xh>{xhstop} {
307307
char* endptr;
308308

309309
BEGIN(SQL);
@@ -314,45 +314,36 @@ cppline {space}*#(.*\\{line_end})*.*
314314
return ICONST;
315315
}
316316

317-
<SQL>{xqstart} {
317+
{xqstart} {
318+
state_before == YYSTATE;
318319
BEGIN(xq);
319320
startlit();
320321
}
321-
<xq>{xqstop} {
322-
BEGIN(SQL);
322+
<xq>{xqstop} {
323+
BEGIN(state_before);
323324
yylval.str = mm_strdup(literalbuf);
324325
return SCONST;
325326
}
326327
<xq>{xqdouble} |
327328
<xq>{xqinside} |
328-
<xq>{xqliteral} {
329+
<xq>{xqliteral} {
329330
addlit(yytext, yyleng);
330331
}
331-
<xq>{xqcat} { /* ignore */
332+
<xq>{xqcat} {
333+
/* ignore */
332334
}
333335

334-
<SQL>{xdstart} {
336+
{xdstart} {
337+
state_before = YYSTATE;
335338
BEGIN(xd);
336339
startlit();
337340
}
338-
<xd>{xdstop} {
339-
BEGIN(SQL);
340-
yylval.str = mm_strdup(literalbuf);
341-
return CSTRING;
342-
}
343-
<xd>{xdinside} {
344-
addlit(yytext, yyleng);
345-
}
346-
{xdstart} {
347-
BEGIN(xdc);
348-
startlit();
349-
}
350-
<xdc>{xdstop} {
351-
BEGIN(C);
341+
<xd>{xdstop} {
342+
BEGIN(state_before);
352343
yylval.str = mm_strdup(literalbuf);
353344
return CSTRING;
354345
}
355-
<xdc>{xdcinside} {
346+
<xd>{xdinside} {
356347
addlit(yytext, yyleng);
357348
}
358349
<SQL>{typecast} { return TYPECAST; }
@@ -365,7 +356,7 @@ cppline {space}*#(.*\\{line_end})*.*
365356
BEGIN C;
366357
return yytext[0];
367358
}
368-
<SQL>{operator} {
359+
<SQL>{operator} {
369360
if (strcmp((char*)yytext,"!=") == 0)
370361
yylval.str = mm_strdup("<>"); /* compatability */
371362
else

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,6 +5086,7 @@ c_anything: IDENT { $$ = $1; }
50865086
| CSTRING { $$ = make3_str(make_str("\""), $1, make_str("\"")); }
50875087
| Iconst { $$ = $1; }
50885088
| Fconst { $$ = $1; }
5089+
| Sconst { $$ = $1; }
50895090
| '*' { $$ = make_str("*"); }
50905091
| '+' { $$ = make_str("+"); }
50915092
| '-' { $$ = make_str("-"); }
@@ -5112,8 +5113,6 @@ c_anything: IDENT { $$ = $1; }
51125113
| VARCHAR { $$ = make_str("varchar"); }
51135114
| '[' { $$ = make_str("["); }
51145115
| ']' { $$ = make_str("]"); }
5115-
/* | '(' { $$ = make_str("("); }
5116-
| ')' { $$ = make_str(")"); }*/
51175116
| '=' { $$ = make_str("="); }
51185117

51195118
blockstart : '{' {

0 commit comments

Comments
 (0)