rbs 0.18.0 → 0.18.1
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/CHANGELOG.md +4 -0
- data/lib/rbs/environment_walker.rb +16 -10
- data/lib/rbs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e206f65853958ab46b6893d2c8b631676a82bd3eb62ea2f6f0f5c19bef2ce2a0
|
4
|
+
data.tar.gz: 502bdf2a7ccc7578b3cfe816cfcae57a84677e4da171204d82e5e8f7c9f71091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6665849050b6ef83c7d9d4f4fb32a712b96a5afb38bb236d7749f5e55bebc939ca08f04251ab1af482f2a090bd285d12ae421593076bcdc53fffedccb6e31d9e
|
7
|
+
data.tar.gz: ff18d27e825dfbddafba1f6b493fbeee50e47274fcf47fad33db55e69e4edc72f25ed9a24449217178ca3d279079f5a8216440080104f147d62e9bccc67926d7
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.18.1 (2020-12-01)
|
6
|
+
|
7
|
+
* Fix `EnvironmentWalker#each_type_name` ([#494](https://github.com/ruby/rbs/pull/494))
|
8
|
+
|
5
9
|
## 0.18.0 (2020-12-01)
|
6
10
|
|
7
11
|
* Signature updates for `YAML`, `ObjectSpace`, and `Singleton` ([#408](https://github.com/ruby/rbs/pull/408), [#477](https://github.com/ruby/rbs/pull/477), [#482](https://github.com/ruby/rbs/pull/482))
|
@@ -53,11 +53,11 @@ module RBS
|
|
53
53
|
definition = builder.build_interface(name)
|
54
54
|
unless only_ancestors?
|
55
55
|
definition.each_type do |type|
|
56
|
-
|
56
|
+
each_type_node type, &block
|
57
57
|
end
|
58
58
|
end
|
59
59
|
when name.alias?
|
60
|
-
|
60
|
+
each_type_node builder.expand_alias(name), &block
|
61
61
|
else
|
62
62
|
raise "Unexpected TypeNameNode with type_name=#{name}"
|
63
63
|
end
|
@@ -77,7 +77,7 @@ module RBS
|
|
77
77
|
|
78
78
|
unless only_ancestors?
|
79
79
|
ancestor.args.each do |type|
|
80
|
-
|
80
|
+
each_type_node type, &block
|
81
81
|
end
|
82
82
|
end
|
83
83
|
when Definition::Ancestor::Singleton
|
@@ -88,13 +88,19 @@ module RBS
|
|
88
88
|
|
89
89
|
unless only_ancestors?
|
90
90
|
definition.each_type do |type|
|
91
|
-
|
91
|
+
each_type_node type, &block
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
97
|
def each_type_name(type, &block)
|
98
|
+
each_type_node(type) do |node|
|
99
|
+
yield node.type_name
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def each_type_node(type, &block)
|
98
104
|
case type
|
99
105
|
when RBS::Types::Bases::Any
|
100
106
|
when RBS::Types::Bases::Class
|
@@ -111,30 +117,30 @@ module RBS
|
|
111
117
|
when RBS::Types::ClassInstance
|
112
118
|
yield InstanceNode.new(type_name: type.name)
|
113
119
|
type.args.each do |ty|
|
114
|
-
|
120
|
+
each_type_node(ty, &block)
|
115
121
|
end
|
116
122
|
when RBS::Types::Interface
|
117
123
|
yield TypeNameNode.new(type_name: type.name)
|
118
124
|
type.args.each do |ty|
|
119
|
-
|
125
|
+
each_type_node(ty, &block)
|
120
126
|
end
|
121
127
|
when RBS::Types::Alias
|
122
128
|
yield TypeNameNode.new(type_name: type.name)
|
123
129
|
when RBS::Types::Union, RBS::Types::Intersection, RBS::Types::Tuple
|
124
130
|
type.types.each do |ty|
|
125
|
-
|
131
|
+
each_type_node ty, &block
|
126
132
|
end
|
127
133
|
when RBS::Types::Optional
|
128
|
-
|
134
|
+
each_type_node type.type, &block
|
129
135
|
when RBS::Types::Literal
|
130
136
|
# nop
|
131
137
|
when RBS::Types::Record
|
132
138
|
type.fields.each_value do |ty|
|
133
|
-
|
139
|
+
each_type_node ty, &block
|
134
140
|
end
|
135
141
|
when RBS::Types::Proc
|
136
142
|
type.each_type do |ty|
|
137
|
-
|
143
|
+
each_type_node ty, &block
|
138
144
|
end
|
139
145
|
else
|
140
146
|
raise "Unexpected type given: #{type}"
|
data/lib/rbs/version.rb
CHANGED