fiasto 0.2.7

High-performance modern Wilkinson's formula parsing for statistical models. Parses R-style formulas into structured JSON metadata supporting linear models, mixed effects, and complex statistical specifications.
Documentation
use thiserror::Error;

// ---------------------------
// ERRORS
// ---------------------------

#[derive(Error, Debug)]
/// This checks for the following
/// - lexing errors
/// - unexpected end of input
/// - unexpected tokens
/// - invalid syntax
pub enum ParseError {
    #[error("lexing error at {0:?}")]
    Lex(String),
    #[error("unexpected end of input")]
    Eoi,
    #[error("unexpected token: expected {expected:?}, found {found:?}")]
    Unexpected {
        expected: &'static str,
        found: Option<super::lexer::Token>,
    },
    #[error("invalid syntax: {0}")]
    Syntax(String),
}