Remove a useless condition and two unnecessary parentheses in lexer.cpp

This commit is contained in:
Username404 2021-11-24 18:35:54 +01:00
parent 26978f75c8
commit 47b5135402
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 5 additions and 2 deletions

View File

@ -46,6 +46,9 @@ endif()
if (${IS_GNU} OR ${IS_CLANG})
if (NOT MINGW)
if (CMAKE_VERSION STREQUAL "3.22.0")
message(WARNING "CMake ${CMAKE_VERSION} does not support mingw cross-compilers")
endif()
include(FindOpenMP)
if (OpenMP_CXX_FOUND)
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")

View File

@ -19,7 +19,7 @@ vector<tok> lex(const string& in)
switch (current) {
case DIVIDE: if (in[i + 1] == current) i += 2; else goto insertToken;
case TAG: {
if ((current == TAG && in[i + 1] == DEFINE)) { // See the IDENTIFIER case in Parser.hpp
if (current == TAG && in[i + 1] == DEFINE) { // See the IDENTIFIER case in Parser.hpp
goto insertToken;
} else {
while (not (in[i + 1] == EOF_ || in[i + 1] == '\n')) {
@ -29,7 +29,7 @@ vector<tok> lex(const string& in)
}
}
case ASTERISK: {
if ((in.size() - i) > 2 && in[i + 1] == ASTERISK) {
if (in[i + 1] == ASTERISK) {
i += 2;
try {
while (not (in.at(i) == ASTERISK && in.at(i + 1) == ASTERISK)) {