digitalmars.D - FloatLiteral 1f
- Philip Trettner (17/17) Jul 27 2010 Hello.
- Alix Pexton (7/24) Jul 28 2010 This is one of many discrepancies between the docs and the
- Jerry Quinn (2/26) Jul 28 2010 This was reported in bug 949:
Hello. When I came across the lexical definition of a FloatLiteral I wondered how '1f' gets recognized. The definition says: FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffix Float contains a dot or an exponent, so this cannot be. The suffixes for integers are only imaginary, so '1f' won't be recognized either. But the D Compiler compiles fine (as it should be). Am I missing something or is this a flaw in the FloatLiteral definition? kind regards, Philip
Jul 27 2010
On 27/07/2010 21:46, Philip Trettner wrote:Hello. When I came across the lexical definition of a FloatLiteral I wondered how '1f' gets recognized. The definition says: FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffix Float contains a dot or an exponent, so this cannot be. The suffixes for integers are only imaginary, so '1f' won't be recognized either. But the D Compiler compiles fine (as it should be). Am I missing something or is this a flaw in the FloatLiteral definition? kind regards, PhilipThis is one of many discrepancies between the docs and the implementation. I'm still working on writing productions that match the code for my visual grammar project. The code isn't that hard to read if you ever get tempted to take a look, but be wary, it's a little spread out, not all cases are handled in the same place. A...
Jul 28 2010
On 27/07/2010 21:46, Philip Trettner wrote:This was reported in bug 949: http://d.puremagic.com/issues/show_bug.cgi?id=949Hello. When I came across the lexical definition of a FloatLiteral I wondered how '1f' gets recognized. The definition says: FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffix Float contains a dot or an exponent, so this cannot be. The suffixes for integers are only imaginary, so '1f' won't be recognized either. But the D Compiler compiles fine (as it should be). Am I missing something or is this a flaw in the FloatLiteral definition? kind regards, Philip
Jul 28 2010