diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index eb90743..7a57e78 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -13,7 +13,7 @@ using namespace std; #include "../lex.hpp" -#define IS(X) template::value>::type* = nullptr> +#define IS(X) template::value>::type* = nullptr> struct ParseComponent { [[nodiscard]] constexpr const type_info& getId() const { return typeid(*this); } virtual ~ParseComponent() = default; @@ -88,6 +88,8 @@ public: } return optional>(); }; + IS(StandardComponents::NamedIdentifier) + inline auto operator[](const string& key) const { return findReferenceByName(key); } inline size_t getCompCount() const { return subComponents.size(); } IS_PARSECOMPONENT inline void add(const T& component) { addComponent(component); }; IS_PARSECOMPONENT inline void addAll(const initializer_list& components) { addAllComponents(components); }