on master help sign in
Add pod highlighting (#7907)
commit2caca1c4e92d46a9b021deed5d50025a5f229325 authorJesse Luehrs <doy@tozt.net> dateSat 12 Aug 2023, 21:14 (3 years ago) parent01776e6
5 files changed+75−2
book/src/generated/lang-support.md+1 languages.toml+11 runtime/queries/perl/highlights.scm−2 runtime/queries/perl/injections.scm+2 runtime/queries/pod/highlights.scm+61
book/src/generated/lang-support.md+1
@@ -114,6 +114,7 @@
114114| perl | ✓ | | | `perlnavigator` |
115115| php | ✓ | ✓ | ✓ | `intelephense` |
116116| po | ✓ | ✓ | | |
117+| pod | ✓ | | | |
117118| ponylang | ✓ | ✓ | ✓ | |
118119| prisma | ✓ | | | `prisma-language-server` |
119120| prolog | | | | `swipl` |
languages.toml+11
@@ -1117,6 +1117,17 @@ indent = { tab-width = 2, unit = " " }
11171117name = "perl"
11181118source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "ed21ecbcc128a6688770ebafd3ef68a1c9bc1ea9" }
11191119
1120+[[language]]
1121+name = "pod"
1122+scope = "source.pod"
1123+injection-regex = "pod"
1124+roots = []
1125+file-types = ["pod"]
1126+
1127+[[grammar]]
1128+name = "pod"
1129+source = { git = "https://github.com/tree-sitter-perl/tree-sitter-pod", rev = "d466b84009a63986834498073ec05d58d727d55f" }
1130+
11201131[[language]]
11211132name = "racket"
11221133scope = "source.racket"
runtime/queries/perl/highlights.scm−2
@@ -41,8 +41,6 @@
4141(eof_marker) @keyword.directive
4242(data_section) @comment
4343
44−(pod) @comment.block.documentation
45−
4644(number) @constant.numeric
4745(version) @constant
4846
runtime/queries/perl/injections.scm+2
@@ -1,2 +1,4 @@
11((comment) @injection.content
22 (#set! injection.language "comment"))
3+((pod) @injection.content
4+ (#set! injection.language "pod"))
runtime/queries/pod/highlights.scmnew file+61
@@ -0,0 +1,61 @@
1+[(pod_directive)
2+ (head_directive)
3+ (over_directive)
4+ (item_directive)
5+ (back_directive)
6+ (encoding_directive)
7+ (cut_directive)] @tag
8+
9+(head_paragraph
10+ (head_directive) @directive
11+ (#eq? @directive "=head1")
12+ (content) @markup.heading.1)
13+(head_paragraph
14+ (head_directive) @directive
15+ (#eq? @directive "=head2")
16+ (content) @markup.heading.2)
17+(head_paragraph
18+ (head_directive) @directive
19+ (#eq? @directive "=head3")
20+ (content) @markup.heading.3)
21+(head_paragraph
22+ (head_directive) @directive
23+ (#eq? @directive "=head4")
24+ (content) @markup.heading.4)
25+(head_paragraph
26+ (head_directive) @directive
27+ (#eq? @directive "=head5")
28+ (content) @markup.heading.5)
29+(head_paragraph
30+ (head_directive) @directive
31+ (#eq? @directive "=head6")
32+ (content) @markup.heading.6)
33+
34+(over_paragraph (content) @constant.numeric.integer)
35+(item_paragraph (content) @markup.list)
36+(encoding_paragraph (content) @string)
37+
38+(verbatim_paragraph (content) @markup.raw)
39+
40+(interior_sequence) @tag
41+
42+(interior_sequence
43+ (sequence_letter) @letter
44+ (#eq? @letter "B")
45+ (content) @markup.bold)
46+(interior_sequence
47+ (sequence_letter) @letter
48+ (#eq? @letter "C")
49+ (content) @markup.raw)
50+(interior_sequence
51+ (sequence_letter) @letter
52+ (#eq? @letter "F")
53+ (content) @markup.italic)
54+(interior_sequence
55+ (sequence_letter) @letter
56+ (#eq? @letter "I")
57+ (content) @markup.italic)
58+(interior_sequence
59+ (sequence_letter) @letter
60+ (#eq? @letter "L")
61+ (content) @markup.link.url)