many things

This commit is contained in:
nora 2023-07-31 22:39:17 +02:00
parent f582a5b4c3
commit 924236532c
13 changed files with 264 additions and 85 deletions

View file

@ -13,11 +13,13 @@ import { Crate, Built, Typecked } from "./ast";
import { Ids } from "./utils";
const INPUT = `
global HELLO: I32 = 0_I32;
extern mod std;
type A = { a: String };
function main() = (
HELLO = 1_I32;
);
std.rt.allocateItem(0_I32, 0_I32);
);
`;
function main() {
@ -135,6 +137,8 @@ function loadCrate(
const tokens = tokenize(input);
const ast = parse(name, tokens, crateId.next());
const [resolved, crates] = resolve(ast, loadCrate);
console.log(resolved);
const typecked = typeck(resolved, [...existingCrates, ...crates]);
return [typecked, crates];