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