Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions syntax/cpp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ if !exists("cpp_no_cpp20")
syn keyword cppModule import module export
endif

" C++ 23 extensions
if !exists("cpp_no_cpp23")
syn match cppNumber display contained "\<0\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0\o\+\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
Comment on lines +107 to +108
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0[bB][01]\('\=[01]\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"
syn match cppNumber display contained "\<0[xX]\x\('\=\x\+\)*\([Uu]\=[Zz]\|[Zz][Uu]\)\>"

endif

" The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?"

Expand Down