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 emit statements and basic event definitions
- Loading branch information
Showing
9 changed files
with
206 additions
and
2 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
47 changes: 47 additions & 0 deletions
47
...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.
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
5 changes: 5 additions & 0 deletions
5
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.
23 changes: 23 additions & 0 deletions
23
crates/solidity/testing/snapshots/bindings_assertions/control/emit_event.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,23 @@ | ||
contract Test { | ||
event TestEvent(int id); | ||
// ^def:1 | ||
|
||
function test_emit() public { | ||
int x = 1; | ||
// ^def:2 | ||
|
||
emit TestEvent(x); | ||
// ^ref:2 (>= 0.4.21) | ||
// ^ref:1 (>= 0.4.21) | ||
emit Utils.Debug(x); | ||
// ^ref:2 (>= 0.4.21) | ||
// ^ref:4 (>= 0.4.21) | ||
// ^ref:3 (>= 0.4.21) | ||
} | ||
} | ||
|
||
library Utils { | ||
// ^def:3 | ||
event Debug(int subject); | ||
// ^def:4 | ||
} |
33 changes: 33 additions & 0 deletions
33
...olidity/testing/snapshots/bindings_output/control/emit_event/generated/0.4.11-failure.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,33 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Parse errors: | ||
Error: Expected Equal or Semicolon. | ||
╭─[input.sol:7:23] | ||
│ | ||
7 │ emit TestEvent(x); | ||
│ ─┬─ | ||
│ ╰─── Error occurred here. | ||
───╯ | ||
References and definitions: | ||
╭─[input.sol:1:1] | ||
│ | ||
1 │ contract Test { | ||
│ ──┬─ | ||
│ ╰─── def: 1 | ||
2 │ event TestEvent(int id); | ||
│ ────┬──── | ||
│ ╰────── def: 2 | ||
│ | ||
4 │ function test_emit() public { | ||
│ ────┬──── | ||
│ ╰────── def: 3 | ||
5 │ int x = 1; | ||
│ ┬ | ||
│ ╰── def: 4 | ||
│ | ||
7 │ emit TestEvent(x); | ||
│ ──┬─ ────┬──── | ||
│ ╰───────────── unresolved | ||
│ │ | ||
│ ╰────── def: 5 | ||
───╯ |
25 changes: 25 additions & 0 deletions
25
...olidity/testing/snapshots/bindings_output/control/emit_event/generated/0.4.21-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,25 @@ | ||
# 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 │ event TestEvent(int id); | ||
│ ────┬──── | ||
│ ╰────── def: 2 | ||
│ | ||
4 │ function test_emit() public { | ||
│ ────┬──── | ||
│ ╰────── def: 3 | ||
5 │ int x = 1; | ||
│ ┬ | ||
│ ╰── def: 4 | ||
│ | ||
7 │ emit TestEvent(x); | ||
│ ────┬──── ┬ | ||
│ ╰──────── ref: 2 | ||
│ │ | ||
│ ╰── ref: 4 | ||
───╯ |
9 changes: 9 additions & 0 deletions
9
crates/solidity/testing/snapshots/bindings_output/control/emit_event/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,9 @@ | ||
contract Test { | ||
event TestEvent(int id); | ||
|
||
function test_emit() public { | ||
int x = 1; | ||
|
||
emit TestEvent(x); | ||
} | ||
} |