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
New regex for matching numbers #2995
Conversation
Thank you for the PR @Roopesh2! Please rebuild Prism by running |
@RunDevelopment I've rebuilt code and updated test codes |
@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. |
Closed in favor of #3149. Thank you for reporting these problems! |
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).