-
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_45' into 'master'
Add table alignment to AggregateAssoc, ComponentDecl, ObjectDecl, ParamAssoc and ParamSpec Closes eng/ide/gnatformat#45 See merge request eng/libadalang/libadalang!1710
- Loading branch information
Showing
24 changed files
with
434 additions
and
318 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,4 +1,4 @@ | ||
Foo := | ||
(Baaaar with | ||
Qux => Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
Qux => Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
Baaaz => Bazzzzzzzz); |
2 changes: 1 addition & 1 deletion
2
testsuite/tests/unparsing/bracket_aggregate/long_complete/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Foo := | ||
[Baaaar with | ||
Qux => Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
Qux => Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
Baaaz => Bazzzzzzzz]; |
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 @@ | ||
Ada.Text_IO.Put_Line (Foooooooooooo, Prettier_Ada.Documents.Json.Serialize (Document)); |
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,2 @@ | ||
Ada.Text_IO.Put_Line | ||
(Foooooooooooo, Prettier_Ada.Documents.Json.Serialize (Document)); |
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: stmt | ||
description: | | ||
Tests that if the statement is too long, the underlying `CallExpr` breaks. | ||
Additionally, this that if the `f_suffix` fits, it does not break. |
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,5 @@ | ||
Foo | ||
(AAAA => Foo_1, | ||
BB => Foo_2, | ||
CCCCCCC => Foo_3, | ||
(AAAA => Foo_1, | ||
BB => Foo_2, | ||
CCCCCCC => Foo_3, | ||
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD => 7); |
10 changes: 5 additions & 5 deletions
10
testsuite/tests/unparsing/enum_rep_clause/everything_long/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
for VeeeeeeeeeeeeryLoooooooooooongTyyyyyyyyyyyyyyyyypeNaaaaaaaaaaaame use | ||
(Aaaaaaaaaaaa => 1, | ||
Bbbbbbbbbbb => 5, | ||
Ccccccccc => 10, | ||
Dddd => 1, | ||
E => 5, | ||
F => 10); | ||
Bbbbbbbbbbb => 5, | ||
Ccccccccc => 10, | ||
Dddd => 1, | ||
E => 5, | ||
F => 10); |
10 changes: 5 additions & 5 deletions
10
testsuite/tests/unparsing/enum_rep_clause/long_aggregate/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
for T use | ||
(Aaaaaaaaaaaa => 1, | ||
Bbbbbbbbbbb => 5, | ||
Ccccccccc => 10, | ||
Dddd => 1, | ||
E => 5, | ||
F => 10); | ||
Bbbbbbbbbbb => 5, | ||
Ccccccccc => 10, | ||
Dddd => 1, | ||
E => 5, | ||
F => 10); |
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
4 changes: 2 additions & 2 deletions
4
testsuite/tests/unparsing/generic_subp_decl/empty_formal_part/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
generic | ||
function Perform_Comparison_Check | ||
(Comparing_Value : Foo_Bar_Baz; | ||
Rule_Value : Foo_Bar_Baz; | ||
Logic_Operator : Unbounded_String) return Boolean; | ||
Rule_Value : Foo_Bar_Baz; | ||
Logic_Operator : Unbounded_String) return Boolean; |
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,9 @@ | ||
procedure Main is | ||
AAAAAAAAAAAAAAAA : Baaaaaar := Bar; | ||
BBBBBBBBBBBBBBBBBBBB : Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz := | ||
Bazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz; | ||
CCCCCCCCCCCCCCCCCCCCCCCCCCCC : Quuuuuuuuuuuuuuuuuux := Qux; | ||
DDDDDDDDDDDDDDD : Corge; | ||
begin | ||
null; | ||
end Main; |
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,11 @@ | ||
procedure Main | ||
is | ||
AAAAAAAAAAAAAAAA : Baaaaaar := Bar; | ||
BBBBBBBBBBBBBBBBBBBB : | ||
Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz := | ||
Bazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz; | ||
CCCCCCCCCCCCCCCCCCCCCCCCCCCC : Quuuuuuuuuuuuuuuuuux := Qux; | ||
DDDDDDDDDDDDDDD : Corge; | ||
begin | ||
null; | ||
end Main; |
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,6 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
Test the alignemnt of the `:` and `:=` tokens on `ObjectDecl` nodes. | ||
Also test continuation line indentation when they're followed by a line | ||
break. |
4 changes: 2 additions & 2 deletions
4
testsuite/tests/unparsing/record_type_def/record_with_component_default_expr/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type Date is | ||
record | ||
A : Integer range 1 .. 31 := 15; | ||
B : Real := 0.15; | ||
C : String := "my_str"; | ||
B : Real := 0.15; | ||
C : String := "my_str"; | ||
end record; |
4 changes: 2 additions & 2 deletions
4
testsuite/tests/unparsing/record_type_def/simple_record/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type Date is | ||
record | ||
Day : Integer range 1 .. 31; | ||
Day : Integer range 1 .. 31; | ||
Month : Month_Enum; | ||
Year : Integer range 0 .. 4000; | ||
Year : Integer range 0 .. 4000; | ||
end record; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_spec/function/param_ids_diff_length/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 | ||
(AAAAAAAAAAAA : Bar; | ||
BBBBBBBBBBBBB : Baz; | ||
CCCCCCCCCCCCCC : Qux; | ||
DDDDDDDDDDDDDDD : Corge) return Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/unparsing/subp_spec/function/param_ids_diff_length/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,6 @@ | ||
function Foo | ||
(AAAAAAAAAAAA : Bar; | ||
BBBBBBBBBBBBB : Baz; | ||
CCCCCCCCCCCCCC : Qux; | ||
DDDDDDDDDDDDDDD : Corge) | ||
return Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed |
4 changes: 4 additions & 0 deletions
4
testsuite/tests/unparsing/subp_spec/function/param_ids_diff_length/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,4 @@ | ||
driver: unparser | ||
rule: subp_spec | ||
description: | | ||
Test that parameters ids of different length are aligned by the `:` token. |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_spec/function/param_ids_types_diff_length/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 | ||
(AAAAAAAAAAAAAAAA : Baaaaaar := Bar; | ||
BBBBBBBBBBBBBBBBBBBB : Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz := Bazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz; | ||
CCCCCCCCCCCCCCCCCCCCCCCCCCCC : Quuuuuuuuuuuuuuuuuux := Qux; | ||
DDDDDDDDDDDDDDD : Corge) return Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed |
8 changes: 8 additions & 0 deletions
8
testsuite/tests/unparsing/subp_spec/function/param_ids_types_diff_length/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,8 @@ | ||
function Foo | ||
(AAAAAAAAAAAAAAAA : Baaaaaar := Bar; | ||
BBBBBBBBBBBBBBBBBBBB : | ||
Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz := | ||
Bazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz; | ||
CCCCCCCCCCCCCCCCCCCCCCCCCCCC : Quuuuuuuuuuuuuuuuuux := Qux; | ||
DDDDDDDDDDDDDDD : Corge) | ||
return Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/unparsing/subp_spec/function/param_ids_types_diff_length/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,6 @@ | ||
driver: unparser | ||
rule: subp_spec | ||
description: | | ||
Test the alignemnt of the `:` and `:=` tokens on `ParamSpec` nodes. | ||
Also test continuation line indentation when they're followed by a line | ||
break. |