Skip to content

Commit c219456

Browse files
committed
hardcode prop ::
1 parent 7293a34 commit c219456

2 files changed

Lines changed: 21 additions & 30 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LSTSFLAGS = MALLOC_CHECK_=3
88
# recommendation: ulimit -s unlimited
99

1010
dev: install-production
11-
lm --v23 --showalloc SRC/index.lsts
11+
lm --v23 --showalloc SRC/index.lsts > out.txt
1212

1313
build: compile-production
1414
time env $(LSTSFLAGS) ./production --v23 --c -o deploy1.c SRC/index.lsts

SRC/prop-core.lsts

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,17 @@ let weaken-quick-prop(original-base: Type, base: Type, pre: Type): Type = (
153153
);
154154
}
155155
};
156-
if tag.contains(c"::") {
157-
let tag-parts = tag.split(c"::").into(type(Vector<CString>));
158-
let tag-base = tag-parts[0] + c"::";
159-
let ti = 1_sz;
160-
while ti < tag-parts.length {
161-
let tag-part = tag-parts[ti];
162-
for vector row in weaken-quick-prop-index.lookup( (tag-base, parameters.length as U64), mk-vector(type((Type,Type))) ) {
163-
let lt = row.first;
164-
let rt = row.second;
165-
if can-unify(lt, original-base) then (
166-
base = remove-info(base, rt);
167-
);
168-
};
169-
tag-base = tag-base + tag-part + c"::";
170-
ti = ti + 1;
156+
if tag.has-prefix(c"Tag::") or tag.has-prefix(c"Field::") {
157+
# TODO: generalize to all :: types, temporary semantic regression
158+
let tag-base = if tag.has-prefix(c"Tag::") then c"Tag::"
159+
else if tag.has-prefix(c"Field::") then c"Field::"
160+
else c"";
161+
for vector row in weaken-quick-prop-index.lookup( (tag-base, parameters.length as U64), mk-vector(type((Type,Type))) ) {
162+
let lt = row.first;
163+
let rt = row.second;
164+
if can-unify(lt, original-base) then (
165+
base = remove-info(base, rt);
166+
);
171167
};
172168
};
173169
);
@@ -233,20 +229,15 @@ let unenrich-quick-prop(original-base: Type, base: Type, pre: Type): Type = (
233229
}
234230
};
235231
if tag.contains(c"::") {
236-
let tag-parts = tag.split(c"::").into(type(Vector<CString>));
237-
let tag-base = tag-parts[0] + c"::";
238-
let ti = 1_sz;
239-
while ti < tag-parts.length {
240-
let tag-part = tag-parts[ti];
241-
for vector row in quick-prop.lookup( (tag-base, parameters.length as U64), mk-vector(type((Type,Type))) ) {
242-
let lt = row.first;
243-
let rt = row.second;
244-
if can-unify(lt, original-base) then (
245-
base = remove-info(base, rt);
246-
);
247-
};
248-
tag-base = tag-base + tag-part + c"::";
249-
ti = ti + 1;
232+
let tag-base = if tag.has-prefix(c"Tag::") then c"Tag::"
233+
else if tag.has-prefix(c"Field::") then c"Field::"
234+
else c"";
235+
for vector row in quick-prop.lookup( (tag-base, parameters.length as U64), mk-vector(type((Type,Type))) ) {
236+
let lt = row.first;
237+
let rt = row.second;
238+
if can-unify(lt, original-base) then (
239+
base = remove-info(base, rt);
240+
);
250241
};
251242
};
252243
);

0 commit comments

Comments
 (0)