Compare commits
3 Commits
8f45c8cf92
...
682295b04a
Author | SHA1 | Date | |
---|---|---|---|
682295b04a | |||
e5f6b37210 | |||
5c5c9c5f7b |
@ -629,14 +629,17 @@ impl Type {
|
||||
}
|
||||
(I32 | U32, I16 | U16 | I8 | U8) => Some(Instr::Trunc(value, other.clone())),
|
||||
(I16 | U16, I8 | U8) => Some(Instr::Trunc(value, other.clone())),
|
||||
(U8 | I8, U16 | I16 | U32 | I32 | U64 | I64 | U128 | I128) => {
|
||||
(U8 | I8, U8 | I8 | U16 | I16 | U32 | I32 | U64 | I64 | U128 | I128) => {
|
||||
Some(Instr::ZExt(value, other.clone()))
|
||||
}
|
||||
(U16 | I16, U32 | I32 | U64 | I64 | U128 | I128) => {
|
||||
(U16 | I16, U16 | I16 | U32 | I32 | U64 | I64 | U128 | I128) => {
|
||||
Some(Instr::ZExt(value, other.clone()))
|
||||
}
|
||||
(U32 | I32, U64 | I64 | U128 | I128) => Some(Instr::ZExt(value, other.clone())),
|
||||
(U64 | I64, U128 | I128) => Some(Instr::ZExt(value, other.clone())),
|
||||
(U32 | I32, U32 | I32 | U64 | I64 | U128 | I128) => {
|
||||
Some(Instr::ZExt(value, other.clone()))
|
||||
}
|
||||
(U64 | I64, U64 | I64 | U128 | I128) => Some(Instr::ZExt(value, other.clone())),
|
||||
(U128 | I128, U128 | I128) => Some(Instr::ZExt(value, other.clone())),
|
||||
(U8 | U16 | U32 | U64 | U128, F16 | F32 | F32B | F64 | F80 | F128 | F128PPC) => {
|
||||
Some(Instr::UIToFP(value, other.clone()))
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ impl Parse for PrimaryExpression {
|
||||
stream.expect(Token::BracketClose)?;
|
||||
Expression(Kind::Array(expressions), stream.get_range().unwrap())
|
||||
}
|
||||
_ => Err(stream.expected_err("expression")?)?,
|
||||
_ => Err(stream.expected_err("expression inner")?)?,
|
||||
}
|
||||
} else {
|
||||
Err(stream.expected_err("expression")?)?
|
||||
@ -662,14 +662,11 @@ impl Parse for BlockLevelStatement {
|
||||
if let Ok(SetStatement(ident, expr, range)) = stream.parse() {
|
||||
Stmt::Set(ident, expr, range)
|
||||
} else {
|
||||
if let Ok(e) = stream.parse() {
|
||||
if stream.expect(Token::Semi).is_ok() {
|
||||
Stmt::Expression(e)
|
||||
} else {
|
||||
Stmt::Return(ReturnType::Soft, e)
|
||||
}
|
||||
let e = stream.parse()?;
|
||||
if stream.expect(Token::Semi).is_ok() {
|
||||
Stmt::Expression(e)
|
||||
} else {
|
||||
Err(stream.expecting_err("expression")?)?
|
||||
Stmt::Return(ReturnType::Soft, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1085,7 +1085,8 @@ impl mir::Expression {
|
||||
},
|
||||
(TypeKind::UserPtr(_), TypeKind::UserPtr(_))
|
||||
| (TypeKind::Char, TypeKind::U8)
|
||||
| (TypeKind::U8, TypeKind::Char) => Some(StackValue(
|
||||
| (TypeKind::U8, TypeKind::Char)
|
||||
| (TypeKind::U8, TypeKind::I8) => Some(StackValue(
|
||||
val.0.derive(
|
||||
scope
|
||||
.block
|
||||
|
Loading…
Reference in New Issue
Block a user