From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 324573858285; Sat, 15 Oct 2022 09:15:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 324573858285 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665825343; bh=+v1F2soqmpikt3el4ns8tA3tmhCEuAw+dY9M+inajoU=; h=From:To:Subject:Date:From; b=hEYX7g3S8ngUGh61ioQGpcV+5z3ng5fZeHc8CR4GqJTz2v4m+QKHAHX5mm5QeZesH lGZWa0gGfDSCVLbaf9QjR4cG6lmAyHWqV/CIr1L/zw6yg+jUWvLABB/MDjP/+oU5Vm DBfHeyXec/z4+ebrjEJ79YpU3qQaJIVKmJcMAgPE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] ast: dump: minor fixups to IfExpr formatting X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: a5a86282306eea70b7c89bd221b8e8f1afa77a2e X-Git-Newrev: 45326391da3e6800fa0a9e1f89420ac3a5ae340b Message-Id: <20221015091543.324573858285@sourceware.org> Date: Sat, 15 Oct 2022 09:15:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:45326391da3e6800fa0a9e1f89420ac3a5ae340b commit 45326391da3e6800fa0a9e1f89420ac3a5ae340b Author: David Faust Date: Thu Oct 13 09:27:35 2022 -0700 ast: dump: minor fixups to IfExpr formatting Diff: --- gcc/rust/ast/rust-ast-dump.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 3b00c9fedb6..1ba84b8efa1 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); }