diff options
| author | leo60228 <leo@60228.dev> | 2021-08-29 13:10:15 -0400 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-09-17 21:06:36 +0200 |
| commit | df06bfead256c5f15ee5972e1013702229fb82ec (patch) | |
| tree | 51470f08d54377f6286131ad3a7871770cc98098 | |
| parent | update scala highlights (#1760) (diff) | |
| download | nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar.gz nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar.bz2 nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar.lz nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar.xz nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.tar.zst nvim-treesitter-df06bfead256c5f15ee5972e1013702229fb82ec.zip | |
Add tree-sitter-pioasm with highlights and injections (#1759)
* add tree-sitter-pioasm with highlights and injections
* [docgen] Update README.md
skip-checks: true
* remove ada injection from pioasm
* address review
* remove unnecessary python predicate
Co-authored-by: Github Actions <actions@github>
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 9 | ||||
| -rw-r--r-- | queries/pioasm/highlights.scm | 30 | ||||
| -rw-r--r-- | queries/pioasm/injections.scm | 10 |
4 files changed, 50 insertions, 0 deletions
@@ -191,6 +191,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu) - [x] [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) (maintained by @undu) - [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka) +- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228) - [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta) - [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester) - [x] [Tree-sitter query language](https://github.com/nvim-treesitter/tree-sitter-query) (maintained by @steelsojka) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index dc993265e..7b9d28b1f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -693,6 +693,15 @@ list.json5 = { maintainers = { "@Joakker" }, } +list.pioasm = { + install_info = { + url = "https://github.com/leo60228/tree-sitter-pioasm", + branch = "main", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@leo60228" }, +} + local M = { list = list, } diff --git a/queries/pioasm/highlights.scm b/queries/pioasm/highlights.scm new file mode 100644 index 000000000..c455103f9 --- /dev/null +++ b/queries/pioasm/highlights.scm @@ -0,0 +1,30 @@ +[ (line_comment) (block_comment) ] @comment + +(label_decl) @label + +(string) @string + +(instruction + opcode: _ @keyword) + +[ "pins" "x" "y" "null" "isr" "osr" "status" "pc" "exec" ] @variable.builtin + +(out_target "pindirs" @variable.builtin) +(directive "pindirs" @keyword) + +(condition [ "--" "!=" ] @operator) +(expression [ "+" "-" "*" "/" "|" "&" "^" "::" ] @operator) +(not) @operator + +[ "optional" "opt" "side" "sideset" "side_set" "pin" "gpio" "osre" ] @keyword +[ "block" "noblock" "iffull" "ifempty" "rel" ] @keyword +(irq_modifiers) @keyword + +(integer) @number + +(directive (identifier) @variable) +(directive (symbol_def (identifier) @variable)) +(value (identifier) @variable) + +(directive + directive: _ @keyword) diff --git a/queries/pioasm/injections.scm b/queries/pioasm/injections.scm new file mode 100644 index 000000000..a8a0cf49e --- /dev/null +++ b/queries/pioasm/injections.scm @@ -0,0 +1,10 @@ + [ (line_comment) (block_comment) ] @comment + +((code_block + (code_block_language) @_language + (code_block_body) @c) + (#eq? @_language "c-sdk")) + +(code_block + (code_block_language) @language + (code_block_body) @content) |
