internal SourceContext Append(SourceContext other) => new SourceContext(other, this);
public SourceContext Push(SourceContext newContext) => newContext.kind == Kind.Collapsible && newContext.SourceLines[0] == this.SourceLines[0] ? this : new SourceContext(newContext, this);
private SourceContext(SourceContext parent, SourceContext child) { this.SourceLines = parent.SourceLines.Concat(child.SourceLines).ToList(); }
private SourceContext(SourceContext newContext, SourceContext oldContext) { this.SourceLines = newContext.SourceLines.Concat(oldContext.SourceLines).ToList(); this.kind = Kind.Aggregate; }