'Add the currently parsed input to the result.'

def emit(self):

    if self._buffer:
        attrs = [getattr(attributes, name) for name in self._attrs]
        attrs.extend(filter(None, [self.foreground, self.background]))
        if (not attrs):
            attrs.append(attributes.normal)
        attrs.append(self._buffer)
        attr = _foldr(operator.getitem, attrs.pop(), attrs)
        if (self._result is None):
            self._result = attr
        else:
            self._result[attr]
        self._buffer = ''
