mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add smali query
This commit is contained in:
parent
c657cf6b11
commit
e1f2bb2fcf
2 changed files with 114 additions and 0 deletions
113
queries/smali/highlights.scm
Normal file
113
queries/smali/highlights.scm
Normal 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
|
||||
1
queries/smali/injections.scm
Normal file
1
queries/smali/injections.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(comment) @comment
|
||||
Loading…
Add table
Add a link
Reference in a new issue