digitalmars.D.learn - float literals
- Ellery Newcomer (26/26) Dec 27 2008 From the grammar,
- BCS (3/11) Dec 27 2008 I don't think "Integer" is referring to "IntegerLiteral". In fact, I thi...
- Ellery Newcomer (4/19) Dec 28 2008 Umm.. Ok. I guess I'll just omit it from my grammar until it is defined....
From the grammar, FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffix it appears that dmd should be able to compile something like ifloat f1 = 0b1001i; //doesn't like this ifloat f2 = 010i; //doesn't treat this as octal ifloat f3 = 0xFFFFi; //doesn't like this if built in complex numbers are going away, this will become a non issue. real r1 = 0b1001L; //does work! real r2 = 010L; //does work! real r3 = 0xFFFFL; //does work! Yay! float f4 = 0b1001F; //doesn't like this float f5 = 010F; //doesn't like this float f6 = 0xFFFFF; //umm.... Obviously, the F suffix introduces an ambiguity for hex. Not sure if the others should be considered a problem. What's the deal? Is the grammar lying to me? Is DMD not following spec? Am I going crazy? (well, that's a given) At the moment, I appear to be using dmd 1.033
Dec 27 2008
Reply to Ellery,From the grammar, FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffixI don't think "Integer" is referring to "IntegerLiteral". In fact, I think it is undefined.
Dec 27 2008
BCS wrote:Reply to Ellery,Umm.. Ok. I guess I'll just omit it from my grammar until it is defined... At least for RealSuffix it appeared very much to be referring to IntegerLiteralFrom the grammar, FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffixI don't think "Integer" is referring to "IntegerLiteral". In fact, I think it is undefined.
Dec 28 2008
Reply to Ellery,BCS wrote:As that is in lex.html I don't think it is part of the syntax but part of the lexical stuff. OTOH I seem to recall that there are some issues with FP literals vs slices ".."Reply to Ellery,Umm.. Ok. I guess I'll just omit it from my grammar until it is defined... At least for RealSuffix it appeared very much to be referring to IntegerLiteralFrom the grammar, FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffixI don't think "Integer" is referring to "IntegerLiteral". In fact, I think it is undefined.
Dec 29 2008
Reply to Ellery,BCS wrote:As that is in lex.html I don't think it is part of the syntax but part of the lexical stuff. OTOH I seem to recall that there are some issues with FP literals vs slices ".."Reply to Ellery,Umm.. Ok. I guess I'll just omit it from my grammar until it is defined... At least for RealSuffix it appeared very much to be referring to IntegerLiteralFrom the grammar, FloatLiteral: Float Float Suffix Integer ImaginarySuffix Integer FloatSuffix ImaginarySuffix Integer RealSuffix ImaginarySuffixI don't think "Integer" is referring to "IntegerLiteral". In fact, I think it is undefined.
Dec 29 2008