patterns: Fixed enums not counting properly

This commit is contained in:
WerWolv
2021-09-11 23:14:22 +02:00
parent 3d15a108af
commit 635f0606e0
4 changed files with 7 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
#include <bit>
#include <optional>
#include <unordered_map>
#include <map>
#include <variant>
#include <vector>
@@ -381,13 +381,13 @@ namespace hex::pl {
return new ASTNodeEnum(*this);
}
[[nodiscard]] const std::unordered_map<std::string, ASTNode*>& getEntries() const { return this->m_entries; }
[[nodiscard]] const std::map<std::string, ASTNode*>& getEntries() const { return this->m_entries; }
void addEntry(const std::string &name, ASTNode* expression) { this->m_entries.insert({ name, expression }); }
[[nodiscard]] ASTNode *getUnderlyingType() { return this->m_underlyingType; }
private:
std::unordered_map<std::string, ASTNode*> m_entries;
std::map<std::string, ASTNode*> m_entries;
ASTNode *m_underlyingType;
};

View File

@@ -11,6 +11,9 @@
#include <map>
#include <vector>
#define LITERAL_COMPARE(literal, cond) std::visit([&](auto &&literal) { return (cond) != 0; }, literal)
#define AS_TYPE(type, value) ctx.template asType<type>(value)
namespace hex::prv { class Provider; }
namespace hex::pl {