+CYTarget *CYTypeStruct::Replace(CYContext &context) {
+ CYList<CYElementValue> types;
+ CYList<CYElementValue> names;
+
+ CYForEach (field, fields_) {
+ CYTypedIdentifier *typed(field->typed_);
+ types->*$ CYElementValue(typed->Replace(context));
+
+ CYExpression *name;
+ if (typed->identifier_ == NULL)
+ name = NULL;
+ else
+ name = $S(typed->identifier_->Word());
+ names->*$ CYElementValue(name);
+ }
+
+ CYTarget *target($N2($V("Type"), $ CYArray(types), $ CYArray(names)));
+ if (name_ != NULL)
+ target = $C1($M(target, $S("withName")), $S(name_->Word()));
+ return target;
+}
+