def add_field(self, field):
        if field.struct:
            raise ValueError('Cannot add a field to %s, the field is already in another '
                             'struct, %s', self, field)

        self.fields.append(field)
        self.add_child(field)
        field.struct = self

        return field
Add a new field to this message and return the field.
dataset/ETHPy150Open pdef/pdef/compiler/pdefc/lang.py/Struct.add_field