tokit 0.0.0

Blazing fast parser combinators: parse-while-lexing (zero-copy), deterministic LALR-style parsing, no backtracking. Flexible emitters for fail-fast runtime or greedy compiler diagnostics
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// A parser that applies its inner parser if a peeked condition is false.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct OrNot<P>(pub(super) P);

impl<P> OrNot<P> {
  /// Creates a new `OrNot` combinator.
  #[cfg_attr(not(tarpaulin), inline(always))]
  pub(super) const fn new(parser: P) -> Self {
    Self(parser)
  }
}