moving to desktop

This commit is contained in:
2025-05-02 22:03:32 -04:00
parent 57c46b653e
commit 5f36be9de9
19 changed files with 197 additions and 236 deletions

17
src/util/name_stack.rs Normal file
View File

@@ -0,0 +1,17 @@
use std::collections::HashMap;
pub struct NameStack<T>(Vec<HashMap<String, T>>);
impl<T> NameStack<T> {
pub fn new() -> Self {
Self(Vec::new())
}
pub fn search(&self, name: &str) -> Option<&T> {
for level in self.0.iter().rev() {
if let Some(v) = level.get(name) {
return Some(v);
}
}
None
}
}