Remove the ParseComponents constructor declaration and make NamedIdentifier.name a const variable again

This commit is contained in:
Username404 2021-08-08 22:51:49 +02:00
parent e8b2f90263
commit 43136672bd
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 4 deletions

View File

@ -17,15 +17,14 @@ using namespace std;
#define IS_PARSECOMPONENT IS(ParseComponent) #define IS_PARSECOMPONENT IS(ParseComponent)
struct ParseComponent { struct ParseComponent {
[[nodiscard]] const type_info& getId() const { return typeid(*this); } [[nodiscard]] const type_info& getId() const { return typeid(*this); }
ParseComponent() = default;
virtual ~ParseComponent() = default; virtual ~ParseComponent() = default;
}; };
namespace StandardComponents { namespace StandardComponents {
struct [[deprecated]] Expression: ParseComponent {}; struct [[deprecated]] Expression: ParseComponent {};
struct NamedIdentifier: public ParseComponent { struct NamedIdentifier: public ParseComponent {
string name; const string name;
explicit NamedIdentifier(string_view nameText): ParseComponent(), name(nameText) {} explicit NamedIdentifier(string_view nameText): name(nameText) {}
}; };
struct Define: NamedIdentifier { struct Define: NamedIdentifier {
const bool final; const bool final;
@ -41,7 +40,7 @@ namespace StandardComponents {
namespace types { namespace types {
struct String: ParseComponent { struct String: ParseComponent {
const char* content; const char* content;
explicit String(const char* string): ParseComponent(), content(string) {} explicit String(const char* string): content(string) {}
}; };
} }
} }