Skip to content

Error propagation handling#16

Merged
lefticus merged 8 commits intodevelopfrom
error_propagation_handling
Mar 26, 2026
Merged

Error propagation handling#16
lefticus merged 8 commits intodevelopfrom
error_propagation_handling

Conversation

@lefticus
Copy link
Copy Markdown
Owner

No description provided.

lefticus and others added 8 commits March 25, 2026 17:20
Tests verify that SmallVector container overflows (values, strings,
object_scratch) return Error SExprs instead of silently corrupting data.
Currently these tests crash/fail, proving the need for error propagation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add has_container_error() and make_container_error() to detect and report
when any SmallVector container enters error state. Check for overflow in
evaluate(), sequence(), and parse() so errors bubble up as Error SExprs
instead of causing silent data corruption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Distinguish between strings, values, scratch, and scope container
overflows so callers can identify which resource was exhausted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Test error propagation through nested expressions, if branches, let
bindings/body, cond results, begin, and eval. Test wrong arg counts for
error?, quote, if, and cons. Test that evaluate_to surfaces errors via
std::expected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the 5-state switch-based parser with sequential digit consumption
phases (sign, integer, fraction, exponent). Same functionality in roughly
35% less code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The nested get_if chains for converting between quoted representations
(list_type↔literal_list_type, identifier↔symbol) were repeated in car,
cons, and quote. Extract into two inverse helper functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
error_p was doing exactly what the generic make_type_predicate already
does: check param count, eval, check type, return bool. Eliminate the
dedicated function and reuse the existing template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lefticus lefticus merged commit 042f2e0 into develop Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant