From d4b0e04fadb0101ebae50fa3d9d8762f7bca7b04 Mon Sep 17 00:00:00 2001 From: Monika Kurovszky Date: Mon, 8 Apr 2024 17:37:18 +0200 Subject: [PATCH 1/2] Add AnonymousType and AnonymousTypeDecl configs --- extensions/default_unparsing_config.json | 79 +- .../access_type/access_all/doc-baseline.json | 74 + .../access_type/access_all/input.ada | 1 + .../access_type/access_all/test.out | 1 + .../access_type/access_all/test.yaml | 7 + .../not_null_access/doc-baseline.json | 74 + .../access_type/not_null_access/input.ada | 1 + .../access_type/not_null_access/test.out | 1 + .../access_type/not_null_access/test.yaml | 7 + .../simple_access/doc-baseline.json | 74 + .../access_type/simple_access/input.ada | 1 + .../access_type/simple_access/test.out | 1 + .../access_type/simple_access/test.yaml | 6 + .../long_element_type/doc-baseline.json | 168 ++ .../array_type/long_element_type/input.ada | 1 + .../array_type/long_element_type/test.out | 2 + .../array_type/long_element_type/test.yaml | 7 + .../array_type/long_index/doc-baseline.json | 168 ++ .../array_type/long_index/input.ada | 1 + .../array_type/long_index/test.out | 2 + .../array_type/long_index/test.yaml | 7 + .../array_type/simple_decl/doc-baseline.json | 168 ++ .../array_type/simple_decl/input.ada | 1 + .../array_type/simple_decl/test.out | 1 + .../array_type/simple_decl/test.yaml | 6 + .../everything_long/doc-baseline.json | 499 +++-- .../with_aspects/doc-baseline.json | 1953 +++++++++-------- 27 files changed, 2120 insertions(+), 1191 deletions(-) create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.yaml create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.yaml create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.yaml create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/doc-baseline.json create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/input.ada create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.out create mode 100644 testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.yaml diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index 4f0b5817c..bd82a33ab 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -8,7 +8,7 @@ "kind": "text", "text": "accept" }, - "whitespace", + "whitespace", { "kind": "recurse_field", "field": "f_body_decl" @@ -30,7 +30,7 @@ }, "AcceptStmtBody": { "node": [ - { + { "kind": "recurse_field", "field": "f_name" } @@ -44,7 +44,7 @@ "kind": "text", "text": "accept" }, - "whitespace", + "whitespace", { "kind": "recurse_field", "field": "f_body_decl" @@ -66,12 +66,12 @@ "kind": "recurse_field", "field": "f_stmts" }, - "hardlineWithoutBreakParent", + "hardlineWithoutBreakParent", { "kind": "text", "text": "end" }, - "whitespace", + "whitespace", { "kind": "recurse_field", "field": "f_end_name" @@ -198,6 +198,49 @@ "whitespace" ] }, + "AnonymousType": { + "node": [ + { + "kind": "recurse_field", + "field": "f_type_decl" + } + ] + }, + "AnonymousTypeDecl": { + "node": { + "kind": "group", + "document": [ + { + "kind": "group", + "document": [ + { + "kind": "recurse_field", + "field": "f_name" + }, + { + "kind": "recurse_field", + "field": "f_discriminants" + } + ] + }, + { + "kind": "align", + "width": 2, + "contents": [ + { + "kind": "group", + "document": [ + { + "kind": "recurse_field", + "field": "f_type_def" + } + ] + } + ] + } + ] + } + }, "AspectAssoc": { "node": { "kind": "group", @@ -1464,11 +1507,11 @@ { "kind": "text", "text": "entry" - }, + }, { "kind": "recurse_field", "field": "f_entry_name" - }, + }, { "kind": "recurse_field", "field": "f_family_type" @@ -1502,7 +1545,7 @@ } ] } - ], + ], "f_entry_params": { "kind": "ifEmpty", "then": "recurse", @@ -4137,14 +4180,14 @@ { "kind": "recurse_field", "field": "f_task_type" - }, + }, { "kind": "text", "text": ";" } ] } - }, + }, "SingleTaskTypeDecl": { "node": { "kind": "group", @@ -4169,7 +4212,7 @@ { "kind": "recurse_field", "field": "f_definition" - } + } ] }, "fields": { @@ -4420,12 +4463,12 @@ "kind": "text", "text": "task" }, - "whitespace", + "whitespace", { "kind": "text", "text": "body" }, - "whitespace", + "whitespace", { "kind": "recurse_field", "field": "f_name" @@ -4481,7 +4524,7 @@ "hardlineWithoutBreakParent" ] } - }, + }, "TaskDef": { "node": { "kind": "group", @@ -4489,7 +4532,7 @@ { "kind": "text", "text": "is" - }, + }, { "kind": "recurse_field", "field": "f_interfaces" @@ -4551,7 +4594,7 @@ "contents": "recurse" } ] - } + } } }, "TaskTypeDecl": { @@ -4611,7 +4654,7 @@ "contents": [ "hardlineWithoutBreakParent", "recurse" - ] + ] } } } @@ -4946,4 +4989,4 @@ } } } -} +} \ No newline at end of file diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/doc-baseline.json new file mode 100644 index 000000000..1cc061764 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/doc-baseline.json @@ -0,0 +1,74 @@ +{ + "id": 8, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 7, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 6, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 5, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 4, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "access all Bbbbbbbbbbbbbbb" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/input.ada new file mode 100644 index 000000000..ae73c0e98 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/input.ada @@ -0,0 +1 @@ +access all Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.out new file mode 100644 index 000000000..ae73c0e98 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.out @@ -0,0 +1 @@ +access all Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.yaml new file mode 100644 index 000000000..4d0711ea3 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/access_all/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of a simple anonymous + access all type declaration. + It is expected the declaration stays on a single line. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/doc-baseline.json new file mode 100644 index 000000000..7cd329318 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/doc-baseline.json @@ -0,0 +1,74 @@ +{ + "id": 8, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 7, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 6, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 5, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 4, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "not null access Bbbbbbbbbbbbbbb" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada new file mode 100644 index 000000000..c85ef6365 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada @@ -0,0 +1 @@ +not null access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out new file mode 100644 index 000000000..c85ef6365 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out @@ -0,0 +1 @@ +not null access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml new file mode 100644 index 000000000..7e0c26842 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of a simple not null + anonymous access type declaration. + It is expected the declaration stays on a single line. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/doc-baseline.json new file mode 100644 index 000000000..a262b47d4 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/doc-baseline.json @@ -0,0 +1,74 @@ +{ + "id": 8, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 7, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 6, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 5, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 4, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "access Bbbbbbbbbbbbbbb" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/input.ada new file mode 100644 index 000000000..526d36129 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/input.ada @@ -0,0 +1 @@ +access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.out new file mode 100644 index 000000000..526d36129 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.out @@ -0,0 +1 @@ +access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml new file mode 100644 index 000000000..6e9f63743 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml @@ -0,0 +1,6 @@ +description: | + This test checks the formatting of a simple anonymous access type declaration. + It is expected the declaration stays on a single line. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/doc-baseline.json new file mode 100644 index 000000000..bea92ebee --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/doc-baseline.json @@ -0,0 +1,168 @@ +{ + "id": 20, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 19, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 18, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 17, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 16, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 15, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "array (" + }, + { + "id": 7, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 1 + }, + "alignContents": { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 4, + "kind": "list", + "list": [ + { + "id": 3, + "kind": "text", + "text": "Buffer_Index" + } + ] + } + } + }, + "break": false, + "expandedStates": null + } + } + } + }, + { + "id": 8, + "kind": "text", + "text": ")" + }, + { + "id": 9, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 10, + "kind": "text", + "text": "of" + }, + { + "id": 14, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 13, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 12, + "kind": "list", + "list": [ + { + "id": 11, + "kind": "text", + "text": " Veeeeeeeeeeeeeeery_Looooooooooooonnnnnnnnnnnng_Element_Type" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/input.ada new file mode 100644 index 000000000..73b8e35e9 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/input.ada @@ -0,0 +1 @@ +array (Buffer_Index) of Veeeeeeeeeeeeeeery_Looooooooooooonnnnnnnnnnnng_Element_Type diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.out b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.out new file mode 100644 index 000000000..5b736c099 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.out @@ -0,0 +1,2 @@ +array (Buffer_Index) + of Veeeeeeeeeeeeeeery_Looooooooooooonnnnnnnnnnnng_Element_Type diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.yaml new file mode 100644 index 000000000..7eb90196b --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_element_type/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of an anonymous array type declaration. + It is expected the declaration breaks before `of` keywords and the new + line be indented. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/doc-baseline.json new file mode 100644 index 000000000..5ff6f9a74 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/doc-baseline.json @@ -0,0 +1,168 @@ +{ + "id": 20, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 19, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 18, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 17, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 16, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 15, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "array (" + }, + { + "id": 7, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 1 + }, + "alignContents": { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 4, + "kind": "list", + "list": [ + { + "id": 3, + "kind": "text", + "text": "Veeeeeeeerrrrrrry_Loooooooooooooooooooooooooooooong_Buffer_Indexxxxxxxx" + } + ] + } + } + }, + "break": false, + "expandedStates": null + } + } + } + }, + { + "id": 8, + "kind": "text", + "text": ")" + }, + { + "id": 9, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 10, + "kind": "text", + "text": "of" + }, + { + "id": 14, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 13, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 12, + "kind": "list", + "list": [ + { + "id": 11, + "kind": "text", + "text": " Character" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/input.ada new file mode 100644 index 000000000..5be82f8d3 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/input.ada @@ -0,0 +1 @@ +array (Veeeeeeeerrrrrrry_Loooooooooooooooooooooooooooooong_Buffer_Indexxxxxxxx) of Character diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.out b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.out new file mode 100644 index 000000000..d3892322a --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.out @@ -0,0 +1,2 @@ +array (Veeeeeeeerrrrrrry_Loooooooooooooooooooooooooooooong_Buffer_Indexxxxxxxx) + of Character diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.yaml new file mode 100644 index 000000000..7eb90196b --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/long_index/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of an anonymous array type declaration. + It is expected the declaration breaks before `of` keywords and the new + line be indented. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/doc-baseline.json b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/doc-baseline.json new file mode 100644 index 000000000..53c8db8d4 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/doc-baseline.json @@ -0,0 +1,168 @@ +{ + "id": 20, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 19, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 18, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 17, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 16, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 15, + "kind": "list", + "list": [ + { + "id": 2, + "kind": "text", + "text": "array (" + }, + { + "id": 7, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 1 + }, + "alignContents": { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 4, + "kind": "list", + "list": [ + { + "id": 3, + "kind": "text", + "text": "Buffer_Index" + } + ] + } + } + }, + "break": false, + "expandedStates": null + } + } + } + }, + { + "id": 8, + "kind": "text", + "text": ")" + }, + { + "id": 9, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 10, + "kind": "text", + "text": "of" + }, + { + "id": 14, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 13, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 12, + "kind": "list", + "list": [ + { + "id": 11, + "kind": "text", + "text": " Character" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/input.ada new file mode 100644 index 000000000..6dc5fe2bb --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/input.ada @@ -0,0 +1 @@ +array (Buffer_Index) of Character diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.out b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.out new file mode 100644 index 000000000..6dc5fe2bb --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.out @@ -0,0 +1 @@ +array (Buffer_Index) of Character diff --git a/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.yaml new file mode 100644 index 000000000..e9f84a8fe --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/array_type/simple_decl/test.yaml @@ -0,0 +1,6 @@ +description: | + This test checks the formatting of an anonymous array type declaration. + It is expected the declaration stays on a single line. + +driver: unparser +rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/param_spec/everything_long/doc-baseline.json b/testsuite/tests/unparsing/param_spec/everything_long/doc-baseline.json index 2938e857d..f5257ed2c 100644 --- a/testsuite/tests/unparsing/param_spec/everything_long/doc-baseline.json +++ b/testsuite/tests/unparsing/param_spec/everything_long/doc-baseline.json @@ -1,223 +1,276 @@ -{ - "id": 28, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 27, - "kind": "list", - "list": [ - { - "id": 13, - "kind": "command", - "command": { - "command": "group", - "id": 1, - "groupContents": { - "id": 12, - "kind": "list", - "list": [ - { - "id": 1, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 0, - "kind": "text", - "text": "Fooooooooooooooooo" - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 2, - "kind": "text", - "text": " :" - }, - { - "id": 11, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 10, - "kind": "list", - "list": [ - { - "id": 3, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 9, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 8, - "kind": "list", - "list": [ - { - "id": 4, - "kind": "text", - "text": "aliased in out " - }, - { - "id": 7, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 6, - "kind": "list", - "list": [ - { - "id": 5, - "kind": "text", - "text": "not null access Baaaaaaaaaaaaaaaaaaaaaaar" - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 26, - "kind": "command", - "command": { - "command": "ifBreak", - "ifBreakGroupId": 1, - "breakContents": { - "id": 19, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 4 - }, - "alignContents": { - "id": 18, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 17, - "kind": "list", - "list": [ - { - "id": 14, - "kind": "text", - "text": " :=" - }, - { - "id": 15, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 16, - "kind": "text", - "text": "Baaaaaaaaaaaaaaaaz" - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - }, - "flatContents": { - "id": 25, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 24, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 23, - "kind": "list", - "list": [ - { - "id": 20, - "kind": "text", - "text": " :=" - }, - { - "id": 21, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 22, - "kind": "text", - "text": "Baaaaaaaaaaaaaaaaz" - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } -} +{ + "id": 34, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 33, + "kind": "list", + "list": [ + { + "id": 19, + "kind": "command", + "command": { + "command": "group", + "id": 1, + "groupContents": { + "id": 18, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 0, + "kind": "text", + "text": "Fooooooooooooooooo" + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 2, + "kind": "text", + "text": " :" + }, + { + "id": 17, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 16, + "kind": "list", + "list": [ + { + "id": 3, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 15, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 14, + "kind": "list", + "list": [ + { + "id": 4, + "kind": "text", + "text": "aliased in out " + }, + { + "id": 13, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 12, + "kind": "list", + "list": [ + { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 11, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 10, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 9, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 8, + "kind": "list", + "list": [ + { + "id": 7, + "kind": "text", + "text": "not null access Baaaaaaaaaaaaaaaaaaaaaaar" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 32, + "kind": "command", + "command": { + "command": "ifBreak", + "ifBreakGroupId": 1, + "breakContents": { + "id": 25, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 4 + }, + "alignContents": { + "id": 24, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 23, + "kind": "list", + "list": [ + { + "id": 20, + "kind": "text", + "text": " :=" + }, + { + "id": 21, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 22, + "kind": "text", + "text": "Baaaaaaaaaaaaaaaaz" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + }, + "flatContents": { + "id": 31, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 30, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 29, + "kind": "list", + "list": [ + { + "id": 26, + "kind": "text", + "text": " :=" + }, + { + "id": 27, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 28, + "kind": "text", + "text": "Baaaaaaaaaaaaaaaaz" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/protected_type_decl/with_aspects/doc-baseline.json b/testsuite/tests/unparsing/protected_type_decl/with_aspects/doc-baseline.json index c08cfcbc7..449119012 100644 --- a/testsuite/tests/unparsing/protected_type_decl/with_aspects/doc-baseline.json +++ b/testsuite/tests/unparsing/protected_type_decl/with_aspects/doc-baseline.json @@ -1,950 +1,1003 @@ -{ - "id": 119, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 118, - "kind": "list", - "list": [ - { - "id": 77, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 76, - "kind": "list", - "list": [ - { - "id": 0, - "kind": "text", - "text": "protected type Worker" - }, - { - "id": 55, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 54, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 53, - "kind": "list", - "list": [ - { - "id": 1, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 2, - "kind": "text", - "text": "(" - }, - { - "id": 51, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 1 - }, - "alignContents": { - "id": 50, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 49, - "kind": "list", - "list": [ - { - "id": 26, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 25, - "kind": "list", - "list": [ - { - "id": 17, - "kind": "command", - "command": { - "command": "group", - "id": 1, - "groupContents": { - "id": 16, - "kind": "list", - "list": [ - { - "id": 4, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 3, - "kind": "text", - "text": "Priority_Level" - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 5, - "kind": "text", - "text": " :" - }, - { - "id": 15, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 14, - "kind": "list", - "list": [ - { - "id": 6, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 13, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "innerRoot" - }, - "alignContents": { - "id": 12, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 11, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 10, - "kind": "list", - "list": [ - { - "id": 7, - "kind": "text", - "text": "System" - }, - { - "id": 8, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": true, - "hard": false - } - }, - { - "id": 9, - "kind": "text", - "text": ".Priority" - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - } - } - ] - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 24, - "kind": "command", - "command": { - "command": "ifBreak", - "ifBreakGroupId": 1, - "breakContents": { - "id": 20, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 4 - }, - "alignContents": { - "id": 19, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 18, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - } - }, - "flatContents": { - "id": 23, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 22, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 21, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 27, - "kind": "text", - "text": ";" - }, - { - "id": 28, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 48, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 47, - "kind": "list", - "list": [ - { - "id": 39, - "kind": "command", - "command": { - "command": "group", - "id": 1, - "groupContents": { - "id": 38, - "kind": "list", - "list": [ - { - "id": 30, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 29, - "kind": "text", - "text": "Buffer_Parameter" - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 31, - "kind": "text", - "text": " :" - }, - { - "id": 37, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 36, - "kind": "list", - "list": [ - { - "id": 32, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 35, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 34, - "kind": "list", - "list": [ - { - "id": 33, - "kind": "text", - "text": "access Buffer" - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 46, - "kind": "command", - "command": { - "command": "ifBreak", - "ifBreakGroupId": 1, - "breakContents": { - "id": 42, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 4 - }, - "alignContents": { - "id": 41, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 40, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - } - }, - "flatContents": { - "id": 45, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 44, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 43, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - }, - { - "id": 52, - "kind": "text", - "text": ")" - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - }, - { - "id": 73, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 72, - "kind": "list", - "list": [ - { - "id": 58, - "kind": "list", - "list": [ - { - "id": 56, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": true - } - }, - { - "id": 57, - "kind": "command", - "command": { - "command": "breakParent" - } - } - ] - }, - { - "id": 71, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 70, - "kind": "list", - "list": [ - { - "id": 59, - "kind": "text", - "text": "with" - }, - { - "id": 69, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 68, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 67, - "kind": "list", - "list": [ - { - "id": 60, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 66, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 65, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 64, - "kind": "list", - "list": [ - { - "id": 61, - "kind": "text", - "text": "Priority =>" - }, - { - "id": 62, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 63, - "kind": "text", - "text": "Prio" - } - ] - } - } - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - } - } - }, - { - "id": 74, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": false - } - }, - { - "id": 75, - "kind": "text", - "text": "is" - } - ] - }, - "break": true, - "expandedStates": null - } - }, - { - "id": 79, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 78, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 116, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 115, - "kind": "list", - "list": [ - { - "id": 110, - "kind": "command", - "command": { - "command": "indent", - "indentContents": { - "id": 109, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 108, - "kind": "list", - "list": [ - { - "id": 82, - "kind": "list", - "list": [ - { - "id": 80, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": true - } - }, - { - "id": 81, - "kind": "command", - "command": { - "command": "breakParent" - } - } - ] - }, - { - "id": 93, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 92, - "kind": "list", - "list": [ - { - "id": 90, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 89, - "kind": "list", - "list": [ - { - "id": 88, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 87, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 86, - "kind": "list", - "list": [ - { - "id": 83, - "kind": "text", - "text": "entry Fill" - }, - { - "id": 85, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 84, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 91, - "kind": "text", - "text": ";" - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 96, - "kind": "list", - "list": [ - { - "id": 94, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": true - } - }, - { - "id": 95, - "kind": "command", - "command": { - "command": "breakParent" - } - } - ] - }, - { - "id": 107, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 106, - "kind": "list", - "list": [ - { - "id": 104, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 103, - "kind": "list", - "list": [ - { - "id": 102, - "kind": "command", - "command": { - "command": "align", - "alignData": { - "kind": "width", - "n": 2 - }, - "alignContents": { - "id": 101, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 100, - "kind": "list", - "list": [ - { - "id": 97, - "kind": "text", - "text": "entry Drain" - }, - { - "id": 99, - "kind": "command", - "command": { - "command": "group", - "id": 0, - "groupContents": { - "id": 98, - "kind": "list", - "list": [ - ] - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": false, - "expandedStates": null - } - } - } - } - ] - }, - "break": false, - "expandedStates": null - } - }, - { - "id": 105, - "kind": "text", - "text": ";" - } - ] - }, - "break": false, - "expandedStates": null - } - } - ] - }, - "break": true, - "expandedStates": null - } - } - } - }, - { - "id": 113, - "kind": "list", - "list": [ - { - "id": 111, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": false, - "hard": true - } - }, - { - "id": 112, - "kind": "command", - "command": { - "command": "breakParent" - } - } - ] - }, - { - "id": 114, - "kind": "text", - "text": "end Worker" - } - ] - }, - "break": true, - "expandedStates": null - } - }, - { - "id": 117, - "kind": "text", - "text": ";" - } - ] - }, - "break": true, - "expandedStates": null - } -} +{ + "id": 125, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 124, + "kind": "list", + "list": [ + { + "id": 83, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 82, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "protected type Worker" + }, + { + "id": 61, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 60, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 59, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": "(" + }, + { + "id": 57, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 1 + }, + "alignContents": { + "id": 56, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 55, + "kind": "list", + "list": [ + { + "id": 26, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 25, + "kind": "list", + "list": [ + { + "id": 17, + "kind": "command", + "command": { + "command": "group", + "id": 1, + "groupContents": { + "id": 16, + "kind": "list", + "list": [ + { + "id": 4, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 3, + "kind": "text", + "text": "Priority_Level" + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 5, + "kind": "text", + "text": " :" + }, + { + "id": 15, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 14, + "kind": "list", + "list": [ + { + "id": 6, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 13, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 12, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 11, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 10, + "kind": "list", + "list": [ + { + "id": 7, + "kind": "text", + "text": "System" + }, + { + "id": 8, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": true, + "hard": false + } + }, + { + "id": 9, + "kind": "text", + "text": ".Priority" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } + } + ] + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 24, + "kind": "command", + "command": { + "command": "ifBreak", + "ifBreakGroupId": 1, + "breakContents": { + "id": 20, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 4 + }, + "alignContents": { + "id": 19, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 18, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + } + }, + "flatContents": { + "id": 23, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 22, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 21, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 27, + "kind": "text", + "text": ";" + }, + { + "id": 28, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 54, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 53, + "kind": "list", + "list": [ + { + "id": 45, + "kind": "command", + "command": { + "command": "group", + "id": 1, + "groupContents": { + "id": 44, + "kind": "list", + "list": [ + { + "id": 30, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 29, + "kind": "text", + "text": "Buffer_Parameter" + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 31, + "kind": "text", + "text": " :" + }, + { + "id": 43, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 42, + "kind": "list", + "list": [ + { + "id": 32, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 41, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 40, + "kind": "list", + "list": [ + { + "id": 34, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 33, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 39, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 38, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 37, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 36, + "kind": "list", + "list": [ + { + "id": 35, + "kind": "text", + "text": "access Buffer" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 52, + "kind": "command", + "command": { + "command": "ifBreak", + "ifBreakGroupId": 1, + "breakContents": { + "id": 48, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 4 + }, + "alignContents": { + "id": 47, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 46, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + } + }, + "flatContents": { + "id": 51, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 50, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 49, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + }, + { + "id": 58, + "kind": "text", + "text": ")" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + }, + { + "id": 79, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 78, + "kind": "list", + "list": [ + { + "id": 64, + "kind": "list", + "list": [ + { + "id": 62, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": true + } + }, + { + "id": 63, + "kind": "command", + "command": { + "command": "breakParent" + } + } + ] + }, + { + "id": 77, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 76, + "kind": "list", + "list": [ + { + "id": 65, + "kind": "text", + "text": "with" + }, + { + "id": 75, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 74, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 73, + "kind": "list", + "list": [ + { + "id": 66, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 72, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 71, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 70, + "kind": "list", + "list": [ + { + "id": 67, + "kind": "text", + "text": "Priority =>" + }, + { + "id": 68, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 69, + "kind": "text", + "text": "Prio" + } + ] + } + } + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + } + } + }, + { + "id": 80, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 81, + "kind": "text", + "text": "is" + } + ] + }, + "break": true, + "expandedStates": null + } + }, + { + "id": 85, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 84, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 122, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 121, + "kind": "list", + "list": [ + { + "id": 116, + "kind": "command", + "command": { + "command": "indent", + "indentContents": { + "id": 115, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 114, + "kind": "list", + "list": [ + { + "id": 88, + "kind": "list", + "list": [ + { + "id": 86, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": true + } + }, + { + "id": 87, + "kind": "command", + "command": { + "command": "breakParent" + } + } + ] + }, + { + "id": 99, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 98, + "kind": "list", + "list": [ + { + "id": 96, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 95, + "kind": "list", + "list": [ + { + "id": 94, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 93, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 92, + "kind": "list", + "list": [ + { + "id": 89, + "kind": "text", + "text": "entry Fill" + }, + { + "id": 91, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 90, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 97, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 102, + "kind": "list", + "list": [ + { + "id": 100, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": true + } + }, + { + "id": 101, + "kind": "command", + "command": { + "command": "breakParent" + } + } + ] + }, + { + "id": 113, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 112, + "kind": "list", + "list": [ + { + "id": 110, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 109, + "kind": "list", + "list": [ + { + "id": 108, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 107, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 106, + "kind": "list", + "list": [ + { + "id": 103, + "kind": "text", + "text": "entry Drain" + }, + { + "id": 105, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 104, + "kind": "list", + "list": [ + ] + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + ] + }, + "break": false, + "expandedStates": null + } + }, + { + "id": 111, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } + } + ] + }, + "break": true, + "expandedStates": null + } + } + } + }, + { + "id": 119, + "kind": "list", + "list": [ + { + "id": 117, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": true + } + }, + { + "id": 118, + "kind": "command", + "command": { + "command": "breakParent" + } + } + ] + }, + { + "id": 120, + "kind": "text", + "text": "end Worker" + } + ] + }, + "break": true, + "expandedStates": null + } + }, + { + "id": 123, + "kind": "text", + "text": ";" + } + ] + }, + "break": true, + "expandedStates": null + } +} From f639d9e1b46cd14cbad59818d2e05c034b6dd319 Mon Sep 17 00:00:00 2001 From: Monika Kurovszky Date: Tue, 9 Apr 2024 11:50:15 +0200 Subject: [PATCH 2/2] Removing AnonymousType config --- extensions/default_unparsing_config.json | 8 -------- .../access_type/simple_access/test.yaml | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index bd82a33ab..bb0502583 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -198,14 +198,6 @@ "whitespace" ] }, - "AnonymousType": { - "node": [ - { - "kind": "recurse_field", - "field": "f_type_decl" - } - ] - }, "AnonymousTypeDecl": { "node": { "kind": "group", diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml index 6e9f63743..1030b8750 100644 --- a/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/simple_access/test.yaml @@ -1,5 +1,6 @@ description: | - This test checks the formatting of a simple anonymous access type declaration. + This test checks the formatting of a simple anonymous + access type declaration. It is expected the declaration stays on a single line. driver: unparser