public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] ast: dump If expressions
@ 2022-10-06 20:05 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-06 20:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e9e5288a303df10829d1f34e3d2ebff793a74ea0

commit e9e5288a303df10829d1f34e3d2ebff793a74ea0
Author: David Faust <david.faust@oracle.com>
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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-06 20:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 20:05 [gcc/devel/rust/master] ast: dump If expressions Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).