lower bool literal with the value from source code rather than default bool value
This commit is contained in:
parent
67351a011b
commit
d0b6b2ee2f
2 changed files with 4 additions and 3 deletions
|
@ -748,7 +748,7 @@ impl From<ast::LiteralKind> for Literal {
|
|||
LiteralKind::ByteString => Literal::ByteString(Default::default()),
|
||||
LiteralKind::String => Literal::String(Default::default()),
|
||||
LiteralKind::Byte => Literal::Int(Default::default(), Some(BuiltinInt::U8)),
|
||||
LiteralKind::Bool => Literal::Bool(Default::default()),
|
||||
LiteralKind::Bool(val) => Literal::Bool(val),
|
||||
LiteralKind::Char => Literal::Char(Default::default()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,7 +308,7 @@ pub enum LiteralKind {
|
|||
Byte,
|
||||
IntNumber { suffix: Option<SmolStr> },
|
||||
FloatNumber { suffix: Option<SmolStr> },
|
||||
Bool,
|
||||
Bool(bool),
|
||||
}
|
||||
|
||||
impl ast::Literal {
|
||||
|
@ -355,7 +355,8 @@ impl ast::Literal {
|
|||
LiteralKind::FloatNumber { suffix: Self::find_suffix(&text, &FLOAT_SUFFIXES) }
|
||||
}
|
||||
STRING | RAW_STRING => LiteralKind::String,
|
||||
T![true] | T![false] => LiteralKind::Bool,
|
||||
T![true] => LiteralKind::Bool(true),
|
||||
T![false] => LiteralKind::Bool(false),
|
||||
BYTE_STRING | RAW_BYTE_STRING => LiteralKind::ByteString,
|
||||
CHAR => LiteralKind::Char,
|
||||
BYTE => LiteralKind::Byte,
|
||||
|
|
Loading…
Add table
Reference in a new issue