From 90fddf9dcd9d42f8fed3aee12d339304642f3f73 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sun, 11 Oct 2020 16:31:49 +0200 Subject: [PATCH] Report EParseCodePathWithoutRet at a more meaningful position --- lslopt/lslparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lslopt/lslparse.py b/lslopt/lslparse.py index 51b72d7..e17cdc8 100644 --- a/lslopt/lslparse.py +++ b/lslopt/lslparse.py @@ -2276,6 +2276,7 @@ list lazy_list_set(list L, integer i, list v) LastIsReturn = False while True: if self.tok[0] == '}': + self.closebrace = self.errorpos break stmt = self.Parse_statement(ReturnType, AllowDecl = True, AllowStSw = AllowStSw, InsideSwitch = InsideSwitch, @@ -2548,6 +2549,7 @@ list lazy_list_set(list L, integer i, list v) body = self.Parse_code_block(typ) del self.locallabels if typ and not getattr(body, 'LIR', False): # is LastIsReturn flag set? + self.errorpos = self.closebrace raise EParseCodePathWithoutRet(self) paramscope = self.scopeindex self.AddSymbol('f', 0, name, Loc=len(self.tree), Type=typ,