def scan(self, type, **kw):
        """Returns the matched text, and moves to the next token"""
        context = kw.get("context",None)

        if self.last_token is None:
            tok = self.token([type],context)
        else:
            if self.last_types and self.last_types not in type:
                raise NotImplementedError("Unimplemented: restriction set changed")

            tok = self.last_token
            self.last_token = None
        if tok.type != type:
            if not self.last_types: self.last_types=[]
            raise SyntaxError(tok.pos, 'Trying to find '+type+': '+ ', '.join(self.last_types)+", got "+tok.type, context=context)
        return tok.value
dataset/ETHPy150Open smurfix/yapps/yapps/runtime.py/Scanner.scan/swapped operands of `not in`