Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,629 changes: 4,363 additions & 4,266 deletions BOOTSTRAP/cli.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LSTSFLAGS = MALLOC_CHECK_=3
# recommendation: ulimit -s unlimited

dev: install-production
lm --v23 tests/promises/vector/constructor.lsts
lm tests/promises/vector/constructor.lsts
$(CC) $(CFLAGS) tmp.c
./a.out

Expand Down
3 changes: 2 additions & 1 deletion SRC/dev-prop-tctx-least-upper-bound.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ let .least-upper-bound(tctx: TypeContext?, left: Vector<Type>, right: Vector<Typ
let success = true;
while rli < left.length {
(tctx, let tt) = tctx.least-upper-bound(left[rli],right[rli],blame);
if non-zero(tt) then next = next.push(tt);
if not(non-zero(left[rli])) and not(non-zero(right[rli])) then next = next.push(ta);
else if non-zero(tt) then next = next.push(tt);
else success = false;
rli = rli + 1;
};
Expand Down
11 changes: 0 additions & 11 deletions SRC/typecheck-typecheck.lsts
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@

let typecheck(): Nil = (
print("Typecheck 1\n");
infer-global-context-prim(ast-parsed-program);
print("Typecheck 2\n");
infer-global-context-td(ast-parsed-program);
print("Typecheck 3\n");
infer-global-context(ast-parsed-program);
print("Typecheck 4\n");
assert-no-infinite-types();
print("Typecheck 5\n");
(global-flow-tctx, ast-parsed-program) = infer-global-terms(global-flow-tctx, ast-parsed-program);
tctx-currently-processing-globals = false;
print("Typecheck 6\n");
(global-flow-tctx, ast-parsed-program) = std-infer-expr(global-flow-tctx, ast-parsed-program, false, Used, ta);
print("Typecheck 7\n");
# TODO: release globals for graceful exit
while non-zero(stack-to-specialize) { match stack-to-specialize {
# this can't be a normal for-loop because it gets extended during iteration
Expand All @@ -22,11 +15,7 @@ let typecheck(): Nil = (
specialize(key, ctx, result-type, term);
);
}};
print("Typecheck 8\n");
validate-interfaces();
print("Typecheck 9\n");
assert-well-typed(ast-parsed-program);
print("Typecheck 10\n");
decorate-var-to-def();
print("Typecheck 11\n");
);
4 changes: 1 addition & 3 deletions SRC/unit-main-core.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ let main(argc: C_int, argv: CString[]): Nil = (
print("\{ast-parsed-program}\n");
);
_ => (
print("Begin Parse\n");
for list fp4 in input.reverse { frontend(fp4); };
print("End Parse, Begin Preprocess\n");
match config-mode {
ModeTypecheck{} => (preprocess(); typecheck(););
ModeCompile{} => (preprocess(); print("End Preprocess, Begin Typecheck\n"); typecheck(); print("End Typecheck, Begin Backend\n"); plugin-current-backend(); );
ModeCompile{} => (preprocess(); typecheck(); plugin-current-backend(); );
};
);
};
Expand Down
11 changes: 11 additions & 0 deletions lib/core/vector.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ let .reverse(v: Vector<t>): Vector<t> = (

# new allocations = 0
let .into(v: Vector<t>, tt: Type<Vector<t>>): Vector<t> = v;
let .into(v: Vector<t>, tt: Type<String>): String = (
let s = "[";
let i = 0_sz;
for vector t in v {
if i>0 then s = s + ",";
s = s + t.into(type(String));
i = i + 1;
};
s = s + "]";
s
);

let .contains(v: Vector<t>, i: t): Bool = (
let result = false;
Expand Down
Loading