diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-26 18:14:16 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-26 21:56:32 +0100 |
commit | d5a56477c79d0ad8de146547554233dd62be36e8 (patch) | |
tree | f02a3934cf35a2a92d953689a4a108812eb1640e /src/vhdl/vhdl-formatters.adb | |
parent | 1c95bef128de8c1fbddf93ac61bb6ffaf1574f4a (diff) | |
download | ghdl-d5a56477c79d0ad8de146547554233dd62be36e8.tar.gz ghdl-d5a56477c79d0ad8de146547554233dd62be36e8.tar.bz2 ghdl-d5a56477c79d0ad8de146547554233dd62be36e8.zip |
vhdl-prints: add Print_String
Move Vstring methods from formatters to prints.
Diffstat (limited to 'src/vhdl/vhdl-formatters.adb')
-rw-r--r-- | src/vhdl/vhdl-formatters.adb | 30 |
1 files changed, 2 insertions, 28 deletions
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 <gnu.org/licenses>. -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; |