Skip to content

Commit d644dbc

Browse files
authored
Merge pull request #40 from vivkin/master
Fix auto and remove old binary literals
2 parents 26079a1 + 1a748ce commit d644dbc

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

syntax/c.vim

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@ syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumbe
182182
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
183183
"hex number
184184
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
185-
if s:ft ==# 'cpp' && !exists("cpp_no_cpp14")
186-
syn match cNumber display contained "\d\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
187-
syn match cNumber display contained "0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
188-
syn match cNumber display contained "0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
189-
endif
190185
" Flag the first zero of an octal number as something special
191186
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
192187
syn match cOctalZero display contained "\<0"

syntax/cpp.vim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ syn keyword cppConstant __cplusplus
3737

3838
" C++ 11 extensions
3939
if !exists("cpp_no_cpp11")
40-
syn keyword cppModifier override final auto
41-
syn keyword cppType nullptr_t
40+
syn keyword cppModifier override final
41+
syn keyword cppType nullptr_t auto
4242
syn keyword cppExceptions noexcept
4343
syn keyword cppStorageClass constexpr decltype thread_local
4444
syn keyword cppConstant nullptr
@@ -53,7 +53,11 @@ endif
5353

5454
" C++ 14 extensions
5555
if !exists("cpp_no_cpp14")
56-
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
56+
syn case ignore
57+
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
58+
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
59+
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
60+
syn case match
5761
endif
5862

5963
" The minimum and maximum operators in GNU C++

0 commit comments

Comments
 (0)