Fix "new" keyword syntax checking
parent
66984a4bb3
commit
51665e8396
|
@ -50,7 +50,11 @@ CBotInstr* CBotNew::Compile(CBotToken* &p, CBotCStack* pStack)
|
||||||
if (!IsOfType(p, ID_NEW)) return nullptr;
|
if (!IsOfType(p, ID_NEW)) return nullptr;
|
||||||
|
|
||||||
// verifies that the token is a class name
|
// verifies that the token is a class name
|
||||||
if (p->GetType() != TokenTypVar) return nullptr;
|
if (p->GetType() != TokenTypVar)
|
||||||
|
{
|
||||||
|
pStack->SetError(CBotErrBadNew, p);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
CBotClass* pClass = CBotClass::Find(p);
|
CBotClass* pClass = CBotClass::Find(p);
|
||||||
if (pClass == nullptr)
|
if (pClass == nullptr)
|
||||||
|
|
Loading…
Reference in New Issue