X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/17860defa84c6d8bc0e8bc088a7e09361f17db07..c4231c6faf4e1b4650b075c641b0bb8c053739e4:/src/repr.h?ds=sidebyside diff --git a/src/repr.h b/src/repr.h index 709528d..959e74d 100644 --- a/src/repr.h +++ b/src/repr.h @@ -44,6 +44,7 @@ struct Context std::vector variables; std::vector functions; std::vector structs; + std::vector namespaces; }; enum class TypeModifierType @@ -65,6 +66,21 @@ struct Type std::string name; std::vector modifiers; std::vector 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 ctx; - std::vector namespaces; }; struct Program { std::shared_ptr ctx; - std::vector namespaces; }; enum class ExprType