Пример #1
0
        public Span Clone()
        {
            var newSpan = new Span();

            if (Begin != null)
            {
                newSpan.Begin = Begin.Clone();
            }
            newSpan.BeginFlags   = BeginFlags;
            newSpan.Color        = Color;
            newSpan.Continuation = Continuation;
            if (End != null)
            {
                newSpan.End = End.Clone();
            }
            newSpan.EndFlags = EndFlags;
            newSpan.Escape   = Escape;
            if (Exit != null)
            {
                newSpan.Exit = Exit.Clone();
            }
            newSpan.ExitFlags     = ExitFlags;
            newSpan.NextColor     = NextColor;
            newSpan.Rule          = Rule;
            newSpan.StopAtEol     = StopAtEol;
            newSpan.TagColor      = TagColor;
            newSpan.BeginTagColor = beginTagColor;
            newSpan.EndTagColor   = endTagColor;
            return(newSpan);
        }
Пример #2
0
    public virtual Differences VisitExit(Exit exit1, Exit exit2){
      Differences differences = new Differences(exit1, exit2);
      if (exit1 == null || exit2 == null){
        if (exit1 != exit2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      Exit changes = (Exit)exit2.Clone();
      Exit deletions = (Exit)exit2.Clone();
      Exit insertions = (Exit)exit2.Clone();

      differences.NumberOfSimilarities++;
      if (exit1.Level == exit2.Level) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++;

      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;
    }
Пример #3
0
 public override Statement VisitExit(Exit exit)
 {
     if (exit == null) return null;
     return base.VisitExit((Exit)exit.Clone());
 }