From ed11e7660071d20ba3ba63d946c84bc11da1beb2 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 3 Jun 2024 15:58:15 -0700 Subject: [PATCH] Warnings on analyzer --- src/analyzer.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/analyzer.rs b/src/analyzer.rs index e2ef9cf..28bc34a 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -5,6 +5,7 @@ pub(crate) struct Analyzer<'src> { assignments: Table<'src, Assignment<'src>>, aliases: Table<'src, Alias<'src, Name<'src>>>, sets: Table<'src, Set<'src>>, + warnings: Vec, } impl<'src> Analyzer<'src> { @@ -18,14 +19,11 @@ impl<'src> Analyzer<'src> { let mut analyzer = Self::default(); let mut unprocessed_recipes = Vec::new(); - let mut unprocessed_assignments = Vec::new(); let mut stack = Vec::new(); stack.push(asts.get(root).unwrap()); - let mut warnings = Vec::new(); - let mut modules: Table = Table::new(); let mut definitions: HashMap<&str, (&'static str, Name)> = HashMap::new(); @@ -92,7 +90,7 @@ impl<'src> Analyzer<'src> { } } - warnings.extend(ast.warnings.iter().cloned()); + analyzer.warnings.extend(ast.warnings.iter().cloned()); } let settings = Settings::from_setting_iter(analyzer.sets.into_iter().map(|(_, set)| set.value)); @@ -159,7 +157,7 @@ impl<'src> Analyzer<'src> { recipes, settings, source: root.into(), - warnings, + warnings: analyzer.warnings, }) }