mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Report EParseUndefined at the identifier causing it.
It was being reported at the next token in some cases, due to needing to resolve the scope.
This commit is contained in:
parent
9b2668808f
commit
09d96576c7
1 changed files with 4 additions and 0 deletions
|
@ -893,6 +893,7 @@ class parser(object):
|
|||
raise EParseUEOF(self)
|
||||
raise EParseSyntax(self)
|
||||
name = val
|
||||
idpos = self.errorpos
|
||||
self.NextToken()
|
||||
|
||||
# Course of action decided here.
|
||||
|
@ -904,9 +905,11 @@ class parser(object):
|
|||
# Functions are looked up in the global scope only.
|
||||
sym = self.FindSymbolFull(val, 0)
|
||||
if sym is None:
|
||||
self.errorpos = idpos
|
||||
raise EParseUndefined(self)
|
||||
|
||||
if sym['Kind'] != 'f':
|
||||
self.errorpos = idpos
|
||||
raise EParseUndefined(self)
|
||||
args = self.Parse_optional_expression_list(sym['ParamTypes'])
|
||||
self.expect(')')
|
||||
|
@ -915,6 +918,7 @@ class parser(object):
|
|||
|
||||
sym = self.FindSymbolFull(val)
|
||||
if sym is None or sym['Kind'] != 'v':
|
||||
self.errorpos = idpos
|
||||
raise EParseUndefined(self)
|
||||
|
||||
typ = sym['Type']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue