Tipo diz o texto do seu bloco-handle; paleta sem teto de 192 itens
value_text no TypeBlock: um bloco-handle (TB_VALUE_BLOCK) aparece como
a library quiser ("tensor [3, 32, 32]") em vez de "[bloco Tipo]".
fly_items vira vetor que cresce: as libraries de categoria ja ocupavam
185 dos 192 itens e as variaveis empurravam categorias inteiras para fora.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34c9a39c2c
commit
3dd132d12d
6 files changed
+52
-9
No files matched your search
@@ -16,6 +16,11 @@ static bool text_is(TinyBlocks_Value v, const char* s) {
|
||||
return strcmp(buf, s) == 0;
|
||||
}
|
||||
|
||||
static size_t handle_text(TinyBlocks_Block* self, char* out, size_t cap) {
|
||||
(void)self;
|
||||
return (size_t)snprintf(out, cap, "tensor [3, 32, 32]");
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
/* toda kind tem classe; desconhecida cai em "nada" */
|
||||
bool all = true;
|
||||
@@ -65,6 +70,16 @@ int main(void) {
|
||||
CHECK(tb_value_equals(ve, ve2) && !tb_value_equals(ve, vo), "resultados iguais pela tag e pelo conteúdo");
|
||||
|
||||
tb_value_free(&vo); tb_value_free(&ve); tb_value_free(&ve2); tb_value_free(&jl); tb_value_free(&t);
|
||||
|
||||
/* Bloco-handle: o tipo diz como o valor vira texto (value_text) */
|
||||
TinyBlocks* rt = NULL;
|
||||
tinyblocks_init(&rt, NULL);
|
||||
TinyBlocks_TypeBlock* th = tb_type_block_create(rt, "Teste._Handle", NULL, 0, NULL, 0, NULL);
|
||||
TinyBlocks_Block* hb = tb_block_create(rt, th);
|
||||
CHECK(text_is(tb_value_block(hb), "[bloco Teste._Handle]"), "bloco sem value_text: \"[bloco Tipo]\"");
|
||||
tb_type_block_set_value_text(th, handle_text);
|
||||
CHECK(text_is(tb_value_block(hb), "tensor [3, 32, 32]"), "bloco com value_text: o texto do tipo");
|
||||
tinyblocks_deinit(&rt);
|
||||
if (fails) printf("\n%d FALHA(S)\n", fails);
|
||||
else printf("\nTUDO OK\n");
|
||||
return fails != 0;
|
||||
|
||||
Reference in new issue
Block a user