code: def consume(self, char):
          
  
          if self.state == "stream":
              self._stream(char)
          elif self.state == "escape":
              self._escape_sequence(char)
          elif self.state == "escape-lb":
              self._escape_parameters(char)
          elif self.state == "mode":
              self._mode(char)
          elif self.state == "charset-g0":
              self._charset_g0(char)
          elif self.state == "charset-g1":
              self._charset_g1(char)
docs: Consume a single character and advance the state as necessary.