Clean up some unused code

This commit is contained in:
James Westman 2021-12-16 22:08:04 -06:00
parent 5a4cf58e0e
commit 5b76a3b8dd
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
3 changed files with 2 additions and 10 deletions

View file

@ -20,7 +20,7 @@
import typing as T import typing as T
from .ast_utils import * from .ast_utils import *
from .errors import assert_true, AlreadyCaughtError, CompileError, CompilerBugError, MultipleErrors from .errors import CompileError, CompilerBugError, MultipleErrors
from . import gir from . import gir
from .lsp_utils import Completion, CompletionItemKind, SemanticToken, SemanticTokenType from .lsp_utils import Completion, CompletionItemKind, SemanticToken, SemanticTokenType
from .tokenizer import Token from .tokenizer import Token

View file

@ -86,8 +86,6 @@ class AstNode:
for validator in self.validators: for validator in self.validators:
try: try:
validator(self) validator(self)
except AlreadyCaughtError:
pass
except CompileError as e: except CompileError as e:
yield e yield e
@ -140,8 +138,7 @@ class AstNode:
def validate(token_name=None, end_token_name=None, skip_incomplete=False): def validate(token_name=None, end_token_name=None, skip_incomplete=False):
""" Decorator for functions that validate an AST node. Exceptions raised """ Decorator for functions that validate an AST node. Exceptions raised
during validation are marked with range information from the tokens. Also during validation are marked with range information from the tokens. """
creates a cached property out of the function. """
def decorator(func): def decorator(func):
def inner(self): def inner(self):

View file

@ -91,11 +91,6 @@ class CodeAction:
replace_with: str replace_with: str
class AlreadyCaughtError(Exception):
""" Emitted when a validation has already failed and its error message
should not be repeated. """
class MultipleErrors(PrintableError): class MultipleErrors(PrintableError):
""" If multiple errors occur during compilation, they can be collected into """ If multiple errors occur during compilation, they can be collected into
a list and re-thrown using the MultipleErrors exception. It will a list and re-thrown using the MultipleErrors exception. It will