aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael2023-04-12 20:28:51 +0000
committerGitHub2023-04-12 20:28:51 +0000
commit161fef2166e851071176e2fdaa9455efb5af0a6d (patch)
tree392a1241085ff5402bdb321bfbdbffc592b3c0d3 /runtime
parentfff8543b5809766608be14ee1a45f8b86f5a3de2 (diff)
Add DTD language support (#6644)
- Added syntax highlighting for the DTD subset of the XML spec. - Included .dtd and .ent as common file extensions
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/dtd/highlights.scm39
-rw-r--r--runtime/queries/dtd/injections.scm2
2 files changed, 41 insertions, 0 deletions
diff --git a/runtime/queries/dtd/highlights.scm b/runtime/queries/dtd/highlights.scm
new file mode 100644
index 00000000..cb3d482b
--- /dev/null
+++ b/runtime/queries/dtd/highlights.scm
@@ -0,0 +1,39 @@
+; highlights.scm
+
+(comment) @comment
+
+[
+ "ELEMENT"
+ "ATTLIST"
+] @keyword
+
+[
+ "#REQUIRED"
+ "#IMPLIED"
+ "#FIXED"
+ "#PCDATA"
+] @keyword.directive
+
+[
+ "EMPTY"
+ "ANY"
+ "SYSTEM"
+ "PUBLIC"
+] @constant
+
+(element_name) @module
+
+
+(attribute_name) @attribute
+
+(system_literal) @string
+(pubid_literal) @string
+(attribute_value) @string
+
+[
+ ">"
+ "</"
+ "<?"
+ "?>"
+ "<!"
+] @punctuation.bracket
diff --git a/runtime/queries/dtd/injections.scm b/runtime/queries/dtd/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/dtd/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))