Skip to content
← Back

src/syntax/trees/definitions/use.ghul

1
namespace Syntax.Trees.Definitions is
2
3
use Source;
4
5
class USE(location: LOCATION, name: Identifiers.Identifier?, `use: Identifiers.Identifier?): Definition is
6
// Set by the first use-resolution round when the used name bound.
7
// A name that resolves only once members exist - a static method,
8
// a global function, an enum member - stays unset and is retried
9
// by the second round, after declare-members; the flag is written
10
// unconditionally by round one, so it never carries stale state
11
// across builds on a retained tree.
12
is_import_resolved: bool public;
13
14
super(location);
15
16
accept(visitor: Visitor) is
17
visitor.visit(self);
18
si
19
20
walk(visitor: Visitor) is
21
if !visitor.pre(self) then
22
if name? then
23
name.walk(visitor);
24
fi
25
26
if `use? then
27
`use.walk(visitor);
28
fi
29
fi
30
31
accept(visitor);
32
si
33
si
34
si