lib/rouge/lexers/julia.rb in rouge-4.2.0 vs lib/rouge/lexers/julia.rb in rouge-4.2.1
- old
+ new
@@ -250,18 +250,19 @@
rule %r/0x[a-fA-F0-9]+/, Literal::Number::Hex
rule %r/\d+(_\d+)+/, Literal::Number::Integer
rule %r/\d+/, Literal::Number::Integer
end
+ NAME_RE = %r/[\p{L}\p{Nl}\p{S}_][\p{Word}\p{S}\p{Po}!]*/
state :funcname do
- rule %r/[\p{L}\p{Nl}\p{S}_][\p{Word}\p{S}\p{Po}!]*/, Name::Function, :pop!
+ rule NAME_RE, Name::Function, :pop!
rule %r/\([^\s\w{]{1,2}\)/, Operator, :pop!
rule %r/[^\s\w{]{1,2}/, Operator, :pop!
end
state :typename do
- rule %r/[\p{L}\p{Nl}\p{S}_][\p{Word}\p{S}\p{Po}!]*/, Name::Class, :pop!
+ rule NAME_RE, Name::Class, :pop!
end
state :stringescape do
rule %r/\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})/,
Literal::String::Escape