diff options
Diffstat (limited to 'src/xml/parsers.rs')
-rw-r--r-- | src/xml/parsers.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xml/parsers.rs b/src/xml/parsers.rs index b8b8018..6326593 100644 --- a/src/xml/parsers.rs +++ b/src/xml/parsers.rs @@ -189,8 +189,8 @@ impl<'s> Parser<'s, Names<'s>> for Names<'s> { // TODO: fix fn parse(input: &'s str) -> IResult<&str, Names<'s>> { map( - recognize(pair(Name::parse, many0(pair(char('\u{20}'), Name::parse)))), - |names| Names(names), + pair(Name::parse, many0(preceded(char('\u{20}'), Name::parse))), + |(head, tail)| Names(vec![vec![head], tail].concat()), )(input) } } @@ -208,11 +208,11 @@ impl<'s> Parser<'s, Nmtoken<'s>> for Nmtoken<'s> { impl<'s> Parser<'s, Nmtokens<'s>> for Nmtokens<'s> { fn parse(input: &'s str) -> IResult<&str, Nmtokens<'s>> { map( - recognize(pair( + pair( Nmtoken::parse, - many0(pair(char('\u{20}'), Nmtoken::parse)), - )), - |nmtokens| Nmtokens(nmtokens), + many0(preceded(char('\u{20}'), Nmtoken::parse)), + ), + |(head, tail)| Nmtokens(vec![vec![head], tail].concat()), )(input) } } |