diff options
| author | Amaan Q <amaanq12@gmail.com> | 2023-01-08 01:56:27 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-01-09 21:24:54 +0100 |
| commit | e1f2bb2fcfba4bfcf341b8c52cc059ed61018558 (patch) | |
| tree | 71b852c75867f1056ed4b736f7e4d0807221ca88 | |
| parent | feat: add smali to lockfile, parser, and link to repo in README (diff) | |
| download | nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar.gz nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar.bz2 nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar.lz nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar.xz nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.tar.zst nvim-treesitter-e1f2bb2fcfba4bfcf341b8c52cc059ed61018558.zip | |
feat: add smali query
| -rw-r--r-- | queries/smali/highlights.scm | 113 | ||||
| -rw-r--r-- | queries/smali/injections.scm | 1 |
2 files changed, 114 insertions, 0 deletions
diff --git a/queries/smali/highlights.scm b/queries/smali/highlights.scm new file mode 100644 index 000000000..71e4220d9 --- /dev/null +++ b/queries/smali/highlights.scm @@ -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 diff --git a/queries/smali/injections.scm b/queries/smali/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/queries/smali/injections.scm @@ -0,0 +1 @@ +(comment) @comment |
