Description
Is your feature request related to a problem? Please describe.
We have to obscure syntaxes that can be argued to be bugs; certainly one of them.
However, changing the tokenizer/parser for them technically means breaking the language.
- Tokenizer Bug: Floats with leading 0's wrong tokenized #8605
[ 01.1 ] == [ 1 0.1 ]
- Support Hexadecimal, Octal and Binary syntax #7695
[ 0xff ] == [ 0 xff ]
ifxff
is in scope
I think bug for bug compatibility is valuable, but also costly. In this case the cost/benefit of bug for bug compatibility seems off, and we may have a way out.
Describe the solution you'd like
Language versioning would be great, but going this route also means that we'd have to indefinitely support the bad syntax.
So regardless of the language versioning idea, we can run an experiment to verify that the community does not rely on the bad syntax, and then "break" the syntax to no ill effect.
Benefits:
- clean up the implementation; less maintenance overhead
- the default language version has better syntax
Method:
- reject the bad syntaxes in the lexer and/or parser. Ask users to open an issue in the error message.
- wait
- if nothing is reported, fix and improve the lexer and/or parser as appropriate depending on whether an issue was created
Describe alternatives you've considered
Wait for language versioning and maintain the bad syntax forever even if there's no benefit of doing so.
Additional context
Priorities
Add 👍 to issues you find important.