Navigation Menu

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

C++ lexer thinks that : can only follow a label name #1996

Closed
Golovanov399 opened this issue Dec 22, 2021 · 0 comments · Fixed by #2022
Closed

C++ lexer thinks that : can only follow a label name #1996

Golovanov399 opened this issue Dec 22, 2021 · 0 comments · Fixed by #2022
Milestone

Comments

@Golovanov399
Copy link

This is a copy of some old issue: gpoore/minted#195

Briefly: the token right before the comma is highlighted incorrectly in ternary operators (see image below) and range-based for loops. Right now the lexer is not aware of any other usage of : except indicating a label.

I have created a pull-request 3 years ago, but it has not been merged. All its details are lost, but as far as I remember, I have added a rule or two before or after this line:

(r'(' + _ident + r')(\s*)(:)(?!:)', bygroups(Name.Label, Whitespace, Punctuation)),

It was probably not the best solution and just a workaround, but I didn't feel like digging in.

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

Successfully merging a pull request may close this issue.

2 participants