mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
89 lines
1.8 KiB
Plaintext
89 lines
1.8 KiB
Plaintext
|
{
|
||
|
let x := 1
|
||
|
let y := 2
|
||
|
let a := 3
|
||
|
let b := 4
|
||
|
for {} 1 {} {
|
||
|
for {} 1 {} {
|
||
|
for {} 1 {} {
|
||
|
// Here, the nesting is not yet too deep, so the assignment
|
||
|
// should be removed.
|
||
|
for {} 1 { x := 9 } {
|
||
|
y := 10
|
||
|
for {} 1 {} {
|
||
|
for {} 1 {} {
|
||
|
// Now we are too deep, assignments stay.
|
||
|
for {} 1 { a := 10 } {
|
||
|
b := 12
|
||
|
b := 11
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
x := 13
|
||
|
}
|
||
|
// ====
|
||
|
// step: redundantAssignEliminator
|
||
|
// ----
|
||
|
// {
|
||
|
// let x := 1
|
||
|
// let y := 2
|
||
|
// let a := 3
|
||
|
// let b := 4
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// }
|
||
|
// {
|
||
|
// for {
|
||
|
// }
|
||
|
// 1
|
||
|
// {
|
||
|
// a := 10
|
||
|
// }
|
||
|
// {
|
||
|
// b := 12
|
||
|
// b := 11
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// }
|