Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lexical] Undocumented HexFloat syntax #4149

Open
dlangBugzillaToGithub opened this issue Dec 13, 2024 · 0 comments
Open

[Lexical] Undocumented HexFloat syntax #4149

dlangBugzillaToGithub opened this issue Dec 13, 2024 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

zxinsworld reported this on 2024-12-13T15:56:18Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24894

Description

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant