lib/rouge/lexers/cpp.rb in rouge-3.4.1 vs lib/rouge/lexers/cpp.rb in rouge-3.5.0

- old
+ new

@@ -47,32 +47,32 @@ id = /[a-zA-Z_][a-zA-Z0-9_]*/ prepend :root do # Offload C++ extensions, http://offload.codeplay.com/ - rule /(?:__offload|__blockingoffload|__outer)\b/, Keyword::Pseudo + rule %r/(?:__offload|__blockingoffload|__outer)\b/, Keyword::Pseudo end # digits with optional inner quotes # see www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf dq = /\d('?\d)*/ prepend :statements do - rule /class\b/, Keyword, :classname + rule %r/class\b/, Keyword, :classname rule %r((#{dq}[.]#{dq}?|[.]#{dq})(e[+-]?#{dq}[lu]*)?)i, Num::Float rule %r(#{dq}e[+-]?#{dq}[lu]*)i, Num::Float - rule /0x\h('?\h)*[lu]*/i, Num::Hex - rule /0[0-7]('?[0-7])*[lu]*/i, Num::Oct - rule /#{dq}[lu]*/i, Num::Integer - rule /\bnullptr\b/, Name::Builtin - rule /(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str + rule %r/0x\h('?\h)*[lu]*/i, Num::Hex + rule %r/0[0-7]('?[0-7])*[lu]*/i, Num::Oct + rule %r/#{dq}[lu]*/i, Num::Integer + rule %r/\bnullptr\b/, Name::Builtin + rule %r/(?:u8|u|U|L)?R"([a-zA-Z0-9_{}\[\]#<>%:;.?*\+\-\/\^&|~!=,"']{,16})\(.*?\)\1"/m, Str end state :classname do rule id, Name::Class, :pop! # template specification - rule /\s*(?=>)/m, Text, :pop! + rule %r/\s*(?=>)/m, Text, :pop! mixin :whitespace end end end end