aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ChangeLog5
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l43
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y2
3 files changed, 47 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 8895cfab4c3..e77ecf377b7 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -590,5 +590,10 @@ Fri May 21 18:13:44 CEST 1999
Sun May 23 11:19:32 CEST 1999
- Add braces around each statement so that a simple if/else works.
+
+Thu Jun 10 21:09:12 CEST 1999
+
+ - Fixed typo in preproc.y.
+ - Synced pgc.l with scan.l.
- Set library version to 3.0.0
- Set ecpg version to 2.6.0
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 44542cb83bf..d942a65b3ea 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -146,10 +146,11 @@ operator {op_and_self}+
xmstop -
integer [\-]?{digit}+
+decimal [\-]?(({digit}*\.{digit}+)|({digit}+\.{digit}*))
+real [\-]?((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+))
/*
-real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
-*/
real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
+*/
param \${integer}
@@ -391,14 +392,34 @@ cppline {space}*#.*(\\{space}*\n)*\n*
if (*endptr != '\0' || errno == ERANGE)
{
errno = 0;
+#if 0
yylval.dval = strtod(((char *)yytext),&endptr);
if (*endptr != '\0' || errno == ERANGE)
yyerror("ERROR: Bad integer input");
yyerror("WARNING: Integer input is out of range; promoted to float");
return FCONST;
+#endif
+ yylval.str = mm_strdup((char*)yytext);
+ return SCONST;
}
return ICONST;
}
+{decimal}/{space}*-{number} {
+ char* endptr;
+
+ BEGIN(xm);
+ if (strlen((char *)yytext) <= 17)
+ {
+ errno = 0;
+ yylval.dval = strtod(((char *)yytext),&endptr);
+ if (*endptr != '\0' || errno == ERANGE)
+ yyerror("ERROR: Bad float8 input");
+ return FCONST;
+ }
+ yylval.str = mm_strdup((char*)yytext);
+ return SCONST;
+ }
+
<C,SQL>{real}/{space}*-{number} {
char* endptr;
@@ -417,14 +438,32 @@ cppline {space}*#.*(\\{space}*\n)*\n*
if (*endptr != '\0' || errno == ERANGE)
{
errno = 0;
+#if 0
yylval.dval = strtod(((char *)yytext),&endptr);
if (*endptr != '\0' || errno == ERANGE)
yyerror("ERROR: Bad integer input");
yyerror("WARNING: Integer input is out of range; promoted to float");
return FCONST;
+#endif
+ yylval.str = mm_strdup((char*)yytext);
+ return SCONST;
}
return ICONST;
}
+{decimal} {
+ char* endptr;
+
+ if (strlen((char *)yytext) <= 17)
+ {
+ errno = 0;
+ yylval.dval = strtod((char *)yytext,&endptr);
+ if (*endptr != '\0' || errno == ERANGE)
+ yyerror("ERROR: Bad float8 input");
+ return FCONST;
+ }
+ yylval.str = mm_strdup((char*)yytext);
+ return SCONST;
+ }
<C,SQL>{real} {
char* endptr;
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index bb1bc14cd0f..d541dbf0c85 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -2918,7 +2918,7 @@ name_list: name
{ $$ = cat3_str($1, make1_str(","), $3); }
;
-group_clause: GROUP BY expr_list { $$ = cat2_str(make1_str("groub by"), $3); }
+group_clause: GROUP BY expr_list { $$ = cat2_str(make1_str("group by"), $3); }
| /*EMPTY*/ { $$ = make1_str(""); }
;