error recovery!

This commit is contained in:
nora 2023-08-06 00:07:10 +02:00
parent c0c08488ba
commit ef04f21100
18 changed files with 799 additions and 366 deletions

View file

@ -51,6 +51,8 @@ function printItem(item: Item<AnyPhase>): string {
)};`
);
}
case "error":
return "<ERROR>";
}
}
@ -203,6 +205,8 @@ function printExpr(expr: Expr<AnyPhase>, indent: number): string {
.map((expr) => printExpr(expr, indent))
.join(", ")})`;
}
case "error":
return "<ERROR>";
}
}
@ -218,6 +222,8 @@ function printType(type: Type<AnyPhase>): string {
return `*${printType(type.inner)}`;
case "never":
return "!";
case "error":
return "<ERROR>";
}
}
@ -230,6 +236,9 @@ function printRes(res: Resolution): string {
case "builtin": {
return `#B`;
}
case "error": {
return "#E";
}
}
}
@ -274,6 +283,8 @@ export function printTy(ty: Ty): string {
case "never": {
return "!";
}
case "error":
return "<ERROR>";
}
}