system/src/sc/lang/html/Element.java
public void assignChildTagObjects(TypeDeclaration parentType, Element oldElem) {
      if (oldElem.tagObject != null) {
         tagObject = parentType;
         parentType.element = this;
      }
      if (children != null) {
         // We just cloned oldElem to produce this one so these should match
         if (oldElem == null || oldElem.children == null || oldElem.children.size() != children.size())
            System.err.println("*** mismatch in cloned element children!");
         Object oldChild = null;
         int i = 0;
         for (Object child:children) {
            oldChild = oldElem.children.get(i++);
            if (child instanceof Element) {
               Element childElem = (Element) child;
               Element oldChildElem = (Element) oldChild;
               // Should be the same name - this keeps us from resolving the extends element in childElem if it's one of those anonymous tags whose name depends on the base type of the parent.
               if (childElem.cachedObjectName == null && oldChildElem.cachedObjectName != null)
                  childElem.cachedObjectName = oldChildElem.cachedObjectName;
               String childName = childElem.tagObject == null ? null : childElem.getObjectName();
               if (childElem.isRepeatElement()) {
                  String repeatName = childElem.getRepeatObjectName();
                  TypeDeclaration childRepeatType = (TypeDeclaration) parentType.getInnerType(repeatName, null);
                  if (childRepeatType == null) {
                     System.out.println("*** Skipping assignChildTagObjects for: " + parentType + " and: " + repeatName);
                     continue;
                  }
                  else {
                     childElem.repeatWrapper = childRepeatType;
                     childRepeatType.element = childElem;
                  }
               }
               TypeDeclaration childType = oldChildElem.tagObject == null  ? parentType : (TypeDeclaration) parentType.getInnerType(childName, null, false, false, false, false);
               if (childType != null)
                  childElem.assignChildTagObjects(childType, oldChildElem);
               /*
               else {
                  // TODO: remove this debug code
                  childType = oldChildElem.tagObject == null  ? parentType : (TypeDeclaration) parentType.getInnerType(childName, null, true, false, false);
                  if (childType != null)
                     System.out.println("***");

               }
               */
            }
         }
      }
   }
// It's probably faster this way?  We could also just reinit the rootType from the cloned template when the init flags are set.
It's probably faster this way.  We could also just reinit the rootType from the cloned template when the init flags are set.
It ' s probably faster this way . We could also just reinit the rootType from the cloned template when the init flags are set .
public void assignChildTagObjects(TypeDeclaration parentType, Element oldElem) {
      if (oldElem.tagObject != null) {
         tagObject = parentType;
         parentType.element = this;
      }
      if (children != null) {
         if (oldElem == null || oldElem.children == null || oldElem.children.size() != children.size())
            System.err.println("*** mismatch in cloned element children!");
         Object oldChild = null;
         int i = 0;
         for (Object child:children) {
            oldChild = oldElem.children.get(i++);
            if (child instanceof Element) {
               Element childElem = (Element) child;
               Element oldChildElem = (Element) oldChild;
               if (childElem.cachedObjectName == null && oldChildElem.cachedObjectName != null)
                  childElem.cachedObjectName = oldChildElem.cachedObjectName;
               String childName = childElem.tagObject == null ? null : childElem.getObjectName();
               if (childElem.isRepeatElement()) {
                  String repeatName = childElem.getRepeatObjectName();
                  TypeDeclaration childRepeatType = (TypeDeclaration) parentType.getInnerType(repeatName, null);
                  if (childRepeatType == null) {
                     System.out.println("*** Skipping assignChildTagObjects for: " + parentType + " and: " + repeatName);
                     continue;
                  }
                  else {
                     childElem.repeatWrapper = childRepeatType;
                     childRepeatType.element = childElem;
                  }
               }
               TypeDeclaration childType = oldChildElem.tagObject == null  ? parentType : (TypeDeclaration) parentType.getInnerType(childName, null, false, false, false, false);
               if (childType != null)
                  childElem.assignChildTagObjects(childType, oldChildElem);
               /*
               else {
                  // TODO: remove this debug code
                  childType = oldChildElem.tagObject == null  ? parentType : (TypeDeclaration) parentType.getInnerType(childName, null, true, false, false);
                  if (childType != null)
                     System.out.println("***");
               }
               */
            }
         }
      }
   }
public void assignChildTagObjects ( TypeDeclaration parentType , Element oldElem ) { if ( oldElem . tagObject != null ) { tagObject = parentType ; parentType . element = this ; } if ( children != null ) { if ( oldElem == null || oldElem . children == null || oldElem . children . size ( ) != children . size ( ) ) System . err . println ( "*** mismatch in cloned element children!" ) ; Object oldChild = null ; int i = 0 ; for ( Object child : children ) { oldChild = oldElem . children . get ( i ++ ) ; if ( child instanceof Element ) { Element childElem = ( Element ) child ; Element oldChildElem = ( Element ) oldChild ; if ( childElem . cachedObjectName == null && oldChildElem . cachedObjectName != null ) childElem . cachedObjectName = oldChildElem . cachedObjectName ; String childName = childElem . tagObject == null ? null : childElem . getObjectName ( ) ; if ( childElem . isRepeatElement ( ) ) { String repeatName = childElem . getRepeatObjectName ( ) ; TypeDeclaration childRepeatType = ( TypeDeclaration ) parentType . getInnerType ( repeatName , null ) ; if ( childRepeatType == null ) { System . out . println ( "*** Skipping assignChildTagObjects for: " + parentType + " and: " + repeatName ) ; continue ; } else { childElem . repeatWrapper = childRepeatType ; childRepeatType . element = childElem ; } } TypeDeclaration childType = oldChildElem . tagObject == null ? parentType : ( TypeDeclaration ) parentType . getInnerType ( childName , null , false , false , false , false ) ; if ( childType != null ) childElem . assignChildTagObjects ( childType , oldChildElem ) ; /*
               else {
                  // TODO: remove this debug code
                  childType = oldChildElem.tagObject == null  ? parentType : (TypeDeclaration) parentType.getInnerType(childName, null, true, false, false);
                  if (childType != null)
                     System.out.println("***");

               }
               */ } } } }
It's probably faster this way?
It ' s probably faster this way?
// We just cloned oldElem to produce this one so these should match // Should be the same name - this keeps us from resolving the extends element in childElem if it's one of those anonymous tags whose name depends on the base type of the parent.