lib/rouge/lexers/kotlin.rb in rouge-3.17.0 vs lib/rouge/lexers/kotlin.rb in rouge-3.18.0
- old
+ new
@@ -51,10 +51,13 @@
end
rule %r'\b(val|var)(\s+)' do
groups Keyword::Declaration, Text
push :property
end
+ rule %r'(return|continue|break|this|super)(@#{name})?' do
+ groups Keyword, Name::Decorator
+ end
rule %r'\bfun\b', Keyword
rule %r'\b(?:#{keywords.join('|')})\b', Keyword
rule %r'^\s*\[.*?\]', Name::Attribute
rule %r'[^\S\n]+', Text
rule %r'\\\n', Text # line continuation
@@ -76,9 +79,10 @@
groups Name::Class, Punctuation
push :generic_parameters
end
rule class_name, Name::Class
rule %r'(#{name})(?=\s*[({])', Name::Function
+ rule %r'(#{name})@', Name::Decorator # label
rule name, Name
end
state :package do
rule %r'\S+', Name::Namespace, :pop!