]> gitweb.ps.run Git - toc/blobdiff - src/repr.h
function resolution, pre generics
[toc] / src / repr.h
index f196427fbe6a9cfae8cf34e6ac95a6d8978caa14..f12b0dacccda6fa3e6737cfc282eb2ceccf8c33d 100644 (file)
@@ -37,6 +37,12 @@ struct AssignStmt;
 struct ReturnStmt;\r
 struct Stmt;\r
 \r
+struct Context\r
+{\r
+  std::shared_ptr<Context> parent;\r
+  std::vector<Variable> variables;\r
+};\r
+\r
 enum class TypeModifierType\r
 {\r
   Pointer, Array\r
@@ -65,7 +71,7 @@ struct Variable
 \r
 struct Body\r
 {\r
-  std::vector<Variable> variables;\r
+  std::shared_ptr<Context> ctx;\r
   std::vector<Stmt> statements;\r
 };\r
 \r
@@ -74,6 +80,7 @@ struct Function
   Type returnType;\r
   std::string name;\r
   std::vector<Variable> parameters;\r
+  bool defined;\r
   Body body;\r
 };\r
 \r
@@ -95,7 +102,7 @@ struct Struct
 struct Namespace\r
 {\r
   std::string name;\r
-  std::vector<Variable> variables;\r
+  std::shared_ptr<Context> ctx;\r
   std::vector<Struct> structs;\r
   std::vector<Function> functions;\r
   std::vector<Namespace> namespaces;\r
@@ -103,7 +110,7 @@ struct Namespace
 \r
 struct Program\r
 {\r
-  std::vector<Variable> variables;\r
+  std::shared_ptr<Context> ctx;\r
   std::vector<Struct> structs;\r
   std::vector<Function> functions;\r
   std::vector<Namespace> namespaces;\r