field exporting
This commit is contained in:
+1
-7
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user