1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE language SYSTEM "language.dtd">
3
<language name="sed" section="Scripts" version="1.0" kateversion="2.4" extensions="*.sed" mimetype="text/x-sed" author="Bart Sas (bart.sas@gmail.com)" license="GPL">
6
<context name="BeginningOfLine" attribute="Normal" lineEndContext="#stay">
8
<DetectChar char="#" attribute="Comment" context="Comment"/>
9
<RegExpr String="(/)" attribute="Separator" context="FirstAddressRegex"/>
10
<RegExpr String="\\(\S)" attribute="Separator" context="FirstAddressRegex"/>
11
<Int attribute="Line Number" context="AfterFirstAddress"/>
12
<DetectChar char="$" attribute="Last Line" context="AfterFirstAddress"/>
13
<DetectChar char="}" attribute="Brace" context="AfterCommand"/>
14
<DetectChar char=":" attribute="Label" context="Label"/>
15
<DetectChar char="!" attribute="Negation" context="Command"/>
16
<IncludeRules context="Command"/>
17
<RegExpr String="\S" attribute="Error" context="Error"/>
20
<context name="FirstAddressRegex" attribute="Regex" lineEndContext="Error" dynamic="true">
22
<RegExpr String="\\%1" attribute="Regex Escape" context="#stay" dynamic="true"/>
23
<RegExpr String="%1" attribute="Separator" context="AfterFirstAddress" dynamic="true"/>
24
<IncludeRules context="Regex"/>
27
<context name="AfterFirstAddress" attribute="Normal" lineEndContext="BeginningOfLine">
29
<DetectChar char="!" attribute="Negation" context="Command"/>
30
<IncludeRules context="AfterFirstAddress2"/>
31
<RegExpr String="\S" attribute="Error" context="Error"/>
34
<context name="AfterFirstAddress2" attribute="Normal" lineEndContext="BeginningOfLine">
36
<DetectChar char="," attribute="Normal" context="SecondAddress"/>
37
<DetectChar char="~" attribute="Normal" context="Step"/>
38
<IncludeRules context="Command"/>
39
<RegExpr String="\S" attribute="Error" context="Error"/>
42
<context name="SecondAddress" attribute="Normal" lineEndContext="Error">
44
<RegExpr String="(/)" attribute="Separator" context="SecondAddressRegex"/>
45
<RegExpr String="\\(\S)" attribute="Separator" context="SecondAddressRegex"/>
46
<Int attribute="Line Number" context="AfterSecondAddress"/>
47
<DetectChar char="$" attribute="Last Line" context="AfterSecondAddress"/>
48
<RegExpr String="\S" attribute="Error" context="Error"/>
51
<context name="SecondAddressRegex" attribute="Regex" lineEndContext="Error" dynamic="true">
53
<RegExpr String="\\%1" attribute="Regex Escape" context="#stay" dynamic="true"/>
54
<RegExpr String="%1" attribute="Separator" context="AfterSecondAddress" dynamic="true"/>
55
<IncludeRules context="Regex"/>
58
<context name="AfterSecondAddress" attribute="Normal" lineEndContext="Error" dynamic="true">
60
<DetectChar char="!" attribute="Negation" context="Command"/>
61
<IncludeRules context="Command"/>
62
<RegExpr String="\S" attribute="Error" context="Error"/>
65
<context name="Step" attribute="Normal" lineEndContext="Error">
67
<Int attribute="Step" context="Command"/>
68
<RegExpr String="\S" attribute="Error" context="Error"/>
71
<context name="Command" attribute="Normal" lineEndContext="Error">
73
<DetectChar char="s" attribute="Command" context="SCommand"/>
74
<DetectChar char="y" attribute="Command" context="YCommand"/>
75
<AnyChar String="dpnDNPhHgGxFvz=" attribute="Command" context="AfterCommand"/>
76
<AnyChar String="aic" attribute="Command" context="AICCommand"/>
77
<AnyChar String="bTt" attribute="Command" context="BTCommand"/>
78
<AnyChar String="WwrR" attribute="Command" context="WRCommand"/>
79
<AnyChar String="lL" attribute="Command" context="LCommand"/>
80
<AnyChar String="qQ" attribute="Command" context="QCommand"/>
81
<DetectChar char="{" attribute="Brace" context="BeginningOfLine"/>
82
<RegExpr String="\S" attribute="Error" context="Error"/>
85
<context name="SCommand" attribute="Normal" lineEndContext="Error">
87
<RegExpr String="(\S)" attribute="Separator" context="SRegex"/>
90
<context name="SRegex" attribute="Regex" lineEndContext="Error" dynamic="true">
92
<RegExpr String="\\%1" attribute="Regex Escape" context="#stay" dynamic="true"/>
93
<RegExpr String="(%1)" attribute="Separator" context="SReplacement" dynamic="true"/>
94
<IncludeRules context="Regex"/>
97
<context name="SReplacement" attribute="Replacement" lineEndContext="Error" dynamic="true">
99
<RegExpr String="\\%1" attribute="Repl Escape" context="#stay" dynamic="true"/>
100
<RegExpr String="%1" attribute="Separator" context="SFlags" dynamic="true"/>
101
<RegExpr String="\\[0-9LlUuE\\&]" attribute="Repl Escape" context="#stay"/>
102
<DetectChar char="&" attribute="Repl Escape" context="#stay"/>
105
<context name="SFlags" attribute="Normal" lineEndContext="BeginningOfLine">
107
<AnyChar String="gpeIiMm" attribute="Flag" context="#stay"/>
108
<DetectChar char="w" attribute="Flag" context="WFlag"/>
109
<Int attribute="Repl Number" context="#stay"/>
110
<IncludeRules context="AfterCommand"/>
113
<context name="WFlag" attribute="Normal" lineEndContext="BeginningOfLine">
115
<RegExpr String="\S+" attribute="Filename" context="SFlags"/>
118
<context name="YCommand" attribute="Normal" lineEndContext="Error">
120
<RegExpr String="(\S)" attribute="Separator" context="YSourceList"/>
123
<context name="YSourceList" attribute="Char List" lineEndContext="Error" dynamic="true">
125
<RegExpr String="\\%1" attribute="Char List Escape" context="#stay" dynamic="true"/>
126
<RegExpr String="(%1)" attribute="Separator" context="YDestList" dynamic="true"/>
127
<Detect2Chars char="\" char1="n" attribute="Char List Escape" context="#stay"/>
128
<Detect2Chars char="\" char1="\" attribute="Char List Escape" context="#stay"/>
131
<context name="YDestList" attribute="Char List" lineEndContext="Error" dynamic="true">
133
<RegExpr String="\\%1" attribute="Char List Escape" context="#stay" dynamic="true"/>
134
<RegExpr String="%1" attribute="Separator" context="AfterCommand" dynamic="true"/>
135
<Detect2Chars char="\" char1="n" attribute="Char List Escape" context="#stay"/>
136
<Detect2Chars char="\" char1="\" attribute="Char List Escape" context="#stay"/>
139
<context name="AICCommand" attribute="Normal" lineEndContext="Error">
141
<LineContinue attribute="Line Continue" context="LiteralText"/>
142
<RegExpr String="\S" attribute="Error" context="Error"/>
145
<context name="LiteralText" attribute="Literal Text" lineEndContext="BeginningOfLine">
146
<Detect2Chars char="\" char1="\" attribute="Literal Escape" context="LiteralText"/>
147
<LineContinue attribute="Line Continue" context="LiteralText"/>
148
<DetectChar char="\" attribute="Error" context="Error"/>
151
<context name="BTCommand" attribute="Normal" lineEndContext="BeginningOfLine">
153
<RegExpr String="\w+" attribute="Label" context="AfterCommand"/>
154
<IncludeRules context="AfterCommand"/>
157
<context name="WRCommand" attribute="Normal" lineEndContext="Error">
159
<RegExpr String="\S+" attribute="Filename" context="AfterCommand"/>
162
<context name="LCommand" attribute="Normal" lineEndContext="BeginningOfLine">
164
<Int attribute="Wrap Length" context="AfterCommand"/>
165
<IncludeRules context="AfterCommand"/>
168
<context name="QCommand" attribute="Normal" lineEndContext="BeginningOfLine">
170
<Int attribute="Exit Code" context="AfterCommand"/>
171
<IncludeRules context="AfterCommand"/>
174
<context name="Label" attribute="Normal" lineEndContext="Error">
176
<RegExpr String="\w+" attribute="Label" context="AfterCommand"/>
177
<RegExpr String="\S" attribute="Error" context="Error"/>
180
<context name="AfterCommand" attribute="Normal" lineEndContext="BeginningOfLine">
182
<DetectChar char=";" attribute="Normal" context="BeginningOfLine"/>
183
<DetectChar char="}" attribute="Brace" context="AfterCommand"/>
184
<DetectChar char="#" attribute="Comment" context="Comment"/>
185
<RegExpr String="\S" attribute="Error" context="Error"/>
188
<context name="Regex" attribute="Regex" lineEndContext="Error">
189
<Detect2Chars char="\" char1="(" attribute="Regex Escape" context="#stay"/>
190
<Detect2Chars char="\" char1=")" attribute="Regex Escape" context="#stay"/>
191
<Detect2Chars char="\" char1="+" attribute="Regex Escape" context="#stay"/>
192
<Detect2Chars char="\" char1="?" attribute="Regex Escape" context="#stay"/>
193
<Detect2Chars char="\" char1="|" attribute="Regex Escape" context="#stay"/>
194
<Detect2Chars char="\" char1="{" attribute="Regex Escape" context="#stay"/>
195
<Detect2Chars char="\" char1="}" attribute="Regex Escape" context="#stay"/>
196
<Detect2Chars char="\" char1="[" attribute="Regex Escape" context="#stay"/>
197
<Detect2Chars char="\" char1="]" attribute="Regex Escape" context="#stay"/>
198
<Detect2Chars char="\" char1="." attribute="Regex Escape" context="#stay"/>
199
<Detect2Chars char="\" char1="*" attribute="Regex Escape" context="#stay"/>
200
<Detect2Chars char="\" char1="\" attribute="Regex Escape" context="#stay"/>
201
<Detect2Chars char="\" char1="^" attribute="Regex Escape" context="#stay"/>
202
<Detect2Chars char="\" char1="$" attribute="Regex Escape" context="#stay"/>
203
<Detect2Chars char="\" char1="n" attribute="Regex Escape" context="#stay"/>
204
<Detect2Chars char="\" char1="t" attribute="Regex Escape" context="#stay"/>
205
<Detect2Chars char="\" char1="0" attribute="Regex Escape" context="#stay"/>
206
<Detect2Chars char="\" char1="1" attribute="Regex Escape" context="#stay"/>
207
<Detect2Chars char="\" char1="2" attribute="Regex Escape" context="#stay"/>
208
<Detect2Chars char="\" char1="3" attribute="Regex Escape" context="#stay"/>
209
<Detect2Chars char="\" char1="4" attribute="Regex Escape" context="#stay"/>
210
<Detect2Chars char="\" char1="5" attribute="Regex Escape" context="#stay"/>
211
<Detect2Chars char="\" char1="6" attribute="Regex Escape" context="#stay"/>
212
<Detect2Chars char="\" char1="7" attribute="Regex Escape" context="#stay"/>
213
<Detect2Chars char="\" char1="8" attribute="Regex Escape" context="#stay"/>
214
<Detect2Chars char="\" char1="9" attribute="Regex Escape" context="#stay"/>
215
<DetectChar char="*" attribute="Regex Escape" context="#stay"/>
216
<DetectChar char="." attribute="Regex Escape" context="#stay"/>
217
<DetectChar char="^" attribute="Regex Escape" context="#stay"/>
218
<DetectChar char="$" attribute="Regex Escape" context="#stay"/>
219
<DetectChar char="[" attribute="Regex Escape" context="#stay"/>
220
<DetectChar char="]" attribute="Regex Escape" context="#stay"/>
223
<context name="Comment" attribute="Comment" lineEndContext="BeginningOfLine"/>
224
<context name="Error" attribute="Error" lineEndContext="BeginningOfLine"/>
228
<itemData name="Normal" defStyleNum="dsNormal"/>
230
<itemData name="Regex" defStyleNum="dsString"/>
231
<itemData name="Regex Escape" defStyleNum="dsChar"/>
232
<itemData name="Replacement" defStyleNum="dsString"/>
233
<itemData name="Repl Escape" defStyleNum="dsChar"/>
234
<itemData name="Char List" defStyleNum="dsString"/>
235
<itemData name="Char List Escape" defStyleNum="dsChar"/>
236
<itemData name="Separator" defStyleNum="dsString" color="#00F"/>
238
<itemData name="Line Number" defStyleNum="dsDecVal"/>
239
<itemData name="Step" defStyleNum="dsDecVal"/>
240
<itemData name="Last Line" defStyleNum="dsOthers" color="#808" bold="1"/>
241
<itemData name="Negation" defStyleNum="dsOthers" color="#808" bold="1"/>
243
<itemData name="Command" defStyleNum="dsKeyword"/>
244
<itemData name="Label" defStyleNum="dsFunction"/>
245
<itemData name="Brace" defStyleNum="dsNormal"/>
247
<itemData name="Flag" defStyleNum="dsDataType"/>
248
<itemData name="Repl Number" defStyleNum="dsDecVal"/>
249
<itemData name="Exit Code" defStyleNum="dsDecVal"/>
250
<itemData name="Filename" defStyleNum="dsBaseN"/>
251
<itemData name="Wrap Length" defStyleNum="dsDecVal"/>
253
<itemData name="Line Continue" defStyleNum="dsOthers" color="#000" bold="1"/>
254
<itemData name="Literal Text" defStyleNum="dsOthers" color="#080" italic="1"/>
255
<itemData name="Literal Escape" defStyleNum="dsOthers" color="#0A0" italic="1"/>
257
<itemData name="Comment" defStyleNum="dsComment"/>
258
<itemData name="Error" defStyleNum="dsError"/>
264
<comment name="singleLine" start="#"/>