public virtual Differences VisitConstructTuple(ConstructTuple consTuple1, ConstructTuple consTuple2){
      Differences differences = new Differences(consTuple1, consTuple2);
      if (consTuple1 == null || consTuple2 == null){
        if (consTuple1 != consTuple2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      ConstructTuple changes = (ConstructTuple)consTuple2.Clone();
      ConstructTuple deletions = (ConstructTuple)consTuple2.Clone();
      ConstructTuple insertions = (ConstructTuple)consTuple2.Clone();

      FieldList fieldChanges, fieldDeletions, fieldInsertions;
      Differences diff = this.VisitFieldList(consTuple1.Fields, consTuple2.Fields, out fieldChanges, out fieldDeletions, out fieldInsertions);
      if (diff == null){Debug.Assert(false); return differences;}
      changes.Fields = fieldChanges;
      deletions.Fields = fieldDeletions;
      insertions.Fields = fieldInsertions;
      differences.NumberOfDifferences += diff.NumberOfDifferences;
      differences.NumberOfSimilarities += diff.NumberOfSimilarities;

      if (differences.NumberOfDifferences == 0){
        differences.Changes = null;
        differences.Deletions = null;
        differences.Insertions = null;
      }else{
        differences.Changes = changes;
        differences.Deletions = deletions;
        differences.Insertions = insertions;
      }
      return differences;
    }
Example #2
0
 public override Expression VisitConstructTuple(ConstructTuple consTuple)
 {
     if (consTuple == null) return null;
     return base.VisitConstructTuple((ConstructTuple)consTuple.Clone());
 }