funny ints

This commit is contained in:
nora 2022-07-05 22:08:48 +02:00
parent c519241bd4
commit 8093f87fc3
9 changed files with 825 additions and 58 deletions

View file

@ -121,20 +121,40 @@ pub enum Stmt {
// --- Types and decls and garbage whatever
//
#[derive(Debug, DebugPls)]
pub enum IntTySignedness {
Signed,
Unsigned,
}
impl Default for IntTySignedness {
fn default() -> Self {
// C defaults to unsigned for integers.
Self::Signed
}
}
#[derive(Debug, DebugPls)]
pub enum IntTyKind {
Short,
Int,
Long,
LongLong,
}
#[derive(Debug, DebugPls)]
pub struct IntTy {
pub sign: IntTySignedness,
pub kind: IntTyKind,
}
#[derive(Debug, DebugPls)]
pub enum TypeSpecifier {
Void,
Char,
SChar,
UChar,
Short,
UShort,
Int,
UInt,
Long,
ULong,
LongLong,
ULongLong,
Integer(IntTy),
Float,
Double,
LongDouble,