Add a Reference structure to the StandardComponents namespace.

This commit is contained in:
Username404 2021-08-08 22:53:29 +02:00
parent 43136672bd
commit 9871cc66c7
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,9 @@ namespace StandardComponents {
explicit Define(const bool& isFinal, string_view nameText): NamedIdentifier(nameText), final(isFinal) {}
explicit Define(string_view nameText): Define(false, nameText) {}
};
struct Reference: NamedIdentifier {
using NamedIdentifier::NamedIdentifier;
};
struct Class: NamedIdentifier {
struct Constructor {};

View File

@ -28,6 +28,8 @@ namespace Parser {
if (isFinalDefine || next.toktype == tok::DEFINE) {
parseTree << Define(isFinalDefine, current.toktext);
i += isFinalDefine ? 2 : 1;
} else {
parseTree << Reference(current.toktext);
}
}
}