count lines during scanning for triple quotes

This commit is contained in:
Axel Kohlmeyer
2023-08-25 21:17:31 -04:00
parent 568199e50d
commit 401133acec
2 changed files with 2 additions and 1 deletions

View File

@ -261,6 +261,7 @@ void Input::file()
if (ntriple % 2) { if (ntriple % 2) {
line[m+1] = '\n'; line[m+1] = '\n';
m += 2; m += 2;
++nline;
continue; continue;
} }

View File

@ -651,7 +651,7 @@ void lammps_commands_string(void *handle, const char *str)
// split buffer into lines, set line number, process continuation characters, and here docs // split buffer into lines, set line number, process continuation characters, and here docs
while (cursor < buffer.size()) { while (cursor < buffer.size()) {
++ nline; ++nline;
std::size_t start = cursor; std::size_t start = cursor;
cursor = buffer.find('\n', start); cursor = buffer.find('\n', start);
if (cursor != std::string::npos) { if (cursor != std::string::npos) {