mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Report EParseCodePathWithoutRet at a more meaningful position
This commit is contained in:
parent
9e5f6e928d
commit
90fddf9dcd
1 changed files with 2 additions and 0 deletions
|
@ -2276,6 +2276,7 @@ list lazy_list_set(list L, integer i, list v)
|
||||||
LastIsReturn = False
|
LastIsReturn = False
|
||||||
while True:
|
while True:
|
||||||
if self.tok[0] == '}':
|
if self.tok[0] == '}':
|
||||||
|
self.closebrace = self.errorpos
|
||||||
break
|
break
|
||||||
stmt = self.Parse_statement(ReturnType, AllowDecl = True,
|
stmt = self.Parse_statement(ReturnType, AllowDecl = True,
|
||||||
AllowStSw = AllowStSw, InsideSwitch = InsideSwitch,
|
AllowStSw = AllowStSw, InsideSwitch = InsideSwitch,
|
||||||
|
@ -2548,6 +2549,7 @@ list lazy_list_set(list L, integer i, list v)
|
||||||
body = self.Parse_code_block(typ)
|
body = self.Parse_code_block(typ)
|
||||||
del self.locallabels
|
del self.locallabels
|
||||||
if typ and not getattr(body, 'LIR', False): # is LastIsReturn flag set?
|
if typ and not getattr(body, 'LIR', False): # is LastIsReturn flag set?
|
||||||
|
self.errorpos = self.closebrace
|
||||||
raise EParseCodePathWithoutRet(self)
|
raise EParseCodePathWithoutRet(self)
|
||||||
paramscope = self.scopeindex
|
paramscope = self.scopeindex
|
||||||
self.AddSymbol('f', 0, name, Loc=len(self.tree), Type=typ,
|
self.AddSymbol('f', 0, name, Loc=len(self.tree), Type=typ,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue