diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/mt-tool.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bin/mt-tool.rs b/src/bin/mt-tool.rs index 8aac6ca..7dab194 100644 --- a/src/bin/mt-tool.rs +++ b/src/bin/mt-tool.rs @@ -5,6 +5,7 @@ extern crate getopts; use modelthing::modelica_parser; use modelthing::transpile_scheme::TranspileScheme; +use modelthing::transpile_js::TranspileJS; use getopts::Options; use std::env; use std::io::Read; @@ -82,7 +83,7 @@ fn main() { let cmd = matches.free[0].clone(); match cmd.as_str() { "parse" => { parse_modelica_files(matches.free[1..].iter().map(|x| x.to_string()).collect()); }, - "transpile" => { + "transpile_scheme" => { if matches.free.len() != 2 { println!("Expected a single path to load"); exit(-1); @@ -90,6 +91,14 @@ fn main() { let me = modelthing::load_model_entry(Path::new(&matches.free[1])).unwrap(); println!("{}", me.ast.repr_scheme().unwrap()); }, + "transpile_js" => { + if matches.free.len() != 2 { + println!("Expected a single path to load"); + exit(-1); + } + let me = modelthing::load_model_entry(Path::new(&matches.free[1])).unwrap(); + println!("{}", me.ast.repr_js().unwrap()); + }, "list" => { // XXX: search path? for m in modelthing::search_models(Path::new("examples")) { |