def parse_compound_list(path, compounds):
context = FilePathContext(path)<EOL>for compound_def in compounds:<EOL><INDENT>if '<STR_LIT>' in compound_def:<EOL><INDENT>file_format = compound_def.get('<STR_LIT>')<EOL>include_context = context.resolve(compound_def['<STR_LIT>'])<EOL>for compound in parse_compound_file(include_context, file_format):<EOL><INDENT>yield compound<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield parse_compound(compound_def, context)<EOL><DEDENT><DEDENT>
Parse a structured list of compounds as obtained from a YAML file

    Yields CompoundEntries. Path can be given as a string or a context.