annotate runtime/syntax/msmessages.vim @ 1661:5bbc2d6658ad v7.2a.013

updated for version 7.2a-013
author vimboss
date Fri, 04 Jul 2008 09:44:11 +0000
parents b9740fb41986
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1619
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim syntax file
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: MS Message Text files (*.mc)
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
3 " Maintainer: Kevin Locke <kwl7@cornell.edu>
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
4 " Last Change: 2008 April 09
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
5 " Location: http://kevinlocke.name/programs/vim/syntax/msmessages.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
6
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
7 " See format description at <http://msdn2.microsoft.com/en-us/library/aa385646.aspx>
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
8 " This file is based on the rc.vim and c.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
9
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
12 if version < 600
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
13 syntax clear
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
14 elseif exists("b:current_syntax")
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
15 finish
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
16 endif
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
17
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
18 " Common MS Messages keywords
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
19 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
20 syn keyword msmessagesIdentifier MessageIdTypedef
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
21 syn keyword msmessagesIdentifier SeverityNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
22 syn keyword msmessagesIdentifier FacilityNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
23 syn keyword msmessagesIdentifier LanguageNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
24 syn keyword msmessagesIdentifier OutputBase
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
25
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
26 syn keyword msmessagesIdentifier MessageId
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
27 syn keyword msmessagesIdentifier Severity
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
28 syn keyword msmessagesIdentifier Facility
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
29 syn keyword msmessagesIdentifier OutputBase
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
30
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
31 syn match msmessagesIdentifier /\<SymbolicName\>/ nextgroup=msmessagesIdentEq skipwhite
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
32 syn match msmessagesIdentEq transparent /=/ nextgroup=msmessagesIdentDef skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
33 syn match msmessagesIdentDef display /\w\+/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
34 " Note: The Language keyword is highlighted as part of an msmessagesLangEntry
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
35
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
36 " Set value
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
37 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
38 syn region msmessagesSet start="(" end=")" transparent fold contains=msmessagesName keepend
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
39 syn match msmessagesName /\w\+/ nextgroup=msmessagesSetEquals skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn match msmessagesSetEquals /=/ display transparent nextgroup=msmessagesNumVal skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
41 syn match msmessagesNumVal display transparent "\<\d\|\.\d" contains=msmessagesNumber,msmessagesFloat,msmessagesOctalError,msmessagesOctal nextgroup=msmessagesValSep
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
42 syn match msmessagesValSep /:/ display nextgroup=msmessagesNameDef contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
43 syn match msmessagesNameDef /\w\+/ display contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
44
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
45
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
46 " Comments are converted to C source (by removing leading ;)
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
47 " So we highlight the comments as C
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
48 syn include @msmessagesC syntax/c.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
49 unlet b:current_syntax
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
50 syn region msmessagesCComment matchgroup=msmessagesComment start=/;/ end=/$/ contains=@msmessagesC keepend
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
51
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
52 " String and Character constants
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
53 " Highlight special characters (those which have a escape) differently
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
54 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
55 syn region msmessagesLangEntry start=/\<Language\>\s*=\s*\S\+\s*$/hs=e+1 end=/^\./ contains=msmessagesFormat,msmessagesLangEntryEnd,msmessagesLanguage keepend
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
56 syn match msmessagesLanguage /\<Language\(\s*=\)\@=/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
57 syn match msmessagesLangEntryEnd display /^\./ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
58 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
59 syn match msmessagesFormat display /%[1-9]\d\?\(![-+0 #]*\d*\(\.\d\+\)\?\(h\|l\|ll\|I\|I32\|I64\)\?[aAcCdeEfgGinopsSuxX]!\)\?/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
60 syn match msmessagesFormat display /%[0.%\\br]/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
61 syn match msmessagesFormat display /%!\(\s\)\@=/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
62
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
63 " Integer number, or floating point number without a dot and with "f".
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
64 " Copied from c.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
65 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
66 "(long) integer
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
67 syn match msmessagesNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
68 "hex number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
69 syn match msmessagesNumber display contained "\<0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
70 " Flag the first zero of an octal number as something special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
71 syn match msmessagesOctal display contained "\<0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=msmessagesOctalZero
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
72 syn match msmessagesOctalZero display contained "\<0"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
73 " flag an octal number with wrong digits
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
74 syn match msmessagesOctalError display contained "\<0\o*[89]\d*"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
75 syn match msmessagesFloat display contained "\d\+f"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
76 "floating point number, with dot, optional exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
77 syn match msmessagesFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
78 "floating point number, starting with a dot, optional exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
79 syn match msmessagesFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
80 "floating point number, without dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
81 syn match msmessagesFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
82 "hexadecimal floating point number, optional leading digits, with dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
83 syn match msmessagesFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
84 "hexadecimal floating point number, with leading digits, optional dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
85 syn match msmessagesFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
86
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
87 " Types (used in MessageIdTypedef statement)
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
88 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
89 syn keyword msmessagesType int long short char
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
90 syn keyword msmessagesType signed unsigned
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
91 syn keyword msmessagesType size_t ssize_t sig_atomic_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
92 syn keyword msmessagesType int8_t int16_t int32_t int64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
93 syn keyword msmessagesType uint8_t uint16_t uint32_t uint64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
94 syn keyword msmessagesType int_least8_t int_least16_t int_least32_t int_least64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
95 syn keyword msmessagesType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
96 syn keyword msmessagesType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
97 syn keyword msmessagesType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
98 syn keyword msmessagesType intptr_t uintptr_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
99 syn keyword msmessagesType intmax_t uintmax_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
100 " Add some Windows datatypes that will be common in msmessages files
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
101 syn keyword msmessagesType BYTE CHAR SHORT SIZE_T SSIZE_T TBYTE TCHAR UCHAR USHORT
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
102 syn keyword msmessagesType DWORD DWORDLONG DWORD32 DWORD64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
103 syn keyword msmessagesType INT INT32 INT64 UINT UINT32 UINT64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
104 syn keyword msmessagesType LONG LONGLONG LONG32 LONG64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
105 syn keyword msmessagesType ULONG ULONGLONG ULONG32 ULONG64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
106
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
107 " Sync to language entries, since they should be most common
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
108 syn sync match msmessagesLangSync grouphere msmessagesLangEntry "\<Language\s*="
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
109 syn sync match msmessagesLangEndSync grouphere NONE "^\."
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
110
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
111 " Define the default highlighting.
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
112 hi def link msmessagesNumber Number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
113 hi def link msmessagesOctal Number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
114 hi def link msmessagesFloat Float
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
115 hi def link msmessagesOctalError msmessagesError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
116 hi def link msmessagesSetError msmessagesError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
117 hi def link msmessagesError Error
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
118 hi def link msmessagesLangEntry String
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
119 hi def link msmessagesLangEntryEnd Special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
120 hi def link msmessagesComment Comment
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
121 hi def link msmessagesFormat msmessagesSpecial
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
122 hi def link msmessagesSpecial SpecialChar
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
123
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
124 hi def link msmessagesType Type
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
125 hi def link msmessagesIdentifier Identifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
126 hi def link msmessagesLanguage msmessagesIdentifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
127 hi def link msmessagesName msmessagesIdentifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
128 hi def link msmessagesNameDef Macro
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
129 hi def link msmessagesIdentDef Macro
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
130 hi def link msmessagesValSep Special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
131 hi def link msmessagesNameErr Error
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
132
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
133 let b:current_syntax = "msmessages"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
134
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
135 " vim: ts=8