Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- binder_
error - Convenience: create an
InvalidBindererror. - byte_
offset_ to_ line_ col - Returns the line and column for a byte offset in source.
- classify_
error - Classify a
ParseErrorinto a human-readable category string. - compact_
error_ summary - Formats a compact error summary line.
- count_
by_ kind - Return the count of each kind in a
ParseErrorscollection. - count_
by_ severity - Counts the number of errors at each severity level.
- dedup_
by_ message - Deduplicates a list of errors by message fingerprint.
- dedup_
errors - Deduplicate errors by span start position.
- duplicate_
error - Convenience: create a
DuplicateDeclarationerror. - earliest_
error - Return the error with the earliest position.
- error_
col - Return the 1-indexed column from a
ParseError. - error_
col_ ext2 - Returns the column of a located error.
- error_
contains - Checks if an error message matches a substring.
- error_
end - Return the byte end offset from a
ParseError. - error_
fingerprint - Computes a fingerprint for an error message (for deduplication).
- error_
kind_ name - Return a short category name for a
ParseErrorKind. - error_
line - Return the 1-indexed line number from a
ParseError. - error_
line_ ext2 - Returns the line number of a located error.
- error_
source_ text - Extract the source text covered by the error span.
- error_
start - Return the byte start offset from a
ParseError. - error_
to_ json - Produce a compact JSON-compatible representation of a
ParseError. - errors_
have_ same_ message - Checks if two errors have the same message after normalisation.
- errors_
to_ json - Export all errors in a
ParseErrorsas a JSON array string. - expand_
span - Expand the span of an error by
nbytes on both sides (clamped to source bounds). - extract_
context - Extract context lines around a given line number from source.
- format_
annotated_ source - Format source text with annotated spans underlined.
- format_
caret_ range - Formats an error range as a caret string (e.g., “ ^^^“).
- format_
expected - Format a list of expected token descriptions as a human-readable string.
- format_
gnu_ errors - Formats a sequence of errors in GNU style (file:line:col: message).
- is_
duplicate_ error - Return
trueif the error kind is a duplicate declaration. - is_
recoverable - Return
trueif the error is likely recoverable (parser can continue). - is_
syntax_ error - Return
trueif the error kind is an invalid syntax error. - latest_
error - Return the error with the latest position.
- numbered_
error_ list - Format a list of errors as a numbered list.
- other_
error - Convenience: wrap any string into an
Otherparse error. - parse_
location - Parse a source location from a “line:col” string.
- partition_
by_ line - Partitions errors by line number.
- pattern_
error - Convenience: create an
InvalidPatternerror. - recovery_
hints - Generate recovery hints for common parse errors.
- render_
diagnostics - Render a collection of diagnostics as a multi-line string.
- sort_
errors - Sort errors by their span start position.
- span_
is_ empty - Check if an error’s span is empty (zero-length).
- span_
len - Return the length (in bytes) of the span.
- suggest_
correction - Suggest a correction for a common typo in keywords.
- syntax_
error - Convenience: create an
InvalidSyntaxerror at the given location. - total_
span - Returns the total byte span covered by a list of errors.
- truncate_
source - Truncate source text to at most
max_lenchars, appending…if needed. - underline_
span - Return a string that underlines the span within its line.
- universe_
error - Convenience: create an
InvalidUniverseerror. - widest_
error - Returns the error with the widest span.