From 08a038cf82d74fb6f63f0ed483d0288fed23507e Mon Sep 17 00:00:00 2001 From: Username404 Date: Tue, 14 Sep 2021 20:41:28 +0200 Subject: [PATCH] Set the ParsingException cause to another string when no identifier is given to a class, and pass the component's line to the exception --- src/headers/parsing/Parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index 129d4bc..b8f10f3 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -37,7 +37,7 @@ namespace Parser { if (current.toktext == "class") { if (next.toktype == IDENTIFIER) { 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 { if ((lexed.size() - i) > 2) { bool isFinalDefine = nextAre(2, TAG, DEFINE);