Parse a series of key-value pairs.

def _parse_key(self, indent):
        """Parse a series of key-value pairs."""
        data = {}

        new_indent = indent
        while not self._finished and new_indent == indent:
            self._skip_whitespace()
            cur_token = self._cur_token
            if cur_token['type'] is TT.id:
                key = cur_token['value']
                next_token = self._nth_token()
                if next_token['type'] is TT.colon:
                    self._increment(2)  # move past the ':'
                    # whitespace before a newline is not important
                    # whitespace after a newline is important
                    self._skip_whitespace()
                    self._skip_newlines()
                    data[key] = self._parse_value()
                else:
                    raise ParseError("':'", next_token)
            else:
                if cur_token['type'] is TT.hyphen:
                    return data
                else:
                    raise ParseError("identifier or '-'", cur_token)

            if self.tokens[self._cur_position - 1]['type'] is not TT.lbreak:
                # skip whitespace at the end of the line
                self._skip_whitespace()
                self._skip_newlines()

            # find next indentation level without incrementing
            new_indent = 0
            temp_position = self._cur_position
            while (
                temp_position < self.num_tokens-1 and
                self.tokens[temp_position]['type'] is TT.ws
            ):
                temp_position += 1
                new_indent += 1

        if indent == 0 or new_indent < indent:
            return data
        else:
            raise Exception(
                "Parser screwed up, increase of indent on line {} should "
                "have been caught by _parse_value().".format(
                    cur_token['line']
                )
            )