Skip to content

Commit 935b48b

Browse files
committed
Merge branch 'mr/jicquel/gpr-issues#742' into 'master'
Revert "Implement JSON array concatenation" See merge request eng/toolchain/gnatcoll-core!224
2 parents 37b5d43 + a80e810 commit 935b48b

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

core/src/gnatcoll-json.adb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -953,13 +953,6 @@ package body GNATCOLL.JSON is
953953
Arr.Vals.Append (Val);
954954
end Append;
955955

956-
procedure Append (Arr : in out JSON_Array; Val : JSON_Array) is
957-
begin
958-
for Value of Val.Vals loop
959-
Arr.Vals.Append (Value);
960-
end loop;
961-
end Append;
962-
963956
-------------
964957
-- Prepend --
965958
-------------
@@ -969,13 +962,6 @@ package body GNATCOLL.JSON is
969962
Arr.Vals.Prepend (Val);
970963
end Prepend;
971964

972-
procedure Prepend (Arr : in out JSON_Array; Val : JSON_Array) is
973-
begin
974-
for Value of reverse Val.Vals loop
975-
Arr.Vals.Prepend (Value);
976-
end loop;
977-
end Prepend;
978-
979965
---------
980966
-- "&" --
981967
---------

core/src/gnatcoll-json.ads

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,9 @@ package GNATCOLL.JSON is
217217
-- Raise a Constraint_Error otherwise.
218218

219219
procedure Append (Arr : in out JSON_Array; Val : JSON_Value);
220-
-- Append all values of Val at the end of the Arr array
221-
222-
procedure Append (Arr : in out JSON_Array; Val : JSON_Array);
223220
-- Append Val as a new element at the end of the Arr array
224221

225222
procedure Prepend (Arr : in out JSON_Array; Val : JSON_Value);
226-
-- Insert all values of Val at the beginning of the Arr array
227-
228-
procedure Prepend (Arr : in out JSON_Array; Val : JSON_Array);
229223
-- Insert Val as the first element of the Arr array
230224

231225
procedure Clear (Arr : in out JSON_Array);

testsuite/core/tests/json/api/test.adb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ function Test return Integer is
8282

8383
Int_0 : JSON_Value := Create (Integer'(0));
8484
Int_1 : constant JSON_Value := Create (Integer'(1));
85-
Int_2 : constant JSON_Value := Create (Integer'(2));
86-
Int_3 : constant JSON_Value := Create (Integer'(3));
87-
8885
Hello_World : constant JSON_Value := Create ("Hello world!");
89-
Hi_World : constant JSON_Value := Create ("Hi world!");
9086

9187
Float_0 : constant JSON_Value := Create (Float'(0.0));
9288
Float_1 : constant JSON_Value := Create (Float'(1.0));
@@ -103,7 +99,6 @@ begin
10399

104100
declare
105101
Arr : JSON_Array := Int_0 & Int_1 & Hello_World;
106-
Arr2 : constant JSON_Array := Int_2 & Int_3 & Hi_World;
107102
Empty : constant JSON_Array := Empty_Array;
108103
begin
109104
-- Inspect an empty array
@@ -148,26 +143,6 @@ begin
148143
Clear (Arr);
149144
A.Assert (Length (Arr) = 0);
150145

151-
Arr := Hello_World & Int_0 & Int_1;
152-
Append (Arr, Arr2);
153-
A.Assert (Length (Arr) = 6);
154-
A.Assert (Get (Arr, 1) = Hello_World);
155-
A.Assert (Get (Arr, 2) = Int_0);
156-
A.Assert (Get (Arr, 3) = Int_1);
157-
A.Assert (Get (Arr, 4) = Int_2);
158-
A.Assert (Get (Arr, 5) = Int_3);
159-
A.Assert (Get (Arr, 6) = Hi_World);
160-
161-
Arr := Hello_World & Int_0 & Int_1;
162-
Prepend (Arr, Arr2);
163-
A.Assert (Length (Arr) = 6);
164-
A.Assert (Get (Arr, 1) = Int_2);
165-
A.Assert (Get (Arr, 2) = Int_3);
166-
A.Assert (Get (Arr, 3) = Hi_World);
167-
A.Assert (Get (Arr, 4) = Hello_World);
168-
A.Assert (Get (Arr, 5) = Int_0);
169-
A.Assert (Get (Arr, 6) = Int_1);
170-
171146
Arr := Hello_World & Int_0 & Int_1 & Int_0;
172147
Sort (Arr, Less'Access);
173148
Check_Image (Create (Arr), "[0,0,1,""Hello world!""]");

0 commit comments

Comments
 (0)