Some declaration guards

This commit is contained in:
2022-08-15 03:12:10 +01:00
parent 4cda75df11
commit 8d12db7dbe
4 changed files with 26 additions and 4 deletions

View File

@@ -59,7 +59,11 @@ bool declareScopeVariable(Scope* scope, Literal key, Literal type) {
return true;
}
//return false if undefined
bool isDelcaredScopeVariable(Scope* scope, Literal key) {
return existsLiteralDictionary(&scope->variables, key);
}
//return false if undefined, or can't be assigned
bool setScopeVariable(Scope* scope, Literal key, Literal value) {
//dead end
if (scope == NULL) {