aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/syntax/files/firejail-profile.lang.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syntax/files/firejail-profile.lang.in')
-rw-r--r--contrib/syntax/files/firejail-profile.lang.in70
1 files changed, 70 insertions, 0 deletions
diff --git a/contrib/syntax/files/firejail-profile.lang.in b/contrib/syntax/files/firejail-profile.lang.in
new file mode 100644
index 000000000..acd5c86ce
--- /dev/null
+++ b/contrib/syntax/files/firejail-profile.lang.in
@@ -0,0 +1,70 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- @make_input@ -->
3<!-- vim: set ts=2 sts=2 sw=2 et: -->
4<!--
5 https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-tutorial.md
6 https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-reference.md
7-->
8<language id="firejail-profile" name="Firejail Profile" version="2.0" _section="Other">
9 <metadata>
10 <property name="mimetypes">text/plain;text/x-firejail-profile</property>
11 <property name="globs">*.profile;*.local;*.inc</property>
12 <property name="line-comment-start">#</property>
13 </metadata>
14
15 <styles>
16 <style id="comment" name="Comment" map-to="def:comment"/>
17 <style id="condition" name="Condition" map-to="def:preprocessor"/>
18 <style id="command" name="Command" map-to="def:keyword"/>
19 <style id="invalid" name="Invalid" map-to="def:error"/>
20 </styles>
21
22 <definitions>
23 <define-regex id="commands-with-arguments" extended="true">
24 (@FJ_PROFILE_COMMANDS_ARG1@)
25 </define-regex>
26
27 <define-regex id="commands-without-arguments" extended="true">
28 (@FJ_PROFILE_COMMANDS_ARG0@)
29 </define-regex>
30
31 <define-regex id="conditions" extended="true">
32 (@FJ_PROFILE_CONDITIONALS@)
33 </define-regex>
34
35 <context id="conditional-line">
36 <match>\?(?P&lt;condition&gt;\%{conditions}): </match>
37 <include>
38 <context sub-pattern="condition" style-ref="condition"/>
39 </include>
40 </context>
41
42 <context id="command-with-args">
43 <match>(?P&lt;command&gt;\%{commands-with-arguments}) (?P&lt;args&gt;.+)</match>
44 <include>
45 <context sub-pattern="command" style-ref="command"/>
46 </include>
47 </context>
48
49 <context id="command-without-args">
50 <match dupnames="true">(?P&lt;command&gt;\%{commands-without-arguments})</match>
51 <include>
52 <context sub-pattern="command" style-ref="command"/>
53 </include>
54 </context>
55
56 <context id="invalid" style-ref="invalid">
57 <match>.+</match>
58 </context>
59
60 <context id="firejail-profile" class="no-spell-check">
61 <include>
62 <context ref="def:shell-like-comment"/>
63 <context ref="conditional-line"/>
64 <context ref="command-with-args"/>
65 <context ref="command-without-args"/>
66 <context ref="invalid"/>
67 </include>
68 </context>
69 </definitions>
70</language>