From ff789734e228ec3b2784c3889f6598e696a59814 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 5 Jun 2024 14:20:37 +0000 Subject: [PATCH 1/2] Unparsing: update baselines for trivias preservation --- testsuite/tests/unparsing/protected_body/simple_body/test.out | 1 + testsuite/tests/unparsing/protected_body/with_entry/test.out | 1 + .../record_type_def/record_mixed_with_variant/test.out | 2 ++ .../unparsing/record_type_def/record_with_variant/test.out | 3 ++- .../single_task_decl_with_family_of_entries/test.out | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/unparsing/protected_body/simple_body/test.out b/testsuite/tests/unparsing/protected_body/simple_body/test.out index 7887a5184..51de1ea20 100644 --- a/testsuite/tests/unparsing/protected_body/simple_body/test.out +++ b/testsuite/tests/unparsing/protected_body/simple_body/test.out @@ -4,6 +4,7 @@ protected body Shared_Array is begin return Table (N); end Component; + procedure Set_Component (N : in Index; E : in Item) is begin diff --git a/testsuite/tests/unparsing/protected_body/with_entry/test.out b/testsuite/tests/unparsing/protected_body/with_entry/test.out index c3edd625b..7931d71d6 100644 --- a/testsuite/tests/unparsing/protected_body/with_entry/test.out +++ b/testsuite/tests/unparsing/protected_body/with_entry/test.out @@ -4,6 +4,7 @@ protected body Resource is begin Busy := True; end Seize; + procedure Release is begin diff --git a/testsuite/tests/unparsing/record_type_def/record_mixed_with_variant/test.out b/testsuite/tests/unparsing/record_type_def/record_mixed_with_variant/test.out index 128651a86..34696bc33 100644 --- a/testsuite/tests/unparsing/record_type_def/record_mixed_with_variant/test.out +++ b/testsuite/tests/unparsing/record_type_def/record_mixed_with_variant/test.out @@ -1,6 +1,8 @@ type Expr (Kind : Expr_Kind_Type) is record + Count : Integer; + case Kind is when Bin_Op_A | Bin_Op_B => L, R : Expr_Access; diff --git a/testsuite/tests/unparsing/record_type_def/record_with_variant/test.out b/testsuite/tests/unparsing/record_type_def/record_with_variant/test.out index 3a820bfde..5d946c55d 100644 --- a/testsuite/tests/unparsing/record_type_def/record_with_variant/test.out +++ b/testsuite/tests/unparsing/record_type_def/record_with_variant/test.out @@ -1,5 +1,6 @@ type Expr (Kind : Expr_Kind_Type) is record + case Kind is when Bin_Op_A | Bin_Op_B => L, R : Expr_Access; @@ -7,4 +8,4 @@ type Expr (Kind : Expr_Kind_Type) is when Num => Val : Integer; end case; - end record; \ No newline at end of file + end record; diff --git a/testsuite/tests/unparsing/task_type_decl/single_task_decl_with_family_of_entries/test.out b/testsuite/tests/unparsing/task_type_decl/single_task_decl_with_family_of_entries/test.out index b6d97533c..00c9f3241 100644 --- a/testsuite/tests/unparsing/task_type_decl/single_task_decl_with_family_of_entries/test.out +++ b/testsuite/tests/unparsing/task_type_decl/single_task_decl_with_family_of_entries/test.out @@ -1,3 +1,3 @@ task Controller is - entry Request (Level) (D : Item); + entry Request (Level) (D : Item); -- a family of entries end Controller; From 7ba5ce843877ee4307a1e012a1b208eed79288ac Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 5 Jun 2024 14:33:21 +0000 Subject: [PATCH 2/2] Unparsing: cap the number of consecutive empty lines to preserve --- extensions/default_unparsing_config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index 1a1272974..c704900c9 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -5746,5 +5746,6 @@ ] } } - } + }, + "max_empty_lines": 1 }