Fix error type on non-var global identifier in expression.

The error message should be EParseUndefined, not EParseTypeMismatch.
This commit is contained in:
Sei Lisa 2017-01-30 06:07:52 +01:00
parent 7419ac4982
commit c71b0eea2f

View file

@ -913,11 +913,9 @@ class parser(object):
return {'nt':'FNCALL', 't':sym['Type'], 'name':name, 'ch':args} return {'nt':'FNCALL', 't':sym['Type'], 'name':name, 'ch':args}
sym = self.FindSymbolFull(val) sym = self.FindSymbolFull(val)
if sym is None: if sym is None or sym['Kind'] != 'v':
raise EParseUndefined(self) raise EParseUndefined(self)
if sym['Kind'] != 'v':
raise EParseTypeMismatch(self)
typ = sym['Type'] typ = sym['Type']
lvalue = {'nt':'IDENT', 't':typ, 'name':name, 'scope':sym['Scope']} lvalue = {'nt':'IDENT', 't':typ, 'name':name, 'scope':sym['Scope']}