Skip to content

Commit

Permalink
Merge branch 'master' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyDelp authored Dec 15, 2021
2 parents 8870a25 + 4f45e04 commit 4e13cb7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ using namespace JoSIM;

std::vector<tokens_t> Input::read_input(
LineInput& input, string_o fileName) {
if (std::filesystem::path(fileName.value()).has_parent_path()) {
fileParentPath =
std::filesystem::path(fileName.value()).parent_path().string();
//When the standard input is selected, "fileName" will be in the nullopt state.
if(fileName != std::nullopt){
if (std::filesystem::path(fileName.value()).has_parent_path()) {
fileParentPath =
std::filesystem::path(fileName.value()).parent_path().string();
}
}
// Variable to store the read line
std::string line;
Expand Down Expand Up @@ -89,7 +92,7 @@ std::vector<tokens_t> Input::read_input(
// If the line contains a "END" statement
} else if (tokens.at(0) == ".END" || tokens.at(0) == "END") {
break;
// If the line does not contain an "INCLUDE" or "FILE" statement
// If the line does not contain an "INCLUDE", "FILE" or "END" statement
} else {
// Transform the entire line to upper case
std::transform(tokens.begin() + 1, tokens.end(), tokens.begin() + 1,
Expand Down

0 comments on commit 4e13cb7

Please sign in to comment.