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); }
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; }
public override Statement VisitExit(Exit exit) { if (exit == null) return null; return base.VisitExit((Exit)exit.Clone()); }