use shm_rs::static_scheme::generator::RustCode; use shm_rs::static_scheme::init; use shm_rs::dynamic_scheme::environment; use shm_rs::serializator::serializator; use shm_rs::RustCodeDerives; fn main() { let curdir = std::env::current_dir().unwrap(); println!("{}", curdir.display()); let schm = init::SchemeInit::new_with_path(curdir).unwrap(); let res = schm.run_from_file("examples/complex_example_1/init_networking.shm", None).unwrap(); let resser = res.get("networking").unwrap().clone(); let anres = resser.analyze().unwrap(); println!("errors:\n{}", anres); let mut curdir = std::env::current_dir().unwrap(); curdir.push("examples/complex_example_1/init_networking_dyn1.shm"); let (_, dyn_res) = environment::DynEnvironment::from_file(curdir, resser.clone()).unwrap(); let ret = serializator::Serialization::serialize(resser.clone(), dyn_res.clone()).unwrap(); let serialized = serde_json::to_string(&ret).unwrap(); println!("Result:\n{}", serialized); let mut rc = RustCode::new(vec![RustCodeDerives::Debug], vec![], None); println!("Structures: "); match resser.generate_rust_code(&mut rc) { Ok(_) => { println!("{}", rc); }, Err(e) => { println!("{}", e); } } }