polserver/pol-core/bscript/compiler/model/LocalVariableScopeInfo.h
Eric Swanson e344a8a483
Consolidate local variable scope information (#301)
Adds:
- model/LocalVariableScopeInfo.h

Stores, for local variable blocks:
- the names of the local variables in the block
- the "base index" of those local variables within the current scope

The code generator uses these to clean up local variables as they go out of scope.

We also need this when writing debug information.
2020-09-12 09:31:52 -07:00

19 lines
383 B
C++

#ifndef POLSERVER_LOCALVARIABLESCOPEINFO_H
#define POLSERVER_LOCALVARIABLESCOPEINFO_H
#include <memory>
#include <vector>
namespace Pol::Bscript::Compiler
{
class Variable;
class LocalVariableScopeInfo
{
public:
unsigned base_index = 0;
std::vector<std::shared_ptr<Variable>> variables;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_LOCALVARIABLESCOPEINFO_H