Skip to content

Commit

Permalink
fix(parser): no syntax errors are displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Nov 20, 2024
1 parent b2fb80c commit 7a64828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
19 changes: 2 additions & 17 deletions crates/erg_compiler/build_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,23 +421,8 @@ impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable>
debug_assert!(res.is_ok(), "{:?}", res.unwrap_err());
log!(info "Dependency resolution process completed");
log!("graph:\n{}", self.shared.graph.display());
if self.parse_errors.errors.is_empty() {
self.shared.warns.extend(self.parse_errors.warns.flush());
// continue analysis if ELS mode
} else if self.cfg.mode == ErgMode::LanguageServer {
// self.finalize();
self.shared.errors.extend(self.parse_errors.errors.flush());
self.shared.warns.extend(self.parse_errors.warns.flush());
} else {
/*
self.finalize();
return Err(IncompleteArtifact::new(
None,
self.parse_errors.errors.flush(),
self.parse_errors.warns.flush(),
));
*/
}
self.shared.errors.extend(self.parse_errors.errors.flush());
self.shared.warns.extend(self.parse_errors.warns.flush());
self.execute(ast, mode)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/erg_parser/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl Parser {
fn next_expr(&mut self) {
while let Some(t) = self.peek() {
match t.category() {
TC::Separator | TC::DefOp | TC::LambdaOp => {
TC::Separator => {
self.skip();
return;
}
Expand Down

0 comments on commit 7a64828

Please sign in to comment.