Skip to content

Commit

Permalink
Merge branch 'issue_171' into 'master'
Browse files Browse the repository at this point in the history
Squash blank lines after ';' to a single blank line

Closes #171

See merge request eng/ide/libadalang-tools!208
  • Loading branch information
joaopsazevedo committed May 2, 2024
2 parents f883407 + 449c0e7 commit 9acf52b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pp-formatting.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- --
-- Libadalang Tools --
-- --
-- Copyright (C) 2001-2022, AdaCore --
-- Copyright (C) 2001-2024, AdaCore --
-- --
-- Libadalang Tools is free software; you can redistribute it and/or modi- --
-- fy it under terms of the GNU General Public License as published by --
Expand Down Expand Up @@ -4239,6 +4239,10 @@ package body Pp.Formatting is
or else (not Insert_Blank_Lines (Cmd)
and then Kind (Src_Tok) /= End_Of_Input)
or else Prev_Prev_Tok_Kind in Comment_Kind
or else
(Prev_Prev_Tok_Kind in ';'
and then Next_Tok_Kind not in Nil
and then Kind (Src_Tok) not in Res_End)
or else Next_Tok_Kind in Comment_Kind
then
Append_Temp_Line_Break
Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/pp/U206-003/expected/ramsim.ads
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package RAMSim is
new Bus_Device (Vendor_Id, Device_Id, Port, Native_Endian) with record
Controller : RAMsim_Control;
end record;

-- A comment about RAMsim_Ref before

type RAMsim_Ref is access all RAMsim_Device'Class;
Expand All @@ -24,6 +25,7 @@ package RAMSim is
-- A comment about Device_Setup
overriding procedure Device_Setup
(Self : in out RAMsim_Device);

-- A comment about ..
overriding procedure Device_Init
(Self : in out RAMsim_Device);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package My_Package is
type My_Enum is
(Value_A,
Value_B);

subtype My_Subtype is -- Some comment
Mode range Some_Value_A .. Some_Value_B;
end My_Package;
1 change: 1 addition & 0 deletions testsuite/tests/pp/VC19-020/test.out
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ procedure Main is
Static_Predicate =>
First_Dozen in
1 .. 2 | 3 | 4 | 5 .. 6 | 7 .. 8 | 9 .. 10 | 11 .. 12 | 13 .. 14;

function Valid_Response_Code
(Val : RFLX.RFLX_Types.Base_Integer) return Boolean is
(Val in
Expand Down

0 comments on commit 9acf52b

Please sign in to comment.