lang: interfaces, ast: Add debug methods for graphing scope

This can occasionally help in our debugging of the scope graph.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
James Shubin
2023-09-25 17:03:39 -04:00
parent fcc76809e3
commit b4a8d0d783
3 changed files with 215 additions and 0 deletions

View File

@@ -187,3 +187,8 @@ func (obj *ExprAny) Value() (types.Value, error) {
}
return obj.V, nil
}
// ScopeGraph adds nodes and vertices to the supplied graph.
func (obj *ExprAny) ScopeGraph(g *pgraph.Graph) {
g.AddVertex(obj)
}