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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support template parameter packs
  • Loading branch information
pyrmont committed Jun 19, 2020
commit b3bedc5add3432b898d1aebf623667b0c55698b2
12 changes: 11 additions & 1 deletion lib/rouge/lexers/cpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@ def self.reserved

state :template do
rule %r/>/, Punctuation, :pop!
rule %r/typename\b/, Keyword, :classname
rule %r/(typename)([ ,]?)/ do |m|
case m[2]
when " "
groups Keyword, Text
push :classname
when ","
groups Keyword, Punctuation
else
token Keyword
end
end
mixin :root
end

Expand Down