mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 23:40:04 -04:00
feat(smali): update queries from upstream parser
This commit is contained in:
parent
1280315db1
commit
9f157094cd
3 changed files with 40 additions and 10 deletions
|
|
@ -1,11 +1,21 @@
|
|||
; Types
|
||||
|
||||
(class_identifier) @type
|
||||
(class_identifier
|
||||
(identifier) @type)
|
||||
|
||||
(primitive_type) @type.builtin
|
||||
|
||||
((class_identifier) @type.builtin
|
||||
(#match? @type.builtin "^L(android|com/android|dalvik|java|kotlinx)/"))
|
||||
((class_identifier
|
||||
. (identifier) @_first @type.builtin
|
||||
(identifier) @type.builtin)
|
||||
(#any-of? @_first "android" "dalvik" "java" "kotlinx"))
|
||||
|
||||
((class_identifier
|
||||
. (identifier) @_first @type.builtin
|
||||
. (identifier) @_second @type.builtin
|
||||
(identifier) @type.builtin)
|
||||
(#eq? @_first "com")
|
||||
(#any-of? @_second "android" "google"))
|
||||
|
||||
; Methods
|
||||
|
||||
|
|
@ -48,6 +58,8 @@
|
|||
((method_identifier) @constructor
|
||||
(#any-of? @constructor "<init>" "<clinit>"))
|
||||
|
||||
"constructor" @constructor
|
||||
|
||||
; Fields
|
||||
|
||||
[
|
||||
|
|
@ -55,6 +67,9 @@
|
|||
(annotation_key)
|
||||
] @field
|
||||
|
||||
((field_identifier) @constant
|
||||
(#lua-match? @constant "^[%u_]*$"))
|
||||
|
||||
; Variables
|
||||
|
||||
(variable) @variable.builtin
|
||||
|
|
@ -90,6 +105,9 @@
|
|||
((opcode) @exception
|
||||
(#lua-match? @exception "^throw"))
|
||||
|
||||
((opcode) @comment
|
||||
(#eq? @comment "nop")) ; haha, anyone get it? ;)
|
||||
|
||||
[
|
||||
"="
|
||||
".."
|
||||
|
|
@ -100,7 +118,6 @@
|
|||
[
|
||||
".class"
|
||||
".super"
|
||||
".source"
|
||||
".implements"
|
||||
".field"
|
||||
".end field"
|
||||
|
|
@ -118,8 +135,6 @@
|
|||
".end local"
|
||||
".restart local"
|
||||
".registers"
|
||||
".catch"
|
||||
".catchall"
|
||||
".packed-switch"
|
||||
".end packed-switch"
|
||||
".sparse-switch"
|
||||
|
|
@ -131,11 +146,20 @@
|
|||
(epilogue_directive)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
".source"
|
||||
] @include
|
||||
|
||||
[
|
||||
".method"
|
||||
".end method"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
".catch"
|
||||
".catchall"
|
||||
] @exception
|
||||
|
||||
; Literals
|
||||
|
||||
(string) @string
|
||||
|
|
@ -144,6 +168,8 @@
|
|||
|
||||
(character) @character
|
||||
|
||||
"L" @character.special
|
||||
|
||||
(number) @number
|
||||
|
||||
[
|
||||
|
|
@ -160,7 +186,7 @@
|
|||
|
||||
(annotation_visibility) @storageclass
|
||||
|
||||
(access_modifiers) @type.qualifier
|
||||
(access_modifier) @type.qualifier
|
||||
|
||||
(array_type
|
||||
"[" @punctuation.special)
|
||||
|
|
@ -171,11 +197,15 @@
|
|||
|
||||
[
|
||||
"->"
|
||||
":"
|
||||
","
|
||||
":"
|
||||
";"
|
||||
"@"
|
||||
"/"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(line_directive (number) @text.underline @text.literal)
|
||||
|
||||
; Comments
|
||||
|
||||
(comment) @comment @spell
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue