split const integers into signed and unsigned

This commit is contained in:
Julius Rakow
2018-07-14 14:48:04 +02:00
parent 1e32e91877
commit 51b9eb81e8
5 changed files with 14 additions and 10 deletions

View File

@ -189,7 +189,8 @@ pub struct Const {
pub enum ConstValue {
BooleanLiteral(bool),
FloatLiteral(f64),
IntegerLiteral(i64),
SignedIntegerLiteral(i64),
UnsignedIntegerLiteral(u64),
Null,
}

View File

@ -986,11 +986,15 @@ impl ToTokens for ast::Const {
FloatLiteral(f) => {
let f = Literal::f64_unsuffixed(f);
quote!(#f)
}
IntegerLiteral(i) => {
},
SignedIntegerLiteral(i) => {
let i = Literal::i64_unsuffixed(i);
quote!(#i)
}
},
UnsignedIntegerLiteral(i) => {
let i = Literal::u64_unsuffixed(i);
quote!(#i)
},
Null => unimplemented!(),
};