@@ -36,6 +36,12 @@ defmodule Refactorex.Dataflow do
3636 { id , _ , [ { :when , _ , [ header , body ] } ] } when id in ~w( defguard defguardp) a ->
3737 analyze_sealed_scope ( dataflow , header , body )
3838
39+ { :test , _ , [ _ , { :%{} , _ , setup } , scope ] } ->
40+ analyze_sealed_scope ( dataflow , setup , scope )
41+
42+ { :test , _ , [ _ | _ ] = scope } ->
43+ analyze_sealed_scope ( dataflow , scope )
44+
3945 { id , _ , [ condition , clauses ] } when id in ~w( if unless) a ->
4046 % __MODULE__ { }
4147 |> recursive_analyze ( condition )
@@ -55,10 +61,10 @@ defmodule Refactorex.Dataflow do
5561 |> recursive_analyze ( catches )
5662 |> close_scope ( dataflow )
5763
58- { :case , _ , expression_and_clauses } ->
64+ { :case , _ , [ _ | _ ] = expression_and_clauses } ->
5965 analyze_compound_scope ( dataflow , expression_and_clauses , [ ] )
6066
61- { :with , _ , children } ->
67+ { :with , _ , [ _ | _ ] = children } ->
6268 {
6369 statements ,
6470 [ [ body | catches ] ]
@@ -68,19 +74,13 @@ defmodule Refactorex.Dataflow do
6874 |> analyze_compound_scope ( statements , body )
6975 |> recursive_analyze ( catches )
7076
71- { :for , _ , children } ->
77+ { :for , _ , [ _ | _ ] = children } ->
7278 { statements , body } = Enum . split_while ( children , & match? ( { _ , _ , _ } , & 1 ) )
7379 analyze_compound_scope ( dataflow , statements , body )
7480
7581 { { :__block__ , _ , [ :do ] } , block } ->
7682 analyze_scope ( dataflow , block )
7783
78- { :test , _ , [ _ , { :%{} , _ , setup } , scope ] } ->
79- analyze_sealed_scope ( dataflow , setup , scope )
80-
81- { :test , _ , scope } ->
82- analyze_sealed_scope ( dataflow , scope )
83-
8484 { :-> , _ , [ [ { :when , _ , [ left , guard ] } ] , right ] } ->
8585 analyze_scope ( dataflow , left , [ guard , right ] )
8686
0 commit comments