From d17a6affb1d0f8876c094bb37315c9a235a7b5dc Mon Sep 17 00:00:00 2001 From: Tan Le Date: Tue, 28 Jun 2022 13:17:54 +1000 Subject: [PATCH] Fix template highlight of braces in CPP lexer (#1839) --- lib/rouge/lexers/cpp.rb | 1 + spec/visual/samples/cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/rouge/lexers/cpp.rb b/lib/rouge/lexers/cpp.rb index d78261e8e7..e9694267a2 100644 --- a/lib/rouge/lexers/cpp.rb +++ b/lib/rouge/lexers/cpp.rb @@ -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 diff --git a/spec/visual/samples/cpp b/spec/visual/samples/cpp index a08ab960cb..b738ec6f4e 100644 --- a/spec/visual/samples/cpp +++ b/spec/visual/samples/cpp @@ -112,6 +112,13 @@ void forward_args(F f, Args... args) { f(std::forward(args)...); } +// using auto +template +void func(); + +template +void func(); + // namespace namespace printing { inline namespace latest {