rbs 2.8.4 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +12 -4
- data/.github/workflows/comments.yml +11 -11
- data/.github/workflows/dependabot.yml +30 -0
- data/.github/workflows/ruby.yml +40 -49
- data/.github/workflows/typecheck.yml +36 -0
- data/.github/workflows/windows.yml +28 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +42 -2
- data/CHANGELOG.md +845 -1
- data/README.md +64 -4
- data/Rakefile +198 -18
- data/Steepfile +11 -11
- data/config.yml +311 -0
- data/core/array.rbs +2189 -1914
- data/core/basic_object.rbs +59 -84
- data/core/binding.rbs +7 -69
- data/core/builtin.rbs +210 -11
- data/core/class.rbs +37 -0
- data/core/comparable.rbs +23 -25
- data/core/complex.rbs +449 -227
- data/core/constants.rbs +29 -21
- data/core/data.rbs +415 -0
- data/core/dir.rbs +698 -415
- data/core/encoding.rbs +468 -843
- data/core/enumerable.rbs +495 -455
- data/core/enumerator/product.rbs +92 -0
- data/core/enumerator.rbs +106 -9
- data/core/env.rbs +1 -1
- data/core/errno.rbs +506 -605
- data/core/errors.rbs +15 -17
- data/core/exception.rbs +361 -145
- data/core/false_class.rbs +39 -26
- data/core/fiber.rbs +121 -14
- data/core/file.rbs +1262 -320
- data/core/file_test.rbs +62 -45
- data/core/float.rbs +187 -208
- data/core/gc.rbs +446 -196
- data/core/global_variables.rbs +29 -29
- data/core/hash.rbs +242 -349
- data/core/integer.rbs +246 -308
- data/core/io/buffer.rbs +373 -122
- data/core/io/wait.rbs +29 -17
- data/core/io.rbs +1881 -1518
- data/core/kernel.rbs +2116 -1538
- data/core/marshal.rbs +24 -14
- data/core/match_data.rbs +413 -166
- data/core/math.rbs +531 -291
- data/core/method.rbs +101 -32
- data/core/module.rbs +228 -64
- data/core/nil_class.rbs +106 -47
- data/core/numeric.rbs +206 -292
- data/core/object.rbs +73 -1168
- data/core/object_space/weak_key_map.rbs +166 -0
- data/core/object_space.rbs +5 -3
- data/core/proc.rbs +280 -39
- data/core/process.rbs +1318 -658
- data/core/ractor.rbs +200 -134
- data/core/random.rbs +21 -4
- data/core/range.rbs +309 -153
- data/core/rational.rbs +4 -12
- data/core/rb_config.rbs +64 -43
- data/core/rbs/unnamed/argf.rbs +411 -147
- data/core/rbs/unnamed/env_class.rbs +137 -253
- data/core/rbs/unnamed/random.rbs +49 -26
- data/core/refinement.rbs +16 -1
- data/core/regexp.rbs +1568 -862
- data/core/ruby_vm.rbs +719 -7
- data/core/rubygems/config_file.rbs +3 -0
- data/core/rubygems/errors.rbs +69 -6
- data/core/rubygems/rubygems.rbs +71 -17
- data/core/rubygems/version.rbs +11 -7
- data/{stdlib/set/0 → core}/set.rbs +80 -91
- data/core/signal.rbs +14 -8
- data/core/string.rbs +1732 -1607
- data/core/struct.rbs +467 -95
- data/core/symbol.rbs +215 -245
- data/core/thread.rbs +133 -89
- data/core/thread_group.rbs +9 -9
- data/core/time.rbs +1141 -841
- data/core/trace_point.rbs +181 -121
- data/core/true_class.rbs +58 -32
- data/core/unbound_method.rbs +103 -30
- data/core/warning.rbs +50 -5
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/architecture.md +110 -0
- data/docs/collection.md +59 -5
- data/docs/data_and_struct.md +86 -0
- data/docs/gem.md +57 -0
- data/docs/rbs_by_example.md +16 -35
- data/docs/repo.md +1 -1
- data/docs/sigs.md +7 -7
- data/docs/stdlib.md +63 -5
- data/docs/syntax.md +255 -61
- data/docs/tools.md +1 -0
- data/ext/rbs_extension/extconf.rb +10 -0
- data/ext/rbs_extension/lexer.c +1741 -1548
- data/ext/rbs_extension/lexer.h +11 -1
- data/ext/rbs_extension/lexer.re +12 -6
- data/ext/rbs_extension/lexstate.c +26 -3
- data/ext/rbs_extension/location.c +119 -111
- data/ext/rbs_extension/location.h +32 -7
- data/ext/rbs_extension/main.c +3 -0
- data/ext/rbs_extension/parser.c +883 -481
- data/ext/rbs_extension/parserstate.c +65 -25
- data/ext/rbs_extension/parserstate.h +13 -3
- data/ext/rbs_extension/rbs_extension.h +1 -10
- data/ext/rbs_extension/unescape.c +7 -47
- data/goodcheck.yml +2 -2
- data/{ext/rbs_extension → include/rbs}/constants.h +26 -15
- data/include/rbs/ruby_objs.h +72 -0
- data/include/rbs.h +7 -0
- data/lib/rbs/annotate/annotations.rb +3 -3
- data/lib/rbs/annotate/formatter.rb +13 -3
- data/lib/rbs/annotate/rdoc_annotator.rb +1 -1
- data/lib/rbs/annotate/rdoc_source.rb +12 -3
- data/lib/rbs/ast/declarations.rb +85 -2
- data/lib/rbs/ast/directives.rb +39 -0
- data/lib/rbs/ast/members.rb +49 -15
- data/lib/rbs/ast/type_param.rb +104 -15
- data/lib/rbs/ast/visitor.rb +137 -0
- data/lib/rbs/buffer.rb +5 -0
- data/lib/rbs/cli/colored_io.rb +48 -0
- data/lib/rbs/cli/diff.rb +83 -0
- data/lib/rbs/cli/validate.rb +356 -0
- data/lib/rbs/cli.rb +253 -143
- data/lib/rbs/collection/cleaner.rb +8 -1
- data/lib/rbs/collection/config/lockfile.rb +92 -0
- data/lib/rbs/collection/config/lockfile_generator.rb +154 -65
- data/lib/rbs/collection/config.rb +19 -46
- data/lib/rbs/collection/installer.rb +12 -13
- data/lib/rbs/collection/sources/base.rb +2 -2
- data/lib/rbs/collection/sources/git.rb +146 -69
- data/lib/rbs/collection/sources/local.rb +81 -0
- data/lib/rbs/collection/sources/rubygems.rb +10 -12
- data/lib/rbs/collection/sources/stdlib.rb +14 -13
- data/lib/rbs/collection/sources.rb +15 -2
- data/lib/rbs/collection.rb +2 -1
- data/lib/rbs/definition.rb +13 -16
- data/lib/rbs/definition_builder/ancestor_builder.rb +100 -24
- data/lib/rbs/definition_builder/method_builder.rb +4 -4
- data/lib/rbs/definition_builder.rb +489 -584
- data/lib/rbs/diff.rb +125 -0
- data/lib/rbs/environment/use_map.rb +77 -0
- data/lib/rbs/environment.rb +406 -105
- data/lib/rbs/environment_loader.rb +48 -44
- data/lib/rbs/environment_walker.rb +1 -1
- data/lib/rbs/errors.rb +175 -56
- data/lib/rbs/file_finder.rb +28 -0
- data/lib/rbs/location_aux.rb +8 -7
- data/lib/rbs/locator.rb +37 -15
- data/lib/rbs/method_type.rb +23 -0
- data/lib/rbs/namespace.rb +1 -0
- data/lib/rbs/parser/lex_result.rb +15 -0
- data/lib/rbs/parser/token.rb +23 -0
- data/lib/rbs/parser_aux.rb +22 -13
- data/lib/rbs/prototype/helpers.rb +48 -22
- data/lib/rbs/prototype/node_usage.rb +99 -0
- data/lib/rbs/prototype/rb.rb +125 -31
- data/lib/rbs/prototype/rbi.rb +49 -36
- data/lib/rbs/prototype/runtime/helpers.rb +59 -0
- data/lib/rbs/prototype/runtime/reflection.rb +19 -0
- data/lib/rbs/prototype/runtime/value_object_generator.rb +279 -0
- data/lib/rbs/prototype/runtime.rb +273 -159
- data/lib/rbs/resolver/constant_resolver.rb +24 -8
- data/lib/rbs/resolver/type_name_resolver.rb +41 -7
- data/lib/rbs/sorter.rb +153 -123
- data/lib/rbs/substitution.rb +19 -0
- data/lib/rbs/subtractor.rb +201 -0
- data/lib/rbs/test/errors.rb +24 -11
- data/lib/rbs/test/guaranteed.rb +30 -0
- data/lib/rbs/test/hook.rb +45 -40
- data/lib/rbs/test/setup.rb +1 -1
- data/lib/rbs/test/tester.rb +1 -1
- data/lib/rbs/test/type_check.rb +120 -23
- data/lib/rbs/test.rb +6 -3
- data/lib/rbs/type_alias_dependency.rb +13 -3
- data/lib/rbs/type_alias_regularity.rb +21 -14
- data/lib/rbs/type_name.rb +18 -13
- data/lib/rbs/types.rb +352 -18
- data/lib/rbs/unit_test/convertibles.rb +176 -0
- data/lib/rbs/unit_test/spy.rb +136 -0
- data/lib/rbs/unit_test/type_assertions.rb +341 -0
- data/lib/rbs/unit_test/with_aliases.rb +143 -0
- data/lib/rbs/unit_test.rb +6 -0
- data/lib/rbs/validator.rb +55 -30
- data/lib/rbs/variance_calculator.rb +26 -23
- data/lib/rbs/vendorer.rb +3 -3
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +69 -22
- data/lib/rbs.rb +7 -2
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +5 -5
- data/rbs.gemspec +12 -2
- data/schema/decls.json +1 -1
- data/schema/members.json +15 -10
- data/sig/ancestor_builder.rbs +4 -0
- data/sig/ancestor_graph.rbs +22 -2
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +1 -1
- data/sig/cli/colored_io.rbs +15 -0
- data/sig/cli/diff.rbs +21 -0
- data/sig/cli/validate.rbs +43 -0
- data/sig/cli.rbs +4 -0
- data/sig/collection/config/lockfile.rbs +74 -0
- data/sig/collection/config/lockfile_generator.rbs +66 -0
- data/sig/collection/config.rbs +5 -48
- data/sig/collection/installer.rbs +1 -1
- data/sig/collection/sources.rbs +105 -33
- data/sig/constant.rbs +1 -1
- data/sig/declarations.rbs +42 -3
- data/sig/definition.rbs +26 -10
- data/sig/definition_builder.rbs +103 -81
- data/sig/diff.rbs +28 -0
- data/sig/directives.rbs +61 -0
- data/sig/environment.rbs +175 -29
- data/sig/environment_loader.rbs +20 -18
- data/sig/errors.rbs +123 -2
- data/sig/file_finder.rbs +28 -0
- data/sig/location.rbs +0 -3
- data/sig/locator.rbs +14 -2
- data/sig/manifest.yaml +0 -1
- data/sig/members.rbs +32 -9
- data/sig/method_types.rbs +10 -4
- data/sig/namespace.rbs +2 -3
- data/sig/parser.rbs +55 -16
- data/sig/prototype/helpers.rbs +4 -0
- data/sig/prototype/node_usage.rbs +20 -0
- data/sig/prototype/rb.rbs +10 -2
- data/sig/prototype/rbi.rbs +2 -0
- data/sig/prototype/runtime.rbs +182 -0
- data/sig/rbs.rbs +1 -1
- data/sig/rdoc/rbs.rbs +4 -0
- data/sig/repository.rbs +7 -5
- data/sig/resolver/constant_resolver.rbs +3 -4
- data/sig/resolver/context.rbs +1 -1
- data/sig/resolver/type_name_resolver.rbs +5 -1
- data/sig/shims/bundler.rbs +38 -0
- data/sig/shims/rubygems.rbs +19 -0
- data/sig/sorter.rbs +23 -5
- data/sig/substitution.rbs +6 -0
- data/sig/subtractor.rbs +37 -0
- data/sig/test/errors.rbs +52 -0
- data/sig/test/guranteed.rbs +9 -0
- data/sig/test/type_check.rbs +19 -0
- data/sig/test.rbs +82 -0
- data/sig/type_alias_dependency.rbs +31 -0
- data/sig/type_alias_regularity.rbs +12 -6
- data/sig/type_param.rbs +45 -9
- data/sig/typename.rbs +8 -5
- data/sig/types.rbs +119 -12
- data/sig/unit_test/convertibles.rbs +154 -0
- data/sig/unit_test/spy.rbs +28 -0
- data/sig/unit_test/type_assertions.rbs +194 -0
- data/sig/unit_test/with_aliases.rbs +136 -0
- data/sig/use_map.rbs +35 -0
- data/sig/validator.rbs +12 -5
- data/sig/variance_calculator.rbs +3 -1
- data/sig/vendorer.rbs +1 -1
- data/sig/visitor.rbs +47 -0
- data/sig/writer.rbs +6 -2
- data/src/constants.c +153 -0
- data/src/ruby_objs.c +793 -0
- data/stdlib/base64/0/base64.rbs +298 -45
- data/stdlib/benchmark/0/benchmark.rbs +12 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +62 -198
- data/stdlib/cgi/0/core.rbs +68 -15
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/coverage/0/coverage.rbs +50 -11
- data/stdlib/csv/0/csv.rbs +90 -119
- data/stdlib/csv/0/manifest.yaml +1 -0
- data/stdlib/date/0/date.rbs +806 -735
- data/stdlib/date/0/date_time.rbs +70 -211
- data/stdlib/dbm/0/dbm.rbs +0 -2
- data/stdlib/delegate/0/delegator.rbs +184 -0
- data/stdlib/delegate/0/kernel.rbs +47 -0
- data/stdlib/delegate/0/simple_delegator.rbs +96 -0
- data/stdlib/did_you_mean/0/did_you_mean.rbs +3 -8
- data/stdlib/digest/0/digest.rbs +48 -35
- data/stdlib/erb/0/erb.rbs +15 -39
- data/stdlib/etc/0/etc.rbs +174 -54
- data/stdlib/fileutils/0/fileutils.rbs +1234 -385
- data/stdlib/forwardable/0/forwardable.rbs +4 -4
- data/stdlib/io-console/0/io-console.rbs +82 -17
- data/stdlib/ipaddr/0/ipaddr.rbs +11 -6
- data/stdlib/json/0/json.rbs +434 -151
- data/stdlib/kconv/0/kconv.rbs +166 -0
- data/stdlib/logger/0/formatter.rbs +0 -2
- data/stdlib/logger/0/log_device.rbs +1 -3
- data/stdlib/logger/0/logger.rbs +465 -328
- 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 +7 -7
- 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/monitor/0/monitor.rbs +91 -10
- data/stdlib/mutex_m/0/mutex_m.rbs +0 -2
- data/stdlib/net-http/0/manifest.yaml +1 -1
- data/stdlib/net-http/0/net-http.rbs +3858 -964
- data/stdlib/net-protocol/0/manifest.yaml +2 -0
- data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
- data/stdlib/net-smtp/0/manifest.yaml +2 -0
- data/stdlib/net-smtp/0/net-smtp.rbs +55 -0
- data/stdlib/nkf/0/nkf.rbs +35 -5
- data/stdlib/objspace/0/objspace.rbs +40 -18
- data/stdlib/observable/0/observable.rbs +217 -0
- data/stdlib/open-uri/0/manifest.yaml +4 -0
- data/stdlib/open-uri/0/open-uri.rbs +393 -0
- data/stdlib/open3/0/open3.rbs +147 -0
- data/stdlib/openssl/0/manifest.yaml +1 -0
- data/stdlib/openssl/0/openssl.rbs +681 -316
- data/stdlib/optparse/0/optparse.rbs +100 -65
- data/stdlib/pathname/0/pathname.rbs +24 -15
- data/stdlib/pp/0/manifest.yaml +2 -0
- data/stdlib/pp/0/pp.rbs +300 -0
- data/stdlib/prettyprint/0/prettyprint.rbs +2 -6
- data/stdlib/pstore/0/pstore.rbs +370 -156
- data/stdlib/psych/0/core_ext.rbs +12 -0
- data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
- data/stdlib/psych/0/manifest.yaml +3 -0
- data/stdlib/psych/0/psych.rbs +402 -0
- data/stdlib/{yaml → psych}/0/store.rbs +2 -2
- data/stdlib/pty/0/pty.rbs +63 -11
- data/stdlib/rdoc/0/code_object.rbs +51 -0
- data/stdlib/rdoc/0/comment.rbs +59 -0
- data/stdlib/rdoc/0/context.rbs +153 -0
- data/stdlib/rdoc/0/markup.rbs +117 -0
- data/stdlib/rdoc/0/parser.rbs +56 -0
- data/stdlib/rdoc/0/rdoc.rbs +13 -380
- data/stdlib/rdoc/0/ri.rbs +17 -0
- data/stdlib/rdoc/0/store.rbs +48 -0
- data/stdlib/rdoc/0/top_level.rbs +97 -0
- data/stdlib/resolv/0/resolv.rbs +16 -79
- data/stdlib/ripper/0/ripper.rbs +1648 -0
- data/stdlib/securerandom/0/securerandom.rbs +7 -2
- data/stdlib/shellwords/0/shellwords.rbs +11 -12
- data/stdlib/singleton/0/singleton.rbs +0 -3
- data/stdlib/socket/0/addrinfo.rbs +13 -18
- data/stdlib/socket/0/basic_socket.rbs +5 -10
- data/stdlib/socket/0/ip_socket.rbs +0 -2
- data/stdlib/socket/0/socket.rbs +77 -46
- data/stdlib/socket/0/tcp_server.rbs +0 -5
- data/stdlib/socket/0/tcp_socket.rbs +36 -3
- data/stdlib/socket/0/udp_socket.rbs +4 -5
- data/stdlib/socket/0/unix_server.rbs +0 -5
- data/stdlib/socket/0/unix_socket.rbs +2 -4
- data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +188 -107
- data/stdlib/strscan/0/string_scanner.rbs +1269 -425
- data/stdlib/tempfile/0/tempfile.rbs +224 -61
- data/stdlib/time/0/time.rbs +48 -35
- data/stdlib/timeout/0/timeout.rbs +17 -8
- data/stdlib/tmpdir/0/tmpdir.rbs +10 -3
- data/stdlib/tsort/0/tsort.rbs +0 -4
- data/stdlib/uri/0/common.rbs +271 -144
- data/stdlib/uri/0/file.rbs +5 -0
- data/stdlib/uri/0/ftp.rbs +1 -1
- data/stdlib/uri/0/generic.rbs +26 -22
- data/stdlib/uri/0/http.rbs +4 -4
- data/stdlib/uri/0/ldap.rbs +1 -1
- data/stdlib/uri/0/mailto.rbs +84 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
- data/stdlib/yaml/0/manifest.yaml +1 -2
- data/stdlib/yaml/0/yaml.rbs +1 -199
- data/stdlib/zlib/0/buf_error.rbs +10 -0
- data/stdlib/zlib/0/data_error.rbs +10 -0
- data/stdlib/zlib/0/deflate.rbs +210 -0
- data/stdlib/zlib/0/error.rbs +20 -0
- data/stdlib/zlib/0/gzip_file/crc_error.rbs +12 -0
- data/stdlib/zlib/0/gzip_file/error.rbs +23 -0
- data/stdlib/zlib/0/gzip_file/length_error.rbs +12 -0
- data/stdlib/zlib/0/gzip_file/no_footer.rbs +11 -0
- data/stdlib/zlib/0/gzip_file.rbs +156 -0
- data/stdlib/zlib/0/gzip_reader.rbs +293 -0
- data/stdlib/zlib/0/gzip_writer.rbs +166 -0
- data/stdlib/zlib/0/inflate.rbs +180 -0
- data/stdlib/zlib/0/mem_error.rbs +10 -0
- data/stdlib/zlib/0/need_dict.rbs +13 -0
- data/stdlib/zlib/0/stream_end.rbs +11 -0
- data/stdlib/zlib/0/stream_error.rbs +11 -0
- data/stdlib/zlib/0/version_error.rbs +11 -0
- data/stdlib/zlib/0/zlib.rbs +1 -3
- data/stdlib/zlib/0/zstream.rbs +200 -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 +136 -36
- data/Gemfile +0 -33
- data/Gemfile.lock +0 -118
- data/core/deprecated.rbs +0 -9
- data/ext/rbs_extension/constants.c +0 -135
- data/ext/rbs_extension/ruby_objs.c +0 -525
- data/ext/rbs_extension/ruby_objs.h +0 -43
- data/lib/rbs/constant_table.rb +0 -167
- data/lib/rbs/parser_compat/lexer_error.rb +0 -6
- data/lib/rbs/parser_compat/located_value.rb +0 -7
- data/lib/rbs/parser_compat/semantics_error.rb +0 -6
- data/lib/rbs/parser_compat/syntax_error.rb +0 -6
- data/lib/rbs/test/spy.rb +0 -6
- data/lib/rbs/type_name_resolver.rb +0 -67
- data/sig/constant_table.rbs +0 -30
- data/sig/shims/abstract_syntax_tree.rbs +0 -25
- data/sig/shims/pp.rbs +0 -3
- data/sig/shims/ripper.rbs +0 -8
- data/sig/shims.rbs +0 -69
- data/sig/type_name_resolver.rbs +0 -26
- data/stdlib/minitest/0/manifest.yaml +0 -2
- data/stdlib/prime/0/integer-extension.rbs +0 -41
- data/stdlib/prime/0/manifest.yaml +0 -2
- data/stdlib/prime/0/prime.rbs +0 -372
@@ -1,135 +0,0 @@
|
|
1
|
-
#include "rbs_extension.h"
|
2
|
-
|
3
|
-
VALUE RBS_Parser;
|
4
|
-
|
5
|
-
VALUE RBS;
|
6
|
-
VALUE RBS_AST;
|
7
|
-
VALUE RBS_AST_Comment;
|
8
|
-
VALUE RBS_AST_Annotation;
|
9
|
-
VALUE RBS_AST_TypeParam;
|
10
|
-
|
11
|
-
VALUE RBS_AST_Declarations;
|
12
|
-
|
13
|
-
VALUE RBS_AST_Declarations_Alias;
|
14
|
-
VALUE RBS_AST_Declarations_Constant;
|
15
|
-
VALUE RBS_AST_Declarations_Global;
|
16
|
-
VALUE RBS_AST_Declarations_Interface;
|
17
|
-
VALUE RBS_AST_Declarations_Module;
|
18
|
-
VALUE RBS_AST_Declarations_Module_Self;
|
19
|
-
VALUE RBS_AST_Declarations_Class;
|
20
|
-
VALUE RBS_AST_Declarations_Class_Super;
|
21
|
-
|
22
|
-
VALUE RBS_AST_Members;
|
23
|
-
VALUE RBS_AST_Members_Alias;
|
24
|
-
VALUE RBS_AST_Members_AttrAccessor;
|
25
|
-
VALUE RBS_AST_Members_AttrReader;
|
26
|
-
VALUE RBS_AST_Members_AttrWriter;
|
27
|
-
VALUE RBS_AST_Members_ClassInstanceVariable;
|
28
|
-
VALUE RBS_AST_Members_ClassVariable;
|
29
|
-
VALUE RBS_AST_Members_Extend;
|
30
|
-
VALUE RBS_AST_Members_Include;
|
31
|
-
VALUE RBS_AST_Members_InstanceVariable;
|
32
|
-
VALUE RBS_AST_Members_MethodDefinition;
|
33
|
-
VALUE RBS_AST_Members_Prepend;
|
34
|
-
VALUE RBS_AST_Members_Private;
|
35
|
-
VALUE RBS_AST_Members_Public;
|
36
|
-
|
37
|
-
VALUE RBS_Namespace;
|
38
|
-
VALUE RBS_TypeName;
|
39
|
-
|
40
|
-
VALUE RBS_Types_Alias;
|
41
|
-
VALUE RBS_Types_Bases_Any;
|
42
|
-
VALUE RBS_Types_Bases_Bool;
|
43
|
-
VALUE RBS_Types_Bases_Bottom;
|
44
|
-
VALUE RBS_Types_Bases_Class;
|
45
|
-
VALUE RBS_Types_Bases_Instance;
|
46
|
-
VALUE RBS_Types_Bases_Nil;
|
47
|
-
VALUE RBS_Types_Bases_Self;
|
48
|
-
VALUE RBS_Types_Bases_Top;
|
49
|
-
VALUE RBS_Types_Bases_Void;
|
50
|
-
VALUE RBS_Types_Bases;
|
51
|
-
VALUE RBS_Types_Block;
|
52
|
-
VALUE RBS_Types_ClassInstance;
|
53
|
-
VALUE RBS_Types_ClassSingleton;
|
54
|
-
VALUE RBS_Types_Function_Param;
|
55
|
-
VALUE RBS_Types_Function;
|
56
|
-
VALUE RBS_Types_Interface;
|
57
|
-
VALUE RBS_Types_Intersection;
|
58
|
-
VALUE RBS_Types_Literal;
|
59
|
-
VALUE RBS_Types_Optional;
|
60
|
-
VALUE RBS_Types_Proc;
|
61
|
-
VALUE RBS_Types_Record;
|
62
|
-
VALUE RBS_Types_Tuple;
|
63
|
-
VALUE RBS_Types_Union;
|
64
|
-
VALUE RBS_Types_Variable;
|
65
|
-
VALUE RBS_Types;
|
66
|
-
VALUE RBS_MethodType;
|
67
|
-
|
68
|
-
VALUE RBS_ParsingError;
|
69
|
-
|
70
|
-
void rbs__init_constants(void) {
|
71
|
-
ID id_RBS = rb_intern_const("RBS");
|
72
|
-
|
73
|
-
RBS = rb_const_get(rb_cObject, id_RBS);
|
74
|
-
RBS_ParsingError = rb_const_get(RBS, rb_intern("ParsingError"));
|
75
|
-
RBS_AST = rb_const_get(RBS, rb_intern("AST"));
|
76
|
-
RBS_AST_Comment = rb_const_get(RBS_AST, rb_intern("Comment"));
|
77
|
-
RBS_AST_Annotation = rb_const_get(RBS_AST, rb_intern("Annotation"));
|
78
|
-
RBS_AST_TypeParam = rb_const_get(RBS_AST, rb_intern("TypeParam"));
|
79
|
-
|
80
|
-
RBS_AST_Declarations = rb_const_get(RBS_AST, rb_intern("Declarations"));
|
81
|
-
|
82
|
-
RBS_AST_Declarations_Alias = rb_const_get(RBS_AST_Declarations, rb_intern("Alias"));
|
83
|
-
RBS_AST_Declarations_Constant = rb_const_get(RBS_AST_Declarations, rb_intern("Constant"));
|
84
|
-
RBS_AST_Declarations_Global = rb_const_get(RBS_AST_Declarations, rb_intern("Global"));
|
85
|
-
RBS_AST_Declarations_Interface = rb_const_get(RBS_AST_Declarations, rb_intern("Interface"));
|
86
|
-
RBS_AST_Declarations_Module = rb_const_get(RBS_AST_Declarations, rb_intern("Module"));
|
87
|
-
RBS_AST_Declarations_Module_Self = rb_const_get(RBS_AST_Declarations_Module, rb_intern("Self"));
|
88
|
-
RBS_AST_Declarations_Class = rb_const_get(RBS_AST_Declarations, rb_intern("Class"));
|
89
|
-
RBS_AST_Declarations_Class_Super = rb_const_get(RBS_AST_Declarations_Class, rb_intern("Super"));
|
90
|
-
|
91
|
-
RBS_AST_Members = rb_const_get(RBS_AST, rb_intern("Members"));
|
92
|
-
RBS_AST_Members_Alias = rb_const_get(RBS_AST_Members, rb_intern("Alias"));
|
93
|
-
RBS_AST_Members_AttrAccessor = rb_const_get(RBS_AST_Members, rb_intern("AttrAccessor"));
|
94
|
-
RBS_AST_Members_AttrReader = rb_const_get(RBS_AST_Members, rb_intern("AttrReader"));
|
95
|
-
RBS_AST_Members_AttrWriter = rb_const_get(RBS_AST_Members, rb_intern("AttrWriter"));
|
96
|
-
RBS_AST_Members_ClassInstanceVariable = rb_const_get(RBS_AST_Members, rb_intern("ClassInstanceVariable"));
|
97
|
-
RBS_AST_Members_ClassVariable = rb_const_get(RBS_AST_Members, rb_intern("ClassVariable"));
|
98
|
-
RBS_AST_Members_Extend = rb_const_get(RBS_AST_Members, rb_intern("Extend"));
|
99
|
-
RBS_AST_Members_Include = rb_const_get(RBS_AST_Members, rb_intern("Include"));
|
100
|
-
RBS_AST_Members_InstanceVariable = rb_const_get(RBS_AST_Members, rb_intern("InstanceVariable"));
|
101
|
-
RBS_AST_Members_MethodDefinition = rb_const_get(RBS_AST_Members, rb_intern("MethodDefinition"));
|
102
|
-
RBS_AST_Members_Prepend = rb_const_get(RBS_AST_Members, rb_intern("Prepend"));
|
103
|
-
RBS_AST_Members_Private = rb_const_get(RBS_AST_Members, rb_intern("Private"));
|
104
|
-
RBS_AST_Members_Public = rb_const_get(RBS_AST_Members, rb_intern("Public"));
|
105
|
-
|
106
|
-
RBS_Namespace = rb_const_get(RBS, rb_intern("Namespace"));
|
107
|
-
RBS_TypeName = rb_const_get(RBS, rb_intern("TypeName"));
|
108
|
-
RBS_Types = rb_const_get(RBS, rb_intern("Types"));
|
109
|
-
RBS_Types_Alias = rb_const_get(RBS_Types, rb_intern("Alias"));
|
110
|
-
RBS_Types_Bases = rb_const_get(RBS_Types, rb_intern("Bases"));
|
111
|
-
RBS_Types_Bases_Any = rb_const_get(RBS_Types_Bases, rb_intern("Any"));
|
112
|
-
RBS_Types_Bases_Bool = rb_const_get(RBS_Types_Bases, rb_intern("Bool"));
|
113
|
-
RBS_Types_Bases_Bottom = rb_const_get(RBS_Types_Bases, rb_intern("Bottom"));
|
114
|
-
RBS_Types_Bases_Class = rb_const_get(RBS_Types_Bases, rb_intern("Class"));
|
115
|
-
RBS_Types_Bases_Instance = rb_const_get(RBS_Types_Bases, rb_intern("Instance"));
|
116
|
-
RBS_Types_Bases_Nil = rb_const_get(RBS_Types_Bases, rb_intern("Nil"));
|
117
|
-
RBS_Types_Bases_Self = rb_const_get(RBS_Types_Bases, rb_intern("Self"));
|
118
|
-
RBS_Types_Bases_Top = rb_const_get(RBS_Types_Bases, rb_intern("Top"));
|
119
|
-
RBS_Types_Bases_Void = rb_const_get(RBS_Types_Bases, rb_intern("Void"));
|
120
|
-
RBS_Types_Block = rb_const_get(RBS_Types, rb_intern("Block"));
|
121
|
-
RBS_Types_ClassInstance = rb_const_get(RBS_Types, rb_intern("ClassInstance"));
|
122
|
-
RBS_Types_ClassSingleton = rb_const_get(RBS_Types, rb_intern("ClassSingleton"));
|
123
|
-
RBS_Types_Function = rb_const_get(RBS_Types, rb_intern("Function"));
|
124
|
-
RBS_Types_Function_Param = rb_const_get(RBS_Types_Function, rb_intern("Param"));
|
125
|
-
RBS_Types_Interface = rb_const_get(RBS_Types, rb_intern("Interface"));
|
126
|
-
RBS_Types_Intersection = rb_const_get(RBS_Types, rb_intern("Intersection"));
|
127
|
-
RBS_Types_Literal = rb_const_get(RBS_Types, rb_intern("Literal"));
|
128
|
-
RBS_Types_Optional = rb_const_get(RBS_Types, rb_intern("Optional"));
|
129
|
-
RBS_Types_Proc = rb_const_get(RBS_Types, rb_intern("Proc"));
|
130
|
-
RBS_Types_Record = rb_const_get(RBS_Types, rb_intern("Record"));
|
131
|
-
RBS_Types_Tuple = rb_const_get(RBS_Types, rb_intern("Tuple"));
|
132
|
-
RBS_Types_Union = rb_const_get(RBS_Types, rb_intern("Union"));
|
133
|
-
RBS_Types_Variable = rb_const_get(RBS_Types, rb_intern("Variable"));
|
134
|
-
RBS_MethodType = rb_const_get(RBS, rb_intern("MethodType"));
|
135
|
-
}
|
@@ -1,525 +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_function(
|
174
|
-
VALUE required_positional_params,
|
175
|
-
VALUE optional_positional_params,
|
176
|
-
VALUE rest_positional_param,
|
177
|
-
VALUE trailing_positional_params,
|
178
|
-
VALUE required_keyword_params,
|
179
|
-
VALUE optional_keyword_params,
|
180
|
-
VALUE rest_keyword_param,
|
181
|
-
VALUE return_type
|
182
|
-
) {
|
183
|
-
VALUE args = rb_hash_new();
|
184
|
-
rb_hash_aset(args, ID2SYM(rb_intern("required_positionals")), required_positional_params);
|
185
|
-
rb_hash_aset(args, ID2SYM(rb_intern("optional_positionals")), optional_positional_params);
|
186
|
-
rb_hash_aset(args, ID2SYM(rb_intern("rest_positionals")), rest_positional_param);
|
187
|
-
rb_hash_aset(args, ID2SYM(rb_intern("trailing_positionals")), trailing_positional_params);
|
188
|
-
rb_hash_aset(args, ID2SYM(rb_intern("required_keywords")), required_keyword_params);
|
189
|
-
rb_hash_aset(args, ID2SYM(rb_intern("optional_keywords")), optional_keyword_params);
|
190
|
-
rb_hash_aset(args, ID2SYM(rb_intern("rest_keywords")), rest_keyword_param);
|
191
|
-
rb_hash_aset(args, ID2SYM(rb_intern("return_type")), return_type);
|
192
|
-
|
193
|
-
return CLASS_NEW_INSTANCE(
|
194
|
-
RBS_Types_Function,
|
195
|
-
1,
|
196
|
-
&args
|
197
|
-
);
|
198
|
-
}
|
199
|
-
|
200
|
-
VALUE rbs_proc(VALUE function, VALUE block, VALUE location, VALUE self_type) {
|
201
|
-
VALUE args = rb_hash_new();
|
202
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), function);
|
203
|
-
rb_hash_aset(args, ID2SYM(rb_intern("block")), block);
|
204
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
205
|
-
rb_hash_aset(args, ID2SYM(rb_intern("self_type")), self_type);
|
206
|
-
|
207
|
-
return CLASS_NEW_INSTANCE(
|
208
|
-
RBS_Types_Proc,
|
209
|
-
1,
|
210
|
-
&args
|
211
|
-
);
|
212
|
-
}
|
213
|
-
|
214
|
-
VALUE rbs_void(VALUE location) {
|
215
|
-
VALUE args = rb_hash_new();
|
216
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
217
|
-
|
218
|
-
return CLASS_NEW_INSTANCE(
|
219
|
-
RBS_Types_Bases_Void,
|
220
|
-
1,
|
221
|
-
&args
|
222
|
-
);
|
223
|
-
}
|
224
|
-
|
225
|
-
VALUE rbs_literal(VALUE literal, VALUE location) {
|
226
|
-
VALUE args = rb_hash_new();
|
227
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
228
|
-
rb_hash_aset(args, ID2SYM(rb_intern("literal")), literal);
|
229
|
-
|
230
|
-
return CLASS_NEW_INSTANCE(
|
231
|
-
RBS_Types_Literal,
|
232
|
-
1,
|
233
|
-
&args
|
234
|
-
);
|
235
|
-
}
|
236
|
-
|
237
|
-
VALUE rbs_record(VALUE fields, VALUE location) {
|
238
|
-
VALUE args = rb_hash_new();
|
239
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
240
|
-
rb_hash_aset(args, ID2SYM(rb_intern("fields")), fields);
|
241
|
-
|
242
|
-
return CLASS_NEW_INSTANCE(
|
243
|
-
RBS_Types_Record,
|
244
|
-
1,
|
245
|
-
&args
|
246
|
-
);
|
247
|
-
}
|
248
|
-
|
249
|
-
VALUE rbs_variable(VALUE name, VALUE location) {
|
250
|
-
VALUE args = rb_hash_new();
|
251
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
252
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
253
|
-
|
254
|
-
return CLASS_NEW_INSTANCE(
|
255
|
-
RBS_Types_Variable,
|
256
|
-
1,
|
257
|
-
&args
|
258
|
-
);
|
259
|
-
}
|
260
|
-
|
261
|
-
VALUE rbs_method_type(VALUE type_params, VALUE type, VALUE block, VALUE location) {
|
262
|
-
VALUE args = rb_hash_new();
|
263
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
264
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
265
|
-
rb_hash_aset(args, ID2SYM(rb_intern("block")), block);
|
266
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
267
|
-
|
268
|
-
return CLASS_NEW_INSTANCE(
|
269
|
-
RBS_MethodType,
|
270
|
-
1,
|
271
|
-
&args
|
272
|
-
);
|
273
|
-
}
|
274
|
-
|
275
|
-
VALUE rbs_ast_comment(VALUE string, VALUE location) {
|
276
|
-
VALUE args = rb_hash_new();
|
277
|
-
rb_hash_aset(args, ID2SYM(rb_intern("string")), string);
|
278
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
279
|
-
|
280
|
-
return CLASS_NEW_INSTANCE(
|
281
|
-
RBS_AST_Comment,
|
282
|
-
1,
|
283
|
-
&args
|
284
|
-
);
|
285
|
-
}
|
286
|
-
|
287
|
-
VALUE rbs_ast_annotation(VALUE string, VALUE location) {
|
288
|
-
VALUE args = rb_hash_new();
|
289
|
-
rb_hash_aset(args, ID2SYM(rb_intern("string")), string);
|
290
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
291
|
-
|
292
|
-
return CLASS_NEW_INSTANCE(
|
293
|
-
RBS_AST_Annotation,
|
294
|
-
1,
|
295
|
-
&args
|
296
|
-
);
|
297
|
-
}
|
298
|
-
|
299
|
-
VALUE rbs_ast_type_param(VALUE name, VALUE variance, bool unchecked, VALUE upper_bound, VALUE location) {
|
300
|
-
VALUE args = rb_hash_new();
|
301
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
302
|
-
rb_hash_aset(args, ID2SYM(rb_intern("variance")), variance);
|
303
|
-
rb_hash_aset(args, ID2SYM(rb_intern("upper_bound")), upper_bound);
|
304
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
305
|
-
|
306
|
-
VALUE type_param = CLASS_NEW_INSTANCE(RBS_AST_TypeParam, 1, &args);
|
307
|
-
|
308
|
-
if (unchecked) {
|
309
|
-
rb_funcall(type_param, rb_intern("unchecked!"), 0);
|
310
|
-
}
|
311
|
-
|
312
|
-
return type_param;
|
313
|
-
}
|
314
|
-
|
315
|
-
VALUE rbs_ast_decl_constant(VALUE name, VALUE type, VALUE location, VALUE comment) {
|
316
|
-
VALUE args = rb_hash_new();
|
317
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
318
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
319
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
320
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
321
|
-
|
322
|
-
return CLASS_NEW_INSTANCE(
|
323
|
-
RBS_AST_Declarations_Constant,
|
324
|
-
1,
|
325
|
-
&args
|
326
|
-
);
|
327
|
-
}
|
328
|
-
|
329
|
-
VALUE rbs_ast_decl_global(VALUE name, VALUE type, VALUE location, VALUE comment) {
|
330
|
-
VALUE args = rb_hash_new();
|
331
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
332
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
333
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
334
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
335
|
-
|
336
|
-
return CLASS_NEW_INSTANCE(
|
337
|
-
RBS_AST_Declarations_Global,
|
338
|
-
1,
|
339
|
-
&args
|
340
|
-
);
|
341
|
-
}
|
342
|
-
|
343
|
-
VALUE rbs_ast_decl_alias(VALUE name, VALUE type_params, VALUE type, VALUE annotations, VALUE location, VALUE comment) {
|
344
|
-
VALUE args = rb_hash_new();
|
345
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
346
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
347
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
348
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
349
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
350
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
351
|
-
|
352
|
-
return CLASS_NEW_INSTANCE(
|
353
|
-
RBS_AST_Declarations_Alias,
|
354
|
-
1,
|
355
|
-
&args
|
356
|
-
);
|
357
|
-
}
|
358
|
-
|
359
|
-
VALUE rbs_ast_decl_interface(VALUE name, VALUE type_params, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
360
|
-
VALUE args = rb_hash_new();
|
361
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
362
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
363
|
-
rb_hash_aset(args, ID2SYM(rb_intern("members")), members);
|
364
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
365
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
366
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
367
|
-
|
368
|
-
return CLASS_NEW_INSTANCE(
|
369
|
-
RBS_AST_Declarations_Interface,
|
370
|
-
1,
|
371
|
-
&args
|
372
|
-
);
|
373
|
-
}
|
374
|
-
|
375
|
-
VALUE rbs_ast_decl_module_self(VALUE name, VALUE args, VALUE location) {
|
376
|
-
VALUE kw_args = rb_hash_new();
|
377
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("name")), name);
|
378
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("args")), args);
|
379
|
-
rb_hash_aset(kw_args, ID2SYM(rb_intern("location")), location);
|
380
|
-
|
381
|
-
return CLASS_NEW_INSTANCE(
|
382
|
-
RBS_AST_Declarations_Module_Self,
|
383
|
-
1,
|
384
|
-
&kw_args
|
385
|
-
);
|
386
|
-
}
|
387
|
-
|
388
|
-
VALUE rbs_ast_decl_module(VALUE name, VALUE type_params, VALUE self_types, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
389
|
-
VALUE args = rb_hash_new();
|
390
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
391
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type_params")), type_params);
|
392
|
-
rb_hash_aset(args, ID2SYM(rb_intern("self_types")), self_types);
|
393
|
-
rb_hash_aset(args, ID2SYM(rb_intern("members")), members);
|
394
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
395
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
396
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
397
|
-
|
398
|
-
return CLASS_NEW_INSTANCE(
|
399
|
-
RBS_AST_Declarations_Module,
|
400
|
-
1,
|
401
|
-
&args
|
402
|
-
);
|
403
|
-
}
|
404
|
-
|
405
|
-
VALUE rbs_ast_members_method_definition(VALUE name, VALUE kind, VALUE types, VALUE annotations, VALUE location, VALUE comment, VALUE overload, VALUE visibility) {
|
406
|
-
VALUE args = rb_hash_new();
|
407
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
408
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
409
|
-
rb_hash_aset(args, ID2SYM(rb_intern("types")), types);
|
410
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
411
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
412
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
413
|
-
rb_hash_aset(args, ID2SYM(rb_intern("overload")), overload);
|
414
|
-
rb_hash_aset(args, ID2SYM(rb_intern("visibility")), visibility);
|
415
|
-
|
416
|
-
return CLASS_NEW_INSTANCE(
|
417
|
-
RBS_AST_Members_MethodDefinition,
|
418
|
-
1,
|
419
|
-
&args
|
420
|
-
);
|
421
|
-
}
|
422
|
-
|
423
|
-
VALUE rbs_ast_members_variable(VALUE klass, VALUE name, VALUE type, VALUE location, VALUE comment) {
|
424
|
-
VALUE args = rb_hash_new();
|
425
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
426
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
427
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
428
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
429
|
-
|
430
|
-
return CLASS_NEW_INSTANCE(
|
431
|
-
klass,
|
432
|
-
1,
|
433
|
-
&args
|
434
|
-
);
|
435
|
-
}
|
436
|
-
|
437
|
-
VALUE rbs_ast_members_mixin(VALUE klass, VALUE name, VALUE module_args, VALUE annotations, VALUE location, VALUE comment) {
|
438
|
-
VALUE args = rb_hash_new();
|
439
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
440
|
-
rb_hash_aset(args, ID2SYM(rb_intern("args")), module_args);
|
441
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
442
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
443
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
444
|
-
|
445
|
-
return CLASS_NEW_INSTANCE(
|
446
|
-
klass,
|
447
|
-
1,
|
448
|
-
&args
|
449
|
-
);
|
450
|
-
}
|
451
|
-
|
452
|
-
VALUE rbs_ast_members_attribute(VALUE klass, VALUE name, VALUE type, VALUE ivar_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment, VALUE visibility) {
|
453
|
-
VALUE args = rb_hash_new();
|
454
|
-
rb_hash_aset(args, ID2SYM(rb_intern("name")), name);
|
455
|
-
rb_hash_aset(args, ID2SYM(rb_intern("type")), type);
|
456
|
-
rb_hash_aset(args, ID2SYM(rb_intern("ivar_name")), ivar_name);
|
457
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
458
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
459
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
460
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
461
|
-
rb_hash_aset(args, ID2SYM(rb_intern("visibility")), visibility);
|
462
|
-
|
463
|
-
return CLASS_NEW_INSTANCE(
|
464
|
-
klass,
|
465
|
-
1,
|
466
|
-
&args
|
467
|
-
);
|
468
|
-
}
|
469
|
-
|
470
|
-
VALUE rbs_ast_members_visibility(VALUE klass, VALUE location) {
|
471
|
-
VALUE args = rb_hash_new();
|
472
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
473
|
-
|
474
|
-
return CLASS_NEW_INSTANCE(
|
475
|
-
klass,
|
476
|
-
1,
|
477
|
-
&args
|
478
|
-
);
|
479
|
-
}
|
480
|
-
|
481
|
-
VALUE rbs_ast_members_alias(VALUE new_name, VALUE old_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment) {
|
482
|
-
VALUE args = rb_hash_new();
|
483
|
-
rb_hash_aset(args, ID2SYM(rb_intern("new_name")), new_name);
|
484
|
-
rb_hash_aset(args, ID2SYM(rb_intern("old_name")), old_name);
|
485
|
-
rb_hash_aset(args, ID2SYM(rb_intern("kind")), kind);
|
486
|
-
rb_hash_aset(args, ID2SYM(rb_intern("annotations")), annotations);
|
487
|
-
rb_hash_aset(args, ID2SYM(rb_intern("location")), location);
|
488
|
-
rb_hash_aset(args, ID2SYM(rb_intern("comment")), comment);
|
489
|
-
|
490
|
-
return CLASS_NEW_INSTANCE(
|
491
|
-
RBS_AST_Members_Alias,
|
492
|
-
1,
|
493
|
-
&args
|
494
|
-
);
|
495
|
-
}
|
496
|
-
|
497
|
-
VALUE rbs_ast_decl_class_super(VALUE name, VALUE args, VALUE location) {
|
498
|
-
VALUE kwargs = rb_hash_new();
|
499
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("name")), name);
|
500
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("args")), args);
|
501
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
502
|
-
|
503
|
-
return CLASS_NEW_INSTANCE(
|
504
|
-
RBS_AST_Declarations_Class_Super,
|
505
|
-
1,
|
506
|
-
&kwargs
|
507
|
-
);
|
508
|
-
}
|
509
|
-
|
510
|
-
VALUE rbs_ast_decl_class(VALUE name, VALUE type_params, VALUE super_class, VALUE members, VALUE annotations, VALUE location, VALUE comment) {
|
511
|
-
VALUE kwargs = rb_hash_new();
|
512
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("name")), name);
|
513
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("type_params")), type_params);
|
514
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("super_class")), super_class);
|
515
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("members")), members);
|
516
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("annotations")), annotations);
|
517
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("location")), location);
|
518
|
-
rb_hash_aset(kwargs, ID2SYM(rb_intern("comment")), comment);
|
519
|
-
|
520
|
-
return CLASS_NEW_INSTANCE(
|
521
|
-
RBS_AST_Declarations_Class,
|
522
|
-
1,
|
523
|
-
&kwargs
|
524
|
-
);
|
525
|
-
}
|
@@ -1,43 +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 location);
|
10
|
-
VALUE rbs_ast_decl_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_members_alias(VALUE new_name, VALUE old_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment);
|
19
|
-
VALUE rbs_ast_members_attribute(VALUE klass, VALUE name, VALUE type, VALUE ivar_name, VALUE kind, VALUE annotations, VALUE location, VALUE comment, VALUE visibility);
|
20
|
-
VALUE rbs_ast_members_method_definition(VALUE name, VALUE kind, VALUE types, VALUE annotations, VALUE location, VALUE comment, VALUE overload, VALUE visibility);
|
21
|
-
VALUE rbs_ast_members_mixin(VALUE klass, VALUE name, VALUE args, VALUE annotations, VALUE location, VALUE comment);
|
22
|
-
VALUE rbs_ast_members_variable(VALUE klass, VALUE name, VALUE type, VALUE location, VALUE comment);
|
23
|
-
VALUE rbs_ast_members_visibility(VALUE klass, VALUE location);
|
24
|
-
VALUE rbs_base_type(VALUE klass, VALUE location);
|
25
|
-
VALUE rbs_block(VALUE type, VALUE required, VALUE self_type);
|
26
|
-
VALUE rbs_class_instance(VALUE typename, VALUE type_args, VALUE location);
|
27
|
-
VALUE rbs_class_singleton(VALUE typename, VALUE location);
|
28
|
-
VALUE rbs_function_param(VALUE type, VALUE name, VALUE location);
|
29
|
-
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);
|
30
|
-
VALUE rbs_interface(VALUE typename, VALUE type_args, VALUE location);
|
31
|
-
VALUE rbs_intersection(VALUE types, VALUE location);
|
32
|
-
VALUE rbs_literal(VALUE literal, VALUE location);
|
33
|
-
VALUE rbs_method_type(VALUE type_params, VALUE type, VALUE block, VALUE location);
|
34
|
-
VALUE rbs_namespace(VALUE path, VALUE absolute);
|
35
|
-
VALUE rbs_optional(VALUE type, VALUE location);
|
36
|
-
VALUE rbs_proc(VALUE function, VALUE block, VALUE location, VALUE self_type);
|
37
|
-
VALUE rbs_record(VALUE fields, VALUE location);
|
38
|
-
VALUE rbs_tuple(VALUE types, VALUE location);
|
39
|
-
VALUE rbs_type_name(VALUE namespace, VALUE name);
|
40
|
-
VALUE rbs_union(VALUE types, VALUE location);
|
41
|
-
VALUE rbs_variable(VALUE name, VALUE location);
|
42
|
-
|
43
|
-
#endif
|