Accept the use of "structure" as an alternative to the "class" keyword

This commit is contained in:
Username404 2021-09-25 16:11:02 +02:00
parent 471a588d37
commit c6ee98e76b
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -31,7 +31,7 @@ namespace Parser {
switch (current.toktype) {
case STRING: parseTree << types::String(current.toktext.data()); break;
case IDENTIFIER: {
if (current.toktext == "class") {
if (current.toktext == "class" || current.toktext == "structure") {
if (next.toktype == IDENTIFIER) {
parseTree << Class(next.toktext); ++i;
} else throw ParsingException((not (next.toktext.empty() or next.toktype == tok::EOF_)) ? '"' + next.toktext + "\" is not a valid class identifier" : "A class identifier is required", next.line);