errors: show location before the message
This commit is contained in:
parent
717bd60e86
commit
1e9843ec0e
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ from . import source, lexer
|
||||||
|
|
||||||
class CompilationError(Exception):
|
class CompilationError(Exception):
|
||||||
def __init__(self, location: source.SourceLocation, message: str = "Unknown error"):
|
def __init__(self, location: source.SourceLocation, message: str = "Unknown error"):
|
||||||
super().__init__(f"{message} at {str(location)}")
|
super().__init__(f"{str(location)}: {message} ")
|
||||||
self.location = location
|
self.location = location
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue