From 173f98ae49d816178d8fa5b627c62aade9547d04 Mon Sep 17 00:00:00 2001 From: David Faust Date: Thu, 13 Oct 2022 10:23:44 -0700 Subject: [PATCH] gccrs: ast: dump: RangeExprs gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump for RangeExprs. --- gcc/rust/ast/rust-ast-dump.cc | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index b9e08b5..8caad98 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -622,27 +622,46 @@ Dump::visit (BreakExpr &expr) void Dump::visit (RangeFromToExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << ".."; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeFromExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << ".."; +} void Dump::visit (RangeToExpr &expr) -{} +{ + stream << ".."; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeFullExpr &expr) -{} +{ + stream << ".."; +} void Dump::visit (RangeFromToInclExpr &expr) -{} +{ + expr.get_from_expr ()->accept_vis (*this); + stream << "..="; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (RangeToInclExpr &expr) -{} +{ + stream << "..="; + expr.get_to_expr ()->accept_vis (*this); +} void Dump::visit (ReturnExpr &expr) -- 2.7.4