mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Simplify error & warning handling
This commit is contained in:
parent
122b049ce9
commit
b6ee649458
8 changed files with 38 additions and 21 deletions
|
@ -79,7 +79,19 @@ class AstNode:
|
|||
|
||||
@cached_property
|
||||
def errors(self):
|
||||
return list(self._get_errors())
|
||||
return list(
|
||||
error
|
||||
for error in self._get_errors()
|
||||
if not isinstance(error, CompileWarning)
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def warnings(self):
|
||||
return list(
|
||||
warning
|
||||
for warning in self._get_errors()
|
||||
if isinstance(warning, CompileWarning)
|
||||
)
|
||||
|
||||
def _get_errors(self):
|
||||
for validator in self.validators:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue