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

Numeric separators: 1_000_000 #215

Merged
merged 4 commits into from May 12, 2019
Merged

Numeric separators: 1_000_000 #215

merged 4 commits into from May 12, 2019

Conversation

odino
Copy link
Collaborator

@odino odino commented May 10, 2019

This PR adds support to underscores in numeric
literals, following the footsteps of Python 3
and JS.

100 # 100
1_0_0 # 100
10_0 # 100
_100 # ERROR: identifier not found: _

The main differences with other implementations are:

  • you can use as many consecutive _ as you'd like (10_000_000___00 is ok)
  • underscores can be found at the end of a number (100, 1_0_0 and 100_ are all the same)

Fixes #212

This PR adds support to underscores in numeric
literals, following the footsteps of [Python 3](https://www.python.org/dev/peps/pep-0515/#implementation)
and [JS](https://github.com/tc39/proposal-numeric-separator).

```
100 # 100
1_0_0 # 100
10_0 # 100
_100 # ERROR: identifier not found: _
```

The main differences with other implementations are:

* you can use as many consecutive `_` as you'd like (`10_000_000___00` is ok)
* underscores *can* be found at the end of a number (`100`, `1_0_0` and `100_` are all the same)
@odino odino added this to the 1.4.x milestone May 10, 2019
@odino odino requested a review from a team May 10, 2019 12:58
Copy link
Contributor

@ntwrick ntwrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@odino odino merged commit 047fa5b into 1.4.x May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants