From d1cd747e86d4c55ba83bb0a3ded61126846e7437 Mon Sep 17 00:00:00 2001 From: Ugric Date: Tue, 28 Mar 2023 23:09:51 +0100 Subject: [PATCH] fix catch error --- src/trycatch.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/trycatch.go b/src/trycatch.go index 3817ba1..9521950 100644 --- a/src/trycatch.go +++ b/src/trycatch.go @@ -28,11 +28,10 @@ func parseTryCatch(code UNPARSEcode, index int, codelines []UNPARSEcode) (TryCat return TryCatch{}, false, err, i } totalIndex += i - /* - if index+totalIndex >= len(codelines) { - return TryCatch{}, false, ArErr{"Syntax Error", "expected catch statement", code.line, code.path, code.realcode, true}, i - } - */ + + if index+totalIndex >= len(codelines) { + return TryCatch{}, false, ArErr{"Syntax Error", "expected catch statement", code.line, code.path, code.realcode, true}, i + } catchtrimmed := strings.TrimSpace(codelines[index+totalIndex].code) if !catchCompiled.MatchString(catchtrimmed) { return TryCatch{}, false, ArErr{"Syntax Error", "invalid syntax", code.line, code.path, code.realcode, true}, i