From d5a56477c79d0ad8de146547554233dd62be36e8 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 26 Jan 2023 18:14:16 +0100 Subject: vhdl-prints: add Print_String Move Vstring methods from formatters to prints. --- src/vhdl/vhdl-formatters.adb | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'src/vhdl/vhdl-formatters.adb') diff --git a/src/vhdl/vhdl-formatters.adb b/src/vhdl/vhdl-formatters.adb index 03c72dbaa..172894fb8 100644 --- a/src/vhdl/vhdl-formatters.adb +++ b/src/vhdl/vhdl-formatters.adb @@ -14,7 +14,6 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -with Ada.Unchecked_Deallocation; with Ada.Unchecked_Conversion; with Types; use Types; @@ -28,6 +27,8 @@ with Vhdl.Tokens; use Vhdl.Tokens; with Vhdl.Scanner; use Vhdl.Scanner; with Vhdl.Prints; use Vhdl.Prints; +with Grt.Vstrings; + package body Vhdl.Formatters is -- Check token TOK with the one from the scanner. Deal with irregular -- cases. @@ -901,33 +902,6 @@ package body Vhdl.Formatters is pragma Unreferenced (Dump_Fmt); - function Allocate_Handle return Vstring_Acc is - begin - return new Grt.Vstrings.Vstring; - end Allocate_Handle; - - function Get_Length (Handle : Vstring_Acc) return Natural is - begin - return Grt.Vstrings.Length (Handle.all); - end Get_Length; - - function Get_C_String (Handle : Vstring_Acc) - return Grt.Types.Ghdl_C_String is - begin - return Grt.Vstrings.Get_C_String (Handle.all); - end Get_C_String; - - procedure Free_Handle (Handle : Vstring_Acc) - is - procedure Deallocate is new Ada.Unchecked_Deallocation - (Grt.Vstrings.Vstring, Vstring_Acc); - Handle1 : Vstring_Acc; - begin - Grt.Vstrings.Free (Handle.all); - Handle1 := Handle; - Deallocate (Handle1); - end Free_Handle; - type Vstring_Printer_Ctxt is new Format_Disp_Ctxt.Printer_Ctxt with record Handle : Vstring_Acc; end record; -- cgit v1.2.3