parol: Structural error

I think we should have a dedicated error type something like the following instead of miette::Report.

enum ParserError {
    Scanner(ScannerError),
    Syntax(SyntaxError),
}

pub struct Span(Range<usize>);

enum ScannerError {
    UnexpectedToken {
        span: Span,
        token: Token,
        expected: Vec<TokenDef>,
    },
    ...
}

enum SyntaxError {
    ...
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I released new versions on crates.io of parol-macros, parol_runtime, parol and parol-ls today. Hence I would close this issue. As always, donโ€™t hesitate to contact me if you have any suggestions or questions. Thanks a lot for your contributions! ๐Ÿ’ฏ

Yeah, good points ๐Ÿ‘ Then I can put codespan_reporting as dependency of parol_runtime and re-export it. This will remove the need of both new crates, parol-errors and error-report.