Fix parsing of floating point values in exponential notation, and numbers

with a leading + or - sign (untested).
This commit is contained in:
Frank Mori Hess 2006-08-28 22:59:42 +00:00
parent 29358e699f
commit a186b9a33c

View file

@ -69,13 +69,10 @@ softcal_to_phys {return T_SOFTCAL_TO_PHYS;}
softcal_from_phys {return T_SOFTCAL_FROM_PHYS;}
=> { return ( T_ASSIGN ); };
(0[xX])?(00)?[0-9a-fA-F]+ {calib_lvalp->ival = strtol(calib_yyget_text(yyscanner), NULL, 0);
[+-]?(0[xX])?[0-9a-fA-F]+ {calib_lvalp->ival = strtol(calib_yyget_text(yyscanner), NULL, 0);
return( T_NUMBER ); }
[0-9]+\.*[0-9]* { calib_lvalp->dval = strtod(calib_yyget_text(yyscanner), 0);
return( T_FLOAT ); }
[0-9]*\.*[0-9]+ { calib_lvalp->dval = strtod(calib_yyget_text(yyscanner), 0);
[+-]?(([0-9]+\.?[0-9]*)|([0-9]*\.?[0-9]+))([eE][+-]?[0-9]+)? { calib_lvalp->dval = strtod(calib_yyget_text(yyscanner), 0);
return( T_FLOAT ); }
[ \t]