8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.48 1999/05/03 19:09:42 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.49 1999/05/12 07:12:51 thomas Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
37
37
#endif
38
38
#define YY_READ_BUF_SIZE MAX_PARSE_BUFFER
39
39
40
+ #ifdef YY_READ_BUF_SIZE
41
+ #undef YY_READ_BUF_SIZE
42
+ #endif
43
+ #define YY_READ_BUF_SIZE MAX_PARSE_BUFFER
44
+
40
45
extern char *parseString;
41
46
static char *parseCh;
42
47
@@ -157,10 +162,11 @@ operator {op_and_self}+
157
162
xmstop -
158
163
159
164
integer [\- ]? {digit }+
165
+ decimal [\- ]? (({digit }* \. {digit }+ )| ({digit }+ \. {digit }* ))
166
+ real [\- ]? ((({digit }* \. {digit }+ )| ({digit }+ \. {digit }* )| ({digit }+ ))([Ee ][-+ ]? {digit }+ ))
160
167
/*
161
- real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
162
- */
163
168
real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+))
169
+ */
164
170
165
171
param \$ {integer }
166
172
@@ -339,15 +345,35 @@ other .
339
345
if (*endptr != ' \0 ' || errno == ERANGE)
340
346
{
341
347
errno = 0 ;
348
+ #if 0
342
349
yylval.dval = strtod(((char *)yytext),&endptr);
343
350
if (*endptr != '\0' || errno == ERANGE)
344
351
elog(ERROR,"Bad integer input '%s'",yytext);
345
352
CheckFloat8Val(yylval.dval);
346
353
elog(NOTICE,"Integer input '%s' is out of range; promoted to float", yytext);
347
354
return FCONST;
355
+ #endif
356
+ yylval.str = pstrdup ((char *)yytext);
357
+ return SCONST;
348
358
}
349
359
return ICONST;
350
360
}
361
+ {decimal }/ {space }* -{number } {
362
+ char * endptr;
363
+
364
+ BEGIN (xm);
365
+ if (strlen ((char *)yytext) <= 17 )
366
+ {
367
+ errno = 0 ;
368
+ yylval.dval = strtod (((char *)yytext),&endptr);
369
+ if (*endptr != ' \0 ' || errno == ERANGE)
370
+ elog (ERROR," Bad float8 input '%s'" ,yytext);
371
+ CheckFloat8Val (yylval.dval );
372
+ return FCONST;
373
+ }
374
+ yylval.str = pstrdup ((char *)yytext);
375
+ return SCONST;
376
+ }
351
377
{real }/ {space }* -{number } {
352
378
char * endptr;
353
379
@@ -367,15 +393,34 @@ other .
367
393
if (*endptr != ' \0 ' || errno == ERANGE)
368
394
{
369
395
errno = 0 ;
396
+ #if 0
370
397
yylval.dval = strtod(((char *)yytext),&endptr);
371
398
if (*endptr != '\0' || errno == ERANGE)
372
399
elog(ERROR,"Bad integer input '%s'",yytext);
373
400
CheckFloat8Val(yylval.dval);
374
401
elog(NOTICE,"Integer input '%s' is out of range; promoted to float", yytext);
375
402
return FCONST;
403
+ #endif
404
+ yylval.str = pstrdup ((char *)yytext);
405
+ return SCONST;
376
406
}
377
407
return ICONST;
378
408
}
409
+ {decimal } {
410
+ char * endptr;
411
+
412
+ if (strlen ((char *)yytext) <= 17 )
413
+ {
414
+ errno = 0 ;
415
+ yylval.dval = strtod ((char *)yytext,&endptr);
416
+ if (*endptr != ' \0 ' || errno == ERANGE)
417
+ elog (ERROR," Bad float input '%s'" ,yytext);
418
+ CheckFloat8Val (yylval.dval );
419
+ return FCONST;
420
+ }
421
+ yylval.str = pstrdup ((char *)yytext);
422
+ return SCONST;
423
+ }
379
424
{real } {
380
425
char * endptr;
381
426
0 commit comments