annotate runtime/syntax/msmessages.vim @ 24248:883d7ceffd97 v8.2.2665

patch 8.2.2665: test failures Commit: https://github.com/vim/vim/commit/7b45d46cf7db0d2d7a4defc2d81b233a2c672b74 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 27 19:09:02 2021 +0100 patch 8.2.2665: test failures Problem: Test failures. Solution: Check more specific feature. Add missing change.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Mar 2021 19:15:03 +0100
parents 43efa4f5a8ea
children
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
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 1619
diff changeset
10 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 1619
diff changeset
11 if exists("b:current_syntax")
1619
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
12 finish
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
13 endif
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
14
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
15 " Common MS Messages keywords
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
16 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
17 syn keyword msmessagesIdentifier MessageIdTypedef
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
18 syn keyword msmessagesIdentifier SeverityNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
19 syn keyword msmessagesIdentifier FacilityNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
20 syn keyword msmessagesIdentifier LanguageNames
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
21 syn keyword msmessagesIdentifier OutputBase
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
22
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
23 syn keyword msmessagesIdentifier MessageId
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
24 syn keyword msmessagesIdentifier Severity
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
25 syn keyword msmessagesIdentifier Facility
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
26 syn keyword msmessagesIdentifier OutputBase
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
27
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
28 syn match msmessagesIdentifier /\<SymbolicName\>/ nextgroup=msmessagesIdentEq skipwhite
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
29 syn match msmessagesIdentEq transparent /=/ nextgroup=msmessagesIdentDef skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
30 syn match msmessagesIdentDef display /\w\+/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
31 " Note: The Language keyword is highlighted as part of an msmessagesLangEntry
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
32
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
33 " Set value
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
34 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
35 syn region msmessagesSet start="(" end=")" transparent fold contains=msmessagesName keepend
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
36 syn match msmessagesName /\w\+/ nextgroup=msmessagesSetEquals skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
37 syn match msmessagesSetEquals /=/ display transparent nextgroup=msmessagesNumVal skipwhite contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
38 syn match msmessagesNumVal display transparent "\<\d\|\.\d" contains=msmessagesNumber,msmessagesFloat,msmessagesOctalError,msmessagesOctal nextgroup=msmessagesValSep
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
39 syn match msmessagesValSep /:/ display nextgroup=msmessagesNameDef contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn match msmessagesNameDef /\w\+/ display contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
41
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
42
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
43 " Comments are converted to C source (by removing leading ;)
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
44 " So we highlight the comments as C
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
45 syn include @msmessagesC syntax/c.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
46 unlet b:current_syntax
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
47 syn region msmessagesCComment matchgroup=msmessagesComment start=/;/ end=/$/ contains=@msmessagesC keepend
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
48
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
49 " String and Character constants
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
50 " Highlight special characters (those which have a escape) differently
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
51 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
52 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
53 syn match msmessagesLanguage /\<Language\(\s*=\)\@=/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
54 syn match msmessagesLangEntryEnd display /^\./ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
55 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
56 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
57 syn match msmessagesFormat display /%[0.%\\br]/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
58 syn match msmessagesFormat display /%!\(\s\)\@=/ contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
59
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
60 " Integer number, or floating point number without a dot and with "f".
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
61 " Copied from c.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
62 syn case ignore
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
63 "(long) integer
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
64 syn match msmessagesNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
65 "hex number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
66 syn match msmessagesNumber display contained "\<0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
67 " Flag the first zero of an octal number as something special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
68 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
69 syn match msmessagesOctalZero display contained "\<0"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
70 " flag an octal number with wrong digits
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
71 syn match msmessagesOctalError display contained "\<0\o*[89]\d*"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
72 syn match msmessagesFloat display contained "\d\+f"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
73 "floating point number, with dot, optional exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
74 syn match msmessagesFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
75 "floating point number, starting with a dot, optional exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
76 syn match msmessagesFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
77 "floating point number, without dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
78 syn match msmessagesFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
79 "hexadecimal floating point number, optional leading digits, with dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
80 syn match msmessagesFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
81 "hexadecimal floating point number, with leading digits, optional dot, with exponent
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
82 syn match msmessagesFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
83
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
84 " Types (used in MessageIdTypedef statement)
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
85 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
86 syn keyword msmessagesType int long short char
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
87 syn keyword msmessagesType signed unsigned
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
88 syn keyword msmessagesType size_t ssize_t sig_atomic_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
89 syn keyword msmessagesType int8_t int16_t int32_t int64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
90 syn keyword msmessagesType uint8_t uint16_t uint32_t uint64_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
91 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
92 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
93 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
94 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
95 syn keyword msmessagesType intptr_t uintptr_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
96 syn keyword msmessagesType intmax_t uintmax_t
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
97 " Add some Windows datatypes that will be common in msmessages files
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
98 syn keyword msmessagesType BYTE CHAR SHORT SIZE_T SSIZE_T TBYTE TCHAR UCHAR USHORT
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
99 syn keyword msmessagesType DWORD DWORDLONG DWORD32 DWORD64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
100 syn keyword msmessagesType INT INT32 INT64 UINT UINT32 UINT64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
101 syn keyword msmessagesType LONG LONGLONG LONG32 LONG64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
102 syn keyword msmessagesType ULONG ULONGLONG ULONG32 ULONG64
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
103
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
104 " Sync to language entries, since they should be most common
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
105 syn sync match msmessagesLangSync grouphere msmessagesLangEntry "\<Language\s*="
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
106 syn sync match msmessagesLangEndSync grouphere NONE "^\."
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
107
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
108 " Define the default highlighting.
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
109 hi def link msmessagesNumber Number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
110 hi def link msmessagesOctal Number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
111 hi def link msmessagesFloat Float
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
112 hi def link msmessagesOctalError msmessagesError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
113 hi def link msmessagesSetError msmessagesError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
114 hi def link msmessagesError Error
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
115 hi def link msmessagesLangEntry String
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
116 hi def link msmessagesLangEntryEnd Special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
117 hi def link msmessagesComment Comment
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
118 hi def link msmessagesFormat msmessagesSpecial
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
119 hi def link msmessagesSpecial SpecialChar
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
120
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
121 hi def link msmessagesType Type
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
122 hi def link msmessagesIdentifier Identifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
123 hi def link msmessagesLanguage msmessagesIdentifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
124 hi def link msmessagesName msmessagesIdentifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
125 hi def link msmessagesNameDef Macro
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
126 hi def link msmessagesIdentDef Macro
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
127 hi def link msmessagesValSep Special
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
128 hi def link msmessagesNameErr Error
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
129
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
130 let b:current_syntax = "msmessages"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
131
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
132 " vim: ts=8