AST - Fixed loop label dump
This commit is contained in:
parent
c5c8b04355
commit
14d5b94f76
1 changed files with 6 additions and 10 deletions
16
src/ast.rs
16
src/ast.rs
|
@ -130,16 +130,12 @@ impl AstDumper for StmtNode {
|
||||||
condition,
|
condition,
|
||||||
body,
|
body,
|
||||||
} => {
|
} => {
|
||||||
format!(
|
let ltxt = if let Some(label) = label {
|
||||||
"( {}while {} {} )",
|
format!("@{} ", label.lexeme)
|
||||||
if let Some(label) = label {
|
} else {
|
||||||
&format!("@{} ", label.lexeme)
|
"".to_string()
|
||||||
} else {
|
};
|
||||||
""
|
format!("( {}while {} {} )", ltxt, condition.dump(), body.dump())
|
||||||
},
|
|
||||||
condition.dump(),
|
|
||||||
body.dump()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Self::LoopControlStmt {
|
Self::LoopControlStmt {
|
||||||
|
|
Loading…
Reference in a new issue