summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorChristopher Di Bella <cjdb.ns@gmail.com>2023-04-26 00:39:19 -0700
committerGitHub <noreply@github.com>2023-04-26 09:39:19 +0200
commit8f6bc3ae436a4f04f71cd14c01a48266498f2f4d (patch)
tree0997ae3dbed7892e1bf5da137c7a5d006a299884 /pygments
parentadc6a48a17fe7fb7bfa81edbbf550bb9796869b6 (diff)
downloadpygments-git-8f6bc3ae436a4f04f71cd14c01a48266498f2f4d.tar.gz
Updates C and C++ lexers (#2422)
* replaces `restrict` with `__restrict` in C++ `restrict` isn't a C++ keyword, but `__restrict` is recognised by Clang, GCC, and MSVC as a language extension. * adds `_BitInt` and `__int128` as C and C++ types * `_BitInt` is a new C type and an extended integral type for C++. * `__int128` is an extended integral type on both Clang and GCC.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/c_cpp.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index aed8b4a4..ba6702f5 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -107,7 +107,8 @@ class CFamilyLexer(RegexLexer):
(words(('int8', 'int16', 'int32', 'int64', 'wchar_t'), prefix=r'__',
suffix=r'\b'), Keyword.Reserved),
(words(('bool', 'int', 'long', 'float', 'short', 'double', 'char',
- 'unsigned', 'signed', 'void'), suffix=r'\b'), Keyword.Type)
+ 'unsigned', 'signed', 'void', '_BitInt',
+ '__int128'), suffix=r'\b'), Keyword.Type)
],
'keywords': [
(r'(struct|union)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
@@ -380,7 +381,7 @@ class CppLexer(CFamilyLexer):
'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit',
'export', 'friend', 'mutable', 'new', 'operator',
'private', 'protected', 'public', 'reinterpret_cast', 'class',
- 'restrict', 'static_cast', 'template', 'this', 'throw', 'throws',
+ '__restrict', 'static_cast', 'template', 'this', 'throw', 'throws',
'try', 'typeid', 'using', 'virtual', 'constexpr', 'nullptr', 'concept',
'decltype', 'noexcept', 'override', 'final', 'constinit', 'consteval',
'co_await', 'co_return', 'co_yield', 'requires', 'import', 'module',