mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
refactor(api): use typed keysets
Initially this is just for geting rid of boilerplate, but eventually the types could get exposed as metadata
This commit is contained in:
@@ -63,8 +63,9 @@
|
||||
#define NIL ((Object)OBJECT_INIT)
|
||||
#define NULL_STRING ((String)STRING_INIT)
|
||||
|
||||
// currently treat key=vim.NIL as if the key was missing
|
||||
#define HAS_KEY(o) ((o).type != kObjectTypeNil)
|
||||
#define HAS_KEY(d, typ, key) (((d)->is_set__##typ##_ & (1 << KEYSET_OPTIDX_##typ##__##key)) != 0)
|
||||
|
||||
#define GET_BOOL_OR_TRUE(d, typ, key) (HAS_KEY(d, typ, key) ? (d)->key : true)
|
||||
|
||||
#define PUT(dict, k, v) \
|
||||
kv_push(dict, ((KeyValuePair) { .key = cstr_to_string(k), .value = v }))
|
||||
|
Reference in New Issue
Block a user