builtup4/bu4/parsing/constructs/pexception.py

18 lines
586 B
Python

# Copyright (c) PARRRATE T&V 2021. All rights reserved.
from bu4.linking.constructs.lexception import LException
from bu4.linking.constructs.linked import Linked
from bu4.parsing.constructs.parsed import Parsed
from bu4.transform.states.transformfinished import TransformFinished
from bu4.transform.states.transformstate import TransformState
__all__ = ('PException',)
class PException(Parsed):
def __init__(self, name: bytes):
self.name = name
def link(self, promise: set[bytes]) -> TransformState[Linked]:
return TransformFinished(LException(self.name))