summaryrefslogtreecommitdiffstats
path: root/syntax/cpp.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-12-20 20:57:20 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2016-12-20 20:57:20 +0100
commite404a658b1647fad396a954776eda0bdabf8353c (patch)
treefcdab0e324fd72015ba656e43bd8f8c243030c14 /syntax/cpp.vim
parent74652b465d7eff97070001317a4ea5557717378d (diff)
downloadvim-polyglot-e404a658b1647fad396a954776eda0bdabf8353c.tar.gz
vim-polyglot-e404a658b1647fad396a954776eda0bdabf8353c.zip
Update
Diffstat (limited to 'syntax/cpp.vim')
-rw-r--r--syntax/cpp.vim64
1 files changed, 26 insertions, 38 deletions
diff --git a/syntax/cpp.vim b/syntax/cpp.vim
index 8406070d..ff0c7ec2 100644
--- a/syntax/cpp.vim
+++ b/syntax/cpp.vim
@@ -4,23 +4,16 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
" Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
-" Last Change: 2015 Nov 10
+" Last Change: 2016 Oct 28
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
finish
endif
" Read the C syntax to start with
-if version < 600
- so <sfile>:p:h/c.vim
-else
- runtime! syntax/c.vim
- unlet b:current_syntax
-endif
+runtime! syntax/c.vim
+unlet b:current_syntax
" C++ extensions
syn keyword cppStatement new delete this friend using
@@ -39,8 +32,8 @@ syn keyword cppConstant __cplusplus
" C++ 11 extensions
if !exists("cpp_no_cpp11")
- syn keyword cppModifier override final auto
- syn keyword cppType nullptr_t
+ syn keyword cppModifier override final
+ syn keyword cppType nullptr_t auto
syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype thread_local
syn keyword cppConstant nullptr
@@ -55,36 +48,31 @@ endif
" C++ 14 extensions
if !exists("cpp_no_cpp14")
- syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
+ 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\)\>"
+ syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
+ syn case match
endif
" The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?"
" Default highlighting
-if version >= 508 || !exists("did_cpp_syntax_inits")
- if version < 508
- let did_cpp_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
- HiLink cppAccess cppStatement
- HiLink cppCast cppStatement
- HiLink cppExceptions Exception
- HiLink cppOperator Operator
- HiLink cppStatement Statement
- HiLink cppModifier Type
- HiLink cppType Type
- HiLink cppStorageClass StorageClass
- HiLink cppStructure Structure
- HiLink cppBoolean Boolean
- HiLink cppConstant Constant
- HiLink cppRawStringDelimiter Delimiter
- HiLink cppRawString String
- HiLink cppNumber Number
- delcommand HiLink
-endif
+hi def link cppAccess cppStatement
+hi def link cppCast cppStatement
+hi def link cppExceptions Exception
+hi def link cppOperator Operator
+hi def link cppStatement Statement
+hi def link cppModifier Type
+hi def link cppType Type
+hi def link cppStorageClass StorageClass
+hi def link cppStructure Structure
+hi def link cppBoolean Boolean
+hi def link cppConstant Constant
+hi def link cppRawStringDelimiter Delimiter
+hi def link cppRawString String
+hi def link cppNumber Number
let b:current_syntax = "cpp"