pub enum Keyword {
Show 78 variants
Auto,
Break,
Case,
Char,
Const,
Continue,
Default,
Do,
Double,
Else,
Enum,
Extern,
Float,
For,
Goto,
If,
Int,
Long,
Register,
Return,
Short,
Signed,
Sizeof,
Static,
Struct,
Switch,
Typedef,
Union,
Unsigned,
Void,
Volatile,
While,
Inline,
Restrict,
Bool,
Complex,
Imaginary,
Alignas,
Alignof,
Atomic,
Generic,
Noreturn,
StaticAssert,
ThreadLocal,
BitInt,
Decimal32,
Decimal64,
Decimal128,
Float16,
Float32,
Float64,
Float128,
Float32x,
Float64x,
Float128x,
Constexpr,
False,
Nullptr,
True,
Typeof,
TypeofUnqual,
Asm,
Attribute,
AutoType,
GnuAlignof,
Extension,
Imag,
Real,
Int128,
Label,
BuiltinOffsetof,
BuiltinChooseExpr,
BuiltinTypesCompatibleP,
BuiltinVaArg,
BuiltinVaList,
BuiltinVaStart,
BuiltinVaEnd,
BuiltinVaCopy,
}Expand description
A keyword, meaning a spelling the grammar knows rather than a name a program chose.
One variant per meaning, not per spelling. __inline__ and inline are the same keyword
because they are the same declaration specifier, and a parser that had to know which of
them was written would be carrying the difference all the way to the AST for nothing.
Where two spellings mean genuinely different things they stay apart: __alignof__ is
Keyword::GnuAlignof rather than Keyword::Alignof, because GNU’s asks for the
alignment the target prefers and C’s asks for the one the ABI requires, and on i386 they
disagree about double.
Variants§
Auto
auto.
Break
break.
Case
case.
Char
char.
Const
const, and the GNU spelling __const.
Continue
continue.
Default
default.
Do
do.
Double
double.
Else
else.
Enum
enum.
Extern
extern.
Float
float.
For
for.
Goto
goto.
If
if.
Int
int.
Long
long.
Register
register.
Return
return.
Short
short.
Signed
signed, and the GNU spelling __signed__.
Sizeof
sizeof.
Static
static.
Struct
struct.
Switch
switch.
Typedef
typedef.
Union
union.
Unsigned
unsigned.
Void
void.
Volatile
volatile, and the GNU spelling __volatile__.
While
while.
Inline
inline, from C99, and the GNU spelling __inline__.
Restrict
restrict, from C99, and the GNU spelling __restrict__.
Bool
_Bool, and bool from C23.
Complex
_Complex, and the GNU spelling __complex__.
Imaginary
_Imaginary.
Alignas
_Alignas, and alignas from C23.
Alignof
_Alignof, and alignof from C23.
Atomic
_Atomic.
Generic
_Generic.
Noreturn
_Noreturn.
StaticAssert
_Static_assert, and static_assert from C23.
ThreadLocal
_Thread_local, thread_local from C23, and the GNU spelling __thread.
BitInt
_BitInt.
Decimal32
_Decimal32.
Decimal64
_Decimal64.
Decimal128
_Decimal128.
Float16
_Float16.
Float32
_Float32.
Float64
_Float64.
Float128
_Float128.
Float32x
_Float32x.
Float64x
_Float64x.
Float128x
_Float128x.
Constexpr
constexpr, from C23.
False
false, from C23.
Nullptr
nullptr, from C23.
True
true, from C23.
Typeof
typeof, from C23 and from the GNU dialects, and the spelling __typeof__.
TypeofUnqual
typeof_unqual, from C23, and the spelling __typeof_unqual__.
Asm
asm, in the GNU dialects, and the spelling __asm__.
Attribute
__attribute__.
AutoType
__auto_type, which is not auto: it deduces from an initialiser in every dialect.
GnuAlignof
__alignof__, which asks for the preferred alignment rather than the required one.
Extension
__extension__, which turns off the pedantic diagnostics for one expression.
Imag
__imag__.
Real
__real__.
Int128
__int128.
Label
__label__, which declares a local label in a statement expression.
BuiltinOffsetof
__builtin_offsetof, which is syntax rather than a function because it takes a type.
BuiltinChooseExpr
__builtin_choose_expr.
BuiltinTypesCompatibleP
__builtin_types_compatible_p.
BuiltinVaArg
__builtin_va_arg.
BuiltinVaList
__builtin_va_list, the target’s type for a variable argument list.
BuiltinVaStart
__builtin_va_start.
BuiltinVaEnd
__builtin_va_end.
BuiltinVaCopy
__builtin_va_copy.