mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add references to error messages
That way, errors can reference other parts of the code, like duplicate properties.
This commit is contained in:
parent
824476bda1
commit
d987b15374
2 changed files with 23 additions and 2 deletions
|
@ -138,7 +138,10 @@ class AstNode:
|
|||
|
||||
if type(child) is type(self):
|
||||
if check is None or check(child):
|
||||
raise CompileError(error)
|
||||
raise CompileError(
|
||||
error,
|
||||
references=[ErrorReference(child.group.start, child.group.end, "previous declaration was here")]
|
||||
)
|
||||
|
||||
|
||||
def validate(token_name=None, end_token_name=None, skip_incomplete=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue