parse errors should use standard filename:lineno prefix when possible

This commit is contained in:
Dustin Spicuzza 2021-12-17 00:21:23 -05:00
parent 8f7455f3d3
commit cd6d4f23f3

View File

@ -327,9 +327,9 @@ class CxxParser:
if tok: if tok:
filename, lineno = tok.location filename, lineno = tok.location
msg = f"Not able to parse {filename} on line {lineno} evaluating '{tok.value}'{context}" msg = f"{filename}:{lineno}: parse error evaluating '{tok.value}'{context}"
else: else:
msg = f"Error parsing {self.filename}{context}" msg = f"{self.filename}: parse error{context}"
raise CxxParseError(msg) from e raise CxxParseError(msg) from e