- 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)
30 lines
958 B
C
30 lines
958 B
C
/*
|
|
* cat/error.h -- runtime error object.
|
|
*
|
|
* Naming rule: a symbol living in `cat/error.h` (path without the
|
|
* leading include/ or src/ prefix) is named cat_error_* / CAT_ERROR_*.
|
|
*
|
|
* Catscript runtime errors are carried in a plain value struct so that
|
|
* any C-API call can report failure without exceptions or longjmp.
|
|
*/
|
|
#ifndef CAT_ERROR_H
|
|
#define CAT_ERROR_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
/* CAT_ERROR_Error -- an error slot passed into API calls. */
|
|
/* `raised` becomes true when an operation fails; `message` is a */
|
|
/* human-readable description (always NUL terminated when raised). */
|
|
typedef struct CAT_ERROR_Error {
|
|
bool raised;
|
|
char message[256];
|
|
} CAT_ERROR_Error;
|
|
|
|
/* Clear an error slot back to the "no error" state. */
|
|
void cat_error_clear(CAT_ERROR_Error *err);
|
|
|
|
/* Raise (fill) an error slot with a printf-style message. */
|
|
void cat_error_raise(CAT_ERROR_Error *err, const char *fmt, ...);
|
|
|
|
#endif /* CAT_ERROR_H */
|