New regex for matching numbers#2995
Closed
roopeshor wants to merge 6 commits intoPrismJS:masterfrom
roopeshor:master
Closed
New regex for matching numbers#2995roopeshor wants to merge 6 commits intoPrismJS:masterfrom roopeshor:master
roopeshor wants to merge 6 commits intoPrismJS:masterfrom
roopeshor:master
Conversation
Member
|
Thank you for the PR @Roopesh2! Please rebuild Prism by running |
Author
|
@RunDevelopment I've rebuilt code and updated test codes |
Author
|
@RunDevelopment Please don't merge this PR now. I've to work more on this as I found another critical bug. Bug is that number in a variable starting with '$' gets matched. |
Member
|
Closed in favor of #3149. Thank you for reporting these problems! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old regex for detecting number doesn't work in following edge cases:
0xf_f_f_f_ffn,
0xf_f_f_f_f,
0b1_1_1_1,
0b0_0_1_0_1_0_1n,
0o1_1_3_2,
0o1_1_3_2n,
2.2_4_54e64_33,
2.2_4_54e+64_33,
2.2_4_54e-64_33,
3_4_5,
3_4_5.5_5_6
The new one also detects these kind of numbers. (I know these are rare and not encouraged, but I think it should be also supported because they are also valid numbers).