def __init__(self, source, diag=None):
        if diag is None:
            diag = DefaultDiagnostics()
        self.source = diag.wrap(iter(source))
        try:
            self.buffer = [self.source.next()]
        except __HOLE__:
            self.buffer = []
        self.index = 0
        self.len = len(self.buffer)
        self.depth = 0
        self.offset = 0
        self.commit_depth = 0
        self.diag = diag
dataset/ETHPy150Open brehaut/picoparse/picoparse/__init__.py/BufferWalker.__init__