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

Leading +/- in number not highlighed correctly #9

Open
aDotInTheVoid opened this issue Jul 2, 2022 · 1 comment
Open

Leading +/- in number not highlighed correctly #9

aDotInTheVoid opened this issue Jul 2, 2022 · 1 comment

Comments

@aDotInTheVoid
Copy link

"normal 10 leading+ +10 leading- -10 leading+. +10.0 leading-. -10.0" The 10 with no decimal is hilighed in blue, but everything else is green

VSCode recognizes +10 as a entity.name.tag but 10 as constant.numeric.integer.decimal.rust

The same source as before, but with a pop up below the +10, showing entity.name.tag
The same source as before, but with a pop up below the +10, showing constant.numeric.integer.decimal.rust

This ultimately occurs because +10 is both a valid node name, and entry. Ideally +10 should be highlighted differently in the document +10 +10, but I don't thing this is achievable with regex's. But I think if +10 can only be a number or identifier, it's more likely to be a number.

@eugenesvk
Copy link

because +10 is both a valid node name, and entry

Maybe this changed, but this shouldn't be a valid identifier, it specifically excludes + followed up by a digit
bare-identifier := ((identifier-char - digit - sign) identifier-char* | sign ((identifier-char - digit) identifier-char*)?) - keyword

Ideally +10 should be highlighted differently in the document +10 +10, but I don't thing this is achievable with regex's.

that's fine since you can have a node parsing rule have a higher priority, so the first +10 would be node, and the second +10 would be node attribute

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

No branches or pull requests

2 participants