diff options
| author | Graham Bates <info@grahambates.com> | 2022-04-26 17:53:51 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-04-27 16:54:38 +0200 |
| commit | 7a01241ba6230ef34f62ae8e4ce5033ea78c4e66 (patch) | |
| tree | 0be655838319ee49e4b0149d8ebf16c8f1e7a156 | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar.gz nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar.bz2 nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar.lz nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar.xz nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.tar.zst nvim-treesitter-7a01241ba6230ef34f62ae8e4ce5033ea78c4e66.zip | |
feat: add m68k parser and queries
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 9 | ||||
| -rw-r--r-- | queries/m68k/folds.scm | 1 | ||||
| -rw-r--r-- | queries/m68k/highlights.scm | 73 |
4 files changed, 86 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json index ca8515d78..1dde94954 100644 --- a/lockfile.json +++ b/lockfile.json @@ -179,6 +179,9 @@ "lua": { "revision": "2b4ffd5a5ffd0c6b4c84f0d9e003050a70db2a37" }, + "m68k": { + "revision": "4760f19a60e0d0598032ddd6683999284c3c2bb4" + }, "make": { "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 0f305be86..8682d48eb 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1041,6 +1041,15 @@ list.wgsl = { filetype = "wgsl", } +list.m68k = { + install_info = { + url = "https://github.com/grahambates/tree-sitter-m68k", + files = { "src/parser.c" }, + }, + maintainers = { "@grahambates" }, + filetype = "asm68k", +} + local M = { list = list, filetype_to_parsername = filetype_to_parsername, diff --git a/queries/m68k/folds.scm b/queries/m68k/folds.scm new file mode 100644 index 000000000..1dd8eaf11 --- /dev/null +++ b/queries/m68k/folds.scm @@ -0,0 +1 @@ +(element_list) @fold diff --git a/queries/m68k/highlights.scm b/queries/m68k/highlights.scm new file mode 100644 index 000000000..d2791a238 --- /dev/null +++ b/queries/m68k/highlights.scm @@ -0,0 +1,73 @@ +(symbol) @variable + +(label name: (symbol) @constant) + +[ + (instruction_mnemonic) + (directive_mnemonic) +] @function.builtin + +(include (directive_mnemonic) @include) +(include_bin (directive_mnemonic) @include) +(include_dir (directive_mnemonic) @include) + + +(size) @attribute + +(macro_definition name: (symbol) @function.macro) +(macro_call name: (symbol) @function.macro) + +[ + (path) + (string_literal) +] @string + +[ + (decimal_literal) + (hexadecimal_literal) + (octal_literal) + (binary_literal) +] @number + +[ + (reptn) + (carg) + (narg) + (macro_arg) +] @variable.builtin + +[ + (control_mnemonic) + (address_register) + (data_register) + (float_register) + (named_register) +] @keyword + +(repeat (control_mnemonic) @repeat) +(conditional (control_mnemonic) @conditional) + +(interpolated (macro_arg) @embedded) + +(comment) @comment + +[ + (operator) + "=" + "#" +] @operator + +[ + "." + "," + "/" + "-" +] @punctuation.delimiter + +[ + "(" + ")" + ")+" +] @punctuation.bracket + +(section) @namespace |
