diff --git a/oca/src/facade/fetch.rs b/oca/src/facade/fetch.rs index 3b37cd5..ac39f17 100644 --- a/oca/src/facade/fetch.rs +++ b/oca/src/facade/fetch.rs @@ -10,6 +10,7 @@ use oca_bundle::state::oca::{ capture_base::CaptureBase, DynOverlay, OCABundle, }; +#[cfg(feature = "local-references")] use std::collections::HashMap; use std::rc::Rc; use serde::Serialize; @@ -324,6 +325,15 @@ impl Facade { Ok(oca_file::ocafile::generate_from_ast(&oca_ast)) } + pub fn get_oca_bundle_ast(&self, said: String) -> Result> { + let oca_bundle_steps = self.get_oca_bundle_steps(said)?; + let mut oca_ast = OCAAst::new(); + for step in oca_bundle_steps { + oca_ast.commands.push(step.command); + } + Ok(oca_ast) + } + pub fn parse_oca_bundle_to_ocafile(&self, bundle: &OCABundle) -> Result> { let oca_ast = bundle.to_ast(); Ok(oca_file::ocafile::generate_from_ast(&oca_ast))