|
|
|
@ -323,12 +323,17 @@ namespace Compiler
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mAllowExpression)
|
|
|
|
|
{
|
|
|
|
|
if (keyword==Scanner::K_getdisabled || keyword==Scanner::K_getdistance)
|
|
|
|
|
{
|
|
|
|
|
if (mAllowExpression)
|
|
|
|
|
{
|
|
|
|
|
scanner.putbackKeyword (keyword, loc);
|
|
|
|
|
parseExpression (scanner, loc);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
getErrorHandler().warning ("Unexpected naked expression", loc);
|
|
|
|
|
}
|
|
|
|
|
mState = EndState;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -338,24 +343,33 @@ namespace Compiler
|
|
|
|
|
char returnType;
|
|
|
|
|
std::string argumentType;
|
|
|
|
|
|
|
|
|
|
bool hasExplicit = !mExplicit.empty();
|
|
|
|
|
bool hasExplicit = mState==ExplicitState;
|
|
|
|
|
|
|
|
|
|
if (extensions->isFunction (keyword, returnType, argumentType, hasExplicit))
|
|
|
|
|
{
|
|
|
|
|
if (!hasExplicit && !mExplicit.empty())
|
|
|
|
|
if (!hasExplicit && mState==ExplicitState)
|
|
|
|
|
{
|
|
|
|
|
getErrorHandler().warning ("Stray explicit reference", loc);
|
|
|
|
|
mExplicit.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mAllowExpression)
|
|
|
|
|
{
|
|
|
|
|
scanner.putbackKeyword (keyword, loc);
|
|
|
|
|
parseExpression (scanner, loc);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
std::vector<Interpreter::Type_Code> code;
|
|
|
|
|
int optionals = mExprParser.parseArguments (argumentType, scanner, code, keyword);
|
|
|
|
|
mCode.insert(mCode.end(), code.begin(), code.end());
|
|
|
|
|
extensions->generateFunctionCode (keyword, mCode, mLiterals, mExplicit, optionals);
|
|
|
|
|
}
|
|
|
|
|
mState = EndState;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mState==ExplicitState)
|
|
|
|
|
{
|
|
|
|
|