Doesn't like .001
Brought to you by:
mecki
if (x < .001) {
// do something
}
compiles fine under javac, but chokes on Janino. The
workaround is to use "0.001"
MyClass.java, Line 1019, Column 20: Unexpected
token "." in primary
at net.janino.Parser.throwParseException(Unknown
Source)
at net.janino.Parser.parsePrimary(Unknown Source)
at net.janino.Parser.parseUnaryExpression
(Unknown Source)
at net.janino.Parser.parseMultiplicativeExpression
(Unknown Source)
at net.janino.Parser.parseAdditiveExpression
(Unknown Source)
at net.janino.Parser.parseShiftExpression(Unknown
Source)
Logged In: YES
user_id=865893
Yep... I never liked the ".001" style for floating-point
constants. It looks ugly and is difficult to scan (the dot
can either be the beginning of a floating-point constant or
the "." operator). But for the sake of JAVAC
compatibility... will be fixed in version 1.0.7.