Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit ec2c9f2b authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

Print line where parse error occured

parent e41f7d04
No related branches found
No related tags found
No related merge requests found
......@@ -101,14 +101,18 @@ void OpalParser::parse(Statement &stat) const {
std::string hint = getHint(name);
unsigned int position = stat.position();
std::string positionIndicator = std::string(position, ' ') + "^\n";
std::ostringstream statStr;
stat.print(statStr);
if (hint != "") {
throw ParseError("OpalParser::parse()",
statStr.str() +
positionIndicator +
"Syntax error, either the keyword REAL is missing or\n" +
hint);
} else {
throw ParseError("OpalParser::parse()",
statStr.str() +
positionIndicator +
"Syntax error, the keyword REAL is missing\n");
}
......@@ -368,8 +372,11 @@ void OpalParser::parseEnd(Statement &stat) const {
unsigned int position = stat.position();
std::string positionIndicator = std::string(position + 1, ' ') + "^\n";
std::ostringstream statStr;
stat.print(statStr);
throw ParseError("OpalParser::parseEnd()",
statStr.str() +
positionIndicator +
"Syntax error (maybe missing comma or semicolon ? )");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment