mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
moved all crates into seperate folder + related path fixes
This commit is contained in:
parent
12ef03bb86
commit
eee85fa45d
1063 changed files with 92 additions and 93 deletions
|
@ -1,55 +0,0 @@
|
|||
use peg::error::ParseError;
|
||||
use roc_ast::ast_error::ASTError;
|
||||
use roc_module::module_err::ModuleError;
|
||||
use roc_parse::parser::SyntaxError;
|
||||
use snafu::Snafu;
|
||||
|
||||
#[derive(Debug, Snafu)]
|
||||
#[snafu(visibility(pub))]
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
pub enum DocsError {
|
||||
WrapASTError {
|
||||
#[snafu(backtrace)]
|
||||
source: ASTError,
|
||||
},
|
||||
WrapModuleError {
|
||||
#[snafu(backtrace)]
|
||||
source: ModuleError,
|
||||
},
|
||||
WrapSyntaxError {
|
||||
msg: String,
|
||||
},
|
||||
WrapPegParseError {
|
||||
source: ParseError<usize>,
|
||||
},
|
||||
}
|
||||
|
||||
pub type DocsResult<T, E = DocsError> = std::result::Result<T, E>;
|
||||
|
||||
impl<'a> From<SyntaxError<'a>> for DocsError {
|
||||
fn from(syntax_err: SyntaxError) -> Self {
|
||||
Self::WrapSyntaxError {
|
||||
msg: format!("{:?}", syntax_err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ASTError> for DocsError {
|
||||
fn from(ast_err: ASTError) -> Self {
|
||||
Self::WrapASTError { source: ast_err }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ModuleError> for DocsError {
|
||||
fn from(module_err: ModuleError) -> Self {
|
||||
Self::WrapModuleError { source: module_err }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ParseError<usize>> for DocsError {
|
||||
fn from(peg_parse_err: ParseError<usize>) -> Self {
|
||||
Self::WrapPegParseError {
|
||||
source: peg_parse_err,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue