Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. use failure::Error;
  2. use nom::{named, do_parse, opt, tag, map_res, take_while, space, alphanumeric};
  3.  
  4. named!(key_value <&str,(&str,&str)>,
  5. do_parse!(
  6. opt!(space) >> tag!("[") >>
  7. key: take_while!(alphanumeric) >>
  8. opt!(space) >> tag!("=") >> opt!(space) >>
  9. val: take_while!(alphanumeric) >>
  10. opt!(space) >> tag!("]") >> opt!(space) >>
  11. (key, val)
  12. )
  13. );
  14.  
  15. fn main() -> Result<(), Error> {
  16. let text = r#"[color = "hueolor"]"#;
  17. Ok(())
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement