diff options
author | 2022-12-04 17:37:02 +0100 | |
---|---|---|
committer | 2022-12-04 16:37:02 +0000 | |
commit | 16afd8c8e9818a7bff5e460c76eabf47255caf57 (patch) | |
tree | 8de77e3c3e412c59fa05d6fadbfac3e08298a0f7 /contrib | |
parent | Merge pull request #5488 from kmk3/configure-fix-format-misc (diff) | |
download | firejail-16afd8c8e9818a7bff5e460c76eabf47255caf57.tar.gz firejail-16afd8c8e9818a7bff5e460c76eabf47255caf57.tar.zst firejail-16afd8c8e9818a7bff5e460c76eabf47255caf57.zip |
Add basic gtksourceview language-spec (#5502)
Tested with org.gnome.TextEditor.
The gtksourceview language-spec hasn't changed between gtksourceview 3,
4 and 5 AFAIK so it should also work on older systems if you copy/link
the file in the right places.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gtksourceview-5/language-specs/firejail-profile.lang | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/contrib/gtksourceview-5/language-specs/firejail-profile.lang b/contrib/gtksourceview-5/language-specs/firejail-profile.lang new file mode 100644 index 000000000..61c37f98f --- /dev/null +++ b/contrib/gtksourceview-5/language-specs/firejail-profile.lang | |||
@@ -0,0 +1,69 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!-- vim: set ts=2 sts=2 sw=2 et: --> | ||
3 | <!-- | ||
4 | https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-tutorial.md | ||
5 | https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-reference.md | ||
6 | --> | ||
7 | <language id="firejail-profile" name="Firejail Profile" version="2.0" _section="Other"> | ||
8 | <metadata> | ||
9 | <property name="mimetypes">text/plain;text/x-firejail-profile</property> | ||
10 | <property name="globs">*.profile;*.local;*.inc</property> | ||
11 | <property name="line-comment-start">#</property> | ||
12 | </metadata> | ||
13 | |||
14 | <styles> | ||
15 | <style id="comment" name="Comment" map-to="def:comment"/> | ||
16 | <style id="condition" name="Condition" map-to="def:preprocessor"/> | ||
17 | <style id="command" name="Command" map-to="def:keyword"/> | ||
18 | <style id="invalid" name="Invalid" map-to="def:error"/> | ||
19 | </styles> | ||
20 | |||
21 | <definitions> | ||
22 | <define-regex id="commands-with-arguments" extended="true"> | ||
23 | (apparmor|bind|blacklist-nolog|blacklist|caps.drop|caps.keep|cpu|dbus-system.broadcast|dbus-system.call|dbus-system.own|dbus-system.see|dbus-system.talk|dbus-system|dbus-user.broadcast|dbus-user.call|dbus-user.own|dbus-user.see|dbus-user.talk|dbus-user|defaultgw|dns|env|hostname|hosts-file|ignore|include|ip6|ip|iprange|join-or-start|keep-fd|mac|mkdir|mkfile|mtu|name|net|netfilter6|netfilter|netmask|netns|nice|noblacklist|noexec|nowhitelist|overlay-named|private-bin|private-cwd|private-etc|private-home|private-lib|private-opt|private-srv|private|protocol|read-only|read-write|restrict-namespaces|rlimit-as|rlimit-cpu|rlimit-fsize|rlimit-nofile|rlimit-nproc|rlimit-sigpending|rlimit|rmenv|seccomp-error-action|seccomp.32.drop|seccomp.32.keep|seccomp.32|seccomp.drop|seccomp.keep|seccomp|shell|timeout|tmpfs|veth-name|whitelist-ro|whitelist|x11|xephyr-screen) | ||
24 | </define-regex> | ||
25 | |||
26 | <define-regex id="commands-without-arguments" extended="true"> | ||
27 | (allow-debuggers|allusers|apparmor|caps|deterministic-exit-code|deterministic-shutdown|disable-mnt|ipc-namespace|keep-config-pulse|keep-dev-shm|keep-fd|keep-var-tmp|machine-id|memory-deny-write-execute|netfilter|no3d|noautopulse|nodbus|nodvd|nogroups|noinput|nonewprivs|noprinters|noroot|nosound|notv|nou2f|novideo|overlay-tmpfs|overlay|private-cache|private-cwd|private-dev|private-lib|private-tmp|private|quiet|restrict-namespaces|seccomp.32|seccomp.block-secondary|seccomp|tab|tracelog|writable-etc|writable-run-user|writable-var-log|writable-var|x11) | ||
28 | </define-regex> | ||
29 | |||
30 | <define-regex id="conditions" extended="true"> | ||
31 | (ALLOW_TRAY|BROWSER_ALLOW_DRM|BROWSER_DISABLE_U2F|HAS_APPIMAGE|HAS_NET|HAS_NODBUS|HAS_NOSOUND|HAS_X11) | ||
32 | </define-regex> | ||
33 | |||
34 | <context id="conditional-line"> | ||
35 | <match>\?(?P<condition>\%{conditions}): </match> | ||
36 | <include> | ||
37 | <context sub-pattern="condition" style-ref="condition"/> | ||
38 | </include> | ||
39 | </context> | ||
40 | |||
41 | <context id="command-with-args"> | ||
42 | <match>(?P<command>\%{commands-with-arguments}) (?P<args>.+)</match> | ||
43 | <include> | ||
44 | <context sub-pattern="command" style-ref="command"/> | ||
45 | </include> | ||
46 | </context> | ||
47 | |||
48 | <context id="command-without-args"> | ||
49 | <match dupnames="true">(?P<command>\%{commands-without-arguments})</match> | ||
50 | <include> | ||
51 | <context sub-pattern="command" style-ref="command"/> | ||
52 | </include> | ||
53 | </context> | ||
54 | |||
55 | <context id="invalid" style-ref="invalid"> | ||
56 | <match>.+</match> | ||
57 | </context> | ||
58 | |||
59 | <context id="firejail-profile" class="no-spell-check"> | ||
60 | <include> | ||
61 | <context ref="def:shell-like-comment"/> | ||
62 | <context ref="conditional-line"/> | ||
63 | <context ref="command-with-args"/> | ||
64 | <context ref="command-without-args"/> | ||
65 | <context ref="invalid"/> | ||
66 | </include> | ||
67 | </context> | ||
68 | </definitions> | ||
69 | </language> | ||