rbs 1.6.2 → 1.7.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +0 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -0
- data/Rakefile +7 -22
- data/core/kernel.rbs +4 -4
- data/core/trace_point.rbs +1 -1
- data/ext/rbs/extension/constants.c +140 -0
- data/ext/rbs/extension/constants.h +72 -0
- data/ext/rbs/extension/extconf.rb +3 -0
- data/ext/rbs/extension/lexer.c +1070 -0
- data/ext/rbs/extension/lexer.h +145 -0
- data/ext/rbs/extension/location.c +295 -0
- data/ext/rbs/extension/location.h +59 -0
- data/ext/rbs/extension/main.c +9 -0
- data/ext/rbs/extension/parser.c +2418 -0
- data/ext/rbs/extension/parser.h +23 -0
- data/ext/rbs/extension/parserstate.c +313 -0
- data/ext/rbs/extension/parserstate.h +141 -0
- data/ext/rbs/extension/rbs_extension.h +40 -0
- data/ext/rbs/extension/ruby_objs.c +585 -0
- data/ext/rbs/extension/ruby_objs.h +46 -0
- data/ext/rbs/extension/unescape.c +65 -0
- data/goodcheck.yml +1 -1
- data/lib/rbs/ast/comment.rb +0 -12
- data/lib/rbs/buffer.rb +4 -0
- data/lib/rbs/cli.rb +5 -8
- data/lib/rbs/collection/sources/git.rb +18 -3
- data/lib/rbs/errors.rb +14 -1
- data/lib/rbs/location.rb +221 -217
- data/lib/rbs/location_aux.rb +108 -0
- data/lib/rbs/locator.rb +10 -7
- data/lib/rbs/parser_aux.rb +24 -0
- data/lib/rbs/types.rb +2 -3
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +4 -2
- data/lib/rbs.rb +3 -7
- data/rbs.gemspec +2 -1
- data/sig/ancestor_builder.rbs +2 -2
- data/sig/annotation.rbs +2 -2
- data/sig/comment.rbs +7 -7
- data/sig/constant_table.rbs +1 -1
- data/sig/declarations.rbs +9 -9
- data/sig/definition.rbs +1 -1
- data/sig/definition_builder.rbs +2 -2
- data/sig/errors.rbs +30 -25
- data/sig/location.rbs +42 -79
- data/sig/locator.rbs +2 -2
- data/sig/members.rbs +7 -7
- data/sig/method_types.rbs +3 -3
- data/sig/parser.rbs +11 -21
- data/sig/types.rbs +45 -27
- data/sig/writer.rbs +1 -1
- data/stdlib/json/0/json.rbs +3 -3
- metadata +24 -6
- data/lib/rbs/parser.rb +0 -3614
data/sig/location.rbs
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
module RBS
|
2
2
|
# Location is the range on buffer, `start_pos..end_pos`.
|
3
3
|
# The index is based on characters.
|
4
|
-
|
4
|
+
#
|
5
|
+
# A location can have _child_ locations.
|
6
|
+
#
|
7
|
+
# ```
|
8
|
+
#
|
9
|
+
# ```
|
10
|
+
#
|
11
|
+
class Location[RequiredChildKeys, OptionalChildKeys]
|
5
12
|
# The buffer this location points on.
|
6
|
-
attr_reader buffer: Buffer
|
13
|
+
attr_reader buffer (): Buffer
|
7
14
|
|
8
15
|
# The index of character the range starts from.
|
9
|
-
attr_reader start_pos: Integer
|
16
|
+
attr_reader start_pos (): Integer
|
10
17
|
|
11
18
|
# The index of character the range ends at.
|
12
|
-
attr_reader end_pos: Integer
|
19
|
+
attr_reader end_pos (): Integer
|
13
20
|
|
14
|
-
def initialize: (
|
21
|
+
def initialize: (Buffer, Integer start_pos, Integer end_pos) -> void
|
15
22
|
|
16
23
|
def inspect: () -> String
|
17
24
|
|
@@ -19,22 +26,22 @@ module RBS
|
|
19
26
|
def name: () -> untyped
|
20
27
|
|
21
28
|
# Line of the `start_pos` (1 origin)
|
22
|
-
|
29
|
+
attr_reader start_line (): Integer
|
23
30
|
|
24
31
|
# Column of the `start_pos` (0 origin)
|
25
|
-
|
32
|
+
attr_reader start_column (): Integer
|
26
33
|
|
27
34
|
# Line of the `end_pos` (1 origin)
|
28
|
-
|
35
|
+
attr_reader end_line (): Integer
|
29
36
|
|
30
37
|
# Column of the `end_pos` (0 origin)
|
31
|
-
|
38
|
+
attr_reader end_column (): Integer
|
32
39
|
|
33
|
-
|
40
|
+
attr_reader start_loc (): Buffer::loc
|
34
41
|
|
35
|
-
|
42
|
+
attr_reader end_loc (): Buffer::loc
|
36
43
|
|
37
|
-
|
44
|
+
attr_reader range (): Range[Integer]
|
38
45
|
|
39
46
|
# A substring of buffer associated to the location.
|
40
47
|
def source: () -> String
|
@@ -46,88 +53,44 @@ module RBS
|
|
46
53
|
# Location.to_string(loc) # => a.rb:1:0...3:4
|
47
54
|
# Location.to_string(nil) # => *:*:*..*:*
|
48
55
|
#
|
49
|
-
def self.to_string: (Location? location, ?default: ::String default) -> String
|
56
|
+
def self.to_string: (Location[untyped, untyped]? location, ?default: ::String default) -> String
|
50
57
|
|
51
58
|
def ==: (untyped other) -> bool
|
52
59
|
|
53
|
-
# Returns a new location with starting positionof `self` and ending position of `other`.
|
54
|
-
#
|
55
|
-
# l1 = Location.new(buffer: buffer, start_pos: 0, end_pox: x)
|
56
|
-
# l2 = Location.new(buffer: buffer, start_pos: y, end_pos: 20)
|
57
|
-
# l1 + l2 # => Location.new(buffer: buffer, start_pos: 0, end_pos: 20)
|
58
|
-
#
|
59
|
-
def +: (Location other) -> Location
|
60
|
-
|
61
|
-
# Returns true if `loc` is exact predecessor of `self`.
|
62
|
-
#
|
63
|
-
# l1 = Location.new(...) # 0..10
|
64
|
-
# l2 = Location.new(...) # 10..13
|
65
|
-
# l3 = Location.new(...) # 13..20
|
66
|
-
#
|
67
|
-
# l1.pred?(l2) # => true
|
68
|
-
# l2.pred?(l3) # => true
|
69
|
-
# l1.pred?(l3) # => false
|
70
|
-
#
|
71
|
-
def pred?: (Location loc) -> bool
|
72
|
-
|
73
60
|
include _ToJson
|
74
61
|
|
75
|
-
|
76
|
-
#
|
77
|
-
def concat: (*Location?) -> Location
|
78
|
-
|
79
|
-
# Inplace version of `+`.
|
80
|
-
#
|
81
|
-
def <<: (Location?) -> Location
|
62
|
+
def add_optional_child: (OptionalChildKeys name, Range[Integer]? range) -> void
|
82
63
|
|
83
|
-
|
84
|
-
#
|
85
|
-
# location.with_children(
|
86
|
-
# required: { name: name.location },
|
87
|
-
# optional: { args: nil }
|
88
|
-
# )
|
89
|
-
#
|
90
|
-
def with_children: [R, O](?required: Hash[R, Range[Integer] | Location], ?optional: Hash[O, Range[Integer] | Location | nil]) -> WithChildren[R, O]
|
64
|
+
def add_required_child: (RequiredChildKeys name, Range[Integer] range) -> void
|
91
65
|
|
92
|
-
# Location
|
66
|
+
# Returns `Location` instance for given _child_ name.
|
93
67
|
#
|
94
|
-
# # Array[String]
|
95
|
-
# # ^^^^^ <= name
|
96
|
-
# # ^^^^^^^^ <= args
|
97
|
-
# #
|
98
68
|
# # @type var loc: Location::WithChildren[:name, :args]
|
99
|
-
# loc
|
100
|
-
# loc
|
101
|
-
# loc = loc.merge_optional({ args: 5...13 })
|
69
|
+
# loc[:name] # => Location
|
70
|
+
# loc[:args] # => may be nil
|
102
71
|
#
|
103
|
-
#
|
104
|
-
#
|
72
|
+
# Note that passing unknown symbol raises an error even if the child is _optional_.
|
73
|
+
# You need explicitly set `nil` for absent optional children.
|
105
74
|
#
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
attr_reader optional_children: Hash[OptionalChildKeys, Range[Integer]?]
|
75
|
+
def []: (RequiredChildKeys) -> Location[bot, bot]
|
76
|
+
| (OptionalChildKeys) -> Location[bot, bot]?
|
77
|
+
| (Symbol) -> Location[bot, bot]?
|
110
78
|
|
111
|
-
|
79
|
+
def each_optional_key: () { (Symbol) -> void } -> void
|
80
|
+
| () -> Enumerator[Symbol, void]
|
112
81
|
|
113
|
-
|
82
|
+
def each_required_key: () { (Symbol) -> void } -> void
|
83
|
+
| () -> Enumerator[Symbol, void]
|
114
84
|
|
115
|
-
|
116
|
-
#
|
117
|
-
# # @type var loc: Location::WithChildren[:name, :args]
|
118
|
-
# loc[:name] # => Location
|
119
|
-
# loc[:args] # => may be nil
|
120
|
-
#
|
121
|
-
# Note that passing unknown symbol raises an error even if the child is _optional_.
|
122
|
-
# You need explicitly set `nil` for absent optional children.
|
123
|
-
#
|
124
|
-
def []: (RequiredChildKeys) -> Location
|
125
|
-
| (OptionalChildKeys) -> Location?
|
126
|
-
| (Symbol) -> Location?
|
85
|
+
private
|
127
86
|
|
128
|
-
|
87
|
+
def _start_loc: () -> Buffer::loc?
|
88
|
+
def _end_loc: () -> Buffer::loc?
|
129
89
|
|
130
|
-
|
131
|
-
|
90
|
+
def _add_required_child: (RequiredChildKeys name, Integer start_pos, Integer end_pos) -> void
|
91
|
+
def _add_optional_child: (OptionalChildKeys name, Integer start_pos, Integer end_pos) -> void
|
92
|
+
def _add_optional_no_child: (OptionalChildKeys name) -> void
|
93
|
+
def _optional_keys: () -> Array[Symbol]
|
94
|
+
def _required_keys: () -> Array[Symbol]
|
132
95
|
end
|
133
96
|
end
|
data/sig/locator.rbs
CHANGED
@@ -37,8 +37,8 @@ module RBS
|
|
37
37
|
|
38
38
|
def find_in_type: (Integer pos, type: Types::t, array: Array[component]) -> bool
|
39
39
|
|
40
|
-
def find_in_loc: (Integer pos, location: Location
|
40
|
+
def find_in_loc: (Integer pos, location: Location[untyped, untyped]?, array: Array[component]) -> bool
|
41
41
|
|
42
|
-
def test_loc: (Integer pos, location: Location?) -> bool
|
42
|
+
def test_loc: (Integer pos, location: Location[untyped, untyped]?) -> bool
|
43
43
|
end
|
44
44
|
end
|
data/sig/members.rbs
CHANGED
@@ -25,7 +25,7 @@ module RBS
|
|
25
25
|
# ^^^ name
|
26
26
|
# ^^^ overload
|
27
27
|
#
|
28
|
-
type loc = Location
|
28
|
+
type loc = Location[:keyword | :name, :kind | :overload]
|
29
29
|
|
30
30
|
attr_reader name: Symbol
|
31
31
|
attr_reader kind: kind
|
@@ -59,7 +59,7 @@ module RBS
|
|
59
59
|
# ^^^^ name
|
60
60
|
# ^ colon
|
61
61
|
#
|
62
|
-
type loc = Location
|
62
|
+
type loc = Location[:name | :colon, :kind]
|
63
63
|
|
64
64
|
attr_reader name: Symbol
|
65
65
|
attr_reader type: Types::t
|
@@ -97,7 +97,7 @@ module RBS
|
|
97
97
|
# ^ arg_open
|
98
98
|
# ^ arg_close
|
99
99
|
#
|
100
|
-
type loc = Location
|
100
|
+
type loc = Location[:name | :keyword, :args]
|
101
101
|
|
102
102
|
attr_reader name: TypeName
|
103
103
|
attr_reader args: Array[Types::t]
|
@@ -141,7 +141,7 @@ module RBS
|
|
141
141
|
# ^^^^ ivar_name
|
142
142
|
# ^ colon
|
143
143
|
#
|
144
|
-
type loc = Location
|
144
|
+
type loc = Location[:keyword | :name | :colon, :kind | :ivar | :ivar_name]
|
145
145
|
|
146
146
|
attr_reader name: Symbol
|
147
147
|
attr_reader type: Types::t
|
@@ -174,9 +174,9 @@ module RBS
|
|
174
174
|
end
|
175
175
|
|
176
176
|
module LocationOnly
|
177
|
-
attr_reader location: Location?
|
177
|
+
attr_reader location: Location[bot, bot]?
|
178
178
|
|
179
|
-
def initialize: (location: Location?) -> void
|
179
|
+
def initialize: (location: Location[bot, bot]?) -> void
|
180
180
|
|
181
181
|
include _HashEqual
|
182
182
|
end
|
@@ -206,7 +206,7 @@ module RBS
|
|
206
206
|
# ^^^^^ old_kind
|
207
207
|
# ^^^ old_name
|
208
208
|
#
|
209
|
-
type loc = Location
|
209
|
+
type loc = Location[:keyword | :new_name | :old_name, :new_kind | :old_kind]
|
210
210
|
|
211
211
|
attr_reader new_name: Symbol
|
212
212
|
attr_reader old_name: Symbol
|
data/sig/method_types.rbs
CHANGED
@@ -3,9 +3,9 @@ module RBS
|
|
3
3
|
attr_reader type_params: Array[Symbol]
|
4
4
|
attr_reader type: Types::Function
|
5
5
|
attr_reader block: Types::Block?
|
6
|
-
attr_reader location: Location?
|
6
|
+
attr_reader location: Location[untyped, untyped]?
|
7
7
|
|
8
|
-
def initialize: (type_params: Array[Symbol], type: Types::Function, block: Types::Block?, location: Location?) -> void
|
8
|
+
def initialize: (type_params: Array[Symbol], type: Types::Function, block: Types::Block?, location: Location[untyped, untyped]?) -> void
|
9
9
|
|
10
10
|
def ==: (untyped other) -> bool
|
11
11
|
|
@@ -13,7 +13,7 @@ module RBS
|
|
13
13
|
|
14
14
|
def sub: (Substitution) -> MethodType
|
15
15
|
|
16
|
-
def update: (?type_params: Array[Symbol], ?type: Types::Function, ?block: Types::Block?, ?location: Location?) -> MethodType
|
16
|
+
def update: (?type_params: Array[Symbol], ?type: Types::Function, ?block: Types::Block?, ?location: Location[untyped, untyped]?) -> MethodType
|
17
17
|
|
18
18
|
def free_variables: (?Set[Symbol] set) -> Set[Symbol]
|
19
19
|
|
data/sig/parser.rbs
CHANGED
@@ -1,32 +1,22 @@
|
|
1
1
|
module RBS
|
2
2
|
class Parser
|
3
|
-
|
4
|
-
attr_reader token_str: String
|
5
|
-
attr_reader error_value: untyped
|
6
|
-
attr_reader value_stack: untyped?
|
3
|
+
def self.parse_method_type: (Buffer | String, ?line: Integer, ?column: Integer, ?variables: Array[Symbol]) -> MethodType
|
7
4
|
|
8
|
-
|
9
|
-
end
|
5
|
+
def self.parse_type: (Buffer | String, ?line: Integer, ?column: Integer, ?variables: Array[Symbol]) -> Types::t
|
10
6
|
|
11
|
-
|
12
|
-
attr_reader input: String
|
13
|
-
attr_reader location: Location
|
7
|
+
def self.parse_signature: (Buffer | String, ?line: Integer, ?column: Integer) -> Array[AST::Declarations::t]
|
14
8
|
|
15
|
-
|
16
|
-
end
|
9
|
+
private
|
17
10
|
|
18
|
-
|
19
|
-
attr_reader subject: untyped
|
20
|
-
attr_reader location: Location
|
21
|
-
attr_reader original_message: String
|
11
|
+
def self.buffer: (String | Buffer source) -> Buffer
|
22
12
|
|
23
|
-
|
24
|
-
|
13
|
+
%a{no-defn}
|
14
|
+
def self._parse_type: (Buffer, Integer line, Integer column, Array[Symbol] variables) -> Types::t
|
25
15
|
|
26
|
-
|
16
|
+
%a{no-defn}
|
17
|
+
def self._parse_method_type: (Buffer, Integer line, Integer column, Array[Symbol] variables) -> MethodType
|
27
18
|
|
28
|
-
|
29
|
-
|
30
|
-
def self.parse_signature: (String | Buffer, ?eof_re: Regexp?) -> Array[AST::Declarations::t]
|
19
|
+
%a{no-defn}
|
20
|
+
def self._parse_signature: (Buffer, Integer line, Integer column) -> Array[AST::Declarations::t]
|
31
21
|
end
|
32
22
|
end
|
data/sig/types.rbs
CHANGED
@@ -13,7 +13,7 @@ module RBS
|
|
13
13
|
def sub: (Substitution) -> t
|
14
14
|
|
15
15
|
# Maps type names included in the type and returns new instance of type.
|
16
|
-
def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> t
|
16
|
+
def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> t
|
17
17
|
|
18
18
|
# Yields all direct sub types included in the type.
|
19
19
|
# It doesn't yield the type itself.
|
@@ -58,16 +58,16 @@ module RBS
|
|
58
58
|
end
|
59
59
|
|
60
60
|
module NoTypeName
|
61
|
-
def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> self
|
61
|
+
def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> self
|
62
62
|
end
|
63
63
|
|
64
64
|
module Bases
|
65
65
|
class Base
|
66
66
|
include _TypeBase
|
67
67
|
|
68
|
-
attr_reader location: Location?
|
68
|
+
attr_reader location: Location[bot, bot]?
|
69
69
|
|
70
|
-
def initialize: (location: Location?) -> void
|
70
|
+
def initialize: (location: Location[bot, bot]?) -> void
|
71
71
|
|
72
72
|
def ==: (untyped other) -> bool
|
73
73
|
|
@@ -111,6 +111,8 @@ module RBS
|
|
111
111
|
end
|
112
112
|
|
113
113
|
class Variable
|
114
|
+
type loc = Location[bot, bot]
|
115
|
+
|
114
116
|
attr_reader name: Symbol
|
115
117
|
|
116
118
|
@@count: Integer
|
@@ -119,9 +121,9 @@ module RBS
|
|
119
121
|
include NoTypeName
|
120
122
|
include EmptyEachType
|
121
123
|
|
122
|
-
def initialize: (name: Symbol, location:
|
124
|
+
def initialize: (name: Symbol, location: loc?) -> void
|
123
125
|
|
124
|
-
attr_reader location:
|
126
|
+
attr_reader location: loc?
|
125
127
|
|
126
128
|
def ==: (untyped other) -> bool
|
127
129
|
|
@@ -144,7 +146,7 @@ module RBS
|
|
144
146
|
class ClassSingleton
|
145
147
|
# singleton(::Foo)
|
146
148
|
# ^^^^^ => name
|
147
|
-
type loc = Location
|
149
|
+
type loc = Location[:name, bot]
|
148
150
|
|
149
151
|
def initialize: (name: TypeName, location: loc?) -> void
|
150
152
|
|
@@ -189,7 +191,7 @@ module RBS
|
|
189
191
|
# _Foo[Bar, Baz]
|
190
192
|
# ^^^^ => name
|
191
193
|
# ^^^^^^^^^^ => args
|
192
|
-
type loc = Location
|
194
|
+
type loc = Location[:name, :args]
|
193
195
|
|
194
196
|
def initialize: (name: TypeName, args: Array[t], location: loc?) -> void
|
195
197
|
|
@@ -214,7 +216,8 @@ module RBS
|
|
214
216
|
# Foo[Bar, Baz]
|
215
217
|
# ^^^ => name
|
216
218
|
# ^^^^^^^^^^ => args
|
217
|
-
|
219
|
+
#
|
220
|
+
type loc = Location[:name, :args]
|
218
221
|
|
219
222
|
def initialize: (name: TypeName, args: Array[t], location: loc?) -> void
|
220
223
|
|
@@ -226,54 +229,64 @@ module RBS
|
|
226
229
|
class Alias
|
227
230
|
attr_reader name: TypeName
|
228
231
|
|
229
|
-
|
232
|
+
type loc = Location[bot, bot]
|
233
|
+
|
234
|
+
def initialize: (name: TypeName, location: loc?) -> void
|
230
235
|
|
231
236
|
include _TypeBase
|
232
237
|
include NoFreeVariables
|
233
238
|
include NoSubst
|
234
239
|
include EmptyEachType
|
235
240
|
|
236
|
-
attr_reader location:
|
241
|
+
attr_reader location: loc?
|
237
242
|
end
|
238
243
|
|
239
244
|
class Tuple
|
240
245
|
attr_reader types: Array[t]
|
241
246
|
|
242
|
-
|
247
|
+
type loc = Location[bot, bot]
|
248
|
+
|
249
|
+
def initialize: (types: Array[t], location: loc?) -> void
|
243
250
|
|
244
251
|
include _TypeBase
|
245
252
|
|
246
|
-
attr_reader location:
|
253
|
+
attr_reader location: loc?
|
247
254
|
end
|
248
255
|
|
249
256
|
class Record
|
250
257
|
attr_reader fields: Hash[Symbol, t]
|
251
258
|
|
252
|
-
|
259
|
+
type loc = Location[bot, bot]
|
260
|
+
|
261
|
+
def initialize: (fields: Hash[Symbol, t], location: loc?) -> void
|
253
262
|
|
254
263
|
include _TypeBase
|
255
264
|
|
256
|
-
attr_reader location:
|
265
|
+
attr_reader location: loc?
|
257
266
|
end
|
258
267
|
|
259
268
|
class Optional
|
260
269
|
attr_reader type: t
|
261
270
|
|
262
|
-
|
271
|
+
type loc = Location[bot, bot]
|
272
|
+
|
273
|
+
def initialize: (type: t, location: loc?) -> void
|
263
274
|
|
264
275
|
include _TypeBase
|
265
276
|
|
266
|
-
attr_reader location:
|
277
|
+
attr_reader location: loc?
|
267
278
|
end
|
268
279
|
|
269
280
|
class Union
|
270
281
|
attr_reader types: Array[t]
|
271
282
|
|
272
|
-
|
283
|
+
type loc = Location[bot, bot]
|
284
|
+
|
285
|
+
def initialize: (types: Array[t], location: loc?) -> void
|
273
286
|
|
274
287
|
include _TypeBase
|
275
288
|
|
276
|
-
attr_reader location:
|
289
|
+
attr_reader location: loc?
|
277
290
|
|
278
291
|
def map_type: () { (t) -> t } -> Union
|
279
292
|
| () -> Enumerator[t, Union]
|
@@ -282,11 +295,13 @@ module RBS
|
|
282
295
|
class Intersection
|
283
296
|
attr_reader types: Array[t]
|
284
297
|
|
285
|
-
|
298
|
+
type loc = Location[bot, bot]
|
299
|
+
|
300
|
+
def initialize: (types: Array[t], location: loc?) -> void
|
286
301
|
|
287
302
|
include _TypeBase
|
288
303
|
|
289
|
-
attr_reader location:
|
304
|
+
attr_reader location: loc?
|
290
305
|
|
291
306
|
def map_type: () { (t) -> t } -> Intersection
|
292
307
|
| () -> Enumerator[t, Intersection]
|
@@ -294,7 +309,7 @@ module RBS
|
|
294
309
|
|
295
310
|
class Function
|
296
311
|
class Param
|
297
|
-
type loc = Location
|
312
|
+
type loc = Location[bot, :name]
|
298
313
|
|
299
314
|
attr_reader type: t
|
300
315
|
attr_reader name: Symbol?
|
@@ -329,7 +344,7 @@ module RBS
|
|
329
344
|
def map_type: { (t) -> t } -> Function
|
330
345
|
| -> Enumerator[t, Function]
|
331
346
|
|
332
|
-
def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> Function
|
347
|
+
def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> Function
|
333
348
|
|
334
349
|
def each_type: () { (t) -> void } -> void
|
335
350
|
| -> Enumerator[t, void]
|
@@ -384,19 +399,22 @@ module RBS
|
|
384
399
|
attr_reader type: Function
|
385
400
|
attr_reader block: Block?
|
386
401
|
|
387
|
-
|
402
|
+
type loc = Location[bot, bot]
|
403
|
+
|
404
|
+
def initialize: (location: loc?, type: Function, block: Block?) -> void
|
388
405
|
|
389
406
|
include _TypeBase
|
390
407
|
|
391
|
-
attr_reader location:
|
408
|
+
attr_reader location: loc?
|
392
409
|
end
|
393
410
|
|
394
411
|
class Literal
|
395
412
|
type literal = String | Integer | Symbol | TrueClass | FalseClass
|
413
|
+
type loc = Location[bot, bot]
|
396
414
|
|
397
415
|
attr_reader literal: literal
|
398
416
|
|
399
|
-
def initialize: (literal: literal, location:
|
417
|
+
def initialize: (literal: literal, location: loc?) -> void
|
400
418
|
|
401
419
|
include _TypeBase
|
402
420
|
include NoFreeVariables
|
@@ -404,7 +422,7 @@ module RBS
|
|
404
422
|
include EmptyEachType
|
405
423
|
include NoTypeName
|
406
424
|
|
407
|
-
attr_reader location:
|
425
|
+
attr_reader location: loc?
|
408
426
|
end
|
409
427
|
end
|
410
428
|
end
|