Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow leading whitespace in input parameters #965

Merged
merged 7 commits into from
Nov 1, 2023
3 changes: 2 additions & 1 deletion src/parameter_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ bool ParameterInput::ParseLine(InputBlock *pib, std::string line, std::string &n
std::string &value, std::string &comment) {
std::size_t first_char, last_char, equal_char, hash_char, cont_char, len;
bool continuation = false;
printf("line: %s\n", line.c_str());
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

hash_char = line.find_first_of("#"); // find "#" (optional)
comment = "";
Expand All @@ -315,7 +316,7 @@ bool ParameterInput::ParseLine(InputBlock *pib, std::string line, std::string &n
name.assign(line, first_char, len);
last_char = name.find_last_not_of(" ");
name.erase(last_char + 1, std::string::npos);
line.erase(0, len + 1);
line.erase(0, equal_char+1);
}

cont_char = line.find_first_of("&"); // find "&" continuation character
Expand Down
Loading