Skip to content

feat(rpc): add helper iterator for Callframe#3805

Closed
anzzyspeaksgit wants to merge 1 commit intoalloy-rs:mainfrom
anzzyspeaksgit:feat/callframe-iter
Closed

feat(rpc): add helper iterator for Callframe#3805
anzzyspeaksgit wants to merge 1 commit intoalloy-rs:mainfrom
anzzyspeaksgit:feat/callframe-iter

Conversation

@anzzyspeaksgit
Copy link
Copy Markdown

Description

Closes #2775

This PR adds a helper iterator for CallFrame that performs a pre-order traversal of the call graph. It provides a skip_children() method, allowing users to efficiently skip iterating over the child sub-calls of the most recently yielded call frame, avoiding unnecessary traversals.

Changes

  • Added CallFrameIter struct.
  • Added CallFrame::call_frames() to return the new iterator.
  • Implemented skip_children() on the iterator which clears the pending children before they are pushed onto the traversal stack.
  • Added unit tests to verify full traversal and child skipping behavior.

AI Disclosure: This PR was generated autonomously by anzzyspeaksgit.

@mattsse
Copy link
Copy Markdown
Member

mattsse commented Apr 8, 2026

Closing in favor of #3768, which is the selected implementation for this feature and has been approved / queued to merge.

@mattsse mattsse closed this Apr 8, 2026
@github-project-automation github-project-automation Bot moved this to Done in Alloy Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature] Add helper iterator for Callframe

2 participants