|
|
@ -51,7 +51,7 @@ namespace Compiler
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Extensions::registerFunction(
|
|
|
|
void Extensions::registerFunction(
|
|
|
|
const std::string& keyword, ScriptReturn returnType, const ScriptArgs& argumentType, int code, int codeExplicit)
|
|
|
|
const std::string& keyword, ScriptReturn returnType, ScriptArgs argumentType, int code, int codeExplicit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Function function;
|
|
|
|
Function function;
|
|
|
|
|
|
|
|
|
|
|
@ -70,18 +70,18 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
|
|
int keywordIndex = mNextKeywordIndex--;
|
|
|
|
int keywordIndex = mNextKeywordIndex--;
|
|
|
|
|
|
|
|
|
|
|
|
mKeywords.insert(std::make_pair(keyword, keywordIndex));
|
|
|
|
mKeywords.emplace(keyword, keywordIndex);
|
|
|
|
|
|
|
|
|
|
|
|
function.mReturn = returnType;
|
|
|
|
function.mReturn = returnType;
|
|
|
|
function.mArguments = argumentType;
|
|
|
|
function.mArguments = std::move(argumentType);
|
|
|
|
function.mCode = code;
|
|
|
|
function.mCode = code;
|
|
|
|
function.mCodeExplicit = codeExplicit;
|
|
|
|
function.mCodeExplicit = codeExplicit;
|
|
|
|
|
|
|
|
|
|
|
|
mFunctions.insert(std::make_pair(keywordIndex, function));
|
|
|
|
mFunctions.emplace(keywordIndex, std::move(function));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Extensions::registerInstruction(
|
|
|
|
void Extensions::registerInstruction(
|
|
|
|
const std::string& keyword, const ScriptArgs& argumentType, int code, int codeExplicit)
|
|
|
|
const std::string& keyword, ScriptArgs argumentType, int code, int codeExplicit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Instruction instruction;
|
|
|
|
Instruction instruction;
|
|
|
|
|
|
|
|
|
|
|
@ -100,13 +100,13 @@ namespace Compiler
|
|
|
|
|
|
|
|
|
|
|
|
int keywordIndex = mNextKeywordIndex--;
|
|
|
|
int keywordIndex = mNextKeywordIndex--;
|
|
|
|
|
|
|
|
|
|
|
|
mKeywords.insert(std::make_pair(keyword, keywordIndex));
|
|
|
|
mKeywords.emplace(keyword, keywordIndex);
|
|
|
|
|
|
|
|
|
|
|
|
instruction.mArguments = argumentType;
|
|
|
|
instruction.mArguments = std::move(argumentType);
|
|
|
|
instruction.mCode = code;
|
|
|
|
instruction.mCode = code;
|
|
|
|
instruction.mCodeExplicit = codeExplicit;
|
|
|
|
instruction.mCodeExplicit = codeExplicit;
|
|
|
|
|
|
|
|
|
|
|
|
mInstructions.insert(std::make_pair(keywordIndex, instruction));
|
|
|
|
mInstructions.emplace(keywordIndex, std::move(instruction));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Extensions::generateFunctionCode(int keyword, std::vector<Interpreter::Type_Code>& code, Literals& literals,
|
|
|
|
void Extensions::generateFunctionCode(int keyword, std::vector<Interpreter::Type_Code>& code, Literals& literals,
|
|
|
|