From: Huck Boles Date: Wed, 10 May 2023 23:54:36 +0000 (-0500) Subject: error messages X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=86efcfa5d5385fa4538d57ad84ce2d813c996201;p=metaforge.git error messages --- diff --git a/src/filetype/builder.rs b/src/filetype/builder.rs index adea616..982030a 100644 --- a/src/filetype/builder.rs +++ b/src/filetype/builder.rs @@ -131,6 +131,7 @@ fn get_pattern(key: &str, file: &MetaFile, dirs: &Options) -> Result { return Ok(String::new()); }; + // DEFAULT override for variables defined higher in chain if filename == "DEFAULT" { filename = "default"; } diff --git a/src/filetype/structs.rs b/src/filetype/structs.rs deleted file mode 100644 index 139597f..0000000 --- a/src/filetype/structs.rs +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/parser/parse.rs b/src/parser/parse.rs index 7dbb3ae..82c9609 100644 --- a/src/parser/parse.rs +++ b/src/parser/parse.rs @@ -1,5 +1,5 @@ use crate::{source, MetaFile, Source, Substitution}; -use color_eyre::Result; +use color_eyre::{eyre::WrapErr, Result}; use pest::{ iterators::{Pair, Pairs}, Parser, @@ -11,7 +11,10 @@ use std::collections::HashMap; pub struct MetaParser; pub fn parse_file(file: &str) -> Result { - let meta_source = MetaParser::parse(Rule::file, file)?.next().unwrap(); + let meta_source = MetaParser::parse(Rule::file, file) + .wrap_err("parser error")? + .next() + .unwrap(); Ok(parse_pair(meta_source)) }