Exemplo n.º 1
0
 public SyntaxTree(Uri fileUri, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax)
 {
     FileUri       = fileUri;
     LineStarts    = lineStarts;
     ProgramSyntax = programSyntax;
     Hierarchy     = new SyntaxHierarchy();
     Hierarchy.AddRoot(ProgramSyntax);
 }
Exemplo n.º 2
0
        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>()));
        }
Exemplo n.º 3
0
 void ISyntaxVisitor.VisitProgramSyntax(ProgramSyntax syntax) => ReplaceCurrent(syntax, ReplaceProgramSyntax);
Exemplo n.º 4
0
 public virtual void VisitProgramSyntax(ProgramSyntax syntax)
 {
     this.VisitNodes(syntax.Children);
     this.Visit(syntax.EndOfFile);
 }
Exemplo n.º 5
0
 public SyntaxTree(string filePath, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax)
 {
     FilePath      = filePath;
     LineStarts    = lineStarts;
     ProgramSyntax = programSyntax;
 }
Exemplo n.º 6
0
 public virtual void VisitProgramSyntax(ProgramSyntax syntax)
 {
     this.VisitNodes(syntax.Statements);
     this.Visit(syntax.EndOfFile);
 }
Exemplo n.º 7
0
 public SyntaxTree(Uri fileUri, ImmutableArray <int> lineStarts, ProgramSyntax programSyntax)
 {
     FileUri       = fileUri;
     LineStarts    = lineStarts;
     ProgramSyntax = programSyntax;
 }