17 lines
589 B
Python
17 lines
589 B
Python
# Copyright (c) PARRRATE T&V 2021. All rights reserved.
|
|
|
|
from bu4.parsing.codes import CODE_QUOT
|
|
from bu4.parsing.extensions.extension import Extension
|
|
from bu4.parsing.states.parsestate import ParseState
|
|
from bu4.parsing.states.psafter import PSAfter
|
|
from bu4.parsing.targets.pschain import PSChain
|
|
from bu4.parsing.targets.psendswith import PSEndsWith
|
|
|
|
__all__ = ('XQuot',)
|
|
|
|
|
|
class XQuot(Extension, code=CODE_QUOT):
|
|
def apply(self, state: PSAfter) -> ParseState:
|
|
state.target = PSChain(PSEndsWith(self.parser, CODE_QUOT, 'quot expected'), state.target)
|
|
return state
|