[Issue 24894] New: [Lexical] Undocumented HexFloat syntax
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 13 15:56:18 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24894
Issue ID: 24894
Summary: [Lexical] Undocumented HexFloat syntax
Product: D
Version: D2
Hardware: All
URL: http://dlang.org/
OS: All
Status: NEW
Severity: normal
Priority: P3
Component: dlang.org
Assignee: nobody at puremagic.com
Reporter: zxinsworld at gmail.com
This code compiles:
```d
void main(){
float x = 0xp1;
}
```
However, the grammar in the spec doesn't list any way to write a HexFloat
without leading digits:
```
HexFloat:
HexPrefix HexDigitsNoSingleUS . HexDigitsNoStartingUS HexExponent
HexPrefix . HexDigitsNoStartingUS HexExponent
HexPrefix HexDigitsNoSingleUS HexExponent
```
So we need to either add ``HexPrefix HexExponent`` to the grammar, or
deprecate``0xp1`` in case it wasn't meant to work in the first place.
--
More information about the Digitalmars-d-bugs
mailing list