def rec_body entity indent packed False assert entity FIELDS fields De

1
2
3
4
5
6
7
def rec_body(entity, indent=" ", packed=False):
assert (entity['FIELDS'])
fields = DelphiGenerator.rec_fields_list(entity)
# Terrible code. Magic!
f = ";\n".join(map(lambda x: "{}{}".format(indent, x), fields))
return "{}record\n{};\nend".format("packed " if packed else "",
";\n".join(map(lambda x: " {}".format(x), fields)))