mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 16:35:03 +01:00
many things
This commit is contained in:
parent
f582a5b4c3
commit
924236532c
13 changed files with 264 additions and 85 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue