diff options
author | bnewbold <bnewbold@robocracy.org> | 2017-01-16 18:03:50 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2017-01-16 18:03:50 -0800 |
commit | 4a5fdd64541f79321d171697930680039123938d (patch) | |
tree | bdc0785ca833dc5b2188eb4dfb8ca50625d7e22b /modelica-parser-lalrpop | |
parent | 33718f831a54e30254c194116baba82e9d8c6bad (diff) | |
download | modelthing-4a5fdd64541f79321d171697930680039123938d.tar.gz modelthing-4a5fdd64541f79321d171697930680039123938d.zip |
parser: fix get_constant_vars()
Diffstat (limited to 'modelica-parser-lalrpop')
-rw-r--r-- | modelica-parser-lalrpop/src/ast.rs | 6 |
1 files 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<String,Option<Expr>> { 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()); + }, _ => (), } } |