]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Update printing container aggregates for debugging
authorViljar Indus <indus@adacore.com>
Thu, 8 Jun 2023 14:29:23 +0000 (17:29 +0300)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 27 Jun 2023 12:05:49 +0000 (14:05 +0200)
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.

gcc/ada/sprint.adb

index dd4f420af352e0f282c745053717f0b67c94628c..f54d409ef96d606210060349dea4815a541a9ad1 100644 (file)
@@ -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 =>