Skip to content

Commit

Permalink
aoc/src/lib.rs: export tag and newline, create "space" function
Browse files Browse the repository at this point in the history
  • Loading branch information
lpenz committed Dec 20, 2023
1 parent a9278bc commit c2b4f33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aoc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ pub mod parser {
pub use combinator::all_consuming;
pub use nom::branch;
pub use nom::bytes::complete as bytes;
pub use nom::bytes::complete::tag;
pub use nom::character::complete as character;
pub use nom::character::complete::newline;
pub use nom::combinator;
pub use nom::multi;
pub use nom::Finish;
Expand All @@ -34,6 +36,10 @@ pub mod parser {
Ok(result.map_err(|e| eyre!("error reading input: {:?}", e))?.1)
}};
}

pub fn space(input: &str) -> IResult<&str, &str> {
tag(" ")(input)
}
}

pub trait OptionExt<T> {
Expand Down

0 comments on commit c2b4f33

Please sign in to comment.