def iter_insert_items(tree):
if tree.list_values:<EOL><INDENT>keys = tree.attrs<EOL>for values in tree.list_values:<EOL><INDENT>if len(keys) != len(values):<EOL><INDENT>raise SyntaxError(<EOL>"<STR_LIT>" "<STR_LIT>" % (values, keys)<EOL>)<EOL><DEDENT>yield dict(zip(keys, map(resolve, values)))<EOL><DEDENT><DEDENT>elif tree.map_values:<EOL><INDENT>for item in tree.map_values:<EOL><INDENT>data = {}<EOL>for (key, val) in item:<EOL><INDENT>data[key] = resolve(val)<EOL><DEDENT>yield data<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise SyntaxError("<STR_LIT>")<EOL><DEDENT>
Iterate over the items to insert from an INSERT statement