Top level scope

This commit is contained in:
2026-04-15 09:16:26 +02:00
parent 19629363b0
commit 6717be038f
5 changed files with 126 additions and 19 deletions
+8
View File
@@ -1,3 +1,5 @@
use std::collections::HashMap;
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
@@ -123,3 +125,9 @@ pub enum VarKind {
Const,
Var,
}
impl ParamList {
pub fn to_hashmap<T>(&self, f: impl Fn(&String, &TypeExpr) -> T) -> HashMap<String, T> {
self.0.iter().map(|(k, v)| (k.clone(), f(k, v))).collect()
}
}