forked from NomicFoundation/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Binding rules for while and do-while statements
- Loading branch information
Showing
8 changed files
with
152 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 37 additions & 3 deletions
40
...s/solidity/outputs/cargo/slang_solidity/src/generated/bindings/generated/binding_rules.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
crates/solidity/outputs/cargo/tests/src/bindings_assertions/generated/control.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
crates/solidity/outputs/cargo/tests/src/bindings_output/generated/control.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
crates/solidity/testing/snapshots/bindings_assertions/control/do_while.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
contract Test { | ||
function test() public returns (int) { | ||
int i = 1; | ||
// ^def:1 | ||
do { | ||
int odd = i % 2; | ||
// ^def:2 | ||
// ^ref:1 | ||
i *= 3; | ||
//<ref:1 | ||
} while (i < 100); | ||
// ^ref:1 | ||
return odd; | ||
// ^ref:! (>= 0.5.0) | ||
// ^ref:2 (< 0.5.0) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
crates/solidity/testing/snapshots/bindings_assertions/control/while_stmt.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
contract Test { | ||
function test() public returns (int) { | ||
int i = 1; | ||
// ^def:1 | ||
while (i < 100) { | ||
// ^ref:1 | ||
int odd = i % 2; | ||
// ^def:2 | ||
// ^ref:1 | ||
i *= 3; | ||
//<ref:1 | ||
} | ||
return odd; | ||
// ^ref:! (>= 0.5.0) | ||
// ^ref:2 (< 0.5.0) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...olidity/testing/snapshots/bindings_output/control/while_stmt/generated/0.4.11-success.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
References and definitions: | ||
╭─[input.sol:1:1] | ||
│ | ||
1 │ contract Test { | ||
│ ──┬─ | ||
│ ╰─── def: 1 | ||
2 │ function test() public { | ||
│ ──┬─ | ||
│ ╰─── def: 2 | ||
3 │ int i = 1; | ||
│ ┬ | ||
│ ╰── def: 3 | ||
4 │ while (i < 100) { | ||
│ ┬ | ||
│ ╰── ref: 3 | ||
5 │ i *= 3; | ||
│ ┬ | ||
│ ╰── ref: 3 | ||
───╯ |
8 changes: 8 additions & 0 deletions
8
crates/solidity/testing/snapshots/bindings_output/control/while_stmt/input.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
contract Test { | ||
function test() public { | ||
int i = 1; | ||
while (i < 100) { | ||
i *= 3; | ||
} | ||
} | ||
} |