-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Implement Solidity AST printer #2165
Comments
What about just including the hash of the source code into the AST? |
May I know how this feature is going? I think this would be useful. I realize that there are some source code files look related. |
I think this is implemented already. The AST printer can be used via CLI argument like |
@axic could you clarify the meaning of this issue, please? |
It says it in the description:
|
@axic Did you mean being able to convert AST to Solidity source code? |
Yes. |
Any update here? I think this is very useful. |
Any updates? I am trying to do this. |
Reposting from #5802 (which has been closed as a duplicate):
|
@axic @chriseth Given that there are now tools that can do this, are we still planning to implement this? Also pinging @blitz-1306, who might be interested in this topic. |
Hello everyone. As I've been referenced here, I might share a few thoughts how this is done in solc-typed-ast. The most of the logic is concentrated in following directory: https://github.com/ConsenSys/solc-typed-ast/tree/master/src/ast/writing (mostly in Writing AST to source code is mostly trivial task, aside from few considerations:
For us, AST-to-source conversion been beneficial for the following reasons:
Ofc, I do not think that all of the points above are related to the current scope of "just writing source from an AST". My intention here is to share some experience and ideas, also indicate some caveats of the feature alongside with possible benefits. Regards. |
Pinging @cd1m0, who is actively developing Scribble at the moment (in case if there would be any additional input). |
This issue has been marked as stale due to inactivity for the last 90 days. |
Just seeing the stale notification here and will even manually close this, since we won't be doing this ourselves - however, in case this pops up for anyone, I recently had a call with Certora about them having released an open source tool that does just this even with potential AST mutations. Without spending much time on looking it up, this may have been it: https://github.com/Certora/gambit or a related repo there. |
This would take the internal AST structure and return a "Solidity source code output" which can be parsed by the parser.
This can also be used by the "import AST from JSON" feature (see #2096) to create the hash of the sourcecode that is part of the onchain metadata.
The text was updated successfully, but these errors were encountered: