Skip to content
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

Design functions to fold through statements and expressions #1148

Open
jubnzv opened this issue Aug 17, 2022 · 2 comments
Open

Design functions to fold through statements and expressions #1148

jubnzv opened this issue Aug 17, 2022 · 2 comments
Assignees
Labels
Milestone

Comments

@jubnzv
Copy link
Contributor

jubnzv commented Aug 17, 2022

Folding through nested statements and expressions is a common pattern used almost in every static analysis.

However, this pattern is too verbose and error-prone, because a developer could forget to handle nested statements or expressions for some nodes.

We should create generic functions fold_over_stmts and fold_over_exprs in the ContractUtil.ml in the same way as fold_over_messages is implemented. These function should look into nested statements and expressions and accumulate the information as it is implemented in the argument function ~f.

@anton-trunov anton-trunov added the enhancement New feature or request label Aug 18, 2022
@anton-trunov anton-trunov added this to the Scilla 0.13.0 milestone Aug 18, 2022
@anton-trunov
Copy link
Contributor

Related issue: #438

@anton-trunov
Copy link
Contributor

Related: we now have an annotation mapper in https://github.com/Zilliqa/scilla/blob/master/src/base/SyntaxAnnotMapper.ml.

@jubnzv jubnzv self-assigned this Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants