(input: &str)
| 26 | pub struct Date(pub u8, pub u8, pub u16); |
| 27 | |
| 28 | pub fn parse_date(input: &str) -> IResult<&str, Date> { |
| 29 | let (input, (d, _, m, _, y)) = tuple(( |
| 30 | map_res(digit1::<&str, _>, str::parse), |
| 31 | char('-'), |
| 32 | map_res(digit1::<&str, _>, str::parse), |
| 33 | char('-'), |
| 34 | map_res(digit1::<&str, _>, str::parse), |
| 35 | ))(input)?; |
| 36 | |
| 37 | Ok((input, Date(d, m, y))) |
| 38 | } |
| 39 | |
| 40 | pub fn parse_value(input: &str) -> IResult<&str, Value> { |
| 41 | alt(( |