diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-03-22 13:51:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-03-22 13:51:15 -0700 |
commit | cffd912f512dc46b5a732068a0380c059db0f07d (patch) | |
tree | 724d494ff91f293f0044cdc120f9346cbdcb0b9d /parser.l | |
parent | 1ccc6d458fbda380233019a1d80d5aff576d9d03 (diff) | |
download | txr-cffd912f512dc46b5a732068a0380c059db0f07d.tar.gz txr-cffd912f512dc46b5a732068a0380c059db0f07d.tar.bz2 txr-cffd912f512dc46b5a732068a0380c059db0f07d.zip |
* 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 #<bad-float> 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.
Diffstat (limited to 'parser.l')
-rw-r--r-- | parser.l | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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}|#)* |