Lines Matching full:state
4 class State(list):
5 """ Track the current and nested state of the parser.
7 This utility class is used to track the state of the BlockParser and
9 a list. Each time a state is set, that state is appended to the end of the
10 list. Each time a state is reset, that state is removed from the end of
13 Therefore, each time a state is set for a nested block, that state must be
14 reset when we back out of that level of nesting or the state could be
22 def set(self, state):
23 """ Set a new state. """
24 self.append(state)
27 """ Step back one step in nested state. """
30 def isstate(self, state):
31 """ Test that top (current) level is of given state. """
33 return self[-1] == state
46 self.state = State()