From ae2c1e2ae5a856a461cd87827441be74ff9a2597 Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 24 Jul 2018 16:14:58 +0200 Subject: [PATCH] Fix for #6 --- engine/compiler.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/compiler.c b/engine/compiler.c index db0935d..f2a9689 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -5160,7 +5160,11 @@ static sxi32 PH7_CompileSwitch(ph7_gen_state *pGen) { for(;;) { sxu32 nKwrd; if(pGen->pIn >= pGen->pEnd) { - /* No more input to process */ + /* No more input to process and switch block not ended */ + rc = PH7_GenCompileError(&(*pGen), E_ERROR, pGen->pIn->nLine, "Unexpected end of file, expecting 'case' or 'default' or '}'"); + if(rc == SXERR_ABORT) { + return SXERR_ABORT; + } break; } if((pGen->pIn->nType & PH7_TK_KEYWORD) == 0) {