GNU bug report logs -
#61482
30.0.50; tree-sitter-c doesn't support _Generic
Previous Next
Full log
View this message in rfc822 format
Po Lu <luangruo <at> yahoo.com> 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
This bug report was last modified 2 years and 215 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.