Comentários: separadores com no máximo "---"
Trechos com quatro ou mais hífens dentro de comentários viram "---" (strings não mudam). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
374b445a8f
commit
80bd330766
40 files changed
+137
-137
No files matched your search
+1
-1
@@ -95,7 +95,7 @@ bool tb_image_get_pixel(const TinyBlocks_Image* img, int x, int y,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -- Registro de formatos ------------------------------------------------- */
|
||||
/* -- Registro de formatos --- */
|
||||
|
||||
#define TB_IMAGE_MAX_FORMATS 24
|
||||
|
||||
|
||||
+12
-12
@@ -13,7 +13,7 @@
|
||||
#include <strings.h>
|
||||
#include "tinyblocks/tinyblocks.h"
|
||||
|
||||
/* -- Construtores ---------------------------------------------------------- */
|
||||
/* -- Construtores --- */
|
||||
|
||||
TinyBlocks_Value tb_value_none(void)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ TinyBlocks_Value tb_value_block(TinyBlocks_Block* block)
|
||||
return v;
|
||||
}
|
||||
|
||||
/* -- Auxiliares ------------------------------------------------------------ */
|
||||
/* -- Auxiliares --- */
|
||||
|
||||
bool tb_text_to_number(const char* s, double* out)
|
||||
{
|
||||
@@ -95,7 +95,7 @@ static size_t put(char* out, size_t cap, const char* s)
|
||||
static TinyBlocks_Value obj_copy(TinyBlocks_Value v) { tb_object_retain(v.as.object); return v; }
|
||||
static void obj_release(TinyBlocks_Value* v) { tb_object_release(v->as.object); v->as.object = NULL; }
|
||||
|
||||
/* -- Classe: nada ---------------------------------------------------------- */
|
||||
/* -- Classe: nada --- */
|
||||
|
||||
static size_t none_text(TinyBlocks_Value v, char* out, size_t cap) { (void)v; return put(out, cap, ""); }
|
||||
static bool never(TinyBlocks_Value v) { (void)v; return false; }
|
||||
@@ -104,7 +104,7 @@ static const TinyBlocks_ValueClass s_none = {
|
||||
TB_VALUE_NONE, "nada", NULL, NULL, none_text, NULL, never, NULL, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: inteiro ------------------------------------------------------- */
|
||||
/* -- Classe: inteiro --- */
|
||||
|
||||
static size_t int_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
{ return (size_t)snprintf(out, cap, "%lld", (long long)v.as.integer); }
|
||||
@@ -116,7 +116,7 @@ static const TinyBlocks_ValueClass s_integer = {
|
||||
TB_VALUE_INTEGER, "número inteiro", NULL, NULL, int_text, int_num, int_truthy, int_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: real ---------------------------------------------------------- */
|
||||
/* -- Classe: real --- */
|
||||
|
||||
static size_t real_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
{ return (size_t)snprintf(out, cap, "%.15g", v.as.real); }
|
||||
@@ -128,7 +128,7 @@ static const TinyBlocks_ValueClass s_real = {
|
||||
TB_VALUE_REAL, "número real", NULL, NULL, real_text, real_num, real_truthy, real_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: texto --------------------------------------------------------- */
|
||||
/* -- Classe: texto --- */
|
||||
|
||||
static TinyBlocks_Value text_copy(TinyBlocks_Value v) { return tb_value_text(v.as.text); }
|
||||
static void text_release(TinyBlocks_Value* v) { free(v->as.text); v->as.text = NULL; }
|
||||
@@ -149,7 +149,7 @@ static const TinyBlocks_ValueClass s_text = {
|
||||
TB_VALUE_TEXT, "texto", text_copy, text_release, text_text, text_num, text_truthy, text_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: referencia a bloco -------------------------------------------- */
|
||||
/* -- Classe: referencia a bloco --- */
|
||||
|
||||
static size_t block_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ static const TinyBlocks_ValueClass s_block = {
|
||||
TB_VALUE_BLOCK, "bloco", NULL, NULL, block_text, NULL, block_truthy, block_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: desenho vetorial ---------------------------------------------- */
|
||||
/* -- Classe: desenho vetorial --- */
|
||||
|
||||
static size_t vec_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
{ return (size_t)snprintf(out, cap, "[desenho com %u comandos]", v.as.vector ? v.as.vector->count : 0u); }
|
||||
@@ -174,7 +174,7 @@ static const TinyBlocks_ValueClass s_vector = {
|
||||
TB_VALUE_VECTOR, "desenho vetorial", obj_copy, obj_release, vec_text, NULL, vec_truthy, vec_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: JSON (listas e objetos) --------------------------------------- */
|
||||
/* -- Classe: JSON (listas e objetos) --- */
|
||||
|
||||
|
||||
/* texto JSON sai sem aspas; o resto, como JSON */
|
||||
@@ -238,7 +238,7 @@ static const TinyBlocks_ValueClass s_json = {
|
||||
TB_VALUE_JSON, "JSON", obj_copy, obj_release, json_text, json_num, json_truthy, json_eq, json_type_name,
|
||||
};
|
||||
|
||||
/* -- Classe: imagem -------------------------------------------------------- */
|
||||
/* -- Classe: imagem --- */
|
||||
|
||||
static size_t img_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
{ return (size_t)snprintf(out, cap, "[imagem %dx%d]", tb_image_width(v.as.image), tb_image_height(v.as.image)); }
|
||||
@@ -249,7 +249,7 @@ static const TinyBlocks_ValueClass s_image = {
|
||||
TB_VALUE_IMAGE, "imagem", obj_copy, obj_release, img_text, NULL, img_truthy, img_eq, NULL,
|
||||
};
|
||||
|
||||
/* -- Classe: resultado (Ok | Erro) ----------------------------------------- */
|
||||
/* -- Classe: resultado (Ok | Erro) --- */
|
||||
|
||||
|
||||
static size_t res_text(TinyBlocks_Value v, char* out, size_t cap)
|
||||
@@ -279,7 +279,7 @@ static const TinyBlocks_ValueClass s_result = {
|
||||
TB_VALUE_RESULT, "resultado", obj_copy, obj_release, res_text, NULL, res_truthy, res_eq, res_type_name,
|
||||
};
|
||||
|
||||
/* -- Tabela e despacho ----------------------------------------------------- */
|
||||
/* -- Tabela e despacho --- */
|
||||
|
||||
static const TinyBlocks_ValueClass* const s_classes[TB_VALUE_KIND_COUNT] = {
|
||||
[TB_VALUE_NONE] = &s_none,
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ static VarTable s_global;
|
||||
static TbVarScope* s_cur = NULL;
|
||||
static TbVarScope* s_live = NULL;
|
||||
|
||||
/* -- Tabela ---------------------------------------------------------------- */
|
||||
/* -- Tabela --- */
|
||||
|
||||
static int table_find(const VarTable* t, const char* name) {
|
||||
for (int i = 0; i < t->n; i++) if (!strcmp(t->v[i].name, name)) return i;
|
||||
@@ -78,7 +78,7 @@ static VarTable* where(const char* name, int* idx) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* -- Escopos --------------------------------------------------------------- */
|
||||
/* -- Escopos --- */
|
||||
|
||||
TbVarScope* tb_vars_scope_new(TbVarScope* parent) {
|
||||
TbVarScope* s = calloc(1, sizeof(TbVarScope));
|
||||
@@ -103,7 +103,7 @@ void tb_vars_scope_free(TbVarScope* s) {
|
||||
TbVarScope* tb_vars_scope_current(void) { return s_cur; }
|
||||
void tb_vars_scope_set(TbVarScope* s) { s_cur = s; }
|
||||
|
||||
/* -- Valores --------------------------------------------------------------- */
|
||||
/* -- Valores --- */
|
||||
|
||||
const TinyBlocks_Value* tb_vars_get(const char* name) {
|
||||
if (!name || !name[0]) return NULL;
|
||||
@@ -140,7 +140,7 @@ bool tb_vars_delete(const char* name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -- Globais --------------------------------------------------------------- */
|
||||
/* -- Globais --- */
|
||||
|
||||
int tb_vars_global_count(void) { return s_global.n; }
|
||||
const char* tb_vars_global_name(int i) { return (i >= 0 && i < s_global.n) ? s_global.v[i].name : ""; }
|
||||
|
||||
Reference in new issue
Block a user