You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to robustly parse Cadence, to do things such as understand which arguments are used in a transaction or script, we must include the ability to parse Cadence in FCL.
We must ensure the bundle size of FCL doesn't increase beyond a reasonable amount. To do so, we should consider if we can use a tool like pegjs or peggy to generate a parser on the client using a supplied Cadence grammar, rather than include the parser as part of the FCL bundle.
What are you currently working on that this is blocking?
We need this feature in order to complete the updated FCL query/mutate argument syntax: #1656
The text was updated successfully, but these errors were encountered:
A simple and effective way to reduce the size of the parser and making it more efficient for this use case (reduce memory consumption) could be to refactor the parser to not depend on the AST package (and transitively on the pretty printing package code and library as @bluesign pointed out), by changing the productions from allocations of AST nodes to interface callbacks.
In Cadence, the callbacks would perform the node creation as currently.
In the stripped down parser you would not have to allocate any nodes in the callbacks, except for function parameters (and that could be further filtered to just parameter lists you are interested in).
Issue to be solved
In order to robustly parse Cadence, to do things such as understand which arguments are used in a transaction or script, we must include the ability to parse Cadence in FCL.
Suggest A Solution
Investigate tooling such as:
See if there is a way to convert the Cadence grammar to PEG format: https://github.com/onflow/cadence/blob/master/docs/cadence.ebnf
We must ensure the bundle size of FCL doesn't increase beyond a reasonable amount. To do so, we should consider if we can use a tool like pegjs or peggy to generate a parser on the client using a supplied Cadence grammar, rather than include the parser as part of the FCL bundle.
What are you currently working on that this is blocking?
We need this feature in order to complete the updated FCL query/mutate argument syntax: #1656
The text was updated successfully, but these errors were encountered: