diff --git a/src/main.rs b/src/main.rs index 554ceb9..2c5274f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1486,11 +1486,12 @@ async fn compile(config:CompileConfig)->AResult<()>{ std::io::BufReader::new(std::fs::File::open(template_path)?) }; let mut dom=load_dom(input)?; + //hack to traverse root folder as the root object + dom.root_mut().name="src".to_owned(); //add in scripts and models let mut folder=config.input_folder.clone(); - folder.push("src"); - let mut stack:Vec=dom.root().children().into_iter().map(|&referent|CompileStackInstruction::TraverseReferent(referent,None)).collect(); + let mut stack:Vec=vec![CompileStackInstruction::TraverseReferent(dom.root_ref(),None)]; while let Some(instruction)=stack.pop(){ match instruction{ CompileStackInstruction::TraverseReferent(item_ref,blacklist)=>{