Browse Source

fixed position indication in PrismParser in case of an error.

tempestpy_adaptions
gereon 12 years ago
parent
commit
22d8ec76bc
  1. 4
      src/parser/PrismParser.cpp

4
src/parser/PrismParser.cpp

@ -449,9 +449,11 @@ std::shared_ptr<storm::ir::Program> PrismParser::parse(std::istream& inputStream
// Construct the error message including a caret display of the position in the
// erroneous line.
std::stringstream msg;
std::string line = e.first.get_currentline();
while (line.find('\t') != std::string::npos) line.replace(line.find('\t'),1," ");
msg << pos.file << ", line " << pos.line << ", column " << pos.column
<< ": parse error: expected " << e.what_ << std::endl << "\t"
<< e.first.get_currentline() << std::endl << "\t";
<< line << std::endl << "\t";
int i = 0;
for (i = 0; i < pos.column; ++i) {
msg << "-";

Loading…
Cancel
Save