Commit Graph

9 Commits

Author SHA1 Message Date
5bd533d40c parser: replace fprintf+longjmp with fail(), add forward declarations
Introduce a fail(p, "msg") inline function that stores the error message
in a buffer and longjmps, replacing ~52 fprintf(stderr,...)+longjmp pairs.
The error message is propagated through Ast.err_msg so callers can decide
whether/how to display it. Also add forward declarations for all static
functions and move PtrModifiers typedef to the type definitions section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:40:33 +00:00
f5f54fcbe8 parser: propagate errors via setjmp/longjmp instead of exit(1)
Replace 32 parse-error exit(1) calls with longjmp to allow callers to
detect and handle parse failures. The OOM exit(1) in
astNodeListEnsureCapacity is kept as-is.

Add has_error flag to Ast, wrap parseRoot() with setjmp in astParse(),
and update test infrastructure to use the C parser for testError tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-11 14:40:31 +00:00
d551ba3d12 a few bugfixes and a new TODO 2024-12-30 22:36:35 +02:00
b8a52d3f39 More parser — lint+tests pass again 2024-12-30 01:30:48 +02:00
6006a802e1 making tcc happier 2024-12-29 00:13:54 +02:00
ef3ef64abd more macros 2024-12-23 21:56:56 +02:00
a9c4b5c7ab macros 2024-12-23 00:01:42 +02:00
db35aa7722 rename types 2024-12-22 22:31:16 +02:00
228b215259 making parser 2024-12-20 00:24:51 +02:00