From 53fdc9005c7804196840a4ed12bbd61f674f2f8d Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 08:59:56 -0500 Subject: [PATCH 1/6] feat: Add minitest assertions --- lib/minitest/result_assertions.rb | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/minitest/result_assertions.rb diff --git a/lib/minitest/result_assertions.rb b/lib/minitest/result_assertions.rb new file mode 100644 index 0000000..6dca613 --- /dev/null +++ b/lib/minitest/result_assertions.rb @@ -0,0 +1,49 @@ +# typed: true + +require "minitest/assertions" + +module Minitest + module Assertions + extend T::Sig + + # Fails unless Result is a Success + def assert_success(result) + assert_kind_of(Typed::Success, result) + end + + # Fails unless Result is a Failure + def assert_failure(result) + assert_kind_of(Typed::Failure, result) + end + + # Fails unless exp is equal to payload + def assert_payload(exp, result) + assert_equal(exp, result.payload) + end + + # Fails unless exp is equal to error + def assert_error(exp, result) + assert_equal(exp, result.error) + end + + # Fails if Result is a Success + def refute_success(result) + refute_kind_of(Typed::Success, result) + end + + # Fails if Result is a Failure + def refute_failure(result) + refute_kind_of(Typed::Failure, result) + end + + # Fails if exp is equal to payload + def refute_payload(exp, result) + refute_equal(exp, result.payload) + end + + # Fails if exp is equal to error + def refute_error(exp, result) + refute_equal(exp, result.error) + end + end +end From 7f5aaa412aad1bf5e583e03eca931e3b51dcce16 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 09:01:21 -0500 Subject: [PATCH 2/6] fix: Add minitest as development dependency --- sorbet-result.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sorbet-result.gemspec b/sorbet-result.gemspec index be16f98..9b7a187 100644 --- a/sorbet-result.gemspec +++ b/sorbet-result.gemspec @@ -30,4 +30,6 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_runtime_dependency "sorbet-runtime", "~> 0.5" + + spec.add_development_dependency "minitest", "~> 5.22" end From c41eb1eaa534aec30df500ba08c9144fe988c964 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 09:58:35 -0500 Subject: [PATCH 3/6] fix: Loading issues --- lib/minitest/result_assertions.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/minitest/result_assertions.rb b/lib/minitest/result_assertions.rb index 6dca613..e98c36a 100644 --- a/lib/minitest/result_assertions.rb +++ b/lib/minitest/result_assertions.rb @@ -1,11 +1,10 @@ # typed: true require "minitest/assertions" +require "sorbet-result" module Minitest module Assertions - extend T::Sig - # Fails unless Result is a Success def assert_success(result) assert_kind_of(Typed::Success, result) From b4d138cf32e7fccc6c0da2f67d211c504f70f855 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 09:58:50 -0500 Subject: [PATCH 4/6] tests: Add tests --- .../assertions/result_assertions_test.rb | 30 +++++++++++++++++++ test/test_helper.rb | 1 + 2 files changed, 31 insertions(+) create mode 100644 test/minitest/assertions/result_assertions_test.rb diff --git a/test/minitest/assertions/result_assertions_test.rb b/test/minitest/assertions/result_assertions_test.rb new file mode 100644 index 0000000..47728f4 --- /dev/null +++ b/test/minitest/assertions/result_assertions_test.rb @@ -0,0 +1,30 @@ +# typed: true + +require "test_helper" + +class ResultAssertionsTest < Minitest::Test + def setup + @success = Typed::Success.new("Test Payload") + @failure = Typed::Failure.new("Test Error") + end + + def test_success_assertions + assert_success(@success) + refute_success(@failure) + end + + def test_failure_assertions + assert_failure(@failure) + refute_failure(@success) + end + + def test_payload_assertions + assert_payload("Test Payload", @success) + refute_payload("Payload", @success) + end + + def test_error_assertions + assert_error("Test Error", @failure) + refute_error("Error", @failure) + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index e534c53..b56b303 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true require "minitest/autorun" +require "minitest/result_assertions" require "debug" From 57240a262c99dd9647b73bdc9c2cf1174ff1f9b1 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 09:59:05 -0500 Subject: [PATCH 5/6] docs: Update version and supporting docs --- CHANGELOG.md | 6 ++++++ Gemfile.lock | 2 +- README.md | 23 +++++++++++++++++++++++ sorbet-result.gemspec | 2 +- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 950f7c8..88c8354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2024-02-21 + +### Added + +- Add minitest assertions for Results + ### Changed - Switched to Standard over using Rubocop directly diff --git a/Gemfile.lock b/Gemfile.lock index 56da152..96485f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - sorbet-result (1.0.0) + sorbet-result (1.1.0) sorbet-runtime (~> 0.5) GEM diff --git a/README.md b/README.md index 17ba7ac..8d59f36 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,29 @@ res = retrieve_user(user_id) If the above chain does not fail, the `puts` statement is never run. If the chain does yield a `Failure`, the `puts` block is executed and the `Failure` is ultimately returned. +### Testing + +We ship with a few Minitest assertions that can be used to easily verify Results. + +```ruby +# test_helper.rb + +require "minitest/results_assertions" +# You also need add this to `sorbet/tapioca/require.rb` and rebuild the Minitest gem RBIs + +# *_test.rb + +@success = Typed::Success.new("Test Payload") +@failure = Typed::Failure.new("Test Error") + +assert_success(@success) +assert_failure(@failure) +assert_payload("Test Payload", @success) +assert_error("Test Error", @failure) + +# We also have the `refute_*` counterparts +``` + ## Why use Results? Let's say you're working on a method that reaches out to an API and fetches a resource. We hope to get a successful response and continue on in our program, but you can imagine several scenarios where we don't get that response: our authentication could fail, the server could return a 5XX response code, or the resource we were querying could have moved or not exist any more. diff --git a/sorbet-result.gemspec b/sorbet-result.gemspec index 9b7a187..ae8d004 100644 --- a/sorbet-result.gemspec +++ b/sorbet-result.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "sorbet-result" - spec.version = "1.0.0" + spec.version = "1.1.0" spec.authors = ["Max VelDink"] spec.email = ["maxveldink@gmail.com"] From 5e1c0d8e4104153ff0fcf5258a3a3dfcda77e101 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 21 Feb 2024 10:17:28 -0500 Subject: [PATCH 6/6] deps: Update deps --- Gemfile.lock | 40 +- ...initest@5.21.2.rbi => minitest@5.22.2.rbi} | 291 +- ...{parser@3.3.0.4.rbi => parser@3.3.0.5.rbi} | 0 .../{prism@0.19.0.rbi => prism@0.24.0.rbi} | 26415 ++++++++++------ .../rbi/gems/{rbi@0.1.6.rbi => rbi@0.1.9.rbi} | 110 +- ...bet@0.7.6.rbi => rubocop-sorbet@0.7.7.rbi} | 0 ...{rubocop@1.59.0.rbi => rubocop@1.60.2.rbi} | 1032 +- sorbet/rbi/gems/spoom@1.2.4.rbi | 30 +- ...tandard@1.33.0.rbi => standard@1.34.0.rbi} | 110 +- ...tapioca@0.11.17.rbi => tapioca@0.12.0.rbi} | 58 +- sorbet/rbi/gems/yard-sorbet@0.8.1.rbi | 2 +- test/test_data/failure.out | 4 +- test/test_data/success.out | 4 +- 13 files changed, 17078 insertions(+), 11018 deletions(-) rename sorbet/rbi/gems/{minitest@5.21.2.rbi => minitest@5.22.2.rbi} (90%) rename sorbet/rbi/gems/{parser@3.3.0.4.rbi => parser@3.3.0.5.rbi} (100%) rename sorbet/rbi/gems/{prism@0.19.0.rbi => prism@0.24.0.rbi} (52%) rename sorbet/rbi/gems/{rbi@0.1.6.rbi => rbi@0.1.9.rbi} (96%) rename sorbet/rbi/gems/{rubocop-sorbet@0.7.6.rbi => rubocop-sorbet@0.7.7.rbi} (100%) rename sorbet/rbi/gems/{rubocop@1.59.0.rbi => rubocop@1.60.2.rbi} (98%) rename sorbet/rbi/gems/{standard@1.33.0.rbi => standard@1.34.0.rbi} (88%) rename sorbet/rbi/gems/{tapioca@0.11.17.rbi => tapioca@0.12.0.rbi} (98%) diff --git a/Gemfile.lock b/Gemfile.lock index 96485f2..691d936 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,27 +13,27 @@ GEM reline (>= 0.3.8) erubi (1.12.0) io-console (0.7.2) - irb (1.11.1) + irb (1.11.2) rdoc reline (>= 0.4.2) json (2.7.1) language_server-protocol (3.17.0.3) lint_roller (1.1.0) - minitest (5.21.2) + minitest (5.22.2) netrc (0.11.0) parallel (1.24.0) - parser (3.3.0.4) + parser (3.3.0.5) ast (~> 2.4.1) racc prettier_print (1.2.1) - prism (0.19.0) + prism (0.24.0) psych (5.1.2) stringio racc (1.7.3) rainbow (3.1.1) rake (13.1.0) - rbi (0.1.6) - prism (>= 0.18.0, < 0.20) + rbi (0.1.9) + prism (>= 0.18.0, < 0.25) sorbet-runtime (>= 0.5.9204) rdoc (6.6.2) psych (>= 4.0.0) @@ -41,11 +41,11 @@ GEM reline (0.4.2) io-console (~> 0.5) rexml (3.2.6) - rubocop (1.59.0) + rubocop (1.60.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) @@ -57,26 +57,26 @@ GEM rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) - rubocop-sorbet (0.7.6) + rubocop-sorbet (0.7.7) rubocop (>= 0.90.0) ruby-progressbar (1.13.0) - sorbet (0.5.11212) - sorbet-static (= 0.5.11212) - sorbet-runtime (0.5.11212) - sorbet-static (0.5.11212-universal-darwin) - sorbet-static (0.5.11212-x86_64-linux) - sorbet-static-and-runtime (0.5.11212) - sorbet (= 0.5.11212) - sorbet-runtime (= 0.5.11212) + sorbet (0.5.11262) + sorbet-static (= 0.5.11262) + sorbet-runtime (0.5.11262) + sorbet-static (0.5.11262-universal-darwin) + sorbet-static (0.5.11262-x86_64-linux) + sorbet-static-and-runtime (0.5.11262) + sorbet (= 0.5.11262) + sorbet-runtime (= 0.5.11262) spoom (1.2.4) erubi (>= 1.10.0) sorbet-static-and-runtime (>= 0.5.10187) syntax_tree (>= 6.1.1) thor (>= 0.19.2) - standard (1.33.0) + standard (1.34.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.59.0) + rubocop (~> 1.60) standard-custom (~> 1.0.0) standard-performance (~> 1.3) standard-custom (1.0.2) @@ -91,7 +91,7 @@ GEM stringio (3.1.0) syntax_tree (6.2.0) prettier_print (>= 1.2.0) - tapioca (0.11.17) + tapioca (0.12.0) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) diff --git a/sorbet/rbi/gems/minitest@5.21.2.rbi b/sorbet/rbi/gems/minitest@5.22.2.rbi similarity index 90% rename from sorbet/rbi/gems/minitest@5.21.2.rbi rename to sorbet/rbi/gems/minitest@5.22.2.rbi index f6bb41a..aebdf5d 100644 --- a/sorbet/rbi/gems/minitest@5.21.2.rbi +++ b/sorbet/rbi/gems/minitest@5.22.2.rbi @@ -56,7 +56,7 @@ module Minitest # Internal run method. Responsible for telling all Runnable # sub-classes to run. # - # source://minitest//lib/minitest.rb#176 + # source://minitest//lib/minitest.rb#197 def __run(reporter, options); end # A simple hook allowing you to run a block of code after everything @@ -87,16 +87,19 @@ module Minitest # source://minitest//lib/minitest.rb#18 def cattr_accessor(name); end - # source://minitest//lib/minitest.rb#1134 + # source://minitest//lib/minitest.rb#1146 def clock_time; end + # source://minitest//lib/minitest.rb#177 + def empty_run!(options); end + # source://minitest//lib/minitest.rb#19 def extensions; end # source://minitest//lib/minitest.rb#19 def extensions=(_arg0); end - # source://minitest//lib/minitest.rb#271 + # source://minitest//lib/minitest.rb#292 def filter_backtrace(bt); end # source://minitest//lib/minitest.rb#19 @@ -117,7 +120,7 @@ module Minitest # source://minitest//lib/minitest.rb#19 def parallel_executor=(_arg0); end - # source://minitest//lib/minitest.rb#189 + # source://minitest//lib/minitest.rb#210 def process_args(args = T.unsafe(nil)); end # source://minitest//lib/minitest.rb#19 @@ -136,7 +139,7 @@ module Minitest # Minitest.run(args) # Minitest.__run(reporter, options) # Runnable.runnables.each - # runnable.run(reporter, options) + # runnable_klass.run(reporter, options) # self.runnable_methods.each # self.run_one_method(self, runnable_method, reporter) # Minitest.run_one_method(klass, runnable_method) @@ -145,7 +148,7 @@ module Minitest # source://minitest//lib/minitest.rb#143 def run(args = T.unsafe(nil)); end - # source://minitest//lib/minitest.rb#1125 + # source://minitest//lib/minitest.rb#1137 def run_one_method(klass, method_name); end # source://minitest//lib/minitest.rb#19 @@ -159,24 +162,24 @@ end # Defines the API for Reporters. Subclass this and override whatever # you want. Go nuts. # -# source://minitest//lib/minitest.rb#627 +# source://minitest//lib/minitest.rb#638 class Minitest::AbstractReporter # @return [AbstractReporter] a new instance of AbstractReporter # - # source://minitest//lib/minitest.rb#629 + # source://minitest//lib/minitest.rb#640 def initialize; end # Did this run pass? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#664 + # source://minitest//lib/minitest.rb#675 def passed?; end # About to start running a test. This allows a reporter to show # that it is starting or that we are in the middle of a test run. # - # source://minitest//lib/minitest.rb#643 + # source://minitest//lib/minitest.rb#654 def prerecord(klass, name); end # Output and record the result of the test. Call @@ -184,43 +187,43 @@ class Minitest::AbstractReporter # result character string. Stores the result of the run if the run # did not pass. # - # source://minitest//lib/minitest.rb#652 + # source://minitest//lib/minitest.rb#663 def record(result); end # Outputs the summary of the run. # - # source://minitest//lib/minitest.rb#658 + # source://minitest//lib/minitest.rb#669 def report; end # Starts reporting on the run. # - # source://minitest//lib/minitest.rb#636 + # source://minitest//lib/minitest.rb#647 def start; end - # source://minitest//lib/minitest.rb#668 + # source://minitest//lib/minitest.rb#679 def synchronize(&block); end end # Represents run failures. # -# source://minitest//lib/minitest.rb#951 +# source://minitest//lib/minitest.rb#962 class Minitest::Assertion < ::Exception - # source://minitest//lib/minitest.rb#954 + # source://minitest//lib/minitest.rb#965 def error; end # Where was this run before an assertion was raised? # - # source://minitest//lib/minitest.rb#961 + # source://minitest//lib/minitest.rb#972 def location; end - # source://minitest//lib/minitest.rb#968 + # source://minitest//lib/minitest.rb#980 def result_code; end - # source://minitest//lib/minitest.rb#972 + # source://minitest//lib/minitest.rb#984 def result_label; end end -# source://minitest//lib/minitest.rb#952 +# source://minitest//lib/minitest.rb#963 Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp) # Minitest Assertions. All assertion methods accept a +msg+ which is @@ -672,77 +675,77 @@ Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object) # # See Minitest.backtrace_filter=. # -# source://minitest//lib/minitest.rb#1096 +# source://minitest//lib/minitest.rb#1108 class Minitest::BacktraceFilter # @return [BacktraceFilter] a new instance of BacktraceFilter # - # source://minitest//lib/minitest.rb#1102 + # source://minitest//lib/minitest.rb#1114 def initialize(regexp = T.unsafe(nil)); end # Filter +bt+ to something useful. Returns the whole thing if # $DEBUG (ruby) or $MT_DEBUG (env). # - # source://minitest//lib/minitest.rb#1110 + # source://minitest//lib/minitest.rb#1122 def filter(bt); end # Returns the value of attribute regexp. # - # source://minitest//lib/minitest.rb#1100 + # source://minitest//lib/minitest.rb#1112 def regexp; end # Sets the attribute regexp # # @param value the value to set the attribute regexp to. # - # source://minitest//lib/minitest.rb#1100 + # source://minitest//lib/minitest.rb#1112 def regexp=(_arg0); end end -# source://minitest//lib/minitest.rb#1098 +# source://minitest//lib/minitest.rb#1110 Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp) # Dispatch to multiple reporters as one. # -# source://minitest//lib/minitest.rb#900 +# source://minitest//lib/minitest.rb#911 class Minitest::CompositeReporter < ::Minitest::AbstractReporter # @return [CompositeReporter] a new instance of CompositeReporter # - # source://minitest//lib/minitest.rb#906 + # source://minitest//lib/minitest.rb#917 def initialize(*reporters); end # Add another reporter to the mix. # - # source://minitest//lib/minitest.rb#918 + # source://minitest//lib/minitest.rb#929 def <<(reporter); end - # source://minitest//lib/minitest.rb#911 + # source://minitest//lib/minitest.rb#922 def io; end # @return [Boolean] # - # source://minitest//lib/minitest.rb#922 + # source://minitest//lib/minitest.rb#933 def passed?; end - # source://minitest//lib/minitest.rb#930 + # source://minitest//lib/minitest.rb#941 def prerecord(klass, name); end - # source://minitest//lib/minitest.rb#937 + # source://minitest//lib/minitest.rb#948 def record(result); end - # source://minitest//lib/minitest.rb#943 + # source://minitest//lib/minitest.rb#954 def report; end # The list of reporters to dispatch to. # - # source://minitest//lib/minitest.rb#904 + # source://minitest//lib/minitest.rb#915 def reporters; end # The list of reporters to dispatch to. # - # source://minitest//lib/minitest.rb#904 + # source://minitest//lib/minitest.rb#915 def reporters=(_arg0); end - # source://minitest//lib/minitest.rb#926 + # source://minitest//lib/minitest.rb#937 def start; end end @@ -1013,48 +1016,48 @@ end # # ... lots of test methods ... # end # -# source://minitest//lib/minitest.rb#1040 +# source://minitest//lib/minitest.rb#1052 module Minitest::Guard # Is this running on jruby? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1045 + # source://minitest//lib/minitest.rb#1057 def jruby?(platform = T.unsafe(nil)); end # Is this running on maglev? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1052 + # source://minitest//lib/minitest.rb#1064 def maglev?(platform = T.unsafe(nil)); end # Is this running on mri? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1062 + # source://minitest//lib/minitest.rb#1074 def mri?(platform = T.unsafe(nil)); end # Is this running on macOS? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1069 + # source://minitest//lib/minitest.rb#1081 def osx?(platform = T.unsafe(nil)); end # Is this running on rubinius? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1076 + # source://minitest//lib/minitest.rb#1088 def rubinius?(platform = T.unsafe(nil)); end # Is this running on windows? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#1086 + # source://minitest//lib/minitest.rb#1098 def windows?(platform = T.unsafe(nil)); end end @@ -1217,36 +1220,36 @@ end # plugin, pull this out of the composite and replace it with your # own. # -# source://minitest//lib/minitest.rb#699 +# source://minitest//lib/minitest.rb#710 class Minitest::ProgressReporter < ::Minitest::Reporter - # source://minitest//lib/minitest.rb#700 + # source://minitest//lib/minitest.rb#711 def prerecord(klass, name); end - # source://minitest//lib/minitest.rb#707 + # source://minitest//lib/minitest.rb#718 def record(result); end end # Shared code for anything that can get passed to a Reporter. See # Minitest::Test & Minitest::Result. # -# source://minitest//lib/minitest.rb#521 +# source://minitest//lib/minitest.rb#532 module Minitest::Reportable # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#543 + # source://minitest//lib/minitest.rb#554 def class_name; end # Did this run error? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#564 + # source://minitest//lib/minitest.rb#575 def error?; end # The location identifier of this test. Depends on a method # existing called class_name. # - # source://minitest//lib/minitest.rb#538 + # source://minitest//lib/minitest.rb#549 def location; end # Did this run pass? @@ -1256,50 +1259,50 @@ module Minitest::Reportable # # @return [Boolean] # - # source://minitest//lib/minitest.rb#528 + # source://minitest//lib/minitest.rb#539 def passed?; end # Returns ".", "F", or "E" based on the result of the run. # - # source://minitest//lib/minitest.rb#550 + # source://minitest//lib/minitest.rb#561 def result_code; end # Was this run skipped? # # @return [Boolean] # - # source://minitest//lib/minitest.rb#557 + # source://minitest//lib/minitest.rb#568 def skipped?; end end -# source://minitest//lib/minitest.rb#532 +# source://minitest//lib/minitest.rb#543 Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String) -# source://minitest//lib/minitest.rb#675 +# source://minitest//lib/minitest.rb#686 class Minitest::Reporter < ::Minitest::AbstractReporter # @return [Reporter] a new instance of Reporter # - # source://minitest//lib/minitest.rb#684 + # source://minitest//lib/minitest.rb#695 def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end # The IO used to report. # - # source://minitest//lib/minitest.rb#677 + # source://minitest//lib/minitest.rb#688 def io; end # The IO used to report. # - # source://minitest//lib/minitest.rb#677 + # source://minitest//lib/minitest.rb#688 def io=(_arg0); end # Command-line options for this run. # - # source://minitest//lib/minitest.rb#682 + # source://minitest//lib/minitest.rb#693 def options; end # Command-line options for this run. # - # source://minitest//lib/minitest.rb#682 + # source://minitest//lib/minitest.rb#693 def options=(_arg0); end end @@ -1309,80 +1312,80 @@ end # blow up. By using Result.from(a_test) you can be reasonably sure # that the test result can be marshalled. # -# source://minitest//lib/minitest.rb#576 +# source://minitest//lib/minitest.rb#587 class Minitest::Result < ::Minitest::Runnable include ::Minitest::Reportable - # source://minitest//lib/minitest.rb#610 + # source://minitest//lib/minitest.rb#621 def class_name; end # The class name of the test result. # - # source://minitest//lib/minitest.rb#585 + # source://minitest//lib/minitest.rb#596 def klass; end # The class name of the test result. # - # source://minitest//lib/minitest.rb#585 + # source://minitest//lib/minitest.rb#596 def klass=(_arg0); end # The location of the test method. # - # source://minitest//lib/minitest.rb#590 + # source://minitest//lib/minitest.rb#601 def source_location; end # The location of the test method. # - # source://minitest//lib/minitest.rb#590 + # source://minitest//lib/minitest.rb#601 def source_location=(_arg0); end - # source://minitest//lib/minitest.rb#614 + # source://minitest//lib/minitest.rb#625 def to_s; end class << self # Create a new test result from a Runnable instance. # - # source://minitest//lib/minitest.rb#595 + # source://minitest//lib/minitest.rb#606 def from(runnable); end end end # re-open # -# source://minitest//lib/minitest.rb#284 +# source://minitest//lib/minitest.rb#305 class Minitest::Runnable # @return [Runnable] a new instance of Runnable # - # source://minitest//lib/minitest.rb#452 + # source://minitest//lib/minitest.rb#463 def initialize(name); end # Number of assertions executed in this run. # - # source://minitest//lib/minitest.rb#288 + # source://minitest//lib/minitest.rb#309 def assertions; end # Number of assertions executed in this run. # - # source://minitest//lib/minitest.rb#288 + # source://minitest//lib/minitest.rb#309 def assertions=(_arg0); end - # source://minitest//lib/minitest.rb#448 + # source://minitest//lib/minitest.rb#459 def failure; end # An assertion raised during the run, if any. # - # source://minitest//lib/minitest.rb#293 + # source://minitest//lib/minitest.rb#314 def failures; end # An assertion raised during the run, if any. # - # source://minitest//lib/minitest.rb#293 + # source://minitest//lib/minitest.rb#314 def failures=(_arg0); end - # source://minitest//lib/minitest.rb#434 + # source://minitest//lib/minitest.rb#445 def marshal_dump; end - # source://minitest//lib/minitest.rb#444 + # source://minitest//lib/minitest.rb#455 def marshal_load(ary); end # Metadata you attach to the test results that get sent to the reporter. @@ -1392,29 +1395,29 @@ class Minitest::Runnable # NOTE: this data *must* be plain (read: marshal-able) data! # Hashes! Arrays! Strings! # - # source://minitest//lib/minitest.rb#467 + # source://minitest//lib/minitest.rb#478 def metadata; end # Sets metadata, mainly used for +Result.from+. # - # source://minitest//lib/minitest.rb#474 + # source://minitest//lib/minitest.rb#485 def metadata=(_arg0); end # Returns true if metadata exists. # # @return [Boolean] # - # source://minitest//lib/minitest.rb#479 + # source://minitest//lib/minitest.rb#490 def metadata?; end # Name of the run. # - # source://minitest//lib/minitest.rb#311 + # source://minitest//lib/minitest.rb#332 def name; end # Set the name of the run. # - # source://minitest//lib/minitest.rb#318 + # source://minitest//lib/minitest.rb#339 def name=(o); end # Did this run pass? @@ -1425,7 +1428,7 @@ class Minitest::Runnable # @raise [NotImplementedError] # @return [Boolean] # - # source://minitest//lib/minitest.rb#496 + # source://minitest//lib/minitest.rb#507 def passed?; end # Returns a single character string to print based on the result @@ -1434,14 +1437,14 @@ class Minitest::Runnable # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#505 + # source://minitest//lib/minitest.rb#516 def result_code; end # Runs a single method. Needs to return self. # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#486 + # source://minitest//lib/minitest.rb#497 def run; end # Was this run skipped? See #passed? for more information. @@ -1449,42 +1452,42 @@ class Minitest::Runnable # @raise [NotImplementedError] # @return [Boolean] # - # source://minitest//lib/minitest.rb#512 + # source://minitest//lib/minitest.rb#523 def skipped?; end # The time it took to run. # - # source://minitest//lib/minitest.rb#298 + # source://minitest//lib/minitest.rb#319 def time; end # The time it took to run. # - # source://minitest//lib/minitest.rb#298 + # source://minitest//lib/minitest.rb#319 def time=(_arg0); end - # source://minitest//lib/minitest.rb#300 + # source://minitest//lib/minitest.rb#321 def time_it; end class << self - # source://minitest//lib/minitest.rb#1144 + # source://minitest//lib/minitest.rb#1156 def inherited(klass); end # Returns all instance methods matching the pattern +re+. # - # source://minitest//lib/minitest.rb#325 + # source://minitest//lib/minitest.rb#346 def methods_matching(re); end - # source://minitest//lib/minitest.rb#404 + # source://minitest//lib/minitest.rb#415 def on_signal(name, action); end - # source://minitest//lib/minitest.rb#329 + # source://minitest//lib/minitest.rb#350 def reset; end # Responsible for running all runnable methods in a given class, # each in its own instance. Each instance is passed to the # reporter to record. # - # source://minitest//lib/minitest.rb#340 + # source://minitest//lib/minitest.rb#361 def run(reporter, options = T.unsafe(nil)); end # Runs a single method and has the reporter record the result. @@ -1492,7 +1495,7 @@ class Minitest::Runnable # that subclasses can specialize the running of an individual # test. See Minitest::ParallelTest::ClassMethods for an example. # - # source://minitest//lib/minitest.rb#376 + # source://minitest//lib/minitest.rb#387 def run_one_method(klass, method_name, reporter); end # Each subclass of Runnable is responsible for overriding this @@ -1500,33 +1503,33 @@ class Minitest::Runnable # # @raise [NotImplementedError] # - # source://minitest//lib/minitest.rb#421 + # source://minitest//lib/minitest.rb#432 def runnable_methods; end # Returns all subclasses of Runnable. # - # source://minitest//lib/minitest.rb#428 + # source://minitest//lib/minitest.rb#439 def runnables; end # Defines the order to run tests (:random by default). Override # this or use a convenience method to change it for your tests. # - # source://minitest//lib/minitest.rb#385 + # source://minitest//lib/minitest.rb#396 def test_order; end - # source://minitest//lib/minitest.rb#389 + # source://minitest//lib/minitest.rb#400 def with_info_handler(reporter, &block); end end end -# source://minitest//lib/minitest.rb#402 +# source://minitest//lib/minitest.rb#413 Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash) # Assertion raised when skipping a run. # -# source://minitest//lib/minitest.rb#980 +# source://minitest//lib/minitest.rb#992 class Minitest::Skip < ::Minitest::Assertion - # source://minitest//lib/minitest.rb#981 + # source://minitest//lib/minitest.rb#993 def result_label; end end @@ -1783,113 +1786,113 @@ Minitest::Spec::TYPES = T.let(T.unsafe(nil), Array) # end # end # -# source://minitest//lib/minitest.rb#735 +# source://minitest//lib/minitest.rb#746 class Minitest::StatisticsReporter < ::Minitest::Reporter # @return [StatisticsReporter] a new instance of StatisticsReporter # - # source://minitest//lib/minitest.rb#779 + # source://minitest//lib/minitest.rb#790 def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end # Total number of assertions. # - # source://minitest//lib/minitest.rb#739 + # source://minitest//lib/minitest.rb#750 def assertions; end # Total number of assertions. # - # source://minitest//lib/minitest.rb#739 + # source://minitest//lib/minitest.rb#750 def assertions=(_arg0); end # Total number of test cases. # - # source://minitest//lib/minitest.rb#744 + # source://minitest//lib/minitest.rb#755 def count; end # Total number of test cases. # - # source://minitest//lib/minitest.rb#744 + # source://minitest//lib/minitest.rb#755 def count=(_arg0); end # Total number of tests that erred. # - # source://minitest//lib/minitest.rb#772 + # source://minitest//lib/minitest.rb#783 def errors; end # Total number of tests that erred. # - # source://minitest//lib/minitest.rb#772 + # source://minitest//lib/minitest.rb#783 def errors=(_arg0); end # Total number of tests that failed. # - # source://minitest//lib/minitest.rb#767 + # source://minitest//lib/minitest.rb#778 def failures; end # Total number of tests that failed. # - # source://minitest//lib/minitest.rb#767 + # source://minitest//lib/minitest.rb#778 def failures=(_arg0); end # @return [Boolean] # - # source://minitest//lib/minitest.rb#792 + # source://minitest//lib/minitest.rb#803 def passed?; end - # source://minitest//lib/minitest.rb#800 + # source://minitest//lib/minitest.rb#811 def record(result); end # Report on the tracked statistics. # - # source://minitest//lib/minitest.rb#810 + # source://minitest//lib/minitest.rb#821 def report; end # An +Array+ of test cases that failed or were skipped. # - # source://minitest//lib/minitest.rb#749 + # source://minitest//lib/minitest.rb#760 def results; end # An +Array+ of test cases that failed or were skipped. # - # source://minitest//lib/minitest.rb#749 + # source://minitest//lib/minitest.rb#760 def results=(_arg0); end # Total number of tests that where skipped. # - # source://minitest//lib/minitest.rb#777 + # source://minitest//lib/minitest.rb#788 def skips; end # Total number of tests that where skipped. # - # source://minitest//lib/minitest.rb#777 + # source://minitest//lib/minitest.rb#788 def skips=(_arg0); end - # source://minitest//lib/minitest.rb#796 + # source://minitest//lib/minitest.rb#807 def start; end # Time the test run started. If available, the monotonic clock is # used and this is a +Float+, otherwise it's an instance of # +Time+. # - # source://minitest//lib/minitest.rb#756 + # source://minitest//lib/minitest.rb#767 def start_time; end # Time the test run started. If available, the monotonic clock is # used and this is a +Float+, otherwise it's an instance of # +Time+. # - # source://minitest//lib/minitest.rb#756 + # source://minitest//lib/minitest.rb#767 def start_time=(_arg0); end # Test run time. If available, the monotonic clock is used and # this is a +Float+, otherwise it's an instance of +Time+. # - # source://minitest//lib/minitest.rb#762 + # source://minitest//lib/minitest.rb#773 def total_time; end # Test run time. If available, the monotonic clock is used and # this is a +Float+, otherwise it's an instance of +Time+. # - # source://minitest//lib/minitest.rb#762 + # source://minitest//lib/minitest.rb#773 def total_time=(_arg0); end end @@ -1901,48 +1904,48 @@ end # plugin, pull this out of the composite and replace it with your # own. # -# source://minitest//lib/minitest.rb#830 +# source://minitest//lib/minitest.rb#841 class Minitest::SummaryReporter < ::Minitest::StatisticsReporter - # source://minitest//lib/minitest.rb#865 + # source://minitest//lib/minitest.rb#876 def aggregated_results(io); end # Returns the value of attribute old_sync. # - # source://minitest//lib/minitest.rb#833 + # source://minitest//lib/minitest.rb#844 def old_sync; end # Sets the attribute old_sync # # @param value the value to set the attribute old_sync to. # - # source://minitest//lib/minitest.rb#833 + # source://minitest//lib/minitest.rb#844 def old_sync=(_arg0); end - # source://minitest//lib/minitest.rb#848 + # source://minitest//lib/minitest.rb#859 def report; end # :startdoc: # - # source://minitest//lib/minitest.rb#836 + # source://minitest//lib/minitest.rb#847 def start; end - # source://minitest//lib/minitest.rb#860 + # source://minitest//lib/minitest.rb#871 def statistics; end - # source://minitest//lib/minitest.rb#885 + # source://minitest//lib/minitest.rb#896 def summary; end # :stopdoc: # - # source://minitest//lib/minitest.rb#832 + # source://minitest//lib/minitest.rb#843 def sync; end # :stopdoc: # - # source://minitest//lib/minitest.rb#832 + # source://minitest//lib/minitest.rb#843 def sync=(_arg0); end - # source://minitest//lib/minitest.rb#881 + # source://minitest//lib/minitest.rb#892 def to_s; end end @@ -2120,36 +2123,36 @@ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) # Assertion wrapping an unexpected error that was raised during a run. # -# source://minitest//lib/minitest.rb#989 +# source://minitest//lib/minitest.rb#1001 class Minitest::UnexpectedError < ::Minitest::Assertion include ::Minitest::Compress # @return [UnexpectedError] a new instance of UnexpectedError # - # source://minitest//lib/minitest.rb#995 + # source://minitest//lib/minitest.rb#1007 def initialize(error); end - # source://minitest//lib/minitest.rb#1008 + # source://minitest//lib/minitest.rb#1020 def backtrace; end # TODO: figure out how to use `cause` instead # - # source://minitest//lib/minitest.rb#993 + # source://minitest//lib/minitest.rb#1005 def error; end # TODO: figure out how to use `cause` instead # - # source://minitest//lib/minitest.rb#993 + # source://minitest//lib/minitest.rb#1005 def error=(_arg0); end - # source://minitest//lib/minitest.rb#1014 + # source://minitest//lib/minitest.rb#1026 def message; end - # source://minitest//lib/minitest.rb#1020 + # source://minitest//lib/minitest.rb#1032 def result_label; end end -# source://minitest//lib/minitest.rb#1012 +# source://minitest//lib/minitest.rb#1024 Minitest::UnexpectedError::BASE_RE = T.let(T.unsafe(nil), Regexp) # source://minitest//lib/minitest.rb#12 diff --git a/sorbet/rbi/gems/parser@3.3.0.4.rbi b/sorbet/rbi/gems/parser@3.3.0.5.rbi similarity index 100% rename from sorbet/rbi/gems/parser@3.3.0.4.rbi rename to sorbet/rbi/gems/parser@3.3.0.5.rbi diff --git a/sorbet/rbi/gems/prism@0.19.0.rbi b/sorbet/rbi/gems/prism@0.24.0.rbi similarity index 52% rename from sorbet/rbi/gems/prism@0.19.0.rbi rename to sorbet/rbi/gems/prism@0.24.0.rbi index b4e4868..07688d1 100644 --- a/sorbet/rbi/gems/prism@0.19.0.rbi +++ b/sorbet/rbi/gems/prism@0.24.0.rbi @@ -4,9 +4,18 @@ # This is an autogenerated file for types exported from the `prism` gem. # Please instead update this file by running `bin/tapioca gem prism`. +# =begin # This file is generated by the templates/template.rb script and should not be -# modified manually. See templates/lib/prism/visitor.rb.erb +# modified manually. See templates/rbi/prism.rbi.erb # if you are looking to modify the template +# =end + +# The Prism Ruby parser. +# +# "Parsing Ruby is suddenly manageable!" +# - You, hopefully +# +# source://prism//lib/prism.rb#8 module Prism class << self # Mirror the Prism.dump API by using the serialization API. @@ -27,7 +36,7 @@ module Prism # # For supported options, see Prism::parse. # - # source://prism//prism.rb#46 + # source://prism//lib/prism.rb#46 def lex_compat(source, **options); end # Mirror the Prism.lex_file API by using the serialization API. @@ -40,7 +49,7 @@ module Prism # returns the same tokens. Raises SyntaxError if the syntax in source is # invalid. # - # source://prism//prism.rb#56 + # source://prism//lib/prism.rb#56 def lex_ripper(source); end # :call-seq: @@ -48,7 +57,7 @@ module Prism # # Load the serialized AST using the source as a reference into a tree. # - # source://prism//prism.rb#64 + # source://prism//lib/prism.rb#64 def load(source, serialized); end # Mirror the Prism.parse API by using the serialization API. @@ -64,7 +73,7 @@ module Prism # # @return [Boolean] # - # source://prism//prism.rb#72 + # source://prism//lib/prism.rb#72 def parse_failure?(source, **options); end # Mirror the Prism.parse_file API by using the serialization API. This uses @@ -84,7 +93,7 @@ module Prism # # @return [Boolean] # - # source://prism//prism.rb#80 + # source://prism//lib/prism.rb#80 def parse_file_failure?(filepath, **options); end # Mirror the Prism.parse_file_success? API by using the serialization API. @@ -109,73 +118,88 @@ end # # alias $foo $bar # ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#97 class Prism::AliasGlobalVariableNode < ::Prism::Node - # def initialize: (new_name: Node, old_name: Node, keyword_loc: Location, location: Location) -> void + # def initialize: (Node new_name, Node old_name, Location keyword_loc, Location location) -> void # # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode # - # source://prism//prism/node.rb#63 - def initialize(new_name, old_name, keyword_loc, location); end + # source://prism//lib/prism/node.rb#99 + def initialize(source, new_name, old_name, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#71 + # source://prism//lib/prism/node.rb#109 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#76 + # source://prism//lib/prism/node.rb#114 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#86 + # source://prism//lib/prism/node.rb#124 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#81 + # source://prism//lib/prism/node.rb#119 def compact_child_nodes; end # def copy: (**params) -> AliasGlobalVariableNode # - # source://prism//prism/node.rb#91 + # source://prism//lib/prism/node.rb#129 + sig { params(params: T.untyped).returns(Prism::AliasGlobalVariableNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#76 + # source://prism//lib/prism/node.rb#114 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Node, old_name: Node, keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#104 + # source://prism//lib/prism/node.rb#143 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#114 + # source://prism//lib/prism/node.rb#166 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#109 + # source://prism//lib/prism/node.rb#161 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#60 + # source://prism//lib/prism/node.rb#154 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader new_name: Node # - # source://prism//prism/node.rb#54 + # source://prism//lib/prism/node.rb#148 + sig { returns(Prism::Node) } def new_name; end # attr_reader old_name: Node # - # source://prism//prism/node.rb#57 + # source://prism//lib/prism/node.rb#151 + sig { returns(Prism::Node) } def old_name; end # Sometimes you want to check an instance of a node against a list of @@ -193,7 +217,7 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#138 + # source://prism//lib/prism/node.rb#190 def type; end class << self @@ -204,7 +228,7 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#148 + # source://prism//lib/prism/node.rb#200 def type; end end end @@ -213,73 +237,88 @@ end # # alias foo bar # ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#209 class Prism::AliasMethodNode < ::Prism::Node - # def initialize: (new_name: Node, old_name: Node, keyword_loc: Location, location: Location) -> void + # def initialize: (Node new_name, Node old_name, Location keyword_loc, Location location) -> void # # @return [AliasMethodNode] a new instance of AliasMethodNode # - # source://prism//prism/node.rb#168 - def initialize(new_name, old_name, keyword_loc, location); end + # source://prism//lib/prism/node.rb#211 + def initialize(source, new_name, old_name, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#176 + # source://prism//lib/prism/node.rb#221 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#181 + # source://prism//lib/prism/node.rb#226 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#191 + # source://prism//lib/prism/node.rb#236 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#186 + # source://prism//lib/prism/node.rb#231 def compact_child_nodes; end # def copy: (**params) -> AliasMethodNode # - # source://prism//prism/node.rb#196 + # source://prism//lib/prism/node.rb#241 + sig { params(params: T.untyped).returns(Prism::AliasMethodNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#181 + # source://prism//lib/prism/node.rb#226 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Node, old_name: Node, keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#209 + # source://prism//lib/prism/node.rb#255 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#219 + # source://prism//lib/prism/node.rb#278 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#214 + # source://prism//lib/prism/node.rb#273 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#165 + # source://prism//lib/prism/node.rb#266 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader new_name: Node # - # source://prism//prism/node.rb#159 + # source://prism//lib/prism/node.rb#260 + sig { returns(Prism::Node) } def new_name; end # attr_reader old_name: Node # - # source://prism//prism/node.rb#162 + # source://prism//lib/prism/node.rb#263 + sig { returns(Prism::Node) } def old_name; end # Sometimes you want to check an instance of a node against a list of @@ -297,7 +336,7 @@ class Prism::AliasMethodNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#243 + # source://prism//lib/prism/node.rb#302 def type; end class << self @@ -308,7 +347,7 @@ class Prism::AliasMethodNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#253 + # source://prism//lib/prism/node.rb#312 def type; end end end @@ -317,73 +356,88 @@ end # # foo => bar | baz # ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#321 class Prism::AlternationPatternNode < ::Prism::Node - # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void + # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void # # @return [AlternationPatternNode] a new instance of AlternationPatternNode # - # source://prism//prism/node.rb#273 - def initialize(left, right, operator_loc, location); end + # source://prism//lib/prism/node.rb#323 + def initialize(source, left, right, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#281 + # source://prism//lib/prism/node.rb#333 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#286 + # source://prism//lib/prism/node.rb#338 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#296 + # source://prism//lib/prism/node.rb#348 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#291 + # source://prism//lib/prism/node.rb#343 def compact_child_nodes; end # def copy: (**params) -> AlternationPatternNode # - # source://prism//prism/node.rb#301 + # source://prism//lib/prism/node.rb#353 + sig { params(params: T.untyped).returns(Prism::AlternationPatternNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#286 + # source://prism//lib/prism/node.rb#338 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#314 + # source://prism//lib/prism/node.rb#367 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#324 + # source://prism//lib/prism/node.rb#390 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://prism//prism/node.rb#264 + # source://prism//lib/prism/node.rb#372 + sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism//prism/node.rb#319 + # source://prism//lib/prism/node.rb#385 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#270 + # source://prism//lib/prism/node.rb#378 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader right: Node # - # source://prism//prism/node.rb#267 + # source://prism//lib/prism/node.rb#375 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -401,7 +455,7 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#348 + # source://prism//lib/prism/node.rb#414 def type; end class << self @@ -412,7 +466,7 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#358 + # source://prism//lib/prism/node.rb#424 def type; end end end @@ -421,73 +475,103 @@ end # # left and right # ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#433 class Prism::AndNode < ::Prism::Node - # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void + # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void # # @return [AndNode] a new instance of AndNode # - # source://prism//prism/node.rb#378 - def initialize(left, right, operator_loc, location); end + # source://prism//lib/prism/node.rb#435 + def initialize(source, left, right, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#386 + # source://prism//lib/prism/node.rb#445 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#391 + # source://prism//lib/prism/node.rb#450 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#401 + # source://prism//lib/prism/node.rb#460 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#396 + # source://prism//lib/prism/node.rb#455 def compact_child_nodes; end # def copy: (**params) -> AndNode # - # source://prism//prism/node.rb#406 + # source://prism//lib/prism/node.rb#465 + sig { params(params: T.untyped).returns(Prism::AndNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#391 + # source://prism//lib/prism/node.rb#450 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#419 + # source://prism//lib/prism/node.rb#479 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#429 + # source://prism//lib/prism/node.rb#517 def inspect(inspector = T.unsafe(nil)); end - # attr_reader left: Node + # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism//prism/node.rb#369 + # left and right + # ^^^^ + # + # 1 && 2 + # ^ + # + # source://prism//lib/prism/node.rb#490 + sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism//prism/node.rb#424 + # source://prism//lib/prism/node.rb#512 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `and` keyword or the `&&` operator. + # + # left and right + # ^^^ # - # source://prism//prism/node.rb#375 + # source://prism//lib/prism/node.rb#505 + sig { returns(Prism::Location) } def operator_loc; end - # attr_reader right: Node + # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # left && right + # ^^^^^ # - # source://prism//prism/node.rb#372 + # 1 and 2 + # ^ + # + # source://prism//lib/prism/node.rb#499 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -505,7 +589,7 @@ class Prism::AndNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#453 + # source://prism//lib/prism/node.rb#541 def type; end class << self @@ -516,7 +600,7 @@ class Prism::AndNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#463 + # source://prism//lib/prism/node.rb#551 def type; end end end @@ -525,65 +609,78 @@ end # # return foo, bar, baz # ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#560 class Prism::ArgumentsNode < ::Prism::Node - # def initialize: (flags: Integer, arguments: Array[Node], location: Location) -> void + # def initialize: (Integer flags, Array[Node] arguments, Location location) -> void # # @return [ArgumentsNode] a new instance of ArgumentsNode # - # source://prism//prism/node.rb#480 - def initialize(flags, arguments, location); end + # source://prism//lib/prism/node.rb#562 + def initialize(source, flags, arguments, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#487 + # source://prism//lib/prism/node.rb#571 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader arguments: Array[Node] # - # source://prism//prism/node.rb#477 + # source://prism//lib/prism/node.rb#613 + sig { returns(T::Array[Prism::Node]) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#492 + # source://prism//lib/prism/node.rb#576 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#502 + # source://prism//lib/prism/node.rb#586 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#497 + # source://prism//lib/prism/node.rb#581 def compact_child_nodes; end # def contains_keyword_splat?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#524 + # source://prism//lib/prism/node.rb#617 + sig { returns(T::Boolean) } def contains_keyword_splat?; end # def copy: (**params) -> ArgumentsNode # - # source://prism//prism/node.rb#507 + # source://prism//lib/prism/node.rb#591 + sig { params(params: T.untyped).returns(Prism::ArgumentsNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#492 + # source://prism//lib/prism/node.rb#576 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Node], location: Location } # - # source://prism//prism/node.rb#519 + # source://prism//lib/prism/node.rb#604 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#529 + # source://prism//lib/prism/node.rb#622 def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -601,14 +698,15 @@ class Prism::ArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#551 + # source://prism//lib/prism/node.rb#644 def type; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#474 + # source://prism//lib/prism/node.rb#609 + sig { returns(Integer) } def flags; end class << self @@ -619,103 +717,121 @@ class Prism::ArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#561 + # source://prism//lib/prism/node.rb#654 def type; end end end # Flags for arguments nodes. +# +# source://prism//lib/prism/node.rb#19241 module Prism::ArgumentsNodeFlags; end # if arguments contain keyword splat # -# source://prism//prism/node.rb#17279 +# source://prism//lib/prism/node.rb#19243 Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer) -# Represents an array literal. This can be a regular array using brackets or -# a special array using % like %w or %i. +# Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. # # [1, 2, 3] # ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#663 class Prism::ArrayNode < ::Prism::Node - # def initialize: (flags: Integer, elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void + # def initialize: (Integer flags, Array[Node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [ArrayNode] a new instance of ArrayNode # - # source://prism//prism/node.rb#585 - def initialize(flags, elements, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#665 + def initialize(source, flags, elements, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#594 + # source://prism//lib/prism/node.rb#676 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#599 + # source://prism//lib/prism/node.rb#681 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#643 + # source://prism//lib/prism/node.rb#758 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#582 + # source://prism//lib/prism/node.rb#735 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#609 + # source://prism//lib/prism/node.rb#691 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#604 + # source://prism//lib/prism/node.rb#686 def compact_child_nodes; end # def contains_splat?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#633 + # source://prism//lib/prism/node.rb#748 + sig { returns(T::Boolean) } def contains_splat?; end # def copy: (**params) -> ArrayNode # - # source://prism//prism/node.rb#614 + # source://prism//lib/prism/node.rb#696 + sig { params(params: T.untyped).returns(Prism::ArrayNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#599 + # source://prism//lib/prism/node.rb#681 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#628 + # source://prism//lib/prism/node.rb#711 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # attr_reader elements: Array[Node] # - # source://prism//prism/node.rb#576 + # source://prism//lib/prism/node.rb#720 + sig { returns(T::Array[Prism::Node]) } def elements; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#648 + # source://prism//lib/prism/node.rb#763 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//prism/node.rb#638 + # source://prism//lib/prism/node.rb#753 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#579 + # source://prism//lib/prism/node.rb#723 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # Sometimes you want to check an instance of a node against a list of @@ -733,14 +849,15 @@ class Prism::ArrayNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#672 + # source://prism//lib/prism/node.rb#787 def type; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#573 + # source://prism//lib/prism/node.rb#716 + sig { returns(Integer) } def flags; end class << self @@ -751,17 +868,19 @@ class Prism::ArrayNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#682 + # source://prism//lib/prism/node.rb#797 def type; end end end # Flags for array nodes. +# +# source://prism//lib/prism/node.rb#19247 module Prism::ArrayNodeFlags; end # if array contains splat nodes # -# source://prism//prism/node.rb#17285 +# source://prism//lib/prism/node.rb#19249 Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # Represents an array pattern in pattern matching. @@ -780,93 +899,112 @@ Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # # foo in Bar[1, 2, 3] # ^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#818 class Prism::ArrayPatternNode < ::Prism::Node - # def initialize: (constant: Node?, requireds: Array[Node], rest: Node?, posts: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void + # def initialize: (Node? constant, Array[Node] requireds, Node? rest, Array[Node] posts, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [ArrayPatternNode] a new instance of ArrayPatternNode # - # source://prism//prism/node.rb#723 - def initialize(constant, requireds, rest, posts, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#820 + def initialize(source, constant, requireds, rest, posts, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#734 + # source://prism//lib/prism/node.rb#833 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#739 + # source://prism//lib/prism/node.rb#838 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#785 + # source://prism//lib/prism/node.rb#922 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#720 + # source://prism//lib/prism/node.rb#904 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#754 + # source://prism//lib/prism/node.rb#853 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#744 + # source://prism//lib/prism/node.rb#843 def compact_child_nodes; end # attr_reader constant: Node? # - # source://prism//prism/node.rb#705 + # source://prism//lib/prism/node.rb#880 + sig { returns(T.nilable(Prism::Node)) } def constant; end # def copy: (**params) -> ArrayPatternNode # - # source://prism//prism/node.rb#759 + # source://prism//lib/prism/node.rb#858 + sig { params(params: T.untyped).returns(Prism::ArrayPatternNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#739 + # source://prism//lib/prism/node.rb#838 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, requireds: Array[Node], rest: Node?, posts: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#775 + # source://prism//lib/prism/node.rb#875 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#790 + # source://prism//lib/prism/node.rb#927 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//prism/node.rb#780 + # source://prism//lib/prism/node.rb#917 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#717 + # source://prism//lib/prism/node.rb#892 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader posts: Array[Node] # - # source://prism//prism/node.rb#714 + # source://prism//lib/prism/node.rb#889 + sig { returns(T::Array[Prism::Node]) } def posts; end # attr_reader requireds: Array[Node] # - # source://prism//prism/node.rb#708 + # source://prism//lib/prism/node.rb#883 + sig { returns(T::Array[Prism::Node]) } def requireds; end # attr_reader rest: Node? # - # source://prism//prism/node.rb#711 + # source://prism//lib/prism/node.rb#886 + sig { returns(T.nilable(Prism::Node)) } def rest; end # Sometimes you want to check an instance of a node against a list of @@ -884,7 +1022,7 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#825 + # source://prism//lib/prism/node.rb#962 def type; end class << self @@ -895,7 +1033,7 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#835 + # source://prism//lib/prism/node.rb#972 def type; end end end @@ -904,68 +1042,94 @@ end # # { a => b } # ^^^^^^ +# +# source://prism//lib/prism/node.rb#981 class Prism::AssocNode < ::Prism::Node - # def initialize: (key: Node, value: Node?, operator_loc: Location?, location: Location) -> void + # def initialize: (Node key, Node value, Location? operator_loc, Location location) -> void # # @return [AssocNode] a new instance of AssocNode # - # source://prism//prism/node.rb#855 - def initialize(key, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#983 + def initialize(source, key, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#863 + # source://prism//lib/prism/node.rb#993 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#868 + # source://prism//lib/prism/node.rb#998 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#881 + # source://prism//lib/prism/node.rb#1008 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#873 + # source://prism//lib/prism/node.rb#1003 def compact_child_nodes; end # def copy: (**params) -> AssocNode # - # source://prism//prism/node.rb#886 + # source://prism//lib/prism/node.rb#1013 + sig { params(params: T.untyped).returns(Prism::AssocNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#868 + # source://prism//lib/prism/node.rb#998 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { key: Node, value: Node, operator_loc: Location?, location: Location } # - # source://prism//prism/node.rb#899 + # source://prism//lib/prism/node.rb#1027 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#909 + # source://prism//lib/prism/node.rb#1074 def inspect(inspector = T.unsafe(nil)); end - # attr_reader key: Node + # The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # { a: b } + # ^ + # + # { foo => bar } + # ^^^ + # + # { def a; end => 1 } + # ^^^^^^^^^^ # - # source://prism//prism/node.rb#846 + # source://prism//lib/prism/node.rb#1041 + sig { returns(Prism::Node) } def key; end # def operator: () -> String? # - # source://prism//prism/node.rb#904 + # source://prism//lib/prism/node.rb#1069 + sig { returns(T.nilable(String)) } def operator; end - # attr_reader operator_loc: Location? + # The location of the `=>` operator, if present. + # + # { foo => bar } + # ^^ # - # source://prism//prism/node.rb#852 + # source://prism//lib/prism/node.rb#1056 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -983,12 +1147,19 @@ class Prism::AssocNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#937 + # source://prism//lib/prism/node.rb#1098 def type; end - # attr_reader value: Node? + # The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # { foo => bar } + # ^^^ + # + # { x: 1 } + # ^ # - # source://prism//prism/node.rb#849 + # source://prism//lib/prism/node.rb#1050 + sig { returns(Prism::Node) } def value; end class << self @@ -999,7 +1170,7 @@ class Prism::AssocNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#947 + # source://prism//lib/prism/node.rb#1108 def type; end end end @@ -1008,63 +1179,79 @@ end # # { **foo } # ^^^^^ +# +# source://prism//lib/prism/node.rb#1117 class Prism::AssocSplatNode < ::Prism::Node - # def initialize: (value: Node?, operator_loc: Location, location: Location) -> void + # def initialize: (Node? value, Location operator_loc, Location location) -> void # # @return [AssocSplatNode] a new instance of AssocSplatNode # - # source://prism//prism/node.rb#964 - def initialize(value, operator_loc, location); end + # source://prism//lib/prism/node.rb#1119 + def initialize(source, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#971 + # source://prism//lib/prism/node.rb#1128 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#976 + # source://prism//lib/prism/node.rb#1133 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#988 + # source://prism//lib/prism/node.rb#1145 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#981 + # source://prism//lib/prism/node.rb#1138 def compact_child_nodes; end # def copy: (**params) -> AssocSplatNode # - # source://prism//prism/node.rb#993 + # source://prism//lib/prism/node.rb#1150 + sig { params(params: T.untyped).returns(Prism::AssocSplatNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#976 + # source://prism//lib/prism/node.rb#1133 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node?, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#1005 + # source://prism//lib/prism/node.rb#1163 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1015 + # source://prism//lib/prism/node.rb#1189 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#1010 + # source://prism//lib/prism/node.rb#1184 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `**` operator. + # + # { **x } + # ^^ # - # source://prism//prism/node.rb#961 + # source://prism//lib/prism/node.rb#1177 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1082,12 +1269,16 @@ class Prism::AssocSplatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1041 + # source://prism//lib/prism/node.rb#1215 def type; end - # attr_reader value: Node? + # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. # - # source://prism//prism/node.rb#958 + # { **foo } + # ^^^ + # + # source://prism//lib/prism/node.rb#1171 + sig { returns(T.nilable(Prism::Node)) } def value; end class << self @@ -1098,67 +1289,85 @@ class Prism::AssocSplatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1051 + # source://prism//lib/prism/node.rb#1225 def type; end end end +Prism::BACKEND = T.let(T.unsafe(nil), Symbol) + # Represents reading a reference to a field in the previous match. # # $' # ^^ +# +# source://prism//lib/prism/node.rb#1234 class Prism::BackReferenceReadNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location location) -> void # # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode # - # source://prism//prism/node.rb#1065 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#1236 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1071 + # source://prism//lib/prism/node.rb#1244 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1076 + # source://prism//lib/prism/node.rb#1249 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1086 + # source://prism//lib/prism/node.rb#1259 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1081 + # source://prism//lib/prism/node.rb#1254 def compact_child_nodes; end # def copy: (**params) -> BackReferenceReadNode # - # source://prism//prism/node.rb#1091 + # source://prism//lib/prism/node.rb#1264 + sig { params(params: T.untyped).returns(Prism::BackReferenceReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1076 + # source://prism//lib/prism/node.rb#1249 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#1102 + # source://prism//lib/prism/node.rb#1276 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1107 + # source://prism//lib/prism/node.rb#1289 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # The name of the back-reference variable, including the leading `$`. + # + # $& # name `:$&` # - # source://prism//prism/node.rb#1062 + # $+ # name `:$+` + # + # source://prism//lib/prism/node.rb#1285 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -1176,7 +1385,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1127 + # source://prism//lib/prism/node.rb#1309 def type; end class << self @@ -1187,7 +1396,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1137 + # source://prism//lib/prism/node.rb#1319 def type; end end end @@ -1196,21 +1405,26 @@ end # methods are implemented on this visitor, so it forces the consumer to # implement each one that they need. For a default implementation that # continues walking the tree, see the Visitor class. +# +# source://prism//lib/prism/visitor.rb#13 class Prism::BasicVisitor # Calls `accept` on the given node if it is not `nil`, which in turn should # call back into this visitor by calling the appropriate `visit_*` method. # - # source://prism//prism/visitor.rb#16 + # source://prism//lib/prism/visitor.rb#16 + sig { params(node: T.nilable(Prism::Node)).void } def visit(node); end # Visits each node in `nodes` by calling `accept` on each one. # - # source://prism//prism/visitor.rb#21 + # source://prism//lib/prism/visitor.rb#21 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void } def visit_all(nodes); end # Visits the child nodes of `node` by calling `accept` on each one. # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::Node).void } def visit_child_nodes(node); end end @@ -1220,96 +1434,115 @@ end # foo # end # ^^^^^ +# +# source://prism//lib/prism/node.rb#1330 class Prism::BeginNode < ::Prism::Node - # def initialize: (begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location?, location: Location) -> void + # def initialize: (Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc, Location location) -> void # # @return [BeginNode] a new instance of BeginNode # - # source://prism//prism/node.rb#1168 - def initialize(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#1332 + def initialize(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1179 + # source://prism//lib/prism/node.rb#1345 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def begin_keyword: () -> String? # - # source://prism//prism/node.rb#1229 + # source://prism//lib/prism/node.rb#1433 + sig { returns(T.nilable(String)) } def begin_keyword; end # attr_reader begin_keyword_loc: Location? # - # source://prism//prism/node.rb#1150 + # source://prism//lib/prism/node.rb#1396 + sig { returns(T.nilable(Prism::Location)) } def begin_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1188 + # source://prism//lib/prism/node.rb#1354 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1203 + # source://prism//lib/prism/node.rb#1369 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1193 + # source://prism//lib/prism/node.rb#1359 def compact_child_nodes; end # def copy: (**params) -> BeginNode # - # source://prism//prism/node.rb#1208 + # source://prism//lib/prism/node.rb#1374 + sig { params(params: T.untyped).returns(Prism::BeginNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1188 + # source://prism//lib/prism/node.rb#1354 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//prism/node.rb#1224 + # source://prism//lib/prism/node.rb#1391 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # attr_reader else_clause: ElseNode? # - # source://prism//prism/node.rb#1159 + # source://prism//lib/prism/node.rb#1414 + sig { returns(T.nilable(Prism::ElseNode)) } def else_clause; end # def end_keyword: () -> String? # - # source://prism//prism/node.rb#1234 + # source://prism//lib/prism/node.rb#1438 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//prism/node.rb#1165 + # source://prism//lib/prism/node.rb#1420 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # attr_reader ensure_clause: EnsureNode? # - # source://prism//prism/node.rb#1162 + # source://prism//lib/prism/node.rb#1417 + sig { returns(T.nilable(Prism::EnsureNode)) } def ensure_clause; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1239 + # source://prism//lib/prism/node.rb#1443 def inspect(inspector = T.unsafe(nil)); end # attr_reader rescue_clause: RescueNode? # - # source://prism//prism/node.rb#1156 + # source://prism//lib/prism/node.rb#1411 + sig { returns(T.nilable(Prism::RescueNode)) } def rescue_clause; end - # source://prism//prism/node.rb#1183 + # source://prism//lib/prism/node.rb#1349 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#1153 + # source://prism//lib/prism/node.rb#1408 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -1327,7 +1560,7 @@ class Prism::BeginNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1284 + # source://prism//lib/prism/node.rb#1488 def type; end class << self @@ -1338,7 +1571,7 @@ class Prism::BeginNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1294 + # source://prism//lib/prism/node.rb#1498 def type; end end end @@ -1347,68 +1580,82 @@ end # # bar(&args) # ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#1507 class Prism::BlockArgumentNode < ::Prism::Node - # def initialize: (expression: Node?, operator_loc: Location, location: Location) -> void + # def initialize: (Node? expression, Location operator_loc, Location location) -> void # # @return [BlockArgumentNode] a new instance of BlockArgumentNode # - # source://prism//prism/node.rb#1311 - def initialize(expression, operator_loc, location); end + # source://prism//lib/prism/node.rb#1509 + def initialize(source, expression, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1318 + # source://prism//lib/prism/node.rb#1518 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1323 + # source://prism//lib/prism/node.rb#1523 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1335 + # source://prism//lib/prism/node.rb#1535 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1328 + # source://prism//lib/prism/node.rb#1528 def compact_child_nodes; end # def copy: (**params) -> BlockArgumentNode # - # source://prism//prism/node.rb#1340 + # source://prism//lib/prism/node.rb#1540 + sig { params(params: T.untyped).returns(Prism::BlockArgumentNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1323 + # source://prism//lib/prism/node.rb#1523 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node?, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#1352 + # source://prism//lib/prism/node.rb#1553 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # attr_reader expression: Node? # - # source://prism//prism/node.rb#1305 + # source://prism//lib/prism/node.rb#1558 + sig { returns(T.nilable(Prism::Node)) } def expression; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1362 + # source://prism//lib/prism/node.rb#1573 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#1357 + # source://prism//lib/prism/node.rb#1568 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#1308 + # source://prism//lib/prism/node.rb#1561 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1426,7 +1673,7 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1388 + # source://prism//lib/prism/node.rb#1599 def type; end class << self @@ -1437,7 +1684,7 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1398 + # source://prism//lib/prism/node.rb#1609 def type; end end end @@ -1446,60 +1693,80 @@ end # # a { |; b| } # ^ +# +# source://prism//lib/prism/node.rb#1618 class Prism::BlockLocalVariableNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Integer flags, Symbol name, Location location) -> void # # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode # - # source://prism//prism/node.rb#1412 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#1620 + def initialize(source, flags, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1418 + # source://prism//lib/prism/node.rb#1629 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1423 + # source://prism//lib/prism/node.rb#1634 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1433 + # source://prism//lib/prism/node.rb#1644 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1428 + # source://prism//lib/prism/node.rb#1639 def compact_child_nodes; end # def copy: (**params) -> BlockLocalVariableNode # - # source://prism//prism/node.rb#1438 + # source://prism//lib/prism/node.rb#1649 + sig { params(params: T.untyped).returns(Prism::BlockLocalVariableNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1423 + # source://prism//lib/prism/node.rb#1634 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } # - # source://prism//prism/node.rb#1449 + # source://prism//lib/prism/node.rb#1662 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1454 + # source://prism//lib/prism/node.rb#1680 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#1409 + # source://prism//lib/prism/node.rb#1671 + sig { returns(Symbol) } def name; end + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#1675 + sig { returns(T::Boolean) } + def repeated_parameter?; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -1515,9 +1782,17 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1474 + # source://prism//lib/prism/node.rb#1702 def type; end + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#1667 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -1526,102 +1801,115 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1484 + # source://prism//lib/prism/node.rb#1712 def type; end end end # Represents a block of ruby code. # -# [1, 2, 3].each { |i| puts x } -# ^^^^^^^^^^^^^^ +# [1, 2, 3].each { |i| puts x } +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#1721 class Prism::BlockNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], locals_body_index: Integer, parameters: Node?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> void + # def initialize: (Array[Symbol] locals, Node? parameters, Node? body, Location opening_loc, Location closing_loc, Location location) -> void # # @return [BlockNode] a new instance of BlockNode # - # source://prism//prism/node.rb#1513 - def initialize(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#1723 + def initialize(source, locals, parameters, body, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1524 + # source://prism//lib/prism/node.rb#1735 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader body: Node? # - # source://prism//prism/node.rb#1504 + # source://prism//lib/prism/node.rb#1785 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1529 + # source://prism//lib/prism/node.rb#1740 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//prism/node.rb#1573 + # source://prism//lib/prism/node.rb#1806 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//prism/node.rb#1510 + # source://prism//lib/prism/node.rb#1794 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1542 + # source://prism//lib/prism/node.rb#1753 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1534 + # source://prism//lib/prism/node.rb#1745 def compact_child_nodes; end # def copy: (**params) -> BlockNode # - # source://prism//prism/node.rb#1547 + # source://prism//lib/prism/node.rb#1758 + sig { params(params: T.untyped).returns(Prism::BlockNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1529 + # source://prism//lib/prism/node.rb#1740 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Node?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#1563 + # source://prism//lib/prism/node.rb#1774 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1578 + # source://prism//lib/prism/node.rb#1811 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//prism/node.rb#1495 + # source://prism//lib/prism/node.rb#1779 + sig { returns(T::Array[Symbol]) } def locals; end - # attr_reader locals_body_index: Integer - # - # source://prism//prism/node.rb#1498 - def locals_body_index; end - # def opening: () -> String # - # source://prism//prism/node.rb#1568 + # source://prism//lib/prism/node.rb#1801 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#1507 + # source://prism//lib/prism/node.rb#1788 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader parameters: Node? # - # source://prism//prism/node.rb#1501 + # source://prism//lib/prism/node.rb#1782 + sig { returns(T.nilable(Prism::Node)) } def parameters; end # Sometimes you want to check an instance of a node against a list of @@ -1639,7 +1927,7 @@ class Prism::BlockNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1613 + # source://prism//lib/prism/node.rb#1845 def type; end class << self @@ -1650,7 +1938,7 @@ class Prism::BlockNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1623 + # source://prism//lib/prism/node.rb#1855 def type; end end end @@ -1660,75 +1948,98 @@ end # def a(&b) # ^^ # end +# +# source://prism//lib/prism/node.rb#1865 class Prism::BlockParameterNode < ::Prism::Node - # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # # @return [BlockParameterNode] a new instance of BlockParameterNode # - # source://prism//prism/node.rb#1644 - def initialize(name, name_loc, operator_loc, location); end + # source://prism//lib/prism/node.rb#1867 + def initialize(source, flags, name, name_loc, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1652 + # source://prism//lib/prism/node.rb#1878 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1657 + # source://prism//lib/prism/node.rb#1883 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1667 + # source://prism//lib/prism/node.rb#1893 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1662 + # source://prism//lib/prism/node.rb#1888 def compact_child_nodes; end # def copy: (**params) -> BlockParameterNode # - # source://prism//prism/node.rb#1672 + # source://prism//lib/prism/node.rb#1898 + sig { params(params: T.untyped).returns(Prism::BlockParameterNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1657 + # source://prism//lib/prism/node.rb#1883 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#1685 + # source://prism//lib/prism/node.rb#1913 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1695 + # source://prism//lib/prism/node.rb#1954 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://prism//prism/node.rb#1635 + # source://prism//lib/prism/node.rb#1922 + sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//prism/node.rb#1638 + # source://prism//lib/prism/node.rb#1925 + sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#1690 + # source://prism//lib/prism/node.rb#1949 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#1641 + # source://prism//lib/prism/node.rb#1937 + sig { returns(Prism::Location) } def operator_loc; end + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#1944 + sig { returns(T::Boolean) } + def repeated_parameter?; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -1744,9 +2055,17 @@ class Prism::BlockParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1721 + # source://prism//lib/prism/node.rb#1982 def type; end + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#1918 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -1755,7 +2074,7 @@ class Prism::BlockParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1731 + # source://prism//lib/prism/node.rb#1992 def type; end end end @@ -1768,83 +2087,100 @@ end # foo do |a, b = 1; local| # ^^^^^^^^^^^^^^^^^ # end +# +# source://prism//lib/prism/node.rb#2005 class Prism::BlockParametersNode < ::Prism::Node - # def initialize: (parameters: ParametersNode?, locals: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void + # def initialize: (ParametersNode? parameters, Array[Node] locals, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [BlockParametersNode] a new instance of BlockParametersNode # - # source://prism//prism/node.rb#1758 - def initialize(parameters, locals, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#2007 + def initialize(source, parameters, locals, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1767 + # source://prism//lib/prism/node.rb#2018 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1772 + # source://prism//lib/prism/node.rb#2023 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#1814 + # source://prism//lib/prism/node.rb#2097 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#1755 + # source://prism//lib/prism/node.rb#2079 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1785 + # source://prism//lib/prism/node.rb#2036 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1777 + # source://prism//lib/prism/node.rb#2028 def compact_child_nodes; end # def copy: (**params) -> BlockParametersNode # - # source://prism//prism/node.rb#1790 + # source://prism//lib/prism/node.rb#2041 + sig { params(params: T.untyped).returns(Prism::BlockParametersNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1772 + # source://prism//lib/prism/node.rb#2023 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#1804 + # source://prism//lib/prism/node.rb#2056 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1819 + # source://prism//lib/prism/node.rb#2102 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Node] # - # source://prism//prism/node.rb#1749 + # source://prism//lib/prism/node.rb#2064 + sig { returns(T::Array[Prism::Node]) } def locals; end # def opening: () -> String? # - # source://prism//prism/node.rb#1809 + # source://prism//lib/prism/node.rb#2092 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#1752 + # source://prism//lib/prism/node.rb#2067 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//prism/node.rb#1746 + # source://prism//lib/prism/node.rb#2061 + sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end # Sometimes you want to check an instance of a node against a list of @@ -1862,7 +2198,7 @@ class Prism::BlockParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1847 + # source://prism//lib/prism/node.rb#2130 def type; end class << self @@ -1873,7 +2209,7 @@ class Prism::BlockParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1857 + # source://prism//lib/prism/node.rb#2140 def type; end end end @@ -1882,68 +2218,82 @@ end # # break foo # ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2149 class Prism::BreakNode < ::Prism::Node - # def initialize: (arguments: ArgumentsNode?, keyword_loc: Location, location: Location) -> void + # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # # @return [BreakNode] a new instance of BreakNode # - # source://prism//prism/node.rb#1874 - def initialize(arguments, keyword_loc, location); end + # source://prism//lib/prism/node.rb#2151 + def initialize(source, arguments, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#1881 + # source://prism//lib/prism/node.rb#2160 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//prism/node.rb#1868 + # source://prism//lib/prism/node.rb#2200 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1886 + # source://prism//lib/prism/node.rb#2165 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#1898 + # source://prism//lib/prism/node.rb#2177 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#1891 + # source://prism//lib/prism/node.rb#2170 def compact_child_nodes; end # def copy: (**params) -> BreakNode # - # source://prism//prism/node.rb#1903 + # source://prism//lib/prism/node.rb#2182 + sig { params(params: T.untyped).returns(Prism::BreakNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#1886 + # source://prism//lib/prism/node.rb#2165 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#1915 + # source://prism//lib/prism/node.rb#2195 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#1925 + # source://prism//lib/prism/node.rb#2215 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#1920 + # source://prism//lib/prism/node.rb#2210 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#1871 + # source://prism//lib/prism/node.rb#2203 + sig { returns(Prism::Location) } def keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1961,7 +2311,7 @@ class Prism::BreakNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#1951 + # source://prism//lib/prism/node.rb#2241 def type; end class << self @@ -1972,7 +2322,7 @@ class Prism::BreakNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#1961 + # source://prism//lib/prism/node.rb#2251 def type; end end end @@ -1981,107 +2331,136 @@ end # # foo.bar &&= value # ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2260 class Prism::CallAndWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Node value, Location location) -> void # # @return [CallAndWriteNode] a new instance of CallAndWriteNode # - # source://prism//prism/node.rb#1996 - def initialize(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#2262 + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2009 + # source://prism//lib/prism/node.rb#2277 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2065 + # source://prism//lib/prism/node.rb#2381 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//prism/node.rb#2070 + # source://prism//lib/prism/node.rb#2391 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//prism/node.rb#1978 + # source://prism//lib/prism/node.rb#2331 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2014 + # source://prism//lib/prism/node.rb#2282 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2027 + # source://prism//lib/prism/node.rb#2295 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2019 + # source://prism//lib/prism/node.rb#2287 def compact_child_nodes; end # def copy: (**params) -> CallAndWriteNode # - # source://prism//prism/node.rb#2032 + # source://prism//lib/prism/node.rb#2300 + sig { params(params: T.untyped).returns(Prism::CallAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2014 + # source://prism//lib/prism/node.rb#2282 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#2050 + # source://prism//lib/prism/node.rb#2319 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2386 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2085 + # source://prism//lib/prism/node.rb#2406 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//prism/node.rb#2075 + # source://prism//lib/prism/node.rb#2396 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//prism/node.rb#1981 + # source://prism//lib/prism/node.rb#2343 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#2080 + # source://prism//lib/prism/node.rb#2401 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#1990 + # source://prism//lib/prism/node.rb#2361 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//prism/node.rb#1984 + # source://prism//lib/prism/node.rb#2355 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Node? # - # source://prism//prism/node.rb#1975 + # source://prism//lib/prism/node.rb#2328 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2055 + # source://prism//lib/prism/node.rb#2371 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2099,31 +2478,35 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2119 + # source://prism//lib/prism/node.rb#2440 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#1993 + # source://prism//lib/prism/node.rb#2367 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2060 + # source://prism//lib/prism/node.rb#2376 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//prism/node.rb#1987 + # source://prism//lib/prism/node.rb#2358 + sig { returns(Symbol) } def write_name; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#1972 + # source://prism//lib/prism/node.rb#2324 + sig { returns(Integer) } def flags; end class << self @@ -2134,7 +2517,7 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2129 + # source://prism//lib/prism/node.rb#2450 def type; end end end @@ -2158,127 +2541,169 @@ end # # foo&.bar # ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2474 class Prism::CallNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?, location: Location) -> void + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Node? block, Location location) -> void # # @return [CallNode] a new instance of CallNode # - # source://prism//prism/node.rb#2182 - def initialize(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end + # source://prism//lib/prism/node.rb#2476 + def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2196 + # source://prism//lib/prism/node.rb#2492 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//prism/node.rb#2173 + # source://prism//lib/prism/node.rb#2596 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2254 + # source://prism//lib/prism/node.rb#2625 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Node? # - # source://prism//prism/node.rb#2179 + # source://prism//lib/prism/node.rb#2611 + sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//prism/node.rb#2259 + # source://prism//lib/prism/node.rb#2635 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//prism/node.rb#2161 + # source://prism//lib/prism/node.rb#2557 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2201 + # source://prism//lib/prism/node.rb#2497 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#2274 + # source://prism//lib/prism/node.rb#2650 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#2176 + # source://prism//lib/prism/node.rb#2599 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2215 + # source://prism//lib/prism/node.rb#2511 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2206 + # source://prism//lib/prism/node.rb#2502 def compact_child_nodes; end # def copy: (**params) -> CallNode # - # source://prism//prism/node.rb#2220 + # source://prism//lib/prism/node.rb#2516 + sig { params(params: T.untyped).returns(Prism::CallNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2201 + # source://prism//lib/prism/node.rb#2497 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?, location: Location } # - # source://prism//prism/node.rb#2239 + # source://prism//lib/prism/node.rb#2536 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2630 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2279 + # source://prism//lib/prism/node.rb#2655 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//prism/node.rb#2264 + # source://prism//lib/prism/node.rb#2640 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//prism/node.rb#2167 + # source://prism//lib/prism/node.rb#2572 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader name: Symbol # - # source://prism//prism/node.rb#2164 + # source://prism//lib/prism/node.rb#2569 + sig { returns(Symbol) } def name; end # def opening: () -> String? # - # source://prism//prism/node.rb#2269 + # source://prism//lib/prism/node.rb#2645 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#2170 + # source://prism//lib/prism/node.rb#2584 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # attr_reader receiver: Node? + # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # foo.bar + # ^^^ # - # source://prism//prism/node.rb#2158 + # +foo + # ^^^ + # + # foo + bar + # ^^^ + # + # source://prism//lib/prism/node.rb#2554 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2244 + # source://prism//lib/prism/node.rb#2615 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2296,21 +2721,23 @@ class Prism::CallNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2323 + # source://prism//lib/prism/node.rb#2699 def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2249 + # source://prism//lib/prism/node.rb#2620 + sig { returns(T::Boolean) } def variable_call?; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#2155 + # source://prism//lib/prism/node.rb#2541 + sig { returns(Integer) } def flags; end class << self @@ -2321,134 +2748,170 @@ class Prism::CallNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2333 + # source://prism//lib/prism/node.rb#2709 def type; end end end # Flags for call nodes. +# +# source://prism//lib/prism/node.rb#19253 module Prism::CallNodeFlags; end # a call that is an attribute write, so the value being written should be returned # -# source://prism//prism/node.rb#17297 +# source://prism//lib/prism/node.rb#19261 Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) +# a call that ignores method visibility +# +# source://prism//lib/prism/node.rb#19264 +Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) + # &. operator # -# source://prism//prism/node.rb#17291 +# source://prism//lib/prism/node.rb#19255 Prism::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer) # a call that could have been a local variable # -# source://prism//prism/node.rb#17294 +# source://prism//lib/prism/node.rb#19258 Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # Represents the use of an assignment operator on a call. # # foo.bar += baz # ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2718 class Prism::CallOperatorWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol operator, Location operator_loc, Node value, Location location) -> void # # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode # - # source://prism//prism/node.rb#2371 - def initialize(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#2720 + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2385 + # source://prism//lib/prism/node.rb#2736 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2442 + # source://prism//lib/prism/node.rb#2844 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//prism/node.rb#2447 + # source://prism//lib/prism/node.rb#2854 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//prism/node.rb#2350 + # source://prism//lib/prism/node.rb#2791 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2390 + # source://prism//lib/prism/node.rb#2741 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2403 + # source://prism//lib/prism/node.rb#2754 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2395 + # source://prism//lib/prism/node.rb#2746 def compact_child_nodes; end # def copy: (**params) -> CallOperatorWriteNode # - # source://prism//prism/node.rb#2408 + # source://prism//lib/prism/node.rb#2759 + sig { params(params: T.untyped).returns(Prism::CallOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2390 + # source://prism//lib/prism/node.rb#2741 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#2427 + # source://prism//lib/prism/node.rb#2779 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#2849 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2457 + # source://prism//lib/prism/node.rb#2864 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//prism/node.rb#2452 + # source://prism//lib/prism/node.rb#2859 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//prism/node.rb#2353 + # source://prism//lib/prism/node.rb#2803 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader operator: Symbol # - # source://prism//prism/node.rb#2362 + # source://prism//lib/prism/node.rb#2821 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#2365 + # source://prism//lib/prism/node.rb#2824 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//prism/node.rb#2356 + # source://prism//lib/prism/node.rb#2815 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Node? # - # source://prism//prism/node.rb#2347 + # source://prism//lib/prism/node.rb#2788 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2432 + # source://prism//lib/prism/node.rb#2834 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2466,31 +2929,35 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2492 + # source://prism//lib/prism/node.rb#2899 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#2368 + # source://prism//lib/prism/node.rb#2830 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2437 + # source://prism//lib/prism/node.rb#2839 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//prism/node.rb#2359 + # source://prism//lib/prism/node.rb#2818 + sig { returns(Symbol) } def write_name; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#2344 + # source://prism//lib/prism/node.rb#2784 + sig { returns(Integer) } def flags; end class << self @@ -2501,7 +2968,7 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2502 + # source://prism//lib/prism/node.rb#2909 def type; end end end @@ -2510,107 +2977,136 @@ end # # foo.bar ||= value # ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#2918 class Prism::CallOrWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Node value, Location location) -> void # # @return [CallOrWriteNode] a new instance of CallOrWriteNode # - # source://prism//prism/node.rb#2537 - def initialize(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#2920 + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2550 + # source://prism//lib/prism/node.rb#2935 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2606 + # source://prism//lib/prism/node.rb#3039 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//prism/node.rb#2611 + # source://prism//lib/prism/node.rb#3049 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//prism/node.rb#2519 + # source://prism//lib/prism/node.rb#2989 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2555 + # source://prism//lib/prism/node.rb#2940 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2568 + # source://prism//lib/prism/node.rb#2953 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2560 + # source://prism//lib/prism/node.rb#2945 def compact_child_nodes; end # def copy: (**params) -> CallOrWriteNode # - # source://prism//prism/node.rb#2573 + # source://prism//lib/prism/node.rb#2958 + sig { params(params: T.untyped).returns(Prism::CallOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2555 + # source://prism//lib/prism/node.rb#2940 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#2591 + # source://prism//lib/prism/node.rb#2977 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3044 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2626 + # source://prism//lib/prism/node.rb#3064 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//prism/node.rb#2616 + # source://prism//lib/prism/node.rb#3054 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//prism/node.rb#2522 + # source://prism//lib/prism/node.rb#3001 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#2621 + # source://prism//lib/prism/node.rb#3059 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#2531 + # source://prism//lib/prism/node.rb#3019 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//prism/node.rb#2525 + # source://prism//lib/prism/node.rb#3013 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Node? # - # source://prism//prism/node.rb#2516 + # source://prism//lib/prism/node.rb#2986 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2596 + # source://prism//lib/prism/node.rb#3029 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2628,31 +3124,35 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2660 + # source://prism//lib/prism/node.rb#3098 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#2534 + # source://prism//lib/prism/node.rb#3025 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2601 + # source://prism//lib/prism/node.rb#3034 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//prism/node.rb#2528 + # source://prism//lib/prism/node.rb#3016 + sig { returns(Symbol) } def write_name; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#2513 + # source://prism//lib/prism/node.rb#2982 + sig { returns(Integer) } def flags; end class << self @@ -2663,7 +3163,7 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2670 + # source://prism//lib/prism/node.rb#3108 def type; end end end @@ -2680,97 +3180,124 @@ end # # for foo.bar in baz do end # ^^^^^^^ +# +# source://prism//lib/prism/node.rb#3125 class Prism::CallTargetNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location) -> void + # def initialize: (Integer flags, Node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void # # @return [CallTargetNode] a new instance of CallTargetNode # - # source://prism//prism/node.rb#2704 - def initialize(flags, receiver, call_operator_loc, name, message_loc, location); end + # source://prism//lib/prism/node.rb#3127 + def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2714 + # source://prism//lib/prism/node.rb#3139 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2764 + # source://prism//lib/prism/node.rb#3213 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String # - # source://prism//prism/node.rb#2769 + # source://prism//lib/prism/node.rb#3223 + sig { returns(String) } def call_operator; end # attr_reader call_operator_loc: Location # - # source://prism//prism/node.rb#2695 + # source://prism//lib/prism/node.rb#3187 + sig { returns(Prism::Location) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2719 + # source://prism//lib/prism/node.rb#3144 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2729 + # source://prism//lib/prism/node.rb#3154 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2724 + # source://prism//lib/prism/node.rb#3149 def compact_child_nodes; end # def copy: (**params) -> CallTargetNode # - # source://prism//prism/node.rb#2734 + # source://prism//lib/prism/node.rb#3159 + sig { params(params: T.untyped).returns(Prism::CallTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2719 + # source://prism//lib/prism/node.rb#3144 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location } # - # source://prism//prism/node.rb#2749 + # source://prism//lib/prism/node.rb#3175 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#3218 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2779 + # source://prism//lib/prism/node.rb#3233 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String # - # source://prism//prism/node.rb#2774 + # source://prism//lib/prism/node.rb#3228 + sig { returns(String) } def message; end # attr_reader message_loc: Location # - # source://prism//prism/node.rb#2701 + # source://prism//lib/prism/node.rb#3196 + sig { returns(Prism::Location) } def message_loc; end # attr_reader name: Symbol # - # source://prism//prism/node.rb#2698 + # source://prism//lib/prism/node.rb#3193 + sig { returns(Symbol) } def name; end # attr_reader receiver: Node # - # source://prism//prism/node.rb#2692 + # source://prism//lib/prism/node.rb#3184 + sig { returns(Prism::Node) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2754 + # source://prism//lib/prism/node.rb#3203 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2788,21 +3315,23 @@ class Prism::CallTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2805 + # source://prism//lib/prism/node.rb#3259 def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#2759 + # source://prism//lib/prism/node.rb#3208 + sig { returns(T::Boolean) } def variable_call?; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#2689 + # source://prism//lib/prism/node.rb#3180 + sig { returns(Integer) } def flags; end class << self @@ -2813,7 +3342,7 @@ class Prism::CallTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2815 + # source://prism//lib/prism/node.rb#3269 def type; end end end @@ -2822,68 +3351,82 @@ end # # foo => [bar => baz] # ^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3278 class Prism::CapturePatternNode < ::Prism::Node - # def initialize: (value: Node, target: Node, operator_loc: Location, location: Location) -> void + # def initialize: (Node value, Node target, Location operator_loc, Location location) -> void # # @return [CapturePatternNode] a new instance of CapturePatternNode # - # source://prism//prism/node.rb#2835 - def initialize(value, target, operator_loc, location); end + # source://prism//lib/prism/node.rb#3280 + def initialize(source, value, target, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2843 + # source://prism//lib/prism/node.rb#3290 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2848 + # source://prism//lib/prism/node.rb#3295 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2858 + # source://prism//lib/prism/node.rb#3305 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2853 + # source://prism//lib/prism/node.rb#3300 def compact_child_nodes; end # def copy: (**params) -> CapturePatternNode # - # source://prism//prism/node.rb#2863 + # source://prism//lib/prism/node.rb#3310 + sig { params(params: T.untyped).returns(Prism::CapturePatternNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2848 + # source://prism//lib/prism/node.rb#3295 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, target: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#2876 + # source://prism//lib/prism/node.rb#3324 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#2886 + # source://prism//lib/prism/node.rb#3347 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#2881 + # source://prism//lib/prism/node.rb#3342 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#2832 + # source://prism//lib/prism/node.rb#3335 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: Node # - # source://prism//prism/node.rb#2829 + # source://prism//lib/prism/node.rb#3332 + sig { returns(Prism::Node) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -2901,12 +3444,13 @@ class Prism::CapturePatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#2910 + # source://prism//lib/prism/node.rb#3371 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#2826 + # source://prism//lib/prism/node.rb#3329 + sig { returns(Prism::Node) } def value; end class << self @@ -2917,7 +3461,7 @@ class Prism::CapturePatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#2920 + # source://prism//lib/prism/node.rb#3381 def type; end end end @@ -2928,88 +3472,106 @@ end # in false # end # ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3392 class Prism::CaseMatchNode < ::Prism::Node - # def initialize: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> void + # def initialize: (Node? predicate, Array[Node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseMatchNode] a new instance of CaseMatchNode # - # source://prism//prism/node.rb#2948 - def initialize(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#3394 + def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#2958 + # source://prism//lib/prism/node.rb#3406 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def case_keyword: () -> String # - # source://prism//prism/node.rb#3002 + # source://prism//lib/prism/node.rb#3473 + sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//prism/node.rb#2942 + # source://prism//lib/prism/node.rb#3460 + sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2963 + # source://prism//lib/prism/node.rb#3411 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#2977 + # source://prism//lib/prism/node.rb#3425 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#2968 + # source://prism//lib/prism/node.rb#3416 def compact_child_nodes; end # attr_reader conditions: Array[Node] # - # source://prism//prism/node.rb#2936 + # source://prism//lib/prism/node.rb#3454 + sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism//prism/node.rb#2939 + # source://prism//lib/prism/node.rb#3457 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (**params) -> CaseMatchNode # - # source://prism//prism/node.rb#2982 + # source://prism//lib/prism/node.rb#3430 + sig { params(params: T.untyped).returns(Prism::CaseMatchNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#2963 + # source://prism//lib/prism/node.rb#3411 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#2997 + # source://prism//lib/prism/node.rb#3446 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//prism/node.rb#3007 + # source://prism//lib/prism/node.rb#3478 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#2945 + # source://prism//lib/prism/node.rb#3466 + sig { returns(Prism::Location) } def end_keyword_loc; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3012 + # source://prism//lib/prism/node.rb#3483 def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Node? # - # source://prism//prism/node.rb#2933 + # source://prism//lib/prism/node.rb#3451 + sig { returns(T.nilable(Prism::Node)) } def predicate; end # Sometimes you want to check an instance of a node against a list of @@ -3027,7 +3589,7 @@ class Prism::CaseMatchNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3046 + # source://prism//lib/prism/node.rb#3517 def type; end class << self @@ -3038,7 +3600,7 @@ class Prism::CaseMatchNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3056 + # source://prism//lib/prism/node.rb#3527 def type; end end end @@ -3049,88 +3611,106 @@ end # when false # end # ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3538 class Prism::CaseNode < ::Prism::Node - # def initialize: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> void + # def initialize: (Node? predicate, Array[Node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseNode] a new instance of CaseNode # - # source://prism//prism/node.rb#3084 - def initialize(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#3540 + def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3094 + # source://prism//lib/prism/node.rb#3552 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def case_keyword: () -> String # - # source://prism//prism/node.rb#3138 + # source://prism//lib/prism/node.rb#3619 + sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//prism/node.rb#3078 + # source://prism//lib/prism/node.rb#3606 + sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3099 + # source://prism//lib/prism/node.rb#3557 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3113 + # source://prism//lib/prism/node.rb#3571 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3104 + # source://prism//lib/prism/node.rb#3562 def compact_child_nodes; end # attr_reader conditions: Array[Node] # - # source://prism//prism/node.rb#3072 + # source://prism//lib/prism/node.rb#3600 + sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism//prism/node.rb#3075 + # source://prism//lib/prism/node.rb#3603 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (**params) -> CaseNode # - # source://prism//prism/node.rb#3118 + # source://prism//lib/prism/node.rb#3576 + sig { params(params: T.untyped).returns(Prism::CaseNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3099 + # source://prism//lib/prism/node.rb#3557 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#3133 + # source://prism//lib/prism/node.rb#3592 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//prism/node.rb#3143 + # source://prism//lib/prism/node.rb#3624 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#3081 + # source://prism//lib/prism/node.rb#3612 + sig { returns(Prism::Location) } def end_keyword_loc; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3148 + # source://prism//lib/prism/node.rb#3629 def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Node? # - # source://prism//prism/node.rb#3069 + # source://prism//lib/prism/node.rb#3597 + sig { returns(T.nilable(Prism::Node)) } def predicate; end # Sometimes you want to check an instance of a node against a list of @@ -3148,7 +3728,7 @@ class Prism::CaseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3182 + # source://prism//lib/prism/node.rb#3663 def type; end class << self @@ -3159,7 +3739,7 @@ class Prism::CaseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3192 + # source://prism//lib/prism/node.rb#3673 def type; end end end @@ -3168,108 +3748,130 @@ end # # class Foo end # ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3682 class Prism::ClassNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], class_keyword_loc: Location, constant_path: Node, inheritance_operator_loc: Location?, superclass: Node?, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location) -> void + # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Node constant_path, Location? inheritance_operator_loc, Node? superclass, Node? body, Location end_keyword_loc, Symbol name, Location location) -> void # # @return [ClassNode] a new instance of ClassNode # - # source://prism//prism/node.rb#3227 - def initialize(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end + # source://prism//lib/prism/node.rb#3684 + def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3240 + # source://prism//lib/prism/node.rb#3699 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader body: Node? # - # source://prism//prism/node.rb#3218 + # source://prism//lib/prism/node.rb#3774 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3245 + # source://prism//lib/prism/node.rb#3704 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def class_keyword: () -> String # - # source://prism//prism/node.rb#3287 + # source://prism//lib/prism/node.rb#3787 + sig { returns(String) } def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism//prism/node.rb#3206 + # source://prism//lib/prism/node.rb#3750 + sig { returns(Prism::Location) } def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3259 + # source://prism//lib/prism/node.rb#3718 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3250 + # source://prism//lib/prism/node.rb#3709 def compact_child_nodes; end # attr_reader constant_path: Node # - # source://prism//prism/node.rb#3209 + # source://prism//lib/prism/node.rb#3756 + sig { returns(Prism::Node) } def constant_path; end # def copy: (**params) -> ClassNode # - # source://prism//prism/node.rb#3264 + # source://prism//lib/prism/node.rb#3723 + sig { params(params: T.untyped).returns(Prism::ClassNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3245 + # source://prism//lib/prism/node.rb#3704 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, constant_path: Node, inheritance_operator_loc: Location?, superclass: Node?, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location } # - # source://prism//prism/node.rb#3282 + # source://prism//lib/prism/node.rb#3742 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//prism/node.rb#3297 + # source://prism//lib/prism/node.rb#3797 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#3221 + # source://prism//lib/prism/node.rb#3777 + sig { returns(Prism::Location) } def end_keyword_loc; end # def inheritance_operator: () -> String? # - # source://prism//prism/node.rb#3292 + # source://prism//lib/prism/node.rb#3792 + sig { returns(T.nilable(String)) } def inheritance_operator; end # attr_reader inheritance_operator_loc: Location? # - # source://prism//prism/node.rb#3212 + # source://prism//lib/prism/node.rb#3759 + sig { returns(T.nilable(Prism::Location)) } def inheritance_operator_loc; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3302 + # source://prism//lib/prism/node.rb#3802 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//prism/node.rb#3203 + # source://prism//lib/prism/node.rb#3747 + sig { returns(T::Array[Symbol]) } def locals; end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3224 + # source://prism//lib/prism/node.rb#3783 + sig { returns(Symbol) } def name; end # attr_reader superclass: Node? # - # source://prism//prism/node.rb#3215 + # source://prism//lib/prism/node.rb#3771 + sig { returns(T.nilable(Prism::Node)) } def superclass; end # Sometimes you want to check an instance of a node against a list of @@ -3287,7 +3889,7 @@ class Prism::ClassNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3340 + # source://prism//lib/prism/node.rb#3840 def type; end class << self @@ -3298,7 +3900,7 @@ class Prism::ClassNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3350 + # source://prism//lib/prism/node.rb#3850 def type; end end end @@ -3307,73 +3909,91 @@ end # # @@target &&= value # ^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3859 class Prism::ClassVariableAndWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode # - # source://prism//prism/node.rb#3373 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#3861 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3382 + # source://prism//lib/prism/node.rb#3872 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3387 + # source://prism//lib/prism/node.rb#3877 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3397 + # source://prism//lib/prism/node.rb#3887 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3392 + # source://prism//lib/prism/node.rb#3882 def compact_child_nodes; end # def copy: (**params) -> ClassVariableAndWriteNode # - # source://prism//prism/node.rb#3402 + # source://prism//lib/prism/node.rb#3892 + sig { params(params: T.untyped).returns(Prism::ClassVariableAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3387 + # source://prism//lib/prism/node.rb#3877 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#3416 + # source://prism//lib/prism/node.rb#3907 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#125 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3426 + # source://prism//lib/prism/node.rb#3936 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3361 + # source://prism//lib/prism/node.rb#3912 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#3364 + # source://prism//lib/prism/node.rb#3915 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#3421 + # source://prism//lib/prism/node.rb#3931 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#3367 + # source://prism//lib/prism/node.rb#3921 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3391,12 +4011,13 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3450 + # source://prism//lib/prism/node.rb#3960 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#3370 + # source://prism//lib/prism/node.rb#3927 + sig { returns(Prism::Node) } def value; end class << self @@ -3407,7 +4028,7 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3460 + # source://prism//lib/prism/node.rb#3970 def type; end end end @@ -3416,73 +4037,91 @@ end # # @@target += value # ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#3979 class Prism::ClassVariableOperatorWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void # # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode # - # source://prism//prism/node.rb#3486 - def initialize(name, name_loc, operator_loc, value, operator, location); end + # source://prism//lib/prism/node.rb#3981 + def initialize(source, name, name_loc, operator_loc, value, operator, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3496 + # source://prism//lib/prism/node.rb#3993 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3501 + # source://prism//lib/prism/node.rb#3998 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3511 + # source://prism//lib/prism/node.rb#4008 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3506 + # source://prism//lib/prism/node.rb#4003 def compact_child_nodes; end # def copy: (**params) -> ClassVariableOperatorWriteNode # - # source://prism//prism/node.rb#3516 + # source://prism//lib/prism/node.rb#4013 + sig { params(params: T.untyped).returns(Prism::ClassVariableOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3501 + # source://prism//lib/prism/node.rb#3998 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location } # - # source://prism//prism/node.rb#3531 + # source://prism//lib/prism/node.rb#4029 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#137 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3536 + # source://prism//lib/prism/node.rb#4056 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3471 + # source://prism//lib/prism/node.rb#4034 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#3474 + # source://prism//lib/prism/node.rb#4037 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//prism/node.rb#3483 + # source://prism//lib/prism/node.rb#4052 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#3477 + # source://prism//lib/prism/node.rb#4043 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3500,12 +4139,13 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3561 + # source://prism//lib/prism/node.rb#4081 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#3480 + # source://prism//lib/prism/node.rb#4049 + sig { returns(Prism::Node) } def value; end class << self @@ -3516,7 +4156,7 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3571 + # source://prism//lib/prism/node.rb#4091 def type; end end end @@ -3525,73 +4165,91 @@ end # # @@target ||= value # ^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4100 class Prism::ClassVariableOrWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode # - # source://prism//prism/node.rb#3594 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#4102 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3603 + # source://prism//lib/prism/node.rb#4113 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3608 + # source://prism//lib/prism/node.rb#4118 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3618 + # source://prism//lib/prism/node.rb#4128 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3613 + # source://prism//lib/prism/node.rb#4123 def compact_child_nodes; end # def copy: (**params) -> ClassVariableOrWriteNode # - # source://prism//prism/node.rb#3623 + # source://prism//lib/prism/node.rb#4133 + sig { params(params: T.untyped).returns(Prism::ClassVariableOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3608 + # source://prism//lib/prism/node.rb#4118 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#3637 + # source://prism//lib/prism/node.rb#4148 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#131 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3647 + # source://prism//lib/prism/node.rb#4177 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3582 + # source://prism//lib/prism/node.rb#4153 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#3585 + # source://prism//lib/prism/node.rb#4156 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#3642 + # source://prism//lib/prism/node.rb#4172 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#3588 + # source://prism//lib/prism/node.rb#4162 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3609,12 +4267,13 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3671 + # source://prism//lib/prism/node.rb#4201 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#3591 + # source://prism//lib/prism/node.rb#4168 + sig { returns(Prism::Node) } def value; end class << self @@ -3625,7 +4284,7 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3681 + # source://prism//lib/prism/node.rb#4211 def type; end end end @@ -3634,58 +4293,74 @@ end # # @@foo # ^^^^^ +# +# source://prism//lib/prism/node.rb#4220 class Prism::ClassVariableReadNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode # - # source://prism//prism/node.rb#3695 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#4222 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3701 + # source://prism//lib/prism/node.rb#4230 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3706 + # source://prism//lib/prism/node.rb#4235 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3716 + # source://prism//lib/prism/node.rb#4245 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3711 + # source://prism//lib/prism/node.rb#4240 def compact_child_nodes; end # def copy: (**params) -> ClassVariableReadNode # - # source://prism//prism/node.rb#3721 + # source://prism//lib/prism/node.rb#4250 + sig { params(params: T.untyped).returns(Prism::ClassVariableReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3706 + # source://prism//lib/prism/node.rb#4235 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#3732 + # source://prism//lib/prism/node.rb#4262 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3737 + # source://prism//lib/prism/node.rb#4275 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @@abc # name `:@@abc` # - # source://prism//prism/node.rb#3692 + # @@_test # name `:@@_test` + # + # source://prism//lib/prism/node.rb#4271 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -3703,7 +4378,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3757 + # source://prism//lib/prism/node.rb#4295 def type; end class << self @@ -3714,7 +4389,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3767 + # source://prism//lib/prism/node.rb#4305 def type; end end end @@ -3723,58 +4398,70 @@ end # # @@foo, @@bar = baz # ^^^^^ ^^^^^ +# +# source://prism//lib/prism/node.rb#4314 class Prism::ClassVariableTargetNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode # - # source://prism//prism/node.rb#3781 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#4316 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3787 + # source://prism//lib/prism/node.rb#4324 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3792 + # source://prism//lib/prism/node.rb#4329 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3802 + # source://prism//lib/prism/node.rb#4339 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3797 + # source://prism//lib/prism/node.rb#4334 def compact_child_nodes; end # def copy: (**params) -> ClassVariableTargetNode # - # source://prism//prism/node.rb#3807 + # source://prism//lib/prism/node.rb#4344 + sig { params(params: T.untyped).returns(Prism::ClassVariableTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3792 + # source://prism//lib/prism/node.rb#4329 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#3818 + # source://prism//lib/prism/node.rb#4356 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3823 + # source://prism//lib/prism/node.rb#4365 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3778 + # source://prism//lib/prism/node.rb#4361 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -3792,7 +4479,7 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3843 + # source://prism//lib/prism/node.rb#4385 def type; end class << self @@ -3803,7 +4490,7 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3853 + # source://prism//lib/prism/node.rb#4395 def type; end end end @@ -3812,73 +4499,88 @@ end # # @@foo = 1 # ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4404 class Prism::ClassVariableWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location?, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Node value, Location? operator_loc, Location location) -> void # # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode # - # source://prism//prism/node.rb#3876 - def initialize(name, name_loc, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#4406 + def initialize(source, name, name_loc, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3885 + # source://prism//lib/prism/node.rb#4417 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3890 + # source://prism//lib/prism/node.rb#4422 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#3900 + # source://prism//lib/prism/node.rb#4432 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#3895 + # source://prism//lib/prism/node.rb#4427 def compact_child_nodes; end # def copy: (**params) -> ClassVariableWriteNode # - # source://prism//prism/node.rb#3905 + # source://prism//lib/prism/node.rb#4437 + sig { params(params: T.untyped).returns(Prism::ClassVariableWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#3890 + # source://prism//lib/prism/node.rb#4422 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location?, location: Location } # - # source://prism//prism/node.rb#3919 + # source://prism//lib/prism/node.rb#4452 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#3929 + # source://prism//lib/prism/node.rb#4487 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3864 + # source://prism//lib/prism/node.rb#4457 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#3867 + # source://prism//lib/prism/node.rb#4460 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String? # - # source://prism//prism/node.rb#3924 + # source://prism//lib/prism/node.rb#4482 + sig { returns(T.nilable(String)) } def operator; end # attr_reader operator_loc: Location? # - # source://prism//prism/node.rb#3873 + # source://prism//lib/prism/node.rb#4469 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3896,12 +4598,13 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#3953 + # source://prism//lib/prism/node.rb#4511 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#3870 + # source://prism//lib/prism/node.rb#4466 + sig { returns(Prism::Node) } def value; end class << self @@ -3912,30 +4615,36 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#3963 + # source://prism//lib/prism/node.rb#4521 def type; end end end # This represents a comment that was encountered during parsing. It is the # base class for all comment types. +# +# source://prism//lib/prism/parse_result.rb#258 class Prism::Comment # Create a new comment object with the given location. # # @return [Comment] a new instance of Comment # - # source://prism//prism/parse_result.rb#233 + # source://prism//lib/prism/parse_result.rb#263 def initialize(location); end # Implement the hash pattern matching interface for Comment. # - # source://prism//prism/parse_result.rb#238 + # source://prism//lib/prism/parse_result.rb#268 def deconstruct_keys(keys); end # The location of this comment in the source. # - # source://prism//prism/parse_result.rb#230 + # source://prism//lib/prism/parse_result.rb#260 + sig { returns(Prism::Location) } def location; end + + sig { returns(T::Boolean) } + def trailing?; end end # A compiler is a visitor that returns the value of each node as it visits. @@ -3954,908 +4663,910 @@ end # # Prism.parse("1 + 2").value.accept(SExpressions.new) # # => [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] +# +# source://prism//lib/prism/compiler.rb#26 class Prism::Compiler # Visit an individual node. # - # source://prism//prism/compiler.rb#28 + # source://prism//lib/prism/compiler.rb#28 def visit(node); end # Visit the child nodes of the given node. # Compile a AliasGlobalVariableNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_alias_global_variable_node(node); end # Visit the child nodes of the given node. # Compile a AliasMethodNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_alias_method_node(node); end # Visit a list of nodes. # - # source://prism//prism/compiler.rb#33 + # source://prism//lib/prism/compiler.rb#33 def visit_all(nodes); end # Visit the child nodes of the given node. # Compile a AlternationPatternNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_alternation_pattern_node(node); end # Visit the child nodes of the given node. # Compile a AndNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_and_node(node); end # Visit the child nodes of the given node. # Compile a ArgumentsNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_arguments_node(node); end # Visit the child nodes of the given node. # Compile a ArrayNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_array_node(node); end # Visit the child nodes of the given node. # Compile a ArrayPatternNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_array_pattern_node(node); end # Visit the child nodes of the given node. # Compile a AssocNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_assoc_node(node); end # Visit the child nodes of the given node. # Compile a AssocSplatNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_assoc_splat_node(node); end # Visit the child nodes of the given node. # Compile a BackReferenceReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_back_reference_read_node(node); end # Visit the child nodes of the given node. # Compile a BeginNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_begin_node(node); end # Visit the child nodes of the given node. # Compile a BlockArgumentNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_block_argument_node(node); end # Visit the child nodes of the given node. # Compile a BlockLocalVariableNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_block_local_variable_node(node); end # Visit the child nodes of the given node. # Compile a BlockNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_block_node(node); end # Visit the child nodes of the given node. # Compile a BlockParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_block_parameter_node(node); end # Visit the child nodes of the given node. # Compile a BlockParametersNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_block_parameters_node(node); end # Visit the child nodes of the given node. # Compile a BreakNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_break_node(node); end # Visit the child nodes of the given node. # Compile a CallAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_call_and_write_node(node); end # Visit the child nodes of the given node. # Compile a CallNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_call_node(node); end # Visit the child nodes of the given node. # Compile a CallOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_call_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a CallOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_call_or_write_node(node); end # Visit the child nodes of the given node. # Compile a CallTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_call_target_node(node); end # Visit the child nodes of the given node. # Compile a CapturePatternNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_capture_pattern_node(node); end # Visit the child nodes of the given node. # Compile a CaseMatchNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_case_match_node(node); end # Visit the child nodes of the given node. # Compile a CaseNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_case_node(node); end # Visit the child nodes of the given node. # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_child_nodes(node); end # Visit the child nodes of the given node. # Compile a ClassNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_class_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_target_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_path_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_read_node(node); end # Visit the child nodes of the given node. # Compile a ConstantTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_target_node(node); end # Visit the child nodes of the given node. # Compile a ConstantWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_constant_write_node(node); end # Visit the child nodes of the given node. # Compile a DefNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_def_node(node); end # Visit the child nodes of the given node. # Compile a DefinedNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_defined_node(node); end # Visit the child nodes of the given node. # Compile a ElseNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_else_node(node); end # Visit the child nodes of the given node. # Compile a EmbeddedStatementsNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_embedded_statements_node(node); end # Visit the child nodes of the given node. # Compile a EmbeddedVariableNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_embedded_variable_node(node); end # Visit the child nodes of the given node. # Compile a EnsureNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_ensure_node(node); end # Visit the child nodes of the given node. # Compile a FalseNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_false_node(node); end # Visit the child nodes of the given node. # Compile a FindPatternNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_find_pattern_node(node); end # Visit the child nodes of the given node. # Compile a FlipFlopNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_flip_flop_node(node); end # Visit the child nodes of the given node. # Compile a FloatNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_float_node(node); end # Visit the child nodes of the given node. # Compile a ForNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_for_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingArgumentsNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_forwarding_arguments_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_forwarding_parameter_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingSuperNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_forwarding_super_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_global_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a HashNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_hash_node(node); end # Visit the child nodes of the given node. # Compile a HashPatternNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_hash_pattern_node(node); end # Visit the child nodes of the given node. # Compile a IfNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_if_node(node); end # Visit the child nodes of the given node. # Compile a ImaginaryNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_imaginary_node(node); end # Visit the child nodes of the given node. # Compile a ImplicitNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_implicit_node(node); end # Visit the child nodes of the given node. # Compile a ImplicitRestNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_implicit_rest_node(node); end # Visit the child nodes of the given node. # Compile a InNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_in_node(node); end # Visit the child nodes of the given node. # Compile a IndexAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_index_and_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_index_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_index_or_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_index_target_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_instance_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a IntegerNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_integer_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedMatchLastLineNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_interpolated_match_last_line_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedRegularExpressionNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_interpolated_regular_expression_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedStringNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_interpolated_string_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedSymbolNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_interpolated_symbol_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedXStringNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_interpolated_x_string_node(node); end # Visit the child nodes of the given node. # Compile a KeywordHashNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_keyword_hash_node(node); end # Visit the child nodes of the given node. # Compile a KeywordRestParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_keyword_rest_parameter_node(node); end # Visit the child nodes of the given node. # Compile a LambdaNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_lambda_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableAndWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableOperatorWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableOrWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_local_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a MatchLastLineNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_match_last_line_node(node); end # Visit the child nodes of the given node. # Compile a MatchPredicateNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_match_predicate_node(node); end # Visit the child nodes of the given node. # Compile a MatchRequiredNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_match_required_node(node); end # Visit the child nodes of the given node. # Compile a MatchWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_match_write_node(node); end # Visit the child nodes of the given node. # Compile a MissingNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_missing_node(node); end # Visit the child nodes of the given node. # Compile a ModuleNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_module_node(node); end # Visit the child nodes of the given node. # Compile a MultiTargetNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_multi_target_node(node); end # Visit the child nodes of the given node. # Compile a MultiWriteNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_multi_write_node(node); end # Visit the child nodes of the given node. # Compile a NextNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_next_node(node); end # Visit the child nodes of the given node. # Compile a NilNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_nil_node(node); end # Visit the child nodes of the given node. # Compile a NoKeywordsParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_no_keywords_parameter_node(node); end # Visit the child nodes of the given node. # Compile a NumberedParametersNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_numbered_parameters_node(node); end # Visit the child nodes of the given node. # Compile a NumberedReferenceReadNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_numbered_reference_read_node(node); end # Visit the child nodes of the given node. # Compile a OptionalKeywordParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_optional_keyword_parameter_node(node); end # Visit the child nodes of the given node. # Compile a OptionalParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_optional_parameter_node(node); end # Visit the child nodes of the given node. # Compile a OrNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_or_node(node); end # Visit the child nodes of the given node. # Compile a ParametersNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_parameters_node(node); end # Visit the child nodes of the given node. # Compile a ParenthesesNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_parentheses_node(node); end # Visit the child nodes of the given node. # Compile a PinnedExpressionNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_pinned_expression_node(node); end # Visit the child nodes of the given node. # Compile a PinnedVariableNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_pinned_variable_node(node); end # Visit the child nodes of the given node. # Compile a PostExecutionNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_post_execution_node(node); end # Visit the child nodes of the given node. # Compile a PreExecutionNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_pre_execution_node(node); end # Visit the child nodes of the given node. # Compile a ProgramNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_program_node(node); end # Visit the child nodes of the given node. # Compile a RangeNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_range_node(node); end # Visit the child nodes of the given node. # Compile a RationalNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_rational_node(node); end # Visit the child nodes of the given node. # Compile a RedoNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_redo_node(node); end # Visit the child nodes of the given node. # Compile a RegularExpressionNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_regular_expression_node(node); end # Visit the child nodes of the given node. # Compile a RequiredKeywordParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_required_keyword_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RequiredParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_required_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RescueModifierNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_rescue_modifier_node(node); end # Visit the child nodes of the given node. # Compile a RescueNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_rescue_node(node); end # Visit the child nodes of the given node. # Compile a RestParameterNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_rest_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RetryNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_retry_node(node); end # Visit the child nodes of the given node. # Compile a ReturnNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_return_node(node); end # Visit the child nodes of the given node. # Compile a SelfNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_self_node(node); end # Visit the child nodes of the given node. # Compile a SingletonClassNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_singleton_class_node(node); end # Visit the child nodes of the given node. # Compile a SourceEncodingNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_source_encoding_node(node); end # Visit the child nodes of the given node. # Compile a SourceFileNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_source_file_node(node); end # Visit the child nodes of the given node. # Compile a SourceLineNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_source_line_node(node); end # Visit the child nodes of the given node. # Compile a SplatNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_splat_node(node); end # Visit the child nodes of the given node. # Compile a StatementsNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_statements_node(node); end # Visit the child nodes of the given node. # Compile a StringNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_string_node(node); end # Visit the child nodes of the given node. # Compile a SuperNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_super_node(node); end # Visit the child nodes of the given node. # Compile a SymbolNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_symbol_node(node); end # Visit the child nodes of the given node. # Compile a TrueNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_true_node(node); end # Visit the child nodes of the given node. # Compile a UndefNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_undef_node(node); end # Visit the child nodes of the given node. # Compile a UnlessNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_unless_node(node); end # Visit the child nodes of the given node. # Compile a UntilNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_until_node(node); end # Visit the child nodes of the given node. # Compile a WhenNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_when_node(node); end # Visit the child nodes of the given node. # Compile a WhileNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_while_node(node); end # Visit the child nodes of the given node. # Compile a XStringNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_x_string_node(node); end # Visit the child nodes of the given node. # Compile a YieldNode node # - # source://prism//prism/compiler.rb#38 + # source://prism//lib/prism/compiler.rb#38 def visit_yield_node(node); end end @@ -4863,73 +5574,91 @@ end # # Target &&= value # ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4530 class Prism::ConstantAndWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode # - # source://prism//prism/node.rb#3986 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#4532 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#3995 + # source://prism//lib/prism/node.rb#4543 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4000 + # source://prism//lib/prism/node.rb#4548 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4010 + # source://prism//lib/prism/node.rb#4558 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4005 + # source://prism//lib/prism/node.rb#4553 def compact_child_nodes; end # def copy: (**params) -> ConstantAndWriteNode # - # source://prism//prism/node.rb#4015 + # source://prism//lib/prism/node.rb#4563 + sig { params(params: T.untyped).returns(Prism::ConstantAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4000 + # source://prism//lib/prism/node.rb#4548 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#4029 + # source://prism//lib/prism/node.rb#4578 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#143 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4039 + # source://prism//lib/prism/node.rb#4607 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#3974 + # source://prism//lib/prism/node.rb#4583 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#3977 + # source://prism//lib/prism/node.rb#4586 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#4034 + # source://prism//lib/prism/node.rb#4602 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#3980 + # source://prism//lib/prism/node.rb#4592 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -4947,12 +5676,13 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4063 + # source://prism//lib/prism/node.rb#4631 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#3983 + # source://prism//lib/prism/node.rb#4598 + sig { returns(Prism::Node) } def value; end class << self @@ -4963,7 +5693,7 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4073 + # source://prism//lib/prism/node.rb#4641 def type; end end end @@ -4972,73 +5702,91 @@ end # # Target += value # ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4650 class Prism::ConstantOperatorWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void # # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode # - # source://prism//prism/node.rb#4099 - def initialize(name, name_loc, operator_loc, value, operator, location); end + # source://prism//lib/prism/node.rb#4652 + def initialize(source, name, name_loc, operator_loc, value, operator, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4109 + # source://prism//lib/prism/node.rb#4664 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4114 + # source://prism//lib/prism/node.rb#4669 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4124 + # source://prism//lib/prism/node.rb#4679 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4119 + # source://prism//lib/prism/node.rb#4674 def compact_child_nodes; end # def copy: (**params) -> ConstantOperatorWriteNode # - # source://prism//prism/node.rb#4129 + # source://prism//lib/prism/node.rb#4684 + sig { params(params: T.untyped).returns(Prism::ConstantOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4114 + # source://prism//lib/prism/node.rb#4669 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location } # - # source://prism//prism/node.rb#4144 + # source://prism//lib/prism/node.rb#4700 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#155 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4149 + # source://prism//lib/prism/node.rb#4727 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#4084 + # source://prism//lib/prism/node.rb#4705 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#4087 + # source://prism//lib/prism/node.rb#4708 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//prism/node.rb#4096 + # source://prism//lib/prism/node.rb#4723 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4090 + # source://prism//lib/prism/node.rb#4714 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -5056,12 +5804,13 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4174 + # source://prism//lib/prism/node.rb#4752 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4093 + # source://prism//lib/prism/node.rb#4720 + sig { returns(Prism::Node) } def value; end class << self @@ -5072,7 +5821,7 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4184 + # source://prism//lib/prism/node.rb#4762 def type; end end end @@ -5081,73 +5830,91 @@ end # # Target ||= value # ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4771 class Prism::ConstantOrWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode # - # source://prism//prism/node.rb#4207 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#4773 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4216 + # source://prism//lib/prism/node.rb#4784 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4221 + # source://prism//lib/prism/node.rb#4789 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4231 + # source://prism//lib/prism/node.rb#4799 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4226 + # source://prism//lib/prism/node.rb#4794 def compact_child_nodes; end # def copy: (**params) -> ConstantOrWriteNode # - # source://prism//prism/node.rb#4236 + # source://prism//lib/prism/node.rb#4804 + sig { params(params: T.untyped).returns(Prism::ConstantOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4221 + # source://prism//lib/prism/node.rb#4789 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#4250 + # source://prism//lib/prism/node.rb#4819 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#149 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4260 + # source://prism//lib/prism/node.rb#4848 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#4195 + # source://prism//lib/prism/node.rb#4824 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#4198 + # source://prism//lib/prism/node.rb#4827 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#4255 + # source://prism//lib/prism/node.rb#4843 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4201 + # source://prism//lib/prism/node.rb#4833 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -5165,12 +5932,13 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4284 + # source://prism//lib/prism/node.rb#4872 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4204 + # source://prism//lib/prism/node.rb#4839 + sig { returns(Prism::Node) } def value; end class << self @@ -5181,7 +5949,7 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4294 + # source://prism//lib/prism/node.rb#4882 def type; end end end @@ -5190,68 +5958,82 @@ end # # Parent::Child &&= value # ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#4891 class Prism::ConstantPathAndWriteNode < ::Prism::Node - # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void # # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode # - # source://prism//prism/node.rb#4314 - def initialize(target, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#4893 + def initialize(source, target, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4322 + # source://prism//lib/prism/node.rb#4903 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4327 + # source://prism//lib/prism/node.rb#4908 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4337 + # source://prism//lib/prism/node.rb#4918 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4332 + # source://prism//lib/prism/node.rb#4913 def compact_child_nodes; end # def copy: (**params) -> ConstantPathAndWriteNode # - # source://prism//prism/node.rb#4342 + # source://prism//lib/prism/node.rb#4923 + sig { params(params: T.untyped).returns(Prism::ConstantPathAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4327 + # source://prism//lib/prism/node.rb#4908 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#4355 + # source://prism//lib/prism/node.rb#4937 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4365 + # source://prism//lib/prism/node.rb#4960 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#4360 + # source://prism//lib/prism/node.rb#4955 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4308 + # source://prism//lib/prism/node.rb#4945 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//prism/node.rb#4305 + # source://prism//lib/prism/node.rb#4942 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5269,12 +6051,13 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4389 + # source://prism//lib/prism/node.rb#4984 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4311 + # source://prism//lib/prism/node.rb#4951 + sig { returns(Prism::Node) } def value; end class << self @@ -5285,7 +6068,7 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4399 + # source://prism//lib/prism/node.rb#4994 def type; end end end @@ -5294,84 +6077,99 @@ end # # Foo::Bar # ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5003 class Prism::ConstantPathNode < ::Prism::Node - # def initialize: (parent: Node?, child: Node, delimiter_loc: Location, location: Location) -> void + # def initialize: (Node? parent, Node child, Location delimiter_loc, Location location) -> void # # @return [ConstantPathNode] a new instance of ConstantPathNode # - # source://prism//prism/node.rb#4419 - def initialize(parent, child, delimiter_loc, location); end + # source://prism//lib/prism/node.rb#5005 + def initialize(source, parent, child, delimiter_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4427 + # source://prism//lib/prism/node.rb#5015 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader child: Node # - # source://prism//prism/node.rb#4413 + # source://prism//lib/prism/node.rb#5060 + sig { returns(Prism::Node) } def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4432 + # source://prism//lib/prism/node.rb#5020 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4445 + # source://prism//lib/prism/node.rb#5033 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4437 + # source://prism//lib/prism/node.rb#5025 def compact_child_nodes; end # def copy: (**params) -> ConstantPathNode # - # source://prism//prism/node.rb#4450 + # source://prism//lib/prism/node.rb#5038 + sig { params(params: T.untyped).returns(Prism::ConstantPathNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4432 + # source://prism//lib/prism/node.rb#5020 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Node?, child: Node, delimiter_loc: Location, location: Location } # - # source://prism//prism/node.rb#4463 + # source://prism//lib/prism/node.rb#5052 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//prism/node.rb#4468 + # source://prism//lib/prism/node.rb#5070 + sig { returns(String) } def delimiter; end # attr_reader delimiter_loc: Location # - # source://prism//prism/node.rb#4416 + # source://prism//lib/prism/node.rb#5063 + sig { returns(Prism::Location) } def delimiter_loc; end # Returns the full name of this constant path. For example: "Foo::Bar" # - # source://prism//prism/node_ext.rb#129 + # source://prism//lib/prism/node_ext.rb#129 def full_name; end # Returns the list of parts for the full name of this constant path. # For example: [:Foo, :Bar] # - # source://prism//prism/node_ext.rb#112 + # source://prism//lib/prism/node_ext.rb#112 def full_name_parts; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4473 + # source://prism//lib/prism/node.rb#5075 def inspect(inspector = T.unsafe(nil)); end # attr_reader parent: Node? # - # source://prism//prism/node.rb#4410 + # source://prism//lib/prism/node.rb#5057 + sig { returns(T.nilable(Prism::Node)) } def parent; end # Sometimes you want to check an instance of a node against a list of @@ -5389,7 +6187,7 @@ class Prism::ConstantPathNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4501 + # source://prism//lib/prism/node.rb#5103 def type; end class << self @@ -5400,7 +6198,7 @@ class Prism::ConstantPathNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4511 + # source://prism//lib/prism/node.rb#5113 def type; end end end @@ -5411,74 +6209,90 @@ end # simple constants # var::Bar::Baz -> raises because the first part of the constant path is a # local variable +# +# source://prism//lib/prism/node_ext.rb#108 class Prism::ConstantPathNode::DynamicPartsInConstantPathError < ::StandardError; end # Represents assigning to a constant path using an operator that isn't `=`. # # Parent::Child += value # ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5122 class Prism::ConstantPathOperatorWriteNode < ::Prism::Node - # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Symbol operator, Location location) -> void # # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode # - # source://prism//prism/node.rb#4534 - def initialize(target, operator_loc, value, operator, location); end + # source://prism//lib/prism/node.rb#5124 + def initialize(source, target, operator_loc, value, operator, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4543 + # source://prism//lib/prism/node.rb#5135 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4548 + # source://prism//lib/prism/node.rb#5140 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4558 + # source://prism//lib/prism/node.rb#5150 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4553 + # source://prism//lib/prism/node.rb#5145 def compact_child_nodes; end # def copy: (**params) -> ConstantPathOperatorWriteNode # - # source://prism//prism/node.rb#4563 + # source://prism//lib/prism/node.rb#5155 + sig { params(params: T.untyped).returns(Prism::ConstantPathOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4548 + # source://prism//lib/prism/node.rb#5140 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, operator: Symbol, location: Location } # - # source://prism//prism/node.rb#4577 + # source://prism//lib/prism/node.rb#5170 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4582 + # source://prism//lib/prism/node.rb#5191 def inspect(inspector = T.unsafe(nil)); end # attr_reader operator: Symbol # - # source://prism//prism/node.rb#4531 + # source://prism//lib/prism/node.rb#5187 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4525 + # source://prism//lib/prism/node.rb#5178 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//prism/node.rb#4522 + # source://prism//lib/prism/node.rb#5175 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5496,12 +6310,13 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4607 + # source://prism//lib/prism/node.rb#5216 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4528 + # source://prism//lib/prism/node.rb#5184 + sig { returns(Prism::Node) } def value; end class << self @@ -5512,7 +6327,7 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4617 + # source://prism//lib/prism/node.rb#5226 def type; end end end @@ -5521,68 +6336,82 @@ end # # Parent::Child ||= value # ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5235 class Prism::ConstantPathOrWriteNode < ::Prism::Node - # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void # # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode # - # source://prism//prism/node.rb#4637 - def initialize(target, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#5237 + def initialize(source, target, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4645 + # source://prism//lib/prism/node.rb#5247 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4650 + # source://prism//lib/prism/node.rb#5252 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4660 + # source://prism//lib/prism/node.rb#5262 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4655 + # source://prism//lib/prism/node.rb#5257 def compact_child_nodes; end # def copy: (**params) -> ConstantPathOrWriteNode # - # source://prism//prism/node.rb#4665 + # source://prism//lib/prism/node.rb#5267 + sig { params(params: T.untyped).returns(Prism::ConstantPathOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4650 + # source://prism//lib/prism/node.rb#5252 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#4678 + # source://prism//lib/prism/node.rb#5281 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4688 + # source://prism//lib/prism/node.rb#5304 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#4683 + # source://prism//lib/prism/node.rb#5299 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4631 + # source://prism//lib/prism/node.rb#5289 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//prism/node.rb#4628 + # source://prism//lib/prism/node.rb#5286 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5600,12 +6429,13 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4712 + # source://prism//lib/prism/node.rb#5328 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4634 + # source://prism//lib/prism/node.rb#5295 + sig { returns(Prism::Node) } def value; end class << self @@ -5616,7 +6446,7 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4722 + # source://prism//lib/prism/node.rb#5338 def type; end end end @@ -5625,84 +6455,99 @@ end # # Foo::Foo, Bar::Bar = baz # ^^^^^^^^ ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5347 class Prism::ConstantPathTargetNode < ::Prism::Node - # def initialize: (parent: Node?, child: Node, delimiter_loc: Location, location: Location) -> void + # def initialize: (Node? parent, Node child, Location delimiter_loc, Location location) -> void # # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode # - # source://prism//prism/node.rb#4742 - def initialize(parent, child, delimiter_loc, location); end + # source://prism//lib/prism/node.rb#5349 + def initialize(source, parent, child, delimiter_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4750 + # source://prism//lib/prism/node.rb#5359 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader child: Node # - # source://prism//prism/node.rb#4736 + # source://prism//lib/prism/node.rb#5404 + sig { returns(Prism::Node) } def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4755 + # source://prism//lib/prism/node.rb#5364 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4768 + # source://prism//lib/prism/node.rb#5377 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4760 + # source://prism//lib/prism/node.rb#5369 def compact_child_nodes; end # def copy: (**params) -> ConstantPathTargetNode # - # source://prism//prism/node.rb#4773 + # source://prism//lib/prism/node.rb#5382 + sig { params(params: T.untyped).returns(Prism::ConstantPathTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4755 + # source://prism//lib/prism/node.rb#5364 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Node?, child: Node, delimiter_loc: Location, location: Location } # - # source://prism//prism/node.rb#4786 + # source://prism//lib/prism/node.rb#5396 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//prism/node.rb#4791 + # source://prism//lib/prism/node.rb#5414 + sig { returns(String) } def delimiter; end # attr_reader delimiter_loc: Location # - # source://prism//prism/node.rb#4739 + # source://prism//lib/prism/node.rb#5407 + sig { returns(Prism::Location) } def delimiter_loc; end # Returns the full name of this constant path. For example: "Foo::Bar" # - # source://prism//prism/node_ext.rb#142 + # source://prism//lib/prism/node_ext.rb#152 def full_name; end # Returns the list of parts for the full name of this constant path. # For example: [:Foo, :Bar] # - # source://prism//prism/node_ext.rb#137 + # source://prism//lib/prism/node_ext.rb#137 def full_name_parts; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4796 + # source://prism//lib/prism/node.rb#5419 def inspect(inspector = T.unsafe(nil)); end # attr_reader parent: Node? # - # source://prism//prism/node.rb#4733 + # source://prism//lib/prism/node.rb#5401 + sig { returns(T.nilable(Prism::Node)) } def parent; end # Sometimes you want to check an instance of a node against a list of @@ -5720,7 +6565,7 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4824 + # source://prism//lib/prism/node.rb#5447 def type; end class << self @@ -5731,7 +6576,7 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4834 + # source://prism//lib/prism/node.rb#5457 def type; end end end @@ -5746,68 +6591,82 @@ end # # ::Foo::Bar = 1 # ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5472 class Prism::ConstantPathWriteNode < ::Prism::Node - # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void # # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode # - # source://prism//prism/node.rb#4860 - def initialize(target, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#5474 + def initialize(source, target, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4868 + # source://prism//lib/prism/node.rb#5484 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4873 + # source://prism//lib/prism/node.rb#5489 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4883 + # source://prism//lib/prism/node.rb#5499 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4878 + # source://prism//lib/prism/node.rb#5494 def compact_child_nodes; end # def copy: (**params) -> ConstantPathWriteNode # - # source://prism//prism/node.rb#4888 + # source://prism//lib/prism/node.rb#5504 + sig { params(params: T.untyped).returns(Prism::ConstantPathWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4873 + # source://prism//lib/prism/node.rb#5489 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#4901 + # source://prism//lib/prism/node.rb#5518 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#4911 + # source://prism//lib/prism/node.rb#5541 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//prism/node.rb#4906 + # source://prism//lib/prism/node.rb#5536 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#4854 + # source://prism//lib/prism/node.rb#5526 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//prism/node.rb#4851 + # source://prism//lib/prism/node.rb#5523 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5825,12 +6684,13 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#4935 + # source://prism//lib/prism/node.rb#5565 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#4857 + # source://prism//lib/prism/node.rb#5532 + sig { returns(Prism::Node) } def value; end class << self @@ -5841,7 +6701,7 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#4945 + # source://prism//lib/prism/node.rb#5575 def type; end end end @@ -5850,69 +6710,85 @@ end # # Foo # ^^^ +# +# source://prism//lib/prism/node.rb#5584 class Prism::ConstantReadNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location location) -> void # # @return [ConstantReadNode] a new instance of ConstantReadNode # - # source://prism//prism/node.rb#4959 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#5586 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#4965 + # source://prism//lib/prism/node.rb#5594 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4970 + # source://prism//lib/prism/node.rb#5599 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#4980 + # source://prism//lib/prism/node.rb#5609 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#4975 + # source://prism//lib/prism/node.rb#5604 def compact_child_nodes; end # def copy: (**params) -> ConstantReadNode # - # source://prism//prism/node.rb#4985 + # source://prism//lib/prism/node.rb#5614 + sig { params(params: T.untyped).returns(Prism::ConstantReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#4970 + # source://prism//lib/prism/node.rb#5599 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#4996 + # source://prism//lib/prism/node.rb#5626 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # Returns the full name of this constant. For example: "Foo" # - # source://prism//prism/node_ext.rb#96 + # source://prism//lib/prism/node_ext.rb#96 def full_name; end # Returns the list of parts for the full name of this constant. # For example: [:Foo] # - # source://prism//prism/node_ext.rb#91 + # source://prism//lib/prism/node_ext.rb#91 def full_name_parts; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#5001 + # source://prism//lib/prism/node.rb#5639 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). + # + # X # name `:X` + # + # SOME_CONSTANT # name `:SOME_CONSTANT` # - # source://prism//prism/node.rb#4956 + # source://prism//lib/prism/node.rb#5635 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -5930,7 +6806,7 @@ class Prism::ConstantReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#5021 + # source://prism//lib/prism/node.rb#5659 def type; end class << self @@ -5941,7 +6817,7 @@ class Prism::ConstantReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#5031 + # source://prism//lib/prism/node.rb#5669 def type; end end end @@ -5950,58 +6826,81 @@ end # # Foo, Bar = baz # ^^^ ^^^ +# +# source://prism//lib/prism/node.rb#5678 class Prism::ConstantTargetNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void + # def initialize: (Symbol name, Location location) -> void # # @return [ConstantTargetNode] a new instance of ConstantTargetNode # - # source://prism//prism/node.rb#5045 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#5680 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#5051 + # source://prism//lib/prism/node.rb#5688 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5056 + # source://prism//lib/prism/node.rb#5693 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#5066 + # source://prism//lib/prism/node.rb#5703 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#5061 + # source://prism//lib/prism/node.rb#5698 def compact_child_nodes; end # def copy: (**params) -> ConstantTargetNode # - # source://prism//prism/node.rb#5071 + # source://prism//lib/prism/node.rb#5708 + sig { params(params: T.untyped).returns(Prism::ConstantTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5056 + # source://prism//lib/prism/node.rb#5693 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#5082 + # source://prism//lib/prism/node.rb#5720 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # Returns the full name of this constant. For example: "Foo" + # + # source://prism//lib/prism/node_ext.rb#165 + def full_name; end + + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # source://prism//lib/prism/node_ext.rb#160 + def full_name_parts; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#5087 + # source://prism//lib/prism/node.rb#5729 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#5042 + # source://prism//lib/prism/node.rb#5725 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -6019,7 +6918,7 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#5107 + # source://prism//lib/prism/node.rb#5749 def type; end class << self @@ -6030,7 +6929,7 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#5117 + # source://prism//lib/prism/node.rb#5759 def type; end end end @@ -6039,73 +6938,88 @@ end # # Foo = 1 # ^^^^^^^ +# +# source://prism//lib/prism/node.rb#5768 class Prism::ConstantWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void # # @return [ConstantWriteNode] a new instance of ConstantWriteNode # - # source://prism//prism/node.rb#5140 - def initialize(name, name_loc, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#5770 + def initialize(source, name, name_loc, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#5149 + # source://prism//lib/prism/node.rb#5781 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5154 + # source://prism//lib/prism/node.rb#5786 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#5164 + # source://prism//lib/prism/node.rb#5796 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#5159 + # source://prism//lib/prism/node.rb#5791 def compact_child_nodes; end # def copy: (**params) -> ConstantWriteNode # - # source://prism//prism/node.rb#5169 + # source://prism//lib/prism/node.rb#5801 + sig { params(params: T.untyped).returns(Prism::ConstantWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5154 + # source://prism//lib/prism/node.rb#5786 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#5183 + # source://prism//lib/prism/node.rb#5816 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#5193 + # source://prism//lib/prism/node.rb#5845 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//prism/node.rb#5128 + # source://prism//lib/prism/node.rb#5821 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#5131 + # source://prism//lib/prism/node.rb#5824 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#5188 + # source://prism//lib/prism/node.rb#5840 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#5137 + # source://prism//lib/prism/node.rb#5833 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -6123,12 +7037,13 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#5217 + # source://prism//lib/prism/node.rb#5869 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#5134 + # source://prism//lib/prism/node.rb#5830 + sig { returns(Prism::Node) } def value; end class << self @@ -6139,11 +7054,13 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#5227 + # source://prism//lib/prism/node.rb#5879 def type; end end end +class Prism::DATAComment < Prism::Comment; end + # The DSL module provides a set of methods that can be used to create prism # nodes in a more concise manner. For example, instead of writing: # @@ -6154,10 +7071,12 @@ end # Prism::IntegerNode.new( # Prism::IntegerBaseFlags::DECIMAL, # Prism::Location.new(source, 1, 1), +# source # ) # ], # Prism::Location.new(source, 0, 1), -# Prism::Location.new(source, 2, 1) +# Prism::Location.new(source, 2, 1), +# source # ) # # you could instead write: @@ -6165,764 +7084,769 @@ end # source = Prism::Source.new("[1]") # # ArrayNode( -# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1))), +# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1)), source), # Location(source, 0, 1), -# Location(source, 2, 1) +# Location(source, 2, 1), +# source # ) # # This is mostly helpful in the context of writing tests, but can also be used # to generate trees programmatically. +# +# source://prism//lib/prism/dsl.rb#40 module Prism::DSL private # Create a new AliasGlobalVariableNode node # - # source://prism//prism/dsl.rb#46 - def AliasGlobalVariableNode(new_name, old_name, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#49 + def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AliasMethodNode node # - # source://prism//prism/dsl.rb#51 - def AliasMethodNode(new_name, old_name, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#54 + def AliasMethodNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AlternationPatternNode node # - # source://prism//prism/dsl.rb#56 - def AlternationPatternNode(left, right, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#59 + def AlternationPatternNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AndNode node # - # source://prism//prism/dsl.rb#61 - def AndNode(left, right, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#64 + def AndNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArgumentsNode node # - # source://prism//prism/dsl.rb#66 - def ArgumentsNode(flags, arguments, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#69 + def ArgumentsNode(flags, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArrayNode node # - # source://prism//prism/dsl.rb#71 - def ArrayNode(flags, elements, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#74 + def ArrayNode(flags, elements, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArrayPatternNode node # - # source://prism//prism/dsl.rb#76 - def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#79 + def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AssocNode node # - # source://prism//prism/dsl.rb#81 - def AssocNode(key, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#84 + def AssocNode(key, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AssocSplatNode node # - # source://prism//prism/dsl.rb#86 - def AssocSplatNode(value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#89 + def AssocSplatNode(value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BackReferenceReadNode node # - # source://prism//prism/dsl.rb#91 - def BackReferenceReadNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#94 + def BackReferenceReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BeginNode node # - # source://prism//prism/dsl.rb#96 - def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#99 + def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockArgumentNode node # - # source://prism//prism/dsl.rb#101 - def BlockArgumentNode(expression, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#104 + def BlockArgumentNode(expression, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockLocalVariableNode node # - # source://prism//prism/dsl.rb#106 - def BlockLocalVariableNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#109 + def BlockLocalVariableNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockNode node # - # source://prism//prism/dsl.rb#111 - def BlockNode(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#114 + def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockParameterNode node # - # source://prism//prism/dsl.rb#116 - def BlockParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#119 + def BlockParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockParametersNode node # - # source://prism//prism/dsl.rb#121 - def BlockParametersNode(parameters, locals, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#124 + def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BreakNode node # - # source://prism//prism/dsl.rb#126 - def BreakNode(arguments, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#129 + def BreakNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallAndWriteNode node # - # source://prism//prism/dsl.rb#131 - def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#134 + def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallNode node # - # source://prism//prism/dsl.rb#136 - def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#139 + def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallOperatorWriteNode node # - # source://prism//prism/dsl.rb#141 - def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#144 + def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallOrWriteNode node # - # source://prism//prism/dsl.rb#146 - def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#149 + def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallTargetNode node # - # source://prism//prism/dsl.rb#151 - def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#154 + def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CapturePatternNode node # - # source://prism//prism/dsl.rb#156 - def CapturePatternNode(value, target, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#159 + def CapturePatternNode(value, target, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CaseMatchNode node # - # source://prism//prism/dsl.rb#161 - def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#164 + def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CaseNode node # - # source://prism//prism/dsl.rb#166 - def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#169 + def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassNode node # - # source://prism//prism/dsl.rb#171 - def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#174 + def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableAndWriteNode node # - # source://prism//prism/dsl.rb#176 - def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#179 + def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableOperatorWriteNode node # - # source://prism//prism/dsl.rb#181 - def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#184 + def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableOrWriteNode node # - # source://prism//prism/dsl.rb#186 - def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#189 + def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableReadNode node # - # source://prism//prism/dsl.rb#191 - def ClassVariableReadNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#194 + def ClassVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableTargetNode node # - # source://prism//prism/dsl.rb#196 - def ClassVariableTargetNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#199 + def ClassVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableWriteNode node # - # source://prism//prism/dsl.rb#201 - def ClassVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#204 + def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantAndWriteNode node # - # source://prism//prism/dsl.rb#206 - def ConstantAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#209 + def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantOperatorWriteNode node # - # source://prism//prism/dsl.rb#211 - def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#214 + def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantOrWriteNode node # - # source://prism//prism/dsl.rb#216 - def ConstantOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#219 + def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathAndWriteNode node # - # source://prism//prism/dsl.rb#221 - def ConstantPathAndWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#224 + def ConstantPathAndWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathNode node # - # source://prism//prism/dsl.rb#226 - def ConstantPathNode(parent, child, delimiter_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#229 + def ConstantPathNode(parent, child, delimiter_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathOperatorWriteNode node # - # source://prism//prism/dsl.rb#231 - def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#234 + def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathOrWriteNode node # - # source://prism//prism/dsl.rb#236 - def ConstantPathOrWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#239 + def ConstantPathOrWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathTargetNode node # - # source://prism//prism/dsl.rb#241 - def ConstantPathTargetNode(parent, child, delimiter_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#244 + def ConstantPathTargetNode(parent, child, delimiter_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathWriteNode node # - # source://prism//prism/dsl.rb#246 - def ConstantPathWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#249 + def ConstantPathWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantReadNode node # - # source://prism//prism/dsl.rb#251 - def ConstantReadNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#254 + def ConstantReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantTargetNode node # - # source://prism//prism/dsl.rb#256 - def ConstantTargetNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#259 + def ConstantTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantWriteNode node # - # source://prism//prism/dsl.rb#261 - def ConstantWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#264 + def ConstantWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new DefNode node # - # source://prism//prism/dsl.rb#266 - def DefNode(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#269 + def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new DefinedNode node # - # source://prism//prism/dsl.rb#271 - def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#274 + def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ElseNode node # - # source://prism//prism/dsl.rb#276 - def ElseNode(else_keyword_loc, statements, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#279 + def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new EmbeddedStatementsNode node # - # source://prism//prism/dsl.rb#281 - def EmbeddedStatementsNode(opening_loc, statements, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#284 + def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new EmbeddedVariableNode node # - # source://prism//prism/dsl.rb#286 - def EmbeddedVariableNode(operator_loc, variable, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#289 + def EmbeddedVariableNode(operator_loc, variable, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new EnsureNode node # - # source://prism//prism/dsl.rb#291 - def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#294 + def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FalseNode node # - # source://prism//prism/dsl.rb#296 - def FalseNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#299 + def FalseNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FindPatternNode node # - # source://prism//prism/dsl.rb#301 - def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#304 + def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FlipFlopNode node # - # source://prism//prism/dsl.rb#306 - def FlipFlopNode(flags, left, right, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#309 + def FlipFlopNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FloatNode node # - # source://prism//prism/dsl.rb#311 - def FloatNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#314 + def FloatNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForNode node # - # source://prism//prism/dsl.rb#316 - def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#319 + def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForwardingArgumentsNode node # - # source://prism//prism/dsl.rb#321 - def ForwardingArgumentsNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#324 + def ForwardingArgumentsNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForwardingParameterNode node # - # source://prism//prism/dsl.rb#326 - def ForwardingParameterNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#329 + def ForwardingParameterNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForwardingSuperNode node # - # source://prism//prism/dsl.rb#331 - def ForwardingSuperNode(block, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#334 + def ForwardingSuperNode(block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableAndWriteNode node # - # source://prism//prism/dsl.rb#336 - def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#339 + def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableOperatorWriteNode node # - # source://prism//prism/dsl.rb#341 - def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#344 + def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableOrWriteNode node # - # source://prism//prism/dsl.rb#346 - def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#349 + def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableReadNode node # - # source://prism//prism/dsl.rb#351 - def GlobalVariableReadNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#354 + def GlobalVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableTargetNode node # - # source://prism//prism/dsl.rb#356 - def GlobalVariableTargetNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#359 + def GlobalVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableWriteNode node # - # source://prism//prism/dsl.rb#361 - def GlobalVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#364 + def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new HashNode node # - # source://prism//prism/dsl.rb#366 - def HashNode(opening_loc, elements, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#369 + def HashNode(opening_loc, elements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new HashPatternNode node # - # source://prism//prism/dsl.rb#371 - def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#374 + def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IfNode node # - # source://prism//prism/dsl.rb#376 - def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#379 + def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ImaginaryNode node # - # source://prism//prism/dsl.rb#381 - def ImaginaryNode(numeric, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#384 + def ImaginaryNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ImplicitNode node # - # source://prism//prism/dsl.rb#386 - def ImplicitNode(value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#389 + def ImplicitNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ImplicitRestNode node # - # source://prism//prism/dsl.rb#391 - def ImplicitRestNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#394 + def ImplicitRestNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InNode node # - # source://prism//prism/dsl.rb#396 - def InNode(pattern, statements, in_loc, then_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#399 + def InNode(pattern, statements, in_loc, then_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IndexAndWriteNode node # - # source://prism//prism/dsl.rb#401 - def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#404 + def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IndexOperatorWriteNode node # - # source://prism//prism/dsl.rb#406 - def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#409 + def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IndexOrWriteNode node # - # source://prism//prism/dsl.rb#411 - def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#414 + def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IndexTargetNode node # - # source://prism//prism/dsl.rb#416 - def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#419 + def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableAndWriteNode node # - # source://prism//prism/dsl.rb#421 - def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#424 + def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableOperatorWriteNode node # - # source://prism//prism/dsl.rb#426 - def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#429 + def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableOrWriteNode node # - # source://prism//prism/dsl.rb#431 - def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#434 + def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableReadNode node # - # source://prism//prism/dsl.rb#436 - def InstanceVariableReadNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#439 + def InstanceVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableTargetNode node # - # source://prism//prism/dsl.rb#441 - def InstanceVariableTargetNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#444 + def InstanceVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableWriteNode node # - # source://prism//prism/dsl.rb#446 - def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#449 + def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IntegerNode node # - # source://prism//prism/dsl.rb#451 - def IntegerNode(flags, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#454 + def IntegerNode(flags, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedMatchLastLineNode node # - # source://prism//prism/dsl.rb#456 - def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#459 + def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedRegularExpressionNode node # - # source://prism//prism/dsl.rb#461 - def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#464 + def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedStringNode node # - # source://prism//prism/dsl.rb#466 - def InterpolatedStringNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#469 + def InterpolatedStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedSymbolNode node # - # source://prism//prism/dsl.rb#471 - def InterpolatedSymbolNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#474 + def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedXStringNode node # - # source://prism//prism/dsl.rb#476 - def InterpolatedXStringNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#479 + def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new KeywordHashNode node # - # source://prism//prism/dsl.rb#481 - def KeywordHashNode(flags, elements, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#484 + def KeywordHashNode(flags, elements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new KeywordRestParameterNode node # - # source://prism//prism/dsl.rb#486 - def KeywordRestParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#489 + def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LambdaNode node # - # source://prism//prism/dsl.rb#491 - def LambdaNode(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#494 + def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableAndWriteNode node # - # source://prism//prism/dsl.rb#496 - def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#499 + def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableOperatorWriteNode node # - # source://prism//prism/dsl.rb#501 - def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#504 + def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableOrWriteNode node # - # source://prism//prism/dsl.rb#506 - def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#509 + def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableReadNode node # - # source://prism//prism/dsl.rb#511 - def LocalVariableReadNode(name, depth, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#514 + def LocalVariableReadNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableTargetNode node # - # source://prism//prism/dsl.rb#516 - def LocalVariableTargetNode(name, depth, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#519 + def LocalVariableTargetNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableWriteNode node # - # source://prism//prism/dsl.rb#521 - def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#524 + def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new Location object # - # source://prism//prism/dsl.rb#41 + # source://prism//lib/prism/dsl.rb#44 def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end # Create a new MatchLastLineNode node # - # source://prism//prism/dsl.rb#526 - def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#529 + def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchPredicateNode node # - # source://prism//prism/dsl.rb#531 - def MatchPredicateNode(value, pattern, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#534 + def MatchPredicateNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchRequiredNode node # - # source://prism//prism/dsl.rb#536 - def MatchRequiredNode(value, pattern, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#539 + def MatchRequiredNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchWriteNode node # - # source://prism//prism/dsl.rb#541 - def MatchWriteNode(call, targets, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#544 + def MatchWriteNode(call, targets, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MissingNode node # - # source://prism//prism/dsl.rb#546 - def MissingNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#549 + def MissingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ModuleNode node # - # source://prism//prism/dsl.rb#551 - def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#554 + def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MultiTargetNode node # - # source://prism//prism/dsl.rb#556 - def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#559 + def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MultiWriteNode node # - # source://prism//prism/dsl.rb#561 - def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#564 + def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NextNode node # - # source://prism//prism/dsl.rb#566 - def NextNode(arguments, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#569 + def NextNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NilNode node # - # source://prism//prism/dsl.rb#571 - def NilNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#574 + def NilNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NoKeywordsParameterNode node # - # source://prism//prism/dsl.rb#576 - def NoKeywordsParameterNode(operator_loc, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#579 + def NoKeywordsParameterNode(operator_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NumberedParametersNode node # - # source://prism//prism/dsl.rb#581 - def NumberedParametersNode(maximum, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#584 + def NumberedParametersNode(maximum, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NumberedReferenceReadNode node # - # source://prism//prism/dsl.rb#586 - def NumberedReferenceReadNode(number, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#589 + def NumberedReferenceReadNode(number, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OptionalKeywordParameterNode node # - # source://prism//prism/dsl.rb#591 - def OptionalKeywordParameterNode(name, name_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#594 + def OptionalKeywordParameterNode(flags, name, name_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OptionalParameterNode node # - # source://prism//prism/dsl.rb#596 - def OptionalParameterNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#599 + def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OrNode node # - # source://prism//prism/dsl.rb#601 - def OrNode(left, right, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#604 + def OrNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ParametersNode node # - # source://prism//prism/dsl.rb#606 - def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#609 + def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ParenthesesNode node # - # source://prism//prism/dsl.rb#611 - def ParenthesesNode(body, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#614 + def ParenthesesNode(body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PinnedExpressionNode node # - # source://prism//prism/dsl.rb#616 - def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#619 + def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PinnedVariableNode node # - # source://prism//prism/dsl.rb#621 - def PinnedVariableNode(variable, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#624 + def PinnedVariableNode(variable, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PostExecutionNode node # - # source://prism//prism/dsl.rb#626 - def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#629 + def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PreExecutionNode node # - # source://prism//prism/dsl.rb#631 - def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#634 + def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ProgramNode node # - # source://prism//prism/dsl.rb#636 - def ProgramNode(locals, statements, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#639 + def ProgramNode(locals, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RangeNode node # - # source://prism//prism/dsl.rb#641 - def RangeNode(flags, left, right, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#644 + def RangeNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RationalNode node # - # source://prism//prism/dsl.rb#646 - def RationalNode(numeric, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#649 + def RationalNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RedoNode node # - # source://prism//prism/dsl.rb#651 - def RedoNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#654 + def RedoNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RegularExpressionNode node # - # source://prism//prism/dsl.rb#656 - def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#659 + def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RequiredKeywordParameterNode node # - # source://prism//prism/dsl.rb#661 - def RequiredKeywordParameterNode(name, name_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#664 + def RequiredKeywordParameterNode(flags, name, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RequiredParameterNode node # - # source://prism//prism/dsl.rb#666 - def RequiredParameterNode(name, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#669 + def RequiredParameterNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RescueModifierNode node # - # source://prism//prism/dsl.rb#671 - def RescueModifierNode(expression, keyword_loc, rescue_expression, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#674 + def RescueModifierNode(expression, keyword_loc, rescue_expression, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RescueNode node # - # source://prism//prism/dsl.rb#676 - def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#679 + def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RestParameterNode node # - # source://prism//prism/dsl.rb#681 - def RestParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#684 + def RestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RetryNode node # - # source://prism//prism/dsl.rb#686 - def RetryNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#689 + def RetryNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ReturnNode node # - # source://prism//prism/dsl.rb#691 - def ReturnNode(keyword_loc, arguments, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#694 + def ReturnNode(keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SelfNode node # - # source://prism//prism/dsl.rb#696 - def SelfNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#699 + def SelfNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SingletonClassNode node # - # source://prism//prism/dsl.rb#701 - def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#704 + def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceEncodingNode node # - # source://prism//prism/dsl.rb#706 - def SourceEncodingNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#709 + def SourceEncodingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceFileNode node # - # source://prism//prism/dsl.rb#711 - def SourceFileNode(filepath, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#714 + def SourceFileNode(filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceLineNode node # - # source://prism//prism/dsl.rb#716 - def SourceLineNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#719 + def SourceLineNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SplatNode node # - # source://prism//prism/dsl.rb#721 - def SplatNode(operator_loc, expression, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#724 + def SplatNode(operator_loc, expression, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new StatementsNode node # - # source://prism//prism/dsl.rb#726 - def StatementsNode(body, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#729 + def StatementsNode(body, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new StringNode node # - # source://prism//prism/dsl.rb#731 - def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#734 + def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SuperNode node # - # source://prism//prism/dsl.rb#736 - def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#739 + def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SymbolNode node # - # source://prism//prism/dsl.rb#741 - def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#744 + def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new TrueNode node # - # source://prism//prism/dsl.rb#746 - def TrueNode(location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#749 + def TrueNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UndefNode node # - # source://prism//prism/dsl.rb#751 - def UndefNode(names, keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#754 + def UndefNode(names, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UnlessNode node # - # source://prism//prism/dsl.rb#756 - def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#759 + def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UntilNode node # - # source://prism//prism/dsl.rb#761 - def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#764 + def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new WhenNode node # - # source://prism//prism/dsl.rb#766 - def WhenNode(keyword_loc, conditions, statements, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#769 + def WhenNode(keyword_loc, conditions, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new WhileNode node # - # source://prism//prism/dsl.rb#771 - def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#774 + def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new XStringNode node # - # source://prism//prism/dsl.rb#776 - def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#779 + def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new YieldNode node # - # source://prism//prism/dsl.rb#781 - def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, location = T.unsafe(nil)); end + # source://prism//lib/prism/dsl.rb#784 + def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end end # This module is used for testing and debugging and is not meant to be used by # consumers of this library. +# +# source://prism//lib/prism/debug.rb#6 module Prism::Debug class << self # :call-seq: @@ -6931,9 +7855,10 @@ module Prism::Debug # For the given source, compiles with CRuby and returns a list of all of the # sets of local variables that were encountered. # - # source://prism//prism/debug.rb#54 + # source://prism//lib/prism/debug.rb#54 def cruby_locals(source); end + def format_errors(_arg0, _arg1); end def inspect_node(_arg0); end def memsize(_arg0); end def named_captures(_arg0); end @@ -6944,7 +7869,7 @@ module Prism::Debug # For the given source string, return the byte offsets of every newline in # the source. # - # source://prism//prism/debug.rb#196 + # source://prism//lib/prism/debug.rb#202 def newlines(source); end # :call-seq: @@ -6953,7 +7878,7 @@ module Prism::Debug # For the given source, parses with prism and returns a list of all of the # sets of local variables that were encountered. # - # source://prism//prism/debug.rb#98 + # source://prism//lib/prism/debug.rb#98 def prism_locals(source); end def profile_file(_arg0); end @@ -6965,30 +7890,32 @@ end # iteration variable in a for loop or the positional parameter on a method # definition that is destructured. # -# source://prism//prism/debug.rb#90 +# source://prism//lib/prism/debug.rb#90 Prism::Debug::AnonymousLocal = T.let(T.unsafe(nil), Object) # A wrapper around a RubyVM::InstructionSequence that provides a more # convenient interface for accessing parts of the iseq. +# +# source://prism//lib/prism/debug.rb#9 class Prism::Debug::ISeq # @return [ISeq] a new instance of ISeq # - # source://prism//prism/debug.rb#12 + # source://prism//lib/prism/debug.rb#12 def initialize(parts); end - # source://prism//prism/debug.rb#28 + # source://prism//lib/prism/debug.rb#28 def each_child; end - # source://prism//prism/debug.rb#24 + # source://prism//lib/prism/debug.rb#24 def instructions; end - # source://prism//prism/debug.rb#20 + # source://prism//lib/prism/debug.rb#20 def local_table; end - # source://prism//prism/debug.rb#10 + # source://prism//lib/prism/debug.rb#10 def parts; end - # source://prism//prism/debug.rb#16 + # source://prism//lib/prism/debug.rb#16 def type; end end @@ -6997,148 +7924,172 @@ end # def method # end # ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#5889 class Prism::DefNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], locals_body_index: Integer, def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location) -> void + # def initialize: (Symbol name, Location name_loc, Node? receiver, ParametersNode? parameters, Node? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc, Location location) -> void # # @return [DefNode] a new instance of DefNode # - # source://prism//prism/node.rb#5278 - def initialize(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#5891 + def initialize(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#5296 + # source://prism//lib/prism/node.rb#5910 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader body: Node? # - # source://prism//prism/node.rb#5251 + # source://prism//lib/prism/node.rb#5977 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5301 + # source://prism//lib/prism/node.rb#5915 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#5315 + # source://prism//lib/prism/node.rb#5929 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#5306 + # source://prism//lib/prism/node.rb#5920 def compact_child_nodes; end # def copy: (**params) -> DefNode # - # source://prism//prism/node.rb#5320 + # source://prism//lib/prism/node.rb#5934 + sig { params(params: T.untyped).returns(Prism::DefNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5301 + # source://prism//lib/prism/node.rb#5915 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location } # - # source://prism//prism/node.rb#5343 + # source://prism//lib/prism/node.rb#5957 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def def_keyword: () -> String # - # source://prism//prism/node.rb#5348 + # source://prism//lib/prism/node.rb#6050 + sig { returns(String) } def def_keyword; end # attr_reader def_keyword_loc: Location # - # source://prism//prism/node.rb#5260 + # source://prism//lib/prism/node.rb#5983 + sig { returns(Prism::Location) } def def_keyword_loc; end # def end_keyword: () -> String? # - # source://prism//prism/node.rb#5373 + # source://prism//lib/prism/node.rb#6075 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//prism/node.rb#5275 + # source://prism//lib/prism/node.rb#6037 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # def equal: () -> String? # - # source://prism//prism/node.rb#5368 + # source://prism//lib/prism/node.rb#6070 + sig { returns(T.nilable(String)) } def equal; end # attr_reader equal_loc: Location? # - # source://prism//prism/node.rb#5272 + # source://prism//lib/prism/node.rb#6025 + sig { returns(T.nilable(Prism::Location)) } def equal_loc; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#5378 + # source://prism//lib/prism/node.rb#6080 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//prism/node.rb#5254 + # source://prism//lib/prism/node.rb#5980 + sig { returns(T::Array[Symbol]) } def locals; end - # attr_reader locals_body_index: Integer - # - # source://prism//prism/node.rb#5257 - def locals_body_index; end - # def lparen: () -> String? # - # source://prism//prism/node.rb#5358 + # source://prism//lib/prism/node.rb#6060 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//prism/node.rb#5266 + # source://prism//lib/prism/node.rb#6001 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # attr_reader name: Symbol # - # source://prism//prism/node.rb#5239 + # source://prism//lib/prism/node.rb#5962 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//prism/node.rb#5242 + # source://prism//lib/prism/node.rb#5965 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String? # - # source://prism//prism/node.rb#5353 + # source://prism//lib/prism/node.rb#6055 + sig { returns(T.nilable(String)) } def operator; end # attr_reader operator_loc: Location? # - # source://prism//prism/node.rb#5263 + # source://prism//lib/prism/node.rb#5989 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//prism/node.rb#5248 + # source://prism//lib/prism/node.rb#5974 + sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end # attr_reader receiver: Node? # - # source://prism//prism/node.rb#5245 + # source://prism//lib/prism/node.rb#5971 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def rparen: () -> String? # - # source://prism//prism/node.rb#5363 + # source://prism//lib/prism/node.rb#6065 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//prism/node.rb#5269 + # source://prism//lib/prism/node.rb#6013 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -7156,7 +8107,7 @@ class Prism::DefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#5425 + # source://prism//lib/prism/node.rb#6126 def type; end class << self @@ -7167,7 +8118,7 @@ class Prism::DefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#5435 + # source://prism//lib/prism/node.rb#6136 def type; end end end @@ -7176,83 +8127,100 @@ end # # defined?(a) # ^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6145 class Prism::DefinedNode < ::Prism::Node - # def initialize: (lparen_loc: Location?, value: Node, rparen_loc: Location?, keyword_loc: Location, location: Location) -> void + # def initialize: (Location? lparen_loc, Node value, Location? rparen_loc, Location keyword_loc, Location location) -> void # # @return [DefinedNode] a new instance of DefinedNode # - # source://prism//prism/node.rb#5458 - def initialize(lparen_loc, value, rparen_loc, keyword_loc, location); end + # source://prism//lib/prism/node.rb#6147 + def initialize(source, lparen_loc, value, rparen_loc, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#5467 + # source://prism//lib/prism/node.rb#6158 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5472 + # source://prism//lib/prism/node.rb#6163 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#5482 + # source://prism//lib/prism/node.rb#6173 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#5477 + # source://prism//lib/prism/node.rb#6168 def compact_child_nodes; end # def copy: (**params) -> DefinedNode # - # source://prism//prism/node.rb#5487 + # source://prism//lib/prism/node.rb#6178 + sig { params(params: T.untyped).returns(Prism::DefinedNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#5472 + # source://prism//lib/prism/node.rb#6163 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Node, rparen_loc: Location?, keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#5501 + # source://prism//lib/prism/node.rb#6193 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#5521 + # source://prism//lib/prism/node.rb#6247 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#5516 + # source://prism//lib/prism/node.rb#6242 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#5455 + # source://prism//lib/prism/node.rb#6225 + sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism//prism/node.rb#5506 + # source://prism//lib/prism/node.rb#6232 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//prism/node.rb#5446 + # source://prism//lib/prism/node.rb#6198 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism//prism/node.rb#5511 + # source://prism//lib/prism/node.rb#6237 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//prism/node.rb#5452 + # source://prism//lib/prism/node.rb#6213 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -7270,12 +8238,13 @@ class Prism::DefinedNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#5545 + # source://prism//lib/prism/node.rb#6271 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#5449 + # source://prism//lib/prism/node.rb#6210 + sig { returns(Prism::Node) } def value; end class << self @@ -7286,13 +8255,53 @@ class Prism::DefinedNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#5555 + # source://prism//lib/prism/node.rb#6281 def type; end end end +# source://prism//lib/prism/desugar_compiler.rb#4 +class Prism::DesugarAndWriteNode + # @return [DesugarAndWriteNode] a new instance of DesugarAndWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#7 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def arguments; end + + # Desugar `x &&= y` to `x && x = y` + # + # source://prism//lib/prism/desugar_compiler.rb#16 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#5 + def write_class; end +end + # DesugarCompiler is a compiler that desugars Ruby code into a more primitive # form. This is useful for consumers that want to deal with fewer node types. +# +# source://prism//lib/prism/desugar_compiler.rb#216 class Prism::DesugarCompiler < ::Prism::MutationCompiler # @@foo &&= bar # @@ -7300,7 +8309,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo && @@foo = bar # - # source://prism//prism/desugar_compiler.rb#12 + # source://prism//lib/prism/desugar_compiler.rb#222 def visit_class_variable_and_write_node(node); end # @@foo += bar @@ -7309,7 +8318,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo = @@foo + bar # - # source://prism//prism/desugar_compiler.rb#30 + # source://prism//lib/prism/desugar_compiler.rb#240 def visit_class_variable_operator_write_node(node); end # @@foo ||= bar @@ -7318,7 +8327,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(@@foo) ? @@foo : @@foo = bar # - # source://prism//prism/desugar_compiler.rb#21 + # source://prism//lib/prism/desugar_compiler.rb#231 def visit_class_variable_or_write_node(node); end # Foo &&= bar @@ -7327,7 +8336,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo && Foo = bar # - # source://prism//prism/desugar_compiler.rb#39 + # source://prism//lib/prism/desugar_compiler.rb#249 def visit_constant_and_write_node(node); end # Foo += bar @@ -7336,7 +8345,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo = Foo + bar # - # source://prism//prism/desugar_compiler.rb#57 + # source://prism//lib/prism/desugar_compiler.rb#267 def visit_constant_operator_write_node(node); end # Foo ||= bar @@ -7345,7 +8354,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(Foo) ? Foo : Foo = bar # - # source://prism//prism/desugar_compiler.rb#48 + # source://prism//lib/prism/desugar_compiler.rb#258 def visit_constant_or_write_node(node); end # $foo &&= bar @@ -7354,7 +8363,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo && $foo = bar # - # source://prism//prism/desugar_compiler.rb#66 + # source://prism//lib/prism/desugar_compiler.rb#276 def visit_global_variable_and_write_node(node); end # $foo += bar @@ -7363,7 +8372,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo = $foo + bar # - # source://prism//prism/desugar_compiler.rb#84 + # source://prism//lib/prism/desugar_compiler.rb#294 def visit_global_variable_operator_write_node(node); end # $foo ||= bar @@ -7372,22 +8381,22 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?($foo) ? $foo : $foo = bar # - # source://prism//prism/desugar_compiler.rb#75 + # source://prism//lib/prism/desugar_compiler.rb#285 def visit_global_variable_or_write_node(node); end # becomes # - # source://prism//prism/desugar_compiler.rb#93 + # source://prism//lib/prism/desugar_compiler.rb#303 def visit_instance_variable_and_write_node(node); end # becomes # - # source://prism//prism/desugar_compiler.rb#111 + # source://prism//lib/prism/desugar_compiler.rb#321 def visit_instance_variable_operator_write_node(node); end # becomes # - # source://prism//prism/desugar_compiler.rb#102 + # source://prism//lib/prism/desugar_compiler.rb#312 def visit_instance_variable_or_write_node(node); end # foo &&= bar @@ -7396,7 +8405,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo && foo = bar # - # source://prism//prism/desugar_compiler.rb#120 + # source://prism//lib/prism/desugar_compiler.rb#330 def visit_local_variable_and_write_node(node); end # foo += bar @@ -7405,7 +8414,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo = foo + bar # - # source://prism//prism/desugar_compiler.rb#138 + # source://prism//lib/prism/desugar_compiler.rb#348 def visit_local_variable_operator_write_node(node); end # foo ||= bar @@ -7414,33 +8423,125 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo || foo = bar # - # source://prism//prism/desugar_compiler.rb#129 + # source://prism//lib/prism/desugar_compiler.rb#339 def visit_local_variable_or_write_node(node); end +end - private +# source://prism//lib/prism/desugar_compiler.rb#63 +class Prism::DesugarOperatorWriteNode + # @return [DesugarOperatorWriteNode] a new instance of DesugarOperatorWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#66 + def initialize(node, source, read_class, write_class, *arguments); end - # Desugar `x &&= y` to `x && x = y` + # Returns the value of attribute arguments. # - # source://prism//prism/desugar_compiler.rb#145 - def desugar_and_write_node(node, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#64 + def arguments; end # Desugar `x += y` to `x = x + y` # - # source://prism//prism/desugar_compiler.rb#155 - def desugar_operator_write_node(node, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#75 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#64 + def write_class; end +end + +# source://prism//lib/prism/desugar_compiler.rb#27 +class Prism::DesugarOrWriteDefinedNode + # @return [DesugarOrWriteDefinedNode] a new instance of DesugarOrWriteDefinedNode + # + # source://prism//lib/prism/desugar_compiler.rb#30 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def arguments; end # Desugar `x ||= y` to `defined?(x) ? x : x = y` # - # source://prism//prism/desugar_compiler.rb#187 - def desugar_or_write_defined_node(node, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#39 + def compile; end - # Desugar `x ||= y` to `x || x = y` + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def read_class; end + + # Returns the value of attribute source. # - # source://prism//prism/desugar_compiler.rb#177 - def desugar_or_write_node(node, read_class, write_class, *arguments); end + # source://prism//lib/prism/desugar_compiler.rb#28 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#28 + def write_class; end end -# The dispatcher class fires events for nodes that are found while walking an +# source://prism//lib/prism/desugar_compiler.rb#99 +class Prism::DesugarOrWriteNode + # @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode + # + # source://prism//lib/prism/desugar_compiler.rb#102 + def initialize(node, source, read_class, write_class, *arguments); end + + # Returns the value of attribute arguments. + # + # source://prism//lib/prism/desugar_compiler.rb#100 + def arguments; end + + # Desugar `x ||= y` to `x || x = y` + # + # source://prism//lib/prism/desugar_compiler.rb#111 + def compile; end + + # Returns the value of attribute node. + # + # source://prism//lib/prism/desugar_compiler.rb#100 + def node; end + + # Returns the value of attribute read_class. + # + # source://prism//lib/prism/desugar_compiler.rb#100 + def read_class; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/desugar_compiler.rb#100 + def source; end + + # Returns the value of attribute write_class. + # + # source://prism//lib/prism/desugar_compiler.rb#100 + def write_class; end +end + +# The dispatcher class fires events for nodes that are found while walking an # AST to all registered listeners. It's useful for performing different types # of analysis on the AST while only having to walk the tree once. # @@ -7470,2754 +8571,2709 @@ end # # integer = result.value.statements.body.first.receiver.receiver # dispatcher.dispatch_once(integer) +# +# source://prism//lib/prism/dispatcher.rb#40 class Prism::Dispatcher < ::Prism::Visitor # Initialize a new dispatcher. # # @return [Dispatcher] a new instance of Dispatcher # - # source://prism//prism/dispatcher.rb#45 + # source://prism//lib/prism/dispatcher.rb#45 def initialize; end # Walks `root` dispatching events to all registered listeners. # # def dispatch: (Node) -> void # - # source://prism//prism/visitor.rb#16 + # source://prism//lib/prism/visitor.rb#16 def dispatch(node); end # Dispatches a single event for `node` to all registered listeners. # # def dispatch_once: (Node) -> void # - # source://prism//prism/dispatcher.rb#64 + # source://prism//lib/prism/dispatcher.rb#64 def dispatch_once(node); end # attr_reader listeners: Hash[Symbol, Array[Listener]] # - # source://prism//prism/dispatcher.rb#42 + # source://prism//lib/prism/dispatcher.rb#42 def listeners; end # Register a listener for one or more events. # # def register: (Listener, *Symbol) -> void # - # source://prism//prism/dispatcher.rb#52 + # source://prism//lib/prism/dispatcher.rb#52 def register(listener, *events); end # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#70 + # source://prism//lib/prism/dispatcher.rb#70 def visit_alias_global_variable_node(node); end # Dispatch enter and leave events for AliasMethodNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#78 + # source://prism//lib/prism/dispatcher.rb#78 def visit_alias_method_node(node); end # Dispatch enter and leave events for AlternationPatternNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#86 + # source://prism//lib/prism/dispatcher.rb#86 def visit_alternation_pattern_node(node); end # Dispatch enter and leave events for AndNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#94 + # source://prism//lib/prism/dispatcher.rb#94 def visit_and_node(node); end # Dispatch enter and leave events for ArgumentsNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#102 + # source://prism//lib/prism/dispatcher.rb#102 def visit_arguments_node(node); end # Dispatch enter and leave events for ArrayNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#110 + # source://prism//lib/prism/dispatcher.rb#110 def visit_array_node(node); end # Dispatch enter and leave events for ArrayPatternNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#118 + # source://prism//lib/prism/dispatcher.rb#118 def visit_array_pattern_node(node); end # Dispatch enter and leave events for AssocNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#126 + # source://prism//lib/prism/dispatcher.rb#126 def visit_assoc_node(node); end # Dispatch enter and leave events for AssocSplatNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#134 + # source://prism//lib/prism/dispatcher.rb#134 def visit_assoc_splat_node(node); end # Dispatch enter and leave events for BackReferenceReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#142 + # source://prism//lib/prism/dispatcher.rb#142 def visit_back_reference_read_node(node); end # Dispatch enter and leave events for BeginNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#150 + # source://prism//lib/prism/dispatcher.rb#150 def visit_begin_node(node); end # Dispatch enter and leave events for BlockArgumentNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#158 + # source://prism//lib/prism/dispatcher.rb#158 def visit_block_argument_node(node); end # Dispatch enter and leave events for BlockLocalVariableNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#166 + # source://prism//lib/prism/dispatcher.rb#166 def visit_block_local_variable_node(node); end # Dispatch enter and leave events for BlockNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#174 + # source://prism//lib/prism/dispatcher.rb#174 def visit_block_node(node); end # Dispatch enter and leave events for BlockParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#182 + # source://prism//lib/prism/dispatcher.rb#182 def visit_block_parameter_node(node); end # Dispatch enter and leave events for BlockParametersNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#190 + # source://prism//lib/prism/dispatcher.rb#190 def visit_block_parameters_node(node); end # Dispatch enter and leave events for BreakNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#198 + # source://prism//lib/prism/dispatcher.rb#198 def visit_break_node(node); end # Dispatch enter and leave events for CallAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#206 + # source://prism//lib/prism/dispatcher.rb#206 def visit_call_and_write_node(node); end # Dispatch enter and leave events for CallNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#214 + # source://prism//lib/prism/dispatcher.rb#214 def visit_call_node(node); end # Dispatch enter and leave events for CallOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#222 + # source://prism//lib/prism/dispatcher.rb#222 def visit_call_operator_write_node(node); end # Dispatch enter and leave events for CallOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#230 + # source://prism//lib/prism/dispatcher.rb#230 def visit_call_or_write_node(node); end # Dispatch enter and leave events for CallTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#238 + # source://prism//lib/prism/dispatcher.rb#238 def visit_call_target_node(node); end # Dispatch enter and leave events for CapturePatternNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#246 + # source://prism//lib/prism/dispatcher.rb#246 def visit_capture_pattern_node(node); end # Dispatch enter and leave events for CaseMatchNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#254 + # source://prism//lib/prism/dispatcher.rb#254 def visit_case_match_node(node); end # Dispatch enter and leave events for CaseNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#262 + # source://prism//lib/prism/dispatcher.rb#262 def visit_case_node(node); end # Dispatch enter and leave events for ClassNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#270 + # source://prism//lib/prism/dispatcher.rb#270 def visit_class_node(node); end # Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#278 + # source://prism//lib/prism/dispatcher.rb#278 def visit_class_variable_and_write_node(node); end # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#286 + # source://prism//lib/prism/dispatcher.rb#286 def visit_class_variable_operator_write_node(node); end # Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#294 + # source://prism//lib/prism/dispatcher.rb#294 def visit_class_variable_or_write_node(node); end # Dispatch enter and leave events for ClassVariableReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#302 + # source://prism//lib/prism/dispatcher.rb#302 def visit_class_variable_read_node(node); end # Dispatch enter and leave events for ClassVariableTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#310 + # source://prism//lib/prism/dispatcher.rb#310 def visit_class_variable_target_node(node); end # Dispatch enter and leave events for ClassVariableWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#318 + # source://prism//lib/prism/dispatcher.rb#318 def visit_class_variable_write_node(node); end # Dispatch enter and leave events for ConstantAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#326 + # source://prism//lib/prism/dispatcher.rb#326 def visit_constant_and_write_node(node); end # Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#334 + # source://prism//lib/prism/dispatcher.rb#334 def visit_constant_operator_write_node(node); end # Dispatch enter and leave events for ConstantOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#342 + # source://prism//lib/prism/dispatcher.rb#342 def visit_constant_or_write_node(node); end # Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#350 + # source://prism//lib/prism/dispatcher.rb#350 def visit_constant_path_and_write_node(node); end # Dispatch enter and leave events for ConstantPathNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#358 + # source://prism//lib/prism/dispatcher.rb#358 def visit_constant_path_node(node); end # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#366 + # source://prism//lib/prism/dispatcher.rb#366 def visit_constant_path_operator_write_node(node); end # Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#374 + # source://prism//lib/prism/dispatcher.rb#374 def visit_constant_path_or_write_node(node); end # Dispatch enter and leave events for ConstantPathTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#382 + # source://prism//lib/prism/dispatcher.rb#382 def visit_constant_path_target_node(node); end # Dispatch enter and leave events for ConstantPathWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#390 + # source://prism//lib/prism/dispatcher.rb#390 def visit_constant_path_write_node(node); end # Dispatch enter and leave events for ConstantReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#398 + # source://prism//lib/prism/dispatcher.rb#398 def visit_constant_read_node(node); end # Dispatch enter and leave events for ConstantTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#406 + # source://prism//lib/prism/dispatcher.rb#406 def visit_constant_target_node(node); end # Dispatch enter and leave events for ConstantWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#414 + # source://prism//lib/prism/dispatcher.rb#414 def visit_constant_write_node(node); end # Dispatch enter and leave events for DefNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#422 + # source://prism//lib/prism/dispatcher.rb#422 def visit_def_node(node); end # Dispatch enter and leave events for DefinedNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#430 + # source://prism//lib/prism/dispatcher.rb#430 def visit_defined_node(node); end # Dispatch enter and leave events for ElseNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#438 + # source://prism//lib/prism/dispatcher.rb#438 def visit_else_node(node); end # Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#446 + # source://prism//lib/prism/dispatcher.rb#446 def visit_embedded_statements_node(node); end # Dispatch enter and leave events for EmbeddedVariableNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#454 + # source://prism//lib/prism/dispatcher.rb#454 def visit_embedded_variable_node(node); end # Dispatch enter and leave events for EnsureNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#462 + # source://prism//lib/prism/dispatcher.rb#462 def visit_ensure_node(node); end # Dispatch enter and leave events for FalseNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#470 + # source://prism//lib/prism/dispatcher.rb#470 def visit_false_node(node); end # Dispatch enter and leave events for FindPatternNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#478 + # source://prism//lib/prism/dispatcher.rb#478 def visit_find_pattern_node(node); end # Dispatch enter and leave events for FlipFlopNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#486 + # source://prism//lib/prism/dispatcher.rb#486 def visit_flip_flop_node(node); end # Dispatch enter and leave events for FloatNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#494 + # source://prism//lib/prism/dispatcher.rb#494 def visit_float_node(node); end # Dispatch enter and leave events for ForNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#502 + # source://prism//lib/prism/dispatcher.rb#502 def visit_for_node(node); end # Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#510 + # source://prism//lib/prism/dispatcher.rb#510 def visit_forwarding_arguments_node(node); end # Dispatch enter and leave events for ForwardingParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#518 + # source://prism//lib/prism/dispatcher.rb#518 def visit_forwarding_parameter_node(node); end # Dispatch enter and leave events for ForwardingSuperNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#526 + # source://prism//lib/prism/dispatcher.rb#526 def visit_forwarding_super_node(node); end # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#534 + # source://prism//lib/prism/dispatcher.rb#534 def visit_global_variable_and_write_node(node); end # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#542 + # source://prism//lib/prism/dispatcher.rb#542 def visit_global_variable_operator_write_node(node); end # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#550 + # source://prism//lib/prism/dispatcher.rb#550 def visit_global_variable_or_write_node(node); end # Dispatch enter and leave events for GlobalVariableReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#558 + # source://prism//lib/prism/dispatcher.rb#558 def visit_global_variable_read_node(node); end # Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#566 + # source://prism//lib/prism/dispatcher.rb#566 def visit_global_variable_target_node(node); end # Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#574 + # source://prism//lib/prism/dispatcher.rb#574 def visit_global_variable_write_node(node); end # Dispatch enter and leave events for HashNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#582 + # source://prism//lib/prism/dispatcher.rb#582 def visit_hash_node(node); end # Dispatch enter and leave events for HashPatternNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#590 + # source://prism//lib/prism/dispatcher.rb#590 def visit_hash_pattern_node(node); end # Dispatch enter and leave events for IfNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#598 + # source://prism//lib/prism/dispatcher.rb#598 def visit_if_node(node); end # Dispatch enter and leave events for ImaginaryNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#606 + # source://prism//lib/prism/dispatcher.rb#606 def visit_imaginary_node(node); end # Dispatch enter and leave events for ImplicitNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#614 + # source://prism//lib/prism/dispatcher.rb#614 def visit_implicit_node(node); end # Dispatch enter and leave events for ImplicitRestNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#622 + # source://prism//lib/prism/dispatcher.rb#622 def visit_implicit_rest_node(node); end # Dispatch enter and leave events for InNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#630 + # source://prism//lib/prism/dispatcher.rb#630 def visit_in_node(node); end # Dispatch enter and leave events for IndexAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#638 + # source://prism//lib/prism/dispatcher.rb#638 def visit_index_and_write_node(node); end # Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#646 + # source://prism//lib/prism/dispatcher.rb#646 def visit_index_operator_write_node(node); end # Dispatch enter and leave events for IndexOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#654 + # source://prism//lib/prism/dispatcher.rb#654 def visit_index_or_write_node(node); end # Dispatch enter and leave events for IndexTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#662 + # source://prism//lib/prism/dispatcher.rb#662 def visit_index_target_node(node); end # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#670 + # source://prism//lib/prism/dispatcher.rb#670 def visit_instance_variable_and_write_node(node); end # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#678 + # source://prism//lib/prism/dispatcher.rb#678 def visit_instance_variable_operator_write_node(node); end # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#686 + # source://prism//lib/prism/dispatcher.rb#686 def visit_instance_variable_or_write_node(node); end # Dispatch enter and leave events for InstanceVariableReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#694 + # source://prism//lib/prism/dispatcher.rb#694 def visit_instance_variable_read_node(node); end # Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#702 + # source://prism//lib/prism/dispatcher.rb#702 def visit_instance_variable_target_node(node); end # Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#710 + # source://prism//lib/prism/dispatcher.rb#710 def visit_instance_variable_write_node(node); end # Dispatch enter and leave events for IntegerNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#718 + # source://prism//lib/prism/dispatcher.rb#718 def visit_integer_node(node); end # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#726 + # source://prism//lib/prism/dispatcher.rb#726 def visit_interpolated_match_last_line_node(node); end # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#734 + # source://prism//lib/prism/dispatcher.rb#734 def visit_interpolated_regular_expression_node(node); end # Dispatch enter and leave events for InterpolatedStringNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#742 + # source://prism//lib/prism/dispatcher.rb#742 def visit_interpolated_string_node(node); end # Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#750 + # source://prism//lib/prism/dispatcher.rb#750 def visit_interpolated_symbol_node(node); end # Dispatch enter and leave events for InterpolatedXStringNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#758 + # source://prism//lib/prism/dispatcher.rb#758 def visit_interpolated_x_string_node(node); end # Dispatch enter and leave events for KeywordHashNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#766 + # source://prism//lib/prism/dispatcher.rb#766 def visit_keyword_hash_node(node); end # Dispatch enter and leave events for KeywordRestParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#774 + # source://prism//lib/prism/dispatcher.rb#774 def visit_keyword_rest_parameter_node(node); end # Dispatch enter and leave events for LambdaNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#782 + # source://prism//lib/prism/dispatcher.rb#782 def visit_lambda_node(node); end # Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#790 + # source://prism//lib/prism/dispatcher.rb#790 def visit_local_variable_and_write_node(node); end # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#798 + # source://prism//lib/prism/dispatcher.rb#798 def visit_local_variable_operator_write_node(node); end # Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#806 + # source://prism//lib/prism/dispatcher.rb#806 def visit_local_variable_or_write_node(node); end # Dispatch enter and leave events for LocalVariableReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#814 + # source://prism//lib/prism/dispatcher.rb#814 def visit_local_variable_read_node(node); end # Dispatch enter and leave events for LocalVariableTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#822 + # source://prism//lib/prism/dispatcher.rb#822 def visit_local_variable_target_node(node); end # Dispatch enter and leave events for LocalVariableWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#830 + # source://prism//lib/prism/dispatcher.rb#830 def visit_local_variable_write_node(node); end # Dispatch enter and leave events for MatchLastLineNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#838 + # source://prism//lib/prism/dispatcher.rb#838 def visit_match_last_line_node(node); end # Dispatch enter and leave events for MatchPredicateNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#846 + # source://prism//lib/prism/dispatcher.rb#846 def visit_match_predicate_node(node); end # Dispatch enter and leave events for MatchRequiredNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#854 + # source://prism//lib/prism/dispatcher.rb#854 def visit_match_required_node(node); end # Dispatch enter and leave events for MatchWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#862 + # source://prism//lib/prism/dispatcher.rb#862 def visit_match_write_node(node); end # Dispatch enter and leave events for MissingNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#870 + # source://prism//lib/prism/dispatcher.rb#870 def visit_missing_node(node); end # Dispatch enter and leave events for ModuleNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#878 + # source://prism//lib/prism/dispatcher.rb#878 def visit_module_node(node); end # Dispatch enter and leave events for MultiTargetNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#886 + # source://prism//lib/prism/dispatcher.rb#886 def visit_multi_target_node(node); end # Dispatch enter and leave events for MultiWriteNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#894 + # source://prism//lib/prism/dispatcher.rb#894 def visit_multi_write_node(node); end # Dispatch enter and leave events for NextNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#902 + # source://prism//lib/prism/dispatcher.rb#902 def visit_next_node(node); end # Dispatch enter and leave events for NilNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#910 + # source://prism//lib/prism/dispatcher.rb#910 def visit_nil_node(node); end # Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#918 + # source://prism//lib/prism/dispatcher.rb#918 def visit_no_keywords_parameter_node(node); end # Dispatch enter and leave events for NumberedParametersNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#926 + # source://prism//lib/prism/dispatcher.rb#926 def visit_numbered_parameters_node(node); end # Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#934 + # source://prism//lib/prism/dispatcher.rb#934 def visit_numbered_reference_read_node(node); end # Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#942 + # source://prism//lib/prism/dispatcher.rb#942 def visit_optional_keyword_parameter_node(node); end # Dispatch enter and leave events for OptionalParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#950 + # source://prism//lib/prism/dispatcher.rb#950 def visit_optional_parameter_node(node); end # Dispatch enter and leave events for OrNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#958 + # source://prism//lib/prism/dispatcher.rb#958 def visit_or_node(node); end # Dispatch enter and leave events for ParametersNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#966 + # source://prism//lib/prism/dispatcher.rb#966 def visit_parameters_node(node); end # Dispatch enter and leave events for ParenthesesNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#974 + # source://prism//lib/prism/dispatcher.rb#974 def visit_parentheses_node(node); end # Dispatch enter and leave events for PinnedExpressionNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#982 + # source://prism//lib/prism/dispatcher.rb#982 def visit_pinned_expression_node(node); end # Dispatch enter and leave events for PinnedVariableNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#990 + # source://prism//lib/prism/dispatcher.rb#990 def visit_pinned_variable_node(node); end # Dispatch enter and leave events for PostExecutionNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#998 + # source://prism//lib/prism/dispatcher.rb#998 def visit_post_execution_node(node); end # Dispatch enter and leave events for PreExecutionNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1006 + # source://prism//lib/prism/dispatcher.rb#1006 def visit_pre_execution_node(node); end # Dispatch enter and leave events for ProgramNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1014 + # source://prism//lib/prism/dispatcher.rb#1014 def visit_program_node(node); end # Dispatch enter and leave events for RangeNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1022 + # source://prism//lib/prism/dispatcher.rb#1022 def visit_range_node(node); end # Dispatch enter and leave events for RationalNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1030 + # source://prism//lib/prism/dispatcher.rb#1030 def visit_rational_node(node); end # Dispatch enter and leave events for RedoNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1038 + # source://prism//lib/prism/dispatcher.rb#1038 def visit_redo_node(node); end # Dispatch enter and leave events for RegularExpressionNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1046 + # source://prism//lib/prism/dispatcher.rb#1046 def visit_regular_expression_node(node); end # Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1054 + # source://prism//lib/prism/dispatcher.rb#1054 def visit_required_keyword_parameter_node(node); end # Dispatch enter and leave events for RequiredParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1062 + # source://prism//lib/prism/dispatcher.rb#1062 def visit_required_parameter_node(node); end # Dispatch enter and leave events for RescueModifierNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1070 + # source://prism//lib/prism/dispatcher.rb#1070 def visit_rescue_modifier_node(node); end # Dispatch enter and leave events for RescueNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1078 + # source://prism//lib/prism/dispatcher.rb#1078 def visit_rescue_node(node); end # Dispatch enter and leave events for RestParameterNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1086 + # source://prism//lib/prism/dispatcher.rb#1086 def visit_rest_parameter_node(node); end # Dispatch enter and leave events for RetryNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1094 + # source://prism//lib/prism/dispatcher.rb#1094 def visit_retry_node(node); end # Dispatch enter and leave events for ReturnNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1102 + # source://prism//lib/prism/dispatcher.rb#1102 def visit_return_node(node); end # Dispatch enter and leave events for SelfNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1110 + # source://prism//lib/prism/dispatcher.rb#1110 def visit_self_node(node); end # Dispatch enter and leave events for SingletonClassNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1118 + # source://prism//lib/prism/dispatcher.rb#1118 def visit_singleton_class_node(node); end # Dispatch enter and leave events for SourceEncodingNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1126 + # source://prism//lib/prism/dispatcher.rb#1126 def visit_source_encoding_node(node); end # Dispatch enter and leave events for SourceFileNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1134 + # source://prism//lib/prism/dispatcher.rb#1134 def visit_source_file_node(node); end # Dispatch enter and leave events for SourceLineNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1142 + # source://prism//lib/prism/dispatcher.rb#1142 def visit_source_line_node(node); end # Dispatch enter and leave events for SplatNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1150 + # source://prism//lib/prism/dispatcher.rb#1150 def visit_splat_node(node); end # Dispatch enter and leave events for StatementsNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1158 + # source://prism//lib/prism/dispatcher.rb#1158 def visit_statements_node(node); end # Dispatch enter and leave events for StringNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1166 + # source://prism//lib/prism/dispatcher.rb#1166 def visit_string_node(node); end # Dispatch enter and leave events for SuperNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1174 + # source://prism//lib/prism/dispatcher.rb#1174 def visit_super_node(node); end # Dispatch enter and leave events for SymbolNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1182 + # source://prism//lib/prism/dispatcher.rb#1182 def visit_symbol_node(node); end # Dispatch enter and leave events for TrueNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1190 + # source://prism//lib/prism/dispatcher.rb#1190 def visit_true_node(node); end # Dispatch enter and leave events for UndefNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1198 + # source://prism//lib/prism/dispatcher.rb#1198 def visit_undef_node(node); end # Dispatch enter and leave events for UnlessNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1206 + # source://prism//lib/prism/dispatcher.rb#1206 def visit_unless_node(node); end # Dispatch enter and leave events for UntilNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1214 + # source://prism//lib/prism/dispatcher.rb#1214 def visit_until_node(node); end # Dispatch enter and leave events for WhenNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1222 + # source://prism//lib/prism/dispatcher.rb#1222 def visit_when_node(node); end # Dispatch enter and leave events for WhileNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1230 + # source://prism//lib/prism/dispatcher.rb#1230 def visit_while_node(node); end # Dispatch enter and leave events for XStringNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1238 + # source://prism//lib/prism/dispatcher.rb#1238 def visit_x_string_node(node); end # Dispatch enter and leave events for YieldNode nodes and continue # walking the tree. # - # source://prism//prism/dispatcher.rb#1246 + # source://prism//lib/prism/dispatcher.rb#1246 def visit_yield_node(node); end end +# source://prism//lib/prism/dispatcher.rb#1252 class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor # @return [DispatchOnce] a new instance of DispatchOnce # - # source://prism//prism/dispatcher.rb#1255 + # source://prism//lib/prism/dispatcher.rb#1255 def initialize(listeners); end # Returns the value of attribute listeners. # - # source://prism//prism/dispatcher.rb#1253 + # source://prism//lib/prism/dispatcher.rb#1253 def listeners; end # Dispatch enter and leave events for AliasGlobalVariableNode nodes. # - # source://prism//prism/dispatcher.rb#1260 + # source://prism//lib/prism/dispatcher.rb#1260 def visit_alias_global_variable_node(node); end # Dispatch enter and leave events for AliasMethodNode nodes. # - # source://prism//prism/dispatcher.rb#1266 + # source://prism//lib/prism/dispatcher.rb#1266 def visit_alias_method_node(node); end # Dispatch enter and leave events for AlternationPatternNode nodes. # - # source://prism//prism/dispatcher.rb#1272 + # source://prism//lib/prism/dispatcher.rb#1272 def visit_alternation_pattern_node(node); end # Dispatch enter and leave events for AndNode nodes. # - # source://prism//prism/dispatcher.rb#1278 + # source://prism//lib/prism/dispatcher.rb#1278 def visit_and_node(node); end # Dispatch enter and leave events for ArgumentsNode nodes. # - # source://prism//prism/dispatcher.rb#1284 + # source://prism//lib/prism/dispatcher.rb#1284 def visit_arguments_node(node); end # Dispatch enter and leave events for ArrayNode nodes. # - # source://prism//prism/dispatcher.rb#1290 + # source://prism//lib/prism/dispatcher.rb#1290 def visit_array_node(node); end # Dispatch enter and leave events for ArrayPatternNode nodes. # - # source://prism//prism/dispatcher.rb#1296 + # source://prism//lib/prism/dispatcher.rb#1296 def visit_array_pattern_node(node); end # Dispatch enter and leave events for AssocNode nodes. # - # source://prism//prism/dispatcher.rb#1302 + # source://prism//lib/prism/dispatcher.rb#1302 def visit_assoc_node(node); end # Dispatch enter and leave events for AssocSplatNode nodes. # - # source://prism//prism/dispatcher.rb#1308 + # source://prism//lib/prism/dispatcher.rb#1308 def visit_assoc_splat_node(node); end # Dispatch enter and leave events for BackReferenceReadNode nodes. # - # source://prism//prism/dispatcher.rb#1314 + # source://prism//lib/prism/dispatcher.rb#1314 def visit_back_reference_read_node(node); end # Dispatch enter and leave events for BeginNode nodes. # - # source://prism//prism/dispatcher.rb#1320 + # source://prism//lib/prism/dispatcher.rb#1320 def visit_begin_node(node); end # Dispatch enter and leave events for BlockArgumentNode nodes. # - # source://prism//prism/dispatcher.rb#1326 + # source://prism//lib/prism/dispatcher.rb#1326 def visit_block_argument_node(node); end # Dispatch enter and leave events for BlockLocalVariableNode nodes. # - # source://prism//prism/dispatcher.rb#1332 + # source://prism//lib/prism/dispatcher.rb#1332 def visit_block_local_variable_node(node); end # Dispatch enter and leave events for BlockNode nodes. # - # source://prism//prism/dispatcher.rb#1338 + # source://prism//lib/prism/dispatcher.rb#1338 def visit_block_node(node); end # Dispatch enter and leave events for BlockParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1344 + # source://prism//lib/prism/dispatcher.rb#1344 def visit_block_parameter_node(node); end # Dispatch enter and leave events for BlockParametersNode nodes. # - # source://prism//prism/dispatcher.rb#1350 + # source://prism//lib/prism/dispatcher.rb#1350 def visit_block_parameters_node(node); end # Dispatch enter and leave events for BreakNode nodes. # - # source://prism//prism/dispatcher.rb#1356 + # source://prism//lib/prism/dispatcher.rb#1356 def visit_break_node(node); end # Dispatch enter and leave events for CallAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1362 + # source://prism//lib/prism/dispatcher.rb#1362 def visit_call_and_write_node(node); end # Dispatch enter and leave events for CallNode nodes. # - # source://prism//prism/dispatcher.rb#1368 + # source://prism//lib/prism/dispatcher.rb#1368 def visit_call_node(node); end # Dispatch enter and leave events for CallOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1374 + # source://prism//lib/prism/dispatcher.rb#1374 def visit_call_operator_write_node(node); end # Dispatch enter and leave events for CallOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1380 + # source://prism//lib/prism/dispatcher.rb#1380 def visit_call_or_write_node(node); end # Dispatch enter and leave events for CallTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1386 + # source://prism//lib/prism/dispatcher.rb#1386 def visit_call_target_node(node); end # Dispatch enter and leave events for CapturePatternNode nodes. # - # source://prism//prism/dispatcher.rb#1392 + # source://prism//lib/prism/dispatcher.rb#1392 def visit_capture_pattern_node(node); end # Dispatch enter and leave events for CaseMatchNode nodes. # - # source://prism//prism/dispatcher.rb#1398 + # source://prism//lib/prism/dispatcher.rb#1398 def visit_case_match_node(node); end # Dispatch enter and leave events for CaseNode nodes. # - # source://prism//prism/dispatcher.rb#1404 + # source://prism//lib/prism/dispatcher.rb#1404 def visit_case_node(node); end # Dispatch enter and leave events for ClassNode nodes. # - # source://prism//prism/dispatcher.rb#1410 + # source://prism//lib/prism/dispatcher.rb#1410 def visit_class_node(node); end # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1416 + # source://prism//lib/prism/dispatcher.rb#1416 def visit_class_variable_and_write_node(node); end # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1422 + # source://prism//lib/prism/dispatcher.rb#1422 def visit_class_variable_operator_write_node(node); end # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1428 + # source://prism//lib/prism/dispatcher.rb#1428 def visit_class_variable_or_write_node(node); end # Dispatch enter and leave events for ClassVariableReadNode nodes. # - # source://prism//prism/dispatcher.rb#1434 + # source://prism//lib/prism/dispatcher.rb#1434 def visit_class_variable_read_node(node); end # Dispatch enter and leave events for ClassVariableTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1440 + # source://prism//lib/prism/dispatcher.rb#1440 def visit_class_variable_target_node(node); end # Dispatch enter and leave events for ClassVariableWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1446 + # source://prism//lib/prism/dispatcher.rb#1446 def visit_class_variable_write_node(node); end # Dispatch enter and leave events for ConstantAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1452 + # source://prism//lib/prism/dispatcher.rb#1452 def visit_constant_and_write_node(node); end # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1458 + # source://prism//lib/prism/dispatcher.rb#1458 def visit_constant_operator_write_node(node); end # Dispatch enter and leave events for ConstantOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1464 + # source://prism//lib/prism/dispatcher.rb#1464 def visit_constant_or_write_node(node); end # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1470 + # source://prism//lib/prism/dispatcher.rb#1470 def visit_constant_path_and_write_node(node); end # Dispatch enter and leave events for ConstantPathNode nodes. # - # source://prism//prism/dispatcher.rb#1476 + # source://prism//lib/prism/dispatcher.rb#1476 def visit_constant_path_node(node); end # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1482 + # source://prism//lib/prism/dispatcher.rb#1482 def visit_constant_path_operator_write_node(node); end # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1488 + # source://prism//lib/prism/dispatcher.rb#1488 def visit_constant_path_or_write_node(node); end # Dispatch enter and leave events for ConstantPathTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1494 + # source://prism//lib/prism/dispatcher.rb#1494 def visit_constant_path_target_node(node); end # Dispatch enter and leave events for ConstantPathWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1500 + # source://prism//lib/prism/dispatcher.rb#1500 def visit_constant_path_write_node(node); end # Dispatch enter and leave events for ConstantReadNode nodes. # - # source://prism//prism/dispatcher.rb#1506 + # source://prism//lib/prism/dispatcher.rb#1506 def visit_constant_read_node(node); end # Dispatch enter and leave events for ConstantTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1512 + # source://prism//lib/prism/dispatcher.rb#1512 def visit_constant_target_node(node); end # Dispatch enter and leave events for ConstantWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1518 + # source://prism//lib/prism/dispatcher.rb#1518 def visit_constant_write_node(node); end # Dispatch enter and leave events for DefNode nodes. # - # source://prism//prism/dispatcher.rb#1524 + # source://prism//lib/prism/dispatcher.rb#1524 def visit_def_node(node); end # Dispatch enter and leave events for DefinedNode nodes. # - # source://prism//prism/dispatcher.rb#1530 + # source://prism//lib/prism/dispatcher.rb#1530 def visit_defined_node(node); end # Dispatch enter and leave events for ElseNode nodes. # - # source://prism//prism/dispatcher.rb#1536 + # source://prism//lib/prism/dispatcher.rb#1536 def visit_else_node(node); end # Dispatch enter and leave events for EmbeddedStatementsNode nodes. # - # source://prism//prism/dispatcher.rb#1542 + # source://prism//lib/prism/dispatcher.rb#1542 def visit_embedded_statements_node(node); end # Dispatch enter and leave events for EmbeddedVariableNode nodes. # - # source://prism//prism/dispatcher.rb#1548 + # source://prism//lib/prism/dispatcher.rb#1548 def visit_embedded_variable_node(node); end # Dispatch enter and leave events for EnsureNode nodes. # - # source://prism//prism/dispatcher.rb#1554 + # source://prism//lib/prism/dispatcher.rb#1554 def visit_ensure_node(node); end # Dispatch enter and leave events for FalseNode nodes. # - # source://prism//prism/dispatcher.rb#1560 + # source://prism//lib/prism/dispatcher.rb#1560 def visit_false_node(node); end # Dispatch enter and leave events for FindPatternNode nodes. # - # source://prism//prism/dispatcher.rb#1566 + # source://prism//lib/prism/dispatcher.rb#1566 def visit_find_pattern_node(node); end # Dispatch enter and leave events for FlipFlopNode nodes. # - # source://prism//prism/dispatcher.rb#1572 + # source://prism//lib/prism/dispatcher.rb#1572 def visit_flip_flop_node(node); end # Dispatch enter and leave events for FloatNode nodes. # - # source://prism//prism/dispatcher.rb#1578 + # source://prism//lib/prism/dispatcher.rb#1578 def visit_float_node(node); end # Dispatch enter and leave events for ForNode nodes. # - # source://prism//prism/dispatcher.rb#1584 + # source://prism//lib/prism/dispatcher.rb#1584 def visit_for_node(node); end # Dispatch enter and leave events for ForwardingArgumentsNode nodes. # - # source://prism//prism/dispatcher.rb#1590 + # source://prism//lib/prism/dispatcher.rb#1590 def visit_forwarding_arguments_node(node); end # Dispatch enter and leave events for ForwardingParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1596 + # source://prism//lib/prism/dispatcher.rb#1596 def visit_forwarding_parameter_node(node); end # Dispatch enter and leave events for ForwardingSuperNode nodes. # - # source://prism//prism/dispatcher.rb#1602 + # source://prism//lib/prism/dispatcher.rb#1602 def visit_forwarding_super_node(node); end # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1608 + # source://prism//lib/prism/dispatcher.rb#1608 def visit_global_variable_and_write_node(node); end # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1614 + # source://prism//lib/prism/dispatcher.rb#1614 def visit_global_variable_operator_write_node(node); end # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1620 + # source://prism//lib/prism/dispatcher.rb#1620 def visit_global_variable_or_write_node(node); end # Dispatch enter and leave events for GlobalVariableReadNode nodes. # - # source://prism//prism/dispatcher.rb#1626 + # source://prism//lib/prism/dispatcher.rb#1626 def visit_global_variable_read_node(node); end # Dispatch enter and leave events for GlobalVariableTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1632 + # source://prism//lib/prism/dispatcher.rb#1632 def visit_global_variable_target_node(node); end # Dispatch enter and leave events for GlobalVariableWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1638 + # source://prism//lib/prism/dispatcher.rb#1638 def visit_global_variable_write_node(node); end # Dispatch enter and leave events for HashNode nodes. # - # source://prism//prism/dispatcher.rb#1644 + # source://prism//lib/prism/dispatcher.rb#1644 def visit_hash_node(node); end # Dispatch enter and leave events for HashPatternNode nodes. # - # source://prism//prism/dispatcher.rb#1650 + # source://prism//lib/prism/dispatcher.rb#1650 def visit_hash_pattern_node(node); end # Dispatch enter and leave events for IfNode nodes. # - # source://prism//prism/dispatcher.rb#1656 + # source://prism//lib/prism/dispatcher.rb#1656 def visit_if_node(node); end # Dispatch enter and leave events for ImaginaryNode nodes. # - # source://prism//prism/dispatcher.rb#1662 + # source://prism//lib/prism/dispatcher.rb#1662 def visit_imaginary_node(node); end # Dispatch enter and leave events for ImplicitNode nodes. # - # source://prism//prism/dispatcher.rb#1668 + # source://prism//lib/prism/dispatcher.rb#1668 def visit_implicit_node(node); end # Dispatch enter and leave events for ImplicitRestNode nodes. # - # source://prism//prism/dispatcher.rb#1674 + # source://prism//lib/prism/dispatcher.rb#1674 def visit_implicit_rest_node(node); end # Dispatch enter and leave events for InNode nodes. # - # source://prism//prism/dispatcher.rb#1680 + # source://prism//lib/prism/dispatcher.rb#1680 def visit_in_node(node); end # Dispatch enter and leave events for IndexAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1686 + # source://prism//lib/prism/dispatcher.rb#1686 def visit_index_and_write_node(node); end # Dispatch enter and leave events for IndexOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1692 + # source://prism//lib/prism/dispatcher.rb#1692 def visit_index_operator_write_node(node); end # Dispatch enter and leave events for IndexOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1698 + # source://prism//lib/prism/dispatcher.rb#1698 def visit_index_or_write_node(node); end # Dispatch enter and leave events for IndexTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1704 + # source://prism//lib/prism/dispatcher.rb#1704 def visit_index_target_node(node); end # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1710 + # source://prism//lib/prism/dispatcher.rb#1710 def visit_instance_variable_and_write_node(node); end # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1716 + # source://prism//lib/prism/dispatcher.rb#1716 def visit_instance_variable_operator_write_node(node); end # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1722 + # source://prism//lib/prism/dispatcher.rb#1722 def visit_instance_variable_or_write_node(node); end # Dispatch enter and leave events for InstanceVariableReadNode nodes. # - # source://prism//prism/dispatcher.rb#1728 + # source://prism//lib/prism/dispatcher.rb#1728 def visit_instance_variable_read_node(node); end # Dispatch enter and leave events for InstanceVariableTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1734 + # source://prism//lib/prism/dispatcher.rb#1734 def visit_instance_variable_target_node(node); end # Dispatch enter and leave events for InstanceVariableWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1740 + # source://prism//lib/prism/dispatcher.rb#1740 def visit_instance_variable_write_node(node); end # Dispatch enter and leave events for IntegerNode nodes. # - # source://prism//prism/dispatcher.rb#1746 + # source://prism//lib/prism/dispatcher.rb#1746 def visit_integer_node(node); end # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. # - # source://prism//prism/dispatcher.rb#1752 + # source://prism//lib/prism/dispatcher.rb#1752 def visit_interpolated_match_last_line_node(node); end # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. # - # source://prism//prism/dispatcher.rb#1758 + # source://prism//lib/prism/dispatcher.rb#1758 def visit_interpolated_regular_expression_node(node); end # Dispatch enter and leave events for InterpolatedStringNode nodes. # - # source://prism//prism/dispatcher.rb#1764 + # source://prism//lib/prism/dispatcher.rb#1764 def visit_interpolated_string_node(node); end # Dispatch enter and leave events for InterpolatedSymbolNode nodes. # - # source://prism//prism/dispatcher.rb#1770 + # source://prism//lib/prism/dispatcher.rb#1770 def visit_interpolated_symbol_node(node); end # Dispatch enter and leave events for InterpolatedXStringNode nodes. # - # source://prism//prism/dispatcher.rb#1776 + # source://prism//lib/prism/dispatcher.rb#1776 def visit_interpolated_x_string_node(node); end # Dispatch enter and leave events for KeywordHashNode nodes. # - # source://prism//prism/dispatcher.rb#1782 + # source://prism//lib/prism/dispatcher.rb#1782 def visit_keyword_hash_node(node); end # Dispatch enter and leave events for KeywordRestParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1788 + # source://prism//lib/prism/dispatcher.rb#1788 def visit_keyword_rest_parameter_node(node); end # Dispatch enter and leave events for LambdaNode nodes. # - # source://prism//prism/dispatcher.rb#1794 + # source://prism//lib/prism/dispatcher.rb#1794 def visit_lambda_node(node); end # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1800 + # source://prism//lib/prism/dispatcher.rb#1800 def visit_local_variable_and_write_node(node); end # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1806 + # source://prism//lib/prism/dispatcher.rb#1806 def visit_local_variable_operator_write_node(node); end # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1812 + # source://prism//lib/prism/dispatcher.rb#1812 def visit_local_variable_or_write_node(node); end # Dispatch enter and leave events for LocalVariableReadNode nodes. # - # source://prism//prism/dispatcher.rb#1818 + # source://prism//lib/prism/dispatcher.rb#1818 def visit_local_variable_read_node(node); end # Dispatch enter and leave events for LocalVariableTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1824 + # source://prism//lib/prism/dispatcher.rb#1824 def visit_local_variable_target_node(node); end # Dispatch enter and leave events for LocalVariableWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1830 + # source://prism//lib/prism/dispatcher.rb#1830 def visit_local_variable_write_node(node); end # Dispatch enter and leave events for MatchLastLineNode nodes. # - # source://prism//prism/dispatcher.rb#1836 + # source://prism//lib/prism/dispatcher.rb#1836 def visit_match_last_line_node(node); end # Dispatch enter and leave events for MatchPredicateNode nodes. # - # source://prism//prism/dispatcher.rb#1842 + # source://prism//lib/prism/dispatcher.rb#1842 def visit_match_predicate_node(node); end # Dispatch enter and leave events for MatchRequiredNode nodes. # - # source://prism//prism/dispatcher.rb#1848 + # source://prism//lib/prism/dispatcher.rb#1848 def visit_match_required_node(node); end # Dispatch enter and leave events for MatchWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1854 + # source://prism//lib/prism/dispatcher.rb#1854 def visit_match_write_node(node); end # Dispatch enter and leave events for MissingNode nodes. # - # source://prism//prism/dispatcher.rb#1860 + # source://prism//lib/prism/dispatcher.rb#1860 def visit_missing_node(node); end # Dispatch enter and leave events for ModuleNode nodes. # - # source://prism//prism/dispatcher.rb#1866 + # source://prism//lib/prism/dispatcher.rb#1866 def visit_module_node(node); end # Dispatch enter and leave events for MultiTargetNode nodes. # - # source://prism//prism/dispatcher.rb#1872 + # source://prism//lib/prism/dispatcher.rb#1872 def visit_multi_target_node(node); end # Dispatch enter and leave events for MultiWriteNode nodes. # - # source://prism//prism/dispatcher.rb#1878 + # source://prism//lib/prism/dispatcher.rb#1878 def visit_multi_write_node(node); end # Dispatch enter and leave events for NextNode nodes. # - # source://prism//prism/dispatcher.rb#1884 + # source://prism//lib/prism/dispatcher.rb#1884 def visit_next_node(node); end # Dispatch enter and leave events for NilNode nodes. # - # source://prism//prism/dispatcher.rb#1890 + # source://prism//lib/prism/dispatcher.rb#1890 def visit_nil_node(node); end # Dispatch enter and leave events for NoKeywordsParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1896 + # source://prism//lib/prism/dispatcher.rb#1896 def visit_no_keywords_parameter_node(node); end # Dispatch enter and leave events for NumberedParametersNode nodes. # - # source://prism//prism/dispatcher.rb#1902 + # source://prism//lib/prism/dispatcher.rb#1902 def visit_numbered_parameters_node(node); end # Dispatch enter and leave events for NumberedReferenceReadNode nodes. # - # source://prism//prism/dispatcher.rb#1908 + # source://prism//lib/prism/dispatcher.rb#1908 def visit_numbered_reference_read_node(node); end # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1914 + # source://prism//lib/prism/dispatcher.rb#1914 def visit_optional_keyword_parameter_node(node); end # Dispatch enter and leave events for OptionalParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1920 + # source://prism//lib/prism/dispatcher.rb#1920 def visit_optional_parameter_node(node); end # Dispatch enter and leave events for OrNode nodes. # - # source://prism//prism/dispatcher.rb#1926 + # source://prism//lib/prism/dispatcher.rb#1926 def visit_or_node(node); end # Dispatch enter and leave events for ParametersNode nodes. # - # source://prism//prism/dispatcher.rb#1932 + # source://prism//lib/prism/dispatcher.rb#1932 def visit_parameters_node(node); end # Dispatch enter and leave events for ParenthesesNode nodes. # - # source://prism//prism/dispatcher.rb#1938 + # source://prism//lib/prism/dispatcher.rb#1938 def visit_parentheses_node(node); end # Dispatch enter and leave events for PinnedExpressionNode nodes. # - # source://prism//prism/dispatcher.rb#1944 + # source://prism//lib/prism/dispatcher.rb#1944 def visit_pinned_expression_node(node); end # Dispatch enter and leave events for PinnedVariableNode nodes. # - # source://prism//prism/dispatcher.rb#1950 + # source://prism//lib/prism/dispatcher.rb#1950 def visit_pinned_variable_node(node); end # Dispatch enter and leave events for PostExecutionNode nodes. # - # source://prism//prism/dispatcher.rb#1956 + # source://prism//lib/prism/dispatcher.rb#1956 def visit_post_execution_node(node); end # Dispatch enter and leave events for PreExecutionNode nodes. # - # source://prism//prism/dispatcher.rb#1962 + # source://prism//lib/prism/dispatcher.rb#1962 def visit_pre_execution_node(node); end # Dispatch enter and leave events for ProgramNode nodes. # - # source://prism//prism/dispatcher.rb#1968 + # source://prism//lib/prism/dispatcher.rb#1968 def visit_program_node(node); end # Dispatch enter and leave events for RangeNode nodes. # - # source://prism//prism/dispatcher.rb#1974 + # source://prism//lib/prism/dispatcher.rb#1974 def visit_range_node(node); end # Dispatch enter and leave events for RationalNode nodes. # - # source://prism//prism/dispatcher.rb#1980 + # source://prism//lib/prism/dispatcher.rb#1980 def visit_rational_node(node); end # Dispatch enter and leave events for RedoNode nodes. # - # source://prism//prism/dispatcher.rb#1986 + # source://prism//lib/prism/dispatcher.rb#1986 def visit_redo_node(node); end # Dispatch enter and leave events for RegularExpressionNode nodes. # - # source://prism//prism/dispatcher.rb#1992 + # source://prism//lib/prism/dispatcher.rb#1992 def visit_regular_expression_node(node); end # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. # - # source://prism//prism/dispatcher.rb#1998 + # source://prism//lib/prism/dispatcher.rb#1998 def visit_required_keyword_parameter_node(node); end # Dispatch enter and leave events for RequiredParameterNode nodes. # - # source://prism//prism/dispatcher.rb#2004 + # source://prism//lib/prism/dispatcher.rb#2004 def visit_required_parameter_node(node); end # Dispatch enter and leave events for RescueModifierNode nodes. # - # source://prism//prism/dispatcher.rb#2010 + # source://prism//lib/prism/dispatcher.rb#2010 def visit_rescue_modifier_node(node); end # Dispatch enter and leave events for RescueNode nodes. # - # source://prism//prism/dispatcher.rb#2016 + # source://prism//lib/prism/dispatcher.rb#2016 def visit_rescue_node(node); end # Dispatch enter and leave events for RestParameterNode nodes. # - # source://prism//prism/dispatcher.rb#2022 + # source://prism//lib/prism/dispatcher.rb#2022 def visit_rest_parameter_node(node); end # Dispatch enter and leave events for RetryNode nodes. # - # source://prism//prism/dispatcher.rb#2028 + # source://prism//lib/prism/dispatcher.rb#2028 def visit_retry_node(node); end # Dispatch enter and leave events for ReturnNode nodes. # - # source://prism//prism/dispatcher.rb#2034 + # source://prism//lib/prism/dispatcher.rb#2034 def visit_return_node(node); end # Dispatch enter and leave events for SelfNode nodes. # - # source://prism//prism/dispatcher.rb#2040 + # source://prism//lib/prism/dispatcher.rb#2040 def visit_self_node(node); end # Dispatch enter and leave events for SingletonClassNode nodes. # - # source://prism//prism/dispatcher.rb#2046 + # source://prism//lib/prism/dispatcher.rb#2046 def visit_singleton_class_node(node); end # Dispatch enter and leave events for SourceEncodingNode nodes. # - # source://prism//prism/dispatcher.rb#2052 + # source://prism//lib/prism/dispatcher.rb#2052 def visit_source_encoding_node(node); end # Dispatch enter and leave events for SourceFileNode nodes. # - # source://prism//prism/dispatcher.rb#2058 + # source://prism//lib/prism/dispatcher.rb#2058 def visit_source_file_node(node); end # Dispatch enter and leave events for SourceLineNode nodes. # - # source://prism//prism/dispatcher.rb#2064 + # source://prism//lib/prism/dispatcher.rb#2064 def visit_source_line_node(node); end # Dispatch enter and leave events for SplatNode nodes. # - # source://prism//prism/dispatcher.rb#2070 + # source://prism//lib/prism/dispatcher.rb#2070 def visit_splat_node(node); end # Dispatch enter and leave events for StatementsNode nodes. # - # source://prism//prism/dispatcher.rb#2076 + # source://prism//lib/prism/dispatcher.rb#2076 def visit_statements_node(node); end # Dispatch enter and leave events for StringNode nodes. # - # source://prism//prism/dispatcher.rb#2082 + # source://prism//lib/prism/dispatcher.rb#2082 def visit_string_node(node); end # Dispatch enter and leave events for SuperNode nodes. # - # source://prism//prism/dispatcher.rb#2088 + # source://prism//lib/prism/dispatcher.rb#2088 def visit_super_node(node); end # Dispatch enter and leave events for SymbolNode nodes. # - # source://prism//prism/dispatcher.rb#2094 + # source://prism//lib/prism/dispatcher.rb#2094 def visit_symbol_node(node); end # Dispatch enter and leave events for TrueNode nodes. # - # source://prism//prism/dispatcher.rb#2100 + # source://prism//lib/prism/dispatcher.rb#2100 def visit_true_node(node); end # Dispatch enter and leave events for UndefNode nodes. # - # source://prism//prism/dispatcher.rb#2106 + # source://prism//lib/prism/dispatcher.rb#2106 def visit_undef_node(node); end # Dispatch enter and leave events for UnlessNode nodes. # - # source://prism//prism/dispatcher.rb#2112 + # source://prism//lib/prism/dispatcher.rb#2112 def visit_unless_node(node); end # Dispatch enter and leave events for UntilNode nodes. # - # source://prism//prism/dispatcher.rb#2118 + # source://prism//lib/prism/dispatcher.rb#2118 def visit_until_node(node); end # Dispatch enter and leave events for WhenNode nodes. # - # source://prism//prism/dispatcher.rb#2124 + # source://prism//lib/prism/dispatcher.rb#2124 def visit_when_node(node); end # Dispatch enter and leave events for WhileNode nodes. # - # source://prism//prism/dispatcher.rb#2130 + # source://prism//lib/prism/dispatcher.rb#2130 def visit_while_node(node); end # Dispatch enter and leave events for XStringNode nodes. # - # source://prism//prism/dispatcher.rb#2136 + # source://prism//lib/prism/dispatcher.rb#2136 def visit_x_string_node(node); end # Dispatch enter and leave events for YieldNode nodes. # - # source://prism//prism/dispatcher.rb#2142 + # source://prism//lib/prism/dispatcher.rb#2142 def visit_yield_node(node); end end -# Represents an `else` clause in a `case`, `if`, or `unless` statement. +# This visitor provides the ability to call Node#to_dot, which converts a +# subtree into a graphviz dot graph. # -# if a then b else c end -# ^^^^^^^^^^ -class Prism::ElseNode < ::Prism::Node - # def initialize: (else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location) -> void +# source://prism//lib/prism/dot_visitor.rb#13 +class Prism::DotVisitor < ::Prism::Visitor + # Initialize a new dot visitor. # - # @return [ElseNode] a new instance of ElseNode + # @return [DotVisitor] a new instance of DotVisitor # - # source://prism//prism/node.rb#5575 - def initialize(else_keyword_loc, statements, end_keyword_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#105 + def initialize; end - # def accept: (visitor: Visitor) -> void + # The digraph that is being built. # - # source://prism//prism/node.rb#5583 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#102 + def digraph; end - # def child_nodes: () -> Array[nil | Node] + # Convert this visitor into a graphviz dot graph string. # - # source://prism//prism/node.rb#5588 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#110 + def to_dot; end - # def comment_targets: () -> Array[Node | Location] + # Visit a AliasGlobalVariableNode node. # - # source://prism//prism/node.rb#5600 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#115 + def visit_alias_global_variable_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a AliasMethodNode node. # - # source://prism//prism/node.rb#5593 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#140 + def visit_alias_method_node(node); end - # def copy: (**params) -> ElseNode + # Visit a AlternationPatternNode node. # - # source://prism//prism/node.rb#5605 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#165 + def visit_alternation_pattern_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a AndNode node. # - # source://prism//prism/node.rb#5588 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#190 + def visit_and_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a ArgumentsNode node. # - # source://prism//prism/node.rb#5618 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#215 + def visit_arguments_node(node); end - # def else_keyword: () -> String + # Visit a ArrayNode node. # - # source://prism//prism/node.rb#5623 - def else_keyword; end + # source://prism//lib/prism/dot_visitor.rb#245 + def visit_array_node(node); end - # attr_reader else_keyword_loc: Location + # Visit a ArrayPatternNode node. # - # source://prism//prism/node.rb#5566 - def else_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#285 + def visit_array_pattern_node(node); end - # def end_keyword: () -> String? + # Visit a AssocNode node. # - # source://prism//prism/node.rb#5628 - def end_keyword; end + # source://prism//lib/prism/dot_visitor.rb#347 + def visit_assoc_node(node); end - # attr_reader end_keyword_loc: Location? + # Visit a AssocSplatNode node. # - # source://prism//prism/node.rb#5572 - def end_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#374 + def visit_assoc_splat_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a BackReferenceReadNode node. # - # source://prism//prism/node.rb#5633 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#397 + def visit_back_reference_read_node(node); end - # attr_reader statements: StatementsNode? + # Visit a BeginNode node. # - # source://prism//prism/node.rb#5569 - def statements; end + # source://prism//lib/prism/dot_visitor.rb#414 + def visit_begin_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a BlockArgumentNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#462 + def visit_block_argument_node(node); end + + # Visit a BlockLocalVariableNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#485 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode node. # - # source://prism//prism/node.rb#5660 - def type; end + # source://prism//lib/prism/dot_visitor.rb#505 + def visit_block_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#5670 - def type; end - end -end + # Visit a BlockParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#540 + def visit_block_parameter_node(node); end -# EmbDocComment objects correspond to comments that are surrounded by =begin -# and =end. -class Prism::EmbDocComment < ::Prism::Comment - # Returns a string representation of this comment. + # Visit a BlockParametersNode node. # - # source://prism//prism/parse_result.rb#267 - def inspect; end + # source://prism//lib/prism/dot_visitor.rb#568 + def visit_block_parameters_node(node); end - # This can only be true for inline comments. + # Visit a BreakNode node. # - # @return [Boolean] + # source://prism//lib/prism/dot_visitor.rb#611 + def visit_break_node(node); end + + # Visit a CallAndWriteNode node. # - # source://prism//prism/parse_result.rb#262 - def trailing?; end -end + # source://prism//lib/prism/dot_visitor.rb#634 + def visit_call_and_write_node(node); end -# Represents an interpolated set of statements. -# -# "foo #{bar}" -# ^^^^^^ -class Prism::EmbeddedStatementsNode < ::Prism::Node - # def initialize: (opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location) -> void + # Visit a CallNode node. # - # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode + # source://prism//lib/prism/dot_visitor.rb#680 + def visit_call_node(node); end + + # Visit a CallOperatorWriteNode node. # - # source://prism//prism/node.rb#5690 - def initialize(opening_loc, statements, closing_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#738 + def visit_call_operator_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a CallOrWriteNode node. # - # source://prism//prism/node.rb#5698 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#787 + def visit_call_or_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a CallTargetNode node. # - # source://prism//prism/node.rb#5703 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#833 + def visit_call_target_node(node); end - # def closing: () -> String + # Visit a CapturePatternNode node. # - # source://prism//prism/node.rb#5743 - def closing; end + # source://prism//lib/prism/dot_visitor.rb#863 + def visit_capture_pattern_node(node); end - # attr_reader closing_loc: Location + # Visit a CaseMatchNode node. # - # source://prism//prism/node.rb#5687 - def closing_loc; end + # source://prism//lib/prism/dot_visitor.rb#888 + def visit_case_match_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a CaseNode node. # - # source://prism//prism/node.rb#5715 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#933 + def visit_case_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a ClassNode node. # - # source://prism//prism/node.rb#5708 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#978 + def visit_class_node(node); end - # def copy: (**params) -> EmbeddedStatementsNode + # Visit a ClassVariableAndWriteNode node. # - # source://prism//prism/node.rb#5720 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#1025 + def visit_class_variable_and_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a ClassVariableOperatorWriteNode node. # - # source://prism//prism/node.rb#5703 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#1052 + def visit_class_variable_operator_write_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a ClassVariableOrWriteNode node. # - # source://prism//prism/node.rb#5733 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#1082 + def visit_class_variable_or_write_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a ClassVariableReadNode node. # - # source://prism//prism/node.rb#5748 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#1109 + def visit_class_variable_read_node(node); end - # def opening: () -> String + # Visit a ClassVariableTargetNode node. # - # source://prism//prism/node.rb#5738 - def opening; end + # source://prism//lib/prism/dot_visitor.rb#1126 + def visit_class_variable_target_node(node); end - # attr_reader opening_loc: Location + # Visit a ClassVariableWriteNode node. # - # source://prism//prism/node.rb#5681 - def opening_loc; end + # source://prism//lib/prism/dot_visitor.rb#1143 + def visit_class_variable_write_node(node); end - # attr_reader statements: StatementsNode? + # Visit a ConstantAndWriteNode node. # - # source://prism//prism/node.rb#5684 - def statements; end + # source://prism//lib/prism/dot_visitor.rb#1172 + def visit_constant_and_write_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a ConstantOperatorWriteNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#1199 + def visit_constant_operator_write_node(node); end + + # Visit a ConstantOrWriteNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#1229 + def visit_constant_or_write_node(node); end + + # Visit a ConstantPathAndWriteNode node. # - # source://prism//prism/node.rb#5775 - def type; end + # source://prism//lib/prism/dot_visitor.rb#1256 + def visit_constant_path_and_write_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#5785 - def type; end - end -end + # Visit a ConstantPathNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1281 + def visit_constant_path_node(node); end -# Represents an interpolated variable. -# -# "foo #@bar" -# ^^^^^ -class Prism::EmbeddedVariableNode < ::Prism::Node - # def initialize: (operator_loc: Location, variable: Node, location: Location) -> void + # Visit a ConstantPathOperatorWriteNode node. # - # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode + # source://prism//lib/prism/dot_visitor.rb#1308 + def visit_constant_path_operator_write_node(node); end + + # Visit a ConstantPathOrWriteNode node. # - # source://prism//prism/node.rb#5802 - def initialize(operator_loc, variable, location); end + # source://prism//lib/prism/dot_visitor.rb#1336 + def visit_constant_path_or_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a ConstantPathTargetNode node. # - # source://prism//prism/node.rb#5809 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#1361 + def visit_constant_path_target_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a ConstantPathWriteNode node. # - # source://prism//prism/node.rb#5814 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#1388 + def visit_constant_path_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a ConstantReadNode node. # - # source://prism//prism/node.rb#5824 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#1413 + def visit_constant_read_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a ConstantTargetNode node. # - # source://prism//prism/node.rb#5819 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#1430 + def visit_constant_target_node(node); end - # def copy: (**params) -> EmbeddedVariableNode + # Visit a ConstantWriteNode node. # - # source://prism//prism/node.rb#5829 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#1447 + def visit_constant_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a DefNode node. # - # source://prism//prism/node.rb#5814 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#1474 + def visit_def_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a DefinedNode node. # - # source://prism//prism/node.rb#5841 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#1543 + def visit_defined_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a ElseNode node. # - # source://prism//prism/node.rb#5851 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#1574 + def visit_else_node(node); end - # def operator: () -> String + # Visit a EmbeddedStatementsNode node. # - # source://prism//prism/node.rb#5846 - def operator; end + # source://prism//lib/prism/dot_visitor.rb#1602 + def visit_embedded_statements_node(node); end - # attr_reader operator_loc: Location + # Visit a EmbeddedVariableNode node. # - # source://prism//prism/node.rb#5796 - def operator_loc; end + # source://prism//lib/prism/dot_visitor.rb#1628 + def visit_embedded_variable_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a EnsureNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#1649 + def visit_ensure_node(node); end + + # Visit a FalseNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#1675 + def visit_false_node(node); end + + # Visit a FindPatternNode node. # - # source://prism//prism/node.rb#5873 - def type; end + # source://prism//lib/prism/dot_visitor.rb#1689 + def visit_find_pattern_node(node); end - # attr_reader variable: Node + # Visit a FlipFlopNode node. # - # source://prism//prism/node.rb#5799 - def variable; end + # source://prism//lib/prism/dot_visitor.rb#1740 + def visit_flip_flop_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#5883 - def type; end - end -end + # Visit a FloatNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1772 + def visit_float_node(node); end -# Flags for nodes that have unescaped content. -module Prism::EncodingFlags; end + # Visit a ForNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1786 + def visit_for_node(node); end -# internal bytes forced the encoding to binary -# -# source://prism//prism/node.rb#17306 -Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + # Visit a ForwardingArgumentsNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1828 + def visit_forwarding_arguments_node(node); end -# internal bytes forced the encoding to UTF-8 -# -# source://prism//prism/node.rb#17303 -Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + # Visit a ForwardingParameterNode node. + # + # source://prism//lib/prism/dot_visitor.rb#1842 + def visit_forwarding_parameter_node(node); end -# Represents an `ensure` clause in a `begin` statement. -# -# begin -# foo -# ensure -# ^^^^^^ -# bar -# end -class Prism::EnsureNode < ::Prism::Node - # def initialize: (ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location) -> void + # Visit a ForwardingSuperNode node. # - # @return [EnsureNode] a new instance of EnsureNode + # source://prism//lib/prism/dot_visitor.rb#1856 + def visit_forwarding_super_node(node); end + + # Visit a GlobalVariableAndWriteNode node. # - # source://prism//prism/node.rb#5907 - def initialize(ensure_keyword_loc, statements, end_keyword_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#1876 + def visit_global_variable_and_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a GlobalVariableOperatorWriteNode node. # - # source://prism//prism/node.rb#5915 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#1903 + def visit_global_variable_operator_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a GlobalVariableOrWriteNode node. # - # source://prism//prism/node.rb#5920 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#1933 + def visit_global_variable_or_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a GlobalVariableReadNode node. # - # source://prism//prism/node.rb#5932 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#1960 + def visit_global_variable_read_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a GlobalVariableTargetNode node. # - # source://prism//prism/node.rb#5925 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#1977 + def visit_global_variable_target_node(node); end - # def copy: (**params) -> EnsureNode + # Visit a GlobalVariableWriteNode node. # - # source://prism//prism/node.rb#5937 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#1994 + def visit_global_variable_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a HashNode node. # - # source://prism//prism/node.rb#5920 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#2021 + def visit_hash_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a HashPatternNode node. # - # source://prism//prism/node.rb#5950 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#2054 + def visit_hash_pattern_node(node); end - # def end_keyword: () -> String + # Visit a IfNode node. # - # source://prism//prism/node.rb#5960 - def end_keyword; end + # source://prism//lib/prism/dot_visitor.rb#2103 + def visit_if_node(node); end - # attr_reader end_keyword_loc: Location + # Visit a ImaginaryNode node. # - # source://prism//prism/node.rb#5904 - def end_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#2148 + def visit_imaginary_node(node); end - # def ensure_keyword: () -> String + # Visit a ImplicitNode node. # - # source://prism//prism/node.rb#5955 - def ensure_keyword; end + # source://prism//lib/prism/dot_visitor.rb#2166 + def visit_implicit_node(node); end - # attr_reader ensure_keyword_loc: Location + # Visit a ImplicitRestNode node. # - # source://prism//prism/node.rb#5898 - def ensure_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#2184 + def visit_implicit_rest_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a InNode node. # - # source://prism//prism/node.rb#5965 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#2198 + def visit_in_node(node); end - # attr_reader statements: StatementsNode? + # Visit a IndexAndWriteNode node. # - # source://prism//prism/node.rb#5901 - def statements; end + # source://prism//lib/prism/dot_visitor.rb#2230 + def visit_index_and_write_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a IndexOperatorWriteNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#2283 + def visit_index_operator_write_node(node); end + + # Visit a IndexOrWriteNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#2339 + def visit_index_or_write_node(node); end + + # Visit a IndexTargetNode node. # - # source://prism//prism/node.rb#5992 - def type; end + # source://prism//lib/prism/dot_visitor.rb#2392 + def visit_index_target_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6002 - def type; end - end -end + # Visit a InstanceVariableAndWriteNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2431 + def visit_instance_variable_and_write_node(node); end -# Represents the use of the literal `false` keyword. -# -# false -# ^^^^^ -class Prism::FalseNode < ::Prism::Node - # def initialize: (location: Location) -> void + # Visit a InstanceVariableOperatorWriteNode node. # - # @return [FalseNode] a new instance of FalseNode + # source://prism//lib/prism/dot_visitor.rb#2458 + def visit_instance_variable_operator_write_node(node); end + + # Visit a InstanceVariableOrWriteNode node. # - # source://prism//prism/node.rb#6013 - def initialize(location); end + # source://prism//lib/prism/dot_visitor.rb#2488 + def visit_instance_variable_or_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a InstanceVariableReadNode node. # - # source://prism//prism/node.rb#6018 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#2515 + def visit_instance_variable_read_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a InstanceVariableTargetNode node. # - # source://prism//prism/node.rb#6023 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#2532 + def visit_instance_variable_target_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a InstanceVariableWriteNode node. # - # source://prism//prism/node.rb#6033 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#2549 + def visit_instance_variable_write_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a IntegerNode node. # - # source://prism//prism/node.rb#6028 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#2576 + def visit_integer_node(node); end - # def copy: (**params) -> FalseNode + # Visit a InterpolatedMatchLastLineNode node. # - # source://prism//prism/node.rb#6038 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#2593 + def visit_interpolated_match_last_line_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a InterpolatedRegularExpressionNode node. # - # source://prism//prism/node.rb#6023 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#2629 + def visit_interpolated_regular_expression_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a InterpolatedStringNode node. # - # source://prism//prism/node.rb#6048 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#2665 + def visit_interpolated_string_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a InterpolatedSymbolNode node. # - # source://prism//prism/node.rb#6053 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#2702 + def visit_interpolated_symbol_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a InterpolatedXStringNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#2739 + def visit_interpolated_x_string_node(node); end + + # Visit a KeywordHashNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#2772 + def visit_keyword_hash_node(node); end + + # Visit a KeywordRestParameterNode node. # - # source://prism//prism/node.rb#6072 - def type; end + # source://prism//lib/prism/dot_visitor.rb#2802 + def visit_keyword_rest_parameter_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6082 - def type; end - end -end + # Visit a LambdaNode node. + # + # source://prism//lib/prism/dot_visitor.rb#2830 + def visit_lambda_node(node); end -# Represents a find pattern in pattern matching. -# -# foo in *bar, baz, *qux -# ^^^^^^^^^^^^^^^ -# -# foo in [*bar, baz, *qux] -# ^^^^^^^^^^^^^^^^^ -# -# foo in Foo(*bar, baz, *qux) -# ^^^^^^^^^^^^^^^^^^^^ -class Prism::FindPatternNode < ::Prism::Node - # def initialize: (constant: Node?, left: Node, requireds: Array[Node], right: Node, opening_loc: Location?, closing_loc: Location?, location: Location) -> void + # Visit a LocalVariableAndWriteNode node. # - # @return [FindPatternNode] a new instance of FindPatternNode + # source://prism//lib/prism/dot_visitor.rb#2868 + def visit_local_variable_and_write_node(node); end + + # Visit a LocalVariableOperatorWriteNode node. # - # source://prism//prism/node.rb#6117 - def initialize(constant, left, requireds, right, opening_loc, closing_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#2898 + def visit_local_variable_operator_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a LocalVariableOrWriteNode node. # - # source://prism//prism/node.rb#6128 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#2931 + def visit_local_variable_or_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a LocalVariableReadNode node. # - # source://prism//prism/node.rb#6133 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#2961 + def visit_local_variable_read_node(node); end - # def closing: () -> String? + # Visit a LocalVariableTargetNode node. # - # source://prism//prism/node.rb#6179 - def closing; end + # source://prism//lib/prism/dot_visitor.rb#2981 + def visit_local_variable_target_node(node); end - # attr_reader closing_loc: Location? + # Visit a LocalVariableWriteNode node. # - # source://prism//prism/node.rb#6114 - def closing_loc; end + # source://prism//lib/prism/dot_visitor.rb#3001 + def visit_local_variable_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a MatchLastLineNode node. # - # source://prism//prism/node.rb#6148 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#3031 + def visit_match_last_line_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a MatchPredicateNode node. # - # source://prism//prism/node.rb#6138 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#3060 + def visit_match_predicate_node(node); end - # attr_reader constant: Node? + # Visit a MatchRequiredNode node. # - # source://prism//prism/node.rb#6099 - def constant; end + # source://prism//lib/prism/dot_visitor.rb#3085 + def visit_match_required_node(node); end - # def copy: (**params) -> FindPatternNode + # Visit a MatchWriteNode node. # - # source://prism//prism/node.rb#6153 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#3110 + def visit_match_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a MissingNode node. # - # source://prism//prism/node.rb#6133 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#3141 + def visit_missing_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a ModuleNode node. # - # source://prism//prism/node.rb#6169 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#3155 + def visit_module_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a MultiTargetNode node. # - # source://prism//prism/node.rb#6184 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#3191 + def visit_multi_target_node(node); end - # attr_reader left: Node + # Visit a MultiWriteNode node. # - # source://prism//prism/node.rb#6102 - def left; end + # source://prism//lib/prism/dot_visitor.rb#3247 + def visit_multi_write_node(node); end - # def opening: () -> String? + # Visit a NextNode node. # - # source://prism//prism/node.rb#6174 - def opening; end + # source://prism//lib/prism/dot_visitor.rb#3310 + def visit_next_node(node); end - # attr_reader opening_loc: Location? + # Visit a NilNode node. # - # source://prism//prism/node.rb#6111 - def opening_loc; end + # source://prism//lib/prism/dot_visitor.rb#3333 + def visit_nil_node(node); end - # attr_reader requireds: Array[Node] + # Visit a NoKeywordsParameterNode node. # - # source://prism//prism/node.rb#6105 - def requireds; end + # source://prism//lib/prism/dot_visitor.rb#3347 + def visit_no_keywords_parameter_node(node); end - # attr_reader right: Node + # Visit a NumberedParametersNode node. # - # source://prism//prism/node.rb#6108 - def right; end + # source://prism//lib/prism/dot_visitor.rb#3367 + def visit_numbered_parameters_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a NumberedReferenceReadNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#3384 + def visit_numbered_reference_read_node(node); end + + # Visit a OptionalKeywordParameterNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#3401 + def visit_optional_keyword_parameter_node(node); end + + # Visit a OptionalParameterNode node. # - # source://prism//prism/node.rb#6216 - def type; end + # source://prism//lib/prism/dot_visitor.rb#3428 + def visit_optional_parameter_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6226 - def type; end - end -end + # Visit a OrNode node. + # + # source://prism//lib/prism/dot_visitor.rb#3458 + def visit_or_node(node); end -# Represents the use of the `..` or `...` operators to create flip flops. -# -# baz if foo .. bar -# ^^^^^^^^^^ -class Prism::FlipFlopNode < ::Prism::Node - # def initialize: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> void + # Visit a ParametersNode node. # - # @return [FlipFlopNode] a new instance of FlipFlopNode + # source://prism//lib/prism/dot_visitor.rb#3483 + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node. # - # source://prism//prism/node.rb#6249 - def initialize(flags, left, right, operator_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#3567 + def visit_parentheses_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a PinnedExpressionNode node. # - # source://prism//prism/node.rb#6258 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#3593 + def visit_pinned_expression_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a PinnedVariableNode node. # - # source://prism//prism/node.rb#6263 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#3620 + def visit_pinned_variable_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a PostExecutionNode node. # - # source://prism//prism/node.rb#6276 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#3641 + def visit_post_execution_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a PreExecutionNode node. # - # source://prism//prism/node.rb#6268 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#3670 + def visit_pre_execution_node(node); end - # def copy: (**params) -> FlipFlopNode + # Visit a ProgramNode node. # - # source://prism//prism/node.rb#6281 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#3699 + def visit_program_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a RangeNode node. # - # source://prism//prism/node.rb#6263 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#3720 + def visit_range_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a RationalNode node. # - # source://prism//prism/node.rb#6295 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#3752 + def visit_rational_node(node); end - # def exclude_end?: () -> bool + # Visit a RedoNode node. # - # @return [Boolean] + # source://prism//lib/prism/dot_visitor.rb#3770 + def visit_redo_node(node); end + + # Visit a RegularExpressionNode node. # - # source://prism//prism/node.rb#6300 - def exclude_end?; end + # source://prism//lib/prism/dot_visitor.rb#3784 + def visit_regular_expression_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a RequiredKeywordParameterNode node. # - # source://prism//prism/node.rb#6310 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#3813 + def visit_required_keyword_parameter_node(node); end - # attr_reader left: Node? + # Visit a RequiredParameterNode node. # - # source://prism//prism/node.rb#6240 - def left; end + # source://prism//lib/prism/dot_visitor.rb#3836 + def visit_required_parameter_node(node); end - # def operator: () -> String + # Visit a RescueModifierNode node. # - # source://prism//prism/node.rb#6305 - def operator; end + # source://prism//lib/prism/dot_visitor.rb#3856 + def visit_rescue_modifier_node(node); end - # attr_reader operator_loc: Location + # Visit a RescueNode node. # - # source://prism//prism/node.rb#6246 - def operator_loc; end + # source://prism//lib/prism/dot_visitor.rb#3881 + def visit_rescue_node(node); end - # attr_reader right: Node? + # Visit a RestParameterNode node. # - # source://prism//prism/node.rb#6243 - def right; end + # source://prism//lib/prism/dot_visitor.rb#3934 + def visit_rest_parameter_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a RetryNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#3962 + def visit_retry_node(node); end + + # Visit a ReturnNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#3976 + def visit_return_node(node); end + + # Visit a SelfNode node. # - # source://prism//prism/node.rb#6344 - def type; end + # source://prism//lib/prism/dot_visitor.rb#3999 + def visit_self_node(node); end - private + # Visit a SingletonClassNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4013 + def visit_singleton_class_node(node); end - # Returns the value of attribute flags. + # Visit a SourceEncodingNode node. # - # source://prism//prism/node.rb#6237 - def flags; end + # source://prism//lib/prism/dot_visitor.rb#4049 + def visit_source_encoding_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6354 - def type; end - end -end + # Visit a SourceFileNode node. + # + # source://prism//lib/prism/dot_visitor.rb#4063 + def visit_source_file_node(node); end -# Represents a floating point number literal. -# -# 1.0 -# ^^^ -class Prism::FloatNode < ::Prism::Node - # def initialize: (location: Location) -> void + # Visit a SourceLineNode node. # - # @return [FloatNode] a new instance of FloatNode + # source://prism//lib/prism/dot_visitor.rb#4080 + def visit_source_line_node(node); end + + # Visit a SplatNode node. # - # source://prism//prism/node.rb#6365 - def initialize(location); end + # source://prism//lib/prism/dot_visitor.rb#4094 + def visit_splat_node(node); end - # def accept: (visitor: Visitor) -> void + # Visit a StatementsNode node. # - # source://prism//prism/node.rb#6370 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#4117 + def visit_statements_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Visit a StringNode node. # - # source://prism//prism/node.rb#6375 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#4144 + def visit_string_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Visit a SuperNode node. # - # source://prism//prism/node.rb#6385 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#4177 + def visit_super_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit a SymbolNode node. # - # source://prism//prism/node.rb#6380 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#4216 + def visit_symbol_node(node); end - # def copy: (**params) -> FloatNode + # Visit a TrueNode node. # - # source://prism//prism/node.rb#6390 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#4251 + def visit_true_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a UndefNode node. # - # source://prism//prism/node.rb#6375 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#4265 + def visit_undef_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit a UnlessNode node. # - # source://prism//prism/node.rb#6400 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#4295 + def visit_unless_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Visit a UntilNode node. # - # source://prism//prism/node.rb#6405 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#4338 + def visit_until_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a WhenNode node. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#4373 + def visit_when_node(node); end + + # Visit a WhileNode node. # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#4409 + def visit_while_node(node); end + + # Visit a XStringNode node. # - # source://prism//prism/node.rb#6424 - def type; end + # source://prism//lib/prism/dot_visitor.rb#4444 + def visit_x_string_node(node); end - # Returns the value of the node as a Ruby Float. + # Visit a YieldNode node. # - # source://prism//prism/node_ext.rb#62 - def value; end + # source://prism//lib/prism/dot_visitor.rb#4473 + def visit_yield_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6434 - def type; end - end -end + private -# Represents the use of the `for` keyword. -# -# for i in a end -# ^^^^^^^^^^^^^^ -class Prism::ForNode < ::Prism::Node - # def initialize: (index: Node, collection: Node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location, location: Location) -> void + # Inspect a node that has arguments_node_flags flags to display the flags as a + # comma-separated list. # - # @return [ForNode] a new instance of ForNode + # source://prism//lib/prism/dot_visitor.rb#4519 + def arguments_node_flags_inspect(node); end + + # Inspect a node that has array_node_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6466 - def initialize(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end + # source://prism//lib/prism/dot_visitor.rb#4527 + def array_node_flags_inspect(node); end - # def accept: (visitor: Visitor) -> void + # Inspect a node that has call_node_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6478 - def accept(visitor); end + # source://prism//lib/prism/dot_visitor.rb#4535 + def call_node_flags_inspect(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a node that has encoding_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6483 - def child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#4546 + def encoding_flags_inspect(node); end - # attr_reader collection: Node + # Inspect a node that has integer_base_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6448 - def collection; end + # source://prism//lib/prism/dot_visitor.rb#4555 + def integer_base_flags_inspect(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a node that has keyword_hash_node_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6497 - def comment_targets; end + # source://prism//lib/prism/dot_visitor.rb#4566 + def keyword_hash_node_flags_inspect(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a location to display the start and end line and column numbers. # - # source://prism//prism/node.rb#6488 - def compact_child_nodes; end + # source://prism//lib/prism/dot_visitor.rb#4513 + def location_inspect(location); end - # def copy: (**params) -> ForNode + # Inspect a node that has loop_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6502 - def copy(**params); end + # source://prism//lib/prism/dot_visitor.rb#4574 + def loop_flags_inspect(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Generate a unique node ID for a node throughout the digraph. # - # source://prism//prism/node.rb#6483 - def deconstruct; end + # source://prism//lib/prism/dot_visitor.rb#4508 + def node_id(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Inspect a node that has parameter_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6519 - def deconstruct_keys(keys); end + # source://prism//lib/prism/dot_visitor.rb#4582 + def parameter_flags_inspect(node); end - # def do_keyword: () -> String? + # Inspect a node that has range_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6534 - def do_keyword; end + # source://prism//lib/prism/dot_visitor.rb#4590 + def range_flags_inspect(node); end - # attr_reader do_keyword_loc: Location? + # Inspect a node that has regular_expression_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6460 - def do_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#4598 + def regular_expression_flags_inspect(node); end - # def end_keyword: () -> String + # Inspect a node that has string_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6539 - def end_keyword; end + # source://prism//lib/prism/dot_visitor.rb#4616 + def string_flags_inspect(node); end - # attr_reader end_keyword_loc: Location + # Inspect a node that has symbol_flags flags to display the flags as a + # comma-separated list. # - # source://prism//prism/node.rb#6463 - def end_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#4626 + def symbol_flags_inspect(node); end +end - # def for_keyword: () -> String +# source://prism//lib/prism/dot_visitor.rb#58 +class Prism::DotVisitor::Digraph + # @return [Digraph] a new instance of Digraph # - # source://prism//prism/node.rb#6524 - def for_keyword; end + # source://prism//lib/prism/dot_visitor.rb#61 + def initialize; end - # attr_reader for_keyword_loc: Location + # source://prism//lib/prism/dot_visitor.rb#75 + def edge(value); end + + # Returns the value of attribute edges. # - # source://prism//prism/node.rb#6454 - def for_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#59 + def edges; end - # def in_keyword: () -> String + # source://prism//lib/prism/dot_visitor.rb#67 + def node(value); end + + # Returns the value of attribute nodes. # - # source://prism//prism/node.rb#6529 - def in_keyword; end + # source://prism//lib/prism/dot_visitor.rb#59 + def nodes; end - # attr_reader in_keyword_loc: Location + # source://prism//lib/prism/dot_visitor.rb#79 + def to_dot; end + + # source://prism//lib/prism/dot_visitor.rb#71 + def waypoint(value); end + + # Returns the value of attribute waypoints. # - # source://prism//prism/node.rb#6457 - def in_keyword_loc; end + # source://prism//lib/prism/dot_visitor.rb#59 + def waypoints; end +end - # attr_reader index: Node +# source://prism//lib/prism/dot_visitor.rb#14 +class Prism::DotVisitor::Field + # @return [Field] a new instance of Field # - # source://prism//prism/node.rb#6445 - def index; end + # source://prism//lib/prism/dot_visitor.rb#17 + def initialize(name, value, port); end - # def inspect(inspector: NodeInspector) -> String + # Returns the value of attribute name. # - # source://prism//prism/node.rb#6544 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/dot_visitor.rb#15 + def name; end - # attr_reader statements: StatementsNode? + # Returns the value of attribute port. # - # source://prism//prism/node.rb#6451 - def statements; end + # source://prism//lib/prism/dot_visitor.rb#15 + def port; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # source://prism//lib/prism/dot_visitor.rb#23 + def to_dot; end + + # Returns the value of attribute value. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/dot_visitor.rb#15 + def value; end +end + +# source://prism//lib/prism/dot_visitor.rb#32 +class Prism::DotVisitor::Table + # @return [Table] a new instance of Table # - # def type: () -> Symbol + # source://prism//lib/prism/dot_visitor.rb#35 + def initialize(name); end + + # source://prism//lib/prism/dot_visitor.rb#40 + def field(name, value = T.unsafe(nil), port: T.unsafe(nil)); end + + # Returns the value of attribute fields. # - # source://prism//prism/node.rb#6577 - def type; end + # source://prism//lib/prism/dot_visitor.rb#33 + def fields; end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#6587 - def type; end - end + # Returns the value of attribute name. + # + # source://prism//lib/prism/dot_visitor.rb#33 + def name; end + + # source://prism//lib/prism/dot_visitor.rb#44 + def to_dot; end end -# Represents forwarding all arguments to this method to another method. +# Represents an `else` clause in a `case`, `if`, or `unless` statement. # -# def foo(...) -# bar(...) -# ^^^ -# end -class Prism::ForwardingArgumentsNode < ::Prism::Node - # def initialize: (location: Location) -> void +# if a then b else c end +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6290 +class Prism::ElseNode < ::Prism::Node + # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void # - # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode + # @return [ElseNode] a new instance of ElseNode # - # source://prism//prism/node.rb#6600 - def initialize(location); end + # source://prism//lib/prism/node.rb#6292 + def initialize(source, else_keyword_loc, statements, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#6605 + # source://prism//lib/prism/node.rb#6302 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6610 + # source://prism//lib/prism/node.rb#6307 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#6620 + # source://prism//lib/prism/node.rb#6319 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#6615 + # source://prism//lib/prism/node.rb#6312 def compact_child_nodes; end - # def copy: (**params) -> ForwardingArgumentsNode + # def copy: (**params) -> ElseNode # - # source://prism//prism/node.rb#6625 + # source://prism//lib/prism/node.rb#6324 + sig { params(params: T.untyped).returns(Prism::ElseNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6610 + # source://prism//lib/prism/node.rb#6307 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//prism/node.rb#6635 + # source://prism//lib/prism/node.rb#6338 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def else_keyword: () -> String # - # source://prism//prism/node.rb#6640 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6365 + sig { returns(String) } + def else_keyword; end + + # attr_reader else_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#6343 + sig { returns(Prism::Location) } + def else_keyword_loc; end + + # def end_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#6370 + sig { returns(T.nilable(String)) } + def end_keyword; end + + # attr_reader end_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#6352 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#6375 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6349 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -10234,7 +11290,7 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#6659 + # source://prism//lib/prism/node.rb#6402 def type; end class << self @@ -10245,65 +11301,123 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#6669 + # source://prism//lib/prism/node.rb#6412 def type; end end end -# Represents the use of the forwarding parameter in a method, block, or lambda declaration. +# EmbDocComment objects correspond to comments that are surrounded by =begin +# and =end. # -# def foo(...) -# ^^^ -# end -class Prism::ForwardingParameterNode < ::Prism::Node - # def initialize: (location: Location) -> void +# source://prism//lib/prism/parse_result.rb#290 +class Prism::EmbDocComment < ::Prism::Comment + # Returns a string representation of this comment. # - # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode + # source://prism//lib/prism/parse_result.rb#297 + def inspect; end + + # This can only be true for inline comments. # - # source://prism//prism/node.rb#6681 - def initialize(location); end + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#292 + def trailing?; end +end + +# Represents an interpolated set of statements. +# +# "foo #{bar}" +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#6421 +class Prism::EmbeddedStatementsNode < ::Prism::Node + # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void + # + # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode + # + # source://prism//lib/prism/node.rb#6423 + def initialize(source, opening_loc, statements, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#6686 + # source://prism//lib/prism/node.rb#6433 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6691 + # source://prism//lib/prism/node.rb#6438 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#6495 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#6483 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#6701 + # source://prism//lib/prism/node.rb#6450 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#6696 + # source://prism//lib/prism/node.rb#6443 def compact_child_nodes; end - # def copy: (**params) -> ForwardingParameterNode + # def copy: (**params) -> EmbeddedStatementsNode # - # source://prism//prism/node.rb#6706 + # source://prism//lib/prism/node.rb#6455 + sig { params(params: T.untyped).returns(Prism::EmbeddedStatementsNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6691 + # source://prism//lib/prism/node.rb#6438 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#6716 + # source://prism//lib/prism/node.rb#6469 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#6721 + # source://prism//lib/prism/node.rb#6500 def inspect(inspector = T.unsafe(nil)); end + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#6490 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#6474 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6480 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -10319,7 +11433,7 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#6740 + # source://prism//lib/prism/node.rb#6527 def type; end class << self @@ -10330,69 +11444,87 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#6750 + # source://prism//lib/prism/node.rb#6537 def type; end end end -# Represents the use of the `super` keyword without parentheses or arguments. +# Represents an interpolated variable. # -# super -# ^^^^^ -class Prism::ForwardingSuperNode < ::Prism::Node - # def initialize: (block: BlockNode?, location: Location) -> void +# "foo #@bar" +# ^^^^^ +# +# source://prism//lib/prism/node.rb#6546 +class Prism::EmbeddedVariableNode < ::Prism::Node + # def initialize: (Location operator_loc, Node variable, Location location) -> void # - # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode + # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode # - # source://prism//prism/node.rb#6764 - def initialize(block, location); end + # source://prism//lib/prism/node.rb#6548 + def initialize(source, operator_loc, variable, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#6770 + # source://prism//lib/prism/node.rb#6557 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader block: BlockNode? - # - # source://prism//prism/node.rb#6761 - def block; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6775 + # source://prism//lib/prism/node.rb#6562 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#6787 + # source://prism//lib/prism/node.rb#6572 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#6780 + # source://prism//lib/prism/node.rb#6567 def compact_child_nodes; end - # def copy: (**params) -> ForwardingSuperNode + # def copy: (**params) -> EmbeddedVariableNode # - # source://prism//prism/node.rb#6792 + # source://prism//lib/prism/node.rb#6577 + sig { params(params: T.untyped).returns(Prism::EmbeddedVariableNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6775 + # source://prism//lib/prism/node.rb#6562 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Node, location: Location } # - # source://prism//prism/node.rb#6803 + # source://prism//lib/prism/node.rb#6590 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#6808 + # source://prism//lib/prism/node.rb#6610 def inspect(inspector = T.unsafe(nil)); end + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#6605 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#6595 + sig { returns(Prism::Location) } + def operator_loc; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -10408,9 +11540,15 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#6833 + # source://prism//lib/prism/node.rb#6632 def type; end + # attr_reader variable: Node + # + # source://prism//lib/prism/node.rb#6601 + sig { returns(Prism::Node) } + def variable; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10419,83 +11557,123 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#6843 + # source://prism//lib/prism/node.rb#6642 def type; end end end -# Represents the use of the `&&=` operator for assignment to a global variable. +# Flags for nodes that have unescaped content. # -# $target &&= value -# ^^^^^^^^^^^^^^^^^ -class Prism::GlobalVariableAndWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void +# source://prism//lib/prism/node.rb#19268 +module Prism::EncodingFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19273 +Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19270 +Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents an `ensure` clause in a `begin` statement. +# +# begin +# foo +# ensure +# ^^^^^^ +# bar +# end +# +# source://prism//lib/prism/node.rb#6655 +class Prism::EnsureNode < ::Prism::Node + # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void # - # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode + # @return [EnsureNode] a new instance of EnsureNode # - # source://prism//prism/node.rb#6866 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#6657 + def initialize(source, ensure_keyword_loc, statements, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#6875 + # source://prism//lib/prism/node.rb#6667 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6880 + # source://prism//lib/prism/node.rb#6672 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#6890 + # source://prism//lib/prism/node.rb#6684 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#6885 + # source://prism//lib/prism/node.rb#6677 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableAndWriteNode + # def copy: (**params) -> EnsureNode # - # source://prism//prism/node.rb#6895 + # source://prism//lib/prism/node.rb#6689 + sig { params(params: T.untyped).returns(Prism::EnsureNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6880 + # source://prism//lib/prism/node.rb#6672 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#6909 + # source://prism//lib/prism/node.rb#6703 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def end_keyword: () -> String # - # source://prism//prism/node.rb#6919 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#6729 + sig { returns(String) } + def end_keyword; end - # attr_reader name: Symbol + # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#6854 - def name; end + # source://prism//lib/prism/node.rb#6717 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # attr_reader name_loc: Location + # def ensure_keyword: () -> String # - # source://prism//prism/node.rb#6857 - def name_loc; end + # source://prism//lib/prism/node.rb#6724 + sig { returns(String) } + def ensure_keyword; end - # def operator: () -> String + # attr_reader ensure_keyword_loc: Location # - # source://prism//prism/node.rb#6914 - def operator; end + # source://prism//lib/prism/node.rb#6708 + sig { returns(Prism::Location) } + def ensure_keyword_loc; end - # attr_reader operator_loc: Location + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#6860 - def operator_loc; end + # source://prism//lib/prism/node.rb#6734 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#6714 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -10512,14 +11690,9 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#6943 + # source://prism//lib/prism/node.rb#6761 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#6863 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10528,84 +11701,75 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#6953 + # source://prism//lib/prism/node.rb#6771 def type; end end end -# Represents assigning to a global variable using an operator that isn't `=`. +# Represents the use of the literal `false` keyword. # -# $target += value -# ^^^^^^^^^^^^^^^^ -class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void +# false +# ^^^^^ +# +# source://prism//lib/prism/node.rb#6780 +class Prism::FalseNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode + # @return [FalseNode] a new instance of FalseNode # - # source://prism//prism/node.rb#6979 - def initialize(name, name_loc, operator_loc, value, operator, location); end + # source://prism//lib/prism/node.rb#6782 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#6989 + # source://prism//lib/prism/node.rb#6789 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6994 + # source://prism//lib/prism/node.rb#6794 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7004 + # source://prism//lib/prism/node.rb#6804 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#6999 + # source://prism//lib/prism/node.rb#6799 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableOperatorWriteNode + # def copy: (**params) -> FalseNode # - # source://prism//prism/node.rb#7009 + # source://prism//lib/prism/node.rb#6809 + sig { params(params: T.untyped).returns(Prism::FalseNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#6994 + # source://prism//lib/prism/node.rb#6794 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#7024 + # source://prism//lib/prism/node.rb#6820 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7029 + # source://prism//lib/prism/node.rb#6826 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#6964 - def name; end - - # attr_reader name_loc: Location - # - # source://prism//prism/node.rb#6967 - def name_loc; end - - # attr_reader operator: Symbol - # - # source://prism//prism/node.rb#6976 - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#6970 - def operator_loc; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -10621,14 +11785,9 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7054 + # source://prism//lib/prism/node.rb#6845 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#6973 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10637,83 +11796,128 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7064 + # source://prism//lib/prism/node.rb#6855 def type; end end end -# Represents the use of the `||=` operator for assignment to a global variable. +# Represents a find pattern in pattern matching. # -# $target ||= value -# ^^^^^^^^^^^^^^^^^ -class Prism::GlobalVariableOrWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void +# foo in *bar, baz, *qux +# ^^^^^^^^^^^^^^^ +# +# foo in [*bar, baz, *qux] +# ^^^^^^^^^^^^^^^^^ +# +# foo in Foo(*bar, baz, *qux) +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#6870 +class Prism::FindPatternNode < ::Prism::Node + # def initialize: (Node? constant, Node left, Array[Node] requireds, Node right, Location? opening_loc, Location? closing_loc, Location location) -> void # - # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode + # @return [FindPatternNode] a new instance of FindPatternNode # - # source://prism//prism/node.rb#7087 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#6872 + def initialize(source, constant, left, requireds, right, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7096 + # source://prism//lib/prism/node.rb#6885 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7101 + # source://prism//lib/prism/node.rb#6890 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#6974 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#6956 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7111 + # source://prism//lib/prism/node.rb#6905 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7106 + # source://prism//lib/prism/node.rb#6895 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableOrWriteNode + # attr_reader constant: Node? + # + # source://prism//lib/prism/node.rb#6932 + sig { returns(T.nilable(Prism::Node)) } + def constant; end + + # def copy: (**params) -> FindPatternNode # - # source://prism//prism/node.rb#7116 + # source://prism//lib/prism/node.rb#6910 + sig { params(params: T.untyped).returns(Prism::FindPatternNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7101 + # source://prism//lib/prism/node.rb#6890 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, left: Node, requireds: Array[Node], right: Node, opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#7130 + # source://prism//lib/prism/node.rb#6927 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7140 + # source://prism//lib/prism/node.rb#6979 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # attr_reader left: Node # - # source://prism//prism/node.rb#7075 - def name; end + # source://prism//lib/prism/node.rb#6935 + sig { returns(Prism::Node) } + def left; end - # attr_reader name_loc: Location + # def opening: () -> String? # - # source://prism//prism/node.rb#7078 - def name_loc; end + # source://prism//lib/prism/node.rb#6969 + sig { returns(T.nilable(String)) } + def opening; end - # def operator: () -> String + # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#7135 - def operator; end + # source://prism//lib/prism/node.rb#6944 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end - # attr_reader operator_loc: Location + # attr_reader requireds: Array[Node] # - # source://prism//prism/node.rb#7081 - def operator_loc; end + # source://prism//lib/prism/node.rb#6938 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # attr_reader right: Node + # + # source://prism//lib/prism/node.rb#6941 + sig { returns(Prism::Node) } + def right; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -10730,14 +11934,9 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7164 + # source://prism//lib/prism/node.rb#7011 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#7084 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10746,68 +11945,106 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7174 + # source://prism//lib/prism/node.rb#7021 def type; end end end -# Represents referencing a global variable. +# Represents the use of the `..` or `...` operators to create flip flops. # -# $foo -# ^^^^ -class Prism::GlobalVariableReadNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void +# baz if foo .. bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7030 +class Prism::FlipFlopNode < ::Prism::Node + # def initialize: (Integer flags, Node? left, Node? right, Location operator_loc, Location location) -> void # - # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode + # @return [FlipFlopNode] a new instance of FlipFlopNode # - # source://prism//prism/node.rb#7188 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#7032 + def initialize(source, flags, left, right, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7194 + # source://prism//lib/prism/node.rb#7043 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7199 + # source://prism//lib/prism/node.rb#7048 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7209 + # source://prism//lib/prism/node.rb#7061 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7204 + # source://prism//lib/prism/node.rb#7053 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableReadNode + # def copy: (**params) -> FlipFlopNode # - # source://prism//prism/node.rb#7214 + # source://prism//lib/prism/node.rb#7066 + sig { params(params: T.untyped).returns(Prism::FlipFlopNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7199 + # source://prism//lib/prism/node.rb#7048 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#7225 + # source://prism//lib/prism/node.rb#7081 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def exclude_end?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#7103 + sig { returns(T::Boolean) } + def exclude_end?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7230 + # source://prism//lib/prism/node.rb#7113 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # attr_reader left: Node? # - # source://prism//prism/node.rb#7185 - def name; end + # source://prism//lib/prism/node.rb#7090 + sig { returns(T.nilable(Prism::Node)) } + def left; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#7108 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7096 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader right: Node? + # + # source://prism//lib/prism/node.rb#7093 + sig { returns(T.nilable(Prism::Node)) } + def right; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -10824,9 +12061,17 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7250 + # source://prism//lib/prism/node.rb#7147 def type; end + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#7086 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10835,69 +12080,75 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7260 + # source://prism//lib/prism/node.rb#7157 def type; end end end -# Represents writing to a global variable in a context that doesn't have an explicit value. +# Represents a floating point number literal. # -# $foo, $bar = baz -# ^^^^ ^^^^ -class Prism::GlobalVariableTargetNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void +# 1.0 +# ^^^ +# +# source://prism//lib/prism/node.rb#7166 +class Prism::FloatNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode + # @return [FloatNode] a new instance of FloatNode # - # source://prism//prism/node.rb#7274 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#7168 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7280 + # source://prism//lib/prism/node.rb#7175 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7285 + # source://prism//lib/prism/node.rb#7180 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7295 + # source://prism//lib/prism/node.rb#7190 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7290 + # source://prism//lib/prism/node.rb#7185 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableTargetNode + # def copy: (**params) -> FloatNode # - # source://prism//prism/node.rb#7300 + # source://prism//lib/prism/node.rb#7195 + sig { params(params: T.untyped).returns(Prism::FloatNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7285 + # source://prism//lib/prism/node.rb#7180 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#7311 + # source://prism//lib/prism/node.rb#7206 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7316 + # source://prism//lib/prism/node.rb#7212 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#7271 - def name; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -10913,9 +12164,14 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7336 + # source://prism//lib/prism/node.rb#7231 def type; end + # Returns the value of the node as a Ruby Float. + # + # source://prism//lib/prism/node_ext.rb#62 + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -10924,83 +12180,140 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7346 + # source://prism//lib/prism/node.rb#7241 def type; end end end -# Represents writing to a global variable. +# Represents the use of the `for` keyword. # -# $foo = 1 -# ^^^^^^^^ -class Prism::GlobalVariableWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void +# for i in a end +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7250 +class Prism::ForNode < ::Prism::Node + # def initialize: (Node index, Node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc, Location location) -> void # - # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode + # @return [ForNode] a new instance of ForNode # - # source://prism//prism/node.rb#7369 - def initialize(name, name_loc, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#7252 + def initialize(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7378 + # source://prism//lib/prism/node.rb#7266 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7383 + # source://prism//lib/prism/node.rb#7271 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # attr_reader collection: Node + # + # source://prism//lib/prism/node.rb#7316 + sig { returns(Prism::Node) } + def collection; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7393 + # source://prism//lib/prism/node.rb#7285 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7388 + # source://prism//lib/prism/node.rb#7276 def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableWriteNode + # def copy: (**params) -> ForNode # - # source://prism//prism/node.rb#7398 + # source://prism//lib/prism/node.rb#7290 + sig { params(params: T.untyped).returns(Prism::ForNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7383 + # source://prism//lib/prism/node.rb#7271 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { index: Node, collection: Node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#7412 + # source://prism//lib/prism/node.rb#7308 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def do_keyword: () -> String? # - # source://prism//prism/node.rb#7422 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#7363 + sig { returns(T.nilable(String)) } + def do_keyword; end - # attr_reader name: Symbol + # attr_reader do_keyword_loc: Location? # - # source://prism//prism/node.rb#7357 - def name; end + # source://prism//lib/prism/node.rb#7334 + sig { returns(T.nilable(Prism::Location)) } + def do_keyword_loc; end - # attr_reader name_loc: Location + # def end_keyword: () -> String # - # source://prism//prism/node.rb#7360 - def name_loc; end + # source://prism//lib/prism/node.rb#7368 + sig { returns(String) } + def end_keyword; end - # def operator: () -> String + # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#7417 - def operator; end + # source://prism//lib/prism/node.rb#7346 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # attr_reader operator_loc: Location + # def for_keyword: () -> String # - # source://prism//prism/node.rb#7366 - def operator_loc; end + # source://prism//lib/prism/node.rb#7353 + sig { returns(String) } + def for_keyword; end + + # attr_reader for_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#7322 + sig { returns(Prism::Location) } + def for_keyword_loc; end + + # def in_keyword: () -> String + # + # source://prism//lib/prism/node.rb#7358 + sig { returns(String) } + def in_keyword; end + + # attr_reader in_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#7328 + sig { returns(Prism::Location) } + def in_keyword_loc; end + + # attr_reader index: Node + # + # source://prism//lib/prism/node.rb#7313 + sig { returns(Prism::Node) } + def index; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#7373 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#7319 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -11017,14 +12330,9 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7446 + # source://prism//lib/prism/node.rb#7406 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#7363 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -11033,89 +12341,77 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7456 + # source://prism//lib/prism/node.rb#7416 def type; end end end -# Represents a hash literal. +# Represents forwarding all arguments to this method to another method. # -# { a => b } -# ^^^^^^^^^^ -class Prism::HashNode < ::Prism::Node - # def initialize: (opening_loc: Location, elements: Array[Node], closing_loc: Location, location: Location) -> void +# def foo(...) +# bar(...) +# ^^^ +# end +# +# source://prism//lib/prism/node.rb#7427 +class Prism::ForwardingArgumentsNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [HashNode] a new instance of HashNode + # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode # - # source://prism//prism/node.rb#7476 - def initialize(opening_loc, elements, closing_loc, location); end + # source://prism//lib/prism/node.rb#7429 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7484 + # source://prism//lib/prism/node.rb#7436 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7489 + # source://prism//lib/prism/node.rb#7441 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#7527 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#7473 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7499 + # source://prism//lib/prism/node.rb#7451 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7494 + # source://prism//lib/prism/node.rb#7446 def compact_child_nodes; end - # def copy: (**params) -> HashNode + # def copy: (**params) -> ForwardingArgumentsNode # - # source://prism//prism/node.rb#7504 + # source://prism//lib/prism/node.rb#7456 + sig { params(params: T.untyped).returns(Prism::ForwardingArgumentsNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7489 + # source://prism//lib/prism/node.rb#7441 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#7517 + # source://prism//lib/prism/node.rb#7467 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] - # - # source://prism//prism/node.rb#7470 - def elements; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7532 + # source://prism//lib/prism/node.rb#7473 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String - # - # source://prism//prism/node.rb#7522 - def opening; end - - # attr_reader opening_loc: Location - # - # source://prism//prism/node.rb#7467 - def opening_loc; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -11131,7 +12427,7 @@ class Prism::HashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7554 + # source://prism//lib/prism/node.rb#7492 def type; end class << self @@ -11142,102 +12438,76 @@ class Prism::HashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7564 + # source://prism//lib/prism/node.rb#7502 def type; end end end -# Represents a hash pattern in pattern matching. +# Represents the use of the forwarding parameter in a method, block, or lambda declaration. # -# foo => { a: 1, b: 2 } -# ^^^^^^^^^^^^^^ +# def foo(...) +# ^^^ +# end # -# foo => { a: 1, b: 2, **c } -# ^^^^^^^^^^^^^^^^^^^ -class Prism::HashPatternNode < ::Prism::Node - # def initialize: (constant: Node?, elements: Array[Node], rest: Node?, opening_loc: Location?, closing_loc: Location?, location: Location) -> void +# source://prism//lib/prism/node.rb#7512 +class Prism::ForwardingParameterNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [HashPatternNode] a new instance of HashPatternNode + # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode # - # source://prism//prism/node.rb#7593 - def initialize(constant, elements, rest, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#7514 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7603 + # source://prism//lib/prism/node.rb#7521 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7608 + # source://prism//lib/prism/node.rb#7526 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism//prism/node.rb#7652 - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism//prism/node.rb#7590 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7622 + # source://prism//lib/prism/node.rb#7536 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7613 + # source://prism//lib/prism/node.rb#7531 def compact_child_nodes; end - # attr_reader constant: Node? - # - # source://prism//prism/node.rb#7578 - def constant; end - - # def copy: (**params) -> HashPatternNode + # def copy: (**params) -> ForwardingParameterNode # - # source://prism//prism/node.rb#7627 + # source://prism//lib/prism/node.rb#7541 + sig { params(params: T.untyped).returns(Prism::ForwardingParameterNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7608 + # source://prism//lib/prism/node.rb#7526 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#7642 + # source://prism//lib/prism/node.rb#7552 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] - # - # source://prism//prism/node.rb#7581 - def elements; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7657 + # source://prism//lib/prism/node.rb#7558 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String? - # - # source://prism//prism/node.rb#7647 - def opening; end - - # attr_reader opening_loc: Location? - # - # source://prism//prism/node.rb#7587 - def opening_loc; end - - # attr_reader rest: Node? - # - # source://prism//prism/node.rb#7584 - def rest; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -11253,7 +12523,7 @@ class Prism::HashPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7691 + # source://prism//lib/prism/node.rb#7577 def type; end class << self @@ -11264,123 +12534,202 @@ class Prism::HashPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7701 + # source://prism//lib/prism/node.rb#7587 def type; end end end -module Prism::HeredocQuery - # Returns true if this node was represented as a heredoc in the source code. - # - # @return [Boolean] - # - # source://prism//prism/node_ext.rb#37 - def heredoc?; end -end - -# Represents the use of the `if` keyword, either in the block form or the modifier form. +# Represents the use of the `super` keyword without parentheses or arguments. # -# bar if foo -# ^^^^^^^^^^ +# super +# ^^^^^ # -# if foo then bar end -# ^^^^^^^^^^^^^^^^^^^ -class Prism::IfNode < ::Prism::Node - # def initialize: (if_keyword_loc: Location?, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> void +# source://prism//lib/prism/node.rb#7596 +class Prism::ForwardingSuperNode < ::Prism::Node + # def initialize: (BlockNode? block, Location location) -> void # - # @return [IfNode] a new instance of IfNode + # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode # - # source://prism//prism/node.rb#7733 - def initialize(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#7598 + def initialize(source, block, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7744 + # source://prism//lib/prism/node.rb#7606 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader block: BlockNode? + # + # source://prism//lib/prism/node.rb#7645 + sig { returns(T.nilable(Prism::BlockNode)) } + def block; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7753 + # source://prism//lib/prism/node.rb#7611 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7767 + # source://prism//lib/prism/node.rb#7623 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7758 + # source://prism//lib/prism/node.rb#7616 def compact_child_nodes; end - # attr_reader consequent: Node? - # - # source://prism//prism/node.rb#7727 - def consequent; end - - # def copy: (**params) -> IfNode + # def copy: (**params) -> ForwardingSuperNode # - # source://prism//prism/node.rb#7772 + # source://prism//lib/prism/node.rb#7628 + sig { params(params: T.untyped).returns(Prism::ForwardingSuperNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7753 + # source://prism//lib/prism/node.rb#7611 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location } # - # source://prism//prism/node.rb#7788 + # source://prism//lib/prism/node.rb#7640 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def end_keyword: () -> String? - # - # source://prism//prism/node.rb#7803 - def end_keyword; end - - # attr_reader end_keyword_loc: Location? + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7730 - def end_keyword_loc; end + # source://prism//lib/prism/node.rb#7649 + def inspect(inspector = T.unsafe(nil)); end - # def if_keyword: () -> String? + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/node.rb#7793 - def if_keyword; end - - # attr_reader if_keyword_loc: Location? + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/node.rb#7715 - def if_keyword_loc; end - - # def inspect(inspector: NodeInspector) -> String + # def type: () -> Symbol # - # source://prism//prism/node.rb#7808 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#7674 + def type; end - # attr_reader predicate: Node + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#7684 + def type; end + end +end + +# Represents the use of the `&&=` operator for assignment to a global variable. +# +# $target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7693 +class Prism::GlobalVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # - # source://prism//prism/node.rb#7718 - def predicate; end + # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#7695 + def initialize(source, name, name_loc, operator_loc, value, location); end - # source://prism//prism/node.rb#7748 - def set_newline_flag(newline_marked); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#7706 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # attr_reader statements: StatementsNode? + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7724 - def statements; end + # source://prism//lib/prism/node.rb#7711 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # def then_keyword: () -> String? + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7798 - def then_keyword; end + # source://prism//lib/prism/node.rb#7721 + def comment_targets; end - # attr_reader then_keyword_loc: Location? + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7721 - def then_keyword_loc; end + # source://prism//lib/prism/node.rb#7716 + def compact_child_nodes; end + + # def copy: (**params) -> GlobalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#7726 + sig { params(params: T.untyped).returns(Prism::GlobalVariableAndWriteNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#7711 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } + # + # source://prism//lib/prism/node.rb#7741 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # source://prism//lib/prism/desugar_compiler.rb#161 + def desugar; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#7770 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#7746 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7749 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#7765 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7755 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -11397,9 +12746,15 @@ class Prism::IfNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7844 + # source://prism//lib/prism/node.rb#7794 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#7761 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -11408,68 +12763,101 @@ class Prism::IfNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7854 + # source://prism//lib/prism/node.rb#7804 def type; end end end -# Represents an imaginary number literal. +# Represents assigning to a global variable using an operator that isn't `=`. # -# 1.0i -# ^^^^ -class Prism::ImaginaryNode < ::Prism::Node - # def initialize: (numeric: Node, location: Location) -> void +# $target += value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#7813 +class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void # - # @return [ImaginaryNode] a new instance of ImaginaryNode + # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode # - # source://prism//prism/node.rb#7868 - def initialize(numeric, location); end + # source://prism//lib/prism/node.rb#7815 + def initialize(source, name, name_loc, operator_loc, value, operator, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7874 + # source://prism//lib/prism/node.rb#7827 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7879 + # source://prism//lib/prism/node.rb#7832 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7889 + # source://prism//lib/prism/node.rb#7842 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7884 + # source://prism//lib/prism/node.rb#7837 def compact_child_nodes; end - # def copy: (**params) -> ImaginaryNode + # def copy: (**params) -> GlobalVariableOperatorWriteNode # - # source://prism//prism/node.rb#7894 + # source://prism//lib/prism/node.rb#7847 + sig { params(params: T.untyped).returns(Prism::GlobalVariableOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7879 + # source://prism//lib/prism/node.rb#7832 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location } # - # source://prism//prism/node.rb#7905 + # source://prism//lib/prism/node.rb#7863 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#173 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#7910 + # source://prism//lib/prism/node.rb#7890 def inspect(inspector = T.unsafe(nil)); end - # attr_reader numeric: Node + # attr_reader name: Symbol # - # source://prism//prism/node.rb#7865 - def numeric; end + # source://prism//lib/prism/node.rb#7868 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7871 + sig { returns(Prism::Location) } + def name_loc; end + + # attr_reader operator: Symbol + # + # source://prism//lib/prism/node.rb#7886 + sig { returns(Symbol) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7877 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -11486,12 +12874,13 @@ class Prism::ImaginaryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#7931 + # source://prism//lib/prism/node.rb#7915 def type; end - # Returns the value of the node as a Ruby Complex. + # attr_reader value: Node # - # source://prism//prism/node_ext.rb#69 + # source://prism//lib/prism/node.rb#7883 + sig { returns(Prism::Node) } def value; end class << self @@ -11502,68 +12891,102 @@ class Prism::ImaginaryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#7941 + # source://prism//lib/prism/node.rb#7925 def type; end end end -# Represents a node that is implicitly being added to the tree but doesn't -# correspond directly to a node in the source. +# Represents the use of the `||=` operator for assignment to a global variable. # -# { foo: } -# ^^^^ +# $target ||= value +# ^^^^^^^^^^^^^^^^^ # -# { Foo: } -# ^^^^ -class Prism::ImplicitNode < ::Prism::Node - # def initialize: (value: Node, location: Location) -> void +# source://prism//lib/prism/node.rb#7934 +class Prism::GlobalVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # - # @return [ImplicitNode] a new instance of ImplicitNode + # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode # - # source://prism//prism/node.rb#7959 - def initialize(value, location); end + # source://prism//lib/prism/node.rb#7936 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#7965 + # source://prism//lib/prism/node.rb#7947 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7970 + # source://prism//lib/prism/node.rb#7952 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#7980 + # source://prism//lib/prism/node.rb#7962 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#7975 + # source://prism//lib/prism/node.rb#7957 def compact_child_nodes; end - # def copy: (**params) -> ImplicitNode + # def copy: (**params) -> GlobalVariableOrWriteNode # - # source://prism//prism/node.rb#7985 + # source://prism//lib/prism/node.rb#7967 + sig { params(params: T.untyped).returns(Prism::GlobalVariableOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#7970 + # source://prism//lib/prism/node.rb#7952 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#7996 + # source://prism//lib/prism/node.rb#7982 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#167 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8001 + # source://prism//lib/prism/node.rb#8011 def inspect(inspector = T.unsafe(nil)); end + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#7987 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#7990 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#8006 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#7996 + sig { returns(Prism::Location) } + def operator_loc; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -11579,12 +13002,13 @@ class Prism::ImplicitNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8022 + # source://prism//lib/prism/node.rb#8035 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#7956 + # source://prism//lib/prism/node.rb#8002 + sig { returns(Prism::Node) } def value; end class << self @@ -11595,73 +13019,85 @@ class Prism::ImplicitNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8032 + # source://prism//lib/prism/node.rb#8045 def type; end end end -# Represents using a trailing comma to indicate an implicit rest parameter. -# -# foo { |bar,| } -# ^ -# -# foo in [bar,] -# ^ +# Represents referencing a global variable. # -# for foo, in bar do end -# ^ +# $foo +# ^^^^ # -# foo, = bar -# ^ -class Prism::ImplicitRestNode < ::Prism::Node - # def initialize: (location: Location) -> void +# source://prism//lib/prism/node.rb#8054 +class Prism::GlobalVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [ImplicitRestNode] a new instance of ImplicitRestNode + # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode # - # source://prism//prism/node.rb#8052 - def initialize(location); end + # source://prism//lib/prism/node.rb#8056 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8057 + # source://prism//lib/prism/node.rb#8064 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8062 + # source://prism//lib/prism/node.rb#8069 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8072 + # source://prism//lib/prism/node.rb#8079 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8067 + # source://prism//lib/prism/node.rb#8074 def compact_child_nodes; end - # def copy: (**params) -> ImplicitRestNode + # def copy: (**params) -> GlobalVariableReadNode # - # source://prism//prism/node.rb#8077 + # source://prism//lib/prism/node.rb#8084 + sig { params(params: T.untyped).returns(Prism::GlobalVariableReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8062 + # source://prism//lib/prism/node.rb#8069 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#8087 + # source://prism//lib/prism/node.rb#8096 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8092 + # source://prism//lib/prism/node.rb#8109 def inspect(inspector = T.unsafe(nil)); end + # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. + # + # $foo # name `:$foo` + # + # $_Test # name `:$_Test` + # + # source://prism//lib/prism/node.rb#8105 + sig { returns(Symbol) } + def name; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -11677,7 +13113,7 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8111 + # source://prism//lib/prism/node.rb#8129 def type; end class << self @@ -11688,93 +13124,80 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8121 + # source://prism//lib/prism/node.rb#8139 def type; end end end -# Represents the use of the `in` keyword in a case statement. +# Represents writing to a global variable in a context that doesn't have an explicit value. # -# case a; in b then c end -# ^^^^^^^^^^^ -class Prism::InNode < ::Prism::Node - # def initialize: (pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location) -> void +# $foo, $bar = baz +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#8148 +class Prism::GlobalVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [InNode] a new instance of InNode + # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode # - # source://prism//prism/node.rb#8144 - def initialize(pattern, statements, in_loc, then_loc, location); end + # source://prism//lib/prism/node.rb#8150 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8153 + # source://prism//lib/prism/node.rb#8158 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8158 + # source://prism//lib/prism/node.rb#8163 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8171 + # source://prism//lib/prism/node.rb#8173 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8163 + # source://prism//lib/prism/node.rb#8168 def compact_child_nodes; end - # def copy: (**params) -> InNode + # def copy: (**params) -> GlobalVariableTargetNode # - # source://prism//prism/node.rb#8176 + # source://prism//lib/prism/node.rb#8178 + sig { params(params: T.untyped).returns(Prism::GlobalVariableTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8158 + # source://prism//lib/prism/node.rb#8163 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#8190 + # source://prism//lib/prism/node.rb#8190 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def in: () -> String - # - # source://prism//prism/node.rb#8195 - def in; end - - # attr_reader in_loc: Location - # - # source://prism//prism/node.rb#8138 - def in_loc; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8205 + # source://prism//lib/prism/node.rb#8199 def inspect(inspector = T.unsafe(nil)); end - # attr_reader pattern: Node - # - # source://prism//prism/node.rb#8132 - def pattern; end - - # attr_reader statements: StatementsNode? - # - # source://prism//prism/node.rb#8135 - def statements; end - - # def then: () -> String? - # - # source://prism//prism/node.rb#8200 - def then; end - - # attr_reader then_loc: Location? + # attr_reader name: Symbol # - # source://prism//prism/node.rb#8141 - def then_loc; end + # source://prism//lib/prism/node.rb#8195 + sig { returns(Symbol) } + def name; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -11791,7 +13214,7 @@ class Prism::InNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8234 + # source://prism//lib/prism/node.rb#8219 def type; end class << self @@ -11802,133 +13225,99 @@ class Prism::InNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8244 + # source://prism//lib/prism/node.rb#8229 def type; end end end -# Represents the use of the `&&=` operator on a call to the `[]` method. +# Represents writing to a global variable. # -# foo.bar[baz] &&= value -# ^^^^^^^^^^^^^^^^^^^^^^ -class Prism::IndexAndWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> void +# $foo = 1 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8238 +class Prism::GlobalVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void # - # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode + # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode # - # source://prism//prism/node.rb#8282 - def initialize(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#8240 + def initialize(source, name, name_loc, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8296 + # source://prism//lib/prism/node.rb#8251 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#8267 - def arguments; end - - # def attribute_write?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8355 - def attribute_write?; end - - # attr_reader block: Node? - # - # source://prism//prism/node.rb#8273 - def block; end - - # def call_operator: () -> String? - # - # source://prism//prism/node.rb#8360 - def call_operator; end - - # attr_reader call_operator_loc: Location? - # - # source://prism//prism/node.rb#8261 - def call_operator_loc; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8301 + # source://prism//lib/prism/node.rb#8256 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#8370 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#8270 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8316 + # source://prism//lib/prism/node.rb#8266 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8306 + # source://prism//lib/prism/node.rb#8261 def compact_child_nodes; end - # def copy: (**params) -> IndexAndWriteNode + # def copy: (**params) -> GlobalVariableWriteNode # - # source://prism//prism/node.rb#8321 + # source://prism//lib/prism/node.rb#8271 + sig { params(params: T.untyped).returns(Prism::GlobalVariableWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8301 + # source://prism//lib/prism/node.rb#8256 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#8340 + # source://prism//lib/prism/node.rb#8286 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8380 + # source://prism//lib/prism/node.rb#8315 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String + # attr_reader name: Symbol # - # source://prism//prism/node.rb#8365 - def opening; end + # source://prism//lib/prism/node.rb#8291 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#8264 - def opening_loc; end + # source://prism//lib/prism/node.rb#8294 + sig { returns(Prism::Location) } + def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#8375 + # source://prism//lib/prism/node.rb#8310 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#8276 + # source://prism//lib/prism/node.rb#8303 + sig { returns(Prism::Location) } def operator_loc; end - # attr_reader receiver: Node? - # - # source://prism//prism/node.rb#8258 - def receiver; end - - # def safe_navigation?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8345 - def safe_navigation?; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -11944,28 +13333,15 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8425 + # source://prism//lib/prism/node.rb#8339 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#8279 + # source://prism//lib/prism/node.rb#8300 + sig { returns(Prism::Node) } def value; end - # def variable_call?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8350 - def variable_call?; end - - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#8255 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -11974,132 +13350,116 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8435 + # source://prism//lib/prism/node.rb#8349 def type; end end end -# Represents the use of an assignment operator on a call to `[]`. +# Represents a hash literal. # -# foo.bar[baz] += value -# ^^^^^^^^^^^^^^^^^^^^^ -class Prism::IndexOperatorWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> void +# { a => b } +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8358 +class Prism::HashNode < ::Prism::Node + # def initialize: (Location opening_loc, Array[Node] elements, Location closing_loc, Location location) -> void # - # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode + # @return [HashNode] a new instance of HashNode # - # source://prism//prism/node.rb#8476 - def initialize(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#8360 + def initialize(source, opening_loc, elements, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8491 + # source://prism//lib/prism/node.rb#8370 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#8458 - def arguments; end - - # def attribute_write?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8551 - def attribute_write?; end - - # attr_reader block: Node? - # - # source://prism//prism/node.rb#8464 - def block; end - - # def call_operator: () -> String? - # - # source://prism//prism/node.rb#8556 - def call_operator; end - - # attr_reader call_operator_loc: Location? - # - # source://prism//prism/node.rb#8452 - def call_operator_loc; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8496 + # source://prism//lib/prism/node.rb#8375 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//prism/node.rb#8566 + # source://prism//lib/prism/node.rb#8442 + sig { returns(String) } def closing; end - # attr_reader closing_loc: Location + # The location of the closing brace. # - # source://prism//prism/node.rb#8461 + # { a => b } + # ^ + # + # source://prism//lib/prism/node.rb#8430 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8511 + # source://prism//lib/prism/node.rb#8385 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8501 + # source://prism//lib/prism/node.rb#8380 def compact_child_nodes; end - # def copy: (**params) -> IndexOperatorWriteNode + # def copy: (**params) -> HashNode # - # source://prism//prism/node.rb#8516 + # source://prism//lib/prism/node.rb#8390 + sig { params(params: T.untyped).returns(Prism::HashNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8496 + # source://prism//lib/prism/node.rb#8375 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[Node], closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#8536 + # source://prism//lib/prism/node.rb#8404 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#8571 - def inspect(inspector = T.unsafe(nil)); end - - # def opening: () -> String + # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. # - # source://prism//prism/node.rb#8561 - def opening; end - - # attr_reader opening_loc: Location + # { a: b } + # ^^^^ # - # source://prism//prism/node.rb#8455 - def opening_loc; end - - # attr_reader operator: Symbol + # { **foo } + # ^^^^^ # - # source://prism//prism/node.rb#8467 - def operator; end + # source://prism//lib/prism/node.rb#8424 + sig { returns(T::Array[Prism::Node]) } + def elements; end - # attr_reader operator_loc: Location + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8470 - def operator_loc; end + # source://prism//lib/prism/node.rb#8447 + def inspect(inspector = T.unsafe(nil)); end - # attr_reader receiver: Node? + # def opening: () -> String # - # source://prism//prism/node.rb#8449 - def receiver; end + # source://prism//lib/prism/node.rb#8437 + sig { returns(String) } + def opening; end - # def safe_navigation?: () -> bool + # The location of the opening brace. # - # @return [Boolean] + # { a => b } + # ^ # - # source://prism//prism/node.rb#8541 - def safe_navigation?; end + # source://prism//lib/prism/node.rb#8412 + sig { returns(Prism::Location) } + def opening_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -12116,28 +13476,9 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8617 + # source://prism//lib/prism/node.rb#8469 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#8473 - def value; end - - # def variable_call?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8546 - def variable_call?; end - - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#8446 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -12146,132 +13487,119 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8627 + # source://prism//lib/prism/node.rb#8479 def type; end end end -# Represents the use of the `||=` operator on a call to `[]`. +# Represents a hash pattern in pattern matching. # -# foo.bar[baz] ||= value -# ^^^^^^^^^^^^^^^^^^^^^^ -class Prism::IndexOrWriteNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> void +# foo => { a: 1, b: 2 } +# ^^^^^^^^^^^^^^ +# +# foo => { a: 1, b: 2, **c } +# ^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#8491 +class Prism::HashPatternNode < ::Prism::Node + # def initialize: (Node? constant, Array[Node] elements, Node? rest, Location? opening_loc, Location? closing_loc, Location location) -> void # - # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode + # @return [HashPatternNode] a new instance of HashPatternNode # - # source://prism//prism/node.rb#8665 - def initialize(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#8493 + def initialize(source, constant, elements, rest, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8679 + # source://prism//lib/prism/node.rb#8505 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#8650 - def arguments; end - - # def attribute_write?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8738 - def attribute_write?; end - - # attr_reader block: Node? - # - # source://prism//prism/node.rb#8656 - def block; end - - # def call_operator: () -> String? - # - # source://prism//prism/node.rb#8743 - def call_operator; end - - # attr_reader call_operator_loc: Location? - # - # source://prism//prism/node.rb#8644 - def call_operator_loc; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8684 + # source://prism//lib/prism/node.rb#8510 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String + # def closing: () -> String? # - # source://prism//prism/node.rb#8753 + # source://prism//lib/prism/node.rb#8589 + sig { returns(T.nilable(String)) } def closing; end - # attr_reader closing_loc: Location + # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#8653 + # source://prism//lib/prism/node.rb#8571 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8699 + # source://prism//lib/prism/node.rb#8524 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8689 + # source://prism//lib/prism/node.rb#8515 def compact_child_nodes; end - # def copy: (**params) -> IndexOrWriteNode + # attr_reader constant: Node? + # + # source://prism//lib/prism/node.rb#8550 + sig { returns(T.nilable(Prism::Node)) } + def constant; end + + # def copy: (**params) -> HashPatternNode # - # source://prism//prism/node.rb#8704 + # source://prism//lib/prism/node.rb#8529 + sig { params(params: T.untyped).returns(Prism::HashPatternNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8684 + # source://prism//lib/prism/node.rb#8510 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, elements: Array[Node], rest: Node?, opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#8723 + # source://prism//lib/prism/node.rb#8545 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # attr_reader elements: Array[Node] + # + # source://prism//lib/prism/node.rb#8553 + sig { returns(T::Array[Prism::Node]) } + def elements; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#8763 + # source://prism//lib/prism/node.rb#8594 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String + # def opening: () -> String? # - # source://prism//prism/node.rb#8748 + # source://prism//lib/prism/node.rb#8584 + sig { returns(T.nilable(String)) } def opening; end - # attr_reader opening_loc: Location + # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#8647 + # source://prism//lib/prism/node.rb#8559 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # def operator: () -> String - # - # source://prism//prism/node.rb#8758 - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#8659 - def operator_loc; end - - # attr_reader receiver: Node? - # - # source://prism//prism/node.rb#8641 - def receiver; end - - # def safe_navigation?: () -> bool - # - # @return [Boolean] + # attr_reader rest: Node? # - # source://prism//prism/node.rb#8728 - def safe_navigation?; end + # source://prism//lib/prism/node.rb#8556 + sig { returns(T.nilable(Prism::Node)) } + def rest; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -12288,28 +13616,9 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8808 + # source://prism//lib/prism/node.rb#8628 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#8662 - def value; end - - # def variable_call?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8733 - def variable_call?; end - - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#8638 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -12318,120 +13627,144 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8818 + # source://prism//lib/prism/node.rb#8638 def type; end end end -# Represents assigning to an index. +# source://prism//lib/prism/node_ext.rb#35 +module Prism::HeredocQuery + # Returns true if this node was represented as a heredoc in the source code. + # + # @return [Boolean] + # + # source://prism//lib/prism/node_ext.rb#37 + def heredoc?; end +end + +# Represents the use of the `if` keyword, either in the block form or the modifier form. # -# foo[bar], = 1 -# ^^^^^^^^ +# bar if foo +# ^^^^^^^^^^ # -# begin -# rescue => foo[bar] -# ^^^^^^^^ -# end +# if foo then bar end +# ^^^^^^^^^^^^^^^^^^^ # -# for foo[bar] in baz do end -# ^^^^^^^^ -class Prism::IndexTargetNode < ::Prism::Node - # def initialize: (flags: Integer, receiver: Node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, location: Location) -> void +# source://prism//lib/prism/node.rb#8650 +class Prism::IfNode < ::Prism::Node + # def initialize: (Location? if_keyword_loc, Node predicate, Location? then_keyword_loc, StatementsNode? statements, Node? consequent, Location? end_keyword_loc, Location location) -> void # - # @return [IndexTargetNode] a new instance of IndexTargetNode + # @return [IfNode] a new instance of IfNode # - # source://prism//prism/node.rb#8855 - def initialize(flags, receiver, opening_loc, arguments, closing_loc, block, location); end + # source://prism//lib/prism/node.rb#8652 + def initialize(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#8866 + # source://prism//lib/prism/node.rb#8665 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#8846 - def arguments; end - - # def attribute_write?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8921 - def attribute_write?; end - - # attr_reader block: Node? - # - # source://prism//prism/node.rb#8852 - def block; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8871 + # source://prism//lib/prism/node.rb#8674 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#8931 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#8849 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#8885 + # source://prism//lib/prism/node.rb#8688 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#8876 + # source://prism//lib/prism/node.rb#8679 def compact_child_nodes; end - # def copy: (**params) -> IndexTargetNode + # attr_reader consequent: Node? + # + # source://prism//lib/prism/node.rb#8745 + sig { returns(T.nilable(Prism::Node)) } + def consequent; end + + # def copy: (**params) -> IfNode # - # source://prism//prism/node.rb#8890 + # source://prism//lib/prism/node.rb#8693 + sig { params(params: T.untyped).returns(Prism::IfNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#8871 + # source://prism//lib/prism/node.rb#8674 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { if_keyword_loc: Location?, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location } # - # source://prism//prism/node.rb#8906 + # source://prism//lib/prism/node.rb#8710 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def end_keyword: () -> String? # - # source://prism//prism/node.rb#8936 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#8771 + sig { returns(T.nilable(String)) } + def end_keyword; end - # def opening: () -> String + # attr_reader end_keyword_loc: Location? # - # source://prism//prism/node.rb#8926 - def opening; end + # source://prism//lib/prism/node.rb#8748 + sig { returns(T.nilable(Prism::Location)) } + def end_keyword_loc; end - # attr_reader opening_loc: Location + # def if_keyword: () -> String? # - # source://prism//prism/node.rb#8843 - def opening_loc; end + # source://prism//lib/prism/node.rb#8761 + sig { returns(T.nilable(String)) } + def if_keyword; end - # attr_reader receiver: Node + # attr_reader if_keyword_loc: Location? # - # source://prism//prism/node.rb#8840 - def receiver; end + # source://prism//lib/prism/node.rb#8715 + sig { returns(T.nilable(Prism::Location)) } + def if_keyword_loc; end - # def safe_navigation?: () -> bool + # def inspect(NodeInspector inspector) -> String # - # @return [Boolean] + # source://prism//lib/prism/node.rb#8776 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader predicate: Node # - # source://prism//prism/node.rb#8911 - def safe_navigation?; end + # source://prism//lib/prism/node.rb#8727 + sig { returns(Prism::Node) } + def predicate; end + + # source://prism//lib/prism/node.rb#8669 + def set_newline_flag(newline_marked); end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#8742 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then_keyword: () -> String? + # + # source://prism//lib/prism/node.rb#8766 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # attr_reader then_keyword_loc: Location? + # + # source://prism//lib/prism/node.rb#8730 + sig { returns(T.nilable(Prism::Location)) } + def then_keyword_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -12448,23 +13781,9 @@ class Prism::IndexTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#8973 + # source://prism//lib/prism/node.rb#8812 def type; end - # def variable_call?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#8916 - def variable_call?; end - - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#8837 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -12473,100 +13792,80 @@ class Prism::IndexTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#8983 + # source://prism//lib/prism/node.rb#8822 def type; end end end -# InlineComment objects are the most common. They correspond to comments in -# the source file like this one that start with #. -class Prism::InlineComment < ::Prism::Comment - # Returns a string representation of this comment. - # - # source://prism//prism/parse_result.rb#253 - def inspect; end - - # Returns true if this comment happens on the same line as other code and - # false if the comment is by itself. - # - # @return [Boolean] - # - # source://prism//prism/parse_result.rb#248 - def trailing?; end -end - -# Represents the use of the `&&=` operator for assignment to an instance variable. +# Represents an imaginary number literal. # -# @target &&= value -# ^^^^^^^^^^^^^^^^^ -class Prism::InstanceVariableAndWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void +# 1.0i +# ^^^^ +# +# source://prism//lib/prism/node.rb#8831 +class Prism::ImaginaryNode < ::Prism::Node + # def initialize: (Node numeric, Location location) -> void # - # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode + # @return [ImaginaryNode] a new instance of ImaginaryNode # - # source://prism//prism/node.rb#9006 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#8833 + def initialize(source, numeric, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9015 + # source://prism//lib/prism/node.rb#8841 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9020 + # source://prism//lib/prism/node.rb#8846 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9030 + # source://prism//lib/prism/node.rb#8856 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9025 + # source://prism//lib/prism/node.rb#8851 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableAndWriteNode + # def copy: (**params) -> ImaginaryNode # - # source://prism//prism/node.rb#9035 + # source://prism//lib/prism/node.rb#8861 + sig { params(params: T.untyped).returns(Prism::ImaginaryNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9020 + # source://prism//lib/prism/node.rb#8846 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Node, location: Location } # - # source://prism//prism/node.rb#9049 + # source://prism//lib/prism/node.rb#8873 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9059 + # source://prism//lib/prism/node.rb#8882 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#8994 - def name; end - - # attr_reader name_loc: Location - # - # source://prism//prism/node.rb#8997 - def name_loc; end - - # def operator: () -> String - # - # source://prism//prism/node.rb#9054 - def operator; end - - # attr_reader operator_loc: Location + # attr_reader numeric: Node # - # source://prism//prism/node.rb#9000 - def operator_loc; end + # source://prism//lib/prism/node.rb#8878 + sig { returns(Prism::Node) } + def numeric; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -12583,12 +13882,12 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9083 + # source://prism//lib/prism/node.rb#8903 def type; end - # attr_reader value: Node + # Returns the value of the node as a Ruby Complex. # - # source://prism//prism/node.rb#9003 + # source://prism//lib/prism/node_ext.rb#69 def value; end class << self @@ -12599,84 +13898,81 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9093 + # source://prism//lib/prism/node.rb#8913 def type; end end end -# Represents assigning to an instance variable using an operator that isn't `=`. +# Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source. # -# @target += value -# ^^^^^^^^^^^^^^^^ -class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void +# { foo: } +# ^^^^ +# +# { Foo: } +# ^^^^ +# +# foo in { bar: } +# ^^^^ +# +# source://prism//lib/prism/node.rb#8928 +class Prism::ImplicitNode < ::Prism::Node + # def initialize: (Node value, Location location) -> void # - # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode + # @return [ImplicitNode] a new instance of ImplicitNode # - # source://prism//prism/node.rb#9119 - def initialize(name, name_loc, operator_loc, value, operator, location); end + # source://prism//lib/prism/node.rb#8930 + def initialize(source, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9129 + # source://prism//lib/prism/node.rb#8938 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9134 + # source://prism//lib/prism/node.rb#8943 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9144 + # source://prism//lib/prism/node.rb#8953 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9139 + # source://prism//lib/prism/node.rb#8948 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableOperatorWriteNode + # def copy: (**params) -> ImplicitNode # - # source://prism//prism/node.rb#9149 + # source://prism//lib/prism/node.rb#8958 + sig { params(params: T.untyped).returns(Prism::ImplicitNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9134 + # source://prism//lib/prism/node.rb#8943 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, location: Location } # - # source://prism//prism/node.rb#9164 + # source://prism//lib/prism/node.rb#8970 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9169 + # source://prism//lib/prism/node.rb#8979 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#9104 - def name; end - - # attr_reader name_loc: Location - # - # source://prism//prism/node.rb#9107 - def name_loc; end - - # attr_reader operator: Symbol - # - # source://prism//prism/node.rb#9116 - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#9110 - def operator_loc; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -12692,12 +13988,13 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9194 + # source://prism//lib/prism/node.rb#9000 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#9113 + # source://prism//lib/prism/node.rb#8975 + sig { returns(Prism::Node) } def value; end class << self @@ -12708,84 +14005,84 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9204 + # source://prism//lib/prism/node.rb#9010 def type; end end end -# Represents the use of the `||=` operator for assignment to an instance variable. +# Represents using a trailing comma to indicate an implicit rest parameter. # -# @target ||= value -# ^^^^^^^^^^^^^^^^^ -class Prism::InstanceVariableOrWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void +# foo { |bar,| } +# ^ +# +# foo in [bar,] +# ^ +# +# for foo, in bar do end +# ^ +# +# foo, = bar +# ^ +# +# source://prism//lib/prism/node.rb#9028 +class Prism::ImplicitRestNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode + # @return [ImplicitRestNode] a new instance of ImplicitRestNode # - # source://prism//prism/node.rb#9227 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/node.rb#9030 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9236 + # source://prism//lib/prism/node.rb#9037 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9241 + # source://prism//lib/prism/node.rb#9042 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9251 + # source://prism//lib/prism/node.rb#9052 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9246 + # source://prism//lib/prism/node.rb#9047 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableOrWriteNode + # def copy: (**params) -> ImplicitRestNode # - # source://prism//prism/node.rb#9256 + # source://prism//lib/prism/node.rb#9057 + sig { params(params: T.untyped).returns(Prism::ImplicitRestNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9241 + # source://prism//lib/prism/node.rb#9042 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#9270 + # source://prism//lib/prism/node.rb#9068 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9280 + # source://prism//lib/prism/node.rb#9074 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#9215 - def name; end - - # attr_reader name_loc: Location - # - # source://prism//prism/node.rb#9218 - def name_loc; end - - # def operator: () -> String - # - # source://prism//prism/node.rb#9275 - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#9221 - def operator_loc; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -12801,14 +14098,9 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9304 + # source://prism//lib/prism/node.rb#9093 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#9224 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -12817,68 +14109,110 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9314 + # source://prism//lib/prism/node.rb#9103 def type; end end end -# Represents referencing an instance variable. +# Represents the use of the `in` keyword in a case statement. # -# @foo -# ^^^^ -class Prism::InstanceVariableReadNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void +# case a; in b then c end +# ^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9112 +class Prism::InNode < ::Prism::Node + # def initialize: (Node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void # - # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode + # @return [InNode] a new instance of InNode # - # source://prism//prism/node.rb#9328 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#9114 + def initialize(source, pattern, statements, in_loc, then_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9334 + # source://prism//lib/prism/node.rb#9125 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9339 + # source://prism//lib/prism/node.rb#9130 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9349 + # source://prism//lib/prism/node.rb#9143 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9344 + # source://prism//lib/prism/node.rb#9135 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableReadNode + # def copy: (**params) -> InNode # - # source://prism//prism/node.rb#9354 + # source://prism//lib/prism/node.rb#9148 + sig { params(params: T.untyped).returns(Prism::InNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9339 + # source://prism//lib/prism/node.rb#9130 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } # - # source://prism//prism/node.rb#9365 + # source://prism//lib/prism/node.rb#9163 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def in: () -> String + # + # source://prism//lib/prism/node.rb#9193 + sig { returns(String) } + def in; end + + # attr_reader in_loc: Location + # + # source://prism//lib/prism/node.rb#9174 + sig { returns(Prism::Location) } + def in_loc; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9370 + # source://prism//lib/prism/node.rb#9203 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # attr_reader pattern: Node # - # source://prism//prism/node.rb#9325 - def name; end + # source://prism//lib/prism/node.rb#9168 + sig { returns(Prism::Node) } + def pattern; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#9171 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end + + # def then: () -> String? + # + # source://prism//lib/prism/node.rb#9198 + sig { returns(T.nilable(String)) } + def then; end + + # attr_reader then_loc: Location? + # + # source://prism//lib/prism/node.rb#9180 + sig { returns(T.nilable(Prism::Location)) } + def then_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -12895,7 +14229,7 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9390 + # source://prism//lib/prism/node.rb#9232 def type; end class << self @@ -12906,87 +14240,205 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9400 + # source://prism//lib/prism/node.rb#9242 def type; end end end -# Represents writing to an instance variable in a context that doesn't have an explicit value. +# Represents the use of the `&&=` operator on a call to the `[]` method. # -# @foo, @bar = baz -# ^^^^ ^^^^ -class Prism::InstanceVariableTargetNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void +# foo.bar[baz] &&= value +# ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9251 +class Prism::IndexAndWriteNode < ::Prism::Node + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location operator_loc, Node value, Location location) -> void # - # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode + # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode # - # source://prism//prism/node.rb#9414 - def initialize(name, location); end + # source://prism//lib/prism/node.rb#9253 + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9420 + # source://prism//lib/prism/node.rb#9269 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9344 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9376 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Node? + # + # source://prism//lib/prism/node.rb#9353 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#9386 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#9326 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9425 + # source://prism//lib/prism/node.rb#9274 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9396 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9347 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9435 + # source://prism//lib/prism/node.rb#9289 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9430 + # source://prism//lib/prism/node.rb#9279 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableTargetNode + # def copy: (**params) -> IndexAndWriteNode # - # source://prism//prism/node.rb#9440 + # source://prism//lib/prism/node.rb#9294 + sig { params(params: T.untyped).returns(Prism::IndexAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9425 + # source://prism//lib/prism/node.rb#9274 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#9451 + # source://prism//lib/prism/node.rb#9314 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool # - # source://prism//prism/node.rb#9456 - def inspect(inspector = T.unsafe(nil)); end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9381 + sig { returns(T::Boolean) } + def ignore_visibility?; end - # attr_reader name: Symbol + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9411 - def name; end + # source://prism//lib/prism/node.rb#9406 + def inspect(inspector = T.unsafe(nil)); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # def opening: () -> String # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/node.rb#9391 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9338 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#9401 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#9356 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Node? + # + # source://prism//lib/prism/node.rb#9323 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9366 + sig { returns(T::Boolean) } + def safe_navigation?; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # # def type: () -> Symbol # - # source://prism//prism/node.rb#9476 + # source://prism//lib/prism/node.rb#9451 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#9362 + sig { returns(Prism::Node) } + def value; end + + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9371 + sig { returns(T::Boolean) } + def variable_call?; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9319 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -12995,84 +14447,165 @@ class Prism::InstanceVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9486 + # source://prism//lib/prism/node.rb#9461 def type; end end end -# Represents writing to an instance variable. +# Represents the use of an assignment operator on a call to `[]`. # -# @foo = 1 -# ^^^^^^^^ -class Prism::InstanceVariableWriteNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void +# foo.bar[baz] += value +# ^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9470 +class Prism::IndexOperatorWriteNode < ::Prism::Node + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Symbol operator, Location operator_loc, Node value, Location location) -> void # - # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode + # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode # - # source://prism//prism/node.rb#9509 - def initialize(name, name_loc, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#9472 + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9518 + # source://prism//lib/prism/node.rb#9489 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9565 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9600 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Node? + # + # source://prism//lib/prism/node.rb#9574 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def call_operator: () -> String? + # + # source://prism//lib/prism/node.rb#9610 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? + # + # source://prism//lib/prism/node.rb#9547 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9523 + # source://prism//lib/prism/node.rb#9494 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9620 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9568 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9533 + # source://prism//lib/prism/node.rb#9509 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9528 + # source://prism//lib/prism/node.rb#9499 def compact_child_nodes; end - # def copy: (**params) -> InstanceVariableWriteNode + # def copy: (**params) -> IndexOperatorWriteNode # - # source://prism//prism/node.rb#9538 + # source://prism//lib/prism/node.rb#9514 + sig { params(params: T.untyped).returns(Prism::IndexOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9523 + # source://prism//lib/prism/node.rb#9494 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator: Symbol, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#9552 + # source://prism//lib/prism/node.rb#9535 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def ignore_visibility?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9605 + sig { returns(T::Boolean) } + def ignore_visibility?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9562 + # source://prism//lib/prism/node.rb#9625 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # def opening: () -> String # - # source://prism//prism/node.rb#9497 - def name; end + # source://prism//lib/prism/node.rb#9615 + sig { returns(String) } + def opening; end - # attr_reader name_loc: Location + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#9500 - def name_loc; end + # source://prism//lib/prism/node.rb#9559 + sig { returns(Prism::Location) } + def opening_loc; end - # def operator: () -> String + # attr_reader operator: Symbol # - # source://prism//prism/node.rb#9557 + # source://prism//lib/prism/node.rb#9577 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#9506 + # source://prism//lib/prism/node.rb#9580 + sig { returns(Prism::Location) } def operator_loc; end + # attr_reader receiver: Node? + # + # source://prism//lib/prism/node.rb#9544 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9590 + sig { returns(T::Boolean) } + def safe_navigation?; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -13088,14 +14621,31 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9586 + # source://prism//lib/prism/node.rb#9671 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#9503 + # source://prism//lib/prism/node.rb#9586 + sig { returns(Prism::Node) } def value; end + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9595 + sig { returns(T::Boolean) } + def variable_call?; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#9540 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -13104,114 +14654,164 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9596 + # source://prism//lib/prism/node.rb#9681 def type; end end end -# Flags for integer nodes that correspond to the base of the integer. -module Prism::IntegerBaseFlags; end - -# 0b prefix +# Represents the use of the `||=` operator on a call to `[]`. # -# source://prism//prism/node.rb#17312 -Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) - -# 0d or no prefix +# foo.bar[baz] ||= value +# ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//prism/node.rb#17315 -Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) +# source://prism//lib/prism/node.rb#9690 +class Prism::IndexOrWriteNode < ::Prism::Node + # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location operator_loc, Node value, Location location) -> void + # + # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode + # + # source://prism//lib/prism/node.rb#9692 + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end -# 0x prefix -# -# source://prism//prism/node.rb#17321 -Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#9708 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end -# 0o or 0 prefix -# -# source://prism//prism/node.rb#17318 -Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9783 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end -# Represents an integer number literal. -# -# 1 -# ^ -class Prism::IntegerNode < ::Prism::Node - # def initialize: (flags: Integer, location: Location) -> void + # def attribute_write?: () -> bool # - # @return [IntegerNode] a new instance of IntegerNode + # @return [Boolean] # - # source://prism//prism/node.rb#9610 - def initialize(flags, location); end + # source://prism//lib/prism/node.rb#9815 + sig { returns(T::Boolean) } + def attribute_write?; end - # def accept: (visitor: Visitor) -> void + # attr_reader block: Node? # - # source://prism//prism/node.rb#9616 - def accept(visitor); end + # source://prism//lib/prism/node.rb#9792 + sig { returns(T.nilable(Prism::Node)) } + def block; end - # def binary?: () -> bool + # def call_operator: () -> String? # - # @return [Boolean] + # source://prism//lib/prism/node.rb#9825 + sig { returns(T.nilable(String)) } + def call_operator; end + + # attr_reader call_operator_loc: Location? # - # source://prism//prism/node.rb#9652 - def binary?; end + # source://prism//lib/prism/node.rb#9765 + sig { returns(T.nilable(Prism::Location)) } + def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9621 + # source://prism//lib/prism/node.rb#9713 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#9835 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#9786 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9631 + # source://prism//lib/prism/node.rb#9728 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9626 + # source://prism//lib/prism/node.rb#9718 def compact_child_nodes; end - # def copy: (**params) -> IntegerNode + # def copy: (**params) -> IndexOrWriteNode # - # source://prism//prism/node.rb#9636 + # source://prism//lib/prism/node.rb#9733 + sig { params(params: T.untyped).returns(Prism::IndexOrWriteNode) } def copy(**params); end - # def decimal?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9657 - def decimal?; end - # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9621 + # source://prism//lib/prism/node.rb#9713 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#9647 + # source://prism//lib/prism/node.rb#9753 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def hexadecimal?: () -> bool + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#9667 - def hexadecimal?; end + # source://prism//lib/prism/node.rb#9820 + sig { returns(T::Boolean) } + def ignore_visibility?; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9672 + # source://prism//lib/prism/node.rb#9845 def inspect(inspector = T.unsafe(nil)); end - # def octal?: () -> bool + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#9830 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#9777 + sig { returns(Prism::Location) } + def opening_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#9840 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#9795 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader receiver: Node? + # + # source://prism//lib/prism/node.rb#9762 + sig { returns(T.nilable(Prism::Node)) } + def receiver; end + + # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#9662 - def octal?; end + # source://prism//lib/prism/node.rb#9805 + sig { returns(T::Boolean) } + def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13228,19 +14828,29 @@ class Prism::IntegerNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9693 + # source://prism//lib/prism/node.rb#9890 def type; end - # Returns the value of the node as a Ruby Integer. + # attr_reader value: Node # - # source://prism//prism/node_ext.rb#76 + # source://prism//lib/prism/node.rb#9801 + sig { returns(Prism::Node) } def value; end + # def variable_call?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#9810 + sig { returns(T::Boolean) } + def variable_call?; end + private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#9607 + # source://prism//lib/prism/node.rb#9758 + sig { returns(Integer) } def flags; end class << self @@ -13251,158 +14861,148 @@ class Prism::IntegerNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9703 + # source://prism//lib/prism/node.rb#9900 def type; end end end -# Represents a regular expression literal that contains interpolation that -# is being used in the predicate of a conditional to implicitly match -# against the last line read by an IO object. +# Represents assigning to an index. # -# if /foo #{bar} baz/ then end -# ^^^^^^^^^^^^^^^^ -class Prism::InterpolatedMatchLastLineNode < ::Prism::Node - include ::Prism::RegularExpressionOptions - - # def initialize: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void +# foo[bar], = 1 +# ^^^^^^^^ +# +# begin +# rescue => foo[bar] +# ^^^^^^^^ +# end +# +# for foo[bar] in baz do end +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9917 +class Prism::IndexTargetNode < ::Prism::Node + # def initialize: (Integer flags, Node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location location) -> void # - # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode + # @return [IndexTargetNode] a new instance of IndexTargetNode # - # source://prism//prism/node.rb#9728 - def initialize(flags, opening_loc, parts, closing_loc, location); end + # source://prism//lib/prism/node.rb#9919 + def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#9737 + # source://prism//lib/prism/node.rb#9932 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # def ascii_8bit?: () -> bool + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#9991 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#9806 - def ascii_8bit?; end + # source://prism//lib/prism/node.rb#10014 + sig { returns(T::Boolean) } + def attribute_write?; end + + # attr_reader block: Node? + # + # source://prism//lib/prism/node.rb#10000 + sig { returns(T.nilable(Prism::Node)) } + def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9747 + # source://prism//lib/prism/node.rb#9937 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//prism/node.rb#9841 + # source://prism//lib/prism/node.rb#10029 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//prism/node.rb#9725 + # source://prism//lib/prism/node.rb#9994 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9757 + # source://prism//lib/prism/node.rb#9951 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9752 + # source://prism//lib/prism/node.rb#9942 def compact_child_nodes; end - # def copy: (**params) -> InterpolatedMatchLastLineNode + # def copy: (**params) -> IndexTargetNode # - # source://prism//prism/node.rb#9762 + # source://prism//lib/prism/node.rb#9956 + sig { params(params: T.untyped).returns(Prism::IndexTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9747 + # source://prism//lib/prism/node.rb#9937 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, location: Location } # - # source://prism//prism/node.rb#9776 + # source://prism//lib/prism/node.rb#9973 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9801 - def euc_jp?; end - - # def extended?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9786 - def extended?; end - - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9826 - def forced_binary_encoding?; end - - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9831 - def forced_us_ascii_encoding?; end - - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9821 - def forced_utf8_encoding?; end - - # def ignore_case?: () -> bool + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#9781 - def ignore_case?; end + # source://prism//lib/prism/node.rb#10019 + sig { returns(T::Boolean) } + def ignore_visibility?; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#9846 + # source://prism//lib/prism/node.rb#10034 def inspect(inspector = T.unsafe(nil)); end - # def multi_line?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9791 - def multi_line?; end - - # def once?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9796 - def once?; end - # def opening: () -> String # - # source://prism//prism/node.rb#9836 + # source://prism//lib/prism/node.rb#10024 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#9719 + # source://prism//lib/prism/node.rb#9985 + sig { returns(Prism::Location) } def opening_loc; end - # attr_reader parts: Array[Node] + # attr_reader receiver: Node # - # source://prism//prism/node.rb#9722 - def parts; end + # source://prism//lib/prism/node.rb#9982 + sig { returns(Prism::Node) } + def receiver; end - # source://prism//prism/node.rb#9741 - def set_newline_flag(newline_marked); end + # def safe_navigation?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10004 + sig { returns(T::Boolean) } + def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13419,28 +15019,23 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#9870 + # source://prism//lib/prism/node.rb#10071 def type; end - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9816 - def utf_8?; end - - # def windows_31j?: () -> bool + # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#9811 - def windows_31j?; end + # source://prism//lib/prism/node.rb#10009 + sig { returns(T::Boolean) } + def variable_call?; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#9716 + # source://prism//lib/prism/node.rb#9978 + sig { returns(Integer) } def flags; end class << self @@ -13451,156 +15046,121 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#9880 + # source://prism//lib/prism/node.rb#10081 def type; end end end -# Represents a regular expression literal that contains interpolation. +# InlineComment objects are the most common. They correspond to comments in +# the source file like this one that start with #. # -# /foo #{bar} baz/ -# ^^^^^^^^^^^^^^^^ -class Prism::InterpolatedRegularExpressionNode < ::Prism::Node - include ::Prism::RegularExpressionOptions - - # def initialize: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void - # - # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode - # - # source://prism//prism/node.rb#9903 - def initialize(flags, opening_loc, parts, closing_loc, location); end - - # def accept: (visitor: Visitor) -> void +# source://prism//lib/prism/parse_result.rb#275 +class Prism::InlineComment < ::Prism::Comment + # Returns a string representation of this comment. # - # source://prism//prism/node.rb#9912 - def accept(visitor); end + # source://prism//lib/prism/parse_result.rb#283 + def inspect; end - # def ascii_8bit?: () -> bool + # Returns true if this comment happens on the same line as other code and + # false if the comment is by itself. # # @return [Boolean] # - # source://prism//prism/node.rb#9981 - def ascii_8bit?; end + # source://prism//lib/prism/parse_result.rb#278 + sig { override.returns(T::Boolean) } + def trailing?; end +end - # def child_nodes: () -> Array[nil | Node] +# Represents the use of the `&&=` operator for assignment to an instance variable. +# +# @target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10090 +class Prism::InstanceVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # - # source://prism//prism/node.rb#9922 - def child_nodes; end + # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#10092 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def closing: () -> String + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10016 - def closing; end + # source://prism//lib/prism/node.rb#10103 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # attr_reader closing_loc: Location + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9900 - def closing_loc; end + # source://prism//lib/prism/node.rb#10108 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#9932 + # source://prism//lib/prism/node.rb#10118 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#9927 + # source://prism//lib/prism/node.rb#10113 def compact_child_nodes; end - # def copy: (**params) -> InterpolatedRegularExpressionNode + # def copy: (**params) -> InstanceVariableAndWriteNode # - # source://prism//prism/node.rb#9937 + # source://prism//lib/prism/node.rb#10123 + sig { params(params: T.untyped).returns(Prism::InstanceVariableAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#9922 + # source://prism//lib/prism/node.rb#10108 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#9951 + # source://prism//lib/prism/node.rb#10138 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9976 - def euc_jp?; end - - # def extended?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9961 - def extended?; end - - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#10001 - def forced_binary_encoding?; end - - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#10006 - def forced_us_ascii_encoding?; end - - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9996 - def forced_utf8_encoding?; end - - # def ignore_case?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9956 - def ignore_case?; end + # source://prism//lib/prism/desugar_compiler.rb#179 + def desugar; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10021 + # source://prism//lib/prism/node.rb#10167 def inspect(inspector = T.unsafe(nil)); end - # def multi_line?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9966 - def multi_line?; end - - # def once?: () -> bool - # - # @return [Boolean] + # attr_reader name: Symbol # - # source://prism//prism/node.rb#9971 - def once?; end + # source://prism//lib/prism/node.rb#10143 + sig { returns(Symbol) } + def name; end - # def opening: () -> String + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#10011 - def opening; end + # source://prism//lib/prism/node.rb#10146 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader opening_loc: Location + # def operator: () -> String # - # source://prism//prism/node.rb#9894 - def opening_loc; end + # source://prism//lib/prism/node.rb#10162 + sig { returns(String) } + def operator; end - # attr_reader parts: Array[Node] + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#9897 - def parts; end - - # source://prism//prism/node.rb#9916 - def set_newline_flag(newline_marked); end + # source://prism//lib/prism/node.rb#10152 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13617,29 +15177,14 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10045 + # source://prism//lib/prism/node.rb#10191 def type; end - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9991 - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#9986 - def windows_31j?; end - - private - - # Returns the value of attribute flags. + # attr_reader value: Node # - # source://prism//prism/node.rb#9891 - def flags; end + # source://prism//lib/prism/node.rb#10158 + sig { returns(Prism::Node) } + def value; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -13649,93 +15194,101 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10055 + # source://prism//lib/prism/node.rb#10201 def type; end end end -# Represents a string literal that contains interpolation. +# Represents assigning to an instance variable using an operator that isn't `=`. # -# "foo #{bar} baz" +# @target += value # ^^^^^^^^^^^^^^^^ -class Prism::InterpolatedStringNode < ::Prism::Node - include ::Prism::HeredocQuery - - # def initialize: (opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location) -> void +# +# source://prism//lib/prism/node.rb#10210 +class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void # - # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode + # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode # - # source://prism//prism/node.rb#10075 - def initialize(opening_loc, parts, closing_loc, location); end + # source://prism//lib/prism/node.rb#10212 + def initialize(source, name, name_loc, operator_loc, value, operator, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10083 + # source://prism//lib/prism/node.rb#10224 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10093 + # source://prism//lib/prism/node.rb#10229 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism//prism/node.rb#10131 - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism//prism/node.rb#10072 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10103 + # source://prism//lib/prism/node.rb#10239 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10098 + # source://prism//lib/prism/node.rb#10234 def compact_child_nodes; end - # def copy: (**params) -> InterpolatedStringNode + # def copy: (**params) -> InstanceVariableOperatorWriteNode # - # source://prism//prism/node.rb#10108 + # source://prism//lib/prism/node.rb#10244 + sig { params(params: T.untyped).returns(Prism::InstanceVariableOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10093 + # source://prism//lib/prism/node.rb#10229 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location } # - # source://prism//prism/node.rb#10121 + # source://prism//lib/prism/node.rb#10260 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#191 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10136 + # source://prism//lib/prism/node.rb#10287 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String? + # attr_reader name: Symbol # - # source://prism//prism/node.rb#10126 - def opening; end + # source://prism//lib/prism/node.rb#10265 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location? + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#10066 - def opening_loc; end + # source://prism//lib/prism/node.rb#10268 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader parts: Array[Node] + # attr_reader operator: Symbol # - # source://prism//prism/node.rb#10069 - def parts; end + # source://prism//lib/prism/node.rb#10283 + sig { returns(Symbol) } + def operator; end - # source://prism//prism/node.rb#10087 - def set_newline_flag(newline_marked); end + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#10274 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13752,9 +15305,15 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10158 + # source://prism//lib/prism/node.rb#10312 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#10280 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -13763,91 +15322,101 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10168 + # source://prism//lib/prism/node.rb#10322 def type; end end end -# Represents a symbol literal that contains interpolation. +# Represents the use of the `||=` operator for assignment to an instance variable. # -# :"foo #{bar} baz" +# @target ||= value # ^^^^^^^^^^^^^^^^^ -class Prism::InterpolatedSymbolNode < ::Prism::Node - # def initialize: (opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location) -> void +# +# source://prism//lib/prism/node.rb#10331 +class Prism::InstanceVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # - # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode + # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode # - # source://prism//prism/node.rb#10188 - def initialize(opening_loc, parts, closing_loc, location); end + # source://prism//lib/prism/node.rb#10333 + def initialize(source, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10196 + # source://prism//lib/prism/node.rb#10344 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10206 + # source://prism//lib/prism/node.rb#10349 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism//prism/node.rb#10244 - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism//prism/node.rb#10185 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10216 + # source://prism//lib/prism/node.rb#10359 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10211 + # source://prism//lib/prism/node.rb#10354 def compact_child_nodes; end - # def copy: (**params) -> InterpolatedSymbolNode + # def copy: (**params) -> InstanceVariableOrWriteNode # - # source://prism//prism/node.rb#10221 + # source://prism//lib/prism/node.rb#10364 + sig { params(params: T.untyped).returns(Prism::InstanceVariableOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10206 + # source://prism//lib/prism/node.rb#10349 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#10234 + # source://prism//lib/prism/node.rb#10379 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # source://prism//lib/prism/desugar_compiler.rb#185 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10249 + # source://prism//lib/prism/node.rb#10408 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String? + # attr_reader name: Symbol # - # source://prism//prism/node.rb#10239 - def opening; end + # source://prism//lib/prism/node.rb#10384 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location? + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#10179 - def opening_loc; end + # source://prism//lib/prism/node.rb#10387 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader parts: Array[Node] + # def operator: () -> String # - # source://prism//prism/node.rb#10182 - def parts; end + # source://prism//lib/prism/node.rb#10403 + sig { returns(String) } + def operator; end - # source://prism//prism/node.rb#10200 - def set_newline_flag(newline_marked); end + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#10393 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13864,9 +15433,15 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10271 + # source://prism//lib/prism/node.rb#10432 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#10399 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -13875,93 +15450,84 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10281 + # source://prism//lib/prism/node.rb#10442 def type; end end end -# Represents an xstring literal that contains interpolation. +# Represents referencing an instance variable. # -# `foo #{bar} baz` -# ^^^^^^^^^^^^^^^^ -class Prism::InterpolatedXStringNode < ::Prism::Node - include ::Prism::HeredocQuery - - # def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void +# @foo +# ^^^^ +# +# source://prism//lib/prism/node.rb#10451 +class Prism::InstanceVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode + # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode # - # source://prism//prism/node.rb#10301 - def initialize(opening_loc, parts, closing_loc, location); end + # source://prism//lib/prism/node.rb#10453 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10309 + # source://prism//lib/prism/node.rb#10461 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10319 + # source://prism//lib/prism/node.rb#10466 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#10357 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#10298 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10329 + # source://prism//lib/prism/node.rb#10476 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10324 + # source://prism//lib/prism/node.rb#10471 def compact_child_nodes; end - # def copy: (**params) -> InterpolatedXStringNode + # def copy: (**params) -> InstanceVariableReadNode # - # source://prism//prism/node.rb#10334 + # source://prism//lib/prism/node.rb#10481 + sig { params(params: T.untyped).returns(Prism::InstanceVariableReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10319 + # source://prism//lib/prism/node.rb#10466 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#10347 + # source://prism//lib/prism/node.rb#10493 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10362 + # source://prism//lib/prism/node.rb#10506 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String + # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # - # source://prism//prism/node.rb#10352 - def opening; end - - # attr_reader opening_loc: Location + # @x # name `:@x` # - # source://prism//prism/node.rb#10292 - def opening_loc; end - - # attr_reader parts: Array[Node] + # @_test # name `:@_test` # - # source://prism//prism/node.rb#10295 - def parts; end - - # source://prism//prism/node.rb#10313 - def set_newline_flag(newline_marked); end + # source://prism//lib/prism/node.rb#10502 + sig { returns(Symbol) } + def name; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -13978,7 +15544,7 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10384 + # source://prism//lib/prism/node.rb#10526 def type; end class << self @@ -13989,75 +15555,80 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10394 + # source://prism//lib/prism/node.rb#10536 def type; end end end -# Represents a hash literal without opening and closing braces. +# Represents writing to an instance variable in a context that doesn't have an explicit value. # -# foo(a: b) -# ^^^^ -class Prism::KeywordHashNode < ::Prism::Node - # def initialize: (flags: Integer, elements: Array[Node], location: Location) -> void +# @foo, @bar = baz +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#10545 +class Prism::InstanceVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [KeywordHashNode] a new instance of KeywordHashNode + # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode # - # source://prism//prism/node.rb#10411 - def initialize(flags, elements, location); end + # source://prism//lib/prism/node.rb#10547 + def initialize(source, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10418 + # source://prism//lib/prism/node.rb#10555 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10423 + # source://prism//lib/prism/node.rb#10560 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10433 + # source://prism//lib/prism/node.rb#10570 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10428 + # source://prism//lib/prism/node.rb#10565 def compact_child_nodes; end - # def copy: (**params) -> KeywordHashNode + # def copy: (**params) -> InstanceVariableTargetNode # - # source://prism//prism/node.rb#10438 + # source://prism//lib/prism/node.rb#10575 + sig { params(params: T.untyped).returns(Prism::InstanceVariableTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10423 + # source://prism//lib/prism/node.rb#10560 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//prism/node.rb#10450 + # source://prism//lib/prism/node.rb#10587 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] - # - # source://prism//prism/node.rb#10408 - def elements; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10460 + # source://prism//lib/prism/node.rb#10596 def inspect(inspector = T.unsafe(nil)); end - # def static_keys?: () -> bool - # - # @return [Boolean] + # attr_reader name: Symbol # - # source://prism//prism/node.rb#10455 - def static_keys?; end + # source://prism//lib/prism/node.rb#10592 + sig { returns(Symbol) } + def name; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14074,16 +15645,9 @@ class Prism::KeywordHashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10482 + # source://prism//lib/prism/node.rb#10616 def type; end - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#10405 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -14092,91 +15656,97 @@ class Prism::KeywordHashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10492 + # source://prism//lib/prism/node.rb#10626 def type; end end end -# Flags for keyword hash nodes. -module Prism::KeywordHashNodeFlags; end - -# a keyword hash which only has `AssocNode` elements all with static literal keys, which means the elements can be treated as keyword arguments +# Represents writing to an instance variable. # -# source://prism//prism/node.rb#17327 -Prism::KeywordHashNodeFlags::STATIC_KEYS = T.let(T.unsafe(nil), Integer) - -# Represents a keyword rest parameter to a method, block, or lambda definition. +# @foo = 1 +# ^^^^^^^^ # -# def a(**b) -# ^^^ -# end -class Prism::KeywordRestParameterNode < ::Prism::Node - # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void +# source://prism//lib/prism/node.rb#10635 +class Prism::InstanceVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void # - # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode + # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode # - # source://prism//prism/node.rb#10513 - def initialize(name, name_loc, operator_loc, location); end + # source://prism//lib/prism/node.rb#10637 + def initialize(source, name, name_loc, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10521 + # source://prism//lib/prism/node.rb#10648 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10526 + # source://prism//lib/prism/node.rb#10653 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10536 + # source://prism//lib/prism/node.rb#10663 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10531 + # source://prism//lib/prism/node.rb#10658 def compact_child_nodes; end - # def copy: (**params) -> KeywordRestParameterNode + # def copy: (**params) -> InstanceVariableWriteNode # - # source://prism//prism/node.rb#10541 + # source://prism//lib/prism/node.rb#10668 + sig { params(params: T.untyped).returns(Prism::InstanceVariableWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10526 + # source://prism//lib/prism/node.rb#10653 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#10554 + # source://prism//lib/prism/node.rb#10683 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10564 + # source://prism//lib/prism/node.rb#10712 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol? + # attr_reader name: Symbol # - # source://prism//prism/node.rb#10504 + # source://prism//lib/prism/node.rb#10688 + sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location? + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#10507 + # source://prism//lib/prism/node.rb#10691 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//prism/node.rb#10559 + # source://prism//lib/prism/node.rb#10707 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#10510 + # source://prism//lib/prism/node.rb#10700 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -14194,9 +15764,15 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10590 + # source://prism//lib/prism/node.rb#10736 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#10697 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -14205,113 +15781,131 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10600 + # source://prism//lib/prism/node.rb#10746 def type; end end end -# Represents using a lambda literal (not the lambda method call). +# Flags for integer nodes that correspond to the base of the integer. # -# ->(value) { value * 2 } -# ^^^^^^^^^^^^^^^^^^^^^^^ -class Prism::LambdaNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], locals_body_index: Integer, operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Node?, body: Node?, location: Location) -> void +# source://prism//lib/prism/node.rb#19277 +module Prism::IntegerBaseFlags; end + +# 0b prefix +# +# source://prism//lib/prism/node.rb#19279 +Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) + +# 0d or no prefix +# +# source://prism//lib/prism/node.rb#19282 +Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + +# 0x prefix +# +# source://prism//lib/prism/node.rb#19288 +Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + +# 0o or 0 prefix +# +# source://prism//lib/prism/node.rb#19285 +Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + +# Represents an integer number literal. +# +# 1 +# ^ +# +# source://prism//lib/prism/node.rb#10755 +class Prism::IntegerNode < ::Prism::Node + # def initialize: (Integer flags, Location location) -> void # - # @return [LambdaNode] a new instance of LambdaNode + # @return [IntegerNode] a new instance of IntegerNode # - # source://prism//prism/node.rb#10632 - def initialize(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location); end + # source://prism//lib/prism/node.rb#10757 + def initialize(source, flags, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10644 + # source://prism//lib/prism/node.rb#10765 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader body: Node? + # def binary?: () -> bool # - # source://prism//prism/node.rb#10629 - def body; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10807 + sig { returns(T::Boolean) } + def binary?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10649 + # source://prism//lib/prism/node.rb#10770 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#10699 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#10623 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10662 + # source://prism//lib/prism/node.rb#10780 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10654 + # source://prism//lib/prism/node.rb#10775 def compact_child_nodes; end - # def copy: (**params) -> LambdaNode + # def copy: (**params) -> IntegerNode # - # source://prism//prism/node.rb#10667 + # source://prism//lib/prism/node.rb#10785 + sig { params(params: T.untyped).returns(Prism::IntegerNode) } def copy(**params); end + # def decimal?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10812 + sig { returns(T::Boolean) } + def decimal?; end + # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10649 + # source://prism//lib/prism/node.rb#10770 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, location: Location } # - # source://prism//prism/node.rb#10684 + # source://prism//lib/prism/node.rb#10797 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#10704 - def inspect(inspector = T.unsafe(nil)); end - - # attr_reader locals: Array[Symbol] - # - # source://prism//prism/node.rb#10611 - def locals; end - - # attr_reader locals_body_index: Integer - # - # source://prism//prism/node.rb#10614 - def locals_body_index; end - - # def opening: () -> String + # def hexadecimal?: () -> bool # - # source://prism//prism/node.rb#10694 - def opening; end - - # attr_reader opening_loc: Location + # @return [Boolean] # - # source://prism//prism/node.rb#10620 - def opening_loc; end + # source://prism//lib/prism/node.rb#10822 + sig { returns(T::Boolean) } + def hexadecimal?; end - # def operator: () -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10689 - def operator; end + # source://prism//lib/prism/node.rb#10827 + def inspect(inspector = T.unsafe(nil)); end - # attr_reader operator_loc: Location + # def octal?: () -> bool # - # source://prism//prism/node.rb#10617 - def operator_loc; end - - # attr_reader parameters: Node? + # @return [Boolean] # - # source://prism//prism/node.rb#10626 - def parameters; end + # source://prism//lib/prism/node.rb#10817 + sig { returns(T::Boolean) } + def octal?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14328,9 +15922,22 @@ class Prism::LambdaNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10740 + # source://prism//lib/prism/node.rb#10848 def type; end + # Returns the value of the node as a Ruby Integer. + # + # source://prism//lib/prism/node_ext.rb#76 + def value; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#10802 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -14339,308 +15946,181 @@ class Prism::LambdaNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10750 + # source://prism//lib/prism/node.rb#10858 def type; end end end -# This class is responsible for lexing the source using prism and then -# converting those tokens to be compatible with Ripper. In the vast majority -# of cases, this is a one-to-one mapping of the token type. Everything else -# generally lines up. However, there are a few cases that require special -# handling. -class Prism::LexCompat - # @return [LexCompat] a new instance of LexCompat +# Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object. +# +# if /foo #{bar} baz/ then end +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#10867 +class Prism::InterpolatedMatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void # - # source://prism//prism/lex_compat.rb#599 - def initialize(source, **options); end + # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode + # + # source://prism//lib/prism/node.rb#10869 + def initialize(source, flags, opening_loc, parts, closing_loc, location); end - # Returns the value of attribute options. + # def accept: (Visitor visitor) -> void # - # source://prism//prism/lex_compat.rb#597 - def options; end + # source://prism//lib/prism/node.rb#10880 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/lex_compat.rb#604 - def result; end + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10970 + sig { returns(T::Boolean) } + def ascii_8bit?; end - # Returns the value of attribute source. + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/lex_compat.rb#597 - def source; end -end + # source://prism//lib/prism/node.rb#10890 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end -# Ripper doesn't include the rest of the token in the event, so we need to -# trim it down to just the content on the first line when comparing. -class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token - # source://prism//prism/lex_compat.rb#211 - def ==(other); end -end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#11005 + sig { returns(String) } + def closing; end -# A heredoc in this case is a list of tokens that belong to the body of the -# heredoc that should be appended onto the list of tokens when the heredoc -# closes. -module Prism::LexCompat::Heredoc - class << self - # Here we will split between the two types of heredocs and return the - # object that will store their tokens. - # - # source://prism//prism/lex_compat.rb#583 - def build(opening); end - end -end + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#10938 + sig { returns(Prism::Location) } + def closing_loc; end -# Dash heredocs are a little more complicated. They are a list of tokens -# that need to be split on "\\\n" to mimic Ripper's behavior. We also need -# to keep track of the state that the heredoc was opened in. -class Prism::LexCompat::Heredoc::DashHeredoc - # @return [DashHeredoc] a new instance of DashHeredoc + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/lex_compat.rb#298 - def initialize(split); end + # source://prism//lib/prism/node.rb#10900 + def comment_targets; end - # source://prism//prism/lex_compat.rb#303 - def <<(token); end - - # source://prism//prism/lex_compat.rb#296 - def split; end - - # source://prism//prism/lex_compat.rb#307 - def to_a; end - - # source://prism//prism/lex_compat.rb#296 - def tokens; end -end - -# Heredocs that are dedenting heredocs are a little more complicated. -# Ripper outputs on_ignored_sp tokens for the whitespace that is being -# removed from the output. prism only modifies the node itself and keeps -# the token the same. This simplifies prism, but makes comparing against -# Ripper much harder because there is a length mismatch. -# -# Fortunately, we already have to pull out the heredoc tokens in order to -# insert them into the stream in the correct order. As such, we can do -# some extra manipulation on the tokens to make them match Ripper's -# output by mirroring the dedent logic that Ripper uses. -class Prism::LexCompat::Heredoc::DedentingHeredoc - # @return [DedentingHeredoc] a new instance of DedentingHeredoc - # - # source://prism//prism/lex_compat.rb#359 - def initialize; end - - # As tokens are coming in, we track the minimum amount of common leading - # whitespace on plain string content tokens. This allows us to later - # remove that amount of whitespace from the beginning of each line. - # - # source://prism//prism/lex_compat.rb#370 - def <<(token); end - - # Returns the value of attribute dedent. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/lex_compat.rb#357 - def dedent; end + # source://prism//lib/prism/node.rb#10895 + def compact_child_nodes; end - # Returns the value of attribute dedent_next. + # def copy: (**params) -> InterpolatedMatchLastLineNode # - # source://prism//prism/lex_compat.rb#357 - def dedent_next; end + # source://prism//lib/prism/node.rb#10905 + sig { params(params: T.untyped).returns(Prism::InterpolatedMatchLastLineNode) } + def copy(**params); end - # Returns the value of attribute embexpr_balance. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/lex_compat.rb#357 - def embexpr_balance; end - - # source://prism//prism/lex_compat.rb#407 - def to_a; end + # source://prism//lib/prism/node.rb#10890 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Returns the value of attribute tokens. + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location } # - # source://prism//prism/lex_compat.rb#357 - def tokens; end -end - -# source://prism//prism/lex_compat.rb#355 -Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/node.rb#10920 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end -# Heredocs that are no dash or tilde heredocs are just a list of tokens. -# We need to keep them around so that we can insert them in the correct -# order back into the token stream and set the state of the last token to -# the state that the heredoc was opened in. -class Prism::LexCompat::Heredoc::PlainHeredoc - # @return [PlainHeredoc] a new instance of PlainHeredoc + # def euc_jp?: () -> bool # - # source://prism//prism/lex_compat.rb#279 - def initialize; end - - # source://prism//prism/lex_compat.rb#283 - def <<(token); end - - # source://prism//prism/lex_compat.rb#287 - def to_a; end - - # source://prism//prism/lex_compat.rb#277 - def tokens; end -end - -# Ident tokens for the most part are exactly the same, except sometimes we -# know an ident is a local when ripper doesn't (when they are introduced -# through named captures in regular expressions). In that case we don't -# compare the state. -class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token - # source://prism//prism/lex_compat.rb#229 - def ==(other); end -end - -# Tokens where state should be ignored -# used for :on_comment, :on_heredoc_end, :on_embexpr_end -class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token - # source://prism//prism/lex_compat.rb#219 - def ==(other); end -end - -# Ignored newlines can occasionally have a LABEL state attached to them, so -# we compare the state differently here. -class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token - # source://prism//prism/lex_compat.rb#240 - def ==(other); end -end - -# If we have an identifier that follows a method name like: -# -# def foo bar -# -# then Ripper will mark bar as END|LABEL if there is a local in a parent -# scope named bar because it hasn't pushed the local table yet. We do this -# more accurately, so we need to allow comparing against both END and -# END|LABEL. -class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token - # source://prism//prism/lex_compat.rb#260 - def ==(other); end -end - -# This is a mapping of prism token types to Ripper token types. This is a -# many-to-one mapping because we split up our token types, whereas Ripper -# tends to group them. -# -# source://prism//prism/lex_compat.rb#15 -Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) - -# When we produce tokens, we produce the same arrays that Ripper does. -# However, we add a couple of convenience methods onto them to make them a -# little easier to work with. We delegate all other methods to the array. -class Prism::LexCompat::Token < ::SimpleDelegator - # The type of the token. + # @return [Boolean] # - # source://prism//prism/lex_compat.rb#193 - def event; end + # source://prism//lib/prism/node.rb#10965 + sig { returns(T::Boolean) } + def euc_jp?; end - # The location of the token in the source. + # def extended?: () -> bool # - # source://prism//prism/lex_compat.rb#188 - def location; end - - # The state of the lexer when this token was produced. + # @return [Boolean] # - # source://prism//prism/lex_compat.rb#203 - def state; end + # source://prism//lib/prism/node.rb#10950 + sig { returns(T::Boolean) } + def extended?; end - # The slice of the source that this token represents. + # def forced_binary_encoding?: () -> bool # - # source://prism//prism/lex_compat.rb#198 - def value; end -end - -# This is a class that wraps the Ripper lexer to produce almost exactly the -# same tokens. -class Prism::LexRipper - # @return [LexRipper] a new instance of LexRipper + # @return [Boolean] # - # source://prism//prism/lex_compat.rb#855 - def initialize(source); end - - # source://prism//prism/lex_compat.rb#859 - def result; end - - # source://prism//prism/lex_compat.rb#853 - def source; end -end + # source://prism//lib/prism/node.rb#10990 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end -# Represents the use of the `&&=` operator for assignment to a local variable. -# -# target &&= value -# ^^^^^^^^^^^^^^^^ -class Prism::LocalVariableAndWriteNode < ::Prism::Node - # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void + # def forced_us_ascii_encoding?: () -> bool # - # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode + # @return [Boolean] # - # source://prism//prism/node.rb#10776 - def initialize(name_loc, operator_loc, value, name, depth, location); end + # source://prism//lib/prism/node.rb#10995 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end - # def accept: (visitor: Visitor) -> void + # def forced_utf8_encoding?: () -> bool # - # source://prism//prism/node.rb#10786 - def accept(visitor); end - - # def child_nodes: () -> Array[nil | Node] + # @return [Boolean] # - # source://prism//prism/node.rb#10791 - def child_nodes; end + # source://prism//lib/prism/node.rb#10985 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # def comment_targets: () -> Array[Node | Location] + # def ignore_case?: () -> bool # - # source://prism//prism/node.rb#10801 - def comment_targets; end - - # def compact_child_nodes: () -> Array[Node] + # @return [Boolean] # - # source://prism//prism/node.rb#10796 - def compact_child_nodes; end + # source://prism//lib/prism/node.rb#10945 + sig { returns(T::Boolean) } + def ignore_case?; end - # def copy: (**params) -> LocalVariableAndWriteNode + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#10806 - def copy(**params); end + # source://prism//lib/prism/node.rb#11010 + def inspect(inspector = T.unsafe(nil)); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # def multi_line?: () -> bool # - # source://prism//prism/node.rb#10791 - def deconstruct; end - - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # @return [Boolean] # - # source://prism//prism/node.rb#10821 - def deconstruct_keys(keys); end + # source://prism//lib/prism/node.rb#10955 + sig { returns(T::Boolean) } + def multi_line?; end - # attr_reader depth: Integer + # def once?: () -> bool # - # source://prism//prism/node.rb#10773 - def depth; end - - # def inspect(inspector: NodeInspector) -> String + # @return [Boolean] # - # source://prism//prism/node.rb#10831 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#10960 + sig { returns(T::Boolean) } + def once?; end - # attr_reader name: Symbol + # def opening: () -> String # - # source://prism//prism/node.rb#10770 - def name; end + # source://prism//lib/prism/node.rb#11000 + sig { returns(String) } + def opening; end - # attr_reader name_loc: Location + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#10761 - def name_loc; end + # source://prism//lib/prism/node.rb#10929 + sig { returns(Prism::Location) } + def opening_loc; end - # def operator: () -> String + # attr_reader parts: Array[Node] # - # source://prism//prism/node.rb#10826 - def operator; end + # source://prism//lib/prism/node.rb#10935 + sig { returns(T::Array[Prism::Node]) } + def parts; end - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#10764 - def operator_loc; end + # source://prism//lib/prism/node.rb#10884 + def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14657,13 +16137,32 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10856 + # source://prism//lib/prism/node.rb#11034 def type; end - # attr_reader value: Node + # def utf_8?: () -> bool # - # source://prism//prism/node.rb#10767 - def value; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10980 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#10975 + sig { returns(T::Boolean) } + def windows_31j?; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#10925 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -14673,88 +16172,181 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10866 + # source://prism//lib/prism/node.rb#11044 def type; end end end -# Represents assigning to a local variable using an operator that isn't `=`. +# Represents a regular expression literal that contains interpolation. # -# target += value -# ^^^^^^^^^^^^^^^ -class Prism::LocalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, operator: Symbol, depth: Integer, location: Location) -> void +# /foo #{bar} baz/ +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11053 +class Prism::InterpolatedRegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions + + # def initialize: (Integer flags, Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void # - # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode + # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode # - # source://prism//prism/node.rb#10895 - def initialize(name_loc, operator_loc, value, name, operator, depth, location); end + # source://prism//lib/prism/node.rb#11055 + def initialize(source, flags, opening_loc, parts, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#10906 + # source://prism//lib/prism/node.rb#11066 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11156 + sig { returns(T::Boolean) } + def ascii_8bit?; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10911 + # source://prism//lib/prism/node.rb#11076 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#11191 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#11124 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#10921 + # source://prism//lib/prism/node.rb#11086 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#10916 + # source://prism//lib/prism/node.rb#11081 def compact_child_nodes; end - # def copy: (**params) -> LocalVariableOperatorWriteNode + # def copy: (**params) -> InterpolatedRegularExpressionNode # - # source://prism//prism/node.rb#10926 + # source://prism//lib/prism/node.rb#11091 + sig { params(params: T.untyped).returns(Prism::InterpolatedRegularExpressionNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#10911 + # source://prism//lib/prism/node.rb#11076 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#10942 + # source://prism//lib/prism/node.rb#11106 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader depth: Integer + # def euc_jp?: () -> bool # - # source://prism//prism/node.rb#10892 - def depth; end - - # def inspect(inspector: NodeInspector) -> String + # @return [Boolean] # - # source://prism//prism/node.rb#10947 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#11151 + sig { returns(T::Boolean) } + def euc_jp?; end - # attr_reader name: Symbol + # def extended?: () -> bool # - # source://prism//prism/node.rb#10886 - def name; end - - # attr_reader name_loc: Location + # @return [Boolean] # - # source://prism//prism/node.rb#10877 - def name_loc; end + # source://prism//lib/prism/node.rb#11136 + sig { returns(T::Boolean) } + def extended?; end - # attr_reader operator: Symbol + # def forced_binary_encoding?: () -> bool # - # source://prism//prism/node.rb#10889 - def operator; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11176 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # attr_reader operator_loc: Location + # def forced_us_ascii_encoding?: () -> bool # - # source://prism//prism/node.rb#10880 - def operator_loc; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11181 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11171 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11131 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#11196 + def inspect(inspector = T.unsafe(nil)); end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11141 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11146 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#11186 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#11115 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parts: Array[Node] + # + # source://prism//lib/prism/node.rb#11121 + sig { returns(T::Array[Prism::Node]) } + def parts; end + + # source://prism//lib/prism/node.rb#11070 + def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14771,13 +16363,32 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#10973 + # source://prism//lib/prism/node.rb#11220 def type; end - # attr_reader value: Node + # def utf_8?: () -> bool # - # source://prism//prism/node.rb#10883 - def value; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11166 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#11161 + sig { returns(T::Boolean) } + def windows_31j?; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#11111 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -14787,88 +16398,109 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#10983 + # source://prism//lib/prism/node.rb#11230 def type; end end end -# Represents the use of the `||=` operator for assignment to a local variable. +# Represents a string literal that contains interpolation. # -# target ||= value +# "foo #{bar} baz" # ^^^^^^^^^^^^^^^^ -class Prism::LocalVariableOrWriteNode < ::Prism::Node - # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void +# +# source://prism//lib/prism/node.rb#11239 +class Prism::InterpolatedStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Location? opening_loc, Array[Node] parts, Location? closing_loc, Location location) -> void # - # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode + # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode # - # source://prism//prism/node.rb#11009 - def initialize(name_loc, operator_loc, value, name, depth, location); end + # source://prism//lib/prism/node.rb#11241 + def initialize(source, opening_loc, parts, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11019 + # source://prism//lib/prism/node.rb#11251 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11024 + # source://prism//lib/prism/node.rb#11261 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#11328 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#11310 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11034 + # source://prism//lib/prism/node.rb#11271 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11029 + # source://prism//lib/prism/node.rb#11266 def compact_child_nodes; end - # def copy: (**params) -> LocalVariableOrWriteNode + # def copy: (**params) -> InterpolatedStringNode # - # source://prism//prism/node.rb#11039 + # source://prism//lib/prism/node.rb#11276 + sig { params(params: T.untyped).returns(Prism::InterpolatedStringNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11024 + # source://prism//lib/prism/node.rb#11261 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#11054 + # source://prism//lib/prism/node.rb#11290 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader depth: Integer - # - # source://prism//prism/node.rb#11006 - def depth; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11064 + # source://prism//lib/prism/node.rb#11333 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # def opening: () -> String? # - # source://prism//prism/node.rb#11003 - def name; end + # source://prism//lib/prism/node.rb#11323 + sig { returns(T.nilable(String)) } + def opening; end - # attr_reader name_loc: Location + # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#10994 - def name_loc; end + # source://prism//lib/prism/node.rb#11295 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end - # def operator: () -> String + # attr_reader parts: Array[Node] # - # source://prism//prism/node.rb#11059 - def operator; end + # source://prism//lib/prism/node.rb#11307 + sig { returns(T::Array[Prism::Node]) } + def parts; end - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#10997 - def operator_loc; end + # source://prism//lib/prism/node.rb#11255 + def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14885,14 +16517,9 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11089 + # source://prism//lib/prism/node.rb#11355 def type; end - # attr_reader value: Node - # - # source://prism//prism/node.rb#11000 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -14901,75 +16528,107 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11099 + # source://prism//lib/prism/node.rb#11365 def type; end end end -# Represents reading a local variable. Note that this requires that a local -# variable of the same name has already been written to in the same scope, -# otherwise it is parsed as a method call. +# Represents a symbol literal that contains interpolation. # -# foo -# ^^^ -class Prism::LocalVariableReadNode < ::Prism::Node - # def initialize: (name: Symbol, depth: Integer, location: Location) -> void +# :"foo #{bar} baz" +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11374 +class Prism::InterpolatedSymbolNode < ::Prism::Node + # def initialize: (Location? opening_loc, Array[Node] parts, Location? closing_loc, Location location) -> void # - # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode + # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode # - # source://prism//prism/node.rb#11118 - def initialize(name, depth, location); end + # source://prism//lib/prism/node.rb#11376 + def initialize(source, opening_loc, parts, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11125 + # source://prism//lib/prism/node.rb#11386 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11130 + # source://prism//lib/prism/node.rb#11396 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#11463 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#11445 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11140 + # source://prism//lib/prism/node.rb#11406 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11135 + # source://prism//lib/prism/node.rb#11401 def compact_child_nodes; end - # def copy: (**params) -> LocalVariableReadNode + # def copy: (**params) -> InterpolatedSymbolNode # - # source://prism//prism/node.rb#11145 + # source://prism//lib/prism/node.rb#11411 + sig { params(params: T.untyped).returns(Prism::InterpolatedSymbolNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11130 + # source://prism//lib/prism/node.rb#11396 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location } # - # source://prism//prism/node.rb#11157 + # source://prism//lib/prism/node.rb#11425 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader depth: Integer + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11115 - def depth; end + # source://prism//lib/prism/node.rb#11468 + def inspect(inspector = T.unsafe(nil)); end - # def inspect(inspector: NodeInspector) -> String + # def opening: () -> String? # - # source://prism//prism/node.rb#11162 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#11458 + sig { returns(T.nilable(String)) } + def opening; end - # attr_reader name: Symbol + # attr_reader opening_loc: Location? # - # source://prism//prism/node.rb#11112 - def name; end + # source://prism//lib/prism/node.rb#11430 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # attr_reader parts: Array[Node] + # + # source://prism//lib/prism/node.rb#11442 + sig { returns(T::Array[Prism::Node]) } + def parts; end + + # source://prism//lib/prism/node.rb#11390 + def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -14986,7 +16645,7 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11183 + # source://prism//lib/prism/node.rb#11490 def type; end class << self @@ -14997,73 +16656,109 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11193 + # source://prism//lib/prism/node.rb#11500 def type; end end end -# Represents writing to a local variable in a context that doesn't have an explicit value. +# Represents an xstring literal that contains interpolation. # -# foo, bar = baz -# ^^^ ^^^ -class Prism::LocalVariableTargetNode < ::Prism::Node - # def initialize: (name: Symbol, depth: Integer, location: Location) -> void +# `foo #{bar} baz` +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#11509 +class Prism::InterpolatedXStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void # - # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode + # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode # - # source://prism//prism/node.rb#11210 - def initialize(name, depth, location); end + # source://prism//lib/prism/node.rb#11511 + def initialize(source, opening_loc, parts, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11217 + # source://prism//lib/prism/node.rb#11521 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11222 + # source://prism//lib/prism/node.rb#11531 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#11586 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#11574 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11232 + # source://prism//lib/prism/node.rb#11541 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11227 + # source://prism//lib/prism/node.rb#11536 def compact_child_nodes; end - # def copy: (**params) -> LocalVariableTargetNode + # def copy: (**params) -> InterpolatedXStringNode # - # source://prism//prism/node.rb#11237 + # source://prism//lib/prism/node.rb#11546 + sig { params(params: T.untyped).returns(Prism::InterpolatedXStringNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11222 + # source://prism//lib/prism/node.rb#11531 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#11249 + # source://prism//lib/prism/node.rb#11560 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader depth: Integer + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11207 - def depth; end + # source://prism//lib/prism/node.rb#11591 + def inspect(inspector = T.unsafe(nil)); end - # def inspect(inspector: NodeInspector) -> String + # def opening: () -> String # - # source://prism//prism/node.rb#11254 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#11581 + sig { returns(String) } + def opening; end - # attr_reader name: Symbol + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#11204 - def name; end + # source://prism//lib/prism/node.rb#11565 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parts: Array[Node] + # + # source://prism//lib/prism/node.rb#11571 + sig { returns(T::Array[Prism::Node]) } + def parts; end + + # source://prism//lib/prism/node.rb#11525 + def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -15080,7 +16775,7 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11275 + # source://prism//lib/prism/node.rb#11613 def type; end class << self @@ -15091,88 +16786,88 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11285 + # source://prism//lib/prism/node.rb#11623 def type; end end end -# Represents writing to a local variable. +# Represents a hash literal without opening and closing braces. # -# foo = 1 -# ^^^^^^^ -class Prism::LocalVariableWriteNode < ::Prism::Node - # def initialize: (name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void +# foo(a: b) +# ^^^^ +# +# source://prism//lib/prism/node.rb#11632 +class Prism::KeywordHashNode < ::Prism::Node + # def initialize: (Integer flags, Array[Node] elements, Location location) -> void # - # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode + # @return [KeywordHashNode] a new instance of KeywordHashNode # - # source://prism//prism/node.rb#11311 - def initialize(name, depth, name_loc, value, operator_loc, location); end + # source://prism//lib/prism/node.rb#11634 + def initialize(source, flags, elements, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11321 + # source://prism//lib/prism/node.rb#11643 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11326 + # source://prism//lib/prism/node.rb#11648 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11336 + # source://prism//lib/prism/node.rb#11658 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11331 + # source://prism//lib/prism/node.rb#11653 def compact_child_nodes; end - # def copy: (**params) -> LocalVariableWriteNode + # def copy: (**params) -> KeywordHashNode # - # source://prism//prism/node.rb#11341 + # source://prism//lib/prism/node.rb#11663 + sig { params(params: T.untyped).returns(Prism::KeywordHashNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11326 + # source://prism//lib/prism/node.rb#11648 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Node], location: Location } # - # source://prism//prism/node.rb#11356 + # source://prism//lib/prism/node.rb#11676 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader depth: Integer + # attr_reader elements: Array[Node] # - # source://prism//prism/node.rb#11299 - def depth; end + # source://prism//lib/prism/node.rb#11685 + sig { returns(T::Array[Prism::Node]) } + def elements; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11366 + # source://prism//lib/prism/node.rb#11694 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol - # - # source://prism//prism/node.rb#11296 - def name; end - - # attr_reader name_loc: Location - # - # source://prism//prism/node.rb#11302 - def name_loc; end - - # def operator: () -> String + # def symbol_keys?: () -> bool # - # source://prism//prism/node.rb#11361 - def operator; end - - # attr_reader operator_loc: Location + # @return [Boolean] # - # source://prism//prism/node.rb#11308 - def operator_loc; end + # source://prism//lib/prism/node.rb#11689 + sig { returns(T::Boolean) } + def symbol_keys?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -15189,13 +16884,16 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11391 + # source://prism//lib/prism/node.rb#11716 def type; end - # attr_reader value: Node + private + + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#11305 - def value; end + # source://prism//lib/prism/node.rb#11681 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -15205,344 +16903,274 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11401 + # source://prism//lib/prism/node.rb#11726 def type; end end end -# This represents a location in the source. -class Prism::Location - # Create a new location object with the given source, start byte offset, and - # byte length. +# Flags for keyword hash nodes. +# +# source://prism//lib/prism/node.rb#19292 +module Prism::KeywordHashNodeFlags; end + +# a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments +# +# source://prism//lib/prism/node.rb#19294 +Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) + +# Represents a keyword rest parameter to a method, block, or lambda definition. +# +# def a(**b) +# ^^^ +# end +# +# source://prism//lib/prism/node.rb#11736 +class Prism::KeywordRestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # - # @return [Location] a new instance of Location + # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode # - # source://prism//prism/parse_result.rb#108 - def initialize(source, start_offset, length); end + # source://prism//lib/prism/node.rb#11738 + def initialize(source, flags, name, name_loc, operator_loc, location); end - # Returns true if the given other location is equal to this location. + # def accept: (Visitor visitor) -> void # - # source://prism//prism/parse_result.rb#202 - def ==(other); end + # source://prism//lib/prism/node.rb#11749 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # The list of comments attached to this location - # - # source://prism//prism/parse_result.rb#104 - def comments; end - - # Create a new location object with the given options. - # - # source://prism//prism/parse_result.rb#116 - def copy(**options); end - - # Implement the hash pattern matching interface for Location. - # - # source://prism//prism/parse_result.rb#192 - def deconstruct_keys(keys); end - - # The column number in characters where this location ends from the start of - # the line. + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#187 - def end_character_column; end + # source://prism//lib/prism/node.rb#11754 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The character offset from the beginning of the source where this location - # ends. + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/parse_result.rb#147 - def end_character_offset; end + # source://prism//lib/prism/node.rb#11764 + def comment_targets; end - # The column number in bytes where this location ends from the start of the - # line. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/parse_result.rb#181 - def end_column; end + # source://prism//lib/prism/node.rb#11759 + def compact_child_nodes; end - # The line number where this location ends. + # def copy: (**params) -> KeywordRestParameterNode # - # source://prism//prism/parse_result.rb#163 - def end_line; end + # source://prism//lib/prism/node.rb#11769 + sig { params(params: T.untyped).returns(Prism::KeywordRestParameterNode) } + def copy(**params); end - # The byte offset from the beginning of the source where this location ends. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#141 - def end_offset; end + # source://prism//lib/prism/node.rb#11754 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Returns a string representation of this location. + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism//prism/parse_result.rb#125 - def inspect; end + # source://prism//lib/prism/node.rb#11784 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # Returns a new location that stretches from this location to the given - # other location. Raises an error if this location is not before the other - # location or if they don't share the same source. + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/parse_result.rb#211 - def join(other); end + # source://prism//lib/prism/node.rb#11825 + def inspect(inspector = T.unsafe(nil)); end - # The length of this location in bytes. + # attr_reader name: Symbol? # - # source://prism//prism/parse_result.rb#101 - def length; end + # source://prism//lib/prism/node.rb#11793 + sig { returns(T.nilable(Symbol)) } + def name; end - # Implement the pretty print interface for Location. + # attr_reader name_loc: Location? # - # source://prism//prism/parse_result.rb#197 - def pretty_print(q); end + # source://prism//lib/prism/node.rb#11796 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end - # The source code that this location represents. + # def operator: () -> String # - # source://prism//prism/parse_result.rb#130 - def slice; end + # source://prism//lib/prism/node.rb#11820 + sig { returns(String) } + def operator; end - # The column number in characters where this location ends from the start of - # the line. + # attr_reader operator_loc: Location # - # source://prism//prism/parse_result.rb#175 - def start_character_column; end + # source://prism//lib/prism/node.rb#11808 + sig { returns(Prism::Location) } + def operator_loc; end - # The character offset from the beginning of the source where this location - # starts. + # def repeated_parameter?: () -> bool # - # source://prism//prism/parse_result.rb#136 - def start_character_offset; end - - # The column number in bytes where this location starts from the start of - # the line. + # @return [Boolean] # - # source://prism//prism/parse_result.rb#169 - def start_column; end + # source://prism//lib/prism/node.rb#11815 + sig { returns(T::Boolean) } + def repeated_parameter?; end - # The line number where this location starts. + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/parse_result.rb#152 - def start_line; end - - # The content of the line where this location starts before this location. + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/parse_result.rb#157 - def start_line_slice; end - - # The byte offset from the beginning of the source where this location - # starts. + # def type: () -> Symbol # - # source://prism//prism/parse_result.rb#98 - def start_offset; end + # source://prism//lib/prism/node.rb#11853 + def type; end - protected + private - # Returns the value of attribute source. + # private attr_reader flags: Integer # - # source://prism//prism/parse_result.rb#94 - def source; end + # source://prism//lib/prism/node.rb#11789 + sig { returns(Integer) } + def flags; end class << self - # Returns a null location that does not correspond to a source and points to - # the beginning of the file. Useful for when you want a location object but - # do not care where it points. + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. # - # source://prism//prism/parse_result.rb#221 - def null; end + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#11863 + def type; end end end -# Flags for while and until loop nodes. -module Prism::LoopFlags; end - -# a loop after a begin statement, so the body is executed first before the condition +# Represents using a lambda literal (not the lambda method call). # -# source://prism//prism/node.rb#17333 -Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) - -# This represents a magic comment that was encountered during parsing. -class Prism::MagicComment - # Create a new magic comment object with the given key and value locations. - # - # @return [MagicComment] a new instance of MagicComment - # - # source://prism//prism/parse_result.rb#281 - def initialize(key_loc, value_loc); end - - # Implement the hash pattern matching interface for MagicComment. - # - # source://prism//prism/parse_result.rb#297 - def deconstruct_keys(keys); end - - # Returns a string representation of this magic comment. - # - # source://prism//prism/parse_result.rb#302 - def inspect; end - - # Returns the key of the magic comment by slicing it from the source code. - # - # source://prism//prism/parse_result.rb#287 - def key; end - - # A Location object representing the location of the key in the source. - # - # source://prism//prism/parse_result.rb#275 - def key_loc; end - - # Returns the value of the magic comment by slicing it from the source code. - # - # source://prism//prism/parse_result.rb#292 - def value; end - - # A Location object representing the location of the value in the source. - # - # source://prism//prism/parse_result.rb#278 - def value_loc; end -end - -# Represents a regular expression literal used in the predicate of a -# conditional to implicitly match against the last line read by an IO -# object. +# ->(value) { value * 2 } +# ^^^^^^^^^^^^^^^^^^^^^^^ # -# if /foo/i then end -# ^^^^^^ -class Prism::MatchLastLineNode < ::Prism::Node - include ::Prism::RegularExpressionOptions - - # def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void +# source://prism//lib/prism/node.rb#11872 +class Prism::LambdaNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, Node? parameters, Node? body, Location location) -> void # - # @return [MatchLastLineNode] a new instance of MatchLastLineNode + # @return [LambdaNode] a new instance of LambdaNode # - # source://prism//prism/node.rb#11429 - def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism//lib/prism/node.rb#11874 + def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11439 + # source://prism//lib/prism/node.rb#11887 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # def ascii_8bit?: () -> bool - # - # @return [Boolean] + # attr_reader body: Node? # - # source://prism//prism/node.rb#11504 - def ascii_8bit?; end + # source://prism//lib/prism/node.rb#11956 + sig { returns(T.nilable(Prism::Node)) } + def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11444 + # source://prism//lib/prism/node.rb#11892 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//prism/node.rb#11544 + # source://prism//lib/prism/node.rb#11970 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//prism/node.rb#11423 + # source://prism//lib/prism/node.rb#11947 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11454 + # source://prism//lib/prism/node.rb#11905 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11449 + # source://prism//lib/prism/node.rb#11897 def compact_child_nodes; end - # def content: () -> String - # - # source://prism//prism/node.rb#11539 - def content; end - - # attr_reader content_loc: Location - # - # source://prism//prism/node.rb#11420 - def content_loc; end - - # def copy: (**params) -> MatchLastLineNode + # def copy: (**params) -> LambdaNode # - # source://prism//prism/node.rb#11459 + # source://prism//lib/prism/node.rb#11910 + sig { params(params: T.untyped).returns(Prism::LambdaNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11444 + # source://prism//lib/prism/node.rb#11892 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Node?, body: Node?, location: Location } # - # source://prism//prism/node.rb#11474 + # source://prism//lib/prism/node.rb#11927 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11499 - def euc_jp?; end - - # def extended?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11484 - def extended?; end - - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11524 - def forced_binary_encoding?; end - - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11529 - def forced_us_ascii_encoding?; end - - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11519 - def forced_utf8_encoding?; end + # source://prism//lib/prism/node.rb#11975 + def inspect(inspector = T.unsafe(nil)); end - # def ignore_case?: () -> bool - # - # @return [Boolean] + # attr_reader locals: Array[Symbol] # - # source://prism//prism/node.rb#11479 - def ignore_case?; end + # source://prism//lib/prism/node.rb#11932 + sig { returns(T::Array[Symbol]) } + def locals; end - # def inspect(inspector: NodeInspector) -> String + # def opening: () -> String # - # source://prism//prism/node.rb#11549 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#11965 + sig { returns(String) } + def opening; end - # def multi_line?: () -> bool - # - # @return [Boolean] + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#11489 - def multi_line?; end + # source://prism//lib/prism/node.rb#11941 + sig { returns(Prism::Location) } + def opening_loc; end - # def once?: () -> bool - # - # @return [Boolean] + # def operator: () -> String # - # source://prism//prism/node.rb#11494 - def once?; end + # source://prism//lib/prism/node.rb#11960 + sig { returns(String) } + def operator; end - # def opening: () -> String + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#11534 - def opening; end + # source://prism//lib/prism/node.rb#11935 + sig { returns(Prism::Location) } + def operator_loc; end - # attr_reader opening_loc: Location + # attr_reader parameters: Node? # - # source://prism//prism/node.rb#11417 - def opening_loc; end + # source://prism//lib/prism/node.rb#11953 + sig { returns(T.nilable(Prism::Node)) } + def parameters; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -15559,35 +17187,9 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11574 + # source://prism//lib/prism/node.rb#12010 def type; end - # attr_reader unescaped: String - # - # source://prism//prism/node.rb#11426 - def unescaped; end - - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11514 - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#11509 - def windows_31j?; end - - private - - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#11414 - def flags; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -15596,79 +17198,357 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11584 + # source://prism//lib/prism/node.rb#12020 def type; end end end -# Represents the use of the modifier `in` operator. -# -# foo in bar -# ^^^^^^^^^^ -class Prism::MatchPredicateNode < ::Prism::Node - # def initialize: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> void +# This class is responsible for lexing the source using prism and then +# converting those tokens to be compatible with Ripper. In the vast majority +# of cases, this is a one-to-one mapping of the token type. Everything else +# generally lines up. However, there are a few cases that require special +# handling. +# +# source://prism//lib/prism/lex_compat.rb#12 +class Prism::LexCompat + # @return [LexCompat] a new instance of LexCompat # - # @return [MatchPredicateNode] a new instance of MatchPredicateNode + # source://prism//lib/prism/lex_compat.rb#600 + def initialize(source, **options); end + + # Returns the value of attribute options. + # + # source://prism//lib/prism/lex_compat.rb#598 + def options; end + + # source://prism//lib/prism/lex_compat.rb#605 + def result; end + + # Returns the value of attribute source. + # + # source://prism//lib/prism/lex_compat.rb#598 + def source; end +end + +# Ripper doesn't include the rest of the token in the event, so we need to +# trim it down to just the content on the first line when comparing. +# +# source://prism//lib/prism/lex_compat.rb#211 +class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#212 + def ==(other); end +end + +# A heredoc in this case is a list of tokens that belong to the body of the +# heredoc that should be appended onto the list of tokens when the heredoc +# closes. +# +# source://prism//lib/prism/lex_compat.rb#272 +module Prism::LexCompat::Heredoc + class << self + # Here we will split between the two types of heredocs and return the + # object that will store their tokens. + # + # source://prism//lib/prism/lex_compat.rb#584 + def build(opening); end + end +end + +# Dash heredocs are a little more complicated. They are a list of tokens +# that need to be split on "\\\n" to mimic Ripper's behavior. We also need +# to keep track of the state that the heredoc was opened in. +# +# source://prism//lib/prism/lex_compat.rb#296 +class Prism::LexCompat::Heredoc::DashHeredoc + # @return [DashHeredoc] a new instance of DashHeredoc + # + # source://prism//lib/prism/lex_compat.rb#299 + def initialize(split); end + + # source://prism//lib/prism/lex_compat.rb#304 + def <<(token); end + + # source://prism//lib/prism/lex_compat.rb#297 + def split; end + + # source://prism//lib/prism/lex_compat.rb#308 + def to_a; end + + # source://prism//lib/prism/lex_compat.rb#297 + def tokens; end +end + +# Heredocs that are dedenting heredocs are a little more complicated. +# Ripper outputs on_ignored_sp tokens for the whitespace that is being +# removed from the output. prism only modifies the node itself and keeps +# the token the same. This simplifies prism, but makes comparing against +# Ripper much harder because there is a length mismatch. +# +# Fortunately, we already have to pull out the heredoc tokens in order to +# insert them into the stream in the correct order. As such, we can do +# some extra manipulation on the tokens to make them match Ripper's +# output by mirroring the dedent logic that Ripper uses. +# +# source://prism//lib/prism/lex_compat.rb#355 +class Prism::LexCompat::Heredoc::DedentingHeredoc + # @return [DedentingHeredoc] a new instance of DedentingHeredoc + # + # source://prism//lib/prism/lex_compat.rb#360 + def initialize; end + + # As tokens are coming in, we track the minimum amount of common leading + # whitespace on plain string content tokens. This allows us to later + # remove that amount of whitespace from the beginning of each line. + # + # source://prism//lib/prism/lex_compat.rb#371 + def <<(token); end + + # Returns the value of attribute dedent. + # + # source://prism//lib/prism/lex_compat.rb#358 + def dedent; end + + # Returns the value of attribute dedent_next. + # + # source://prism//lib/prism/lex_compat.rb#358 + def dedent_next; end + + # Returns the value of attribute embexpr_balance. + # + # source://prism//lib/prism/lex_compat.rb#358 + def embexpr_balance; end + + # source://prism//lib/prism/lex_compat.rb#408 + def to_a; end + + # Returns the value of attribute tokens. + # + # source://prism//lib/prism/lex_compat.rb#358 + def tokens; end +end + +# source://prism//lib/prism/lex_compat.rb#356 +Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) + +# Heredocs that are no dash or tilde heredocs are just a list of tokens. +# We need to keep them around so that we can insert them in the correct +# order back into the token stream and set the state of the last token to +# the state that the heredoc was opened in. +# +# source://prism//lib/prism/lex_compat.rb#277 +class Prism::LexCompat::Heredoc::PlainHeredoc + # @return [PlainHeredoc] a new instance of PlainHeredoc + # + # source://prism//lib/prism/lex_compat.rb#280 + def initialize; end + + # source://prism//lib/prism/lex_compat.rb#284 + def <<(token); end + + # source://prism//lib/prism/lex_compat.rb#288 + def to_a; end + + # source://prism//lib/prism/lex_compat.rb#278 + def tokens; end +end + +# Ident tokens for the most part are exactly the same, except sometimes we +# know an ident is a local when ripper doesn't (when they are introduced +# through named captures in regular expressions). In that case we don't +# compare the state. +# +# source://prism//lib/prism/lex_compat.rb#229 +class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#230 + def ==(other); end +end + +# Tokens where state should be ignored +# used for :on_comment, :on_heredoc_end, :on_embexpr_end +# +# source://prism//lib/prism/lex_compat.rb#219 +class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#220 + def ==(other); end +end + +# Ignored newlines can occasionally have a LABEL state attached to them, so +# we compare the state differently here. +# +# source://prism//lib/prism/lex_compat.rb#240 +class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#241 + def ==(other); end +end + +# If we have an identifier that follows a method name like: +# +# def foo bar +# +# then Ripper will mark bar as END|LABEL if there is a local in a parent +# scope named bar because it hasn't pushed the local table yet. We do this +# more accurately, so we need to allow comparing against both END and +# END|LABEL. +# +# source://prism//lib/prism/lex_compat.rb#260 +class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token + # source://prism//lib/prism/lex_compat.rb#261 + def ==(other); end +end + +# This is a mapping of prism token types to Ripper token types. This is a +# many-to-one mapping because we split up our token types, whereas Ripper +# tends to group them. +# +# source://prism//lib/prism/lex_compat.rb#16 +Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) + +# When we produce tokens, we produce the same arrays that Ripper does. +# However, we add a couple of convenience methods onto them to make them a +# little easier to work with. We delegate all other methods to the array. +# +# source://prism//lib/prism/lex_compat.rb#187 +class Prism::LexCompat::Token < ::SimpleDelegator + # The type of the token. + # + # source://prism//lib/prism/lex_compat.rb#194 + def event; end + + # The location of the token in the source. + # + # source://prism//lib/prism/lex_compat.rb#189 + def location; end + + # The state of the lexer when this token was produced. + # + # source://prism//lib/prism/lex_compat.rb#204 + def state; end + + # The slice of the source that this token represents. + # + # source://prism//lib/prism/lex_compat.rb#199 + def value; end +end + +# This is a class that wraps the Ripper lexer to produce almost exactly the +# same tokens. +# +# source://prism//lib/prism/lex_compat.rb#853 +class Prism::LexRipper + # @return [LexRipper] a new instance of LexRipper + # + # source://prism//lib/prism/lex_compat.rb#856 + def initialize(source); end + + # source://prism//lib/prism/lex_compat.rb#860 + def result; end + + # source://prism//lib/prism/lex_compat.rb#854 + def source; end + + private + + # source://prism//lib/prism/lex_compat.rb#894 + def lex(source); end +end + +# Represents the use of the `&&=` operator for assignment to a local variable. +# +# target &&= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12029 +class Prism::LocalVariableAndWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Integer depth, Location location) -> void # - # source://prism//prism/node.rb#11604 - def initialize(value, pattern, operator_loc, location); end + # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode + # + # source://prism//lib/prism/node.rb#12031 + def initialize(source, name_loc, operator_loc, value, name, depth, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11612 + # source://prism//lib/prism/node.rb#12043 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11617 + # source://prism//lib/prism/node.rb#12048 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11627 + # source://prism//lib/prism/node.rb#12058 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11622 + # source://prism//lib/prism/node.rb#12053 def compact_child_nodes; end - # def copy: (**params) -> MatchPredicateNode + # def copy: (**params) -> LocalVariableAndWriteNode # - # source://prism//prism/node.rb#11632 + # source://prism//lib/prism/node.rb#12063 + sig { params(params: T.untyped).returns(Prism::LocalVariableAndWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11617 + # source://prism//lib/prism/node.rb#12048 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location } # - # source://prism//prism/node.rb#11645 + # source://prism//lib/prism/node.rb#12079 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12102 + sig { returns(Integer) } + def depth; end + + # source://prism//lib/prism/desugar_compiler.rb#197 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11655 + # source://prism//lib/prism/node.rb#12111 def inspect(inspector = T.unsafe(nil)); end + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#12099 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#12084 + sig { returns(Prism::Location) } + def name_loc; end + # def operator: () -> String # - # source://prism//prism/node.rb#11650 + # source://prism//lib/prism/node.rb#12106 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#11601 + # source://prism//lib/prism/node.rb#12090 + sig { returns(Prism::Location) } def operator_loc; end - # attr_reader pattern: Node - # - # source://prism//prism/node.rb#11598 - def pattern; end - # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -15684,12 +17564,13 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11679 + # source://prism//lib/prism/node.rb#12136 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#11595 + # source://prism//lib/prism/node.rb#12096 + sig { returns(Prism::Node) } def value; end class << self @@ -15700,78 +17581,107 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11689 + # source://prism//lib/prism/node.rb#12146 def type; end end end -# Represents the use of the `=>` operator. +# Represents assigning to a local variable using an operator that isn't `=`. # -# foo => bar -# ^^^^^^^^^^ -class Prism::MatchRequiredNode < ::Prism::Node - # def initialize: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> void +# target += value +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12155 +class Prism::LocalVariableOperatorWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Symbol operator, Integer depth, Location location) -> void # - # @return [MatchRequiredNode] a new instance of MatchRequiredNode + # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode # - # source://prism//prism/node.rb#11709 - def initialize(value, pattern, operator_loc, location); end + # source://prism//lib/prism/node.rb#12157 + def initialize(source, name_loc, operator_loc, value, name, operator, depth, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11717 + # source://prism//lib/prism/node.rb#12170 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11722 + # source://prism//lib/prism/node.rb#12175 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11732 + # source://prism//lib/prism/node.rb#12185 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11727 + # source://prism//lib/prism/node.rb#12180 def compact_child_nodes; end - # def copy: (**params) -> MatchRequiredNode + # def copy: (**params) -> LocalVariableOperatorWriteNode # - # source://prism//prism/node.rb#11737 + # source://prism//lib/prism/node.rb#12190 + sig { params(params: T.untyped).returns(Prism::LocalVariableOperatorWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11722 + # source://prism//lib/prism/node.rb#12175 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Node, name: Symbol, operator: Symbol, depth: Integer, location: Location } # - # source://prism//prism/node.rb#11750 + # source://prism//lib/prism/node.rb#12207 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # attr_reader depth: Integer # - # source://prism//prism/node.rb#11760 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#12233 + sig { returns(Integer) } + def depth; end - # def operator: () -> String - # - # source://prism//prism/node.rb#11755 - def operator; end + # source://prism//lib/prism/desugar_compiler.rb#209 + def desugar; end - # attr_reader operator_loc: Location + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11706 - def operator_loc; end + # source://prism//lib/prism/node.rb#12237 + def inspect(inspector = T.unsafe(nil)); end - # attr_reader pattern: Node + # attr_reader name: Symbol # - # source://prism//prism/node.rb#11703 - def pattern; end + # source://prism//lib/prism/node.rb#12227 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#12212 + sig { returns(Prism::Location) } + def name_loc; end + + # attr_reader operator: Symbol + # + # source://prism//lib/prism/node.rb#12230 + sig { returns(Symbol) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#12218 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -15788,12 +17698,13 @@ class Prism::MatchRequiredNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11784 + # source://prism//lib/prism/node.rb#12263 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#11700 + # source://prism//lib/prism/node.rb#12224 + sig { returns(Prism::Node) } def value; end class << self @@ -15804,74 +17715,107 @@ class Prism::MatchRequiredNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11794 + # source://prism//lib/prism/node.rb#12273 def type; end end end -# Represents writing local variables using a regular expression match with -# named capture groups. +# Represents the use of the `||=` operator for assignment to a local variable. # -# /(?bar)/ =~ baz -# ^^^^^^^^^^^^^^^^^^^^ -class Prism::MatchWriteNode < ::Prism::Node - # def initialize: (call: CallNode, targets: Array[Node], location: Location) -> void +# target ||= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12282 +class Prism::LocalVariableOrWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Integer depth, Location location) -> void # - # @return [MatchWriteNode] a new instance of MatchWriteNode + # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode # - # source://prism//prism/node.rb#11812 - def initialize(call, targets, location); end + # source://prism//lib/prism/node.rb#12284 + def initialize(source, name_loc, operator_loc, value, name, depth, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11819 + # source://prism//lib/prism/node.rb#12296 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader call: CallNode - # - # source://prism//prism/node.rb#11806 - def call; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11824 + # source://prism//lib/prism/node.rb#12301 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11834 + # source://prism//lib/prism/node.rb#12311 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11829 + # source://prism//lib/prism/node.rb#12306 def compact_child_nodes; end - # def copy: (**params) -> MatchWriteNode + # def copy: (**params) -> LocalVariableOrWriteNode # - # source://prism//prism/node.rb#11839 + # source://prism//lib/prism/node.rb#12316 + sig { params(params: T.untyped).returns(Prism::LocalVariableOrWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11824 + # source://prism//lib/prism/node.rb#12301 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location } # - # source://prism//prism/node.rb#11851 + # source://prism//lib/prism/node.rb#12332 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # attr_reader depth: Integer + # + # source://prism//lib/prism/node.rb#12355 + sig { returns(Integer) } + def depth; end + + # source://prism//lib/prism/desugar_compiler.rb#203 + def desugar; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11856 + # source://prism//lib/prism/node.rb#12364 def inspect(inspector = T.unsafe(nil)); end - # attr_reader targets: Array[Node] + # attr_reader name: Symbol # - # source://prism//prism/node.rb#11809 - def targets; end + # source://prism//lib/prism/node.rb#12352 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#12337 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#12359 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#12343 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -15888,9 +17832,15 @@ class Prism::MatchWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11878 + # source://prism//lib/prism/node.rb#12389 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#12349 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -15899,62 +17849,105 @@ class Prism::MatchWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11888 + # source://prism//lib/prism/node.rb#12399 def type; end end end -# Represents a node that is missing from the source and results in a syntax -# error. -class Prism::MissingNode < ::Prism::Node - # def initialize: (location: Location) -> void +# Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. +# +# foo +# ^^^ +# +# source://prism//lib/prism/node.rb#12408 +class Prism::LocalVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void # - # @return [MissingNode] a new instance of MissingNode + # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode # - # source://prism//prism/node.rb#11897 - def initialize(location); end + # source://prism//lib/prism/node.rb#12410 + def initialize(source, name, depth, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#11902 + # source://prism//lib/prism/node.rb#12419 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11907 + # source://prism//lib/prism/node.rb#12424 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#11917 + # source://prism//lib/prism/node.rb#12434 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#11912 + # source://prism//lib/prism/node.rb#12429 def compact_child_nodes; end - # def copy: (**params) -> MissingNode + # def copy: (**params) -> LocalVariableReadNode # - # source://prism//prism/node.rb#11922 + # source://prism//lib/prism/node.rb#12439 + sig { params(params: T.untyped).returns(Prism::LocalVariableReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#11907 + # source://prism//lib/prism/node.rb#12424 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism//prism/node.rb#11932 + # source://prism//lib/prism/node.rb#12452 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # The number of visible scopes that should be searched to find the origin of this local variable. + # + # foo = 1; foo # depth 0 + # + # bar = 2; tap { bar } # depth 1 + # + # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). + # + # source://prism//lib/prism/node.rb#12478 + sig { returns(Integer) } + def depth; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#11937 + # source://prism//lib/prism/node.rb#12482 def inspect(inspector = T.unsafe(nil)); end + # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # x # name `:x` + # + # _Test # name `:_Test` + # + # Note that this can also be an underscore followed by a number for the default block parameters. + # + # _1 # name `:_1` + # + # Finally, for the default `it` block parameter, the name is `0it`. This is to distinguish it from an `it` local variable that is explicitly declared. + # + # it # name `:0it` + # + # source://prism//lib/prism/node.rb#12469 + sig { returns(Symbol) } + def name; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -15970,7 +17963,7 @@ class Prism::MissingNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#11956 + # source://prism//lib/prism/node.rb#12503 def type; end class << self @@ -15981,102 +17974,85 @@ class Prism::MissingNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#11966 + # source://prism//lib/prism/node.rb#12513 def type; end end end -# Represents a module declaration involving the `module` keyword. +# Represents writing to a local variable in a context that doesn't have an explicit value. # -# module Foo end -# ^^^^^^^^^^^^^^ -class Prism::ModuleNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], module_keyword_loc: Location, constant_path: Node, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location) -> void +# foo, bar = baz +# ^^^ ^^^ +# +# source://prism//lib/prism/node.rb#12522 +class Prism::LocalVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void # - # @return [ModuleNode] a new instance of ModuleNode + # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode # - # source://prism//prism/node.rb#11995 - def initialize(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end + # source://prism//lib/prism/node.rb#12524 + def initialize(source, name, depth, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12006 + # source://prism//lib/prism/node.rb#12533 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader body: Node? - # - # source://prism//prism/node.rb#11986 - def body; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12011 + # source://prism//lib/prism/node.rb#12538 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12024 + # source://prism//lib/prism/node.rb#12548 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12016 + # source://prism//lib/prism/node.rb#12543 def compact_child_nodes; end - # attr_reader constant_path: Node - # - # source://prism//prism/node.rb#11983 - def constant_path; end - - # def copy: (**params) -> ModuleNode + # def copy: (**params) -> LocalVariableTargetNode # - # source://prism//prism/node.rb#12029 + # source://prism//lib/prism/node.rb#12553 + sig { params(params: T.untyped).returns(Prism::LocalVariableTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12011 + # source://prism//lib/prism/node.rb#12538 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism//prism/node.rb#12045 + # source://prism//lib/prism/node.rb#12566 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def end_keyword: () -> String - # - # source://prism//prism/node.rb#12055 - def end_keyword; end - - # attr_reader end_keyword_loc: Location + # attr_reader depth: Integer # - # source://prism//prism/node.rb#11989 - def end_keyword_loc; end + # source://prism//lib/prism/node.rb#12574 + sig { returns(Integer) } + def depth; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12060 + # source://prism//lib/prism/node.rb#12578 def inspect(inspector = T.unsafe(nil)); end - # attr_reader locals: Array[Symbol] - # - # source://prism//prism/node.rb#11977 - def locals; end - - # def module_keyword: () -> String - # - # source://prism//prism/node.rb#12050 - def module_keyword; end - - # attr_reader module_keyword_loc: Location - # - # source://prism//prism/node.rb#11980 - def module_keyword_loc; end - # attr_reader name: Symbol # - # source://prism//prism/node.rb#11992 + # source://prism//lib/prism/node.rb#12571 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -16094,7 +18070,7 @@ class Prism::ModuleNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12091 + # source://prism//lib/prism/node.rb#12599 def type; end class << self @@ -16105,98 +18081,104 @@ class Prism::ModuleNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12101 + # source://prism//lib/prism/node.rb#12609 def type; end end end -# Represents a multi-target expression. +# Represents writing to a local variable. # -# a, (b, c) = 1, 2, 3 -# ^^^^^^ -class Prism::MultiTargetNode < ::Prism::Node - # def initialize: (lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, location: Location) -> void +# foo = 1 +# ^^^^^^^ +# +# source://prism//lib/prism/node.rb#12618 +class Prism::LocalVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location name_loc, Node value, Location operator_loc, Location location) -> void # - # @return [MultiTargetNode] a new instance of MultiTargetNode + # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode # - # source://prism//prism/node.rb#12127 - def initialize(lefts, rest, rights, lparen_loc, rparen_loc, location); end + # source://prism//lib/prism/node.rb#12620 + def initialize(source, name, depth, name_loc, value, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12137 + # source://prism//lib/prism/node.rb#12632 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12142 + # source://prism//lib/prism/node.rb#12637 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12156 + # source://prism//lib/prism/node.rb#12647 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12147 + # source://prism//lib/prism/node.rb#12642 def compact_child_nodes; end - # def copy: (**params) -> MultiTargetNode + # def copy: (**params) -> LocalVariableWriteNode # - # source://prism//prism/node.rb#12161 + # source://prism//lib/prism/node.rb#12652 + sig { params(params: T.untyped).returns(Prism::LocalVariableWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12142 + # source://prism//lib/prism/node.rb#12637 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#12176 + # source://prism//lib/prism/node.rb#12668 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#12191 - def inspect(inspector = T.unsafe(nil)); end - - # attr_reader lefts: Array[Node] - # - # source://prism//prism/node.rb#12112 - def lefts; end - - # def lparen: () -> String? + # attr_reader depth: Integer # - # source://prism//prism/node.rb#12181 - def lparen; end + # source://prism//lib/prism/node.rb#12676 + sig { returns(Integer) } + def depth; end - # attr_reader lparen_loc: Location? + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12121 - def lparen_loc; end + # source://prism//lib/prism/node.rb#12700 + def inspect(inspector = T.unsafe(nil)); end - # attr_reader rest: Node? + # attr_reader name: Symbol # - # source://prism//prism/node.rb#12115 - def rest; end + # source://prism//lib/prism/node.rb#12673 + sig { returns(Symbol) } + def name; end - # attr_reader rights: Array[Node] + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#12118 - def rights; end + # source://prism//lib/prism/node.rb#12679 + sig { returns(Prism::Location) } + def name_loc; end - # def rparen: () -> String? + # def operator: () -> String # - # source://prism//prism/node.rb#12186 - def rparen; end + # source://prism//lib/prism/node.rb#12695 + sig { returns(String) } + def operator; end - # attr_reader rparen_loc: Location? + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#12124 - def rparen_loc; end + # source://prism//lib/prism/node.rb#12688 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -16213,9 +18195,15 @@ class Prism::MultiTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12220 + # source://prism//lib/prism/node.rb#12725 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#12685 + sig { returns(Prism::Node) } + def value; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -16224,957 +18212,782 @@ class Prism::MultiTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12230 + # source://prism//lib/prism/node.rb#12735 def type; end end end -# Represents a write to a multi-target expression. +# This represents a location in the source. # -# a, b, c = 1, 2, 3 -# ^^^^^^^^^^^^^^^^^ -class Prism::MultiWriteNode < ::Prism::Node - # def initialize: (lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Node, location: Location) -> void +# source://prism//lib/prism/parse_result.rb#98 +class Prism::Location + # Create a new location object with the given source, start byte offset, and + # byte length. # - # @return [MultiWriteNode] a new instance of MultiWriteNode + # @return [Location] a new instance of Location # - # source://prism//prism/node.rb#12262 - def initialize(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end + # source://prism//lib/prism/parse_result.rb#116 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void } + def initialize(source, start_offset, length); end - # def accept: (visitor: Visitor) -> void + # Returns true if the given other location is equal to this location. # - # source://prism//prism/node.rb#12274 - def accept(visitor); end + # source://prism//lib/prism/parse_result.rb#232 + def ==(other); end - # def child_nodes: () -> Array[nil | Node] + # The list of comments attached to this location # - # source://prism//prism/node.rb#12279 - def child_nodes; end + # source://prism//lib/prism/parse_result.rb#112 + sig { returns(T::Array[Prism::Comment]) } + def comments; end - # def comment_targets: () -> Array[Node | Location] + # Create a new location object with the given options. # - # source://prism//prism/node.rb#12294 - def comment_targets; end + # source://prism//lib/prism/parse_result.rb#124 + sig { params(options: T.untyped).returns(Prism::Location) } + def copy(**options); end - # def compact_child_nodes: () -> Array[Node] + # Implement the hash pattern matching interface for Location. # - # source://prism//prism/node.rb#12284 - def compact_child_nodes; end + # source://prism//lib/prism/parse_result.rb#222 + def deconstruct_keys(keys); end - # def copy: (**params) -> MultiWriteNode + # The column number in characters where this location ends from the start of + # the line. # - # source://prism//prism/node.rb#12299 - def copy(**params); end + # source://prism//lib/prism/parse_result.rb#211 + def end_character_column; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # The character offset from the beginning of the source where this location + # ends. # - # source://prism//prism/node.rb#12279 - def deconstruct; end + # source://prism//lib/prism/parse_result.rb#160 + def end_character_offset; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # The column number in code units of the given encoding where this location + # ends from the start of the line. # - # source://prism//prism/node.rb#12316 - def deconstruct_keys(keys); end + # source://prism//lib/prism/parse_result.rb#217 + def end_code_units_column(encoding = T.unsafe(nil)); end - # def inspect(inspector: NodeInspector) -> String + # The offset from the start of the file in code units of the given encoding. # - # source://prism//prism/node.rb#12336 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/parse_result.rb#165 + def end_code_units_offset(encoding = T.unsafe(nil)); end - # attr_reader lefts: Array[Node] + # The column number in bytes where this location ends from the start of the + # line. # - # source://prism//prism/node.rb#12241 - def lefts; end + # source://prism//lib/prism/parse_result.rb#205 + sig { returns(Integer) } + def end_column; end - # def lparen: () -> String? + # The line number where this location ends. # - # source://prism//prism/node.rb#12321 - def lparen; end + # source://prism//lib/prism/parse_result.rb#181 + sig { returns(Integer) } + def end_line; end - # attr_reader lparen_loc: Location? + # The byte offset from the beginning of the source where this location ends. # - # source://prism//prism/node.rb#12250 - def lparen_loc; end + # source://prism//lib/prism/parse_result.rb#154 + sig { returns(Integer) } + def end_offset; end - # def operator: () -> String + # Returns a string representation of this location. # - # source://prism//prism/node.rb#12331 - def operator; end + # source://prism//lib/prism/parse_result.rb#133 + def inspect; end - # attr_reader operator_loc: Location + # Returns a new location that stretches from this location to the given + # other location. Raises an error if this location is not before the other + # location or if they don't share the same source. # - # source://prism//prism/node.rb#12256 - def operator_loc; end + # source://prism//lib/prism/parse_result.rb#241 + def join(other); end - # attr_reader rest: Node? + # The length of this location in bytes. # - # source://prism//prism/node.rb#12244 - def rest; end + # source://prism//lib/prism/parse_result.rb#109 + def length; end - # attr_reader rights: Array[Node] + # Implement the pretty print interface for Location. # - # source://prism//prism/node.rb#12247 - def rights; end + # source://prism//lib/prism/parse_result.rb#227 + def pretty_print(q); end - # def rparen: () -> String? + # The source code that this location represents. # - # source://prism//prism/node.rb#12326 - def rparen; end + # source://prism//lib/prism/parse_result.rb#138 + sig { returns(String) } + def slice; end - # attr_reader rparen_loc: Location? + # The column number in characters where this location ends from the start of + # the line. # - # source://prism//prism/node.rb#12253 - def rparen_loc; end + # source://prism//lib/prism/parse_result.rb#193 + def start_character_column; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # The character offset from the beginning of the source where this location + # starts. # - # source://prism//prism/node.rb#12368 - def type; end + # source://prism//lib/prism/parse_result.rb#144 + def start_character_offset; end - # attr_reader value: Node + # The column number in code units of the given encoding where this location + # starts from the start of the line. # - # source://prism//prism/node.rb#12259 - def value; end - - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#12378 - def type; end - end -end + # source://prism//lib/prism/parse_result.rb#199 + def start_code_units_column(encoding = T.unsafe(nil)); end -# This visitor walks through the tree and copies each node as it is being -# visited. This is useful for consumers that want to mutate the tree, as you -# can change subtrees in place without effecting the rest of the tree. -class Prism::MutationCompiler < ::Prism::Compiler - # Copy a AliasGlobalVariableNode node + # The offset from the start of the file in code units of the given encoding. # - # source://prism//prism/mutation_compiler.rb#14 - def visit_alias_global_variable_node(node); end + # source://prism//lib/prism/parse_result.rb#149 + def start_code_units_offset(encoding = T.unsafe(nil)); end - # Copy a AliasMethodNode node + # The column number in bytes where this location starts from the start of + # the line. # - # source://prism//prism/mutation_compiler.rb#19 - def visit_alias_method_node(node); end + # source://prism//lib/prism/parse_result.rb#187 + sig { returns(Integer) } + def start_column; end - # Copy a AlternationPatternNode node + # The line number where this location starts. # - # source://prism//prism/mutation_compiler.rb#24 - def visit_alternation_pattern_node(node); end + # source://prism//lib/prism/parse_result.rb#170 + sig { returns(Integer) } + def start_line; end - # Copy a AndNode node + # The content of the line where this location starts before this location. # - # source://prism//prism/mutation_compiler.rb#29 - def visit_and_node(node); end + # source://prism//lib/prism/parse_result.rb#175 + def start_line_slice; end - # Copy a ArgumentsNode node + # The byte offset from the beginning of the source where this location + # starts. # - # source://prism//prism/mutation_compiler.rb#34 - def visit_arguments_node(node); end + # source://prism//lib/prism/parse_result.rb#106 + sig { returns(Integer) } + def start_offset; end - # Copy a ArrayNode node - # - # source://prism//prism/mutation_compiler.rb#39 - def visit_array_node(node); end + protected - # Copy a ArrayPatternNode node + # A Source object that is used to determine more information from the given + # offset and length. # - # source://prism//prism/mutation_compiler.rb#44 - def visit_array_pattern_node(node); end + # source://prism//lib/prism/parse_result.rb#101 + def source; end - # Copy a AssocNode node - # - # source://prism//prism/mutation_compiler.rb#49 - def visit_assoc_node(node); end + class << self + # Returns a null location that does not correspond to a source and points to + # the beginning of the file. Useful for when you want a location object but + # do not care where it points. + # + # source://prism//lib/prism/parse_result.rb#251 + def null; end + end +end - # Copy a AssocSplatNode node - # - # source://prism//prism/mutation_compiler.rb#54 - def visit_assoc_splat_node(node); end +# Flags for while and until loop nodes. +# +# source://prism//lib/prism/node.rb#19298 +module Prism::LoopFlags; end - # Copy a BackReferenceReadNode node - # - # source://prism//prism/mutation_compiler.rb#59 - def visit_back_reference_read_node(node); end +# a loop after a begin statement, so the body is executed first before the condition +# +# source://prism//lib/prism/node.rb#19300 +Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) - # Copy a BeginNode node +# This represents a magic comment that was encountered during parsing. +# +# source://prism//lib/prism/parse_result.rb#303 +class Prism::MagicComment + # Create a new magic comment object with the given key and value locations. # - # source://prism//prism/mutation_compiler.rb#64 - def visit_begin_node(node); end - - # Copy a BlockArgumentNode node + # @return [MagicComment] a new instance of MagicComment # - # source://prism//prism/mutation_compiler.rb#69 - def visit_block_argument_node(node); end + # source://prism//lib/prism/parse_result.rb#311 + def initialize(key_loc, value_loc); end - # Copy a BlockLocalVariableNode node + # Implement the hash pattern matching interface for MagicComment. # - # source://prism//prism/mutation_compiler.rb#74 - def visit_block_local_variable_node(node); end + # source://prism//lib/prism/parse_result.rb#327 + def deconstruct_keys(keys); end - # Copy a BlockNode node + # Returns a string representation of this magic comment. # - # source://prism//prism/mutation_compiler.rb#79 - def visit_block_node(node); end + # source://prism//lib/prism/parse_result.rb#332 + def inspect; end - # Copy a BlockParameterNode node + # Returns the key of the magic comment by slicing it from the source code. # - # source://prism//prism/mutation_compiler.rb#84 - def visit_block_parameter_node(node); end + # source://prism//lib/prism/parse_result.rb#317 + def key; end - # Copy a BlockParametersNode node + # A Location object representing the location of the key in the source. # - # source://prism//prism/mutation_compiler.rb#89 - def visit_block_parameters_node(node); end + # source://prism//lib/prism/parse_result.rb#305 + def key_loc; end - # Copy a BreakNode node + # Returns the value of the magic comment by slicing it from the source code. # - # source://prism//prism/mutation_compiler.rb#94 - def visit_break_node(node); end + # source://prism//lib/prism/parse_result.rb#322 + def value; end - # Copy a CallAndWriteNode node + # A Location object representing the location of the value in the source. # - # source://prism//prism/mutation_compiler.rb#99 - def visit_call_and_write_node(node); end + # source://prism//lib/prism/parse_result.rb#308 + def value_loc; end +end - # Copy a CallNode node - # - # source://prism//prism/mutation_compiler.rb#104 - def visit_call_node(node); end +# Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. +# +# if /foo/i then end +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#12744 +class Prism::MatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions - # Copy a CallOperatorWriteNode node + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void # - # source://prism//prism/mutation_compiler.rb#109 - def visit_call_operator_write_node(node); end - - # Copy a CallOrWriteNode node + # @return [MatchLastLineNode] a new instance of MatchLastLineNode # - # source://prism//prism/mutation_compiler.rb#114 - def visit_call_or_write_node(node); end + # source://prism//lib/prism/node.rb#12746 + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end - # Copy a CallTargetNode node + # def accept: (Visitor visitor) -> void # - # source://prism//prism/mutation_compiler.rb#119 - def visit_call_target_node(node); end + # source://prism//lib/prism/node.rb#12758 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # Copy a CapturePatternNode node + # def ascii_8bit?: () -> bool # - # source://prism//prism/mutation_compiler.rb#124 - def visit_capture_pattern_node(node); end - - # Copy a CaseMatchNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#129 - def visit_case_match_node(node); end + # source://prism//lib/prism/node.rb#12850 + sig { returns(T::Boolean) } + def ascii_8bit?; end - # Copy a CaseNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#134 - def visit_case_node(node); end + # source://prism//lib/prism/node.rb#12763 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a ClassNode node + # def closing: () -> String # - # source://prism//prism/mutation_compiler.rb#139 - def visit_class_node(node); end + # source://prism//lib/prism/node.rb#12890 + sig { returns(String) } + def closing; end - # Copy a ClassVariableAndWriteNode node + # attr_reader closing_loc: Location # - # source://prism//prism/mutation_compiler.rb#144 - def visit_class_variable_and_write_node(node); end + # source://prism//lib/prism/node.rb#12815 + sig { returns(Prism::Location) } + def closing_loc; end - # Copy a ClassVariableOperatorWriteNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/mutation_compiler.rb#149 - def visit_class_variable_operator_write_node(node); end + # source://prism//lib/prism/node.rb#12773 + def comment_targets; end - # Copy a ClassVariableOrWriteNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/mutation_compiler.rb#154 - def visit_class_variable_or_write_node(node); end + # source://prism//lib/prism/node.rb#12768 + def compact_child_nodes; end - # Copy a ClassVariableReadNode node + # def content: () -> String # - # source://prism//prism/mutation_compiler.rb#159 - def visit_class_variable_read_node(node); end + # source://prism//lib/prism/node.rb#12885 + sig { returns(String) } + def content; end - # Copy a ClassVariableTargetNode node + # attr_reader content_loc: Location # - # source://prism//prism/mutation_compiler.rb#164 - def visit_class_variable_target_node(node); end + # source://prism//lib/prism/node.rb#12809 + sig { returns(Prism::Location) } + def content_loc; end - # Copy a ClassVariableWriteNode node + # def copy: (**params) -> MatchLastLineNode # - # source://prism//prism/mutation_compiler.rb#169 - def visit_class_variable_write_node(node); end + # source://prism//lib/prism/node.rb#12778 + sig { params(params: T.untyped).returns(Prism::MatchLastLineNode) } + def copy(**params); end - # Copy a ConstantAndWriteNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#174 - def visit_constant_and_write_node(node); end + # source://prism//lib/prism/node.rb#12763 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a ConstantOperatorWriteNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism//prism/mutation_compiler.rb#179 - def visit_constant_operator_write_node(node); end + # source://prism//lib/prism/node.rb#12794 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # Copy a ConstantOrWriteNode node + # def euc_jp?: () -> bool # - # source://prism//prism/mutation_compiler.rb#184 - def visit_constant_or_write_node(node); end - - # Copy a ConstantPathAndWriteNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#189 - def visit_constant_path_and_write_node(node); end + # source://prism//lib/prism/node.rb#12845 + sig { returns(T::Boolean) } + def euc_jp?; end - # Copy a ConstantPathNode node + # def extended?: () -> bool # - # source://prism//prism/mutation_compiler.rb#194 - def visit_constant_path_node(node); end - - # Copy a ConstantPathOperatorWriteNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#199 - def visit_constant_path_operator_write_node(node); end + # source://prism//lib/prism/node.rb#12830 + sig { returns(T::Boolean) } + def extended?; end - # Copy a ConstantPathOrWriteNode node + # def forced_binary_encoding?: () -> bool # - # source://prism//prism/mutation_compiler.rb#204 - def visit_constant_path_or_write_node(node); end - - # Copy a ConstantPathTargetNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#209 - def visit_constant_path_target_node(node); end + # source://prism//lib/prism/node.rb#12870 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # Copy a ConstantPathWriteNode node + # def forced_us_ascii_encoding?: () -> bool # - # source://prism//prism/mutation_compiler.rb#214 - def visit_constant_path_write_node(node); end - - # Copy a ConstantReadNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#219 - def visit_constant_read_node(node); end + # source://prism//lib/prism/node.rb#12875 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end - # Copy a ConstantTargetNode node + # def forced_utf8_encoding?: () -> bool # - # source://prism//prism/mutation_compiler.rb#224 - def visit_constant_target_node(node); end - - # Copy a ConstantWriteNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#229 - def visit_constant_write_node(node); end + # source://prism//lib/prism/node.rb#12865 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # Copy a DefNode node + # def ignore_case?: () -> bool # - # source://prism//prism/mutation_compiler.rb#234 - def visit_def_node(node); end - - # Copy a DefinedNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#239 - def visit_defined_node(node); end + # source://prism//lib/prism/node.rb#12825 + sig { returns(T::Boolean) } + def ignore_case?; end - # Copy a ElseNode node + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/mutation_compiler.rb#244 - def visit_else_node(node); end + # source://prism//lib/prism/node.rb#12895 + def inspect(inspector = T.unsafe(nil)); end - # Copy a EmbeddedStatementsNode node + # def multi_line?: () -> bool # - # source://prism//prism/mutation_compiler.rb#249 - def visit_embedded_statements_node(node); end - - # Copy a EmbeddedVariableNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#254 - def visit_embedded_variable_node(node); end + # source://prism//lib/prism/node.rb#12835 + sig { returns(T::Boolean) } + def multi_line?; end - # Copy a EnsureNode node + # def once?: () -> bool # - # source://prism//prism/mutation_compiler.rb#259 - def visit_ensure_node(node); end - - # Copy a FalseNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#264 - def visit_false_node(node); end + # source://prism//lib/prism/node.rb#12840 + sig { returns(T::Boolean) } + def once?; end - # Copy a FindPatternNode node + # def opening: () -> String # - # source://prism//prism/mutation_compiler.rb#269 - def visit_find_pattern_node(node); end + # source://prism//lib/prism/node.rb#12880 + sig { returns(String) } + def opening; end - # Copy a FlipFlopNode node + # attr_reader opening_loc: Location # - # source://prism//prism/mutation_compiler.rb#274 - def visit_flip_flop_node(node); end + # source://prism//lib/prism/node.rb#12803 + sig { returns(Prism::Location) } + def opening_loc; end - # Copy a FloatNode node + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/mutation_compiler.rb#279 - def visit_float_node(node); end - - # Copy a ForNode node + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/mutation_compiler.rb#284 - def visit_for_node(node); end - - # Copy a ForwardingArgumentsNode node + # def type: () -> Symbol # - # source://prism//prism/mutation_compiler.rb#289 - def visit_forwarding_arguments_node(node); end + # source://prism//lib/prism/node.rb#12920 + def type; end - # Copy a ForwardingParameterNode node + # attr_reader unescaped: String # - # source://prism//prism/mutation_compiler.rb#294 - def visit_forwarding_parameter_node(node); end + # source://prism//lib/prism/node.rb#12821 + sig { returns(String) } + def unescaped; end - # Copy a ForwardingSuperNode node + # def utf_8?: () -> bool # - # source://prism//prism/mutation_compiler.rb#299 - def visit_forwarding_super_node(node); end - - # Copy a GlobalVariableAndWriteNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#304 - def visit_global_variable_and_write_node(node); end + # source://prism//lib/prism/node.rb#12860 + sig { returns(T::Boolean) } + def utf_8?; end - # Copy a GlobalVariableOperatorWriteNode node + # def windows_31j?: () -> bool # - # source://prism//prism/mutation_compiler.rb#309 - def visit_global_variable_operator_write_node(node); end - - # Copy a GlobalVariableOrWriteNode node + # @return [Boolean] # - # source://prism//prism/mutation_compiler.rb#314 - def visit_global_variable_or_write_node(node); end + # source://prism//lib/prism/node.rb#12855 + sig { returns(T::Boolean) } + def windows_31j?; end - # Copy a GlobalVariableReadNode node - # - # source://prism//prism/mutation_compiler.rb#319 - def visit_global_variable_read_node(node); end + private - # Copy a GlobalVariableTargetNode node + # private attr_reader flags: Integer # - # source://prism//prism/mutation_compiler.rb#324 - def visit_global_variable_target_node(node); end + # source://prism//lib/prism/node.rb#12799 + sig { returns(Integer) } + def flags; end - # Copy a GlobalVariableWriteNode node - # - # source://prism//prism/mutation_compiler.rb#329 - def visit_global_variable_write_node(node); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#12930 + def type; end + end +end - # Copy a HashNode node +# Represents the use of the modifier `in` operator. +# +# foo in bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#12939 +class Prism::MatchPredicateNode < ::Prism::Node + # def initialize: (Node value, Node pattern, Location operator_loc, Location location) -> void # - # source://prism//prism/mutation_compiler.rb#334 - def visit_hash_node(node); end - - # Copy a HashPatternNode node + # @return [MatchPredicateNode] a new instance of MatchPredicateNode # - # source://prism//prism/mutation_compiler.rb#339 - def visit_hash_pattern_node(node); end + # source://prism//lib/prism/node.rb#12941 + def initialize(source, value, pattern, operator_loc, location); end - # Copy a IfNode node + # def accept: (Visitor visitor) -> void # - # source://prism//prism/mutation_compiler.rb#344 - def visit_if_node(node); end + # source://prism//lib/prism/node.rb#12951 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # Copy a ImaginaryNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#349 - def visit_imaginary_node(node); end + # source://prism//lib/prism/node.rb#12956 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a ImplicitNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/mutation_compiler.rb#354 - def visit_implicit_node(node); end + # source://prism//lib/prism/node.rb#12966 + def comment_targets; end - # Copy a ImplicitRestNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/mutation_compiler.rb#359 - def visit_implicit_rest_node(node); end + # source://prism//lib/prism/node.rb#12961 + def compact_child_nodes; end - # Copy a InNode node + # def copy: (**params) -> MatchPredicateNode # - # source://prism//prism/mutation_compiler.rb#364 - def visit_in_node(node); end + # source://prism//lib/prism/node.rb#12971 + sig { params(params: T.untyped).returns(Prism::MatchPredicateNode) } + def copy(**params); end - # Copy a IndexAndWriteNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#369 - def visit_index_and_write_node(node); end + # source://prism//lib/prism/node.rb#12956 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a IndexOperatorWriteNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, pattern: Node, operator_loc: Location, location: Location } # - # source://prism//prism/mutation_compiler.rb#374 - def visit_index_operator_write_node(node); end + # source://prism//lib/prism/node.rb#12985 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # Copy a IndexOrWriteNode node + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/mutation_compiler.rb#379 - def visit_index_or_write_node(node); end + # source://prism//lib/prism/node.rb#13008 + def inspect(inspector = T.unsafe(nil)); end - # Copy a IndexTargetNode node + # def operator: () -> String # - # source://prism//prism/mutation_compiler.rb#384 - def visit_index_target_node(node); end + # source://prism//lib/prism/node.rb#13003 + sig { returns(String) } + def operator; end - # Copy a InstanceVariableAndWriteNode node + # attr_reader operator_loc: Location # - # source://prism//prism/mutation_compiler.rb#389 - def visit_instance_variable_and_write_node(node); end + # source://prism//lib/prism/node.rb#12996 + sig { returns(Prism::Location) } + def operator_loc; end - # Copy a InstanceVariableOperatorWriteNode node + # attr_reader pattern: Node # - # source://prism//prism/mutation_compiler.rb#394 - def visit_instance_variable_operator_write_node(node); end + # source://prism//lib/prism/node.rb#12993 + sig { returns(Prism::Node) } + def pattern; end - # Copy a InstanceVariableOrWriteNode node + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/mutation_compiler.rb#399 - def visit_instance_variable_or_write_node(node); end - - # Copy a InstanceVariableReadNode node + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/mutation_compiler.rb#404 - def visit_instance_variable_read_node(node); end - - # Copy a InstanceVariableTargetNode node + # def type: () -> Symbol # - # source://prism//prism/mutation_compiler.rb#409 - def visit_instance_variable_target_node(node); end + # source://prism//lib/prism/node.rb#13032 + def type; end - # Copy a InstanceVariableWriteNode node + # attr_reader value: Node # - # source://prism//prism/mutation_compiler.rb#414 - def visit_instance_variable_write_node(node); end + # source://prism//lib/prism/node.rb#12990 + sig { returns(Prism::Node) } + def value; end - # Copy a IntegerNode node - # - # source://prism//prism/mutation_compiler.rb#419 - def visit_integer_node(node); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13042 + def type; end + end +end - # Copy a InterpolatedMatchLastLineNode node +# Represents the use of the `=>` operator. +# +# foo => bar +# ^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13051 +class Prism::MatchRequiredNode < ::Prism::Node + # def initialize: (Node value, Node pattern, Location operator_loc, Location location) -> void # - # source://prism//prism/mutation_compiler.rb#424 - def visit_interpolated_match_last_line_node(node); end - - # Copy a InterpolatedRegularExpressionNode node + # @return [MatchRequiredNode] a new instance of MatchRequiredNode # - # source://prism//prism/mutation_compiler.rb#429 - def visit_interpolated_regular_expression_node(node); end + # source://prism//lib/prism/node.rb#13053 + def initialize(source, value, pattern, operator_loc, location); end - # Copy a InterpolatedStringNode node + # def accept: (Visitor visitor) -> void # - # source://prism//prism/mutation_compiler.rb#434 - def visit_interpolated_string_node(node); end + # source://prism//lib/prism/node.rb#13063 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # Copy a InterpolatedSymbolNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#439 - def visit_interpolated_symbol_node(node); end + # source://prism//lib/prism/node.rb#13068 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a InterpolatedXStringNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/mutation_compiler.rb#444 - def visit_interpolated_x_string_node(node); end + # source://prism//lib/prism/node.rb#13078 + def comment_targets; end - # Copy a KeywordHashNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/mutation_compiler.rb#449 - def visit_keyword_hash_node(node); end + # source://prism//lib/prism/node.rb#13073 + def compact_child_nodes; end - # Copy a KeywordRestParameterNode node + # def copy: (**params) -> MatchRequiredNode # - # source://prism//prism/mutation_compiler.rb#454 - def visit_keyword_rest_parameter_node(node); end + # source://prism//lib/prism/node.rb#13083 + sig { params(params: T.untyped).returns(Prism::MatchRequiredNode) } + def copy(**params); end - # Copy a LambdaNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/mutation_compiler.rb#459 - def visit_lambda_node(node); end + # source://prism//lib/prism/node.rb#13068 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a LocalVariableAndWriteNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, pattern: Node, operator_loc: Location, location: Location } # - # source://prism//prism/mutation_compiler.rb#464 - def visit_local_variable_and_write_node(node); end + # source://prism//lib/prism/node.rb#13097 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # Copy a LocalVariableOperatorWriteNode node + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/mutation_compiler.rb#469 - def visit_local_variable_operator_write_node(node); end + # source://prism//lib/prism/node.rb#13120 + def inspect(inspector = T.unsafe(nil)); end - # Copy a LocalVariableOrWriteNode node + # def operator: () -> String # - # source://prism//prism/mutation_compiler.rb#474 - def visit_local_variable_or_write_node(node); end + # source://prism//lib/prism/node.rb#13115 + sig { returns(String) } + def operator; end - # Copy a LocalVariableReadNode node + # attr_reader operator_loc: Location # - # source://prism//prism/mutation_compiler.rb#479 - def visit_local_variable_read_node(node); end + # source://prism//lib/prism/node.rb#13108 + sig { returns(Prism::Location) } + def operator_loc; end - # Copy a LocalVariableTargetNode node + # attr_reader pattern: Node # - # source://prism//prism/mutation_compiler.rb#484 - def visit_local_variable_target_node(node); end + # source://prism//lib/prism/node.rb#13105 + sig { returns(Prism::Node) } + def pattern; end - # Copy a LocalVariableWriteNode node + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/mutation_compiler.rb#489 - def visit_local_variable_write_node(node); end - - # Copy a MatchLastLineNode node + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/mutation_compiler.rb#494 - def visit_match_last_line_node(node); end - - # Copy a MatchPredicateNode node + # def type: () -> Symbol # - # source://prism//prism/mutation_compiler.rb#499 - def visit_match_predicate_node(node); end + # source://prism//lib/prism/node.rb#13144 + def type; end - # Copy a MatchRequiredNode node + # attr_reader value: Node # - # source://prism//prism/mutation_compiler.rb#504 - def visit_match_required_node(node); end + # source://prism//lib/prism/node.rb#13102 + sig { returns(Prism::Node) } + def value; end - # Copy a MatchWriteNode node - # - # source://prism//prism/mutation_compiler.rb#509 - def visit_match_write_node(node); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13154 + def type; end + end +end - # Copy a MissingNode node - # - # source://prism//prism/mutation_compiler.rb#514 - def visit_missing_node(node); end - - # Copy a ModuleNode node - # - # source://prism//prism/mutation_compiler.rb#519 - def visit_module_node(node); end - - # Copy a MultiTargetNode node - # - # source://prism//prism/mutation_compiler.rb#524 - def visit_multi_target_node(node); end - - # Copy a MultiWriteNode node - # - # source://prism//prism/mutation_compiler.rb#529 - def visit_multi_write_node(node); end - - # Copy a NextNode node - # - # source://prism//prism/mutation_compiler.rb#534 - def visit_next_node(node); end - - # Copy a NilNode node - # - # source://prism//prism/mutation_compiler.rb#539 - def visit_nil_node(node); end - - # Copy a NoKeywordsParameterNode node - # - # source://prism//prism/mutation_compiler.rb#544 - def visit_no_keywords_parameter_node(node); end - - # Copy a NumberedParametersNode node - # - # source://prism//prism/mutation_compiler.rb#549 - def visit_numbered_parameters_node(node); end - - # Copy a NumberedReferenceReadNode node - # - # source://prism//prism/mutation_compiler.rb#554 - def visit_numbered_reference_read_node(node); end - - # Copy a OptionalKeywordParameterNode node - # - # source://prism//prism/mutation_compiler.rb#559 - def visit_optional_keyword_parameter_node(node); end - - # Copy a OptionalParameterNode node - # - # source://prism//prism/mutation_compiler.rb#564 - def visit_optional_parameter_node(node); end - - # Copy a OrNode node - # - # source://prism//prism/mutation_compiler.rb#569 - def visit_or_node(node); end - - # Copy a ParametersNode node - # - # source://prism//prism/mutation_compiler.rb#574 - def visit_parameters_node(node); end - - # Copy a ParenthesesNode node - # - # source://prism//prism/mutation_compiler.rb#579 - def visit_parentheses_node(node); end - - # Copy a PinnedExpressionNode node - # - # source://prism//prism/mutation_compiler.rb#584 - def visit_pinned_expression_node(node); end - - # Copy a PinnedVariableNode node - # - # source://prism//prism/mutation_compiler.rb#589 - def visit_pinned_variable_node(node); end - - # Copy a PostExecutionNode node - # - # source://prism//prism/mutation_compiler.rb#594 - def visit_post_execution_node(node); end - - # Copy a PreExecutionNode node - # - # source://prism//prism/mutation_compiler.rb#599 - def visit_pre_execution_node(node); end - - # Copy a ProgramNode node - # - # source://prism//prism/mutation_compiler.rb#604 - def visit_program_node(node); end - - # Copy a RangeNode node - # - # source://prism//prism/mutation_compiler.rb#609 - def visit_range_node(node); end - - # Copy a RationalNode node - # - # source://prism//prism/mutation_compiler.rb#614 - def visit_rational_node(node); end - - # Copy a RedoNode node - # - # source://prism//prism/mutation_compiler.rb#619 - def visit_redo_node(node); end - - # Copy a RegularExpressionNode node - # - # source://prism//prism/mutation_compiler.rb#624 - def visit_regular_expression_node(node); end - - # Copy a RequiredKeywordParameterNode node - # - # source://prism//prism/mutation_compiler.rb#629 - def visit_required_keyword_parameter_node(node); end - - # Copy a RequiredParameterNode node - # - # source://prism//prism/mutation_compiler.rb#634 - def visit_required_parameter_node(node); end - - # Copy a RescueModifierNode node - # - # source://prism//prism/mutation_compiler.rb#639 - def visit_rescue_modifier_node(node); end - - # Copy a RescueNode node - # - # source://prism//prism/mutation_compiler.rb#644 - def visit_rescue_node(node); end - - # Copy a RestParameterNode node - # - # source://prism//prism/mutation_compiler.rb#649 - def visit_rest_parameter_node(node); end - - # Copy a RetryNode node - # - # source://prism//prism/mutation_compiler.rb#654 - def visit_retry_node(node); end - - # Copy a ReturnNode node - # - # source://prism//prism/mutation_compiler.rb#659 - def visit_return_node(node); end - - # Copy a SelfNode node - # - # source://prism//prism/mutation_compiler.rb#664 - def visit_self_node(node); end - - # Copy a SingletonClassNode node - # - # source://prism//prism/mutation_compiler.rb#669 - def visit_singleton_class_node(node); end - - # Copy a SourceEncodingNode node - # - # source://prism//prism/mutation_compiler.rb#674 - def visit_source_encoding_node(node); end - - # Copy a SourceFileNode node - # - # source://prism//prism/mutation_compiler.rb#679 - def visit_source_file_node(node); end - - # Copy a SourceLineNode node - # - # source://prism//prism/mutation_compiler.rb#684 - def visit_source_line_node(node); end - - # Copy a SplatNode node - # - # source://prism//prism/mutation_compiler.rb#689 - def visit_splat_node(node); end - - # Copy a StatementsNode node - # - # source://prism//prism/mutation_compiler.rb#694 - def visit_statements_node(node); end - - # Copy a StringNode node - # - # source://prism//prism/mutation_compiler.rb#699 - def visit_string_node(node); end - - # Copy a SuperNode node - # - # source://prism//prism/mutation_compiler.rb#704 - def visit_super_node(node); end - - # Copy a SymbolNode node - # - # source://prism//prism/mutation_compiler.rb#709 - def visit_symbol_node(node); end - - # Copy a TrueNode node - # - # source://prism//prism/mutation_compiler.rb#714 - def visit_true_node(node); end - - # Copy a UndefNode node - # - # source://prism//prism/mutation_compiler.rb#719 - def visit_undef_node(node); end - - # Copy a UnlessNode node - # - # source://prism//prism/mutation_compiler.rb#724 - def visit_unless_node(node); end - - # Copy a UntilNode node - # - # source://prism//prism/mutation_compiler.rb#729 - def visit_until_node(node); end - - # Copy a WhenNode node - # - # source://prism//prism/mutation_compiler.rb#734 - def visit_when_node(node); end - - # Copy a WhileNode node - # - # source://prism//prism/mutation_compiler.rb#739 - def visit_while_node(node); end - - # Copy a XStringNode node - # - # source://prism//prism/mutation_compiler.rb#744 - def visit_x_string_node(node); end - - # Copy a YieldNode node - # - # source://prism//prism/mutation_compiler.rb#749 - def visit_yield_node(node); end -end - -# Represents the use of the `next` keyword. +# Represents writing local variables using a regular expression match with named capture groups. # -# next 1 -# ^^^^^^ -class Prism::NextNode < ::Prism::Node - # def initialize: (arguments: ArgumentsNode?, keyword_loc: Location, location: Location) -> void +# /(?bar)/ =~ baz +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13163 +class Prism::MatchWriteNode < ::Prism::Node + # def initialize: (CallNode call, Array[Node] targets, Location location) -> void # - # @return [NextNode] a new instance of NextNode + # @return [MatchWriteNode] a new instance of MatchWriteNode # - # source://prism//prism/node.rb#12395 - def initialize(arguments, keyword_loc, location); end + # source://prism//lib/prism/node.rb#13165 + def initialize(source, call, targets, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12402 + # source://prism//lib/prism/node.rb#13174 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? + # attr_reader call: CallNode # - # source://prism//prism/node.rb#12389 - def arguments; end + # source://prism//lib/prism/node.rb#13212 + sig { returns(Prism::CallNode) } + def call; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12407 + # source://prism//lib/prism/node.rb#13179 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12419 + # source://prism//lib/prism/node.rb#13189 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12412 + # source://prism//lib/prism/node.rb#13184 def compact_child_nodes; end - # def copy: (**params) -> NextNode + # def copy: (**params) -> MatchWriteNode # - # source://prism//prism/node.rb#12424 + # source://prism//lib/prism/node.rb#13194 + sig { params(params: T.untyped).returns(Prism::MatchWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12407 + # source://prism//lib/prism/node.rb#13179 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[Node], location: Location } # - # source://prism//prism/node.rb#12436 + # source://prism//lib/prism/node.rb#13207 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12446 + # source://prism//lib/prism/node.rb#13219 def inspect(inspector = T.unsafe(nil)); end - # def keyword: () -> String - # - # source://prism//prism/node.rb#12441 - def keyword; end - - # attr_reader keyword_loc: Location + # attr_reader targets: Array[Node] # - # source://prism//prism/node.rb#12392 - def keyword_loc; end + # source://prism//lib/prism/node.rb#13215 + sig { returns(T::Array[Prism::Node]) } + def targets; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -17191,7 +19004,7 @@ class Prism::NextNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12472 + # source://prism//lib/prism/node.rb#13241 def type; end class << self @@ -17202,62 +19015,70 @@ class Prism::NextNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12482 + # source://prism//lib/prism/node.rb#13251 def type; end end end -# Represents the use of the `nil` keyword. +# Represents a node that is missing from the source and results in a syntax error. # -# nil -# ^^^ -class Prism::NilNode < ::Prism::Node - # def initialize: (location: Location) -> void +# source://prism//lib/prism/node.rb#13257 +class Prism::MissingNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [NilNode] a new instance of NilNode + # @return [MissingNode] a new instance of MissingNode # - # source://prism//prism/node.rb#12493 - def initialize(location); end + # source://prism//lib/prism/node.rb#13259 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12498 + # source://prism//lib/prism/node.rb#13266 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12503 + # source://prism//lib/prism/node.rb#13271 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12513 + # source://prism//lib/prism/node.rb#13281 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12508 + # source://prism//lib/prism/node.rb#13276 def compact_child_nodes; end - # def copy: (**params) -> NilNode + # def copy: (**params) -> MissingNode # - # source://prism//prism/node.rb#12518 + # source://prism//lib/prism/node.rb#13286 + sig { params(params: T.untyped).returns(Prism::MissingNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12503 + # source://prism//lib/prism/node.rb#13271 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#12528 + # source://prism//lib/prism/node.rb#13297 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12533 + # source://prism//lib/prism/node.rb#13303 def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -17275,7 +19096,7 @@ class Prism::NilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12552 + # source://prism//lib/prism/node.rb#13322 def type; end class << self @@ -17286,84 +19107,122 @@ class Prism::NilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12562 + # source://prism//lib/prism/node.rb#13332 def type; end end end -# Represents the use of `**nil` inside method arguments. +# Represents a module declaration involving the `module` keyword. # -# def a(**nil) -# ^^^^^ -# end -class Prism::NoKeywordsParameterNode < ::Prism::Node - # def initialize: (operator_loc: Location, keyword_loc: Location, location: Location) -> void +# module Foo end +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13341 +class Prism::ModuleNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location module_keyword_loc, Node constant_path, Node? body, Location end_keyword_loc, Symbol name, Location location) -> void # - # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode + # @return [ModuleNode] a new instance of ModuleNode # - # source://prism//prism/node.rb#12580 - def initialize(operator_loc, keyword_loc, location); end + # source://prism//lib/prism/node.rb#13343 + def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12587 + # source://prism//lib/prism/node.rb#13356 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader body: Node? + # + # source://prism//lib/prism/node.rb#13413 + sig { returns(T.nilable(Prism::Node)) } + def body; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12592 + # source://prism//lib/prism/node.rb#13361 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12602 + # source://prism//lib/prism/node.rb#13374 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12597 + # source://prism//lib/prism/node.rb#13366 def compact_child_nodes; end - # def copy: (**params) -> NoKeywordsParameterNode + # attr_reader constant_path: Node + # + # source://prism//lib/prism/node.rb#13410 + sig { returns(Prism::Node) } + def constant_path; end + + # def copy: (**params) -> ModuleNode # - # source://prism//prism/node.rb#12607 + # source://prism//lib/prism/node.rb#13379 + sig { params(params: T.untyped).returns(Prism::ModuleNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12592 + # source://prism//lib/prism/node.rb#13361 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], module_keyword_loc: Location, constant_path: Node, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location } # - # source://prism//prism/node.rb#12619 + # source://prism//lib/prism/node.rb#13396 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def end_keyword: () -> String # - # source://prism//prism/node.rb#12634 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#13431 + sig { returns(String) } + def end_keyword; end - # def keyword: () -> String + # attr_reader end_keyword_loc: Location # - # source://prism//prism/node.rb#12629 - def keyword; end + # source://prism//lib/prism/node.rb#13416 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # attr_reader keyword_loc: Location + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12577 - def keyword_loc; end + # source://prism//lib/prism/node.rb#13436 + def inspect(inspector = T.unsafe(nil)); end - # def operator: () -> String + # attr_reader locals: Array[Symbol] # - # source://prism//prism/node.rb#12624 - def operator; end + # source://prism//lib/prism/node.rb#13401 + sig { returns(T::Array[Symbol]) } + def locals; end - # attr_reader operator_loc: Location + # def module_keyword: () -> String # - # source://prism//prism/node.rb#12574 - def operator_loc; end + # source://prism//lib/prism/node.rb#13426 + sig { returns(String) } + def module_keyword; end + + # attr_reader module_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#13404 + sig { returns(Prism::Location) } + def module_keyword_loc; end + + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#13422 + sig { returns(Symbol) } + def name; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -17380,7 +19239,7 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12655 + # source://prism//lib/prism/node.rb#13467 def type; end class << self @@ -17391,155 +19250,116 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12665 + # source://prism//lib/prism/node.rb#13477 def type; end end end -# This represents a node in the tree. It is the parent class of all of the -# various node types. -class Prism::Node - # A Location instance that represents the location of this node in the - # source. - # - # source://prism//prism/node.rb#14 - def location; end - - # @return [Boolean] - # - # source://prism//prism/node.rb#16 - def newline?; end - - # Similar to inspect, but respects the current level of indentation given by - # the pretty print object. - # - # source://prism//prism/node.rb#35 - def pretty_print(q); end - - # source://prism//prism/node.rb#20 - def set_newline_flag(newline_marked); end - - # Slice the location of the node from the source. - # - # source://prism//prism/node.rb#29 - def slice; end - - # Convert this node into a graphviz dot graph string. - # - # source://prism//prism/node.rb#43 - def to_dot; end -end - -# This object is responsible for generating the output for the inspect method -# implementations of child nodes. -class Prism::NodeInspector - # @return [NodeInspector] a new instance of NodeInspector - # - # source://prism//prism/node_inspector.rb#9 - def initialize(prefix = T.unsafe(nil)); end - - # Appends a line to the output with the current prefix. - # - # source://prism//prism/node_inspector.rb#15 - def <<(line); end - - # Returns a new inspector that can be used to inspect a child node. - # - # source://prism//prism/node_inspector.rb#59 - def child_inspector(append); end - - # Generates a string that represents a child node. - # - # source://prism//prism/node_inspector.rb#54 - def child_node(node, append); end - - # This generates a string that is used as the header of the inspect output - # for any given node. - # - # source://prism//prism/node_inspector.rb#21 - def header(node); end - - # Generates a string that represents a list of nodes. It handles properly - # using the box drawing characters to make the output look nice. - # - # source://prism//prism/node_inspector.rb#31 - def list(prefix, nodes); end - - # Generates a string that represents a location field on a node. - # - # source://prism//prism/node_inspector.rb#45 - def location(value); end - - # source://prism//prism/node_inspector.rb#7 - def output; end - - # source://prism//prism/node_inspector.rb#7 - def prefix; end - - # Returns the output as a string. - # - # source://prism//prism/node_inspector.rb#64 - def to_str; end -end - -# Represents an implicit set of parameters through the use of numbered -# parameters within a block or lambda. +# Represents a multi-target expression. # -# -> { _1 + _2 } -# ^^^^^^^^^^^^^^ -class Prism::NumberedParametersNode < ::Prism::Node - # def initialize: (maximum: Integer, location: Location) -> void +# a, (b, c) = 1, 2, 3 +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#13486 +class Prism::MultiTargetNode < ::Prism::Node + # def initialize: (Array[Node] lefts, Node? rest, Array[Node] rights, Location? lparen_loc, Location? rparen_loc, Location location) -> void # - # @return [NumberedParametersNode] a new instance of NumberedParametersNode + # @return [MultiTargetNode] a new instance of MultiTargetNode # - # source://prism//prism/node.rb#12680 - def initialize(maximum, location); end + # source://prism//lib/prism/node.rb#13488 + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12686 + # source://prism//lib/prism/node.rb#13500 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12691 + # source://prism//lib/prism/node.rb#13505 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12701 + # source://prism//lib/prism/node.rb#13519 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12696 + # source://prism//lib/prism/node.rb#13510 def compact_child_nodes; end - # def copy: (**params) -> NumberedParametersNode + # def copy: (**params) -> MultiTargetNode # - # source://prism//prism/node.rb#12706 + # source://prism//lib/prism/node.rb#13524 + sig { params(params: T.untyped).returns(Prism::MultiTargetNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12691 + # source://prism//lib/prism/node.rb#13505 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, location: Location } # - # source://prism//prism/node.rb#12717 + # source://prism//lib/prism/node.rb#13540 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12722 + # source://prism//lib/prism/node.rb#13589 def inspect(inspector = T.unsafe(nil)); end - # attr_reader maximum: Integer + # attr_reader lefts: Array[Node] # - # source://prism//prism/node.rb#12677 - def maximum; end + # source://prism//lib/prism/node.rb#13545 + sig { returns(T::Array[Prism::Node]) } + def lefts; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#13579 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13554 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # attr_reader rest: Node? + # + # source://prism//lib/prism/node.rb#13548 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # attr_reader rights: Array[Node] + # + # source://prism//lib/prism/node.rb#13551 + sig { returns(T::Array[Prism::Node]) } + def rights; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#13584 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#13566 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -17556,7 +19376,7 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12742 + # source://prism//lib/prism/node.rb#13618 def type; end class << self @@ -17567,163 +19387,128 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12752 + # source://prism//lib/prism/node.rb#13628 def type; end end end -# Represents reading a numbered reference to a capture in the previous match. +# Represents a write to a multi-target expression. # -# $1 -# ^^ -class Prism::NumberedReferenceReadNode < ::Prism::Node - # def initialize: (number: Integer, location: Location) -> void +# a, b, c = 1, 2, 3 +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#13637 +class Prism::MultiWriteNode < ::Prism::Node + # def initialize: (Array[Node] lefts, Node? rest, Array[Node] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Node value, Location location) -> void # - # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode + # @return [MultiWriteNode] a new instance of MultiWriteNode # - # source://prism//prism/node.rb#12766 - def initialize(number, location); end + # source://prism//lib/prism/node.rb#13639 + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#12772 + # source://prism//lib/prism/node.rb#13653 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12777 + # source://prism//lib/prism/node.rb#13658 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#12787 + # source://prism//lib/prism/node.rb#13673 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#12782 + # source://prism//lib/prism/node.rb#13663 def compact_child_nodes; end - # def copy: (**params) -> NumberedReferenceReadNode + # def copy: (**params) -> MultiWriteNode # - # source://prism//prism/node.rb#12792 + # source://prism//lib/prism/node.rb#13678 + sig { params(params: T.untyped).returns(Prism::MultiWriteNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#12777 + # source://prism//lib/prism/node.rb#13658 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#12803 + # source://prism//lib/prism/node.rb#13696 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#12808 + # source://prism//lib/prism/node.rb#13759 def inspect(inspector = T.unsafe(nil)); end - # attr_reader number: Integer - # - # source://prism//prism/node.rb#12763 - def number; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#12828 - def type; end - - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#12838 - def type; end - end -end - -# Represents an optional keyword parameter to a method, block, or lambda definition. -# -# def a(b: 1) -# ^^^^ -# end -class Prism::OptionalKeywordParameterNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, value: Node, location: Location) -> void - # - # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode - # - # source://prism//prism/node.rb#12859 - def initialize(name, name_loc, value, location); end - - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#12867 - def accept(visitor); end - - # def child_nodes: () -> Array[nil | Node] + # attr_reader lefts: Array[Node] # - # source://prism//prism/node.rb#12872 - def child_nodes; end + # source://prism//lib/prism/node.rb#13701 + sig { returns(T::Array[Prism::Node]) } + def lefts; end - # def comment_targets: () -> Array[Node | Location] + # def lparen: () -> String? # - # source://prism//prism/node.rb#12882 - def comment_targets; end + # source://prism//lib/prism/node.rb#13744 + sig { returns(T.nilable(String)) } + def lparen; end - # def compact_child_nodes: () -> Array[Node] + # attr_reader lparen_loc: Location? # - # source://prism//prism/node.rb#12877 - def compact_child_nodes; end + # source://prism//lib/prism/node.rb#13710 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end - # def copy: (**params) -> OptionalKeywordParameterNode + # def operator: () -> String # - # source://prism//prism/node.rb#12887 - def copy(**params); end + # source://prism//lib/prism/node.rb#13754 + sig { returns(String) } + def operator; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#12872 - def deconstruct; end + # source://prism//lib/prism/node.rb#13734 + sig { returns(Prism::Location) } + def operator_loc; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # attr_reader rest: Node? # - # source://prism//prism/node.rb#12900 - def deconstruct_keys(keys); end + # source://prism//lib/prism/node.rb#13704 + sig { returns(T.nilable(Prism::Node)) } + def rest; end - # def inspect(inspector: NodeInspector) -> String + # attr_reader rights: Array[Node] # - # source://prism//prism/node.rb#12905 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/node.rb#13707 + sig { returns(T::Array[Prism::Node]) } + def rights; end - # attr_reader name: Symbol + # def rparen: () -> String? # - # source://prism//prism/node.rb#12850 - def name; end + # source://prism//lib/prism/node.rb#13749 + sig { returns(T.nilable(String)) } + def rparen; end - # attr_reader name_loc: Location + # attr_reader rparen_loc: Location? # - # source://prism//prism/node.rb#12853 - def name_loc; end + # source://prism//lib/prism/node.rb#13722 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -17740,12 +19525,13 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#12928 + # source://prism//lib/prism/node.rb#13791 def type; end # attr_reader value: Node # - # source://prism//prism/node.rb#12856 + # source://prism//lib/prism/node.rb#13740 + sig { returns(Prism::Node) } def value; end class << self @@ -17756,666 +19542,839 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#12938 + # source://prism//lib/prism/node.rb#13801 def type; end end end -# Represents an optional parameter to a method, block, or lambda definition. +# This visitor walks through the tree and copies each node as it is being +# visited. This is useful for consumers that want to mutate the tree, as you +# can change subtrees in place without effecting the rest of the tree. # -# def a(b = 1) -# ^^^^^ -# end -class Prism::OptionalParameterNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void - # - # @return [OptionalParameterNode] a new instance of OptionalParameterNode +# source://prism//lib/prism/mutation_compiler.rb#12 +class Prism::MutationCompiler < ::Prism::Compiler + # Copy a AliasGlobalVariableNode node # - # source://prism//prism/node.rb#12962 - def initialize(name, name_loc, operator_loc, value, location); end + # source://prism//lib/prism/mutation_compiler.rb#14 + def visit_alias_global_variable_node(node); end - # def accept: (visitor: Visitor) -> void + # Copy a AliasMethodNode node # - # source://prism//prism/node.rb#12971 - def accept(visitor); end + # source://prism//lib/prism/mutation_compiler.rb#19 + def visit_alias_method_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a AlternationPatternNode node # - # source://prism//prism/node.rb#12976 - def child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#24 + def visit_alternation_pattern_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a AndNode node # - # source://prism//prism/node.rb#12986 - def comment_targets; end + # source://prism//lib/prism/mutation_compiler.rb#29 + def visit_and_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a ArgumentsNode node # - # source://prism//prism/node.rb#12981 - def compact_child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#34 + def visit_arguments_node(node); end - # def copy: (**params) -> OptionalParameterNode + # Copy a ArrayNode node # - # source://prism//prism/node.rb#12991 - def copy(**params); end + # source://prism//lib/prism/mutation_compiler.rb#39 + def visit_array_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a ArrayPatternNode node # - # source://prism//prism/node.rb#12976 - def deconstruct; end + # source://prism//lib/prism/mutation_compiler.rb#44 + def visit_array_pattern_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Copy a AssocNode node # - # source://prism//prism/node.rb#13005 - def deconstruct_keys(keys); end + # source://prism//lib/prism/mutation_compiler.rb#49 + def visit_assoc_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Copy a AssocSplatNode node # - # source://prism//prism/node.rb#13015 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/mutation_compiler.rb#54 + def visit_assoc_splat_node(node); end - # attr_reader name: Symbol + # Copy a BackReferenceReadNode node # - # source://prism//prism/node.rb#12950 - def name; end + # source://prism//lib/prism/mutation_compiler.rb#59 + def visit_back_reference_read_node(node); end - # attr_reader name_loc: Location + # Copy a BeginNode node # - # source://prism//prism/node.rb#12953 - def name_loc; end + # source://prism//lib/prism/mutation_compiler.rb#64 + def visit_begin_node(node); end - # def operator: () -> String + # Copy a BlockArgumentNode node # - # source://prism//prism/node.rb#13010 - def operator; end + # source://prism//lib/prism/mutation_compiler.rb#69 + def visit_block_argument_node(node); end - # attr_reader operator_loc: Location + # Copy a BlockLocalVariableNode node # - # source://prism//prism/node.rb#12956 - def operator_loc; end + # source://prism//lib/prism/mutation_compiler.rb#74 + def visit_block_local_variable_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Copy a BlockNode node # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/mutation_compiler.rb#79 + def visit_block_node(node); end + + # Copy a BlockParameterNode node # - # def type: () -> Symbol + # source://prism//lib/prism/mutation_compiler.rb#84 + def visit_block_parameter_node(node); end + + # Copy a BlockParametersNode node # - # source://prism//prism/node.rb#13039 - def type; end + # source://prism//lib/prism/mutation_compiler.rb#89 + def visit_block_parameters_node(node); end - # attr_reader value: Node + # Copy a BreakNode node # - # source://prism//prism/node.rb#12959 - def value; end + # source://prism//lib/prism/mutation_compiler.rb#94 + def visit_break_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#13049 - def type; end - end -end + # Copy a CallAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#99 + def visit_call_and_write_node(node); end -# Represents the use of the `||` operator or the `or` keyword. -# -# left or right -# ^^^^^^^^^^^^^ -class Prism::OrNode < ::Prism::Node - # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void + # Copy a CallNode node # - # @return [OrNode] a new instance of OrNode + # source://prism//lib/prism/mutation_compiler.rb#104 + def visit_call_node(node); end + + # Copy a CallOperatorWriteNode node # - # source://prism//prism/node.rb#13069 - def initialize(left, right, operator_loc, location); end + # source://prism//lib/prism/mutation_compiler.rb#109 + def visit_call_operator_write_node(node); end - # def accept: (visitor: Visitor) -> void + # Copy a CallOrWriteNode node # - # source://prism//prism/node.rb#13077 - def accept(visitor); end + # source://prism//lib/prism/mutation_compiler.rb#114 + def visit_call_or_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a CallTargetNode node # - # source://prism//prism/node.rb#13082 - def child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#119 + def visit_call_target_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a CapturePatternNode node # - # source://prism//prism/node.rb#13092 - def comment_targets; end + # source://prism//lib/prism/mutation_compiler.rb#124 + def visit_capture_pattern_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a CaseMatchNode node # - # source://prism//prism/node.rb#13087 - def compact_child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#129 + def visit_case_match_node(node); end - # def copy: (**params) -> OrNode + # Copy a CaseNode node # - # source://prism//prism/node.rb#13097 - def copy(**params); end + # source://prism//lib/prism/mutation_compiler.rb#134 + def visit_case_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a ClassNode node # - # source://prism//prism/node.rb#13082 - def deconstruct; end + # source://prism//lib/prism/mutation_compiler.rb#139 + def visit_class_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Copy a ClassVariableAndWriteNode node # - # source://prism//prism/node.rb#13110 - def deconstruct_keys(keys); end + # source://prism//lib/prism/mutation_compiler.rb#144 + def visit_class_variable_and_write_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Copy a ClassVariableOperatorWriteNode node # - # source://prism//prism/node.rb#13120 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/mutation_compiler.rb#149 + def visit_class_variable_operator_write_node(node); end - # attr_reader left: Node + # Copy a ClassVariableOrWriteNode node # - # source://prism//prism/node.rb#13060 - def left; end + # source://prism//lib/prism/mutation_compiler.rb#154 + def visit_class_variable_or_write_node(node); end - # def operator: () -> String + # Copy a ClassVariableReadNode node # - # source://prism//prism/node.rb#13115 - def operator; end + # source://prism//lib/prism/mutation_compiler.rb#159 + def visit_class_variable_read_node(node); end - # attr_reader operator_loc: Location + # Copy a ClassVariableTargetNode node # - # source://prism//prism/node.rb#13066 - def operator_loc; end + # source://prism//lib/prism/mutation_compiler.rb#164 + def visit_class_variable_target_node(node); end - # attr_reader right: Node + # Copy a ClassVariableWriteNode node # - # source://prism//prism/node.rb#13063 - def right; end + # source://prism//lib/prism/mutation_compiler.rb#169 + def visit_class_variable_write_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Copy a ConstantAndWriteNode node # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/mutation_compiler.rb#174 + def visit_constant_and_write_node(node); end + + # Copy a ConstantOperatorWriteNode node # - # def type: () -> Symbol + # source://prism//lib/prism/mutation_compiler.rb#179 + def visit_constant_operator_write_node(node); end + + # Copy a ConstantOrWriteNode node # - # source://prism//prism/node.rb#13144 - def type; end + # source://prism//lib/prism/mutation_compiler.rb#184 + def visit_constant_or_write_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#13154 - def type; end - end -end + # Copy a ConstantPathAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#189 + def visit_constant_path_and_write_node(node); end -# A parser for the pack template language. -module Prism::Pack - class << self - def parse(_arg0, _arg1, _arg2); end - end -end + # Copy a ConstantPathNode node + # + # source://prism//lib/prism/mutation_compiler.rb#194 + def visit_constant_path_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a ConstantPathOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#199 + def visit_constant_path_operator_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) + # Copy a ConstantPathOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#204 + def visit_constant_path_or_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) + # Copy a ConstantPathTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#209 + def visit_constant_path_target_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a ConstantPathWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#214 + def visit_constant_path_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) + # Copy a ConstantReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#219 + def visit_constant_read_node(node); end -# A directive in the pack template language. -class Prism::Pack::Directive - # Initialize a new directive with the given values. + # Copy a ConstantTargetNode node # - # @return [Directive] a new instance of Directive + # source://prism//lib/prism/mutation_compiler.rb#224 + def visit_constant_target_node(node); end + + # Copy a ConstantWriteNode node # - # source://prism//prism/pack.rb#88 - def initialize(version, variant, source, type, signed, endian, size, length_type, length); end + # source://prism//lib/prism/mutation_compiler.rb#229 + def visit_constant_write_node(node); end - # Provide a human-readable description of the directive. + # Copy a DefNode node # - # source://prism//prism/pack.rb#130 - def describe; end + # source://prism//lib/prism/mutation_compiler.rb#234 + def visit_def_node(node); end - # The type of endianness of the directive. + # Copy a DefinedNode node # - # source://prism//prism/pack.rb#76 - def endian; end + # source://prism//lib/prism/mutation_compiler.rb#239 + def visit_defined_node(node); end - # The length of this directive (used for integers). + # Copy a ElseNode node # - # source://prism//prism/pack.rb#85 - def length; end + # source://prism//lib/prism/mutation_compiler.rb#244 + def visit_else_node(node); end - # The length type of this directive (used for integers). + # Copy a EmbeddedStatementsNode node # - # source://prism//prism/pack.rb#82 - def length_type; end + # source://prism//lib/prism/mutation_compiler.rb#249 + def visit_embedded_statements_node(node); end - # The type of signedness of the directive. + # Copy a EmbeddedVariableNode node # - # source://prism//prism/pack.rb#73 - def signed; end + # source://prism//lib/prism/mutation_compiler.rb#254 + def visit_embedded_variable_node(node); end - # The size of the directive. + # Copy a EnsureNode node # - # source://prism//prism/pack.rb#79 - def size; end + # source://prism//lib/prism/mutation_compiler.rb#259 + def visit_ensure_node(node); end - # A byteslice of the source string that this directive represents. + # Copy a FalseNode node # - # source://prism//prism/pack.rb#67 - def source; end + # source://prism//lib/prism/mutation_compiler.rb#264 + def visit_false_node(node); end - # The type of the directive. + # Copy a FindPatternNode node # - # source://prism//prism/pack.rb#70 - def type; end + # source://prism//lib/prism/mutation_compiler.rb#269 + def visit_find_pattern_node(node); end - # A symbol representing whether or not we are packing or unpacking. + # Copy a FlipFlopNode node # - # source://prism//prism/pack.rb#64 - def variant; end + # source://prism//lib/prism/mutation_compiler.rb#274 + def visit_flip_flop_node(node); end - # A symbol representing the version of Ruby. + # Copy a FloatNode node # - # source://prism//prism/pack.rb#61 - def version; end -end + # source://prism//lib/prism/mutation_compiler.rb#279 + def visit_float_node(node); end -# The descriptions of the various types of endianness. -# -# source://prism//prism/pack.rb#101 -Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a ForNode node + # + # source://prism//lib/prism/mutation_compiler.rb#284 + def visit_for_node(node); end -# The descriptions of the various types of signedness. -# -# source://prism//prism/pack.rb#110 -Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a ForwardingArgumentsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#289 + def visit_forwarding_arguments_node(node); end -# The descriptions of the various types of sizes. -# -# source://prism//prism/pack.rb#117 -Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a ForwardingParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#294 + def visit_forwarding_parameter_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + # Copy a ForwardingSuperNode node + # + # source://prism//lib/prism/mutation_compiler.rb#299 + def visit_forwarding_super_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + # Copy a GlobalVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#304 + def visit_global_variable_and_write_node(node); end -# The result of parsing a pack template. -class Prism::Pack::Format - # Create a new Format with the given directives and encoding. + # Copy a GlobalVariableOperatorWriteNode node # - # @return [Format] a new instance of Format + # source://prism//lib/prism/mutation_compiler.rb#309 + def visit_global_variable_operator_write_node(node); end + + # Copy a GlobalVariableOrWriteNode node # - # source://prism//prism/pack.rb#203 - def initialize(directives, encoding); end + # source://prism//lib/prism/mutation_compiler.rb#314 + def visit_global_variable_or_write_node(node); end - # Provide a human-readable description of the format. + # Copy a GlobalVariableReadNode node # - # source://prism//prism/pack.rb#209 - def describe; end + # source://prism//lib/prism/mutation_compiler.rb#319 + def visit_global_variable_read_node(node); end - # A list of the directives in the template. + # Copy a GlobalVariableTargetNode node # - # source://prism//prism/pack.rb#197 - def directives; end + # source://prism//lib/prism/mutation_compiler.rb#324 + def visit_global_variable_target_node(node); end - # The encoding of the template. + # Copy a GlobalVariableWriteNode node # - # source://prism//prism/pack.rb#200 - def encoding; end -end + # source://prism//lib/prism/mutation_compiler.rb#329 + def visit_global_variable_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) + # Copy a HashNode node + # + # source://prism//lib/prism/mutation_compiler.rb#334 + def visit_hash_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) + # Copy a HashPatternNode node + # + # source://prism//lib/prism/mutation_compiler.rb#339 + def visit_hash_pattern_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) + # Copy a IfNode node + # + # source://prism//lib/prism/mutation_compiler.rb#344 + def visit_if_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) + # Copy a ImaginaryNode node + # + # source://prism//lib/prism/mutation_compiler.rb#349 + def visit_imaginary_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) + # Copy a ImplicitNode node + # + # source://prism//lib/prism/mutation_compiler.rb#354 + def visit_implicit_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a ImplicitRestNode node + # + # source://prism//lib/prism/mutation_compiler.rb#359 + def visit_implicit_rest_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) + # Copy a InNode node + # + # source://prism//lib/prism/mutation_compiler.rb#364 + def visit_in_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a IndexAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#369 + def visit_index_and_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) + # Copy a IndexOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#374 + def visit_index_operator_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) + # Copy a IndexOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#379 + def visit_index_or_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) + # Copy a IndexTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#384 + def visit_index_target_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#389 + def visit_instance_variable_and_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#394 + def visit_instance_variable_operator_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#399 + def visit_instance_variable_or_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#404 + def visit_instance_variable_read_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#409 + def visit_instance_variable_target_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#414 + def visit_instance_variable_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + # Copy a IntegerNode node + # + # source://prism//lib/prism/mutation_compiler.rb#419 + def visit_integer_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedMatchLastLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#424 + def visit_interpolated_match_last_line_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedRegularExpressionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#429 + def visit_interpolated_regular_expression_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#434 + def visit_interpolated_string_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedSymbolNode node + # + # source://prism//lib/prism/mutation_compiler.rb#439 + def visit_interpolated_symbol_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedXStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#444 + def visit_interpolated_x_string_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + # Copy a KeywordHashNode node + # + # source://prism//lib/prism/mutation_compiler.rb#449 + def visit_keyword_hash_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + # Copy a KeywordRestParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#454 + def visit_keyword_rest_parameter_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + # Copy a LambdaNode node + # + # source://prism//lib/prism/mutation_compiler.rb#459 + def visit_lambda_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableAndWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#464 + def visit_local_variable_and_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableOperatorWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#469 + def visit_local_variable_operator_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableOrWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#474 + def visit_local_variable_or_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableReadNode node + # + # source://prism//lib/prism/mutation_compiler.rb#479 + def visit_local_variable_read_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableTargetNode node + # + # source://prism//lib/prism/mutation_compiler.rb#484 + def visit_local_variable_target_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#489 + def visit_local_variable_write_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + # Copy a MatchLastLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#494 + def visit_match_last_line_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + # Copy a MatchPredicateNode node + # + # source://prism//lib/prism/mutation_compiler.rb#499 + def visit_match_predicate_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + # Copy a MatchRequiredNode node + # + # source://prism//lib/prism/mutation_compiler.rb#504 + def visit_match_required_node(node); end -# source://prism//prism/pack.rb#55 -Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + # Copy a MatchWriteNode node + # + # source://prism//lib/prism/mutation_compiler.rb#509 + def visit_match_write_node(node); end -# Represents the list of parameters on a method, block, or lambda definition. -# -# def a(b, c, d) -# ^^^^^^^ -# end -class Prism::ParametersNode < ::Prism::Node - # def initialize: (requireds: Array[Node], optionals: Array[Node], rest: Node?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location) -> void + # Copy a MissingNode node # - # @return [ParametersNode] a new instance of ParametersNode + # source://prism//lib/prism/mutation_compiler.rb#514 + def visit_missing_node(node); end + + # Copy a ModuleNode node # - # source://prism//prism/node.rb#13187 - def initialize(requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end + # source://prism//lib/prism/mutation_compiler.rb#519 + def visit_module_node(node); end - # def accept: (visitor: Visitor) -> void + # Copy a MultiTargetNode node # - # source://prism//prism/node.rb#13199 - def accept(visitor); end + # source://prism//lib/prism/mutation_compiler.rb#524 + def visit_multi_target_node(node); end - # attr_reader block: BlockParameterNode? + # Copy a MultiWriteNode node # - # source://prism//prism/node.rb#13184 - def block; end + # source://prism//lib/prism/mutation_compiler.rb#529 + def visit_multi_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a NextNode node # - # source://prism//prism/node.rb#13204 - def child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#534 + def visit_next_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a NilNode node # - # source://prism//prism/node.rb#13222 - def comment_targets; end + # source://prism//lib/prism/mutation_compiler.rb#539 + def visit_nil_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a NoKeywordsParameterNode node # - # source://prism//prism/node.rb#13209 - def compact_child_nodes; end + # source://prism//lib/prism/mutation_compiler.rb#544 + def visit_no_keywords_parameter_node(node); end - # def copy: (**params) -> ParametersNode + # Copy a NumberedParametersNode node # - # source://prism//prism/node.rb#13227 - def copy(**params); end + # source://prism//lib/prism/mutation_compiler.rb#549 + def visit_numbered_parameters_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a NumberedReferenceReadNode node # - # source://prism//prism/node.rb#13204 - def deconstruct; end + # source://prism//lib/prism/mutation_compiler.rb#554 + def visit_numbered_reference_read_node(node); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Copy a OptionalKeywordParameterNode node # - # source://prism//prism/node.rb#13244 - def deconstruct_keys(keys); end + # source://prism//lib/prism/mutation_compiler.rb#559 + def visit_optional_keyword_parameter_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Copy a OptionalParameterNode node # - # source://prism//prism/node.rb#13249 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/mutation_compiler.rb#564 + def visit_optional_parameter_node(node); end - # attr_reader keyword_rest: Node? + # Copy a OrNode node # - # source://prism//prism/node.rb#13181 - def keyword_rest; end + # source://prism//lib/prism/mutation_compiler.rb#569 + def visit_or_node(node); end - # attr_reader keywords: Array[Node] + # Copy a ParametersNode node # - # source://prism//prism/node.rb#13178 - def keywords; end + # source://prism//lib/prism/mutation_compiler.rb#574 + def visit_parameters_node(node); end - # attr_reader optionals: Array[Node] + # Copy a ParenthesesNode node # - # source://prism//prism/node.rb#13169 - def optionals; end + # source://prism//lib/prism/mutation_compiler.rb#579 + def visit_parentheses_node(node); end - # attr_reader posts: Array[Node] + # Copy a PinnedExpressionNode node # - # source://prism//prism/node.rb#13175 - def posts; end + # source://prism//lib/prism/mutation_compiler.rb#584 + def visit_pinned_expression_node(node); end - # attr_reader requireds: Array[Node] + # Copy a PinnedVariableNode node # - # source://prism//prism/node.rb#13166 - def requireds; end + # source://prism//lib/prism/mutation_compiler.rb#589 + def visit_pinned_variable_node(node); end - # attr_reader rest: Node? + # Copy a PostExecutionNode node # - # source://prism//prism/node.rb#13172 - def rest; end + # source://prism//lib/prism/mutation_compiler.rb#594 + def visit_post_execution_node(node); end - # Mirrors the Method#parameters method. + # Copy a PreExecutionNode node # - # source://prism//prism/node_ext.rb#149 - def signature; end + # source://prism//lib/prism/mutation_compiler.rb#599 + def visit_pre_execution_node(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Copy a ProgramNode node # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/mutation_compiler.rb#604 + def visit_program_node(node); end + + # Copy a RangeNode node # - # def type: () -> Symbol + # source://prism//lib/prism/mutation_compiler.rb#609 + def visit_range_node(node); end + + # Copy a RationalNode node # - # source://prism//prism/node.rb#13290 - def type; end + # source://prism//lib/prism/mutation_compiler.rb#614 + def visit_rational_node(node); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#13300 - def type; end - end + # Copy a RedoNode node + # + # source://prism//lib/prism/mutation_compiler.rb#619 + def visit_redo_node(node); end + + # Copy a RegularExpressionNode node + # + # source://prism//lib/prism/mutation_compiler.rb#624 + def visit_regular_expression_node(node); end + + # Copy a RequiredKeywordParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#629 + def visit_required_keyword_parameter_node(node); end + + # Copy a RequiredParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#634 + def visit_required_parameter_node(node); end + + # Copy a RescueModifierNode node + # + # source://prism//lib/prism/mutation_compiler.rb#639 + def visit_rescue_modifier_node(node); end + + # Copy a RescueNode node + # + # source://prism//lib/prism/mutation_compiler.rb#644 + def visit_rescue_node(node); end + + # Copy a RestParameterNode node + # + # source://prism//lib/prism/mutation_compiler.rb#649 + def visit_rest_parameter_node(node); end + + # Copy a RetryNode node + # + # source://prism//lib/prism/mutation_compiler.rb#654 + def visit_retry_node(node); end + + # Copy a ReturnNode node + # + # source://prism//lib/prism/mutation_compiler.rb#659 + def visit_return_node(node); end + + # Copy a SelfNode node + # + # source://prism//lib/prism/mutation_compiler.rb#664 + def visit_self_node(node); end + + # Copy a SingletonClassNode node + # + # source://prism//lib/prism/mutation_compiler.rb#669 + def visit_singleton_class_node(node); end + + # Copy a SourceEncodingNode node + # + # source://prism//lib/prism/mutation_compiler.rb#674 + def visit_source_encoding_node(node); end + + # Copy a SourceFileNode node + # + # source://prism//lib/prism/mutation_compiler.rb#679 + def visit_source_file_node(node); end + + # Copy a SourceLineNode node + # + # source://prism//lib/prism/mutation_compiler.rb#684 + def visit_source_line_node(node); end + + # Copy a SplatNode node + # + # source://prism//lib/prism/mutation_compiler.rb#689 + def visit_splat_node(node); end + + # Copy a StatementsNode node + # + # source://prism//lib/prism/mutation_compiler.rb#694 + def visit_statements_node(node); end + + # Copy a StringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#699 + def visit_string_node(node); end + + # Copy a SuperNode node + # + # source://prism//lib/prism/mutation_compiler.rb#704 + def visit_super_node(node); end + + # Copy a SymbolNode node + # + # source://prism//lib/prism/mutation_compiler.rb#709 + def visit_symbol_node(node); end + + # Copy a TrueNode node + # + # source://prism//lib/prism/mutation_compiler.rb#714 + def visit_true_node(node); end + + # Copy a UndefNode node + # + # source://prism//lib/prism/mutation_compiler.rb#719 + def visit_undef_node(node); end + + # Copy a UnlessNode node + # + # source://prism//lib/prism/mutation_compiler.rb#724 + def visit_unless_node(node); end + + # Copy a UntilNode node + # + # source://prism//lib/prism/mutation_compiler.rb#729 + def visit_until_node(node); end + + # Copy a WhenNode node + # + # source://prism//lib/prism/mutation_compiler.rb#734 + def visit_when_node(node); end + + # Copy a WhileNode node + # + # source://prism//lib/prism/mutation_compiler.rb#739 + def visit_while_node(node); end + + # Copy a XStringNode node + # + # source://prism//lib/prism/mutation_compiler.rb#744 + def visit_x_string_node(node); end + + # Copy a YieldNode node + # + # source://prism//lib/prism/mutation_compiler.rb#749 + def visit_yield_node(node); end end -# Represents a parenthesized expression +# Represents the use of the `next` keyword. # -# (10 + 34) -# ^^^^^^^^^ -class Prism::ParenthesesNode < ::Prism::Node - # def initialize: (body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> void +# next 1 +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#13810 +class Prism::NextNode < ::Prism::Node + # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # - # @return [ParenthesesNode] a new instance of ParenthesesNode + # @return [NextNode] a new instance of NextNode # - # source://prism//prism/node.rb#13320 - def initialize(body, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#13812 + def initialize(source, arguments, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#13328 + # source://prism//lib/prism/node.rb#13821 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader body: Node? + # attr_reader arguments: ArgumentsNode? # - # source://prism//prism/node.rb#13311 - def body; end + # source://prism//lib/prism/node.rb#13861 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13337 + # source://prism//lib/prism/node.rb#13826 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#13377 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#13317 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#13349 + # source://prism//lib/prism/node.rb#13838 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#13342 + # source://prism//lib/prism/node.rb#13831 def compact_child_nodes; end - # def copy: (**params) -> ParenthesesNode + # def copy: (**params) -> NextNode # - # source://prism//prism/node.rb#13354 + # source://prism//lib/prism/node.rb#13843 + sig { params(params: T.untyped).returns(Prism::NextNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13337 + # source://prism//lib/prism/node.rb#13826 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#13367 + # source://prism//lib/prism/node.rb#13856 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#13382 + # source://prism//lib/prism/node.rb#13876 def inspect(inspector = T.unsafe(nil)); end - # def opening: () -> String + # def keyword: () -> String # - # source://prism//prism/node.rb#13372 - def opening; end + # source://prism//lib/prism/node.rb#13871 + sig { returns(String) } + def keyword; end - # attr_reader opening_loc: Location + # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#13314 - def opening_loc; end - - # source://prism//prism/node.rb#13332 - def set_newline_flag(newline_marked); end + # source://prism//lib/prism/node.rb#13864 + sig { returns(Prism::Location) } + def keyword_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -18432,7 +20391,7 @@ class Prism::ParenthesesNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#13409 + # source://prism//lib/prism/node.rb#13902 def type; end class << self @@ -18443,535 +20402,565 @@ class Prism::ParenthesesNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#13419 + # source://prism//lib/prism/node.rb#13912 def type; end end end -# This represents an error that was encountered during parsing. -class Prism::ParseError - # Create a new error object with the given message and location. - # - # @return [ParseError] a new instance of ParseError - # - # source://prism//prism/parse_result.rb#316 - def initialize(message, location); end - - # Implement the hash pattern matching interface for ParseError. +# Represents the use of the `nil` keyword. +# +# nil +# ^^^ +# +# source://prism//lib/prism/node.rb#13921 +class Prism::NilNode < ::Prism::Node + # def initialize: (Location location) -> void # - # source://prism//prism/parse_result.rb#322 - def deconstruct_keys(keys); end - - # Returns a string representation of this error. + # @return [NilNode] a new instance of NilNode # - # source://prism//prism/parse_result.rb#327 - def inspect; end + # source://prism//lib/prism/node.rb#13923 + def initialize(source, location); end - # A Location object representing the location of this error in the source. + # def accept: (Visitor visitor) -> void # - # source://prism//prism/parse_result.rb#313 - def location; end + # source://prism//lib/prism/node.rb#13930 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # The message associated with this error. + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#310 - def message; end -end + # source://prism//lib/prism/node.rb#13935 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end -# This represents the result of a call to ::parse or ::parse_file. It contains -# the AST, any comments that were encounters, and any errors that were -# encountered. -class Prism::ParseResult - # Create a new parse result object with the given values. - # - # @return [ParseResult] a new instance of ParseResult + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/parse_result.rb#387 - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + # source://prism//lib/prism/node.rb#13945 + def comment_targets; end - # Attach the list of comments to their respective locations in the tree. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/parse_result/comments.rb#173 - def attach_comments!; end + # source://prism//lib/prism/node.rb#13940 + def compact_child_nodes; end - # The list of comments that were encountered during parsing. + # def copy: (**params) -> NilNode # - # source://prism//prism/parse_result.rb#367 - def comments; end + # source://prism//lib/prism/node.rb#13950 + sig { params(params: T.untyped).returns(Prism::NilNode) } + def copy(**params); end - # An optional location that represents the location of the content after the - # __END__ marker. This content is loaded into the DATA constant when the - # file being parsed is the main file being executed. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#375 - def data_loc; end + # source://prism//lib/prism/node.rb#13935 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Implement the hash pattern matching interface for ParseResult. + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/parse_result.rb#398 + # source://prism//lib/prism/node.rb#13961 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # The list of errors that were generated during parsing. + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/parse_result.rb#378 - def errors; end + # source://prism//lib/prism/node.rb#13967 + def inspect(inspector = T.unsafe(nil)); end - # Returns true if there were errors during parsing and false if there were - # not. + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # @return [Boolean] + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/parse_result.rb#410 - def failure?; end - - # The list of magic comments that were encountered during parsing. + # def type: () -> Symbol # - # source://prism//prism/parse_result.rb#370 - def magic_comments; end + # source://prism//lib/prism/node.rb#13986 + def type; end - # Walk the tree and mark nodes that are on a new line. - # - # source://prism//prism/parse_result/newlines.rb#60 - def mark_newlines!; end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#13996 + def type; end + end +end - # A Source instance that represents the source code that was parsed. +# Represents the use of `**nil` inside method arguments. +# +# def a(**nil) +# ^^^^^ +# end +# +# source://prism//lib/prism/node.rb#14006 +class Prism::NoKeywordsParameterNode < ::Prism::Node + # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void # - # source://prism//prism/parse_result.rb#384 - def source; end + # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode + # + # source://prism//lib/prism/node.rb#14008 + def initialize(source, operator_loc, keyword_loc, location); end - # Returns true if there were no errors during parsing and false if there - # were. + # def accept: (Visitor visitor) -> void # - # @return [Boolean] + # source://prism//lib/prism/node.rb#14017 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#404 - def success?; end + # source://prism//lib/prism/node.rb#14022 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The value that was generated by parsing. Normally this holds the AST, but - # it can sometimes how a list of tokens or other results passed back from - # the parser. + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/parse_result.rb#364 - def value; end + # source://prism//lib/prism/node.rb#14032 + def comment_targets; end - # The list of warnings that were generated during parsing. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/parse_result.rb#381 - def warnings; end -end + # source://prism//lib/prism/node.rb#14027 + def compact_child_nodes; end -# When we've parsed the source, we have both the syntax tree and the list of -# comments that we found in the source. This class is responsible for -# walking the tree and finding the nearest location to attach each comment. -# -# It does this by first finding the nearest locations to each comment. -# Locations can either come from nodes directly or from location fields on -# nodes. For example, a `ClassNode` has an overall location encompassing the -# entire class, but it also has a location for the `class` keyword. -# -# Once the nearest locations are found, it determines which one to attach -# to. If it's a trailing comment (a comment on the same line as other source -# code), it will favor attaching to the nearest location that occurs before -# the comment. Otherwise it will favor attaching to the nearest location -# that is after the comment. -class Prism::ParseResult::Comments - # Create a new Comments object that will attach comments to the given - # parse result. + # def copy: (**params) -> NoKeywordsParameterNode # - # @return [Comments] a new instance of Comments + # source://prism//lib/prism/node.rb#14037 + sig { params(params: T.untyped).returns(Prism::NoKeywordsParameterNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/parse_result/comments.rb#78 - def initialize(parse_result); end + # source://prism//lib/prism/node.rb#14022 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Attach the comments to their respective locations in the tree by - # mutating the parse result. + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location } # - # source://prism//prism/parse_result/comments.rb#84 - def attach!; end + # source://prism//lib/prism/node.rb#14050 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # The parse result that we are attaching comments to. + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/parse_result/comments.rb#74 - def parse_result; end + # source://prism//lib/prism/node.rb#14078 + def inspect(inspector = T.unsafe(nil)); end - private + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#14073 + sig { returns(String) } + def keyword; end - # Responsible for finding the nearest targets to the given comment within - # the context of the given encapsulating node. + # attr_reader keyword_loc: Location # - # source://prism//prism/parse_result/comments.rb#103 - def nearest_targets(node, comment); end + # source://prism//lib/prism/node.rb#14061 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#14068 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#14055 + sig { returns(Prism::Location) } + def operator_loc; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14099 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14109 + def type; end + end end -# A target for attaching comments that is based on a location field on a -# node. For example, the `end` token of a ClassNode. -class Prism::ParseResult::Comments::LocationTarget - # @return [LocationTarget] a new instance of LocationTarget +# This represents a node in the tree. It is the parent class of all of the +# various node types. +# +# source://prism//lib/prism/node.rb#11 +class Prism::Node + # Accepts a visitor and calls back into the specialized visit function. # - # source://prism//prism/parse_result/comments.rb#52 - def initialize(location); end + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#62 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/parse_result/comments.rb#68 - def <<(comment); end + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#68 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # @return [Boolean] + # Returns an array of child nodes and locations that could potentially have + # comments attached to them. # - # source://prism//prism/parse_result/comments.rb#64 - def encloses?(comment); end + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#82 + def comment_targets; end - # source://prism//prism/parse_result/comments.rb#60 - def end_offset; end + # Returns an array of child nodes, excluding any `nil`s in the place of + # optional nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#76 + sig { returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#68 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/parse_result/comments.rb#50 + # A Location instance that represents the location of this node in the + # source. + # + # source://prism//lib/prism/node.rb#18 + sig { returns(Prism::Location) } def location; end - # source://prism//prism/parse_result/comments.rb#56 - def start_offset; end -end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#23 + def newline?; end -# A target for attaching comments that is based on a specific node's -# location. -class Prism::ParseResult::Comments::NodeTarget - # @return [NodeTarget] a new instance of NodeTarget + # Similar to inspect, but respects the current level of indentation given by + # the pretty print object. # - # source://prism//prism/parse_result/comments.rb#25 - def initialize(node); end + # source://prism//lib/prism/node.rb#42 + def pretty_print(q); end - # source://prism//prism/parse_result/comments.rb#42 - def <<(comment); end + # source://prism//lib/prism/node.rb#27 + def set_newline_flag(newline_marked); end - # @return [Boolean] + # Slice the location of the node from the source. # - # source://prism//prism/parse_result/comments.rb#37 - def encloses?(comment); end + # source://prism//lib/prism/node.rb#36 + sig { returns(String) } + def slice; end - # source://prism//prism/parse_result/comments.rb#33 - def end_offset; end + # Convert this node into a graphviz dot graph string. + # + # source://prism//lib/prism/node.rb#50 + sig { returns(String) } + def to_dot; end - # source://prism//prism/parse_result/comments.rb#23 - def node; end + # Returns a symbol symbolizing the type of node that this represents. This + # is particularly useful for case statements and array comparisons. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#88 + sig { returns(Symbol) } + def type; end - # source://prism//prism/parse_result/comments.rb#29 - def start_offset; end + private + + # A pointer to the source that this node was created from. + # + # source://prism//lib/prism/node.rb#13 + def source; end end -# The :line tracepoint event gets fired whenever the Ruby VM encounters an -# expression on a new line. The types of expressions that can trigger this -# event are: -# -# * if statements -# * unless statements -# * nodes that are children of statements lists -# -# In order to keep track of the newlines, we have a list of offsets that -# come back from the parser. We assign these offsets to the first nodes that -# we find in the tree that are on those lines. +# This object is responsible for generating the output for the inspect method +# implementations of child nodes. # -# Note that the logic in this file should be kept in sync with the Java -# MarkNewlinesVisitor, since that visitor is responsible for marking the -# newlines for JRuby/TruffleRuby. -class Prism::ParseResult::Newlines < ::Prism::Visitor - # Create a new Newlines visitor with the given newline offsets. +# source://prism//lib/prism/node_inspector.rb#6 +class Prism::NodeInspector + # @return [NodeInspector] a new instance of NodeInspector # - # @return [Newlines] a new instance of Newlines + # source://prism//lib/prism/node_inspector.rb#9 + def initialize(prefix = T.unsafe(nil)); end + + # Appends a line to the output with the current prefix. # - # source://prism//prism/parse_result/newlines.rb#22 - def initialize(newline_marked); end + # source://prism//lib/prism/node_inspector.rb#15 + sig { params(line: String).void } + def <<(line); end - # Permit block/lambda nodes to mark newlines within themselves. + # Returns a new inspector that can be used to inspect a child node. # - # source://prism//prism/parse_result/newlines.rb#27 - def visit_block_node(node); end + # source://prism//lib/prism/node_inspector.rb#59 + sig { params(append: String).returns(Prism::NodeInspector) } + def child_inspector(append); end - # Mark if/unless nodes as newlines. + # Generates a string that represents a child node. # - # source://prism//prism/parse_result/newlines.rb#41 - def visit_if_node(node); end + # source://prism//lib/prism/node_inspector.rb#54 + sig { params(node: Prism::Node, append: String).returns(String) } + def child_node(node, append); end - # Permit block/lambda nodes to mark newlines within themselves. + # This generates a string that is used as the header of the inspect output + # for any given node. # - # source://prism//prism/parse_result/newlines.rb#27 - def visit_lambda_node(node); end + # source://prism//lib/prism/node_inspector.rb#21 + # This generates a string that is used as the header of the inspect output + sig { params(node: Prism::Node).returns(String) } + def header(node); end - # Permit statements lists to mark newlines within themselves. + # Generates a string that represents a list of nodes. It handles properly + # using the box drawing characters to make the output look nice. # - # source://prism//prism/parse_result/newlines.rb#49 - def visit_statements_node(node); end + # source://prism//lib/prism/node_inspector.rb#31 + # Generates a string that represents a list of nodes. It handles properly + sig { params(prefix: String, nodes: T::Array[Prism::Node]).returns(String) } + def list(prefix, nodes); end - # Mark if/unless nodes as newlines. + # Generates a string that represents a location field on a node. # - # source://prism//prism/parse_result/newlines.rb#41 - def visit_unless_node(node); end + # source://prism//lib/prism/node_inspector.rb#45 + sig { params(value: Prism::Location).returns(String) } + def location(value); end + + # source://prism//lib/prism/node_inspector.rb#7 + sig { returns(String) } + def output; end + + # source://prism//lib/prism/node_inspector.rb#7 + sig { returns(String) } + def prefix; end + + # Returns the output as a string. + # + # source://prism//lib/prism/node_inspector.rb#64 + sig { returns(String) } + def to_str; end end -# This represents a warning that was encountered during parsing. -class Prism::ParseWarning - # Create a new warning object with the given message and location. +# Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. +# +# -> { _1 + _2 } +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#14118 +class Prism::NumberedParametersNode < ::Prism::Node + # def initialize: (Integer maximum, Location location) -> void # - # @return [ParseWarning] a new instance of ParseWarning + # @return [NumberedParametersNode] a new instance of NumberedParametersNode # - # source://prism//prism/parse_result.rb#341 - def initialize(message, location); end + # source://prism//lib/prism/node.rb#14120 + def initialize(source, maximum, location); end - # Implement the hash pattern matching interface for ParseWarning. + # def accept: (Visitor visitor) -> void # - # source://prism//prism/parse_result.rb#347 - def deconstruct_keys(keys); end + # source://prism//lib/prism/node.rb#14128 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # Returns a string representation of this warning. + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/parse_result.rb#352 - def inspect; end + # source://prism//lib/prism/node.rb#14133 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # A Location object representing the location of this warning in the source. + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/parse_result.rb#338 - def location; end + # source://prism//lib/prism/node.rb#14143 + def comment_targets; end - # The message associated with this warning. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/parse_result.rb#335 - def message; end -end + # source://prism//lib/prism/node.rb#14138 + def compact_child_nodes; end -# A pattern is an object that wraps a Ruby pattern matching expression. The -# expression would normally be passed to an `in` clause within a `case` -# expression or a rightward assignment expression. For example, in the -# following snippet: -# -# case node -# in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] -# end -# -# the pattern is the ConstantPathNode[...] expression. -# -# The pattern gets compiled into an object that responds to #call by running -# the #compile method. This method itself will run back through Prism to -# parse the expression into a tree, then walk the tree to generate the -# necessary callable objects. For example, if you wanted to compile the -# expression above into a callable, you would: -# -# callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile -# callable.call(node) -# -# The callable object returned by #compile is guaranteed to respond to #call -# with a single argument, which is the node to match against. It also is -# guaranteed to respond to #===, which means it itself can be used in a `case` -# expression, as in: -# -# case node -# when callable -# end -# -# If the query given to the initializer cannot be compiled into a valid -# matcher (either because of a syntax error or because it is using syntax we -# do not yet support) then a Prism::Pattern::CompilationError will be -# raised. -class Prism::Pattern - # Create a new pattern with the given query. The query should be a string - # containing a Ruby pattern matching expression. - # - # @return [Pattern] a new instance of Pattern - # - # source://prism//prism/pattern.rb#63 - def initialize(query); end - - # Compile the query into a callable object that can be used to match against - # nodes. - # - # source://prism//prism/pattern.rb#70 - def compile; end - - # The query that this pattern was initialized with. - # - # source://prism//prism/pattern.rb#59 - def query; end - - # Scan the given node and all of its children for nodes that match the - # pattern. If a block is given, it will be called with each node that - # matches the pattern. If no block is given, an enumerator will be returned - # that will yield each node that matches the pattern. - # - # source://prism//prism/pattern.rb#79 - def scan(root); end - - private - - # Shortcut for combining two procs into one that returns true if both return - # true. - # - # source://prism//prism/pattern.rb#95 - def combine_and(left, right); end - - # Shortcut for combining two procs into one that returns true if either - # returns true. - # - # source://prism//prism/pattern.rb#101 - def combine_or(left, right); end - - # in foo | bar - # - # source://prism//prism/pattern.rb#136 - def compile_alternation_pattern_node(node); end - - # in [foo, bar, baz] - # - # source://prism//prism/pattern.rb#111 - def compile_array_pattern_node(node); end - - # in Prism::ConstantReadNode - # - # source://prism//prism/pattern.rb#141 - def compile_constant_path_node(node); end - - # in ConstantReadNode - # in String + # def copy: (**params) -> NumberedParametersNode # - # source://prism//prism/pattern.rb#153 - def compile_constant_read_node(node); end + # source://prism//lib/prism/node.rb#14148 + sig { params(params: T.untyped).returns(Prism::NumberedParametersNode) } + def copy(**params); end - # Raise an error because the given node is not supported. - # - # @raise [CompilationError] + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/pattern.rb#106 - def compile_error(node); end + # source://prism//lib/prism/node.rb#14133 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # in InstanceVariableReadNode[name: Symbol] - # in { name: Symbol } + # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } # - # source://prism//prism/pattern.rb#171 - def compile_hash_pattern_node(node); end + # source://prism//lib/prism/node.rb#14160 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # in nil + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/pattern.rb#196 - def compile_nil_node(node); end + # source://prism//lib/prism/node.rb#14169 + def inspect(inspector = T.unsafe(nil)); end - # Compile any kind of node. Dispatch out to the individual compilation - # methods based on the type of node. + # attr_reader maximum: Integer # - # source://prism//prism/pattern.rb#225 - def compile_node(node); end + # source://prism//lib/prism/node.rb#14165 + sig { returns(Integer) } + def maximum; end - # in /foo/ + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/pattern.rb#201 - def compile_regular_expression_node(node); end - - # in "" - # in "foo" + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/pattern.rb#209 - def compile_string_node(node); end - - # in :+ - # in :foo + # def type: () -> Symbol # - # source://prism//prism/pattern.rb#217 - def compile_symbol_node(node); end -end + # source://prism//lib/prism/node.rb#14189 + def type; end -# Raised when the query given to a pattern is either invalid Ruby syntax or -# is using syntax that we don't yet support. -class Prism::Pattern::CompilationError < ::StandardError - # Create a new CompilationError with the given representation of the node - # that caused the error. - # - # @return [CompilationError] a new instance of CompilationError - # - # source://prism//prism/pattern.rb#43 - def initialize(repr); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#14199 + def type; end + end end -# Represents the use of the `^` operator for pinning an expression in a -# pattern matching expression. +# Represents reading a numbered reference to a capture in the previous match. # -# foo in ^(bar) -# ^^^^^^ -class Prism::PinnedExpressionNode < ::Prism::Node - # def initialize: (expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location) -> void +# $1 +# ^^ +# +# source://prism//lib/prism/node.rb#14208 +class Prism::NumberedReferenceReadNode < ::Prism::Node + # def initialize: (Integer number, Location location) -> void # - # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode + # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode # - # source://prism//prism/node.rb#13443 - def initialize(expression, operator_loc, lparen_loc, rparen_loc, location); end + # source://prism//lib/prism/node.rb#14210 + def initialize(source, number, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#13452 + # source://prism//lib/prism/node.rb#14218 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13457 + # source://prism//lib/prism/node.rb#14223 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#13467 + # source://prism//lib/prism/node.rb#14233 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#13462 + # source://prism//lib/prism/node.rb#14228 def compact_child_nodes; end - # def copy: (**params) -> PinnedExpressionNode + # def copy: (**params) -> NumberedReferenceReadNode # - # source://prism//prism/node.rb#13472 + # source://prism//lib/prism/node.rb#14238 + sig { params(params: T.untyped).returns(Prism::NumberedReferenceReadNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13457 + # source://prism//lib/prism/node.rb#14223 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location } # - # source://prism//prism/node.rb#13486 + # source://prism//lib/prism/node.rb#14250 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader expression: Node - # - # source://prism//prism/node.rb#13431 - def expression; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#13506 + # source://prism//lib/prism/node.rb#14265 def inspect(inspector = T.unsafe(nil)); end - # def lparen: () -> String - # - # source://prism//prism/node.rb#13496 - def lparen; end - - # attr_reader lparen_loc: Location - # - # source://prism//prism/node.rb#13437 - def lparen_loc; end - - # def operator: () -> String + # The (1-indexed, from the left) number of the capture group. Numbered references that would overflow a `uint32` result in a `number` of exactly `2**32 - 1`. # - # source://prism//prism/node.rb#13491 - def operator; end - - # attr_reader operator_loc: Location + # $1 # number `1` # - # source://prism//prism/node.rb#13434 - def operator_loc; end - - # def rparen: () -> String + # $5432 # number `5432` # - # source://prism//prism/node.rb#13501 - def rparen; end - - # attr_reader rparen_loc: Location + # $4294967296 # number `4294967295` # - # source://prism//prism/node.rb#13440 - def rparen_loc; end + # source://prism//lib/prism/node.rb#14261 + sig { returns(Integer) } + def number; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -18988,7 +20977,7 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#13530 + # source://prism//lib/prism/node.rb#14285 def type; end class << self @@ -18999,74 +20988,95 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#13540 + # source://prism//lib/prism/node.rb#14295 def type; end end end -# Represents the use of the `^` operator for pinning a variable in a pattern -# matching expression. +# Represents an optional keyword parameter to a method, block, or lambda definition. # -# foo in ^bar -# ^^^^ -class Prism::PinnedVariableNode < ::Prism::Node - # def initialize: (variable: Node, operator_loc: Location, location: Location) -> void +# def a(b: 1) +# ^^^^ +# end +# +# source://prism//lib/prism/node.rb#14305 +class Prism::OptionalKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Node value, Location location) -> void # - # @return [PinnedVariableNode] a new instance of PinnedVariableNode + # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode # - # source://prism//prism/node.rb#13558 - def initialize(variable, operator_loc, location); end + # source://prism//lib/prism/node.rb#14307 + def initialize(source, flags, name, name_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#13565 + # source://prism//lib/prism/node.rb#14318 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13570 + # source://prism//lib/prism/node.rb#14323 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#13580 + # source://prism//lib/prism/node.rb#14333 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#13575 + # source://prism//lib/prism/node.rb#14328 def compact_child_nodes; end - # def copy: (**params) -> PinnedVariableNode + # def copy: (**params) -> OptionalKeywordParameterNode # - # source://prism//prism/node.rb#13585 + # source://prism//lib/prism/node.rb#14338 + sig { params(params: T.untyped).returns(Prism::OptionalKeywordParameterNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13570 + # source://prism//lib/prism/node.rb#14323 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#13597 + # source://prism//lib/prism/node.rb#14353 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#13607 + # source://prism//lib/prism/node.rb#14380 def inspect(inspector = T.unsafe(nil)); end - # def operator: () -> String + # attr_reader name: Symbol # - # source://prism//prism/node.rb#13602 - def operator; end + # source://prism//lib/prism/node.rb#14362 + sig { returns(Symbol) } + def name; end - # attr_reader operator_loc: Location + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#13555 - def operator_loc; end + # source://prism//lib/prism/node.rb#14365 + sig { returns(Prism::Location) } + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#14375 + sig { returns(T::Boolean) } + def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -19083,13 +21093,22 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#13629 + # source://prism//lib/prism/node.rb#14405 def type; end - # attr_reader variable: Node + # attr_reader value: Node # - # source://prism//prism/node.rb#13552 - def variable; end + # source://prism//lib/prism/node.rb#14371 + sig { returns(Prism::Node) } + def value; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#14358 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -19099,98 +21118,107 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#13639 + # source://prism//lib/prism/node.rb#14415 def type; end end end -# Represents the use of the `END` keyword. +# Represents an optional parameter to a method, block, or lambda definition. # -# END { foo } -# ^^^^^^^^^^^ -class Prism::PostExecutionNode < ::Prism::Node - # def initialize: (statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void +# def a(b = 1) +# ^^^^^ +# end +# +# source://prism//lib/prism/node.rb#14425 +class Prism::OptionalParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void # - # @return [PostExecutionNode] a new instance of PostExecutionNode + # @return [OptionalParameterNode] a new instance of OptionalParameterNode # - # source://prism//prism/node.rb#13662 - def initialize(statements, keyword_loc, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#14427 + def initialize(source, flags, name, name_loc, operator_loc, value, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#13671 + # source://prism//lib/prism/node.rb#14439 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13676 + # source://prism//lib/prism/node.rb#14444 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#13722 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#13659 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#13688 + # source://prism//lib/prism/node.rb#14454 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#13681 + # source://prism//lib/prism/node.rb#14449 def compact_child_nodes; end - # def copy: (**params) -> PostExecutionNode + # def copy: (**params) -> OptionalParameterNode # - # source://prism//prism/node.rb#13693 + # source://prism//lib/prism/node.rb#14459 + sig { params(params: T.untyped).returns(Prism::OptionalParameterNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13676 + # source://prism//lib/prism/node.rb#14444 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } # - # source://prism//prism/node.rb#13707 + # source://prism//lib/prism/node.rb#14475 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#13727 + # source://prism//lib/prism/node.rb#14513 def inspect(inspector = T.unsafe(nil)); end - # def keyword: () -> String + # attr_reader name: Symbol # - # source://prism//prism/node.rb#13712 - def keyword; end + # source://prism//lib/prism/node.rb#14484 + sig { returns(Symbol) } + def name; end - # attr_reader keyword_loc: Location + # attr_reader name_loc: Location # - # source://prism//prism/node.rb#13653 - def keyword_loc; end + # source://prism//lib/prism/node.rb#14487 + sig { returns(Prism::Location) } + def name_loc; end - # def opening: () -> String + # def operator: () -> String # - # source://prism//prism/node.rb#13717 - def opening; end + # source://prism//lib/prism/node.rb#14508 + sig { returns(String) } + def operator; end - # attr_reader opening_loc: Location + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#13656 - def opening_loc; end + # source://prism//lib/prism/node.rb#14493 + sig { returns(Prism::Location) } + def operator_loc; end - # attr_reader statements: StatementsNode? + # def repeated_parameter?: () -> bool # - # source://prism//prism/node.rb#13650 - def statements; end + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#14503 + sig { returns(T::Boolean) } + def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -19207,9 +21235,23 @@ class Prism::PostExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#13755 + # source://prism//lib/prism/node.rb#14539 def type; end + # attr_reader value: Node + # + # source://prism//lib/prism/node.rb#14499 + sig { returns(Prism::Node) } + def value; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#14480 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -19218,98 +21260,113 @@ class Prism::PostExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#13765 + # source://prism//lib/prism/node.rb#14549 def type; end end end -# Represents the use of the `BEGIN` keyword. +# Represents the use of the `||` operator or the `or` keyword. # -# BEGIN { foo } +# left or right # ^^^^^^^^^^^^^ -class Prism::PreExecutionNode < ::Prism::Node - # def initialize: (statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void +# +# source://prism//lib/prism/node.rb#14558 +class Prism::OrNode < ::Prism::Node + # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void # - # @return [PreExecutionNode] a new instance of PreExecutionNode + # @return [OrNode] a new instance of OrNode # - # source://prism//prism/node.rb#13788 - def initialize(statements, keyword_loc, opening_loc, closing_loc, location); end + # source://prism//lib/prism/node.rb#14560 + def initialize(source, left, right, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#13797 + # source://prism//lib/prism/node.rb#14570 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13802 + # source://prism//lib/prism/node.rb#14575 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism//prism/node.rb#13848 - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism//prism/node.rb#13785 - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#13814 + # source://prism//lib/prism/node.rb#14585 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#13807 + # source://prism//lib/prism/node.rb#14580 def compact_child_nodes; end - # def copy: (**params) -> PreExecutionNode + # def copy: (**params) -> OrNode # - # source://prism//prism/node.rb#13819 + # source://prism//lib/prism/node.rb#14590 + sig { params(params: T.untyped).returns(Prism::OrNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#13802 + # source://prism//lib/prism/node.rb#14575 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#13833 + # source://prism//lib/prism/node.rb#14604 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#13853 + # source://prism//lib/prism/node.rb#14642 def inspect(inspector = T.unsafe(nil)); end - # def keyword: () -> String + # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism//prism/node.rb#13838 - def keyword; end - - # attr_reader keyword_loc: Location + # left or right + # ^^^^ # - # source://prism//prism/node.rb#13779 - def keyword_loc; end + # 1 || 2 + # ^ + # + # source://prism//lib/prism/node.rb#14615 + sig { returns(Prism::Node) } + def left; end - # def opening: () -> String + # def operator: () -> String # - # source://prism//prism/node.rb#13843 - def opening; end + # source://prism//lib/prism/node.rb#14637 + sig { returns(String) } + def operator; end - # attr_reader opening_loc: Location + # The location of the `or` keyword or the `||` operator. # - # source://prism//prism/node.rb#13782 - def opening_loc; end + # left or right + # ^^ + # + # source://prism//lib/prism/node.rb#14630 + sig { returns(Prism::Location) } + def operator_loc; end - # attr_reader statements: StatementsNode? + # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism//prism/node.rb#13776 - def statements; end + # left || right + # ^^^^^ + # + # 1 or 2 + # ^ + # + # source://prism//lib/prism/node.rb#14624 + sig { returns(Prism::Node) } + def right; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -19326,7 +21383,7 @@ class Prism::PreExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#13881 + # source://prism//lib/prism/node.rb#14666 def type; end class << self @@ -19337,288 +21394,374 @@ class Prism::PreExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#13891 + # source://prism//lib/prism/node.rb#14676 def type; end end end -# The top level node of any parse tree. -class Prism::ProgramNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], statements: StatementsNode, location: Location) -> void - # - # @return [ProgramNode] a new instance of ProgramNode - # - # source://prism//prism/node.rb#13905 - def initialize(locals, statements, location); end +# A parser for the pack template language. +# +# source://prism//lib/prism/pack.rb#5 +module Prism::Pack + class << self + def parse(_arg0, _arg1, _arg2); end + end +end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#13912 - def accept(visitor); end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#13917 - def child_nodes; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#13927 - def comment_targets; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#13922 - def compact_child_nodes; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) - # def copy: (**params) -> ProgramNode +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) + +# A directive in the pack template language. +# +# source://prism//lib/prism/pack.rb#59 +class Prism::Pack::Directive + # Initialize a new directive with the given values. # - # source://prism//prism/node.rb#13932 - def copy(**params); end + # @return [Directive] a new instance of Directive + # + # source://prism//lib/prism/pack.rb#88 + def initialize(version, variant, source, type, signed, endian, size, length_type, length); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Provide a human-readable description of the directive. # - # source://prism//prism/node.rb#13917 - def deconstruct; end + # source://prism//lib/prism/pack.rb#130 + def describe; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # The type of endianness of the directive. # - # source://prism//prism/node.rb#13944 - def deconstruct_keys(keys); end + # source://prism//lib/prism/pack.rb#76 + def endian; end - # def inspect(inspector: NodeInspector) -> String + # The length of this directive (used for integers). # - # source://prism//prism/node.rb#13949 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/pack.rb#85 + def length; end - # attr_reader locals: Array[Symbol] + # The length type of this directive (used for integers). # - # source://prism//prism/node.rb#13899 - def locals; end + # source://prism//lib/prism/pack.rb#82 + def length_type; end - # attr_reader statements: StatementsNode + # The type of signedness of the directive. # - # source://prism//prism/node.rb#13902 - def statements; end + # source://prism//lib/prism/pack.rb#73 + def signed; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # The size of the directive. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/pack.rb#79 + def size; end + + # A byteslice of the source string that this directive represents. # - # def type: () -> Symbol + # source://prism//lib/prism/pack.rb#67 + def source; end + + # The type of the directive. # - # source://prism//prism/node.rb#13971 + # source://prism//lib/prism/pack.rb#70 def type; end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#13981 - def type; end - end + # A symbol representing whether or not we are packing or unpacking. + # + # source://prism//lib/prism/pack.rb#64 + def variant; end + + # A symbol representing the version of Ruby. + # + # source://prism//lib/prism/pack.rb#61 + def version; end end -# Flags for range and flip-flop nodes. -module Prism::RangeFlags; end +# The descriptions of the various types of endianness. +# +# source://prism//lib/prism/pack.rb#101 +Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) -# ... operator +# The descriptions of the various types of signedness. # -# source://prism//prism/node.rb#17339 -Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) +# source://prism//lib/prism/pack.rb#110 +Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) -# Represents the use of the `..` or `...` operators. +# The descriptions of the various types of sizes. # -# 1..2 -# ^^^^ +# source://prism//lib/prism/pack.rb#117 +Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + +# The result of parsing a pack template. # -# c if a =~ /left/ ... b =~ /right/ -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -class Prism::RangeNode < ::Prism::Node - # def initialize: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> void +# source://prism//lib/prism/pack.rb#195 +class Prism::Pack::Format + # Create a new Format with the given directives and encoding. # - # @return [RangeNode] a new instance of RangeNode + # @return [Format] a new instance of Format # - # source://prism//prism/node.rb#14007 - def initialize(flags, left, right, operator_loc, location); end + # source://prism//lib/prism/pack.rb#203 + def initialize(directives, encoding); end - # def accept: (visitor: Visitor) -> void + # Provide a human-readable description of the format. # - # source://prism//prism/node.rb#14016 - def accept(visitor); end + # source://prism//lib/prism/pack.rb#209 + def describe; end - # def child_nodes: () -> Array[nil | Node] + # A list of the directives in the template. # - # source://prism//prism/node.rb#14021 - def child_nodes; end + # source://prism//lib/prism/pack.rb#197 + def directives; end - # def comment_targets: () -> Array[Node | Location] + # The encoding of the template. # - # source://prism//prism/node.rb#14034 - def comment_targets; end + # source://prism//lib/prism/pack.rb#200 + def encoding; end +end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#14026 - def compact_child_nodes; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) - # def copy: (**params) -> RangeNode - # - # source://prism//prism/node.rb#14039 - def copy(**params); end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#14021 - def deconstruct; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#14053 - def deconstruct_keys(keys); end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) - # def exclude_end?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#14058 - def exclude_end?; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#14068 - def inspect(inspector = T.unsafe(nil)); end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) - # attr_reader left: Node? - # - # source://prism//prism/node.rb#13998 - def left; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) - # def operator: () -> String - # - # source://prism//prism/node.rb#14063 - def operator; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#14004 - def operator_loc; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) - # attr_reader right: Node? - # - # source://prism//prism/node.rb#14001 - def right; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#14102 - def type; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) - private +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#13995 - def flags; end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#14112 - def type; end - end -end +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) -# Represents a rational number literal. +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + +# source://prism//lib/prism/pack.rb#55 +Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + +# Flags for parameter nodes. # -# 1.0r -# ^^^^ -class Prism::RationalNode < ::Prism::Node - # def initialize: (numeric: Node, location: Location) -> void +# source://prism//lib/prism/node.rb#19304 +module Prism::ParameterFlags; end + +# a parameter name that has been repeated in the method signature +# +# source://prism//lib/prism/node.rb#19306 +Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) + +# Represents the list of parameters on a method, block, or lambda definition. +# +# def a(b, c, d) +# ^^^^^^^ +# end +# +# source://prism//lib/prism/node.rb#14686 +class Prism::ParametersNode < ::Prism::Node + # def initialize: (Array[Node] requireds, Array[Node] optionals, Node? rest, Array[Node] posts, Array[Node] keywords, Node? keyword_rest, BlockParameterNode? block, Location location) -> void # - # @return [RationalNode] a new instance of RationalNode + # @return [ParametersNode] a new instance of ParametersNode # - # source://prism//prism/node.rb#14126 - def initialize(numeric, location); end + # source://prism//lib/prism/node.rb#14688 + def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14132 + # source://prism//lib/prism/node.rb#14702 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader block: BlockParameterNode? + # + # source://prism//lib/prism/node.rb#14771 + sig { returns(T.nilable(Prism::BlockParameterNode)) } + def block; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14137 + # source://prism//lib/prism/node.rb#14707 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14147 + # source://prism//lib/prism/node.rb#14725 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14142 + # source://prism//lib/prism/node.rb#14712 def compact_child_nodes; end - # def copy: (**params) -> RationalNode + # def copy: (**params) -> ParametersNode # - # source://prism//prism/node.rb#14152 + # source://prism//lib/prism/node.rb#14730 + sig { params(params: T.untyped).returns(Prism::ParametersNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14137 + # source://prism//lib/prism/node.rb#14707 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[Node], optionals: Array[Node], rest: Node?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location } # - # source://prism//prism/node.rb#14163 + # source://prism//lib/prism/node.rb#14748 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14168 + # source://prism//lib/prism/node.rb#14775 def inspect(inspector = T.unsafe(nil)); end - # attr_reader numeric: Node + # attr_reader keyword_rest: Node? # - # source://prism//prism/node.rb#14123 - def numeric; end + # source://prism//lib/prism/node.rb#14768 + sig { returns(T.nilable(Prism::Node)) } + def keyword_rest; end + + # attr_reader keywords: Array[Node] + # + # source://prism//lib/prism/node.rb#14765 + sig { returns(T::Array[Prism::Node]) } + def keywords; end + + # attr_reader optionals: Array[Node] + # + # source://prism//lib/prism/node.rb#14756 + sig { returns(T::Array[Prism::Node]) } + def optionals; end + + # attr_reader posts: Array[Node] + # + # source://prism//lib/prism/node.rb#14762 + sig { returns(T::Array[Prism::Node]) } + def posts; end + + # attr_reader requireds: Array[Node] + # + # source://prism//lib/prism/node.rb#14753 + sig { returns(T::Array[Prism::Node]) } + def requireds; end + + # attr_reader rest: Node? + # + # source://prism//lib/prism/node.rb#14759 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # Mirrors the Method#parameters method. + # + # source://prism//lib/prism/node_ext.rb#172 + def signature; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -19635,14 +21778,9 @@ class Prism::RationalNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14189 + # source://prism//lib/prism/node.rb#14816 def type; end - # Returns the value of the node as a Ruby Rational. - # - # source://prism//prism/node_ext.rb#83 - def value; end - class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -19651,64 +21789,108 @@ class Prism::RationalNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#14199 + # source://prism//lib/prism/node.rb#14826 def type; end end end -# Represents the use of the `redo` keyword. +# Represents a parenthesized expression # -# redo -# ^^^^ -class Prism::RedoNode < ::Prism::Node - # def initialize: (location: Location) -> void +# (10 + 34) +# ^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#14835 +class Prism::ParenthesesNode < ::Prism::Node + # def initialize: (Node? body, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [RedoNode] a new instance of RedoNode + # @return [ParenthesesNode] a new instance of ParenthesesNode # - # source://prism//prism/node.rb#14210 - def initialize(location); end + # source://prism//lib/prism/node.rb#14837 + def initialize(source, body, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14215 + # source://prism//lib/prism/node.rb#14847 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end + # attr_reader body: Node? + # + # source://prism//lib/prism/node.rb#14892 + sig { returns(T.nilable(Prism::Node)) } + def body; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14220 + # source://prism//lib/prism/node.rb#14856 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#14913 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#14901 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14230 + # source://prism//lib/prism/node.rb#14868 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14225 + # source://prism//lib/prism/node.rb#14861 def compact_child_nodes; end - # def copy: (**params) -> RedoNode + # def copy: (**params) -> ParenthesesNode # - # source://prism//prism/node.rb#14235 + # source://prism//lib/prism/node.rb#14873 + sig { params(params: T.untyped).returns(Prism::ParenthesesNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14220 + # source://prism//lib/prism/node.rb#14856 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { body: Node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#14245 + # source://prism//lib/prism/node.rb#14887 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14250 + # source://prism//lib/prism/node.rb#14918 def inspect(inspector = T.unsafe(nil)); end + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#14908 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#14895 + sig { returns(Prism::Location) } + def opening_loc; end + + # source://prism//lib/prism/node.rb#14851 + def set_newline_flag(newline_marked); end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -19724,7 +21906,7 @@ class Prism::RedoNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14269 + # source://prism//lib/prism/node.rb#14945 def type; end class << self @@ -19735,435 +21917,589 @@ class Prism::RedoNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#14279 + # source://prism//lib/prism/node.rb#14955 def type; end end end -# Flags for regular expression and match last line nodes. -module Prism::RegularExpressionFlags; end - -# n - forces the ASCII-8BIT encoding -# -# source://prism//prism/node.rb#17360 -Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) - -# e - forces the EUC-JP encoding -# -# source://prism//prism/node.rb#17357 -Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) - -# x - ignores whitespace and allows comments in regular expressions -# -# source://prism//prism/node.rb#17348 -Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) - -# internal bytes forced the encoding to binary +# This represents an error that was encountered during parsing. # -# source://prism//prism/node.rb#17372 -Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) +# source://prism//lib/prism/parse_result.rb#338 +class Prism::ParseError + # Create a new error object with the given message and location. + # + # @return [ParseError] a new instance of ParseError + # + # source://prism//lib/prism/parse_result.rb#349 + def initialize(message, location, level); end -# internal bytes forced the encoding to US-ASCII -# -# source://prism//prism/node.rb#17375 -Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + # Implement the hash pattern matching interface for ParseError. + # + # source://prism//lib/prism/parse_result.rb#356 + def deconstruct_keys(keys); end -# internal bytes forced the encoding to UTF-8 -# -# source://prism//prism/node.rb#17369 -Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + # Returns a string representation of this error. + # + # source://prism//lib/prism/parse_result.rb#361 + def inspect; end -# i - ignores the case of characters when matching -# -# source://prism//prism/node.rb#17345 -Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) + # The level of this error. + # + # source://prism//lib/prism/parse_result.rb#346 + def level; end -# m - allows $ to match the end of lines within strings -# -# source://prism//prism/node.rb#17351 -Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) + # A Location object representing the location of this error in the source. + # + # source://prism//lib/prism/parse_result.rb#343 + sig { returns(Prism::Location) } + def location; end -# o - only interpolates values into the regular expression once -# -# source://prism//prism/node.rb#17354 -Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) + # The message associated with this error. + # + # source://prism//lib/prism/parse_result.rb#340 + sig { returns(String) } + def message; end +end -# u - forces the UTF-8 encoding +# This represents the result of a call to ::parse or ::parse_file. It contains +# the AST, any comments that were encounters, and any errors that were +# encountered. # -# source://prism//prism/node.rb#17366 -Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) +# source://prism//lib/prism/parse_result.rb#398 +class Prism::ParseResult + # Create a new parse result object with the given values. + # + # @return [ParseResult] a new instance of ParseResult + # + # source://prism//lib/prism/parse_result.rb#425 + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end -# s - forces the Windows-31J encoding -# -# source://prism//prism/node.rb#17363 -Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) + # Attach the list of comments to their respective locations in the tree. + # + # source://prism//lib/prism/parse_result/comments.rb#173 + def attach_comments!; end -# Represents a regular expression literal with no interpolation. -# -# /foo/i -# ^^^^^^ -class Prism::RegularExpressionNode < ::Prism::Node - include ::Prism::RegularExpressionOptions + # The list of comments that were encountered during parsing. + # + # source://prism//lib/prism/parse_result.rb#405 + sig { returns(T::Array[Prism::Comment]) } + def comments; end - # def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void + # An optional location that represents the location of the __END__ marker + # and the rest of the content of the file. This content is loaded into the + # DATA constant when the file being parsed is the main file being executed. # - # @return [RegularExpressionNode] a new instance of RegularExpressionNode + # source://prism//lib/prism/parse_result.rb#413 + def data_loc; end + + # Implement the hash pattern matching interface for ParseResult. # - # source://prism//prism/node.rb#14305 - def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism//lib/prism/parse_result.rb#436 + def deconstruct_keys(keys); end - # def accept: (visitor: Visitor) -> void + # The list of errors that were generated during parsing. # - # source://prism//prism/node.rb#14315 - def accept(visitor); end + # source://prism//lib/prism/parse_result.rb#416 + sig { returns(T::Array[Prism::ParseError]) } + def errors; end - # def ascii_8bit?: () -> bool + # Returns true if there were errors during parsing and false if there were + # not. # # @return [Boolean] # - # source://prism//prism/node.rb#14380 - def ascii_8bit?; end + # source://prism//lib/prism/parse_result.rb#448 + def failure?; end - # def child_nodes: () -> Array[nil | Node] + # The list of magic comments that were encountered during parsing. # - # source://prism//prism/node.rb#14320 - def child_nodes; end + # source://prism//lib/prism/parse_result.rb#408 + def magic_comments; end - # def closing: () -> String + # Walk the tree and mark nodes that are on a new line. # - # source://prism//prism/node.rb#14420 - def closing; end + # source://prism//lib/prism/parse_result/newlines.rb#60 + def mark_newlines!; end - # attr_reader closing_loc: Location + # A Source instance that represents the source code that was parsed. # - # source://prism//prism/node.rb#14299 - def closing_loc; end + # source://prism//lib/prism/parse_result.rb#422 + sig { returns(Prism::Source) } + def source; end - # def comment_targets: () -> Array[Node | Location] + # Returns true if there were no errors during parsing and false if there + # were. # - # source://prism//prism/node.rb#14330 - def comment_targets; end - - # def compact_child_nodes: () -> Array[Node] + # @return [Boolean] # - # source://prism//prism/node.rb#14325 - def compact_child_nodes; end + # source://prism//lib/prism/parse_result.rb#442 + def success?; end - # def content: () -> String - # - # source://prism//prism/node.rb#14415 - def content; end - - # attr_reader content_loc: Location - # - # source://prism//prism/node.rb#14296 - def content_loc; end - - # def copy: (**params) -> RegularExpressionNode - # - # source://prism//prism/node.rb#14335 - def copy(**params); end - - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#14320 - def deconstruct; end - - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # The value that was generated by parsing. Normally this holds the AST, but + # it can sometimes how a list of tokens or other results passed back from + # the parser. # - # source://prism//prism/node.rb#14350 - def deconstruct_keys(keys); end + # source://prism//lib/prism/parse_result.rb#402 + sig { returns(Prism::ProgramNode) } + def value; end - # def euc_jp?: () -> bool - # - # @return [Boolean] + # The list of warnings that were generated during parsing. # - # source://prism//prism/node.rb#14375 - def euc_jp?; end + # source://prism//lib/prism/parse_result.rb#419 + sig { returns(T::Array[Prism::ParseWarning]) } + def warnings; end +end - # def extended?: () -> bool +# When we've parsed the source, we have both the syntax tree and the list of +# comments that we found in the source. This class is responsible for +# walking the tree and finding the nearest location to attach each comment. +# +# It does this by first finding the nearest locations to each comment. +# Locations can either come from nodes directly or from location fields on +# nodes. For example, a `ClassNode` has an overall location encompassing the +# entire class, but it also has a location for the `class` keyword. +# +# Once the nearest locations are found, it determines which one to attach +# to. If it's a trailing comment (a comment on the same line as other source +# code), it will favor attaching to the nearest location that occurs before +# the comment. Otherwise it will favor attaching to the nearest location +# that is after the comment. +# +# source://prism//lib/prism/parse_result/comments.rb#19 +class Prism::ParseResult::Comments + # Create a new Comments object that will attach comments to the given + # parse result. # - # @return [Boolean] + # @return [Comments] a new instance of Comments # - # source://prism//prism/node.rb#14360 - def extended?; end + # source://prism//lib/prism/parse_result/comments.rb#78 + def initialize(parse_result); end - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] + # Attach the comments to their respective locations in the tree by + # mutating the parse result. # - # source://prism//prism/node.rb#14400 - def forced_binary_encoding?; end + # source://prism//lib/prism/parse_result/comments.rb#84 + def attach!; end - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] + # The parse result that we are attaching comments to. # - # source://prism//prism/node.rb#14405 - def forced_us_ascii_encoding?; end + # source://prism//lib/prism/parse_result/comments.rb#74 + def parse_result; end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#14395 - def forced_utf8_encoding?; end + private - # def ignore_case?: () -> bool - # - # @return [Boolean] + # Responsible for finding the nearest targets to the given comment within + # the context of the given encapsulating node. # - # source://prism//prism/node.rb#14355 - def ignore_case?; end + # source://prism//lib/prism/parse_result/comments.rb#103 + def nearest_targets(node, comment); end +end - # def inspect(inspector: NodeInspector) -> String +# A target for attaching comments that is based on a location field on a +# node. For example, the `end` token of a ClassNode. +# +# source://prism//lib/prism/parse_result/comments.rb#49 +class Prism::ParseResult::Comments::LocationTarget + # @return [LocationTarget] a new instance of LocationTarget # - # source://prism//prism/node.rb#14425 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/parse_result/comments.rb#52 + def initialize(location); end - # def multi_line?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#14365 - def multi_line?; end + # source://prism//lib/prism/parse_result/comments.rb#68 + def <<(comment); end - # def once?: () -> bool - # # @return [Boolean] # - # source://prism//prism/node.rb#14370 - def once?; end + # source://prism//lib/prism/parse_result/comments.rb#64 + def encloses?(comment); end - # def opening: () -> String - # - # source://prism//prism/node.rb#14410 - def opening; end + # source://prism//lib/prism/parse_result/comments.rb#60 + def end_offset; end - # attr_reader opening_loc: Location - # - # source://prism//prism/node.rb#14293 - def opening_loc; end + # source://prism//lib/prism/parse_result/comments.rb#50 + def location; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#14450 - def type; end + # source://prism//lib/prism/parse_result/comments.rb#56 + def start_offset; end +end - # attr_reader unescaped: String +# A target for attaching comments that is based on a specific node's +# location. +# +# source://prism//lib/prism/parse_result/comments.rb#22 +class Prism::ParseResult::Comments::NodeTarget + # @return [NodeTarget] a new instance of NodeTarget # - # source://prism//prism/node.rb#14302 - def unescaped; end + # source://prism//lib/prism/parse_result/comments.rb#25 + def initialize(node); end - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#14390 - def utf_8?; end + # source://prism//lib/prism/parse_result/comments.rb#42 + def <<(comment); end - # def windows_31j?: () -> bool - # # @return [Boolean] # - # source://prism//prism/node.rb#14385 - def windows_31j?; end - - private + # source://prism//lib/prism/parse_result/comments.rb#37 + def encloses?(comment); end - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#14290 - def flags; end + # source://prism//lib/prism/parse_result/comments.rb#33 + def end_offset; end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#14460 - def type; end - end -end + # source://prism//lib/prism/parse_result/comments.rb#23 + def node; end -module Prism::RegularExpressionOptions - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # - # source://prism//prism/node_ext.rb#9 - def options; end + # source://prism//lib/prism/parse_result/comments.rb#29 + def start_offset; end end -# Represents a required keyword parameter to a method, block, or lambda definition. +# The :line tracepoint event gets fired whenever the Ruby VM encounters an +# expression on a new line. The types of expressions that can trigger this +# event are: # -# def a(b: ) -# ^^ -# end -class Prism::RequiredKeywordParameterNode < ::Prism::Node - # def initialize: (name: Symbol, name_loc: Location, location: Location) -> void +# * if statements +# * unless statements +# * nodes that are children of statements lists +# +# In order to keep track of the newlines, we have a list of offsets that +# come back from the parser. We assign these offsets to the first nodes that +# we find in the tree that are on those lines. +# +# Note that the logic in this file should be kept in sync with the Java +# MarkNewlinesVisitor, since that visitor is responsible for marking the +# newlines for JRuby/TruffleRuby. +# +# source://prism//lib/prism/parse_result/newlines.rb#20 +class Prism::ParseResult::Newlines < ::Prism::Visitor + # Create a new Newlines visitor with the given newline offsets. # - # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode + # @return [Newlines] a new instance of Newlines # - # source://prism//prism/node.rb#14478 - def initialize(name, name_loc, location); end + # source://prism//lib/prism/parse_result/newlines.rb#22 + def initialize(newline_marked); end - # def accept: (visitor: Visitor) -> void + # Permit block/lambda nodes to mark newlines within themselves. # - # source://prism//prism/node.rb#14485 - def accept(visitor); end + # source://prism//lib/prism/parse_result/newlines.rb#27 + def visit_block_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Mark if/unless nodes as newlines. # - # source://prism//prism/node.rb#14490 - def child_nodes; end + # source://prism//lib/prism/parse_result/newlines.rb#41 + def visit_if_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Permit block/lambda nodes to mark newlines within themselves. # - # source://prism//prism/node.rb#14500 - def comment_targets; end + # source://prism//lib/prism/parse_result/newlines.rb#27 + def visit_lambda_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Permit statements lists to mark newlines within themselves. # - # source://prism//prism/node.rb#14495 - def compact_child_nodes; end + # source://prism//lib/prism/parse_result/newlines.rb#49 + def visit_statements_node(node); end - # def copy: (**params) -> RequiredKeywordParameterNode + # Mark if/unless nodes as newlines. # - # source://prism//prism/node.rb#14505 - def copy(**params); end + # source://prism//lib/prism/parse_result/newlines.rb#41 + def visit_unless_node(node); end +end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] +# This represents a warning that was encountered during parsing. +# +# source://prism//lib/prism/parse_result.rb#367 +class Prism::ParseWarning + # Create a new warning object with the given message and location. # - # source://prism//prism/node.rb#14490 - def deconstruct; end + # @return [ParseWarning] a new instance of ParseWarning + # + # source://prism//lib/prism/parse_result.rb#378 + def initialize(message, location, level); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Implement the hash pattern matching interface for ParseWarning. # - # source://prism//prism/node.rb#14517 + # source://prism//lib/prism/parse_result.rb#385 def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # Returns a string representation of this warning. # - # source://prism//prism/node.rb#14522 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/parse_result.rb#390 + def inspect; end - # attr_reader name: Symbol + # The level of this warning. # - # source://prism//prism/node.rb#14472 - def name; end + # source://prism//lib/prism/parse_result.rb#375 + def level; end - # attr_reader name_loc: Location + # A Location object representing the location of this warning in the source. # - # source://prism//prism/node.rb#14475 - def name_loc; end + # source://prism//lib/prism/parse_result.rb#372 + sig { returns(Prism::Location) } + def location; end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol + # The message associated with this warning. # - # source://prism//prism/node.rb#14543 - def type; end - - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#14553 - def type; end - end + # source://prism//lib/prism/parse_result.rb#369 + sig { returns(String) } + def message; end end -# Represents a required parameter to a method, block, or lambda definition. +# A pattern is an object that wraps a Ruby pattern matching expression. The +# expression would normally be passed to an `in` clause within a `case` +# expression or a rightward assignment expression. For example, in the +# following snippet: # -# def a(b) -# ^ +# case node +# in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] # end -class Prism::RequiredParameterNode < ::Prism::Node - # def initialize: (name: Symbol, location: Location) -> void +# +# the pattern is the ConstantPathNode[...] expression. +# +# The pattern gets compiled into an object that responds to #call by running +# the #compile method. This method itself will run back through Prism to +# parse the expression into a tree, then walk the tree to generate the +# necessary callable objects. For example, if you wanted to compile the +# expression above into a callable, you would: +# +# callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile +# callable.call(node) +# +# The callable object returned by #compile is guaranteed to respond to #call +# with a single argument, which is the node to match against. It also is +# guaranteed to respond to #===, which means it itself can be used in a `case` +# expression, as in: +# +# case node +# when callable +# end +# +# If the query given to the initializer cannot be compiled into a valid +# matcher (either because of a syntax error or because it is using syntax we +# do not yet support) then a Prism::Pattern::CompilationError will be +# raised. +# +# source://prism//lib/prism/pattern.rb#37 +class Prism::Pattern + # Create a new pattern with the given query. The query should be a string + # containing a Ruby pattern matching expression. # - # @return [RequiredParameterNode] a new instance of RequiredParameterNode + # @return [Pattern] a new instance of Pattern + # + # source://prism//lib/prism/pattern.rb#63 + def initialize(query); end + + # Compile the query into a callable object that can be used to match against + # nodes. + # + # source://prism//lib/prism/pattern.rb#70 + def compile; end + + # The query that this pattern was initialized with. + # + # source://prism//lib/prism/pattern.rb#59 + def query; end + + # Scan the given node and all of its children for nodes that match the + # pattern. If a block is given, it will be called with each node that + # matches the pattern. If no block is given, an enumerator will be returned + # that will yield each node that matches the pattern. + # + # source://prism//lib/prism/pattern.rb#79 + def scan(root); end + + private + + # Shortcut for combining two procs into one that returns true if both return + # true. + # + # source://prism//lib/prism/pattern.rb#95 + def combine_and(left, right); end + + # Shortcut for combining two procs into one that returns true if either + # returns true. + # + # source://prism//lib/prism/pattern.rb#101 + def combine_or(left, right); end + + # in foo | bar + # + # source://prism//lib/prism/pattern.rb#136 + def compile_alternation_pattern_node(node); end + + # in [foo, bar, baz] + # + # source://prism//lib/prism/pattern.rb#111 + def compile_array_pattern_node(node); end + + # in Prism::ConstantReadNode + # + # source://prism//lib/prism/pattern.rb#141 + def compile_constant_path_node(node); end + + # in ConstantReadNode + # in String + # + # source://prism//lib/prism/pattern.rb#153 + def compile_constant_read_node(node); end + + # Raise an error because the given node is not supported. + # + # @raise [CompilationError] + # + # source://prism//lib/prism/pattern.rb#106 + def compile_error(node); end + + # in InstanceVariableReadNode[name: Symbol] + # in { name: Symbol } + # + # source://prism//lib/prism/pattern.rb#171 + def compile_hash_pattern_node(node); end + + # in nil + # + # source://prism//lib/prism/pattern.rb#196 + def compile_nil_node(node); end + + # Compile any kind of node. Dispatch out to the individual compilation + # methods based on the type of node. + # + # source://prism//lib/prism/pattern.rb#225 + def compile_node(node); end + + # in /foo/ + # + # source://prism//lib/prism/pattern.rb#201 + def compile_regular_expression_node(node); end + + # in "" + # in "foo" + # + # source://prism//lib/prism/pattern.rb#209 + def compile_string_node(node); end + + # in :+ + # in :foo + # + # source://prism//lib/prism/pattern.rb#217 + def compile_symbol_node(node); end +end + +# Raised when the query given to a pattern is either invalid Ruby syntax or +# is using syntax that we don't yet support. +# +# source://prism//lib/prism/pattern.rb#40 +class Prism::Pattern::CompilationError < ::StandardError + # Create a new CompilationError with the given representation of the node + # that caused the error. + # + # @return [CompilationError] a new instance of CompilationError + # + # source://prism//lib/prism/pattern.rb#43 + def initialize(repr); end +end + +# Represents the use of the `^` operator for pinning an expression in a pattern matching expression. +# +# foo in ^(bar) +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#14964 +class Prism::PinnedExpressionNode < ::Prism::Node + # def initialize: (Node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void # - # source://prism//prism/node.rb#14568 - def initialize(name, location); end + # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode + # + # source://prism//lib/prism/node.rb#14966 + def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14574 + # source://prism//lib/prism/node.rb#14977 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14579 + # source://prism//lib/prism/node.rb#14982 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14589 + # source://prism//lib/prism/node.rb#14992 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14584 + # source://prism//lib/prism/node.rb#14987 def compact_child_nodes; end - # def copy: (**params) -> RequiredParameterNode + # def copy: (**params) -> PinnedExpressionNode # - # source://prism//prism/node.rb#14594 + # source://prism//lib/prism/node.rb#14997 + sig { params(params: T.untyped).returns(Prism::PinnedExpressionNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14579 + # source://prism//lib/prism/node.rb#14982 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } # - # source://prism//prism/node.rb#14605 + # source://prism//lib/prism/node.rb#15012 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # attr_reader expression: Node + # + # source://prism//lib/prism/node.rb#15017 + sig { returns(Prism::Node) } + def expression; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14610 + # source://prism//lib/prism/node.rb#15054 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # def lparen: () -> String # - # source://prism//prism/node.rb#14565 - def name; end + # source://prism//lib/prism/node.rb#15044 + sig { returns(String) } + def lparen; end + + # attr_reader lparen_loc: Location + # + # source://prism//lib/prism/node.rb#15026 + sig { returns(Prism::Location) } + def lparen_loc; end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#15039 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#15020 + sig { returns(Prism::Location) } + def operator_loc; end + + # def rparen: () -> String + # + # source://prism//lib/prism/node.rb#15049 + sig { returns(String) } + def rparen; end + + # attr_reader rparen_loc: Location + # + # source://prism//lib/prism/node.rb#15032 + sig { returns(Prism::Location) } + def rparen_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -20180,7 +22516,7 @@ class Prism::RequiredParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14630 + # source://prism//lib/prism/node.rb#15078 def type; end class << self @@ -20191,86 +22527,86 @@ class Prism::RequiredParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#14640 + # source://prism//lib/prism/node.rb#15088 def type; end end end -# Represents an expression modified with a rescue. +# Represents the use of the `^` operator for pinning a variable in a pattern matching expression. # -# foo rescue nil -# ^^^^^^^^^^^^^^ -class Prism::RescueModifierNode < ::Prism::Node - # def initialize: (expression: Node, keyword_loc: Location, rescue_expression: Node, location: Location) -> void +# foo in ^bar +# ^^^^ +# +# source://prism//lib/prism/node.rb#15097 +class Prism::PinnedVariableNode < ::Prism::Node + # def initialize: (Node variable, Location operator_loc, Location location) -> void # - # @return [RescueModifierNode] a new instance of RescueModifierNode + # @return [PinnedVariableNode] a new instance of PinnedVariableNode # - # source://prism//prism/node.rb#14660 - def initialize(expression, keyword_loc, rescue_expression, location); end + # source://prism//lib/prism/node.rb#15099 + def initialize(source, variable, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14668 + # source://prism//lib/prism/node.rb#15108 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14677 + # source://prism//lib/prism/node.rb#15113 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14687 + # source://prism//lib/prism/node.rb#15123 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14682 + # source://prism//lib/prism/node.rb#15118 def compact_child_nodes; end - # def copy: (**params) -> RescueModifierNode + # def copy: (**params) -> PinnedVariableNode # - # source://prism//prism/node.rb#14692 + # source://prism//lib/prism/node.rb#15128 + sig { params(params: T.untyped).returns(Prism::PinnedVariableNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14677 + # source://prism//lib/prism/node.rb#15113 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Node, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#14705 + # source://prism//lib/prism/node.rb#15141 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader expression: Node - # - # source://prism//prism/node.rb#14651 - def expression; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14715 + # source://prism//lib/prism/node.rb#15161 def inspect(inspector = T.unsafe(nil)); end - # def keyword: () -> String - # - # source://prism//prism/node.rb#14710 - def keyword; end - - # attr_reader keyword_loc: Location + # def operator: () -> String # - # source://prism//prism/node.rb#14654 - def keyword_loc; end + # source://prism//lib/prism/node.rb#15156 + sig { returns(String) } + def operator; end - # attr_reader rescue_expression: Node + # attr_reader operator_loc: Location # - # source://prism//prism/node.rb#14657 - def rescue_expression; end - - # source://prism//prism/node.rb#14672 - def set_newline_flag(newline_marked); end + # source://prism//lib/prism/node.rb#15149 + sig { returns(Prism::Location) } + def operator_loc; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -20287,9 +22623,15 @@ class Prism::RescueModifierNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14739 + # source://prism//lib/prism/node.rb#15183 def type; end + # attr_reader variable: Node + # + # source://prism//lib/prism/node.rb#15146 + sig { returns(Prism::Node) } + def variable; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -20298,108 +22640,115 @@ class Prism::RescueModifierNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#14749 + # source://prism//lib/prism/node.rb#15193 def type; end end end -# Represents a rescue statement. +# Represents the use of the `END` keyword. # -# begin -# rescue Foo, *splat, Bar => ex -# foo -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# end +# END { foo } +# ^^^^^^^^^^^ # -# `Foo, *splat, Bar` are in the `exceptions` field. -# `ex` is in the `exception` field. -class Prism::RescueNode < ::Prism::Node - # def initialize: (keyword_loc: Location, exceptions: Array[Node], operator_loc: Location?, reference: Node?, statements: StatementsNode?, consequent: RescueNode?, location: Location) -> void +# source://prism//lib/prism/node.rb#15202 +class Prism::PostExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [RescueNode] a new instance of RescueNode + # @return [PostExecutionNode] a new instance of PostExecutionNode # - # source://prism//prism/node.rb#14784 - def initialize(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end + # source://prism//lib/prism/node.rb#15204 + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14795 + # source://prism//lib/prism/node.rb#15215 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14800 + # source://prism//lib/prism/node.rb#15220 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#15289 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15272 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14815 + # source://prism//lib/prism/node.rb#15232 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14805 + # source://prism//lib/prism/node.rb#15225 def compact_child_nodes; end - # attr_reader consequent: RescueNode? - # - # source://prism//prism/node.rb#14781 - def consequent; end - - # def copy: (**params) -> RescueNode + # def copy: (**params) -> PostExecutionNode # - # source://prism//prism/node.rb#14820 + # source://prism//lib/prism/node.rb#15237 + sig { params(params: T.untyped).returns(Prism::PostExecutionNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14800 + # source://prism//lib/prism/node.rb#15220 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#14836 + # source://prism//lib/prism/node.rb#15252 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # attr_reader exceptions: Array[Node] - # - # source://prism//prism/node.rb#14769 - def exceptions; end - - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14851 + # source://prism//lib/prism/node.rb#15294 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#14841 + # source://prism//lib/prism/node.rb#15279 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#14766 + # source://prism//lib/prism/node.rb#15260 + sig { returns(Prism::Location) } def keyword_loc; end - # def operator: () -> String? - # - # source://prism//prism/node.rb#14846 - def operator; end - - # attr_reader operator_loc: Location? + # def opening: () -> String # - # source://prism//prism/node.rb#14772 - def operator_loc; end + # source://prism//lib/prism/node.rb#15284 + sig { returns(String) } + def opening; end - # attr_reader reference: Node? + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#14775 - def reference; end + # source://prism//lib/prism/node.rb#15266 + sig { returns(Prism::Location) } + def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#14778 + # source://prism//lib/prism/node.rb#15257 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -20417,7 +22766,7 @@ class Prism::RescueNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14891 + # source://prism//lib/prism/node.rb#15322 def type; end class << self @@ -20428,84 +22777,116 @@ class Prism::RescueNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#14901 + # source://prism//lib/prism/node.rb#15332 def type; end end end -# Represents a rest parameter to a method, block, or lambda definition. +# Represents the use of the `BEGIN` keyword. # -# def a(*b) -# ^^ -# end -class Prism::RestParameterNode < ::Prism::Node - # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void +# BEGIN { foo } +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#15341 +class Prism::PreExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [RestParameterNode] a new instance of RestParameterNode + # @return [PreExecutionNode] a new instance of PreExecutionNode # - # source://prism//prism/node.rb#14922 - def initialize(name, name_loc, operator_loc, location); end + # source://prism//lib/prism/node.rb#15343 + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#14930 + # source://prism//lib/prism/node.rb#15354 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14935 + # source://prism//lib/prism/node.rb#15359 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#15428 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15411 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#14945 + # source://prism//lib/prism/node.rb#15371 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#14940 + # source://prism//lib/prism/node.rb#15364 def compact_child_nodes; end - # def copy: (**params) -> RestParameterNode + # def copy: (**params) -> PreExecutionNode # - # source://prism//prism/node.rb#14950 + # source://prism//lib/prism/node.rb#15376 + sig { params(params: T.untyped).returns(Prism::PreExecutionNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#14935 + # source://prism//lib/prism/node.rb#15359 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//prism/node.rb#14963 + # source://prism//lib/prism/node.rb#15391 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#14973 + # source://prism//lib/prism/node.rb#15433 def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol? + # def keyword: () -> String # - # source://prism//prism/node.rb#14913 - def name; end + # source://prism//lib/prism/node.rb#15418 + sig { returns(String) } + def keyword; end - # attr_reader name_loc: Location? + # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#14916 - def name_loc; end + # source://prism//lib/prism/node.rb#15399 + sig { returns(Prism::Location) } + def keyword_loc; end - # def operator: () -> String + # def opening: () -> String # - # source://prism//prism/node.rb#14968 - def operator; end + # source://prism//lib/prism/node.rb#15423 + sig { returns(String) } + def opening; end - # attr_reader operator_loc: Location + # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#14919 - def operator_loc; end + # source://prism//lib/prism/node.rb#15405 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#15396 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -20522,7 +22903,7 @@ class Prism::RestParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#14999 + # source://prism//lib/prism/node.rb#15461 def type; end class << self @@ -20533,64 +22914,84 @@ class Prism::RestParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#15009 + # source://prism//lib/prism/node.rb#15471 def type; end end end -# Represents the use of the `retry` keyword. +# The top level node of any parse tree. # -# retry -# ^^^^^ -class Prism::RetryNode < ::Prism::Node - # def initialize: (location: Location) -> void +# source://prism//lib/prism/node.rb#15477 +class Prism::ProgramNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void # - # @return [RetryNode] a new instance of RetryNode + # @return [ProgramNode] a new instance of ProgramNode # - # source://prism//prism/node.rb#15020 - def initialize(location); end + # source://prism//lib/prism/node.rb#15479 + def initialize(source, locals, statements, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#15025 + # source://prism//lib/prism/node.rb#15488 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#15030 + # source://prism//lib/prism/node.rb#15493 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#15040 + # source://prism//lib/prism/node.rb#15503 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#15035 + # source://prism//lib/prism/node.rb#15498 def compact_child_nodes; end - # def copy: (**params) -> RetryNode + # def copy: (**params) -> ProgramNode # - # source://prism//prism/node.rb#15045 + # source://prism//lib/prism/node.rb#15508 + sig { params(params: T.untyped).returns(Prism::ProgramNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#15030 + # source://prism//lib/prism/node.rb#15493 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location } # - # source://prism//prism/node.rb#15055 + # source://prism//lib/prism/node.rb#15521 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#15060 + # source://prism//lib/prism/node.rb#15533 def inspect(inspector = T.unsafe(nil)); end + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#15526 + sig { returns(T::Array[Symbol]) } + def locals; end + + # attr_reader statements: StatementsNode + # + # source://prism//lib/prism/node.rb#15529 + sig { returns(Prism::StatementsNode) } + def statements; end + # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by # calling `[cls1, cls2].include?(node.class)` or putting the node into a @@ -20606,7 +23007,7 @@ class Prism::RetryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#15079 + # source://prism//lib/prism/node.rb#15555 def type; end class << self @@ -20617,78 +23018,132 @@ class Prism::RetryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#15089 + # source://prism//lib/prism/node.rb#15565 def type; end end end -# Represents the use of the `return` keyword. +# Flags for range and flip-flop nodes. # -# return 1 -# ^^^^^^^^ -class Prism::ReturnNode < ::Prism::Node - # def initialize: (keyword_loc: Location, arguments: ArgumentsNode?, location: Location) -> void +# source://prism//lib/prism/node.rb#19310 +module Prism::RangeFlags; end + +# ... operator +# +# source://prism//lib/prism/node.rb#19312 +Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) + +# Represents the use of the `..` or `...` operators. +# +# 1..2 +# ^^^^ +# +# c if a =~ /left/ ... b =~ /right/ +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#15577 +class Prism::RangeNode < ::Prism::Node + # def initialize: (Integer flags, Node? left, Node? right, Location operator_loc, Location location) -> void # - # @return [ReturnNode] a new instance of ReturnNode + # @return [RangeNode] a new instance of RangeNode # - # source://prism//prism/node.rb#15106 - def initialize(keyword_loc, arguments, location); end + # source://prism//lib/prism/node.rb#15579 + def initialize(source, flags, left, right, operator_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#15113 + # source://prism//lib/prism/node.rb#15590 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#15103 - def arguments; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#15118 + # source://prism//lib/prism/node.rb#15595 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#15130 + # source://prism//lib/prism/node.rb#15608 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#15123 + # source://prism//lib/prism/node.rb#15600 def compact_child_nodes; end - # def copy: (**params) -> ReturnNode + # def copy: (**params) -> RangeNode # - # source://prism//prism/node.rb#15135 + # source://prism//lib/prism/node.rb#15613 + sig { params(params: T.untyped).returns(Prism::RangeNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#15118 + # source://prism//lib/prism/node.rb#15595 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location } # - # source://prism//prism/node.rb#15147 + # source://prism//lib/prism/node.rb#15628 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def exclude_end?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15663 + sig { returns(T::Boolean) } + def exclude_end?; end + + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#15157 + # source://prism//lib/prism/node.rb#15673 def inspect(inspector = T.unsafe(nil)); end - # def keyword: () -> String + # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism//prism/node.rb#15152 - def keyword; end + # 1... + # ^ + # + # hello...goodbye + # ^^^^^ + # + # source://prism//lib/prism/node.rb#15643 + sig { returns(T.nilable(Prism::Node)) } + def left; end - # attr_reader keyword_loc: Location + # def operator: () -> String # - # source://prism//prism/node.rb#15100 - def keyword_loc; end + # source://prism//lib/prism/node.rb#15668 + sig { returns(String) } + def operator; end + + # The location of the `..` or `...` operator. + # + # source://prism//lib/prism/node.rb#15656 + sig { returns(Prism::Location) } + def operator_loc; end + + # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # ..5 + # ^ + # + # 1...foo + # ^^^ + # If neither right-hand or left-hand side was included, this will be a MissingNode. + # + # source://prism//lib/prism/node.rb#15653 + sig { returns(T.nilable(Prism::Node)) } + def right; end # Sometimes you want to check an instance of a node against a list of # classes to see what kind of behavior to perform. Usually this is done by @@ -20705,9 +23160,17 @@ class Prism::ReturnNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#15183 + # source://prism//lib/prism/node.rb#15707 def type; end + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15633 + sig { returns(Integer) } + def flags; end + class << self # Similar to #type, this method returns a symbol that you can use for # splitting on the type of the node without having to do a long === chain. @@ -20716,2826 +23179,5925 @@ class Prism::ReturnNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#15193 + # source://prism//lib/prism/node.rb#15717 def type; end end end -# Note: This integration is not finished, and therefore still has many -# inconsistencies with Ripper. If you'd like to help out, pull requests would -# be greatly appreciated! -# -# This class is meant to provide a compatibility layer between prism and -# Ripper. It functions by parsing the entire tree first and then walking it -# and executing each of the Ripper callbacks as it goes. +# Represents a rational number literal. # -# This class is going to necessarily be slower than the native Ripper API. It -# is meant as a stopgap until developers migrate to using prism. It is also -# meant as a test harness for the prism parser. +# 1.0r +# ^^^^ # -# To use this class, you treat `Prism::RipperCompat` effectively as you would -# treat the `Ripper` class. -class Prism::RipperCompat < ::Prism::Visitor - # Create a new RipperCompat object with the given source. +# source://prism//lib/prism/node.rb#15726 +class Prism::RationalNode < ::Prism::Node + # def initialize: (Node numeric, Location location) -> void # - # @return [RipperCompat] a new instance of RipperCompat + # @return [RationalNode] a new instance of RationalNode # - # source://prism//prism/ripper_compat.rb#74 - def initialize(source); end + # source://prism//lib/prism/node.rb#15728 + def initialize(source, numeric, location); end - # The current column number of the parser. + # def accept: (Visitor visitor) -> void # - # source://prism//prism/ripper_compat.rb#71 - def column; end + # source://prism//lib/prism/node.rb#15736 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # True if the parser encountered an error during parsing. - # - # @return [Boolean] + # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/ripper_compat.rb#86 - def error?; end + # source://prism//lib/prism/node.rb#15741 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The current line number of the parser. + # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/ripper_compat.rb#68 - def lineno; end + # source://prism//lib/prism/node.rb#15751 + def comment_targets; end - # Parse the source and return the result. + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/ripper_compat.rb#91 - def parse; end + # source://prism//lib/prism/node.rb#15746 + def compact_child_nodes; end - # The source that is being parsed. + # def copy: (**params) -> RationalNode # - # source://prism//prism/ripper_compat.rb#65 - def source; end + # source://prism//lib/prism/node.rb#15756 + sig { params(params: T.untyped).returns(Prism::RationalNode) } + def copy(**params); end - # Visit a CallNode node. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/ripper_compat.rb#110 - def visit_call_node(node); end + # source://prism//lib/prism/node.rb#15741 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Visit a FloatNode node. + # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Node, location: Location } # - # source://prism//prism/ripper_compat.rb#123 - def visit_float_node(node); end + # source://prism//lib/prism/node.rb#15768 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # Visit a ImaginaryNode node. + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/ripper_compat.rb#129 - def visit_imaginary_node(node); end + # source://prism//lib/prism/node.rb#15777 + def inspect(inspector = T.unsafe(nil)); end - # Visit an IntegerNode node. + # attr_reader numeric: Node # - # source://prism//prism/ripper_compat.rb#135 - def visit_integer_node(node); end + # source://prism//lib/prism/node.rb#15773 + sig { returns(Prism::Node) } + def numeric; end - # Visit a ProgramNode node. + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. # - # source://prism//prism/ripper_compat.rb#155 - def visit_program_node(node); end - - # Visit a RationalNode node. + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. # - # source://prism//prism/ripper_compat.rb#141 - def visit_rational_node(node); end - - # Visit a StatementsNode node. + # def type: () -> Symbol # - # source://prism//prism/ripper_compat.rb#147 - def visit_statements_node(node); end - - private - - # source://prism//prism/ripper_compat.rb#192 - def _dispatch0; end - - # source://prism//prism/ripper_compat.rb#193 - def _dispatch1(_); end + # source://prism//lib/prism/node.rb#15798 + def type; end - # source://prism//prism/ripper_compat.rb#194 - def _dispatch2(_, _); end + # Returns the value of the node as a Ruby Rational. + # + # source://prism//lib/prism/node_ext.rb#83 + def value; end - # source://prism//prism/ripper_compat.rb#195 - def _dispatch3(_, _, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15808 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#196 - def _dispatch4(_, _, _, _); end +# Represents the use of the `redo` keyword. +# +# redo +# ^^^^ +# +# source://prism//lib/prism/node.rb#15817 +class Prism::RedoNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [RedoNode] a new instance of RedoNode + # + # source://prism//lib/prism/node.rb#15819 + def initialize(source, location); end - # source://prism//prism/ripper_compat.rb#197 - def _dispatch5(_, _, _, _, _); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15826 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#198 - def _dispatch7(_, _, _, _, _, _, _); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15831 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # This method is responsible for updating lineno and column information - # to reflect the current node. + # def comment_targets: () -> Array[Node | Location] # - # This method could be drastically improved with some caching on the start - # of every line, but for now it's good enough. + # source://prism//lib/prism/node.rb#15841 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/ripper_compat.rb#182 - def bounds(location); end + # source://prism//lib/prism/node.rb#15836 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_BEGIN(_); end + # def copy: (**params) -> RedoNode + # + # source://prism//lib/prism/node.rb#15846 + sig { params(params: T.untyped).returns(Prism::RedoNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#193 - def on_CHAR(_); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15831 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_END(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#15857 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#193 - def on___end__(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#15863 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#194 - def on_alias(_, _); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15882 + def type; end - # source://prism//prism/ripper_compat.rb#194 - def on_alias_error(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#15892 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#194 - def on_aref(_, _); end +# Flags for regular expression and match last line nodes. +# +# source://prism//lib/prism/node.rb#19316 +module Prism::RegularExpressionFlags; end - # source://prism//prism/ripper_compat.rb#194 - def on_aref_field(_, _); end +# n - forces the ASCII-8BIT encoding +# +# source://prism//lib/prism/node.rb#19333 +Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#193 - def on_arg_ambiguous(_); end +# e - forces the EUC-JP encoding +# +# source://prism//lib/prism/node.rb#19330 +Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#193 - def on_arg_paren(_); end +# x - ignores whitespace and allows comments in regular expressions +# +# source://prism//lib/prism/node.rb#19321 +Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#194 - def on_args_add(_, _); end +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19345 +Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#194 - def on_args_add_block(_, _); end +# internal bytes forced the encoding to US-ASCII +# +# source://prism//lib/prism/node.rb#19348 +Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#194 - def on_args_add_star(_, _); end +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19342 +Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#192 - def on_args_forward; end +# i - ignores the case of characters when matching +# +# source://prism//lib/prism/node.rb#19318 +Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#192 - def on_args_new; end +# m - allows $ to match the end of lines within strings +# +# source://prism//lib/prism/node.rb#19324 +Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#193 - def on_array(_); end +# o - only interpolates values into the regular expression once +# +# source://prism//lib/prism/node.rb#19327 +Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#196 - def on_aryptn(_, _, _, _); end +# u - forces the UTF-8 encoding +# +# source://prism//lib/prism/node.rb#19339 +Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#194 - def on_assign(_, _); end +# s - forces the Windows-31J encoding +# +# source://prism//lib/prism/node.rb#19336 +Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#194 - def on_assign_error(_, _); end +# Represents a regular expression literal with no interpolation. +# +# /foo/i +# ^^^^^^ +# +# source://prism//lib/prism/node.rb#15901 +class Prism::RegularExpressionNode < ::Prism::Node + include ::Prism::RegularExpressionOptions - # source://prism//prism/ripper_compat.rb#194 - def on_assoc_new(_, _); end + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void + # + # @return [RegularExpressionNode] a new instance of RegularExpressionNode + # + # source://prism//lib/prism/node.rb#15903 + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_assoc_splat(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#15915 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_assoclist_from_args(_); end + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16007 + sig { returns(T::Boolean) } + def ascii_8bit?; end - # source://prism//prism/ripper_compat.rb#193 - def on_backref(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15920 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_backtick(_); end + # def closing: () -> String + # + # source://prism//lib/prism/node.rb#16047 + sig { returns(String) } + def closing; end - # source://prism//prism/ripper_compat.rb#193 - def on_bare_assoc_hash(_); end + # attr_reader closing_loc: Location + # + # source://prism//lib/prism/node.rb#15972 + sig { returns(Prism::Location) } + def closing_loc; end - # source://prism//prism/ripper_compat.rb#193 - def on_begin(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#15930 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#195 - def on_binary(_, _, _); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#15925 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_block_var(_, _); end + # def content: () -> String + # + # source://prism//lib/prism/node.rb#16042 + sig { returns(String) } + def content; end - # source://prism//prism/ripper_compat.rb#193 - def on_blockarg(_); end + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#15966 + sig { returns(Prism::Location) } + def content_loc; end - # source://prism//prism/ripper_compat.rb#196 - def on_bodystmt(_, _, _, _); end + # def copy: (**params) -> RegularExpressionNode + # + # source://prism//lib/prism/node.rb#15935 + sig { params(params: T.untyped).returns(Prism::RegularExpressionNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#194 - def on_brace_block(_, _); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#15920 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_break(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#15951 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#195 - def on_call(_, _, _); end + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16002 + sig { returns(T::Boolean) } + def euc_jp?; end - # source://prism//prism/ripper_compat.rb#194 - def on_case(_, _); end + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15987 + sig { returns(T::Boolean) } + def extended?; end - # source://prism//prism/ripper_compat.rb#195 - def on_class(_, _, _); end + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16027 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # source://prism//prism/ripper_compat.rb#194 - def on_class_name_error(_, _); end + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16032 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end - # source://prism//prism/ripper_compat.rb#193 - def on_comma(_); end + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16022 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # source://prism//prism/ripper_compat.rb#194 - def on_command(_, _); end + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15982 + sig { returns(T::Boolean) } + def ignore_case?; end - # source://prism//prism/ripper_compat.rb#196 - def on_command_call(_, _, _, _); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16052 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#193 - def on_comment(_); end + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15992 + sig { returns(T::Boolean) } + def multi_line?; end - # source://prism//prism/ripper_compat.rb#193 - def on_const(_); end + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#15997 + sig { returns(T::Boolean) } + def once?; end - # source://prism//prism/ripper_compat.rb#194 - def on_const_path_field(_, _); end + # def opening: () -> String + # + # source://prism//lib/prism/node.rb#16037 + sig { returns(String) } + def opening; end - # source://prism//prism/ripper_compat.rb#194 - def on_const_path_ref(_, _); end + # attr_reader opening_loc: Location + # + # source://prism//lib/prism/node.rb#15960 + sig { returns(Prism::Location) } + def opening_loc; end - # source://prism//prism/ripper_compat.rb#193 - def on_const_ref(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16077 + def type; end - # source://prism//prism/ripper_compat.rb#193 - def on_cvar(_); end + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#15978 + sig { returns(String) } + def unescaped; end - # source://prism//prism/ripper_compat.rb#195 - def on_def(_, _, _); end + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16017 + sig { returns(T::Boolean) } + def utf_8?; end - # source://prism//prism/ripper_compat.rb#193 - def on_defined(_); end + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16012 + sig { returns(T::Boolean) } + def windows_31j?; end - # source://prism//prism/ripper_compat.rb#197 - def on_defs(_, _, _, _, _); end + private - # source://prism//prism/ripper_compat.rb#194 - def on_do_block(_, _); end + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#15956 + sig { returns(Integer) } + def flags; end - # source://prism//prism/ripper_compat.rb#194 - def on_dot2(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16087 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#194 - def on_dot3(_, _); end +# source://prism//lib/prism/node_ext.rb#6 +module Prism::RegularExpressionOptions + # Returns a numeric value that represents the flags that were used to create + # the regular expression. + # + # source://prism//lib/prism/node_ext.rb#9 + def options; end +end - # source://prism//prism/ripper_compat.rb#193 - def on_dyna_symbol(_); end - - # source://prism//prism/ripper_compat.rb#193 - def on_else(_); end - - # source://prism//prism/ripper_compat.rb#195 - def on_elsif(_, _, _); end - - # source://prism//prism/ripper_compat.rb#193 - def on_embdoc(_); end - - # source://prism//prism/ripper_compat.rb#193 - def on_embdoc_beg(_); end +# Represents a required keyword parameter to a method, block, or lambda definition. +# +# def a(b: ) +# ^^ +# end +# +# source://prism//lib/prism/node.rb#16097 +class Prism::RequiredKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void + # + # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode + # + # source://prism//lib/prism/node.rb#16099 + def initialize(source, flags, name, name_loc, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_embdoc_end(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16109 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_embexpr_beg(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16114 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_embexpr_end(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16124 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#193 - def on_embvar(_); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16119 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_ensure(_); end + # def copy: (**params) -> RequiredKeywordParameterNode + # + # source://prism//lib/prism/node.rb#16129 + sig { params(params: T.untyped).returns(Prism::RequiredKeywordParameterNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#192 - def on_excessed_comma; end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16114 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_fcall(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#16143 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#195 - def on_field(_, _, _); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16167 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#193 - def on_float(_); end + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#16152 + sig { returns(Symbol) } + def name; end - # source://prism//prism/ripper_compat.rb#196 - def on_fndptn(_, _, _, _); end + # attr_reader name_loc: Location + # + # source://prism//lib/prism/node.rb#16155 + sig { returns(Prism::Location) } + def name_loc; end - # source://prism//prism/ripper_compat.rb#195 - def on_for(_, _, _); end + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16162 + sig { returns(T::Boolean) } + def repeated_parameter?; end - # source://prism//prism/ripper_compat.rb#193 - def on_gvar(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16190 + def type; end - # source://prism//prism/ripper_compat.rb#193 - def on_hash(_); end + private - # source://prism//prism/ripper_compat.rb#193 - def on_heredoc_beg(_); end + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16148 + sig { returns(Integer) } + def flags; end - # source://prism//prism/ripper_compat.rb#194 - def on_heredoc_dedent(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16200 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#193 - def on_heredoc_end(_); end +# Represents a required parameter to a method, block, or lambda definition. +# +# def a(b) +# ^ +# end +# +# source://prism//lib/prism/node.rb#16210 +class Prism::RequiredParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location location) -> void + # + # @return [RequiredParameterNode] a new instance of RequiredParameterNode + # + # source://prism//lib/prism/node.rb#16212 + def initialize(source, flags, name, location); end - # source://prism//prism/ripper_compat.rb#195 - def on_hshptn(_, _, _); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16221 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_ident(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16226 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#195 - def on_if(_, _, _); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16236 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#194 - def on_if_mod(_, _); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16231 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#195 - def on_ifop(_, _, _); end + # def copy: (**params) -> RequiredParameterNode + # + # source://prism//lib/prism/node.rb#16241 + sig { params(params: T.untyped).returns(Prism::RequiredParameterNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#193 - def on_ignored_nl(_); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16226 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_ignored_sp(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } + # + # source://prism//lib/prism/node.rb#16254 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#193 - def on_imaginary(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16272 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#195 - def on_in(_, _, _); end + # attr_reader name: Symbol + # + # source://prism//lib/prism/node.rb#16263 + sig { returns(Symbol) } + def name; end - # source://prism//prism/ripper_compat.rb#193 - def on_int(_); end + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16267 + sig { returns(T::Boolean) } + def repeated_parameter?; end - # source://prism//prism/ripper_compat.rb#193 - def on_ivar(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16294 + def type; end - # source://prism//prism/ripper_compat.rb#193 - def on_kw(_); end + private - # source://prism//prism/ripper_compat.rb#193 - def on_kwrest_param(_); end + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16259 + sig { returns(Integer) } + def flags; end - # source://prism//prism/ripper_compat.rb#193 - def on_label(_); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16304 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#193 - def on_label_end(_); end +# Represents an expression modified with a rescue. +# +# foo rescue nil +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16313 +class Prism::RescueModifierNode < ::Prism::Node + # def initialize: (Node expression, Location keyword_loc, Node rescue_expression, Location location) -> void + # + # @return [RescueModifierNode] a new instance of RescueModifierNode + # + # source://prism//lib/prism/node.rb#16315 + def initialize(source, expression, keyword_loc, rescue_expression, location); end - # source://prism//prism/ripper_compat.rb#194 - def on_lambda(_, _); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16325 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_lbrace(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16334 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_lbracket(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16344 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#193 - def on_lparen(_); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16339 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_magic_comment(_, _); end + # def copy: (**params) -> RescueModifierNode + # + # source://prism//lib/prism/node.rb#16349 + sig { params(params: T.untyped).returns(Prism::RescueModifierNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#194 - def on_massign(_, _); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16334 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#194 - def on_method_add_arg(_, _); end + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node, keyword_loc: Location, rescue_expression: Node, location: Location } + # + # source://prism//lib/prism/node.rb#16363 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#194 - def on_method_add_block(_, _); end + # attr_reader expression: Node + # + # source://prism//lib/prism/node.rb#16368 + sig { returns(Prism::Node) } + def expression; end - # source://prism//prism/ripper_compat.rb#194 - def on_mlhs_add(_, _); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16386 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#194 - def on_mlhs_add_post(_, _); end + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16381 + sig { returns(String) } + def keyword; end - # source://prism//prism/ripper_compat.rb#194 - def on_mlhs_add_star(_, _); end + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16371 + sig { returns(Prism::Location) } + def keyword_loc; end - # source://prism//prism/ripper_compat.rb#192 - def on_mlhs_new; end + # attr_reader rescue_expression: Node + # + # source://prism//lib/prism/node.rb#16377 + sig { returns(Prism::Node) } + def rescue_expression; end - # source://prism//prism/ripper_compat.rb#193 - def on_mlhs_paren(_); end + # source://prism//lib/prism/node.rb#16329 + def set_newline_flag(newline_marked); end - # source://prism//prism/ripper_compat.rb#194 - def on_module(_, _); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16410 + def type; end - # source://prism//prism/ripper_compat.rb#194 - def on_mrhs_add(_, _); end - - # source://prism//prism/ripper_compat.rb#194 - def on_mrhs_add_star(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16420 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#192 - def on_mrhs_new; end +# Represents a rescue statement. +# +# begin +# rescue Foo, *splat, Bar => ex +# foo +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# end +# +# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. +# +# source://prism//lib/prism/node.rb#16434 +class Prism::RescueNode < ::Prism::Node + # def initialize: (Location keyword_loc, Array[Node] exceptions, Location? operator_loc, Node? reference, StatementsNode? statements, RescueNode? consequent, Location location) -> void + # + # @return [RescueNode] a new instance of RescueNode + # + # source://prism//lib/prism/node.rb#16436 + def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_mrhs_new_from_args(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16449 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_next(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16454 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_nl(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16469 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#193 - def on_nokw_param(_); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16459 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_op(_); end + # attr_reader consequent: RescueNode? + # + # source://prism//lib/prism/node.rb#16523 + sig { returns(T.nilable(Prism::RescueNode)) } + def consequent; end - # source://prism//prism/ripper_compat.rb#195 - def on_opassign(_, _, _); end + # def copy: (**params) -> RescueNode + # + # source://prism//lib/prism/node.rb#16474 + sig { params(params: T.untyped).returns(Prism::RescueNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#194 - def on_operator_ambiguous(_, _); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16454 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#194 - def on_param_error(_, _); end + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, exceptions: Array[Node], operator_loc: Location?, reference: Node?, statements: StatementsNode?, consequent: RescueNode?, location: Location } + # + # source://prism//lib/prism/node.rb#16491 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#198 - def on_params(_, _, _, _, _, _, _); end + # attr_reader exceptions: Array[Node] + # + # source://prism//lib/prism/node.rb#16502 + sig { returns(T::Array[Prism::Node]) } + def exceptions; end - # source://prism//prism/ripper_compat.rb#193 - def on_paren(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16537 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#193 - def on_parse_error(_); end + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16527 + sig { returns(String) } + def keyword; end - # source://prism//prism/ripper_compat.rb#193 - def on_period(_); end + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16496 + sig { returns(Prism::Location) } + def keyword_loc; end - # source://prism//prism/ripper_compat.rb#193 - def on_program(_); end + # def operator: () -> String? + # + # source://prism//lib/prism/node.rb#16532 + sig { returns(T.nilable(String)) } + def operator; end - # source://prism//prism/ripper_compat.rb#194 - def on_qsymbols_add(_, _); end + # attr_reader operator_loc: Location? + # + # source://prism//lib/prism/node.rb#16505 + sig { returns(T.nilable(Prism::Location)) } + def operator_loc; end - # source://prism//prism/ripper_compat.rb#193 - def on_qsymbols_beg(_); end + # attr_reader reference: Node? + # + # source://prism//lib/prism/node.rb#16517 + sig { returns(T.nilable(Prism::Node)) } + def reference; end - # source://prism//prism/ripper_compat.rb#192 - def on_qsymbols_new; end + # attr_reader statements: StatementsNode? + # + # source://prism//lib/prism/node.rb#16520 + sig { returns(T.nilable(Prism::StatementsNode)) } + def statements; end - # source://prism//prism/ripper_compat.rb#194 - def on_qwords_add(_, _); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16577 + def type; end - # source://prism//prism/ripper_compat.rb#193 - def on_qwords_beg(_); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16587 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#192 - def on_qwords_new; end +# Represents a rest parameter to a method, block, or lambda definition. +# +# def a(*b) +# ^^ +# end +# +# source://prism//lib/prism/node.rb#16597 +class Prism::RestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void + # + # @return [RestParameterNode] a new instance of RestParameterNode + # + # source://prism//lib/prism/node.rb#16599 + def initialize(source, flags, name, name_loc, operator_loc, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_rational(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16610 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_rbrace(_); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16615 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_rbracket(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16625 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#192 - def on_redo; end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16620 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_regexp_add(_, _); end + # def copy: (**params) -> RestParameterNode + # + # source://prism//lib/prism/node.rb#16630 + sig { params(params: T.untyped).returns(Prism::RestParameterNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#193 - def on_regexp_beg(_); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16615 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_regexp_end(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#16645 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#194 - def on_regexp_literal(_, _); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16686 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#192 - def on_regexp_new; end + # attr_reader name: Symbol? + # + # source://prism//lib/prism/node.rb#16654 + sig { returns(T.nilable(Symbol)) } + def name; end - # source://prism//prism/ripper_compat.rb#196 - def on_rescue(_, _, _, _); end + # attr_reader name_loc: Location? + # + # source://prism//lib/prism/node.rb#16657 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end - # source://prism//prism/ripper_compat.rb#194 - def on_rescue_mod(_, _); end + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#16681 + sig { returns(String) } + def operator; end - # source://prism//prism/ripper_compat.rb#193 - def on_rest_param(_); end + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#16669 + sig { returns(Prism::Location) } + def operator_loc; end - # source://prism//prism/ripper_compat.rb#192 - def on_retry; end + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#16676 + sig { returns(T::Boolean) } + def repeated_parameter?; end - # source://prism//prism/ripper_compat.rb#193 - def on_return(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16714 + def type; end - # source://prism//prism/ripper_compat.rb#192 - def on_return0; end + private - # source://prism//prism/ripper_compat.rb#193 - def on_rparen(_); end + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#16650 + sig { returns(Integer) } + def flags; end - # source://prism//prism/ripper_compat.rb#194 - def on_sclass(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16724 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#193 - def on_semicolon(_); end +# Represents the use of the `retry` keyword. +# +# retry +# ^^^^^ +# +# source://prism//lib/prism/node.rb#16733 +class Prism::RetryNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [RetryNode] a new instance of RetryNode + # + # source://prism//lib/prism/node.rb#16735 + def initialize(source, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_sp(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16742 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#194 - def on_stmts_add(_, _); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16747 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#192 - def on_stmts_new; end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16757 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#194 - def on_string_add(_, _); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16752 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_string_concat(_, _); end + # def copy: (**params) -> RetryNode + # + # source://prism//lib/prism/node.rb#16762 + sig { params(params: T.untyped).returns(Prism::RetryNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#192 - def on_string_content; end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16747 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_string_dvar(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#16773 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#193 - def on_string_embexpr(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16779 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#193 - def on_string_literal(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16798 + def type; end - # source://prism//prism/ripper_compat.rb#193 - def on_super(_); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16808 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#193 - def on_symbeg(_); end +# Represents the use of the `return` keyword. +# +# return 1 +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#16817 +class Prism::ReturnNode < ::Prism::Node + # def initialize: (Location keyword_loc, ArgumentsNode? arguments, Location location) -> void + # + # @return [ReturnNode] a new instance of ReturnNode + # + # source://prism//lib/prism/node.rb#16819 + def initialize(source, keyword_loc, arguments, location); end - # source://prism//prism/ripper_compat.rb#193 - def on_symbol(_); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16828 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#193 - def on_symbol_literal(_); end + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#16874 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end - # source://prism//prism/ripper_compat.rb#194 - def on_symbols_add(_, _); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16833 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_symbols_beg(_); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16845 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#192 - def on_symbols_new; end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16838 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#193 - def on_tlambda(_); end + # def copy: (**params) -> ReturnNode + # + # source://prism//lib/prism/node.rb#16850 + sig { params(params: T.untyped).returns(Prism::ReturnNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#193 - def on_tlambeg(_); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16833 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_top_const_field(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, arguments: ArgumentsNode?, location: Location } + # + # source://prism//lib/prism/node.rb#16863 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#193 - def on_top_const_ref(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16883 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#193 - def on_tstring_beg(_); end + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#16878 + sig { returns(String) } + def keyword; end - # source://prism//prism/ripper_compat.rb#193 - def on_tstring_content(_); end + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#16868 + sig { returns(Prism::Location) } + def keyword_loc; end - # source://prism//prism/ripper_compat.rb#193 - def on_tstring_end(_); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16909 + def type; end - # source://prism//prism/ripper_compat.rb#194 - def on_unary(_, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16919 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#193 - def on_undef(_); end +# Represents the `self` keyword. +# +# self +# ^^^^ +# +# source://prism//lib/prism/node.rb#16928 +class Prism::SelfNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SelfNode] a new instance of SelfNode + # + # source://prism//lib/prism/node.rb#16930 + def initialize(source, location); end - # source://prism//prism/ripper_compat.rb#195 - def on_unless(_, _, _); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#16937 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#194 - def on_unless_mod(_, _); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16942 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_until(_, _); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#16952 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#194 - def on_until_mod(_, _); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#16947 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#194 - def on_var_alias(_, _); end + # def copy: (**params) -> SelfNode + # + # source://prism//lib/prism/node.rb#16957 + sig { params(params: T.untyped).returns(Prism::SelfNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#193 - def on_var_field(_); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#16942 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#193 - def on_var_ref(_); end + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#16968 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#193 - def on_vcall(_); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#16974 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#192 - def on_void_stmt; end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#16993 + def type; end - # source://prism//prism/ripper_compat.rb#195 - def on_when(_, _, _); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17003 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#194 - def on_while(_, _); end +# A module responsible for deserializing parse results. +# +# source://prism//lib/prism/serialize.rb#23 +module Prism::Serialize + class << self + # Deserialize the AST represented by the given string into a parse result. + # + # source://prism//lib/prism/serialize.rb#37 + def load(input, serialized); end - # source://prism//prism/ripper_compat.rb#194 - def on_while_mod(_, _); end + # Deserialize the tokens represented by the given string into a parse + # result. + # + # source://prism//lib/prism/serialize.rb#49 + def load_tokens(source, serialized); end + end +end - # source://prism//prism/ripper_compat.rb#194 - def on_word_add(_, _); end +# source://prism//lib/prism/serialize.rb#53 +class Prism::Serialize::Loader + # @return [Loader] a new instance of Loader + # + # source://prism//lib/prism/serialize.rb#58 + def initialize(source, serialized); end - # source://prism//prism/ripper_compat.rb#192 - def on_word_new; end + # Returns the value of attribute constant_pool. + # + # source://prism//lib/prism/serialize.rb#55 + def constant_pool; end - # source://prism//prism/ripper_compat.rb#194 - def on_words_add(_, _); end + # Returns the value of attribute constant_pool_offset. + # + # source://prism//lib/prism/serialize.rb#55 + def constant_pool_offset; end - # source://prism//prism/ripper_compat.rb#193 - def on_words_beg(_); end + # Returns the value of attribute encoding. + # + # source://prism//lib/prism/serialize.rb#54 + def encoding; end - # source://prism//prism/ripper_compat.rb#192 - def on_words_new; end + # Returns the value of attribute input. + # + # source://prism//lib/prism/serialize.rb#54 + def input; end - # source://prism//prism/ripper_compat.rb#193 - def on_words_sep(_); end + # Returns the value of attribute io. + # + # source://prism//lib/prism/serialize.rb#54 + def io; end - # source://prism//prism/ripper_compat.rb#194 - def on_xstring_add(_, _); end + # source://prism//lib/prism/serialize.rb#96 + def load_comments; end - # source://prism//prism/ripper_compat.rb#193 - def on_xstring_literal(_); end + # source://prism//lib/prism/serialize.rb#82 + def load_encoding; end - # source://prism//prism/ripper_compat.rb#192 - def on_xstring_new; end + # source://prism//lib/prism/serialize.rb#73 + def load_header; end - # source://prism//prism/ripper_compat.rb#193 - def on_yield(_); end + # source://prism//lib/prism/serialize.rb#92 + def load_line_offsets; end - # source://prism//prism/ripper_compat.rb#192 - def on_yield0; end + # source://prism//lib/prism/serialize.rb#106 + def load_metadata; end - # source://prism//prism/ripper_compat.rb#192 - def on_zsuper; end + # source://prism//lib/prism/serialize.rb#140 + def load_nodes; end - # Lazily initialize the parse result. - # - # source://prism//prism/ripper_compat.rb#188 - def result; end + # source://prism//lib/prism/serialize.rb#154 + def load_result; end - class << self - # This is a convenience method that runs the SexpBuilderPP subclass parser. - # - # source://prism//prism/ripper_compat.rb#171 - def sexp(source); end + # source://prism//lib/prism/serialize.rb#88 + def load_start_line; end - # This is a convenience method that runs the SexpBuilder subclass parser. - # - # source://prism//prism/ripper_compat.rb#166 - def sexp_raw(source); end - end -end + # source://prism//lib/prism/serialize.rb#115 + def load_tokens; end -# This class mirrors the ::Ripper::SexpBuilder subclass of ::Ripper that -# returns the arrays of [type, *children]. -class Prism::RipperCompat::SexpBuilder < ::Prism::RipperCompat - private + # source://prism//lib/prism/serialize.rb#128 + def load_tokens_result; end - # source://prism//prism/ripper_compat.rb#27 - def on_BEGIN(*args); end + # Returns the value of attribute serialized. + # + # source://prism//lib/prism/serialize.rb#54 + def serialized; end - # source://prism//prism/ripper_compat.rb#33 - def on_CHAR(value); end + # Returns the value of attribute source. + # + # source://prism//lib/prism/serialize.rb#55 + def source; end - # source://prism//prism/ripper_compat.rb#27 - def on_END(*args); end + # Returns the value of attribute start_line. + # + # source://prism//lib/prism/serialize.rb#56 + def start_line; end - # source://prism//prism/ripper_compat.rb#33 - def on___end__(value); end + private - # source://prism//prism/ripper_compat.rb#27 - def on_alias(*args); end + # source://prism//lib/prism/serialize.rb#217 + def load_constant(index); end - # source://prism//prism/ripper_compat.rb#27 - def on_alias_error(*args); end + # source://prism//lib/prism/serialize.rb#193 + def load_embedded_string; end - # source://prism//prism/ripper_compat.rb#27 - def on_aref(*args); end + # source://prism//lib/prism/serialize.rb#247 + def load_error_level; end - # source://prism//prism/ripper_compat.rb#27 - def on_aref_field(*args); end + # source://prism//lib/prism/serialize.rb#209 + def load_location; end - # source://prism//prism/ripper_compat.rb#27 - def on_arg_ambiguous(*args); end + # source://prism//lib/prism/serialize.rb#274 + def load_node; end - # source://prism//prism/ripper_compat.rb#27 - def on_arg_paren(*args); end + # source://prism//lib/prism/serialize.rb#242 + def load_optional_constant; end - # source://prism//prism/ripper_compat.rb#27 - def on_args_add(*args); end + # source://prism//lib/prism/serialize.rb#213 + def load_optional_location; end - # source://prism//prism/ripper_compat.rb#27 - def on_args_add_block(*args); end + # source://prism//lib/prism/serialize.rb#186 + def load_optional_node; end - # source://prism//prism/ripper_compat.rb#27 - def on_args_add_star(*args); end + # source://prism//lib/prism/serialize.rb#238 + def load_required_constant; end - # source://prism//prism/ripper_compat.rb#27 - def on_args_forward(*args); end + # source://prism//lib/prism/serialize.rb#182 + def load_serialized_length; end - # source://prism//prism/ripper_compat.rb#27 - def on_args_new(*args); end + # source://prism//lib/prism/serialize.rb#197 + def load_string; end - # source://prism//prism/ripper_compat.rb#27 - def on_array(*args); end + # source://prism//lib/prism/serialize.rb#177 + def load_varsint; end - # source://prism//prism/ripper_compat.rb#27 - def on_aryptn(*args); end + # variable-length integer using https://en.wikipedia.org/wiki/LEB128 + # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints + # + # source://prism//lib/prism/serialize.rb#163 + def load_varuint; end - # source://prism//prism/ripper_compat.rb#27 - def on_assign(*args); end + # source://prism//lib/prism/serialize.rb#260 + def load_warning_level; end +end - # source://prism//prism/ripper_compat.rb#27 - def on_assign_error(*args); end +# The major version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism//lib/prism/serialize.rb#26 +Prism::Serialize::MAJOR_VERSION = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#27 - def on_assoc_new(*args); end +# The minor version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism//lib/prism/serialize.rb#30 +Prism::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#27 - def on_assoc_splat(*args); end +# The patch version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism//lib/prism/serialize.rb#34 +Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) - # source://prism//prism/ripper_compat.rb#27 - def on_assoclist_from_args(*args); end +# The token types that can be indexed by their enum values. +# +# source://prism//lib/prism/serialize.rb#1482 +Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) - # source://prism//prism/ripper_compat.rb#33 - def on_backref(value); end +# Represents a singleton class declaration involving the `class` keyword. +# +# class << self end +# ^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17012 +class Prism::SingletonClassNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Node expression, Node? body, Location end_keyword_loc, Location location) -> void + # + # @return [SingletonClassNode] a new instance of SingletonClassNode + # + # source://prism//lib/prism/node.rb#17014 + def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end - # source://prism//prism/ripper_compat.rb#33 - def on_backtick(value); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17027 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#27 - def on_bare_assoc_hash(*args); end + # attr_reader body: Node? + # + # source://prism//lib/prism/node.rb#17090 + sig { returns(T.nilable(Prism::Node)) } + def body; end - # source://prism//prism/ripper_compat.rb#27 - def on_begin(*args); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17032 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#27 - def on_binary(*args); end + # def class_keyword: () -> String + # + # source://prism//lib/prism/node.rb#17100 + sig { returns(String) } + def class_keyword; end - # source://prism//prism/ripper_compat.rb#27 - def on_block_var(*args); end + # attr_reader class_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#17075 + sig { returns(Prism::Location) } + def class_keyword_loc; end - # source://prism//prism/ripper_compat.rb#27 - def on_blockarg(*args); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17045 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#27 - def on_bodystmt(*args); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17037 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#27 - def on_brace_block(*args); end + # def copy: (**params) -> SingletonClassNode + # + # source://prism//lib/prism/node.rb#17050 + sig { params(params: T.untyped).returns(Prism::SingletonClassNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#27 - def on_break(*args); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17032 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism//prism/ripper_compat.rb#27 - def on_call(*args); end + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Node, body: Node?, end_keyword_loc: Location, location: Location } + # + # source://prism//lib/prism/node.rb#17067 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end - # source://prism//prism/ripper_compat.rb#27 - def on_case(*args); end + # def end_keyword: () -> String + # + # source://prism//lib/prism/node.rb#17110 + sig { returns(String) } + def end_keyword; end - # source://prism//prism/ripper_compat.rb#27 - def on_class(*args); end + # attr_reader end_keyword_loc: Location + # + # source://prism//lib/prism/node.rb#17093 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # source://prism//prism/ripper_compat.rb#27 - def on_class_name_error(*args); end + # attr_reader expression: Node + # + # source://prism//lib/prism/node.rb#17087 + sig { returns(Prism::Node) } + def expression; end - # source://prism//prism/ripper_compat.rb#33 - def on_comma(value); end + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17115 + def inspect(inspector = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#27 - def on_command(*args); end + # attr_reader locals: Array[Symbol] + # + # source://prism//lib/prism/node.rb#17072 + sig { returns(T::Array[Symbol]) } + def locals; end - # source://prism//prism/ripper_compat.rb#27 - def on_command_call(*args); end + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#17105 + sig { returns(String) } + def operator; end - # source://prism//prism/ripper_compat.rb#33 - def on_comment(value); end + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#17081 + sig { returns(Prism::Location) } + def operator_loc; end - # source://prism//prism/ripper_compat.rb#33 - def on_const(value); end + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17146 + def type; end - # source://prism//prism/ripper_compat.rb#27 - def on_const_path_field(*args); end + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17156 + def type; end + end +end - # source://prism//prism/ripper_compat.rb#27 - def on_const_path_ref(*args); end +# This represents a source of Ruby code that has been parsed. It is used in +# conjunction with locations to allow them to resolve line numbers and source +# ranges. +# +# source://prism//lib/prism/parse_result.rb#7 +class Prism::Source + # Create a new source object with the given source code. + # + # @return [Source] a new instance of Source + # + # source://prism//lib/prism/parse_result.rb#18 + def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end - # source://prism//prism/ripper_compat.rb#27 - def on_const_ref(*args); end + # Return the column number in characters for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#53 + def character_column(byte_offset); end - # source://prism//prism/ripper_compat.rb#33 - def on_cvar(value); end + # Return the character offset for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#48 + def character_offset(byte_offset); end - # source://prism//prism/ripper_compat.rb#27 - def on_def(*args); end + # Returns the column number in code units for the given encoding for the + # given byte offset. + # + # source://prism//lib/prism/parse_result.rb#70 + def code_units_column(byte_offset, encoding); end - # source://prism//prism/ripper_compat.rb#27 - def on_defined(*args); end + # Returns the offset from the start of the file for the given byte offset + # counting in code units for the given encoding. + # + # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the + # concept of code units that differs from the number of characters in other + # encodings, it is not captured here. + # + # source://prism//lib/prism/parse_result.rb#63 + def code_units_offset(byte_offset, encoding); end - # source://prism//prism/ripper_compat.rb#27 - def on_defs(*args); end + # Return the column number for the given byte offset. + # + # source://prism//lib/prism/parse_result.rb#43 + def column(byte_offset); end - # source://prism//prism/ripper_compat.rb#27 - def on_do_block(*args); end + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#32 + def line(byte_offset); end - # source://prism//prism/ripper_compat.rb#27 - def on_dot2(*args); end + sig { params(value: Integer).returns(Integer) } + def line_offset(value); end - # source://prism//prism/ripper_compat.rb#27 - def on_dot3(*args); end + # Return the byte offset of the start of the line corresponding to the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#38 + def line_start(byte_offset); end - # source://prism//prism/ripper_compat.rb#27 - def on_dyna_symbol(*args); end + # The list of newline byte offsets in the source code. + # + # source://prism//lib/prism/parse_result.rb#15 + sig { returns(T::Array[Integer]) } + def offsets; end - # source://prism//prism/ripper_compat.rb#27 - def on_else(*args); end + # Perform a byteslice on the source code using the given byte offset and + # byte length. + # + # source://prism//lib/prism/parse_result.rb#26 + def slice(byte_offset, length); end - # source://prism//prism/ripper_compat.rb#27 - def on_elsif(*args); end + # The source code that this source object represents. + # + # source://prism//lib/prism/parse_result.rb#9 + sig { returns(String) } + def source; end - # source://prism//prism/ripper_compat.rb#33 - def on_embdoc(value); end + # The line number where this source starts. + # + # source://prism//lib/prism/parse_result.rb#12 + def start_line; end - # source://prism//prism/ripper_compat.rb#33 - def on_embdoc_beg(value); end + private - # source://prism//prism/ripper_compat.rb#33 - def on_embdoc_end(value); end + # Binary search through the offsets to find the line number for the given + # byte offset. + # + # source://prism//lib/prism/parse_result.rb#78 + def find_line(byte_offset); end +end - # source://prism//prism/ripper_compat.rb#33 - def on_embexpr_beg(value); end +# Represents the use of the `__ENCODING__` keyword. +# +# __ENCODING__ +# ^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17165 +class Prism::SourceEncodingNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SourceEncodingNode] a new instance of SourceEncodingNode + # + # source://prism//lib/prism/node.rb#17167 + def initialize(source, location); end - # source://prism//prism/ripper_compat.rb#33 - def on_embexpr_end(value); end + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17174 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end - # source://prism//prism/ripper_compat.rb#33 - def on_embvar(value); end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17179 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism//prism/ripper_compat.rb#27 - def on_ensure(*args); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17189 + def comment_targets; end - # source://prism//prism/ripper_compat.rb#27 - def on_excessed_comma(*args); end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17184 + def compact_child_nodes; end - # source://prism//prism/ripper_compat.rb#27 - def on_fcall(*args); end + # def copy: (**params) -> SourceEncodingNode + # + # source://prism//lib/prism/node.rb#17194 + sig { params(params: T.untyped).returns(Prism::SourceEncodingNode) } + def copy(**params); end - # source://prism//prism/ripper_compat.rb#27 - def on_field(*args); end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17179 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#17205 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17211 + def inspect(inspector = T.unsafe(nil)); end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17230 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17240 + def type; end + end +end + +# Represents the use of the `__FILE__` keyword. +# +# __FILE__ +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17249 +class Prism::SourceFileNode < ::Prism::Node + # def initialize: (String filepath, Location location) -> void + # + # @return [SourceFileNode] a new instance of SourceFileNode + # + # source://prism//lib/prism/node.rb#17251 + def initialize(source, filepath, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17259 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17264 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17274 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17269 + def compact_child_nodes; end + + # def copy: (**params) -> SourceFileNode + # + # source://prism//lib/prism/node.rb#17279 + sig { params(params: T.untyped).returns(Prism::SourceFileNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17264 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { filepath: String, location: Location } + # + # source://prism//lib/prism/node.rb#17291 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # attr_reader filepath: String + # + # source://prism//lib/prism/node.rb#17296 + sig { returns(String) } + def filepath; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17300 + def inspect(inspector = T.unsafe(nil)); end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17320 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17330 + def type; end + end +end + +# Represents the use of the `__LINE__` keyword. +# +# __LINE__ +# ^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17339 +class Prism::SourceLineNode < ::Prism::Node + # def initialize: (Location location) -> void + # + # @return [SourceLineNode] a new instance of SourceLineNode + # + # source://prism//lib/prism/node.rb#17341 + def initialize(source, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17348 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17353 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17363 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17358 + def compact_child_nodes; end + + # def copy: (**params) -> SourceLineNode + # + # source://prism//lib/prism/node.rb#17368 + sig { params(params: T.untyped).returns(Prism::SourceLineNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17353 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism//lib/prism/node.rb#17379 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17385 + def inspect(inspector = T.unsafe(nil)); end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17404 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17414 + def type; end + end +end + +# Represents the use of the splat operator. +# +# [*a] +# ^^ +# +# source://prism//lib/prism/node.rb#17423 +class Prism::SplatNode < ::Prism::Node + # def initialize: (Location operator_loc, Node? expression, Location location) -> void + # + # @return [SplatNode] a new instance of SplatNode + # + # source://prism//lib/prism/node.rb#17425 + def initialize(source, operator_loc, expression, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17434 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17439 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17451 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17444 + def compact_child_nodes; end + + # def copy: (**params) -> SplatNode + # + # source://prism//lib/prism/node.rb#17456 + sig { params(params: T.untyped).returns(Prism::SplatNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17439 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Node?, location: Location } + # + # source://prism//lib/prism/node.rb#17469 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # attr_reader expression: Node? + # + # source://prism//lib/prism/node.rb#17480 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17489 + def inspect(inspector = T.unsafe(nil)); end + + # def operator: () -> String + # + # source://prism//lib/prism/node.rb#17484 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism//lib/prism/node.rb#17474 + sig { returns(Prism::Location) } + def operator_loc; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17515 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17525 + def type; end + end +end + +# Represents a set of statements contained within some scope. +# +# foo; bar; baz +# ^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17534 +class Prism::StatementsNode < ::Prism::Node + # def initialize: (Array[Node] body, Location location) -> void + # + # @return [StatementsNode] a new instance of StatementsNode + # + # source://prism//lib/prism/node.rb#17536 + def initialize(source, body, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17544 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # attr_reader body: Array[Node] + # + # source://prism//lib/prism/node.rb#17581 + sig { returns(T::Array[Prism::Node]) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17549 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17559 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17554 + def compact_child_nodes; end + + # def copy: (**params) -> StatementsNode + # + # source://prism//lib/prism/node.rb#17564 + sig { params(params: T.untyped).returns(Prism::StatementsNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17549 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Node], location: Location } + # + # source://prism//lib/prism/node.rb#17576 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17585 + def inspect(inspector = T.unsafe(nil)); end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17605 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17615 + def type; end + end +end + +# Flags for string nodes. +# +# source://prism//lib/prism/node.rb#19352 +module Prism::StringFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19357 +Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19354 +Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# frozen by virtue of a `frozen_string_literal` comment +# +# source://prism//lib/prism/node.rb#19360 +Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. +# +# "foo" +# ^^^^^ +# +# %w[foo] +# ^^^ +# +# "foo #{bar} baz" +# ^^^^ ^^^^ +# +# source://prism//lib/prism/node.rb#17630 +class Prism::StringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped, Location location) -> void + # + # @return [StringNode] a new instance of StringNode + # + # source://prism//lib/prism/node.rb#17632 + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17644 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17649 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#17748 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#17707 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17659 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17654 + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism//lib/prism/node.rb#17743 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism//lib/prism/node.rb#17701 + sig { returns(Prism::Location) } + def content_loc; end + + # def copy: (**params) -> StringNode + # + # source://prism//lib/prism/node.rb#17664 + sig { params(params: T.untyped).returns(Prism::StringNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17649 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#17680 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17728 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17723 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#17733 + sig { returns(T::Boolean) } + def frozen?; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17753 + def inspect(inspector = T.unsafe(nil)); end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#17738 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#17689 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17778 + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#17719 + sig { returns(String) } + def unescaped; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#17685 + sig { returns(Integer) } + def flags; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17788 + def type; end + end +end + +# Represents the use of the `super` keyword with parentheses or arguments. +# +# super() +# ^^^^^^^ +# +# super foo, bar +# ^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#17800 +class Prism::SuperNode < ::Prism::Node + # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Node? block, Location location) -> void + # + # @return [SuperNode] a new instance of SuperNode + # + # source://prism//lib/prism/node.rb#17802 + def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17814 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism//lib/prism/node.rb#17876 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # attr_reader block: Node? + # + # source://prism//lib/prism/node.rb#17891 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17819 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17832 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17824 + def compact_child_nodes; end + + # def copy: (**params) -> SuperNode + # + # source://prism//lib/prism/node.rb#17837 + sig { params(params: T.untyped).returns(Prism::SuperNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17819 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Node?, location: Location } + # + # source://prism//lib/prism/node.rb#17853 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#17910 + def inspect(inspector = T.unsafe(nil)); end + + # def keyword: () -> String + # + # source://prism//lib/prism/node.rb#17895 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism//lib/prism/node.rb#17858 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # source://prism//lib/prism/node.rb#17900 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism//lib/prism/node.rb#17864 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # source://prism//lib/prism/node.rb#17905 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism//lib/prism/node.rb#17879 + sig { returns(T.nilable(Prism::Location)) } + def rparen_loc; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17944 + def type; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17954 + def type; end + end +end + +# Flags for symbol nodes. +# +# source://prism//lib/prism/node.rb#19364 +module Prism::SymbolFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism//lib/prism/node.rb#19369 +Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to US-ASCII +# +# source://prism//lib/prism/node.rb#19372 +Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to UTF-8 +# +# source://prism//lib/prism/node.rb#19366 +Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal or a symbol contained within a `%i` list. +# +# :foo +# ^^^^ +# +# %i[foo] +# ^^^ +# +# source://prism//lib/prism/node.rb#17966 +class Prism::SymbolNode < ::Prism::Node + # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void + # + # @return [SymbolNode] a new instance of SymbolNode + # + # source://prism//lib/prism/node.rb#17968 + def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end + + # def accept: (Visitor visitor) -> void + # + # source://prism//lib/prism/node.rb#17980 + sig { params(visitor: Prism::Visitor).void } + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17985 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism//lib/prism/node.rb#18090 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism//lib/prism/node.rb#18049 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism//lib/prism/node.rb#17995 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://prism//lib/prism/node.rb#17990 + def compact_child_nodes; end + + # def copy: (**params) -> SymbolNode + # + # source://prism//lib/prism/node.rb#18000 + sig { params(params: T.untyped).returns(Prism::SymbolNode) } + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism//lib/prism/node.rb#17985 + sig { returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location } + # + # source://prism//lib/prism/node.rb#18016 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end + def deconstruct_keys(keys); end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18070 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18075 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism//lib/prism/node.rb#18065 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def inspect(NodeInspector inspector) -> String + # + # source://prism//lib/prism/node.rb#18095 + def inspect(inspector = T.unsafe(nil)); end + + # def opening: () -> String? + # + # source://prism//lib/prism/node.rb#18080 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism//lib/prism/node.rb#18025 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end + + # Sometimes you want to check an instance of a node against a list of + # classes to see what kind of behavior to perform. Usually this is done by + # calling `[cls1, cls2].include?(node.class)` or putting the node into a + # case statement and doing `case node; when cls1; when cls2; end`. Both of + # these approaches are relatively slow because of the constant lookups, + # method calls, and/or array allocations. + # + # Instead, you can call #type, which will return to you a symbol that you + # can use for comparison. This is faster than the other approaches because + # it uses a single integer comparison, but also because if you're on CRuby + # you can take advantage of the fact that case statements with all symbol + # keys will use a jump table. + # + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18120 + def type; end + + # attr_reader unescaped: String + # + # source://prism//lib/prism/node.rb#18061 + sig { returns(String) } + def unescaped; end + + # def value: () -> String? + # + # source://prism//lib/prism/node.rb#18085 + sig { returns(T.nilable(String)) } + def value; end + + # attr_reader value_loc: Location? + # + # source://prism//lib/prism/node.rb#18037 + sig { returns(T.nilable(Prism::Location)) } + def value_loc; end + + private + + # private attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#18021 + sig { returns(Integer) } + def flags; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#18130 + def type; end + end +end + +# This represents a token from the Ruby source. +# +# source://prism//lib/prism/parse_result.rb#454 +class Prism::Token + # Create a new token object with the given type, value, and location. + # + # @return [Token] a new instance of Token + # + # source://prism//lib/prism/parse_result.rb#466 + def initialize(source, type, value, location); end + + # Returns true if the given other token is equal to this token. + # + # source://prism//lib/prism/parse_result.rb#500 + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other); end + + # Implement the hash pattern matching interface for Token. + # + # source://prism//lib/prism/parse_result.rb#474 + sig { params(keys: T.untyped).returns(T.untyped) } + def deconstruct_keys(keys); end + + # A Location object representing the location of this token in the source. + # + # source://prism//lib/prism/parse_result.rb#479 + sig { returns(Prism::Location) } + def location; end + + # Implement the pretty print interface for Token. + # + # source://prism//lib/prism/parse_result.rb#485 + sig { params(q: T.untyped).returns(T.untyped) } + def pretty_print(q); end + + # The type of token that this token is. + # + # source://prism//lib/prism/parse_result.rb#460 + sig { returns(T.untyped) } + def type; end + + # A byteslice of the source that this token represents. + # + # source://prism//lib/prism/parse_result.rb#463 + sig { returns(String) } + def value; end + + private + + # The Source object that represents the source this token came from. + # + # source://prism//lib/prism/parse_result.rb#456 + def source; end +end + +# This module is responsible for converting the prism syntax tree into other +# syntax trees. +# +# source://prism//lib/prism/translation.rb#6 +module Prism::Translation; end + +# This class is the entry-point for converting a prism syntax tree into the +# whitequark/parser gem's syntax tree. It inherits from the base parser for +# the parser gem, and overrides the parse* methods to parse with prism and +# then translate. +# +# source://prism//lib/prism/translation/parser.rb#11 +class Prism::Translation::Parser < ::Parser::Base + # The default encoding for Ruby files is UTF-8. + # + # source://prism//lib/prism/translation/parser.rb#33 + def default_encoding; end + + # Parses a source buffer and returns the AST. + # + # source://prism//lib/prism/translation/parser.rb#41 + def parse(source_buffer); end + + # Parses a source buffer and returns the AST and the source code comments. + # + # source://prism//lib/prism/translation/parser.rb#54 + def parse_with_comments(source_buffer); end + + # Parses a source buffer and returns the AST, the source code comments, + # and the tokens emitted by the lexer. + # + # source://prism//lib/prism/translation/parser.rb#71 + def tokenize(source_buffer, recover = T.unsafe(nil)); end + + # Since prism resolves num params for us, we don't need to support this + # kind of logic here. + # + # source://prism//lib/prism/translation/parser.rb#97 + def try_declare_numparam(node); end + + # source://prism//lib/prism/translation/parser.rb#28 + def version; end + + # source://prism//lib/prism/translation/parser.rb#37 + def yyerror; end + + private + + # Build the parser gem AST from the prism AST. + # + # source://prism//lib/prism/translation/parser.rb#146 + def build_ast(program, offset_cache); end + + # Build the parser gem comments from the prism comments. + # + # source://prism//lib/prism/translation/parser.rb#151 + def build_comments(comments, offset_cache); end + + # Prism deals with offsets in bytes, while the parser gem deals with + # offsets in characters. We need to handle this conversion in order to + # build the parser gem AST. + # + # If the bytesize of the source is the same as the length, then we can + # just use the offset directly. Otherwise, we build an array where the + # index is the byte offset and the value is the character offset. + # + # source://prism//lib/prism/translation/parser.rb#129 + def build_offset_cache(source); end + + # Build a range from a prism location. + # + # source://prism//lib/prism/translation/parser.rb#163 + def build_range(location, offset_cache); end + + # Build the parser gem tokens from the prism tokens. + # + # source://prism//lib/prism/translation/parser.rb#158 + def build_tokens(tokens, offset_cache); end + + # Converts the version format handled by Parser to the format handled by Prism. + # + # source://prism//lib/prism/translation/parser.rb#172 + def convert_for_prism(version); end + + # If there was a error generated during the parse, then raise an + # appropriate syntax error. Otherwise return the result. + # + # source://prism//lib/prism/translation/parser.rb#111 + def unwrap(result, offset_cache); end + + # This is a hook to allow consumers to disable some errors if they don't + # want them to block creating the syntax tree. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/parser.rb#105 + def valid_error?(error); end +end + +# A visitor that knows how to convert a prism syntax tree into the +# whitequark/parser gem's syntax tree. +# +# source://prism//lib/prism/translation/parser/compiler.rb#8 +class Prism::Translation::Parser::Compiler < ::Prism::Compiler + # Initialize a new compiler with the given parser, offset cache, and + # options. + # + # @return [Compiler] a new instance of Compiler + # + # source://prism//lib/prism/translation/parser/compiler.rb#39 + def initialize(parser, offset_cache, forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # The Parser::Builders::Default instance that is being used to build the + # AST. + # + # source://prism//lib/prism/translation/parser/compiler.rb#18 + def builder; end + + # The types of values that can be forwarded in the current scope. + # + # source://prism//lib/prism/translation/parser/compiler.rb#29 + def forwarding; end + + # Whether or not the current node is in a destructure. + # + # source://prism//lib/prism/translation/parser/compiler.rb#32 + def in_destructure; end + + # Whether or not the current node is in a pattern. + # + # source://prism//lib/prism/translation/parser/compiler.rb#35 + def in_pattern; end + + # The offset cache that is used to map between byte and character + # offsets in the file. + # + # source://prism//lib/prism/translation/parser/compiler.rb#26 + def offset_cache; end + + # The Parser::Base instance that is being used to build the AST. + # + # source://prism//lib/prism/translation/parser/compiler.rb#14 + def parser; end + + # The Parser::Source::Buffer instance that is holding a reference to the + # source code. + # + # source://prism//lib/prism/translation/parser/compiler.rb#22 + def source_buffer; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#58 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#52 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#64 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#70 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#101 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#76 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#82 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#107 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#141 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#151 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#157 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#195 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#201 + def visit_block_local_variable_node(node); end + + # A block on a keyword or method call. + # + # @raise [CompilationError] + # + # source://prism//lib/prism/translation/parser/compiler.rb#206 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#212 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # source://prism//lib/prism/translation/parser/compiler.rb#217 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#226 + def visit_break_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#300 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#238 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#300 + def visit_call_operator_write_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#300 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#327 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#339 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#358 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#345 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#371 + def visit_class_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#403 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#403 + def visit_class_variable_operator_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#403 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#384 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#421 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#393 + def visit_class_variable_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#442 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#442 + def visit_constant_operator_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#442 + def visit_constant_or_write_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#496 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#466 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#496 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#496 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#514 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#486 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#427 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#460 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#436 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#523 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#570 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#582 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#588 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#598 + def visit_embedded_variable_node(node); end + + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # + # @raise [CompilationError] + # + # source://prism//lib/prism/translation/parser/compiler.rb#604 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#610 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#616 + def visit_find_pattern_node(node); end + + # 0..5 + # ^^^^ + # if foo .. bar; end + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1302 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#628 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#634 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#652 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#658 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#667 + def visit_forwarding_super_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#698 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#698 + def visit_global_variable_operator_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#698 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#679 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#716 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#688 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#722 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#732 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#750 + def visit_if_node(node); end + + # 1i + # + # source://prism//lib/prism/translation/parser/compiler.rb#791 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # @raise [CompilationError] + # + # source://prism//lib/prism/translation/parser/compiler.rb#797 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # @raise [CompilationError] + # + # source://prism//lib/prism/translation/parser/compiler.rb#803 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#809 + def visit_in_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#835 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#835 + def visit_index_operator_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#835 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#861 + def visit_index_target_node(node); end + + # ^^^^^^^^^^^ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#891 + def visit_instance_variable_and_write_node(node); end + + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#891 + def visit_instance_variable_operator_write_node(node); end + + # ^^^^^^^^^^^ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#891 + def visit_instance_variable_or_write_node(node); end + + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#872 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#909 + def visit_instance_variable_target_node(node); end + + # ^^^^^^^^ + # + # @foo, @bar = 1 + # ^^^^ ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#881 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#915 + def visit_integer_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#921 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#921 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#936 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#951 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#961 + def visit_interpolated_x_string_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#976 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#985 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # source://prism//lib/prism/translation/parser/compiler.rb#993 + def visit_lambda_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # foo &&= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1037 + def visit_local_variable_and_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1037 + def visit_local_variable_operator_write_node(node); end + + # foo += bar + # ^^^^^^^^^^ + # foo ||= bar + # ^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1037 + def visit_local_variable_or_write_node(node); end + + # foo + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1018 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1055 + def visit_local_variable_target_node(node); end + + # foo = 1 + # ^^^^^^^ + # + # foo, bar = 1 + # ^^^ ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1027 + def visit_local_variable_write_node(node); end + + # /foo/ + # ^^^^^ + # if /foo/ then end + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1336 + def visit_match_last_line_node(node); end + + # source://prism//lib/prism/translation/parser/compiler.rb#1066 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1085 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1095 + def visit_match_write_node(node); end + + # A node that is missing from the syntax tree. This is only used in the + # case of a syntax error. The parser gem doesn't have such a concept, so + # we invent our own here. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1106 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1112 + def visit_module_node(node); end + + # foo, bar = baz + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1123 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1137 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1158 + def visit_next_node(node); end + + # nil + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1170 + def visit_nil_node(node); end + + # def foo(**nil); end + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1176 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1186 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1192 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1198 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1204 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1210 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1216 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1255 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1265 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1271 + def visit_pinned_variable_node(node); end + + # END {} + # + # source://prism//lib/prism/translation/parser/compiler.rb#1276 + def visit_post_execution_node(node); end + + # BEGIN {} + # + # source://prism//lib/prism/translation/parser/compiler.rb#1286 + def visit_pre_execution_node(node); end + + # The top-level program node. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1296 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1302 + def visit_range_node(node); end + + # 1r + # ^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1324 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1330 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1336 + def visit_regular_expression_node(node); end + + # def foo(bar:); end + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1351 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1357 + def visit_required_parameter_node(node); end + + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1363 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # @raise [CompilationError] + # + # source://prism//lib/prism/translation/parser/compiler.rb#1381 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1390 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1396 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1405 + def visit_return_node(node); end + + # self + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1417 + def visit_self_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1423 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1435 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1441 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1447 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1459 + def visit_splat_node(node); end + + # A list of statements. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1472 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1478 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1495 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1518 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1536 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1542 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1551 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1581 + def visit_until_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1603 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1617 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1639 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1657 + def visit_yield_node(node); end + + private + + # Initialize a new compiler with the given option overrides, used to + # visit a subtree with the given options. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1671 + def copy_compiler(forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # When *, **, &, or ... are used as an argument in a method call, we + # check if they were allowed by the current context. To determine that + # we build this lookup table. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1678 + def find_forwarding(node); end + + # Blocks can have a special set of parameters that automatically expand + # when given arrays if they have a single required parameter and no + # other parameters. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/parser/compiler.rb#1693 + def procarg0?(parameters); end + + # Constructs a new source range from the given start and end offsets. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1710 + def srange(location); end + + # Constructs a new source range by finding the given tokens between the + # given start offset and end offset. If the needle is not found, it + # returns nil. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1722 + def srange_find(start_offset, end_offset, tokens); end + + # Constructs a new source range from the given start and end offsets. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1715 + def srange_offsets(start_offset, end_offset); end + + # Transform a location into a token that the parser gem expects. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1731 + def token(location); end + + # Visit a block node on a call. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1736 + def visit_block(call, block); end + + # Visit a heredoc that can be either a string or an xstring. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1769 + def visit_heredoc(node); end + + # Visit a numeric node and account for the optional sign. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1815 + def visit_numeric(node, value); end + + # Within the given block, track that we're within a pattern. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1827 + def within_pattern; end +end + +# Raised when the tree is malformed or there is a bug in the compiler. +# +# source://prism//lib/prism/translation/parser/compiler.rb#10 +class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError; end + +# Locations in the parser gem AST are generated using this class. We +# store a reference to its constant to make it slightly faster to look +# up. +# +# source://prism//lib/prism/translation/parser/compiler.rb#1707 +Prism::Translation::Parser::Compiler::Range = Parser::Source::Range + +# The parser gem has a list of diagnostics with a hard-coded set of error +# messages. We create our own diagnostic class in order to set our own +# error messages. +# +# source://prism//lib/prism/translation/parser.rb#15 +class Prism::Translation::Parser::Diagnostic < ::Parser::Diagnostic + # Initialize a new diagnostic with the given message and location. + # + # @return [Diagnostic] a new instance of Diagnostic + # + # source://prism//lib/prism/translation/parser.rb#20 + def initialize(message, location); end + + # The message generated by prism. + # + # source://prism//lib/prism/translation/parser.rb#17 + def message; end +end + +# Accepts a list of prism tokens and converts them into the expected +# format for the parser gem. +# +# source://prism//lib/prism/translation/parser/lexer.rb#8 +class Prism::Translation::Parser::Lexer + # Initialize the lexer with the given source buffer, prism tokens, and + # offset cache. + # + # @return [Lexer] a new instance of Lexer + # + # source://prism//lib/prism/translation/parser/lexer.rb#193 + def initialize(source_buffer, lexed, offset_cache); end + + # An array of prism tokens that we lexed. + # + # source://prism//lib/prism/translation/parser/lexer.rb#186 + def lexed; end + + # A hash that maps offsets in bytes to offsets in characters. + # + # source://prism//lib/prism/translation/parser/lexer.rb#189 + def offset_cache; end + + # The Parser::Source::Buffer that the tokens were lexed from. + # + # source://prism//lib/prism/translation/parser/lexer.rb#183 + def source_buffer; end + + # Convert the prism tokens into the expected format for the parser gem. + # + # source://prism//lib/prism/translation/parser/lexer.rb#203 + def to_a; end + + private + + # Parse a complex from the string representation. + # + # source://prism//lib/prism/translation/parser/lexer.rb#310 + def parse_complex(value); end + + # Parse a rational from the string representation. + # + # source://prism//lib/prism/translation/parser/lexer.rb#323 + def parse_rational(value); end +end + +# source://prism//lib/prism/translation/parser/lexer.rb#199 +Prism::Translation::Parser::Lexer::Range = Parser::Source::Range + +# The direct translating of types between the two lexers. +# +# source://prism//lib/prism/translation/parser/lexer.rb#10 +Prism::Translation::Parser::Lexer::TYPES = T.let(T.unsafe(nil), Hash) + +# source://prism//lib/prism/translation/parser.rb#26 +Prism::Translation::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + +# Note: This integration is not finished, and therefore still has many +# inconsistencies with Ripper. If you'd like to help out, pull requests would +# be greatly appreciated! +# +# This class is meant to provide a compatibility layer between prism and +# Ripper. It functions by parsing the entire tree first and then walking it +# and executing each of the Ripper callbacks as it goes. +# +# This class is going to necessarily be slower than the native Ripper API. It +# is meant as a stopgap until developers migrate to using prism. It is also +# meant as a test harness for the prism parser. +# +# To use this class, you treat `Prism::Translation::Ripper` effectively as you would +# treat the `Ripper` class. +# +# source://prism//lib/prism/translation/ripper.rb#21 +class Prism::Translation::Ripper < ::Prism::Compiler + # Create a new Translation::Ripper object with the given source. + # + # @return [Ripper] a new instance of Ripper + # + # source://prism//lib/prism/translation/ripper.rb#75 + def initialize(source); end + + # The current column number of the parser. + # + # source://prism//lib/prism/translation/ripper.rb#72 + def column; end + + # True if the parser encountered an error during parsing. + # + # @return [Boolean] + # + # source://prism//lib/prism/translation/ripper.rb#87 + def error?; end + + # The current line number of the parser. + # + # source://prism//lib/prism/translation/ripper.rb#69 + def lineno; end + + # Parse the source and return the result. + # + # source://prism//lib/prism/translation/ripper.rb#92 + def parse; end + + # The source that is being parsed. + # + # source://prism//lib/prism/translation/ripper.rb#66 + def source; end + + # Visit an AliasGlobalVariableNode. + # + # source://prism//lib/prism/translation/ripper.rb#247 + def visit_alias_global_variable_node(node); end + + # Visit an AliasMethodNode. + # + # source://prism//lib/prism/translation/ripper.rb#226 + def visit_alias_method_node(node); end + + # Visit an AndNode. + # + # source://prism//lib/prism/translation/ripper.rb#264 + def visit_and_node(node); end + + # Visit an ArrayNode node. + # + # source://prism//lib/prism/translation/ripper.rb#113 + def visit_array_node(node); end + + # Visit a BackReferenceReadNode. + # + # source://prism//lib/prism/translation/ripper.rb#258 + def visit_back_reference_read_node(node); end + + # Visit a BeginNode node. + # This is not at all bulletproof against different structures of begin/rescue/else/ensure/end. + # + # source://prism//lib/prism/translation/ripper.rb#315 + def visit_begin_node(node); end + + # Visit a BlockNode. + # + # source://prism//lib/prism/translation/ripper.rb#191 + def visit_block_node(node); end + + # Visit a BlockParametersNode. + # + # source://prism//lib/prism/translation/ripper.rb#200 + def visit_block_parameters_node(node); end + + # Visit a BreakNode. + # + # source://prism//lib/prism/translation/ripper.rb#218 + def visit_break_node(node); end + + # Visit a CallNode node. + # Ripper distinguishes between many different method-call + # nodes -- unary and binary operators, "command" calls with + # no parentheses, and call/fcall/vcall. + # + # source://prism//lib/prism/translation/ripper.rb#123 + def visit_call_node(node); end + + # Visit an EmbeddedStatementsNode node. + # + # source://prism//lib/prism/translation/ripper.rb#371 + def visit_embedded_statements_node(node); end + + # Visit a FalseNode. + # + # source://prism//lib/prism/translation/ripper.rb#280 + def visit_false_node(node); end + + # Visit a FloatNode node. + # + # source://prism//lib/prism/translation/ripper.rb#286 + def visit_float_node(node); end + + # Visit a GlobalVariableReadNode. + # + # source://prism//lib/prism/translation/ripper.rb#252 + def visit_global_variable_read_node(node); end + + # Visit a ImaginaryNode node. + # + # source://prism//lib/prism/translation/ripper.rb#291 + def visit_imaginary_node(node); end + + # Visit an IntegerNode node. + # + # source://prism//lib/prism/translation/ripper.rb#296 + def visit_integer_node(node); end + + # Visit an InterpolatedStringNode node. + # + # source://prism//lib/prism/translation/ripper.rb#366 + def visit_interpolated_string_node(node); end + + # Visit an InterpolatedSymbolNode node. + # + # source://prism//lib/prism/translation/ripper.rb#381 + def visit_interpolated_symbol_node(node); end + + # Visit a LocalVariableAndWriteNode. + # + # source://prism//lib/prism/translation/ripper.rb#168 + def visit_local_variable_and_write_node(node); end + + # Visit nodes for +=, *=, -=, etc., called LocalVariableOperatorWriteNodes. + # + # source://prism//lib/prism/translation/ripper.rb#178 + def visit_local_variable_operator_write_node(node); end + + # Visit a LocalVariableOrWriteNode. + # + # source://prism//lib/prism/translation/ripper.rb#173 + def visit_local_variable_or_write_node(node); end + + # Visit a LocalVariableReadNode. + # + # source://prism//lib/prism/translation/ripper.rb#183 + def visit_local_variable_read_node(node); end + + # Visit a LocalVariableWriteNode. + # + # source://prism//lib/prism/translation/ripper.rb#161 + def visit_local_variable_write_node(node); end + + # Visit an OrNode. + # + # source://prism//lib/prism/translation/ripper.rb#269 + def visit_or_node(node); end + + # Visit a ParametersNode. + # This will require expanding as we support more kinds of parameters. + # + # source://prism//lib/prism/translation/ripper.rb#206 + def visit_parameters_node(node); end + + # Visit a ParenthesesNode node. + # + # source://prism//lib/prism/translation/ripper.rb#301 + def visit_parentheses_node(node); end + + # Visit a ProgramNode node. + # + # source://prism//lib/prism/translation/ripper.rb#327 + def visit_program_node(node); end + + # Visit a RangeNode node. + # + # source://prism//lib/prism/translation/ripper.rb#334 + def visit_range_node(node); end + + # Visit a RationalNode node. + # + # source://prism//lib/prism/translation/ripper.rb#347 + def visit_rational_node(node); end + + # Visit a RequiredParameterNode. + # + # source://prism//lib/prism/translation/ripper.rb#212 + def visit_required_parameter_node(node); end + + # Visit a RescueNode node. + # + # source://prism//lib/prism/translation/ripper.rb#322 + def visit_rescue_node(node); end + + # Visit a StatementsNode node. + # + # source://prism//lib/prism/translation/ripper.rb#386 + def visit_statements_node(node); end + + # Visit a StringNode node. + # + # source://prism//lib/prism/translation/ripper.rb#352 + def visit_string_node(node); end + + # Visit a SymbolNode node. + # + # source://prism//lib/prism/translation/ripper.rb#376 + def visit_symbol_node(node); end + + # Visit a TrueNode. + # + # source://prism//lib/prism/translation/ripper.rb#274 + def visit_true_node(node); end + + # Visit an XStringNode node. + # + # source://prism//lib/prism/translation/ripper.rb#359 + def visit_x_string_node(node); end + + private + + # source://prism//lib/prism/translation/ripper.rb#680 + def _dispatch0; end + + # source://prism//lib/prism/translation/ripper.rb#681 + def _dispatch1(_); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def _dispatch2(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#683 + def _dispatch3(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#684 + def _dispatch4(_, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#685 + def _dispatch5(_, _, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#686 + def _dispatch7(_, _, _, _, _, _, _); end + + # This method is responsible for updating lineno and column information + # to reflect the current node. + # + # This method could be drastically improved with some caching on the start + # of every line, but for now it's good enough. + # + # source://prism//lib/prism/translation/ripper.rb#663 + def bounds(location); end - # source://prism//prism/ripper_compat.rb#33 - def on_float(value); end + # If we need to do something unusual, we can directly update the line number + # and column to reflect the current node. + # + # source://prism//lib/prism/translation/ripper.rb#670 + def bounds_values(lineno, column); end - # source://prism//prism/ripper_compat.rb#27 - def on_fndptn(*args); end + # For CRuby et al, "no block" in an on_block_var is false + # + # source://prism//lib/prism/translation/ripper.rb#646 + def no_block_value; end - # source://prism//prism/ripper_compat.rb#27 - def on_for(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_BEGIN(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_gvar(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_CHAR(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_hash(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_END(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_heredoc_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on___end__(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_heredoc_dedent(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_alias(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_heredoc_end(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_alias_error(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_hshptn(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_aref(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_ident(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_aref_field(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_if(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_arg_ambiguous(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_if_mod(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_arg_paren(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_ifop(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_args_add(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_ignored_nl(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_args_add_block(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_ignored_sp(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_args_add_star(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_imaginary(value); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_args_forward; end - # source://prism//prism/ripper_compat.rb#27 - def on_in(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_args_new; end - # source://prism//prism/ripper_compat.rb#33 - def on_int(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_array(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_ivar(value); end + # source://prism//lib/prism/translation/ripper.rb#684 + def on_aryptn(_, _, _, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_kw(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_assign(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_kwrest_param(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_assign_error(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_label(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_assoc_new(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_label_end(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_assoc_splat(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_lambda(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_assoclist_from_args(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_lbrace(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_backref(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_lbracket(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_backtick(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_lparen(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_bare_assoc_hash(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_magic_comment(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_begin(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_massign(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_binary(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_method_add_arg(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_block_var(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_method_add_block(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_blockarg(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_mlhs_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#684 + def on_bodystmt(_, _, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mlhs_add_post(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_brace_block(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mlhs_add_star(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_break(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_mlhs_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_call(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mlhs_paren(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_case(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_module(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_class(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mrhs_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_class_name_error(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mrhs_add_star(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_comma(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_mrhs_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_command(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_mrhs_new_from_args(*args); end + # source://prism//lib/prism/translation/ripper.rb#684 + def on_command_call(_, _, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_next(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_comment(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_nl(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_const(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_nokw_param(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_const_path_field(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_op(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_const_path_ref(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_opassign(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_const_ref(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_operator_ambiguous(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_cvar(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_param_error(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_def(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_params(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_defined(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_paren(*args); end + # source://prism//lib/prism/translation/ripper.rb#685 + def on_defs(_, _, _, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_parse_error(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_do_block(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_period(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_dot2(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_program(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_dot3(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_qsymbols_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_dyna_symbol(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_qsymbols_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_else(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_qsymbols_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_elsif(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_qwords_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embdoc(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_qwords_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embdoc_beg(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_qwords_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embdoc_end(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_rational(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embexpr_beg(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_rbrace(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embexpr_end(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_rbracket(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_embvar(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_redo(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_ensure(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_regexp_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_excessed_comma; end - # source://prism//prism/ripper_compat.rb#33 - def on_regexp_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_fcall(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_regexp_end(value); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_field(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_regexp_literal(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_float(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_regexp_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#684 + def on_fndptn(_, _, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_rescue(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_for(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_rescue_mod(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_gvar(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_rest_param(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_hash(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_retry(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_heredoc_beg(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_return(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_heredoc_dedent(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_return0(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_heredoc_end(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_rparen(value); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_hshptn(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_sclass(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_ident(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_semicolon(value); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_if(_, _, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_sp(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_if_mod(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_stmts_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_ifop(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_stmts_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_ignored_nl(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_ignored_sp(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_concat(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_imaginary(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_content(*args); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_in(_, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_dvar(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_int(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_embexpr(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_ivar(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_string_literal(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_kw(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_super(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_kwrest_param(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_symbeg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_label(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_symbol(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_label_end(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_symbol_literal(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_lambda(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_symbols_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_lbrace(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_lbracket(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_lparen(_); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_magic_comment(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_massign(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_method_add_arg(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_method_add_block(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_mlhs_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_mlhs_add_post(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_mlhs_add_star(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#680 + def on_mlhs_new; end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_mlhs_paren(_); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_module(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_mrhs_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_mrhs_add_star(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#680 + def on_mrhs_new; end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_mrhs_new_from_args(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_next(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_nl(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_nokw_param(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_op(_); end + + # source://prism//lib/prism/translation/ripper.rb#683 + def on_opassign(_, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_operator_ambiguous(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_param_error(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#686 + def on_params(_, _, _, _, _, _, _); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_paren(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_parse_error(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_period(_); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_program(_); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_qsymbols_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_qsymbols_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#680 + def on_qsymbols_new; end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_qwords_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_qwords_beg(_); end + + # source://prism//lib/prism/translation/ripper.rb#680 + def on_qwords_new; end - # source://prism//prism/ripper_compat.rb#33 - def on_symbols_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_rational(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_symbols_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_rbrace(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_tlambda(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_rbracket(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_tlambeg(value); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_redo; end - # source://prism//prism/ripper_compat.rb#27 - def on_top_const_field(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_regexp_add(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_top_const_ref(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_regexp_beg(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_tstring_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_regexp_end(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_tstring_content(value); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_regexp_literal(_, _); end - # source://prism//prism/ripper_compat.rb#33 - def on_tstring_end(value); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_regexp_new; end - # source://prism//prism/ripper_compat.rb#27 - def on_unary(*args); end + # source://prism//lib/prism/translation/ripper.rb#684 + def on_rescue(_, _, _, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_undef(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_rescue_mod(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_unless(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_rest_param(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_unless_mod(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_retry; end - # source://prism//prism/ripper_compat.rb#27 - def on_until(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_return(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_until_mod(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_return0; end - # source://prism//prism/ripper_compat.rb#27 - def on_var_alias(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_rparen(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_var_field(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_sclass(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_var_ref(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_semicolon(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_vcall(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_sp(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_void_stmt(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_stmts_add(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_when(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_stmts_new; end - # source://prism//prism/ripper_compat.rb#27 - def on_while(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_string_add(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_while_mod(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_string_concat(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_word_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_string_content; end - # source://prism//prism/ripper_compat.rb#27 - def on_word_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_string_dvar(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_words_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_string_embexpr(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_words_beg(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_string_literal(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_words_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_super(_); end - # source://prism//prism/ripper_compat.rb#33 - def on_words_sep(value); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_symbeg(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_xstring_add(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_symbol(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_xstring_literal(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_symbol_literal(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_xstring_new(*args); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_symbols_add(_, _); end - # source://prism//prism/ripper_compat.rb#27 - def on_yield(*args); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_symbols_beg(_); end - # source://prism//prism/ripper_compat.rb#27 - def on_yield0(*args); end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_symbols_new; end - # source://prism//prism/ripper_compat.rb#27 - def on_zsuper(*args); end -end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_tlambda(_); end -# This class mirrors the ::Ripper::SexpBuilderPP subclass of ::Ripper that -# returns the same values as ::Ripper::SexpBuilder except with a couple of -# niceties that flatten linked lists into arrays. -class Prism::RipperCompat::SexpBuilderPP < ::Prism::RipperCompat::SexpBuilder - private + # source://prism//lib/prism/translation/ripper.rb#681 + def on_tlambeg(_); end - # source://prism//prism/ripper_compat.rb#45 - def _dispatch_event_new; end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_top_const_field(_); end - # source://prism//prism/ripper_compat.rb#49 - def _dispatch_event_push(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_top_const_ref(_); end - # source://prism//prism/ripper_compat.rb#49 - def on_args_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_tstring_beg(_); end - # source://prism//prism/ripper_compat.rb#45 - def on_args_new; end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_tstring_content(_); end - # source://prism//prism/ripper_compat.rb#49 - def on_mlhs_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_tstring_end(_); end - # source://prism//prism/ripper_compat.rb#45 - def on_mlhs_new; end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_unary(_, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_mrhs_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_undef(_); end - # source://prism//prism/ripper_compat.rb#45 - def on_mrhs_new; end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_unless(_, _, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_qsymbols_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_unless_mod(_, _); end - # source://prism//prism/ripper_compat.rb#45 - def on_qsymbols_new; end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_until(_, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_qwords_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_until_mod(_, _); end - # source://prism//prism/ripper_compat.rb#45 - def on_qwords_new; end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_var_alias(_, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_regexp_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_var_field(_); end - # source://prism//prism/ripper_compat.rb#45 - def on_regexp_new; end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_var_ref(_); end - # source://prism//prism/ripper_compat.rb#49 - def on_stmts_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_vcall(_); end - # source://prism//prism/ripper_compat.rb#45 - def on_stmts_new; end + # source://prism//lib/prism/translation/ripper.rb#680 + def on_void_stmt; end - # source://prism//prism/ripper_compat.rb#49 - def on_string_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#683 + def on_when(_, _, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_symbols_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_while(_, _); end - # source://prism//prism/ripper_compat.rb#45 - def on_symbols_new; end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_while_mod(_, _); end - # source://prism//prism/ripper_compat.rb#49 - def on_word_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_word_add(_, _); end - # source://prism//prism/ripper_compat.rb#45 + # source://prism//lib/prism/translation/ripper.rb#680 def on_word_new; end - # source://prism//prism/ripper_compat.rb#49 - def on_words_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#682 + def on_words_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_words_beg(_); end - # source://prism//prism/ripper_compat.rb#45 + # source://prism//lib/prism/translation/ripper.rb#680 def on_words_new; end - # source://prism//prism/ripper_compat.rb#49 - def on_xstring_add(list, item); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_words_sep(_); end + + # source://prism//lib/prism/translation/ripper.rb#682 + def on_xstring_add(_, _); end + + # source://prism//lib/prism/translation/ripper.rb#681 + def on_xstring_literal(_); end - # source://prism//prism/ripper_compat.rb#45 + # source://prism//lib/prism/translation/ripper.rb#680 def on_xstring_new; end -end -# Represents the `self` keyword. -# -# self -# ^^^^ -class Prism::SelfNode < ::Prism::Node - # def initialize: (location: Location) -> void - # - # @return [SelfNode] a new instance of SelfNode - # - # source://prism//prism/node.rb#15204 - def initialize(location); end + # source://prism//lib/prism/translation/ripper.rb#681 + def on_yield(_); end + + # source://prism//lib/prism/translation/ripper.rb#680 + def on_yield0; end - # def accept: (visitor: Visitor) -> void + # source://prism//lib/prism/translation/ripper.rb#680 + def on_zsuper; end + + # Lazily initialize the parse result. # - # source://prism//prism/node.rb#15209 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#676 + def result; end - # def child_nodes: () -> Array[nil | Node] + # In Prism this is a CallNode with :[]= as the operator. + # In Ripper it's an :aref_field. # - # source://prism//prism/node.rb#15214 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#521 + def visit_aref_field_node(node); end - # def comment_targets: () -> Array[Node | Location] + # In Prism this is a CallNode with :[] as the operator. + # In Ripper it's an :aref. # - # source://prism//prism/node.rb#15224 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#513 + def visit_aref_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Visit an operation-and-assign node, such as +=. # - # source://prism//prism/node.rb#15219 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#501 + def visit_binary_op_assign(node, operator: T.unsafe(nil)); end - # def copy: (**params) -> SelfNode + # Visit a binary operator node like an AndNode or OrNode # - # source://prism//prism/node.rb#15229 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#652 + def visit_binary_operator(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Visit a list of elements, like the elements of an array or arguments. # - # source://prism//prism/node.rb#15214 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#474 + def visit_elements(elements); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # Visit an InterpolatedStringNode or an InterpolatedSymbolNode node. # - # source://prism//prism/node.rb#15239 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#482 + def visit_enumerated_node(node); end - # def inspect(inspector: NodeInspector) -> String + # Generate Ripper events for a CallNode with no opening_loc # - # source://prism//prism/node.rb#15244 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#410 + def visit_no_paren_call(node); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. + # Visit a node that represents a number. We need to explicitly handle the + # unary - operator. # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. + # source://prism//lib/prism/translation/ripper.rb#611 + def visit_number(node); end + + # Ripper has several methods of emitting a symbol literal. Inside an alias + # sometimes it suppresses the [:symbol] wrapper around ident. If the symbol + # is also the name of a keyword (e.g. :if) it will emit a :@kw wrapper, not + # an :@ident wrapper, with similar treatment for constants and operators. # - # def type: () -> Symbol + # source://prism//lib/prism/translation/ripper.rb#580 + def visit_symbol_literal_node(node, no_symbol_wrapper: T.unsafe(nil)); end + + # For most Rubies and JRuby after 9.4.6.0 this is a no-op. # - # source://prism//prism/node.rb#15263 - def type; end + # source://prism//lib/prism/translation/ripper.rb#634 + def visit_unary_operator(value); end class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. + # This is a convenience method that runs the SexpBuilderPP subclass parser. # - # def self.type: () -> Symbol + # source://prism//lib/prism/translation/ripper.rb#403 + def sexp(source); end + + # This is a convenience method that runs the SexpBuilder subclass parser. # - # source://prism//prism/node.rb#15273 - def type; end + # source://prism//lib/prism/translation/ripper.rb#398 + def sexp_raw(source); end end end -# A module responsible for deserializing parse results. -module Prism::Serialize - class << self - # Deserialize the AST represented by the given string into a parse result. - # - # source://prism//prism/serialize.rb#37 - def load(input, serialized); end +# In an alias statement Ripper will emit @kw instead of @ident if the object +# being aliased is a Ruby keyword. For instance, in the line "alias :foo :if", +# the :if is treated as a lexer keyword. So we need to know what symbols are +# also keywords. +# +# source://prism//lib/prism/translation/ripper.rb#532 +Prism::Translation::Ripper::RUBY_KEYWORDS = T.let(T.unsafe(nil), Array) - # Deserialize the tokens represented by the given string into a parse - # result. - # - # source://prism//prism/serialize.rb#49 - def load_tokens(source, serialized); end - end -end +# This class mirrors the ::Ripper::SexpBuilder subclass of ::Ripper that +# returns the arrays of [type, *children]. +# +# source://prism//lib/prism/translation/ripper.rb#24 +class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper + private -class Prism::Serialize::Loader - # @return [Loader] a new instance of Loader - # - # source://prism//prism/serialize.rb#58 - def initialize(source, serialized); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_BEGIN(*args); end - # Returns the value of attribute constant_pool. - # - # source://prism//prism/serialize.rb#55 - def constant_pool; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_CHAR(value); end - # Returns the value of attribute constant_pool_offset. - # - # source://prism//prism/serialize.rb#55 - def constant_pool_offset; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_END(*args); end - # Returns the value of attribute encoding. - # - # source://prism//prism/serialize.rb#54 - def encoding; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on___end__(value); end - # Returns the value of attribute input. - # - # source://prism//prism/serialize.rb#54 - def input; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_alias(*args); end - # Returns the value of attribute io. - # - # source://prism//prism/serialize.rb#54 - def io; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_alias_error(*args); end - # source://prism//prism/serialize.rb#92 - def load_comments; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_aref(*args); end - # source://prism//prism/serialize.rb#82 - def load_encoding; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_aref_field(*args); end - # source://prism//prism/serialize.rb#73 - def load_header; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_arg_ambiguous(*args); end - # source://prism//prism/serialize.rb#102 - def load_metadata; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_arg_paren(*args); end - # source://prism//prism/serialize.rb#135 - def load_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_args_add(*args); end - # source://prism//prism/serialize.rb#148 - def load_result; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_args_add_block(*args); end - # source://prism//prism/serialize.rb#88 - def load_start_line; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_args_add_star(*args); end - # source://prism//prism/serialize.rb#111 - def load_tokens; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_args_forward(*args); end - # source://prism//prism/serialize.rb#124 - def load_tokens_result; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_args_new(*args); end - # Returns the value of attribute serialized. - # - # source://prism//prism/serialize.rb#54 - def serialized; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_array(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_aryptn(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_assign(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_assign_error(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_assoc_new(*args); end - # Returns the value of attribute source. - # - # source://prism//prism/serialize.rb#55 - def source; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_assoc_splat(*args); end - # Returns the value of attribute start_line. - # - # source://prism//prism/serialize.rb#56 - def start_line; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_assoclist_from_args(*args); end - private + # source://prism//lib/prism/translation/ripper.rb#34 + def on_backref(value); end - # source://prism//prism/serialize.rb#211 - def load_constant(index); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_backtick(value); end - # source://prism//prism/serialize.rb#187 - def load_embedded_string; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_bare_assoc_hash(*args); end - # source://prism//prism/serialize.rb#203 - def load_location; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_begin(*args); end - # source://prism//prism/serialize.rb#242 - def load_node; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_binary(*args); end - # source://prism//prism/serialize.rb#236 - def load_optional_constant; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_block_var(*args); end - # source://prism//prism/serialize.rb#207 - def load_optional_location; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_blockarg(*args); end - # source://prism//prism/serialize.rb#180 - def load_optional_node; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_bodystmt(*args); end - # source://prism//prism/serialize.rb#232 - def load_required_constant; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_brace_block(*args); end - # source://prism//prism/serialize.rb#176 - def load_serialized_length; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_break(*args); end - # source://prism//prism/serialize.rb#191 - def load_string; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_call(*args); end - # source://prism//prism/serialize.rb#171 - def load_varsint; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_case(*args); end - # variable-length integer using https://en.wikipedia.org/wiki/LEB128 - # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints - # - # source://prism//prism/serialize.rb#157 - def load_varuint; end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_class(*args); end -# The major version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism//prism/serialize.rb#26 -Prism::Serialize::MAJOR_VERSION = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_class_name_error(*args); end -# The minor version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism//prism/serialize.rb#30 -Prism::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#34 + def on_comma(value); end -# The patch version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism//prism/serialize.rb#34 -Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_command(*args); end -# The token types that can be indexed by their enum values. -# -# source://prism//prism/serialize.rb#1154 -Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_command_call(*args); end -# Represents a singleton class declaration involving the `class` keyword. -# -# class << self end -# ^^^^^^^^^^^^^^^^^ -class Prism::SingletonClassNode < ::Prism::Node - # def initialize: (locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Node, body: Node?, end_keyword_loc: Location, location: Location) -> void - # - # @return [SingletonClassNode] a new instance of SingletonClassNode - # - # source://prism//prism/node.rb#15302 - def initialize(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_comment(value); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15313 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_const(value); end - # attr_reader body: Node? - # - # source://prism//prism/node.rb#15296 - def body; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_const_path_field(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15318 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_const_path_ref(*args); end - # def class_keyword: () -> String - # - # source://prism//prism/node.rb#15357 - def class_keyword; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_const_ref(*args); end - # attr_reader class_keyword_loc: Location - # - # source://prism//prism/node.rb#15287 - def class_keyword_loc; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_cvar(value); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15331 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_def(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15323 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_defined(*args); end - # def copy: (**params) -> SingletonClassNode - # - # source://prism//prism/node.rb#15336 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_defs(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15318 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_do_block(*args); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15352 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_dot2(*args); end - # def end_keyword: () -> String - # - # source://prism//prism/node.rb#15367 - def end_keyword; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_dot3(*args); end - # attr_reader end_keyword_loc: Location - # - # source://prism//prism/node.rb#15299 - def end_keyword_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_dyna_symbol(*args); end - # attr_reader expression: Node - # - # source://prism//prism/node.rb#15293 - def expression; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_else(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15372 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_elsif(*args); end - # attr_reader locals: Array[Symbol] - # - # source://prism//prism/node.rb#15284 - def locals; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embdoc(value); end - # def operator: () -> String - # - # source://prism//prism/node.rb#15362 - def operator; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embdoc_beg(value); end - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#15290 - def operator_loc; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embdoc_end(value); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15403 - def type; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embexpr_beg(value); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15413 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embexpr_end(value); end -# This represents a source of Ruby code that has been parsed. It is used in -# conjunction with locations to allow them to resolve line numbers and source -# ranges. -class Prism::Source - # Create a new source object with the given source code and newline byte - # offsets. If no newline byte offsets are given, they will be computed from - # the source code. - # - # @return [Source] a new instance of Source - # - # source://prism//prism/parse_result.rb#20 - def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_embvar(value); end - # Return the column number in characters for the given byte offset. - # - # source://prism//prism/parse_result.rb#55 - def character_column(byte_offset); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_ensure(*args); end - # Return the character offset for the given byte offset. - # - # source://prism//prism/parse_result.rb#50 - def character_offset(byte_offset); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_excessed_comma(*args); end - # Return the column number for the given byte offset. - # - # source://prism//prism/parse_result.rb#45 - def column(byte_offset); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_fcall(*args); end - # Binary search through the offsets to find the line number for the given - # byte offset. - # - # source://prism//prism/parse_result.rb#34 - def line(byte_offset); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_field(*args); end - # Return the byte offset of the start of the line corresponding to the given - # byte offset. - # - # source://prism//prism/parse_result.rb#40 - def line_start(byte_offset); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_float(value); end - # The list of newline byte offsets in the source code. - # - # source://prism//prism/parse_result.rb#15 - def offsets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_fndptn(*args); end - # Perform a byteslice on the source code using the given byte offset and - # byte length. - # - # source://prism//prism/parse_result.rb#28 - def slice(byte_offset, length); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_for(*args); end - # The source code that this source object represents. - # - # source://prism//prism/parse_result.rb#9 - def source; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_gvar(value); end - # The line number where this source starts. - # - # source://prism//prism/parse_result.rb#12 - def start_line; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_hash(*args); end - # The line number where this source starts. - # - # source://prism//prism/parse_result.rb#12 - def start_line=(_arg0); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_heredoc_beg(value); end - private + # source://prism//lib/prism/translation/ripper.rb#28 + def on_heredoc_dedent(*args); end - # Find all of the newlines in the source code and return their byte offsets - # from the start of the string an array. - # - # source://prism//prism/parse_result.rb#83 - def compute_offsets(code); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_heredoc_end(value); end - # Binary search through the offsets to find the line number for the given - # byte offset. - # - # source://prism//prism/parse_result.rb#63 - def find_line(byte_offset); end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_hshptn(*args); end -# Represents the use of the `__ENCODING__` keyword. -# -# __ENCODING__ -# ^^^^^^^^^^^^ -class Prism::SourceEncodingNode < ::Prism::Node - # def initialize: (location: Location) -> void - # - # @return [SourceEncodingNode] a new instance of SourceEncodingNode - # - # source://prism//prism/node.rb#15424 - def initialize(location); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_ident(value); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15429 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_if(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15434 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_if_mod(*args); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15444 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_ifop(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15439 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_ignored_nl(value); end - # def copy: (**params) -> SourceEncodingNode - # - # source://prism//prism/node.rb#15449 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_ignored_sp(value); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15434 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_imaginary(value); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15459 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_in(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15464 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_int(value); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15483 - def type; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_ivar(value); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15493 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_kw(value); end -# Represents the use of the `__FILE__` keyword. -# -# __FILE__ -# ^^^^^^^^ -class Prism::SourceFileNode < ::Prism::Node - # def initialize: (filepath: String, location: Location) -> void - # - # @return [SourceFileNode] a new instance of SourceFileNode - # - # source://prism//prism/node.rb#15507 - def initialize(filepath, location); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_kwrest_param(*args); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15513 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_label(value); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15518 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_label_end(value); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15528 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_lambda(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15523 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_lbrace(value); end - # def copy: (**params) -> SourceFileNode - # - # source://prism//prism/node.rb#15533 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_lbracket(value); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15518 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_lparen(value); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15544 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_magic_comment(*args); end - # attr_reader filepath: String - # - # source://prism//prism/node.rb#15504 - def filepath; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_massign(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15549 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_method_add_arg(*args); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15569 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_method_add_block(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15579 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mlhs_add(*args); end -# Represents the use of the `__LINE__` keyword. -# -# __LINE__ -# ^^^^^^^^ -class Prism::SourceLineNode < ::Prism::Node - # def initialize: (location: Location) -> void - # - # @return [SourceLineNode] a new instance of SourceLineNode - # - # source://prism//prism/node.rb#15590 - def initialize(location); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mlhs_add_post(*args); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15595 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mlhs_add_star(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15600 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mlhs_new(*args); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15610 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mlhs_paren(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15605 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_module(*args); end - # def copy: (**params) -> SourceLineNode - # - # source://prism//prism/node.rb#15615 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mrhs_add(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15600 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mrhs_add_star(*args); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15625 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mrhs_new(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15630 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_mrhs_new_from_args(*args); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15649 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_next(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15659 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_nl(value); end -# Represents the use of the splat operator. -# -# [*a] -# ^^ -class Prism::SplatNode < ::Prism::Node - # def initialize: (operator_loc: Location, expression: Node?, location: Location) -> void - # - # @return [SplatNode] a new instance of SplatNode - # - # source://prism//prism/node.rb#15676 - def initialize(operator_loc, expression, location); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_nokw_param(*args); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15683 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_op(value); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15688 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_opassign(*args); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15700 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_operator_ambiguous(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15693 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_param_error(*args); end - # def copy: (**params) -> SplatNode - # - # source://prism//prism/node.rb#15705 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_params(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15688 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_paren(*args); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15717 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_parse_error(*args); end - # attr_reader expression: Node? - # - # source://prism//prism/node.rb#15673 - def expression; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_period(value); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15727 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_program(*args); end - # def operator: () -> String - # - # source://prism//prism/node.rb#15722 - def operator; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_qsymbols_add(*args); end - # attr_reader operator_loc: Location - # - # source://prism//prism/node.rb#15670 - def operator_loc; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_qsymbols_beg(value); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15753 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_qsymbols_new(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15763 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_qwords_add(*args); end -# Represents a set of statements contained within some scope. -# -# foo; bar; baz -# ^^^^^^^^^^^^^ -class Prism::StatementsNode < ::Prism::Node - # def initialize: (body: Array[Node], location: Location) -> void - # - # @return [StatementsNode] a new instance of StatementsNode - # - # source://prism//prism/node.rb#15777 - def initialize(body, location); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_qwords_beg(value); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15783 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_qwords_new(*args); end - # attr_reader body: Array[Node] - # - # source://prism//prism/node.rb#15774 - def body; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_rational(value); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15788 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_rbrace(value); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15798 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_rbracket(value); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15793 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_redo(*args); end - # def copy: (**params) -> StatementsNode - # - # source://prism//prism/node.rb#15803 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_regexp_add(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15788 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_regexp_beg(value); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15814 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_regexp_end(value); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15819 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_regexp_literal(*args); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15839 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_regexp_new(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15849 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_rescue(*args); end -# Flags for string nodes. -module Prism::StringFlags; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_rescue_mod(*args); end -# internal bytes forced the encoding to binary -# -# source://prism//prism/node.rb#17384 -Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_rest_param(*args); end -# internal bytes forced the encoding to UTF-8 -# -# source://prism//prism/node.rb#17381 -Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_retry(*args); end -# frozen by virtue of a `frozen_string_literal` comment -# -# source://prism//prism/node.rb#17387 -Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_return(*args); end -# Represents a string literal, a string contained within a `%w` list, or -# plain string content within an interpolated string. -# -# "foo" -# ^^^^^ -# -# %w[foo] -# ^^^ -# -# "foo #{bar} baz" -# ^^^^ ^^^^ -class Prism::StringNode < ::Prism::Node - include ::Prism::HeredocQuery + # source://prism//lib/prism/translation/ripper.rb#28 + def on_return0(*args); end - # def initialize: (flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location) -> void - # - # @return [StringNode] a new instance of StringNode - # - # source://prism//prism/node.rb#15882 - def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_rparen(value); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#15892 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_sclass(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15897 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_semicolon(value); end - # def closing: () -> String? - # - # source://prism//prism/node.rb#15957 - def closing; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_sp(value); end - # attr_reader closing_loc: Location? - # - # source://prism//prism/node.rb#15876 - def closing_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_stmts_add(*args); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#15907 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_stmts_new(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#15902 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_add(*args); end - # def content: () -> String - # - # source://prism//prism/node.rb#15952 - def content; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_concat(*args); end - # attr_reader content_loc: Location - # - # source://prism//prism/node.rb#15873 - def content_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_content(*args); end - # def copy: (**params) -> StringNode - # - # source://prism//prism/node.rb#15912 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_dvar(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#15897 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_embexpr(*args); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#15927 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_string_literal(*args); end - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#15937 - def forced_binary_encoding?; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_super(*args); end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#15932 - def forced_utf8_encoding?; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_symbeg(value); end - # def frozen?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#15942 - def frozen?; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_symbol(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#15962 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_symbol_literal(*args); end - # def opening: () -> String? - # - # source://prism//prism/node.rb#15947 - def opening; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_symbols_add(*args); end - # attr_reader opening_loc: Location? - # - # source://prism//prism/node.rb#15870 - def opening_loc; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_symbols_beg(value); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#15987 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_symbols_new(*args); end - # attr_reader unescaped: String - # - # source://prism//prism/node.rb#15879 - def unescaped; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_tlambda(value); end - private + # source://prism//lib/prism/translation/ripper.rb#34 + def on_tlambeg(value); end - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#15867 - def flags; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_top_const_field(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#15997 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_top_const_ref(*args); end -# Represents the use of the `super` keyword with parentheses or arguments. -# -# super() -# ^^^^^^^ -# -# super foo, bar -# ^^^^^^^^^^^^^^ -class Prism::SuperNode < ::Prism::Node - # def initialize: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Node?, location: Location) -> void - # - # @return [SuperNode] a new instance of SuperNode - # - # source://prism//prism/node.rb#16026 - def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_tstring_beg(value); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#16036 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_tstring_content(value); end - # attr_reader arguments: ArgumentsNode? - # - # source://prism//prism/node.rb#16017 - def arguments; end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_tstring_end(value); end - # attr_reader block: Node? - # - # source://prism//prism/node.rb#16023 - def block; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_unary(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#16041 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_undef(*args); end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#16054 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_unless(*args); end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#16046 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_unless_mod(*args); end - # def copy: (**params) -> SuperNode - # - # source://prism//prism/node.rb#16059 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_until(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_until_mod(*args); end + + # source://prism//lib/prism/translation/ripper.rb#28 + def on_var_alias(*args); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#16041 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_var_field(*args); end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#16074 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_var_ref(*args); end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#16094 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_vcall(*args); end - # def keyword: () -> String - # - # source://prism//prism/node.rb#16079 - def keyword; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_void_stmt(*args); end - # attr_reader keyword_loc: Location - # - # source://prism//prism/node.rb#16011 - def keyword_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_when(*args); end - # def lparen: () -> String? - # - # source://prism//prism/node.rb#16084 - def lparen; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_while(*args); end - # attr_reader lparen_loc: Location? - # - # source://prism//prism/node.rb#16014 - def lparen_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_while_mod(*args); end - # def rparen: () -> String? - # - # source://prism//prism/node.rb#16089 - def rparen; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_word_add(*args); end - # attr_reader rparen_loc: Location? - # - # source://prism//prism/node.rb#16020 - def rparen_loc; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_word_new(*args); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#16128 - def type; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_words_add(*args); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#16138 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#34 + def on_words_beg(value); end -# Flags for symbol nodes. -module Prism::SymbolFlags; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_words_new(*args); end -# internal bytes forced the encoding to binary -# -# source://prism//prism/node.rb#17396 -Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#34 + def on_words_sep(value); end -# internal bytes forced the encoding to US-ASCII -# -# source://prism//prism/node.rb#17399 -Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_xstring_add(*args); end -# internal bytes forced the encoding to UTF-8 -# -# source://prism//prism/node.rb#17393 -Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + # source://prism//lib/prism/translation/ripper.rb#28 + def on_xstring_literal(*args); end -# Represents a symbol literal or a symbol contained within a `%i` list. -# -# :foo -# ^^^^ -# -# %i[foo] -# ^^^ -class Prism::SymbolNode < ::Prism::Node - # def initialize: (flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> void - # - # @return [SymbolNode] a new instance of SymbolNode - # - # source://prism//prism/node.rb#16167 - def initialize(flags, opening_loc, value_loc, closing_loc, unescaped, location); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_xstring_new(*args); end - # def accept: (visitor: Visitor) -> void - # - # source://prism//prism/node.rb#16177 - def accept(visitor); end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_yield(*args); end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#16182 - def child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_yield0(*args); end - # def closing: () -> String? - # - # source://prism//prism/node.rb#16242 - def closing; end + # source://prism//lib/prism/translation/ripper.rb#28 + def on_zsuper(*args); end +end - # attr_reader closing_loc: Location? - # - # source://prism//prism/node.rb#16161 - def closing_loc; end +# This class mirrors the ::Ripper::SexpBuilderPP subclass of ::Ripper that +# returns the same values as ::Ripper::SexpBuilder except with a couple of +# niceties that flatten linked lists into arrays. +# +# source://prism//lib/prism/translation/ripper.rb#43 +class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder + private - # def comment_targets: () -> Array[Node | Location] - # - # source://prism//prism/node.rb#16192 - def comment_targets; end + # source://prism//lib/prism/translation/ripper.rb#46 + def _dispatch_event_new; end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism//prism/node.rb#16187 - def compact_child_nodes; end + # source://prism//lib/prism/translation/ripper.rb#50 + def _dispatch_event_push(list, item); end - # def copy: (**params) -> SymbolNode - # - # source://prism//prism/node.rb#16197 - def copy(**params); end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_args_add(list, item); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism//prism/node.rb#16182 - def deconstruct; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_args_new; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] - # - # source://prism//prism/node.rb#16212 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_mlhs_add(list, item); end - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#16222 - def forced_binary_encoding?; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_mlhs_new; end - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#16227 - def forced_us_ascii_encoding?; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_mrhs_add(list, item); end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism//prism/node.rb#16217 - def forced_utf8_encoding?; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_mrhs_new; end - # def inspect(inspector: NodeInspector) -> String - # - # source://prism//prism/node.rb#16247 - def inspect(inspector = T.unsafe(nil)); end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_qsymbols_add(list, item); end - # def opening: () -> String? - # - # source://prism//prism/node.rb#16232 - def opening; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_qsymbols_new; end - # attr_reader opening_loc: Location? - # - # source://prism//prism/node.rb#16155 - def opening_loc; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_qwords_add(list, item); end - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # - # def type: () -> Symbol - # - # source://prism//prism/node.rb#16272 - def type; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_qwords_new; end - # attr_reader unescaped: String - # - # source://prism//prism/node.rb#16164 - def unescaped; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_regexp_add(list, item); end - # def value: () -> String? - # - # source://prism//prism/node.rb#16237 - def value; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_regexp_new; end - # attr_reader value_loc: Location? - # - # source://prism//prism/node.rb#16158 - def value_loc; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_stmts_add(list, item); end - private + # source://prism//lib/prism/translation/ripper.rb#46 + def on_stmts_new; end - # Returns the value of attribute flags. - # - # source://prism//prism/node.rb#16152 - def flags; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_string_add(list, item); end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//prism/node.rb#16282 - def type; end - end -end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_symbols_add(list, item); end -# This represents a token from the Ruby source. -class Prism::Token - # Create a new token object with the given type, value, and location. - # - # @return [Token] a new instance of Token - # - # source://prism//prism/parse_result.rb#427 - def initialize(type, value, location); end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_symbols_new; end - # Returns true if the given other token is equal to this token. - # - # source://prism//prism/parse_result.rb#454 - def ==(other); end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_word_add(list, item); end - # Implement the hash pattern matching interface for Token. - # - # source://prism//prism/parse_result.rb#434 - def deconstruct_keys(keys); end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_word_new; end - # A Location object representing the location of this token in the source. - # - # source://prism//prism/parse_result.rb#424 - def location; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_words_add(list, item); end - # Implement the pretty print interface for Token. - # - # source://prism//prism/parse_result.rb#439 - def pretty_print(q); end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_words_new; end - # The type of token that this token is. - # - # source://prism//prism/parse_result.rb#418 - def type; end + # source://prism//lib/prism/translation/ripper.rb#50 + def on_xstring_add(list, item); end - # A byteslice of the source that this token represents. - # - # source://prism//prism/parse_result.rb#421 - def value; end + # source://prism//lib/prism/translation/ripper.rb#46 + def on_xstring_new; end end # Represents the use of the literal `true` keyword. # # true # ^^^^ +# +# source://prism//lib/prism/node.rb#18139 class Prism::TrueNode < ::Prism::Node - # def initialize: (location: Location) -> void + # def initialize: (Location location) -> void # # @return [TrueNode] a new instance of TrueNode # - # source://prism//prism/node.rb#16293 - def initialize(location); end + # source://prism//lib/prism/node.rb#18141 + def initialize(source, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16298 + # source://prism//lib/prism/node.rb#18148 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16303 + # source://prism//lib/prism/node.rb#18153 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16313 + # source://prism//lib/prism/node.rb#18163 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16308 + # source://prism//lib/prism/node.rb#18158 def compact_child_nodes; end # def copy: (**params) -> TrueNode # - # source://prism//prism/node.rb#16318 + # source://prism//lib/prism/node.rb#18168 + sig { params(params: T.untyped).returns(Prism::TrueNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16303 + # source://prism//lib/prism/node.rb#18153 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//prism/node.rb#16328 + # source://prism//lib/prism/node.rb#18179 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16333 + # source://prism//lib/prism/node.rb#18185 def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -23553,7 +29115,7 @@ class Prism::TrueNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16352 + # source://prism//lib/prism/node.rb#18204 def type; end class << self @@ -23564,7 +29126,7 @@ class Prism::TrueNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#16362 + # source://prism//lib/prism/node.rb#18214 def type; end end end @@ -23573,68 +29135,82 @@ end # # undef :foo, :bar, :baz # ^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18223 class Prism::UndefNode < ::Prism::Node - # def initialize: (names: Array[Node], keyword_loc: Location, location: Location) -> void + # def initialize: (Array[Node] names, Location keyword_loc, Location location) -> void # # @return [UndefNode] a new instance of UndefNode # - # source://prism//prism/node.rb#16379 - def initialize(names, keyword_loc, location); end + # source://prism//lib/prism/node.rb#18225 + def initialize(source, names, keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16386 + # source://prism//lib/prism/node.rb#18234 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16391 + # source://prism//lib/prism/node.rb#18239 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16401 + # source://prism//lib/prism/node.rb#18249 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16396 + # source://prism//lib/prism/node.rb#18244 def compact_child_nodes; end # def copy: (**params) -> UndefNode # - # source://prism//prism/node.rb#16406 + # source://prism//lib/prism/node.rb#18254 + sig { params(params: T.untyped).returns(Prism::UndefNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16391 + # source://prism//lib/prism/node.rb#18239 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[Node], keyword_loc: Location, location: Location } # - # source://prism//prism/node.rb#16418 + # source://prism//lib/prism/node.rb#18267 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16428 + # source://prism//lib/prism/node.rb#18287 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#16423 + # source://prism//lib/prism/node.rb#18282 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#16376 + # source://prism//lib/prism/node.rb#18275 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader names: Array[Node] # - # source://prism//prism/node.rb#16373 + # source://prism//lib/prism/node.rb#18272 + sig { returns(T::Array[Prism::Node]) } def names; end # Sometimes you want to check an instance of a node against a list of @@ -23652,7 +29228,7 @@ class Prism::UndefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16449 + # source://prism//lib/prism/node.rb#18308 def type; end class << self @@ -23663,7 +29239,7 @@ class Prism::UndefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#16459 + # source://prism//lib/prism/node.rb#18318 def type; end end end @@ -23675,101 +29251,121 @@ end # # unless foo then bar end # ^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18330 class Prism::UnlessNode < ::Prism::Node - # def initialize: (keyword_loc: Location, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> void + # def initialize: (Location keyword_loc, Node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void # # @return [UnlessNode] a new instance of UnlessNode # - # source://prism//prism/node.rb#16491 - def initialize(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + # source://prism//lib/prism/node.rb#18332 + def initialize(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16502 + # source://prism//lib/prism/node.rb#18345 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16511 + # source://prism//lib/prism/node.rb#18354 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16525 + # source://prism//lib/prism/node.rb#18368 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16516 + # source://prism//lib/prism/node.rb#18359 def compact_child_nodes; end # attr_reader consequent: ElseNode? # - # source://prism//prism/node.rb#16485 + # source://prism//lib/prism/node.rb#18419 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (**params) -> UnlessNode # - # source://prism//prism/node.rb#16530 + # source://prism//lib/prism/node.rb#18373 + sig { params(params: T.untyped).returns(Prism::UnlessNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16511 + # source://prism//lib/prism/node.rb#18354 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//prism/node.rb#16546 + # source://prism//lib/prism/node.rb#18390 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://prism//prism/node.rb#16561 + # source://prism//lib/prism/node.rb#18445 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//prism/node.rb#16488 + # source://prism//lib/prism/node.rb#18422 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16566 + # source://prism//lib/prism/node.rb#18450 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#16551 + # source://prism//lib/prism/node.rb#18435 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#16473 + # source://prism//lib/prism/node.rb#18395 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader predicate: Node # - # source://prism//prism/node.rb#16476 + # source://prism//lib/prism/node.rb#18401 + sig { returns(Prism::Node) } def predicate; end - # source://prism//prism/node.rb#16506 + # source://prism//lib/prism/node.rb#18349 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#16482 + # source://prism//lib/prism/node.rb#18416 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism//prism/node.rb#16556 + # source://prism//lib/prism/node.rb#18440 + sig { returns(T.nilable(String)) } def then_keyword; end # attr_reader then_keyword_loc: Location? # - # source://prism//prism/node.rb#16479 + # source://prism//lib/prism/node.rb#18404 + sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -23787,7 +29383,7 @@ class Prism::UnlessNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16602 + # source://prism//lib/prism/node.rb#18486 def type; end class << self @@ -23798,7 +29394,7 @@ class Prism::UnlessNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#16612 + # source://prism//lib/prism/node.rb#18496 def type; end end end @@ -23810,93 +29406,111 @@ end # # until foo do bar end # ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18508 class Prism::UntilNode < ::Prism::Node - # def initialize: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> void + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Node predicate, StatementsNode? statements, Location location) -> void # # @return [UntilNode] a new instance of UntilNode # - # source://prism//prism/node.rb#16641 - def initialize(flags, keyword_loc, closing_loc, predicate, statements, location); end + # source://prism//lib/prism/node.rb#18510 + def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16651 + # source://prism//lib/prism/node.rb#18522 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#16698 + # source://prism//lib/prism/node.rb#18599 + sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16660 + # source://prism//lib/prism/node.rb#18531 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#16708 + # source://prism//lib/prism/node.rb#18609 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#16632 + # source://prism//lib/prism/node.rb#18580 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16673 + # source://prism//lib/prism/node.rb#18544 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16665 + # source://prism//lib/prism/node.rb#18536 def compact_child_nodes; end # def copy: (**params) -> UntilNode # - # source://prism//prism/node.rb#16678 + # source://prism//lib/prism/node.rb#18549 + sig { params(params: T.untyped).returns(Prism::UntilNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16660 + # source://prism//lib/prism/node.rb#18531 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location } # - # source://prism//prism/node.rb#16693 + # source://prism//lib/prism/node.rb#18565 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16713 + # source://prism//lib/prism/node.rb#18614 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#16703 + # source://prism//lib/prism/node.rb#18604 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#16629 + # source://prism//lib/prism/node.rb#18574 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader predicate: Node # - # source://prism//prism/node.rb#16635 + # source://prism//lib/prism/node.rb#18592 + sig { returns(Prism::Node) } def predicate; end - # source://prism//prism/node.rb#16655 + # source://prism//lib/prism/node.rb#18526 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#16638 + # source://prism//lib/prism/node.rb#18595 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -23914,14 +29528,15 @@ class Prism::UntilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16744 + # source://prism//lib/prism/node.rb#18645 def type; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#16626 + # source://prism//lib/prism/node.rb#18570 + sig { returns(Integer) } def flags; end class << self @@ -23932,11 +29547,14 @@ class Prism::UntilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#16754 + # source://prism//lib/prism/node.rb#18655 def type; end end end +# The version constant is set by reading the result of calling pm_version. +Prism::VERSION = T.let(T.unsafe(nil), String) + # A visitor is a class that provides a default implementation for every accept # method defined on the nodes. This means it can walk a tree without the # caller needing to define any special handling. This allows you to handle a @@ -23955,745 +29573,895 @@ end # super # end # end +# +# source://prism//lib/prism/visitor.rb#50 class Prism::Visitor < ::Prism::BasicVisitor # Visit a AliasGlobalVariableNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AliasGlobalVariableNode).void } def visit_alias_global_variable_node(node); end # Visit a AliasMethodNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AliasMethodNode).void } def visit_alias_method_node(node); end # Visit a AlternationPatternNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AlternationPatternNode).void } def visit_alternation_pattern_node(node); end # Visit a AndNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AndNode).void } def visit_and_node(node); end # Visit a ArgumentsNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ArgumentsNode).void } def visit_arguments_node(node); end # Visit a ArrayNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ArrayNode).void } def visit_array_node(node); end # Visit a ArrayPatternNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ArrayPatternNode).void } def visit_array_pattern_node(node); end # Visit a AssocNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AssocNode).void } def visit_assoc_node(node); end # Visit a AssocSplatNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::AssocSplatNode).void } def visit_assoc_splat_node(node); end # Visit a BackReferenceReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BackReferenceReadNode).void } def visit_back_reference_read_node(node); end # Visit a BeginNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BeginNode).void } def visit_begin_node(node); end # Visit a BlockArgumentNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BlockArgumentNode).void } def visit_block_argument_node(node); end # Visit a BlockLocalVariableNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BlockLocalVariableNode).void } def visit_block_local_variable_node(node); end # Visit a BlockNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BlockNode).void } def visit_block_node(node); end # Visit a BlockParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BlockParameterNode).void } def visit_block_parameter_node(node); end # Visit a BlockParametersNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BlockParametersNode).void } def visit_block_parameters_node(node); end # Visit a BreakNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::BreakNode).void } def visit_break_node(node); end # Visit a CallAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CallAndWriteNode).void } def visit_call_and_write_node(node); end # Visit a CallNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CallNode).void } def visit_call_node(node); end # Visit a CallOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CallOperatorWriteNode).void } def visit_call_operator_write_node(node); end # Visit a CallOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CallOrWriteNode).void } def visit_call_or_write_node(node); end # Visit a CallTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CallTargetNode).void } def visit_call_target_node(node); end # Visit a CapturePatternNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CapturePatternNode).void } def visit_capture_pattern_node(node); end # Visit a CaseMatchNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CaseMatchNode).void } def visit_case_match_node(node); end # Visit a CaseNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::CaseNode).void } def visit_case_node(node); end # Visit a ClassNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassNode).void } def visit_class_node(node); end # Visit a ClassVariableAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableAndWriteNode).void } def visit_class_variable_and_write_node(node); end # Visit a ClassVariableOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableOperatorWriteNode).void } def visit_class_variable_operator_write_node(node); end # Visit a ClassVariableOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableOrWriteNode).void } def visit_class_variable_or_write_node(node); end # Visit a ClassVariableReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableReadNode).void } def visit_class_variable_read_node(node); end # Visit a ClassVariableTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableTargetNode).void } def visit_class_variable_target_node(node); end # Visit a ClassVariableWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ClassVariableWriteNode).void } def visit_class_variable_write_node(node); end # Visit a ConstantAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantAndWriteNode).void } def visit_constant_and_write_node(node); end # Visit a ConstantOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantOperatorWriteNode).void } def visit_constant_operator_write_node(node); end # Visit a ConstantOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantOrWriteNode).void } def visit_constant_or_write_node(node); end # Visit a ConstantPathAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathAndWriteNode).void } def visit_constant_path_and_write_node(node); end # Visit a ConstantPathNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathNode).void } def visit_constant_path_node(node); end # Visit a ConstantPathOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathOperatorWriteNode).void } def visit_constant_path_operator_write_node(node); end # Visit a ConstantPathOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathOrWriteNode).void } def visit_constant_path_or_write_node(node); end # Visit a ConstantPathTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathTargetNode).void } def visit_constant_path_target_node(node); end # Visit a ConstantPathWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end # Visit a ConstantReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantReadNode).void } def visit_constant_read_node(node); end # Visit a ConstantTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantTargetNode).void } def visit_constant_target_node(node); end # Visit a ConstantWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end # Visit a DefNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::DefNode).void } def visit_def_node(node); end # Visit a DefinedNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::DefinedNode).void } def visit_defined_node(node); end # Visit a ElseNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ElseNode).void } def visit_else_node(node); end # Visit a EmbeddedStatementsNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::EmbeddedStatementsNode).void } def visit_embedded_statements_node(node); end # Visit a EmbeddedVariableNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::EmbeddedVariableNode).void } def visit_embedded_variable_node(node); end # Visit a EnsureNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::EnsureNode).void } def visit_ensure_node(node); end # Visit a FalseNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::FalseNode).void } def visit_false_node(node); end # Visit a FindPatternNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::FindPatternNode).void } def visit_find_pattern_node(node); end # Visit a FlipFlopNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::FlipFlopNode).void } def visit_flip_flop_node(node); end # Visit a FloatNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::FloatNode).void } def visit_float_node(node); end # Visit a ForNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ForNode).void } def visit_for_node(node); end # Visit a ForwardingArgumentsNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ForwardingArgumentsNode).void } def visit_forwarding_arguments_node(node); end # Visit a ForwardingParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ForwardingParameterNode).void } def visit_forwarding_parameter_node(node); end # Visit a ForwardingSuperNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ForwardingSuperNode).void } def visit_forwarding_super_node(node); end # Visit a GlobalVariableAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableAndWriteNode).void } def visit_global_variable_and_write_node(node); end # Visit a GlobalVariableOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableOperatorWriteNode).void } def visit_global_variable_operator_write_node(node); end # Visit a GlobalVariableOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableOrWriteNode).void } def visit_global_variable_or_write_node(node); end # Visit a GlobalVariableReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableReadNode).void } def visit_global_variable_read_node(node); end # Visit a GlobalVariableTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableTargetNode).void } def visit_global_variable_target_node(node); end # Visit a GlobalVariableWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::GlobalVariableWriteNode).void } def visit_global_variable_write_node(node); end # Visit a HashNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::HashNode).void } def visit_hash_node(node); end # Visit a HashPatternNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::HashPatternNode).void } def visit_hash_pattern_node(node); end # Visit a IfNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IfNode).void } def visit_if_node(node); end # Visit a ImaginaryNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ImaginaryNode).void } def visit_imaginary_node(node); end # Visit a ImplicitNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ImplicitNode).void } def visit_implicit_node(node); end # Visit a ImplicitRestNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ImplicitRestNode).void } def visit_implicit_rest_node(node); end # Visit a InNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InNode).void } def visit_in_node(node); end # Visit a IndexAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IndexAndWriteNode).void } def visit_index_and_write_node(node); end # Visit a IndexOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IndexOperatorWriteNode).void } def visit_index_operator_write_node(node); end # Visit a IndexOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IndexOrWriteNode).void } def visit_index_or_write_node(node); end # Visit a IndexTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IndexTargetNode).void } def visit_index_target_node(node); end # Visit a InstanceVariableAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableAndWriteNode).void } def visit_instance_variable_and_write_node(node); end # Visit a InstanceVariableOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableOperatorWriteNode).void } def visit_instance_variable_operator_write_node(node); end # Visit a InstanceVariableOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableOrWriteNode).void } def visit_instance_variable_or_write_node(node); end # Visit a InstanceVariableReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableReadNode).void } def visit_instance_variable_read_node(node); end # Visit a InstanceVariableTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableTargetNode).void } def visit_instance_variable_target_node(node); end # Visit a InstanceVariableWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InstanceVariableWriteNode).void } def visit_instance_variable_write_node(node); end # Visit a IntegerNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::IntegerNode).void } def visit_integer_node(node); end # Visit a InterpolatedMatchLastLineNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InterpolatedMatchLastLineNode).void } def visit_interpolated_match_last_line_node(node); end # Visit a InterpolatedRegularExpressionNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InterpolatedRegularExpressionNode).void } def visit_interpolated_regular_expression_node(node); end # Visit a InterpolatedStringNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end # Visit a InterpolatedSymbolNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InterpolatedSymbolNode).void } def visit_interpolated_symbol_node(node); end # Visit a InterpolatedXStringNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::InterpolatedXStringNode).void } def visit_interpolated_x_string_node(node); end # Visit a KeywordHashNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::KeywordHashNode).void } def visit_keyword_hash_node(node); end # Visit a KeywordRestParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::KeywordRestParameterNode).void } def visit_keyword_rest_parameter_node(node); end # Visit a LambdaNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LambdaNode).void } def visit_lambda_node(node); end # Visit a LocalVariableAndWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end # Visit a LocalVariableOperatorWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end # Visit a LocalVariableOrWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end # Visit a LocalVariableReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableReadNode).void } def visit_local_variable_read_node(node); end # Visit a LocalVariableTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableTargetNode).void } def visit_local_variable_target_node(node); end # Visit a LocalVariableWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end # Visit a MatchLastLineNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MatchLastLineNode).void } def visit_match_last_line_node(node); end # Visit a MatchPredicateNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MatchPredicateNode).void } def visit_match_predicate_node(node); end # Visit a MatchRequiredNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MatchRequiredNode).void } def visit_match_required_node(node); end # Visit a MatchWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MatchWriteNode).void } def visit_match_write_node(node); end # Visit a MissingNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MissingNode).void } def visit_missing_node(node); end # Visit a ModuleNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ModuleNode).void } def visit_module_node(node); end # Visit a MultiTargetNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MultiTargetNode).void } def visit_multi_target_node(node); end # Visit a MultiWriteNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::MultiWriteNode).void } def visit_multi_write_node(node); end # Visit a NextNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::NextNode).void } def visit_next_node(node); end # Visit a NilNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::NilNode).void } def visit_nil_node(node); end # Visit a NoKeywordsParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::NoKeywordsParameterNode).void } def visit_no_keywords_parameter_node(node); end # Visit a NumberedParametersNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::NumberedParametersNode).void } def visit_numbered_parameters_node(node); end # Visit a NumberedReferenceReadNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::NumberedReferenceReadNode).void } def visit_numbered_reference_read_node(node); end # Visit a OptionalKeywordParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::OptionalKeywordParameterNode).void } def visit_optional_keyword_parameter_node(node); end # Visit a OptionalParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::OptionalParameterNode).void } def visit_optional_parameter_node(node); end # Visit a OrNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::OrNode).void } def visit_or_node(node); end # Visit a ParametersNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ParametersNode).void } def visit_parameters_node(node); end # Visit a ParenthesesNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ParenthesesNode).void } def visit_parentheses_node(node); end # Visit a PinnedExpressionNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::PinnedExpressionNode).void } def visit_pinned_expression_node(node); end # Visit a PinnedVariableNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::PinnedVariableNode).void } def visit_pinned_variable_node(node); end # Visit a PostExecutionNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::PostExecutionNode).void } def visit_post_execution_node(node); end # Visit a PreExecutionNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::PreExecutionNode).void } def visit_pre_execution_node(node); end # Visit a ProgramNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ProgramNode).void } def visit_program_node(node); end # Visit a RangeNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RangeNode).void } def visit_range_node(node); end # Visit a RationalNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RationalNode).void } def visit_rational_node(node); end # Visit a RedoNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RedoNode).void } def visit_redo_node(node); end # Visit a RegularExpressionNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RegularExpressionNode).void } def visit_regular_expression_node(node); end # Visit a RequiredKeywordParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RequiredKeywordParameterNode).void } def visit_required_keyword_parameter_node(node); end # Visit a RequiredParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RequiredParameterNode).void } def visit_required_parameter_node(node); end # Visit a RescueModifierNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RescueModifierNode).void } def visit_rescue_modifier_node(node); end # Visit a RescueNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RescueNode).void } def visit_rescue_node(node); end # Visit a RestParameterNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RestParameterNode).void } def visit_rest_parameter_node(node); end # Visit a RetryNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::RetryNode).void } def visit_retry_node(node); end # Visit a ReturnNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::ReturnNode).void } def visit_return_node(node); end # Visit a SelfNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SelfNode).void } def visit_self_node(node); end # Visit a SingletonClassNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end # Visit a SourceEncodingNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SourceEncodingNode).void } def visit_source_encoding_node(node); end # Visit a SourceFileNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SourceFileNode).void } def visit_source_file_node(node); end # Visit a SourceLineNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SourceLineNode).void } def visit_source_line_node(node); end # Visit a SplatNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SplatNode).void } def visit_splat_node(node); end # Visit a StatementsNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::StatementsNode).void } def visit_statements_node(node); end # Visit a StringNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::StringNode).void } def visit_string_node(node); end # Visit a SuperNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SuperNode).void } def visit_super_node(node); end # Visit a SymbolNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::SymbolNode).void } def visit_symbol_node(node); end # Visit a TrueNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::TrueNode).void } def visit_true_node(node); end # Visit a UndefNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::UndefNode).void } def visit_undef_node(node); end # Visit a UnlessNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::UnlessNode).void } def visit_unless_node(node); end # Visit a UntilNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::UntilNode).void } def visit_until_node(node); end # Visit a WhenNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::WhenNode).void } def visit_when_node(node); end # Visit a WhileNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::WhileNode).void } def visit_while_node(node); end # Visit a XStringNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::XStringNode).void } def visit_x_string_node(node); end # Visit a YieldNode node # - # source://prism//prism/visitor.rb#26 + # source://prism//lib/prism/visitor.rb#26 + sig { params(node: Prism::YieldNode).void } def visit_yield_node(node); end end @@ -24703,73 +30471,88 @@ end # when true # ^^^^^^^^^ # end +# +# source://prism//lib/prism/node.rb#18666 class Prism::WhenNode < ::Prism::Node - # def initialize: (keyword_loc: Location, conditions: Array[Node], statements: StatementsNode?, location: Location) -> void + # def initialize: (Location keyword_loc, Array[Node] conditions, StatementsNode? statements, Location location) -> void # # @return [WhenNode] a new instance of WhenNode # - # source://prism//prism/node.rb#16776 - def initialize(keyword_loc, conditions, statements, location); end + # source://prism//lib/prism/node.rb#18668 + def initialize(source, keyword_loc, conditions, statements, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16784 + # source://prism//lib/prism/node.rb#18678 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16789 + # source://prism//lib/prism/node.rb#18683 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16802 + # source://prism//lib/prism/node.rb#18696 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16794 + # source://prism//lib/prism/node.rb#18688 def compact_child_nodes; end # attr_reader conditions: Array[Node] # - # source://prism//prism/node.rb#16770 + # source://prism//lib/prism/node.rb#18726 + sig { returns(T::Array[Prism::Node]) } def conditions; end # def copy: (**params) -> WhenNode # - # source://prism//prism/node.rb#16807 + # source://prism//lib/prism/node.rb#18701 + sig { params(params: T.untyped).returns(Prism::WhenNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16789 + # source://prism//lib/prism/node.rb#18683 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Node], statements: StatementsNode?, location: Location } # - # source://prism//prism/node.rb#16820 + # source://prism//lib/prism/node.rb#18715 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16830 + # source://prism//lib/prism/node.rb#18738 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#16825 + # source://prism//lib/prism/node.rb#18733 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#16767 + # source://prism//lib/prism/node.rb#18720 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#16773 + # source://prism//lib/prism/node.rb#18729 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -24787,7 +30570,7 @@ class Prism::WhenNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16857 + # source://prism//lib/prism/node.rb#18765 def type; end class << self @@ -24798,7 +30581,7 @@ class Prism::WhenNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#16867 + # source://prism//lib/prism/node.rb#18775 def type; end end end @@ -24810,93 +30593,111 @@ end # # while foo do bar end # ^^^^^^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#18787 class Prism::WhileNode < ::Prism::Node - # def initialize: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> void + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Node predicate, StatementsNode? statements, Location location) -> void # # @return [WhileNode] a new instance of WhileNode # - # source://prism//prism/node.rb#16896 - def initialize(flags, keyword_loc, closing_loc, predicate, statements, location); end + # source://prism//lib/prism/node.rb#18789 + def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#16906 + # source://prism//lib/prism/node.rb#18801 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#16953 + # source://prism//lib/prism/node.rb#18878 + sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16915 + # source://prism//lib/prism/node.rb#18810 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//prism/node.rb#16963 + # source://prism//lib/prism/node.rb#18888 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//prism/node.rb#16887 + # source://prism//lib/prism/node.rb#18859 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#16928 + # source://prism//lib/prism/node.rb#18823 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#16920 + # source://prism//lib/prism/node.rb#18815 def compact_child_nodes; end # def copy: (**params) -> WhileNode # - # source://prism//prism/node.rb#16933 + # source://prism//lib/prism/node.rb#18828 + sig { params(params: T.untyped).returns(Prism::WhileNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#16915 + # source://prism//lib/prism/node.rb#18810 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location } # - # source://prism//prism/node.rb#16948 + # source://prism//lib/prism/node.rb#18844 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#16968 + # source://prism//lib/prism/node.rb#18893 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#16958 + # source://prism//lib/prism/node.rb#18883 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#16884 + # source://prism//lib/prism/node.rb#18853 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader predicate: Node # - # source://prism//prism/node.rb#16890 + # source://prism//lib/prism/node.rb#18871 + sig { returns(Prism::Node) } def predicate; end - # source://prism//prism/node.rb#16910 + # source://prism//lib/prism/node.rb#18805 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//prism/node.rb#16893 + # source://prism//lib/prism/node.rb#18874 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -24914,14 +30715,15 @@ class Prism::WhileNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#16999 + # source://prism//lib/prism/node.rb#18924 def type; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#16881 + # source://prism//lib/prism/node.rb#18849 + sig { returns(Integer) } def flags; end class << self @@ -24932,7 +30734,7 @@ class Prism::WhileNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#17009 + # source://prism//lib/prism/node.rb#18934 def type; end end end @@ -24941,99 +30743,118 @@ end # # `foo` # ^^^^^ +# +# source://prism//lib/prism/node.rb#18943 class Prism::XStringNode < ::Prism::Node include ::Prism::HeredocQuery - # def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void # # @return [XStringNode] a new instance of XStringNode # - # source://prism//prism/node.rb#17035 - def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism//lib/prism/node.rb#18945 + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#17045 + # source://prism//lib/prism/node.rb#18957 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#17050 + # source://prism//lib/prism/node.rb#18962 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//prism/node.rb#17105 + # source://prism//lib/prism/node.rb#19044 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//prism/node.rb#17029 + # source://prism//lib/prism/node.rb#19014 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#17060 + # source://prism//lib/prism/node.rb#18972 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#17055 + # source://prism//lib/prism/node.rb#18967 def compact_child_nodes; end # def content: () -> String # - # source://prism//prism/node.rb#17100 + # source://prism//lib/prism/node.rb#19039 + sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//prism/node.rb#17026 + # source://prism//lib/prism/node.rb#19008 + sig { returns(Prism::Location) } def content_loc; end # def copy: (**params) -> XStringNode # - # source://prism//prism/node.rb#17065 + # source://prism//lib/prism/node.rb#18977 + sig { params(params: T.untyped).returns(Prism::XStringNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#17050 + # source://prism//lib/prism/node.rb#18962 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism//prism/node.rb#17080 + # source://prism//lib/prism/node.rb#18993 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#17090 + # source://prism//lib/prism/node.rb#19029 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//prism/node.rb#17085 + # source://prism//lib/prism/node.rb#19024 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#17110 + # source://prism//lib/prism/node.rb#19049 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//prism/node.rb#17095 + # source://prism//lib/prism/node.rb#19034 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//prism/node.rb#17023 + # source://prism//lib/prism/node.rb#19002 + sig { returns(Prism::Location) } def opening_loc; end # Sometimes you want to check an instance of a node against a list of @@ -25051,19 +30872,21 @@ class Prism::XStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#17135 + # source://prism//lib/prism/node.rb#19074 def type; end # attr_reader unescaped: String # - # source://prism//prism/node.rb#17032 + # source://prism//lib/prism/node.rb#19020 + sig { returns(String) } def unescaped; end private - # Returns the value of attribute flags. + # private attr_reader flags: Integer # - # source://prism//prism/node.rb#17020 + # source://prism//lib/prism/node.rb#18998 + sig { returns(Integer) } def flags; end class << self @@ -25074,7 +30897,7 @@ class Prism::XStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#17145 + # source://prism//lib/prism/node.rb#19084 def type; end end end @@ -25083,88 +30906,106 @@ end # # yield 1 # ^^^^^^^ +# +# source://prism//lib/prism/node.rb#19093 class Prism::YieldNode < ::Prism::Node - # def initialize: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location) -> void + # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void # # @return [YieldNode] a new instance of YieldNode # - # source://prism//prism/node.rb#17168 - def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, location); end + # source://prism//lib/prism/node.rb#19095 + def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, location); end - # def accept: (visitor: Visitor) -> void + # def accept: (Visitor visitor) -> void # - # source://prism//prism/node.rb#17177 + # source://prism//lib/prism/node.rb#19106 + sig { params(visitor: Prism::Visitor).void } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//prism/node.rb#17162 + # source://prism//lib/prism/node.rb#19166 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//prism/node.rb#17182 + # source://prism//lib/prism/node.rb#19111 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//prism/node.rb#17194 + # source://prism//lib/prism/node.rb#19123 def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//prism/node.rb#17187 + # source://prism//lib/prism/node.rb#19116 def compact_child_nodes; end # def copy: (**params) -> YieldNode # - # source://prism//prism/node.rb#17199 + # source://prism//lib/prism/node.rb#19128 + sig { params(params: T.untyped).returns(Prism::YieldNode) } def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//prism/node.rb#17182 + # source://prism//lib/prism/node.rb#19111 + sig { returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location } # - # source://prism//prism/node.rb#17213 + # source://prism//lib/prism/node.rb#19143 + sig do + params( + keys: T::Array[Symbol] + ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + end def deconstruct_keys(keys); end - # def inspect(inspector: NodeInspector) -> String + # def inspect(NodeInspector inspector) -> String # - # source://prism//prism/node.rb#17233 + # source://prism//lib/prism/node.rb#19197 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//prism/node.rb#17218 + # source://prism//lib/prism/node.rb#19182 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//prism/node.rb#17156 + # source://prism//lib/prism/node.rb#19148 + sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism//prism/node.rb#17223 + # source://prism//lib/prism/node.rb#19187 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//prism/node.rb#17159 + # source://prism//lib/prism/node.rb#19154 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism//prism/node.rb#17228 + # source://prism//lib/prism/node.rb#19192 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//prism/node.rb#17165 + # source://prism//lib/prism/node.rb#19169 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -25182,7 +31023,7 @@ class Prism::YieldNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//prism/node.rb#17261 + # source://prism//lib/prism/node.rb#19225 def type; end class << self @@ -25193,7 +31034,7 @@ class Prism::YieldNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//prism/node.rb#17271 + # source://prism//lib/prism/node.rb#19235 def type; end end end diff --git a/sorbet/rbi/gems/rbi@0.1.6.rbi b/sorbet/rbi/gems/rbi@0.1.9.rbi similarity index 96% rename from sorbet/rbi/gems/rbi@0.1.6.rbi rename to sorbet/rbi/gems/rbi@0.1.9.rbi index 5a4efdf..2dc7699 100644 --- a/sorbet/rbi/gems/rbi@0.1.6.rbi +++ b/sorbet/rbi/gems/rbi@0.1.9.rbi @@ -1157,6 +1157,10 @@ class RBI::Node sig { params(node: ::RBI::Node).void } def replace(node); end + # source://rbi//lib/rbi/rewriters/filter_versions.rb#94 + sig { params(version: ::Gem::Version).returns(T::Boolean) } + def satisfies_version?(version); end + # source://rbi//lib/rbi/printer.rb#162 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end @@ -1192,6 +1196,10 @@ class RBI::NodeWithComments < ::RBI::Node # source://rbi//lib/rbi/printer.rb#188 sig { override.returns(T::Boolean) } def oneline?; end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#104 + sig { returns(T::Array[::Gem::Requirement]) } + def version_requirements; end end # source://rbi//lib/rbi/model.rb#601 @@ -1736,6 +1744,78 @@ class RBI::Rewriters::Deannotate < ::RBI::Visitor def deannotate_node(node); end end +# Take a gem version and filter out all RBI that is not relevant to that version based on @version annotations +# in comments. As an example: +# +# ~~~rb +# tree = Parser.parse_string(<<~RBI) +# class Foo +# # @version > 0.3.0 +# def bar +# end +# +# # @version <= 0.3.0 +# def bar(arg1) +# end +# end +# RBI +# +# Rewriters::FilterVersions.filter(tree, Gem::Version.new("0.3.1")) +# +# assert_equal(<<~RBI, tree.string) +# class Foo +# # @version > 0.3.0 +# def bar +# end +# end +# RBI +# ~~~ +# +# Supported operators: +# - equals `=` +# - not equals `!=` +# - greater than `>` +# - greater than or equal to `>=` +# - less than `<` +# - less than or equal to `<=` +# - pessimistic or twiddle-wakka`~>` +# +# And/or logic: +# - "And" logic: put multiple versions on the same line +# - e.g. `@version > 0.3.0, <1.0.0` means version must be greater than 0.3.0 AND less than 1.0.0 +# - "Or" logic: put multiple versions on subsequent lines +# - e.g. the following means version must be less than 0.3.0 OR greater than 1.0.0 +# ``` +# # @version < 0.3.0 +# # @version > 1.0.0 +# ``` +# Prerelease versions: +# - Prerelease versions are considered less than their non-prerelease counterparts +# - e.g. `0.4.0-prerelease` is less than `0.4.0` +# +# RBI with no versions: +# - RBI with no version annotations are automatically counted towards ALL versions +# +# source://rbi//lib/rbi/rewriters/filter_versions.rb#57 +class RBI::Rewriters::FilterVersions < ::RBI::Visitor + # source://rbi//lib/rbi/rewriters/filter_versions.rb#73 + sig { params(version: ::Gem::Version).void } + def initialize(version); end + + # source://rbi//lib/rbi/rewriters/filter_versions.rb#79 + sig { override.params(node: T.nilable(::RBI::Node)).void } + def visit(node); end + + class << self + # source://rbi//lib/rbi/rewriters/filter_versions.rb#66 + sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void } + def filter(tree, version); end + end +end + +# source://rbi//lib/rbi/rewriters/filter_versions.rb#60 +RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) + # source://rbi//lib/rbi/rewriters/group_nodes.rb#6 class RBI::Rewriters::GroupNodes < ::RBI::Visitor # source://rbi//lib/rbi/rewriters/group_nodes.rb#10 @@ -1820,7 +1900,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2037,7 +2117,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2670,7 +2750,7 @@ class RBI::Tree < ::RBI::NodeWithComments sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#38 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#38 sig do params( name: ::String, @@ -2680,19 +2760,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#45 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#45 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#55 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#55 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#50 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#50 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#89 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#89 sig do params( name: ::String, @@ -2705,19 +2785,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#60 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#60 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#25 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#25 sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_module(name, &block); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#9 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#9 sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_path(constant, &block); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#74 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#74 sig do params( name: ::String, @@ -2738,6 +2818,10 @@ class RBI::Tree < ::RBI::NodeWithComments sig { returns(T::Boolean) } def empty?; end + # source://rbi//lib/rbi/rewriters/filter_versions.rb#118 + sig { params(version: ::Gem::Version).void } + def filter_versions!(version); end + # source://rbi//lib/rbi/rewriters/group_nodes.rb#38 sig { void } def group_nodes!; end @@ -2779,11 +2863,11 @@ class RBI::Tree < ::RBI::NodeWithComments private - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#116 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#116 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca/0.11.17/lib/tapioca/rbi_ext/model.rb#111 + # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#111 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.7.6.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.7.7.rbi similarity index 100% rename from sorbet/rbi/gems/rubocop-sorbet@0.7.6.rbi rename to sorbet/rbi/gems/rubocop-sorbet@0.7.7.rbi diff --git a/sorbet/rbi/gems/rubocop@1.59.0.rbi b/sorbet/rbi/gems/rubocop@1.60.2.rbi similarity index 98% rename from sorbet/rbi/gems/rubocop@1.59.0.rbi rename to sorbet/rbi/gems/rubocop@1.60.2.rbi index 49a39e5..ed45e7f 100644 --- a/sorbet/rbi/gems/rubocop@1.59.0.rbi +++ b/sorbet/rbi/gems/rubocop@1.60.2.rbi @@ -749,7 +749,7 @@ class RuboCop::CommentConfig # @return [CommentConfig] a new instance of CommentConfig # - # source://standard/1.33.0/lib/standard/rubocop/ext.rb#20 + # source://standard/1.34.0/lib/standard/rubocop/ext.rb#20 def initialize(processed_source); end # @return [Boolean] @@ -949,7 +949,7 @@ end # during a run of the rubocop program, if files in several # directories are inspected. # -# source://rubocop//lib/rubocop/config.rb#14 +# source://rubocop//lib/rubocop/config.rb#12 class RuboCop::Config include ::RuboCop::PathUtil include ::RuboCop::FileFinder @@ -957,7 +957,7 @@ class RuboCop::Config # @return [Config] a new instance of Config # - # source://rubocop//lib/rubocop/config.rb#32 + # source://rubocop//lib/rubocop/config.rb#30 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end # source://forwardable/1.3.3/forwardable.rb#231 @@ -968,15 +968,15 @@ class RuboCop::Config # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#172 + # source://rubocop//lib/rubocop/config.rb#170 def active_support_extensions_enabled?; end - # source://rubocop//lib/rubocop/config.rb#98 + # source://rubocop//lib/rubocop/config.rb#96 def add_excludes_from_higher_level(highest_config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#195 + # source://rubocop//lib/rubocop/config.rb#193 def allowed_camel_case_file?(file); end # Paths specified in configuration files starting with .rubocop are @@ -985,25 +985,25 @@ class RuboCop::Config # config/default.yml, for example, are not relative to RuboCop's config # directory since that wouldn't work. # - # source://rubocop//lib/rubocop/config.rb#239 + # source://rubocop//lib/rubocop/config.rb#237 def base_dir_for_path_parameters; end - # source://rubocop//lib/rubocop/config.rb#264 + # source://rubocop//lib/rubocop/config.rb#262 def bundler_lock_file_path; end - # source://rubocop//lib/rubocop/config.rb#53 + # source://rubocop//lib/rubocop/config.rb#51 def check; end # @api private # @return [Boolean] whether config for this badge has 'Include' or 'Exclude' keys # - # source://rubocop//lib/rubocop/config.rb#144 + # source://rubocop//lib/rubocop/config.rb#142 def clusivity_config_for_badge?(badge); end # source://forwardable/1.3.3/forwardable.rb#231 def delete(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#110 + # source://rubocop//lib/rubocop/config.rb#108 def deprecation_check; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1011,7 +1011,7 @@ class RuboCop::Config # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#164 + # source://rubocop//lib/rubocop/config.rb#162 def disabled_new_cops?; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1022,7 +1022,7 @@ class RuboCop::Config # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#168 + # source://rubocop//lib/rubocop/config.rb#166 def enabled_new_cops?; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1030,22 +1030,22 @@ class RuboCop::Config # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#217 + # source://rubocop//lib/rubocop/config.rb#215 def file_to_exclude?(file); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#176 + # source://rubocop//lib/rubocop/config.rb#174 def file_to_include?(file); end - # source://rubocop//lib/rubocop/config.rb#160 + # source://rubocop//lib/rubocop/config.rb#158 def for_all_cops; end # Note: the 'Enabled' attribute is same as that returned by `for_cop` # # @return [Config] for the given cop merged with that of its department (if any) # - # source://rubocop//lib/rubocop/config.rb#130 + # source://rubocop//lib/rubocop/config.rb#128 def for_badge(badge); end # Note: the 'Enabled' attribute is calculated according to the department's @@ -1053,7 +1053,7 @@ class RuboCop::Config # # @return [Config] for the given cop / cop name. # - # source://rubocop//lib/rubocop/config.rb#124 + # source://rubocop//lib/rubocop/config.rb#122 def for_cop(cop); end # Note: the 'Enabled' attribute will be present only if specified @@ -1061,17 +1061,17 @@ class RuboCop::Config # # @return [Config] for the given department name. # - # source://rubocop//lib/rubocop/config.rb#155 + # source://rubocop//lib/rubocop/config.rb#153 def for_department(department_name); end - # source://rubocop//lib/rubocop/config.rb#287 + # source://rubocop//lib/rubocop/config.rb#285 def inspect; end # True if this is a config file that is shipped with RuboCop # # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#78 + # source://rubocop//lib/rubocop/config.rb#76 def internal?; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1080,15 +1080,15 @@ class RuboCop::Config # source://forwardable/1.3.3/forwardable.rb#231 def keys(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#49 + # source://rubocop//lib/rubocop/config.rb#47 def loaded_features; end # Returns the value of attribute loaded_path. # - # source://rubocop//lib/rubocop/config.rb#22 + # source://rubocop//lib/rubocop/config.rb#20 def loaded_path; end - # source://rubocop//lib/rubocop/config.rb#83 + # source://rubocop//lib/rubocop/config.rb#81 def make_excludes_absolute; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1097,16 +1097,16 @@ class RuboCop::Config # source://forwardable/1.3.3/forwardable.rb#231 def merge(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#230 + # source://rubocop//lib/rubocop/config.rb#228 def path_relative_to_config(path); end - # source://rubocop//lib/rubocop/config.rb#226 + # source://rubocop//lib/rubocop/config.rb#224 def patterns_to_exclude; end - # source://rubocop//lib/rubocop/config.rb#222 + # source://rubocop//lib/rubocop/config.rb#220 def patterns_to_include; end - # source://rubocop//lib/rubocop/config.rb#275 + # source://rubocop//lib/rubocop/config.rb#273 def pending_cops; end # Returns true if there's a chance that an Include pattern matches hidden @@ -1114,19 +1114,19 @@ class RuboCop::Config # # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#209 + # source://rubocop//lib/rubocop/config.rb#207 def possibly_include_hidden?; end # source://forwardable/1.3.3/forwardable.rb#231 def replace(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#73 + # source://rubocop//lib/rubocop/config.rb#71 def signature; end - # source://rubocop//lib/rubocop/config.rb#260 + # source://rubocop//lib/rubocop/config.rb#258 def smart_loaded_path; end - # source://rubocop//lib/rubocop/config.rb#249 + # source://rubocop//lib/rubocop/config.rb#247 def target_rails_version; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1138,7 +1138,7 @@ class RuboCop::Config # source://forwardable/1.3.3/forwardable.rb#231 def to_hash(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#69 + # source://rubocop//lib/rubocop/config.rb#67 def to_s; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -1147,32 +1147,32 @@ class RuboCop::Config # source://forwardable/1.3.3/forwardable.rb#231 def validate(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config.rb#60 + # source://rubocop//lib/rubocop/config.rb#58 def validate_after_resolution; end private - # source://rubocop//lib/rubocop/config.rb#322 + # source://rubocop//lib/rubocop/config.rb#320 def department_of(qualified_cop_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#310 + # source://rubocop//lib/rubocop/config.rb#308 def enable_cop?(qualified_cop_name, cop_options); end - # source://rubocop//lib/rubocop/config.rb#297 + # source://rubocop//lib/rubocop/config.rb#295 def read_rails_version_from_bundler_lock_file; end - # source://rubocop//lib/rubocop/config.rb#293 + # source://rubocop//lib/rubocop/config.rb#291 def target_rails_version_from_bundler_lock_file; end class << self - # source://rubocop//lib/rubocop/config.rb#24 + # source://rubocop//lib/rubocop/config.rb#22 def create(hash, path, check: T.unsafe(nil)); end end end -# source://rubocop//lib/rubocop/config.rb#19 +# source://rubocop//lib/rubocop/config.rb#17 class RuboCop::Config::CopConfig < ::Struct # Returns the value of attribute metadata # @@ -1205,7 +1205,7 @@ class RuboCop::Config::CopConfig < ::Struct end end -# source://rubocop//lib/rubocop/config.rb#21 +# source://rubocop//lib/rubocop/config.rb#19 RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) # This class has methods related to finding configuration path. @@ -1290,12 +1290,12 @@ RuboCop::ConfigFinder::XDG_CONFIG = T.let(T.unsafe(nil), String) # during a run of the rubocop program, if files in several # directories are inspected. # -# source://rubocop//lib/rubocop/config_loader.rb#18 +# source://rubocop//lib/rubocop/config_loader.rb#17 class RuboCop::ConfigLoader extend ::RuboCop::FileFinder class << self - # source://rubocop//lib/rubocop/config_loader.rb#138 + # source://rubocop//lib/rubocop/config_loader.rb#137 def add_excludes_from_files(config, config_file); end # Used to add features that were required inside a config or from @@ -1303,13 +1303,13 @@ class RuboCop::ConfigLoader # # @api private # - # source://rubocop//lib/rubocop/config_loader.rb#199 + # source://rubocop//lib/rubocop/config_loader.rb#198 def add_loaded_features(loaded_features); end - # source://rubocop//lib/rubocop/config_loader.rb#81 + # source://rubocop//lib/rubocop/config_loader.rb#80 def add_missing_namespaces(path, hash); end - # source://rubocop//lib/rubocop/config_loader.rb#42 + # source://rubocop//lib/rubocop/config_loader.rb#41 def clear_options; end # Returns the path of .rubocop.yml searching upwards in the @@ -1318,128 +1318,128 @@ class RuboCop::ConfigLoader # user's home directory is checked. If there's no .rubocop.yml # there either, the path to the default file is returned. # - # source://rubocop//lib/rubocop/config_loader.rb#105 + # source://rubocop//lib/rubocop/config_loader.rb#104 def configuration_file_for(target_dir); end - # source://rubocop//lib/rubocop/config_loader.rb#109 + # source://rubocop//lib/rubocop/config_loader.rb#108 def configuration_from_file(config_file, check: T.unsafe(nil)); end # Returns the value of attribute debug. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def debug; end # Sets the attribute debug # # @param value the value to set the attribute debug to. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def debug=(_arg0); end # Returns the value of attribute debug. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def debug?; end - # source://rubocop//lib/rubocop/config_loader.rb#148 + # source://rubocop//lib/rubocop/config_loader.rb#147 def default_configuration; end # Sets the attribute default_configuration # # @param value the value to set the attribute default_configuration to. # - # source://rubocop//lib/rubocop/config_loader.rb#36 + # source://rubocop//lib/rubocop/config_loader.rb#35 def default_configuration=(_arg0); end # Returns the value of attribute disable_pending_cops. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def disable_pending_cops; end # Sets the attribute disable_pending_cops # # @param value the value to set the attribute disable_pending_cops to. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def disable_pending_cops=(_arg0); end # Returns the value of attribute enable_pending_cops. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def enable_pending_cops; end # Sets the attribute enable_pending_cops # # @param value the value to set the attribute enable_pending_cops to. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def enable_pending_cops=(_arg0); end # Returns the value of attribute ignore_parent_exclusion. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def ignore_parent_exclusion; end # Sets the attribute ignore_parent_exclusion # # @param value the value to set the attribute ignore_parent_exclusion to. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def ignore_parent_exclusion=(_arg0); end # Returns the value of attribute ignore_parent_exclusion. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def ignore_parent_exclusion?; end # Returns the value of attribute ignore_unrecognized_cops. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def ignore_unrecognized_cops; end # Sets the attribute ignore_unrecognized_cops # # @param value the value to set the attribute ignore_unrecognized_cops to. # - # source://rubocop//lib/rubocop/config_loader.rb#34 + # source://rubocop//lib/rubocop/config_loader.rb#33 def ignore_unrecognized_cops=(_arg0); end # @api private # - # source://rubocop//lib/rubocop/config_loader.rb#156 + # source://rubocop//lib/rubocop/config_loader.rb#155 def inject_defaults!(project_root); end - # source://rubocop//lib/rubocop/config_loader.rb#48 + # source://rubocop//lib/rubocop/config_loader.rb#47 def load_file(file, check: T.unsafe(nil)); end # @raise [TypeError] # - # source://rubocop//lib/rubocop/config_loader.rb#68 + # source://rubocop//lib/rubocop/config_loader.rb#67 def load_yaml_configuration(absolute_path); end # Returns the value of attribute loaded_features. # - # source://rubocop//lib/rubocop/config_loader.rb#37 + # source://rubocop//lib/rubocop/config_loader.rb#36 def loaded_features; end # Return a recursive merge of two hashes. That is, a normal hash merge, # with the addition that any value that is a hash, and occurs in both # arguments, will also be merged. And so on. # - # source://rubocop//lib/rubocop/config_loader.rb#96 + # source://rubocop//lib/rubocop/config_loader.rb#95 def merge(base_hash, derived_hash); end # Merges the given configuration with the default one. # - # source://rubocop//lib/rubocop/config_loader.rb#192 + # source://rubocop//lib/rubocop/config_loader.rb#191 def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end - # source://rubocop//lib/rubocop/config_loader.rb#129 + # source://rubocop//lib/rubocop/config_loader.rb#128 def pending_cops_only_qualified(pending_cops); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader.rb#133 + # source://rubocop//lib/rubocop/config_loader.rb#132 def possible_new_cops?(config); end # Returns the path RuboCop inferred as the root of the project. No file @@ -1447,48 +1447,48 @@ class RuboCop::ConfigLoader # # @deprecated Use `RuboCop::ConfigFinder.project_root` instead. # - # source://rubocop//lib/rubocop/config_loader.rb#167 + # source://rubocop//lib/rubocop/config_loader.rb#166 def project_root; end - # source://rubocop//lib/rubocop/config_loader.rb#176 + # source://rubocop//lib/rubocop/config_loader.rb#175 def warn_on_pending_cops(pending_cops); end - # source://rubocop//lib/rubocop/config_loader.rb#184 + # source://rubocop//lib/rubocop/config_loader.rb#183 def warn_pending_cop(cop); end private - # source://rubocop//lib/rubocop/config_loader.rb#213 + # source://rubocop//lib/rubocop/config_loader.rb#212 def check_duplication(yaml_code, absolute_path); end - # source://rubocop//lib/rubocop/config_loader.rb#205 + # source://rubocop//lib/rubocop/config_loader.rb#204 def file_path(file); end # Read the specified file, or exit with a friendly, concise message on # stderr. Care is taken to use the standard OS exit code for a "file not # found" error. # - # source://rubocop//lib/rubocop/config_loader.rb#233 + # source://rubocop//lib/rubocop/config_loader.rb#232 def read_file(absolute_path); end - # source://rubocop//lib/rubocop/config_loader.rb#209 + # source://rubocop//lib/rubocop/config_loader.rb#208 def resolver; end - # source://rubocop//lib/rubocop/config_loader.rb#239 + # source://rubocop//lib/rubocop/config_loader.rb#238 def yaml_safe_load(yaml_code, filename); end - # source://rubocop//lib/rubocop/config_loader.rb#249 + # source://rubocop//lib/rubocop/config_loader.rb#248 def yaml_safe_load!(yaml_code, filename); end end end -# source://rubocop//lib/rubocop/config_loader.rb#21 +# source://rubocop//lib/rubocop/config_loader.rb#20 RuboCop::ConfigLoader::DEFAULT_FILE = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/config_loader.rb#19 +# source://rubocop//lib/rubocop/config_loader.rb#18 RuboCop::ConfigLoader::DOTFILE = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/config_loader.rb#20 +# source://rubocop//lib/rubocop/config_loader.rb#19 RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String) # A help class for ConfigLoader that handles configuration resolution. @@ -1641,7 +1641,7 @@ end # Raised when a RuboCop configuration file is not found. # -# source://rubocop//lib/rubocop/config_loader.rb#10 +# source://rubocop//lib/rubocop/config_loader.rb#9 class RuboCop::ConfigNotFoundError < ::RuboCop::Error; end # This class handles obsolete configuration. @@ -2210,13 +2210,13 @@ end # Handles validation of configuration, for example cop names, parameter # names, and Ruby versions. # -# source://rubocop//lib/rubocop/config_validator.rb#8 +# source://rubocop//lib/rubocop/config_validator.rb#6 class RuboCop::ConfigValidator extend ::Forwardable # @return [ConfigValidator] a new instance of ConfigValidator # - # source://rubocop//lib/rubocop/config_validator.rb#27 + # source://rubocop//lib/rubocop/config_validator.rb#25 def initialize(config); end # source://forwardable/1.3.3/forwardable.rb#231 @@ -2225,10 +2225,10 @@ class RuboCop::ConfigValidator # source://forwardable/1.3.3/forwardable.rb#231 def smart_loaded_path(*args, **_arg1, &block); end - # source://rubocop//lib/rubocop/config_validator.rb#63 + # source://rubocop//lib/rubocop/config_validator.rb#61 def target_ruby_version; end - # source://rubocop//lib/rubocop/config_validator.rb#33 + # source://rubocop//lib/rubocop/config_validator.rb#31 def validate; end # Validations that should only be run after all config resolving has @@ -2237,100 +2237,100 @@ class RuboCop::ConfigValidator # chain has been loaded so that only the final value is validated, and # any obsolete but overridden values are ignored. # - # source://rubocop//lib/rubocop/config_validator.rb#59 + # source://rubocop//lib/rubocop/config_validator.rb#57 def validate_after_resolution; end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#67 + # source://rubocop//lib/rubocop/config_validator.rb#65 def validate_section_presence(name); end private # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#104 + # source://rubocop//lib/rubocop/config_validator.rb#102 def alert_about_unrecognized_cops(invalid_cop_names); end - # source://rubocop//lib/rubocop/config_validator.rb#253 + # source://rubocop//lib/rubocop/config_validator.rb#251 def check_cop_config_value(hash, parent = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/config_validator.rb#77 + # source://rubocop//lib/rubocop/config_validator.rb#75 def check_obsoletions; end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#84 + # source://rubocop//lib/rubocop/config_validator.rb#82 def check_target_ruby; end - # source://rubocop//lib/rubocop/config_validator.rb#195 + # source://rubocop//lib/rubocop/config_validator.rb#193 def each_invalid_parameter(cop_name); end - # source://rubocop//lib/rubocop/config_validator.rb#120 + # source://rubocop//lib/rubocop/config_validator.rb#118 def list_unknown_cops(invalid_cop_names); end # FIXME: Handling colors in exception messages like this is ugly. # - # source://rubocop//lib/rubocop/config_validator.rb#266 + # source://rubocop//lib/rubocop/config_validator.rb#264 def msg_not_boolean(parent, key, value); end - # source://rubocop//lib/rubocop/config_validator.rb#242 + # source://rubocop//lib/rubocop/config_validator.rb#240 def reject_conflicting_safe_settings; end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#233 + # source://rubocop//lib/rubocop/config_validator.rb#231 def reject_mutually_exclusive_defaults; end - # source://rubocop//lib/rubocop/config_validator.rb#142 + # source://rubocop//lib/rubocop/config_validator.rb#140 def suggestion(name); end # Returns the value of attribute target_ruby. # - # source://rubocop//lib/rubocop/config_validator.rb#75 + # source://rubocop//lib/rubocop/config_validator.rb#73 def target_ruby; end - # source://rubocop//lib/rubocop/config_validator.rb#207 + # source://rubocop//lib/rubocop/config_validator.rb#205 def validate_enforced_styles(valid_cop_names); end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#169 + # source://rubocop//lib/rubocop/config_validator.rb#167 def validate_new_cops_parameter; end - # source://rubocop//lib/rubocop/config_validator.rb#180 + # source://rubocop//lib/rubocop/config_validator.rb#178 def validate_parameter_names(valid_cop_names); end - # source://rubocop//lib/rubocop/config_validator.rb#227 + # source://rubocop//lib/rubocop/config_validator.rb#225 def validate_support_and_has_list(name, formats, valid); end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#158 + # source://rubocop//lib/rubocop/config_validator.rb#156 def validate_syntax_cop; end end # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#12 +# source://rubocop//lib/rubocop/config_validator.rb#10 RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/config_validator.rb#22 +# source://rubocop//lib/rubocop/config_validator.rb#20 RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#21 +# source://rubocop//lib/rubocop/config_validator.rb#19 RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#14 +# source://rubocop//lib/rubocop/config_validator.rb#12 RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#18 +# source://rubocop//lib/rubocop/config_validator.rb#16 RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/util.rb#4 @@ -3099,6 +3099,14 @@ class RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/base.rb#456 def find_severity(_range, severity); end + # This experimental feature has been under consideration for a while. + # + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#487 + def lsp_mode?; end + # source://rubocop//lib/rubocop/cop/base.rb#477 def range_for_original(range); end @@ -4754,7 +4762,7 @@ module RuboCop::Cop::ConfigurableFormatting # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#29 + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#30 def class_emitter_method?(node, name); end # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#17 @@ -4762,7 +4770,7 @@ module RuboCop::Cop::ConfigurableFormatting # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#23 + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#24 def valid_name?(node, name, given_style = T.unsafe(nil)); end end @@ -5002,7 +5010,7 @@ class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter # Legacy # - # source://parser/3.3.0.4/lib/parser/source/tree_rewriter.rb#252 + # source://parser/3.3.0.5/lib/parser/source/tree_rewriter.rb#252 def rewrite; end # Swaps sources at the given ranges. @@ -10102,54 +10110,54 @@ class RuboCop::Cop::Layout::EndAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::EndKeywordAlignment extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#105 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#109 def on_case(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#105 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#109 def on_case_match(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#81 def on_class(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#93 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#97 def on_if(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#89 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#93 def on_module(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#85 def on_sclass(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#101 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#105 def on_until(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#97 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#101 def on_while(node); end private - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#161 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#165 def alignment_node(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#178 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#182 def alignment_node_for_variable_style(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#142 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#146 def asgn_variable_align_with(outer_node, inner_node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#196 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#200 def assignment_or_operator_method(node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#116 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#120 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#131 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#135 def check_asgn_alignment(outer_node, inner_node); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#120 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#124 def check_assignment(node, rhs); end - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#152 + # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#156 def check_other_alignment(node); end end @@ -10538,7 +10546,10 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin # Checks the indentation of the first element in an array literal # where the opening bracket and the first element are on separate lines. -# The other elements' indentations are handled by the ArrayAlignment cop. +# The other elements' indentations are handled by `Layout/ArrayAlignment` cop. +# +# This cop will respect `Layout/ArrayAlignment` and will not work when +# `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArrayAlignment`. # # By default, array literals that are arguments in a method call with # parentheses, and where the opening square bracket of the array is on the @@ -10611,49 +10622,57 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin # :completely_different # ] # -# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#82 +# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#85 class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineElementIndentation extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#91 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#94 def on_array(node); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#95 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#98 def on_csend(node); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#95 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#98 def on_send(node); end private - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#104 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#189 + def array_alignment_config; end + + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#109 def autocorrect(corrector, node); end # Returns the description of what the correct indentation is based on. # - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#142 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#147 def base_description(indent_base_type); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#108 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#113 def brace_alignment_style; end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#112 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#117 def check(array_node, left_parenthesis); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#126 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#131 def check_right_bracket(right_bracket, first_elem, left_bracket, left_parenthesis); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#155 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#183 + def enforce_first_argument_with_fixed_indentation?; end + + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#160 def message(base_description); end - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#163 + # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#168 def message_for_right_bracket(indent_base_type); end end -# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#88 +# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#91 RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) # Checks for a line break before the first element in a @@ -14094,17 +14113,17 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#121 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#125 def comment_within?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#91 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#95 def configured_to_not_be_inspected?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#115 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#119 def convertible_block?(node); end # @return [Boolean] @@ -14112,7 +14131,12 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#69 def end_with_percent_blank_string?(processed_source); end - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#143 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#91 + def index_access_call_chained?(node); end + + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#147 def max_line_length; end # @return [Boolean] @@ -14122,7 +14146,7 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#98 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#102 def other_cop_takes_precedence?(node); end # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#79 @@ -14130,20 +14154,20 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#104 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#108 def single_line_block_chain_enabled?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#108 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#112 def suitable_as_single_line?(node); end - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#134 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#138 def to_single_line(source); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#129 + # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#133 def too_long?(node); end end @@ -16865,7 +16889,7 @@ class RuboCop::Cop::Lint::AssignmentInCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::SafeAssignment extend ::RuboCop::Cop::AutoCorrector - # source://standard/1.33.0/lib/standard/rubocop/ext.rb#4 + # source://standard/1.34.0/lib/standard/rubocop/ext.rb#4 def message(_); end # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#55 @@ -19998,14 +20022,14 @@ class RuboCop::Cop::Lint::LiteralAssignmentInCondition < ::RuboCop::Cop::Base # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#62 - def forbidden_literal?(node); end + def all_literals?(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#72 + # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#79 def offense_range(asgn_node, rhs); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#68 + # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#75 def parallel_assignment_with_splat_operator?(node); end # @yield [node] @@ -23225,7 +23249,7 @@ class RuboCop::Cop::Lint::ShadowedArgument < ::RuboCop::Cop::Base # Get argument references without assignments' references # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#160 + # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#161 def argument_references(argument); end # Find the first argument assignment, which doesn't reference the @@ -23241,17 +23265,17 @@ class RuboCop::Cop::Lint::ShadowedArgument < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#170 + # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#171 def ignore_implicit_references?; end # Check whether the given node is nested into block or conditional. # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#151 + # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#152 def node_within_block_or_conditional?(node, stop_search_node); end - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#143 + # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#144 def reference_pos(node); end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#95 @@ -23722,13 +23746,13 @@ class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/syntax.rb#19 def add_offense_from_diagnostic(diagnostic, ruby_version); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#26 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#29 def add_offense_from_error(error); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#31 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#34 def beautify_message(message); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#37 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#40 def find_severity(_range, _severity); end end @@ -27426,43 +27450,43 @@ class RuboCop::Cop::Naming::BlockForwarding < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#54 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#55 def on_def(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#54 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#55 def on_defs(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#87 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#95 def anonymous_block_argument?(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#119 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#127 def block_forwarding_name; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#73 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#81 def expected_block_forwarding_style?(node, last_argument); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#91 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#99 def explicit_block_argument?(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#95 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#103 def register_offense(block_argument, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#111 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#119 def use_block_argument_as_local_variable?(node, last_argument); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#83 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#91 def use_kwarg_in_method_definition?(node); end class << self @@ -30085,6 +30109,7 @@ RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr # # bad # open(something) # open("| #{something}") +# open("| foo") # URI.open(something) # # # good @@ -30094,7 +30119,6 @@ RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr # # # good (literal strings) # open("foo.text") -# open("| foo") # URI.open("http://example.com") # # source://rubocop//lib/rubocop/cop/security/open.rb#37 @@ -30921,7 +30945,7 @@ RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) # Names not on this list are likely to be meaningful and are allowed by default. # # @example RedundantBlockArgumentNames: ['blk', 'block', 'proc'] (default) -# # bad +# # bad - But it is good with `EnforcedStyle: explicit` set for `Naming/BlockForwarding`. # def foo(&block) # bar(&block) # end @@ -31010,70 +31034,83 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#134 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#135 def on_def(node); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#134 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#135 def on_defs(node); end private - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#174 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#176 def add_forward_all_offenses(node, send_classifications, forwardable_args); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#295 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#329 def add_parens_if_missing(node, corrector); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#183 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#199 def add_post_ruby_32_offenses(def_node, send_classifications, forwardable_args); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#287 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#321 def allow_only_rest_arguments?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#279 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#313 def arguments_range(node, first_node); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#226 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#242 def classification_and_forwards(def_node, send_node, referenced_lvars, forwardable_args); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#211 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#227 def classify_send_nodes(def_node, send_nodes, referenced_lvars, forwardable_args); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#158 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#473 + def explicit_block_name?; end + + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#159 def extract_forwardable_args(args); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#201 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#217 def non_splat_or_block_pass_lvar_references(body); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#170 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#171 def only_forwards_all?(send_classifications); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#162 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#271 + def outside_block?(node); end + + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#163 def redundant_forwardable_named_args(restarg, kwrestarg, blockarg); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#243 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#261 def redundant_named_arg(arg, config_name, keyword); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#269 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#303 def register_forward_all_offense(def_or_send, send_or_arguments, rest_or_splat); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#253 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#277 def register_forward_args_offense(def_arguments_or_send, rest_arg_or_splat); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#261 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#293 + def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg); end + + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#285 def register_forward_kwargs_offense(add_parens, def_arguments_or_send, kwrest_arg_or_splat); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#291 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#325 def use_anonymous_forwarding?; end class << self - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#130 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#131 def autocorrect_incompatible_with; end end end @@ -31084,6 +31121,9 @@ RuboCop::Cop::Style::ArgumentsForwarding::ADDITIONAL_ARG_TYPES = T.let(T.unsafe( # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#127 RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String) +# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#129 +RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String) + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#123 RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array) @@ -31095,110 +31135,115 @@ RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), Stri # Classifies send nodes for possible rest/kwrest/all (including block) forwarding. # -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#302 +# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#336 class RuboCop::Cop::Style::ArgumentsForwarding::SendNodeClassifier extend ::RuboCop::AST::NodePattern::Macros # @return [SendNodeClassifier] a new instance of SendNodeClassifier # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#314 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#348 def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#342 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#376 def classification; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#309 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#343 def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#336 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#370 def forwarded_block_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#312 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#346 def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#330 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#364 def forwarded_kwrest_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#324 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#358 def forwarded_rest_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#306 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#340 def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#410 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#444 def additional_kwargs?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#406 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#440 def additional_kwargs_or_forwarded_kwargs?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#420 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#454 def allow_offense_for_no_block?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#391 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#425 def any_arg_referenced?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#375 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#409 def arguments; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#354 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#388 def can_forward_all?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#414 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#448 def forward_additional_kwargs?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#371 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#405 def forwarded_rest_and_kwrest_args; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#424 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#467 + def missing_rest_arg_or_kwrest_arg?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#458 def no_additional_args?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#399 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#433 def no_post_splat_args?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#367 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#401 def offensive_block_forwarding?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#387 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#421 def referenced_block_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#383 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#417 def referenced_kwrest_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#379 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#413 def referenced_rest_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#363 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#397 def ruby_32_missing_rest_or_kwest?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#395 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#429 def target_ruby_version; end end @@ -32800,6 +32845,8 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # array.reject { |e| e.nil? } # array.delete_if { |e| e.nil? } # array.select { |e| !e.nil? } +# array.grep_v(nil) +# array.grep_v(NilClass) # # # good # array.compact @@ -32815,52 +32862,55 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # good # params.reject(&:nil?) # -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#42 +# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#44 class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedReceivers include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#82 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#85 + def grep_v_with_nil?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#89 def on_csend(node); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#82 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#89 def on_send(node); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#62 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#64 def reject_method?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#55 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#57 def reject_method_with_block_pass?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#72 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#74 def select_method?(param0 = T.unsafe(nil)); end private - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#120 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#129 def good_method_name(node); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#98 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#106 def offense_range(node); end - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#128 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#137 def range(begin_pos_node, end_pos_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#114 + # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#123 def to_enum_method?(node); end end -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#48 +# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#50 RuboCop::Cop::Style::CollectionCompact::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#49 +# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#51 RuboCop::Cop::Style::CollectionCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#50 +# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#52 RuboCop::Cop::Style::CollectionCompact::TO_ENUM_METHODS = T.let(T.unsafe(nil), Array) # Enforces the use of consistent method names @@ -34847,7 +34897,7 @@ class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#48 + # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#46 def offending?(node); end end @@ -35713,40 +35763,40 @@ class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#195 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#184 def add_offense_for_different_line(node, line_node, line_diff); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#142 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#131 def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#210 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#199 def add_offense_for_missing_line(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#217 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#206 def add_offense_for_missing_location(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#189 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#178 def add_offense_for_same_line(node, line_node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#154 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#143 def check_file(node, file_node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#167 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#156 def check_line(node, code); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#95 def check_location(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#202 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#191 def expected_line(sign, line_diff); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#122 def file_and_line(node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#177 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#166 def line_difference(line_node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#229 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#218 def missing_line(node, code); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#109 @@ -35762,20 +35812,13 @@ class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#118 def special_line_keyword?(node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#181 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#170 def string_first_line(str_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#127 def with_binding?(node); end - - # FIXME: It's a Style/ConditionalAssignment's false positive. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#133 - def with_lineno?(node); end end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#59 @@ -37458,19 +37501,22 @@ class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#50 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#74 + def check_unused_block_args(node, key, value); end + + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#51 def each_arguments(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#45 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#46 def kv_each(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#55 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#56 def kv_each_with_block_pass(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#60 def on_block(node); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#85 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#95 def on_block_pass(node); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#60 @@ -37478,55 +37524,63 @@ class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#159 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#180 def check_argument(variable); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#183 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#204 def correct_args(node, corrector); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#169 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#190 def correct_implicit(node, corrector, method_name); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#174 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#195 def correct_key_value_each(node, corrector); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#155 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#176 def format_message(method_name, current); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#93 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#103 def handleable?(node); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#190 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#211 def kv_range(outer_node); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#122 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#133 def message(prefer, method_name, unused_code); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#128 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#139 def register_each_args_offense(node, message, prefer, unused_range); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#99 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#110 def register_kv_offense(target, method); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#135 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#146 def register_kv_with_block_pass_offense(node, target, method); end - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#146 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#167 def root_receiver(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#110 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#121 def unused_block_arg_exist?(node, block_arg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#165 + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#157 + def use_array_converter_method_as_preceding?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#186 def used?(arg); end end +# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#43 +RuboCop::Cop::Style::HashEachMethods::ARRAY_CONVERTER_METHODS = T.let(T.unsafe(nil), Array) + # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#41 RuboCop::Cop::Style::HashEachMethods::MSG = T.let(T.unsafe(nil), String) @@ -38047,43 +38101,43 @@ class RuboCop::Cop::Style::IdenticalConditionalBranches < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#181 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#184 def assignable_condition_value(node); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#140 def check_branches(node, branches); end - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#190 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#193 def check_expressions(node, expressions, insert_position); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#170 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#173 def duplicated_expressions?(node, expressions); end # `elsif` branches show up in the if node as nested `else` branches. We # need to recursively iterate over all `else` branches. # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#230 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#233 def expand_elses(branch); end - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#245 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#248 def head(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#214 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#217 def last_child_of_parent?(node); end - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#224 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#227 def message(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#220 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#223 def single_child_branch?(branch_node); end - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#241 + # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#244 def tail(node); end end @@ -38915,24 +38969,33 @@ class RuboCop::Cop::Style::InvertibleUnlessCondition < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#91 + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#128 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#104 + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#141 def autocorrect_send_node(corrector, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#85 + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#88 def inheritance_check?(node); end - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#112 + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#149 def inverse_methods; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#70 + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#73 def invertible?(node); end + + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#94 + def preferred_condition(node); end + + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#121 + def preferred_logical_condition(node); end + + # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#102 + def preferred_send_condition(node); end end # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#54 @@ -39593,7 +39656,7 @@ class RuboCop::Cop::Style::MapToHash < ::RuboCop::Cop::Base extend ::RuboCop::Cop::TargetRubyVersion # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#41 - def map_to_h?(param0 = T.unsafe(nil)); end + def map_to_h(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#52 def on_csend(node); end @@ -39603,7 +39666,7 @@ class RuboCop::Cop::Style::MapToHash < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#67 + # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#68 def autocorrect(corrector, to_h, map); end class << self @@ -39858,23 +39921,20 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 def on_send(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 - def on_super(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 def on_yield(node); end private - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#226 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#225 def args_begin(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#235 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#233 def args_end(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#239 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#237 def args_parenthesized?(node); end class << self @@ -39896,12 +39956,12 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#166 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#174 def allowed_chained_call_with_parentheses?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#162 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#170 def allowed_multiline_call_with_parentheses?(node); end # @return [Boolean] @@ -39911,17 +39971,17 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#175 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#183 def ambiguous_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#204 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#212 def assigned_before?(node, target); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#212 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#220 def assignment_in_condition?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#31 @@ -39929,9 +39989,14 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#143 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#151 def call_as_argument_or_chain?(node); end + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#144 + def call_in_argument_with_block?(node); end + # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#100 @@ -39944,7 +40009,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#149 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#157 def call_in_match_pattern?(node); end # @return [Boolean] @@ -39964,22 +40029,22 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#139 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#140 def call_with_braced_block?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#222 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#230 def forwards_anonymous_rest_arguments?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#191 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#199 def hash_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#155 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#163 def hash_literal_in_arguments?(node); end # @return [Boolean] @@ -39989,7 +40054,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#208 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#216 def inside_string_interpolation?(node); end # Require hash value omission be enclosed in parentheses to prevent the following issue: @@ -40007,7 +40072,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#187 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#195 def logical_operator?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#40 @@ -40023,7 +40088,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#195 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#203 def regexp_slash_literal?(node); end # @return [Boolean] @@ -40033,7 +40098,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#179 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#187 def splat?(node); end # @return [Boolean] @@ -40048,12 +40113,12 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#183 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#191 def ternary_if?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#199 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#207 def unary_literal?(node); end end @@ -41226,12 +41291,12 @@ class RuboCop::Cop::Style::MultilineTernaryOperator < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#60 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#84 + # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#82 def comments_in_condition(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#90 + # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#88 def enforce_single_line_ternary_operator?(node); end # @return [Boolean] @@ -41239,12 +41304,12 @@ class RuboCop::Cop::Style::MultilineTernaryOperator < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#56 def offense?(node); end - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#70 + # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#68 def replacement(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#94 + # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#92 def use_assignment_method?(node); end end @@ -43376,7 +43441,7 @@ class RuboCop::Cop::Style::ParallelAssignment::AssignmentSorter def tsort_each_child(assignment); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#145 - def tsort_each_node(&block); end + def tsort_each_node(*_arg0, **_arg1, &_arg2); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#136 def uses_var?(param0, param1); end @@ -43548,20 +43613,20 @@ class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#122 + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#130 def allow_multiline_conditions?; end - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#110 + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#118 def message(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#103 + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#111 def modifier_op?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#116 + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#124 def parens_allowed?(node); end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#80 @@ -43569,7 +43634,12 @@ class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#95 + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#96 + def require_parentheses?(node, condition_body); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#103 def semicolon_separated_expressions?(first_exp, rest_exps); end end @@ -44883,21 +44953,24 @@ RuboCop::Cop::Style::RedundantDoubleSplatHashBraces::MSG = T.let(T.unsafe(nil), class RuboCop::Cop::Style::RedundantEach < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#43 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#43 def on_send(node); end private - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#93 + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#96 def message(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#85 + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#86 def range(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#63 + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#64 def redundant_each_method(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#104 + # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#107 def remove_redundant_each(corrector, range, redundant_node); end end @@ -45545,35 +45618,40 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#168 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#175 def argument_is_method?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#136 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#143 def argument_newline?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#100 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#101 def ends_with_backslash_without_comment?(source_line); end - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#148 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#155 def find_node_for_line(line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#124 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#131 def inside_string_literal?(range, token); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#108 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#109 def inside_string_literal_or_method_with_argument?(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#175 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#117 + def leading_dot_method_chain_with_blank_line?(range); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#182 def method_call_with_arguments?(node); end # A method call without parentheses such as the following cannot remove `\`: @@ -45583,12 +45661,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#132 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#139 def method_with_argument?(current_token, next_token); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#116 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#123 def redundant_line_continuation?(range); end # @return [Boolean] @@ -45598,17 +45676,17 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#154 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#161 def same_line?(node, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#179 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#186 def start_with_arithmetic_operator?(source_line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#104 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#105 def string_concatenation?(source_line); end end @@ -45642,16 +45720,16 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#35 def arg_in_call_with_block?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#253 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#269 def first_send_argument?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#258 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#274 def first_super_argument?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#263 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#279 def first_yield_argument?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#166 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#175 def interpolation?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#26 @@ -45668,6 +45746,11 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#177 + def allow_in_multiline_conditions?; end + # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#68 @@ -45695,39 +45778,39 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#267 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#283 def call_chain_starts_with_int?(begin_node, send_node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#129 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#136 def check(begin_node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#168 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#184 def check_send(begin_node, node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#177 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#193 def check_unary(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#201 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#217 def disallowed_literal?(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#107 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#114 def empty_parentheses?(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#140 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#147 def find_offense_message(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#112 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#119 def first_arg_begins_with_hash_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#242 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#258 def first_argument?(node); end # @return [Boolean] @@ -45737,12 +45820,12 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#197 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#213 def keyword_ancestor?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#216 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#232 def keyword_with_redundant_parentheses?(node); end # @return [Boolean] @@ -45752,18 +45835,23 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#229 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#245 def method_call_with_redundant_parentheses?(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#121 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#128 def method_chain_begins_with_hash_literal(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#187 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#107 + def multiline_control_flow_statements?(node); end + + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#203 def offense(node, msg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#238 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#254 def only_begin_arg?(args); end # @return [Boolean] @@ -45773,12 +45861,12 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#205 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#221 def raised_to_power_negative_numeric?(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#193 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#209 def suspect_unary?(node); end # @return [Boolean] @@ -48346,32 +48434,69 @@ RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#39 RuboCop::Cop::Style::SingleLineMethods::NOT_SUPPORTED_ENDLESS_METHOD_BODY_TYPES = T.let(T.unsafe(nil), Array) -# Checks that arrays are sliced with endless ranges instead of -# `ary[start..-1]` on Ruby 2.6+. +# Checks that arrays are not sliced with the redundant `ary[0..-1]`, replacing it with `ary`, +# and ensures arrays are sliced with endless ranges instead of `ary[start..-1]` on Ruby 2.6+, +# and with beginless ranges instead of `ary[nil..end]` on Ruby 2.7+. # # @example # # bad -# items[1..-1] +# items[0..-1] +# items[0..nil] +# items[0...nil] +# +# # good +# items +# +# # bad +# items[1..-1] # Ruby 2.6+ +# items[1..nil] # Ruby 2.6+ +# +# # good +# items[1..] # Ruby 2.6+ +# +# # bad +# items[nil..42] # Ruby 2.7+ # # # good -# items[1..] +# items[..42] # Ruby 2.7+ +# items[0..42] # Ruby 2.7+ # -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#28 +# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#46 class RuboCop::Cop::Style::SlicingWithRange < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#40 + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#77 def on_send(node); end - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#38 + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#73 + def range_from_zero?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#57 + def range_from_zero_till_minus_one?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#65 def range_till_minus_one?(param0 = T.unsafe(nil)); end + + private + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#111 + def beginless(range_node); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#107 + def endless(range_node); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#93 + def offense_message_with_removal_range(range_node, selector); end end -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#34 +# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#52 RuboCop::Cop::Style::SlicingWithRange::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#35 +# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#53 +RuboCop::Cop::Style::SlicingWithRange::MSG_USELESS_RANGE = T.let(T.unsafe(nil), String) + +# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#54 RuboCop::Cop::Style::SlicingWithRange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # If the branch of a conditional consists solely of a conditional node, @@ -49531,7 +49656,7 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) # # good # something.map(&:upcase) # -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#87 +# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#123 class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base include ::RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::RangeHelp @@ -49541,81 +49666,81 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#136 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#172 def destructuring_block_argument?(argument_node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#116 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152 def on_block(node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#116 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152 def on_numblock(node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#98 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#134 def proc_node?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#104 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#140 def symbol_proc?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#101 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#137 def symbol_proc_receiver?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#204 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#240 def allow_comments?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#200 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#236 def allow_if_method_has_argument?(send_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#151 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#187 def allowed_method_name?(name); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#164 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#200 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#176 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#212 def autocorrect_with_args(corrector, node, args, method_name); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#172 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#208 def autocorrect_without_args(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#190 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#226 def begin_pos_for_replacement(node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#185 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#221 def block_range_with_space(node); end - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#155 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#191 def register_offense(node, method_name, block_method_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#147 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#183 def unsafe_array_usage?(node); end # See: https://github.com/rubocop/rubocop/issues/10864 # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#143 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#179 def unsafe_hash_usage?(node); end class << self - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#111 + # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#147 def autocorrect_incompatible_with; end end end -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#94 +# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#130 RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#95 +# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#131 RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array) # Corrector to correct conditional assignment in ternary conditions. @@ -53780,7 +53905,12 @@ module RuboCop::Ext::RegexpNode private - # source://rubocop//lib/rubocop/ext/regexp_node.rb#68 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/ext/regexp_node.rb#65 + def named_capturing?(exp, event, named); end + + # source://rubocop//lib/rubocop/ext/regexp_node.rb#73 def with_interpolations_blanked; end end @@ -54219,100 +54349,108 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#27 def initialize(output, options = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#39 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#40 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#33 - def file_started(_file, _file_info); end + def file_started(_file, options); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#47 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#48 def finished(_inspected_files); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#68 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#69 def auto_gen_enforced_style?; end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#72 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#73 def command; end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#156 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#161 def cop_config_params(default_cfg, cfg); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#176 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#181 def default_config(cop_name); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#220 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#225 def excludes(offending_files, cop_name, parent); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#191 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#196 def filtered_config(cfg); end + # Returns true if the given arr include the given elm or if any of the + # given arr is a regexp that matches the given elm. + # # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#241 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#273 + def include_or_match?(arr, elm); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#246 def merge_mode_for_exclude?(cfg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#262 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#267 def no_exclude_limit?; end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#101 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#102 def output_cop(cop_name, offense_count); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#128 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#133 def output_cop_comments(output_buffer, cfg, cop_name, offense_count); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#180 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#185 def output_cop_config(output_buffer, cfg, cop_name); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#163 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#168 def output_cop_param_comments(output_buffer, params, default_cfg); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#210 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#215 def output_exclude_list(output_buffer, offending_files, cop_name); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#245 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#250 def output_exclude_path(output_buffer, exclude_path, parent); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#199 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#204 def output_offending_files(output_buffer, cfg, cop_name); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#95 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#96 def output_offenses; end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#258 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#263 def safe_autocorrect?(config); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#115 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#116 def set_max(cfg, cop_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#64 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#65 def show_offense_counts?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#60 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#61 def show_timestamp?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#148 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#153 def supports_safe_autocorrect?(cop_class, default_cfg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#152 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#157 def supports_unsafe_autocorrect?(cop_class, default_cfg); end - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#91 + # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#92 def timestamp; end class << self @@ -54455,33 +54593,33 @@ RuboCop::Formatter::FuubarStyleFormatter::RESET_SEQUENCE = T.let(T.unsafe(nil), # This formatter formats report data as GitHub Workflow commands resulting # in GitHub check annotations when run within GitHub Actions. # -# source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#7 +# source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#7 class RuboCop::Formatter::GitHubActionsFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#14 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#14 def file_finished(file, offenses); end - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#18 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#18 def finished(_inspected_files); end - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#10 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#10 def started(_target_files); end private - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#29 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#29 def github_escape(string); end - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#41 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#41 def github_severity(offense); end - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#33 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#33 def minimum_severity_to_fail; end - # source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#45 + # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#45 def report_offense(file, offense); end end -# source://rubocop//lib/rubocop/formatter/git_hub_actions_formatter.rb#8 +# source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#8 RuboCop::Formatter::GitHubActionsFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) # This formatter saves the output as an html file. @@ -54720,22 +54858,22 @@ RuboCop::Formatter::HTMLFormatter::TEMPLATE_PATH = T.let(T.unsafe(nil), String) # This formatter formats the report data in JSON format. # -# source://rubocop//lib/rubocop/formatter/json_formatter.rb#9 +# source://rubocop//lib/rubocop/formatter/json_formatter.rb#8 class RuboCop::Formatter::JSONFormatter < ::RuboCop::Formatter::BaseFormatter include ::RuboCop::PathUtil # @return [JSONFormatter] a new instance of JSONFormatter # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#14 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#13 def initialize(output, options = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#23 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#22 def file_finished(file, offenses); end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#28 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#27 def finished(inspected_files); end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#43 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#42 def hash_for_file(file, offenses); end # TODO: Consider better solution for Offense#real_column. @@ -54743,21 +54881,21 @@ class RuboCop::Formatter::JSONFormatter < ::RuboCop::Formatter::BaseFormatter # So, the minimum value of `last_column` should be 1. # And non-zero value of `last_column` should be used as is. # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#65 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#64 def hash_for_location(offense); end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#50 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#49 def hash_for_offense(offense); end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#33 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#32 def metadata_hash; end # Returns the value of attribute output_hash. # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#12 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#11 def output_hash; end - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#19 + # source://rubocop//lib/rubocop/formatter/json_formatter.rb#18 def started(target_files); end end @@ -55894,22 +56032,22 @@ RuboCop::Options::E_STDIN_NO_PATH = T.let(T.unsafe(nil), String) # # @api private # -# source://rubocop//lib/rubocop/options.rb#497 +# source://rubocop//lib/rubocop/options.rb#489 module RuboCop::OptionsHelp; end # @api private # -# source://rubocop//lib/rubocop/options.rb#499 +# source://rubocop//lib/rubocop/options.rb#491 RuboCop::OptionsHelp::FORMATTER_OPTION_LIST = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop//lib/rubocop/options.rb#498 +# source://rubocop//lib/rubocop/options.rb#490 RuboCop::OptionsHelp::MAX_EXCL = T.let(T.unsafe(nil), String) # @api private # -# source://rubocop//lib/rubocop/options.rb#501 +# source://rubocop//lib/rubocop/options.rb#493 RuboCop::OptionsHelp::TEXT = T.let(T.unsafe(nil), Hash) # Validates option arguments and the options' compatibility with each other. @@ -55927,57 +56065,51 @@ class RuboCop::OptionsValidator # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/options.rb#471 + # source://rubocop//lib/rubocop/options.rb#463 def boolean_or_empty_cache?; end # @api private # - # source://rubocop//lib/rubocop/options.rb#437 + # source://rubocop//lib/rubocop/options.rb#433 def disable_parallel_when_invalid_option_combo; end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/options.rb#463 - def display_only_fail_level_offenses_with_autocorrect?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/options.rb#467 + # source://rubocop//lib/rubocop/options.rb#459 def except_syntax?; end # @api private # - # source://rubocop//lib/rubocop/options.rb#475 + # source://rubocop//lib/rubocop/options.rb#467 def incompatible_options; end # @api private # - # source://rubocop//lib/rubocop/options.rb#450 + # source://rubocop//lib/rubocop/options.rb#446 def invalid_arguments_for_parallel; end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/options.rb#458 + # source://rubocop//lib/rubocop/options.rb#454 def only_includes_redundant_disable?; end # @api private # - # source://rubocop//lib/rubocop/options.rb#384 + # source://rubocop//lib/rubocop/options.rb#380 def validate_auto_gen_config; end # @api private # @raise [OptionArgumentError] # - # source://rubocop//lib/rubocop/options.rb#423 + # source://rubocop//lib/rubocop/options.rb#419 def validate_autocorrect; end # @api private # @raise [OptionArgumentError] # - # source://rubocop//lib/rubocop/options.rb#487 + # source://rubocop//lib/rubocop/options.rb#479 def validate_cache_enabled_for_cache_root; end # @api private @@ -55994,25 +56126,25 @@ class RuboCop::OptionsValidator # @api private # @raise [OptionArgumentError] # - # source://rubocop//lib/rubocop/options.rb#405 + # source://rubocop//lib/rubocop/options.rb#401 def validate_display_only_correctable_and_autocorrect; end # @api private # @raise [OptionArgumentError] # - # source://rubocop//lib/rubocop/options.rb#397 + # source://rubocop//lib/rubocop/options.rb#393 def validate_display_only_failed; end # @api private # @raise [OptionArgumentError] # - # source://rubocop//lib/rubocop/options.rb#414 + # source://rubocop//lib/rubocop/options.rb#410 def validate_display_only_failed_and_display_only_correctable; end # @api private # @raise [OptionParser::MissingArgument] # - # source://rubocop//lib/rubocop/options.rb#479 + # source://rubocop//lib/rubocop/options.rb#471 def validate_exclude_limit_option; end class << self diff --git a/sorbet/rbi/gems/spoom@1.2.4.rbi b/sorbet/rbi/gems/spoom@1.2.4.rbi index ad1c2db..4268222 100644 --- a/sorbet/rbi/gems/spoom@1.2.4.rbi +++ b/sorbet/rbi/gems/spoom@1.2.4.rbi @@ -958,7 +958,7 @@ class Spoom::Coverage::D3::ColorPalette < ::T::Struct prop :strong, ::String class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -1298,7 +1298,7 @@ class Spoom::Coverage::Snapshot < ::T::Struct sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } def from_obj(obj); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -1450,7 +1450,7 @@ class Spoom::Deadcode::Definition < ::T::Struct def module?; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2343,7 +2343,7 @@ class Spoom::Deadcode::Reference < ::T::Struct def method?; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2593,7 +2593,7 @@ class Spoom::Deadcode::Send < ::T::Struct def each_arg_assoc(&block); end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2613,7 +2613,7 @@ class Spoom::ExecResult < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2821,7 +2821,7 @@ class Spoom::FileTree::Node < ::T::Struct def path; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -2887,7 +2887,7 @@ class Spoom::Git::Commit < ::T::Struct def timestamp; end class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end # Parse a line formated as `%h %at` into a `Commit` @@ -2999,7 +2999,7 @@ class Spoom::LSP::Diagnostic < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3032,7 +3032,7 @@ class Spoom::LSP::DocumentSymbol < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3090,7 +3090,7 @@ class Spoom::LSP::Hover < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3115,7 +3115,7 @@ class Spoom::LSP::Location < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3178,7 +3178,7 @@ class Spoom::LSP::Position < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3216,7 +3216,7 @@ class Spoom::LSP::Range < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -3282,7 +3282,7 @@ class Spoom::LSP::SignatureHelp < ::T::Struct sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } def from_json(json); end - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/sorbet/rbi/gems/standard@1.33.0.rbi b/sorbet/rbi/gems/standard@1.34.0.rbi similarity index 88% rename from sorbet/rbi/gems/standard@1.33.0.rbi rename to sorbet/rbi/gems/standard@1.34.0.rbi index ad076de..2c252ed 100644 --- a/sorbet/rbi/gems/standard@1.33.0.rbi +++ b/sorbet/rbi/gems/standard@1.34.0.rbi @@ -14,25 +14,25 @@ class RuboCop::CommentConfig # source://standard//lib/standard/rubocop/ext.rb#20 def initialize(processed_source); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#63 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#63 def comment_only_line?(line_number); end # source://forwardable/1.3.3/forwardable.rb#231 def config(*args, **_arg1, &block); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#51 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#51 def cop_disabled_line_ranges; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#39 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#39 def cop_enabled_at_line?(cop, line_number); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#47 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#47 def cop_opted_in?(cop); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#55 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#55 def extra_enabled_comments; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#30 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#30 def processed_source; end # source://forwardable/1.3.3/forwardable.rb#231 @@ -40,49 +40,49 @@ class RuboCop::CommentConfig private - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#96 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#96 def analyze; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#124 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#124 def analyze_cop(analysis, directive); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#144 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#144 def analyze_disabled(analysis, directive); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#155 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#155 def analyze_rest(analysis, directive); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#135 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#135 def analyze_single_line(analysis, directive); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#164 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#164 def cop_line_ranges(analysis); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#170 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#170 def each_directive; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#69 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#69 def extra_enabled_comments_with_names(extras:, names:); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#190 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#190 def handle_enable_all(directive, names, extras); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#204 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#204 def handle_switch(directive, names, extras); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#115 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#115 def inject_disabled_cops_directives(analyses); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#183 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#183 def non_comment_token_line_numbers; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#34 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#34 def old_initialize(processed_source); end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#83 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#83 def opt_in_cops; end - # source://rubocop/1.59.0/lib/rubocop/comment_config.rb#179 + # source://rubocop/1.60.2/lib/rubocop/comment_config.rb#179 def qualified_cop_name(cop_name); end end @@ -94,114 +94,114 @@ class RuboCop::Cop::Lint::AssignmentInCondition < ::RuboCop::Cop::Base # source://standard//lib/standard/rubocop/ext.rb#4 def message(_); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#55 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#55 def on_if(node); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#55 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#55 def on_until(node); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#55 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#55 def on_while(node); end private - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#82 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#82 def allowed_construct?(asgn_node); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#86 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#86 def conditional_assignment?(asgn_node); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#90 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#90 def skip_children?(asgn_node); end - # source://rubocop/1.59.0/lib/rubocop/cop/lint/assignment_in_condition.rb#96 + # source://rubocop/1.60.2/lib/rubocop/cop/lint/assignment_in_condition.rb#96 def traverse_node(node, &block); end end # source://standard//lib/standard/rubocop/ext.rb#9 class RuboCop::DirectiveComment - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#30 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#30 def initialize(comment, cop_registry = T.unsafe(nil)); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#80 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#80 def all_cops?; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#28 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#28 def comment; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#85 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#85 def cop_names; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#28 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#28 def cop_registry; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#28 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#28 def cops; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#91 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#91 def department_names; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#105 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#105 def directive_count; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#60 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#60 def disabled?; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#75 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#75 def disabled_all?; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#65 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#65 def enabled?; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#70 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#70 def enabled_all?; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#96 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#96 def in_directive_department?(cop); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#110 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#110 def line_number; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#42 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#42 def match?(cop_names); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#55 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#55 def match_captures; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#28 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#28 def mode; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#101 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#101 def overridden_by_department?(cop); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#46 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#46 def range; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#37 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#37 def single_line?; end private - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#130 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#130 def all_cop_names; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#134 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#134 def cop_names_for_department(department); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#126 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#126 def department?(name); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#140 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#140 def exclude_redundant_directive_cop(cops); end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#120 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#120 def parsed_cop_names; end - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#116 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#116 def splitted_cops_string; end class << self - # source://rubocop/1.59.0/lib/rubocop/directive_comment.rb#24 + # source://rubocop/1.60.2/lib/rubocop/directive_comment.rb#24 def before_comment(line); end end end diff --git a/sorbet/rbi/gems/tapioca@0.11.17.rbi b/sorbet/rbi/gems/tapioca@0.12.0.rbi similarity index 98% rename from sorbet/rbi/gems/tapioca@0.11.17.rbi rename to sorbet/rbi/gems/tapioca@0.12.0.rbi index 4e6ad9d..37d2918 100644 --- a/sorbet/rbi/gems/tapioca@0.11.17.rbi +++ b/sorbet/rbi/gems/tapioca@0.12.0.rbi @@ -54,7 +54,7 @@ module RBI; end # source://tapioca//lib/tapioca/rbi_ext/model.rb#5 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi/0.1.6/lib/rbi/model.rb#119 + # source://rbi/0.1.9/lib/rbi/model.rb#119 sig do params( loc: T.nilable(::RBI::Loc), @@ -64,19 +64,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi/0.1.6/lib/rbi/model.rb#126 + # source://rbi/0.1.9/lib/rbi/model.rb#126 sig { params(node: ::RBI::Node).void } def <<(node); end - # source://rbi/0.1.6/lib/rbi/printer.rb#226 + # source://rbi/0.1.9/lib/rbi/printer.rb#226 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi/0.1.6/lib/rbi/rewriters/add_sig_templates.rb#66 + # source://rbi/0.1.9/lib/rbi/rewriters/add_sig_templates.rb#66 sig { params(with_todo_comment: T::Boolean).void } def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - # source://rbi/0.1.6/lib/rbi/rewriters/annotate.rb#49 + # source://rbi/0.1.9/lib/rbi/rewriters/annotate.rb#49 sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end @@ -140,23 +140,27 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end - # source://rbi/0.1.6/lib/rbi/rewriters/deannotate.rb#41 + # source://rbi/0.1.9/lib/rbi/rewriters/deannotate.rb#41 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # source://rbi/0.1.6/lib/rbi/model.rb#132 + # source://rbi/0.1.9/lib/rbi/model.rb#132 sig { returns(T::Boolean) } def empty?; end - # source://rbi/0.1.6/lib/rbi/rewriters/group_nodes.rb#38 + # source://rbi/0.1.9/lib/rbi/rewriters/filter_versions.rb#118 + sig { params(version: ::Gem::Version).void } + def filter_versions!(version); end + + # source://rbi/0.1.9/lib/rbi/rewriters/group_nodes.rb#38 sig { void } def group_nodes!; end - # source://rbi/0.1.6/lib/rbi/index.rb#68 + # source://rbi/0.1.9/lib/rbi/index.rb#68 sig { returns(::RBI::Index) } def index; end - # source://rbi/0.1.6/lib/rbi/rewriters/merge_trees.rb#324 + # source://rbi/0.1.9/lib/rbi/rewriters/merge_trees.rb#324 sig do params( other: ::RBI::Tree, @@ -167,23 +171,23 @@ class RBI::Tree < ::RBI::NodeWithComments end def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # source://rbi/0.1.6/lib/rbi/rewriters/nest_non_public_methods.rb#46 + # source://rbi/0.1.9/lib/rbi/rewriters/nest_non_public_methods.rb#46 sig { void } def nest_non_public_methods!; end - # source://rbi/0.1.6/lib/rbi/rewriters/nest_singleton_methods.rb#36 + # source://rbi/0.1.9/lib/rbi/rewriters/nest_singleton_methods.rb#36 sig { void } def nest_singleton_methods!; end - # source://rbi/0.1.6/lib/rbi/model.rb#110 + # source://rbi/0.1.9/lib/rbi/model.rb#110 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # source://rbi/0.1.6/lib/rbi/printer.rb#233 + # source://rbi/0.1.9/lib/rbi/printer.rb#233 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi/0.1.6/lib/rbi/rewriters/sort_nodes.rb#119 + # source://rbi/0.1.9/lib/rbi/rewriters/sort_nodes.rb#119 sig { void } def sort_nodes!; end @@ -204,7 +208,7 @@ class RBI::TypedParam < ::T::Struct const :type, ::String class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -1121,7 +1125,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -1132,7 +1136,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :colors, T::Array[::Symbol] class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end @@ -1688,13 +1692,16 @@ end # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#7 class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base + include ::Tapioca::SorbetHelper + include ::Tapioca::RBIHelper + private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#32 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#33 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#13 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -2429,7 +2436,7 @@ class Tapioca::Loaders::Loader # @param engine [T.class_of(Rails::Engine)] # @return [Array] # - # source://sorbet-runtime/0.5.11212/lib/types/private/methods/_methods.rb#252 + # source://sorbet-runtime/0.5.11262/lib/types/private/methods/_methods.rb#257 def eager_load_paths(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/loaders/loader.rb#198 @@ -3337,7 +3344,7 @@ module Tapioca::Static::SymbolLoader # @return [Array] # - # source://sorbet-runtime/0.5.11212/lib/types/private/methods/_methods.rb#252 + # source://sorbet-runtime/0.5.11262/lib/types/private/methods/_methods.rb#257 def engines(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/static/symbol_loader.rb#82 @@ -3454,11 +3461,6 @@ end # source://tapioca//lib/tapioca/version.rb#5 Tapioca::VERSION = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/source_uri.rb#6 -module URI - include ::URI::RFC2396_REGEXP -end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#7 class URI::Source < ::URI::File # source://tapioca//lib/tapioca/helpers/source_uri.rb#58 @@ -3499,5 +3501,3 @@ end # source://tapioca//lib/tapioca/helpers/source_uri.rb#10 URI::Source::COMPONENT = T.let(T.unsafe(nil), Array) - -class URI::WSS < ::URI::WS; end diff --git a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi b/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi index 75a2e4c..8e66c30 100644 --- a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +++ b/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi @@ -381,7 +381,7 @@ class YARDSorbet::TStructProp < ::T::Struct const :types, T::Array[::String] class << self - # source://sorbet-runtime/0.5.11212/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 def inherited(s); end end end diff --git a/test/test_data/failure.out b/test/test_data/failure.out index 4fae552..4bc198b 100644 --- a/test/test_data/failure.out +++ b/test/test_data/failure.out @@ -36,6 +36,6 @@ test/test_data/failure.rb:33: Method `upcase` does not exist on `Integer` https: test/test_data/failure.rb:33: Replace with `phase` 33 | success.payload_or(1).upcase ^^^^^^ - https://github.com/sorbet/sorbet/tree/6440c695688b98f9405bc080c119a2468a6b45ea/rbi/core/integer.rbi#L921: Defined here - 921 | def phase(); end + https://github.com/sorbet/sorbet/tree/fb09bed285d9bb073a4ab129e51d7fcbc8d8c548/rbi/core/integer.rbi#L957: Defined here + 957 | def phase(); end ^^^^^^^^^^^ diff --git a/test/test_data/success.out b/test/test_data/success.out index 208a434..bd72f1b 100644 --- a/test/test_data/success.out +++ b/test/test_data/success.out @@ -36,6 +36,6 @@ test/test_data/success.rb:33: Method `upcase` does not exist on `Integer` compon test/test_data/success.rb:33: Replace with `phase` 33 | success.payload_or(1).upcase ^^^^^^ - https://github.com/sorbet/sorbet/tree/6440c695688b98f9405bc080c119a2468a6b45ea/rbi/core/integer.rbi#L921: Defined here - 921 | def phase(); end + https://github.com/sorbet/sorbet/tree/fb09bed285d9bb073a4ab129e51d7fcbc8d8c548/rbi/core/integer.rbi#L957: Defined here + 957 | def phase(); end ^^^^^^^^^^^