mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-16 17:45:11 +01:00
c what is this
This commit is contained in:
parent
ffd3dad040
commit
54226ad499
11 changed files with 305 additions and 57 deletions
|
|
@ -17,7 +17,7 @@ pub enum Atom {
|
|||
Ident(Ident),
|
||||
Int(u128),
|
||||
Float(f64),
|
||||
String(String),
|
||||
String(Vec<u8>),
|
||||
Char(u8),
|
||||
}
|
||||
|
||||
|
|
@ -157,8 +157,11 @@ impl Default for IntTySignedness {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, DebugPls, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, DebugPls, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
// N.B: Ord, order matters.
|
||||
pub enum IntTyKind {
|
||||
Bool,
|
||||
Char,
|
||||
Short,
|
||||
Int,
|
||||
Long,
|
||||
|
|
@ -175,13 +178,10 @@ pub struct IntTy {
|
|||
pub enum TypeSpecifier {
|
||||
Void,
|
||||
Char,
|
||||
SChar,
|
||||
UChar,
|
||||
Integer(IntTy),
|
||||
Float,
|
||||
Double,
|
||||
LongDouble,
|
||||
Bool,
|
||||
// TODO
|
||||
// complex
|
||||
// atomic-type-specifier
|
||||
|
|
@ -294,3 +294,13 @@ impl DirectDeclarator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl IntTySignedness {
|
||||
pub fn signed(self) -> bool {
|
||||
matches!(self, Self::Signed)
|
||||
}
|
||||
|
||||
pub fn unsigned(self) -> bool {
|
||||
matches!(self, Self::Unsigned)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue