Skip to content

Commit 1dbf3e8

Browse files
committed
Minimal comment for visit.rs
1 parent 97576bd commit 1dbf3e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/comp/middle/visit.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ import std::option::some;
44
import std::option::none;
55
import util::common::span;
66

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+
713
// Lots of redundant indirection and refcounting. Our typesystem doesn't do
814
// 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.
1016
tag vt[E] { vtor(visitor[E]); }
1117
fn vt[E](&vt[E] x) -> visitor[E] {
1218
alt (x) { case (vtor(?v)) { ret v; } }

0 commit comments

Comments
 (0)