From cffd912f512dc46b5a732068a0380c059db0f07d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 22 Mar 2012 13:51:15 -0700 Subject: * parser.l: Bugfix: was not allowing e-notation floats with no decimal point like 1E1. * stream.c: (vformat): Keep track of whether or not precision was given in precision_p local variable. When printing # pass a precision of 0 to vformat_str, not precision, since precision does not apply. In ~f and ~e, if the precision was not given, default it to 3. Restructured float printing in ~a and ~s. It now just uses sprintf's %g with a precision. If user does not specify precision, it defaults to DBL_DIG to print the number with reasonable accuracy. A .0 is added if it sprintf produces an integer, and the conversion is ~s rather than ~a. --- parser.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parser.l') diff --git a/parser.l b/parser.l index 7e07f79f..52aab27c 100644 --- a/parser.l +++ b/parser.l @@ -153,7 +153,7 @@ SGN [+\-] EXP [eE][+\-]?[0-9]+ DIG [0-9] NUM {SGN}?{DIG}+ -FLO {SGN}?{DIG}*[.]({DIG}+{EXP}?|{EXP}) +FLO {SGN}?({DIG}*[.]{DIG}+{EXP}?|{DIG}+[.]?{EXP}) FLODOT {SGN}?{DIG}+[.] BSCHR [a-zA-Z0-9!$%&*+\-<=>?\\^_~] BSYM {BSCHR}({BSCHR}|#)* -- cgit v1.2.3