rbs 4.1.3-java → 4.2.0-java
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/.gitattributes +1 -0
- data/.github/workflows/bundle-update.yml +2 -2
- data/.github/workflows/c-check.yml +2 -2
- data/.github/workflows/changelog.yml +121 -0
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/jruby.yml +3 -3
- data/.github/workflows/release-gems.yml +6 -7
- data/.github/workflows/ruby.yml +6 -6
- data/.github/workflows/rust.yml +12 -12
- data/.github/workflows/truffleruby.yml +2 -2
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/wasm.yml +3 -3
- data/.github/workflows/windows.yml +2 -2
- data/.rubocop.yml +0 -1
- data/CHANGELOG.md +50 -0
- data/Rakefile +50 -21
- data/config.yml +5 -0
- data/core/io.rbs +2 -1
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/release.md +57 -1
- data/docs/stdlib.md +8 -0
- data/docs/syntax.md +12 -0
- data/ext/rbs_extension/ast_translation.c +15 -0
- data/ext/rbs_extension/class_constants.c +2 -0
- data/ext/rbs_extension/class_constants.h +1 -0
- data/ext/rbs_extension/main.c +55 -19
- data/include/rbs/ast.h +21 -13
- data/include/rbs/defines.h +2 -2
- data/include/rbs/lexer.h +13 -12
- data/include/rbs/parser.h +37 -3
- data/lib/rbs/ast/declarations.rb +1 -1
- data/lib/rbs/ast/type_param.rb +1 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +8 -5
- data/lib/rbs/definition_builder/method_builder.rb +4 -4
- data/lib/rbs/definition_builder.rb +5 -2
- data/lib/rbs/environment/class_entry.rb +12 -0
- data/lib/rbs/environment/module_entry.rb +26 -1
- data/lib/rbs/parser_aux.rb +2 -2
- data/lib/rbs/prototype/helpers.rb +19 -52
- data/lib/rbs/prototype/runtime/value_object_generator.rb +0 -1
- data/lib/rbs/prototype/runtime.rb +1 -1
- data/lib/rbs/types.rb +44 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/wasm/parser.rb +62 -25
- data/lib/rbs/wasm/rbs_parser.wasm +0 -0
- data/lib/rbs/wasm/runtime.rb +19 -4
- data/lib/rbs/wasm/serialization_schema.rb +3 -2
- data/rbs.gemspec +1 -5
- data/schema/function.json +12 -1
- data/sig/environment/class_entry.rbs +6 -0
- data/sig/environment/module_entry.rbs +15 -0
- data/sig/parser.rbs +4 -4
- data/sig/types.rbs +11 -1
- data/src/ast.c +17 -1
- data/src/lexer.c +1562 -1560
- data/src/lexer.re +50 -18
- data/src/lexstate.c +2 -1
- data/src/parser.c +130 -70
- data/src/serialize.c +20 -13
- data/src/util/rbs_encoding.c +195 -49
- data/stdlib/erb/0/erb.rbs +4 -4
- data/stdlib/monitor/0/monitor.rbs +4 -4
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/stringio/0/stringio.rbs +2 -1
- data/stdlib/zlib/0/gzip_file.rbs +1 -1
- data/stdlib/zlib/0/gzip_writer.rbs +2 -1
- data/wasm/README.md +20 -4
- data/wasm/rbs_wasm.c +93 -37
- metadata +5 -3
data/sig/parser.rbs
CHANGED
|
@@ -136,9 +136,9 @@ module RBS
|
|
|
136
136
|
|
|
137
137
|
def self._parse_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool void_allowed, bool self_allowed, bool classish_allowed) -> Types::t?
|
|
138
138
|
|
|
139
|
-
def self._parse_method_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof) -> MethodType?
|
|
139
|
+
def self._parse_method_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool enable_forwarding_params) -> MethodType?
|
|
140
140
|
|
|
141
|
-
def self._parse_signature: (Buffer, Integer start_pos, Integer end_pos) -> [Array[AST::Directives::t], Array[AST::Declarations::t]]
|
|
141
|
+
def self._parse_signature: (Buffer, Integer start_pos, Integer end_pos, bool enable_forwarding_params) -> [Array[AST::Directives::t], Array[AST::Declarations::t]]
|
|
142
142
|
|
|
143
143
|
# Parse and serialize the result to the binary format consumed by
|
|
144
144
|
# RBS::WASM::Deserializer (see ext/rbs_extension/main.c and
|
|
@@ -146,9 +146,9 @@ module RBS
|
|
|
146
146
|
# round-trip can be exercised on CRuby.
|
|
147
147
|
def self._parse_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool void_allowed, bool self_allowed, bool classish_allowed) -> String?
|
|
148
148
|
|
|
149
|
-
def self._parse_method_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof) -> String?
|
|
149
|
+
def self._parse_method_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool enable_forwarding_params) -> String?
|
|
150
150
|
|
|
151
|
-
def self._parse_signature_to_bytes: (Buffer, Integer start_pos, Integer end_pos) -> String
|
|
151
|
+
def self._parse_signature_to_bytes: (Buffer, Integer start_pos, Integer end_pos, bool enable_forwarding_params) -> String
|
|
152
152
|
|
|
153
153
|
def self._parse_type_params: (Buffer, Integer start_pos, Integer end_pos, bool module_type_params) -> Array[AST::TypeParam]
|
|
154
154
|
|
data/sig/types.rbs
CHANGED
|
@@ -385,6 +385,12 @@ module RBS
|
|
|
385
385
|
| -> Enumerator[t, Param]
|
|
386
386
|
end
|
|
387
387
|
|
|
388
|
+
class ForwardingParam
|
|
389
|
+
attr_reader location: Location?
|
|
390
|
+
|
|
391
|
+
def initialize: (location: Location) -> void
|
|
392
|
+
end
|
|
393
|
+
|
|
388
394
|
attr_reader required_positionals: Array[Param]
|
|
389
395
|
attr_reader optional_positionals: Array[Param]
|
|
390
396
|
attr_reader rest_positionals: Param?
|
|
@@ -392,6 +398,7 @@ module RBS
|
|
|
392
398
|
attr_reader required_keywords: Hash[Symbol, Param]
|
|
393
399
|
attr_reader optional_keywords: Hash[Symbol, Param]
|
|
394
400
|
attr_reader rest_keywords: Param?
|
|
401
|
+
attr_reader forwarding: ForwardingParam?
|
|
395
402
|
attr_reader return_type: t
|
|
396
403
|
|
|
397
404
|
def initialize: (required_positionals: Array[Param],
|
|
@@ -401,7 +408,8 @@ module RBS
|
|
|
401
408
|
required_keywords: Hash[Symbol, Param],
|
|
402
409
|
optional_keywords: Hash[Symbol, Param],
|
|
403
410
|
rest_keywords: Param?,
|
|
404
|
-
return_type: t
|
|
411
|
+
return_type: t,
|
|
412
|
+
?forwarding: ForwardingParam?) -> void
|
|
405
413
|
|
|
406
414
|
def free_variables: (?Set[Symbol]) -> Set[Symbol]
|
|
407
415
|
|
|
@@ -431,9 +439,11 @@ module RBS
|
|
|
431
439
|
?required_keywords: Hash[Symbol, Param],
|
|
432
440
|
?optional_keywords: Hash[Symbol, Param],
|
|
433
441
|
?rest_keywords: Param?,
|
|
442
|
+
?forwarding: ForwardingParam?,
|
|
434
443
|
?return_type: t) -> Function
|
|
435
444
|
|
|
436
445
|
def empty?: () -> bool
|
|
446
|
+
def forwarding?: () -> bool
|
|
437
447
|
|
|
438
448
|
def param_to_s: () -> String
|
|
439
449
|
def return_to_s: () -> String
|
data/src/ast.c
CHANGED
|
@@ -143,6 +143,8 @@ const char *RBS_NONNULL rbs_node_type_name(rbs_node_t *RBS_NONNULL node) {
|
|
|
143
143
|
return "RBS::Types::ClassSingleton";
|
|
144
144
|
case RBS_TYPES_FUNCTION:
|
|
145
145
|
return "RBS::Types::Function";
|
|
146
|
+
case RBS_TYPES_FUNCTION_FORWARDING_PARAM:
|
|
147
|
+
return "RBS::Types::Function::ForwardingParam";
|
|
146
148
|
case RBS_TYPES_FUNCTION_PARAM:
|
|
147
149
|
return "RBS::Types::Function::Param";
|
|
148
150
|
case RBS_TYPES_INTERFACE:
|
|
@@ -1430,7 +1432,7 @@ rbs_types_class_singleton_t *RBS_NONNULL rbs_types_class_singleton_new(rbs_alloc
|
|
|
1430
1432
|
return instance;
|
|
1431
1433
|
}
|
|
1432
1434
|
#line 140 "templates/src/ast.c.erb"
|
|
1433
|
-
rbs_types_function_t *RBS_NONNULL rbs_types_function_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL required_positionals, rbs_node_list_t *RBS_NONNULL optional_positionals, rbs_node_t *RBS_NULLABLE rest_positionals, rbs_node_list_t *RBS_NONNULL trailing_positionals, rbs_hash_t *RBS_NONNULL required_keywords, rbs_hash_t *RBS_NONNULL optional_keywords, rbs_node_t *RBS_NULLABLE rest_keywords, rbs_node_t *RBS_NONNULL return_type) {
|
|
1435
|
+
rbs_types_function_t *RBS_NONNULL rbs_types_function_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL required_positionals, rbs_node_list_t *RBS_NONNULL optional_positionals, rbs_node_t *RBS_NULLABLE rest_positionals, rbs_node_list_t *RBS_NONNULL trailing_positionals, rbs_hash_t *RBS_NONNULL required_keywords, rbs_hash_t *RBS_NONNULL optional_keywords, rbs_node_t *RBS_NULLABLE rest_keywords, rbs_node_t *RBS_NULLABLE forwarding, rbs_node_t *RBS_NONNULL return_type) {
|
|
1434
1436
|
rbs_types_function_t *instance = rbs_allocator_alloc(allocator, rbs_types_function_t);
|
|
1435
1437
|
|
|
1436
1438
|
*instance = (rbs_types_function_t) {
|
|
@@ -1445,12 +1447,26 @@ rbs_types_function_t *RBS_NONNULL rbs_types_function_new(rbs_allocator_t *RBS_NO
|
|
|
1445
1447
|
.required_keywords = required_keywords,
|
|
1446
1448
|
.optional_keywords = optional_keywords,
|
|
1447
1449
|
.rest_keywords = rest_keywords,
|
|
1450
|
+
.forwarding = forwarding,
|
|
1448
1451
|
.return_type = return_type,
|
|
1449
1452
|
};
|
|
1450
1453
|
|
|
1451
1454
|
return instance;
|
|
1452
1455
|
}
|
|
1453
1456
|
#line 140 "templates/src/ast.c.erb"
|
|
1457
|
+
rbs_types_function_forwarding_param_t *RBS_NONNULL rbs_types_function_forwarding_param_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1458
|
+
rbs_types_function_forwarding_param_t *instance = rbs_allocator_alloc(allocator, rbs_types_function_forwarding_param_t);
|
|
1459
|
+
|
|
1460
|
+
*instance = (rbs_types_function_forwarding_param_t) {
|
|
1461
|
+
.base = (rbs_node_t) {
|
|
1462
|
+
.type = RBS_TYPES_FUNCTION_FORWARDING_PARAM,
|
|
1463
|
+
.location = location,
|
|
1464
|
+
},
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
return instance;
|
|
1468
|
+
}
|
|
1469
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1454
1470
|
rbs_types_function_param_t *RBS_NONNULL rbs_types_function_param_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL type, rbs_ast_symbol_t *RBS_NULLABLE name) {
|
|
1455
1471
|
rbs_types_function_param_t *instance = rbs_allocator_alloc(allocator, rbs_types_function_param_t);
|
|
1456
1472
|
|