-
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.
Add config for MembershipExpr and ExprAlternativesList
- Loading branch information
1 parent
cc3af8d
commit a599bb2
Showing
10 changed files
with
191 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
testsuite/tests/unparsing/membership_expr/f_op_in/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,40 @@ | ||
function Is_Expected_Parent_Kind (Kiiiiiind : Ada_Node_Kind_Type) return Boolean | ||
is (Kiiiiiiiiind.Something_That_Is_Veeeeeeeeeeeeeeeeeeeeeeery_Looooooooooooooong | ||
in Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range | ||
and Kiiiiiiiiind.Something_That_Is_Veeeeeeeeeeeeeeeeeeeeeeery_Looooooooooooooong.Foooooooooooooooo in | ||
Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range | ||
and Kiiiiiiiiind in | ||
Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range); |
44 changes: 44 additions & 0 deletions
44
testsuite/tests/unparsing/membership_expr/f_op_in/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,44 @@ | ||
function Is_Expected_Parent_Kind | ||
(Kiiiiiind : Ada_Node_Kind_Type) return Boolean | ||
is (Kiiiiiiiiind | ||
.Something_That_Is_Veeeeeeeeeeeeeeeeeeeeeeery_Looooooooooooooong | ||
in Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range | ||
and Kiiiiiiiiind | ||
.Something_That_Is_Veeeeeeeeeeeeeeeeeeeeeeery_Looooooooooooooong | ||
.Foooooooooooooooo | ||
in Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range | ||
and Kiiiiiiiiind in | ||
Ada_Package_Body | ||
| Ada_Package_Decl | ||
| Ada_Library_Item | ||
| Ada_Subp_Body | ||
| Ada_Task_Body | ||
| Ada_Decl_Block | ||
| Ada_For_Loop_Stmt | ||
| Ada_Loop_Stmt | ||
| Ada_While_Loop_Stmt | ||
| Ada_If_Stmt_Range | ||
| Ada_Case_Stmt_Range | ||
| Ada_Case_Stmt_Alternative_Range); |
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_decl | ||
description: | | ||
Test that the `f_membership_exprs` field is correctly indented based on | ||
`f_expr` when `f_op` is an `OpIn` node. |
10 changes: 10 additions & 0 deletions
10
testsuite/tests/unparsing/membership_expr/f_op_not_in/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,10 @@ | ||
procedure Foo | ||
is | ||
begin | ||
if Parent.Parent.Kind not in Ada_Begin_Block_Range | Ada_Decl_Block_Range | Bar | ||
and then Parent_Parent.Parent_Parent.Parent_Parent.Parent_Kind not in Ada_Begin_Block_Range | Ada_Decl_Block_Range | Bar | ||
and then Parent_Parent.Parent_Parent.Parent_Parent.Parent_Parent.Parent_Kind not in Ada_Begin_Block_Range | Ada_Decl_Block_Range | Bar | ||
then | ||
Current_Indentation := @ + Indentation; | ||
end if; | ||
end Foo; |
22 changes: 22 additions & 0 deletions
22
testsuite/tests/unparsing/membership_expr/f_op_not_in/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,22 @@ | ||
procedure Foo is | ||
begin | ||
if Parent.Parent.Kind not in | ||
Ada_Begin_Block_Range | ||
| Ada_Decl_Block_Range | ||
| Bar | ||
and then Parent_Parent.Parent_Parent.Parent_Parent.Parent_Kind not in | ||
Ada_Begin_Block_Range | ||
| Ada_Decl_Block_Range | ||
| Bar | ||
and then Parent_Parent | ||
.Parent_Parent | ||
.Parent_Parent | ||
.Parent_Parent | ||
.Parent_Kind | ||
not in Ada_Begin_Block_Range | ||
| Ada_Decl_Block_Range | ||
| Bar | ||
then | ||
Current_Indentation := @ + Indentation; | ||
end if; | ||
end Foo; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/membership_expr/f_op_not_in/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 the `f_membership_exprs` field is correctly indented based on | ||
`f_expr` when `f_op` is an `OpNotIn` node. |
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 @@ | ||
function Is_Expected_Parent_Kind (Kind_1, Kind_2: Ada_Node_Kind_Type) return Boolean | ||
is (Kind_1 in Ada_Package_Body and Kind_2 in Ada_Subp_Body); |
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 Is_Expected_Parent_Kind | ||
(Kind_1, Kind_2 : Ada_Node_Kind_Type) return Boolean | ||
is (Kind_1 in Ada_Package_Body and Kind_2 in Ada_Subp_Body); |
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: expr_fn | ||
description: | | ||
Test that no line breaks are added when `MembershipExpr`s fits on the line. |