]> gitweb.ps.run Git - toc/blobdiff - src/repr.h
generic functions and structs
[toc] / src / repr.h
index f12b0dacccda6fa3e6737cfc282eb2ceccf8c33d..b30aecd1a8f15aa1fc9c827804ef6c01693856e8 100644 (file)
@@ -61,6 +61,7 @@ struct Type
   std::vector<std::string> namespacePrefixes;\r
   std::string name;\r
   std::vector<TypeModifier> modifiers;\r
+  std::vector<Type> genericInstantiation;\r
 };\r
 \r
 struct Variable\r
@@ -77,8 +78,10 @@ struct Body
 \r
 struct Function\r
 {\r
-  Type returnType;\r
   std::string name;\r
+  std::vector<std::string> genericTypeNames;\r
+  std::vector<std::vector<Type>> genericInstantiations;\r
+  Type returnType;\r
   std::vector<Variable> parameters;\r
   bool defined;\r
   Body body;\r
@@ -95,6 +98,8 @@ struct StructMember
 struct Struct\r
 {\r
   std::string name;\r
+  std::vector<std::string> genericTypeNames;\r
+  std::vector<std::vector<Type>> genericInstantiations;\r
   std::vector<StructMember<Variable>> members;\r
   std::vector<StructMember<Function>> methods;\r
 };\r
@@ -126,6 +131,7 @@ struct FuncExpr
   std::vector<std::string> namespacePrefixes;\r
   std::string functionName;\r
   std::vector<Expr> arguments;\r
+  std::vector<Type> genericInstantiation;\r
 };\r
 \r
 struct MethodExpr\r
@@ -133,6 +139,7 @@ struct MethodExpr
   std::shared_ptr<Expr> expr;\r
   std::string methodName;\r
   std::vector<Expr> arguments;\r
+  std::vector<Type> genericInstantiation;\r
 };\r
 \r
 enum class LitType\r
@@ -157,6 +164,7 @@ struct ParenExpr
 \r
 struct DotExpr\r
 {\r
+  bool isPointer;\r
   std::shared_ptr<Expr> expr;\r
   std::string identifier;\r
 };\r