added custom function handling (compiler)

This commit is contained in:
Marc Zinnschlag 2010-07-03 10:43:55 +02:00
parent a1beffc3cd
commit 32eafaa301
6 changed files with 186 additions and 83 deletions

View file

@ -12,6 +12,8 @@
#include "errorhandler.hpp"
#include "locals.hpp"
#include "stringparser.hpp"
#include "extensions.hpp"
#include "context.hpp"
namespace Compiler
{
@ -279,6 +281,27 @@ namespace Compiler
mNextOperand = false;
return true;
}
else
{
// check for custom extensions
if (const Extensions *extensions = getContext().getExtensions())
{
char returnType;
std::string argumentType;
if (extensions->isFunction (keyword, returnType, argumentType))
{
mTokenLoc = loc;
parseArguments (argumentType, scanner);
extensions->generateFunctionCode (keyword, mCode);
mOperands.push_back (returnType);
mNextOperand = false;
return true;
}
}
}
}
else
{