mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
RST: use any-of? instead of match? (#1678)
This commit is contained in:
parent
576f14d2ee
commit
4c40a46a6d
2 changed files with 42 additions and 10 deletions
|
|
@ -4,25 +4,33 @@
|
|||
((directive
|
||||
name: (type) @_type
|
||||
body: (body) @rst)
|
||||
(#match?
|
||||
(#any-of?
|
||||
@_type
|
||||
"^(attention|caution|danger|error|hint|important|note|tip|warning|admonition)|(line-block|parsed-literal|epigraph|highlights|pull-quote|compound)|(header|footer)|(meta)|(replace)$"))
|
||||
"attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition"
|
||||
"line-block" "parsed-literal" "epigraph" "highlights" "pull-quote" "compound"
|
||||
"header" "footer"
|
||||
"meta"
|
||||
"replace"))
|
||||
|
||||
;; Directives with nested content without arguments, but with options
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (options) (content) @rst))
|
||||
(#match?
|
||||
(#any-of?
|
||||
@_type
|
||||
"^(attention|caution|danger|error|hint|important|note|tip|warning|admonition)|(line-block|parsed-literal|compound)$"))
|
||||
"attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition"
|
||||
"line-block" "parsed-literal" "compound"))
|
||||
|
||||
;; Directives with nested content with arguments and options
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (content) @rst))
|
||||
(#match?
|
||||
(#any-of?
|
||||
@_type
|
||||
"^(figure)|(topic|sidebar|container)|(table|list-table)|(class|role|restructuredtext-test-directive)$"))
|
||||
"figure"
|
||||
"topic" "sidebar" "container"
|
||||
"table" "list-table"
|
||||
"class" "role" "restructuredtext-test-directive"))
|
||||
|
||||
;; Special directives
|
||||
((directive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue