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

Return ControlFlow from AST visitor methods #14

Open
DaniPopes opened this issue Jun 6, 2024 · 1 comment · May be fixed by #115
Open

Return ControlFlow from AST visitor methods #14

DaniPopes opened this issue Jun 6, 2024 · 1 comment · May be fixed by #115
Assignees
Labels
A-parser Area: parsing source code to an AST C-enhancement Category: an issue proposing an enhancement or a PR with one E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. P-medium Medium priority

Comments

@DaniPopes
Copy link
Member

Currently AST visitors do not return anything, whereas it would be beneficial to return a ControlFlow value, with the associated break type defined by implementors. By default, all functions should always return Continue(()), and implementors may choose to break early.

https://github.com/paradigmxyz/sulk/blob/5f827dd5a0fed12f8e57c48ac60e371b98d921a3/crates/ast/src/visit.rs#L7-L10

@DaniPopes DaniPopes added C-enhancement Category: an issue proposing an enhancement or a PR with one A-parser Area: parsing source code to an AST and removed enhancement labels Jul 6, 2024
@DaniPopes DaniPopes added P-high High priority P-medium Medium priority E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. and removed P-high High priority labels Jul 6, 2024
@mahmudsudo
Copy link

Hi can I take on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: parsing source code to an AST C-enhancement Category: an issue proposing an enhancement or a PR with one E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. P-medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants