Bug 24894 – [Lexical] Undocumented HexFloat syntax

Status
NEW
Severity
normal
Priority
P3
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-12-13T15:56:18Z
Last change time
2024-12-15T15:28:41Z
Assigned to
No Owner
Creator
zxinsworld
Moved to GitHub: dlang.org#4149 →

Comments

Comment #0 by zxinsworld — 2024-12-13T15:56:18Z
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.
Comment #1 by robert.schadek — 2024-12-15T15:28:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4149 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB