pub fn resolve_one_level(self, variables: &HashMap<VarName, AttrVal>) -> AttrVal {
        self.into_iter()
            .map(|entry| match entry {
                AttrValElement::Expr(expr) => AttrValElement::Expr(expr.map_terminals_into(|child_expr| match child_expr {
                    AttrValExpr::VarRef(var_name) => match variables.get(&var_name) {
                        Some(value) => AttrValExpr::Literal(value.clone()),
                        None => AttrValExpr::VarRef(var_name),
                    },
                    other => other,
                })),

                _ => entry,
            })
            .collect()
    }
/// resolve partially.
/// If a var-ref links to another var-ref, that other var-ref is used.
/// If a referenced variable is not found in the given hashmap, returns the var-ref unchanged.
resolve partially.
If a var-ref links to another var-ref, that other var-ref is used.
If a referenced variable is not found in the given hashmap, returns the var-ref unchanged.
resolve partially . If a var - ref links to another var - ref that other var - ref is used . If a referenced variable is not found in the given hashmap returns the var - ref unchanged .
pub fn resolve_one_level(self, variables: &HashMap<VarName, AttrVal>) -> AttrVal {
        self.into_iter()
            .map(|entry| match entry {
                AttrValElement::Expr(expr) => AttrValElement::Expr(expr.map_terminals_into(|child_expr| match child_expr {
                    AttrValExpr::VarRef(var_name) => match variables.get(&var_name) {
                        Some(value) => AttrValExpr::Literal(value.clone()),
                        None => AttrValExpr::VarRef(var_name),
                    },
                    other => other,
                })),
                _ => entry,
            })
            .collect()
    }
pub fn resolve_one_level ( self , variables : & HashMap < VarName , AttrVal > ) -> AttrVal { self . into_iter ( ) . map ( | entry | match entry { AttrValElement :: Expr ( expr ) => AttrValElement :: Expr ( expr . map_terminals_into ( | child_expr | match child_expr { AttrValExpr :: VarRef ( var_name ) => match variables . get ( & var_name ) { Some ( value ) => AttrValExpr :: Literal ( value . clone ( ) ) , None => AttrValExpr :: VarRef ( var_name ) , } , other => other , } ) ) , _ => entry , } ) . collect ( ) }
resolve partially.
resolve partially .
self
variables
&HashMap<VarName, AttrVal>