aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/generated/lang-support.md1
-rw-r--r--languages.toml11
-rw-r--r--runtime/queries/perl/highlights.scm2
-rw-r--r--runtime/queries/perl/injections.scm2
-rw-r--r--runtime/queries/pod/highlights.scm61
5 files changed, 75 insertions, 2 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 297f67af..10989a23 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -114,6 +114,7 @@
| perl | ✓ | | | `perlnavigator` |
| php | ✓ | ✓ | ✓ | `intelephense` |
| po | ✓ | ✓ | | |
+| pod | ✓ | | | |
| ponylang | ✓ | ✓ | ✓ | |
| prisma | ✓ | | | `prisma-language-server` |
| prolog | | | | `swipl` |
diff --git a/languages.toml b/languages.toml
index 0e217842..defffa03 100644
--- a/languages.toml
+++ b/languages.toml
@@ -1118,6 +1118,17 @@ name = "perl"
source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "ed21ecbcc128a6688770ebafd3ef68a1c9bc1ea9" }
[[language]]
+name = "pod"
+scope = "source.pod"
+injection-regex = "pod"
+roots = []
+file-types = ["pod"]
+
+[[grammar]]
+name = "pod"
+source = { git = "https://github.com/tree-sitter-perl/tree-sitter-pod", rev = "d466b84009a63986834498073ec05d58d727d55f" }
+
+[[language]]
name = "racket"
scope = "source.racket"
roots = []
diff --git a/runtime/queries/perl/highlights.scm b/runtime/queries/perl/highlights.scm
index 961ff5ea..c2496f9f 100644
--- a/runtime/queries/perl/highlights.scm
+++ b/runtime/queries/perl/highlights.scm
@@ -41,8 +41,6 @@
(eof_marker) @keyword.directive
(data_section) @comment
-(pod) @comment.block.documentation
-
(number) @constant.numeric
(version) @constant
diff --git a/runtime/queries/perl/injections.scm b/runtime/queries/perl/injections.scm
index 321c90ad..2b182a6e 100644
--- a/runtime/queries/perl/injections.scm
+++ b/runtime/queries/perl/injections.scm
@@ -1,2 +1,4 @@
((comment) @injection.content
(#set! injection.language "comment"))
+((pod) @injection.content
+ (#set! injection.language "pod"))
diff --git a/runtime/queries/pod/highlights.scm b/runtime/queries/pod/highlights.scm
new file mode 100644
index 00000000..e8bd4b54
--- /dev/null
+++ b/runtime/queries/pod/highlights.scm
@@ -0,0 +1,61 @@
+[(pod_directive)
+ (head_directive)
+ (over_directive)
+ (item_directive)
+ (back_directive)
+ (encoding_directive)
+ (cut_directive)] @tag
+
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head1")
+ (content) @markup.heading.1)
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head2")
+ (content) @markup.heading.2)
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head3")
+ (content) @markup.heading.3)
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head4")
+ (content) @markup.heading.4)
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head5")
+ (content) @markup.heading.5)
+(head_paragraph
+ (head_directive) @directive
+ (#eq? @directive "=head6")
+ (content) @markup.heading.6)
+
+(over_paragraph (content) @constant.numeric.integer)
+(item_paragraph (content) @markup.list)
+(encoding_paragraph (content) @string)
+
+(verbatim_paragraph (content) @markup.raw)
+
+(interior_sequence) @tag
+
+(interior_sequence
+ (sequence_letter) @letter
+ (#eq? @letter "B")
+ (content) @markup.bold)
+(interior_sequence
+ (sequence_letter) @letter
+ (#eq? @letter "C")
+ (content) @markup.raw)
+(interior_sequence
+ (sequence_letter) @letter
+ (#eq? @letter "F")
+ (content) @markup.italic)
+(interior_sequence
+ (sequence_letter) @letter
+ (#eq? @letter "I")
+ (content) @markup.italic)
+(interior_sequence
+ (sequence_letter) @letter
+ (#eq? @letter "L")
+ (content) @markup.link.url)