1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 12:20:41 +00:00
OpenMW/components/compiler/literals.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
761 B
C++
Raw Normal View History

#include "literals.hpp"
#include <algorithm>
#include <cstring>
namespace Compiler
{
int Literals::addInteger(Interpreter::Type_Integer value)
{
int index = static_cast<int>(mIntegers.size());
2022-09-22 18:26:05 +00:00
mIntegers.push_back(value);
2022-09-22 18:26:05 +00:00
return index;
}
int Literals::addFloat(Interpreter::Type_Float value)
{
int index = static_cast<int>(mFloats.size());
2022-09-22 18:26:05 +00:00
mFloats.push_back(value);
2022-09-22 18:26:05 +00:00
return index;
}
int Literals::addString(const std::string& value)
{
int index = static_cast<int>(mStrings.size());
2022-09-22 18:26:05 +00:00
mStrings.push_back(value);
2022-09-22 18:26:05 +00:00
return index;
}
void Literals::clear()
{
mIntegers.clear();
mFloats.clear();
mStrings.clear();
}
}