annotate runtime/syntax/cpp.vim @ 9529:581d5131629f v7.4.2045

commit https://github.com/vim/vim/commit/5ef2e762844e0eb1f5b213bd58e6bc38bdb69dac Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 15 21:29:35 2016 +0200 patch 7.4.2045 Problem: Memory leak when using a function callback. Solution: Don't save the function name when it's in the partial.
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jul 2016 21:30:07 +0200
parents be72f4201a1d
children 43efa4f5a8ea
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>
9464
be72f4201a1d commit https://github.com/vim/vim/commit/063b9d15abea041a5bfff3ffc4e219e26fd1d4fa
Christian Brabandt <cb@256bit.org>
parents: 7228
diff changeset
5 " Last Change: 2016 Jul 07
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Read the C syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 so <sfile>:p:h/c.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 runtime! syntax/c.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
23 " C++ extensions
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword cppStatement new delete this friend using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 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
26 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
27 syn keyword cppType bool wchar_t
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword cppExceptions throw try catch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword cppOperator operator typeid
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 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
31 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword cppStorageClass mutable
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword cppStructure class typename template namespace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword cppBoolean true false
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
36 syn keyword cppConstant __cplusplus
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 " C++ 11 extensions
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
39 if !exists("cpp_no_cpp11")
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
40 syn keyword cppModifier override final
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
41 syn keyword cppType nullptr_t
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
42 syn keyword cppExceptions noexcept
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
43 syn keyword cppStorageClass constexpr decltype thread_local
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 syn keyword cppConstant nullptr
6663
056809de0b29 updated for version 7.4.656
Bram Moolenaar <bram@vim.org>
parents: 5929
diff changeset
45 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
46 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
47 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
48 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
49 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
50 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
51 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
52 endif
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
54 " C++ 14 extensions
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
55 if !exists("cpp_no_cpp14")
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
56 syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
57 endif
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
58
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " The minimum and maximum operators in GNU C++
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match cppMinMax "[<>]?"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Default highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 if version >= 508 || !exists("did_cpp_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 let did_cpp_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink cppAccess cppStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink cppCast cppStatement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink cppExceptions Exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink cppOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink cppStatement Statement
7228
873eae260c97 commit https://github.com/vim/vim/commit/b4ff518d95aa57c2f8c0568c915035bef849581b
Christian Brabandt <cb@256bit.org>
parents: 6823
diff changeset
75 HiLink cppModifier Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink cppType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink cppStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink cppStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink cppBoolean Boolean
4229
fa4089df54bc Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
80 HiLink cppConstant Constant
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6663
diff changeset
81 HiLink cppRawStringDelimiter Delimiter
5929
16d26051085a Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 4229
diff changeset
82 HiLink cppRawString String
9464
be72f4201a1d commit https://github.com/vim/vim/commit/063b9d15abea041a5bfff3ffc4e219e26fd1d4fa
Christian Brabandt <cb@256bit.org>
parents: 7228
diff changeset
83 HiLink cppNumber Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 let b:current_syntax = "cpp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " vim: ts=8