mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
As discussed in PR#5421, capturing `@error` is inconsistent, requiring deep nesting (or priority) in order to correctly have red backgrounds to it. Some queries has this capture, some don't. For consistency purposes, removing all of them is more preferable. For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)` to your custom queries.
119 lines
1.7 KiB
Scheme
119 lines
1.7 KiB
Scheme
;; XML declaration
|
|
|
|
(XMLDecl "xml" @preproc)
|
|
|
|
(XMLDecl [ "version" "encoding" ] @tag.attribute)
|
|
|
|
(XMLDecl (EncName) @string.special)
|
|
|
|
(XMLDecl (VersionNum) @number)
|
|
|
|
;; Processing instructions
|
|
|
|
(PI) @preproc
|
|
|
|
;; Element declaration
|
|
|
|
(elementdecl
|
|
"ELEMENT" @define
|
|
(Name) @tag)
|
|
|
|
(contentspec
|
|
(_ (Name) @tag.attribute))
|
|
|
|
"#PCDATA" @type.builtin
|
|
|
|
[ "EMPTY" "ANY" ] @type.qualifier
|
|
|
|
[ "*" "?" "+" ] @character.special
|
|
|
|
;; Entity declaration
|
|
|
|
(GEDecl
|
|
"ENTITY" @define
|
|
(Name) @constant)
|
|
|
|
(GEDecl (EntityValue) @string)
|
|
|
|
(NDataDecl
|
|
"NDATA" @keyword
|
|
(Name) @label)
|
|
|
|
;; Parsed entity declaration
|
|
|
|
(PEDecl
|
|
"ENTITY" @define
|
|
"%" @operator
|
|
(Name) @function.macro)
|
|
|
|
(PEDecl (EntityValue) @string)
|
|
|
|
;; Notation declaration
|
|
|
|
(NotationDecl
|
|
"NOTATION" @preproc
|
|
(Name) @label)
|
|
|
|
((NotationDecl
|
|
(ExternalID
|
|
(SystemLiteral (URI) @string.special))
|
|
(#set! "priority" 105)))
|
|
|
|
;; Attlist declaration
|
|
|
|
(AttlistDecl
|
|
"ATTLIST" @define
|
|
(Name) @tag)
|
|
|
|
(AttDef (Name) @tag.attribute)
|
|
|
|
(AttDef (Enumeration (Nmtoken) @string))
|
|
|
|
[
|
|
(StringType)
|
|
(TokenizedType)
|
|
] @type.builtin
|
|
|
|
(NotationType "NOTATION" @type.builtin)
|
|
|
|
[
|
|
"#REQUIRED"
|
|
"#IMPLIED"
|
|
"#FIXED"
|
|
] @attribute
|
|
|
|
;; Entities
|
|
|
|
(EntityRef) @constant
|
|
|
|
((EntityRef) @constant.builtin
|
|
(#any-of? @constant.builtin
|
|
"&" "<" ">" """ "'"))
|
|
|
|
(CharRef) @character
|
|
|
|
(PEReference) @function.macro
|
|
|
|
;; External references
|
|
|
|
[ "PUBLIC" "SYSTEM" ] @keyword
|
|
|
|
(PubidLiteral) @string.special
|
|
|
|
(SystemLiteral (URI) @text.uri)
|
|
|
|
;; Delimiters & punctuation
|
|
|
|
[ "<?" "?>" "<!" ">" "]]>" ] @tag.delimiter
|
|
|
|
[ "(" ")" "[" ] @punctuation.bracket
|
|
|
|
[ "\"" "'" ] @punctuation.delimiter
|
|
|
|
[ "," "|" "=" ] @operator
|
|
|
|
;; Misc
|
|
|
|
[ "INCLUDE" "IGNORE" ] @include
|
|
|
|
(Comment) @comment @spell
|