Skip to content

Commit

Permalink
[C] Add support for C11 noreturn compiler hint
Browse files Browse the repository at this point in the history
  • Loading branch information
James Buren committed Nov 2, 2024
1 parent 6e7c53d commit 68c27e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion C++/C.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ variables:
declspec: '__declspec\(\s*\w+(?:\([^)]+\))?\s*\)'
storage_classes: 'static|extern|register|thread_local|_Thread_local|constexpr|{{declspec}}'
type_qualifier: 'const|volatile'
compiler_directive: 'inline|restrict|__restrict__|__restrict'
compiler_directive: 'inline|restrict|__restrict__|__restrict|_Noreturn|noreturn'
modifiers: '{{storage_classes}}|{{type_qualifier}}|{{compiler_directive}}'
non_func_keywords: 'if|for|switch|while|decltype|typeof|typeof_unqual|sizeof|alignof|_Alignof|static_assert|_Static_assert|__declspec|__attribute__'

Expand Down
8 changes: 8 additions & 0 deletions C++/syntax_test_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ void *null_pointer1 = NULL;
void *null_pointer2 = nullptr;
/* ^ constant.language.null */

_Noreturn
/* <- storage.modifier */
void foo(void) { abort(); }

noreturn
/* <- storage.modifier */
void bar(void) { abort(); }

FOOBAR
hello() {
/* <- meta.function entity.name.function */
Expand Down

0 comments on commit 68c27e6

Please sign in to comment.