def consume(self, char):
        """Consumes a single string character and advance the state as
        necessary.

        :param str char: a character to consume.
        """
        try:
            self.consume_handlers[self.state](char)
        except Exception as e:  # TODO: better error handling
            self.reset()
Consumes a single string character and advance the state as
        necessary.

        :param str char: a character to consume.
        
system/shstreams.py