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