Skip to content

Commit ea5bf93

Browse files
committed
deep-hash -> hash
1 parent 0abb084 commit ea5bf93

13 files changed

Lines changed: 3399 additions & 3436 deletions

BOOTSTRAP/cli.c

Lines changed: 3363 additions & 3387 deletions
Large diffs are not rendered by default.

SRC/ast-deep-hash.lsts

Lines changed: 0 additions & 23 deletions
This file was deleted.

SRC/ast-hash.lsts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
let hash(t: AST): U64 = (
3+
match t {
4+
Meta{ val=val } => hash(val) + 123;
5+
ASTEOF{} => 456;
6+
ASTNil{} => 789;
7+
App{ is-cons=is-cons, left=left, right=right } => hash(is-cons) + hash(left) + hash(right);
8+
Var{ key1=key, token=token } => hash(key1);
9+
Lit{ key2=key, token=token } => hash(key2);
10+
Abs{ lhs=lhs, rhs=rhs, tt=tt } => hash(lhs) + hash(rhs) + hash(tt);
11+
AType{ tt=tt } => hash(tt);
12+
Seq{ seq=seq } => hash(seq);
13+
Glb{ key3=key, val=val } => 012 + hash(val);
14+
Typedef{ lhs-type=lhs-type, implies=implies, implements=implements, size=size, alias=alias, opaque-alias=opaque-alias } =>
15+
hash(lhs-type) + hash(implies) + hash(implements) + hash(size) + hash(alias) + hash(opaque-alias);
16+
}
17+
);

SRC/type-deep-hash.lsts

Lines changed: 0 additions & 13 deletions
This file was deleted.

SRC/type-hash.lsts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
let hash(tt: Type): U64 = (
3+
match tt {
4+
TAny{} => 0_u64;
5+
TVar{name=name} => hash(name);
6+
TAnd{conjugate=conjugate} => (
7+
let result = 0_u64;
8+
for vector c in conjugate { result = result + hash(c) };
9+
result
10+
);
11+
TGround{tag=tag,parameters=parameters} => hash(tag) + hash(parameters);
12+
}
13+
);

SRC/unit-ast-core.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ import SRC/ast-acontext-union.lsts;
3030
import SRC/ast-substitute-uuids.lsts;
3131
import SRC/ast-acontext-to-string.lsts;
3232
import SRC/ast-unroll-seq.lsts;
33-
import SRC/ast-deep-hash.lsts;
33+
import SRC/ast-hash.lsts;

SRC/unit-type-core.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import SRC/type-remove-info.lsts;
2222
import SRC/type-ground-tag-and-arity.lsts;
2323
import SRC/type-into-string.lsts;
2424
import SRC/type-is-any-arg-t.lsts;
25-
import SRC/type-deep-hash.lsts;
25+
import SRC/type-hash.lsts;
2626
import SRC/type-cons-root.lsts;
2727
import SRC/type-sanitize-phi.lsts;
2828
import SRC/type-without-phi.lsts;

SRC/unit-util.lsts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
import lib/core/bedrock.lsts;
3-
import lib/core/compiler-only.lsts;
43

54
let safe-alloc-block-count = 0;
65

lib/core/bedrock.lsts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ import lib/core/list.lsts;
1414
import lib/core/s.lsts;
1515
import lib/core/hashtable.lsts;
1616
import lib/core/regex.lsts;
17-
18-
# TODO: remove after V3 release
19-
let deep-hash(x: t): U64 = hash(x);

lib/core/compiler-only.lsts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)