feat: add Doxygen

This commit is contained in:
Amaan Qureshi 2023-08-25 05:02:58 -04:00
parent 4d41d9bfb0
commit a4f4fcdd3e
11 changed files with 74 additions and 3 deletions

View file

@ -209,6 +209,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [diff](https://github.com/the-mikedavis/tree-sitter-diff) (maintained by @gbprod)
- [x] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek)
- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun)
- [x] [doxygen](https://github.com/amaanq/tree-sitter-doxygen) (maintained by @amaanq)
- [x] [dtd](https://github.com/ObserverOfTime/tree-sitter-xml) (maintained by @ObserverOfTime)
- [x] [ebnf](https://github.com/RubixDev/ebnf) (experimental, maintained by @RubixDev)
- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay)

View file

@ -107,6 +107,9 @@
"dot": {
"revision": "9ab85550c896d8b294d9b9ca1e30698736f08cea"
},
"doxygen": {
"revision": "19284113dbd42263c13b39d81b2a3b2492022c9b"
},
"dtd": {
"revision": "9deacbfb79cb3527a0396255beb17e1bba3f2052"
},

View file

@ -376,6 +376,14 @@ list.dot = {
maintainers = { "@rydesun" },
}
list.doxygen = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-doxygen",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@amaanq" },
}
list.dtd = {
install_info = {
url = "https://github.com/ObserverOfTime/tree-sitter-xml",

View file

@ -5,9 +5,13 @@
(#set! injection.language "comment"))
((comment) @injection.content
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
(#set! injection.language "re2c"))
((comment) @injection.content
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
(#set! injection.language "doxygen"))
; TODO: add when asm is added
; (gnu_asm_expression assembly_code: (string_literal) @injection.content
; (#set! injection.language "asm"))

View file

@ -4,6 +4,10 @@
((comment) @injection.content
(#set! injection.language "comment"))
((comment) @injection.content
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
(#set! injection.language "doxygen"))
(raw_string_literal
delimiter: (raw_string_delimiter) @injection.language
(raw_string_content) @injection.content)

View file

@ -0,0 +1,38 @@
((tag_name) @keyword
(#set! "priority" 105))
(identifier) @variable
((tag
(tag_name) @_param
(identifier) @parameter)
(#any-of? @_param "@param" "\\param"))
(function (identifier) @function)
(function_link) @function
(emphasis) @text.emphasis
"\\a" @tag
[
"in"
"out"
"inout"
] @storageclass
"~" @operator
[
"<a"
">"
"</a>"
] @tag
[
","
"::"
] @punctuation.delimiter
[ "(" ")" "[" "]" ] @punctuation.bracket

View file

@ -0,0 +1 @@
(document) @indent.auto

View file

@ -0,0 +1,8 @@
((type) @injection.content
(#set! injection.parent))
((function_link) @injection.content
(#set! injection.parent))
((link) @injection.content
(#set! injection.language "html"))

View file

@ -20,5 +20,5 @@
(#set! injection.language "regex")))
((comment) @injection.content
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
(#set! injection.language "re2c"))

View file

@ -3,3 +3,7 @@
(line_comment)
] @injection.content
(#set! injection.language "comment"))
((block_comment) @injection.content
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
(#set! injection.language "doxygen"))

View file

@ -39,5 +39,5 @@
(#set! injection.language "regex"))
((block_comment) @injection.content
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
(#set! injection.language "re2c"))