foo = bar * .95
where the RHS of the binary operation is a floating point constant
with no integer portion. Changing it to 0.95 works, so I assume the
grammar just needs a tweak.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk
> foo = bar * .95
> where the RHS of the binary operation is a floating point constant
> with no integer portion. Changing it to 0.95 works, so I assume the
> grammar just needs a tweak.
Yep. The lexer (imcc.l) is missing this case.
Patches welcome,
leo
It'd help if I could actually rebuild this so it could be tested...
This is the patch. It should work but the version of flex I have installed
doesn't play nice with the rest of the source, so I can't build and test.
--- imcc/imcc.l~ 2004-04-23 05:20:30.000000000 -0400
+++ imcc/imcc.l 2004-05-07 14:02:07.000000000 -0400
@@ -84,7 +84,7 @@
BIN 0b[01]+
DOT [.]
SIGN [-+]
-FLOATNUM {SIGN}?{DIGITS}{DOT}{DIGIT}*([eE]{SIGN}?{DIGITS})?
+FLOATNUM {SIGN}?({DIGITS}{DOT}{DIGIT}*|{DOT}{DIGITS})([eE]{SIGN}?{DIGITS})?
LETTERDIGIT [a-zA-Z0-9_]
LABELLETTERDIGIT ([a-zA-Z0-9_@]|"::")
ID {LETTER}{LABELLETTERDIGIT}*
> It'd help if I could actually rebuild this so it could be tested...
Works. Applied. Tests ok. Thanks,
leo