fix parsing
This commit is contained in:
@@ -26,14 +26,24 @@ export const run = defineCommand({
|
||||
if (match.succeeded()) {
|
||||
const adapter = semantics(match);
|
||||
const ast = adapter.toAST();
|
||||
// console.log(JSON.stringify(ast, null, 2));
|
||||
new TraitChecker().withModule(ast);
|
||||
const aliasResolvedAst = new TypeAliasResolver().withModule(ast);
|
||||
const typeSystem = new TypeSystem();
|
||||
const typeChecker = new TypeChecker();
|
||||
const typeResolver = new TypeResolver();
|
||||
|
||||
typeChecker.withModule(aliasResolvedAst, typeSystem);
|
||||
typeSystem.solve();
|
||||
try {
|
||||
typeSystem.solve();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.log(JSON.stringify(typeSystem.result, null, 2));
|
||||
return;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user