diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index a872f9b0e..09eb4d8c6 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -1,9 +1,22 @@ { "node_configs": { "DottedName": { - "node": {"kind": "fill", "document": "recurse"}, + "node": { + "kind": "innerRoot", + "contents": { + "kind": "align", + "width": 2, + "contents": {"kind": "group", "document": "recurse"} + } + }, "fields": { - "f_prefix": ["recurse", "softline"] + "f_prefix": [ + { + "kind": "recurse_flatten", + "if": ["DottedName"] + }, + "softline" + ] } } } diff --git a/testsuite/tests/unparsing/dotted_name_0/doc-baseline.json b/testsuite/tests/unparsing/dotted_name_0/doc-baseline.json deleted file mode 100644 index 9a1192cdf..000000000 --- a/testsuite/tests/unparsing/dotted_name_0/doc-baseline.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": 8, - "kind": "command", - "command": { - "command": "fill", - "parts": { - "id": 7, - "kind": "list", - "list": [ - { - "id": 4, - "kind": "command", - "command": { - "command": "fill", - "parts": { - "id": 3, - "kind": "list", - "list": [ - { - "id": 0, - "kind": "text", - "text": "A" - }, - { - "id": 1, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": true, - "hard": false - } - }, - { - "id": 2, - "kind": "text", - "text": ".B" - } - ] - } - } - }, - { - "id": 5, - "kind": "command", - "command": { - "command": "line", - "literal": false, - "soft": true, - "hard": false - } - }, - { - "id": 6, - "kind": "text", - "text": ".C" - } - ] - } - } -} diff --git a/testsuite/tests/unparsing/dotted_names/long_names/doc-baseline.json b/testsuite/tests/unparsing/dotted_names/long_names/doc-baseline.json new file mode 100644 index 000000000..bba02ff75 --- /dev/null +++ b/testsuite/tests/unparsing/dotted_names/long_names/doc-baseline.json @@ -0,0 +1,72 @@ +{ + "id": 8, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 7, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": true, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": ".Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "id": 3, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": true, + "hard": false + } + }, + { + "id": 4, + "kind": "text", + "text": ".Ccccccccccccccccccccccccccccccc" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } +} diff --git a/testsuite/tests/unparsing/dotted_names/long_names/input.ada b/testsuite/tests/unparsing/dotted_names/long_names/input.ada new file mode 100644 index 000000000..d4cf353ed --- /dev/null +++ b/testsuite/tests/unparsing/dotted_names/long_names/input.ada @@ -0,0 +1 @@ +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.Ccccccccccccccccccccccccccccccc diff --git a/testsuite/tests/unparsing/dotted_names/long_names/test.out b/testsuite/tests/unparsing/dotted_names/long_names/test.out new file mode 100644 index 000000000..cb7dc0b5f --- /dev/null +++ b/testsuite/tests/unparsing/dotted_names/long_names/test.out @@ -0,0 +1,3 @@ +Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa + .Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + .Ccccccccccccccccccccccccccccccc diff --git a/testsuite/tests/unparsing/dotted_name_0/test.yaml b/testsuite/tests/unparsing/dotted_names/long_names/test.yaml similarity index 100% rename from testsuite/tests/unparsing/dotted_name_0/test.yaml rename to testsuite/tests/unparsing/dotted_names/long_names/test.yaml diff --git a/testsuite/tests/unparsing/dotted_names/short_names/doc-baseline.json b/testsuite/tests/unparsing/dotted_names/short_names/doc-baseline.json new file mode 100644 index 000000000..ecb564267 --- /dev/null +++ b/testsuite/tests/unparsing/dotted_names/short_names/doc-baseline.json @@ -0,0 +1,72 @@ +{ + "id": 8, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "innerRoot" + }, + "alignContents": { + "id": 7, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 6, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 5, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "A" + }, + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": true, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": ".B" + }, + { + "id": 3, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": true, + "hard": false + } + }, + { + "id": 4, + "kind": "text", + "text": ".C" + } + ] + }, + "break": false, + "expandedStates": null + } + } + } + } + } +} diff --git a/testsuite/tests/unparsing/dotted_name_0/input.ada b/testsuite/tests/unparsing/dotted_names/short_names/input.ada similarity index 100% rename from testsuite/tests/unparsing/dotted_name_0/input.ada rename to testsuite/tests/unparsing/dotted_names/short_names/input.ada diff --git a/testsuite/tests/unparsing/dotted_name_0/test.out b/testsuite/tests/unparsing/dotted_names/short_names/test.out similarity index 100% rename from testsuite/tests/unparsing/dotted_name_0/test.out rename to testsuite/tests/unparsing/dotted_names/short_names/test.out diff --git a/testsuite/tests/unparsing/dotted_names/short_names/test.yaml b/testsuite/tests/unparsing/dotted_names/short_names/test.yaml new file mode 100644 index 000000000..26e692904 --- /dev/null +++ b/testsuite/tests/unparsing/dotted_names/short_names/test.yaml @@ -0,0 +1,2 @@ +driver: unparser +rule: expr