Skip to content

Commit

Permalink
Removed special FindBlockArgumentAssignmet visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperosterbye committed Dec 10, 2019
1 parent 918098d commit 86dbff1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 78 deletions.
76 changes: 0 additions & 76 deletions src/AST-Core/RBFindBlockArgumentAssignment.class.st

This file was deleted.

7 changes: 5 additions & 2 deletions src/GeneralRules/RBAssignmentOnBlockArgumentRule.class.st
@@ -1,12 +1,14 @@
"
Check for assignments on block arguments.
Check for assignments on method and block arguments.
For example:
[:x :y|
x:= x+y.
]
The block argument ""x"" should not be written. This is considered bad style. And some compiler may reject that code.
Same for method arguments, you should not write those either.
"
Class {
#name : #RBAssignmentOnBlockArgumentRule,
Expand All @@ -29,7 +31,8 @@ RBAssignmentOnBlockArgumentRule class >> uniqueIdentifierName [
{ #category : #running }
RBAssignmentOnBlockArgumentRule >> check: aMethod forCritiquesDo: aCriticBlock [
| problemAssignments|
problemAssignments := RBFindBlockArgumentAssignment collectAssignments: aMethod ast.
problemAssignments := aMethod ast assignmentNodes
select: [ :assignment | assignment variable isArg].

problemAssignments do: [ :assignment |
aCriticBlock cull: (ReTrivialCritique
Expand Down

0 comments on commit 86dbff1

Please sign in to comment.