Numbers should be allowed to contain underscores
See original GitHub issuehow to remove the space add before underline ?
const _list = 0b1111_0110;
->
const _list = 0b1111 _0110
;
break my code
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Underscores in Numeric Literals
For instance, if your code contains numbers with many digits, you can use an underscore character to separate digits in groups of three,...
Read more >Regular expression to match numbers followed by underscore ...
The regex means: "one or more digits ( [0-9]{1,} ), followed by an underscore ( _ ) and then again one or more...
Read more >Verify that a string only contains letters, numbers, underscores ...
In this article, we are going to find out how to verify a string that contains only letters, numbers, underscores, and dashes in...
Read more >The name can only contain underscores and alphanumeric ...
Error: The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include...
Read more >What are the underscores in numeric literals in Java?
Underscores can only be between digits and numerals. There are no underscores allowed adjacent to decimal places, the L/F suffix, or the radix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll be glad to take this.
Ah, I see. Relatively new feature - numeric separator. https://github.com/tc39/proposal-numeric-separator
Someone just needs to add
_
as a valid numeral inside numbers along with a few tests. Would be a good first issue.https://github.com/beautify-web/js-beautify/blob/5c00e1d7ec2be058c1c652958bca24e38a1699af/js/src/javascript/tokenizer.js#L69
https://github.com/beautify-web/js-beautify/blob/5c00e1d7ec2be058c1c652958bca24e38a1699af/python/jsbeautifier/javascript/tokenizer.py#L64-L66