Skip to content

Commit

Permalink
Fix template highlight of braces in CPP lexer (#1839)
Browse files Browse the repository at this point in the history
  • Loading branch information
tancnle authored Jun 28, 2022
1 parent 7aab31c commit d17a6af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rouge/lexers/cpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def self.reserved
rule %r/\bnullptr\b/, Name::Builtin
rule %r/(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str
rule %r/(::|<=>)/, Operator
rule %r/[{}]/, Punctuation
end

state :classname do
Expand Down
7 changes: 7 additions & 0 deletions spec/visual/samples/cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ void forward_args(F f, Args... args) {
f(std::forward<Args>(args)...);
}

// using auto
template<auto F = requires { foo(); }>
void func();

template<auto F = []{}>
void func();

// namespace
namespace printing {
inline namespace latest {
Expand Down

0 comments on commit d17a6af

Please sign in to comment.