[Ada] Make -gnatRj output strictly conforming JSON
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 9 Jul 2019 07:53:16 +0000 (07:53 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 9 Jul 2019 07:53:16 +0000 (07:53 +0000)
commitb5d3d113ca9c67320ed06b65c50e8e46e22b6198
tree8f965ea43d3d2da860189febc5b183b5bebd0857
parent0cb51ac7fb5f28e069cc2a6094a6c0188b1aa02e
[Ada] Make -gnatRj output strictly conforming JSON

This changes the -gnatRj output from a concatenation of entities to an
array of entities, thus making it strictly conforming JSON and easier to
be parsed by means of GNATColl or Python.

2019-07-09  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.ads (JSON format): Adjust.
* repinfo.adb (Need_Blank_Line): Rename to...
(Need_Separator): ...this.
(Blank_Line): Rename to...
(Write_Separator): ...this and add JSON specific handling.
(List_Array_Info): Adjust to above renaming.
(List_Object_Info): Likewise.
(List_Record_Info): Likewise.
(List_Subprogram_Info): Likewise.
(List_Type_Info): Likewise.
(List_Entities): Do not set Need_Blank_Line.
(List_Rep_Info): Set Need_Separator and add JSON specific
handling. Output a single JSON stream in the  normal case.

From-SVN: r273265
gcc/ada/ChangeLog
gcc/ada/repinfo.adb
gcc/ada/repinfo.ads