]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Refactor duplicate code for pretty-printing GNAT AST
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 3 Sep 2021 07:46:33 +0000 (09:46 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Oct 2021 08:45:10 +0000 (08:45 +0000)
gcc/ada/

* sprint.adb (Sprint_Node_Actual): Refactor code for generic
package and subprogram declarations.

gcc/ada/sprint.adb

index 8dc96a4f206b26d8866a2e4464ca64af29d2862f..9b78adaade4a4e5eec74acfcc30f924716293813 100644 (file)
@@ -2075,7 +2075,7 @@ package body Sprint is
             Sprint_Node (Name (Node));
             Write_Char (';');
 
-         when N_Generic_Package_Declaration =>
+         when N_Generic_Declaration =>
             Extra_Blank_Line;
             Write_Indent_Str_Sloc ("generic ");
             Sprint_Indented_List (Generic_Formal_Declarations (Node));
@@ -2097,14 +2097,6 @@ package body Sprint is
             Sprint_Node (Name (Node));
             Write_Char (';');
 
-         when N_Generic_Subprogram_Declaration =>
-            Extra_Blank_Line;
-            Write_Indent_Str_Sloc ("generic ");
-            Sprint_Indented_List (Generic_Formal_Declarations (Node));
-            Write_Indent;
-            Sprint_Node (Specification (Node));
-            Write_Char (';');
-
          when N_Goto_Statement =>
             Write_Indent_Str_Sloc ("goto ");
             Sprint_Node (Name (Node));