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:
parent
ca087d2c07
commit
cda634a1c4
9 changed files with 87 additions and 4 deletions
|
|
@ -53,6 +53,9 @@ export interface ParseOptions {
|
|||
export interface ParseState {
|
||||
/** The byte offset in the document that the parser is at. */
|
||||
currentOffset: number;
|
||||
|
||||
/** Indicates whether the parser has encountered an error during parsing. */
|
||||
hasError: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue