annotate runtime/syntax/cpp.vim @ 18486:9d887cad7315

Added tag v8.1.2237 for changeset 63ee3c2b140fe1b4801389872a8e47aec19d028b
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Oct 2019 20:00:04 +0100
parents bd6ff5246c71
children 180a1c5175f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: C++
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
3 " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
11473
bd6ff5246c71 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10319
diff changeset
5 " Last Change: 2017 Jun 05
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 9464
diff changeset
7 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 9464
diff changeset
8 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Read the C syntax to start with
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 9464
diff changeset
13 runtime! syntax/c.vim
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 9464
diff changeset
14 unlet b:current_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16 " C++ extensions
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn keyword cppStatement new delete this friend using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn keyword cppAccess public protected private
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
19 syn keyword cppModifier inline virtual explicit export
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
20 syn keyword cppType bool wchar_t
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword cppExceptions throw try catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword cppOperator operator typeid
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword cppStorageClass mutable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword cppStructure class typename template namespace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword cppBoolean true false
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
29 syn keyword cppConstant __cplusplus
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
31 " C++ 11 extensions
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
32 if !exists("cpp_no_cpp11")
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
33 syn keyword cppModifier override final
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
34 syn keyword cppType nullptr_t auto
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
35 syn keyword cppExceptions noexcept
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
36 syn keyword cppStorageClass constexpr decltype thread_local
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
37 syn keyword cppConstant nullptr
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
38 syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
39 syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
40 syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
41 syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
42 syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
43 syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6663
diff changeset
44 syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 endif
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
46
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
47 " C++ 14 extensions
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
48 if !exists("cpp_no_cpp14")
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
49 syn case ignore
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
50 syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
11473
bd6ff5246c71 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10319
diff changeset
51 syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
52 syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
53 syn case match
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
54 endif
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
55
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " The minimum and maximum operators in GNU C++
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match cppMinMax "[<>]?"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Default highlighting
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
60 hi def link cppAccess cppStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
61 hi def link cppCast cppStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
62 hi def link cppExceptions Exception
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
63 hi def link cppOperator Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
64 hi def link cppStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
65 hi def link cppModifier Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
66 hi def link cppType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
67 hi def link cppStorageClass StorageClass
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
68 hi def link cppStructure Structure
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
69 hi def link cppBoolean Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
70 hi def link cppConstant Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
71 hi def link cppRawStringDelimiter Delimiter
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
72 hi def link cppRawString String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
73 hi def link cppNumber Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let b:current_syntax = "cpp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " vim: ts=8