    def parse(self):
        """
        Generator to return coloured text from raw text.

        :returns: a 3-tuple of (start offset in raw text, command to execute, parameters)
        """
        if self._state.attributes:
            yield (0, Parser.CHANGE_COLOURS, tuple(self._state.attributes))
        offset = 0
        while len(self._state.text) > 0:
            letter = self._state.text[0]
            if ord(letter) < 32:
                yield (offset, Parser.DISPLAY_TEXT, "^" + chr(ord("@") + ord(letter)))
            else:
                yield (offset, Parser.DISPLAY_TEXT, letter)
            offset += 1
            self._state.text = self._state.text[1:]
Generator to return coloured text from raw text.

:returns: a 3-tuple of (start offset in raw text, command to execute, parameters)
asciimatics/parsers.py