wright 0.10.1

The wright programming language compiler and tooling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Parsing utility functions used throughout the parser to make the process of parsing easier.

use super::{error::ParserError, state::ParserState};

pub mod discard_error;
pub mod erase;
pub mod first_successful;
pub mod ignore;
pub mod map;

/// A [`Result`] returned from an AST node parser.
pub type NodeParserResult<Node, Error = ParserError> = Result<Node, Error>;

/// An [`Option`] returned from an AST node parser.
pub type NodeParserOption<Node> = Option<Node>;

/// Type alias used to apease the borrow/lifetime checker complaining about HKTs and stuff.
pub type BoxedParserFn<'src, Output> = Box<dyn (Fn(&mut ParserState<'src>) -> Output) + 'src>;