mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
chore(parser): return AST and Warnings
This commit is contained in:
parent
d4b78eb020
commit
324618dbdc
21 changed files with 443 additions and 128 deletions
|
@ -215,12 +215,12 @@ impl ASTLowerer {
|
|||
format!("{}{code}", "\n".repeat(first_line as usize))
|
||||
};
|
||||
match ASTBuilder::new(self.cfg().clone()).build(code) {
|
||||
Ok(ast) => {
|
||||
self.check_doc_ast(ast);
|
||||
Ok(artifact) => {
|
||||
self.check_doc_ast(artifact.ast);
|
||||
}
|
||||
Err(errs) => {
|
||||
let errs = CompileErrors::from(errs);
|
||||
self.errs.extend(errs);
|
||||
Err(iart) => {
|
||||
self.errs.extend(CompileErrors::from(iart.errors));
|
||||
self.warns.extend(CompileErrors::from(iart.warns));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue