def parse_compound(self):
compound_tag = Compound()<EOL>for token in self.collect_tokens_until('<STR_LIT>'):<EOL><INDENT>item_key = token.value<EOL>if token.type not in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>raise self.error(f'<STR_LIT>')<EOL><DEDENT>if token.type == '<STR_LIT>':<EOL><INDENT>item_key = self.unquote_string(item_key)<EOL><DEDENT>if self.next().current_token.type != '<STR_LIT>':<EOL><INDENT>raise self.error(f'<STR_LIT>'<EOL>f'<STR_LIT>')<EOL><DEDENT>self.next()<EOL>compound_tag[item_key] = self.parse()<EOL><DEDENT>return compound_tag<EOL>
Parse a compound from the token stream.