def format(self, parsed):
    for token_type, token, meta_data in parsed:

      if token_type in [Tokens.TEXT, Tokens.INDENT, Tokens.NEWLINE]:
        self._emit(token)

      elif token_type == Tokens.GROUP:
        self._format_group(token, meta_data['indent'])

      else:
        raise Exception('unsupported token type %s' % token_type)

    result = self._result.getvalue()
    self._result.close()

    return result
dataset/ETHPy150Open waynemoore/sublime-gherkin-formatter/lib/gherkin.py/GherkinFormatter.format/original