Skip to content

Commit e064051

Browse files
dkearnschrisbra
authored andcommitted
runtime(c): add new constexpr keyword to syntax file (C23)
closes: #16471 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 1d2867d commit e064051

6 files changed

Lines changed: 148 additions & 1 deletion

File tree

runtime/syntax/c.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim syntax file
22
" Language: C
33
" Maintainer: The Vim Project <https://github.com/vim/vim>
4-
" Last Change: 2025 Jan 15
4+
" Last Change: 2025 Jan 18
55
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
66

77
" Quit when a (custom) syntax file was already loaded
@@ -318,6 +318,9 @@ syn keyword cStorageClass static register auto volatile extern const
318318
if !exists("c_no_c99") && !s:in_cpp_family
319319
syn keyword cStorageClass inline restrict
320320
endif
321+
if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11"))
322+
syn keyword cStorageClass constexpr
323+
endif
321324
if !exists("c_no_c11")
322325
syn keyword cStorageClass _Alignas alignas
323326
syn keyword cOperator _Alignof alignof
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
>/+0#0000e05#ffffff0@1| |C| |k|e|y|w|o|r|d|s| +0#0000000&@61
2+
@75
3+
|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|k|e|y|w|o|r|d| +0#0000000&@24
4+
@75
5+
|a+0#00e0003&|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58
6+
|a+0#af5f00255&|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58
7+
|a+0#00e0003&|u|t|o| +0#0000000&@70
8+
|b+0#00e0003&|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61
9+
|b+0#af5f00255&|r|e|a|k| +0#0000000&@69
10+
|c+0#af5f00255&|a|s|e| +0#0000000&@70
11+
|c+0#00e0003&|h|a|r| +0#0000000&@70
12+
|c+0#00e0003&|o|n|s|t| +0#0000000&@69
13+
|c+0#00e0003&|o|n|s|t|e|x|p|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@56
14+
|c+0#af5f00255&|o|n|t|i|n|u|e| +0#0000000&@66
15+
|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67
16+
|d+0#af5f00255&|o| +0#0000000&@72
17+
|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68
18+
|e+0#af5f00255&|l|s|e| +0#0000000&@70
19+
|e+0#00e0003&|n|u|m| +0#0000000&@70
20+
@57|1|,|1| @10|T|o|p|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|c+0#af5f00255#ffffff0|o|n|t|i|n|u|e| +0#0000000&@66
2+
|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67
3+
|d+0#af5f00255&|o| +0#0000000&@72
4+
|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68
5+
|e+0#af5f00255&|l|s|e| +0#0000000&@70
6+
>e+0#00e0003&|n|u|m| +0#0000000&@70
7+
|e+0#00e0003&|x|t|e|r|n| +0#0000000&@68
8+
|f+0#e000002&|a|l|s|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@60
9+
|f+0#00e0003&|l|o|a|t| +0#0000000&@69
10+
|f+0#af5f00255&|o|r| +0#0000000&@71
11+
|g+0#af5f00255&|o|t|o| +0#0000000&@70
12+
|i+0#af5f00255&|f| +0#0000000&@72
13+
|i+0#00e0003&|n|l|i|n|e| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@59
14+
|i+0#00e0003&|n|t| +0#0000000&@71
15+
|l+0#00e0003&|o|n|g| +0#0000000&@70
16+
|n+0#e000002&|u|l@1|p|t|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58
17+
|r+0#00e0003&|e|g|i|s|t|e|r| +0#0000000&@66
18+
|r+0#00e0003&|e|s|t|r|i|c|t| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57
19+
|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@68
20+
@57|1|9|,|1| @9|2|8|%|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|r+0#af5f00255#ffffff0|e|t|u|r|n| +0#0000000&@68
2+
|s+0#00e0003&|h|o|r|t| +0#0000000&@69
3+
|s+0#00e0003&|i|g|n|e|d| +0#0000000&@68
4+
|s+0#af5f00255&|i|z|e|o|f| +0#0000000&@68
5+
|s+0#00e0003&|t|a|t|i|c| +0#0000000&@68
6+
>s+0#af5f00255&|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52
7+
|s+0#00e0003&|t|r|u|c|t| +0#0000000&@68
8+
|s+0#af5f00255&|w|i|t|c|h| +0#0000000&@68
9+
|t+0#00e0003&|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@53
10+
|t+0#e000002&|r|u|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61
11+
|t+0#00e0003&|y|p|e|d|e|f| +0#0000000&@67
12+
|t+0#af5f00255&|y|p|e|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@59
13+
|t+0#af5f00255&|y|p|e|o|f|_|u|n|q|u|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52
14+
|u+0#00e0003&|n|i|o|n| +0#0000000&@69
15+
|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&@66
16+
|v+0#00e0003&|o|i|d| +0#0000000&@70
17+
|v+0#00e0003&|o|l|a|t|i|l|e| +0#0000000&@66
18+
|w+0#af5f00255&|h|i|l|e| +0#0000000&@69
19+
@75
20+
@57|3|7|,|1| @9|6|8|%|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
| +0&#ffffff0@74
2+
|_+0#00e0003&|A|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38
3+
|_+0#af5f00255&|A|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38
4+
|_+0#00e0003&|A|t|o|m|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@58
5+
|_+0#00e0003&|B|i|t|I|n|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58
6+
>_+0#00e0003&|B|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@41
7+
|_+0#00e0003&|C|o|m|p|l|e|x| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57
8+
|_+0#00e0003&|D|e|c|i|m|a|l|1|2|8| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@54
9+
|_+0#00e0003&|D|e|c|i|m|a|l|3|2| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55
10+
|_+0#00e0003&|D|e|c|i|m|a|l|6|4| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55
11+
|_+0#af5f00255&|G|e|n|e|r|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@57
12+
|_+0#00e0003&|I|m|a|g|i|n|a|r|y| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@55
13+
|_+0#00e0003&|N|o|r|e|t|u|r|n| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@37
14+
|_+0#af5f00255&|S|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@32
15+
|_+0#00e0003&|T|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@33
16+
|~+0#4040ff13&| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
| +0#0000000&@56|5@1|,|1| @9|B|o|t|
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// C keywords
2+
3+
// Source: https://en.cppreference.com/w/c/keyword
4+
5+
alignas // (C23)
6+
alignof // (C23)
7+
auto
8+
bool // (C23)
9+
break
10+
case
11+
char
12+
const
13+
constexpr // (C23)
14+
continue
15+
default
16+
do
17+
double
18+
else
19+
enum
20+
extern
21+
false // (C23)
22+
float
23+
for
24+
goto
25+
if
26+
inline // (C99)
27+
int
28+
long
29+
nullptr // (C23)
30+
register
31+
restrict // (C99)
32+
return
33+
short
34+
signed
35+
sizeof
36+
static
37+
static_assert // (C23)
38+
struct
39+
switch
40+
thread_local // (C23)
41+
true // (C23)
42+
typedef
43+
typeof // (C23)
44+
typeof_unqual // (C23)
45+
union
46+
unsigned
47+
void
48+
volatile
49+
while
50+
51+
_Alignas // (C11)(deprecated in C23)
52+
_Alignof // (C11)(deprecated in C23)
53+
_Atomic // (C11)
54+
_BitInt // (C23)
55+
_Bool // (C99)(deprecated in C23)
56+
_Complex // (C99)
57+
_Decimal128 // (C23)
58+
_Decimal32 // (C23)
59+
_Decimal64 // (C23)
60+
_Generic // (C11)
61+
_Imaginary // (C99)
62+
_Noreturn // (C11)(deprecated in C23)
63+
_Static_assert // (C11)(deprecated in C23)
64+
_Thread_local // (C11)(deprecated in C23)

0 commit comments

Comments
 (0)