scilla_parser/parser/
mod.rs1use lalrpop_util::lalrpop_mod;
2
3pub mod lexer;
4lalrpop_mod!(#[allow(clippy::all)]pub parser, "/parser/parser.rs");
5
6#[derive(Debug)]
7pub struct ParserError {
8 pub message: String,
9 pub line: usize,
10 pub column: usize,
11}
12
13impl std::error::Error for ParserError {
14 fn description(&self) -> &str {
15 &self.message
16 }
17}
18
19impl std::fmt::Display for ParserError {
20 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
21 write!(
22 f,
23 "{} (line {}, column {})",
24 self.message, self.line, self.column
25 )
26 }
27}