mod module_error;
mod runtime_error;
mod syntax_error;
mod type_error;
mod warning;
pub use module_error::ModuleError;
pub use runtime_error::{NameError, RuntimeError};
pub use syntax_error::SyntaxError;
pub use type_error::TypeError;
pub use warning::Warning;
mod sink;
mod sink_base;
pub use sink_base::{StackTrace, ReportingLevel, DiagSourceRange};
pub use sink::{Diagnostics, PapyriError, AlreadyReported};
pub type PapyriResult<T=()> = Result<T, PapyriError>;
pub type Reported<T=()> = Result<T, AlreadyReported>;
pub fn ice(msg: &str) -> ! {
panic!("Internal compiler error: {msg}");
}
pub fn ice_at(msg: &str, src_file: &crate::utils::sourcefile::SourceFile, range: crate::utils::sourcefile::SourceRange) -> ! {
let (line, col) = src_file.index_to_line_col(range.start);
panic!("Internal compiler error: {msg}\n File \"{}\", line {line}, col {col}", src_file.path_str);
}