Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/yaml.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 null "(null|Null|NULL|~)"> | 4 | <!ENTITY null "(?:null|Null|NULL|~)"> | ||
5 | <!ENTITY bool "(y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)"> | 5 | <!ENTITY bool "(?:y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)"> | ||
6 | 6 | | |||
7 | <!ENTITY int "(0|[\-\+]?[1-9][0-9_]*)"> | 7 | <!ENTITY int "(?:0|[\-\+]?[1-9][0-9_]*)"> | ||
8 | <!ENTITY intOther "[\-\+]?0(x_*[0-9a-fA-F][0-9a-fA-F_]*|o?_*[0-7][0-7_]*|b_*[01][01_]*)"> <!-- Hex, Octal, Binary --> | 8 | <!ENTITY intOther "[\-\+]?0(?:x_*[0-9a-fA-F][0-9a-fA-F_]*|o?_*[0-7][0-7_]*|b_*[01][01_]*)"> <!-- Hex, Octal, Binary --> | ||
9 | <!ENTITY intBase60 "[\-\+]?[1-9][0-9_]*(:[0-5]?[0-9])+"> | 9 | <!ENTITY intBase60 "[\-\+]?[1-9][0-9_]*(?:\:[0-5]?[0-9])+"> | ||
10 | <!ENTITY allInt "(&intBase60;|&intOther;|∫)"> | 10 | <!ENTITY allInt "(?:&intBase60;|&intOther;|∫)"> | ||
11 | 11 | | |||
12 | <!ENTITY float "[\-\+]?([0-9][0-9_]*\.[0-9\._]*|\._*[0-9][0-9\._]*)([eE][\-\+]?[0-9]+)?"> | 12 | <!ENTITY float "[\-\+]?(?:[0-9][0-9_]*\.[0-9\._]*|\._*[0-9][0-9\._]*)(?:[eE][\-\+]?[0-9]+)?"> | ||
13 | <!ENTITY floatExp "[\-\+]?[0-9][0-9_]*[eE][\-\+]?[0-9]+"> | 13 | <!ENTITY floatExp "[\-\+]?[0-9][0-9_]*[eE][\-\+]?[0-9]+"> | ||
14 | <!ENTITY floatBase60 "[\-\+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]*"> | 14 | <!ENTITY floatBase60 "[\-\+]?[0-9][0-9_]*(?:\:[0-5]?[0-9])+\.[0-9_]*"> | ||
15 | <!ENTITY inf "[\-\+]?\.(inf|Inf|INF)\b"> | 15 | <!ENTITY inf "[\-\+]?\.(?:inf|Inf|INF)\b"> | ||
16 | <!ENTITY nan "\.(nan|NaN|NAN)\b"> | 16 | <!ENTITY nan "\.(?:nan|NaN|NAN)\b"> | ||
17 | <!ENTITY allFloat "(&float;|&floatExp;|&floatBase60;|&inf;|&nan;)"> | 17 | <!ENTITY allFloat "(?:&float;|&floatExp;|&floatBase60;|&inf;|&nan;)"> | ||
18 | 18 | | |||
19 | <!ENTITY endValue "(?:\s*$|\s+#)"> | 19 | <!ENTITY endValue "(?:\s*$|\s+#)"> | ||
20 | <!ENTITY endValueInline "\s*[:,\[\]\{\}]"> | 20 | <!ENTITY endValueInline "\s*[:,\[\]\{\}]"> | ||
21 | <!ENTITY space "[ ]"> | 21 | <!ENTITY space "[ ]"> | ||
22 | 22 | | |||
23 | <!-- Key quoted --> | 23 | <!-- Key quoted --> | ||
24 | <!ENTITY keyDQ ""(?:\\.|[^"])+"\s*"> | 24 | <!ENTITY keyDQ ""(?:\\.|[^"])+"\s*"> | ||
25 | <!ENTITY keySQ "'(?:[^']|'')+'\s*"> | 25 | <!ENTITY keySQ "'(?:[^']|'')+'\s*"> | ||
26 | <!-- Literal/folded operator --> | 26 | <!-- Literal/folded operator --> | ||
27 | <!ENTITY literalOp "[\|>][\-\+]?"> | 27 | <!ENTITY literalOp "[\|>][\-\+]?"> | ||
28 | <!-- Key after "?" or "-", used to detect literal/folded operator --> | 28 | <!-- Key after "?" or "-", used to detect literal/folded operator --> | ||
29 | <!ENTITY keyAfterOp "(?:[^"'#\-\?\s][^:#]*|\-(?:[^\s:#][^:#]*)?|&keyDQ;|&keySQ;)"> | 29 | <!ENTITY keyAfterOp "(?:[^"'#\-\?\s][^:#]*|\-(?:[^\s:#][^:#]*)?|&keyDQ;|&keySQ;)"> | ||
30 | 30 | | |||
31 | <!ENTITY dataTypes "!!\S+"> | 31 | <!ENTITY dataTypes "!!\S+"> | ||
32 | <!ENTITY alias "&\S+"> | 32 | <!ENTITY alias "&\S+"> | ||
33 | <!ENTITY reference "\*\S+"> | 33 | <!ENTITY reference "\*\S+"> | ||
34 | ]> | 34 | ]> | ||
35 | 35 | | |||
36 | <!-- Author: Dr Orlovsky MA <maxim@orlovsky.info> //--> | 36 | <!-- Author: Dr Orlovsky MA <maxim@orlovsky.info> //--> | ||
37 | <!-- Modifications (YAML 1.2), values & support for literal/folded style: | 37 | <!-- Modifications (YAML 1.2), values & support for literal/folded style: | ||
38 | Nibaldo González S. <nibgonz@gmail.com> | 38 | Nibaldo González S. <nibgonz@gmail.com> | ||
39 | These modifications are under the MIT license. //--> | 39 | These modifications are under the MIT license. //--> | ||
40 | <language name="YAML" version="6" kateversion="5.0" section="Markup" | 40 | <language name="YAML" version="7" kateversion="5.0" section="Markup" | ||
41 | extensions="*.yaml;*.yml" mimetype="text/yaml" priority="9" | 41 | extensions="*.yaml;*.yml" mimetype="text/yaml" priority="9" | ||
42 | author="Dr Orlovsky MA (dr.orlovsky@gmail.com), Nibaldo González (nibgonz@gmail.com)" license="LGPL"> | 42 | author="Dr Orlovsky MA (dr.orlovsky@gmail.com), Nibaldo González (nibgonz@gmail.com)" license="LGPL"> | ||
43 | <highlighting> | 43 | <highlighting> | ||
44 | <contexts> | 44 | <contexts> | ||
45 | <context attribute="Attribute" lineEndContext="#stay" name="normal" > | 45 | <context attribute="Attribute" lineEndContext="#stay" name="normal" > | ||
46 | <StringDetect attribute="Document Header" context="header" String="---" column="0"/> | 46 | <StringDetect attribute="Document Header" context="header" String="---" column="0"/> | ||
47 | <RegExpr attribute="End of Document" context="EOD" String="^\.\.\.$" column="0"/> | 47 | <RegExpr attribute="End of Document" context="EOD" String="^\.\.\.$" column="0"/> | ||
48 | <DetectChar attribute="Directive" context="directive" char="%" column="0"/> | 48 | <DetectChar attribute="Directive" context="directive" char="%" column="0"/> | ||
49 | 49 | | |||
50 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 50 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
51 | 51 | | |||
52 | <!-- Literal/Folded Style --> | 52 | <!-- Literal/Folded Style --> | ||
53 | <IncludeRules context="find-literal-block" /> | 53 | <IncludeRules context="find-literal-block" /> | ||
54 | 54 | | |||
55 | <RegExpr attribute="Operator" firstNonSpace="true" context="dash" String="\-(?=\s|$)" /> | 55 | <RegExpr attribute="Operator" firstNonSpace="true" context="dash" String="\-(?=\s|$)" /> | ||
56 | <DetectChar attribute="Operator" firstNonSpace="true" context="mapping-key" char="?" /> | 56 | <DetectChar attribute="Operator" firstNonSpace="true" context="mapping-key" char="?" /> | ||
57 | 57 | | |||
58 | <DetectChar attribute="Operator" firstNonSpace="true" context="list" char="[" beginRegion="List" /> | 58 | <DetectChar attribute="Operator" firstNonSpace="true" context="list" char="[" beginRegion="List" /> | ||
59 | <DetectChar attribute="Operator" firstNonSpace="true" context="hash" char="{" beginRegion="Hash" /> | 59 | <DetectChar attribute="Operator" firstNonSpace="true" context="hash" char="{" beginRegion="Hash" /> | ||
60 | 60 | | |||
61 | <RegExpr attribute="Data Types" firstNonSpace="true" context="after-data" String="&dataTypes;" /> | 61 | <RegExpr attribute="Data Types" firstNonSpace="true" context="after-data" String="&dataTypes;" /> | ||
62 | <RegExpr attribute="Alias" firstNonSpace="true" context="after-data" String="&alias;" /> | 62 | <RegExpr attribute="Alias" firstNonSpace="true" context="after-data" String="&alias;" /> | ||
63 | <RegExpr attribute="Reference" firstNonSpace="true" context="after-data" String="&reference;" /> | 63 | <RegExpr attribute="Reference" firstNonSpace="true" context="after-data" String="&reference;" /> | ||
64 | 64 | | |||
65 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="[^"'#\-\s][^:#]*(?=:(\s|$))"/> | 65 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="[^"'#\-\s][^:#]*(?=\:(?:\s|$))"/> | ||
66 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="\-([^\s:#][^:#]*)?(?=:(\s|$))"/> | 66 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="\-(?:[^\s:#][^:#]*)?(?=\:(?:\s|$))"/> | ||
67 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="&keyDQ;(?=:(\s|$))"/> | 67 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="&keyDQ;(?=\:(?:\s|$))"/> | ||
68 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="&keySQ;(?=:(\s|$))"/> | 68 | <RegExpr attribute="Key" context="dpoints-attribute-pre" String="&keySQ;(?=\:(?:\s|$))"/> | ||
69 | <RegExpr attribute="Key Points Operator" context="attribute-pre" String=":(?=\s|$)"/> | 69 | <RegExpr attribute="Key Points Operator" context="attribute-pre" String=":(?=\s|$)"/> | ||
70 | 70 | | |||
71 | <DetectChar attribute="String" firstNonSpace="true" context="string" char="'" beginRegion="String" /> | 71 | <DetectChar attribute="String" firstNonSpace="true" context="string" char="'" beginRegion="String" /> | ||
72 | <DetectChar attribute="String" firstNonSpace="true" context="stringx" char=""" beginRegion="String" /> | 72 | <DetectChar attribute="String" firstNonSpace="true" context="stringx" char=""" beginRegion="String" /> | ||
73 | <IncludeRules context="values-firstnonspace" /> | 73 | <IncludeRules context="values-firstnonspace" /> | ||
74 | <DetectSpaces/> | 74 | <DetectSpaces/> | ||
75 | </context> | 75 | </context> | ||
76 | 76 | | |||
77 | <context attribute="Normal Text" lineEndContext="#pop" name="mapping-key" fallthrough="true" fallthroughContext="#pop"> | 77 | <context attribute="Normal Text" lineEndContext="#pop" name="mapping-key" fallthrough="true" fallthroughContext="#pop"> | ||
78 | <RegExpr attribute="Comment" context="#pop!comment" String="(^|\s+)#" /> | 78 | <RegExpr attribute="Comment" context="#pop!comment" String="(?:^|\s+)#" /> | ||
79 | <DetectSpaces /> | 79 | <DetectSpaces /> | ||
80 | <RegExpr attribute="Operator" context="#pop!dash" String="\-(?=\s|$)" /> | 80 | <RegExpr attribute="Operator" context="#pop!dash" String="\-(?=\s|$)" /> | ||
81 | <RegExpr attribute="Data Types" context="#pop!after-data" String="&dataTypes;" /> | 81 | <RegExpr attribute="Data Types" context="#pop!after-data" String="&dataTypes;" /> | ||
82 | <RegExpr attribute="Alias" context="#pop!after-data" String="&alias;" /> | 82 | <RegExpr attribute="Alias" context="#pop!after-data" String="&alias;" /> | ||
83 | <RegExpr attribute="Reference" context="#pop!after-data" String="&reference;" /> | 83 | <RegExpr attribute="Reference" context="#pop!after-data" String="&reference;" /> | ||
84 | 84 | | |||
85 | <DetectChar attribute="Operator" context="#pop!list" char="[" beginRegion="List" /> | 85 | <DetectChar attribute="Operator" context="#pop!list" char="[" beginRegion="List" /> | ||
86 | <DetectChar attribute="Operator" context="#pop!hash" char="{" beginRegion="Hash" /> | 86 | <DetectChar attribute="Operator" context="#pop!hash" char="{" beginRegion="Hash" /> | ||
87 | <DetectChar attribute="String" context="#pop!string" char="'" beginRegion="String" /> | 87 | <DetectChar attribute="String" context="#pop!string" char="'" beginRegion="String" /> | ||
88 | <DetectChar attribute="String" context="#pop!stringx" char=""" beginRegion="String" /> | 88 | <DetectChar attribute="String" context="#pop!stringx" char=""" beginRegion="String" /> | ||
89 | </context> | 89 | </context> | ||
90 | 90 | | |||
91 | <context attribute="Normal Text" lineEndContext="#pop" name="dash" fallthrough="true" fallthroughContext="#pop"> | 91 | <context attribute="Normal Text" lineEndContext="#pop" name="dash" fallthrough="true" fallthroughContext="#pop"> | ||
92 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 92 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
93 | <DetectSpaces/> | 93 | <DetectSpaces/> | ||
94 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 94 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
95 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | 95 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | ||
96 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | 96 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | ||
97 | <IncludeRules context="values" /> | 97 | <IncludeRules context="values" /> | ||
98 | <DetectChar attribute="Operator" context="#pop!mapping-key" char="?" /> | 98 | <DetectChar attribute="Operator" context="#pop!mapping-key" char="?" /> | ||
99 | <RegExpr attribute="Operator" context="#stay" String="\-(?=\s|$)" /> | 99 | <RegExpr attribute="Operator" context="#stay" String="\-(?=\s|$)" /> | ||
100 | 100 | | |||
101 | <DetectChar attribute="Operator" context="#pop!list" char="[" beginRegion="List" /> | 101 | <DetectChar attribute="Operator" context="#pop!list" char="[" beginRegion="List" /> | ||
102 | <DetectChar attribute="Operator" context="#pop!hash" char="{" beginRegion="Hash" /> | 102 | <DetectChar attribute="Operator" context="#pop!hash" char="{" beginRegion="Hash" /> | ||
103 | <DetectChar attribute="String" context="#pop!string" char="'" beginRegion="String" /> | 103 | <DetectChar attribute="String" context="#pop!string" char="'" beginRegion="String" /> | ||
104 | <DetectChar attribute="String" context="#pop!stringx" char=""" beginRegion="String" /> | 104 | <DetectChar attribute="String" context="#pop!stringx" char=""" beginRegion="String" /> | ||
105 | </context> | 105 | </context> | ||
106 | 106 | | |||
107 | <!-- Highlight lists, hashes and strings after a data type, reference or alias --> | 107 | <!-- Highlight lists, hashes and strings after a data type, reference or alias --> | ||
108 | <context attribute="Normal Text" lineEndContext="#pop" name="after-data" fallthrough="true" fallthroughContext="#pop"> | 108 | <context attribute="Normal Text" lineEndContext="#pop" name="after-data" fallthrough="true" fallthroughContext="#pop"> | ||
109 | <RegExpr attribute="Comment" context="#pop!comment" String="(^|\s+)#" /> | 109 | <RegExpr attribute="Comment" context="#pop!comment" String="(?:^|\s+)#" /> | ||
110 | <DetectSpaces /> | 110 | <DetectSpaces /> | ||
111 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 111 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
112 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | 112 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | ||
113 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | 113 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | ||
114 | 114 | | |||
115 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | 115 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | ||
116 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | 116 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | ||
117 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | 117 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | ||
118 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | 118 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | ||
119 | </context> | 119 | </context> | ||
120 | 120 | | |||
121 | <context attribute="Document Header" lineEndContext="#pop" name="header"> | 121 | <context attribute="Document Header" lineEndContext="#pop" name="header"> | ||
122 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 122 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
123 | <RegExpr attribute="Literal/Folded Operator" context="header-literal-operator" String="\s&literalOp;(?=&endValue;)" lookAhead="true" /> | 123 | <RegExpr attribute="Literal/Folded Operator" context="header-literal-operator" String="\s&literalOp;(?=&endValue;)" lookAhead="true" /> | ||
124 | </context> | 124 | </context> | ||
125 | <context attribute="Document Header" lineEndContext="#pop#pop" name="header-literal-operator" fallthrough="true" fallthroughContext="#pop"> | 125 | <context attribute="Document Header" lineEndContext="#pop#pop" name="header-literal-operator" fallthrough="true" fallthroughContext="#pop"> | ||
126 | <DetectSpaces /> | 126 | <DetectSpaces /> | ||
127 | <RegExpr attribute="Literal/Folded Operator" context="#pop#pop!literal-block-simple" String="&literalOp;" beginRegion="Literal" /> | 127 | <RegExpr attribute="Literal/Folded Operator" context="#pop#pop!literal-block-simple" String="&literalOp;" beginRegion="Literal" /> | ||
128 | </context> | 128 | </context> | ||
129 | 129 | | |||
130 | <context attribute="End of Document" lineEndContext="#stay" name="EOD"> | 130 | <context attribute="End of Document" lineEndContext="#stay" name="EOD"> | ||
131 | </context> | 131 | </context> | ||
132 | 132 | | |||
133 | <context attribute="Directive" lineEndContext="#pop" name="directive"> | 133 | <context attribute="Directive" lineEndContext="#pop" name="directive"> | ||
134 | </context> | 134 | </context> | ||
135 | 135 | | |||
136 | <context attribute="Attribute" lineEndContext="#pop#pop" name="attribute"> | 136 | <context attribute="Attribute" lineEndContext="#pop#pop" name="attribute"> | ||
137 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 137 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
138 | </context> | 138 | </context> | ||
139 | 139 | | |||
140 | <context attribute="Attribute" lineEndContext="#stay" name="list-attribute-inline"> | 140 | <context attribute="Attribute" lineEndContext="#stay" name="list-attribute-inline"> | ||
141 | <AnyChar attribute="Operator" context="#pop#pop" lookAhead="true" String=",]" /> | 141 | <AnyChar attribute="Operator" context="#pop#pop" lookAhead="true" String=",]" /> | ||
142 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 142 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
143 | </context> | 143 | </context> | ||
144 | <context attribute="Attribute" lineEndContext="#stay" name="hash-attribute-inline"> | 144 | <context attribute="Attribute" lineEndContext="#stay" name="hash-attribute-inline"> | ||
145 | <AnyChar attribute="Operator" context="#pop#pop" lookAhead="true" String=",}" /> | 145 | <AnyChar attribute="Operator" context="#pop#pop" lookAhead="true" String=",}" /> | ||
146 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 146 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
147 | </context> | 147 | </context> | ||
148 | 148 | | |||
149 | <!-- Attribute --> | 149 | <!-- Attribute --> | ||
150 | <context attribute="Attribute" lineEndContext="#pop" name="dpoints-attribute-pre" fallthrough="true" fallthroughContext="#pop!attribute-pre"> | 150 | <context attribute="Attribute" lineEndContext="#pop" name="dpoints-attribute-pre" fallthrough="true" fallthroughContext="#pop!attribute-pre"> | ||
151 | <DetectChar attribute="Key Points Operator" context="#pop!attribute-pre" char=":" /> <!-- Highlight two points after Key --> | 151 | <DetectChar attribute="Key Points Operator" context="#pop!attribute-pre" char=":" /> <!-- Highlight two points after Key --> | ||
152 | </context> | 152 | </context> | ||
153 | <context attribute="Attribute" lineEndContext="#pop" name="attribute-pre" fallthrough="true" fallthroughContext="attribute"> | 153 | <context attribute="Attribute" lineEndContext="#pop" name="attribute-pre" fallthrough="true" fallthroughContext="attribute"> | ||
154 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 154 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
155 | <DetectSpaces/> | 155 | <DetectSpaces/> | ||
156 | <DetectChar attribute="Operator" context="#stay" char="?" /> | 156 | <DetectChar attribute="Operator" context="#stay" char="?" /> | ||
157 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 157 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
158 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | 158 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | ||
159 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | 159 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | ||
160 | <DetectChar attribute="String" context="attribute-string" char="'" beginRegion="String" /> | 160 | <DetectChar attribute="String" context="attribute-string" char="'" beginRegion="String" /> | ||
161 | <DetectChar attribute="String" context="attribute-stringx" char=""" beginRegion="String" /> | 161 | <DetectChar attribute="String" context="attribute-stringx" char=""" beginRegion="String" /> | ||
162 | <RegExpr attribute="Alias" context="#stay" String="&alias;(?=\s+[\[\{])" /> | 162 | <RegExpr attribute="Alias" context="#stay" String="&alias;(?=\s+[\[\{])" /> | ||
163 | <RegExpr attribute="Reference" context="#stay" String="&reference;(?=\s+[\[\{])" /> | 163 | <RegExpr attribute="Reference" context="#stay" String="&reference;(?=\s+[\[\{])" /> | ||
164 | <RegExpr attribute="Alias" context="attribute" String="&alias;" /> | 164 | <RegExpr attribute="Alias" context="attribute" String="&alias;" /> | ||
165 | <RegExpr attribute="Reference" context="attribute" String="&reference;" /> | 165 | <RegExpr attribute="Reference" context="attribute" String="&reference;" /> | ||
166 | <IncludeRules context="values" /> | 166 | <IncludeRules context="values" /> | ||
167 | <RegExpr attribute="Literal/Folded Operator" context="#stay" String="&literalOp;(?=&endValue;)" /> | 167 | <RegExpr attribute="Literal/Folded Operator" context="#stay" String="&literalOp;(?=&endValue;)" /> | ||
168 | </context> | 168 | </context> | ||
169 | 169 | | |||
170 | <context attribute="Attribute" lineEndContext="#pop" name="default-attribute-pre-inline"> | 170 | <context attribute="Attribute" lineEndContext="#pop" name="default-attribute-pre-inline"> | ||
171 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 171 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
172 | <DetectSpaces/> | 172 | <DetectSpaces/> | ||
173 | 173 | | |||
174 | <DetectChar attribute="Operator" context="#stay" char="?" /> | 174 | <DetectChar attribute="Operator" context="#stay" char="?" /> | ||
175 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 175 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
176 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | 176 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | ||
177 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | 177 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | ||
178 | <DetectChar attribute="String" context="attribute-string-inline" char="'" beginRegion="String" /> | 178 | <DetectChar attribute="String" context="attribute-string-inline" char="'" beginRegion="String" /> | ||
179 | <DetectChar attribute="String" context="attribute-stringx-inline" char=""" beginRegion="String" /> | 179 | <DetectChar attribute="String" context="attribute-stringx-inline" char=""" beginRegion="String" /> | ||
Show All 25 Lines | 201 | <context attribute="Attribute" lineEndContext="#pop" name="hash-attribute-pre-inline" fallthrough="true" fallthroughContext="hash-attribute-inline"> | |||
205 | 205 | | |||
206 | <AnyChar attribute="Operator" context="#pop" lookAhead="true" String=",}" /> | 206 | <AnyChar attribute="Operator" context="#pop" lookAhead="true" String=",}" /> | ||
207 | <IncludeRules context="values-inline" /> | 207 | <IncludeRules context="values-inline" /> | ||
208 | </context> | 208 | </context> | ||
209 | 209 | | |||
210 | <!-- List --> | 210 | <!-- List --> | ||
211 | <!-- Context "find-values-list" highlights values and then sends to "list-element" --> | 211 | <!-- Context "find-values-list" highlights values and then sends to "list-element" --> | ||
212 | <context attribute="List" lineEndContext="#stay" name="list" fallthrough="true" fallthroughContext="#pop!find-values-list" noIndentationBasedFolding="true"> | 212 | <context attribute="List" lineEndContext="#stay" name="list" fallthrough="true" fallthroughContext="#pop!find-values-list" noIndentationBasedFolding="true"> | ||
213 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 213 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
214 | <DetectSpaces /> | 214 | <DetectSpaces /> | ||
215 | <DetectChar attribute="Operator" context="#pop!find-values-list" char="?" /> | 215 | <DetectChar attribute="Operator" context="#pop!find-values-list" char="?" /> | ||
216 | </context> | 216 | </context> | ||
217 | <context attribute="List" lineEndContext="#stay" name="list-element" noIndentationBasedFolding="true"> | 217 | <context attribute="List" lineEndContext="#stay" name="list-element" noIndentationBasedFolding="true"> | ||
218 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 218 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
219 | 219 | | |||
220 | <DetectChar attribute="Operator" context="#pop" char="]" endRegion="List" /> | 220 | <DetectChar attribute="Operator" context="#pop" char="]" endRegion="List" /> | ||
221 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | 221 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | ||
222 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | 222 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | ||
223 | 223 | | |||
224 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="[^"'#\-,\]\s][^:#,\]]*(?=:(\s|$))"/> | 224 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="[^"'#\-,\]\s][^:#,\]]*(?=\:(?:\s|$))"/> | ||
225 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="\-([^\s:#,\]][^:#,\]]*)?(?=:(\s|$))"/> | 225 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="\-(?:[^\s:#,\]][^:#,\]]*)?(?=\:(?:\s|$))"/> | ||
226 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="&keyDQ;(?=:(\s|$))"/> | 226 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="&keyDQ;(?=\:(?:\s|$))"/> | ||
227 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="&keySQ;(?=:(\s|$))"/> | 227 | <RegExpr attribute="Key" context="dpoints-list-attribute-pre-inline" String="&keySQ;(?=\:(?:\s|$))"/> | ||
228 | <RegExpr attribute="Key Points Operator" context="list-attribute-pre-inline" String=":(?=\s|$)" firstNonSpace="true" /> | 228 | <RegExpr attribute="Key Points Operator" context="list-attribute-pre-inline" String=":(?=\s|$)" firstNonSpace="true" /> | ||
229 | 229 | | |||
230 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 230 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
231 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | 231 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | ||
232 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | 232 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | ||
233 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | 233 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | ||
234 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | 234 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | ||
235 | 235 | | |||
236 | <DetectChar attribute="Operator" context="#pop!list" char="," /> | 236 | <DetectChar attribute="Operator" context="#pop!list" char="," /> | ||
237 | <IncludeRules context="values-list" /> | 237 | <IncludeRules context="values-list" /> | ||
238 | </context> | 238 | </context> | ||
239 | 239 | | |||
240 | <!-- Hash --> | 240 | <!-- Hash --> | ||
241 | <context attribute="Hash" lineEndContext="#stay" name="hash" fallthrough="true" fallthroughContext="#pop!hash-element" noIndentationBasedFolding="true"> | 241 | <context attribute="Hash" lineEndContext="#stay" name="hash" fallthrough="true" fallthroughContext="#pop!hash-element" noIndentationBasedFolding="true"> | ||
242 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 242 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
243 | <DetectSpaces /> | 243 | <DetectSpaces /> | ||
244 | <DetectChar attribute="Operator" context="#pop!hash-element" char="?" /> | 244 | <DetectChar attribute="Operator" context="#pop!hash-element" char="?" /> | ||
245 | </context> | 245 | </context> | ||
246 | <context attribute="Hash" lineEndContext="#stay" name="hash-element" noIndentationBasedFolding="true"> | 246 | <context attribute="Hash" lineEndContext="#stay" name="hash-element" noIndentationBasedFolding="true"> | ||
247 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 247 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
248 | <DetectSpaces/> | 248 | <DetectSpaces/> | ||
249 | 249 | | |||
250 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="[^\s"'#\-,\}\s][^:#,\}]*(?=:(\s|$))"/> | 250 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="[^\s"'#\-,\}\s][^:#,\}]*(?=\:(?:\s|$))"/> | ||
251 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="\-([^\s:#,\}][^:#,\}]*)?(?=:(\s|$))"/> | 251 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="\-(?:[^\s:#,\}][^:#,\}]*)?(?=\:(?:\s|$))"/> | ||
252 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="&keyDQ;(?=:(\s|$))"/> | 252 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="&keyDQ;(?=\:(?:\s|$))"/> | ||
253 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="&keySQ;(?=:(\s|$))"/> | 253 | <RegExpr attribute="Key" context="dpoints-hash-attribute-pre-inline" String="&keySQ;(?=\:(?:\s|$))"/> | ||
254 | <RegExpr attribute="Key Points Operator" context="hash-attribute-pre-inline" String=":(?=\s|$)"/> | 254 | <RegExpr attribute="Key Points Operator" context="hash-attribute-pre-inline" String=":(?=\s|$)"/> | ||
255 | 255 | | |||
256 | <DetectChar attribute="Operator" context="#pop" char="}" endRegion="Hash" /> | 256 | <DetectChar attribute="Operator" context="#pop" char="}" endRegion="Hash" /> | ||
257 | <DetectChar attribute="Operator" context="#pop!hash" char="," /> | 257 | <DetectChar attribute="Operator" context="#pop!hash" char="," /> | ||
258 | 258 | | |||
259 | <!-- This improves highlighting in keys with multiple lines --> | 259 | <!-- This improves highlighting in keys with multiple lines --> | ||
260 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 260 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
261 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | 261 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | ||
Show All 23 Lines | |||||
285 | 285 | | |||
286 | <context attribute="String" lineEndContext="#stay" name="attribute-stringx-inline" noIndentationBasedFolding="true"> | 286 | <context attribute="String" lineEndContext="#stay" name="attribute-stringx-inline" noIndentationBasedFolding="true"> | ||
287 | <DetectIdentifier /> | 287 | <DetectIdentifier /> | ||
288 | <IncludeRules context="escaped-char-doubleq" /> | 288 | <IncludeRules context="escaped-char-doubleq" /> | ||
289 | <DetectChar attribute="String" context="attribute-end-inline" char=""" endRegion="String" /> | 289 | <DetectChar attribute="String" context="attribute-end-inline" char=""" endRegion="String" /> | ||
290 | </context> | 290 | </context> | ||
291 | 291 | | |||
292 | <context attribute="Error" lineEndContext="#pop#pop#pop" name="attribute-end"> | 292 | <context attribute="Error" lineEndContext="#pop#pop#pop" name="attribute-end"> | ||
293 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 293 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
294 | <DetectSpaces attribute="Normal Text" context="#stay"/> | 294 | <DetectSpaces attribute="Normal Text" context="#stay"/> | ||
295 | </context> | 295 | </context> | ||
296 | 296 | | |||
297 | <context attribute="Error" lineEndContext="#pop#pop#pop" name="attribute-end-inline"> | 297 | <context attribute="Error" lineEndContext="#pop#pop#pop" name="attribute-end-inline"> | ||
298 | <RegExpr attribute="Comment" context="comment" String="(^|\s+)#" /> | 298 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s+)#" /> | ||
299 | <DetectSpaces attribute="Normal Text" context="#stay"/> | 299 | <DetectSpaces attribute="Normal Text" context="#stay"/> | ||
300 | <AnyChar attribute="String" context="#pop#pop#pop" lookAhead="true" String="}]"/> | 300 | <AnyChar attribute="String" context="#pop#pop#pop" lookAhead="true" String="}]"/> | ||
301 | <DetectChar attribute="Operator" context="#pop#pop#pop" lookAhead="true" char="," /> | 301 | <DetectChar attribute="Operator" context="#pop#pop#pop" lookAhead="true" char="," /> | ||
302 | </context> | 302 | </context> | ||
303 | 303 | | |||
304 | <context attribute="String" lineEndContext="#stay" name="string" noIndentationBasedFolding="true"> | 304 | <context attribute="String" lineEndContext="#stay" name="string" noIndentationBasedFolding="true"> | ||
305 | <DetectIdentifier /> | 305 | <DetectIdentifier /> | ||
306 | <IncludeRules context="escaped-char-singleq" /> | 306 | <IncludeRules context="escaped-char-singleq" /> | ||
307 | <DetectChar attribute="String" context="#pop" char="'" endRegion="String" /> | 307 | <DetectChar attribute="String" context="#pop" char="'" endRegion="String" /> | ||
308 | </context> | 308 | </context> | ||
309 | 309 | | |||
310 | <context attribute="String" lineEndContext="#stay" name="stringx" noIndentationBasedFolding="true"> | 310 | <context attribute="String" lineEndContext="#stay" name="stringx" noIndentationBasedFolding="true"> | ||
311 | <DetectIdentifier /> | 311 | <DetectIdentifier /> | ||
312 | <IncludeRules context="escaped-char-doubleq" /> | 312 | <IncludeRules context="escaped-char-doubleq" /> | ||
313 | <DetectChar attribute="String" context="#pop" char=""" endRegion="String" /> | 313 | <DetectChar attribute="String" context="#pop" char=""" endRegion="String" /> | ||
314 | </context> | 314 | </context> | ||
315 | 315 | | |||
316 | <context attribute="Normal Text" lineEndContext="#stay" name="escaped-char-doubleq"> | 316 | <context attribute="Normal Text" lineEndContext="#stay" name="escaped-char-doubleq"> | ||
317 | <RegExpr attribute="Escaped Character" context="#stay" String="\\([\s0abtnvfre"/\\N_Lp]|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})"/> | 317 | <RegExpr attribute="Escaped Character" context="#stay" String="\\(?:[\s0abtnvfre"/\\N_Lp]|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})"/> | ||
318 | </context> | 318 | </context> | ||
319 | 319 | | |||
320 | <context attribute="Normal Text" lineEndContext="#stay" name="escaped-char-singleq"> | 320 | <context attribute="Normal Text" lineEndContext="#stay" name="escaped-char-singleq"> | ||
321 | <Detect2Chars attribute="Escaped Character" context="#stay" char="'" char1="'" /> | 321 | <Detect2Chars attribute="Escaped Character" context="#stay" char="'" char1="'" /> | ||
322 | </context> | 322 | </context> | ||
323 | 323 | | |||
324 | <context attribute="Comment" lineEndContext="#pop" name="comment"> | 324 | <context attribute="Comment" lineEndContext="#pop" name="comment"> | ||
325 | <IncludeRules context="##Alerts" /> | 325 | <IncludeRules context="##Alerts" /> | ||
Show All 16 Lines | |||||
342 | <context attribute="Normal Text" lineEndContext="#stay" name="values-inline"> | 342 | <context attribute="Normal Text" lineEndContext="#stay" name="values-inline"> | ||
343 | <RegExpr attribute="Null" context="#stay" String="&null;(?=&endValueInline;|&endValue;)"/> | 343 | <RegExpr attribute="Null" context="#stay" String="&null;(?=&endValueInline;|&endValue;)"/> | ||
344 | <RegExpr attribute="Boolean" context="#stay" String="&bool;(?=&endValueInline;|&endValue;)"/> | 344 | <RegExpr attribute="Boolean" context="#stay" String="&bool;(?=&endValueInline;|&endValue;)"/> | ||
345 | <RegExpr attribute="Float" context="#stay" String="&allFloat;(?=&endValueInline;|&endValue;)"/> | 345 | <RegExpr attribute="Float" context="#stay" String="&allFloat;(?=&endValueInline;|&endValue;)"/> | ||
346 | <RegExpr attribute="Integer" context="#stay" String="&allInt;(?=&endValueInline;|&endValue;)"/> | 346 | <RegExpr attribute="Integer" context="#stay" String="&allInt;(?=&endValueInline;|&endValue;)"/> | ||
347 | </context> | 347 | </context> | ||
348 | 348 | | |||
349 | <context attribute="Normal Text" lineEndContext="#stay" name="values-list"> | 349 | <context attribute="Normal Text" lineEndContext="#stay" name="values-list"> | ||
350 | <RegExpr attribute="Null" context="#stay" String="(\s|^)&null;(?=&endValueInline;|&endValue;)"/> | 350 | <RegExpr attribute="Null" context="#stay" String="(?:\s|^)&null;(?=&endValueInline;|&endValue;)"/> | ||
351 | <RegExpr attribute="Boolean" context="#stay" String="(\s|^)&bool;(?=&endValueInline;|&endValue;)"/> | 351 | <RegExpr attribute="Boolean" context="#stay" String="(?:\s|^)&bool;(?=&endValueInline;|&endValue;)"/> | ||
352 | <RegExpr attribute="Float" context="#stay" String="(\s|^)&allFloat;(?=&endValueInline;|&endValue;)"/> | 352 | <RegExpr attribute="Float" context="#stay" String="(?:\s|^)&allFloat;(?=&endValueInline;|&endValue;)"/> | ||
353 | <RegExpr attribute="Integer" context="#stay" String="(\s|^)&allInt;(?=&endValueInline;|&endValue;)"/> | 353 | <RegExpr attribute="Integer" context="#stay" String="(?:\s|^)&allInt;(?=&endValueInline;|&endValue;)"/> | ||
354 | </context> | 354 | </context> | ||
355 | <!-- If the value is found immediately at the beginning of the list item --> | 355 | <!-- If the value is found immediately at the beginning of the list item --> | ||
356 | <context attribute="Normal Text" lineEndContext="#pop!list-element" name="find-values-list" fallthrough="true" fallthroughContext="#pop!list-element"> | 356 | <context attribute="Normal Text" lineEndContext="#pop!list-element" name="find-values-list" fallthrough="true" fallthroughContext="#pop!list-element"> | ||
357 | <RegExpr attribute="Null" context="#pop!list-element" String="&null;(?=&endValueInline;|&endValue;)"/> | 357 | <RegExpr attribute="Null" context="#pop!list-element" String="&null;(?=&endValueInline;|&endValue;)"/> | ||
358 | <RegExpr attribute="Boolean" context="#pop!list-element" String="&bool;(?=&endValueInline;|&endValue;)"/> | 358 | <RegExpr attribute="Boolean" context="#pop!list-element" String="&bool;(?=&endValueInline;|&endValue;)"/> | ||
359 | <RegExpr attribute="Float" context="#pop!list-element" String="&allFloat;(?=&endValueInline;|&endValue;)"/> | 359 | <RegExpr attribute="Float" context="#pop!list-element" String="&allFloat;(?=&endValueInline;|&endValue;)"/> | ||
360 | <RegExpr attribute="Integer" context="#pop!list-element" String="&allInt;(?=&endValueInline;|&endValue;)"/> | 360 | <RegExpr attribute="Integer" context="#pop!list-element" String="&allInt;(?=&endValueInline;|&endValue;)"/> | ||
361 | </context> | 361 | </context> | ||
362 | 362 | | |||
363 | <!-- Literal/Folded Style: http://yaml.org/spec/1.2/spec.html#id2795688 --> | 363 | <!-- Literal/Folded Style: http://yaml.org/spec/1.2/spec.html#id2795688 --> | ||
364 | 364 | | |||
365 | <context attribute="Normal Text" lineEndContext="#stay" name="find-literal-block"> | 365 | <context attribute="Normal Text" lineEndContext="#stay" name="find-literal-block"> | ||
366 | <!-- Do not allow indentation with tabs: --> | 366 | <!-- Do not allow indentation with tabs: --> | ||
367 | <RegExpr attribute="Alert" context="#stay" column="0" | 367 | <RegExpr attribute="Alert" context="#stay" column="0" | ||
368 | String="^&space;*\t+\s*(?=((&keyDQ;|&keySQ;|[^#])*[^#\w\|<>"'])?&literalOp;&endValue;)" /> | 368 | String="^&space;*\t+\s*(?=(?:(?:&keyDQ;|&keySQ;|[^#])*[^#\w\|<>"'])?&literalOp;&endValue;)" /> | ||
369 | 369 | | |||
370 | <!-- CASE 1: The literal/folded operator is the first character of a line. | 370 | <!-- CASE 1: The literal/folded operator is the first character of a line. | ||
371 | The text after a space is considered literal. | 371 | The text after a space is considered literal. | ||
372 | Ex: | 372 | Ex: | ||
373 | > | | 373 | > | | ||
374 | > ^Start the literal text | 374 | > ^Start the literal text | ||
375 | --> | 375 | --> | ||
376 | <RegExpr attribute="Literal/Folded Operator" context="literal-block-simple" column="0" | 376 | <RegExpr attribute="Literal/Folded Operator" context="literal-block-simple" column="0" | ||
Show All 39 Lines | 410 | <!-- CASE 4: Is there an operator "?" or "-" at the beginning of the line. | |||
416 | > ? - - | | 416 | > ? - - | | ||
417 | > ^Start the literal text | 417 | > ^Start the literal text | ||
418 | > - Key: | | 418 | > - Key: | | ||
419 | > ^Start the literal text | 419 | > ^Start the literal text | ||
420 | > ? - - - - Key: | | 420 | > ? - - - - Key: | | ||
421 | > ^Start the literal text | 421 | > ^Start the literal text | ||
422 | --> | 422 | --> | ||
423 | <RegExpr context="start-literal-block-withdash" lookAhead="true" column="0" | 423 | <RegExpr context="start-literal-block-withdash" lookAhead="true" column="0" | ||
424 | String="^&space;*(\?&space;*|\-&space;+){1,6}((&keyDQ;|&keySQ;|[^#\-\?\s]|\-[^\s#])((&keyDQ;|&keySQ;|[^#])*[^#\w\|<>"'])?)?&literalOp;&endValue;" /> | 424 | String="^&space;*(?:\?&space;*|\-&space;+){1,6}(?:(?:&keyDQ;|&keySQ;|[^#\-\?\s]|\-[^\s#])(?:(?:&keyDQ;|&keySQ;|[^#])*[^#\w\|<>"'])?)?&literalOp;&endValue;" /> | ||
425 | 425 | | |||
426 | <!-- CASE 5: Literal/folded operator after a data type or other content. | 426 | <!-- CASE 5: Literal/folded operator after a data type or other content. | ||
427 | Ex: | 427 | Ex: | ||
428 | > !!type | | 428 | > !!type | | ||
429 | > ^Start the literal text | 429 | > ^Start the literal text | ||
430 | > key1: | 430 | > key1: | ||
431 | > key2: | 431 | > key2: | ||
432 | > !!type | | 432 | > !!type | | ||
433 | > ^Start the literal text | 433 | > ^Start the literal text | ||
434 | --> | 434 | --> | ||
435 | <RegExpr context="start-literal-block-other" lookAhead="true" column="0" | 435 | <RegExpr context="start-literal-block-other" lookAhead="true" column="0" | ||
436 | String="^&space;*(([&\*]|!!)\S+\s+)+&literalOp;&endValue;" /> | 436 | String="^&space;*(?:(?:[&\*]|!!)\S+\s+)+&literalOp;&endValue;" /> | ||
437 | </context> | 437 | </context> | ||
438 | 438 | | |||
439 | <!-- If the line with the literal operator starts with the "-" or "?" operator. | 439 | <!-- If the line with the literal operator starts with the "-" or "?" operator. | ||
440 | NOTE: The indentation capture is limited to 6 nested operators. --> | 440 | NOTE: The indentation capture is limited to 6 nested operators. --> | ||
441 | <context attribute="Normal Text" lineEndContext="#pop" name="start-literal-block-withdash" noIndentationBasedFolding="true"> | 441 | <context attribute="Normal Text" lineEndContext="#pop" name="start-literal-block-withdash" noIndentationBasedFolding="true"> | ||
442 | <!-- With Key: Capture the Key indentation --> | 442 | <!-- With Key: Capture the Key indentation --> | ||
443 | <RegExpr attribute="Operator" context="#pop!literal-block-key-withdash-s2" String="^(&space;*)[\?\-](&space;*)(?=&keyAfterOp;:\s)" column="0"/> | 443 | <RegExpr attribute="Operator" context="#pop!literal-block-key-withdash-s2" String="^(&space;*)[\?\-](&space;*)(?=&keyAfterOp;:\s)" column="0"/> | ||
444 | <RegExpr attribute="Operator" context="#pop!literal-block-key-withdash-s3" String="^(&space;*)[\?\-](&space;*)[\?\-](&space;*)(?=&keyAfterOp;:\s)" column="0"/> | 444 | <RegExpr attribute="Operator" context="#pop!literal-block-key-withdash-s3" String="^(&space;*)[\?\-](&space;*)[\?\-](&space;*)(?=&keyAfterOp;:\s)" column="0"/> | ||
Show All 21 Lines | 458 | <context attribute="Normal Text" lineEndContext="#pop" name="start-literal-block-other" noIndentationBasedFolding="true"> | |||
466 | <RegExpr attribute="Reference" context="#pop!literal-block-withdash-s1" String="^()&reference;" column="0" /> | 466 | <RegExpr attribute="Reference" context="#pop!literal-block-withdash-s1" String="^()&reference;" column="0" /> | ||
467 | </context> | 467 | </context> | ||
468 | 468 | | |||
469 | <!-- Highlight data/attribute before the literal operator (Note that if there is a line | 469 | <!-- Highlight data/attribute before the literal operator (Note that if there is a line | ||
470 | break within a string or bracket, the literal line will not be highlighted). --> | 470 | break within a string or bracket, the literal line will not be highlighted). --> | ||
471 | <context attribute="Attribute" lineEndContext="#pop#pop" name="before-literal-operator" noIndentationBasedFolding="true"> | 471 | <context attribute="Attribute" lineEndContext="#pop#pop" name="before-literal-operator" noIndentationBasedFolding="true"> | ||
472 | <RegExpr attribute="Literal/Folded Operator" context="#pop!end-literal-operator" String="&literalOp;(?=&endValue;)" beginRegion="Literal" /> | 472 | <RegExpr attribute="Literal/Folded Operator" context="#pop!end-literal-operator" String="&literalOp;(?=&endValue;)" beginRegion="Literal" /> | ||
473 | 473 | | |||
474 | <RegExpr attribute="Error" context="#pop#pop" String="([&\*]|!!)\S*&literalOp;(?=&endValue;)" /> | 474 | <RegExpr attribute="Error" context="#pop#pop" String="(?:[&\*]|!!)\S*&literalOp;(?=&endValue;)" /> | ||
475 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | 475 | <RegExpr attribute="Data Types" context="#stay" String="&dataTypes;" /> | ||
476 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | 476 | <RegExpr attribute="Alias" context="#stay" String="&alias;" /> | ||
477 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | 477 | <RegExpr attribute="Reference" context="#stay" String="&reference;" /> | ||
478 | 478 | | |||
479 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | 479 | <DetectChar attribute="Operator" context="list" char="[" beginRegion="List" /> | ||
480 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | 480 | <DetectChar attribute="Operator" context="hash" char="{" beginRegion="Hash" /> | ||
481 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | 481 | <DetectChar attribute="String" context="string" char="'" beginRegion="String" /> | ||
482 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | 482 | <DetectChar attribute="String" context="stringx" char=""" beginRegion="String" /> | ||
483 | </context> | 483 | </context> | ||
484 | 484 | | |||
485 | <context attribute="Normal Text" lineEndContext="#pop#pop" name="dpoints-key-before-literal-operator" fallthrough="true" fallthroughContext="#pop#pop" noIndentationBasedFolding="true"> | 485 | <context attribute="Normal Text" lineEndContext="#pop#pop" name="dpoints-key-before-literal-operator" fallthrough="true" fallthroughContext="#pop#pop" noIndentationBasedFolding="true"> | ||
486 | <DetectChar attribute="Key Points Operator" context="#pop!key-before-literal-operator" char=":" /> | 486 | <DetectChar attribute="Key Points Operator" context="#pop!key-before-literal-operator" char=":" /> | ||
487 | </context> | 487 | </context> | ||
488 | <context attribute="Attribute" lineEndContext="#pop#pop" name="key-before-literal-operator" noIndentationBasedFolding="true"> | 488 | <context attribute="Attribute" lineEndContext="#pop#pop" name="key-before-literal-operator" noIndentationBasedFolding="true"> | ||
489 | <IncludeRules context="before-literal-operator" /> | 489 | <IncludeRules context="before-literal-operator" /> | ||
490 | <DetectChar attribute="Operator" context="#stay" char="?" /> | 490 | <DetectChar attribute="Operator" context="#stay" char="?" /> | ||
491 | </context> | 491 | </context> | ||
492 | <context attribute="Attribute" lineEndContext="#pop" name="end-literal-operator" noIndentationBasedFolding="true"> | 492 | <context attribute="Attribute" lineEndContext="#pop" name="end-literal-operator" noIndentationBasedFolding="true"> | ||
493 | <RegExpr attribute="Comment" context="#pop!comment" String="(^|\s+)#" /> | 493 | <RegExpr attribute="Comment" context="#pop!comment" String="(?:^|\s+)#" /> | ||
494 | </context> | 494 | </context> | ||
495 | 495 | | |||
496 | <!-- Common rules for the content of the literal blocks --> | 496 | <!-- Common rules for the content of the literal blocks --> | ||
497 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-default" noIndentationBasedFolding="true"> | 497 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-default" noIndentationBasedFolding="true"> | ||
498 | <!-- End literal/folded block --> | 498 | <!-- End literal/folded block --> | ||
499 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | 499 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | ||
500 | <!-- Find literal/folded operator --> | 500 | <!-- Find literal/folded operator --> | ||
501 | <RegExpr context="before-literal-operator" String="\S" lookAhead="true" /> | 501 | <RegExpr context="before-literal-operator" String="\S" lookAhead="true" /> | ||
502 | </context> | 502 | </context> | ||
503 | <context attribute="Normal Text" lineEndContext="#pop" name="literal-block-key-default" noIndentationBasedFolding="true"> | 503 | <context attribute="Normal Text" lineEndContext="#pop" name="literal-block-key-default" noIndentationBasedFolding="true"> | ||
504 | <!-- End literal/folded block --> | 504 | <!-- End literal/folded block --> | ||
505 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | 505 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | ||
506 | <!-- Detect Key before the literal/folded operator --> | 506 | <!-- Detect Key before the literal/folded operator --> | ||
507 | <RegExpr attribute="Key" context="dpoints-key-before-literal-operator" String="&keyAfterOp;(?=:\s)" /> | 507 | <RegExpr attribute="Key" context="dpoints-key-before-literal-operator" String="&keyAfterOp;(?=:\s)" /> | ||
508 | <RegExpr attribute="Normal Text" context="#pop" String="\S" lookAhead="true" endRegion="Literal" /> | 508 | <RegExpr attribute="Normal Text" context="#pop" String="\S" lookAhead="true" endRegion="Literal" /> | ||
509 | </context> | 509 | </context> | ||
510 | 510 | | |||
511 | <!-- Content of the literal block: --> | 511 | <!-- Content of the literal block: --> | ||
512 | 512 | | |||
513 | <!-- If the literal operator is starting the line (after a space, use block indentation) --> | 513 | <!-- If the literal operator is starting the line (after a space, use block indentation) --> | ||
514 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-only-operator" dynamic="true" noIndentationBasedFolding="true"> | 514 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-only-operator" dynamic="true" noIndentationBasedFolding="true"> | ||
515 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^%1.*$" dynamic="true" column="0" /> | 515 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^%1.*$" dynamic="true" column="0" /> | ||
516 | 516 | | |||
517 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | 517 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | ||
518 | <RegExpr attribute="Comment" context="comment" String="(^|\s)#" /> | 518 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s)#" /> | ||
519 | <RegExpr context="#pop" String="\S" lookAhead="true" endRegion="Literal" /> | 519 | <RegExpr context="#pop" String="\S" lookAhead="true" endRegion="Literal" /> | ||
520 | </context> | 520 | </context> | ||
521 | <!-- If the literal operator is the first character of a line (or after header) --> | 521 | <!-- If the literal operator is the first character of a line (or after header) --> | ||
522 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-simple" noIndentationBasedFolding="true"> | 522 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-simple" noIndentationBasedFolding="true"> | ||
523 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^\s.*$" column="0" /> | 523 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^\s.*$" column="0" /> | ||
524 | 524 | | |||
525 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | 525 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | ||
526 | <RegExpr attribute="Comment" context="comment" String="(^|\s)#" /> | 526 | <RegExpr attribute="Comment" context="comment" String="(?:^|\s)#" /> | ||
527 | </context> | 527 | </context> | ||
528 | <!-- If there is a data type or other content before the liretal operator (use block indentation) --> | 528 | <!-- If there is a data type or other content before the liretal operator (use block indentation) --> | ||
529 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-after-data" dynamic="true" noIndentationBasedFolding="true"> | 529 | <context attribute="Normal Text" lineEndContext="#stay" name="literal-block-after-data" dynamic="true" noIndentationBasedFolding="true"> | ||
530 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^%1.*$" dynamic="true" column="0" /> | 530 | <RegExpr attribute="Literal/Folded Block" context="#stay" String="^%1.*$" dynamic="true" column="0" /> | ||
531 | 531 | | |||
532 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | 532 | <RegExpr attribute="Normal Text" context="#pop" String="^\s*\S" lookAhead="true" column="0" endRegion="Literal" /> | ||
533 | <RegExpr context="before-literal-operator" String="\S" lookAhead="true" /> | 533 | <RegExpr context="before-literal-operator" String="\S" lookAhead="true" /> | ||
534 | </context> | 534 | </context> | ||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |