diff --git a/C++/C.sublime-syntax b/C++/C.sublime-syntax index 8174f6f37e..7e1f30c5d7 100644 --- a/C++/C.sublime-syntax +++ b/C++/C.sublime-syntax @@ -48,7 +48,7 @@ variables: type_qualifier: 'const|volatile' compiler_directive: 'inline|restrict|__restrict__|__restrict' modifiers: '{{storage_classes}}|{{type_qualifier}}|{{compiler_directive}}' - non_func_keywords: 'if|for|switch|while|decltype|typeof|typeof_unqual|sizeof|static_assert|_Static_assert|__declspec|__attribute__' + non_func_keywords: 'if|for|switch|while|decltype|typeof|typeof_unqual|sizeof|alignof|_Alignof|static_assert|_Static_assert|__declspec|__attribute__' contexts: main: @@ -197,7 +197,7 @@ contexts: scope: keyword.control.flow.return.c - match: \b({{control_keywords}})\b scope: keyword.control.c - - match: \b(sizeof|static_assert|_Static_assert)\b + - match: \b(sizeof|alignof|_Alignof|static_assert|_Static_assert)\b scope: keyword.operator.word.c modifiers: diff --git a/C++/syntax_test_c.c b/C++/syntax_test_c.c index 02d93490f3..8d3fc0e247 100644 --- a/C++/syntax_test_c.c +++ b/C++/syntax_test_c.c @@ -224,6 +224,12 @@ typeof_unqual(i) dt; /* ^ punctuation.section.group.begin */ /* ^ punctuation.section.group.end */ +static_assert(alignof(int) == 4); +/* ^ keyword.operator.word */ + +_Static_assert(_Alignof(int) == 4); +/* ^ keyword.operator.word */ + static_assert(sizeof(int) == 4); /* <- keyword.operator.word */