abouttreesummaryrefslogcommitdiff
path: root/src/repr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/repr.h')
-rw-r--r--src/repr.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/repr.h b/src/repr.h
index f196427..fc77d92 100644
--- a/src/repr.h
+++ b/src/repr.h
@@ -37,6 +37,12 @@ struct AssignStmt;
struct ReturnStmt;
struct Stmt;
+struct Context
+{
+ std::shared_ptr<Context> parent;
+ std::vector<Variable> variables;
+};
+
enum class TypeModifierType
{
Pointer, Array
@@ -65,7 +71,7 @@ struct Variable
struct Body
{
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Stmt> statements;
};
@@ -95,7 +101,7 @@ struct Struct
struct Namespace
{
std::string name;
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Struct> structs;
std::vector<Function> functions;
std::vector<Namespace> namespaces;
@@ -103,7 +109,7 @@ struct Namespace
struct Program
{
- std::vector<Variable> variables;
+ std::shared_ptr<Context> ctx;
std::vector<Struct> structs;
std::vector<Function> functions;
std::vector<Namespace> namespaces;