The value is displaying correctly, but not the type

This commit is contained in:
2022-08-12 17:27:57 +01:00
parent 7424a681d6
commit 55aa6eb273
8 changed files with 157 additions and 30 deletions

View File

@@ -44,7 +44,10 @@ Scope* popScope(Scope* scope) {
}
//returns false if error
bool declareScopeVariable(Scope* scope, Literal key) {
bool declareScopeVariable(Scope* scope, Literal key, Literal type) {
//store the type, for later checking on assignment
//TODO
//don't redefine a variable within this scope
if (existsLiteralDictionary(&scope->variables, key)) {
return false;