Skip to content

Refactor AnnotatingVisitor to use dedicated visitor method for loop annotations#702

Draft
michaelos443 wants to merge 1 commit into
mainfrom
refactor-annotating-visitor
Draft

Refactor AnnotatingVisitor to use dedicated visitor method for loop annotations#702
michaelos443 wants to merge 1 commit into
mainfrom
refactor-annotating-visitor

Conversation

@michaelos443
Copy link
Copy Markdown
Collaborator

This PR refactors AnnotatingVisitor in vyper/vyper/ast/parse.py to replace the unreliable "fake_node" manipulation with a dedicated _parse_for_annotation method.

Changes:

  • Added AnnotatingVisitor._parse_for_annotation to cleanly construct python_ast.AnnAssign from pre-parser tokens.
  • Simplified visit_For to delegate annotation parsing.
  • Removed unused _deepcopy_ast helper and pickle import.
  • Ensured correct source location information is preserved for the synthesized AST nodes.

Validation:

  • All existing functional tests in tests/functional/syntax/test_for_range.py passed.
  • Full suite run confirmed 1416 passed, 1 xfailed (matching baseline).

Pull Request opened by Augment Code | View session

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 27, 2026

Deep Code Review Agent🐛

Started — view session to follow along.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 27, 2026

Deep Code Review Agent🐛

Started — view session to follow along.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

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