efx-core 1.0.0

Core parser and AST for EFx proc-macro
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fmt;
use crate::parser::span_range::SpanRange;

/// Parser error with human-readable message and range
#[derive(Debug)]
pub struct ParseError {
    pub msg: String,
    pub span: SpanRange,
}

impl fmt::Display for ParseError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{} at bytes {}..{}", self.msg, self.span.start.0, self.span.end.0)
    }
}