catscript: núcleo C, stdlib (TOML), família de arquivos e front-end self-hosted

- Modelo de objetos Cat_Value + vtable (interfaces abstratas)
- VM de bytecode, sem GIL (VM por-thread, nativas como valores)
- Stdlib com TOML embutido (toml_parse/toml_encode)
- Família de arquivos: AbstractFile (abstrata), File::open, StringIO, BytesIO
- Front-end (lexer/parser/checker/compiler) implementado em catscript
- cpk (cat package manager) como primeiro programa; manifest package.toml
- Type hints advisory, inclusive DynSized() e sentinel_sized<...>
- 25/25 testes passando (make test)
This commit is contained in:
Minus committed 2026-11-16 01:27:44 +00:00
commit 52d118211f
69 files changed
+6938

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
/*
* cat/compiler.h -- source -> bytecode compiler.
*
* Naming rule: symbols here are cat_compiler_* / CAT_COMPILER_*.
*
* The compiler is a recursive-descent parser over the Lua-like syntax.
* It performs structural-typing checks only where cheap (nothing is
* nominal) and accepts optional `: type` hints, which are advisory.
*/
#ifndef CAT_COMPILER_H
#define CAT_COMPILER_H
#include "cat/bytecode.h"
#include "cat/error.h"
/* Compile `source` into a fresh top-level function. */
CAT_BYTECODE_Function *cat_compiler_compile(const char *source,
CAT_ERROR_Error *err);
#endif /* CAT_COMPILER_H */