Skip to content
← Back

src/syntax/trees/expressions/hash_operand.ghul

1
namespace Syntax.Trees.Expressions is
2
3
use Source
4
5
// The value whose hash stands for one member of a synthesized
6
// `get_hash_code`. Which value that is depends on how the member
7
// is compared, and so is not knowable when the body is built: a
8
// member compared element-wise cannot be hashed by the reference
9
// its own `get_hash_code` answers for, and a member whose
10
// comparison is finer than its hash cannot be hashed at all
11
// without two equal values hashing differently. The parser never
12
// produces this node - add_accessors_for_properties wraps each
13
// member read in one, and compile-expressions lowers it once the
14
// member's static type is known.
15
class HASH_OPERAND(
16
location: LOCATION,
17
left: Expression
18
): Expression is
19
super(location)
20
21
accept(visitor: Visitor) is
22
visitor.visit(self)
23
si
24
25
walk(visitor: Visitor) is
26
if !visitor.pre(self) then
27
left.walk(visitor)
28
fi
29
30
accept(visitor)
31
si
32
si
33
si