jruby-parser 0.4 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jruby-parser.jar +0 -0
- data/lib/jruby-parser/version.rb +1 -1
- data/spec/jruby-parser/static_analysis_spec.rb +14 -1
- metadata +2 -2
data/lib/jruby-parser.jar
CHANGED
Binary file
|
data/lib/jruby-parser/version.rb
CHANGED
@@ -64,6 +64,14 @@ describe Parser do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
it "method: can parse an empty body method with unused param [#{v}]" do
|
68
|
+
parse("def foo(a)\nend").find_node(:defn) do |defn|
|
69
|
+
defn.args.get_normative_parameter_name_list(true).each do |parameter|
|
70
|
+
defn.is_parameter_used(parameter).should == false
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
67
75
|
it "method: Can detect simple parameter is used" do
|
68
76
|
parse("def foo(a); a; end").find_node(:defn) do |defn|
|
69
77
|
defn.args.get_normative_parameter_name_list(true).each do |parameter|
|
@@ -125,6 +133,12 @@ describe Parser do
|
|
125
133
|
end
|
126
134
|
end
|
127
135
|
|
136
|
+
it "block/iter: can parse an empty proc body with unused param [#{v}]" do
|
137
|
+
parse("proc do |a|\nend").find_node(:iter) do |iter|
|
138
|
+
iter.is_parameter_used("a").should == false
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
128
142
|
it "block/iter: Can detect simple parameter is used" do
|
129
143
|
parse("proc { |a, b| a; b }").find_node(:iter) do |iter|
|
130
144
|
iter.is_parameter_used("a").should == true
|
@@ -166,6 +180,5 @@ describe Parser do
|
|
166
180
|
iter.is_parameter_used("b").should == true
|
167
181
|
end
|
168
182
|
end
|
169
|
-
|
170
183
|
end
|
171
184
|
end
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: jruby-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.4.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas E. Enebo
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Gem for syntactically correct parse trees of Ruby source
|
15
15
|
email: tom.enebo@gmail.com
|