1
0
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:
Martin Winandy 2022-11-02 07:16:05 +01:00 committed by Alec Thomas
parent 6ca7db7019
commit d6ea504031
3 changed files with 17 additions and 5 deletions

View File

@ -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>

View File

@ -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

View File

@ -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":")"},