lib/rouge/lexers/r.rb in rouge-3.7.0 vs lib/rouge/lexers/r.rb in rouge-3.8.0

- old
+ new

@@ -58,19 +58,18 @@ rule %r/"(\\.|.)*?"/m, Str::Double rule %r/%[^%]*?%/, Operator rule %r/0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/, Num::Hex - rule %r/[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/, - Num + rule %r/[+-]?(\d+([.]\d+)?|[.]\d+)([eE][+-]?\d+)?[Li]?/, Num # Only recognize built-in functions when they are actually used as a # function call, i.e. followed by an opening parenthesis. # `Name::Builtin` would be more logical, but is usually not # highlighted specifically; thus use `Name::Function`. rule %r/\b(?<!.)(#{PRIMITIVE_FUNCTIONS.join('|')})(?=\()/, Name::Function - rule %r/[a-zA-Z.]([a-zA-Z_][\w.]*)?/ do |m| + rule %r/(?:(?:[[:alpha:]]|[.][._[:alpha:]])[._[:alnum:]]*)|[.]/ do |m| if KEYWORDS.include? m[0] token Keyword elsif KEYWORD_CONSTANTS.include? m[0] token Keyword::Constant elsif BUILTIN_CONSTANTS.include? m[0]