#8307 Input Eclipse Case: Handle trailing line comment

This commit is contained in:
Magne Sjaastad
2022-03-24 11:22:27 +01:00
parent 696c6a15fa
commit 8feb0c363b
2 changed files with 31 additions and 1 deletions

View File

@@ -88,7 +88,8 @@ std::pair<std::string, std::vector<float>>
{
std::vector<float> values;
const auto commentChar = '-';
const auto commentChar = '-';
const auto commentString = "--";
std::string keywordName;
std::string_view line;
@@ -121,6 +122,12 @@ std::pair<std::string, std::vector<float>>
if ( keywordName.empty() )
{
auto found = line.find_first_of( commentString );
if ( found != std::string::npos )
{
line = line.substr( 0, found );
}
trim( line );
if ( !line.empty() )
{