Diff of /syntax/perl.jsf.in [000000] .. [409b67]  Maximize  Restore

Switch to unified view

a b/syntax/perl.jsf.in
1
# JOE syntax highlight file for Perl
2
3
# Define colors
4
5
=Idle
6
=Preproc blue
7
=Comment green
8
=POD green
9
=Constant cyan
10
=Escape bold cyan
11
=Type bold
12
=Keyword bold
13
=Bad bold red
14
=Var yellow
15
16
17
:begin Idle
18
  *       begin noeat call=.perl()
19
20
#
21
# Perl as a subroutine for Mason
22
#
23
24
.subr perl
25
26
# Detect pod
27
28
:idle Idle
29
  *       idle1       noeat
30
.ifdef mason_line
31
  "\n"        idle return
32
.else
33
  "\n"        idle
34
.endif
35
  "="     pod_start
36
37
# allow keywords
38
39
:idle1 Idle
40
  *       idle1
41
  "#"     line_comment_i  recolor=-1
42
  "\n"        idle noeat
43
  "0"     first_digit recolor=-1
44
  "1-9"       decimal recolor=-1
45
  "."     maybe_float
46
  "\""        string      recolor=-1
47
  "'"     char        recolor=-1
48
  "`"     backtick    recolor=-1
49
  "<"     maybe_inc
50
  "$"     not_string  buffer
51
.ifdef mason_block
52
  "&%"        perl_maybe_done buffer
53
  "-a-zA-Z_@" ident       buffer
54
.else
55
  "/"     regex       recolor=-1
56
  "-a-zA-Z_@%&"   ident       buffer
57
.endif
58
59
:perl_maybe_done Idle
60
  *       ident noeat
61
  ">"     idle1   recolor=-2 return
62
63
# prevent keywords
64
65
:rest Idle
66
  *       rest
67
  "({;~"      idle1
68
  "#"     line_comment    recolor=-1
69
  "\n"        idle noeat
70
  "0"     first_digit recolor=-1
71
  "1-9"       decimal recolor=-1
72
  "."     maybe_float
73
  "\""        string      recolor=-1
74
  "'"     char        recolor=-1
75
  "`"     backtick    recolor=-1
76
  "$"     not_string  buffer
77
  "<"     maybe_inc
78
.ifdef mason_block
79
  "&%"        perl_maybe_done buffer
80
  "a-zA-Z_@"  maybe_string    buffer
81
.else
82
  "a-zA-Z_@%&"    maybe_string    buffer
83
.endif
84
85
:pod_start Idle
86
  *       pod_start
87
  "\n"        pod_block
88
89
:pod_block POD
90
  *       pod_block
91
  "="     pod_ident   buffer
92
93
:pod_ident POD
94
  *       pod_block   noeat strings
95
  "=cut"      rest
96
done
97
  "a-zA-Z0-9_"    pod_ident
98
99
:maybe_inc Idle
100
  *       rest        noeat
101
.ifdef mason_block
102
  "/"     perl_maybe_done_2
103
.endif
104
  "<"     maybe_inc1
105
106
:perl_maybe_done_2 Idle
107
  *       perl_idle   noeat
108
  "a-z"       perl_maybe_done_2
109
  ">"     idle
110
111
112
:maybe_inc1 Idle
113
  *       rest        noeat
114
  "   "   maybe_inc1
115
  "'\""       quoted_inc_start    save_c recolor=-1
116
  "A-Za-z_"   inc     buffer noeat
117
118
:quoted_inc_start Var
119
  *       quoted_inc  buffer
120
121
:quoted_inc Var
122
  *       quoted_inc
123
  &       skipline    save_s
124
125
:inc Var
126
  *       skipline    save_s noeat
127
  "A-Za-z0-9_"    inc
128
129
# Should be treated as a normal line here...
130
131
:skipline Idle
132
  *       skipline
133
  "\n"        next_line
134
135
:todelim Constant
136
  *       todelim
137
  "\n"        next_line   strings
138
  "&"     founddelim
139
done
140
141
# eat \n so it's not in string.
142
:next_line Constant
143
  *       todelim     buffer
144
  "\n"        next_line
145
146
:founddelim Var
147
  *       idle        noeat
148
149
:regex Constant
150
  *       regex
151
  "\\"        regex_quote recolor=-1
152
  "/"     rest
153
154
:regex_quote Escape
155
  *       regex
156
157
:not_string Idle
158
  *       rest noeat
159
  "A-Za-z_"   ident
160
  "\"'`#"     rest
161
162
:line_comment Comment
163
  *       line_comment
164
  "\n"        rest
165
166
:line_comment_i Comment
167
  *       line_comment_i
168
  "\n"        idle noeat
169
170
:end_of_file_comment Comment
171
  *       end_of_file_comment
172
173
:first_digit Constant
174
  *       rest    noeat
175
  "x"     hex
176
  "b"     binary
177
  "."     float
178
  "eE"        epart
179
  "0-7"       octal
180
  "89"        bad_number  recolor=-1
181
182
:bad_number Bad
183
  *       rest    noeat
184
  "0-9"       bad_number
185
186
:octal Constant
187
  *       rest    noeat
188
  "0-7_"      octal
189
  "89"        bad_number  recolor=-1
190
191
:binary Constant
192
  *       rest    noeat
193
  "01_"       binary
194
  "2-9"       bad_number  recolor=-1
195
196
:hex Constant
197
  *       rest    noeat
198
  "0-9A-Fa-f_"    hex
199
200
:decimal Constant
201
  *       rest    noeat
202
  "0-9_"      decimal
203
  "eE"        epart
204
  "."     float
205
206
:maybe_float Constant
207
  *       rest    recolor=-2  noeat
208
  "0-9"       float       recolor=-2
209
210
:float Constant
211
  *       rest    noeat
212
  "eE"        epart
213
  "0-9_"      float
214
215
:epart Constant
216
  *       rest    noeat
217
  "0-9+\-"    enum
218
219
:enum Constant
220
  *       rest    noeat
221
  "0-9_"      enum
222
223
:string   Constant
224
  *       string
225
  "\""        rest
226
  "\\"        string_escape   recolor=-1
227
  "$@"        string_subst    recolor=-1
228
229
:string_subst Escape
230
  *       string  noeat recolor=-1
231
  "a-zA-Z_0-9"    string_subst
232
233
:string_escape Escape
234
  *       string
235
  "x"     string_hex1
236
  "c"     string_ctrl
237
  "N"     string_named
238
  "0-7"       string_octal2
239
  "\n"        string      recolor=-2
240
241
:string_named Escape
242
  *       string
243
  "{"     string_named_rest
244
245
:string_named_rest Escape
246
  *       string_named_rest
247
  "}"     string
248
249
:string_ctrl Escape
250
  *       string
251
252
:string_hex1 Escape
253
  *       string      noeat
254
  "{"     string_unicode
255
  "0-9a-fA-F" string_hex2
256
257
:string_unicode Escape
258
  *       string_unicode
259
  "}"     string
260
261
:string_hex2 Escape
262
  *       string      noeat
263
  "0-9a-fA-F" string
264
265
:string_octal2 Escape
266
  *       string      noeat
267
  "0-7"       string_octal3
268
269
:string_octal3 Escape
270
  *       string      noeat
271
  "0-7"       string
272
273
:char Constant
274
  *       char
275
  "\n"        idle noeat
276
  "'"     rest
277
  "\\"        char_escape recolor=-1
278
279
:char_escape  Escape
280
  *       char        recolor=-2
281
  "\\'"   char
282
283
:backtick Constant
284
  *       backtick
285
  "`"     rest
286
  "\\"        backtick_escape recolor=-1
287
  "$@"        backtick_subst recolor=-1
288
289
:backtick_subst Escape
290
  *       backtick    noeat recolor=-1
291
  "a-zA-Z_0-9"    backtick_subst
292
293
:backtick_escape Escape
294
  *       backtick
295
  "x"     backtick_hex1
296
  "c"     backtick_ctrl
297
  "N"     backtick_named
298
  "0-7"       backtick_octal2
299
  "\n"        backtick        recolor=-2
300
301
:backtick_named Escape
302
  *       backtick
303
  "{"     backtick_named_rest
304
305
:backtick_named_rest Escape
306
  *       backtick_named_rest
307
  "}"     backtick
308
309
:backtick_ctrl Escape
310
  *       backtick
311
312
:backtick_hex1 Escape
313
  *       backtick        noeat
314
  "{"     backtick_unicode
315
  "0-9a-fA-F" backtick_hex2
316
317
:backtick_unicode Escape
318
  *       backtick_unicode
319
  "}"     backtick
320
321
:backtick_hex2 Escape
322
  *       backtick        noeat
323
  "0-9a-fA-F" backtick
324
325
:backtick_octal2 Escape
326
  *       backtick        noeat
327
  "0-7"       backtick_octal3
328
329
:backtick_octal3 Escape
330
  *       backtick        noeat
331
  "0-7"       backtick
332
333
:ident    Idle
334
  *       rest        noeat strings
335
  "BEGIN"     kw
336
  "END"       kw
337
  "if"        kw
338
  "unless"    kw
339
  "while"     kw
340
  "until"     kw
341
  "foreach"   kw
342
  "sub"       kw
343
  "my"        kw
344
  "do"        kw
345
  "if"        kw
346
  "else"      kw
347
  "elsif"     kw
348
  "for"       kw
349
  "continue"  kw
350
  "last"      kw
351
  "print"     kw
352
  "reset"     kw
353
  "die"       kw
354
  "goto"      kw
355
  "require"   kw
356
  "use"       kw
357
  "eval"      kw
358
  "redo"      kw
359
  "next"      kw
360
  "warn"      kw
361
  "return"    kw
362
  "printf"    kw
363
  "close"     kw
364
  "package"   kw
365
  "m"     match
366
  "qr"        match
367
  "qq"        match
368
  "qx"        match
369
  "qw"        match
370
  "q"     match
371
  "s"     subst
372
  "tr"        subst
373
  "y"     subst
374
  "__END__"   end_of_file_comment
375
  "__DATA__"  end_of_file_comment
376
done
377
  "a-zA-Z0-9_"    ident
378
379
:maybe_string Idle
380
  *       rest        noeat strings
381
  "qr"        match
382
  "qq"        match
383
  "qx"        match
384
  "qw"        match
385
  "q"     match
386
done
387
  "a-zA-Z0-9_"    maybe_string
388
389
:type Type
390
  *   rest    noeat
391
392
:kw Keyword
393
  *   rest    noeat
394
395
:match Idle
396
  *       inmatch     save_c recolor=-1
397
  "   "   match
398
399
:inmatch Constant
400
  *       inmatch
401
  &       rest
402
  "\\"        inmatch_quote   recolor=-1
403
404
:inmatch_quote Escape
405
  *       inmatch
406
407
:subst Idle
408
  *       insubst     save_c recolor=-1
409
  "<([{`"     delim_insubst   save_c recolor=-1
410
  "   "   subst
411
412
:insubst Constant
413
  *       insubst
414
  &       inrepl
415
  "\\"        insubst_quote   recolor=-1
416
417
:insubst_quote Escape
418
  *       insubst
419
420
:inrepl Constant
421
  *       inrepl
422
  &       rest
423
  "\\"        inrepl_quote
424
425
:inrepl_quote Escape
426
  *       inrepl
427
428
:delim_insubst Constant
429
  *       delim_insubst
430
  &       delim_repl
431
  "\\"        delim_quote
432
433
:delim_quote Escape
434
  *       delim_insubst
435
436
:delim_repl Constant
437
  *       repl        save_c recolor=-1
438
  "   "   delim_repl
439
440
:repl Constant
441
  *       repl
442
  &       rest
443
  "\\"        repl_quote
444
445
:repl_quote Escape
446
  *       repl
447
448
.end

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks