Skip to content

Commit

Permalink
Add documentation examples for character/complete
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and Geal committed Apr 25, 2019
1 parent b027224 commit 06bc533
Show file tree
Hide file tree
Showing 2 changed files with 569 additions and 82 deletions.
8 changes: 4 additions & 4 deletions src/bytes/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ macro_rules! is_a (
/// # Example
/// ```
/// # #[macro_use] extern crate nom;
/// # use nom::character::complete::alpha;
/// # use nom::character::complete::digit;
/// # fn main() {
/// named!(esc, escaped!(call!(alpha), '\\', one_of!("\"n\\")));
/// assert_eq!(esc(&b"abcd;"[..]), Ok((&b";"[..], &b"abcd"[..])));
/// assert_eq!(esc(&b"ab\\\"cd;"[..]), Ok((&b";"[..], &b"ab\\\"cd"[..])));
/// named!(esc, escaped!(call!(digit), '\\', one_of!("\"n\\")));
/// assert_eq!(esc(&b"123;"[..]), Ok((&b";"[..], &b"123"[..])));
/// assert_eq!(esc(&b"12\\\"34;"[..]), Ok((&b";"[..], &b"12\\\"34"[..])));
/// # }
/// ```
#[macro_export(local_inner_macros)]
Expand Down
Loading

0 comments on commit 06bc533

Please sign in to comment.