@@ -58,9 +58,8 @@ package body Test_Images is
58
58
procedure Test_True_Text is
59
59
Text : aliased String := " true" ;
60
60
61
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
62
- Allocator : Types.Memory_Allocator;
63
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
61
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
62
+ Value : constant JSON_Value := Parser.Parse;
64
63
Image : constant String := Value.Image;
65
64
begin
66
65
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -69,9 +68,8 @@ package body Test_Images is
69
68
procedure Test_False_Text is
70
69
Text : aliased String := " false" ;
71
70
72
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
73
- Allocator : Types.Memory_Allocator;
74
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
71
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
72
+ Value : constant JSON_Value := Parser.Parse;
75
73
Image : constant String := Value.Image;
76
74
begin
77
75
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -80,9 +78,8 @@ package body Test_Images is
80
78
procedure Test_Null_Text is
81
79
Text : aliased String := " null" ;
82
80
83
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
84
- Allocator : Types.Memory_Allocator;
85
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
81
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
82
+ Value : constant JSON_Value := Parser.Parse;
86
83
Image : constant String := Value.Image;
87
84
begin
88
85
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -91,9 +88,8 @@ package body Test_Images is
91
88
procedure Test_Escaped_Text is
92
89
Text : aliased String := " "" BS:\b LF:\n CR:\r \\ \/ HT:\t"" " ;
93
90
94
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
95
- Allocator : Types.Memory_Allocator;
96
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
91
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
92
+ Value : constant JSON_Value := Parser.Parse;
97
93
Image : constant String := Value.Image;
98
94
begin
99
95
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -102,9 +98,8 @@ package body Test_Images is
102
98
procedure Test_Empty_String_Text is
103
99
Text : aliased String := " """" " ;
104
100
105
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
106
- Allocator : Types.Memory_Allocator;
107
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
101
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
102
+ Value : constant JSON_Value := Parser.Parse;
108
103
Image : constant String := Value.Image;
109
104
begin
110
105
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -113,9 +108,8 @@ package body Test_Images is
113
108
procedure Test_Non_Empty_String_Text is
114
109
Text : aliased String := " "" test"" " ;
115
110
116
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
117
- Allocator : Types.Memory_Allocator;
118
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
111
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
112
+ Value : constant JSON_Value := Parser.Parse;
119
113
Image : constant String := Value.Image;
120
114
begin
121
115
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -124,9 +118,8 @@ package body Test_Images is
124
118
procedure Test_Number_String_Text is
125
119
Text : aliased String := " "" 12.34"" " ;
126
120
127
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
128
- Allocator : Types.Memory_Allocator;
129
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
121
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
122
+ Value : constant JSON_Value := Parser.Parse;
130
123
Image : constant String := Value.Image;
131
124
begin
132
125
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -135,9 +128,8 @@ package body Test_Images is
135
128
procedure Test_Integer_Number_Text is
136
129
Text : aliased String := " 42" ;
137
130
138
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
139
- Allocator : Types.Memory_Allocator;
140
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
131
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
132
+ Value : constant JSON_Value := Parser.Parse;
141
133
Image : constant String := Value.Image;
142
134
begin
143
135
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -146,9 +138,8 @@ package body Test_Images is
146
138
procedure Test_Empty_Array_Text is
147
139
Text : aliased String := " []" ;
148
140
149
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
150
- Allocator : Types.Memory_Allocator;
151
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
141
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
142
+ Value : constant JSON_Value := Parser.Parse;
152
143
Image : constant String := Value.Image;
153
144
begin
154
145
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -157,9 +148,8 @@ package body Test_Images is
157
148
procedure Test_One_Element_Array_Text is
158
149
Text : aliased String := " ["" test"" ]" ;
159
150
160
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
161
- Allocator : Types.Memory_Allocator;
162
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
151
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
152
+ Value : constant JSON_Value := Parser.Parse;
163
153
Image : constant String := Value.Image;
164
154
begin
165
155
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -168,9 +158,8 @@ package body Test_Images is
168
158
procedure Test_Multiple_Elements_Array_Text is
169
159
Text : aliased String := " [42,true]" ;
170
160
171
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
172
- Allocator : Types.Memory_Allocator;
173
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
161
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
162
+ Value : constant JSON_Value := Parser.Parse;
174
163
Image : constant String := Value.Image;
175
164
begin
176
165
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -179,9 +168,8 @@ package body Test_Images is
179
168
procedure Test_Empty_Object_Text is
180
169
Text : aliased String := " {}" ;
181
170
182
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
183
- Allocator : Types.Memory_Allocator;
184
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
171
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
172
+ Value : constant JSON_Value := Parser.Parse;
185
173
Image : constant String := Value.Image;
186
174
begin
187
175
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -190,9 +178,8 @@ package body Test_Images is
190
178
procedure Test_One_Member_Object_Text is
191
179
Text : aliased String := " {"" foo"" :"" bar"" }" ;
192
180
193
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
194
- Allocator : Types.Memory_Allocator;
195
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
181
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
182
+ Value : constant JSON_Value := Parser.Parse;
196
183
Image : constant String := Value.Image;
197
184
begin
198
185
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -202,9 +189,8 @@ package body Test_Images is
202
189
Text : aliased String := " {"" foo"" :1,"" bar"" :2}" ;
203
190
Text2 : constant String := " {"" bar"" :2,"" foo"" :1}" ;
204
191
205
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
206
- Allocator : Types.Memory_Allocator;
207
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
192
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
193
+ Value : constant JSON_Value := Parser.Parse;
208
194
Image : constant String := Value.Image;
209
195
begin
210
196
Assert ((Text = Image) or else (Text2 = Image), " Image '" & Image & " ' is not '" & Text & " '" );
@@ -213,9 +199,8 @@ package body Test_Images is
213
199
procedure Test_Array_Object_Array is
214
200
Text : aliased String := " [{"" foo"" :[true,42]}]" ;
215
201
216
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
217
- Allocator : Types.Memory_Allocator;
218
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
202
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
203
+ Value : constant JSON_Value := Parser.Parse;
219
204
Image : constant String := Value.Image;
220
205
begin
221
206
Assert (Text = Image, " Image not '" & Text & " '" );
@@ -224,9 +209,8 @@ package body Test_Images is
224
209
procedure Test_Object_Array_Object is
225
210
Text : aliased String := " {"" foo"" :[null,{"" bar"" :42}]}" ;
226
211
227
- Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access );
228
- Allocator : Types.Memory_Allocator;
229
- Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
212
+ Parser : Parsers.Parser := Parsers.Create (JSON.Streams.Create_Stream (Text'Access ));
213
+ Value : constant JSON_Value := Parser.Parse;
230
214
Image : constant String := Value.Image;
231
215
begin
232
216
Assert (Text = Image, " Image not '" & Text & " '" );
0 commit comments