forked from cmur2/joe-syntax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ant.jsf
301 lines (223 loc) · 5.09 KB
/
ant.jsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# JOE syntax highlight file for Ant's build scripts
# http://ant.apache.org/
# using the XML highlighter with better colors since
# ant scripts heavily rely on the tags (blue is a bad color here)
# instead of their contents
# Improved XML highlighter by: Brian Candler <[email protected]>
=Idle
=Bad red bold
=Tag bold
=Attr
=Constant cyan
=Escape bold cyan
=EntityRef magenta
=Decl cyan
=CommentStart green
=CommentBody green
=CommentEnd green
=PIStart yellow bold
=PIBody yellow
=PIEnd yellow bold
=CdataStart blue bold
=CdataBody bold
=CdataEnd blue bold
=Keytag bold magenta #fg_310 # brown
# http://www.w3.org/TR/2004/REC-xml-20040204/
#
# NOTE: For UNICODE compatibility, the ranges
# "A-Za-z_:" -- first character of Name
# "A-Za-z0-9._:-" -- subsequent characters of Name
# ought to be replaced with some appropriate Unicode character classes
:content Idle
* content
"<" tag recolor=-1
"&" entityref recolor=-1
# > is allowed
# ">" error noeat recolor=-1
# In several contexts a space is an error, and since a coloured space is
# not visible, we colour the next non-space character as well.
:error Bad
* error_visible noeat recolor=-1
" \t\r\n" error
:error_visible Bad
* content
# Matched: &
:entityref EntityRef
* error noeat recolor=-1
"A-Za-z0-9._:-" entityref
"#" entityref
";" content
# Matched: <
:tag Tag
* error noeat recolor=-1
"/" end_tag
"A-Za-z_:" start_or_empty_tag buffer
"?" pi_start recolor=-2
"!" decl recolor=-2 buffer
# Matched: </
:end_tag Tag
* error noeat recolor=-1
"A-Za-z_:" end_tag2
:end_tag2 Tag
* error noeat recolor=-1
"A-Za-z0-9._:-" end_tag2
" \t\r\n" end_tag2_sp recolor=-1
">" content
:end_tag2_sp Idle
* end_tag3 noeat
:end_tag3 Tag
* error noeat recolor=-1
" \t\r\n" end_tag3_sp recolor=-1
">" content
:end_tag3_sp Idle
* end_tag_3 noeat
# Matched: <tag
# compare tag name of start/empty tags with a list
# of Ant specific keywords
:start_or_empty_tag Tag
* decide_tag_type noeat strings
"target" kw
done
"A-Za-z0-9._:-" start_or_empty_tag
:kw Keytag
* decide_tag_type noeat
:decide_tag_type Tag
* error noeat recolor=-1
"/" empty_tag
" \t\r\n" start_or_empty_tag_sp
">" content
:start_or_empty_tag_sp Idle
* tag_space noeat
# Matched: <tag/
:empty_tag Tag
* error noeat recolor=-1
">" content
# Matched: <tag SPACE
:tag_space Attr
* error noeat recolor=-1
" \t\r\n" tag_space_sp recolor=-1
"A-Za-z_:" attr
"/" empty_tag recolor=-1
">" close_tag recolor=-1
:tag_space_sp Idle
* tag_space noeat
# Matched: <tag attr
:attr Attr
* error noeat recolor=-1
"A-Za-z0-9._:-" attr
" \t\r\n" attr_sp recolor=-1
"=" string
:attr_sp Idle
* attr_before noeat
:attr_before Attr
* error noeat recolor=-1
" \t\r\n" attr_sp recolor=-1
"=" string
# Matched: <tag attr=
:string Attr
* error noeat recolor=-1
" \t\r\n" string_sp recolor=-1
"\"" string_dq recolor=-1
"'" string_sq recolor=-1
:string_sp Idle
* string noeat
# Matched: <tag attr="
:string_dq Constant
* string_dq
"<" error noeat recolor=-1
"&" char_dq recolor=-1
"\"" endstring
"$" string_dq call=.antvar()
# ">" error noeat recolor=-1
:string_sq Constant
* string_sq
"<" error noeat recolor=-1
"&" char_sq recolor=-1
"'" endstring
"$" string_sq call=.maybe_antvar()
# ">" error noeat recolor=-1
:char_dq EntityRef
* error noeat recolor=-1
"A-Za-z0-9._:-" char_dq
"#" char_dq
";" string_dq
:char_sq EntityRef
* error noeat recolor=-1
"A-Za-z0-9._:-" char_sq
"#" char_sq
";" string_sq
.subr maybe_antvar
# initial state
:maybe_antvar Constant
* NULL return
"{" antvar recolor=-2
:antvar Escape
* antvar
"}" NULL return
.end
# Matched: <tag attr="foo"
:endstring Attr
* error noeat recolor=-1
" \t\r\n" tag_space_sp
"/" empty_tag recolor=-1
">" close_tag recolor=-1
# This state is just to recolor the final ">" at the end of <tag attr="val">
:close_tag Tag
* content noeat
# Matched: <?
:pi_start PIStart
* pi noeat recolor=-1
:pi PIBody
* pi
"?" pi2
:pi2 PIBody
* pi
">" pi_end recolor=-2
:pi_end PIEnd
* content noeat recolor=-1
# Matched: <!
:decl Decl
* decl strings
"!--" comment_start recolor=-5
"![CDATA[" cdata_start recolor=-10
done
"<" decl_nest
">" content
# We allow one level of <...> nesting within declarations
:decl_nest Decl
* decl_nest
">" decl
# Matched: <!--
:comment_start CommentStart
* comment noeat
:comment CommentBody
* comment
"-" comment2
:comment2 CommentBody
* comment
"-" comment3
:comment3 CommentBody
* comment_error noeat recolor=-3
">" comment_end recolor=-3
:comment_end CommentEnd
* content noeat recolor=-1
# For compatibility, the string "--" (double-hyphen) MUST NOT occur within
# comments. [http://www.w3.org/TR/REC-xml/ section 2.5]
:comment_error Bad
* comment
"-" comment_error
">" comment_end recolor=-3
# Matched: <![CDATA[
:cdata_start CdataStart
* cdata noeat
:cdata CdataBody
* cdata
"]" cdata2
:cdata2 CdataBody
* cdata
"]" cdata3
:cdata3 CdataBody
* cdata
">" cdata_end recolor=-3
:cdata_end CdataEnd
* content noeat recolor=-1