pub struct Builtin {
pub set: BuiltinSet,
pub longs: u8,
}Expand description
The keywords naming a built-in type, as the multiset that was written.
Kept rather than resolved, because the parser reads one keyword at a time and cannot tell
what long will turn out to mean until the specifier list ends. Builtin::add catches a
keyword written twice, at the place it is written, and Builtin::resolve catches a
combination that names no type once there are no more keywords coming.
Fields§
§set: BuiltinSetWhich keywords were written.
longs: u8How many times long was written, since it is the one that may repeat.
Implementations§
Source§impl Builtin
impl Builtin
Sourcepub const fn add(self, which: BuiltinSet) -> Result<Builtin, BuiltinError>
pub const fn add(self, which: BuiltinSet) -> Result<Builtin, BuiltinError>
This with one more keyword.
long is the only keyword that may be written twice, so everything else is a duplicate
the second time and is reported at the keyword rather than at the end of the specifier
list, which is where the second half of the checking happens.
§Errors
BuiltinError::Duplicate for a repeat, and BuiltinError::TooManyLongs for a third
long.
Sourcepub fn resolve(self) -> Option<Basic>
pub fn resolve(self) -> Option<Basic>
The type this combination of keywords names, and None if it names no type.
The table is the one in 6.7.2 plus the GNU and C23 rows: _Complex and _Imaginary on
the floating types, _Complex on the integer ones which GCC also allows, __int128
with a sign, and the _FloatN and _DecimalN families which stand alone.