added interpreter

This commit is contained in:
2025-08-31 23:06:26 -06:00
parent dd4f5b9ee6
commit 126524a9e9
5 changed files with 478 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import { TypeAliasResolver } from "../types/type_alias_resolution";
import { TypeSystem } from "../types/type_system";
import { TypeChecker } from "../types/type_checker";
import { TypeResolver } from "../types/type_resolver";
import { TreeWalkInterpreter } from "../interpreter";
export const run = defineCommand({
name: "run",
@@ -33,7 +34,9 @@ export const run = defineCommand({
typeChecker.withModule(aliasResolvedAst, typeSystem);
typeSystem.solve();
const typeResolvedAst = typeResolver.withModule(aliasResolvedAst, typeSystem);
console.log(JSON.stringify(typeResolvedAst, null, 2));
const interpreter = new TreeWalkInterpreter();
const result = interpreter.withModule(typeResolvedAst);
console.log(JSON.stringify(result, null, 2));
// console.log(JSON.stringify(aliasResolvedAst, null, 2));
} else {