system/src/sc/parser/DiffContext.java
void addSameAgainChildren(IParseNode startPN) {
      if (!(startPN instanceof ParentParseNode))
         return;

      ParentParseNode start = (ParentParseNode) startPN;
      if (start.children == null)
         return;

      int startIx = start.getStartIndex();
      for (Object child:start.children) {
         if (child != null) {
            // Don't dig down past the first or last diff nodes
            if (child == firstDiffNode || child == lastDiffNode)
               return;
            // We need an IParseNode at least
            if (!(child instanceof IParseNode))
               return;

            IParseNode childPN = (IParseNode) child;
            // If content has advanced we'll go with the parent?
            if (childPN.getStartIndex() != startIx)
               return;

            sameAgainChildren.add(childPN);
            addSameAgainChildren(childPN);
         }
      }
   }
/** Looks to see if there's a smaller parse node which has the same start index as the parent. */
Looks to see if there's a smaller parse node which has the same start index as the parent.
Looks to see if there ' s a smaller parse node which has the same start index as the parent .
void addSameAgainChildren(IParseNode startPN) {
      if (!(startPN instanceof ParentParseNode))
         return;
      ParentParseNode start = (ParentParseNode) startPN;
      if (start.children == null)
         return;
      int startIx = start.getStartIndex();
      for (Object child:start.children) {
         if (child != null) {
            if (child == firstDiffNode || child == lastDiffNode)
               return;
            if (!(child instanceof IParseNode))
               return;
            IParseNode childPN = (IParseNode) child;
            if (childPN.getStartIndex() != startIx)
               return;
            sameAgainChildren.add(childPN);
            addSameAgainChildren(childPN);
         }
      }
   }
void addSameAgainChildren ( IParseNode startPN ) { if ( ! ( startPN instanceof ParentParseNode ) ) return ; ParentParseNode start = ( ParentParseNode ) startPN ; if ( start . children == null ) return ; int startIx = start . getStartIndex ( ) ; for ( Object child : start . children ) { if ( child != null ) { if ( child == firstDiffNode || child == lastDiffNode ) return ; if ( ! ( child instanceof IParseNode ) ) return ; IParseNode childPN = ( IParseNode ) child ; if ( childPN . getStartIndex ( ) != startIx ) return ; sameAgainChildren . add ( childPN ) ; addSameAgainChildren ( childPN ) ; } } }
Looks to see if there's a smaller parse node which has the same start index as the parent.
Looks to see if there ' s a smaller parse node which has the same start index as the parent .
// Don't dig down past the first or last diff nodes // We need an IParseNode at least // If content has advanced we'll go with the parent?