From 4a5fdd64541f79321d171697930680039123938d Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 16 Jan 2017 18:03:50 -0800 Subject: parser: fix get_constant_vars() --- modelica-parser-lalrpop/src/ast.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modelica-parser-lalrpop/src/ast.rs b/modelica-parser-lalrpop/src/ast.rs index 041491a..12b1503 100644 --- a/modelica-parser-lalrpop/src/ast.rs +++ b/modelica-parser-lalrpop/src/ast.rs @@ -133,11 +133,11 @@ impl ModelicaModel { pub fn get_constant_vars(&self) -> HashMap> { let mut binds = HashMap::new(); - // XXX: actually implement this... for c in &self.components { match c.prefix { - Some(ComponentPrefix::Constant) => { binds.insert(c.name.clone(), Some(Expr::Integer(123))); }, - Some(ComponentPrefix::Parameter) => { binds.insert(c.name.clone(), Some(Expr::Float(4.56))); }, + Some(ComponentPrefix::Constant) | Some(ComponentPrefix::Parameter)=> { + binds.insert(c.name.clone(), c.value.clone()); + }, _ => (), } } -- cgit v1.2.3