diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml index 4b0eed30cf..7f0f785d4b 100644 --- a/doc/src/sgml/ecpg.sgml +++ b/doc/src/sgml/ecpg.sgml @@ -2,7 +2,7 @@ -Linux +Linus Tolke diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 846aa8a158..a7882c20a1 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -848,5 +848,9 @@ Thu Mar 2 17:42:16 CET 2000 - Print error message if an indicator array is given for input variables. + +Fri Mar 3 10:47:06 CET 2000 + + - Fixed handling of double quote in C code. - Set library version to 3.1.0. - Set ecpg version to 2.7.0. diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index fcb033787c..ec265dded1 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.51 2000/02/22 19:57:10 meskes Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.52 2000/03/03 09:56:03 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -51,7 +51,7 @@ static int literalalloc; /* current allocated buffer size */ #define startlit() (literalbuf[0] = '\0', literallen = 0) static void addlit(char *ytext, int yleng); -int before_comment; +int state_before; struct _yy_buffer { YY_BUFFER_STATE buffer; long lineno; @@ -268,12 +268,12 @@ cppline {space}*#(.*\\{line_end})*.* {xcline} { ECHO; } {xcstart} { - before_comment = YYSTATE; + state_before = YYSTATE; ECHO; BEGIN(xc); } -{xcstop} { ECHO; BEGIN(before_comment); } +{xcstop} { ECHO; BEGIN(state_before); } {xcinside} { ECHO; } @@ -303,7 +303,7 @@ cppline {space}*#(.*\\{line_end})*.* BEGIN(xh); startlit(); } -{xhstop} { +{xhstop} { char* endptr; BEGIN(SQL); @@ -314,45 +314,36 @@ cppline {space}*#(.*\\{line_end})*.* return ICONST; } -{xqstart} { +{xqstart} { + state_before == YYSTATE; BEGIN(xq); startlit(); } -{xqstop} { - BEGIN(SQL); +{xqstop} { + BEGIN(state_before); yylval.str = mm_strdup(literalbuf); return SCONST; } {xqdouble} | {xqinside} | -{xqliteral} { +{xqliteral} { addlit(yytext, yyleng); } -{xqcat} { /* ignore */ +{xqcat} { + /* ignore */ } -{xdstart} { +{xdstart} { + state_before = YYSTATE; BEGIN(xd); startlit(); } -{xdstop} { - BEGIN(SQL); +{xdstop} { + BEGIN(state_before); yylval.str = mm_strdup(literalbuf); return CSTRING; } -{xdinside} { - addlit(yytext, yyleng); - } -{xdstart} { - BEGIN(xdc); - startlit(); - } -{xdstop} { - BEGIN(C); - yylval.str = mm_strdup(literalbuf); - return CSTRING; - } -{xdcinside} { +{xdinside} { addlit(yytext, yyleng); } {typecast} { return TYPECAST; } @@ -365,7 +356,7 @@ cppline {space}*#(.*\\{line_end})*.* BEGIN C; return yytext[0]; } -{operator} { +{operator} { if (strcmp((char*)yytext,"!=") == 0) yylval.str = mm_strdup("<>"); /* compatability */ else diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index d3abd00228..88591f831b 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -5086,6 +5086,7 @@ c_anything: IDENT { $$ = $1; } | CSTRING { $$ = make3_str(make_str("\""), $1, make_str("\"")); } | Iconst { $$ = $1; } | Fconst { $$ = $1; } + | Sconst { $$ = $1; } | '*' { $$ = make_str("*"); } | '+' { $$ = make_str("+"); } | '-' { $$ = make_str("-"); } @@ -5112,8 +5113,6 @@ c_anything: IDENT { $$ = $1; } | VARCHAR { $$ = make_str("varchar"); } | '[' { $$ = make_str("["); } | ']' { $$ = make_str("]"); } -/* | '(' { $$ = make_str("("); } - | ')' { $$ = make_str(")"); }*/ | '=' { $$ = make_str("="); } blockstart : '{' {