From 8cb72a9baadaa8227fade4f9b7d29205c04888fa Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 18 Sep 2021 16:26:29 +0200 Subject: [PATCH] Remove a useless condition in Parser.hpp --- src/headers/parsing/Parser.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index d72f727..930c61b 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -36,14 +36,12 @@ namespace Parser { parseTree << Class(next.toktext); ++i; } 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({TAG, DEFINE}); - if (isFinalDefine || next.toktype == DEFINE) { - parseTree << Define(isFinalDefine, current.toktext); - i += 1 + isFinalDefine; - } else { - parseTree << Reference(current.toktext); - } + bool isFinalDefine = nextAre({TAG, DEFINE}); + if (isFinalDefine || next.toktype == DEFINE) { + parseTree << Define(isFinalDefine, current.toktext); + i += 1 + isFinalDefine; + } else { + parseTree << Reference(current.toktext); } } }