comparison src/lex.l @ 2621:337a09dd1c06

[project @ 1997-01-24 21:49:41 by jwe]
author jwe
date Fri, 24 Jan 1997 21:55:06 +0000
parents ae47b0911863
children 7a820bb7f406
comparison
equal deleted inserted replaced
2620:5c773d4745d6 2621:337a09dd1c06
1339 } 1339 }
1340 1340
1341 static void 1341 static void
1342 handle_number (char *yytext) 1342 handle_number (char *yytext)
1343 { 1343 {
1344 char *tmp = strsave (yytext);
1345
1346 char *idx = strpbrk (tmp, "Dd");
1347
1348 if (idx)
1349 *idx = 'e';
1350
1344 double value; 1351 double value;
1345 int nread = sscanf (yytext, "%lf", &value); 1352 int nread = sscanf (tmp, "%lf", &value);
1353
1354 delete [] tmp;
1346 1355
1347 // If yytext doesn't contain a valid number, we are in deep doo doo. 1356 // If yytext doesn't contain a valid number, we are in deep doo doo.
1348 1357
1349 assert (nread == 1); 1358 assert (nread == 1);
1350 1359