rbs 3.7.0.dev.1 → 3.7.0.pre.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 +1 -1
- data/.github/workflows/windows.yml +5 -3
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +47 -0
- data/Rakefile +23 -0
- data/config.yml +311 -0
- data/core/dir.rbs +1 -1
- data/core/kernel.rbs +2 -2
- data/core/process.rbs +1 -1
- data/core/set.rbs +1 -1
- data/docs/syntax.md +6 -4
- data/ext/rbs_extension/extconf.rb +10 -0
- data/ext/rbs_extension/parser.c +103 -110
- data/ext/rbs_extension/rbs_extension.h +1 -2
- data/{ext/rbs_extension → include/rbs}/constants.h +21 -19
- data/include/rbs/ruby_objs.h +72 -0
- data/include/rbs.h +7 -0
- data/lib/rbs/collection/config/lockfile_generator.rb +34 -5
- data/lib/rbs/collection/config.rb +2 -2
- data/lib/rbs/environment_loader.rb +5 -0
- data/lib/rbs/prototype/rb.rb +7 -3
- data/lib/rbs/types.rb +10 -3
- data/lib/rbs/version.rb +1 -1
- data/sig/ancestor_graph.rbs +1 -1
- data/sig/collection/config/lockfile_generator.rbs +9 -1
- data/sig/definition.rbs +1 -1
- data/sig/definition_builder.rbs +1 -1
- data/sig/environment.rbs +1 -1
- data/sig/prototype/rb.rbs +1 -1
- data/sig/type_alias_dependency.rbs +2 -2
- data/sig/type_alias_regularity.rbs +1 -1
- data/sig/type_param.rbs +3 -3
- data/sig/vendorer.rbs +1 -1
- data/{ext/rbs_extension → src}/constants.c +35 -36
- data/src/ruby_objs.c +793 -0
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/csv/0/manifest.yaml +1 -0
- data/stdlib/did_you_mean/0/did_you_mean.rbs +1 -1
- data/stdlib/json/0/json.rbs +1 -1
- data/stdlib/minitest/0/kernel.rbs +2 -2
- data/stdlib/minitest/0/minitest/abstract_reporter.rbs +4 -1
- data/stdlib/minitest/0/minitest/assertion.rbs +1 -0
- data/stdlib/minitest/0/minitest/assertions.rbs +58 -13
- data/stdlib/minitest/0/minitest/backtrace_filter.rbs +7 -0
- data/stdlib/minitest/0/minitest/bench_spec.rbs +8 -8
- data/stdlib/minitest/0/minitest/benchmark.rbs +17 -16
- data/stdlib/minitest/0/minitest/compress.rbs +13 -0
- data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
- data/stdlib/minitest/0/minitest/mock.rbs +9 -5
- data/stdlib/minitest/0/minitest/parallel/executor.rbs +4 -0
- data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +0 -1
- data/stdlib/minitest/0/minitest/pride_io.rbs +8 -0
- data/stdlib/minitest/0/minitest/pride_lol.rbs +2 -0
- data/stdlib/minitest/0/minitest/progress_reporter.rbs +1 -1
- data/stdlib/minitest/0/minitest/reportable.rbs +2 -0
- data/stdlib/minitest/0/minitest/runnable.rbs +33 -1
- data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +1 -1
- data/stdlib/minitest/0/minitest/spec/dsl.rbs +10 -6
- data/stdlib/minitest/0/minitest/spec.rbs +1 -1
- data/stdlib/minitest/0/minitest/statistics_reporter.rbs +5 -0
- data/stdlib/minitest/0/minitest/summary_reporter.rbs +0 -7
- data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +1 -1
- data/stdlib/minitest/0/minitest/test.rbs +7 -14
- data/stdlib/minitest/0/minitest/unexpected_error.rbs +2 -0
- data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
- data/stdlib/minitest/0/minitest/unit.rbs +1 -2
- data/stdlib/minitest/0/minitest.rbs +41 -892
- data/stdlib/open-uri/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/openssl.rbs +26 -1
- data/stdlib/psych/0/core_ext.rbs +12 -0
- data/templates/include/rbs/constants.h.erb +20 -0
- data/templates/include/rbs/ruby_objs.h.erb +10 -0
- data/templates/src/constants.c.erb +36 -0
- data/templates/src/ruby_objs.c.erb +27 -0
- data/templates/template.rb +122 -0
- metadata +19 -9
- data/ext/rbs_extension/ruby_objs.c +0 -602
- data/ext/rbs_extension/ruby_objs.h +0 -51
- data/stdlib/minitest/0/manifest.yaml +0 -2
- /data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +0 -0
@@ -1,602 +0,0 @@
|
|
1
|
-
#include "rbs_extension.h"
|
2
|
-
|
3
|
-
#ifdef RB_PASS_KEYWORDS
|
4
|
-
// Ruby 2.7 or later
|
5
|
-
#define CLASS_NEW_INSTANCE(klass, argc, argv)\
|
6
|
-
rb_class_new_instance_kw(argc, argv, klass, RB_PASS_KEYWORDS)
|
7
|
-
#else
|
8
|
-
// Ruby 2.6
|
9
|
-
#define CLASS_NEW_INSTANCE(receiver, argc, argv)\
|
10
|
-
rb_class_new_instance(argc, argv, receiver)
|
11
|
-
#endif
|
12
|
-
|
13
|
-
VALUE rbs_base_type(VALUE klass, VALUE location) {
|
14
|
-
VALUE args = rb_hash_new();
|
15
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
16
|
-
|
17
|
-
return CLASS_NEW_INSTANCE(
|
18
|
-
klass,
|
19
|
-
1,
|
20
|
-
&args
|
21
|
-
);
|
22
|
-
}
|
23
|
-
|
24
|
-
VALUE rbs_namespace(VALUE path, VALUE absolute) {
|
25
|
-
VALUE args = rb_hash_new();
|
26
|
-
rb_hash_aset(args, ID2SYM(rb_intern("path")), path);
|
27
|
-
rb_hash_aset(args, ID2SYM(rb_intern("absolute")), absolute);
|
28
|
-
|
29
|
-
return CLASS_NEW_INSTANCE(
|
30
|
-
RBS_Namespace,
|
31
|
-
1,
|
32
|
-
&args
|
33
|
-
);
|
34
|
-
}
|
35
|
-
|
36
|
-
VALUE rbs_type_name(VALUE namespace, VALUE name) {
|
37
|
-
VALUE args = rb_hash_new();
|
38
|
-
rb_hash_aset(args, ID2SYM(rb_intern("namespace")), namespace);
|
39
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
40
|
-
|
41
|
-
return CLASS_NEW_INSTANCE(
|
42
|
-
RBS_TypeName,
|
43
|
-
1,
|
44
|
-
&args
|
45
|
-
);
|
46
|
-
}
|
47
|
-
|
48
|
-
VALUE rbs_class_instance(VALUE typename, VALUE type_args, VALUE location) {
|
49
|
-
VALUE args = rb_hash_new();
|
50
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), typename);
|
51
|
-
rb_hash_aset(args, ID2SYM(rb_intern("args")), type_args);
|
52
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
53
|
-
|
54
|
-
return CLASS_NEW_INSTANCE(
|
55
|
-
RBS_Types_ClassInstance,
|
56
|
-
1,
|
57
|
-
&args
|
58
|
-
);
|
59
|
-
}
|
60
|
-
|
61
|
-
VALUE rbs_class_singleton(VALUE typename, VALUE location) {
|
62
|
-
VALUE args = rb_hash_new();
|
63
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), typename);
|
64
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
65
|
-
|
66
|
-
return CLASS_NEW_INSTANCE(
|
67
|
-
RBS_Types_ClassSingleton,
|
68
|
-
1,
|
69
|
-
&args
|
70
|
-
);
|
71
|
-
}
|
72
|
-
|
73
|
-
VALUE rbs_alias(VALUE typename, VALUE args, VALUE location) {
|
74
|
-
VALUE kwargs = rb_hash_new();
|
75
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("name")), typename);
|
76
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("args")), args);
|
77
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
78
|
-
|
79
|
-
return CLASS_NEW_INSTANCE(
|
80
|
-
RBS_Types_Alias,
|
81
|
-
1,
|
82
|
-
&kwargs
|
83
|
-
);
|
84
|
-
}
|
85
|
-
|
86
|
-
VALUE rbs_interface(VALUE typename, VALUE type_args, VALUE location) {
|
87
|
-
VALUE args = rb_hash_new();
|
88
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), typename);
|
89
|
-
rb_hash_aset(args, ID2SYM(rb_intern("args")), type_args);
|
90
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
91
|
-
|
92
|
-
return CLASS_NEW_INSTANCE(
|
93
|
-
RBS_Types_Interface,
|
94
|
-
1,
|
95
|
-
&args
|
96
|
-
);
|
97
|
-
}
|
98
|
-
|
99
|
-
VALUE rbs_union(VALUE types, VALUE location) {
|
100
|
-
VALUE args = rb_hash_new();
|
101
|
-
rb_hash_aset(args, ID2SYM(rb_intern("types")), types);
|
102
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
103
|
-
|
104
|
-
return CLASS_NEW_INSTANCE(
|
105
|
-
RBS_Types_Union,
|
106
|
-
1,
|
107
|
-
&args
|
108
|
-
);
|
109
|
-
}
|
110
|
-
|
111
|
-
VALUE rbs_intersection(VALUE types, VALUE location) {
|
112
|
-
VALUE args = rb_hash_new();
|
113
|
-
rb_hash_aset(args, ID2SYM(rb_intern("types")), types);
|
114
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
115
|
-
|
116
|
-
return CLASS_NEW_INSTANCE(
|
117
|
-
RBS_Types_Intersection,
|
118
|
-
1,
|
119
|
-
&args
|
120
|
-
);
|
121
|
-
}
|
122
|
-
|
123
|
-
VALUE rbs_tuple(VALUE types, VALUE location) {
|
124
|
-
VALUE args = rb_hash_new();
|
125
|
-
rb_hash_aset(args, ID2SYM(rb_intern("types")), types);
|
126
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
127
|
-
|
128
|
-
return CLASS_NEW_INSTANCE(
|
129
|
-
RBS_Types_Tuple,
|
130
|
-
1,
|
131
|
-
&args
|
132
|
-
);
|
133
|
-
}
|
134
|
-
|
135
|
-
VALUE rbs_optional(VALUE type, VALUE location) {
|
136
|
-
VALUE args = rb_hash_new();
|
137
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
138
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
139
|
-
|
140
|
-
return CLASS_NEW_INSTANCE(
|
141
|
-
RBS_Types_Optional,
|
142
|
-
1,
|
143
|
-
&args
|
144
|
-
);
|
145
|
-
}
|
146
|
-
|
147
|
-
VALUE rbs_block(VALUE type, VALUE required, VALUE self_type) {
|
148
|
-
VALUE args = rb_hash_new();
|
149
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
150
|
-
rb_hash_aset(args, ID2SYM(rb_intern("required")), required);
|
151
|
-
rb_hash_aset(args, ID2SYM(rb_intern("self_type")), self_type);
|
152
|
-
|
153
|
-
return CLASS_NEW_INSTANCE(
|
154
|
-
RBS_Types_Block,
|
155
|
-
1,
|
156
|
-
&args
|
157
|
-
);
|
158
|
-
}
|
159
|
-
|
160
|
-
VALUE rbs_function_param(VALUE type, VALUE name, VALUE location) {
|
161
|
-
VALUE args = rb_hash_new();
|
162
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
163
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
164
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
165
|
-
|
166
|
-
return CLASS_NEW_INSTANCE(
|
167
|
-
RBS_Types_Function_Param,
|
168
|
-
1,
|
169
|
-
&args
|
170
|
-
);
|
171
|
-
}
|
172
|
-
|
173
|
-
VALUE rbs_untyped_function(VALUE return_type) {
|
174
|
-
VALUE args = rb_hash_new();
|
175
|
-
rb_hash_aset(args, ID2SYM(rb_intern("return_type")), return_type);
|
176
|
-
|
177
|
-
return CLASS_NEW_INSTANCE(
|
178
|
-
RBS_Types_UntypedFunction,
|
179
|
-
1,
|
180
|
-
&args
|
181
|
-
);
|
182
|
-
}
|
183
|
-
|
184
|
-
VALUE rbs_function(
|
185
|
-
VALUE required_positional_params,
|
186
|
-
VALUE optional_positional_params,
|
187
|
-
VALUE rest_positional_param,
|
188
|
-
VALUE trailing_positional_params,
|
189
|
-
VALUE required_keyword_params,
|
190
|
-
VALUE optional_keyword_params,
|
191
|
-
VALUE rest_keyword_param,
|
192
|
-
VALUE return_type
|
193
|
-
) {
|
194
|
-
VALUE args = rb_hash_new();
|
195
|
-
rb_hash_aset(args, ID2SYM(rb_intern("required_positionals")), required_positional_params);
|
196
|
-
rb_hash_aset(args, ID2SYM(rb_intern("optional_positionals")), optional_positional_params);
|
197
|
-
rb_hash_aset(args, ID2SYM(rb_intern("rest_positionals")), rest_positional_param);
|
198
|
-
rb_hash_aset(args, ID2SYM(rb_intern("trailing_positionals")), trailing_positional_params);
|
199
|
-
rb_hash_aset(args, ID2SYM(rb_intern("required_keywords")), required_keyword_params);
|
200
|
-
rb_hash_aset(args, ID2SYM(rb_intern("optional_keywords")), optional_keyword_params);
|
201
|
-
rb_hash_aset(args, ID2SYM(rb_intern("rest_keywords")), rest_keyword_param);
|
202
|
-
rb_hash_aset(args, ID2SYM(rb_intern("return_type")), return_type);
|
203
|
-
|
204
|
-
return CLASS_NEW_INSTANCE(
|
205
|
-
RBS_Types_Function,
|
206
|
-
1,
|
207
|
-
&args
|
208
|
-
);
|
209
|
-
}
|
210
|
-
|
211
|
-
VALUE rbs_proc(VALUE function, VALUE block, VALUE location, VALUE self_type) {
|
212
|
-
VALUE args = rb_hash_new();
|
213
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), function);
|
214
|
-
rb_hash_aset(args, ID2SYM(rb_intern("block")), block);
|
215
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
216
|
-
rb_hash_aset(args, ID2SYM(rb_intern("self_type")), self_type);
|
217
|
-
|
218
|
-
return CLASS_NEW_INSTANCE(
|
219
|
-
RBS_Types_Proc,
|
220
|
-
1,
|
221
|
-
&args
|
222
|
-
);
|
223
|
-
}
|
224
|
-
|
225
|
-
VALUE rbs_void(VALUE location) {
|
226
|
-
VALUE args = rb_hash_new();
|
227
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
228
|
-
|
229
|
-
return CLASS_NEW_INSTANCE(
|
230
|
-
RBS_Types_Bases_Void,
|
231
|
-
1,
|
232
|
-
&args
|
233
|
-
);
|
234
|
-
}
|
235
|
-
|
236
|
-
VALUE rbs_literal(VALUE literal, VALUE location) {
|
237
|
-
VALUE args = rb_hash_new();
|
238
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
239
|
-
rb_hash_aset(args, ID2SYM(rb_intern("literal")), literal);
|
240
|
-
|
241
|
-
return CLASS_NEW_INSTANCE(
|
242
|
-
RBS_Types_Literal,
|
243
|
-
1,
|
244
|
-
&args
|
245
|
-
);
|
246
|
-
}
|
247
|
-
|
248
|
-
VALUE rbs_record(VALUE fields,VALUE location) {
|
249
|
-
VALUE args = rb_hash_new();
|
250
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
251
|
-
rb_hash_aset(args, ID2SYM(rb_intern("all_fields")), fields);
|
252
|
-
|
253
|
-
return CLASS_NEW_INSTANCE(
|
254
|
-
RBS_Types_Record,
|
255
|
-
1,
|
256
|
-
&args
|
257
|
-
);
|
258
|
-
}
|
259
|
-
|
260
|
-
VALUE rbs_variable(VALUE name, VALUE location) {
|
261
|
-
VALUE args = rb_hash_new();
|
262
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
263
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
264
|
-
|
265
|
-
return CLASS_NEW_INSTANCE(
|
266
|
-
RBS_Types_Variable,
|
267
|
-
1,
|
268
|
-
&args
|
269
|
-
);
|
270
|
-
}
|
271
|
-
|
272
|
-
VALUE rbs_method_type(VALUE type_params, VALUE type, VALUE block, VALUE location) {
|
273
|
-
VALUE args = rb_hash_new();
|
274
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
275
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
276
|
-
rb_hash_aset(args, ID2SYM(rb_intern("block")), block);
|
277
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
278
|
-
|
279
|
-
return CLASS_NEW_INSTANCE(
|
280
|
-
RBS_MethodType,
|
281
|
-
1,
|
282
|
-
&args
|
283
|
-
);
|
284
|
-
}
|
285
|
-
|
286
|
-
VALUE rbs_ast_comment(VALUE string, VALUE location) {
|
287
|
-
VALUE args = rb_hash_new();
|
288
|
-
rb_hash_aset(args, ID2SYM(rb_intern("string")), string);
|
289
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
290
|
-
|
291
|
-
return CLASS_NEW_INSTANCE(
|
292
|
-
RBS_AST_Comment,
|
293
|
-
1,
|
294
|
-
&args
|
295
|
-
);
|
296
|
-
}
|
297
|
-
|
298
|
-
VALUE rbs_ast_annotation(VALUE string, VALUE location) {
|
299
|
-
VALUE args = rb_hash_new();
|
300
|
-
rb_hash_aset(args, ID2SYM(rb_intern("string")), string);
|
301
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
302
|
-
|
303
|
-
return CLASS_NEW_INSTANCE(
|
304
|
-
RBS_AST_Annotation,
|
305
|
-
1,
|
306
|
-
&args
|
307
|
-
);
|
308
|
-
}
|
309
|
-
|
310
|
-
VALUE rbs_ast_type_param(VALUE name, VALUE variance, bool unchecked, VALUE upper_bound, VALUE default_type, VALUE location) {
|
311
|
-
VALUE args = rb_hash_new();
|
312
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
313
|
-
rb_hash_aset(args, ID2SYM(rb_intern("variance")), variance);
|
314
|
-
rb_hash_aset(args, ID2SYM(rb_intern("upper_bound")), upper_bound);
|
315
|
-
rb_hash_aset(args, ID2SYM(rb_intern("default_type")), default_type);
|
316
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
317
|
-
|
318
|
-
VALUE type_param = CLASS_NEW_INSTANCE(RBS_AST_TypeParam, 1, &args);
|
319
|
-
|
320
|
-
if (unchecked) {
|
321
|
-
rb_funcall(type_param, rb_intern("unchecked!"), 0);
|
322
|
-
}
|
323
|
-
|
324
|
-
return type_param;
|
325
|
-
}
|
326
|
-
|
327
|
-
VALUE rbs_ast_decl_constant(VALUE name, VALUE type, VALUE location, VALUE comment) {
|
328
|
-
VALUE args = rb_hash_new();
|
329
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
330
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
331
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
332
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
333
|
-
|
334
|
-
return CLASS_NEW_INSTANCE(
|
335
|
-
RBS_AST_Declarations_Constant,
|
336
|
-
1,
|
337
|
-
&args
|
338
|
-
);
|
339
|
-
}
|
340
|
-
|
341
|
-
VALUE rbs_ast_decl_global(VALUE name, VALUE type, VALUE location, VALUE comment) {
|
342
|
-
VALUE args = rb_hash_new();
|
343
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
344
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
345
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
346
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
347
|
-
|
348
|
-
return CLASS_NEW_INSTANCE(
|
349
|
-
RBS_AST_Declarations_Global,
|
350
|
-
1,
|
351
|
-
&args
|
352
|
-
);
|
353
|
-
}
|
354
|
-
|
355
|
-
VALUE rbs_ast_decl_type_alias(VALUE name, VALUE type_params, VALUE type, VALUE annotations, VALUE location, VALUE comment) {
|
356
|
-
VALUE args = rb_hash_new();
|
357
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
358
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
359
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
360
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
361
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
362
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
363
|
-
|
364
|
-
return CLASS_NEW_INSTANCE(
|
365
|
-
RBS_AST_Declarations_TypeAlias,
|
366
|
-
1,
|
367
|
-
&args
|
368
|
-
);
|
369
|
-
}
|
370
|
-
|
371
|
-
VALUE rbs_ast_decl_interface(VALUE name, VALUE type_params, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
372
|
-
VALUE args = rb_hash_new();
|
373
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
374
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
375
|
-
rb_hash_aset(args, ID2SYM(rb_intern("members")), members);
|
376
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
377
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
378
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
379
|
-
|
380
|
-
return CLASS_NEW_INSTANCE(
|
381
|
-
RBS_AST_Declarations_Interface,
|
382
|
-
1,
|
383
|
-
&args
|
384
|
-
);
|
385
|
-
}
|
386
|
-
|
387
|
-
VALUE rbs_ast_decl_module_self(VALUE name, VALUE args, VALUE location) {
|
388
|
-
VALUE kw_args = rb_hash_new();
|
389
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("name")), name);
|
390
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("args")), args);
|
391
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("location")), location);
|
392
|
-
|
393
|
-
return CLASS_NEW_INSTANCE(
|
394
|
-
RBS_AST_Declarations_Module_Self,
|
395
|
-
1,
|
396
|
-
&kw_args
|
397
|
-
);
|
398
|
-
}
|
399
|
-
|
400
|
-
VALUE rbs_ast_decl_module(VALUE name, VALUE type_params, VALUE self_types, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
401
|
-
VALUE args = rb_hash_new();
|
402
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
403
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
404
|
-
rb_hash_aset(args, ID2SYM(rb_intern("self_types")), self_types);
|
405
|
-
rb_hash_aset(args, ID2SYM(rb_intern("members")), members);
|
406
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
407
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
408
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
409
|
-
|
410
|
-
return CLASS_NEW_INSTANCE(
|
411
|
-
RBS_AST_Declarations_Module,
|
412
|
-
1,
|
413
|
-
&args
|
414
|
-
);
|
415
|
-
}
|
416
|
-
|
417
|
-
VALUE rbs_ast_decl_class_alias(VALUE new_name, VALUE old_name, VALUE location, VALUE comment) {
|
418
|
-
VALUE args = rb_hash_new();
|
419
|
-
rb_hash_aset(args, ID2SYM(rb_intern("new_name")), new_name);
|
420
|
-
rb_hash_aset(args, ID2SYM(rb_intern("old_name")), old_name);
|
421
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
422
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
423
|
-
|
424
|
-
return CLASS_NEW_INSTANCE(
|
425
|
-
RBS_AST_Declarations_ClassAlias,
|
426
|
-
1,
|
427
|
-
&args
|
428
|
-
);
|
429
|
-
}
|
430
|
-
|
431
|
-
VALUE rbs_ast_decl_module_alias(VALUE new_name, VALUE old_name, VALUE location, VALUE comment) {
|
432
|
-
VALUE args = rb_hash_new();
|
433
|
-
rb_hash_aset(args, ID2SYM(rb_intern("new_name")), new_name);
|
434
|
-
rb_hash_aset(args, ID2SYM(rb_intern("old_name")), old_name);
|
435
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
436
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
437
|
-
|
438
|
-
return CLASS_NEW_INSTANCE(
|
439
|
-
RBS_AST_Declarations_ModuleAlias,
|
440
|
-
1,
|
441
|
-
&args
|
442
|
-
);
|
443
|
-
}
|
444
|
-
|
445
|
-
VALUE rbs_ast_members_method_definition_overload(VALUE annotations, VALUE method_type) {
|
446
|
-
VALUE args = rb_hash_new();
|
447
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
448
|
-
rb_hash_aset(args, ID2SYM(rb_intern("method_type")), method_type);
|
449
|
-
|
450
|
-
return CLASS_NEW_INSTANCE(
|
451
|
-
RBS_AST_Members_MethodDefinition_Overload,
|
452
|
-
1,
|
453
|
-
&args
|
454
|
-
);
|
455
|
-
}
|
456
|
-
|
457
|
-
VALUE rbs_ast_members_method_definition(VALUE name, VALUE kind, VALUE overloads, VALUE annotations, VALUE location, VALUE comment, VALUE overloading, VALUE visibility) {
|
458
|
-
VALUE args = rb_hash_new();
|
459
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
460
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
461
|
-
rb_hash_aset(args, ID2SYM(rb_intern("overloads")), overloads);
|
462
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
463
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
464
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
465
|
-
rb_hash_aset(args, ID2SYM(rb_intern("overloading")), overloading);
|
466
|
-
rb_hash_aset(args, ID2SYM(rb_intern("visibility")), visibility);
|
467
|
-
|
468
|
-
return CLASS_NEW_INSTANCE(
|
469
|
-
RBS_AST_Members_MethodDefinition,
|
470
|
-
1,
|
471
|
-
&args
|
472
|
-
);
|
473
|
-
}
|
474
|
-
|
475
|
-
VALUE rbs_ast_members_variable(VALUE klass, VALUE name, VALUE type, VALUE location, VALUE comment) {
|
476
|
-
VALUE args = rb_hash_new();
|
477
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
478
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
479
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
480
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
481
|
-
|
482
|
-
return CLASS_NEW_INSTANCE(
|
483
|
-
klass,
|
484
|
-
1,
|
485
|
-
&args
|
486
|
-
);
|
487
|
-
}
|
488
|
-
|
489
|
-
VALUE rbs_ast_members_mixin(VALUE klass, VALUE name, VALUE module_args, VALUE annotations, VALUE location, VALUE comment) {
|
490
|
-
VALUE args = rb_hash_new();
|
491
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
492
|
-
rb_hash_aset(args, ID2SYM(rb_intern("args")), module_args);
|
493
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
494
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
495
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
496
|
-
|
497
|
-
return CLASS_NEW_INSTANCE(
|
498
|
-
klass,
|
499
|
-
1,
|
500
|
-
&args
|
501
|
-
);
|
502
|
-
}
|
503
|
-
|
504
|
-
VALUE rbs_ast_members_attribute(VALUE klass, VALUE name, VALUE type, VALUE ivar_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment, VALUE visibility) {
|
505
|
-
VALUE args = rb_hash_new();
|
506
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
507
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
508
|
-
rb_hash_aset(args, ID2SYM(rb_intern("ivar_name")), ivar_name);
|
509
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
510
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
511
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
512
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
513
|
-
rb_hash_aset(args, ID2SYM(rb_intern("visibility")), visibility);
|
514
|
-
|
515
|
-
return CLASS_NEW_INSTANCE(
|
516
|
-
klass,
|
517
|
-
1,
|
518
|
-
&args
|
519
|
-
);
|
520
|
-
}
|
521
|
-
|
522
|
-
VALUE rbs_ast_members_visibility(VALUE klass, VALUE location) {
|
523
|
-
VALUE args = rb_hash_new();
|
524
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
525
|
-
|
526
|
-
return CLASS_NEW_INSTANCE(
|
527
|
-
klass,
|
528
|
-
1,
|
529
|
-
&args
|
530
|
-
);
|
531
|
-
}
|
532
|
-
|
533
|
-
VALUE rbs_ast_members_alias(VALUE new_name, VALUE old_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment) {
|
534
|
-
VALUE args = rb_hash_new();
|
535
|
-
rb_hash_aset(args, ID2SYM(rb_intern("new_name")), new_name);
|
536
|
-
rb_hash_aset(args, ID2SYM(rb_intern("old_name")), old_name);
|
537
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
538
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
539
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
540
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
541
|
-
|
542
|
-
return CLASS_NEW_INSTANCE(
|
543
|
-
RBS_AST_Members_Alias,
|
544
|
-
1,
|
545
|
-
&args
|
546
|
-
);
|
547
|
-
}
|
548
|
-
|
549
|
-
VALUE rbs_ast_decl_class_super(VALUE name, VALUE args, VALUE location) {
|
550
|
-
VALUE kwargs = rb_hash_new();
|
551
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("name")), name);
|
552
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("args")), args);
|
553
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
554
|
-
|
555
|
-
return CLASS_NEW_INSTANCE(
|
556
|
-
RBS_AST_Declarations_Class_Super,
|
557
|
-
1,
|
558
|
-
&kwargs
|
559
|
-
);
|
560
|
-
}
|
561
|
-
|
562
|
-
VALUE rbs_ast_decl_class(VALUE name, VALUE type_params, VALUE super_class, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
563
|
-
VALUE kwargs = rb_hash_new();
|
564
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("name")), name);
|
565
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("type_params")), type_params);
|
566
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("super_class")), super_class);
|
567
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("members")), members);
|
568
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("annotations")), annotations);
|
569
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
570
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("comment")), comment);
|
571
|
-
|
572
|
-
return CLASS_NEW_INSTANCE(
|
573
|
-
RBS_AST_Declarations_Class,
|
574
|
-
1,
|
575
|
-
&kwargs
|
576
|
-
);
|
577
|
-
}
|
578
|
-
|
579
|
-
VALUE rbs_ast_directives_use(VALUE clauses, VALUE location) {
|
580
|
-
VALUE kwargs = rb_hash_new();
|
581
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("clauses")), clauses);
|
582
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
583
|
-
|
584
|
-
return CLASS_NEW_INSTANCE(RBS_AST_Directives_Use, 1, &kwargs);
|
585
|
-
}
|
586
|
-
|
587
|
-
VALUE rbs_ast_directives_use_single_clause(VALUE type_name, VALUE new_name, VALUE location) {
|
588
|
-
VALUE kwargs = rb_hash_new();
|
589
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("type_name")), type_name);
|
590
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("new_name")), new_name);
|
591
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
592
|
-
|
593
|
-
return CLASS_NEW_INSTANCE(RBS_AST_Directives_Use_SingleClause, 1, &kwargs);
|
594
|
-
}
|
595
|
-
|
596
|
-
VALUE rbs_ast_directives_use_wildcard_clause(VALUE namespace, VALUE location) {
|
597
|
-
VALUE kwargs = rb_hash_new();
|
598
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("namespace")), namespace);
|
599
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
600
|
-
|
601
|
-
return CLASS_NEW_INSTANCE(RBS_AST_Directives_Use_WildcardClause, 1, &kwargs);
|
602
|
-
}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#ifndef RBS__RUBY_OBJS_H
|
2
|
-
#define RBS__RUBY_OBJS_H
|
3
|
-
|
4
|
-
#include "ruby.h"
|
5
|
-
|
6
|
-
VALUE rbs_alias(VALUE typename, VALUE args, VALUE location);
|
7
|
-
VALUE rbs_ast_annotation(VALUE string, VALUE location);
|
8
|
-
VALUE rbs_ast_comment(VALUE string, VALUE location);
|
9
|
-
VALUE rbs_ast_type_param(VALUE name, VALUE variance, bool unchecked, VALUE upper_bound, VALUE default_type, VALUE location);
|
10
|
-
VALUE rbs_ast_decl_type_alias(VALUE name, VALUE type_params, VALUE type, VALUE annotations, VALUE location, VALUE comment);
|
11
|
-
VALUE rbs_ast_decl_class_super(VALUE name, VALUE args, VALUE location);
|
12
|
-
VALUE rbs_ast_decl_class(VALUE name, VALUE type_params, VALUE super_class, VALUE members, VALUE annotations, VALUE location, VALUE comment);
|
13
|
-
VALUE rbs_ast_decl_constant(VALUE name, VALUE type, VALUE location, VALUE comment);
|
14
|
-
VALUE rbs_ast_decl_global(VALUE name, VALUE type, VALUE location, VALUE comment);
|
15
|
-
VALUE rbs_ast_decl_interface(VALUE name, VALUE type_params, VALUE members, VALUE annotations, VALUE location, VALUE comment);
|
16
|
-
VALUE rbs_ast_decl_module_self(VALUE name, VALUE args, VALUE location);
|
17
|
-
VALUE rbs_ast_decl_module(VALUE name, VALUE type_params, VALUE self_types, VALUE members, VALUE annotations, VALUE location, VALUE comment);
|
18
|
-
VALUE rbs_ast_decl_module_alias(VALUE new_name, VALUE old_name, VALUE location, VALUE comment);
|
19
|
-
VALUE rbs_ast_decl_class_alias(VALUE new_name, VALUE old_name, VALUE location, VALUE comment);
|
20
|
-
VALUE rbs_ast_members_alias(VALUE new_name, VALUE old_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment);
|
21
|
-
VALUE rbs_ast_members_attribute(VALUE klass, VALUE name, VALUE type, VALUE ivar_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment, VALUE visibility);
|
22
|
-
VALUE rbs_ast_members_method_definition(VALUE name, VALUE kind, VALUE overloads, VALUE annotations, VALUE location, VALUE comment, VALUE overloading, VALUE visibility);
|
23
|
-
VALUE rbs_ast_members_method_definition_overload(VALUE annotations, VALUE method_type);
|
24
|
-
VALUE rbs_ast_members_mixin(VALUE klass, VALUE name, VALUE args, VALUE annotations, VALUE location, VALUE comment);
|
25
|
-
VALUE rbs_ast_members_variable(VALUE klass, VALUE name, VALUE type, VALUE location, VALUE comment);
|
26
|
-
VALUE rbs_ast_members_visibility(VALUE klass, VALUE location);
|
27
|
-
VALUE rbs_base_type(VALUE klass, VALUE location);
|
28
|
-
VALUE rbs_block(VALUE type, VALUE required, VALUE self_type);
|
29
|
-
VALUE rbs_class_instance(VALUE typename, VALUE type_args, VALUE location);
|
30
|
-
VALUE rbs_class_singleton(VALUE typename, VALUE location);
|
31
|
-
VALUE rbs_function_param(VALUE type, VALUE name, VALUE location);
|
32
|
-
VALUE rbs_function(VALUE required_positional_params, VALUE optional_positional_params, VALUE rest_positional_params, VALUE trailing_positional_params, VALUE required_keywords, VALUE optional_keywords, VALUE rest_keywords, VALUE return_type);
|
33
|
-
VALUE rbs_untyped_function(VALUE return_type);
|
34
|
-
VALUE rbs_interface(VALUE typename, VALUE type_args, VALUE location);
|
35
|
-
VALUE rbs_intersection(VALUE types, VALUE location);
|
36
|
-
VALUE rbs_literal(VALUE literal, VALUE location);
|
37
|
-
VALUE rbs_method_type(VALUE type_params, VALUE type, VALUE block, VALUE location);
|
38
|
-
VALUE rbs_namespace(VALUE path, VALUE absolute);
|
39
|
-
VALUE rbs_optional(VALUE type, VALUE location);
|
40
|
-
VALUE rbs_proc(VALUE function, VALUE block, VALUE location, VALUE self_type);
|
41
|
-
VALUE rbs_record(VALUE fields, VALUE location);
|
42
|
-
VALUE rbs_tuple(VALUE types, VALUE location);
|
43
|
-
VALUE rbs_type_name(VALUE namespace, VALUE name);
|
44
|
-
VALUE rbs_union(VALUE types, VALUE location);
|
45
|
-
VALUE rbs_variable(VALUE name, VALUE location);
|
46
|
-
|
47
|
-
VALUE rbs_ast_directives_use(VALUE clauses, VALUE location);
|
48
|
-
VALUE rbs_ast_directives_use_single_clause(VALUE type_name, VALUE new_name, VALUE location);
|
49
|
-
VALUE rbs_ast_directives_use_wildcard_clause(VALUE namespace, VALUE location);
|
50
|
-
|
51
|
-
#endif
|
File without changes
|