From 9f82aceb9fbdb42f332d68f4a423123bd0788b2c Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sat, 17 Dec 2016 18:34:47 -0800 Subject: refactor modelica parser into separate crate --- src/bin/mt-tool.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/bin') diff --git a/src/bin/mt-tool.rs b/src/bin/mt-tool.rs index 8ef2464..95a8938 100644 --- a/src/bin/mt-tool.rs +++ b/src/bin/mt-tool.rs @@ -2,10 +2,11 @@ extern crate modelthing; extern crate rustc_serialize; extern crate getopts; +extern crate modelica_parser; -use modelthing::modelica_parser; use modelthing::transpile_scheme::TranspileScheme; use modelthing::transpile_js::TranspileJS; +use modelthing::modelica_model::ModelicaModelExt; use getopts::Options; use std::env; use std::io::Read; @@ -25,13 +26,13 @@ fn parse_modelica_files(paths: Vec) { } let time_stamp = Instant::now(); - let result = modelica_parser::parse_model(&s); + let result = modelica_parser::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; match result { Ok(_) => println!("Input `{}` ({}s): OK", input, elapsed), - Err(err) => println!("Input `{}` ({}sec): ERROR\n{}", input, elapsed, modelthing::pp_parseerror(&s, err)), + Err(err) => println!("Input `{}` ({}sec): ERROR\n{}", input, elapsed, modelica_parser::pp_parseerror(&s, err)), } } } -- cgit v1.2.3