From abf8ae5fa6e7a9d3973666d3881bd30407539b95 Mon Sep 17 00:00:00 2001 From: Ajani Bilby <11359344+AjaniBilby@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:07:58 +1000 Subject: [PATCH] Update index.ts --- source/compiler/codegen/expression/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/compiler/codegen/expression/index.ts b/source/compiler/codegen/expression/index.ts index f8d0056..40ca3c2 100644 --- a/source/compiler/codegen/expression/index.ts +++ b/source/compiler/codegen/expression/index.ts @@ -62,9 +62,12 @@ function CompileBrackets(ctx: Context, syntax: Syntax.Term_Expr_brackets, expect function CompileName(ctx: Context, syntax: Syntax.Term_Name, expect?: Intrinsic) { const name = syntax.value[0].value; const variable = ctx.scope.getVariable(name); - if (!variable) Yeet(`${colors.red("Error")}: Undeclared variable name ${name}\n`, { - path: ctx.file.path, name: ctx.file.name, ref: syntax.ref - }); + if (!variable) { + // TODO: Attempt resolve function/type + Yeet(`${colors.red("Error")}: Undeclared variable ${name}\n`, { + path: ctx.file.path, name: ctx.file.name, ref: syntax.ref + }); + } if (!variable.isDefined) Yeet(`${colors.red("Error")}: Variable ${name} has no value assigned to it\n`, { path: ctx.file.path, name: ctx.file.name, ref: syntax.ref