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

remove octal and binary float literals from the language #2093

Closed
andrewrk opened this Issue Mar 22, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@andrewrk
Copy link
Member

andrewrk commented Mar 22, 2019

Either document them or remove them from the language.

If they are removed from the language then the code in tokenizer.cpp that doesn't call bigfloat_init_buf can be deleted. If they stay in the language, zig should probably reformat the string to match hex float literals and still have the same float parsing code handle them.

@andrewrk andrewrk added the docs label Mar 22, 2019

@andrewrk andrewrk added this to the 0.5.0 milestone Mar 22, 2019

@andrewrk andrewrk added the breaking label Mar 22, 2019

@andrewrk andrewrk changed the title add documentation for octal and binary float literals add documentation for octal and binary float literals or remove them from the language Mar 22, 2019

@thejoshwolfe

This comment has been minimized.

Copy link
Member

thejoshwolfe commented Mar 22, 2019

i vote for removal

@andrewrk andrewrk added the proposal label Mar 22, 2019

@andrewrk andrewrk changed the title add documentation for octal and binary float literals or remove them from the language remove octal and binary float literals from the language Mar 22, 2019

@andrewrk andrewrk added accepted and removed docs labels Mar 22, 2019

@andrewrk andrewrk closed this in 3e9697b Mar 23, 2019

@andrewrk

This comment has been minimized.

Copy link
Member Author

andrewrk commented Mar 23, 2019

This isn't quite solved yet, still needs to be removed from the grammar [1] [2] and stage2 parser.

@andrewrk

This comment has been minimized.

Copy link
Member Author

andrewrk commented Mar 31, 2019

The grammar changes are done thanks to @mokulus.

As to the stage2 parser, I think the tokenizer can allow octal and binary float literals, and then semantic analysis can reject them as invalid format. We already defer float parsing to semantic analysis in stage2. So this can be considered closed.

@andrewrk andrewrk closed this Mar 31, 2019

@andrewrk andrewrk modified the milestones: 0.5.0, 0.4.0 Apr 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.