-
Notifications
You must be signed in to change notification settings - Fork 20
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 binding rules for control statements #1076
Implement binding rules for control statements #1076
Conversation
|
crates/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Show resolved
Hide resolved
crates/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Outdated
Show resolved
Hide resolved
crates/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Outdated
Show resolved
Hide resolved
crates/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Outdated
Show resolved
Hide resolved
crates/solidity/testing/snapshots/bindings_assertions/control/do_while.sol
Show resolved
Hide resolved
...s/solidity/testing/snapshots/bindings_output/control/emit_event/generated/0.4.11-failure.txt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few questions. Thanks!
We're abandoning strict evaluation (which we were not using anyway) in favor of approachability and readability.
Also, count the number of skipped assertions (due to not fulfilling the version requirements)
This PR adds support in the binding rules for:
if
/else
statementsfor
loopswhile
anddo-while
loopsemit
statements and basic event definitionstry-catch
statementsrevert
and basic error definitionsunchecked
blocksIt also includes a reorganization of the rules file to improve readability and maintainability. Previously we were attempting to maintain compatibility with strict evaluation mode which meant that nodes and edges needed to be defined in previous rules. But since to build the stack graph the lazy evaluation mode is used anyway, this restriction can be dropped.
The file is now organized more or less hierarchically, with all the rules affecting a node and its descendants grouped together.