deep-cover 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/deep_cover/node/block.rb +7 -13
- data/lib/deep_cover/node/branch.rb +1 -1
- data/lib/deep_cover/node/send.rb +9 -4
- data/lib/deep_cover/node/short_circuit.rb +2 -2
- data/lib/deep_cover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef02156435418688aa0934036aa4273c3179468c
|
4
|
+
data.tar.gz: ba37d24e7cbf1e34f0fbd0db4f3f2720527825f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c209ce060a984b41dc8e454fccebb6d9911a464a1b76de267ccdd326e567b9af9e427c42e66f75007b7fd81cdb27d4bc5b513772cf2d0d0e11c98a8d152a164
|
7
|
+
data.tar.gz: 492ebdb2f56861e7b9d8d195cfdc2818568ff245e7e64c778d9062290785d420c31e43cb1cdcd2efbd204ef40141ba6e80d7d05e220250beba4bf88759b39a1d
|
@@ -15,20 +15,13 @@ module DeepCover
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
class SendWithBlock <
|
18
|
+
class SendWithBlock < SendBase
|
19
19
|
include WithBlock
|
20
|
-
|
21
|
-
has_child method_name: Symbol
|
22
|
-
has_extra_children arguments: Node
|
20
|
+
end
|
23
21
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
range = arguments.last.expression.with(begin_pos: loc_hash[:selector].end_pos)
|
28
|
-
rules.unshift [range, '(%{node})']
|
29
|
-
end
|
30
|
-
rules
|
31
|
-
end
|
22
|
+
class CsendWithBlock < Csend
|
23
|
+
include WithBlock
|
24
|
+
refine_child actual_send: {safe_send: SendWithBlock}
|
32
25
|
end
|
33
26
|
|
34
27
|
class SuperWithBlock < Node
|
@@ -39,7 +32,8 @@ module DeepCover
|
|
39
32
|
class Block < Node
|
40
33
|
check_completion
|
41
34
|
has_tracker :body
|
42
|
-
has_child call: {send: SendWithBlock,
|
35
|
+
has_child call: { send: SendWithBlock, csend: CsendWithBlock,
|
36
|
+
zsuper: SuperWithBlock, super: SuperWithBlock }
|
43
37
|
has_child args: Args
|
44
38
|
has_child body: Node,
|
45
39
|
can_be_empty: -> { base_node.loc.end.begin },
|
@@ -16,7 +16,7 @@ module DeepCover
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class TrivialBranch < Node::EmptyBody
|
19
|
-
def initialize(
|
19
|
+
def initialize(other_branch: raise, condition: raise, position: true)
|
20
20
|
@condition = condition
|
21
21
|
@other_branch = other_branch
|
22
22
|
super(nil, parent: condition.parent, position: position)
|
data/lib/deep_cover/node/send.rb
CHANGED
@@ -3,8 +3,7 @@ require_relative 'branch'
|
|
3
3
|
|
4
4
|
module DeepCover
|
5
5
|
class Node
|
6
|
-
class
|
7
|
-
check_completion
|
6
|
+
class SendBase < Node
|
8
7
|
has_child receiver: [Node, nil]
|
9
8
|
has_child message: Symbol
|
10
9
|
has_extra_children arguments: Node
|
@@ -52,6 +51,10 @@ module DeepCover
|
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
54
|
+
class Send < SendBase
|
55
|
+
check_completion
|
56
|
+
end
|
57
|
+
|
55
58
|
class Csend < Node
|
56
59
|
include Branch
|
57
60
|
has_tracker :conditional
|
@@ -69,7 +72,9 @@ module DeepCover
|
|
69
72
|
|
70
73
|
executed_loc_keys :dot
|
71
74
|
|
72
|
-
|
75
|
+
def execution_count
|
76
|
+
receiver.flow_completion_count
|
77
|
+
end
|
73
78
|
|
74
79
|
def message
|
75
80
|
actual_send.message
|
@@ -77,7 +82,7 @@ module DeepCover
|
|
77
82
|
|
78
83
|
def branches
|
79
84
|
[ actual_send,
|
80
|
-
TrivialBranch.new(receiver, actual_send)
|
85
|
+
TrivialBranch.new(condition: receiver, other_branch: actual_send)
|
81
86
|
]
|
82
87
|
end
|
83
88
|
end
|
@@ -5,14 +5,14 @@ module DeepCover
|
|
5
5
|
class ShortCircuit < Node
|
6
6
|
include Branch
|
7
7
|
has_tracker :conditional
|
8
|
-
has_child
|
8
|
+
has_child lhs: Node
|
9
9
|
has_child conditional: Node, flow_entry_count: :conditional_tracker_hits,
|
10
10
|
rewrite: '((%{conditional_tracker};%{node}))'
|
11
11
|
|
12
12
|
def branches
|
13
13
|
[
|
14
14
|
conditional,
|
15
|
-
TrivialBranch.new(
|
15
|
+
TrivialBranch.new(condition: lhs, other_branch: conditional)
|
16
16
|
]
|
17
17
|
end
|
18
18
|
end
|
data/lib/deep_cover/version.rb
CHANGED