Core: registro de metadados de blocos (tb_meta) + testes; metadados declarados nas libraries

This commit is contained in:
mguinhos committed 2026-10-20 22:07:40 -03:00
1 parent 22ae18f508
commit 036162280d
14 files changed
+397 -2

No files matched your search

@@ -179,6 +179,48 @@ static bool operators_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
};
tb_library_set_category(lib, &cat);
/* Metadados dos blocos (tooltip do editor: Alt + hover). */
TB_BLOCK_META("Operators.Lt", "eval_op_lt",
"Verdadeiro se A for menor que B");
TB_BLOCK_META("Operators.Eq", "eval_op_eq",
"Verdadeiro se A for igual a B");
TB_BLOCK_META("Operators.Gt", "eval_op_gt",
"Verdadeiro se A for maior que B");
TB_BLOCK_META("Operators.And", "eval_op_and",
"Verdadeiro se ambos os lados forem verdadeiros");
TB_BLOCK_META("Operators.Or", "eval_op_or",
"Verdadeiro se ao menos um lado for verdadeiro");
TB_BLOCK_META("Operators.Not", "eval_op_not",
"Inverte o valor logico");
TB_BLOCK_META("Operators.Random", "eval_op_random",
"Numero inteiro aleatorio entre A e B");
TB_BLOCK_META("Math.Add", "eval_add",
"Soma dois numeros");
TB_BLOCK_META("Math.Sub", "eval_sub",
"Subtrai B de A");
TB_BLOCK_META("Math.Mul", "eval_mul",
"Multiplica dois numeros");
TB_BLOCK_META("Math.Div", "eval_div",
"Divide A por B");
TB_BLOCK_META("Math.Mod", "eval_mod",
"Resto da divisao de A por B");
TB_BLOCK_META("Math.Abs", "eval_abs",
"Valor absoluto de um numero");
TB_BLOCK_META("Math.Max", "eval_max",
"Maior entre dois numeros");
TB_BLOCK_META("Math.Min", "eval_min",
"Menor entre dois numeros");
TB_BLOCK_META("Text.Concat", "eval_concat",
"Junta dois textos");
TB_BLOCK_META("Text.Length", "eval_len",
"Numero de caracteres de um texto");
TB_BLOCK_META("Literal.Integer", "eval_lit_int",
"Valor inteiro digitado");
TB_BLOCK_META("Literal.Real", "eval_lit_real",
"Valor real (decimal) digitado");
TB_BLOCK_META("Literal.Text", "eval_lit_text",
"Valor de texto digitado");
static const TinyBlocks_SlotDesc any2[] = {{"a", TB_VALUE_NONE}, {"b", TB_VALUE_NONE}};
static const TinyBlocks_SlotDesc bool2[] = {{"a", TB_VALUE_INTEGER}, {"b", TB_VALUE_INTEGER}};
static const TinyBlocks_SlotDesc bool1[] = {{"a", TB_VALUE_INTEGER}};