diff options
Diffstat (limited to 'runtime/queries/dtd')
| -rw-r--r-- | runtime/queries/dtd/folds.scm | 4 | ||||
| -rw-r--r-- | runtime/queries/dtd/highlights.scm | 148 | ||||
| -rw-r--r-- | runtime/queries/dtd/injections.scm | 2 | ||||
| -rw-r--r-- | runtime/queries/dtd/locals.scm | 11 |
4 files changed, 165 insertions, 0 deletions
diff --git a/runtime/queries/dtd/folds.scm b/runtime/queries/dtd/folds.scm new file mode 100644 index 000000000..b1bce4ffb --- /dev/null +++ b/runtime/queries/dtd/folds.scm @@ -0,0 +1,4 @@ +[ + (conditionalSect) + (Comment) +] @fold diff --git a/runtime/queries/dtd/highlights.scm b/runtime/queries/dtd/highlights.scm new file mode 100644 index 000000000..9afd6e38b --- /dev/null +++ b/runtime/queries/dtd/highlights.scm @@ -0,0 +1,148 @@ +; Text declaration +(TextDecl + "xml" @keyword.directive) + +(TextDecl + [ + "version" + "encoding" + ] @tag.attribute) + +(TextDecl + (EncName) @string.special) + +(TextDecl + (VersionNum) @number) + +; Processing instructions +(PI) @keyword.directive + +; Element declaration +(elementdecl + "ELEMENT" @keyword.directive.define + (Name) @tag) + +(contentspec + (_ + (Name) @tag.attribute)) + +"#PCDATA" @type.builtin + +[ + "EMPTY" + "ANY" +] @keyword.modifier + +[ + "*" + "?" + "+" +] @character.special + +; Entity declaration +(GEDecl + "ENTITY" @keyword.directive.define + (Name) @constant) + +(GEDecl + (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +; Parsed entity declaration +(PEDecl + "ENTITY" @keyword.directive.define + "%" @operator + (Name) @function.macro) + +(PEDecl + (EntityValue) @string) + +; Notation declaration +(NotationDecl + "NOTATION" @keyword.directive + (Name) @label) + +; Attlist declaration +(AttlistDecl + "ATTLIST" @keyword.directive.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) @string.special.url) + +; Delimiters & punctuation +[ + "<?" + "?>" + "<!" + ">" + "<![" + "]]>" +] @tag.delimiter + +[ + "(" + ")" + "[" +] @punctuation.bracket + +[ + "\"" + "'" +] @punctuation.delimiter + +[ + "," + "|" + "=" +] @operator + +; Misc +[ + "INCLUDE" + "IGNORE" +] @keyword.import + +(Comment) @comment @spell diff --git a/runtime/queries/dtd/injections.scm b/runtime/queries/dtd/injections.scm new file mode 100644 index 000000000..57fae5832 --- /dev/null +++ b/runtime/queries/dtd/injections.scm @@ -0,0 +1,2 @@ +((Comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/dtd/locals.scm b/runtime/queries/dtd/locals.scm new file mode 100644 index 000000000..88246c04a --- /dev/null +++ b/runtime/queries/dtd/locals.scm @@ -0,0 +1,11 @@ +(elementdecl + (Name) @local.definition.type) + +(elementdecl + (contentspec + (children + (Name) @local.reference))) + +(AttlistDecl + . + (Name) @local.reference) |
