Skip to main content

generate_ocafile/
generate_ocafile.rs

1use std::fs;
2
3use oca_sdk_rs::*;
4
5fn main() {
6    let bundle_path = "tests/assets/semantics/structural_bundle2.json";
7    let bundle_str = fs::read_to_string(bundle_path).expect("failed to read bundle");
8
9    let registry = oca::overlay_file::OverlayLocalRegistry::from_dir("tests/assets/overlay-file/")
10        .expect("load overlays");
11    let bundle = oca::bundle::load(&mut bundle_str.as_bytes(), &registry).expect("load bundle");
12    let ocafile = oca::file::generate_from_ast(&bundle.to_ast());
13
14    println!("{}", ocafile);
15}