From 14d5b94f7606eef2cf34d2de18d9166a99b27cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 2 Jan 2023 11:25:18 +0100 Subject: [PATCH] AST - Fixed loop label dump --- src/ast.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 50707e0..0d63d8e 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -130,16 +130,12 @@ impl AstDumper for StmtNode { condition, body, } => { - format!( - "( {}while {} {} )", - if let Some(label) = label { - &format!("@{} ", label.lexeme) - } else { - "" - }, - condition.dump(), - body.dump() - ) + let ltxt = if let Some(label) = label { + format!("@{} ", label.lexeme) + } else { + "".to_string() + }; + format!("( {}while {} {} )", ltxt, condition.dump(), body.dump()) } Self::LoopControlStmt {