mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
#5593 Keyword parser : Improve robustness
Skip empty lines. Return if line starting with an letter is detected, this is interpreted as a new keyword.
This commit is contained in:
parent
dfcdcbb064
commit
f9b6f3a003
@ -1600,8 +1600,16 @@ void RifEclipseInputFileTools::readKeywordDataContent( QFile& data,
|
||||
|
||||
return;
|
||||
}
|
||||
else if ( line[0].isLetter() )
|
||||
{
|
||||
// If a letter is starting the line, this is a new keyword
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !line.isEmpty() )
|
||||
{
|
||||
textContent->push_back( line );
|
||||
}
|
||||
|
||||
} while ( !data.atEnd() );
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ TEST( RifEclipseInputFileToolsTest, FaultData )
|
||||
&isStopParsingKeywordDetected,
|
||||
includeStatementAbsolutePathPrefix );
|
||||
|
||||
EXPECT_EQ( (int)1041, keywordContent.size() );
|
||||
EXPECT_EQ( (int)977, keywordContent.size() );
|
||||
|
||||
/*
|
||||
for (const auto& s : keywordContent)
|
||||
|
@ -11,3 +11,6 @@ EQUIL
|
||||
1950 634.8 1820.5 0.00 3811 0.00 9 9 / ddd
|
||||
1950 634.8 1892 0.00 3821 0.00 10 10 / sdf
|
||||
-- 1950 634.8 1913 0.00 3871 0.00 11 11 / sdf
|
||||
|
||||
RSVD
|
||||
2582.0 120.25
|
Loading…
Reference in New Issue
Block a user