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 (${IS_GNU} OR ${IS_CLANG})
|
||||||
if (NOT MINGW)
|
if (NOT MINGW)
|
||||||
|
if (CMAKE_VERSION STREQUAL "3.22.0")
|
||||||
|
message(WARNING "CMake ${CMAKE_VERSION} does not support mingw cross-compilers")
|
||||||
|
endif()
|
||||||
include(FindOpenMP)
|
include(FindOpenMP)
|
||||||
if (OpenMP_CXX_FOUND)
|
if (OpenMP_CXX_FOUND)
|
||||||
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||||
|
|
|
@ -19,7 +19,7 @@ vector<tok> lex(const string& in)
|
||||||
switch (current) {
|
switch (current) {
|
||||||
case DIVIDE: if (in[i + 1] == current) i += 2; else goto insertToken;
|
case DIVIDE: if (in[i + 1] == current) i += 2; else goto insertToken;
|
||||||
case TAG: {
|
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;
|
goto insertToken;
|
||||||
} else {
|
} else {
|
||||||
while (not (in[i + 1] == EOF_ || in[i + 1] == '\n')) {
|
while (not (in[i + 1] == EOF_ || in[i + 1] == '\n')) {
|
||||||
|
@ -29,7 +29,7 @@ vector<tok> lex(const string& in)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case ASTERISK: {
|
case ASTERISK: {
|
||||||
if ((in.size() - i) > 2 && in[i + 1] == ASTERISK) {
|
if (in[i + 1] == ASTERISK) {
|
||||||
i += 2;
|
i += 2;
|
||||||
try {
|
try {
|
||||||
while (not (in.at(i) == ASTERISK && in.at(i + 1) == ASTERISK)) {
|
while (not (in.at(i) == ASTERISK && in.at(i + 1) == ASTERISK)) {
|
||||||
|
|
Loading…
Reference in New Issue