use crate::verdict::{SafetyLevel, Verdict};
pub(crate) fn exported_verdict<'a>(operands: impl Iterator<Item = &'a str>) -> Verdict {
let mut verdict = Verdict::Allowed(SafetyLevel::Inert);
for operand in operands.filter(|word| !word.starts_with('-')) {
let judged = match operand.split_once('=') {
Some((name, value)) => super::statement_assignment_verdict(name, value, true),
None if hides_an_assignment(operand) => Verdict::Denied,
None => Verdict::Allowed(SafetyLevel::Inert),
};
verdict = verdict.combine(judged);
}
verdict
}
fn hides_an_assignment(word: &str) -> bool {
word.contains(crate::cst::eval::UNPINNABLE) || word.contains(crate::cst::eval::UNRESOLVED_BRACE)
}
#[cfg(test)]
#[path = "exported_tests.rs"]
mod tests;