added on_exit arg to tryLast()

This commit is contained in:
2023-05-24 02:39:19 +06:00
parent 588453a2b7
commit 70807ed22b
5 changed files with 12 additions and 8 deletions

View File

@@ -43,23 +43,23 @@ void test_dtsod(){
char* s;
optime("deserialize",1,
tryLast(DtsodV24_deserialize(text),r)
tryLast(DtsodV24_deserialize(text),r,;)
dtsod=r.value.VoidPtr;
);
print_dtsod(dtsod);
optime("serialize",1,
tryLast(DtsodV24_serialize(dtsod),r)
tryLast(DtsodV24_serialize(dtsod),r,;)
s=r.value.VoidPtr;
);
DtsodV24_free(dtsod);
kprintf("\e[92m%s",s);
optime("reserialize",10,
tryLast(DtsodV24_deserialize(s),r)
tryLast(DtsodV24_deserialize(s),r,;)
dtsod=r.value.VoidPtr;
free(s);
tryLast(DtsodV24_serialize(dtsod),rr)
tryLast(DtsodV24_serialize(dtsod),rr,;)
s=rr.value.VoidPtr;
DtsodV24_free(dtsod);
);

View File

@@ -15,7 +15,7 @@ Maybe throw_errcode(){
Maybe test_maybe(){
kprintf("\e[94mdont_throw returns \e[92m");
tryLast(dont_throw(),rez0)
tryLast(dont_throw(),rez0,;)
printMaybe(rez0);
kprintf("\n");
try(throw_error(),rez1,;)