-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gnatformat-issue_50' into 'master'
Unparsing: Try to fit f_subp_spec, f_aspects and is on the same line Closes eng/ide/gnatformat#50 See merge request eng/libadalang/libadalang!1714
- Loading branch information
Showing
22 changed files
with
95 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
procedure Foo | ||
is | ||
procedure Foo is | ||
begin | ||
declare | ||
Bar : Baz; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
procedure Foo | ||
is | ||
procedure Foo is | ||
begin | ||
declare | ||
Bar : Baz; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
testsuite/tests/unparsing/protected_body/simple_body/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Freeeeeeeeeeeeeeed is begin | ||
null; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Freeeeeeeeeeeeeeed | ||
is | ||
begin | ||
null; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
Test a `SubpBody` whose `f_subp_spec` and `is` token do not fit on one | ||
line. |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/long_subp_spec_with_short_aspect/input.ada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function Fooooooooooooo | ||
(A : Bar; B : Baz; C : Qux) return Freeeeeeeeeeeeeeeeeed with Precondition is | ||
begin | ||
null; | ||
end; |
7 changes: 7 additions & 0 deletions
7
testsuite/tests/unparsing/subp_body/long_subp_spec_with_short_aspect/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function Fooooooooooooo | ||
(A : Bar; B : Baz; C : Qux) return Freeeeeeeeeeeeeeeeeed | ||
with Precondition | ||
is | ||
begin | ||
null; | ||
end; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/long_subp_spec_with_short_aspect/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
Test that, if the `f_subp_spec` of a `SubpBody` breaks, then a line break is | ||
added before `f_aspects` and the `is` token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
testsuite/tests/unparsing/subp_body/with_long_aspect/input.ada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Fred | ||
with Pre => Some_Long_Precondition (With_An_Aggregate => And_Looooooooooooong_R_Expr) | ||
is | ||
type My_Type; | ||
begin | ||
null; | ||
end; | ||
|
9 changes: 9 additions & 0 deletions
9
testsuite/tests/unparsing/subp_body/with_long_aspect/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Fred | ||
with | ||
Pre => | ||
Some_Long_Precondition (With_An_Aggregate => And_Looooooooooooong_R_Expr) | ||
is | ||
type My_Type; | ||
begin | ||
null; | ||
end; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/with_long_aspect/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
Test that when a `SubpBody` has an non null `f_aspects`, a line break is | ||
added before the `is` token. |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/with_short_aspect/input.ada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function Foo (A : Bar) return Fred with Pre => Precondition is | ||
type My_Type; | ||
begin | ||
null; | ||
end; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/with_short_aspect/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function Foo (A : Bar) return Fred with Pre => Precondition is | ||
type My_Type; | ||
begin | ||
null; | ||
end; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/with_short_aspect/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
Test a `SubpBody` whose `f_subp_spec` and `is` token do not fine on one | ||
line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Fred | ||
is | ||
function Foo (A : Bar; B : Baz; C : Qux; D : Corge) return Fred is | ||
begin | ||
null; | ||
end Foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
separate(Parent) | ||
procedure Inner | ||
is | ||
procedure Inner is | ||
begin | ||
Foo; | ||
end Inner; |