From 0adbd20ff8b4d4f8156ee941d3d0b17e80c3a80f Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 19 Dec 2016 09:21:35 +0000 Subject: tweaks to work with modelica-parser-lalrpop --- src/modelica_model.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modelica_model.rs') diff --git a/src/modelica_model.rs b/src/modelica_model.rs index bcc00b1..36c5a2e 100644 --- a/src/modelica_model.rs +++ b/src/modelica_model.rs @@ -133,10 +133,10 @@ impl ModelicaModelExt for ModelicaModel { // TODO: sort output equations by LHS Ok(ModelicaModel{ name: self.name.clone(), + description: self.description.clone(), components: self.components.clone(), connections: vec![], equations: solved, - extends: vec![], }) } } @@ -186,10 +186,10 @@ impl SimpleEquationExt for SimpleEquation { use modelica_parser::ast::BinOperator::*; match self.lhs { Ident(ref s) if s == ident => Ok((*self).clone()), - Ident(_) | Integer(_) | Float(_) => + Ident(_) | Integer(_) | Float(_) | Boolean(_) | StringLiteral(_) => Err("SymbolicError: InternalError: expected var on LHS".to_string()), - Der(_) | Abs(_) => - Err("SymbolicError: NaiveImplementation: can't simplify der() or abs()".to_string()), + Der(_) | MathUnaryExpr(_,_) | Sign(_) | Array(_) => + Err("SymbolicError: NaiveImplementation: can't simplify".to_string()), // TODO: create a macro for the below... BinExpr(Multiply, ref a, ref b) if a.contains(ident) => { SimpleEquation{ -- cgit v1.2.3