diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-15 17:23:52 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-15 17:23:52 +1200 |
commit | ce287c99ae15137138e2c5674f8f84a9c8bc1609 (patch) | |
tree | 0567cbd3dddc78f64a95d60eae1ce54d46da70a1 /src/change_vectors.ads | |
parent | 63c26c318a60efd20485978624352befd5f6c5ee (diff) |
Constants marked constant, code style improvements, redundant with clauses removed
Diffstat (limited to 'src/change_vectors.ads')
-rw-r--r-- | src/change_vectors.ads | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/change_vectors.ads b/src/change_vectors.ads index e325821..86048a9 100644 --- a/src/change_vectors.ads +++ b/src/change_vectors.ads @@ -19,58 +19,53 @@ package Change_Vectors is type Change_Vector is tagged private; - - type Change is - record - Action : FLTK.Text_Buffers.Modification; - Place : FLTK.Text_Buffers.Position; - Length : Natural; - Text : Unbounded_String; - end record; + type Change is record + Action : FLTK.Text_Buffers.Modification; + Place : FLTK.Text_Buffers.Position; + Length : Natural; + Text : Unbounded_String; + end record; Empty_Vector : constant Change_Vector; + + procedure Push (This : in out Change_Vector; Item : in Change); - function Pop (This : in out Change_Vector) return Boolean; - procedure Pop (This : in out Change_Vector); - function Peek (This : in Change_Vector; Item : out Change) return Boolean; - procedure Peek (This : in Change_Vector; Item : out Change); - function Re_Push (This : in out Change_Vector) return Boolean; - procedure Re_Push (This : in out Change_Vector); + + function At_Start (This : in Change_Vector) return Boolean; - function At_End (This : in Change_Vector) return Boolean; @@ -80,21 +75,22 @@ private package Internal_Vectors is new Ada.Containers.Vectors - (Index_Type => Positive, Element_Type => Change); + (Index_Type => Positive, + Element_Type => Change); - type Change_Vector is tagged - record - Near, Far : Natural; - List : Internal_Vectors.Vector; - end record; + type Change_Vector is tagged record + Near, Far : Natural; + List : Internal_Vectors.Vector; + end record; Empty_Vector : constant Change_Vector := - (Near => 0, - Far => 0, - List => Internal_Vectors.Empty_Vector); + (Near => 0, + Far => 0, + List => Internal_Vectors.Empty_Vector); end Change_Vectors; + |