nemicosm/hidl/src/bin/demo.rs

17 lines
380 B
Rust
Raw Normal View History

2022-01-16 01:25:47 +00:00
use anyhow::Result;
use fs_err as fs;
fn main() -> Result<()> {
let tree = fs::read_to_string("hypercosm.hidl")?;
let tree = hidl::grammar::NamespaceParser::new().parse(&tree).unwrap();
2022-01-16 02:12:35 +00:00
let tree = hidl::hir::lower_namespace(tree);
2022-01-16 01:25:47 +00:00
debug2::dbg!(&tree);
let json = serde_json::to_string_pretty(&tree)?;
fs::write("hypercosm.json", &json)?;
Ok(())
2022-01-15 22:16:52 +00:00
}