aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNala Ginrut <mulei@gnu.org>2020-05-03 03:08:41 +0800
committerPhilip Herron <philip.herron@embecosm.com>2020-11-28 19:10:27 +0000
commit4bbfea1e41577d62834a4a63794168847181a3c3 (patch)
tree97f1a033464bcf46302e7601a72bfd36de5dd9e4
parent9fec18623e1a937863f86cc25fa855e65e91d473 (diff)
downloadgcc-4bbfea1e41577d62834a4a63794168847181a3c3.zip
gcc-4bbfea1e41577d62834a4a63794168847181a3c3.tar.gz
gcc-4bbfea1e41577d62834a4a63794168847181a3c3.tar.bz2
Enhance let statement in AST dump
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index ac5cad7..ea19c6b 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -411,7 +411,7 @@ StaticItem::as_string () const
{
::std::string str = VisItem::as_string ();
- str += "static";
+ str += indent_spaces (stay) + "static";
if (has_mut)
{
@@ -427,7 +427,7 @@ StaticItem::as_string () const
"pointer type in static item.");
return "NULL_POINTER_MARK";
}
- str += "\n Type: " + type->as_string ();
+ str += "\n" + indent_spaces (stay) + "Type: " + type->as_string ();
// DEBUG: null pointer check
if (expr == NULL)
@@ -436,7 +436,7 @@ StaticItem::as_string () const
"pointer expr in static item.");
return "NULL_POINTER_MARK";
}
- str += "\n Expression: " + expr->as_string ();
+ str += "\n" + indent_spaces (stay) + "Expression: " + expr->as_string ();
return str + "\n";
}
@@ -3326,13 +3326,15 @@ LetStmt::as_string () const
{
// note that this does not print them with "outer attribute" syntax -
// just the body
+ indent_spaces (enter);
for (const auto &attr : outer_attrs)
{
- str += "\n " + attr.as_string ();
+ str += "\n" + indent_spaces (stay) + attr.as_string ();
}
+ indent_spaces (out);
}
- str += "\nlet " + variables_pattern->as_string ();
+ str += "\n" + indent_spaces (stay) + "let " + variables_pattern->as_string ();
if (has_type ())
{