(self, findrange, break_on_first_char=True)
Skip until character is in findrange.
Skip until character is in findrange.
Skip until character is in findrange .
def skip_to(self, findrange, break_on_first_char=True):
        """Skip until character is in findrange."""
        literal = False
        rem = False
        nchars = len(findrange[0])
        while True:
            c = self.read(1)
            if c == b'':
                break
            elif c == b'"':
                literal = not literal
            elif c == tk.REM:
                rem = True
            elif c == b'\0':
                literal = False
                rem = False
            if literal or rem:
                continue
            if c + self.peek(nchars-1) in findrange:
                if break_on_first_char:
                    self.seek(-1, 1)
                    break
            break_on_first_char = True
            # not elif! if not break_on_first_char, c needs to be properly processed.
            if c == b'\0':
                # offset and line number follow
                literal = False
                off = self.read(2)
                if len(off) < 2 or off == b'\0\0':
                    break
                self.read(2)
            elif c in tk.PLUS_BYTES:
                self.read(tk.PLUS_BYTES[c])
def skip_to ( self , findrange , break_on_first_char = True ) : literal = False rem = False nchars = len ( findrange [ 0 ] ) while True : c = self . read ( 1 ) if c == b'' : break elif c == b'"' : literal = not literal elif c == tk . REM : rem = True elif c == b'\0' : literal = False rem = False if literal or rem : continue if c + self . peek ( nchars - 1 ) in findrange : if break_on_first_char : self . seek ( - 1 , 1 ) break break_on_first_char = True # not elif! if not break_on_first_char, c needs to be properly processed. if c == b'\0' : # offset and line number follow literal = False off = self . read ( 2 ) if len ( off ) < 2 or off == b'\0\0' : break self . read ( 2 ) elif c in tk . PLUS_BYTES : self . read ( tk . PLUS_BYTES [ c ] )