update from MirBSD CVS
[alioth/jupp.git] / syntax / mason.jsf.in
1 # $MirOS: contrib/code/jupp/syntax/mason.jsf.in,v 1.3 2017/12/02 05:38:06 tg Exp $
2 #-
3 # JOE syntax highlight file for HTML
4 # This needs lots of work...
5
6 # Always reparse from beginning
7 -
8
9 # Define colors
10
11 =Idle
12 =Preproc        yellow
13 =Comment        green
14 =Constant       cyan
15 =Escape         bold cyan
16 =Type           bold
17 =Keyword        bold
18 =Bad            bold red
19 =Attr           magenta
20
21 # HTML section
22
23 :reset Idle
24         *               idle            noeat
25         "%"             lperl_idle
26
27 :idle Idle
28         *               idle
29         "&"             char            recolor=-1
30         "<"             start
31         "\n"            reset
32
33 :char Escape
34         *               char
35         ";"             idle
36
37 :start Idle
38         *               mark            noeat
39         "!"             bang
40         "%"             mason_tag
41         "&"             perl_idle
42
43 :mason_tag
44         *               perl_idle
45         ">"             perl_idle
46         "a-z"           mason_tag
47
48 :bang Idle
49         *               mark            noeat
50         "-"             maybe_comment
51
52 :maybe_comment Idle
53         *               mark            noeat
54         "-"             comment         recolor=-2
55
56 :comment Comment
57         *               comment
58         "-"             maybe_end_comment
59
60 :maybe_end_comment Comment
61         *               comment
62         "-"             end_comment
63
64 :end_comment Bad
65         *               idle
66         "-"             maybe_another_comment
67         " \t\n"         end_comment
68         ">"             idle            recolor= -1
69
70 :maybe_another_comment Idle
71         *               end_comment
72         "-"             comment         recolor= -2
73
74
75 # We're in a markup
76
77 :mark Idle
78         *               mark
79         ">"             idle
80         "a-zA-Z_"       ident           buffer
81         "0-9"           number          recolor= -1
82         "\""            astring         recolor= -1
83         "\'"            bstring         recolor= -1
84
85 :number Constant
86         *               mark    noeat
87         "0-9"           number
88
89
90 # Strings
91
92 :astring Constant
93         *               astring
94         "\""            mark
95
96 :bstring Constant
97         *               bstring
98         "'"             mark
99
100 # Keywords
101
102 :ident Idle
103         *               mark            noeat istrings
104         "html"          kw
105         "head"          kw
106         "base"          kw
107         "isindex"       kw
108         "link"          kw
109         "meta"          kw
110         "nextid"        kw
111         "script"        kw
112         "title"         kw
113         "body"          kw
114         "address"       kw
115         "blockquote"    kw
116         "form"          kw
117         "input"         kw
118         "select"        kw
119         "option"        kw
120         "textarea"      kw
121         "h1"            kw
122         "h2"            kw
123         "h3"            kw
124         "h4"            kw
125         "h5"            kw
126         "h6"            kw
127         "hr"            kw
128         "dl"            kw
129         "dt"            kw
130         "dd"            kw
131         "ol"            kw
132         "li"            kw
133         "ul"            kw
134         "dir"           kw
135         "menu"          kw
136         "pre"           kw
137         "table"         kw
138         "caption"       kw
139         "tr"            kw
140         "td"            kw
141         "th"            kw
142         "p"             kw
143         "applet"        kw
144         "param"         kw
145         "basefont"      kw
146         "center"        kw
147         "map"           kw
148         "area"          kw
149         "bgsound"       kw
150         "marquee"       kw
151         "frameset"      kw
152         "frame"         kw
153         "noframes"      kw
154         "b"             kw
155         "i"             kw
156         "tt"            kw
157         "big"           kw
158         "small"         kw
159         "sub"           kw
160         "sup"           kw
161         "u"             kw
162         "font"          kw
163         "blink"         kw
164         "nobr"          kw
165         "cite"          kw
166         "code"          kw
167         "em"            kw
168         "kbd"           kw
169         "samp"          kw
170         "strong"        kw
171         "var"           kw
172         "a"             kw
173         "br"            kw
174         "img"           kw
175         "wbr"           kw
176 # attributes
177         "href"          attr
178         "target"        attr
179         "prompt"        attr
180         "methods"       attr
181         "name"          attr
182         "rel"           attr
183         "rev"           attr
184         "title"         attr
185         "urn"           attr
186         "http-equiv"    attr
187         "content"       attr
188         "n"             attr
189         "background"    attr
190         "bgcolor"       attr
191         "text"          attr
192         "link"          attr
193         "vlink"         attr
194         "bgproperties"  attr
195         "action"        attr
196         "enctype"       attr
197         "method"        attr
198 done
199         "a-zA-Z0-9_"    ident
200
201 :kw Keyword
202         *       mark    noeat
203
204 :attr Attr
205         *       mark    noeat
206
207 # Perl block section
208
209 # JOE syntax highlight file for Perl
210
211 # Still need:
212
213 # _ in numbers
214 # 0b for binary
215 # \cC for Ctrl-C
216 # \x{hex} unicode
217 # no escapes in single quotes (except \\ and \')
218 # \N{NAME} named character
219
220 # / .. / regex
221 # s/ .. / .. /
222 # $name allowed in regex
223 # m//  same as //
224 # s///
225 # tr/// y///
226 # qr//
227
228 # can also do this: s(egg)<larva>
229 # s' ' ' - no interpolation
230
231 # Define colors
232
233 :perl_idle Idle
234         *               perl_idle
235         "#"             perl_line_comment       recolor=-1
236         "\n"            perl_idle
237         "0"             perl_first_digit        recolor=-1
238         "1-9"           perl_decimal    recolor=-1
239         "."             perl_maybe_float
240         "\""            perl_string             recolor=-1
241         "\\"            perl_not_string
242         "'"             perl_char               recolor=-1
243         "`"             perl_backtick   recolor=-1
244         "a-zA-Z_"       perl_ident              buffer
245         "%"             perl_maybe_done
246         "&"             perl_maybe_done
247         "<"             perl_maybe_done_1
248
249 :perl_maybe_done
250         *               perl_idle       noeat
251         ">"             idle
252
253 :perl_maybe_done_1
254         *               perl_idle       noeat
255         "/"             perl_maybe_done_2
256
257 :perl_maybe_done_2
258         *               perl_idle       noeat
259         "a-z"           perl_maybe_done_2
260         ">"             reset
261
262 :perl_not_string Idle
263         *               perl_idle noeat
264         "\"'`"          perl_idle
265
266 :perl_line_comment Comment
267         *               perl_line_comment
268         "\n"            perl_idle
269
270 :perl_first_digit Constant
271         *               perl_idle       noeat
272         "x"             perl_hex
273         "b"             perl_binary
274         "."             perl_float
275         "eE"            perl_epart
276         "0-7"           perl_octal
277         "89"            perl_bad_number recolor=-1
278
279 :perl_bad_number Bad
280         *               perl_idle       noeat
281         "0-9"           perl_bad_number
282
283 :perl_octal Constant
284         *               perl_idle       noeat
285         "0-7_"          perl_octal
286         "89"            perl_bad_number recolor=-1
287
288 :perl_binary Constant
289         *               perl_idle       noeat
290         "01_"           perl_binary
291         "2-9"           perl_bad_number recolor=-1
292
293 :perl_hex Constant
294         *               perl_idle       noeat
295         "0-9A-Fa-f_"    perl_hex
296
297 :perl_decimal Constant
298         *               perl_idle       noeat
299         "0-9_"          perl_decimal
300         "eE"            perl_epart
301         "."             perl_float
302
303 :perl_maybe_float Constant
304         *               perl_idle       recolor=-2      noeat
305         "0-9"           perl_float              recolor=-2
306
307 :perl_float Constant
308         *               perl_idle       noeat
309         "eE"            perl_epart
310         "0-9_"          perl_float
311
312 :perl_epart Constant
313         *               perl_idle       noeat
314         "0-9+\-"        perl_enum
315
316 :perl_enum Constant
317         *               perl_idle       noeat
318         "0-9_"          perl_enum
319
320 :perl_string    Constant
321         *               perl_string
322         "\""            perl_idle
323         "\\"            perl_string_escape      recolor=-1
324         "$@"            perl_string_subst       recolor=-1
325
326 :perl_string_subst Escape
327         *               perl_string     noeat recolor=-1
328         "a-zA-Z_0-9"    perl_string_subst
329
330 :perl_string_escape Escape
331         *               perl_string
332         "x"             perl_string_hex1
333         "c"             perl_string_ctrl
334         "N"             perl_string_named
335         "0-7"           perl_string_octal2
336         "\n"            perl_string             recolor=-2
337
338 :perl_string_named Escape
339         *               perl_string
340         "{"             perl_string_named_rest
341
342 :perl_string_named_rest Escape
343         *               perl_string_named_rest
344         "}"             perl_string
345
346 :perl_string_ctrl Escape
347         *               perl_string
348
349 :perl_string_hex1 Escape
350         *               perl_string             noeat
351         "{"             perl_string_unicode
352         "0-9a-fA-F"     perl_string_hex2
353
354 :perl_string_unicode Escape
355         *               perl_string_unicode
356         "}"             perl_string
357
358 :perl_string_hex2 Escape
359         *               perl_string             noeat
360         "0-9a-fA-F"     perl_string
361
362 :perl_string_octal2 Escape
363         *               perl_string             noeat
364         "0-7"           perl_string_octal3
365
366 :perl_string_octal3 Escape
367         *               perl_string             noeat
368         "0-7"           perl_string
369
370 :perl_char Constant
371         *               perl_char
372         "\n"            perl_reset
373         "'"             perl_idle
374         "\\"            perl_char_escape        recolor=-1
375
376 :perl_char_escape       Escape
377         *               perl_char               recolor=-2
378         "\\'"   perl_char
379
380 :perl_backtick  Constant
381         *               perl_backtick
382         "`"             perl_idle
383         "\\"            perl_backtick_escape    recolor=-1
384         "$@"            perl_backtick_subst recolor=-1
385
386 :perl_backtick_subst Escape
387         *               perl_backtick   noeat recolor=-1
388         "a-zA-Z_0-9"    perl_backtick_subst
389
390 :perl_backtick_escape Escape
391         *               perl_backtick
392         "x"             perl_backtick_hex1
393         "c"             perl_backtick_ctrl
394         "N"             perl_backtick_named
395         "0-7"           perl_backtick_octal2
396         "\n"            perl_backtick           recolor=-2
397
398 :perl_backtick_named Escape
399         *               perl_backtick
400         "{"             perl_backtick_named_rest
401
402 :perl_backtick_named_rest Escape
403         *               perl_backtick_named_rest
404         "}"             perl_backtick
405
406 :perl_backtick_ctrl Escape
407         *               perl_backtick
408
409 :perl_backtick_hex1 Escape
410         *               perl_backtick           noeat
411         "{"             perl_backtick_unicode
412         "0-9a-fA-F"     perl_backtick_hex2
413
414 :perl_backtick_unicode Escape
415         *               perl_backtick_unicode
416         "}"             perl_backtick
417
418 :perl_backtick_hex2 Escape
419         *               perl_backtick           noeat
420         "0-9a-fA-F"     perl_backtick
421
422 :perl_backtick_octal2 Escape
423         *               perl_backtick           noeat
424         "0-7"           perl_backtick_octal3
425
426 :perl_backtick_octal3 Escape
427         *               perl_backtick           noeat
428         "0-7"           perl_backtick
429
430 :perl_ident     Idle
431         *               perl_idle               noeat strings
432         "if"            perl_kw
433         "unless"        perl_kw
434         "while"         perl_kw
435         "until"         perl_kw
436         "foreach"       perl_kw
437         "sub"           perl_kw
438         "my"            perl_kw
439         "do"            perl_kw
440         "if"            perl_kw
441         "else"          perl_kw
442         "elsif"         perl_kw
443         "for"           perl_kw
444         "continue"      perl_kw
445         "last"          perl_kw
446         "print"         perl_kw
447         "reset"         perl_kw
448         "die"           perl_kw
449         "goto"          perl_kw
450         "require"       perl_kw
451         "use"           perl_kw
452         "eval"          perl_kw
453         "redo"          perl_kw
454         "next"          perl_kw
455         "warn"          perl_kw
456 done
457         "a-zA-Z0-9_"    perl_ident
458
459 :perl_type Type
460         *       perl_idle       noeat
461
462 :perl_kw Keyword
463         *       perl_idle       noeat
464
465 # Perl line section
466
467 # JOE syntax highlight file for Perl
468
469 # Still need:
470
471 # _ in numbers
472 # 0b for binary
473 # \cC for Ctrl-C
474 # \x{hex} unicode
475 # no escapes in single quotes (except \\ and \')
476 # \N{NAME} named character
477
478 # / .. / regex
479 # s/ .. / .. /
480 # $name allowed in regex
481 # m//  same as //
482 # s///
483 # tr/// y///
484 # qr//
485
486 # can also do this: s(egg)<larva>
487 # s' ' ' - no interpolation
488
489 # Define colors
490
491 :lperl_idle Idle
492         *               lperl_idle
493         "#"             lperl_line_comment      recolor=-1
494         "\n"            reset
495         "0"             lperl_first_digit       recolor=-1
496         "1-9"           lperl_decimal   recolor=-1
497         "."             lperl_maybe_float
498         "\""            lperl_string            recolor=-1
499         "\\"            lperl_not_string
500         "'"             lperl_char              recolor=-1
501         "`"             lperl_backtick  recolor=-1
502         "a-zA-Z_"       lperl_ident             buffer
503
504 :lperl_not_string Idle
505         *               lperl_idle noeat
506         "\"'`"          lperl_idle
507
508 :lperl_line_comment Comment
509         *               lperl_line_comment
510         "\n"            reset
511
512 :lperl_first_digit Constant
513         *               lperl_idle      noeat
514         "x"             lperl_hex
515         "b"             lperl_binary
516         "."             lperl_float
517         "eE"            lperl_epart
518         "0-7"           lperl_octal
519         "89"            lperl_bad_number        recolor=-1
520
521 :lperl_bad_number Bad
522         *               lperl_idle      noeat
523         "0-9"           lperl_bad_number
524
525 :lperl_octal Constant
526         *               lperl_idle      noeat
527         "0-7_"          lperl_octal
528         "89"            lperl_bad_number        recolor=-1
529
530 :lperl_binary Constant
531         *               lperl_idle      noeat
532         "01_"           lperl_binary
533         "2-9"           lperl_bad_number        recolor=-1
534
535 :lperl_hex Constant
536         *               lperl_idle      noeat
537         "0-9A-Fa-f_"    lperl_hex
538
539 :lperl_decimal Constant
540         *               lperl_idle      noeat
541         "0-9_"          lperl_decimal
542         "eE"            lperl_epart
543         "."             lperl_float
544
545 :lperl_maybe_float Constant
546         *               lperl_idle      recolor=-2      noeat
547         "0-9"           lperl_float             recolor=-2
548
549 :lperl_float Constant
550         *               lperl_idle      noeat
551         "eE"            lperl_epart
552         "0-9_"          lperl_float
553
554 :lperl_epart Constant
555         *               lperl_idle      noeat
556         "0-9+\-"        lperl_enum
557
558 :lperl_enum Constant
559         *               lperl_idle      noeat
560         "0-9_"          lperl_enum
561
562 :lperl_string   Constant
563         *               lperl_string
564         "\""            lperl_idle
565         "\\"            lperl_string_escape     recolor=-1
566         "$@"            lperl_string_subst      recolor=-1
567
568 :lperl_string_subst Escape
569         *               lperl_string    noeat recolor=-1
570         "a-zA-Z_0-9"    lperl_string_subst
571
572 :lperl_string_escape Escape
573         *               lperl_string
574         "x"             lperl_string_hex1
575         "c"             lperl_string_ctrl
576         "N"             lperl_string_named
577         "0-7"           lperl_string_octal2
578         "\n"            reset           recolor=-2
579
580 :lperl_string_named Escape
581         *               lperl_string
582         "{"             lperl_string_named_rest
583
584 :lperl_string_named_rest Escape
585         *               lperl_string_named_rest
586         "}"             lperl_string
587
588 :lperl_string_ctrl Escape
589         *               lperl_string
590
591 :lperl_string_hex1 Escape
592         *               lperl_string            noeat
593         "{"             lperl_string_unicode
594         "0-9a-fA-F"     lperl_string_hex2
595
596 :lperl_string_unicode Escape
597         *               lperl_string_unicode
598         "}"             lperl_string
599
600 :lperl_string_hex2 Escape
601         *               lperl_string            noeat
602         "0-9a-fA-F"     lperl_string
603
604 :lperl_string_octal2 Escape
605         *               lperl_string            noeat
606         "0-7"           lperl_string_octal3
607
608 :lperl_string_octal3 Escape
609         *               lperl_string            noeat
610         "0-7"           lperl_string
611
612 :lperl_char Constant
613         *               lperl_char
614         "\n"            reset
615         "'"             lperl_idle
616         "\\"            lperl_char_escape       recolor=-1
617
618 :lperl_char_escape      Escape
619         *               lperl_char              recolor=-2
620         "\\'"   lperl_char
621
622 :lperl_backtick Constant
623         *               lperl_backtick
624         "`"             lperl_idle
625         "\\"            lperl_backtick_escape   recolor=-1
626         "$@"            lperl_backtick_subst recolor=-1
627
628 :lperl_backtick_subst Escape
629         *               lperl_backtick  noeat recolor=-1
630         "a-zA-Z_0-9"    lperl_backtick_subst
631
632 :lperl_backtick_escape Escape
633         *               lperl_backtick
634         "x"             lperl_backtick_hex1
635         "c"             lperl_backtick_ctrl
636         "N"             lperl_backtick_named
637         "0-7"           lperl_backtick_octal2
638         "\n"            reset           recolor=-2
639
640 :lperl_backtick_named Escape
641         *               lperl_backtick
642         "{"             lperl_backtick_named_rest
643
644 :lperl_backtick_named_rest Escape
645         *               lperl_backtick_named_rest
646         "}"             lperl_backtick
647
648 :lperl_backtick_ctrl Escape
649         *               lperl_backtick
650
651 :lperl_backtick_hex1 Escape
652         *               lperl_backtick          noeat
653         "{"             lperl_backtick_unicode
654         "0-9a-fA-F"     lperl_backtick_hex2
655
656 :lperl_backtick_unicode Escape
657         *               lperl_backtick_unicode
658         "}"             lperl_backtick
659
660 :lperl_backtick_hex2 Escape
661         *               lperl_backtick          noeat
662         "0-9a-fA-F"     lperl_backtick
663
664 :lperl_backtick_octal2 Escape
665         *               lperl_backtick          noeat
666         "0-7"           lperl_backtick_octal3
667
668 :lperl_backtick_octal3 Escape
669         *               lperl_backtick          noeat
670         "0-7"           lperl_backtick
671
672 :lperl_ident    Idle
673         *               lperl_idle              noeat strings
674         "if"            lperl_kw
675         "unless"        lperl_kw
676         "while"         lperl_kw
677         "until"         lperl_kw
678         "foreach"       lperl_kw
679         "sub"           lperl_kw
680         "my"            lperl_kw
681         "do"            lperl_kw
682         "if"            lperl_kw
683         "else"          lperl_kw
684         "elsif"         lperl_kw
685         "for"           lperl_kw
686         "continue"      lperl_kw
687         "last"          lperl_kw
688         "print"         lperl_kw
689         "reset"         lperl_kw
690         "die"           lperl_kw
691         "goto"          lperl_kw
692         "require"       lperl_kw
693         "use"           lperl_kw
694         "eval"          lperl_kw
695         "redo"          lperl_kw
696         "next"          lperl_kw
697         "warn"          lperl_kw
698 done
699         "a-zA-Z0-9_"    lperl_ident
700
701 :lperl_type Type
702         *       lperl_idle      noeat
703
704 :lperl_kw Keyword
705         *       lperl_idle      noeat