Skip to content

Commit

Permalink
Fix forloop comments (#96)
Browse files Browse the repository at this point in the history
Signed-off-by: David P. Chassin <dchassin@slac.stanford.edu>
Signed-off-by: David P. Chassin <david.chassin@me.com>
  • Loading branch information
David P. Chassin authored and dchassin committed Oct 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c949ac5 commit 2ba3283
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/load.cpp
Original file line number Diff line number Diff line change
@@ -6732,7 +6732,15 @@ bool GldLoader::for_capture(const char *line)
{
IN_MYCONTEXT output_verbose("capturing forloop body line %d as '%s'", forbuffer.size(), line);
}
forbuffer.push_back(std::string(line));
const char *comment = strstr(line,"//");
if ( comment == NULL )
{
forbuffer.push_back(std::string(line));
}
else if ( comment > line )
{
forbuffer.push_back(std::string(line).substr(0,(size_t)(comment-line)));
}
forbufferline = forbuffer.end();
return true;
}

0 comments on commit 2ba3283

Please sign in to comment.