Skip to content

Commit a4ed8a5

Browse files
committed
Re-generated the AST bootstrap code with visitors and abstract classes.
1 parent 69ce866 commit a4ed8a5

File tree

4 files changed

+1631
-12
lines changed

4 files changed

+1631
-12
lines changed

src/AST/ASTVisitor.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class AstVisitorOptions
4343
/// this will visit all the nodes in a default way that should be useful
4444
/// for a lot of applications.
4545
/// </summary>
46-
public abstract class AstVisitor : IAstVisitor<bool>, IAstVisited
46+
public abstract partial class AstVisitor : IAstVisitor<bool>, IAstVisited
4747
{
4848
public ISet<object> Visited { get; private set; }
4949
public AstVisitorOptions VisitOptions { get; private set; }
@@ -64,6 +64,11 @@ public bool AlreadyVisited(Declaration decl)
6464
return !Visited.Add(decl);
6565
}
6666

67+
public bool AlreadyVisited(Stmt stmt)
68+
{
69+
return !Visited.Add(stmt);
70+
}
71+
6772
#region Type Visitors
6873

6974
public virtual bool VisitType(Type type, TypeQualifiers quals)
@@ -632,5 +637,10 @@ public bool VisitNonTypeTemplateParameterDecl(NonTypeTemplateParameter nonTypeTe
632637
}
633638

634639
#endregion
640+
641+
public virtual bool VisitStmt(Stmt stmt)
642+
{
643+
return !AlreadyVisited(stmt);
644+
}
635645
}
636646
}

0 commit comments

Comments
 (0)