Warnings on analyzer

This commit is contained in:
Greg Shuflin 2024-06-03 15:58:15 -07:00
parent 32d7d2f03d
commit ed11e76600

View File

@ -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<Warning>,
}
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<Justfile> = 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,
})
}