Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RuleVisitor._resolve_refs #34

Merged
merged 1 commit into from Jul 12, 2014

Conversation

keleshev
Copy link
Contributor

When resolving circular references it is necessary to avoid infinite
recursion. Previously this was done by tracking unwalked_names and
walking_names. Now infinite recursion is prevented by setting
expr.members to None while recursively resolving member expressions.

When resolving circular references it is necessary to avoid infinite
recursion.  Previously this was done by tracking unwalked_names and
walking_names.  Now infinite recursion is prevented by setting
expr.members to None while recursively resolving member expressions.
@keleshev
Copy link
Contributor Author

Any feedback on this one?

@erikrose
Copy link
Owner

Taking a look at this now before I mess with _resolve_refs to add support for custom rules.

@erikrose
Copy link
Owner

I love how much shorter it is! But do we guarantee hitting every rule? Yep, the gen expr loop around all the rules covers it. Why didn't I think of this? :-)

if expr.name:
unwalked_names.remove(expr.name)
original_members = getattr(expr, 'members', None)
if original_members is not None:
Copy link
Owner

Choose a reason for hiding this comment

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

Note to self: shorten to if original_members.

@erikrose erikrose merged commit 2d0101e into erikrose:master Jul 12, 2014
erikrose added a commit that referenced this pull request Jul 12, 2014
@keleshev
Copy link
Contributor Author

👍

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.

None yet

2 participants