panmath 0.1.2

A parser for math as people actually write it
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Common interface for parsers that can create abstract syntax trees.

use crate::ast::AST;
pub mod ascii;
pub mod token;

pub use ascii::AsciiParser;

/// Code that can parse ASTs from a given input type.
pub trait ASTParser<I> {
    /// The error that parsing can raise.
    type ParseError;

    /// Attempts to parse the given input, returning an AST on success.
    fn parse(&self, input: &I) -> Result<AST, Self::ParseError>;
}