def construct_format(f, type_map=CONSTRUCT_CODE):
formatted = "<STR_LIT>"<EOL>if type_map.get(f.type_id, None):<EOL><INDENT>return "<STR_LIT>".format(type_id=type_map.get(f.type_id),<EOL>identifier=f.identifier)<EOL><DEDENT>elif f.type_id == '<STR_LIT:string>' and f.options.get('<STR_LIT:size>', None):<EOL><INDENT>return "<STR_LIT>".format(id=f.identifier,<EOL>size=f.options['<STR_LIT:size>'].value)<EOL><DEDENT>elif f.type_id == '<STR_LIT:string>':<EOL><INDENT>return "<STR_LIT>".format(id=f.identifier)<EOL><DEDENT>elif f.type_id == '<STR_LIT>' and f.options.get('<STR_LIT:size>', None):<EOL><INDENT>fill = f.options['<STR_LIT>'].value<EOL>f_ = copy.copy(f)<EOL>f_.type_id = fill<EOL>s = f.options.get('<STR_LIT:size>', None).value<EOL>return "<STR_LIT>".format(id=f.identifier, size=s, type=type_map.get(f_.type_id, '<STR_LIT>'))<EOL><DEDENT>elif f.type_id == '<STR_LIT>':<EOL><INDENT>fill = f.options['<STR_LIT>'].value<EOL>f_ = copy.copy(f)<EOL>f_.type_id = fill<EOL>return "<STR_LIT>" % construct_format(f_)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>" % (f.identifier, f.type_id)<EOL><DEDENT>return formatted<EOL>
Formats for Construct.