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>
This commit is contained in:
leo60228
2021-08-29 13:10:15 -04:00
committed by GitHub
parent a90e5f4c5f
commit 93f415029d
4 changed files with 50 additions and 0 deletions

View File

@@ -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)

View File

@@ -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,
}

View File

@@ -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)

View File

@@ -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)