Warnings on analyzer
This commit is contained in:
parent
32d7d2f03d
commit
ed11e76600
@ -5,6 +5,7 @@ pub(crate) struct Analyzer<'src> {
|
|||||||
assignments: Table<'src, Assignment<'src>>,
|
assignments: Table<'src, Assignment<'src>>,
|
||||||
aliases: Table<'src, Alias<'src, Name<'src>>>,
|
aliases: Table<'src, Alias<'src, Name<'src>>>,
|
||||||
sets: Table<'src, Set<'src>>,
|
sets: Table<'src, Set<'src>>,
|
||||||
|
warnings: Vec<Warning>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'src> Analyzer<'src> {
|
impl<'src> Analyzer<'src> {
|
||||||
@ -18,14 +19,11 @@ impl<'src> Analyzer<'src> {
|
|||||||
let mut analyzer = Self::default();
|
let mut analyzer = Self::default();
|
||||||
|
|
||||||
let mut unprocessed_recipes = Vec::new();
|
let mut unprocessed_recipes = Vec::new();
|
||||||
|
|
||||||
let mut unprocessed_assignments = Vec::new();
|
let mut unprocessed_assignments = Vec::new();
|
||||||
|
|
||||||
let mut stack = Vec::new();
|
let mut stack = Vec::new();
|
||||||
stack.push(asts.get(root).unwrap());
|
stack.push(asts.get(root).unwrap());
|
||||||
|
|
||||||
let mut warnings = Vec::new();
|
|
||||||
|
|
||||||
let mut modules: Table<Justfile> = Table::new();
|
let mut modules: Table<Justfile> = Table::new();
|
||||||
|
|
||||||
let mut definitions: HashMap<&str, (&'static str, Name)> = HashMap::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));
|
let settings = Settings::from_setting_iter(analyzer.sets.into_iter().map(|(_, set)| set.value));
|
||||||
@ -159,7 +157,7 @@ impl<'src> Analyzer<'src> {
|
|||||||
recipes,
|
recipes,
|
||||||
settings,
|
settings,
|
||||||
source: root.into(),
|
source: root.into(),
|
||||||
warnings,
|
warnings: analyzer.warnings,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user