Commit Graph

5 Commits

Author SHA1 Message Date
Sijawusz Pur Rahnama 57898fd797 Make `BranchVisitor` treat `loop { … }` calls as branchable 2023-12-28 15:31:11 +01:00
Sijawusz Pur Rahnama 8112dddc8f Specs cleanup 2022-12-20 03:25:06 +01:00
Vitalii Elenhaupt 9885457227
Track issue.end_location properly 2018-11-24 19:38:13 +02:00
Vitalii Elenhaupt eab5499f8e
Add a workaround for https://github.com/crystal-lang/crystal/pull/6032 2018-05-08 22:18:15 +03:00
V. Elenhaupt 6475c2bb25
Variable scope & useless assignments (#41)
* AST::Visitor -> AST::NodeVisitor

* Scope & ScopeVisitor

* Useless assignment rule

* Instance vars and useless assignments

* Multiple assigns one by one

* Support outer scope

* Variable used in the useless assignment

* Support OpAssign & MultiAssign

* Captured by block

* Variable, Assignment, Reference & Refactoring

* Variable has references, Assignment can be referenced

* Branch entity

* Handle useless assignments in branches

* Handle assignments in a loop

* Handle branch equality

* Handle special var `$?` assignment

* Improve captured by block stuff

* Avoid assignments in property definitions

(UselessAssign rule reports an warning)

* Support MacroIf and MacroFor branches

* Handle assignments with shadowed vars in inner scopes

* Add method arguments as scope variables

* Handle case if branch is blank

* Top level scope

* Handle case when branch is nop?
2018-05-03 18:57:47 +03:00