1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pub use diagnostic::{DiagnosticLevel, FileID, Span, TextStorage};
pub use self::errors::report::eprint;
mod errors;
pub mod for_3rd;
mod for_std;
pub type Validation<T> = diagnostic::Validation<T, VosError>;
pub type VosResult<T = ()> = Result<T, VosError>;
#[derive(Debug)]
pub struct VosError {
kind: Box<VosErrorKind>,
level: DiagnosticLevel,
file: FileID,
}
#[derive(Debug)]
pub enum VosErrorKind {
IOError(std::io::Error),
ParseError(String),
RuntimeError(String),
DuplicateFields(DuplicateDeclare),
UnknownError,
}
#[derive(Debug)]
pub struct DuplicateDeclare {
pub kind: &'static str,
pub symbol: String,
pub lhs: Span,
pub rhs: Span,
}