Subject: Re: bug#61482: 30.0.50; tree-sitter-c doesn't support _Generic

From: Yuan Fu <[email-masked]>
Date: Tue, 21 Feb 2023 00:56:40 -0800

Po Lu <[email-masked]> writes:

> 2011 Standard C has a feature that works like `switch', except it
> switches upon the type of an expression at compile time.
>
> This does not seem to be supported at all with c-ts-mode:
>
> {
>   const char *typename = _Generic ((expr),
> 				   const char *:
> 				     "const char *",
> 				   int:
> 				     "int",
> 				   unsigned long:
> 				     "unsigned long",
> 				   default:
> 				     NULL);
> }
>
> here, none of the types are fontified (which fares worse than CC Mode),
> nor is _Generic fontified as a keyword.  Indenting anywhere inside the
> _Generic expression also results in nothing happening.

That’s the same as _Noreturn, tree-sitter-c doesn’t support it now. See
https://github.com/tree-sitter/tree-sitter-c/issues/124, I opened an
issue requesting for _Generic and _Noreturn. But I don’t really know
much about these features, please see if I described it correctly.

Yuan