replaced TomlArray with tlibc List

This commit is contained in:
2025-11-26 17:02:38 +05:00
parent 2082d56c25
commit 281a65f0d1
8 changed files with 89 additions and 114 deletions

View File

@@ -14,7 +14,7 @@ Result(Table*) toml_walk_table_path(TomlParser* parser, TomlTable* table,
if (is_array) {
u64 i = 0;
for (; i < key_path->len - 1; i++) {
str part = *key_path->elements[i].value.s;
str part = *key_path->data[i].value.s;
TomlValue* t = TomlTable_get(real_table, part);
if (t == NULL) {
if (create_if_not_exist) {
@@ -31,7 +31,7 @@ Result(Table*) toml_walk_table_path(TomlParser* parser, TomlTable* table,
}
}
str part = *key_path->elements[i].value.s;
str part = *key_path->data[i].value.s;
TomlValue* t = TomlTable_get(real_table, part);
if (t == NULL) {
if (create_if_not_exist) {
@@ -58,7 +58,7 @@ Result(Table*) toml_walk_table_path(TomlParser* parser, TomlTable* table,
}
} else {
for (u64 i = 0; i < key_path->len; i++) {
str part = *key_path->elements[i].value.s;
str part = *key_path->data[i].value.s;
TomlValue* t = TomlTable_get(real_table, part);
if (t == NULL) {
if (create_if_not_exist) {
@@ -72,7 +72,7 @@ Result(Table*) toml_walk_table_path(TomlParser* parser, TomlTable* table,
}
} else {
if (t->type == TLIBTOML_ARRAY) {
real_table = t->value.array->elements[t->value.array->len - 1].value.table;
real_table = t->value.array->data[t->value.array->len - 1].value.table;
} else if (t->type == TLIBTOML_TABLE) {
real_table = t->value.table;
}