field exporting

This commit is contained in:
2026-04-17 12:56:08 +02:00
parent d2f7c0c69b
commit ec30d18e15
7 changed files with 56 additions and 31 deletions
+1 -7
View File
@@ -3,7 +3,7 @@ use std::collections::HashMap;
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct ParamList(pub Vec<(String, TypeExpr)>);
pub struct ParamList(pub HashMap<String, (bool, TypeExpr)>);
#[derive(Debug, Clone, Serialize)]
pub struct Block(pub Vec<Statement>);
@@ -120,9 +120,3 @@ 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()
}
}