I think var declarations are working correctly; no type checking yet

This commit is contained in:
2022-08-13 15:57:30 +01:00
parent 55aa6eb273
commit afad0d99cb
12 changed files with 120 additions and 120 deletions

View File

@@ -107,6 +107,21 @@ static bool setEntryArray(_entry** dictionaryHandle, int* capacityPtr, int count
_entry* entry = getEntryArray(*dictionaryHandle, *capacityPtr, key, hash, false);
//if it's a string or an identifier, make a local copy
if (IS_STRING(key)) {
key = TO_STRING_LITERAL(copyString(AS_STRING(key), STRLEN(key)));
}
if (IS_IDENTIFIER(key)) {
key = TO_IDENTIFIER_LITERAL(copyString(AS_IDENTIFIER(key), STRLEN_I(key)));
}
if (IS_STRING(value)) {
value = TO_STRING_LITERAL(copyString(AS_STRING(value), STRLEN(value)));
}
if (IS_IDENTIFIER(value)) {
value = TO_IDENTIFIER_LITERAL(copyString(AS_IDENTIFIER(value), STRLEN_I(value)));
}
//true = count increase
if (IS_NULL(entry->key)) {
setEntryValues(entry, key, value);