This commit is contained in:
Shunsuke Shibayama 2023-01-28 12:54:42 +09:00
parent 44781cb030
commit e246fad74d
9 changed files with 110 additions and 72 deletions

View file

@ -61,13 +61,15 @@ impl ASTBuilder {
let module = self.runner.parse(src)?;
let mut desugarer = Desugarer::new();
let module = desugarer.desugar(module);
let ast = AST::new(Str::rc(self.runner.cfg().input.full_path()), module);
let path = self.runner.cfg().input.full_path();
let ast = AST::new(Str::rc(path.to_str().unwrap()), module);
Ok(ast)
}
pub fn build_without_desugaring(&mut self, src: String) -> Result<AST, ParserRunnerErrors> {
let module = self.runner.parse(src)?;
let ast = AST::new(Str::rc(self.runner.cfg().input.full_path()), module);
let path = self.runner.cfg().input.full_path();
let ast = AST::new(Str::rc(path.to_str().unwrap()), module);
Ok(ast)
}
}