From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 6175B39484BD; Thu, 6 Oct 2022 20:05:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6175B39484BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665086748; bh=CEYUsXdGLZspD/w10QERfZCV7TOZqdkqNMdeistvMyI=; h=From:To:Subject:Date:From; b=v9mYtuF9czgZBv+WZJQjVvI8FKY6LWFAUScerc+irOqz+p+r90WQuM9a6wb1wnh2M CaDSqlwKKwXPTxXnHYbm0Z1FipZQYXGIvDZqZWpA/zy36+ShyFnS1AEjKjl0UBBJxw w/8OIRONgW0dWDaLVUBnc43KMlhM2hIoXvLCQW/k= 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 If expressions X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: d55f22d046f5b54ec6d77af040aa1805e12ea9d1 X-Git-Newrev: e9e5288a303df10829d1f34e3d2ebff793a74ea0 Message-Id: <20221006200548.6175B39484BD@sourceware.org> Date: Thu, 6 Oct 2022 20:05:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e9e5288a303df10829d1f34e3d2ebff793a74ea0 commit e9e5288a303df10829d1f34e3d2ebff793a74ea0 Author: David Faust Date: Wed Oct 5 10:11:38 2022 -0700 ast: dump If expressions Diff: --- gcc/rust/ast/rust-ast-dump.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index f137f4ed62c..48497b7e330 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -509,15 +509,31 @@ Dump::visit (ForLoopExpr &expr) void Dump::visit (IfExpr &expr) -{} +{ + stream << "if "; + expr.vis_if_condition (*this); + expr.vis_if_block (*this); +} void Dump::visit (IfExprConseqElse &expr) -{} +{ + stream << "if "; + expr.vis_if_condition (*this); + expr.vis_if_block (*this); + stream << indentation << "else "; + expr.vis_else_block (*this); +} void Dump::visit (IfExprConseqIf &expr) -{} +{ + stream << "if "; + expr.vis_if_condition (*this); + expr.vis_if_block (*this); + stream << indentation << "else if "; + expr.vis_conseq_if_expr (*this); +} void Dump::visit (IfExprConseqIfLet &expr)