mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Classify object names and enum names as class names
This commit is contained in:
parent
6ca7db7019
commit
d6ea504031
@ -180,6 +180,9 @@
|
||||
<rule pattern="@(?:[_\p{L}][\p{L}\p{N}]*|`@?[_\p{L}][\p{L}\p{N}]+`)">
|
||||
<token type="NameDecorator"/>
|
||||
</rule>
|
||||
<rule pattern="(?:\p{Lu}[_\p{L}]*)(?=\.)">
|
||||
<token type="NameClass"/>
|
||||
</rule>
|
||||
<rule pattern="(?:[_\p{L}][\p{L}\p{N}]*|`@?[_\p{L}][\p{L}\p{N}]+`)">
|
||||
<token type="Name"/>
|
||||
</rule>
|
||||
|
2
lexers/testdata/kotlin.actual
vendored
2
lexers/testdata/kotlin.actual
vendored
@ -48,6 +48,8 @@ fun someOperators(a: Int, b: Int) {
|
||||
println( a % b)
|
||||
println(c in a..b)
|
||||
|
||||
Logger.info("Hello World")
|
||||
|
||||
a %= 2
|
||||
a && b
|
||||
a *= 2
|
||||
|
17
lexers/testdata/kotlin.expected
vendored
17
lexers/testdata/kotlin.expected
vendored
@ -309,6 +309,13 @@
|
||||
{"type":"Name","value":"b"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n \n "},
|
||||
{"type":"NameClass","value":"Logger"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"info"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralStringDouble","value":"\"Hello World\""},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n \n "},
|
||||
{"type":"Name","value":"a"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Operator","value":"%="},
|
||||
@ -488,29 +495,29 @@
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"NameDecorator","value":"@Target"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"AnnotationTarget"},
|
||||
{"type":"NameClass","value":"AnnotationTarget"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"CLASS"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"AnnotationTarget"},
|
||||
{"type":"NameClass","value":"AnnotationTarget"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"FUNCTION"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"Name","value":"AnnotationTarget"},
|
||||
{"type":"NameClass","value":"AnnotationTarget"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"VALUE_PARAMETER"},
|
||||
{"type":"Punctuation","value":","},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Name","value":"AnnotationTarget"},
|
||||
{"type":"NameClass","value":"AnnotationTarget"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"EXPRESSION"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"NameDecorator","value":"@Retention"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"Name","value":"AnnotationRetention"},
|
||||
{"type":"NameClass","value":"AnnotationRetention"},
|
||||
{"type":"Punctuation","value":"."},
|
||||
{"type":"Name","value":"SOURCE"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user