diff --git a/blueprintcompiler/ast.py b/blueprintcompiler/ast.py index fc447f3..bb80dfd 100644 --- a/blueprintcompiler/ast.py +++ b/blueprintcompiler/ast.py @@ -20,7 +20,7 @@ import typing as T from .ast_utils import * -from .errors import assert_true, AlreadyCaughtError, CompileError, CompilerBugError, MultipleErrors +from .errors import CompileError, CompilerBugError, MultipleErrors from . import gir from .lsp_utils import Completion, CompletionItemKind, SemanticToken, SemanticTokenType from .tokenizer import Token diff --git a/blueprintcompiler/ast_utils.py b/blueprintcompiler/ast_utils.py index d1da93c..33ccf61 100644 --- a/blueprintcompiler/ast_utils.py +++ b/blueprintcompiler/ast_utils.py @@ -86,8 +86,6 @@ class AstNode: for validator in self.validators: try: validator(self) - except AlreadyCaughtError: - pass except CompileError as e: yield e @@ -140,8 +138,7 @@ class AstNode: def validate(token_name=None, end_token_name=None, skip_incomplete=False): """ Decorator for functions that validate an AST node. Exceptions raised - during validation are marked with range information from the tokens. Also - creates a cached property out of the function. """ + during validation are marked with range information from the tokens. """ def decorator(func): def inner(self): diff --git a/blueprintcompiler/errors.py b/blueprintcompiler/errors.py index e3fee43..8a0b961 100644 --- a/blueprintcompiler/errors.py +++ b/blueprintcompiler/errors.py @@ -91,11 +91,6 @@ class CodeAction: replace_with: str -class AlreadyCaughtError(Exception): - """ Emitted when a validation has already failed and its error message - should not be repeated. """ - - class MultipleErrors(PrintableError): """ If multiple errors occur during compilation, they can be collected into a list and re-thrown using the MultipleErrors exception. It will