From 7d42b73a02d0b2b8964d6a5a633b9102f52c717b Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 2 Nov 2016 19:26:57 -0700 Subject: similarly crude javascript output --- src/bin/mt-tool.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/bin') 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")) { -- cgit v1.2.3