typeprof 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/doc/doc.ja.md +5 -0
- data/doc/doc.md +9 -5
- data/lib/typeprof/analyzer.rb +97 -69
- data/lib/typeprof/builtin.rb +96 -92
- data/lib/typeprof/cli.rb +42 -4
- data/lib/typeprof/export.rb +36 -20
- data/lib/typeprof/import.rb +406 -365
- data/lib/typeprof/iseq.rb +1 -1
- data/lib/typeprof/method.rb +34 -33
- data/lib/typeprof/type.rb +1 -4
- data/run.sh +1 -1
- data/smoke/block13.rb +9 -0
- data/smoke/block13.rbs +3 -0
- data/smoke/class.rb +2 -0
- data/smoke/constant1.rb +3 -0
- data/smoke/demo5.rb +3 -0
- data/smoke/gvar.rb +1 -1
- data/smoke/gvar2.rb +17 -0
- data/smoke/gvar2.rbs +1 -0
- data/smoke/inheritance2.rb +6 -0
- data/smoke/ivar3.rb +16 -0
- data/smoke/ivar3.rbs +3 -0
- data/smoke/manual-rbs2.rb +1 -1
- data/smoke/manual-rbs3.rb +12 -0
- data/smoke/manual-rbs3.rbs +3 -0
- data/smoke/module4.rb +3 -0
- data/smoke/multiple-superclass.rb +8 -0
- data/smoke/rbs-alias.rb +9 -0
- data/smoke/rbs-alias.rbs +4 -0
- data/smoke/rbs-attr.rb +26 -0
- data/smoke/rbs-attr.rbs +5 -0
- data/smoke/rbs-vars.rb +39 -0
- data/smoke/rbs-vars.rbs +7 -0
- data/smoke/struct.rb +3 -0
- data/smoke/super1.rb +18 -0
- data/smoke/union-recv.rb +6 -0
- data/tools/setup-insns-def.rb +1 -1
- data/tools/stackprof-wrapper.rb +1 -1
- data/typeprof.gemspec +10 -4
- metadata +26 -7
data/tools/setup-insns-def.rb
CHANGED
@@ -26,5 +26,5 @@ File.read(ARGV[0]).scan(r) do
|
|
26
26
|
end
|
27
27
|
INSN_TABLE[name.to_sym] = operands
|
28
28
|
end
|
29
|
-
target = File.join(__dir__, "../lib/
|
29
|
+
target = File.join(__dir__, "../lib/typeprof/insns-def.rb")
|
30
30
|
File.write(target, "TypeProf::INSN_TABLE = " + INSN_TABLE.pretty_inspect)
|
data/tools/stackprof-wrapper.rb
CHANGED
data/typeprof.gemspec
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "typeprof" # temporal
|
3
|
-
spec.version = "0.
|
3
|
+
spec.version = "0.2.0"
|
4
4
|
spec.authors = ["Yusuke Endoh"]
|
5
5
|
spec.email = ["mame@ruby-lang.org"]
|
6
6
|
|
7
7
|
spec.summary = %q{TypeProf is a type analysis tool for Ruby code based on abstract interpretation}
|
8
|
-
spec.description =
|
9
|
-
|
8
|
+
spec.description = <<~EOD
|
9
|
+
TypeProf performs a type analysis of non-annotated Ruby code.
|
10
|
+
|
11
|
+
It abstractly executes input Ruby code in a level of types instead of values, gathers what types are passed to and returned by methods, and prints the analysis result in RBS format, a standard type description format for Ruby 3.0.
|
12
|
+
|
13
|
+
This tool is planned to be bundled with Ruby 3.0.
|
14
|
+
EOD
|
15
|
+
spec.homepage = "https://github.com/ruby/typeprof"
|
10
16
|
spec.license = "MIT"
|
11
17
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7")
|
12
18
|
|
@@ -22,5 +28,5 @@ Gem::Specification.new do |spec|
|
|
22
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
29
|
spec.require_paths = ["lib"]
|
24
30
|
|
25
|
-
spec.add_runtime_dependency "rbs", ">= 0.
|
31
|
+
spec.add_runtime_dependency "rbs", ">= 0.14.0"
|
26
32
|
end
|
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.
|
4
|
+
version: 0.2.0
|
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-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -16,15 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.14.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
27
|
-
description:
|
26
|
+
version: 0.14.0
|
27
|
+
description: |
|
28
|
+
TypeProf performs a type analysis of non-annotated Ruby code.
|
29
|
+
|
30
|
+
It abstractly executes input Ruby code in a level of types instead of values, gathers what types are passed to and returned by methods, and prints the analysis result in RBS format, a standard type description format for Ruby 3.0.
|
31
|
+
|
32
|
+
This tool is planned to be bundled with Ruby 3.0.
|
28
33
|
email:
|
29
34
|
- mame@ruby-lang.org
|
30
35
|
executables:
|
@@ -95,6 +100,8 @@ files:
|
|
95
100
|
- smoke/block10.rb
|
96
101
|
- smoke/block11.rb
|
97
102
|
- smoke/block12.rb
|
103
|
+
- smoke/block13.rb
|
104
|
+
- smoke/block13.rbs
|
98
105
|
- smoke/block2.rb
|
99
106
|
- smoke/block3.rb
|
100
107
|
- smoke/block4.rb
|
@@ -150,6 +157,8 @@ files:
|
|
150
157
|
- smoke/freeze.rb
|
151
158
|
- smoke/function.rb
|
152
159
|
- smoke/gvar.rb
|
160
|
+
- smoke/gvar2.rb
|
161
|
+
- smoke/gvar2.rbs
|
153
162
|
- smoke/hash-fetch.rb
|
154
163
|
- smoke/hash1.rb
|
155
164
|
- smoke/hash2.rb
|
@@ -164,6 +173,8 @@ files:
|
|
164
173
|
- smoke/integer.rb
|
165
174
|
- smoke/ivar.rb
|
166
175
|
- smoke/ivar2.rb
|
176
|
+
- smoke/ivar3.rb
|
177
|
+
- smoke/ivar3.rbs
|
167
178
|
- smoke/kernel-class.rb
|
168
179
|
- smoke/keyword1.rb
|
169
180
|
- smoke/keyword2.rb
|
@@ -176,6 +187,8 @@ files:
|
|
176
187
|
- smoke/manual-rbs.rbs
|
177
188
|
- smoke/manual-rbs2.rb
|
178
189
|
- smoke/manual-rbs2.rbs
|
190
|
+
- smoke/manual-rbs3.rb
|
191
|
+
- smoke/manual-rbs3.rbs
|
179
192
|
- smoke/masgn1.rb
|
180
193
|
- smoke/masgn2.rb
|
181
194
|
- smoke/masgn3.rb
|
@@ -203,6 +216,12 @@ files:
|
|
203
216
|
- smoke/proc3.rb
|
204
217
|
- smoke/proc4.rb
|
205
218
|
- smoke/range.rb
|
219
|
+
- smoke/rbs-alias.rb
|
220
|
+
- smoke/rbs-alias.rbs
|
221
|
+
- smoke/rbs-attr.rb
|
222
|
+
- smoke/rbs-attr.rbs
|
223
|
+
- smoke/rbs-vars.rb
|
224
|
+
- smoke/rbs-vars.rbs
|
206
225
|
- smoke/redo1.rb
|
207
226
|
- smoke/redo2.rb
|
208
227
|
- smoke/req-keyword.rb
|
@@ -247,11 +266,11 @@ files:
|
|
247
266
|
- tools/setup-insns-def.rb
|
248
267
|
- tools/stackprof-wrapper.rb
|
249
268
|
- typeprof.gemspec
|
250
|
-
homepage: https://github.com/
|
269
|
+
homepage: https://github.com/ruby/typeprof
|
251
270
|
licenses:
|
252
271
|
- MIT
|
253
272
|
metadata:
|
254
|
-
homepage_uri: https://github.com/
|
273
|
+
homepage_uri: https://github.com/ruby/typeprof
|
255
274
|
source_code_uri: https://github.com/ruby/typeprof
|
256
275
|
post_install_message:
|
257
276
|
rdoc_options: []
|