AdaCore / libadalang-tools

Libadalang-based tools
GNU General Public License v3.0
16 stars 13 forks source link

gnatpp: Formatting of if statements #10

Open ProudPenguin opened 4 years ago

ProudPenguin commented 4 years ago

I like the command line options --call-threshold=nnn and --par-threshold=nnn and would like to know if such option could be also introduced for if statements?

Some unformatted example source code:

if A = 1 and B > 2 and C < 3 and D /= 4 then
   null;
end if;

Setting a new option (for example xyz-threshold) to 2 would result into:

if A = 1 and B > 2 and
   C < 3 and D /= 4 then
   null;
end if;

Or xyz-threshold=1:

if A = 1 and
   B > 2 and
   C < 3 and
   D /= 4 then
   null;
end if;
ArnaudCharlet commented 4 years ago

Thank you for your suggestion. Yes, this is technically feasible although each added option adds a cost (in terms of maintenance and in terms of users needing to make a choice), we'll consider it!