mirror of https://github.com/OpenMW/openmw.git
added global variable handling to compiler context (not working yet because of case problems)
parent
f9c1548f80
commit
d57e67e722
@ -0,0 +1,26 @@
|
||||
|
||||
#include "compilercontext.hpp"
|
||||
|
||||
#include "../mwworld/environment.hpp"
|
||||
#include "../mwworld/world.hpp"
|
||||
|
||||
namespace MWScript
|
||||
{
|
||||
CompilerContext::CompilerContext (Type type, const MWWorld::Environment& environment)
|
||||
: mType (type), mEnvironment (environment)
|
||||
{}
|
||||
|
||||
bool CompilerContext::canDeclareLocals() const
|
||||
{
|
||||
return mType==Type_Full;
|
||||
}
|
||||
|
||||
char CompilerContext::getGlobalType (const std::string& name) const
|
||||
{
|
||||
if (const ESM::Global *global = mEnvironment.mWorld->getStore().globals.find (name))
|
||||
return global->type;
|
||||
|
||||
return ' ';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue