mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
removed erroneus wrapping function
This commit is contained in:
parent
b7181af8f3
commit
58c654a092
1 changed files with 2 additions and 6 deletions
|
@ -1532,14 +1532,12 @@ where
|
|||
/// # enum Problem {
|
||||
/// # NotFound(Position),
|
||||
/// # }
|
||||
/// # fn foo() {
|
||||
/// # let arena = Bump::new();
|
||||
/// # let arena = Bump::new();
|
||||
/// let parser = word("hello", Problem::NotFound);
|
||||
/// let (progress, output, state) = parser.parse(&arena, State::new("hello, world".as_bytes()), 0).unwrap();
|
||||
/// assert_eq!(progress, Progress::MadeProgress);
|
||||
/// assert_eq!(output, ());
|
||||
/// assert_eq!(state.pos(), Position::new(5));
|
||||
/// # }
|
||||
/// ```
|
||||
///
|
||||
/// ## Failure case
|
||||
|
@ -1552,15 +1550,13 @@ where
|
|||
/// # enum Problem {
|
||||
/// # NotFound(Position),
|
||||
/// # }
|
||||
/// # fn foo() {
|
||||
/// # let arena = Bump::new();
|
||||
/// # let arena = Bump::new();
|
||||
/// let parser = word("bye", Problem::NotFound);
|
||||
/// let actual = parser.parse(&arena, State::new("hello, world".as_bytes()), 0).unwrap_err();
|
||||
/// assert_eq!(
|
||||
/// actual,
|
||||
/// (Progress::NoProgress, Problem::NotFound(Position::zero())),
|
||||
/// );
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn word<'a, ToError, E>(word: &'static str, to_error: ToError) -> impl Parser<'a, (), E>
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue