Skip to content

Commit

Permalink
Fix various problems with SeqEach & implement core for SeqSome
Browse files Browse the repository at this point in the history
  • Loading branch information
GrieferAtWork committed Dec 15, 2024
1 parent 0e932a6 commit 5cc32d3
Show file tree
Hide file tree
Showing 10 changed files with 3,202 additions and 1,639 deletions.
13 changes: 13 additions & 0 deletions src/deemon/objects/generic-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#define GUARD_DEEMON_OBJECTS_GENERIC_PROXY_C 1

#include <deemon/api.h>
#include <deemon/method-hints.h>
#include <deemon/object.h>

#include "../runtime/runtime_error.h"
#include "seq/default-api.h"

/**/
#include "generic-proxy.h"
Expand Down Expand Up @@ -227,6 +229,12 @@ generic_proxy_contains(ProxyObject *self, DeeObject *item) {
return DeeObject_Contains(self->po_obj, item);
}

INTERN WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *DCALL
generic_proxy_getrange(ProxyObject *self, DeeObject *start, DeeObject *end) {
return DeeObject_GetRange(self->po_obj, start, end);
}


INTERN WUNUSED NONNULL((1, 2)) DREF DeeObject *DCALL
generic_proxy_getitem_string_hash(ProxyObject *self, char const *key, Dee_hash_t hash) {
return DeeObject_GetItemStringHash(self->po_obj, key, hash);
Expand Down Expand Up @@ -283,6 +291,11 @@ generic_proxy_bounditem_string_len_hash(ProxyObject *self, char const *key,
return DeeObject_BoundItemStringLenHash(self->po_obj, key, keylen, hash);
}

INTERN WUNUSED NONNULL((1)) int DCALL
generic_proxy_seq_bool(ProxyObject *__restrict self) {
return DeeSeq_OperatorBool(self->po_obj);
}

/*
INTERN WUNUSED NONNULL((1)) Dee_hash_t DCALL
generic_proxy_hash_id(ProxyObject *self) {
Expand Down
5 changes: 5 additions & 0 deletions src/deemon/objects/generic-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ INTDEF WUNUSED NONNULL((1, 2)) int DCALL generic_proxy_bounditem(ProxyObject *se
INTDEF WUNUSED NONNULL((1)) int DCALL generic_proxy_hasitem_index(ProxyObject *__restrict self, size_t index); /* DeeObject_HasItemIndex(self->po_obj, index) */
INTDEF WUNUSED NONNULL((1)) int DCALL generic_proxy_bounditem_index(ProxyObject *__restrict self, size_t index); /* DeeObject_BoundItemIndex(self->po_obj, index) */
INTDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *DCALL generic_proxy_contains(ProxyObject *self, DeeObject *item); /* DeeObject_Contains(self->po_obj, item) */
INTDEF WUNUSED NONNULL((1, 2, 3)) DREF DeeObject *DCALL generic_proxy_getrange(ProxyObject *self, DeeObject *start, DeeObject *end); /* DeeObject_GetRange(self->po_obj, start, end) */

INTDEF WUNUSED NONNULL((1, 2)) DREF DeeObject *DCALL generic_proxy_getitem_string_hash(ProxyObject *self, char const *key, Dee_hash_t hash); /* DeeObject_GetItemStringHash(self->po_obj, key, hash) */
INTDEF WUNUSED NONNULL((1, 2)) int DCALL generic_proxy_delitem_string_hash(ProxyObject *self, char const *key, Dee_hash_t hash); /* DeeObject_DelItemStringHash(self->po_obj, key, hash) */
Expand All @@ -112,6 +113,10 @@ INTDEF WUNUSED NONNULL((1, 2, 5)) int DCALL generic_proxy_setitem_string_len_has
INTDEF WUNUSED NONNULL((1, 2)) int DCALL generic_proxy_hasitem_string_len_hash(ProxyObject *self, char const *key, size_t keylen, Dee_hash_t hash); /* DeeObject_HasItemStringLenHash(self->po_obj, key, keylen, hash) */
INTDEF WUNUSED NONNULL((1, 2)) int DCALL generic_proxy_bounditem_string_len_hash(ProxyObject *self, char const *key, size_t keylen, Dee_hash_t hash); /* DeeObject_BoundItemStringLenHash(self->po_obj, key, keylen, hash) */

INTDEF WUNUSED NONNULL((1)) int DCALL generic_proxy_seq_bool(ProxyObject *__restrict self); /* DeeSeq_OperatorBool(self->po_obj) */
INTDEF WUNUSED NONNULL((1)) size_t DCALL generic_proxy_seq_size(ProxyObject *__restrict self); /* DeeSeq_OperatorSize(self->po_obj) */
INTDEF WUNUSED NONNULL((1)) DREF DeeObject *DCALL generic_proxy_seq_sizeob(ProxyObject *__restrict self); /* DeeSeq_OperatorSizeOb(self->po_obj) */

/*INTDEF WUNUSED NONNULL((1)) Dee_hash_t DCALL generic_proxy_hash_id(ProxyObject *self);*/

INTDEF struct type_cmp generic_proxy_cmp_recursive;
Expand Down
760 changes: 397 additions & 363 deletions src/deemon/objects/seq/each-fastpass.c.inl

Large diffs are not rendered by default.

Loading

0 comments on commit 5cc32d3

Please sign in to comment.