diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index bdac33d..653ec08 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -775,6 +775,11 @@ proc inferExprType(self: Compiler, node: ASTNode): ASTNode = ## Infers the type of a given expression and ## returns it case node.kind: + of identExpr: + var node = IdentExpr(node) + if self.getStaticIndex(IdentExpr(node)) == -1: + self.error(&"reference to undeclared name '{node.token.lexeme}'") + # TODO: Find type of identifier of unaryExpr: return self.inferValueType(UnaryExpr(node).a) of binaryExpr: diff --git a/src/util/debugger.nim b/src/util/debugger.nim index 3e5f14a..ffafd60 100644 --- a/src/util/debugger.nim +++ b/src/util/debugger.nim @@ -184,7 +184,7 @@ proc disassembleInstruction*(chunk: Chunk, offset: int): int = proc disassembleChunk*(chunk: Chunk, name: string) = ## Takes a chunk of bytecode, and prints it - echo &"==== JAPL Bytecode Debugger - Chunk '{name}' ====\n" + echo &"==== Peon Bytecode Debugger - Chunk '{name}' ====\n" var index = 0 while index < chunk.code.len: index = disassembleInstruction(chunk, index)