* [COMMITTED] ada: Update printing container aggregates for debugging
@ 2023-06-27 12:07 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2023-06-27 12:07 UTC (permalink / raw)
To: gcc-patches; +Cc: Viljar Indus
From: Viljar Indus <indus@adacore.com>
All N_Aggregate nodes were printed with parentheses "()". However
the new container aggregates (homogeneous N_Aggregate nodes) should
be printed with brackets "[]".
gcc/ada/
* sprint.adb (Print_Node_Actual): Print homogeneous N_Aggregate
nodes with brackets.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sprint.adb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index dd4f420af35..f54d409ef96 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -1084,7 +1084,8 @@ package body Sprint is
Write_Str_With_Col_Check_Sloc ("(null record)");
else
- Write_Str_With_Col_Check_Sloc ("(");
+ Write_Str_With_Col_Check_Sloc
+ (if Is_Homogeneous_Aggregate (Node) then "[" else "(");
if Present (Expressions (Node)) then
Sprint_Comma_List (Expressions (Node));
@@ -1120,7 +1121,8 @@ package body Sprint is
Indent_End;
end if;
- Write_Char (')');
+ Write_Char
+ (if Is_Homogeneous_Aggregate (Node) then ']' else ')');
end if;
when N_Allocator =>
--
2.40.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-27 12:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 12:07 [COMMITTED] ada: Update printing container aggregates for debugging Marc Poulhiès
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).