3 " Author: Pieter van Engelen <pietere@sci.kun.nl>
4 " Co-Author: Arthur van Leeuwen <arthurvl@sci.kun.nl>
5 " Last Change: Fri Sep 29 11:35:34 CEST 2000
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
16 syn keyword cleanConditional if case
17 syn keyword cleanLabel let! with where in of
18 syn keyword cleanInclude from import
19 syn keyword cleanSpecial Start
20 syn keyword cleanKeyword infixl infixr infix
21 syn keyword cleanBasicType Int Real Char Bool String
22 syn keyword cleanSpecialType World ProcId Void Files File
23 syn keyword cleanModuleSystem module implementation definition system
24 syn keyword cleanTypeClass class instance export
26 " To do some Denotation Highlighting
27 syn keyword cleanBoolDenot True False
28 syn region cleanStringDenot start=+"+ end=+"+
29 syn match cleanCharDenot "'.'"
30 syn match cleanCharsDenot "'[^'\\]*\(\\.[^'\\]\)*'" contained
31 syn match cleanIntegerDenot "[+-~]\=\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>"
32 syn match cleanRealDenot "[+-~]\=\<\d\+\.\d+\(E[+-~]\=\d+\)\="
34 " To highlight the use of lists, tuples and arrays
35 syn region cleanList start="\[" end="\]" contains=ALL
36 syn region cleanRecord start="{" end="}" contains=ALL
37 syn region cleanArray start="{:" end=":}" contains=ALL
38 syn match cleanTuple "([^=]*,[^=]*)" contains=ALL
40 " To do some Comment Highlighting
41 syn region cleanComment start="/\*" end="\*/" contains=cleanComment
42 syn match cleanComment "//.*"
44 " Now for some useful typedefinitionrecognition
45 syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)[ \t]*\(infix[lr]\=\)\=[ \t]*\d\=[ \t]*::.*->.*" contains=cleanSpecial
47 " Define the default highlighting.
48 " For version 5.7 and earlier: only when not done already
49 " For version 5.8 and later: only when an item doesn't have highlighting yet
50 if version >= 508 || !exists("did_clean_syntax_init")
52 let did_clean_syntax_init = 1
53 command -nargs=+ HiLink hi link <args>
55 command -nargs=+ HiLink hi def link <args>
59 HiLink cleanComment Comment
60 " Constants and denotations
61 HiLink cleanCharsDenot String
62 HiLink cleanStringDenot String
63 HiLink cleanCharDenot Character
64 HiLink cleanIntegerDenot Number
65 HiLink cleanBoolDenot Boolean
66 HiLink cleanRealDenot Float
69 HiLink cleanTypeClass Keyword
70 HiLink cleanConditional Conditional
71 HiLink cleanLabel Label
72 HiLink cleanKeyword Keyword
73 " Generic Preprocessing
74 HiLink cleanInclude Include
75 HiLink cleanModuleSystem PreProc
77 HiLink cleanBasicType Type
78 HiLink cleanSpecialType Type
79 HiLink cleanFuncTypeDef Typedef
81 HiLink cleanSpecial Special
82 HiLink cleanList Special
83 HiLink cleanArray Special
84 HiLink cleanRecord Special
85 HiLink cleanTuple Special
92 let b:current_syntax = "clean"