fabula-dsl 0.1.0

Text DSL parser for fabula patterns and graphs
Documentation
//! Parse error types with source location tracking.

use std::fmt;

/// A parse error with source location information.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ParseError {
    /// 1-based line number where the error occurred.
    pub line: usize,
    /// 1-based column number where the error occurred.
    pub column: usize,
    /// Byte offset range `(start, end)` in the source text.
    pub span: (usize, usize),
    /// Human-readable error message.
    pub message: String,
}

impl fmt::Display for ParseError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}:{}: {}", self.line, self.column, self.message)
    }
}

impl std::error::Error for ParseError {}