From 7a64828459c95a0b2150ff2f3ba166dc32d1d608 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 20 Nov 2024 20:43:55 +0900 Subject: [PATCH] fix(parser): no syntax errors are displayed --- crates/erg_compiler/build_package.rs | 19 ++----------------- crates/erg_parser/parse.rs | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/crates/erg_compiler/build_package.rs b/crates/erg_compiler/build_package.rs index abcfb05d2..2491c6feb 100644 --- a/crates/erg_compiler/build_package.rs +++ b/crates/erg_compiler/build_package.rs @@ -421,23 +421,8 @@ impl 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) } diff --git a/crates/erg_parser/parse.rs b/crates/erg_parser/parse.rs index c6367439c..92d3513b3 100644 --- a/crates/erg_parser/parse.rs +++ b/crates/erg_parser/parse.rs @@ -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; }