Exemplo n.º 1
0
class _ParserState:

    # Attributes:
    #   :scanner (Scanner):
    #   :is_range_start_line_parsed (bool): Default is false.
    #   :tokens:

    def __init__(self, source: str) -> None:
        self.scanner = Scanner(source)
        self.is_range_start_line_parsed = False
        self.tokens = self.scanner.scan()

    def next_token(self):
        return next(self.tokens)
Exemplo n.º 2
0
 def __init__(self, source):
     # type: (str) -> None
     self.scanner = Scanner(source)
     self.is_range_start_line_parsed = False
     self.tokens = self.scanner.scan()