blob: b5421bcfdb606b78471101919f015302525e37ff [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Motif UIL (User Interface Language)
3" Maintainer: Thomas Koehler <jean-luc@picard.franken.de>
Bram Moolenaar543b7ef2013-06-01 14:50:56 +02004" Last Change: 2013 May 23
Bram Moolenaar5c736222010-01-06 20:54:52 +01005" URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/uil.vim
6
Bram Moolenaar071d4272004-06-13 20:20:40 +00007" Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" A bunch of useful keywords
15syn keyword uilType arguments callbacks color
16syn keyword uilType compound_string controls end
17syn keyword uilType exported file include
18syn keyword uilType module object procedure
19syn keyword uilType user_defined xbitmapfile
20
21syn keyword uilTodo contained TODO
22
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020023" String and Character constants
Bram Moolenaar071d4272004-06-13 20:20:40 +000024" Highlight special characters (those which have a backslash) differently
25syn match uilSpecial contained "\\\d\d\d\|\\."
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020026syn region uilString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,uilSpecial
Bram Moolenaar071d4272004-06-13 20:20:40 +000027syn match uilCharacter "'[^\\]'"
Bram Moolenaar543b7ef2013-06-01 14:50:56 +020028syn region uilString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@Spell,uilSpecial
Bram Moolenaar071d4272004-06-13 20:20:40 +000029syn match uilSpecialCharacter "'\\.'"
Bram Moolenaar543b7ef2013-06-01 14:50:56 +020030syn match uilSpecialStatement "Xm[^ =(){}:;]*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000031syn match uilSpecialFunction "MrmNcreateCallback"
Bram Moolenaar543b7ef2013-06-01 14:50:56 +020032syn match uilRessource "XmN[^ =(){}:;]*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000033
34syn match uilNumber "-\=\<\d*\.\=\d\+\(e\=f\=\|[uU]\=[lL]\=\)\>"
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020035syn match uilNumber "0[xX]\x\+\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020037syn region uilComment start="/\*" end="\*/" contains=@Spell,uilTodo
38syn match uilComment "!.*" contains=@Spell,uilTodo
Bram Moolenaar071d4272004-06-13 20:20:40 +000039syn match uilCommentError "\*/"
40
41syn region uilPreCondit start="^#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=uilComment,uilString,uilCharacter,uilNumber,uilCommentError
42syn match uilIncluded contained "<[^>]*>"
43syn match uilInclude "^#\s*include\s\+." contains=uilString,uilIncluded
44syn match uilLineSkip "\\$"
45syn region uilDefine start="^#\s*\(define\>\|undef\>\)" end="$" contains=uilLineSkip,uilComment,uilString,uilCharacter,uilNumber,uilCommentError
46
47syn sync ccomment uilComment
48
49" Define the default highlighting.
50" For version 5.7 and earlier: only when not done already
51" For version 5.8 and later: only when an item doesn't have highlighting yet
52if version >= 508 || !exists("did_uil_syn_inits")
53 if version < 508
54 let did_uil_syn_inits = 1
55 command -nargs=+ HiLink hi link <args>
56 else
57 command -nargs=+ HiLink hi def link <args>
58 endif
59
60 " The default highlighting.
61 HiLink uilCharacter uilString
62 HiLink uilSpecialCharacter uilSpecial
63 HiLink uilNumber uilString
64 HiLink uilCommentError uilError
65 HiLink uilInclude uilPreCondit
66 HiLink uilDefine uilPreCondit
67 HiLink uilIncluded uilString
68 HiLink uilSpecialFunction uilRessource
69 HiLink uilRessource Identifier
70 HiLink uilSpecialStatement Keyword
71 HiLink uilError Error
72 HiLink uilPreCondit PreCondit
73 HiLink uilType Type
74 HiLink uilString String
75 HiLink uilComment Comment
76 HiLink uilSpecial Special
77 HiLink uilTodo Todo
78
79 delcommand HiLink
80endif
81
82
83let b:current_syntax = "uil"
84
85" vim: ts=8