@@ -28,7 +28,7 @@ use self::parse_state::ParseState;
28
28
macro_rules! type_id {
29
29
( $( #[ $meta: meta] ) * $name: ident, $tag: literal) => {
30
30
$( #[ $meta] ) *
31
- fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState , ParseState , E >
31
+ fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState < ' a> , ParseState < ' a> , E >
32
32
where
33
33
E : ParseError <ParseState <' a>> + ContextError <ParseState <' a>>
34
34
{
@@ -40,7 +40,7 @@ macro_rules! type_id {
40
40
41
41
( $( #[ $meta: meta] ) * $name: ident, $( $tag: literal ) ,+) => {
42
42
$( #[ $meta] ) *
43
- fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState , ParseState , E >
43
+ fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState < ' a> , ParseState < ' a> , E >
44
44
where
45
45
E : ParseError <ParseState <' a>> + ContextError <ParseState <' a>>
46
46
{
@@ -107,7 +107,7 @@ type_id!(
107
107
) ;
108
108
109
109
/// Reads any type ID which may appear as a leaf in the resource tree.
110
- fn type_id_no_root < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ParseState , E >
110
+ fn type_id_no_root < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ParseState < ' a > , E >
111
111
where
112
112
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
113
113
{
@@ -132,7 +132,7 @@ where
132
132
/// It is presently unclear which characters appear in keys in practice, so in
133
133
/// the interest of a simplified parse, only characters which have been
134
134
/// encountered in real files are supported.
135
- fn invariant_chars < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ParseState , E >
135
+ fn invariant_chars < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ParseState < ' a > , E >
136
136
where
137
137
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
138
138
{
@@ -143,7 +143,7 @@ where
143
143
}
144
144
145
145
/// Reads a single-line comment up to but not including the final newline.
146
- fn eol_comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ParseState , E >
146
+ fn eol_comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ParseState < ' a > , E >
147
147
where
148
148
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
149
149
{
@@ -153,7 +153,7 @@ where
153
153
/// Reads a multi-line comment.
154
154
///
155
155
/// Does not support nested comments.
156
- fn delimited_comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ParseState , E >
156
+ fn delimited_comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ParseState < ' a > , E >
157
157
where
158
158
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
159
159
{
@@ -164,7 +164,7 @@ where
164
164
}
165
165
166
166
/// Reads one single-line or multi-line comment.
167
- fn comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ParseState , E >
167
+ fn comment < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ParseState < ' a > , E >
168
168
where
169
169
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
170
170
{
@@ -186,7 +186,7 @@ where
186
186
/// for these has also been omitted for the time being.
187
187
///
188
188
/// See [`Reader`] for more details on the specification.
189
- fn string < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , & str , E >
189
+ fn string < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , & ' a str , E >
190
190
where
191
191
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
192
192
{
@@ -203,15 +203,15 @@ where
203
203
}
204
204
205
205
/// Reads a signed or unsigned 32-bit integer.
206
- fn integer < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , u32 , E >
206
+ fn integer < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , u32 , E >
207
207
where
208
208
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
209
209
{
210
210
context ( "integer" , token ( alt ( ( u32, map ( i32, |value| value as u32 ) ) ) ) ) ( input)
211
211
}
212
212
213
213
/// Reads and discards any number of comments and any amount of whitespace.
214
- fn discardable < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ( ) , E >
214
+ fn discardable < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ( ) , E >
215
215
where
216
216
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
217
217
{
@@ -220,7 +220,7 @@ where
220
220
221
221
/// Reads a single token as specified by the provided parser, surrounded by any
222
222
/// number of comments and any amount of whitespace.
223
- fn token < ' a , F , O , E > ( mut parser : F ) -> impl FnMut ( ParseState < ' a > ) -> IResult < ParseState , O , E >
223
+ fn token < ' a , F , O , E > ( mut parser : F ) -> impl FnMut ( ParseState < ' a > ) -> IResult < ParseState < ' a > , O , E >
224
224
where
225
225
F : Parser < ParseState < ' a > , O , E > ,
226
226
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
@@ -237,7 +237,7 @@ where
237
237
/// Generates appropriate matchers for simple string tokens.
238
238
macro_rules! simple_token {
239
239
( $name: ident, $str: expr) => {
240
- fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState , ParseState , E >
240
+ fn $name<' a, E >( input: ParseState <' a>) -> IResult <ParseState < ' a> , ParseState < ' a> , E >
241
241
where
242
242
E : ParseError <ParseState <' a>> + ContextError <ParseState <' a>>,
243
243
{
@@ -251,7 +251,7 @@ simple_token!(right_brace, "}");
251
251
simple_token ! ( comma, "," ) ;
252
252
253
253
/// Reads a table key.
254
- fn key < ' a , E > ( state : ParseState < ' a > ) -> IResult < ParseState , Key , E >
254
+ fn key < ' a , E > ( state : ParseState < ' a > ) -> IResult < ParseState < ' a > , Key < ' a > , E >
255
255
where
256
256
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
257
257
{
@@ -277,7 +277,7 @@ where
277
277
}
278
278
279
279
/// Reads a single table entry, consisting of a key and an associated resource.
280
- fn table_entry < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ( Key , Resource ) , E >
280
+ fn table_entry < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ( Key < ' a > , Resource < ' a > ) , E >
281
281
where
282
282
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
283
283
{
@@ -308,7 +308,7 @@ macro_rules! resource_opt_tag {
308
308
309
309
/// Reads the body of a table resource, consisting of any number of key-resource
310
310
/// pair entries.
311
- fn table_body < ' a , E > ( state : ParseState < ' a > ) -> IResult < ParseState , Table , E >
311
+ fn table_body < ' a , E > ( state : ParseState < ' a > ) -> IResult < ParseState < ' a > , Table < ' a > , E >
312
312
where
313
313
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
314
314
{
@@ -327,7 +327,7 @@ where
327
327
///
328
328
/// Though it is not required in the resource bundle text, the final in-memory
329
329
/// representation sorts these pairs lexically by key.
330
- fn table_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
330
+ fn table_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
331
331
where
332
332
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
333
333
{
@@ -338,7 +338,9 @@ where
338
338
}
339
339
340
340
/// Reads the root table resource, noting whether locale fallback is disabled.
341
- fn root_table_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ( bool , Resource ) , E >
341
+ fn root_table_resource < ' a , E > (
342
+ input : ParseState < ' a > ,
343
+ ) -> IResult < ParseState < ' a > , ( bool , Resource < ' a > ) , E >
342
344
where
343
345
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
344
346
{
@@ -357,7 +359,7 @@ where
357
359
358
360
/// Reads an array resource consisting of any number of hetereogeneously-typed
359
361
/// resources, optionally separated by commas.
360
- fn array_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
362
+ fn array_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
361
363
where
362
364
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
363
365
{
@@ -379,7 +381,7 @@ where
379
381
/// These integers have no inherent signedness; consumers specify whether a
380
382
/// signed or unsigned integer is desired. Because of this, note that 28-bit
381
383
/// integers require special handling in-memory. See [`Int28`] for more details.
382
- fn int_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
384
+ fn int_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
383
385
where
384
386
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
385
387
{
@@ -393,7 +395,7 @@ where
393
395
394
396
/// Reads an integer vector resource, consisting of any number of 32-bit
395
397
/// integers separated by commas. A trailing comma is optional.
396
- fn int_vector_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
398
+ fn int_vector_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
397
399
where
398
400
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
399
401
{
@@ -424,7 +426,7 @@ fn binary_byte(input: &str) -> IResult<&str, u8> {
424
426
/// digits representing byte values.
425
427
///
426
428
/// See [`binary_byte`].
427
- fn binary_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
429
+ fn binary_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
428
430
where
429
431
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
430
432
{
@@ -450,7 +452,7 @@ where
450
452
/// braces.
451
453
///
452
454
/// See [`string`] for more details on the representation of strings.
453
- fn string_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
455
+ fn string_resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
454
456
where
455
457
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
456
458
{
@@ -464,7 +466,7 @@ where
464
466
}
465
467
466
468
/// Reads a single resource.
467
- fn resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , Resource , E >
469
+ fn resource < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , Resource < ' a > , E >
468
470
where
469
471
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
470
472
{
@@ -482,7 +484,7 @@ where
482
484
}
483
485
484
486
/// Reads a complete resource bundle.
485
- fn bundle < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState , ResourceBundle , E >
487
+ fn bundle < ' a , E > ( input : ParseState < ' a > ) -> IResult < ParseState < ' a > , ResourceBundle < ' a > , E >
486
488
where
487
489
E : ParseError < ParseState < ' a > > + ContextError < ParseState < ' a > > ,
488
490
{
0 commit comments