diff options
| -rw-r--r-- | src/bin/mt-tool.rs | 2 | ||||
| -rw-r--r-- | src/lib.rs | 4 | ||||
| -rw-r--r-- | src/modelica_model.rs | 8 | ||||
| -rw-r--r-- | src/transpile_js.rs | 4 | ||||
| -rw-r--r-- | src/transpile_scheme.rs | 4 | ||||
| -rw-r--r-- | tests/lib.rs | 2 | ||||
| -rw-r--r-- | tests/rebalance.rs | 4 | 
7 files changed, 14 insertions, 14 deletions
| diff --git a/src/bin/mt-tool.rs b/src/bin/mt-tool.rs index 37b1705..b6763b2 100644 --- a/src/bin/mt-tool.rs +++ b/src/bin/mt-tool.rs @@ -25,7 +25,7 @@ fn parse_modelica_files(paths: Vec<String>) {          }          let time_stamp = Instant::now(); -        let result = modelica_parser::parser::parse_model(&s); +        let result = modelica_parser::parse_model(&s);          let elapsed = time_stamp.elapsed();          let elapsed = elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1000_000_000.0; @@ -41,7 +41,7 @@ pub struct ModelVar {  #[derive(Debug, PartialEq)]  pub struct ModelEntry { -    pub ast: modelica_parser::ast::ModelicaModel, +    pub ast: modelica_parser::ModelicaModel,      pub metadata: ModelMetadata,      pub markdown: String,  } @@ -66,7 +66,7 @@ pub fn load_model_entry(p: &Path) -> Result<ModelEntry, String> {          try!(File::open(p.join("model.modelica"))              .and_then(|mut f| f.read_to_string(&mut s))              .map_err(|e| e.to_string())); -        try!(modelica_parser::parser::parse_model(&s).map_err(|e| format!("{:?}", e))) +        try!(modelica_parser::parse_model(&s).map_err(|e| format!("{:?}", e)))      };      let metadata = { diff --git a/src/modelica_model.rs b/src/modelica_model.rs index 7b77123..b0bc825 100644 --- a/src/modelica_model.rs +++ b/src/modelica_model.rs @@ -5,7 +5,7 @@ use std::clone::Clone;  use std::collections::HashMap;  use std::collections::HashSet; -use self::modelica_parser::ast::*; +use self::modelica_parser::*;  /// / Helpers @@ -170,7 +170,7 @@ impl ModelicaModelExt for ModelicaModel {  // Recurses through 'original', replacing all instances of 'a' with 'b'  fn substitute_with(original: &Expr, a: &Expr, b: &Expr) -> Expr { -    use modelica_parser::ast::Expr::*; +    use modelica_parser::Expr::*;      println!("original: {:?}  replacing: {:?}   with: {:?}", original, a, b);      if *original == *a {          return b.clone(); @@ -234,8 +234,8 @@ impl SimpleEquationExt for SimpleEquation {      }      fn simplify_lhs(&self, ident: &str) -> Result<SimpleEquation, String> { -        use modelica_parser::ast::Expr::*; -        use modelica_parser::ast::BinOperator::*; +        use modelica_parser::Expr::*; +        use modelica_parser::BinOperator::*;          match self.lhs {              Ident(ref s) if s == ident => Ok((*self).clone()),              Ident(_) | Integer(_) | Float(_) | Boolean(_) | StringLiteral(_) => { diff --git a/src/transpile_js.rs b/src/transpile_js.rs index 1fa6075..b14b964 100644 --- a/src/transpile_js.rs +++ b/src/transpile_js.rs @@ -1,7 +1,7 @@  extern crate modelica_parser; -use self::modelica_parser::ast::*; +use self::modelica_parser::*;  pub trait TranspileJS {      fn repr_js(&self) -> Result<String, String>; @@ -42,7 +42,7 @@ impl TranspileJS for ModelicaModel {  impl TranspileJS for Expr {      fn repr_js(&self) -> Result<String, String> { -        use modelica_parser::ast::Expr::*; +        use modelica_parser::Expr::*;          match *self {              Integer(e) => Ok(format!("{}", e)),              Float(e) => Ok(format!("{}", e)), diff --git a/src/transpile_scheme.rs b/src/transpile_scheme.rs index 7c25047..68147e2 100644 --- a/src/transpile_scheme.rs +++ b/src/transpile_scheme.rs @@ -1,7 +1,7 @@  extern crate modelica_parser; -use self::modelica_parser::ast::*; +use self::modelica_parser::*;  pub trait TranspileScheme {      fn repr_scheme(&self) -> Result<String, String>; @@ -40,7 +40,7 @@ impl TranspileScheme for ModelicaModel {  impl TranspileScheme for Expr {      fn repr_scheme(&self) -> Result<String, String> { -        use modelica_parser::ast::Expr::*; +        use modelica_parser::Expr::*;          match *self {              Integer(e) => Ok(format!("{}", e)),              Float(e) => Ok(format!("{}", e)), diff --git a/tests/lib.rs b/tests/lib.rs index 914064d..fb9c98d 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -33,7 +33,7 @@ fn test_search_models() {  #[test]  fn test substitute_with() { -    use modelica_parser::ast::Expr::*; +    use modelica_parser::Expr::*;      let y = BinExpr(BinOperator::Add,                  Box::new(Ident("y".to_string())), diff --git a/tests/rebalance.rs b/tests/rebalance.rs index f365e84..3303a89 100644 --- a/tests/rebalance.rs +++ b/tests/rebalance.rs @@ -3,11 +3,11 @@ extern crate modelica_parser;  extern crate modelthing;  use modelthing::modelica_model::SimpleEquationExt; -use modelica_parser::ast::*; +use modelica_parser::*;  #[test]  fn test_rebalance_for() { -    use modelica_parser::ast::Expr::*; +    use modelica_parser::Expr::*;      // z = a - 1.2345      // a = z + 1.2345 | 
