Converte símbolos Unicode decorativos dos comentários para ASCII

Substitui barras de caixa (─ ═ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴), travessões (—),
setas (→ ←), reticências (…), bullets (•), multiplicação (×) e
guillemets (› ‹) por equivalentes ASCII. Acentos portugueses são
preservados.
This commit is contained in:
mguinhos committed 2026-10-20 19:27:33 -03:00
1 parent 1cc0ff9d02
commit 90d47bf8a0
36 files changed
+327 -327

No files matched your search

+9 -9
View File
@@ -1,15 +1,15 @@
/*
* python.c — Plugin TinyBlocks com blocos Python.*.
* python.c - Plugin TinyBlocks com blocos Python.*.
*
* Blocos:
* Python.Eval — avalia expressão Python com variáveis x0..x3
* Python.Run — executa script Python com variáveis x0..x3, captura stdout
* Python.Eval - avalia expressão Python com variáveis x0..x3
* Python.Run - executa script Python com variáveis x0..x3, captura stdout
*
* Compilar:
* make python-lib
*
* Carregar no editor:
* ./build/editor build/python.so ou Ctrl+O → build/python.so
* ./build/editor build/python.so ou Ctrl+O -> build/python.so
*
* Exemplos de expressões:
* x0 ** 2 + x1 ** 2
@@ -23,7 +23,7 @@
#include <tinyblocks/tinyblocks.h>
#include <tinyblocks-python/tb_python.h>
/* ── Helper: lê float de slot numérico ──────────────────────────────────── */
/* -- Helper: lê float de slot numérico --- */
static double gd(TinyBlocks_Block* self, TinyBlocks* rt, uint32_t idx) {
TinyBlocks_Value v = tb_block_get_input(self, rt, idx);
if (v.kind == TB_VALUE_REAL) return v.as.real;
@@ -36,7 +36,7 @@ static const char* gs(TinyBlocks_Block* self, TinyBlocks* rt, uint32_t idx) {
return (v.kind == TB_VALUE_TEXT && v.as.text) ? v.as.text : "";
}
/* ── Python.Eval ─────────────────────────────────────────────────────────── */
/* -- Python.Eval --- */
/*
* Inputs: expr (text), x0..x3 (real)
* Output: result (text)
@@ -52,7 +52,7 @@ static void eval_python_eval(TinyBlocks_Block* self, TinyBlocks* rt) {
self->dirty = false;
}
/* ── Python.Run ──────────────────────────────────────────────────────────── */
/* -- Python.Run --- */
/*
* Inputs: code (text), x0..x3 (real)
* Output: stdout (text)
@@ -68,7 +68,7 @@ static void eval_python_run(TinyBlocks_Block* self, TinyBlocks* rt) {
self->dirty = false;
}
/* ── Slots ───────────────────────────────────────────────────────────────── */
/* -- Slots --- */
static const TinyBlocks_SlotDesc eval_in[] = {
{"expr", TB_VALUE_TEXT},
{"x0", TB_VALUE_REAL}, {"x1", TB_VALUE_REAL},
@@ -82,7 +82,7 @@ static const TinyBlocks_SlotDesc run_in[] = {
static const TinyBlocks_SlotDesc text_out[] = {{"result", TB_VALUE_TEXT}};
static const TinyBlocks_SlotDesc stdout_out[]= {{"stdout", TB_VALUE_TEXT}};
/* ── Registro ────────────────────────────────────────────────────────────── */
/* -- Registro --- */
static bool py_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
if (!tb_python_init()) return false;