diff options
Diffstat (limited to 'runtime/syntax/cpp.vim')
-rw-r--r-- | runtime/syntax/cpp.vim | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim index 9cb0860e8..53b6a513f 100644 --- a/runtime/syntax/cpp.vim +++ b/runtime/syntax/cpp.vim @@ -2,7 +2,7 @@ " Language: C++ " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp) " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu> -" Last Change: 2017 Jun 05 +" Last Change: 2019 Dec 18 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -42,6 +42,8 @@ if !exists("cpp_no_cpp11") syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell + syn match cppCast "\<\(const\|static\|dynamic\)_pointer_cast\s*<"me=e-1 + syn match cppCast "\<\(const\|static\|dynamic\)_pointer_cast\s*$" endif " C++ 14 extensions @@ -53,6 +55,21 @@ if !exists("cpp_no_cpp14") syn case match endif +" C++ 20 extensions +if !exists("cpp_no_cpp20") + syn keyword cppStatement co_await co_return co_yield requires + syn keyword cppStorageClass consteval constinit + syn keyword cppStructure concept + syn keyword cppType char8_t + syn keyword cppModule import module export +endif + +" C++ 17 extensions +if !exists("cpp_no_cpp17") + syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1 + syn match cppCast "\<reinterpret_pointer_cast\s*$" +endif + " The minimum and maximum operators in GNU C++ syn match cppMinMax "[<>]?" @@ -71,6 +88,7 @@ hi def link cppConstant Constant hi def link cppRawStringDelimiter Delimiter hi def link cppRawString String hi def link cppNumber Number +hi def link cppModule Include let b:current_syntax = "cpp" |