Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/apparmor.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd" | 2 | <!DOCTYPE language SYSTEM "language.dtd" | ||
3 | [ | 3 | [ | ||
4 | <!ENTITY varName "[A-Za-z]\w*"> | 4 | <!ENTITY varName "[A-Za-z]\w*"> | ||
5 | <!ENTITY variable "@\{&varName;\}"> | 5 | <!ENTITY variable "@\{&varName;\}"> | ||
6 | <!ENTITY exec "[pPcC]?[iuU]?x"> | 6 | <!ENTITY exec "[pPcC]?[iuU]?x"> | ||
7 | <!ENTITY globbChars "*?"> | 7 | <!ENTITY globbChars "*?"> | ||
8 | <!-- Characters not allowed in a path --> | 8 | <!-- Characters not allowed in a path --> | ||
9 | <!ENTITY noPathChar "\s\)""> | 9 | <!ENTITY noPathChar "\s\)""> | ||
10 | <!ENTITY noPathCharWithoutSpace ")""> | 10 | <!ENTITY noPathCharWithoutSpace ")""> | ||
11 | <!ENTITY endPath ",([\s"]|$)"> | 11 | <!ENTITY endPath ",(?:[\s"]|$)"> | ||
12 | ]> | 12 | ]> | ||
13 | 13 | | |||
14 | <!-- | 14 | <!-- | ||
15 | AppArmor Profiles Syntax Highlighting Definition for the KDE KSyntaxHighlighting Framework | 15 | AppArmor Profiles Syntax Highlighting Definition for the KDE KSyntaxHighlighting Framework | ||
16 | ========================================================================================== | 16 | ========================================================================================== | ||
17 | This file is part of the KDE's KSyntaxHighlighting framework. | 17 | This file is part of the KDE's KSyntaxHighlighting framework. | ||
18 | 18 | | |||
19 | Copyright (c) 2017-2019 Nibaldo González S. (nibgonz@gmail.com) | 19 | Copyright (c) 2017-2019 Nibaldo González S. (nibgonz@gmail.com) | ||
Show All 17 Lines | |||||
37 | 37 | | |||
38 | Last update: | 38 | Last update: | ||
39 | Syntax highlighting based on AppArmor 2.13.3 | 39 | Syntax highlighting based on AppArmor 2.13.3 | ||
40 | For more details about the syntax of AppArmor profiles, visit: | 40 | For more details about the syntax of AppArmor profiles, visit: | ||
41 | https://gitlab.com/apparmor/apparmor/wikis/Documentation | 41 | https://gitlab.com/apparmor/apparmor/wikis/Documentation | ||
42 | https://manpages.ubuntu.com/manpages/disco/en/man5/apparmor.d.5.html | 42 | https://manpages.ubuntu.com/manpages/disco/en/man5/apparmor.d.5.html | ||
43 | 43 | | |||
44 | Change log: | 44 | Change log: | ||
45 | * Version 10 [25-Oct-2019]: Use non-capturing groups in RegExpr. | ||||
45 | * Version 9 [20-Jun-2019]: (AppArmor 2.13.3): | 46 | * Version 9 [20-Jun-2019]: (AppArmor 2.13.3): | ||
46 | - Add new network domain keywords. | 47 | - Add new network domain keywords. | ||
47 | - Fixes: drop unsupported 'to' operator for link rules and only highlight the 'in' | 48 | - Fixes: drop unsupported 'to' operator for link rules and only highlight the 'in' | ||
48 | operator in mount rules. Only highlight valid numbers in rlimit rules. | 49 | operator in mount rules. Only highlight valid numbers in rlimit rules. | ||
49 | * Version 8 [02-Apr-2019]: (AppArmor 2.13.2) | 50 | * Version 8 [02-Apr-2019]: (AppArmor 2.13.2) | ||
50 | - Do not highlight variable assignments and alias rules within profiles. | 51 | - Do not highlight variable assignments and alias rules within profiles. | ||
51 | - Add keywords of "tunables/share" variables. | 52 | - Add keywords of "tunables/share" variables. | ||
52 | - Change style of "Other Option" attribute and remove one indentation. | 53 | - Change style of "Other Option" attribute and remove one indentation. | ||
Show All 14 Lines | 67 | * Version 2 [29-Aug-2017, by Nibaldo G.]: | |||
67 | - Improvements and bug fixes. | 68 | - Improvements and bug fixes. | ||
68 | - Each rule has its own context. | 69 | - Each rule has its own context. | ||
69 | - The profile name is highlighted in the profile header and profile transition rules. | 70 | - The profile name is highlighted in the profile header and profile transition rules. | ||
70 | * Version 1 [22-Feb-2017, by Nibaldo González]: | 71 | * Version 1 [22-Feb-2017, by Nibaldo González]: | ||
71 | - Initial version. Support for profile syntax of Apparmor 2.11. | 72 | - Initial version. Support for profile syntax of Apparmor 2.11. | ||
72 | --> | 73 | --> | ||
73 | 74 | | |||
74 | <language name="AppArmor Security Profile" | 75 | <language name="AppArmor Security Profile" | ||
75 | version="9" | 76 | version="10" | ||
76 | kateversion="5.0" | 77 | kateversion="5.0" | ||
77 | section="Markup" | 78 | section="Markup" | ||
78 | extensions="usr.bin.*;usr.sbin.*;bin.*;sbin.*;usr.lib.*;usr.lib64.*;usr.lib32.*;usr.libx32.*;usr.libexec.*;usr.local.bin.*;usr.local.sbin.*;usr.local.lib*;opt.*;etc.cron.*;snap.*;snap-update-ns.*;snap-confine.*" | 79 | extensions="usr.bin.*;usr.sbin.*;bin.*;sbin.*;usr.lib.*;usr.lib64.*;usr.lib32.*;usr.libx32.*;usr.libexec.*;usr.local.bin.*;usr.local.sbin.*;usr.local.lib*;opt.*;etc.cron.*;snap.*;snap-update-ns.*;snap-confine.*" | ||
79 | priority="0" | 80 | priority="0" | ||
80 | mimetype="" | 81 | mimetype="" | ||
81 | author="Nibaldo González (nibgonz@gmail.com)" | 82 | author="Nibaldo González (nibgonz@gmail.com)" | ||
82 | license="MIT"> | 83 | license="MIT"> | ||
83 | 84 | | |||
▲ Show 20 Lines • Show All 697 Lines • ▼ Show 20 Line(s) | 780 | <context name="_normal" attribute="Normal Text" lineEndContext="#stay"> | |||
781 | 782 | | |||
782 | <!-- Variable Assignment. | 783 | <!-- Variable Assignment. | ||
783 | NOTE: | 784 | NOTE: | ||
784 | - Variable assignments are not allowed within profiles (when writing assignments within | 785 | - Variable assignments are not allowed within profiles (when writing assignments within | ||
785 | profiles, the parser shows an error because it does not allow + or = after a variable). | 786 | profiles, the parser shows an error because it does not allow + or = after a variable). | ||
786 | - [Jul 24, 2018] Variables of type "@VAR" will only be highlighted in assignments, as long | 787 | - [Jul 24, 2018] Variables of type "@VAR" will only be highlighted in assignments, as long | ||
787 | as they are not fully supported (apparently, they will be used in conditional expressions). --> | 788 | as they are not fully supported (apparently, they will be used in conditional expressions). --> | ||
788 | <Detect2Chars context="_variable_assignment" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> | 789 | <Detect2Chars context="_variable_assignment" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> | ||
789 | <RegExpr context="_variable_assignment_operator" attribute="Variable" String="@&varName;(?=\s*(\+?\=|$|\s#))" firstNonSpace="true"/> | 790 | <RegExpr context="_variable_assignment_operator" attribute="Variable" String="@&varName;(?=\s*(?:\+?\=|$|\s#))" firstNonSpace="true"/> | ||
790 | <DetectChar context="_variable_assignment_line_general" attribute="Operator 1" char="=" firstNonSpace="true"/> | 791 | <DetectChar context="_variable_assignment_line_general" attribute="Operator 1" char="=" firstNonSpace="true"/> | ||
791 | <Detect2Chars context="_variable_assignment_line" attribute="Operator 1" char="+" char1="=" firstNonSpace="true"/> | 792 | <Detect2Chars context="_variable_assignment_line" attribute="Operator 1" char="+" char1="=" firstNonSpace="true"/> | ||
792 | <!-- Alias rule --> | 793 | <!-- Alias rule --> | ||
793 | <keyword context="_default_rule_with_comments" attribute="Rule" String="rule_name_alias" beginRegion="Rule"/> | 794 | <keyword context="_default_rule_with_comments" attribute="Rule" String="rule_name_alias" beginRegion="Rule"/> | ||
794 | 795 | | |||
795 | <!-- Profile Content (also highlight rules, for abstractions) --> | 796 | <!-- Profile Content (also highlight rules, for abstractions) --> | ||
796 | <IncludeRules context="_default_profile"/> | 797 | <IncludeRules context="_default_profile"/> | ||
797 | </context> | 798 | </context> | ||
798 | 799 | | |||
799 | <!-- Profile Content, within { ... } --> | 800 | <!-- Profile Content, within { ... } --> | ||
800 | <context name="_profile" attribute="Normal Text" lineEndContext="#stay"> | 801 | <context name="_profile" attribute="Normal Text" lineEndContext="#stay"> | ||
801 | <DetectChar context="#pop" attribute="Operator 1" char="}" endRegion="Profile"/> | 802 | <DetectChar context="#pop" attribute="Operator 1" char="}" endRegion="Profile"/> | ||
802 | <Detect2Chars context="_variable_assignment_error" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> | 803 | <Detect2Chars context="_variable_assignment_error" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> | ||
803 | <IncludeRules context="_default_profile"/> | 804 | <IncludeRules context="_default_profile"/> | ||
804 | <WordDetect context="#stay" attribute="Error" String="alias"/> <!-- rule_name_alias --> | 805 | <WordDetect context="#stay" attribute="Error" String="alias"/> <!-- rule_name_alias --> | ||
805 | </context> | 806 | </context> | ||
806 | 807 | | |||
807 | <context name="_default_profile" attribute="Normal Text" lineEndContext="#stay"> | 808 | <context name="_default_profile" attribute="Normal Text" lineEndContext="#stay"> | ||
808 | <!-- Profile Header --> | 809 | <!-- Profile Header --> | ||
809 | <keyword context="_profile_name" attribute="Profile Head" String="profile_head"/> | 810 | <keyword context="_profile_name" attribute="Profile Head" String="profile_head"/> | ||
810 | <RegExpr context="_profile_name" attribute="Profile Head" String="(^|\s)\^(?=\S)"/> | 811 | <RegExpr context="_profile_name" attribute="Profile Head" String="(?:^|\s)\^(?=\S)"/> | ||
811 | <keyword context="#stay" attribute="Option" String="profile_options"/> | 812 | <keyword context="#stay" attribute="Option" String="profile_options"/> | ||
812 | 813 | | |||
813 | <!-- Line Rules --> | 814 | <!-- Line Rules --> | ||
814 | <StringDetect context="_include" attribute="Preprocessor" String="#include" insensitive="true"/> | 815 | <StringDetect context="_include" attribute="Preprocessor" String="#include" insensitive="true"/> | ||
815 | <RegExpr context="_include" attribute="Preprocessor" String="(^|\s)include(?=\s)"/> | 816 | <RegExpr context="_include" attribute="Preprocessor" String="(?:^|\s)include(?=\s)"/> | ||
816 | <DetectChar context="_comment" attribute="Comment" char="#"/> | 817 | <DetectChar context="_comment" attribute="Comment" char="#"/> | ||
817 | 818 | | |||
818 | <!-- Variables --> | 819 | <!-- Variables --> | ||
819 | <Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | 820 | <Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | ||
820 | <Detect2Chars context="_boolean" attribute="Variable" char="$" char1="{" lookAhead="true"/> | 821 | <Detect2Chars context="_boolean" attribute="Variable" char="$" char1="{" lookAhead="true"/> | ||
821 | <keyword context="#stay" attribute="Other Option" String="boolean" insensitive="true"/> | 822 | <keyword context="#stay" attribute="Other Option" String="boolean" insensitive="true"/> | ||
822 | <RegExpr context="#stay" attribute="Variable" String="\$&varName;(?=[\s\(\)\{\}"@\$#\=\+]|$)"/> | 823 | <RegExpr context="#stay" attribute="Variable" String="\$&varName;(?=[\s\(\)\{\}"@\$#\=\+]|$)"/> | ||
823 | 824 | | |||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
871 | <context name="_comment" attribute="Comment" lineEndContext="#pop"> | 872 | <context name="_comment" attribute="Comment" lineEndContext="#pop"> | ||
872 | <DetectSpaces /> | 873 | <DetectSpaces /> | ||
873 | <LineContinue context="#pop" attribute="Comment"/> | 874 | <LineContinue context="#pop" attribute="Comment"/> | ||
874 | <IncludeRules context="##Alerts"/> | 875 | <IncludeRules context="##Alerts"/> | ||
875 | <IncludeRules context="##Modelines"/> | 876 | <IncludeRules context="##Modelines"/> | ||
876 | <!-- URL --> | 877 | <!-- URL --> | ||
877 | <RegExpr context="#stay" attribute="URL in Comment" String="\bhttps?://[^\s<>"'`]*[^\s<>"'`\}\)\]\.,;\|]"/> | 878 | <RegExpr context="#stay" attribute="URL in Comment" String="\bhttps?://[^\s<>"'`]*[^\s<>"'`\}\)\]\.,;\|]"/> | ||
878 | <!-- Email (Source: http://emailregex.com) --> | 879 | <!-- Email (Source: http://emailregex.com) --> | ||
879 | <RegExpr context="#stay" attribute="URL in Comment" String="(([^<>\(\)\[\]\\\.,;:\s@"]+(\.[^<>\(\)\[\]\\\.,;:\s@"]+)*)|("[^"]+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}])|(([a-zA-Z\-\d]+\.)+[a-zA-Z]{2,}))\b"/> | 880 | <RegExpr context="#stay" attribute="URL in Comment" String="(?:(?:[^<>\(\)\[\]\\\.,;:\s@"]+(?:\.[^<>\(\)\[\]\\\.,;:\s@"]+)*)|(?:"[^"]+"))@(?:(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}])|(?:(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,}))\b"/> | ||
880 | </context> | 881 | </context> | ||
881 | 882 | | |||
882 | <!-- Profile Header: | 883 | <!-- Profile Header: | ||
883 | Highlight the name of the profile. | 884 | Highlight the name of the profile. | ||
884 | The profile name label is optional. This is written after the hat character (^) or a profile keyword. --> | 885 | The profile name label is optional. This is written after the hat character (^) or a profile keyword. --> | ||
885 | <context name="_profile_name" attribute="Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 886 | <context name="_profile_name" attribute="Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
886 | <DetectSpaces context="#stay" attribute="Normal Text"/> | 887 | <DetectSpaces context="#stay" attribute="Normal Text"/> | ||
887 | <!-- Not highlighting paths and paths quoted. | 888 | <!-- Not highlighting paths and paths quoted. | ||
888 | NOTE: Some profile labels may contain "/" (like [/]). These cases are not considered. --> | 889 | NOTE: Some profile labels may contain "/" (like [/]). These cases are not considered. --> | ||
889 | <RegExpr context="#pop" attribute="Normal Text" String=""([^/"\\]|\\.)*/" lookAhead="true"/> | 890 | <RegExpr context="#pop" attribute="Normal Text" String=""(?:[^/"\\]|\\.)*/" lookAhead="true"/> | ||
890 | <RegExpr context="#pop!_path_content" attribute="Path" String="([^\s"\\]|\\.)*/" lookAhead="true"/> | 891 | <RegExpr context="#pop!_path_content" attribute="Path" String="(?:[^\s"\\]|\\.)*/" lookAhead="true"/> | ||
891 | <DetectChar context="#pop!_profile_name_quoted" attribute="Profile Name" char="""/> | 892 | <DetectChar context="#pop!_profile_name_quoted" attribute="Profile Name" char="""/> | ||
892 | <!-- First word (the profile name) --> | 893 | <!-- First word (the profile name) --> | ||
893 | <RegExpr context="#pop!_profile_name_content" attribute="Normal Text" String="[^\s/\^\{]" lookAhead="true"/> | 894 | <RegExpr context="#pop!_profile_name_content" attribute="Normal Text" String="[^\s/\^\{]" lookAhead="true"/> | ||
894 | </context> | 895 | </context> | ||
895 | <context name="_profile_name_content" attribute="Profile Name" lineEndContext="#pop"> | 896 | <context name="_profile_name_content" attribute="Profile Name" lineEndContext="#pop"> | ||
896 | <!-- NOTE: "(" generates errors when calling "get_profiles()" (apparmor_status). This forces to put a space before. --> | 897 | <!-- NOTE: "(" generates errors when calling "get_profiles()" (apparmor_status). This forces to put a space before. --> | ||
897 | <RegExpr context="#pop" attribute="Error" String="\(\S*\)?"/> | 898 | <RegExpr context="#pop" attribute="Error" String="\(\S*\)?"/> | ||
898 | <!-- End of the profile name label --> | 899 | <!-- End of the profile name label --> | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | |||||
1016 | <context name="_boolean" attribute="Variable" lineEndContext="#pop"> | 1017 | <context name="_boolean" attribute="Variable" lineEndContext="#pop"> | ||
1017 | <RegExpr context="#pop" attribute="Variable" String="\$\{&varName;\}"/> | 1018 | <RegExpr context="#pop" attribute="Variable" String="\$\{&varName;\}"/> | ||
1018 | <DetectChar context="#pop" attribute="Error" char="$"/> | 1019 | <DetectChar context="#pop" attribute="Error" char="$"/> | ||
1019 | </context> | 1020 | </context> | ||
1020 | 1021 | | |||
1021 | <!-- Access Modes / File Permissions --> | 1022 | <!-- Access Modes / File Permissions --> | ||
1022 | <context name="_permissions" attribute="Normal Text" lineEndContext="#stay"> | 1023 | <context name="_permissions" attribute="Normal Text" lineEndContext="#stay"> | ||
1023 | <IncludeRules context="_permissions_correction"/> | 1024 | <IncludeRules context="_permissions_correction"/> | ||
1024 | <RegExpr context="#stay" attribute="Permissions" String="(^|\s)([rwkml]|&exec;)+(?=[\s,]|$)"/> | 1025 | <RegExpr context="#stay" attribute="Permissions" String="(?:^|\s)(?:[rwkml]|&exec;)+(?=[\s,]|$)"/> | ||
1025 | <RegExpr context="#stay" attribute="Permissions" String="(^|\s)([rakml]|&exec;)+(?=[\s,]|$)"/> | 1026 | <RegExpr context="#stay" attribute="Permissions" String="(?:^|\s)(?:[rakml]|&exec;)+(?=[\s,]|$)"/> | ||
1026 | </context> | 1027 | </context> | ||
1027 | <context name="_file_rule_permissions" attribute="Normal Text" lineEndContext="#stay"> | 1028 | <context name="_file_rule_permissions" attribute="Normal Text" lineEndContext="#stay"> | ||
1028 | <IncludeRules context="_permissions_correction"/> | 1029 | <IncludeRules context="_permissions_correction"/> | ||
1029 | <RegExpr context="_rule_file" attribute="Permissions" String="(^|\s)([rwkml]|&exec;)+(?=[\s,]|$)"/> | 1030 | <RegExpr context="_rule_file" attribute="Permissions" String="(?:^|\s)(?:[rwkml]|&exec;)+(?=[\s,]|$)"/> | ||
1030 | <RegExpr context="_rule_file" attribute="Permissions" String="(^|\s)([rakml]|&exec;)+(?=[\s,]|$)"/> | 1031 | <RegExpr context="_rule_file" attribute="Permissions" String="(?:^|\s)(?:[rakml]|&exec;)+(?=[\s,]|$)"/> | ||
1031 | </context> | 1032 | </context> | ||
1032 | <context name="_permissions_correction" attribute="Normal Text" lineEndContext="#stay"> | 1033 | <context name="_permissions_correction" attribute="Normal Text" lineEndContext="#stay"> | ||
1033 | <!-- Incompatible execution modes --> | 1034 | <!-- Incompatible execution modes --> | ||
1034 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*p[iUu]?x([rwakml]|p[iUu]?x)*[PcC]?[iUu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- p --> | 1035 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*p[iUu]?x(?:[rwakml]|p[iUu]?x)*[PcC]?[iUu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- p --> | ||
1035 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*P[iUu]?x([rwakml]|P[iUu]?x)*[pcC]?[iUu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- P --> | 1036 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*P[iUu]?x(?:[rwakml]|P[iUu]?x)*[pcC]?[iUu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- P --> | ||
1036 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*c[iUu]?x([rwakml]|c[iUu]?x)*[PpC]?[iUu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- c --> | 1037 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*c[iUu]?x(?:[rwakml]|c[iUu]?x)*[PpC]?[iUu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- c --> | ||
1037 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*C[iUu]?x([rwakml]|C[iUu]?x)*[Ppc]?[iUu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- C --> | 1038 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*C[iUu]?x(?:[rwakml]|C[iUu]?x)*[Ppc]?[iUu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- C --> | ||
1038 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*[PpCc]?ix([rwakml]|[PpCc]?ix)*[PpCc]?[Uu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- i --> | 1039 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*[PpCc]?ix(?:[rwakml]|[PpCc]?ix)*[PpCc]?[Uu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- i --> | ||
1039 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*[PpCc]?ux([rwakml]|[PpCc]?ux)*[PpCc]?[iU]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- u --> | 1040 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*[PpCc]?ux(?:[rwakml]|[PpCc]?ux)*[PpCc]?[iU]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- u --> | ||
1040 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*[PpCc]?Ux([rwakml]|[PpCc]?Ux)*[PpCc]?[iu]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- U --> | 1041 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*[PpCc]?Ux(?:[rwakml]|[PpCc]?Ux)*[PpCc]?[iu]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- U --> | ||
1041 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*[iuU]?x([rwakml]|[iuU]?x)*[PpCc][iuU]?x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- x, ix, ux or Ux followed by P, p, C or c --> | 1042 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*[iuU]?x(?:[rwakml]|[iuU]?x)*[PpCc][iuU]?x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- x, ix, ux or Ux followed by P, p, C or c --> | ||
1042 | <RegExpr context="_perm_correction_in" String="(^|\s)[rwakml]*x[rwakmlx]*[iuU]x([rwakml]|&exec;)*([\s,]|$)" lookAhead="true"/> <!-- x followed by ix, ux or Ux --> | 1043 | <RegExpr context="_perm_correction_in" String="(?:^|\s)[rwakml]*x[rwakmlx]*[iuU]x(?:[rwakml]|&exec;)*(?:[\s,]|$)" lookAhead="true"/> <!-- x followed by ix, ux or Ux --> | ||
1043 | </context> | 1044 | </context> | ||
1044 | <context name="_perm_correction_in" attribute="Normal Text" lineEndContext="#pop"> | 1045 | <context name="_perm_correction_in" attribute="Normal Text" lineEndContext="#pop"> | ||
1045 | <!-- Highlight the previous space or the full permission --> | 1046 | <!-- Highlight the previous space or the full permission --> | ||
1046 | <DetectSpaces context="#pop"/> | 1047 | <DetectSpaces context="#pop"/> | ||
1047 | <DetectIdentifier context="#pop"/> | 1048 | <DetectIdentifier context="#pop"/> | ||
1048 | </context> | 1049 | </context> | ||
1049 | 1050 | | |||
1050 | <!-- Operators --> | 1051 | <!-- Operators --> | ||
1051 | <context name="_operators" attribute="Normal Text" lineEndContext="#stay"> | 1052 | <context name="_operators" attribute="Normal Text" lineEndContext="#stay"> | ||
1052 | <DetectChar context="#stay" attribute="Operator 1" char="="/> | 1053 | <DetectChar context="#stay" attribute="Operator 1" char="="/> | ||
1053 | <Detect2Chars context="#stay" attribute="Operator 1" char="+" char1="="/> | 1054 | <Detect2Chars context="#stay" attribute="Operator 1" char="+" char1="="/> | ||
1054 | <Detect2Chars context="#stay" attribute="Operator 2" char="-" char1=">"/> | 1055 | <Detect2Chars context="#stay" attribute="Operator 2" char="-" char1=">"/> | ||
1055 | </context> | 1056 | </context> | ||
1056 | <context name="_operators_in" attribute="Normal Text" lineEndContext="#stay"> | 1057 | <context name="_operators_in" attribute="Normal Text" lineEndContext="#stay"> | ||
1057 | <!-- Only in mount rules --> | 1058 | <!-- Only in mount rules --> | ||
1058 | <RegExpr context="#stay" attribute="Operator 2" String="\b(in)(?=[\s\(\{\["/@\$]|$)"/> | 1059 | <RegExpr context="#stay" attribute="Operator 2" String="\b(?:in)(?=[\s\(\{\["/@\$]|$)"/> | ||
1059 | </context> | 1060 | </context> | ||
1060 | 1061 | | |||
1061 | <!-- RULES --> | 1062 | <!-- RULES --> | ||
1062 | 1063 | | |||
1063 | <!-- For all rules --> | 1064 | <!-- For all rules --> | ||
1064 | <!-- Also see: _default_parentheses_block_rule --> | 1065 | <!-- Also see: _default_parentheses_block_rule --> | ||
1065 | <context name="_common_rule" attribute="Normal Text" lineEndContext="#stay"> | 1066 | <context name="_common_rule" attribute="Normal Text" lineEndContext="#stay"> | ||
1066 | <!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> | 1067 | <!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> | ||
1067 | <RegExpr context="#stay" attribute="Error" String="\=(?=\s*($|&endPath;))"/> | 1068 | <RegExpr context="#stay" attribute="Error" String="\=(?=\s*(?:$|&endPath;))"/> | ||
1068 | <RegExpr context="_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(]*([^&noPathChar;\]\}\=\w\+\-\(,]|,[^&noPathChar;]))"/> | 1069 | <RegExpr context="_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(]*(?:[^&noPathChar;\]\}\=\w\+\-\(,]|,[^&noPathChar;]))"/> | ||
1069 | <Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | 1070 | <Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | ||
1070 | <IncludeRules context="_find_path"/> | 1071 | <IncludeRules context="_find_path"/> | ||
1071 | 1072 | | |||
1072 | <IncludeRules context="_common"/> | 1073 | <IncludeRules context="_common"/> | ||
1073 | <DetectChar context="_r_curly_brackets" attribute="Globbing Brackets" char="{"/> | 1074 | <DetectChar context="_r_curly_brackets" attribute="Globbing Brackets" char="{"/> | ||
1074 | <DetectChar context="_r_square_brackets" attribute="Globbing Brackets" char="["/> | 1075 | <DetectChar context="_r_square_brackets" attribute="Globbing Brackets" char="["/> | ||
1075 | <!-- This must be at the end of each context (to avoid conflicts with some keywords) --> | 1076 | <!-- This must be at the end of each context (to avoid conflicts with some keywords) --> | ||
1076 | <IncludeRules context="_end_rule"/> | 1077 | <IncludeRules context="_end_rule"/> | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 1158 | <context name="_signal_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> | |||
1158 | <IncludeRules context="_signal_rule_keywords"/> | 1159 | <IncludeRules context="_signal_rule_keywords"/> | ||
1159 | <keyword context="#stay" attribute="Other Option" String="rule_signal_options"/> | 1160 | <keyword context="#stay" attribute="Other Option" String="rule_signal_options"/> | ||
1160 | <IncludeRules context="_default_parentheses_block_rule"/> | 1161 | <IncludeRules context="_default_parentheses_block_rule"/> | ||
1161 | </context> | 1162 | </context> | ||
1162 | <context name="_signal_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> | 1163 | <context name="_signal_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> | ||
1163 | <keyword context="#stay" attribute="Flags" String="rule_signal"/> | 1164 | <keyword context="#stay" attribute="Flags" String="rule_signal"/> | ||
1164 | <keyword context="#stay" attribute="Permissions" String="rule_signal_access"/> | 1165 | <keyword context="#stay" attribute="Permissions" String="rule_signal_access"/> | ||
1165 | <keyword context="#stay" attribute="Permissions" String="base_accesses"/> | 1166 | <keyword context="#stay" attribute="Permissions" String="base_accesses"/> | ||
1166 | <RegExpr context="#stay" attribute="Flags" String="\b(rtmin\+)0*(3[012]|[12]?\d)\b"/> | 1167 | <RegExpr context="#stay" attribute="Flags" String="\brtmin\+0*(?:3[012]|[12]?\d)\b"/> <!-- rtmin+0 ... rtmin+32 --> | ||
1167 | </context> | 1168 | </context> | ||
1168 | 1169 | | |||
1169 | <!-- DBus Rule --> | 1170 | <!-- DBus Rule --> | ||
1170 | <context name="_rule_dbus" attribute="Normal Text" lineEndContext="#stay"> | 1171 | <context name="_rule_dbus" attribute="Normal Text" lineEndContext="#stay"> | ||
1171 | <keyword context="#stay" attribute="Option" String="rule_dbus_options"/> | 1172 | <keyword context="#stay" attribute="Option" String="rule_dbus_options"/> | ||
1172 | <IncludeRules context="_dbus_rule_keywords"/> | 1173 | <IncludeRules context="_dbus_rule_keywords"/> | ||
1173 | <IncludeRules context="_default_rule_without_parentheses"/> | 1174 | <IncludeRules context="_default_rule_without_parentheses"/> | ||
1174 | <DetectChar context="_dbus_parentheses_block" attribute="Normal Text" char="("/> | 1175 | <DetectChar context="_dbus_parentheses_block" attribute="Normal Text" char="("/> | ||
Show All 33 Lines | |||||
1208 | <context name="_rule_set" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 1209 | <context name="_rule_set" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
1209 | <keyword context="#pop!_rule_rlimit" attribute="Rule" String="rule_name_rlimit" beginRegion="Rule"/> | 1210 | <keyword context="#pop!_rule_rlimit" attribute="Rule" String="rule_name_rlimit" beginRegion="Rule"/> | ||
1210 | <DetectSpaces context="#stay" attribute="Normal Text"/> | 1211 | <DetectSpaces context="#stay" attribute="Normal Text"/> | ||
1211 | <RegExpr context="_comment" attribute="Comment" String="#(?!include)" insensitive="true"/> | 1212 | <RegExpr context="_comment" attribute="Comment" String="#(?!include)" insensitive="true"/> | ||
1212 | </context> | 1213 | </context> | ||
1213 | <context name="_rule_rlimit" attribute="Normal Text" lineEndContext="#stay"> | 1214 | <context name="_rule_rlimit" attribute="Normal Text" lineEndContext="#stay"> | ||
1214 | <keyword context="#stay" attribute="Data" String="rule_rlimit"/> | 1215 | <keyword context="#stay" attribute="Data" String="rule_rlimit"/> | ||
1215 | <Detect2Chars context="#stay" attribute="Operator 2" char="<" char1="="/> | 1216 | <Detect2Chars context="#stay" attribute="Operator 2" char="<" char1="="/> | ||
1216 | <RegExpr context="#stay" attribute="Number" String="\-(20|1?\d)\b"/> | 1217 | <RegExpr context="#stay" attribute="Number" String="\-(?:20|1?\d)\b"/> | ||
1217 | <RegExpr context="_number_unit" attribute="Number" String="\b\d+"/> <!-- Rules Int don't use '-' as a delimiter --> | 1218 | <RegExpr context="_number_unit" attribute="Number" String="\b\d+"/> <!-- Rules Int don't use '-' as a delimiter --> | ||
1218 | <WordDetect context="#stay" attribute="Number" String="infinity"/> | 1219 | <WordDetect context="#stay" attribute="Number" String="infinity"/> | ||
1219 | <RegExpr context="#stay" attribute="Numerical Unit" String="\b([KMG]B?|[shd]|us|ms|min|sec|(minute|day|hour|week|second)(s?)|(milli|micro)second(s?))\b"/> | 1220 | <RegExpr context="#stay" attribute="Numerical Unit" String="\b(?:[KMG]B?|[shd]|us|ms|min|sec|(?:minute|day|hour|week|second)(?:s?)|(?:milli|micro)second(?:s?))\b"/> | ||
1220 | <IncludeRules context="_default_rule"/> | 1221 | <IncludeRules context="_default_rule"/> | ||
1221 | </context> | 1222 | </context> | ||
1222 | <context name="_number_unit" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 1223 | <context name="_number_unit" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
1223 | <RegExpr context="#pop" attribute="Numerical Unit" String="([KMG]B?|[shd]|us|ms|min|sec|(minute|day|hour|week|second)(s?)|(milli|micro)second(s?))\b"/> | 1224 | <RegExpr context="#pop" attribute="Numerical Unit" String="(?:[KMG]B?|[shd]|us|ms|min|sec|(?:minute|day|hour|week|second)(?:s?)|(?:milli|micro)second(?:s?))\b"/> | ||
1224 | </context> | 1225 | </context> | ||
1225 | 1226 | | |||
1226 | <!-- Link Rule --> | 1227 | <!-- Link Rule --> | ||
1227 | <context name="_rule_link" attribute="Normal Text" lineEndContext="#stay"> | 1228 | <context name="_rule_link" attribute="Normal Text" lineEndContext="#stay"> | ||
1228 | <keyword context="#stay" attribute="Data" String="rule_link"/> | 1229 | <keyword context="#stay" attribute="Data" String="rule_link"/> | ||
1229 | <IncludeRules context="_default_rule"/> | 1230 | <IncludeRules context="_default_rule"/> | ||
1230 | </context> | 1231 | </context> | ||
1231 | 1232 | | |||
Show All 11 Lines | 1241 | <context name="_rule_file" attribute="Normal Text" lineEndContext="#stay"> | |||
1243 | <IncludeRules context="_permissions"/> | 1244 | <IncludeRules context="_permissions"/> | ||
1244 | </context> | 1245 | </context> | ||
1245 | 1246 | | |||
1246 | <!-- Profile Transition: | 1247 | <!-- Profile Transition: | ||
1247 | Highlight the profile name in File Rules (Execute Mode) and Change Profile Rules. --> | 1248 | Highlight the profile name in File Rules (Execute Mode) and Change Profile Rules. --> | ||
1248 | <context name="_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 1249 | <context name="_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
1249 | <DetectSpaces context="#stay" attribute="Normal Text"/> | 1250 | <DetectSpaces context="#stay" attribute="Normal Text"/> | ||
1250 | <!-- Not highlighting paths and paths quoted --> | 1251 | <!-- Not highlighting paths and paths quoted --> | ||
1251 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Path" String="([^\s/\[\\]|//|\\.|\[([^\s\]\\]|\\.)*\])*/($|[^/])" lookAhead="true"/> | 1252 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Path" String="(?:[^\s/\[\\]|//|\\.|\[(?:[^\s\]\\]|\\.)*\])*/(?:$|[^/])" lookAhead="true"/> | ||
1252 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Normal Text" String=""([^/"\[\\]|//|\\.|\[([^"\]\\]|\\.)*\])*/($|[^/])" lookAhead="true"/> | 1253 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Normal Text" String=""(?:[^/"\[\\]|//|\\.|\[(?:[^"\]\\]|\\.)*\])*/(?:$|[^/])" lookAhead="true"/> | ||
1253 | 1254 | | |||
1254 | <DetectChar context="#pop!_t_profile_name_quoted" attribute="Transition Profile Name" char="""/> | 1255 | <DetectChar context="#pop!_t_profile_name_quoted" attribute="Transition Profile Name" char="""/> | ||
1255 | <RegExpr context="#pop!_profile_transition_content" attribute="Normal Text" String="[^\s/]" lookAhead="true"/> <!-- First word --> | 1256 | <RegExpr context="#pop!_profile_transition_content" attribute="Normal Text" String="[^\s/]" lookAhead="true"/> <!-- First word --> | ||
1256 | </context> | 1257 | </context> | ||
1257 | <context name="_profile_transition_content" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> | 1258 | <context name="_profile_transition_content" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> | ||
1258 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Error" String="\(\S*(?=,([&noPathChar;]|$))"/> | 1259 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Error" String="\(\S*(?=,(?:[&noPathChar;]|$))"/> | ||
1259 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Normal Text" String="&endPath;" lookAhead="true"/> <!-- End rule --> | 1260 | <RegExpr context="#pop!_default_rule_with_comments" attribute="Normal Text" String="&endPath;" lookAhead="true"/> <!-- End rule --> | ||
1260 | <DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/> <!-- End of the profile name --> | 1261 | <DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/> <!-- End of the profile name --> | ||
1261 | 1262 | | |||
1262 | <DetectChar context="#stay" attribute="Error" char="""/> | 1263 | <DetectChar context="#stay" attribute="Error" char="""/> | ||
1263 | <StringDetect context="#pop!_default_rule_with_comments" attribute="Error" String="#include" insensitive="true"/> | 1264 | <StringDetect context="#pop!_default_rule_with_comments" attribute="Error" String="#include" insensitive="true"/> | ||
1264 | <RegExpr context="#stay" String="//(?=&endPath;)"/> | 1265 | <RegExpr context="#stay" String="//(?=&endPath;)"/> | ||
1265 | <IncludeRules context="_default_profile_transition"/> | 1266 | <IncludeRules context="_default_profile_transition"/> | ||
1266 | </context> | 1267 | </context> | ||
1267 | <context name="_t_profile_name_quoted" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> | 1268 | <context name="_t_profile_name_quoted" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> | ||
1268 | <DetectChar context="#pop!_default_rule_with_comments" attribute="Transition Profile Name" char="""/> | 1269 | <DetectChar context="#pop!_default_rule_with_comments" attribute="Transition Profile Name" char="""/> | ||
1269 | <IncludeRules context="_default_profile_transition"/> | 1270 | <IncludeRules context="_default_profile_transition"/> | ||
1270 | </context> | 1271 | </context> | ||
1271 | <context name="_default_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay"> | 1272 | <context name="_default_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay"> | ||
1272 | <IncludeRules context="_variable_simple"/> | 1273 | <IncludeRules context="_variable_simple"/> | ||
1273 | <AnyChar context="#stay" attribute="Globbing Char in Tran. Prof." String="&globbChars;"/> | 1274 | <AnyChar context="#stay" attribute="Globbing Char in Tran. Prof." String="&globbChars;"/> | ||
1274 | <IncludeRules context="_profile_transition_escape"/> | 1275 | <IncludeRules context="_profile_transition_escape"/> | ||
1275 | <RegExpr context="#stay" attribute="Hat Operator in Tran. Prof." String="//(?=[^&noPathChar;/])"/> | 1276 | <RegExpr context="#stay" attribute="Hat Operator in Tran. Prof." String="//(?=[^&noPathChar;/])"/> | ||
1276 | </context> | 1277 | </context> | ||
1277 | 1278 | | |||
1278 | <!-- Change Hat / Child Profile (name//HAT). | 1279 | <!-- Change Hat / Child Profile (name//HAT). | ||
1279 | NOTE: Old style (name^HAT) not included --> | 1280 | NOTE: Old style (name^HAT) not included --> | ||
1280 | <context name="_hat_path" attribute="Path" lineEndContext="#pop"> | 1281 | <context name="_hat_path" attribute="Path" lineEndContext="#pop"> | ||
1281 | <RegExpr context="#pop" attribute="Path" String="/(?=/&endPath;)"/> | 1282 | <RegExpr context="#pop" attribute="Path" String="/(?=/&endPath;)"/> | ||
1282 | <RegExpr context="#pop!_hat_path_content" attribute="SubProfile/Hat Operator" String="//(?=([^\s"/\\]|\\.)+([\s"]|$))"/> | 1283 | <RegExpr context="#pop!_hat_path_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^\s"/\\]|\\.)+(?:[\s"]|$))"/> | ||
1283 | <DetectChar context="#pop" attribute="Path" char="/"/> | 1284 | <DetectChar context="#pop" attribute="Path" char="/"/> | ||
1284 | </context> | 1285 | </context> | ||
1285 | <context name="_hat_path_parentheses" attribute="Path" lineEndContext="#pop"> | 1286 | <context name="_hat_path_parentheses" attribute="Path" lineEndContext="#pop"> | ||
1286 | <RegExpr context="#pop!_hat_path_parentheses_content" attribute="SubProfile/Hat Operator" String="//(?=([^&noPathChar;/\\,]|\\.)+([&noPathChar;,]|$))"/> | 1287 | <RegExpr context="#pop!_hat_path_parentheses_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^&noPathChar;/\\,]|\\.)+(?:[&noPathChar;,]|$))"/> | ||
1287 | <DetectChar context="#pop" attribute="Path" char="/"/> | 1288 | <DetectChar context="#pop" attribute="Path" char="/"/> | ||
1288 | </context> | 1289 | </context> | ||
1289 | <context name="_hat_path_quoted" attribute="Text Quoted" lineEndContext="#pop"> | 1290 | <context name="_hat_path_quoted" attribute="Text Quoted" lineEndContext="#pop"> | ||
1290 | <RegExpr context="#pop!_hat_path_quoted_content" attribute="SubProfile/Hat Operator" String="//(?=([^"/\\]|\\.)+")"/> | 1291 | <RegExpr context="#pop!_hat_path_quoted_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^"/\\]|\\.)+")"/> | ||
1291 | <DetectChar context="#pop" attribute="Text Quoted" char="/"/> | 1292 | <DetectChar context="#pop" attribute="Text Quoted" char="/"/> | ||
1292 | </context> | 1293 | </context> | ||
1293 | 1294 | | |||
1294 | <context name="_hat_path_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | 1295 | <context name="_hat_path_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | ||
1295 | <RegExpr context="#pop" String="&endPath;" lookAhead="true"/> <!-- End Path --> | 1296 | <RegExpr context="#pop" String="&endPath;" lookAhead="true"/> <!-- End Path --> | ||
1296 | <IncludeRules context="_default_path"/> | 1297 | <IncludeRules context="_default_path"/> | ||
1297 | </context> | 1298 | </context> | ||
1298 | <context name="_hat_path_parentheses_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | 1299 | <context name="_hat_path_parentheses_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | ||
1299 | <DetectChar context="#pop" char="," lookAhead="true"/> <!-- End Path --> | 1300 | <DetectChar context="#pop" char="," lookAhead="true"/> <!-- End Path --> | ||
1300 | <IncludeRules context="_default_path"/> | 1301 | <IncludeRules context="_default_path"/> | ||
1301 | </context> | 1302 | </context> | ||
1302 | <context name="_hat_path_quoted_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | 1303 | <context name="_hat_path_quoted_content" attribute="SubProfile/Hat" lineEndContext="#pop"> | ||
1303 | <DetectChar context="#pop" char=""" lookAhead="true"/> | 1304 | <DetectChar context="#pop" char=""" lookAhead="true"/> | ||
1304 | <IncludeRules context="_default_quoted"/> | 1305 | <IncludeRules context="_default_quoted"/> | ||
1305 | </context> | 1306 | </context> | ||
1306 | 1307 | | |||
1307 | <!-- Parentheses Block: ( ) | 1308 | <!-- Parentheses Block: ( ) | ||
1308 | NOTE: Here special contexts are used for paths, strings and brackets. The "," character acts as a delimiter. --> | 1309 | NOTE: Here special contexts are used for paths, strings and brackets. The "," character acts as a delimiter. --> | ||
1309 | <context name="_common_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> | 1310 | <context name="_common_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> | ||
1310 | <DetectChar context="#pop" attribute="Normal Text" char=")"/> | 1311 | <DetectChar context="#pop" attribute="Normal Text" char=")"/> | ||
1311 | <!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> | 1312 | <!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> | ||
1312 | <RegExpr context="#stay" attribute="Error" String="\=(?=\s*($|[,\)]))"/> | 1313 | <RegExpr context="#stay" attribute="Error" String="\=(?=\s*(?:$|[,\)]))"/> | ||
1313 | <RegExpr context="_parentheses_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(\),]*[^&noPathChar;\]\}\=\w\+\-\(,])"/> | 1314 | <RegExpr context="_parentheses_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(\),]*[^&noPathChar;\]\}\=\w\+\-\(,])"/> | ||
1314 | <DetectChar context="_parentheses_path_content" attribute="Path" char="/" lookAhead="true"/> | 1315 | <DetectChar context="_parentheses_path_content" attribute="Path" char="/" lookAhead="true"/> | ||
1315 | <Detect2Chars context="_parentheses_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | 1316 | <Detect2Chars context="_parentheses_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> | ||
1316 | 1317 | | |||
1317 | <IncludeRules context="_common"/> | 1318 | <IncludeRules context="_common"/> | ||
1318 | <DetectChar context="_round_brackets" attribute="Globbing Brackets" char="("/> | 1319 | <DetectChar context="_round_brackets" attribute="Globbing Brackets" char="("/> | ||
1319 | <DetectChar context="_p_curly_brackets" attribute="Globbing Brackets" char="{"/> | 1320 | <DetectChar context="_p_curly_brackets" attribute="Globbing Brackets" char="{"/> | ||
1320 | <DetectChar context="_p_square_brackets" attribute="Globbing Brackets" char="["/> | 1321 | <DetectChar context="_p_square_brackets" attribute="Globbing Brackets" char="["/> | ||
1321 | <IncludeRules context="_comment_not_allowed"/> | 1322 | <IncludeRules context="_comment_not_allowed"/> | ||
1322 | </context> | 1323 | </context> | ||
1323 | <context name="_parentheses_block_profile" attribute="Normal Text" lineEndContext="#stay"> | 1324 | <context name="_parentheses_block_profile" attribute="Normal Text" lineEndContext="#stay"> | ||
1324 | <keyword context="#stay" attribute="Flags" String="profile_flags"/> | 1325 | <keyword context="#stay" attribute="Flags" String="profile_flags"/> | ||
1325 | <!-- Used by xattrs --> | 1326 | <!-- Used by xattrs --> | ||
1326 | <RegExpr context="#stay" attribute="Other Option" String="\b[a-zA-Z](\.?[\w\-])*(?=\s*\=)"/> | 1327 | <RegExpr context="#stay" attribute="Other Option" String="\b[a-zA-Z](?:\.?[\w\-])*(?=\s*\=)"/> | ||
1327 | <IncludeRules context="_common_parentheses_block"/> | 1328 | <IncludeRules context="_common_parentheses_block"/> | ||
1328 | <IncludeRules context="_end_rule_irnc"/> | 1329 | <IncludeRules context="_end_rule_irnc"/> | ||
1329 | </context> | 1330 | </context> | ||
1330 | <!-- Parentheses Block within Rules --> | 1331 | <!-- Parentheses Block within Rules --> | ||
1331 | <context name="_default_parentheses_block_rule" attribute="Normal Text" lineEndContext="#stay"> | 1332 | <context name="_default_parentheses_block_rule" attribute="Normal Text" lineEndContext="#stay"> | ||
1332 | <IncludeRules context="_common_parentheses_block"/> | 1333 | <IncludeRules context="_common_parentheses_block"/> | ||
1333 | <IncludeRules context="_end_rule_irnc_parentheses_rule"/> | 1334 | <IncludeRules context="_end_rule_irnc_parentheses_rule"/> | ||
1334 | </context> | 1335 | </context> | ||
1335 | 1336 | | |||
1336 | <!-- Finding the end of a rule --> | 1337 | <!-- Finding the end of a rule --> | ||
1337 | <context name="_end_rule" attribute="Normal Text" lineEndContext="#stay"> | 1338 | <context name="_end_rule" attribute="Normal Text" lineEndContext="#stay"> | ||
1338 | <RegExpr context="#stay" attribute="Normal Text" String=",(?=(\)|[\w\-]+[^\s\w\-,#\("]))"/> <!-- Fix possible incorrect rule closures --> | 1339 | <RegExpr context="#stay" attribute="Normal Text" String=",(?=\)|[\w\-]+[^\s\w\-,#\("])"/> <!-- Fix possible incorrect rule closures --> | ||
1339 | <DetectChar context="#pop" attribute="End of Rule Char" char="," endRegion="Rule"/> | 1340 | <DetectChar context="#pop" attribute="End of Rule Char" char="," endRegion="Rule"/> | ||
1340 | <IncludeRules context="_end_rule_irnc"/> | 1341 | <IncludeRules context="_end_rule_irnc"/> | ||
1341 | </context> | 1342 | </context> | ||
1342 | <!-- Rule/Profile on new line, in rule not closed --> | 1343 | <!-- Rule/Profile on new line, in rule not closed --> | ||
1343 | <context name="_end_rule_irnc" attribute="Normal Text" lineEndContext="#stay"> | 1344 | <context name="_end_rule_irnc" attribute="Normal Text" lineEndContext="#stay"> | ||
1344 | <keyword String="profile_head" context="#pop!_profile_name" attribute="Profile Head Error" firstNonSpace="true" endRegion="Rule"/> | 1345 | <keyword String="profile_head" context="#pop!_profile_name" attribute="Profile Head Error" firstNonSpace="true" endRegion="Rule"/> | ||
1345 | <keyword String="access_types" context="#pop" attribute="Access Qualifier Error" firstNonSpace="true" endRegion="Rule"/> | 1346 | <keyword String="access_types" context="#pop" attribute="Access Qualifier Error" firstNonSpace="true" endRegion="Rule"/> | ||
1346 | <keyword String="qualifiers" context="#pop" attribute="Qualifier Error" firstNonSpace="true" endRegion="Rule"/> | 1347 | <keyword String="qualifiers" context="#pop" attribute="Qualifier Error" firstNonSpace="true" endRegion="Rule"/> | ||
Show All 38 Lines | 1368 | <context name="_end_rule_irnc_parentheses_rule" attribute="Normal Text" lineEndContext="#stay"> | |||
1385 | <keyword String="rule_name_unix" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> | 1386 | <keyword String="rule_name_unix" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> | ||
1386 | <!-- Not included: alias rule --> | 1387 | <!-- Not included: alias rule --> | ||
1387 | </context> | 1388 | </context> | ||
1388 | 1389 | | |||
1389 | <!-- Paths & File Globals --> | 1390 | <!-- Paths & File Globals --> | ||
1390 | 1391 | | |||
1391 | <context name="_find_path" attribute="Normal Text" lineEndContext="#stay"> | 1392 | <context name="_find_path" attribute="Normal Text" lineEndContext="#stay"> | ||
1392 | <DetectChar context="_path_content" attribute="Path" char="/" lookAhead="true"/> | 1393 | <DetectChar context="_path_content" attribute="Path" char="/" lookAhead="true"/> | ||
1393 | <RegExpr context="_path_content" String=":([^:&noPathChar;\(\\]|\\.)+:" lookAhead="true"/> <!-- :namespace: --> | 1394 | <RegExpr context="_path_content" String=":(?:[^\:&noPathChar;\(\\]|\\.)+:" lookAhead="true"/> <!-- :namespace: --> | ||
1394 | </context> | 1395 | </context> | ||
1395 | <context name="_path_content" attribute="Path" lineEndContext="#pop"> | 1396 | <context name="_path_content" attribute="Path" lineEndContext="#pop"> | ||
1396 | <RegExpr context="#pop" String="&endPath;" lookAhead="true"/> | 1397 | <RegExpr context="#pop" String="&endPath;" lookAhead="true"/> | ||
1397 | <IncludeRules context="_default_path"/> | 1398 | <IncludeRules context="_default_path"/> | ||
1398 | <Detect2Chars context="_hat_path" char="/" char1="/" lookAhead="true"/> | 1399 | <Detect2Chars context="_hat_path" char="/" char1="/" lookAhead="true"/> | ||
1399 | </context> | 1400 | </context> | ||
1400 | <context name="_parentheses_path_content" attribute="Path" lineEndContext="#pop"> | 1401 | <context name="_parentheses_path_content" attribute="Path" lineEndContext="#pop"> | ||
1401 | <DetectChar context="#pop" char="," lookAhead="true"/> | 1402 | <DetectChar context="#pop" char="," lookAhead="true"/> | ||
Show All 17 Lines | |||||
1419 | </context> | 1420 | </context> | ||
1420 | <context name="_path_globbing_chars" attribute="Normal Text" lineEndContext="#stay"> | 1421 | <context name="_path_globbing_chars" attribute="Normal Text" lineEndContext="#stay"> | ||
1421 | <AnyChar context="#stay" attribute="Globbing Char" String="&globbChars;"/> | 1422 | <AnyChar context="#stay" attribute="Globbing Char" String="&globbChars;"/> | ||
1422 | <IncludeRules context="_escape"/> | 1423 | <IncludeRules context="_escape"/> | ||
1423 | </context> | 1424 | </context> | ||
1424 | <!-- Escapes: Hexadecimal (\xNN), decimal (\dNNN) & octal (\NNN). Also make literal any character. | 1425 | <!-- Escapes: Hexadecimal (\xNN), decimal (\dNNN) & octal (\NNN). Also make literal any character. | ||
1425 | NOTE: Reserved character escape sequences: \\"aefnrt0 --> | 1426 | NOTE: Reserved character escape sequences: \\"aefnrt0 --> | ||
1426 | <context name="_escape" attribute="Normal Text" lineEndContext="#stay"> | 1427 | <context name="_escape" attribute="Normal Text" lineEndContext="#stay"> | ||
1427 | <RegExpr context="#stay" attribute="Escape Char" String="\\(x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> | 1428 | <RegExpr context="#stay" attribute="Escape Char" String="\\(?:x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> | ||
1428 | </context> | 1429 | </context> | ||
1429 | <context name="_profile_transition_escape" attribute="Transition Profile Name" lineEndContext="#stay"> | 1430 | <context name="_profile_transition_escape" attribute="Transition Profile Name" lineEndContext="#stay"> | ||
1430 | <RegExpr context="#stay" attribute="Globbing Char in Tran. Prof." String="\\(x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> | 1431 | <RegExpr context="#stay" attribute="Globbing Char in Tran. Prof." String="\\(?:x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> | ||
1431 | </context> | 1432 | </context> | ||
1432 | 1433 | | |||
1433 | <!-- Groups of brackets: { }, [ ] and ( ) --> | 1434 | <!-- Groups of brackets: { }, [ ] and ( ) --> | ||
1434 | <context name="_curly_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> | 1435 | <context name="_curly_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> | ||
1435 | <DetectChar context="#pop" attribute="Globbing Brackets" char="}"/> | 1436 | <DetectChar context="#pop" attribute="Globbing Brackets" char="}"/> | ||
1436 | <RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^&noPathChar;\(\[\{\}\\](?=[&noPathChar;]|$)"/> | 1437 | <RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^&noPathChar;\(\[\{\}\\](?=[&noPathChar;]|$)"/> | ||
1437 | <IncludeRules context="_default_path"/> | 1438 | <IncludeRules context="_default_path"/> | ||
1438 | <IncludeRules context="_default_curly_brackets"/> | 1439 | <IncludeRules context="_default_curly_brackets"/> | ||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |