From: David Faust Date: Thu, 13 Oct 2022 16:27:35 +0000 (-0700) Subject: gccrs: ast: dump: minor fixups to IfExpr formatting X-Git-Tag: basepoints/gcc-14~1028 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a9114c151b8a80e4c7e5e1e4823805436870cd7;p=thirdparty%2Fgcc.git gccrs: ast: dump: minor fixups to IfExpr formatting gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Fix IfExpr formatting. --- diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 3b00c9fedb68..1ba84b8efa1e 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -570,6 +570,7 @@ Dump::visit (IfExpr &expr) { stream << "if "; expr.vis_if_condition (*this); + stream << " "; expr.vis_if_block (*this); } @@ -578,6 +579,7 @@ Dump::visit (IfExprConseqElse &expr) { stream << "if "; expr.vis_if_condition (*this); + stream << " "; expr.vis_if_block (*this); stream << indentation << "else "; expr.vis_else_block (*this); @@ -588,8 +590,10 @@ Dump::visit (IfExprConseqIf &expr) { stream << "if "; expr.vis_if_condition (*this); + stream << " "; expr.vis_if_block (*this); - stream << indentation << "else if "; + stream << indentation << "else "; + // The "if" part of the "else if" is printed by the next visitor expr.vis_conseq_if_expr (*this); }