diff --git a/src/pp-formatting.adb b/src/pp-formatting.adb index 2d46fd25..51ecac8a 100644 --- a/src/pp-formatting.adb +++ b/src/pp-formatting.adb @@ -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 -- @@ -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 diff --git a/testsuite/tests/pp/U206-003/expected/ramsim.ads b/testsuite/tests/pp/U206-003/expected/ramsim.ads index 97bcf66c..386800b2 100644 --- a/testsuite/tests/pp/U206-003/expected/ramsim.ads +++ b/testsuite/tests/pp/U206-003/expected/ramsim.ads @@ -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; @@ -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); diff --git a/testsuite/tests/pp/VA11-017_insert_blank_lines/expected/my_package.ads b/testsuite/tests/pp/VA11-017_insert_blank_lines/expected/my_package.ads index 503b9707..74be3144 100644 --- a/testsuite/tests/pp/VA11-017_insert_blank_lines/expected/my_package.ads +++ b/testsuite/tests/pp/VA11-017_insert_blank_lines/expected/my_package.ads @@ -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; diff --git a/testsuite/tests/pp/VC19-020/test.out b/testsuite/tests/pp/VC19-020/test.out index be0624a8..8462d0ab 100644 --- a/testsuite/tests/pp/VC19-020/test.out +++ b/testsuite/tests/pp/VC19-020/test.out @@ -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