public SyntaxTree(Uri fileUri, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax) { FileUri = fileUri; LineStarts = lineStarts; ProgramSyntax = programSyntax; Hierarchy = new SyntaxHierarchy(); Hierarchy.AddRoot(ProgramSyntax); }
protected virtual SyntaxBase ReplaceProgramSyntax(ProgramSyntax syntax) { var hasChanges = TryRewrite(syntax.Children, out var children); hasChanges |= TryRewriteStrict(syntax.EndOfFile, out var endOfFile); if (!hasChanges) { return(syntax); } return(new ProgramSyntax(children, endOfFile, Enumerable.Empty <IDiagnostic>())); }
void ISyntaxVisitor.VisitProgramSyntax(ProgramSyntax syntax) => ReplaceCurrent(syntax, ReplaceProgramSyntax);
public virtual void VisitProgramSyntax(ProgramSyntax syntax) { this.VisitNodes(syntax.Children); this.Visit(syntax.EndOfFile); }
public SyntaxTree(string filePath, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax) { FilePath = filePath; LineStarts = lineStarts; ProgramSyntax = programSyntax; }
public virtual void VisitProgramSyntax(ProgramSyntax syntax) { this.VisitNodes(syntax.Statements); this.Visit(syntax.EndOfFile); }
public SyntaxTree(Uri fileUri, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax) { FileUri = fileUri; LineStarts = lineStarts; ProgramSyntax = programSyntax; }