Set the ParsingException cause to another string when no identifier is given to a class, and pass the component's line to the exception

This commit is contained in:
Username404 2021-09-14 20:41:28 +02:00
parent 95d6b2239a
commit 08a038cf82
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ namespace Parser {
if (current.toktext == "class") { if (current.toktext == "class") {
if (next.toktype == IDENTIFIER) { if (next.toktype == IDENTIFIER) {
parseTree << Class(next.toktext); ++i; parseTree << Class(next.toktext); ++i;
} else throw ParsingException('"' + next.toktext + "\" is not a valid class identifier"); } else throw ParsingException((not next.toktext.empty()) ? '"' + next.toktext + "\" is not a valid class identifier" : "A class identifier is required", next.line);
} else { } else {
if ((lexed.size() - i) > 2) { if ((lexed.size() - i) > 2) {
bool isFinalDefine = nextAre(2, TAG, DEFINE); bool isFinalDefine = nextAre(2, TAG, DEFINE);