diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index 59a53fe38..8228d38d7 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -3173,13 +3173,13 @@ { "kind": "recurse_field", "field": "f_renames" - }, - { - "kind": "recurse_field", - "field": "f_aspects" } ] }, + { + "kind": "recurse_field", + "field": "f_aspects" + }, { "kind": "text", "text": ";" @@ -3188,7 +3188,7 @@ }, "fields": { "f_aspects": [ - "hardlineWithoutBreakParent", + "line", "recurse" ] } @@ -4304,6 +4304,43 @@ ] } }, + "PackageRenamingDecl": { + "node": { + "kind": "group", + "document": [ + { + "kind": "text", + "text": "package" + }, + "whitespace", + { + "kind": "recurse_field", + "field": "f_name" + }, + { + "kind": "continuationLineIndent", + "contents": { + "kind": "recurse_field", + "field": "f_renames" + } + }, + { + "kind": "recurse_field", + "field": "f_aspects" + }, + { + "kind": "text", + "text": ";" + } + ] + }, + "fields": { + "f_aspects": [ + "line", + "recurse" + ] + } + }, "ParamAssoc": { "node": [ { @@ -4925,12 +4962,12 @@ "node": { "kind": "group", "document": [ - "whitespace", + "line", { "kind": "text", "text": "renames" }, - "line", + "whitespace", { "kind": "recurse_field", "field": "f_renamed_object" diff --git a/testsuite/tests/unparsing/exception_decl/long_complete/test.out b/testsuite/tests/unparsing/exception_decl/long_complete/test.out index a9856f6e5..b99209c8e 100644 --- a/testsuite/tests/unparsing/exception_decl/long_complete/test.out +++ b/testsuite/tests/unparsing/exception_decl/long_complete/test.out @@ -1,4 +1,4 @@ -Baaaaaaaaaaaaaaaaaaaaar : exception renames - Fooooooooooooooooooooooooooooooooooo +Baaaaaaaaaaaaaaaaaaaaar : exception + renames Fooooooooooooooooooooooooooooooooooo with Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz; diff --git a/testsuite/tests/unparsing/exception_decl/long_no_aspect/test.out b/testsuite/tests/unparsing/exception_decl/long_no_aspect/test.out index 0faf6ba82..ae01a3f5c 100644 --- a/testsuite/tests/unparsing/exception_decl/long_no_aspect/test.out +++ b/testsuite/tests/unparsing/exception_decl/long_no_aspect/test.out @@ -1,2 +1,2 @@ -Baaaaaaaaaaaaaaaaaaaaar : exception renames - Foooooooooooooooooooooooooooooooooo; +Baaaaaaaaaaaaaaaaaaaaar : exception + renames Foooooooooooooooooooooooooooooooooo; diff --git a/testsuite/tests/unparsing/generic_package_renaming_decl/long_with_aspect/test.out b/testsuite/tests/unparsing/generic_package_renaming_decl/long_with_aspect/test.out index d824d01c5..b290eba8c 100644 --- a/testsuite/tests/unparsing/generic_package_renaming_decl/long_with_aspect/test.out +++ b/testsuite/tests/unparsing/generic_package_renaming_decl/long_with_aspect/test.out @@ -1,3 +1,3 @@ generic package Foo renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar - with Baz; +with Baz; diff --git a/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.out b/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.out index 295e4c1ef..65e431164 100644 --- a/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.out +++ b/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.out @@ -1,2 +1 @@ -generic package Foo renames Bar - with Baz; +generic package Foo renames Bar with Baz; diff --git a/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.yaml b/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.yaml index 9c599a3bd..55cc8f320 100644 --- a/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.yaml +++ b/testsuite/tests/unparsing/generic_package_renaming_decl/short_with_aspect/test.yaml @@ -1,4 +1,4 @@ driver: unparser rule: generic_renaming_decl description: | - Test the line break before the `with` keyword. + Test that no line break is added before the `with` keyword. diff --git a/testsuite/tests/unparsing/no_type_object_renaming_decl/long/test.out b/testsuite/tests/unparsing/no_type_object_renaming_decl/long/test.out index 3746984f6..619c13b4d 100644 --- a/testsuite/tests/unparsing/no_type_object_renaming_decl/long/test.out +++ b/testsuite/tests/unparsing/no_type_object_renaming_decl/long/test.out @@ -1,2 +1,2 @@ -Fooooooooooooooooooooooooooooooooo renames - Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar; +Fooooooooooooooooooooooooooooooooo + renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar; diff --git a/testsuite/tests/unparsing/object_decl/everything_long_rename/input.ada b/testsuite/tests/unparsing/object_decl/everything_long_rename/input.ada index b07b10726..6589c8695 100644 --- a/testsuite/tests/unparsing/object_decl/everything_long_rename/input.ada +++ b/testsuite/tests/unparsing/object_decl/everything_long_rename/input.ada @@ -1,3 +1 @@ -Fooooooooooooooooo : - aliased constant Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa renames Baaaaaaaaaaaaaaaz; - +Fooooooooooooooooo : aliased constant Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa renames Baaaaaaaaaaaaaaaz; diff --git a/testsuite/tests/unparsing/object_decl/everything_long_rename/test.out b/testsuite/tests/unparsing/object_decl/everything_long_rename/test.out index b22a0333c..9a14e0a6f 100644 --- a/testsuite/tests/unparsing/object_decl/everything_long_rename/test.out +++ b/testsuite/tests/unparsing/object_decl/everything_long_rename/test.out @@ -1,3 +1,3 @@ Fooooooooooooooooo : - aliased constant Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa renames - Baaaaaaaaaaaaaaaz; + aliased constant Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + renames Baaaaaaaaaaaaaaaz; diff --git a/testsuite/tests/unparsing/package_renaming_decl/long/input.ada b/testsuite/tests/unparsing/package_renaming_decl/long/input.ada new file mode 100644 index 000000000..8350f5996 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long/input.ada @@ -0,0 +1 @@ +package Foo renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar; diff --git a/testsuite/tests/unparsing/package_renaming_decl/long/test.out b/testsuite/tests/unparsing/package_renaming_decl/long/test.out new file mode 100644 index 000000000..1c79ddb37 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long/test.out @@ -0,0 +1,2 @@ +package Foo + renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar; diff --git a/testsuite/tests/unparsing/package_renaming_decl/long/test.yaml b/testsuite/tests/unparsing/package_renaming_decl/long/test.yaml new file mode 100644 index 000000000..52c5f7707 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long/test.yaml @@ -0,0 +1,4 @@ +driver: unparser +rule: package_renaming_decl +description: | + Test the line break before the `renames` keyword. diff --git a/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/input.ada b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/input.ada new file mode 100644 index 000000000..aebc2e35d --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/input.ada @@ -0,0 +1 @@ +package Foo renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar with Baz; diff --git a/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.out b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.out new file mode 100644 index 000000000..82acb0a32 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.out @@ -0,0 +1,3 @@ +package Foo + renames Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar +with Baz; diff --git a/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.yaml b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.yaml new file mode 100644 index 000000000..28aa17afb --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/long_with_aspect/test.yaml @@ -0,0 +1,4 @@ +driver: unparser +rule: package_renaming_decl +description: | + Test the line break before the `renames` and `with` keywords. diff --git a/testsuite/tests/unparsing/package_renaming_decl/short/input.ada b/testsuite/tests/unparsing/package_renaming_decl/short/input.ada new file mode 100644 index 000000000..8a897600c --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short/input.ada @@ -0,0 +1 @@ +package Foo renames Bar; diff --git a/testsuite/tests/unparsing/package_renaming_decl/short/test.out b/testsuite/tests/unparsing/package_renaming_decl/short/test.out new file mode 100644 index 000000000..8a897600c --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short/test.out @@ -0,0 +1 @@ +package Foo renames Bar; diff --git a/testsuite/tests/unparsing/package_renaming_decl/short/test.yaml b/testsuite/tests/unparsing/package_renaming_decl/short/test.yaml new file mode 100644 index 000000000..14d7deb1b --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short/test.yaml @@ -0,0 +1,4 @@ +driver: unparser +rule: package_renaming_decl +description: | + Test that no line breaks are added. diff --git a/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/input.ada b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/input.ada new file mode 100644 index 000000000..d2f86e7f0 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/input.ada @@ -0,0 +1 @@ +package Foo renames Bar with Baz; diff --git a/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.out b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.out new file mode 100644 index 000000000..d2f86e7f0 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.out @@ -0,0 +1 @@ +package Foo renames Bar with Baz; diff --git a/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.yaml b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.yaml new file mode 100644 index 000000000..ba7e40054 --- /dev/null +++ b/testsuite/tests/unparsing/package_renaming_decl/short_with_aspect/test.yaml @@ -0,0 +1,4 @@ +driver: unparser +rule: package_renaming_decl +description: | + Test that no line break is added before the `with` keyword.