nvim-treesitter/queries/smali/highlights.scm

192 lines
2.7 KiB
Scheme
Raw Normal View History

2023-01-08 01:56:27 -05:00
; Types
(class_identifier) @type
(primitive_type) @type.builtin
2023-02-20 08:10:43 -05:00
((class_identifier) @type.builtin
(#vim-match? @type.builtin "^L(android|com/android|dalvik|java)/"))
2023-01-08 01:56:27 -05:00
; Methods
2023-02-20 08:10:43 -05:00
(method_definition
(method_signature (method_identifier) @method))
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
(expression
2023-01-08 01:56:27 -05:00
(opcode) @_invoke
2023-02-20 08:10:43 -05:00
(value
(body
(full_method_signature
(method_signature (method_identifier) @method.call))))
2023-01-08 01:56:27 -05:00
(#lua-match? @_invoke "^invoke"))
2023-02-20 08:10:43 -05:00
(method_handle
(full_method_signature
(method_signature (method_identifier) @method.call)))
(call_site) @method.call
(custom_invoke
(method_signature (method_identifier) @method.call))
(annotation_value
(body
(method_signature (method_identifier) @method.call)))
(annotation_value
(body
(full_method_signature
(method_signature (method_identifier) @method.call))))
(field_definition
(value
(body
(method_signature (method_identifier) @method.call))))
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
(field_definition
(value
(body
(full_method_signature
(method_signature (method_identifier) @method.call)))))
((method_signature
(method_identifier) @constructor)
(#any-of? @constructor "<init>" "<clinit>"))
2023-01-08 01:56:27 -05:00
; Fields
(field_identifier) @field
2023-02-20 08:10:43 -05:00
(annotation_key) @field
2023-01-08 01:56:27 -05:00
; Variables
2023-02-20 08:10:43 -05:00
(variable) @variable.builtin
(local_directive
(identifier) @variable)
; Parameters
(parameter) @parameter.builtin
(param_identifier) @parameter
2023-01-08 01:56:27 -05:00
; Labels
2023-02-20 08:10:43 -05:00
[
(label)
(jmp_label)
] @label
2023-01-08 01:56:27 -05:00
; Operators
(opcode) @keyword.operator
((opcode) @keyword.return
2023-02-20 08:10:43 -05:00
(#lua-match? @keyword.return "^return"))
((opcode) @conditional
(#vim-match? @conditional "^(if|cmp)"))
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
((opcode) @exception
(#lua-match? @exception "^throw"))
[
"="
".."
] @operator
2023-01-08 01:56:27 -05:00
; Keywords
[
".class"
".super"
".source"
".implements"
".field"
2023-02-20 08:10:43 -05:00
".end field"
2023-01-08 01:56:27 -05:00
".annotation"
2023-02-20 08:10:43 -05:00
".end annotation"
2023-01-08 01:56:27 -05:00
".subannotation"
2023-02-20 08:10:43 -05:00
".end subannotation"
2023-01-08 01:56:27 -05:00
".param"
2023-02-20 08:10:43 -05:00
".end param"
".parameter"
".end parameter"
2023-01-08 01:56:27 -05:00
".line"
".locals"
2023-02-20 08:10:43 -05:00
".local"
".end local"
".restart local"
2023-01-08 01:56:27 -05:00
".registers"
".catch"
".catchall"
".packed-switch"
".end packed-switch"
".sparse-switch"
".end sparse-switch"
".array-data"
".end array-data"
".enum"
] @keyword
[
2023-02-20 08:10:43 -05:00
(prologue_directive)
(epilogue_directive)
2023-01-08 01:56:27 -05:00
] @keyword
[
".method"
2023-02-20 08:10:43 -05:00
".end method"
] @keyword.function
2023-01-08 01:56:27 -05:00
; Literals
2023-02-20 08:10:43 -05:00
(string) @string
(escape_sequence) @string.escape
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
(character) @character
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
(number) @number
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
[
(float)
(NaN)
(Infinity)
] @float
2023-01-08 01:56:27 -05:00
2023-02-20 08:10:43 -05:00
(boolean) @boolean
(null) @constant.builtin
2023-01-08 01:56:27 -05:00
; Misc
2023-02-20 08:10:43 -05:00
(annotation_visibility) @storageclass
2023-01-08 01:56:27 -05:00
(access_modifiers) @type.qualifier
2023-02-20 08:10:43 -05:00
(array_type
"[" @punctuation.special)
2023-01-08 01:56:27 -05:00
["{" "}"] @punctuation.bracket
2023-02-20 08:10:43 -05:00
["(" ")"] @punctuation.bracket
[
"->"
":"
","
"@"
] @punctuation.delimiter
2023-01-08 01:56:27 -05:00
; Comments
(comment) @comment @spell
(class_definition
(comment) @comment.documentation)
; Errors
(ERROR) @error