feat: add smali query

This commit is contained in:
Amaan Q 2023-01-08 01:56:27 -05:00 committed by Stephan Seitz
parent c657cf6b11
commit e1f2bb2fcf
2 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,113 @@
; Types
(class_identifier) @type
(primitive_type) @type.builtin
(array_type
"[" @punctuation.bracket)
; Methods
(method_declaration
(method_identifier) @method)
(statement
(opcode) @_invoke
(full_method_identifier
(method_identifier) @method.call)
(#lua-match? @_invoke "^invoke"))
(method_identifier
"<init>(" @constructor
")" @constructor)
(method_identifier
"<clinit>(" @constructor
")" @constructor)
; Fields
(field_identifier) @field
; Parameters
(parameter) @parameter
; Variables
(variable) @variable
; Labels
(label) @label
; Operators
(opcode) @keyword.operator
((opcode) @keyword.return
(#lua-match? @keyword.return "^return"))
"=" @operator
; Keywords
[
".class"
".super"
".source"
".implements"
".field"
".method"
".annotation"
".subannotation"
".param"
".line"
".locals"
".registers"
".catch"
".catchall"
".packed-switch"
".end packed-switch"
".sparse-switch"
".end sparse-switch"
".array-data"
".end array-data"
".enum"
] @keyword
[
(end_field)
(end_method)
(end_annotation)
(end_subannotation)
(end_param)
] @keyword
; Literals
(string_literal) @string
(number_literal) @number
(boolean_literal) @boolean
;; unsupported
; (character_literal) @character
(null_literal) @constant.builtin
; Misc
(annotation_visibility) @attribute
(access_modifiers) @type.qualifier
["{" "}"] @punctuation.bracket
"->" @punctuation.delimiter
; Comments
(comment) @comment @spell

View file

@ -0,0 +1 @@
(comment) @comment