Skip to content

Commit 68f11f9

Browse files
authored
language support for strictdoc (#14314)
1 parent af74a61 commit 68f11f9

File tree

5 files changed

+392
-0
lines changed

5 files changed

+392
-0
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
| sshclientconfig || | | | | |
243243
| starlark |||| || `starpls` |
244244
| strace || | | | | |
245+
| strictdoc || | || | |
245246
| supercollider || | | | | |
246247
| svelte || || | | `svelteserver` |
247248
| sway |||| | | `forc` |

languages.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,3 +4735,14 @@ comment-token = "#"
47354735
[[grammar]]
47364736
name = "shellcheckrc"
47374737
source = {git = "https://codeberg.org/kpbaks/tree-sitter-shellcheckrc", rev = "ad3da4e8f7fd72dcc5e93a6b89822c59a7cd10ff"}
4738+
4739+
[[grammar]]
4740+
name = "strictdoc"
4741+
source = { git = "https://github.com/manueldiagostino/tree-sitter-strictdoc", rev = "070edcf23f7c85af355437706048f73833e0ea10" }
4742+
4743+
[[language]]
4744+
name = "strictdoc"
4745+
scope = "source.strictdoc"
4746+
injection-regex = "strictdoc"
4747+
file-types = ["sdoc", "sgra"]
4748+
comment-token = ".."
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
;; Tree-sitter highlight queries for strictdoc
2+
3+
;; —————————————————————————————————————————
4+
;; Keywords “blok” del documento
5+
;; —————————————————————————————————————————
6+
[
7+
"[DOCUMENT]"
8+
"[DOCUMENT_FROM_FILE]"
9+
"[GRAMMAR]"
10+
"[/SECTION]"
11+
"[SECTION]"
12+
(sdoc_node_opening)
13+
(sdoc_composite_node_opening)
14+
(sdoc_composite_node_closing)
15+
(sdoc_composite_node_type_name)
16+
] @keyword
17+
18+
[
19+
"AUTO_LEVELS"
20+
"CLASSIFICATION"
21+
"DATE"
22+
"DEFAULT_VIEW"
23+
"ELEMENTS"
24+
"ENABLE_MID"
25+
"FIELDS"
26+
"FILE"
27+
"FORMAT"
28+
"IMPORT_FROM_FILE"
29+
"IS_COMPOSITE"
30+
"LAYOUT"
31+
"LEVEL"
32+
"MARKUP"
33+
"METADATA"
34+
"MID"
35+
"NAME"
36+
"NODE_IN_TOC"
37+
"OBJECT_TYPE"
38+
"OPTIONS"
39+
"PLACEMENT"
40+
"PREFIX"
41+
"PROPERTIES"
42+
"REQ_PREFIX"
43+
"REQUIRED"
44+
"REQUIREMENT_IN_TOC"
45+
"REQUIREMENT_STYLE"
46+
"ROLE"
47+
"ROOT"
48+
"TAG"
49+
"TITLE"
50+
"TYPE"
51+
"UID"
52+
"VALUE"
53+
"VERSION"
54+
"VIEW_STYLE"
55+
"VISIBLE_FIELDS"
56+
] @type.builtin
57+
58+
;; Operators
59+
[
60+
(multiline_opening_token)
61+
(multiline_closing_token)
62+
] @operator
63+
64+
;; Punctuation
65+
[
66+
":" @punctuation.delimiter
67+
"," @punctuation.delimiter
68+
"-" @punctuation.delimiter
69+
]
70+
71+
;; Boolean literals
72+
(boolean_choice) @constant.builtin.boolean
73+
74+
;; Requirement types and file formats
75+
76+
;; Config option values
77+
[
78+
"Child"
79+
"Default"
80+
"File"
81+
"HTML"
82+
"Inline"
83+
"Narrative"
84+
"Off"
85+
"On"
86+
"Parent"
87+
"Plain"
88+
"RST"
89+
"Simple"
90+
"Table"
91+
"Text"
92+
"Website"
93+
"Zebra"
94+
] @constant.builtin
95+
96+
97+
;; Strings
98+
(single_line_string) @string
99+
[ (uid_string) (req_reference_value_id) ] @string.special.symbol
100+
(date) @string.special
101+
102+
;; Fields
103+
(document_custom_metadata_key) @type.parameter
104+
[ "RELATIONS" (field_name) ] @variable.other.member
105+
(choice_option) @variable.parameter
106+
107+
;; Anchors and links
108+
(anchor) @label
109+
(inline_link) @string.special.url
110+
111+
[
112+
(role_id)
113+
] @variable
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
((text_part) @injection.content
3+
(#set! injection.language "rst")
4+
(#set! injection.include-children))
5+
6+
((single_line_text_part) @injection.content
7+
(#set! injection.language "rst")
8+
(#set! injection.include-children))
9+

0 commit comments

Comments
 (0)