Small bug-fixes and improvements

This commit is contained in:
K35
2022-01-02 22:17:31 +00:00
parent cf49fca928
commit 363dcf3e7d
4 changed files with 13 additions and 8 deletions

View File

@ -6,7 +6,7 @@ const builtin = ["number", "string", "boolean"];
export class IRError extends Error {
constructor(public statement: StatementNode, message: string) {
super("Error Compiling: " + message);
super("Error building IR: " + message);
}
}
@ -198,7 +198,7 @@ export default function get_ir(parsed: Parsed): IR {
if (fnc.return_type.type !== "void" && builtin.indexOf(fnc.return_type.type) < 0) {
throw new IRError(
fnc,
`Type ${fnc.return_type} is not defined`
`Type ${fnc.return_type.type} is not defined`
);
}
}