-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Clarify use of _ in numbers #364
Comments
Leading underscore is an identifier:
However, leading underscore in a fractional component should be invalid:
Trailing underscore should be invalid at the end of any numeric sequence:
Unless it had a leading underscore to begin with (in which case it's an identifier):
Repeated underscores within a numeric sequence should be invalid:
Unless it's an identifier (man this keeps coming up):
Elixir, JS and ruby uses the same rules for their numbers (from a quick test) Therefore the tests should be:
|
Ah yup, you're right, I wasn't actually reading the JS console error for So yeah, those tests all look reasonable. But |
Is this already taken care of? |
The description of using
_
in numbers is a little loose. Experience with the feature in JS shows you really want to be very precise about what's allowed, and I suggest just following JS's lead here. Namely:_
can only be placed between digits: not at the start or end of the number, or next to the decimal point or the radix indicator; or next to another_
.Several tests showing these off:
This would change
binary_trailing_underscore.kdl
,trailing_underscore_hex.kdl
,trailing_underscore_octal.kdl
,underscore_before_number.kdl
The text was updated successfully, but these errors were encountered: