File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,15 @@ import std::option::some;
4
4
import std:: option:: none;
5
5
import util:: common:: span;
6
6
7
+ // Context-passing AST walker. Each overridden visit method has full control
8
+ // over what happens with its node, it can do its own traversal of the node's
9
+ // children (potentially passing in different contexts to each), call
10
+ // visit::visit_* to apply the default traversal algorithm (again, it can
11
+ // override the context), or prevent deeper traversal by doing nothing.
12
+
7
13
// Lots of redundant indirection and refcounting. Our typesystem doesn't do
8
14
// circular types, so the visitor record can not hold functions that take
9
- // visitors. A tag breaks the cycle.
15
+ // visitors. A vt tag is used to break the cycle.
10
16
tag vt[ E ] { vtor ( visitor[ E ] ) ; }
11
17
fn vt[ E ] ( & vt[ E ] x) -> visitor[ E ] {
12
18
alt ( x) { case ( vtor ( ?v) ) { ret v; } }
You can’t perform that action at this time.
0 commit comments