Skip to content

Commit

Permalink
Reorganize variables and scoping test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiraldez committed Jul 25, 2024
1 parent 200c17b commit 5df7d9e
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 122 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library Test {
enum Choice { Yes, No }
// ^def:1

function test() public pure {
(int x, int y) = (1, 2);
// ^def:5
// ^def:4
(int z, , int w) = (1, 2, 3);
// ^def:7
// ^def:6
assert(x == z);
// ^ref:6
// ^ref:4
assert(y < w);
// ^ref:7
// ^ref:5
(, Choice c) = (Choice.Yes, Choice.No);
// ^def:8
// ^ref:1

assert(c == Choice.No);
// ^ref:8
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

References and definitions:
╭─[crates/solidity/testing/snapshots/bindings_output/lexical/local_vars/input.sol:1:1]
╭─[crates/solidity/testing/snapshots/bindings_output/variables/local_vars/input.sol:1:1]
1 │ contract Foo {
│ ─┬─
Expand All @@ -12,16 +12,12 @@ References and definitions:
3 │ uint x = 10;
│ ┬
│ ╰── def: 3
4 │ return x + 2;
│ ┬
│ ╰── ref: 3
7 │ function baz() returns (int) {
│ ─┬─
│ ╰─── def: 4
8 │ return w + x;
4 │ uint w = 2;
│ ┬
│ ╰── def: 4
5 │ return x + w;
│ ┬ ┬
│ ╰────── unresolved
│ ╰────── ref: 3
│ │
│ ╰── unresolved
│ ╰── ref: 4
───╯
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contract Foo {
function bar() returns (uint) {
uint x = 10;
uint w = 2;
return x + w;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

References and definitions:
╭─[crates/solidity/testing/snapshots/bindings_output/variables/params/input.sol:1:1]
1 │ contract Foo {
│ ─┬─
│ ╰─── def: 1
2 │ function bar(uint z) returns (uint) {
│ ─┬─ ┬
│ ╰────────── def: 2
│ │
│ ╰── def: 3
3 │ return z + 1;
│ ┬
│ ╰── ref: 3
6 │ function baz(int x, int y) returns (int) {
│ ─┬─ ┬ ┬
│ ╰──────────────── def: 4
│ │ │
│ ╰───────── def: 5
│ │
│ ╰── def: 6
7 │ return x + y;
│ ┬ ┬
│ ╰────── ref: 5
│ │
│ ╰── ref: 6
10 │ function quux(int x, int y) returns (int z) {
│ ──┬─ ┬ ┬ ┬
│ ╰──────────────────────────────── def: 7
│ │ │ │
│ ╰───────────────────────── def: 8
│ │ │
│ ╰────────────────── def: 9
│ │
│ ╰── def: 10
11 │ z = x + y;
│ ┬ ┬ ┬
│ ╰────────── ref: 10
│ │ │
│ ╰────── ref: 8
│ │
│ ╰── ref: 9
────╯
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
contract Foo {
function bar(uint z) returns (uint) {
return z + 1;
}

function baz(int x, int y) returns (int) {
return x + y;
}

function quux(int x, int y) returns (int z) {
z = x + y;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

References and definitions:
╭─[crates/solidity/testing/snapshots/bindings_output/variables/state_vars/input.sol:1:1]
1 │ contract Foo {
│ ─┬─
│ ╰─── def: 1
2 │ uint x;
│ ┬
│ ╰── def: 2
4 │ function bar() returns (uint) {
│ ─┬─
│ ╰─── def: 3
5 │ return x;
│ ┬
│ ╰── ref: 2
───╯
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contract Foo {
uint x;

function bar() returns (uint) {
return x;
}
}

0 comments on commit 5df7d9e

Please sign in to comment.