diff options
author | Christopher Di Bella <cjdb.ns@gmail.com> | 2023-04-26 00:39:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 09:39:19 +0200 |
commit | 8f6bc3ae436a4f04f71cd14c01a48266498f2f4d (patch) | |
tree | 0997ae3dbed7892e1bf5da137c7a5d006a299884 /tests | |
parent | adc6a48a17fe7fb7bfa81edbbf550bb9796869b6 (diff) | |
download | pygments-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 'tests')
-rw-r--r-- | tests/snippets/c/builtin_types.txt | 13 | ||||
-rw-r--r-- | tests/snippets/cpp/extension_keywords.txt | 17 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/snippets/c/builtin_types.txt b/tests/snippets/c/builtin_types.txt new file mode 100644 index 00000000..86778593 --- /dev/null +++ b/tests/snippets/c/builtin_types.txt @@ -0,0 +1,13 @@ +---input--- +__int128 +_BitInt(2) + +---tokens--- +'__int128' Keyword.Type +'\n' Text.Whitespace + +'_BitInt' Keyword.Type +'(' Punctuation +'2' Literal.Number.Integer +')' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/cpp/extension_keywords.txt b/tests/snippets/cpp/extension_keywords.txt new file mode 100644 index 00000000..e47eb339 --- /dev/null +++ b/tests/snippets/cpp/extension_keywords.txt @@ -0,0 +1,17 @@ +---input--- +__restrict +__int128 +_BitInt(2) + +---tokens--- +'__restrict' Keyword +'\n' Text.Whitespace + +'__int128' Keyword.Type +'\n' Text.Whitespace + +'_BitInt' Keyword.Type +'(' Punctuation +'2' Literal.Number.Integer +')' Punctuation +'\n' Text.Whitespace |