fix(ir): Binary syntax and func var declare
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ impl Display for IRInstr {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
IRInstr::Entry => write!(f, "entry"),
|
||||
IRInstr::Binary(dest, left, op, right) => write!(f, "{} = {} {} {}", dest, op, left, right),
|
||||
IRInstr::Binary(dest, left, op, right) => write!(f, "{} = {} {},{}", dest, op, left, right),
|
||||
IRInstr::Exit(v) => if let Some(v) = v { write!(f, "exit {}", v) } else { write!(f, "exit") },
|
||||
IRInstr::FuncCall(func, args, dest) => {
|
||||
if let Some(dest) = dest {
|
||||
@@ -89,7 +89,7 @@ pub struct Variable {
|
||||
impl Display for Variable {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let prefix = match self.var_type {
|
||||
VariableType::Global => "@",
|
||||
VariableType::Global => "@g",
|
||||
VariableType::Local => "%l",
|
||||
VariableType::Temp => "%t",
|
||||
VariableType::ParamTemp => "%t",
|
||||
|
||||
Reference in New Issue
Block a user