Browse Source

Ignore empty lines in property file and only warn if a line could not be parsed

Former-commit-id: 1d2767e90d
tempestpy_adaptions
David_Korzeniewski 10 years ago
parent
commit
5623e66566
  1. 7
      src/utility/cli.h

7
src/utility/cli.h

@ -607,9 +607,11 @@ namespace storm {
while (inputFileStream.good()) {
std::string prop;
std::getline(inputFileStream, prop);
if (!prop.empty()) {
properties.push_back(prop);
}
}
}
catch (std::exception& e) {
inputFileStream.close();
throw e;
@ -621,6 +623,7 @@ namespace storm {
for (std::string prop : properties) {
boost::optional<std::shared_ptr<storm::logic::Formula>> formula;
try {
if (program) {
storm::parser::FormulaParser formulaParser(program.get().getManager().getSharedPointer());
formula = formulaParser.parseFromString(prop);
@ -630,6 +633,10 @@ namespace storm {
}
formulas.push_back(formula);
}
catch (storm::exceptions::WrongFormatException &e) {
STORM_LOG_WARN("Unable to parse line as formula: " << prop);
}
}
std::cout << "Parsed " << formulas.size() << " properties from file " << settings.getPropertiesFilename() << std::endl;
}

Loading…
Cancel
Save