On Sat, Jun 09, 2012 at 01:06:13PM +0200, Bram Moolenaar wrote:
> The maintainer of the C++ file, Ken Shan, has not contacted us for
> almost ten years. We need someone else to maintain this syntax file.

Here it is an improved patch for C++11 keywords support in the syntax
file.

I added some previously missing keywords and removed other already
present in c.vim which has C11 support.


Best regards
-- 
Ricardo (http://r.untroubled.be/)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
# HG changeset patch
# User Ricardo Catalinas Jiménez <[email protected]>
# Date 1339243985 -7200
# Node ID c0825ff5b1ed15ad8daed77b675155e49fdda69b
# Parent  bda6f720360683d3026d6bcd7a7a5c6d63117f96
Add C++ 11 keywords to the syntax file

I made sure the added keywords were not previously included in the
c.vim script. Also removes the NPOS as it seems not useful.

diff -r bda6f7203606 -r c0825ff5b1ed runtime/syntax/cpp.vim
--- a/runtime/syntax/cpp.vim    Thu Jun 07 21:09:39 2012 +0200
+++ b/runtime/syntax/cpp.vim    Sat Jun 09 14:13:05 2012 +0200
@@ -1,7 +1,8 @@
 " Vim syntax file
 " Language:    C++
 " Maintainer:  Ken Shan <[email protected]>
-" Last Change: 2002 Jul 15
+" Contributor: Ricardo Catalinas Jiménez <[email protected]>
+" Last Change: 2012 Jun 9
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
@@ -19,7 +20,7 @@
   unlet b:current_syntax
 endif
 
-" C++ extentions
+" C++ extensions
 syn keyword cppStatement       new delete this friend using
 syn keyword cppAccess          public protected private
 syn keyword cppType            inline virtual explicit export bool wchar_t
@@ -30,9 +31,16 @@
 syn match cppCast              
"\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
 syn keyword cppStorageClass    mutable
 syn keyword cppStructure       class typename template namespace
-syn keyword cppNumber          NPOS
 syn keyword cppBoolean         true false
 
+" C++ 11 extensions
+if !exists("cpp_no_cpp11")
+  syn keyword cppType          override final
+  syn keyword cppExceptions    noexcept
+  syn keyword cppStorageClass  constexpr decltype
+  syn keyword cppConstant      nullptr
+endif
+
 " The minimum and maximum operators in GNU C++
 syn match cppMinMax "[<>]?"
 
@@ -52,8 +60,8 @@
   HiLink cppType               Type
   HiLink cppStorageClass       StorageClass
   HiLink cppStructure          Structure
-  HiLink cppNumber             Number
   HiLink cppBoolean            Boolean
+  HiLink cppConstant           Constant
   delcommand HiLink
 endif
 

Raspunde prin e-mail lui