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

feat(ast_codegen): add #[visit(enter_before)] hint. #4147

Conversation

rzvxa
Copy link
Contributor

@rzvxa rzvxa commented Jul 9, 2024

Closes #4142

I can split it into 2 PRs but it seems pointless. Let me know if you guys disagree with me.

Copy link

graphite-app bot commented Jul 9, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-ast Area - AST label Jul 9, 2024
Copy link
Contributor Author

rzvxa commented Jul 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rzvxa and the rest of your teammates on Graphite Graphite

@rzvxa rzvxa requested review from Dunqing and Boshen July 9, 2024 19:52
@rzvxa rzvxa marked this pull request as ready for review July 9, 2024 19:53
Copy link

codspeed-hq bot commented Jul 9, 2024

CodSpeed Performance Report

Merging #4147 will not alter performance

Comparing 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events (3ba7cfe) with main (725571a)

Summary

✅ 29 untouched benchmarks

@overlookmotel
Copy link
Contributor

Please see #4142 (comment). I'm not clear why this change is required.

@rzvxa
Copy link
Contributor Author

rzvxa commented Jul 10, 2024

Please see #4142 (comment). I'm not clear why this change is required.

I just saw your comment, Even with that it is a good thing to have the visit(enter_before) marker just in case we need it in the future. I can just remove the marker from Class and merge the generator code.

@Boshen
Copy link
Member

Boshen commented Jul 10, 2024

@Dunqing do you know about the semantic details here?

@rzvxa rzvxa force-pushed the 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events branch from 163f302 to 9abe2d8 Compare July 10, 2024 02:37
@Dunqing
Copy link
Member

Dunqing commented Jul 10, 2024

@Dunqing do you know about the semantic details here?

#4142 (comment)

@Dunqing
Copy link
Member

Dunqing commented Jul 10, 2024

I just saw your comment, Even with that it is a good thing to have the visit(enter_before) marker just in case we need it in the future. I can just remove the marker from Class and merge the generator code.

Yes, I think we can keep the visit(enter_before) marker for now. It may be useful for reimplementing the adding scope and resolving references.

@overlookmotel
Copy link
Contributor

Personally, I don't think we should ever enter the node late. It is just confusing, and I can't see a use case.

If you want to avoid throwing away the generator code you already wrote, by all means merge it in, but would you consider "deactivating" visit(enter_before), so we don't start using it kind of by accident without discussing first?

@rzvxa
Copy link
Contributor Author

rzvxa commented Jul 10, 2024

I'll generate an error on encountering it for now.

@rzvxa rzvxa force-pushed the 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events branch from 9abe2d8 to a792c3f Compare July 10, 2024 13:44
@rzvxa rzvxa changed the title fix(ast, ast_codegen): visit decorators in Class before node events. feat(ast_codegen): add #[visit(enter_before)] hint. Jul 10, 2024
@rzvxa rzvxa force-pushed the 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events branch from 81cb539 to ee42fed Compare July 10, 2024 13:57
@rzvxa rzvxa added the 0-merge Merge with Graphite Merge Queue label Jul 10, 2024
Copy link

graphite-app bot commented Jul 10, 2024

Merge activity

  • Jul 10, 9:59 AM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 10, 10:01 AM EDT: rzvxa added this pull request to the Graphite merge queue.
  • Jul 10, 10:06 AM EDT: rzvxa merged this pull request with the Graphite merge queue.

@rzvxa rzvxa removed the A-ast Area - AST label Jul 10, 2024
Closes #4142

I can split it into 2 PRs but it seems pointless. Let me know if you guys disagree with me.
@rzvxa rzvxa force-pushed the 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events branch from ee42fed to 3ba7cfe Compare July 10, 2024 14:02
@graphite-app graphite-app bot merged commit 3ba7cfe into main Jul 10, 2024
26 checks passed
@graphite-app graphite-app bot deleted the 07-09-fix_ast_ast_codegen_visit_decorators_in_class_before_node_events branch July 10, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

must visit decorators before enter_node and enter_scope if have decorators field
4 participants