From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id 568E93858438; Tue, 21 Feb 2023 11:55:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 568E93858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676980548; bh=SAYLpFuPh4cjwGncHULSpWZaNQTY3Qn2+7M+7PUPpKY=; h=From:To:Subject:Date:From; b=TiA5kzlPZGfh30+ATgROGsVGxmbS96L+d7rpNKA/su24uVTfzhFCNv8Anu1MPV/8r fUkjHTuVwonmP30Gxhu+p9xwFpno3pdrJjx3zgPJSfiQjGu4zH2d3NFREX8dFBDFX1 cRTDqaItAWbPQ8Ggb6h0H/8abqU2+Vo25BJBo/Kc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6160] gccrs: ast: dump If expressions X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/heads/master X-Git-Oldrev: 980bd25e25600b438680bc8ff69afc42d9718d94 X-Git-Newrev: aeed747093c27fcbb6f7ebd70014591e77ed6af5 Message-Id: <20230221115548.568E93858438@sourceware.org> Date: Tue, 21 Feb 2023 11:55:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:aeed747093c27fcbb6f7ebd70014591e77ed6af5 commit r13-6160-gaeed747093c27fcbb6f7ebd70014591e77ed6af5 Author: David Faust Date: Wed Oct 5 10:11:38 2022 -0700 gccrs: ast: dump If expressions gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for 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 f3d0e2d9974..bc4f7a3a5c1 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -534,15 +534,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)