feat: start integrating miette

This commit is contained in:
rvcas
2022-10-09 17:33:14 -04:00
committed by Lucas
parent 57dc50e3aa
commit 59d7b54473
9 changed files with 308 additions and 70 deletions

View File

@@ -18,9 +18,19 @@ pub enum ModuleKind {
Script,
}
impl ModuleKind {
pub fn is_script(&self) -> bool {
matches!(self, ModuleKind::Script)
}
pub fn is_lib(&self) -> bool {
matches!(self, ModuleKind::Lib)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Module<Info, Definitions> {
pub name: Vec<String>,
pub name: String,
pub docs: Vec<String>,
pub type_info: Info,
pub definitions: Vec<Definitions>,

View File

@@ -37,7 +37,7 @@ pub fn module_parser(
kind,
definitions,
docs: vec![],
name: vec![],
name: "".to_string(),
type_info: (),
})
}

View File

@@ -126,7 +126,7 @@ fn module() {
ast::UntypedModule {
docs: vec![],
kind: ast::ModuleKind::Script,
name: vec![],
name: "".to_string(),
type_info: (),
definitions: vec![
ast::UntypedDefinition::Use {