@@ -6,6 +6,7 @@ use crate::{
6
6
parser:: Spanning ,
7
7
validation:: { ValidatorContext , Visitor } ,
8
8
value:: ScalarValue ,
9
+ Span ,
9
10
} ;
10
11
11
12
#[ doc( hidden) ]
@@ -177,54 +178,62 @@ where
177
178
self . 1 . exit_inline_fragment ( ctx, f) ;
178
179
}
179
180
180
- fn enter_null_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : Spanning < ( ) > ) {
181
+ fn enter_null_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : SpannedInput < ' a , ( ) > ) {
181
182
self . 0 . enter_null_value ( ctx, n) ;
182
183
self . 1 . enter_null_value ( ctx, n) ;
183
184
}
184
- fn exit_null_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : Spanning < ( ) > ) {
185
+ fn exit_null_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : SpannedInput < ' a , ( ) > ) {
185
186
self . 0 . exit_null_value ( ctx, n) ;
186
187
self . 1 . exit_null_value ( ctx, n) ;
187
188
}
188
189
189
- fn enter_scalar_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : Spanning < & ' a S > ) {
190
+ fn enter_scalar_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : SpannedInput < ' a , S > ) {
190
191
self . 0 . enter_scalar_value ( ctx, n) ;
191
192
self . 1 . enter_scalar_value ( ctx, n) ;
192
193
}
193
- fn exit_scalar_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : Spanning < & ' a S > ) {
194
+ fn exit_scalar_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , n : SpannedInput < ' a , S > ) {
194
195
self . 0 . exit_scalar_value ( ctx, n) ;
195
196
self . 1 . exit_scalar_value ( ctx, n) ;
196
197
}
197
198
198
- fn enter_enum_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : Spanning < & ' a String > ) {
199
+ fn enter_enum_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : SpannedInput < ' a , String > ) {
199
200
self . 0 . enter_enum_value ( ctx, s) ;
200
201
self . 1 . enter_enum_value ( ctx, s) ;
201
202
}
202
- fn exit_enum_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : Spanning < & ' a String > ) {
203
+ fn exit_enum_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : SpannedInput < ' a , String > ) {
203
204
self . 0 . exit_enum_value ( ctx, s) ;
204
205
self . 1 . exit_enum_value ( ctx, s) ;
205
206
}
206
207
207
- fn enter_variable_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : Spanning < & ' a String > ) {
208
+ fn enter_variable_value (
209
+ & mut self ,
210
+ ctx : & mut ValidatorContext < ' a , S > ,
211
+ s : SpannedInput < ' a , String > ,
212
+ ) {
208
213
self . 0 . enter_variable_value ( ctx, s) ;
209
214
self . 1 . enter_variable_value ( ctx, s) ;
210
215
}
211
- fn exit_variable_value ( & mut self , ctx : & mut ValidatorContext < ' a , S > , s : Spanning < & ' a String > ) {
216
+ fn exit_variable_value (
217
+ & mut self ,
218
+ ctx : & mut ValidatorContext < ' a , S > ,
219
+ s : SpannedInput < ' a , String > ,
220
+ ) {
212
221
self . 0 . exit_variable_value ( ctx, s) ;
213
222
self . 1 . exit_variable_value ( ctx, s) ;
214
223
}
215
224
216
225
fn enter_list_value (
217
226
& mut self ,
218
227
ctx : & mut ValidatorContext < ' a , S > ,
219
- l : Spanning < & ' a Vec < Spanning < InputValue < S > > > > ,
228
+ l : SpannedInput < ' a , Vec < Spanning < InputValue < S > > > > ,
220
229
) {
221
230
self . 0 . enter_list_value ( ctx, l) ;
222
231
self . 1 . enter_list_value ( ctx, l) ;
223
232
}
224
233
fn exit_list_value (
225
234
& mut self ,
226
235
ctx : & mut ValidatorContext < ' a , S > ,
227
- l : Spanning < & ' a Vec < Spanning < InputValue < S > > > > ,
236
+ l : SpannedInput < ' a , Vec < Spanning < InputValue < S > > > > ,
228
237
) {
229
238
self . 0 . exit_list_value ( ctx, l) ;
230
239
self . 1 . exit_list_value ( ctx, l) ;
@@ -242,19 +251,20 @@ where
242
251
fn enter_object_field (
243
252
& mut self ,
244
253
ctx : & mut ValidatorContext < ' a , S > ,
245
- f : & ' a ( Spanning < String > , Spanning < InputValue < S > > ) ,
254
+ f : ( SpannedInput < ' a , String > , SpannedInput < ' a , InputValue < S > > ) ,
246
255
) {
247
256
self . 0 . enter_object_field ( ctx, f) ;
248
257
self . 1 . enter_object_field ( ctx, f) ;
249
258
}
250
259
fn exit_object_field (
251
260
& mut self ,
252
261
ctx : & mut ValidatorContext < ' a , S > ,
253
- f : & ' a ( Spanning < String > , Spanning < InputValue < S > > ) ,
262
+ f : ( SpannedInput < ' a , String > , SpannedInput < ' a , InputValue < S > > ) ,
254
263
) {
255
264
self . 0 . exit_object_field ( ctx, f) ;
256
265
self . 1 . exit_object_field ( ctx, f) ;
257
266
}
258
267
}
259
268
260
- type SpannedObject < ' a , S > = Spanning < & ' a Vec < ( Spanning < String > , Spanning < InputValue < S > > ) > > ;
269
+ type SpannedInput < ' a , T > = Spanning < & ' a T , & ' a Span > ;
270
+ type SpannedObject < ' a , S > = SpannedInput < ' a , Vec < ( Spanning < String > , Spanning < InputValue < S > > ) > > ;
0 commit comments