-
Notifications
You must be signed in to change notification settings - Fork 56
Returning original node from visitor #36
Comments
@JisuPark hey! sorry about the late response. I'm not sure what you mean by the original code, but I am wary of exposing such implementation details to the public interface. I believe adding a Concrete Syntax Tree modeled after the JS one should be the way to go here, but any feedback is appreciated. |
@federicobond Thanks for the reply! Now I see your point. I thought current node arguments are too solid to develop a variety of visitor. When I wanted to extract only function declaration in the source, it was hard because I had to reassemble from the argument So I suggested such tweak since it might help developers to create such visitor easier. I think Concrete Syntax Tree can solve it easily. Thanks |
@JisuPark can you provide a piece of code of what you would like to achieve with this library? Better if it is in the form of a pull request with a failing test case. Let’s forget about the implementation for now and understand the API. |
The |
First of all, thank you for the awesome project!
I suggest enhancing transformAST to return not only the parsed one but also the original one.
Similar to Javaparser project, if we want to support
Transform
andGenerate
the solidity code, returning original node is essential.We could use the changed version to reconstruct specific granularity.
For example,
By the way, I'm still thinking about how to keep whitespace and newlines.
Could you give me some advice? (It may be related to #32)
The text was updated successfully, but these errors were encountered: