aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2017-01-16 18:03:50 -0800
committerbnewbold <bnewbold@robocracy.org>2017-01-16 18:03:50 -0800
commit4a5fdd64541f79321d171697930680039123938d (patch)
treebdc0785ca833dc5b2188eb4dfb8ca50625d7e22b
parent33718f831a54e30254c194116baba82e9d8c6bad (diff)
downloadmodelthing-4a5fdd64541f79321d171697930680039123938d.tar.gz
modelthing-4a5fdd64541f79321d171697930680039123938d.zip
parser: fix get_constant_vars()
-rw-r--r--modelica-parser-lalrpop/src/ast.rs6
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());
+ },
_ => (),
}
}