rbs 4.1.0.pre.2-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 +7 -0
- data/.clang-format +75 -0
- data/.clangd +2 -0
- data/.github/dependabot.yml +24 -0
- data/.github/workflows/bundle-update.yml +63 -0
- data/.github/workflows/c-check.yml +61 -0
- data/.github/workflows/comments.yml +37 -0
- data/.github/workflows/dependabot.yml +30 -0
- data/.github/workflows/jruby.yml +67 -0
- data/.github/workflows/milestone.yml +83 -0
- data/.github/workflows/ruby.yml +158 -0
- data/.github/workflows/rust.yml +184 -0
- data/.github/workflows/truffleruby.yml +54 -0
- data/.github/workflows/typecheck.yml +39 -0
- data/.github/workflows/wasm.yml +53 -0
- data/.github/workflows/windows.yml +49 -0
- data/.gitignore +38 -0
- data/.rubocop.yml +72 -0
- data/BSDL +22 -0
- data/CHANGELOG.md +2292 -0
- data/COPYING +56 -0
- data/README.md +240 -0
- data/Rakefile +869 -0
- data/Steepfile +53 -0
- data/config.yml +913 -0
- data/core/array.rbs +4142 -0
- data/core/basic_object.rbs +376 -0
- data/core/binding.rbs +148 -0
- data/core/builtin.rbs +278 -0
- data/core/class.rbs +223 -0
- data/core/comparable.rbs +192 -0
- data/core/complex.rbs +812 -0
- data/core/constants.rbs +96 -0
- data/core/data.rbs +415 -0
- data/core/dir.rbs +993 -0
- data/core/encoding.rbs +1368 -0
- data/core/enumerable.rbs +2506 -0
- data/core/enumerator/arithmetic_sequence.rbs +70 -0
- data/core/enumerator/product.rbs +92 -0
- data/core/enumerator.rbs +705 -0
- data/core/env.rbs +6 -0
- data/core/errno.rbs +682 -0
- data/core/errors.rbs +789 -0
- data/core/exception.rbs +485 -0
- data/core/false_class.rbs +82 -0
- data/core/fiber.rbs +570 -0
- data/core/fiber_error.rbs +11 -0
- data/core/file.rbs +2045 -0
- data/core/file_constants.rbs +463 -0
- data/core/file_stat.rbs +534 -0
- data/core/file_test.rbs +331 -0
- data/core/float.rbs +1316 -0
- data/core/gc.rbs +788 -0
- data/core/global_variables.rbs +184 -0
- data/core/hash.rbs +2183 -0
- data/core/integer.rbs +1374 -0
- data/core/io/buffer.rbs +995 -0
- data/core/io/wait.rbs +48 -0
- data/core/io.rbs +3472 -0
- data/core/kernel.rbs +3172 -0
- data/core/marshal.rbs +207 -0
- data/core/match_data.rbs +637 -0
- data/core/math.rbs +770 -0
- data/core/method.rbs +422 -0
- data/core/module.rbs +1856 -0
- data/core/nil_class.rbs +210 -0
- data/core/numeric.rbs +832 -0
- data/core/object.rbs +108 -0
- data/core/object_space/weak_key_map.rbs +166 -0
- data/core/object_space.rbs +197 -0
- data/core/pathname.rbs +1322 -0
- data/core/proc.rbs +905 -0
- data/core/process.rbs +2316 -0
- data/core/ractor.rbs +924 -0
- data/core/random.rbs +255 -0
- data/core/range.rbs +1209 -0
- data/core/rational.rbs +502 -0
- data/core/rb_config.rbs +88 -0
- data/core/rbs/ops.rbs +154 -0
- data/core/rbs/unnamed/argf.rbs +1236 -0
- data/core/rbs/unnamed/env_class.rbs +1214 -0
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +186 -0
- data/core/refinement.rbs +59 -0
- data/core/regexp.rbs +1974 -0
- data/core/ruby.rbs +53 -0
- data/core/ruby_vm.rbs +809 -0
- data/core/rubygems/basic_specification.rbs +6 -0
- data/core/rubygems/config_file.rbs +38 -0
- data/core/rubygems/dependency_installer.rbs +6 -0
- data/core/rubygems/errors.rbs +109 -0
- data/core/rubygems/installer.rbs +15 -0
- data/core/rubygems/path_support.rbs +6 -0
- data/core/rubygems/platform.rbs +7 -0
- data/core/rubygems/request_set.rbs +49 -0
- data/core/rubygems/requirement.rbs +148 -0
- data/core/rubygems/rubygems.rbs +1105 -0
- data/core/rubygems/source_list.rbs +15 -0
- data/core/rubygems/specification.rbs +23 -0
- data/core/rubygems/stream_ui.rbs +5 -0
- data/core/rubygems/uninstaller.rbs +10 -0
- data/core/rubygems/version.rbs +293 -0
- data/core/set.rbs +751 -0
- data/core/signal.rbs +110 -0
- data/core/string.rbs +5532 -0
- data/core/struct.rbs +668 -0
- data/core/symbol.rbs +482 -0
- data/core/thread.rbs +1826 -0
- data/core/thread_group.rbs +79 -0
- data/core/time.rbs +1793 -0
- data/core/trace_point.rbs +483 -0
- data/core/true_class.rbs +98 -0
- data/core/unbound_method.rbs +337 -0
- data/core/warning.rbs +87 -0
- data/docs/CONTRIBUTING.md +107 -0
- data/docs/aliases.md +79 -0
- data/docs/architecture.md +110 -0
- data/docs/collection.md +192 -0
- data/docs/config.md +171 -0
- data/docs/data_and_struct.md +86 -0
- data/docs/encoding.md +56 -0
- data/docs/gem.md +56 -0
- data/docs/inline.md +634 -0
- data/docs/rbs_by_example.md +309 -0
- data/docs/repo.md +125 -0
- data/docs/rust.md +96 -0
- data/docs/sigs.md +167 -0
- data/docs/stdlib.md +147 -0
- data/docs/syntax.md +940 -0
- data/docs/tools.md +17 -0
- data/docs/type_fingerprint.md +21 -0
- data/docs/wasm_serialization.md +80 -0
- data/exe/rbs +7 -0
- data/ext/rbs_extension/ast_translation.c +1855 -0
- data/ext/rbs_extension/ast_translation.h +41 -0
- data/ext/rbs_extension/class_constants.c +187 -0
- data/ext/rbs_extension/class_constants.h +104 -0
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +40 -0
- data/ext/rbs_extension/legacy_location.c +294 -0
- data/ext/rbs_extension/legacy_location.h +82 -0
- data/ext/rbs_extension/main.c +613 -0
- data/ext/rbs_extension/rbs_extension.h +16 -0
- data/ext/rbs_extension/rbs_string_bridging.c +9 -0
- data/ext/rbs_extension/rbs_string_bridging.h +24 -0
- data/goodcheck.yml +91 -0
- data/include/rbs/ast.h +1047 -0
- data/include/rbs/defines.h +99 -0
- data/include/rbs/lexer.h +207 -0
- data/include/rbs/location.h +40 -0
- data/include/rbs/parser.h +153 -0
- data/include/rbs/serialize.h +39 -0
- data/include/rbs/string.h +47 -0
- data/include/rbs/util/rbs_allocator.h +59 -0
- data/include/rbs/util/rbs_assert.h +20 -0
- data/include/rbs/util/rbs_buffer.h +83 -0
- data/include/rbs/util/rbs_constant_pool.h +155 -0
- data/include/rbs/util/rbs_encoding.h +282 -0
- data/include/rbs/util/rbs_unescape.h +24 -0
- data/include/rbs.h +14 -0
- data/lib/rbs/ancestor_graph.rb +92 -0
- data/lib/rbs/annotate/annotations.rb +199 -0
- data/lib/rbs/annotate/formatter.rb +82 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +131 -0
- data/lib/rbs/annotate.rb +8 -0
- data/lib/rbs/ast/annotation.rb +29 -0
- data/lib/rbs/ast/comment.rb +29 -0
- data/lib/rbs/ast/declarations.rb +472 -0
- data/lib/rbs/ast/directives.rb +49 -0
- data/lib/rbs/ast/members.rb +451 -0
- data/lib/rbs/ast/ruby/annotations.rb +451 -0
- data/lib/rbs/ast/ruby/comment_block.rb +247 -0
- data/lib/rbs/ast/ruby/declarations.rb +291 -0
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
- data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
- data/lib/rbs/ast/ruby/members.rb +762 -0
- data/lib/rbs/ast/type_param.rb +235 -0
- data/lib/rbs/ast/visitor.rb +137 -0
- data/lib/rbs/buffer.rb +189 -0
- data/lib/rbs/builtin_names.rb +58 -0
- data/lib/rbs/cli/colored_io.rb +48 -0
- data/lib/rbs/cli/diff.rb +84 -0
- data/lib/rbs/cli/validate.rb +294 -0
- data/lib/rbs/cli.rb +1253 -0
- data/lib/rbs/collection/cleaner.rb +38 -0
- data/lib/rbs/collection/config/lockfile.rb +92 -0
- data/lib/rbs/collection/config/lockfile_generator.rb +269 -0
- data/lib/rbs/collection/config.rb +81 -0
- data/lib/rbs/collection/installer.rb +32 -0
- data/lib/rbs/collection/sources/base.rb +14 -0
- data/lib/rbs/collection/sources/git.rb +265 -0
- data/lib/rbs/collection/sources/local.rb +81 -0
- data/lib/rbs/collection/sources/rubygems.rb +48 -0
- data/lib/rbs/collection/sources/stdlib.rb +50 -0
- data/lib/rbs/collection/sources.rb +38 -0
- data/lib/rbs/collection.rb +16 -0
- data/lib/rbs/constant.rb +28 -0
- data/lib/rbs/definition.rb +415 -0
- data/lib/rbs/definition_builder/ancestor_builder.rb +678 -0
- data/lib/rbs/definition_builder/method_builder.rb +295 -0
- data/lib/rbs/definition_builder.rb +1054 -0
- data/lib/rbs/diff.rb +131 -0
- data/lib/rbs/environment/class_entry.rb +69 -0
- data/lib/rbs/environment/module_entry.rb +66 -0
- data/lib/rbs/environment/use_map.rb +77 -0
- data/lib/rbs/environment.rb +1028 -0
- data/lib/rbs/environment_loader.rb +167 -0
- data/lib/rbs/environment_walker.rb +155 -0
- data/lib/rbs/errors.rb +634 -0
- data/lib/rbs/factory.rb +18 -0
- data/lib/rbs/file_finder.rb +28 -0
- data/lib/rbs/inline_parser/comment_association.rb +117 -0
- data/lib/rbs/inline_parser.rb +568 -0
- data/lib/rbs/location_aux.rb +170 -0
- data/lib/rbs/locator.rb +247 -0
- data/lib/rbs/method_type.rb +145 -0
- data/lib/rbs/namespace.rb +154 -0
- data/lib/rbs/parser/lex_result.rb +15 -0
- data/lib/rbs/parser/token.rb +23 -0
- data/lib/rbs/parser_aux.rb +142 -0
- data/lib/rbs/prototype/helpers.rb +197 -0
- data/lib/rbs/prototype/node_usage.rb +99 -0
- data/lib/rbs/prototype/rb.rb +816 -0
- data/lib/rbs/prototype/rbi.rb +625 -0
- 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 +680 -0
- data/lib/rbs/repository.rb +127 -0
- data/lib/rbs/resolver/constant_resolver.rb +219 -0
- data/lib/rbs/resolver/type_name_resolver.rb +167 -0
- data/lib/rbs/rewriter.rb +70 -0
- data/lib/rbs/sorter.rb +198 -0
- data/lib/rbs/source.rb +99 -0
- data/lib/rbs/substitution.rb +83 -0
- data/lib/rbs/subtractor.rb +204 -0
- data/lib/rbs/test/errors.rb +80 -0
- data/lib/rbs/test/guaranteed.rb +30 -0
- data/lib/rbs/test/hook.rb +212 -0
- data/lib/rbs/test/observer.rb +19 -0
- data/lib/rbs/test/setup.rb +84 -0
- data/lib/rbs/test/setup_helper.rb +50 -0
- data/lib/rbs/test/tester.rb +167 -0
- data/lib/rbs/test/type_check.rb +457 -0
- data/lib/rbs/test.rb +112 -0
- data/lib/rbs/type_alias_dependency.rb +100 -0
- data/lib/rbs/type_alias_regularity.rb +126 -0
- data/lib/rbs/type_name.rb +122 -0
- data/lib/rbs/types.rb +1604 -0
- data/lib/rbs/unit_test/convertibles.rb +177 -0
- data/lib/rbs/unit_test/spy.rb +138 -0
- data/lib/rbs/unit_test/type_assertions.rb +383 -0
- data/lib/rbs/unit_test/with_aliases.rb +145 -0
- data/lib/rbs/unit_test.rb +6 -0
- data/lib/rbs/validator.rb +186 -0
- data/lib/rbs/variance_calculator.rb +189 -0
- data/lib/rbs/vendorer.rb +71 -0
- data/lib/rbs/version.rb +5 -0
- data/lib/rbs/wasm/deserializer.rb +213 -0
- data/lib/rbs/wasm/jars/asm-analysis.jar +0 -0
- data/lib/rbs/wasm/jars/asm-commons.jar +0 -0
- data/lib/rbs/wasm/jars/asm-tree.jar +0 -0
- data/lib/rbs/wasm/jars/asm-util.jar +0 -0
- data/lib/rbs/wasm/jars/asm.jar +0 -0
- data/lib/rbs/wasm/jars/compiler.jar +0 -0
- data/lib/rbs/wasm/jars/log.jar +0 -0
- data/lib/rbs/wasm/jars/runtime.jar +0 -0
- data/lib/rbs/wasm/jars/wasi.jar +0 -0
- data/lib/rbs/wasm/jars/wasm.jar +0 -0
- data/lib/rbs/wasm/location.rb +61 -0
- data/lib/rbs/wasm/parser.rb +137 -0
- data/lib/rbs/wasm/rbs_parser.wasm +0 -0
- data/lib/rbs/wasm/runtime.rb +217 -0
- data/lib/rbs/wasm/serialization_schema.rb +110 -0
- data/lib/rbs/writer.rb +424 -0
- data/lib/rbs.rb +117 -0
- data/lib/rdoc/discover.rb +20 -0
- data/lib/rdoc_plugin/parser.rb +163 -0
- data/rbs.gemspec +68 -0
- data/schema/annotation.json +14 -0
- data/schema/comment.json +26 -0
- data/schema/decls.json +326 -0
- data/schema/function.json +87 -0
- data/schema/location.json +56 -0
- data/schema/members.json +266 -0
- data/schema/methodType.json +50 -0
- data/schema/typeParam.json +52 -0
- data/schema/types.json +317 -0
- data/sig/ancestor_builder.rbs +163 -0
- data/sig/ancestor_graph.rbs +60 -0
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +85 -0
- data/sig/annotate/rdoc_source.rbs +32 -0
- data/sig/annotation.rbs +27 -0
- data/sig/ast/ruby/annotations.rbs +470 -0
- data/sig/ast/ruby/comment_block.rbs +127 -0
- data/sig/ast/ruby/declarations.rbs +158 -0
- data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
- data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
- data/sig/ast/ruby/members.rbs +198 -0
- data/sig/buffer.rbs +108 -0
- data/sig/builtin_names.rbs +44 -0
- data/sig/cli/colored_io.rbs +15 -0
- data/sig/cli/diff.rbs +15 -0
- data/sig/cli/validate.rbs +47 -0
- data/sig/cli.rbs +89 -0
- data/sig/collection/cleaner.rbs +13 -0
- data/sig/collection/config/lockfile.rbs +74 -0
- data/sig/collection/config/lockfile_generator.rbs +68 -0
- data/sig/collection/config.rbs +46 -0
- data/sig/collection/installer.rbs +17 -0
- data/sig/collection/sources.rbs +214 -0
- data/sig/collection.rbs +4 -0
- data/sig/comment.rbs +26 -0
- data/sig/constant.rbs +21 -0
- data/sig/declarations.rbs +274 -0
- data/sig/definition.rbs +232 -0
- data/sig/definition_builder.rbs +181 -0
- data/sig/diff.rbs +28 -0
- data/sig/directives.rbs +77 -0
- data/sig/environment/class_entry.rbs +50 -0
- data/sig/environment/module_entry.rbs +50 -0
- data/sig/environment.rbs +286 -0
- data/sig/environment_loader.rbs +111 -0
- data/sig/environment_walker.rbs +65 -0
- data/sig/errors.rbs +408 -0
- data/sig/factory.rbs +5 -0
- data/sig/file_finder.rbs +28 -0
- data/sig/inline_parser/comment_association.rbs +71 -0
- data/sig/inline_parser.rbs +126 -0
- data/sig/location.rbs +135 -0
- data/sig/locator.rbs +56 -0
- data/sig/manifest.yaml +5 -0
- data/sig/members.rbs +258 -0
- data/sig/method_builder.rbs +89 -0
- data/sig/method_types.rbs +58 -0
- data/sig/namespace.rbs +161 -0
- data/sig/parser.rbs +164 -0
- data/sig/prototype/helpers.rbs +29 -0
- data/sig/prototype/node_usage.rbs +20 -0
- data/sig/prototype/rb.rbs +96 -0
- data/sig/prototype/rbi.rbs +75 -0
- data/sig/prototype/runtime.rbs +182 -0
- data/sig/rbs.rbs +21 -0
- data/sig/rdoc/rbs.rbs +67 -0
- data/sig/repository.rbs +85 -0
- data/sig/resolver/constant_resolver.rbs +92 -0
- data/sig/resolver/context.rbs +34 -0
- data/sig/resolver/type_name_resolver.rbs +61 -0
- data/sig/rewriter.rbs +45 -0
- data/sig/shims/bundler.rbs +38 -0
- data/sig/shims/enumerable.rbs +5 -0
- data/sig/shims/rubygems.rbs +19 -0
- data/sig/sorter.rbs +41 -0
- data/sig/source.rbs +48 -0
- data/sig/substitution.rbs +48 -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 +53 -0
- data/sig/type_alias_regularity.rbs +98 -0
- data/sig/type_param.rbs +115 -0
- data/sig/typename.rbs +89 -0
- data/sig/types.rbs +578 -0
- data/sig/unit_test/convertibles.rbs +154 -0
- data/sig/unit_test/spy.rbs +22 -0
- data/sig/unit_test/type_assertions.rbs +211 -0
- data/sig/unit_test/with_aliases.rbs +136 -0
- data/sig/use_map.rbs +35 -0
- data/sig/util.rbs +9 -0
- data/sig/validator.rbs +63 -0
- data/sig/variance_calculator.rbs +87 -0
- data/sig/vendorer.rbs +51 -0
- data/sig/version.rbs +3 -0
- data/sig/visitor.rbs +47 -0
- data/sig/wasm/deserializer.rbs +66 -0
- data/sig/wasm/serialization_schema.rbs +13 -0
- data/sig/writer.rbs +127 -0
- data/src/ast.c +1628 -0
- data/src/lexer.c +3217 -0
- data/src/lexer.re +155 -0
- data/src/lexstate.c +217 -0
- data/src/location.c +31 -0
- data/src/parser.c +4255 -0
- data/src/serialize.c +958 -0
- data/src/string.c +41 -0
- data/src/util/rbs_allocator.c +162 -0
- data/src/util/rbs_assert.c +19 -0
- data/src/util/rbs_buffer.c +54 -0
- data/src/util/rbs_constant_pool.c +268 -0
- data/src/util/rbs_encoding.c +21308 -0
- data/src/util/rbs_unescape.c +167 -0
- data/stdlib/abbrev/0/abbrev.rbs +66 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +355 -0
- data/stdlib/benchmark/0/benchmark.rbs +452 -0
- data/stdlib/bigdecimal/0/big_decimal.rbs +1647 -0
- data/stdlib/bigdecimal-math/0/big_math.rbs +280 -0
- data/stdlib/bigdecimal-math/0/manifest.yaml +2 -0
- data/stdlib/cgi/0/core.rbs +911 -0
- data/stdlib/cgi/0/manifest.yaml +4 -0
- data/stdlib/cgi-escape/0/escape.rbs +171 -0
- data/stdlib/coverage/0/coverage.rbs +266 -0
- data/stdlib/csv/0/csv.rbs +3776 -0
- data/stdlib/csv/0/manifest.yaml +3 -0
- data/stdlib/date/0/date.rbs +1598 -0
- data/stdlib/date/0/date_time.rbs +617 -0
- data/stdlib/date/0/time.rbs +26 -0
- data/stdlib/dbm/0/dbm.rbs +421 -0
- data/stdlib/delegate/0/delegator.rbs +187 -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 +344 -0
- data/stdlib/digest/0/digest.rbs +687 -0
- data/stdlib/erb/0/erb.rbs +933 -0
- data/stdlib/etc/0/etc.rbs +884 -0
- data/stdlib/fileutils/0/fileutils.rbs +1753 -0
- data/stdlib/find/0/find.rbs +49 -0
- data/stdlib/forwardable/0/forwardable.rbs +271 -0
- data/stdlib/io-console/0/io-console.rbs +414 -0
- data/stdlib/ipaddr/0/ipaddr.rbs +436 -0
- data/stdlib/json/0/json.rbs +1963 -0
- data/stdlib/kconv/0/kconv.rbs +166 -0
- data/stdlib/logger/0/formatter.rbs +45 -0
- data/stdlib/logger/0/log_device.rbs +100 -0
- data/stdlib/logger/0/logger.rbs +796 -0
- data/stdlib/logger/0/manifest.yaml +2 -0
- data/stdlib/logger/0/period.rbs +17 -0
- data/stdlib/logger/0/severity.rbs +34 -0
- data/stdlib/minitest/0/kernel.rbs +42 -0
- data/stdlib/minitest/0/minitest/abstract_reporter.rbs +52 -0
- data/stdlib/minitest/0/minitest/assertion.rbs +17 -0
- data/stdlib/minitest/0/minitest/assertions.rbs +590 -0
- data/stdlib/minitest/0/minitest/backtrace_filter.rbs +23 -0
- data/stdlib/minitest/0/minitest/bench_spec.rbs +102 -0
- data/stdlib/minitest/0/minitest/benchmark.rbs +259 -0
- data/stdlib/minitest/0/minitest/composite_reporter.rbs +25 -0
- 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/expectation.rbs +2 -0
- data/stdlib/minitest/0/minitest/expectations.rbs +21 -0
- data/stdlib/minitest/0/minitest/guard.rbs +64 -0
- data/stdlib/minitest/0/minitest/mock.rbs +64 -0
- data/stdlib/minitest/0/minitest/parallel/executor.rbs +46 -0
- data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +5 -0
- data/stdlib/minitest/0/minitest/parallel/test.rbs +3 -0
- data/stdlib/minitest/0/minitest/parallel.rbs +2 -0
- data/stdlib/minitest/0/minitest/pride_io.rbs +62 -0
- data/stdlib/minitest/0/minitest/pride_lol.rbs +19 -0
- data/stdlib/minitest/0/minitest/progress_reporter.rbs +11 -0
- data/stdlib/minitest/0/minitest/reportable.rbs +53 -0
- data/stdlib/minitest/0/minitest/reporter.rbs +5 -0
- data/stdlib/minitest/0/minitest/result.rbs +28 -0
- data/stdlib/minitest/0/minitest/runnable.rbs +163 -0
- data/stdlib/minitest/0/minitest/skip.rbs +6 -0
- data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +48 -0
- data/stdlib/minitest/0/minitest/spec/dsl.rbs +129 -0
- data/stdlib/minitest/0/minitest/spec.rbs +11 -0
- data/stdlib/minitest/0/minitest/statistics_reporter.rbs +81 -0
- data/stdlib/minitest/0/minitest/summary_reporter.rbs +18 -0
- data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +92 -0
- data/stdlib/minitest/0/minitest/test.rbs +69 -0
- data/stdlib/minitest/0/minitest/unexpected_error.rbs +12 -0
- data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
- data/stdlib/minitest/0/minitest/unit/test_case.rbs +3 -0
- data/stdlib/minitest/0/minitest/unit.rbs +4 -0
- data/stdlib/minitest/0/minitest.rbs +115 -0
- data/stdlib/monitor/0/monitor.rbs +363 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +104 -0
- data/stdlib/net-http/0/manifest.yaml +3 -0
- data/stdlib/net-http/0/net-http.rbs +5580 -0
- 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 +402 -0
- data/stdlib/objspace/0/objspace.rbs +470 -0
- 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 +433 -0
- data/stdlib/open3/0/open3.rbs +606 -0
- data/stdlib/openssl/0/manifest.yaml +3 -0
- data/stdlib/openssl/0/openssl.rbs +12231 -0
- data/stdlib/optparse/0/optparse.rbs +1734 -0
- data/stdlib/pathname/0/pathname.rbs +36 -0
- data/stdlib/pp/0/manifest.yaml +2 -0
- data/stdlib/pp/0/pp.rbs +301 -0
- data/stdlib/prettyprint/0/prettyprint.rbs +383 -0
- data/stdlib/pstore/0/pstore.rbs +608 -0
- data/stdlib/psych/0/core_ext.rbs +12 -0
- data/stdlib/psych/0/dbm.rbs +237 -0
- data/stdlib/psych/0/manifest.yaml +3 -0
- data/stdlib/psych/0/psych.rbs +455 -0
- data/stdlib/psych/0/store.rbs +57 -0
- data/stdlib/pty/0/pty.rbs +240 -0
- data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
- data/stdlib/rdoc/0/code_object.rbs +52 -0
- data/stdlib/rdoc/0/comment.rbs +61 -0
- data/stdlib/rdoc/0/context.rbs +153 -0
- data/stdlib/rdoc/0/markup.rbs +117 -0
- data/stdlib/rdoc/0/options.rbs +76 -0
- data/stdlib/rdoc/0/parser.rbs +56 -0
- data/stdlib/rdoc/0/rdoc.rbs +393 -0
- 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/manifest.yaml +3 -0
- data/stdlib/resolv/0/resolv.rbs +1787 -0
- data/stdlib/ripper/0/ripper.rbs +1654 -0
- data/stdlib/securerandom/0/manifest.yaml +2 -0
- data/stdlib/securerandom/0/securerandom.rbs +49 -0
- data/stdlib/shellwords/0/shellwords.rbs +229 -0
- data/stdlib/singleton/0/singleton.rbs +134 -0
- data/stdlib/socket/0/addrinfo.rbs +666 -0
- data/stdlib/socket/0/basic_socket.rbs +590 -0
- data/stdlib/socket/0/constants.rbs +2295 -0
- data/stdlib/socket/0/ip_socket.rbs +94 -0
- data/stdlib/socket/0/socket.rbs +4170 -0
- data/stdlib/socket/0/socket_error.rbs +5 -0
- data/stdlib/socket/0/tcp_server.rbs +192 -0
- data/stdlib/socket/0/tcp_socket.rbs +87 -0
- data/stdlib/socket/0/udp_socket.rbs +133 -0
- data/stdlib/socket/0/unix_server.rbs +169 -0
- data/stdlib/socket/0/unix_socket.rbs +172 -0
- data/stdlib/stringio/0/stringio.rbs +1681 -0
- data/stdlib/strscan/0/string_scanner.rbs +1648 -0
- data/stdlib/tempfile/0/tempfile.rbs +483 -0
- data/stdlib/time/0/time.rbs +434 -0
- data/stdlib/timeout/0/timeout.rbs +137 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +69 -0
- data/stdlib/tsort/0/cyclic.rbs +8 -0
- data/stdlib/tsort/0/interfaces.rbs +20 -0
- data/stdlib/tsort/0/tsort.rbs +410 -0
- data/stdlib/uri/0/common.rbs +621 -0
- data/stdlib/uri/0/file.rbs +118 -0
- data/stdlib/uri/0/ftp.rbs +13 -0
- data/stdlib/uri/0/generic.rbs +1116 -0
- data/stdlib/uri/0/http.rbs +104 -0
- data/stdlib/uri/0/https.rbs +14 -0
- data/stdlib/uri/0/ldap.rbs +230 -0
- data/stdlib/uri/0/ldaps.rbs +14 -0
- data/stdlib/uri/0/mailto.rbs +92 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +189 -0
- data/stdlib/uri/0/rfc3986_parser.rbs +2 -0
- data/stdlib/uri/0/ws.rbs +13 -0
- data/stdlib/uri/0/wss.rbs +9 -0
- data/stdlib/yaml/0/manifest.yaml +2 -0
- data/stdlib/yaml/0/yaml.rbs +1 -0
- data/stdlib/zlib/0/buf_error.rbs +10 -0
- data/stdlib/zlib/0/data_error.rbs +10 -0
- data/stdlib/zlib/0/deflate.rbs +211 -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 +168 -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 +449 -0
- data/stdlib/zlib/0/zstream.rbs +201 -0
- data/wasm/README.md +59 -0
- data/wasm/rbs_wasm.c +411 -0
- metadata +660 -0
data/src/ast.c
ADDED
|
@@ -0,0 +1,1628 @@
|
|
|
1
|
+
/*----------------------------------------------------------------------------*/
|
|
2
|
+
/* This file is generated by the templates/template.rb script and should not */
|
|
3
|
+
/* be modified manually. */
|
|
4
|
+
/* To change the template see */
|
|
5
|
+
/* templates/src/ast.c.erb */
|
|
6
|
+
/*----------------------------------------------------------------------------*/
|
|
7
|
+
|
|
8
|
+
#line 2 "templates/src/ast.c.erb"
|
|
9
|
+
#include "rbs/ast.h"
|
|
10
|
+
|
|
11
|
+
#include <stdio.h>
|
|
12
|
+
#include <stdlib.h>
|
|
13
|
+
|
|
14
|
+
const char *RBS_NONNULL rbs_node_type_name(rbs_node_t *RBS_NONNULL node) {
|
|
15
|
+
switch (node->type) {
|
|
16
|
+
case RBS_AST_ANNOTATION:
|
|
17
|
+
return "RBS::AST::Annotation";
|
|
18
|
+
case RBS_AST_BOOL:
|
|
19
|
+
return "RBS::AST::Bool";
|
|
20
|
+
case RBS_AST_COMMENT:
|
|
21
|
+
return "RBS::AST::Comment";
|
|
22
|
+
case RBS_AST_DECLARATIONS_CLASS:
|
|
23
|
+
return "RBS::AST::Declarations::Class";
|
|
24
|
+
case RBS_AST_DECLARATIONS_CLASS_SUPER:
|
|
25
|
+
return "RBS::AST::Declarations::Class::Super";
|
|
26
|
+
case RBS_AST_DECLARATIONS_CLASS_ALIAS:
|
|
27
|
+
return "RBS::AST::Declarations::ClassAlias";
|
|
28
|
+
case RBS_AST_DECLARATIONS_CONSTANT:
|
|
29
|
+
return "RBS::AST::Declarations::Constant";
|
|
30
|
+
case RBS_AST_DECLARATIONS_GLOBAL:
|
|
31
|
+
return "RBS::AST::Declarations::Global";
|
|
32
|
+
case RBS_AST_DECLARATIONS_INTERFACE:
|
|
33
|
+
return "RBS::AST::Declarations::Interface";
|
|
34
|
+
case RBS_AST_DECLARATIONS_MODULE:
|
|
35
|
+
return "RBS::AST::Declarations::Module";
|
|
36
|
+
case RBS_AST_DECLARATIONS_MODULE_SELF:
|
|
37
|
+
return "RBS::AST::Declarations::Module::Self";
|
|
38
|
+
case RBS_AST_DECLARATIONS_MODULE_ALIAS:
|
|
39
|
+
return "RBS::AST::Declarations::ModuleAlias";
|
|
40
|
+
case RBS_AST_DECLARATIONS_TYPE_ALIAS:
|
|
41
|
+
return "RBS::AST::Declarations::TypeAlias";
|
|
42
|
+
case RBS_AST_DIRECTIVES_USE:
|
|
43
|
+
return "RBS::AST::Directives::Use";
|
|
44
|
+
case RBS_AST_DIRECTIVES_USE_SINGLE_CLAUSE:
|
|
45
|
+
return "RBS::AST::Directives::Use::SingleClause";
|
|
46
|
+
case RBS_AST_DIRECTIVES_USE_WILDCARD_CLAUSE:
|
|
47
|
+
return "RBS::AST::Directives::Use::WildcardClause";
|
|
48
|
+
case RBS_AST_INTEGER:
|
|
49
|
+
return "RBS::AST::Integer";
|
|
50
|
+
case RBS_AST_MEMBERS_ALIAS:
|
|
51
|
+
return "RBS::AST::Members::Alias";
|
|
52
|
+
case RBS_AST_MEMBERS_ATTR_ACCESSOR:
|
|
53
|
+
return "RBS::AST::Members::AttrAccessor";
|
|
54
|
+
case RBS_AST_MEMBERS_ATTR_READER:
|
|
55
|
+
return "RBS::AST::Members::AttrReader";
|
|
56
|
+
case RBS_AST_MEMBERS_ATTR_WRITER:
|
|
57
|
+
return "RBS::AST::Members::AttrWriter";
|
|
58
|
+
case RBS_AST_MEMBERS_CLASS_INSTANCE_VARIABLE:
|
|
59
|
+
return "RBS::AST::Members::ClassInstanceVariable";
|
|
60
|
+
case RBS_AST_MEMBERS_CLASS_VARIABLE:
|
|
61
|
+
return "RBS::AST::Members::ClassVariable";
|
|
62
|
+
case RBS_AST_MEMBERS_EXTEND:
|
|
63
|
+
return "RBS::AST::Members::Extend";
|
|
64
|
+
case RBS_AST_MEMBERS_INCLUDE:
|
|
65
|
+
return "RBS::AST::Members::Include";
|
|
66
|
+
case RBS_AST_MEMBERS_INSTANCE_VARIABLE:
|
|
67
|
+
return "RBS::AST::Members::InstanceVariable";
|
|
68
|
+
case RBS_AST_MEMBERS_METHOD_DEFINITION:
|
|
69
|
+
return "RBS::AST::Members::MethodDefinition";
|
|
70
|
+
case RBS_AST_MEMBERS_METHOD_DEFINITION_OVERLOAD:
|
|
71
|
+
return "RBS::AST::Members::MethodDefinition::Overload";
|
|
72
|
+
case RBS_AST_MEMBERS_PREPEND:
|
|
73
|
+
return "RBS::AST::Members::Prepend";
|
|
74
|
+
case RBS_AST_MEMBERS_PRIVATE:
|
|
75
|
+
return "RBS::AST::Members::Private";
|
|
76
|
+
case RBS_AST_MEMBERS_PUBLIC:
|
|
77
|
+
return "RBS::AST::Members::Public";
|
|
78
|
+
case RBS_AST_RUBY_ANNOTATIONS_BLOCK_PARAM_TYPE_ANNOTATION:
|
|
79
|
+
return "RBS::AST::Ruby::Annotations::BlockParamTypeAnnotation";
|
|
80
|
+
case RBS_AST_RUBY_ANNOTATIONS_CLASS_ALIAS_ANNOTATION:
|
|
81
|
+
return "RBS::AST::Ruby::Annotations::ClassAliasAnnotation";
|
|
82
|
+
case RBS_AST_RUBY_ANNOTATIONS_COLON_METHOD_TYPE_ANNOTATION:
|
|
83
|
+
return "RBS::AST::Ruby::Annotations::ColonMethodTypeAnnotation";
|
|
84
|
+
case RBS_AST_RUBY_ANNOTATIONS_DOUBLE_SPLAT_PARAM_TYPE_ANNOTATION:
|
|
85
|
+
return "RBS::AST::Ruby::Annotations::DoubleSplatParamTypeAnnotation";
|
|
86
|
+
case RBS_AST_RUBY_ANNOTATIONS_INSTANCE_VARIABLE_ANNOTATION:
|
|
87
|
+
return "RBS::AST::Ruby::Annotations::InstanceVariableAnnotation";
|
|
88
|
+
case RBS_AST_RUBY_ANNOTATIONS_METHOD_TYPES_ANNOTATION:
|
|
89
|
+
return "RBS::AST::Ruby::Annotations::MethodTypesAnnotation";
|
|
90
|
+
case RBS_AST_RUBY_ANNOTATIONS_MODULE_ALIAS_ANNOTATION:
|
|
91
|
+
return "RBS::AST::Ruby::Annotations::ModuleAliasAnnotation";
|
|
92
|
+
case RBS_AST_RUBY_ANNOTATIONS_MODULE_SELF_ANNOTATION:
|
|
93
|
+
return "RBS::AST::Ruby::Annotations::ModuleSelfAnnotation";
|
|
94
|
+
case RBS_AST_RUBY_ANNOTATIONS_NODE_TYPE_ASSERTION:
|
|
95
|
+
return "RBS::AST::Ruby::Annotations::NodeTypeAssertion";
|
|
96
|
+
case RBS_AST_RUBY_ANNOTATIONS_PARAM_TYPE_ANNOTATION:
|
|
97
|
+
return "RBS::AST::Ruby::Annotations::ParamTypeAnnotation";
|
|
98
|
+
case RBS_AST_RUBY_ANNOTATIONS_RETURN_TYPE_ANNOTATION:
|
|
99
|
+
return "RBS::AST::Ruby::Annotations::ReturnTypeAnnotation";
|
|
100
|
+
case RBS_AST_RUBY_ANNOTATIONS_SKIP_ANNOTATION:
|
|
101
|
+
return "RBS::AST::Ruby::Annotations::SkipAnnotation";
|
|
102
|
+
case RBS_AST_RUBY_ANNOTATIONS_SPLAT_PARAM_TYPE_ANNOTATION:
|
|
103
|
+
return "RBS::AST::Ruby::Annotations::SplatParamTypeAnnotation";
|
|
104
|
+
case RBS_AST_RUBY_ANNOTATIONS_TYPE_APPLICATION_ANNOTATION:
|
|
105
|
+
return "RBS::AST::Ruby::Annotations::TypeApplicationAnnotation";
|
|
106
|
+
case RBS_AST_STRING:
|
|
107
|
+
return "RBS::AST::String";
|
|
108
|
+
case RBS_AST_TYPE_PARAM:
|
|
109
|
+
return "RBS::AST::TypeParam";
|
|
110
|
+
case RBS_METHOD_TYPE:
|
|
111
|
+
return "RBS::MethodType";
|
|
112
|
+
case RBS_NAMESPACE:
|
|
113
|
+
return "RBS::Namespace";
|
|
114
|
+
case RBS_SIGNATURE:
|
|
115
|
+
return "RBS::Signature";
|
|
116
|
+
case RBS_TYPE_NAME:
|
|
117
|
+
return "RBS::TypeName";
|
|
118
|
+
case RBS_TYPES_ALIAS:
|
|
119
|
+
return "RBS::Types::Alias";
|
|
120
|
+
case RBS_TYPES_BASES_ANY:
|
|
121
|
+
return "RBS::Types::Bases::Any";
|
|
122
|
+
case RBS_TYPES_BASES_BOOL:
|
|
123
|
+
return "RBS::Types::Bases::Bool";
|
|
124
|
+
case RBS_TYPES_BASES_BOTTOM:
|
|
125
|
+
return "RBS::Types::Bases::Bottom";
|
|
126
|
+
case RBS_TYPES_BASES_CLASS:
|
|
127
|
+
return "RBS::Types::Bases::Class";
|
|
128
|
+
case RBS_TYPES_BASES_INSTANCE:
|
|
129
|
+
return "RBS::Types::Bases::Instance";
|
|
130
|
+
case RBS_TYPES_BASES_NIL:
|
|
131
|
+
return "RBS::Types::Bases::Nil";
|
|
132
|
+
case RBS_TYPES_BASES_SELF:
|
|
133
|
+
return "RBS::Types::Bases::Self";
|
|
134
|
+
case RBS_TYPES_BASES_TOP:
|
|
135
|
+
return "RBS::Types::Bases::Top";
|
|
136
|
+
case RBS_TYPES_BASES_VOID:
|
|
137
|
+
return "RBS::Types::Bases::Void";
|
|
138
|
+
case RBS_TYPES_BLOCK:
|
|
139
|
+
return "RBS::Types::Block";
|
|
140
|
+
case RBS_TYPES_CLASS_INSTANCE:
|
|
141
|
+
return "RBS::Types::ClassInstance";
|
|
142
|
+
case RBS_TYPES_CLASS_SINGLETON:
|
|
143
|
+
return "RBS::Types::ClassSingleton";
|
|
144
|
+
case RBS_TYPES_FUNCTION:
|
|
145
|
+
return "RBS::Types::Function";
|
|
146
|
+
case RBS_TYPES_FUNCTION_PARAM:
|
|
147
|
+
return "RBS::Types::Function::Param";
|
|
148
|
+
case RBS_TYPES_INTERFACE:
|
|
149
|
+
return "RBS::Types::Interface";
|
|
150
|
+
case RBS_TYPES_INTERSECTION:
|
|
151
|
+
return "RBS::Types::Intersection";
|
|
152
|
+
case RBS_TYPES_LITERAL:
|
|
153
|
+
return "RBS::Types::Literal";
|
|
154
|
+
case RBS_TYPES_OPTIONAL:
|
|
155
|
+
return "RBS::Types::Optional";
|
|
156
|
+
case RBS_TYPES_PROC:
|
|
157
|
+
return "RBS::Types::Proc";
|
|
158
|
+
case RBS_TYPES_RECORD:
|
|
159
|
+
return "RBS::Types::Record";
|
|
160
|
+
case RBS_TYPES_RECORD_FIELD_TYPE:
|
|
161
|
+
return "RBS::Types::Record::FieldType";
|
|
162
|
+
case RBS_TYPES_TUPLE:
|
|
163
|
+
return "RBS::Types::Tuple";
|
|
164
|
+
case RBS_TYPES_UNION:
|
|
165
|
+
return "RBS::Types::Union";
|
|
166
|
+
case RBS_TYPES_UNTYPED_FUNCTION:
|
|
167
|
+
return "RBS::Types::UntypedFunction";
|
|
168
|
+
case RBS_TYPES_VARIABLE:
|
|
169
|
+
return "RBS::Types::Variable";
|
|
170
|
+
case RBS_AST_SYMBOL:
|
|
171
|
+
return "Symbol";
|
|
172
|
+
default:
|
|
173
|
+
return "Unknown";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* rbs_node_list */
|
|
178
|
+
|
|
179
|
+
rbs_node_list_t *RBS_NONNULL rbs_node_list_new(rbs_allocator_t *RBS_NONNULL allocator) {
|
|
180
|
+
rbs_node_list_t *list = rbs_allocator_alloc(allocator, rbs_node_list_t);
|
|
181
|
+
*list = (rbs_node_list_t) {
|
|
182
|
+
.allocator = allocator,
|
|
183
|
+
.head = NULL,
|
|
184
|
+
.tail = NULL,
|
|
185
|
+
.length = 0,
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
return list;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
void rbs_node_list_append(rbs_node_list_t *RBS_NONNULL list, rbs_node_t *RBS_NONNULL node) {
|
|
192
|
+
rbs_node_list_node_t *new_node = rbs_allocator_alloc(list->allocator, rbs_node_list_node_t);
|
|
193
|
+
*new_node = (rbs_node_list_node_t) {
|
|
194
|
+
.node = node,
|
|
195
|
+
.next = NULL,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
if (list->tail == NULL) {
|
|
199
|
+
list->head = new_node;
|
|
200
|
+
list->tail = new_node;
|
|
201
|
+
} else {
|
|
202
|
+
list->tail->next = new_node;
|
|
203
|
+
list->tail = new_node;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
list->length++;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* rbs_hash */
|
|
210
|
+
|
|
211
|
+
rbs_hash_t *RBS_NONNULL rbs_hash_new(rbs_allocator_t *RBS_NONNULL allocator) {
|
|
212
|
+
rbs_hash_t *hash = rbs_allocator_alloc(allocator, rbs_hash_t);
|
|
213
|
+
*hash = (rbs_hash_t) {
|
|
214
|
+
.allocator = allocator,
|
|
215
|
+
.head = NULL,
|
|
216
|
+
.tail = NULL,
|
|
217
|
+
.length = 0,
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
return hash;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
bool rbs_node_equal(rbs_node_t *RBS_NONNULL lhs, rbs_node_t *RBS_NONNULL rhs) {
|
|
224
|
+
if (lhs == rhs) return true;
|
|
225
|
+
if (lhs->type != rhs->type) return false;
|
|
226
|
+
|
|
227
|
+
switch (lhs->type) {
|
|
228
|
+
case RBS_AST_SYMBOL:
|
|
229
|
+
return ((rbs_ast_symbol_t *) lhs)->constant_id == ((rbs_ast_symbol_t *) rhs)->constant_id;
|
|
230
|
+
case RBS_AST_BOOL:
|
|
231
|
+
return ((rbs_ast_bool_t *) lhs)->value == ((rbs_ast_bool_t *) rhs)->value;
|
|
232
|
+
case RBS_AST_INTEGER:
|
|
233
|
+
return rbs_string_equal(((rbs_ast_integer_t *) lhs)->string_representation, ((rbs_ast_integer_t *) rhs)->string_representation);
|
|
234
|
+
case RBS_AST_STRING:
|
|
235
|
+
return rbs_string_equal(((rbs_ast_string_t *) lhs)->string, ((rbs_ast_string_t *) rhs)->string);
|
|
236
|
+
default:
|
|
237
|
+
printf("Unhandled node type: %d\n", lhs->type);
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
rbs_hash_node_t *RBS_NULLABLE rbs_hash_find(rbs_hash_t *RBS_NONNULL hash, rbs_node_t *RBS_NONNULL key) {
|
|
243
|
+
rbs_hash_node_t *current = hash->head;
|
|
244
|
+
|
|
245
|
+
while (current != NULL) {
|
|
246
|
+
if (rbs_node_equal(key, current->key)) {
|
|
247
|
+
return current;
|
|
248
|
+
}
|
|
249
|
+
current = current->next;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return NULL;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
void rbs_hash_set(rbs_hash_t *RBS_NONNULL hash, rbs_node_t *RBS_NONNULL key, rbs_node_t *RBS_NONNULL value) {
|
|
256
|
+
rbs_hash_node_t *existing_node = rbs_hash_find(hash, key);
|
|
257
|
+
if (existing_node != NULL) {
|
|
258
|
+
existing_node->value = value;
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
rbs_hash_node_t *new_node = rbs_allocator_alloc(hash->allocator, rbs_hash_node_t);
|
|
263
|
+
new_node->key = key;
|
|
264
|
+
new_node->value = value;
|
|
265
|
+
new_node->next = NULL;
|
|
266
|
+
|
|
267
|
+
if (hash->tail == NULL) {
|
|
268
|
+
hash->head = new_node;
|
|
269
|
+
hash->tail = new_node;
|
|
270
|
+
} else {
|
|
271
|
+
hash->tail->next = new_node;
|
|
272
|
+
hash->tail = new_node;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
rbs_node_t *RBS_NULLABLE rbs_hash_get(rbs_hash_t *RBS_NONNULL hash, rbs_node_t *RBS_NONNULL key) {
|
|
277
|
+
rbs_hash_node_t *node = rbs_hash_find(hash, key);
|
|
278
|
+
return node ? node->value : NULL;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
rbs_ast_symbol_t *RBS_NONNULL rbs_ast_symbol_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_constant_pool_t *RBS_NONNULL constant_pool, rbs_constant_id_t constant_id) {
|
|
282
|
+
rbs_ast_symbol_t *instance = rbs_allocator_alloc(allocator, rbs_ast_symbol_t);
|
|
283
|
+
|
|
284
|
+
*instance = (rbs_ast_symbol_t) {
|
|
285
|
+
.base = (rbs_node_t) {
|
|
286
|
+
.type = RBS_AST_SYMBOL,
|
|
287
|
+
.location = location,
|
|
288
|
+
},
|
|
289
|
+
.constant_id = constant_id,
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
return instance;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
#line 140 "templates/src/ast.c.erb"
|
|
296
|
+
rbs_ast_annotation_t *RBS_NONNULL rbs_ast_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_string_t string) {
|
|
297
|
+
rbs_ast_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_annotation_t);
|
|
298
|
+
|
|
299
|
+
*instance = (rbs_ast_annotation_t) {
|
|
300
|
+
.base = (rbs_node_t) {
|
|
301
|
+
.type = RBS_AST_ANNOTATION,
|
|
302
|
+
.location = location,
|
|
303
|
+
},
|
|
304
|
+
.string = string,
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
return instance;
|
|
308
|
+
}
|
|
309
|
+
#line 140 "templates/src/ast.c.erb"
|
|
310
|
+
rbs_ast_bool_t *RBS_NONNULL rbs_ast_bool_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, bool value) {
|
|
311
|
+
rbs_ast_bool_t *instance = rbs_allocator_alloc(allocator, rbs_ast_bool_t);
|
|
312
|
+
|
|
313
|
+
*instance = (rbs_ast_bool_t) {
|
|
314
|
+
.base = (rbs_node_t) {
|
|
315
|
+
.type = RBS_AST_BOOL,
|
|
316
|
+
.location = location,
|
|
317
|
+
},
|
|
318
|
+
.value = value,
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
return instance;
|
|
322
|
+
}
|
|
323
|
+
#line 140 "templates/src/ast.c.erb"
|
|
324
|
+
rbs_ast_comment_t *RBS_NONNULL rbs_ast_comment_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_string_t string) {
|
|
325
|
+
rbs_ast_comment_t *instance = rbs_allocator_alloc(allocator, rbs_ast_comment_t);
|
|
326
|
+
|
|
327
|
+
*instance = (rbs_ast_comment_t) {
|
|
328
|
+
.base = (rbs_node_t) {
|
|
329
|
+
.type = RBS_AST_COMMENT,
|
|
330
|
+
.location = location,
|
|
331
|
+
},
|
|
332
|
+
.string = string,
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
return instance;
|
|
336
|
+
}
|
|
337
|
+
#line 140 "templates/src/ast.c.erb"
|
|
338
|
+
rbs_ast_declarations_class_t *RBS_NONNULL rbs_ast_declarations_class_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL type_params, rbs_ast_declarations_class_super_t *RBS_NULLABLE super_class, rbs_node_list_t *RBS_NONNULL members, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range end_range) {
|
|
339
|
+
rbs_ast_declarations_class_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_class_t);
|
|
340
|
+
|
|
341
|
+
*instance = (rbs_ast_declarations_class_t) {
|
|
342
|
+
.base = (rbs_node_t) {
|
|
343
|
+
.type = RBS_AST_DECLARATIONS_CLASS,
|
|
344
|
+
.location = location,
|
|
345
|
+
},
|
|
346
|
+
.name = name,
|
|
347
|
+
.type_params = type_params,
|
|
348
|
+
.super_class = super_class,
|
|
349
|
+
.members = members,
|
|
350
|
+
.annotations = annotations,
|
|
351
|
+
.comment = comment,
|
|
352
|
+
.keyword_range = keyword_range,
|
|
353
|
+
.name_range = name_range,
|
|
354
|
+
.end_range = end_range,
|
|
355
|
+
.type_params_range = RBS_LOCATION_NULL_RANGE,
|
|
356
|
+
.lt_range = RBS_LOCATION_NULL_RANGE,
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
return instance;
|
|
360
|
+
}
|
|
361
|
+
#line 140 "templates/src/ast.c.erb"
|
|
362
|
+
rbs_ast_declarations_class_super_t *RBS_NONNULL rbs_ast_declarations_class_super_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
363
|
+
rbs_ast_declarations_class_super_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_class_super_t);
|
|
364
|
+
|
|
365
|
+
*instance = (rbs_ast_declarations_class_super_t) {
|
|
366
|
+
.base = (rbs_node_t) {
|
|
367
|
+
.type = RBS_AST_DECLARATIONS_CLASS_SUPER,
|
|
368
|
+
.location = location,
|
|
369
|
+
},
|
|
370
|
+
.name = name,
|
|
371
|
+
.args = args,
|
|
372
|
+
.name_range = name_range,
|
|
373
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
return instance;
|
|
377
|
+
}
|
|
378
|
+
#line 140 "templates/src/ast.c.erb"
|
|
379
|
+
rbs_ast_declarations_class_alias_t *RBS_NONNULL rbs_ast_declarations_class_alias_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL new_name, rbs_type_name_t *RBS_NONNULL old_name, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_node_list_t *RBS_NONNULL annotations, rbs_location_range keyword_range, rbs_location_range new_name_range, rbs_location_range eq_range, rbs_location_range old_name_range) {
|
|
380
|
+
rbs_ast_declarations_class_alias_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_class_alias_t);
|
|
381
|
+
|
|
382
|
+
*instance = (rbs_ast_declarations_class_alias_t) {
|
|
383
|
+
.base = (rbs_node_t) {
|
|
384
|
+
.type = RBS_AST_DECLARATIONS_CLASS_ALIAS,
|
|
385
|
+
.location = location,
|
|
386
|
+
},
|
|
387
|
+
.new_name = new_name,
|
|
388
|
+
.old_name = old_name,
|
|
389
|
+
.comment = comment,
|
|
390
|
+
.annotations = annotations,
|
|
391
|
+
.keyword_range = keyword_range,
|
|
392
|
+
.new_name_range = new_name_range,
|
|
393
|
+
.eq_range = eq_range,
|
|
394
|
+
.old_name_range = old_name_range,
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
return instance;
|
|
398
|
+
}
|
|
399
|
+
#line 140 "templates/src/ast.c.erb"
|
|
400
|
+
rbs_ast_declarations_constant_t *RBS_NONNULL rbs_ast_declarations_constant_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_node_list_t *RBS_NONNULL annotations, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
401
|
+
rbs_ast_declarations_constant_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_constant_t);
|
|
402
|
+
|
|
403
|
+
*instance = (rbs_ast_declarations_constant_t) {
|
|
404
|
+
.base = (rbs_node_t) {
|
|
405
|
+
.type = RBS_AST_DECLARATIONS_CONSTANT,
|
|
406
|
+
.location = location,
|
|
407
|
+
},
|
|
408
|
+
.name = name,
|
|
409
|
+
.type = type,
|
|
410
|
+
.comment = comment,
|
|
411
|
+
.annotations = annotations,
|
|
412
|
+
.name_range = name_range,
|
|
413
|
+
.colon_range = colon_range,
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
return instance;
|
|
417
|
+
}
|
|
418
|
+
#line 140 "templates/src/ast.c.erb"
|
|
419
|
+
rbs_ast_declarations_global_t *RBS_NONNULL rbs_ast_declarations_global_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_node_list_t *RBS_NONNULL annotations, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
420
|
+
rbs_ast_declarations_global_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_global_t);
|
|
421
|
+
|
|
422
|
+
*instance = (rbs_ast_declarations_global_t) {
|
|
423
|
+
.base = (rbs_node_t) {
|
|
424
|
+
.type = RBS_AST_DECLARATIONS_GLOBAL,
|
|
425
|
+
.location = location,
|
|
426
|
+
},
|
|
427
|
+
.name = name,
|
|
428
|
+
.type = type,
|
|
429
|
+
.comment = comment,
|
|
430
|
+
.annotations = annotations,
|
|
431
|
+
.name_range = name_range,
|
|
432
|
+
.colon_range = colon_range,
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
return instance;
|
|
436
|
+
}
|
|
437
|
+
#line 140 "templates/src/ast.c.erb"
|
|
438
|
+
rbs_ast_declarations_interface_t *RBS_NONNULL rbs_ast_declarations_interface_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL type_params, rbs_node_list_t *RBS_NONNULL members, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range end_range) {
|
|
439
|
+
rbs_ast_declarations_interface_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_interface_t);
|
|
440
|
+
|
|
441
|
+
*instance = (rbs_ast_declarations_interface_t) {
|
|
442
|
+
.base = (rbs_node_t) {
|
|
443
|
+
.type = RBS_AST_DECLARATIONS_INTERFACE,
|
|
444
|
+
.location = location,
|
|
445
|
+
},
|
|
446
|
+
.name = name,
|
|
447
|
+
.type_params = type_params,
|
|
448
|
+
.members = members,
|
|
449
|
+
.annotations = annotations,
|
|
450
|
+
.comment = comment,
|
|
451
|
+
.keyword_range = keyword_range,
|
|
452
|
+
.name_range = name_range,
|
|
453
|
+
.end_range = end_range,
|
|
454
|
+
.type_params_range = RBS_LOCATION_NULL_RANGE,
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
return instance;
|
|
458
|
+
}
|
|
459
|
+
#line 140 "templates/src/ast.c.erb"
|
|
460
|
+
rbs_ast_declarations_module_t *RBS_NONNULL rbs_ast_declarations_module_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL type_params, rbs_node_list_t *RBS_NONNULL self_types, rbs_node_list_t *RBS_NONNULL members, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range end_range) {
|
|
461
|
+
rbs_ast_declarations_module_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_module_t);
|
|
462
|
+
|
|
463
|
+
*instance = (rbs_ast_declarations_module_t) {
|
|
464
|
+
.base = (rbs_node_t) {
|
|
465
|
+
.type = RBS_AST_DECLARATIONS_MODULE,
|
|
466
|
+
.location = location,
|
|
467
|
+
},
|
|
468
|
+
.name = name,
|
|
469
|
+
.type_params = type_params,
|
|
470
|
+
.self_types = self_types,
|
|
471
|
+
.members = members,
|
|
472
|
+
.annotations = annotations,
|
|
473
|
+
.comment = comment,
|
|
474
|
+
.keyword_range = keyword_range,
|
|
475
|
+
.name_range = name_range,
|
|
476
|
+
.end_range = end_range,
|
|
477
|
+
.type_params_range = RBS_LOCATION_NULL_RANGE,
|
|
478
|
+
.colon_range = RBS_LOCATION_NULL_RANGE,
|
|
479
|
+
.self_types_range = RBS_LOCATION_NULL_RANGE,
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
return instance;
|
|
483
|
+
}
|
|
484
|
+
#line 140 "templates/src/ast.c.erb"
|
|
485
|
+
rbs_ast_declarations_module_self_t *RBS_NONNULL rbs_ast_declarations_module_self_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
486
|
+
rbs_ast_declarations_module_self_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_module_self_t);
|
|
487
|
+
|
|
488
|
+
*instance = (rbs_ast_declarations_module_self_t) {
|
|
489
|
+
.base = (rbs_node_t) {
|
|
490
|
+
.type = RBS_AST_DECLARATIONS_MODULE_SELF,
|
|
491
|
+
.location = location,
|
|
492
|
+
},
|
|
493
|
+
.name = name,
|
|
494
|
+
.args = args,
|
|
495
|
+
.name_range = name_range,
|
|
496
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
return instance;
|
|
500
|
+
}
|
|
501
|
+
#line 140 "templates/src/ast.c.erb"
|
|
502
|
+
rbs_ast_declarations_module_alias_t *RBS_NONNULL rbs_ast_declarations_module_alias_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL new_name, rbs_type_name_t *RBS_NONNULL old_name, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_node_list_t *RBS_NONNULL annotations, rbs_location_range keyword_range, rbs_location_range new_name_range, rbs_location_range eq_range, rbs_location_range old_name_range) {
|
|
503
|
+
rbs_ast_declarations_module_alias_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_module_alias_t);
|
|
504
|
+
|
|
505
|
+
*instance = (rbs_ast_declarations_module_alias_t) {
|
|
506
|
+
.base = (rbs_node_t) {
|
|
507
|
+
.type = RBS_AST_DECLARATIONS_MODULE_ALIAS,
|
|
508
|
+
.location = location,
|
|
509
|
+
},
|
|
510
|
+
.new_name = new_name,
|
|
511
|
+
.old_name = old_name,
|
|
512
|
+
.comment = comment,
|
|
513
|
+
.annotations = annotations,
|
|
514
|
+
.keyword_range = keyword_range,
|
|
515
|
+
.new_name_range = new_name_range,
|
|
516
|
+
.eq_range = eq_range,
|
|
517
|
+
.old_name_range = old_name_range,
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
return instance;
|
|
521
|
+
}
|
|
522
|
+
#line 140 "templates/src/ast.c.erb"
|
|
523
|
+
rbs_ast_declarations_type_alias_t *RBS_NONNULL rbs_ast_declarations_type_alias_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL type_params, rbs_node_t *RBS_NONNULL type, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range eq_range) {
|
|
524
|
+
rbs_ast_declarations_type_alias_t *instance = rbs_allocator_alloc(allocator, rbs_ast_declarations_type_alias_t);
|
|
525
|
+
|
|
526
|
+
*instance = (rbs_ast_declarations_type_alias_t) {
|
|
527
|
+
.base = (rbs_node_t) {
|
|
528
|
+
.type = RBS_AST_DECLARATIONS_TYPE_ALIAS,
|
|
529
|
+
.location = location,
|
|
530
|
+
},
|
|
531
|
+
.name = name,
|
|
532
|
+
.type_params = type_params,
|
|
533
|
+
.type = type,
|
|
534
|
+
.annotations = annotations,
|
|
535
|
+
.comment = comment,
|
|
536
|
+
.keyword_range = keyword_range,
|
|
537
|
+
.name_range = name_range,
|
|
538
|
+
.eq_range = eq_range,
|
|
539
|
+
.type_params_range = RBS_LOCATION_NULL_RANGE,
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
return instance;
|
|
543
|
+
}
|
|
544
|
+
#line 140 "templates/src/ast.c.erb"
|
|
545
|
+
rbs_ast_directives_use_t *RBS_NONNULL rbs_ast_directives_use_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL clauses, rbs_location_range keyword_range) {
|
|
546
|
+
rbs_ast_directives_use_t *instance = rbs_allocator_alloc(allocator, rbs_ast_directives_use_t);
|
|
547
|
+
|
|
548
|
+
*instance = (rbs_ast_directives_use_t) {
|
|
549
|
+
.base = (rbs_node_t) {
|
|
550
|
+
.type = RBS_AST_DIRECTIVES_USE,
|
|
551
|
+
.location = location,
|
|
552
|
+
},
|
|
553
|
+
.clauses = clauses,
|
|
554
|
+
.keyword_range = keyword_range,
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
return instance;
|
|
558
|
+
}
|
|
559
|
+
#line 140 "templates/src/ast.c.erb"
|
|
560
|
+
rbs_ast_directives_use_single_clause_t *RBS_NONNULL rbs_ast_directives_use_single_clause_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL type_name, rbs_ast_symbol_t *RBS_NULLABLE new_name, rbs_location_range type_name_range) {
|
|
561
|
+
rbs_ast_directives_use_single_clause_t *instance = rbs_allocator_alloc(allocator, rbs_ast_directives_use_single_clause_t);
|
|
562
|
+
|
|
563
|
+
*instance = (rbs_ast_directives_use_single_clause_t) {
|
|
564
|
+
.base = (rbs_node_t) {
|
|
565
|
+
.type = RBS_AST_DIRECTIVES_USE_SINGLE_CLAUSE,
|
|
566
|
+
.location = location,
|
|
567
|
+
},
|
|
568
|
+
.type_name = type_name,
|
|
569
|
+
.new_name = new_name,
|
|
570
|
+
.type_name_range = type_name_range,
|
|
571
|
+
.keyword_range = RBS_LOCATION_NULL_RANGE,
|
|
572
|
+
.new_name_range = RBS_LOCATION_NULL_RANGE,
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
return instance;
|
|
576
|
+
}
|
|
577
|
+
#line 140 "templates/src/ast.c.erb"
|
|
578
|
+
rbs_ast_directives_use_wildcard_clause_t *RBS_NONNULL rbs_ast_directives_use_wildcard_clause_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_namespace_t *RBS_NONNULL rbs_namespace, rbs_location_range namespace_range, rbs_location_range star_range) {
|
|
579
|
+
rbs_ast_directives_use_wildcard_clause_t *instance = rbs_allocator_alloc(allocator, rbs_ast_directives_use_wildcard_clause_t);
|
|
580
|
+
|
|
581
|
+
*instance = (rbs_ast_directives_use_wildcard_clause_t) {
|
|
582
|
+
.base = (rbs_node_t) {
|
|
583
|
+
.type = RBS_AST_DIRECTIVES_USE_WILDCARD_CLAUSE,
|
|
584
|
+
.location = location,
|
|
585
|
+
},
|
|
586
|
+
.rbs_namespace = rbs_namespace,
|
|
587
|
+
.namespace_range = namespace_range,
|
|
588
|
+
.star_range = star_range,
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
return instance;
|
|
592
|
+
}
|
|
593
|
+
#line 140 "templates/src/ast.c.erb"
|
|
594
|
+
rbs_ast_integer_t *RBS_NONNULL rbs_ast_integer_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_string_t string_representation) {
|
|
595
|
+
rbs_ast_integer_t *instance = rbs_allocator_alloc(allocator, rbs_ast_integer_t);
|
|
596
|
+
|
|
597
|
+
*instance = (rbs_ast_integer_t) {
|
|
598
|
+
.base = (rbs_node_t) {
|
|
599
|
+
.type = RBS_AST_INTEGER,
|
|
600
|
+
.location = location,
|
|
601
|
+
},
|
|
602
|
+
.string_representation = string_representation,
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
return instance;
|
|
606
|
+
}
|
|
607
|
+
#line 140 "templates/src/ast.c.erb"
|
|
608
|
+
rbs_ast_members_alias_t *RBS_NONNULL rbs_ast_members_alias_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL new_name, rbs_ast_symbol_t *RBS_NONNULL old_name, enum rbs_alias_kind kind, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range keyword_range, rbs_location_range new_name_range, rbs_location_range old_name_range) {
|
|
609
|
+
rbs_ast_members_alias_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_alias_t);
|
|
610
|
+
|
|
611
|
+
*instance = (rbs_ast_members_alias_t) {
|
|
612
|
+
.base = (rbs_node_t) {
|
|
613
|
+
.type = RBS_AST_MEMBERS_ALIAS,
|
|
614
|
+
.location = location,
|
|
615
|
+
},
|
|
616
|
+
.new_name = new_name,
|
|
617
|
+
.old_name = old_name,
|
|
618
|
+
.kind = kind,
|
|
619
|
+
.annotations = annotations,
|
|
620
|
+
.comment = comment,
|
|
621
|
+
.keyword_range = keyword_range,
|
|
622
|
+
.new_name_range = new_name_range,
|
|
623
|
+
.old_name_range = old_name_range,
|
|
624
|
+
.new_kind_range = RBS_LOCATION_NULL_RANGE,
|
|
625
|
+
.old_kind_range = RBS_LOCATION_NULL_RANGE,
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
return instance;
|
|
629
|
+
}
|
|
630
|
+
#line 140 "templates/src/ast.c.erb"
|
|
631
|
+
rbs_ast_members_attr_accessor_t *RBS_NONNULL rbs_ast_members_attr_accessor_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_attr_ivar_name_t ivar_name, enum rbs_attribute_kind kind, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, enum rbs_attribute_visibility visibility, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
632
|
+
rbs_ast_members_attr_accessor_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_attr_accessor_t);
|
|
633
|
+
|
|
634
|
+
*instance = (rbs_ast_members_attr_accessor_t) {
|
|
635
|
+
.base = (rbs_node_t) {
|
|
636
|
+
.type = RBS_AST_MEMBERS_ATTR_ACCESSOR,
|
|
637
|
+
.location = location,
|
|
638
|
+
},
|
|
639
|
+
.name = name,
|
|
640
|
+
.type = type,
|
|
641
|
+
.ivar_name = ivar_name,
|
|
642
|
+
.kind = kind,
|
|
643
|
+
.annotations = annotations,
|
|
644
|
+
.comment = comment,
|
|
645
|
+
.visibility = visibility,
|
|
646
|
+
.keyword_range = keyword_range,
|
|
647
|
+
.name_range = name_range,
|
|
648
|
+
.colon_range = colon_range,
|
|
649
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
650
|
+
.ivar_range = RBS_LOCATION_NULL_RANGE,
|
|
651
|
+
.ivar_name_range = RBS_LOCATION_NULL_RANGE,
|
|
652
|
+
.visibility_range = RBS_LOCATION_NULL_RANGE,
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
return instance;
|
|
656
|
+
}
|
|
657
|
+
#line 140 "templates/src/ast.c.erb"
|
|
658
|
+
rbs_ast_members_attr_reader_t *RBS_NONNULL rbs_ast_members_attr_reader_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_attr_ivar_name_t ivar_name, enum rbs_attribute_kind kind, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, enum rbs_attribute_visibility visibility, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
659
|
+
rbs_ast_members_attr_reader_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_attr_reader_t);
|
|
660
|
+
|
|
661
|
+
*instance = (rbs_ast_members_attr_reader_t) {
|
|
662
|
+
.base = (rbs_node_t) {
|
|
663
|
+
.type = RBS_AST_MEMBERS_ATTR_READER,
|
|
664
|
+
.location = location,
|
|
665
|
+
},
|
|
666
|
+
.name = name,
|
|
667
|
+
.type = type,
|
|
668
|
+
.ivar_name = ivar_name,
|
|
669
|
+
.kind = kind,
|
|
670
|
+
.annotations = annotations,
|
|
671
|
+
.comment = comment,
|
|
672
|
+
.visibility = visibility,
|
|
673
|
+
.keyword_range = keyword_range,
|
|
674
|
+
.name_range = name_range,
|
|
675
|
+
.colon_range = colon_range,
|
|
676
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
677
|
+
.ivar_range = RBS_LOCATION_NULL_RANGE,
|
|
678
|
+
.ivar_name_range = RBS_LOCATION_NULL_RANGE,
|
|
679
|
+
.visibility_range = RBS_LOCATION_NULL_RANGE,
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
return instance;
|
|
683
|
+
}
|
|
684
|
+
#line 140 "templates/src/ast.c.erb"
|
|
685
|
+
rbs_ast_members_attr_writer_t *RBS_NONNULL rbs_ast_members_attr_writer_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_attr_ivar_name_t ivar_name, enum rbs_attribute_kind kind, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, enum rbs_attribute_visibility visibility, rbs_location_range keyword_range, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
686
|
+
rbs_ast_members_attr_writer_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_attr_writer_t);
|
|
687
|
+
|
|
688
|
+
*instance = (rbs_ast_members_attr_writer_t) {
|
|
689
|
+
.base = (rbs_node_t) {
|
|
690
|
+
.type = RBS_AST_MEMBERS_ATTR_WRITER,
|
|
691
|
+
.location = location,
|
|
692
|
+
},
|
|
693
|
+
.name = name,
|
|
694
|
+
.type = type,
|
|
695
|
+
.ivar_name = ivar_name,
|
|
696
|
+
.kind = kind,
|
|
697
|
+
.annotations = annotations,
|
|
698
|
+
.comment = comment,
|
|
699
|
+
.visibility = visibility,
|
|
700
|
+
.keyword_range = keyword_range,
|
|
701
|
+
.name_range = name_range,
|
|
702
|
+
.colon_range = colon_range,
|
|
703
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
704
|
+
.ivar_range = RBS_LOCATION_NULL_RANGE,
|
|
705
|
+
.ivar_name_range = RBS_LOCATION_NULL_RANGE,
|
|
706
|
+
.visibility_range = RBS_LOCATION_NULL_RANGE,
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
return instance;
|
|
710
|
+
}
|
|
711
|
+
#line 140 "templates/src/ast.c.erb"
|
|
712
|
+
rbs_ast_members_class_instance_variable_t *RBS_NONNULL rbs_ast_members_class_instance_variable_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
713
|
+
rbs_ast_members_class_instance_variable_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_class_instance_variable_t);
|
|
714
|
+
|
|
715
|
+
*instance = (rbs_ast_members_class_instance_variable_t) {
|
|
716
|
+
.base = (rbs_node_t) {
|
|
717
|
+
.type = RBS_AST_MEMBERS_CLASS_INSTANCE_VARIABLE,
|
|
718
|
+
.location = location,
|
|
719
|
+
},
|
|
720
|
+
.name = name,
|
|
721
|
+
.type = type,
|
|
722
|
+
.comment = comment,
|
|
723
|
+
.name_range = name_range,
|
|
724
|
+
.colon_range = colon_range,
|
|
725
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
return instance;
|
|
729
|
+
}
|
|
730
|
+
#line 140 "templates/src/ast.c.erb"
|
|
731
|
+
rbs_ast_members_class_variable_t *RBS_NONNULL rbs_ast_members_class_variable_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
732
|
+
rbs_ast_members_class_variable_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_class_variable_t);
|
|
733
|
+
|
|
734
|
+
*instance = (rbs_ast_members_class_variable_t) {
|
|
735
|
+
.base = (rbs_node_t) {
|
|
736
|
+
.type = RBS_AST_MEMBERS_CLASS_VARIABLE,
|
|
737
|
+
.location = location,
|
|
738
|
+
},
|
|
739
|
+
.name = name,
|
|
740
|
+
.type = type,
|
|
741
|
+
.comment = comment,
|
|
742
|
+
.name_range = name_range,
|
|
743
|
+
.colon_range = colon_range,
|
|
744
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
return instance;
|
|
748
|
+
}
|
|
749
|
+
#line 140 "templates/src/ast.c.erb"
|
|
750
|
+
rbs_ast_members_extend_t *RBS_NONNULL rbs_ast_members_extend_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range keyword_range) {
|
|
751
|
+
rbs_ast_members_extend_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_extend_t);
|
|
752
|
+
|
|
753
|
+
*instance = (rbs_ast_members_extend_t) {
|
|
754
|
+
.base = (rbs_node_t) {
|
|
755
|
+
.type = RBS_AST_MEMBERS_EXTEND,
|
|
756
|
+
.location = location,
|
|
757
|
+
},
|
|
758
|
+
.name = name,
|
|
759
|
+
.args = args,
|
|
760
|
+
.annotations = annotations,
|
|
761
|
+
.comment = comment,
|
|
762
|
+
.name_range = name_range,
|
|
763
|
+
.keyword_range = keyword_range,
|
|
764
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
return instance;
|
|
768
|
+
}
|
|
769
|
+
#line 140 "templates/src/ast.c.erb"
|
|
770
|
+
rbs_ast_members_include_t *RBS_NONNULL rbs_ast_members_include_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range keyword_range) {
|
|
771
|
+
rbs_ast_members_include_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_include_t);
|
|
772
|
+
|
|
773
|
+
*instance = (rbs_ast_members_include_t) {
|
|
774
|
+
.base = (rbs_node_t) {
|
|
775
|
+
.type = RBS_AST_MEMBERS_INCLUDE,
|
|
776
|
+
.location = location,
|
|
777
|
+
},
|
|
778
|
+
.name = name,
|
|
779
|
+
.args = args,
|
|
780
|
+
.annotations = annotations,
|
|
781
|
+
.comment = comment,
|
|
782
|
+
.name_range = name_range,
|
|
783
|
+
.keyword_range = keyword_range,
|
|
784
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
return instance;
|
|
788
|
+
}
|
|
789
|
+
#line 140 "templates/src/ast.c.erb"
|
|
790
|
+
rbs_ast_members_instance_variable_t *RBS_NONNULL rbs_ast_members_instance_variable_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, rbs_node_t *RBS_NONNULL type, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range colon_range) {
|
|
791
|
+
rbs_ast_members_instance_variable_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_instance_variable_t);
|
|
792
|
+
|
|
793
|
+
*instance = (rbs_ast_members_instance_variable_t) {
|
|
794
|
+
.base = (rbs_node_t) {
|
|
795
|
+
.type = RBS_AST_MEMBERS_INSTANCE_VARIABLE,
|
|
796
|
+
.location = location,
|
|
797
|
+
},
|
|
798
|
+
.name = name,
|
|
799
|
+
.type = type,
|
|
800
|
+
.comment = comment,
|
|
801
|
+
.name_range = name_range,
|
|
802
|
+
.colon_range = colon_range,
|
|
803
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
return instance;
|
|
807
|
+
}
|
|
808
|
+
#line 140 "templates/src/ast.c.erb"
|
|
809
|
+
rbs_ast_members_method_definition_t *RBS_NONNULL rbs_ast_members_method_definition_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, enum rbs_method_definition_kind kind, rbs_node_list_t *RBS_NONNULL overloads, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, bool overloading, enum rbs_method_definition_visibility visibility, rbs_location_range keyword_range, rbs_location_range name_range) {
|
|
810
|
+
rbs_ast_members_method_definition_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_method_definition_t);
|
|
811
|
+
|
|
812
|
+
*instance = (rbs_ast_members_method_definition_t) {
|
|
813
|
+
.base = (rbs_node_t) {
|
|
814
|
+
.type = RBS_AST_MEMBERS_METHOD_DEFINITION,
|
|
815
|
+
.location = location,
|
|
816
|
+
},
|
|
817
|
+
.name = name,
|
|
818
|
+
.kind = kind,
|
|
819
|
+
.overloads = overloads,
|
|
820
|
+
.annotations = annotations,
|
|
821
|
+
.comment = comment,
|
|
822
|
+
.overloading = overloading,
|
|
823
|
+
.visibility = visibility,
|
|
824
|
+
.keyword_range = keyword_range,
|
|
825
|
+
.name_range = name_range,
|
|
826
|
+
.kind_range = RBS_LOCATION_NULL_RANGE,
|
|
827
|
+
.overloading_range = RBS_LOCATION_NULL_RANGE,
|
|
828
|
+
.visibility_range = RBS_LOCATION_NULL_RANGE,
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
return instance;
|
|
832
|
+
}
|
|
833
|
+
#line 140 "templates/src/ast.c.erb"
|
|
834
|
+
rbs_ast_members_method_definition_overload_t *RBS_NONNULL rbs_ast_members_method_definition_overload_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL annotations, rbs_node_t *RBS_NONNULL method_type) {
|
|
835
|
+
rbs_ast_members_method_definition_overload_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_method_definition_overload_t);
|
|
836
|
+
|
|
837
|
+
*instance = (rbs_ast_members_method_definition_overload_t) {
|
|
838
|
+
.base = (rbs_node_t) {
|
|
839
|
+
.type = RBS_AST_MEMBERS_METHOD_DEFINITION_OVERLOAD,
|
|
840
|
+
.location = location,
|
|
841
|
+
},
|
|
842
|
+
.annotations = annotations,
|
|
843
|
+
.method_type = method_type,
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
return instance;
|
|
847
|
+
}
|
|
848
|
+
#line 140 "templates/src/ast.c.erb"
|
|
849
|
+
rbs_ast_members_prepend_t *RBS_NONNULL rbs_ast_members_prepend_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_node_list_t *RBS_NONNULL annotations, rbs_ast_comment_t *RBS_NULLABLE comment, rbs_location_range name_range, rbs_location_range keyword_range) {
|
|
850
|
+
rbs_ast_members_prepend_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_prepend_t);
|
|
851
|
+
|
|
852
|
+
*instance = (rbs_ast_members_prepend_t) {
|
|
853
|
+
.base = (rbs_node_t) {
|
|
854
|
+
.type = RBS_AST_MEMBERS_PREPEND,
|
|
855
|
+
.location = location,
|
|
856
|
+
},
|
|
857
|
+
.name = name,
|
|
858
|
+
.args = args,
|
|
859
|
+
.annotations = annotations,
|
|
860
|
+
.comment = comment,
|
|
861
|
+
.name_range = name_range,
|
|
862
|
+
.keyword_range = keyword_range,
|
|
863
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
return instance;
|
|
867
|
+
}
|
|
868
|
+
#line 140 "templates/src/ast.c.erb"
|
|
869
|
+
rbs_ast_members_private_t *RBS_NONNULL rbs_ast_members_private_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
870
|
+
rbs_ast_members_private_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_private_t);
|
|
871
|
+
|
|
872
|
+
*instance = (rbs_ast_members_private_t) {
|
|
873
|
+
.base = (rbs_node_t) {
|
|
874
|
+
.type = RBS_AST_MEMBERS_PRIVATE,
|
|
875
|
+
.location = location,
|
|
876
|
+
},
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
return instance;
|
|
880
|
+
}
|
|
881
|
+
#line 140 "templates/src/ast.c.erb"
|
|
882
|
+
rbs_ast_members_public_t *RBS_NONNULL rbs_ast_members_public_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
883
|
+
rbs_ast_members_public_t *instance = rbs_allocator_alloc(allocator, rbs_ast_members_public_t);
|
|
884
|
+
|
|
885
|
+
*instance = (rbs_ast_members_public_t) {
|
|
886
|
+
.base = (rbs_node_t) {
|
|
887
|
+
.type = RBS_AST_MEMBERS_PUBLIC,
|
|
888
|
+
.location = location,
|
|
889
|
+
},
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
return instance;
|
|
893
|
+
}
|
|
894
|
+
#line 140 "templates/src/ast.c.erb"
|
|
895
|
+
rbs_ast_ruby_annotations_block_param_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_block_param_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range ampersand_location, rbs_location_range name_location, rbs_location_range colon_location, rbs_location_range question_location, rbs_location_range type_location, rbs_node_t *RBS_NONNULL type_, rbs_location_range comment_location) {
|
|
896
|
+
rbs_ast_ruby_annotations_block_param_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_block_param_type_annotation_t);
|
|
897
|
+
|
|
898
|
+
*instance = (rbs_ast_ruby_annotations_block_param_type_annotation_t) {
|
|
899
|
+
.base = (rbs_node_t) {
|
|
900
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_BLOCK_PARAM_TYPE_ANNOTATION,
|
|
901
|
+
.location = location,
|
|
902
|
+
},
|
|
903
|
+
.prefix_location = prefix_location,
|
|
904
|
+
.ampersand_location = ampersand_location,
|
|
905
|
+
.name_location = name_location,
|
|
906
|
+
.colon_location = colon_location,
|
|
907
|
+
.question_location = question_location,
|
|
908
|
+
.type_location = type_location,
|
|
909
|
+
.type_ = type_,
|
|
910
|
+
.comment_location = comment_location,
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
return instance;
|
|
914
|
+
}
|
|
915
|
+
#line 140 "templates/src/ast.c.erb"
|
|
916
|
+
rbs_ast_ruby_annotations_class_alias_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_class_alias_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range keyword_location, rbs_type_name_t *RBS_NONNULL type_name, rbs_location_range type_name_location) {
|
|
917
|
+
rbs_ast_ruby_annotations_class_alias_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_class_alias_annotation_t);
|
|
918
|
+
|
|
919
|
+
*instance = (rbs_ast_ruby_annotations_class_alias_annotation_t) {
|
|
920
|
+
.base = (rbs_node_t) {
|
|
921
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_CLASS_ALIAS_ANNOTATION,
|
|
922
|
+
.location = location,
|
|
923
|
+
},
|
|
924
|
+
.prefix_location = prefix_location,
|
|
925
|
+
.keyword_location = keyword_location,
|
|
926
|
+
.type_name = type_name,
|
|
927
|
+
.type_name_location = type_name_location,
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
return instance;
|
|
931
|
+
}
|
|
932
|
+
#line 140 "templates/src/ast.c.erb"
|
|
933
|
+
rbs_ast_ruby_annotations_colon_method_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_colon_method_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_node_list_t *RBS_NONNULL annotations, rbs_node_t *RBS_NONNULL method_type) {
|
|
934
|
+
rbs_ast_ruby_annotations_colon_method_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_colon_method_type_annotation_t);
|
|
935
|
+
|
|
936
|
+
*instance = (rbs_ast_ruby_annotations_colon_method_type_annotation_t) {
|
|
937
|
+
.base = (rbs_node_t) {
|
|
938
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_COLON_METHOD_TYPE_ANNOTATION,
|
|
939
|
+
.location = location,
|
|
940
|
+
},
|
|
941
|
+
.prefix_location = prefix_location,
|
|
942
|
+
.annotations = annotations,
|
|
943
|
+
.method_type = method_type,
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
return instance;
|
|
947
|
+
}
|
|
948
|
+
#line 140 "templates/src/ast.c.erb"
|
|
949
|
+
rbs_ast_ruby_annotations_double_splat_param_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_double_splat_param_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range star2_location, rbs_location_range name_location, rbs_location_range colon_location, rbs_node_t *RBS_NONNULL param_type, rbs_location_range comment_location) {
|
|
950
|
+
rbs_ast_ruby_annotations_double_splat_param_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_double_splat_param_type_annotation_t);
|
|
951
|
+
|
|
952
|
+
*instance = (rbs_ast_ruby_annotations_double_splat_param_type_annotation_t) {
|
|
953
|
+
.base = (rbs_node_t) {
|
|
954
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_DOUBLE_SPLAT_PARAM_TYPE_ANNOTATION,
|
|
955
|
+
.location = location,
|
|
956
|
+
},
|
|
957
|
+
.prefix_location = prefix_location,
|
|
958
|
+
.star2_location = star2_location,
|
|
959
|
+
.name_location = name_location,
|
|
960
|
+
.colon_location = colon_location,
|
|
961
|
+
.param_type = param_type,
|
|
962
|
+
.comment_location = comment_location,
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
return instance;
|
|
966
|
+
}
|
|
967
|
+
#line 140 "templates/src/ast.c.erb"
|
|
968
|
+
rbs_ast_ruby_annotations_instance_variable_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_instance_variable_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_ast_symbol_t *RBS_NONNULL ivar_name, rbs_location_range ivar_name_location, rbs_location_range colon_location, rbs_node_t *RBS_NONNULL type, rbs_location_range comment_location) {
|
|
969
|
+
rbs_ast_ruby_annotations_instance_variable_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_instance_variable_annotation_t);
|
|
970
|
+
|
|
971
|
+
*instance = (rbs_ast_ruby_annotations_instance_variable_annotation_t) {
|
|
972
|
+
.base = (rbs_node_t) {
|
|
973
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_INSTANCE_VARIABLE_ANNOTATION,
|
|
974
|
+
.location = location,
|
|
975
|
+
},
|
|
976
|
+
.prefix_location = prefix_location,
|
|
977
|
+
.ivar_name = ivar_name,
|
|
978
|
+
.ivar_name_location = ivar_name_location,
|
|
979
|
+
.colon_location = colon_location,
|
|
980
|
+
.type = type,
|
|
981
|
+
.comment_location = comment_location,
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
return instance;
|
|
985
|
+
}
|
|
986
|
+
#line 140 "templates/src/ast.c.erb"
|
|
987
|
+
rbs_ast_ruby_annotations_method_types_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_method_types_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_node_list_t *RBS_NONNULL overloads, rbs_location_range_list_t *RBS_NONNULL vertical_bar_locations, rbs_location_range dot3_location) {
|
|
988
|
+
rbs_ast_ruby_annotations_method_types_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_method_types_annotation_t);
|
|
989
|
+
|
|
990
|
+
*instance = (rbs_ast_ruby_annotations_method_types_annotation_t) {
|
|
991
|
+
.base = (rbs_node_t) {
|
|
992
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_METHOD_TYPES_ANNOTATION,
|
|
993
|
+
.location = location,
|
|
994
|
+
},
|
|
995
|
+
.prefix_location = prefix_location,
|
|
996
|
+
.overloads = overloads,
|
|
997
|
+
.vertical_bar_locations = vertical_bar_locations,
|
|
998
|
+
.dot3_location = dot3_location,
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
return instance;
|
|
1002
|
+
}
|
|
1003
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1004
|
+
rbs_ast_ruby_annotations_module_alias_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_module_alias_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range keyword_location, rbs_type_name_t *RBS_NONNULL type_name, rbs_location_range type_name_location) {
|
|
1005
|
+
rbs_ast_ruby_annotations_module_alias_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_module_alias_annotation_t);
|
|
1006
|
+
|
|
1007
|
+
*instance = (rbs_ast_ruby_annotations_module_alias_annotation_t) {
|
|
1008
|
+
.base = (rbs_node_t) {
|
|
1009
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_MODULE_ALIAS_ANNOTATION,
|
|
1010
|
+
.location = location,
|
|
1011
|
+
},
|
|
1012
|
+
.prefix_location = prefix_location,
|
|
1013
|
+
.keyword_location = keyword_location,
|
|
1014
|
+
.type_name = type_name,
|
|
1015
|
+
.type_name_location = type_name_location,
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
return instance;
|
|
1019
|
+
}
|
|
1020
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1021
|
+
rbs_ast_ruby_annotations_module_self_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_module_self_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range keyword_location, rbs_location_range colon_location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range open_bracket_location, rbs_location_range close_bracket_location, rbs_location_range_list_t *RBS_NONNULL args_comma_locations, rbs_location_range comment_location) {
|
|
1022
|
+
rbs_ast_ruby_annotations_module_self_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_module_self_annotation_t);
|
|
1023
|
+
|
|
1024
|
+
*instance = (rbs_ast_ruby_annotations_module_self_annotation_t) {
|
|
1025
|
+
.base = (rbs_node_t) {
|
|
1026
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_MODULE_SELF_ANNOTATION,
|
|
1027
|
+
.location = location,
|
|
1028
|
+
},
|
|
1029
|
+
.prefix_location = prefix_location,
|
|
1030
|
+
.keyword_location = keyword_location,
|
|
1031
|
+
.colon_location = colon_location,
|
|
1032
|
+
.name = name,
|
|
1033
|
+
.args = args,
|
|
1034
|
+
.open_bracket_location = open_bracket_location,
|
|
1035
|
+
.close_bracket_location = close_bracket_location,
|
|
1036
|
+
.args_comma_locations = args_comma_locations,
|
|
1037
|
+
.comment_location = comment_location,
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
return instance;
|
|
1041
|
+
}
|
|
1042
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1043
|
+
rbs_ast_ruby_annotations_node_type_assertion_t *RBS_NONNULL rbs_ast_ruby_annotations_node_type_assertion_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_node_t *RBS_NONNULL type) {
|
|
1044
|
+
rbs_ast_ruby_annotations_node_type_assertion_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_node_type_assertion_t);
|
|
1045
|
+
|
|
1046
|
+
*instance = (rbs_ast_ruby_annotations_node_type_assertion_t) {
|
|
1047
|
+
.base = (rbs_node_t) {
|
|
1048
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_NODE_TYPE_ASSERTION,
|
|
1049
|
+
.location = location,
|
|
1050
|
+
},
|
|
1051
|
+
.prefix_location = prefix_location,
|
|
1052
|
+
.type = type,
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
return instance;
|
|
1056
|
+
}
|
|
1057
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1058
|
+
rbs_ast_ruby_annotations_param_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_param_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range name_location, rbs_location_range colon_location, rbs_node_t *RBS_NONNULL param_type, rbs_location_range comment_location) {
|
|
1059
|
+
rbs_ast_ruby_annotations_param_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_param_type_annotation_t);
|
|
1060
|
+
|
|
1061
|
+
*instance = (rbs_ast_ruby_annotations_param_type_annotation_t) {
|
|
1062
|
+
.base = (rbs_node_t) {
|
|
1063
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_PARAM_TYPE_ANNOTATION,
|
|
1064
|
+
.location = location,
|
|
1065
|
+
},
|
|
1066
|
+
.prefix_location = prefix_location,
|
|
1067
|
+
.name_location = name_location,
|
|
1068
|
+
.colon_location = colon_location,
|
|
1069
|
+
.param_type = param_type,
|
|
1070
|
+
.comment_location = comment_location,
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
return instance;
|
|
1074
|
+
}
|
|
1075
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1076
|
+
rbs_ast_ruby_annotations_return_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_return_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range return_location, rbs_location_range colon_location, rbs_node_t *RBS_NONNULL return_type, rbs_location_range comment_location) {
|
|
1077
|
+
rbs_ast_ruby_annotations_return_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_return_type_annotation_t);
|
|
1078
|
+
|
|
1079
|
+
*instance = (rbs_ast_ruby_annotations_return_type_annotation_t) {
|
|
1080
|
+
.base = (rbs_node_t) {
|
|
1081
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_RETURN_TYPE_ANNOTATION,
|
|
1082
|
+
.location = location,
|
|
1083
|
+
},
|
|
1084
|
+
.prefix_location = prefix_location,
|
|
1085
|
+
.return_location = return_location,
|
|
1086
|
+
.colon_location = colon_location,
|
|
1087
|
+
.return_type = return_type,
|
|
1088
|
+
.comment_location = comment_location,
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
return instance;
|
|
1092
|
+
}
|
|
1093
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1094
|
+
rbs_ast_ruby_annotations_skip_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_skip_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range skip_location, rbs_location_range comment_location) {
|
|
1095
|
+
rbs_ast_ruby_annotations_skip_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_skip_annotation_t);
|
|
1096
|
+
|
|
1097
|
+
*instance = (rbs_ast_ruby_annotations_skip_annotation_t) {
|
|
1098
|
+
.base = (rbs_node_t) {
|
|
1099
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_SKIP_ANNOTATION,
|
|
1100
|
+
.location = location,
|
|
1101
|
+
},
|
|
1102
|
+
.prefix_location = prefix_location,
|
|
1103
|
+
.skip_location = skip_location,
|
|
1104
|
+
.comment_location = comment_location,
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
return instance;
|
|
1108
|
+
}
|
|
1109
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1110
|
+
rbs_ast_ruby_annotations_splat_param_type_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_splat_param_type_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_location_range star_location, rbs_location_range name_location, rbs_location_range colon_location, rbs_node_t *RBS_NONNULL param_type, rbs_location_range comment_location) {
|
|
1111
|
+
rbs_ast_ruby_annotations_splat_param_type_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_splat_param_type_annotation_t);
|
|
1112
|
+
|
|
1113
|
+
*instance = (rbs_ast_ruby_annotations_splat_param_type_annotation_t) {
|
|
1114
|
+
.base = (rbs_node_t) {
|
|
1115
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_SPLAT_PARAM_TYPE_ANNOTATION,
|
|
1116
|
+
.location = location,
|
|
1117
|
+
},
|
|
1118
|
+
.prefix_location = prefix_location,
|
|
1119
|
+
.star_location = star_location,
|
|
1120
|
+
.name_location = name_location,
|
|
1121
|
+
.colon_location = colon_location,
|
|
1122
|
+
.param_type = param_type,
|
|
1123
|
+
.comment_location = comment_location,
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
return instance;
|
|
1127
|
+
}
|
|
1128
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1129
|
+
rbs_ast_ruby_annotations_type_application_annotation_t *RBS_NONNULL rbs_ast_ruby_annotations_type_application_annotation_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_location_range prefix_location, rbs_node_list_t *RBS_NONNULL type_args, rbs_location_range close_bracket_location, rbs_location_range_list_t *RBS_NONNULL comma_locations) {
|
|
1130
|
+
rbs_ast_ruby_annotations_type_application_annotation_t *instance = rbs_allocator_alloc(allocator, rbs_ast_ruby_annotations_type_application_annotation_t);
|
|
1131
|
+
|
|
1132
|
+
*instance = (rbs_ast_ruby_annotations_type_application_annotation_t) {
|
|
1133
|
+
.base = (rbs_node_t) {
|
|
1134
|
+
.type = RBS_AST_RUBY_ANNOTATIONS_TYPE_APPLICATION_ANNOTATION,
|
|
1135
|
+
.location = location,
|
|
1136
|
+
},
|
|
1137
|
+
.prefix_location = prefix_location,
|
|
1138
|
+
.type_args = type_args,
|
|
1139
|
+
.close_bracket_location = close_bracket_location,
|
|
1140
|
+
.comma_locations = comma_locations,
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
return instance;
|
|
1144
|
+
}
|
|
1145
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1146
|
+
rbs_ast_string_t *RBS_NONNULL rbs_ast_string_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_string_t string) {
|
|
1147
|
+
rbs_ast_string_t *instance = rbs_allocator_alloc(allocator, rbs_ast_string_t);
|
|
1148
|
+
|
|
1149
|
+
*instance = (rbs_ast_string_t) {
|
|
1150
|
+
.base = (rbs_node_t) {
|
|
1151
|
+
.type = RBS_AST_STRING,
|
|
1152
|
+
.location = location,
|
|
1153
|
+
},
|
|
1154
|
+
.string = string,
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
return instance;
|
|
1158
|
+
}
|
|
1159
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1160
|
+
rbs_ast_type_param_t *RBS_NONNULL rbs_ast_type_param_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name, enum rbs_type_param_variance variance, rbs_node_t *RBS_NULLABLE upper_bound, rbs_node_t *RBS_NULLABLE lower_bound, rbs_node_t *RBS_NULLABLE default_type, bool unchecked, rbs_location_range name_range) {
|
|
1161
|
+
rbs_ast_type_param_t *instance = rbs_allocator_alloc(allocator, rbs_ast_type_param_t);
|
|
1162
|
+
|
|
1163
|
+
*instance = (rbs_ast_type_param_t) {
|
|
1164
|
+
.base = (rbs_node_t) {
|
|
1165
|
+
.type = RBS_AST_TYPE_PARAM,
|
|
1166
|
+
.location = location,
|
|
1167
|
+
},
|
|
1168
|
+
.name = name,
|
|
1169
|
+
.variance = variance,
|
|
1170
|
+
.upper_bound = upper_bound,
|
|
1171
|
+
.lower_bound = lower_bound,
|
|
1172
|
+
.default_type = default_type,
|
|
1173
|
+
.unchecked = unchecked,
|
|
1174
|
+
.name_range = name_range,
|
|
1175
|
+
.variance_range = RBS_LOCATION_NULL_RANGE,
|
|
1176
|
+
.unchecked_range = RBS_LOCATION_NULL_RANGE,
|
|
1177
|
+
.upper_bound_range = RBS_LOCATION_NULL_RANGE,
|
|
1178
|
+
.lower_bound_range = RBS_LOCATION_NULL_RANGE,
|
|
1179
|
+
.default_range = RBS_LOCATION_NULL_RANGE,
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
return instance;
|
|
1183
|
+
}
|
|
1184
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1185
|
+
rbs_method_type_t *RBS_NONNULL rbs_method_type_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL type_params, rbs_node_t *RBS_NONNULL type, rbs_types_block_t *RBS_NULLABLE block, rbs_location_range type_range) {
|
|
1186
|
+
rbs_method_type_t *instance = rbs_allocator_alloc(allocator, rbs_method_type_t);
|
|
1187
|
+
|
|
1188
|
+
*instance = (rbs_method_type_t) {
|
|
1189
|
+
.base = (rbs_node_t) {
|
|
1190
|
+
.type = RBS_METHOD_TYPE,
|
|
1191
|
+
.location = location,
|
|
1192
|
+
},
|
|
1193
|
+
.type_params = type_params,
|
|
1194
|
+
.type = type,
|
|
1195
|
+
.block = block,
|
|
1196
|
+
.type_range = type_range,
|
|
1197
|
+
.type_params_range = RBS_LOCATION_NULL_RANGE,
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
return instance;
|
|
1201
|
+
}
|
|
1202
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1203
|
+
rbs_namespace_t *RBS_NONNULL rbs_namespace_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL path, bool absolute) {
|
|
1204
|
+
rbs_namespace_t *instance = rbs_allocator_alloc(allocator, rbs_namespace_t);
|
|
1205
|
+
|
|
1206
|
+
*instance = (rbs_namespace_t) {
|
|
1207
|
+
.base = (rbs_node_t) {
|
|
1208
|
+
.type = RBS_NAMESPACE,
|
|
1209
|
+
.location = location,
|
|
1210
|
+
},
|
|
1211
|
+
.path = path,
|
|
1212
|
+
.absolute = absolute,
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
return instance;
|
|
1216
|
+
}
|
|
1217
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1218
|
+
rbs_signature_t *RBS_NONNULL rbs_signature_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL directives, rbs_node_list_t *RBS_NONNULL declarations) {
|
|
1219
|
+
rbs_signature_t *instance = rbs_allocator_alloc(allocator, rbs_signature_t);
|
|
1220
|
+
|
|
1221
|
+
*instance = (rbs_signature_t) {
|
|
1222
|
+
.base = (rbs_node_t) {
|
|
1223
|
+
.type = RBS_SIGNATURE,
|
|
1224
|
+
.location = location,
|
|
1225
|
+
},
|
|
1226
|
+
.directives = directives,
|
|
1227
|
+
.declarations = declarations,
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
return instance;
|
|
1231
|
+
}
|
|
1232
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1233
|
+
rbs_type_name_t *RBS_NONNULL rbs_type_name_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_namespace_t *RBS_NONNULL rbs_namespace, rbs_ast_symbol_t *RBS_NONNULL name) {
|
|
1234
|
+
rbs_type_name_t *instance = rbs_allocator_alloc(allocator, rbs_type_name_t);
|
|
1235
|
+
|
|
1236
|
+
*instance = (rbs_type_name_t) {
|
|
1237
|
+
.base = (rbs_node_t) {
|
|
1238
|
+
.type = RBS_TYPE_NAME,
|
|
1239
|
+
.location = location,
|
|
1240
|
+
},
|
|
1241
|
+
.rbs_namespace = rbs_namespace,
|
|
1242
|
+
.name = name,
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
return instance;
|
|
1246
|
+
}
|
|
1247
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1248
|
+
rbs_types_alias_t *RBS_NONNULL rbs_types_alias_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
1249
|
+
rbs_types_alias_t *instance = rbs_allocator_alloc(allocator, rbs_types_alias_t);
|
|
1250
|
+
|
|
1251
|
+
*instance = (rbs_types_alias_t) {
|
|
1252
|
+
.base = (rbs_node_t) {
|
|
1253
|
+
.type = RBS_TYPES_ALIAS,
|
|
1254
|
+
.location = location,
|
|
1255
|
+
},
|
|
1256
|
+
.name = name,
|
|
1257
|
+
.args = args,
|
|
1258
|
+
.name_range = name_range,
|
|
1259
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
1260
|
+
};
|
|
1261
|
+
|
|
1262
|
+
return instance;
|
|
1263
|
+
}
|
|
1264
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1265
|
+
rbs_types_bases_any_t *RBS_NONNULL rbs_types_bases_any_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, bool todo) {
|
|
1266
|
+
rbs_types_bases_any_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_any_t);
|
|
1267
|
+
|
|
1268
|
+
*instance = (rbs_types_bases_any_t) {
|
|
1269
|
+
.base = (rbs_node_t) {
|
|
1270
|
+
.type = RBS_TYPES_BASES_ANY,
|
|
1271
|
+
.location = location,
|
|
1272
|
+
},
|
|
1273
|
+
.todo = todo,
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
return instance;
|
|
1277
|
+
}
|
|
1278
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1279
|
+
rbs_types_bases_bool_t *RBS_NONNULL rbs_types_bases_bool_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1280
|
+
rbs_types_bases_bool_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_bool_t);
|
|
1281
|
+
|
|
1282
|
+
*instance = (rbs_types_bases_bool_t) {
|
|
1283
|
+
.base = (rbs_node_t) {
|
|
1284
|
+
.type = RBS_TYPES_BASES_BOOL,
|
|
1285
|
+
.location = location,
|
|
1286
|
+
},
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
return instance;
|
|
1290
|
+
}
|
|
1291
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1292
|
+
rbs_types_bases_bottom_t *RBS_NONNULL rbs_types_bases_bottom_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1293
|
+
rbs_types_bases_bottom_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_bottom_t);
|
|
1294
|
+
|
|
1295
|
+
*instance = (rbs_types_bases_bottom_t) {
|
|
1296
|
+
.base = (rbs_node_t) {
|
|
1297
|
+
.type = RBS_TYPES_BASES_BOTTOM,
|
|
1298
|
+
.location = location,
|
|
1299
|
+
},
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
return instance;
|
|
1303
|
+
}
|
|
1304
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1305
|
+
rbs_types_bases_class_t *RBS_NONNULL rbs_types_bases_class_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1306
|
+
rbs_types_bases_class_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_class_t);
|
|
1307
|
+
|
|
1308
|
+
*instance = (rbs_types_bases_class_t) {
|
|
1309
|
+
.base = (rbs_node_t) {
|
|
1310
|
+
.type = RBS_TYPES_BASES_CLASS,
|
|
1311
|
+
.location = location,
|
|
1312
|
+
},
|
|
1313
|
+
};
|
|
1314
|
+
|
|
1315
|
+
return instance;
|
|
1316
|
+
}
|
|
1317
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1318
|
+
rbs_types_bases_instance_t *RBS_NONNULL rbs_types_bases_instance_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1319
|
+
rbs_types_bases_instance_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_instance_t);
|
|
1320
|
+
|
|
1321
|
+
*instance = (rbs_types_bases_instance_t) {
|
|
1322
|
+
.base = (rbs_node_t) {
|
|
1323
|
+
.type = RBS_TYPES_BASES_INSTANCE,
|
|
1324
|
+
.location = location,
|
|
1325
|
+
},
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
return instance;
|
|
1329
|
+
}
|
|
1330
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1331
|
+
rbs_types_bases_nil_t *RBS_NONNULL rbs_types_bases_nil_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1332
|
+
rbs_types_bases_nil_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_nil_t);
|
|
1333
|
+
|
|
1334
|
+
*instance = (rbs_types_bases_nil_t) {
|
|
1335
|
+
.base = (rbs_node_t) {
|
|
1336
|
+
.type = RBS_TYPES_BASES_NIL,
|
|
1337
|
+
.location = location,
|
|
1338
|
+
},
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
return instance;
|
|
1342
|
+
}
|
|
1343
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1344
|
+
rbs_types_bases_self_t *RBS_NONNULL rbs_types_bases_self_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1345
|
+
rbs_types_bases_self_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_self_t);
|
|
1346
|
+
|
|
1347
|
+
*instance = (rbs_types_bases_self_t) {
|
|
1348
|
+
.base = (rbs_node_t) {
|
|
1349
|
+
.type = RBS_TYPES_BASES_SELF,
|
|
1350
|
+
.location = location,
|
|
1351
|
+
},
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
return instance;
|
|
1355
|
+
}
|
|
1356
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1357
|
+
rbs_types_bases_top_t *RBS_NONNULL rbs_types_bases_top_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1358
|
+
rbs_types_bases_top_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_top_t);
|
|
1359
|
+
|
|
1360
|
+
*instance = (rbs_types_bases_top_t) {
|
|
1361
|
+
.base = (rbs_node_t) {
|
|
1362
|
+
.type = RBS_TYPES_BASES_TOP,
|
|
1363
|
+
.location = location,
|
|
1364
|
+
},
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
return instance;
|
|
1368
|
+
}
|
|
1369
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1370
|
+
rbs_types_bases_void_t *RBS_NONNULL rbs_types_bases_void_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location) {
|
|
1371
|
+
rbs_types_bases_void_t *instance = rbs_allocator_alloc(allocator, rbs_types_bases_void_t);
|
|
1372
|
+
|
|
1373
|
+
*instance = (rbs_types_bases_void_t) {
|
|
1374
|
+
.base = (rbs_node_t) {
|
|
1375
|
+
.type = RBS_TYPES_BASES_VOID,
|
|
1376
|
+
.location = location,
|
|
1377
|
+
},
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
return instance;
|
|
1381
|
+
}
|
|
1382
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1383
|
+
rbs_types_block_t *RBS_NONNULL rbs_types_block_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL type, bool required, rbs_node_t *RBS_NULLABLE self_type) {
|
|
1384
|
+
rbs_types_block_t *instance = rbs_allocator_alloc(allocator, rbs_types_block_t);
|
|
1385
|
+
|
|
1386
|
+
*instance = (rbs_types_block_t) {
|
|
1387
|
+
.base = (rbs_node_t) {
|
|
1388
|
+
.type = RBS_TYPES_BLOCK,
|
|
1389
|
+
.location = location,
|
|
1390
|
+
},
|
|
1391
|
+
.type = type,
|
|
1392
|
+
.required = required,
|
|
1393
|
+
.self_type = self_type,
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
return instance;
|
|
1397
|
+
}
|
|
1398
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1399
|
+
rbs_types_class_instance_t *RBS_NONNULL rbs_types_class_instance_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
1400
|
+
rbs_types_class_instance_t *instance = rbs_allocator_alloc(allocator, rbs_types_class_instance_t);
|
|
1401
|
+
|
|
1402
|
+
*instance = (rbs_types_class_instance_t) {
|
|
1403
|
+
.base = (rbs_node_t) {
|
|
1404
|
+
.type = RBS_TYPES_CLASS_INSTANCE,
|
|
1405
|
+
.location = location,
|
|
1406
|
+
},
|
|
1407
|
+
.name = name,
|
|
1408
|
+
.args = args,
|
|
1409
|
+
.name_range = name_range,
|
|
1410
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
return instance;
|
|
1414
|
+
}
|
|
1415
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1416
|
+
rbs_types_class_singleton_t *RBS_NONNULL rbs_types_class_singleton_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
1417
|
+
rbs_types_class_singleton_t *instance = rbs_allocator_alloc(allocator, rbs_types_class_singleton_t);
|
|
1418
|
+
|
|
1419
|
+
*instance = (rbs_types_class_singleton_t) {
|
|
1420
|
+
.base = (rbs_node_t) {
|
|
1421
|
+
.type = RBS_TYPES_CLASS_SINGLETON,
|
|
1422
|
+
.location = location,
|
|
1423
|
+
},
|
|
1424
|
+
.name = name,
|
|
1425
|
+
.args = args,
|
|
1426
|
+
.name_range = name_range,
|
|
1427
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
return instance;
|
|
1431
|
+
}
|
|
1432
|
+
#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) {
|
|
1434
|
+
rbs_types_function_t *instance = rbs_allocator_alloc(allocator, rbs_types_function_t);
|
|
1435
|
+
|
|
1436
|
+
*instance = (rbs_types_function_t) {
|
|
1437
|
+
.base = (rbs_node_t) {
|
|
1438
|
+
.type = RBS_TYPES_FUNCTION,
|
|
1439
|
+
.location = location,
|
|
1440
|
+
},
|
|
1441
|
+
.required_positionals = required_positionals,
|
|
1442
|
+
.optional_positionals = optional_positionals,
|
|
1443
|
+
.rest_positionals = rest_positionals,
|
|
1444
|
+
.trailing_positionals = trailing_positionals,
|
|
1445
|
+
.required_keywords = required_keywords,
|
|
1446
|
+
.optional_keywords = optional_keywords,
|
|
1447
|
+
.rest_keywords = rest_keywords,
|
|
1448
|
+
.return_type = return_type,
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
return instance;
|
|
1452
|
+
}
|
|
1453
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1454
|
+
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
|
+
rbs_types_function_param_t *instance = rbs_allocator_alloc(allocator, rbs_types_function_param_t);
|
|
1456
|
+
|
|
1457
|
+
*instance = (rbs_types_function_param_t) {
|
|
1458
|
+
.base = (rbs_node_t) {
|
|
1459
|
+
.type = RBS_TYPES_FUNCTION_PARAM,
|
|
1460
|
+
.location = location,
|
|
1461
|
+
},
|
|
1462
|
+
.type = type,
|
|
1463
|
+
.name = name,
|
|
1464
|
+
.name_range = RBS_LOCATION_NULL_RANGE,
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
return instance;
|
|
1468
|
+
}
|
|
1469
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1470
|
+
rbs_types_interface_t *RBS_NONNULL rbs_types_interface_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_type_name_t *RBS_NONNULL name, rbs_node_list_t *RBS_NONNULL args, rbs_location_range name_range) {
|
|
1471
|
+
rbs_types_interface_t *instance = rbs_allocator_alloc(allocator, rbs_types_interface_t);
|
|
1472
|
+
|
|
1473
|
+
*instance = (rbs_types_interface_t) {
|
|
1474
|
+
.base = (rbs_node_t) {
|
|
1475
|
+
.type = RBS_TYPES_INTERFACE,
|
|
1476
|
+
.location = location,
|
|
1477
|
+
},
|
|
1478
|
+
.name = name,
|
|
1479
|
+
.args = args,
|
|
1480
|
+
.name_range = name_range,
|
|
1481
|
+
.args_range = RBS_LOCATION_NULL_RANGE,
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
return instance;
|
|
1485
|
+
}
|
|
1486
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1487
|
+
rbs_types_intersection_t *RBS_NONNULL rbs_types_intersection_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL types) {
|
|
1488
|
+
rbs_types_intersection_t *instance = rbs_allocator_alloc(allocator, rbs_types_intersection_t);
|
|
1489
|
+
|
|
1490
|
+
*instance = (rbs_types_intersection_t) {
|
|
1491
|
+
.base = (rbs_node_t) {
|
|
1492
|
+
.type = RBS_TYPES_INTERSECTION,
|
|
1493
|
+
.location = location,
|
|
1494
|
+
},
|
|
1495
|
+
.types = types,
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1498
|
+
return instance;
|
|
1499
|
+
}
|
|
1500
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1501
|
+
rbs_types_literal_t *RBS_NONNULL rbs_types_literal_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL literal) {
|
|
1502
|
+
rbs_types_literal_t *instance = rbs_allocator_alloc(allocator, rbs_types_literal_t);
|
|
1503
|
+
|
|
1504
|
+
*instance = (rbs_types_literal_t) {
|
|
1505
|
+
.base = (rbs_node_t) {
|
|
1506
|
+
.type = RBS_TYPES_LITERAL,
|
|
1507
|
+
.location = location,
|
|
1508
|
+
},
|
|
1509
|
+
.literal = literal,
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
return instance;
|
|
1513
|
+
}
|
|
1514
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1515
|
+
rbs_types_optional_t *RBS_NONNULL rbs_types_optional_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL type) {
|
|
1516
|
+
rbs_types_optional_t *instance = rbs_allocator_alloc(allocator, rbs_types_optional_t);
|
|
1517
|
+
|
|
1518
|
+
*instance = (rbs_types_optional_t) {
|
|
1519
|
+
.base = (rbs_node_t) {
|
|
1520
|
+
.type = RBS_TYPES_OPTIONAL,
|
|
1521
|
+
.location = location,
|
|
1522
|
+
},
|
|
1523
|
+
.type = type,
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
return instance;
|
|
1527
|
+
}
|
|
1528
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1529
|
+
rbs_types_proc_t *RBS_NONNULL rbs_types_proc_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL type, rbs_types_block_t *RBS_NULLABLE block, rbs_node_t *RBS_NULLABLE self_type) {
|
|
1530
|
+
rbs_types_proc_t *instance = rbs_allocator_alloc(allocator, rbs_types_proc_t);
|
|
1531
|
+
|
|
1532
|
+
*instance = (rbs_types_proc_t) {
|
|
1533
|
+
.base = (rbs_node_t) {
|
|
1534
|
+
.type = RBS_TYPES_PROC,
|
|
1535
|
+
.location = location,
|
|
1536
|
+
},
|
|
1537
|
+
.type = type,
|
|
1538
|
+
.block = block,
|
|
1539
|
+
.self_type = self_type,
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
return instance;
|
|
1543
|
+
}
|
|
1544
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1545
|
+
rbs_types_record_t *RBS_NONNULL rbs_types_record_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_hash_t *RBS_NONNULL all_fields) {
|
|
1546
|
+
rbs_types_record_t *instance = rbs_allocator_alloc(allocator, rbs_types_record_t);
|
|
1547
|
+
|
|
1548
|
+
*instance = (rbs_types_record_t) {
|
|
1549
|
+
.base = (rbs_node_t) {
|
|
1550
|
+
.type = RBS_TYPES_RECORD,
|
|
1551
|
+
.location = location,
|
|
1552
|
+
},
|
|
1553
|
+
.all_fields = all_fields,
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
return instance;
|
|
1557
|
+
}
|
|
1558
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1559
|
+
rbs_types_record_field_type_t *RBS_NONNULL rbs_types_record_field_type_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL type, bool required) {
|
|
1560
|
+
rbs_types_record_field_type_t *instance = rbs_allocator_alloc(allocator, rbs_types_record_field_type_t);
|
|
1561
|
+
|
|
1562
|
+
*instance = (rbs_types_record_field_type_t) {
|
|
1563
|
+
.base = (rbs_node_t) {
|
|
1564
|
+
.type = RBS_TYPES_RECORD_FIELD_TYPE,
|
|
1565
|
+
.location = location,
|
|
1566
|
+
},
|
|
1567
|
+
.type = type,
|
|
1568
|
+
.required = required,
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
return instance;
|
|
1572
|
+
}
|
|
1573
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1574
|
+
rbs_types_tuple_t *RBS_NONNULL rbs_types_tuple_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL types) {
|
|
1575
|
+
rbs_types_tuple_t *instance = rbs_allocator_alloc(allocator, rbs_types_tuple_t);
|
|
1576
|
+
|
|
1577
|
+
*instance = (rbs_types_tuple_t) {
|
|
1578
|
+
.base = (rbs_node_t) {
|
|
1579
|
+
.type = RBS_TYPES_TUPLE,
|
|
1580
|
+
.location = location,
|
|
1581
|
+
},
|
|
1582
|
+
.types = types,
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1585
|
+
return instance;
|
|
1586
|
+
}
|
|
1587
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1588
|
+
rbs_types_union_t *RBS_NONNULL rbs_types_union_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_list_t *RBS_NONNULL types) {
|
|
1589
|
+
rbs_types_union_t *instance = rbs_allocator_alloc(allocator, rbs_types_union_t);
|
|
1590
|
+
|
|
1591
|
+
*instance = (rbs_types_union_t) {
|
|
1592
|
+
.base = (rbs_node_t) {
|
|
1593
|
+
.type = RBS_TYPES_UNION,
|
|
1594
|
+
.location = location,
|
|
1595
|
+
},
|
|
1596
|
+
.types = types,
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
return instance;
|
|
1600
|
+
}
|
|
1601
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1602
|
+
rbs_types_untyped_function_t *RBS_NONNULL rbs_types_untyped_function_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_node_t *RBS_NONNULL return_type) {
|
|
1603
|
+
rbs_types_untyped_function_t *instance = rbs_allocator_alloc(allocator, rbs_types_untyped_function_t);
|
|
1604
|
+
|
|
1605
|
+
*instance = (rbs_types_untyped_function_t) {
|
|
1606
|
+
.base = (rbs_node_t) {
|
|
1607
|
+
.type = RBS_TYPES_UNTYPED_FUNCTION,
|
|
1608
|
+
.location = location,
|
|
1609
|
+
},
|
|
1610
|
+
.return_type = return_type,
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
return instance;
|
|
1614
|
+
}
|
|
1615
|
+
#line 140 "templates/src/ast.c.erb"
|
|
1616
|
+
rbs_types_variable_t *RBS_NONNULL rbs_types_variable_new(rbs_allocator_t *RBS_NONNULL allocator, rbs_location_range location, rbs_ast_symbol_t *RBS_NONNULL name) {
|
|
1617
|
+
rbs_types_variable_t *instance = rbs_allocator_alloc(allocator, rbs_types_variable_t);
|
|
1618
|
+
|
|
1619
|
+
*instance = (rbs_types_variable_t) {
|
|
1620
|
+
.base = (rbs_node_t) {
|
|
1621
|
+
.type = RBS_TYPES_VARIABLE,
|
|
1622
|
+
.location = location,
|
|
1623
|
+
},
|
|
1624
|
+
.name = name,
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
return instance;
|
|
1628
|
+
}
|