system/src/sc/lang/template/Template.java
public int replaceChild(Object toReplace, Object other) {
      if (toReplace == rootType) {
         rootType = other;
         return types.replaceChild(toReplace, other);
      }
      return super.replaceChild(toReplace, other);
   }
/** The rootType stores the Template as its direct parent so when we replace it, we need to update it both in the types list and in the rootType variable */
The rootType stores the Template as its direct parent so when we replace it, we need to update it both in the types list and in the rootType variable
The rootType stores the Template as its direct parent so when we replace it we need to update it both in the types list and in the rootType variable
public int replaceChild(Object toReplace, Object other) {
      if (toReplace == rootType) {
         rootType = other;
         return types.replaceChild(toReplace, other);
      }
      return super.replaceChild(toReplace, other);
   }
public int replaceChild ( Object toReplace , Object other ) { if ( toReplace == rootType ) { rootType = other ; return types . replaceChild ( toReplace , other ) ; } return super . replaceChild ( toReplace , other ) ; }
The rootType stores the Template as its direct parent so when we replace it, we need to update it both in the types list and in the rootType variable
The rootType stores the Template as its direct parent so when we replace it we need to update it both in the types list and in the rootType variable