(input: &str)
| 42 | } |
| 43 | |
| 44 | pub fn parse_attribute(input: &str) -> IResult<&str, Attribute> { |
| 45 | map( |
| 46 | tuple((ws(parse_identifier), ws(char(':')), ws(parse_value))), |
| 47 | |(name, _, value)| Attribute { |
| 48 | name: name.to_string(), |
| 49 | value, |
| 50 | }, |
| 51 | )(input) |
| 52 | } |
| 53 | |
| 54 | #[cfg(test)] |
| 55 | mod tests { |