forked from aniani/vim
Update runtime files
This commit is contained in:
@@ -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: 2021 Jan 12
|
||||
" Last Change: 2021 May 04
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -44,33 +44,45 @@ if !exists("cpp_no_cpp11")
|
||||
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
||||
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 region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"\(sv\|s\|_[_a-zA-Z][_a-zA-Z0-9]*\)\=+ 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
|
||||
if !exists("cpp_no_cpp14")
|
||||
syn case ignore
|
||||
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat
|
||||
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
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
|
||||
syn match cppNumbers display transparent "\<\d\|\.\d" contains=cppNumber,cppFloat
|
||||
syn match cppNumber display contained "\<0\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppNumber display contained "\<0\o\+\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppFloat display contained "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppFloat display contained "\<\.\d\+\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppFloat display contained "\<\d\+e[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn region cppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"\(sv\|s\|_\i*\)\=+ end='$' contains=cSpecial,cFormat,@Spell
|
||||
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*$"
|
||||
syn match cppFloat display contained "\<0x\x*\.\x\+p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
syn match cppFloat display contained "\<0x\x\+\.\=p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
|
||||
endif
|
||||
|
||||
" C++ 20 extensions
|
||||
if !exists("cpp_no_cpp20")
|
||||
syn match cppNumber display contained "\<0\(y\|d\)\>"
|
||||
syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\(y\|d\)\>"
|
||||
syn match cppNumber display contained "\<0\o\+\(y\|d\)\>"
|
||||
syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\(y\|d\)\>"
|
||||
syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\(y\|d\)\>"
|
||||
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
|
||||
|
||||
" The minimum and maximum operators in GNU C++
|
||||
@@ -90,7 +102,9 @@ hi def link cppBoolean Boolean
|
||||
hi def link cppConstant Constant
|
||||
hi def link cppRawStringDelimiter Delimiter
|
||||
hi def link cppRawString String
|
||||
hi def link cppString String
|
||||
hi def link cppNumber Number
|
||||
hi def link cppFloat Number
|
||||
hi def link cppModule Include
|
||||
|
||||
let b:current_syntax = "cpp"
|
||||
|
Reference in New Issue
Block a user