feat: add error information in the progress callback

This allows users to bail parsing if an error was *definitely* detected
using the progress callback, as all possible stack versions have a
non-zero error cost.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
Allan Clements 2025-01-25 01:21:04 -05:00 committed by Amaan Qureshi
parent ca087d2c07
commit cda634a1c4
9 changed files with 87 additions and 4 deletions

View file

@ -94,6 +94,7 @@ typedef struct TSInput {
typedef struct TSParseState {
void *payload;
uint32_t current_byte_offset;
bool has_error;
} TSParseState;
typedef struct TSParseOptions {