From 9cf287fef8e614f57d0d52d579d6721ba54683f4 Mon Sep 17 00:00:00 2001
From: bnewbold <bnewbold@robocracy.org>
Date: Mon, 26 Dec 2016 00:08:37 -0800
Subject: updates for new modelica-parser-lalrpop hierarchy

---
 src/bin/mt-tool.rs      | 2 +-
 src/lib.rs              | 4 ++--
 src/modelica_model.rs   | 8 ++++----
 src/transpile_js.rs     | 4 ++--
 src/transpile_scheme.rs | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

(limited to 'src')

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;
 
diff --git a/src/lib.rs b/src/lib.rs
index 07bc0b3..91c99ea 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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)),
-- 
cgit v1.2.3