-
Notifications
You must be signed in to change notification settings - Fork 139
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 documentation for JSON AST #2343
Comments
Could you please describe what kind of documentation you need for the package? You can see an example usage in the tests: https://github.com/onflow/cadence/blob/master/npm-packages/cadence-parser/tests/index.test.ts#L5-L7 |
ok, my statement may not be very clear, I mean a doc like https://solidity-ast.netlify.app/ Perhaps the type of ast is more accurate! |
I see, thanks for clarifying. We do not have documentation for the JSON encoding of the AST element types yet, but you can maybe just look at the Go type definitions for now, they should be fairly self-explanatory. You can find all AST element type definitions in the cadence/runtime/ast/expression.go Lines 1204 to 1208 in bd4d65b
All element types have a MarshalJSON function that implements how the element is encoded to JSON, e.g.: cadence/runtime/ast/expression.go Lines 1292 to 1303 in bd4d65b
|
In addition, we have an AST explorer tool that lets you write Cadence code and inspect the AST: https://github.com/onflow/cadence/tree/master/tools/astexplorer |
Issue to be solved
Add doc for cadence-parser
Suggested Solution
No response
The text was updated successfully, but these errors were encountered: