Run var def filter during parsing.

This commit is contained in:
Stephen Chung
2022-02-13 18:46:25 +08:00
parent 664e3d31e5
commit 5bb6ce835f
9 changed files with 115 additions and 49 deletions

View File

@@ -595,6 +595,16 @@ impl Scope<'_> {
.zip(self.values.iter())
.map(|((name, ..), value)| (name.as_ref(), value.is_read_only(), value))
}
/// Get a reverse iterator to entries in the [`Scope`].
/// Shared values are not expanded.
#[inline]
pub(crate) fn iter_rev_raw(&self) -> impl Iterator<Item = (&str, bool, &Dynamic)> {
self.names
.iter()
.rev()
.zip(self.values.iter().rev())
.map(|((name, ..), value)| (name.as_ref(), value.is_read_only(), value))
}
/// Remove a range of entries within the [`Scope`].
///
/// # Panics