summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMatthew Toohey2022-10-29 20:41:28 +0000
committerGitHub2022-10-29 20:41:28 +0000
commitf054a3f3ed445cdfa8c0dc63698659ef30af57b7 (patch)
treed4dd25e8d60a6c3b870f72b4b7b271dd4844adca /runtime
parent2935e9da197442620578e07d87cd0607ae4145f1 (diff)
feat(lang): add xml (#4518)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/xml/highlights.scm42
-rw-r--r--runtime/queries/xml/indents.scm1
-rw-r--r--runtime/queries/xml/injections.scm2
3 files changed, 45 insertions, 0 deletions
diff --git a/runtime/queries/xml/highlights.scm b/runtime/queries/xml/highlights.scm
new file mode 100644
index 00000000..d5940c8a
--- /dev/null
+++ b/runtime/queries/xml/highlights.scm
@@ -0,0 +1,42 @@
+(comment) @comment
+
+[
+ "DOCTYPE"
+ "ELEMENT"
+ "ATTLIST"
+] @keyword
+
+[
+ "#REQUIRED"
+ "#IMPLIED"
+ "#FIXED"
+ "#PCDATA"
+] @keyword.directive
+
+[
+ "EMPTY"
+ "ANY"
+ "SYSTEM"
+ "PUBLIC"
+] @constant
+
+(doctype) @variable
+(element_name) @variable
+
+"xml" @tag
+(tag_name) @tag
+
+[
+ "encoding"
+ "version"
+ "standalone"
+] @attribute
+(attribute_name) @attribute
+
+(system_literal) @string
+(pubid_literal) @string
+(attribute_value) @string
+
+[
+ "<" ">" "</" "/>" "<?" "?>" "<!"
+] @punctuation.bracket
diff --git a/runtime/queries/xml/indents.scm b/runtime/queries/xml/indents.scm
new file mode 100644
index 00000000..d756debb
--- /dev/null
+++ b/runtime/queries/xml/indents.scm
@@ -0,0 +1 @@
+(element) @indent
diff --git a/runtime/queries/xml/injections.scm b/runtime/queries/xml/injections.scm
new file mode 100644
index 00000000..321c90ad
--- /dev/null
+++ b/runtime/queries/xml/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))