diff options
| author | Patrick Schönberger | 2021-08-11 23:34:11 +0200 |
|---|---|---|
| committer | Patrick Schönberger | 2021-08-11 23:34:11 +0200 |
| commit | 9610ce88f0b753db81014a053bd3c6d79471c90c (patch) | |
| tree | cfe08fa3543362bcb92473e23785efdf5666486c /src/repr.h | |
| parent | 17860defa84c6d8bc0e8bc088a7e09361f17db07 (diff) | |
| download | toc-9610ce88f0b753db81014a053bd3c6d79471c90c.tar.gz toc-9610ce88f0b753db81014a053bd3c6d79471c90c.zip | |
add comments, fix struct/function lookup
Diffstat (limited to 'src/repr.h')
| -rw-r--r-- | src/repr.h | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -44,6 +44,7 @@ struct Context std::vector<Variable> variables;
std::vector<Function> functions;
std::vector<Struct> structs;
+ std::vector<Namespace> namespaces;
};
enum class TypeModifierType
@@ -65,6 +66,21 @@ struct Type std::string name;
std::vector<TypeModifier> modifiers;
std::vector<Type> genericInstantiation;
+
+ bool operator!=(const Type & that)
+ {
+ if (this->name != that.name)
+ return true;
+
+ for (int i = 0; i < this->modifiers.size(); i++)
+ if (this->modifiers[i].type != that.modifiers[i].type)
+ return true;
+
+ for (int i = 0; i < this->namespacePrefixes.size(); i++)
+ if (this->namespacePrefixes[i] != that.namespacePrefixes[i])
+ return true;
+ return false;
+ }
};
struct Variable
@@ -113,13 +129,11 @@ struct Namespace {
std::string name;
std::shared_ptr<Context> ctx;
- std::vector<Namespace> namespaces;
};
struct Program
{
std::shared_ptr<Context> ctx;
- std::vector<Namespace> namespaces;
};
enum class ExprType
|
