mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +00:00
eval: Split eval.c into smaller files
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "nvim/window.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
#include "nvim/map_defs.h"
|
||||
#include "nvim/map.h"
|
||||
#include "nvim/option.h"
|
||||
@@ -87,7 +88,7 @@ bool try_end(Error *err)
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
Object dict_get_value(dict_T *dict, String key, Error *err)
|
||||
{
|
||||
hashitem_T *hi = hash_find(&dict->dv_hashtab, (uint8_t *) key.data);
|
||||
hashitem_T *hi = hash_find(&dict->dv_hashtab, (char_u *)key.data);
|
||||
|
||||
if (HASHITEM_EMPTY(hi)) {
|
||||
api_set_error(err, Validation, _("Key not found"));
|
||||
@@ -177,13 +178,13 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del,
|
||||
if (retval) {
|
||||
rv = vim_to_object(&di->di_tv);
|
||||
}
|
||||
clear_tv(&di->di_tv);
|
||||
tv_clear(&di->di_tv);
|
||||
}
|
||||
|
||||
// Update the value
|
||||
copy_tv(&tv, &di->di_tv);
|
||||
// Clear the temporary variable
|
||||
clear_tv(&tv);
|
||||
tv_clear(&tv);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@@ -682,20 +683,20 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
|
||||
break;
|
||||
|
||||
case kObjectTypeArray: {
|
||||
list_T *list = list_alloc();
|
||||
list_T *const list = tv_list_alloc();
|
||||
|
||||
for (uint32_t i = 0; i < obj.data.array.size; i++) {
|
||||
Object item = obj.data.array.items[i];
|
||||
listitem_T *li = listitem_alloc();
|
||||
listitem_T *li = tv_list_item_alloc();
|
||||
|
||||
if (!object_to_vim(item, &li->li_tv, err)) {
|
||||
// cleanup
|
||||
listitem_free(li);
|
||||
list_free(list);
|
||||
tv_list_item_free(li);
|
||||
tv_list_free(list);
|
||||
return false;
|
||||
}
|
||||
|
||||
list_append(list, li);
|
||||
tv_list_append(list, li);
|
||||
}
|
||||
list->lv_refcount++;
|
||||
|
||||
|
Reference in New Issue
Block a user