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

Support template parameter packs in C++ lexer #1555

Merged

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Jun 19, 2020

Template parameters are more complicated than you could possibly imagine. This adds support for template parameter packs.

It fixes #1546.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Jun 19, 2020
@pyrmont pyrmont self-assigned this Jun 19, 2020
@pyrmont
Copy link
Contributor Author

pyrmont commented Jun 19, 2020

@szilardszaloki I think this fixes the problem. Let me know what you think!

@szilardszaloki
Copy link

@pyrmont Thanks for the fix! Unfortunately, I'm not at all familiar with ruby, just using rouge via GitHub Pages. How about me checking it with recompiling my page when it goes live? Anyhow, the C++ lexer didn't have this issue a couple of weeks ago, so if the fix produces the same output as it did back then, then I guess we're good to go. :)

@pyrmont
Copy link
Contributor Author

pyrmont commented Jul 4, 2020

@szilardszaloki Yeah, unfortunately there's not a simple way to test the code in a PR. You'd basically need to pull it down onto your system and use it to highlight some text. If you're using Rouge via GitHub Pages, you're really using Jekyll and you can set up a local instance, then specify this fork in your GemFile... not exactly simple.

I'm pretty sure it's working properly now. It's at least correctly highlighting the code that you indicated in the original issue was problematic. I'll merge this in and it'll be part of v3.21.0 of Rouge. That will be released on Tuesday 14 July and should start being used relatively soon in GitHub Pages (you can see the versions of the gems they're using here).

@pyrmont pyrmont merged commit 8a05269 into rouge-ruby:master Jul 4, 2020
@pyrmont pyrmont deleted the bugfix.cpp-template-parameter-pack branch July 4, 2020 05:12
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Jul 4, 2020
@szilardszaloki
Copy link

Thanks, Michael!

mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
The change in rouge-ruby#1495 to the way that the `template` keyword caused
template parameter packs not to be highlighted correctly. This commit
fixes that bug while also introducing a more robust set of rules for
highlighting identifiers succeeding the `template` keyword.
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 this pull request may close these issues.

C++ lexer is broken (typename)
2 participants