3 # Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com>
5 # This is a Sublime Text 3 syntax definition for the specific subset of
6 # AsciiDoc markup used for EfficiOS projects, namely:
8 # * The LTTng Documentation
9 # * The LTTng man pages
10 # * The Babeltrace man pages
12 # Permission is hereby granted, free of charge, to any person obtaining a copy
13 # of this software and associated documentation files (the "Software"), to deal
14 # in the Software without restriction, including without limitation the rights
15 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 # copies of the Software, and to permit persons to whom the Software is
17 # furnished to do so, subject to the following conditions:
19 # The above copyright notice and this permission notice shall be included in
20 # all copies or substantial portions of the Software.
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 name: EfficiOS AsciiDoc
34 scope: source.eos-adoc
37 - include: comment-start
40 - include: set-adoc-attr
41 - include: man-heading
47 - include: gen-pre-sig
48 - include: admonition-sig
49 - include: internal-link-start
50 - include: external-link-start
51 - include: list-bullets
59 - meta_scope: comment.block.eos-adoc
63 - match: '^include::.*$'
64 scope: constant.numeric.include.eos-adoc
66 - match: '^image::.*$'
67 scope: constant.numeric.image.eos-adoc
69 - match: '^[A-Z][A-Z -]*$'
70 scope: keyword.control.conditional.heading.eos-adoc
71 push: man-heading-underline
72 man-heading-underline:
74 scope: keyword.control.conditional.heading.eos-adoc
77 scope: keyword.control.conditional.heading.eos-adoc
82 - match: '^\[\[[a-zA-Z0-9_-]+]]$'
83 scope: string.quoted.double.anchor.eos-adoc
89 scope: keyword.control.conditional.heading.eos-adoc
90 set: man-heading-underline
92 - meta_scope: keyword.control.conditional.heading.eos-adoc
96 - match: '^\[role="term"]$'
97 scope: constant.character.eos-adoc
103 - meta_scope: comment.block.term.eos-adoc
107 - match: '^\[source,\s*\w+]$'
108 scope: constant.character.source.eos-adoc
113 - include: source-start
118 - meta_scope: comment.block.eos-adoc
122 - match: '^(\*|\.)+ '
123 scope: constant.character.escape.list-bullet.eos-adoc
126 scope: constant.character.escape.dl.eos-adoc
128 - match: '^\[verse]$'
129 scope: constant.character.verse.eos-adoc
131 - match: '^\[role="[^"]+"]$'
132 scope: constant.character.gen-role.eos-adoc
137 - meta_scope: comment.block.gen-pre.eos-adoc
141 - match: '^\[(WARNING|IMPORTANT|NOTE)]$'
142 scope: constant.character.admonition.eos-adoc
145 scope: constant.character.escape.block-sep.eos-adoc
147 - include: external-link-start
148 - include: external-link-expl-start
149 - include: internal-link-start
152 - include: word-macro
153 - include: lttng-docs-opt
154 - include: lttng-docs-path
155 - include: lttng-docs-dir
156 - include: lttng-docs-env
157 - include: lttng-docs-cmd
161 - include: man-genopt
162 - include: man-bt-compcls
163 - include: man-bt-manparam
164 - include: man-bt-manopt
166 - include: code-backtick-start
167 - include: code-plus-start
168 - include: double-emphasis-start
169 - include: emphasis-start
170 - include: emphasis-quote
171 - include: strong-start
172 - include: escape-adoc-start
176 scope: comment.block.nbsp.eos-adoc
178 - match: '(?<!^)--(?!$)'
179 scope: comment.block.em-dash.eos-adoc
181 - match: ':(not|escwc|esccomma|escstar|escdot|bs):'
182 scope: entity.name.tag.not.eos-adoc
184 - match: '(<<)([a-zA-Z0-9_-]+),'
186 1: entity.name.function.link.eos-adoc
187 2: storage.modifier.c
190 - meta_scope: int-link.eos-adoc
192 set: internal-link-text
194 scope: entity.name.function.link.eos-adoc
198 - meta_scope: string.quoted.double.int-link-text.eos-adoc
202 - match: '(https?://.*?)\['
204 1: storage.modifier.c
207 - meta_scope: ext-link.eos-adoc
211 external-link-expl-start:
212 - match: 'link:([^]]+)\['
214 1: storage.modifier.c
215 push: external-link-expl
217 - meta_scope: ext-link.eos-adoc
222 - match: 'opt:(lttng[a-zA-Z-]*\([a-zA-Z0-9]+\)):(--?[a-zA-Z0-9_-]+)'
223 scope: entity.name.function.opt.eos-adoc
225 1: storage.modifier.c
226 2: storage.modifier.c
228 - match: 'path:\{(.+)}'
229 scope: entity.name.function.path.eos-adoc
231 1: storage.modifier.c
233 - match: 'dir:\{(.+)}'
234 scope: entity.name.function.dir.eos-adoc
236 1: storage.modifier.c
238 - match: 'env:([a-zA-Z0-9_]+)'
239 scope: entity.name.function.env.eos-adoc
241 1: storage.modifier.c
243 - match: 'cmd:([a-zA-Z0-9_-]+)'
244 scope: entity.name.function.cmd.eos-adoc
246 1: storage.modifier.c
248 - match: 'man:([a-zA-Z0-9_.-]+\([a-zA-Z0-9]+\))'
249 scope: entity.name.function.man.eos-adoc
251 1: storage.modifier.c
253 - match: 'opt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
254 scope: entity.name.function.opt.eos-adoc
256 1: storage.modifier.c
258 - match: 'nlopt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
259 scope: entity.name.function.nlopt.eos-adoc
261 1: storage.modifier.c
263 - match: 'genopt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
264 scope: entity.name.function.genopt.eos-adoc
266 1: storage.modifier.c
268 - match: 'compcls:(src|source|flt|filter|sink)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)'
269 scope: entity.name.function.opt.eos-adoc
271 1: storage.modifier.c
272 2: storage.modifier.c
273 3: storage.modifier.c
275 - match: 'manparam:(src|source|flt|filter|sink)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)'
276 scope: entity.name.function.opt.eos-adoc
278 1: storage.modifier.c
279 2: storage.modifier.c
280 3: storage.modifier.c
281 4: storage.modifier.c
283 - match: 'manopt:([a-zA-Z0-9_.-]+\([a-zA-Z0-9]+\)):(--?[a-zA-Z0-9_-]+)'
284 scope: entity.name.function.opt.eos-adoc
286 1: storage.modifier.c
287 2: storage.modifier.c
292 - meta_scope: entity.name.function.code.eos-adoc
299 - meta_scope: entity.name.function.code.eos-adoc
305 scope: storage.modifier.c
306 double-emphasis-start:
308 push: double-emphasis
310 - meta_scope: entity.name.function.double-em.eos-adoc
315 - match: '(?<![A-Za-z0-9_])_(?!\s)'
318 - meta_scope: entity.name.function.em.eos-adoc
324 scope: entity.name.function.em-quote.eos-adoc
326 - match: '\*\*(?!\s)'
329 - meta_scope: entity.name.function.strong.eos-adoc
330 - match: '(?<!\s)\*\*'
334 - match: '\$\$(?!\s)'
337 - meta_scope: entity.name.function.escape-adoc.eos-adoc
338 - match: '(?<!\s)\$\$'
341 - match: \[\[[a-zA-Z0-9_-]+]]
342 scope: string.quoted.double.anchor.eos-adoc
344 - match: '\{[a-zA-Z0-9_-]+\}'
345 scope: entity.name.tag.eos-adoc
347 - match: '^:([a-zA-Z0-9_-]+):\s+'
349 1: constant.numeric.set-adoc-attr.eos-adoc