def dump(buf, indent=<NUM_LIT:0>, skip="<STR_LIT>"):
if not isinstance(type(buf), (type(Union), type(Structure))):<EOL><INDENT>raise RuntimeError("<STR_LIT>" % type(buf))<EOL><DEDENT>for field in getattr(buf, '<STR_LIT>'):<EOL><INDENT>name, types = field[<NUM_LIT:0>], field[<NUM_LIT:1>]<EOL>if name in skip:<EOL><INDENT>return<EOL><DEDENT>value = getattr(buf, name)<EOL>if isinstance(types, (type(Union), type(Structure))):<EOL><INDENT>cij.info("<STR_LIT>" % ("<STR_LIT:U+0020>" * indent, name))<EOL>dump(value, indent+<NUM_LIT:2>, skip)<EOL><DEDENT>elif isinstance(types, type(Array)):<EOL><INDENT>for i, item in enumerate(value):<EOL><INDENT>name_index = "<STR_LIT>" % (name, i)<EOL>if isinstance(types, (type(Union), type(Structure))):<EOL><INDENT>cij.info("<STR_LIT>" % ("<STR_LIT:U+0020>" * indent, name_index))<EOL>dump(item, indent + <NUM_LIT:2>, skip)<EOL><DEDENT>else:<EOL><INDENT>cij.info("<STR_LIT>" % ("<STR_LIT:U+0020>" * indent, name_index, item))<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>cij.info("<STR_LIT>" % ("<STR_LIT:U+0020>" * indent, name, value))<EOL><DEDENT><DEDENT>
Dump UnionType/StructType to STDOUT