diff --git a/ets2panda/public/es2panda_lib.cpp b/ets2panda/public/es2panda_lib.cpp index 14a173532ec31d7f31925419203ef651cb418b6a..3ba94058e728602c09b25d1297b4ff34f3fedafc 100644 --- a/ets2panda/public/es2panda_lib.cpp +++ b/ets2panda/public/es2panda_lib.cpp @@ -500,10 +500,7 @@ __attribute__((unused)) static Context *Parse(Context *ctx) ctx->parser->ParseScript(*ctx->sourceFile, ctx->config->options->GetCompilationMode() == CompilationMode::GEN_STD_LIB); } - ctx->state = !ctx->diagnosticEngine->IsAnyError() ? ES2PANDA_STATE_PARSED : ES2PANDA_STATE_ERROR; - if (ctx->state == ES2PANDA_STATE_ERROR) { - ctx->diagnosticEngine->FlushDiagnostic(); - } + ctx->state = ES2PANDA_STATE_PARSED; ctx->phaseManager->SetCurrentPhaseIdToAfterParse(); return ctx; } @@ -535,7 +532,6 @@ __attribute__((unused)) static Context *Check(Context *ctx) } if (ctx->state == ES2PANDA_STATE_ERROR) { - ctx->diagnosticEngine->FlushDiagnostic(); return ctx; } @@ -579,7 +575,6 @@ __attribute__((unused)) static Context *Lower(Context *ctx) } if (ctx->state == ES2PANDA_STATE_ERROR) { - ctx->diagnosticEngine->FlushDiagnostic(); return ctx; } @@ -688,9 +683,6 @@ extern "C" __attribute__((unused)) es2panda_Context *ProceedToState(es2panda_Con break; } - if (ctx->state == ES2PANDA_STATE_ERROR) { - ctx->diagnosticEngine->FlushDiagnostic(); - } return reinterpret_cast(ctx); } diff --git a/ets2panda/test/unit/public/ast_verifier_check_struct_declaration_test.cpp b/ets2panda/test/unit/public/ast_verifier_check_struct_declaration_test.cpp index dbdd1b433c20cd6034af0c1074360b797b1c39e2..288cafaf20f616c57cc4089b17d851b65fc31973 100644 --- a/ets2panda/test/unit/public/ast_verifier_check_struct_declaration_test.cpp +++ b/ets2panda/test/unit/public/ast_verifier_check_struct_declaration_test.cpp @@ -163,7 +163,7 @@ TEST_F(ASTVerifierTest, StructInStruct) } )"; - CONTEXT(ES2PANDA_STATE_PARSED, ES2PANDA_STATE_ERROR, text) + CONTEXT(ES2PANDA_STATE_PARSED, text) { ASSERT_TRUE(GetImpl()->IsAnyError(GetContext())); }