-- Lemma_Split --
-----------------
- procedure Lemma_Split (Result : String) is
+ procedure Lemma_Split (Result : String)
+ is
begin
for K in Ptr + 1 .. Ptr + Right'Length loop
Lemma_Mod (K - 1);
From : Positive;
Through : Natural;
Justify : Alignment := Left;
- Pad : Character := Space) with SPARK_Mode => Off is
+ Pad : Character := Space)
+ is
begin
Move (Source => Delete (Source, From, Through),
Target => Source,
(Source : in out String;
Before : Positive;
New_Item : String;
- Drop : Truncation := Error) with SPARK_Mode => Off is
+ Drop : Truncation := Error)
+ is
begin
Move (Source => Insert (Source, Before, New_Item),
Target => Source,
Target : out String;
Drop : Truncation := Error;
Justify : Alignment := Left;
- Pad : Character := Space) with SPARK_Mode => Off
+ Pad : Character := Space)
+ with SPARK_Mode => Off
is
Sfirst : constant Integer := Source'First;
Slast : constant Integer := Source'Last;
(Source : in out String;
Position : Positive;
New_Item : String;
- Drop : Truncation := Right) with SPARK_Mode => Off is
+ Drop : Truncation := Right)
+ is
begin
Move (Source => Overwrite (Source, Position, New_Item),
Target => Source,
By : String;
Drop : Truncation := Error;
Justify : Alignment := Left;
- Pad : Character := Space) with SPARK_Mode => Off is
+ Pad : Character := Space)
+ is
begin
Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad);
end Replace_Slice;
Justify : Alignment := Left;
Pad : Character := Space)
with
- Pre => Low - 1 <= Source'Last,
+ Pre =>
+ Low - 1 <= Source'Last
+ and then High >= Source'First - 1
+ and then (if High >= Low
+ then Natural'Max (0, Low - Source'First)
+ <= Natural'Last
+ - By'Length
+ - Natural'Max (Source'Last - High, 0)
+ else Source'Length <= Natural'Last - By'Length),
-- Incomplete contract
New_Item : String;
Drop : Truncation := Error)
with
- Pre => Before - 1 in Source'First - 1 .. Source'Last,
+ Pre =>
+ Before - 1 in Source'First - 1 .. Source'Last
+ and then Source'Length <= Natural'Last - New_Item'Length,
-- Incomplete contract
New_Item : String;
Drop : Truncation := Right)
with
- Pre => Position - 1 in Source'First - 1 .. Source'Last,
+ Pre =>
+ Position - 1 in Source'First - 1 .. Source'Last
+ and then
+ (if Position - Source'First >= Source'Length - New_Item'Length
+ then Position - Source'First <= Natural'Last - New_Item'Length),
-- Incomplete contract