Skip to content

Instantly share code, notes, and snippets.

@ctjhoa
Last active May 4, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctjhoa/2b859ebf7ca201586ac2 to your computer and use it in GitHub Desktop.
Save ctjhoa/2b859ebf7ca201586ac2 to your computer and use it in GitHub Desktop.
erreur nom
error: expected `::`, found `)`
--> src/lib.rs:68:47
|
68 | named!(entity_value <&[u8], (&str,<Vec<&str> >)>,
| ^
#[macro_use]
extern crate nom;
use nom::{IResult, space, newline, alphanumeric, eol};
use std::str;
named!(value <Vec<&str> >,
alt!(
do_parse!(
opt!(space) >>
char!('\n') >>
val: many0!(
do_parse!(
space >>
line: map_res!(
take_while!(call!(|c| c != '\n' as u8)),
str::from_utf8
) >>
eol >>
(line)
)
) >>
(val)
) |
do_parse!(
opt!(space) >>
val: map_res!(
take_while!(call!(|c| c != '\n' as u8)),
str::from_utf8
) >>
eol >>
(vec![val])
)
)
);
named!(entity_value <&[u8], (&str,<Vec<&str> >)>,
do_parse!(
key: map_res!(alphanumeric, str::from_utf8) >>
opt!(space) >>
char!('=') >>
val: value >>
(key, val)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment