-
Notifications
You must be signed in to change notification settings - Fork 413
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
Write functions to give Dune_file.Stanzas.t from ASTs #1972
Comments
I would be happy to take this on, as it will help me prepare for expanding |
Isn't it basically |
Lines 426 to 431 in d7274c2
That is implemented on top of To recap the context of #1448 (comment): The use case is one where we have synthesized an After looking at the code a bit more, I suspect the desired function can be derived from a bit of refactoring of @diml Do you think the added context helps justify the need? Or, alternatively, do you have a preferred alternative for meeting the use case? |
Thanks for the recap. To be clear, the One more question though: are you planning to implement field updates using the following pipeline: |
Thanks for correcting my misunderstanding, @diml. This is a big help. I actually added a documentation comment in #1448, but it is apparently in need of correction due to my misunderstanding. I'll fix that. While correcting the documentation, I'll move to make the file argument optional: this will help formalize its role. |
The plan for this isn't finalized, but it is complicated by the fact that we should be be able to update user-written dune files, which means we need to preserve comments. I am therefore anticipating working through a pipeline |
Ok, that should work. Though depending on what kind of edits you want to do, it might be just as easy to do them on the Ast directly without parsing it. BTW, this is the pipeline I implemented in
|
Super helpful, @diml. Thank you! |
The need for this came up in discussion around #1448 in #1448 (comment).
I expect we'll want a function
Dune_File.Stanzas.of_ast
, likely implemented on top of aDune_File.Stanza.of_ast
.The text was updated successfully, but these errors were encountered: