typeprof 0.9.1 → 0.9.2
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/Gemfile.lock +1 -1
- data/lib/typeprof/analyzer.rb +24 -0
- data/lib/typeprof/config.rb +1 -1
- data/lib/typeprof/export.rb +2 -2
- data/lib/typeprof/version.rb +1 -1
- data/smoke/manual-rbs.rb +1 -1
- data/smoke/method_in_branch.rb +1 -1
- data/smoke/simple.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a881a8e59226faae21acac435131d5961c85ab6c95192ae1261329a87fb6e1
|
4
|
+
data.tar.gz: 8165e47acb1e8d9770922b2ac10487d18ff1b4fd1efa5d4ab8f6f0b11aa15433
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d0bc36fa68827aed7026cc7a52ca37b49d2c042bbaa32bffc9773afad296b81e27b5b4f97b31f24ff4030269f215034568175cae2c4a14bdc4bad8b502172f
|
7
|
+
data.tar.gz: 898d79a93ceae32f71b1c0fe0b9f2aa6a90477fbee58a582da91fe5e6f4e521062cb99549f8ae709d1f26f854a4b2765cdd455282fcdfa0ab9918c9015647ec9
|
data/Gemfile.lock
CHANGED
data/lib/typeprof/analyzer.rb
CHANGED
@@ -117,6 +117,30 @@ module TypeProf
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
class TopStaticEnv
|
121
|
+
include Utils::StructuralEquality
|
122
|
+
|
123
|
+
def recv_ty
|
124
|
+
Type.bot
|
125
|
+
end
|
126
|
+
|
127
|
+
def blk_ty
|
128
|
+
Type.nil
|
129
|
+
end
|
130
|
+
|
131
|
+
def mod_func
|
132
|
+
false
|
133
|
+
end
|
134
|
+
|
135
|
+
def pub_meth
|
136
|
+
true
|
137
|
+
end
|
138
|
+
|
139
|
+
def merge(other)
|
140
|
+
raise unless other.is_a?(TopStaticEnv)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
120
144
|
class Env
|
121
145
|
include Utils::StructuralEquality
|
122
146
|
|
data/lib/typeprof/config.rb
CHANGED
@@ -69,7 +69,7 @@ module TypeProf
|
|
69
69
|
|
70
70
|
prologue_ctx = Context.new(nil, nil, nil)
|
71
71
|
prologue_ep = ExecutionPoint.new(prologue_ctx, -1, nil)
|
72
|
-
prologue_env = Env.new(
|
72
|
+
prologue_env = Env.new(TopStaticEnv.new, [], [], Utils::HashWrapper.new({}))
|
73
73
|
|
74
74
|
Config.rb_files.each do |rb|
|
75
75
|
if rb.is_a?(Array) # [String name, String content]
|
data/lib/typeprof/export.rb
CHANGED
@@ -293,13 +293,13 @@ module TypeProf
|
|
293
293
|
first = false
|
294
294
|
end
|
295
295
|
class_data.explicit_methods.each do |method_name, sigs|
|
296
|
-
sigs = sigs.sort.join("\n" + indent + "#" + " " * (method_name.size +
|
296
|
+
sigs = sigs.sort.join("\n" + indent + "#" + " " * (method_name.size + 5) + "| ")
|
297
297
|
output.puts indent + "# def #{ method_name }: #{ sigs }"
|
298
298
|
first = false
|
299
299
|
end
|
300
300
|
prev_pub_meth = true
|
301
301
|
class_data.iseq_methods.each do |method_name, (pub_meth, sigs)|
|
302
|
-
sigs = sigs.sort.join("\n" + indent + " " * (method_name.size +
|
302
|
+
sigs = sigs.sort.join("\n" + indent + " " * (method_name.size + 6) + "| ")
|
303
303
|
if prev_pub_meth != pub_meth
|
304
304
|
output.puts indent + " #{ pub_meth ? "public" : "private" }"
|
305
305
|
prev_pub_meth = pub_meth
|
data/lib/typeprof/version.rb
CHANGED
data/smoke/manual-rbs.rb
CHANGED
data/smoke/method_in_branch.rb
CHANGED
data/smoke/simple.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typeprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Endoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -327,6 +327,7 @@ files:
|
|
327
327
|
- smoke/retry1.rb
|
328
328
|
- smoke/return.rb
|
329
329
|
- smoke/reveal.rb
|
330
|
+
- smoke/simple.rb
|
330
331
|
- smoke/singleton_class.rb
|
331
332
|
- smoke/singleton_method.rb
|
332
333
|
- smoke/step.rb
|
@@ -390,7 +391,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
391
|
- !ruby/object:Gem::Version
|
391
392
|
version: '0'
|
392
393
|
requirements: []
|
393
|
-
rubygems_version: 3.
|
394
|
+
rubygems_version: 3.2.0.rc.2
|
394
395
|
signing_key:
|
395
396
|
specification_version: 4
|
396
397
|
summary: TypeProf is a type analysis tool for Ruby code based on abstract interpretation
|