mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Clean up some unused code
This commit is contained in:
parent
5a4cf58e0e
commit
5b76a3b8dd
3 changed files with 2 additions and 10 deletions
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue