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

Add Access like API for Elixir AST #97

Open
doorgan opened this issue Jun 27, 2023 · 0 comments
Open

Add Access like API for Elixir AST #97

doorgan opened this issue Jun 27, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@doorgan
Copy link
Owner

doorgan commented Jun 27, 2023

Functions like put_in or update_in are very useful to work with nested data, so naturally they'd be nice for Elixir AST.
Unfortunately, the Elixir AST is just tuples, and we can't implement Acesss for them.

Moreover, a hypothetical lens-like operation like update_in(ast, [:def, :function_name], &change_node_name/1) would crash with the Access semantic, as it would first find the def nodes, then crash if any of them doesn't have a function_name child.
So, our implementation needs to ignore the elements it can't match instead of crashing.

@doorgan doorgan added the enhancement New feature or request label Jun 27, 2023
@doorgan doorgan added this to the 0.13 milestone Jun 27, 2023
@doorgan doorgan self-assigned this Jun 27, 2023
@doorgan doorgan removed this from the 0.13 milestone Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant