diff options
| author | Patrick Schönberger | 2021-08-04 21:44:26 +0200 |
|---|---|---|
| committer | Patrick Schönberger | 2021-08-04 21:44:26 +0200 |
| commit | b9322dfb8efe37f6f88a899269bdf21015f4db9a (patch) | |
| tree | 837a9aadd80723f6c3d672fe0c9ae04f4f0864c8 /src/repr.h | |
| parent | c2ba7425955ae538e220cec79d9124756d1b4c8b (diff) | |
| download | toc-b9322dfb8efe37f6f88a899269bdf21015f4db9a.tar.gz toc-b9322dfb8efe37f6f88a899269bdf21015f4db9a.zip | |
generic functions and structs
Diffstat (limited to 'src/repr.h')
| -rw-r--r-- | src/repr.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -61,6 +61,7 @@ struct Type std::vector<std::string> namespacePrefixes;
std::string name;
std::vector<TypeModifier> modifiers;
+ std::vector<Type> genericInstantiation;
};
struct Variable
@@ -77,8 +78,10 @@ struct Body struct Function
{
- Type returnType;
std::string name;
+ std::vector<std::string> genericTypeNames;
+ std::vector<std::vector<Type>> genericInstantiations;
+ Type returnType;
std::vector<Variable> parameters;
bool defined;
Body body;
@@ -95,6 +98,8 @@ struct StructMember struct Struct
{
std::string name;
+ std::vector<std::string> genericTypeNames;
+ std::vector<std::vector<Type>> genericInstantiations;
std::vector<StructMember<Variable>> members;
std::vector<StructMember<Function>> methods;
};
@@ -126,6 +131,7 @@ struct FuncExpr std::vector<std::string> namespacePrefixes;
std::string functionName;
std::vector<Expr> arguments;
+ std::vector<Type> genericInstantiation;
};
struct MethodExpr
@@ -133,6 +139,7 @@ struct MethodExpr std::shared_ptr<Expr> expr;
std::string methodName;
std::vector<Expr> arguments;
+ std::vector<Type> genericInstantiation;
};
enum class LitType
@@ -157,6 +164,7 @@ struct ParenExpr struct DotExpr
{
+ bool isPointer;
std::shared_ptr<Expr> expr;
std::string identifier;
};
|
