Remove a useless condition and two unnecessary parentheses in lexer.cpp
This commit is contained in:
parent
26978f75c8
commit
47b5135402
|
@ -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}")
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue