aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2022-10-05 10:11:38 -0700
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:32 +0100
commitaeed747093c27fcbb6f7ebd70014591e77ed6af5 (patch)
tree4b185a403c5f88a2fbfcff7b5b6008e278e9289f
parent980bd25e25600b438680bc8ff69afc42d9718d94 (diff)
downloadgcc-aeed747093c27fcbb6f7ebd70014591e77ed6af5.zip
gcc-aeed747093c27fcbb6f7ebd70014591e77ed6af5.tar.gz
gcc-aeed747093c27fcbb6f7ebd70014591e77ed6af5.tar.bz2
gccrs: ast: dump If expressions
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Implement visitor for If expressions.
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index f3d0e2d..bc4f7a3 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)