From 1fea00bb2c26897aaf4ec8af478879aae8a8a4a4 Mon Sep 17 00:00:00 2001 From: Monika Kurovszky Date: Fri, 12 Apr 2024 17:31:14 +0200 Subject: [PATCH] Add DelayStmt config --- extensions/default_unparsing_config.json | 30 ++++++++++ .../delay_stmt/has_until/doc-baseline.json | 58 +++++++++++++++++++ .../unparsing/delay_stmt/has_until/input.ada | 1 + .../unparsing/delay_stmt/has_until/test.out | 1 + .../unparsing/delay_stmt/has_until/test.yaml | 6 ++ .../long_has_until/doc-baseline.json | 58 +++++++++++++++++++ .../delay_stmt/long_has_until/input.ada | 1 + .../delay_stmt/long_has_until/test.out | 2 + .../delay_stmt/long_has_until/test.yaml | 7 +++ .../long_without_until/doc-baseline.json | 58 +++++++++++++++++++ .../delay_stmt/long_without_until/input.ada | 1 + .../delay_stmt/long_without_until/test.out | 2 + .../delay_stmt/long_without_until/test.yaml | 7 +++ .../without_until/doc-baseline.json | 58 +++++++++++++++++++ .../delay_stmt/without_until/input.ada | 1 + .../delay_stmt/without_until/test.out | 1 + .../delay_stmt/without_until/test.yaml | 6 ++ 17 files changed, 298 insertions(+) create mode 100644 testsuite/tests/unparsing/delay_stmt/has_until/doc-baseline.json create mode 100644 testsuite/tests/unparsing/delay_stmt/has_until/input.ada create mode 100644 testsuite/tests/unparsing/delay_stmt/has_until/test.out create mode 100644 testsuite/tests/unparsing/delay_stmt/has_until/test.yaml create mode 100644 testsuite/tests/unparsing/delay_stmt/long_has_until/doc-baseline.json create mode 100644 testsuite/tests/unparsing/delay_stmt/long_has_until/input.ada create mode 100644 testsuite/tests/unparsing/delay_stmt/long_has_until/test.out create mode 100644 testsuite/tests/unparsing/delay_stmt/long_has_until/test.yaml create mode 100644 testsuite/tests/unparsing/delay_stmt/long_without_until/doc-baseline.json create mode 100644 testsuite/tests/unparsing/delay_stmt/long_without_until/input.ada create mode 100644 testsuite/tests/unparsing/delay_stmt/long_without_until/test.out create mode 100644 testsuite/tests/unparsing/delay_stmt/long_without_until/test.yaml create mode 100644 testsuite/tests/unparsing/delay_stmt/without_until/doc-baseline.json create mode 100644 testsuite/tests/unparsing/delay_stmt/without_until/input.ada create mode 100644 testsuite/tests/unparsing/delay_stmt/without_until/test.out create mode 100644 testsuite/tests/unparsing/delay_stmt/without_until/test.yaml diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index 7ed5c2968..91cce8291 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -1376,6 +1376,36 @@ "line" ] }, + "DelayStmt": { + "node": { + "kind": "group", + "document": [ + { + "kind": "text", + "text": "delay" + }, + { + "kind": "recurse_field", + "field": "f_has_until" + }, + { + "kind": "align", + "width": 2, + "contents": [ + "line", + { + "kind": "recurse_field", + "field": "f_expr" + } + ] + }, + { + "kind": "text", + "text": ";" + } + ] + } + }, "DeltaAggregate": { "kind": "group", "document": [ diff --git a/testsuite/tests/unparsing/delay_stmt/has_until/doc-baseline.json b/testsuite/tests/unparsing/delay_stmt/has_until/doc-baseline.json new file mode 100644 index 000000000..b2defab05 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/has_until/doc-baseline.json @@ -0,0 +1,58 @@ +{ + "id": 7, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 6, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "delay until" + }, + { + "id": 4, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": "12" + } + ] + } + } + }, + { + "id": 5, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/delay_stmt/has_until/input.ada b/testsuite/tests/unparsing/delay_stmt/has_until/input.ada new file mode 100644 index 000000000..35dc34530 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/has_until/input.ada @@ -0,0 +1 @@ +delay until 12; diff --git a/testsuite/tests/unparsing/delay_stmt/has_until/test.out b/testsuite/tests/unparsing/delay_stmt/has_until/test.out new file mode 100644 index 000000000..35dc34530 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/has_until/test.out @@ -0,0 +1 @@ +delay until 12; diff --git a/testsuite/tests/unparsing/delay_stmt/has_until/test.yaml b/testsuite/tests/unparsing/delay_stmt/has_until/test.yaml new file mode 100644 index 000000000..d4830b4c5 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/has_until/test.yaml @@ -0,0 +1,6 @@ +description: | + This test checks the formatting of a delay statement. + It is expected the statement stays on a single line. + +driver: unparser +rule: delay_stmt diff --git a/testsuite/tests/unparsing/delay_stmt/long_has_until/doc-baseline.json b/testsuite/tests/unparsing/delay_stmt/long_has_until/doc-baseline.json new file mode 100644 index 000000000..bb0408d85 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_has_until/doc-baseline.json @@ -0,0 +1,58 @@ +{ + "id": 7, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 6, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "delay until" + }, + { + "id": 4, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": "veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal" + } + ] + } + } + }, + { + "id": 5, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/delay_stmt/long_has_until/input.ada b/testsuite/tests/unparsing/delay_stmt/long_has_until/input.ada new file mode 100644 index 000000000..c638e090c --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_has_until/input.ada @@ -0,0 +1 @@ +delay until veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal; diff --git a/testsuite/tests/unparsing/delay_stmt/long_has_until/test.out b/testsuite/tests/unparsing/delay_stmt/long_has_until/test.out new file mode 100644 index 000000000..5764ca427 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_has_until/test.out @@ -0,0 +1,2 @@ +delay until + veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal; diff --git a/testsuite/tests/unparsing/delay_stmt/long_has_until/test.yaml b/testsuite/tests/unparsing/delay_stmt/long_has_until/test.yaml new file mode 100644 index 000000000..76ca56338 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_has_until/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of a delay statement. + It is expected the statement breaks after `until` keyword + and the new line be indented. + +driver: unparser +rule: delay_stmt diff --git a/testsuite/tests/unparsing/delay_stmt/long_without_until/doc-baseline.json b/testsuite/tests/unparsing/delay_stmt/long_without_until/doc-baseline.json new file mode 100644 index 000000000..30a5a6677 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_without_until/doc-baseline.json @@ -0,0 +1,58 @@ +{ + "id": 7, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 6, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "delay" + }, + { + "id": 4, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": "veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal" + } + ] + } + } + }, + { + "id": 5, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/delay_stmt/long_without_until/input.ada b/testsuite/tests/unparsing/delay_stmt/long_without_until/input.ada new file mode 100644 index 000000000..b6c193452 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_without_until/input.ada @@ -0,0 +1 @@ +delay veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal; diff --git a/testsuite/tests/unparsing/delay_stmt/long_without_until/test.out b/testsuite/tests/unparsing/delay_stmt/long_without_until/test.out new file mode 100644 index 000000000..8b4e3199e --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_without_until/test.out @@ -0,0 +1,2 @@ +delay + veeeeeeeeeeeeeeeeeeeeeryLooooooooooooooooooooongDeeeeeeeeeeeeeeeeeeeelVaaaaaaaaaaaaal; diff --git a/testsuite/tests/unparsing/delay_stmt/long_without_until/test.yaml b/testsuite/tests/unparsing/delay_stmt/long_without_until/test.yaml new file mode 100644 index 000000000..cb2f0f587 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/long_without_until/test.yaml @@ -0,0 +1,7 @@ +description: | + This test checks the formatting of a delay statement. + It is expected the statement breaks after `delay` keyword + and the new line be indented. + +driver: unparser +rule: delay_stmt diff --git a/testsuite/tests/unparsing/delay_stmt/without_until/doc-baseline.json b/testsuite/tests/unparsing/delay_stmt/without_until/doc-baseline.json new file mode 100644 index 000000000..eb8ba2d1c --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/without_until/doc-baseline.json @@ -0,0 +1,58 @@ +{ + "id": 7, + "kind": "command", + "command": { + "command": "group", + "id": 0, + "groupContents": { + "id": 6, + "kind": "list", + "list": [ + { + "id": 0, + "kind": "text", + "text": "delay" + }, + { + "id": 4, + "kind": "command", + "command": { + "command": "align", + "alignData": { + "kind": "width", + "n": 2 + }, + "alignContents": { + "id": 3, + "kind": "list", + "list": [ + { + "id": 1, + "kind": "command", + "command": { + "command": "line", + "literal": false, + "soft": false, + "hard": false + } + }, + { + "id": 2, + "kind": "text", + "text": "Del" + } + ] + } + } + }, + { + "id": 5, + "kind": "text", + "text": ";" + } + ] + }, + "break": false, + "expandedStates": null + } +} diff --git a/testsuite/tests/unparsing/delay_stmt/without_until/input.ada b/testsuite/tests/unparsing/delay_stmt/without_until/input.ada new file mode 100644 index 000000000..09436dac3 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/without_until/input.ada @@ -0,0 +1 @@ +delay Del; diff --git a/testsuite/tests/unparsing/delay_stmt/without_until/test.out b/testsuite/tests/unparsing/delay_stmt/without_until/test.out new file mode 100644 index 000000000..09436dac3 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/without_until/test.out @@ -0,0 +1 @@ +delay Del; diff --git a/testsuite/tests/unparsing/delay_stmt/without_until/test.yaml b/testsuite/tests/unparsing/delay_stmt/without_until/test.yaml new file mode 100644 index 000000000..d4830b4c5 --- /dev/null +++ b/testsuite/tests/unparsing/delay_stmt/without_until/test.yaml @@ -0,0 +1,6 @@ +description: | + This test checks the formatting of a delay statement. + It is expected the statement stays on a single line. + +driver: unparser +rule: delay_stmt