Skip to content

Commit

Permalink
Adjust representation of a raw Object.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrieferAtWork committed Nov 5, 2023
1 parent 4e6eeee commit cf9f2bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 50 deletions.
13 changes: 5 additions & 8 deletions src/deemon/objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,24 +1419,21 @@ object_str(DeeObject *__restrict self) {
Dee_Incref(&str_Object);
return &str_Object;
#else
if (self->ob_type != &DeeObject_Type)
if (Dee_TYPE(self) != &DeeObject_Type)
goto err_noimp;
Dee_Incref(&str_Object);
return &str_Object;
err_noimp:
err_unimplemented_operator(self->ob_type, OPERATOR_STR);
err_unimplemented_operator(Dee_TYPE(self), OPERATOR_STR);
return NULL;
#endif
}

PRIVATE WUNUSED NONNULL((1)) DREF DeeStringObject *DCALL
object_repr(DeeObject *__restrict self) {
if (self->ob_type != &DeeObject_Type)
goto err_noimp;
Dee_Incref(&str_Object);
return &str_Object;
err_noimp:
err_unimplemented_operator(self->ob_type, OPERATOR_REPR);
if (Dee_TYPE(self) == &DeeObject_Type)
return (DREF DeeStringObject *)DeeString_New("Object()");
err_unimplemented_operator(Dee_TYPE(self), OPERATOR_REPR);
return NULL;
}

Expand Down
43 changes: 1 addition & 42 deletions util/test-errors.dee
Original file line number Diff line number Diff line change
Expand Up @@ -262,48 +262,7 @@ function main() {
//invokeTypeMembers(deemon.Tuple);
//invokeTypeMembers(deemon.Sequence);


invokeAsync(deemon.Sequence.rlocate);
//invokeAsync(deemon.Sequence.locateall);
//invokeAsync(deemon.Sequence.transform);
//invokeAsync(deemon.Sequence.contains);
//invokeAsync(deemon.Sequence.startswith);
//invokeAsync(deemon.Sequence.endswith);
//invokeAsync(deemon.Sequence.find);
//invokeAsync(deemon.Sequence.rfind);
//invokeAsync(deemon.Sequence.index);
//invokeAsync(deemon.Sequence.rindex);
//invokeAsync(deemon.Sequence.reversed);
//invokeAsync(deemon.Sequence.sorted);
//invokeAsync(deemon.Sequence.segments);
//invokeAsync(deemon.Sequence.distribute);
//invokeAsync(deemon.Sequence.combinations);
//invokeAsync(deemon.Sequence.repeatcombinations);
//invokeAsync(deemon.Sequence.permutations);
//invokeAsync(deemon.Sequence.insert);
//invokeAsync(deemon.Sequence.insertall);
//invokeAsync(deemon.Sequence.append);
//invokeAsync(deemon.Sequence.extend);
//invokeAsync(deemon.Sequence.erase);
//invokeAsync(deemon.Sequence.xch);
//invokeAsync(deemon.Sequence.pop);
//invokeAsync(deemon.Sequence.popfront);
//invokeAsync(deemon.Sequence.popback);
//invokeAsync(deemon.Sequence.pushfront);
//invokeAsync(deemon.Sequence.pushback);
//invokeAsync(deemon.Sequence.remove);
//invokeAsync(deemon.Sequence.rremove);
//invokeAsync(deemon.Sequence.removeall);
//invokeAsync(deemon.Sequence.removeif);
//invokeAsync(deemon.Sequence.clear);
//invokeAsync(deemon.Sequence.resize);
//invokeAsync(deemon.Sequence.fill);
//invokeAsync(deemon.Sequence.reverse);
//invokeAsync(deemon.Sequence.sort);
//invokeAsync(deemon.Sequence.byhash);
//invokeAsync(deemon.Sequence.bfind);
//invokeAsync(deemon.Sequence.bcontains);
//invokeAsync(deemon.Sequence.bindex);
// TODO: crash: deemon.Sequence.bposition((), Object(), -1, (...) -> true)
//invokeAsync(deemon.Sequence.bposition);
//invokeAsync(deemon.Sequence.brange);
//invokeAsync(deemon.Sequence.blocate);
Expand Down

0 comments on commit cf9f2bc

Please sign in to comment.