aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/cpp.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/syntax/cpp.vim
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
Diffstat (limited to 'runtime/syntax/cpp.vim')
-rw-r--r--runtime/syntax/cpp.vim23
1 files changed, 22 insertions, 1 deletions
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim
index 9cb0860e84..ed38913f29 100644
--- a/runtime/syntax/cpp.vim
+++ b/runtime/syntax/cpp.vim
@@ -2,13 +2,16 @@
" 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: 2021 Jan 12
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
+" inform C syntax that the file was included from cpp.vim
+let b:filetype_in_cpp_family = 1
+
" Read the C syntax to start with
runtime! syntax/c.vim
unlet b:current_syntax
@@ -42,6 +45,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 +58,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 +91,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"