2 " Language: Motif UIL (User Interface Language)
3 " Maintainer: Thomas Koehler <jean-luc@picard.franken.de>
4 " Last Change: 2001 Jan 15
6 " Quit when a syntax file was already loaded
9 elseif exists("b:current_syntax")
13 " A bunch of useful keywords
14 syn keyword uilType arguments callbacks color
15 syn keyword uilType compound_string controls end
16 syn keyword uilType exported file include
17 syn keyword uilType module object procedure
18 syn keyword uilType user_defined xbitmapfile
20 syn keyword uilTodo contained TODO
22 " String and Character contstants
23 " Highlight special characters (those which have a backslash) differently
24 syn match uilSpecial contained "\\\d\d\d\|\\."
25 syn region uilString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=uilSpecial
26 syn match uilCharacter "'[^\\]'"
27 syn region uilString start=+'+ skip=+\\\\\|\\"+ end=+'+ contains=uilSpecial
28 syn match uilSpecialCharacter "'\\.'"
29 syn match uilSpecialStatement "Xm[^ =(){}]*"
30 syn match uilSpecialFunction "MrmNcreateCallback"
31 syn match uilRessource "XmN[^ =(){}]*"
33 syn match uilNumber "-\=\<\d*\.\=\d\+\(e\=f\=\|[uU]\=[lL]\=\)\>"
34 syn match uilNumber "0[xX][0-9a-fA-F]\+\>"
36 syn region uilComment start="/\*" end="\*/" contains=uilTodo
37 syn match uilComment "!.*" contains=uilTodo
38 syn match uilCommentError "\*/"
40 syn region uilPreCondit start="^#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=uilComment,uilString,uilCharacter,uilNumber,uilCommentError
41 syn match uilIncluded contained "<[^>]*>"
42 syn match uilInclude "^#\s*include\s\+." contains=uilString,uilIncluded
43 syn match uilLineSkip "\\$"
44 syn region uilDefine start="^#\s*\(define\>\|undef\>\)" end="$" contains=uilLineSkip,uilComment,uilString,uilCharacter,uilNumber,uilCommentError
46 syn sync ccomment uilComment
48 " Define the default highlighting.
49 " For version 5.7 and earlier: only when not done already
50 " For version 5.8 and later: only when an item doesn't have highlighting yet
51 if version >= 508 || !exists("did_uil_syn_inits")
53 let did_uil_syn_inits = 1
54 command -nargs=+ HiLink hi link <args>
56 command -nargs=+ HiLink hi def link <args>
59 " The default highlighting.
60 HiLink uilCharacter uilString
61 HiLink uilSpecialCharacter uilSpecial
62 HiLink uilNumber uilString
63 HiLink uilCommentError uilError
64 HiLink uilInclude uilPreCondit
65 HiLink uilDefine uilPreCondit
66 HiLink uilIncluded uilString
67 HiLink uilSpecialFunction uilRessource
68 HiLink uilRessource Identifier
69 HiLink uilSpecialStatement Keyword
71 HiLink uilPreCondit PreCondit
73 HiLink uilString String
74 HiLink uilComment Comment
75 HiLink uilSpecial Special
82 let b:current_syntax = "uil"