From 5b266ff8fde48326893d355637908f16d1c2479a Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 6 Mar 2021 01:10:36 -0500 Subject: [PATCH] A few more C++ names in libraries. Also support for the `exports` namespace convention. --- vim/after/syntax/cpp.vim | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/vim/after/syntax/cpp.vim b/vim/after/syntax/cpp.vim index 7b52659..76f5753 100644 --- a/vim/after/syntax/cpp.vim +++ b/vim/after/syntax/cpp.vim @@ -12,6 +12,8 @@ syn keyword cppStatement try throw catch syn keyword cxxConstants nullptr +syn keyword cxxExportNamespace exports + syn match cxxConstants "\<\(C::[A-Za-z_]\|k[A-Z]\)[A-Z_a-z0-9]*\>" syn keyword cxxExceptionNames Exception Exceptions @@ -42,8 +44,14 @@ syn region cxxBoostLibrary matchgroup=cxxLibPrefix start="\<\(boost\)\z(::\)\@=" -syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary string_view mutex thread contained +" Threading +syn keyword cxxStlKeywords contained containedin=cxxStlLibrary,cxxBoostLibrary mutex condition_variable thread lock_guard scoped_lock unique_lock + +syn keyword cxxStlKeywords containedin=cxxStlLibrary byte contained + +" Strings syn keyword cxxStlKeywords containedin=cxxStlLibrary string contained +syn keyword cxxStlKeywords contained containedin=cxxStlLibrary,cxxBoostLibrary string_view syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary function contained @@ -87,8 +95,13 @@ syn keyword cxxStlFunctions containedin=cxxStlLibrary getline contained " Metafunctions/Traits -syn keyword cxxStlTraits containedin=cxxStlLibrary is_convertible contained -syn keyword cxxStlTraits containedin=cxxStlLibrary is_constructible is_default_constructible contained +syn keyword cxxLibStatement contained containedin=cxxStlLibrary decay_t +syn keyword cxxStlTypes contained containedin=cxxStlLibrary type_identity type_identity_t +syn keyword cxxStlTraits contained containedin=cxxStlLibrary is_convertible is_base_of +syn keyword cxxStlTraits contained containedin=cxxStlLibrary is_constructible is_default_constructible is_same +syn keyword cxxStlTraits contained containedin=cxxStlLibrary,cxxBoostLibrary enable_if enable_if_t +syn keyword cxxStlConstant contained containedin=cxxStlLibrary bool_constant is_same_v is_convertible_v is_constructible_v +syn keyword cxxStlConstant contained containedin=cxxStlLibrary,cxxBoostLibrary bool_constant true_type false_type is_base_of_v " Free floating STL functions syn keyword cxxStlFreeFunctions back_inserter front_inserter inserter begin end @@ -111,7 +124,8 @@ syn keyword cxxStlExceptionNames containedin=cxxStlLibrary overflow_error contai syn keyword cxxStlExceptionNames containedin=cxxStlLibrary underflow_error contained " Some common boost-only bits I use -syn keyword cxxStlKeywords contained containedin=cxxBoostLibrary lexical_cast +syn keyword cxxStlKeywords contained containedin=cxxBoostLibrary +syn keyword cxxLibStatement contained containedin=cxxBoostLibrary lexical_cast noncopyable " Highlight dangerous things syn match cxxStlDangerousFunction "\(\.\)\@<=release()" @@ -149,11 +163,15 @@ if version >= 508 || !exists("did_cxx_syntax_inits") HiLink cxxStlKeywords cppType HiLink cxxStlFunctions cppStatement HiLink cxxStlFreeFunctions cppStatement + HiLink cxxLibStatement cppStatement HiLink cxxLibPrefix Caller + HiLink cxxExportNamespace cppModule + HiLink cxxStlTraits MetaFunction HiLink cxxMetaFunction MetaFunction + HiLink cxxLibMetaFunction cxxMetaFunction HiLink cxxStlDangerousFunction Dangerous