-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix go number highlighting #3981
Fix go number highlighting #3981
Conversation
Go number literals are considerably more complex than previously expressed. Most notable, `_` is allowed in several contexts to allow digit grouping, hex numbers can take `p` exponents, and a number with a radix (`.`) requires digits before or after but not both. The additional test cases were pulled from https://go.dev/ref/spec.
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +187 B View Changes
|
These numbers get picked up by the decimal regex.
Defining the two together before defining decimals caused us to match the beginnings of what should be matched as decimal/complex floats such as Defining the two together after defining decimals caused But writing this out made me realize that we don't ever actually match an octal without the |
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +201 B View Changes
|
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +101 B View Changes
|
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +208 B View Changes
|
Go number literals are considerably more complex than previously expressed. Most notable,
_
is allowed in several contexts to allow digit grouping, hex numbers can takep
exponents, and a number with a radix (.
) requires digits before or after but not both. The additional test cases were pulled from https://go.dev/ref/spec.Changes
Add test cases from https://go.dev/ref/spec, and make the tests pass.
Checklist
CHANGES.md