add check2
All checks were successful
Check / Explore-Gitea-Actions (push) Successful in 14s

This commit is contained in:
sfja 2026-04-14 00:56:42 +02:00
parent 6bb68863ca
commit 0655f398ce
2 changed files with 33 additions and 0 deletions

32
src/front/check2.ts Normal file
View File

@ -0,0 +1,32 @@
import { Syms } from "./resolve.ts";
import * as ast from "../ast.ts";
import { Ty } from "../ty.ts";
export function checkFn(fn: ast.FnStmt, syms: Syms) {
}
export class FnTys {
constructor(
private nodeTys: Map<ast.Node, Ty>,
) {}
get(node: ast.Node): Ty {
const ty = this.nodeTys.get(node);
if (ty === undefined) {
throw new Error(`no type for '${node.kind.tag}'`);
}
return ty;
}
}
class FnChecker {
private nodeTys = new Map<ast.Node, Ty>();
constructor(
private fn: ast.FnStmt,
private syms: Syms,
) {}
check() {
}
}

View File

@ -1,3 +1,4 @@
export * from "./parse.ts"; export * from "./parse.ts";
export * from "./resolve.ts"; export * from "./resolve.ts";
export * from "./check.ts"; export * from "./check.ts";
export * from "./check2.ts";