Differences From Artifact [402c2b15c2]:

To Artifact [7ebb891e47]:


199
200
201
202
203
204
205
206

207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224
225
  ####################

  if (struct_contains(objects, "comp"))
    for [comp, comp_name] = objects.comp
      if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one")))
	alias = eval(sprintf("%s_alias", comp.type));
	if (is_struct(alias))
	  for [bond, bond_name] = comp

	    if (struct_contains(alias, "bond.label"))
	      old_name = bond.label;
	      new_name = eval(sprintf("alias.%s", old_name));
	      bond.label = new_name;
	      mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]",
			       old_name, comp_name, comp.type, new_name),
		       infofile);

	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	endif
	eval(sprintf("objects.%s = comp;", comp_name));
      endif
    endfor
  endif

  disp("-- finished expanding aliases --")
  objects








|
>
|
|
|
|
|
|
|
>




|







199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
  ####################

  if (struct_contains(objects, "comp"))
    for [comp, comp_name] = objects.comp
      if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one")))
	alias = eval(sprintf("%s_alias", comp.type));
	if (is_struct(alias))
	  for [bond, bond_name] = comp;
	    if (isstruct(bond))
	      if (struct_contains(alias, bond.label))
		old_name = bond.label;
		new_name = eval(sprintf("alias.%s", old_name));
		bond.label = new_name;
		mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]",
				 old_name, comp_name, comp.type, new_name),
			 infofile);
	      endif
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	endif
	eval(sprintf("objects.comp.%s = comp;", comp_name));
      endif
    endfor
  endif

  disp("-- finished expanding aliases --")
  objects


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]