binator 0.3.0

Parser Combinator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use core::fmt::Debug;

use crate::Parse;

/// Take a parser and return a Parser that will call parse on it.
pub fn parse<Stream, Context, Parser>(
  mut parser: Parser,
) -> impl Parse<Stream, Context, Token = Parser::Token>
where
  Parser: Parse<Stream, Context>,
  Parser::Token: Debug,
{
  move |stream: Stream| parser.parse(stream)
}