In eoParser::readFrom, added a test to avoid reading non-parser sections
as these generally contain many -xxx that generate a reading error when xxx is not a keyword. This allows to use State-savec files directly as parameter files
This commit is contained in:
parent
0aa6a235ef
commit
42cb1981d5
1 changed files with 58 additions and 51 deletions
|
|
@ -142,9 +142,15 @@ void eoParser::updateParameters() const
|
||||||
void eoParser::readFrom(istream& is)
|
void eoParser::readFrom(istream& is)
|
||||||
{
|
{
|
||||||
string str;
|
string str;
|
||||||
|
// we must avoid processing \section{xxx} if xxx is NOT "Parser"
|
||||||
|
bool processing = true;
|
||||||
while (is >> str)
|
while (is >> str)
|
||||||
{
|
{
|
||||||
|
if (str.find(string("\\section{"))==0) // found section begin
|
||||||
|
processing = (str.find(string("Parser"))<str.size());
|
||||||
|
|
||||||
|
if (processing) // right \section (or no \section at all)
|
||||||
|
{
|
||||||
if (str[0] == '#')
|
if (str[0] == '#')
|
||||||
{ // skip the rest of the line
|
{ // skip the rest of the line
|
||||||
string tempStr;
|
string tempStr;
|
||||||
|
|
@ -198,6 +204,7 @@ void eoParser::readFrom(istream& is)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateParameters();
|
updateParameters();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue