diff --git a/Gemfile.lock b/Gemfile.lock index 43184392c..91d32942a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,11 @@ PATH remote: . specs: - ruby-lsp (0.10.1) + ruby-lsp (0.11.0) language_server-protocol (~> 3.17.0) sorbet-runtime syntax_tree (>= 6.1.1, < 7) - yarp (>= 0.11, < 0.12) + yarp (>= 0.12, < 0.13) GEM remote: https://rubygems.org/ @@ -17,7 +17,6 @@ GEM debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) - diff-lcs (1.5.0) erubi (1.12.0) io-console (0.6.0) irb (1.8.0) @@ -44,11 +43,9 @@ GEM racc (1.7.1) rainbow (3.1.1) rake (13.0.6) - rbi (0.0.17) - ast - parser (>= 3.0.0) + rbi (0.1.1) sorbet-runtime (>= 0.5.9204) - unparser (>= 0.5.6) + yarp (>= 0.11.0) rdoc (6.5.0) psych (>= 4.0.0) regexp_parser (2.8.1) @@ -79,42 +76,38 @@ GEM rubocop (>= 0.90.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - sorbet (0.5.11013) - sorbet-static (= 0.5.11013) - sorbet-runtime (0.5.11013) - sorbet-static (0.5.11013-universal-darwin) - sorbet-static (0.5.11013-x86_64-linux) - sorbet-static-and-runtime (0.5.11013) - sorbet (= 0.5.11013) - sorbet-runtime (= 0.5.11013) - spoom (1.2.2) + sorbet (0.5.11026) + sorbet-static (= 0.5.11026) + sorbet-runtime (0.5.11026) + sorbet-static (0.5.11026-universal-darwin) + sorbet-static (0.5.11026-x86_64-linux) + sorbet-static-and-runtime (0.5.11026) + sorbet (= 0.5.11026) + sorbet-runtime (= 0.5.11026) + spoom (1.2.4) erubi (>= 1.10.0) - sorbet (>= 0.5.10187) - sorbet-runtime (>= 0.5.9204) + sorbet-static-and-runtime (>= 0.5.10187) syntax_tree (>= 6.1.1) thor (>= 0.19.2) stringio (3.0.7) syntax_tree (6.1.1) prettier_print (>= 1.2.0) - tapioca (0.11.8) + tapioca (0.11.9) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (~> 0.0.0, >= 0.0.16) + rbi (~> 0.1.0, >= 0.1.0) sorbet-static-and-runtime (>= 0.5.10187) spoom (~> 1.2.0, >= 1.2.0) thor (>= 1.2.0) yard-sorbet thor (1.2.2) unicode-display_width (2.4.2) - unparser (0.6.8) - diff-lcs (~> 1.3) - parser (>= 3.2.0) yard (0.9.34) yard-sorbet (0.8.1) sorbet-runtime (>= 0.5) yard (>= 0.9) - yarp (0.11.0) + yarp (0.12.0) PLATFORMS arm64-darwin diff --git a/Rakefile b/Rakefile index 21cceda54..238bfa279 100644 --- a/Rakefile +++ b/Rakefile @@ -13,6 +13,7 @@ end RDoc::Task.new do |rdoc| rdoc.main = "README.md" + rdoc.title = "Ruby LSP documentation" rdoc.rdoc_files.include("*.md", "lib/**/*.rb") rdoc.rdoc_dir = "docs" rdoc.markup = "markdown" diff --git a/SERVER_EXTENSIONS.md b/SERVER_EXTENSIONS.md index a99c1f2d5..8f3ff181c 100644 --- a/SERVER_EXTENSIONS.md +++ b/SERVER_EXTENSIONS.md @@ -115,11 +115,13 @@ module RubyLsp sig do override.params( + nesting: T::Array[String], + index: RubyIndexer::Index, emitter: EventEmitter, message_queue: Thread::Queue, ).returns(T.nilable(Listener[T.nilable(Interface::Hover)])) end - def create_hover_listener(emitter, message_queue) + def create_hover_listener(nesting, index emitter, message_queue) # Use the listener factory methods to instantiate listeners with parameters sent by the LSP combined with any # pre-computed information in the extension. These factory methods are invoked on every request Hover.new(@config, emitter, message_queue) @@ -148,18 +150,18 @@ module RubyLsp @_response = T.let(nil, ResponseType) @config = config - # Register that this listener will handle `on_const` events (i.e.: whenever a constant is found in the code) - emitter.register(self, :on_const) + # Register that this listener will handle `on_constant_read` events (i.e.: whenever a constant read is found in the code) + emitter.register(self, :on_constant_read) end # Listeners must define methods for each event they registered with the emitter. In this case, we have to define # `on_const` to specify what this listener should do every time we find a constant - sig { params(node: SyntaxTree::Const).void } - def on_const(node) + sig { params(node: YARP::ConstantReadNode).void } + def on_constant_read(node) # Certain helpers are made available to listeners to build LSP responses. The classes under `RubyLsp::Interface` # are generally used to build responses and they match exactly what the specification requests. contents = RubyLsp::Interface::MarkupContent.new(kind: "markdown", value: "Hello!") - @_response = RubyLsp::Interface::Hover.new(range: range_from_syntax_tree_node(node), contents: contents) + @_response = RubyLsp::Interface::Hover.new(range: range_from_node(node), contents: contents) end end end diff --git a/VERSION b/VERSION index 571215736..d9df1bbc0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.1 +0.11.0 diff --git a/lib/ruby_indexer/lib/ruby_indexer/configuration.rb b/lib/ruby_indexer/lib/ruby_indexer/configuration.rb index 90ebb5fa0..28a085314 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/configuration.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/configuration.rb @@ -18,11 +18,7 @@ class Configuration sig { void } def initialize - excluded_gem_names = Bundler.definition.dependencies.filter_map do |dependency| - dependency.name if dependency.groups == [:development] - end - - @excluded_gems = T.let(excluded_gem_names, T::Array[String]) + @excluded_gems = T.let(initial_excluded_gems, T::Array[String]) @included_gems = T.let([], T::Array[String]) @excluded_patterns = T.let([File.join("**", "*_test.rb")], T::Array[String]) path = Bundler.settings["path"] @@ -174,5 +170,39 @@ def apply_config(config) @included_patterns.concat(config["included_patterns"]) if config["included_patterns"] @excluded_magic_comments.concat(config["excluded_magic_comments"]) if config["excluded_magic_comments"] end + + sig { returns(T::Array[String]) } + def initial_excluded_gems + excluded, others = Bundler.definition.dependencies.partition do |dependency| + dependency.groups == [:development] + end + + # When working on a gem, we need to make sure that its gemspec dependencies can't be excluded. This is necessary + # because Bundler doesn't assign groups to gemspec dependencies + this_gem = Bundler.definition.dependencies.find { |d| d.to_spec.full_gem_path == Dir.pwd } + others.concat(this_gem.to_spec.dependencies) if this_gem + + excluded.each do |dependency| + next unless dependency.runtime? + + dependency.to_spec.dependencies.each do |transitive_dependency| + # If the transitive dependency is included in other groups, skip it + next if others.any? { |d| d.name == transitive_dependency.name } + + # If the transitive dependency is included as a transitive dependency of a gem outside of the development + # group, skip it + next if others.any? { |d| d.to_spec.dependencies.include?(transitive_dependency) } + + excluded << transitive_dependency + end + rescue Gem::MissingSpecError + # If a gem is scoped only to some specific platform, then its dependencies may not be installed either, but they + # are still listed in dependencies. We can't index them because they are not installed for the platform, so we + # just ignore if they're missing + end + + excluded.uniq! + excluded.map(&:name) + end end end diff --git a/lib/ruby_indexer/lib/ruby_indexer/index.rb b/lib/ruby_indexer/lib/ruby_indexer/index.rb index f467b197f..cf26b89a4 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/index.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/index.rb @@ -167,12 +167,16 @@ class Entry sig { returns(T::Array[String]) } attr_reader :comments + sig { returns(Symbol) } + attr_accessor :visibility + sig { params(name: String, file_path: String, location: YARP::Location, comments: T::Array[String]).void } def initialize(name, file_path, location, comments) @name = name @file_path = file_path @location = location @comments = comments + @visibility = T.let(:public, Symbol) end sig { returns(String) } diff --git a/lib/ruby_indexer/lib/ruby_indexer/visitor.rb b/lib/ruby_indexer/lib/ruby_indexer/visitor.rb index 586e99ede..f3e709505 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/visitor.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/visitor.rb @@ -39,6 +39,9 @@ def visit(node) add_constant(node) when YARP::ConstantPathWriteNode, YARP::ConstantPathOrWriteNode add_constant_with_path(node) + when YARP::CallNode + message = node.message + handle_private_constant(node) if message == "private_constant" end end @@ -50,6 +53,31 @@ def visit_all(nodes) private + sig { params(node: YARP::CallNode).void } + def handle_private_constant(node) + arguments = node.arguments&.arguments + return unless arguments + + first_argument = arguments.first + + name = case first_argument + when YARP::StringNode + first_argument.content + when YARP::SymbolNode + first_argument.value + end + + return unless name + + receiver = node.receiver + name = "#{receiver.slice}::#{name}" if receiver + + # The private_constant method does not resolve the constant name. It always points to a constant that needs to + # exist in the current namespace + entries = @index[fully_qualify_name(name)] + entries&.each { |entry| entry.visibility = :private } + end + sig do params( node: T.any(YARP::ConstantWriteNode, YARP::ConstantOrWriteNode), diff --git a/lib/ruby_indexer/test/classes_and_modules_test.rb b/lib/ruby_indexer/test/classes_and_modules_test.rb index e3e3458ba..6079ebb42 100644 --- a/lib/ruby_indexer/test/classes_and_modules_test.rb +++ b/lib/ruby_indexer/test/classes_and_modules_test.rb @@ -216,5 +216,28 @@ class Bar; end second_foo_entry = @index["Bar"][0] assert_equal("This is a Bar comment", second_foo_entry.comments.join("\n")) end + + def test_private_class_and_module_indexing + index(<<~RUBY) + class A + class B; end + private_constant(:B) + + module C; end + private_constant("C") + + class D; end + end + RUBY + + b_const = @index["A::B"].first + assert_equal(:private, b_const.visibility) + + c_const = @index["A::C"].first + assert_equal(:private, c_const.visibility) + + d_const = @index["A::D"].first + assert_equal(:public, d_const.visibility) + end end end diff --git a/lib/ruby_indexer/test/configuration_test.rb b/lib/ruby_indexer/test/configuration_test.rb index f0005f9d6..bcdc36289 100644 --- a/lib/ruby_indexer/test/configuration_test.rb +++ b/lib/ruby_indexer/test/configuration_test.rb @@ -15,6 +15,8 @@ def test_load_configuration_executes_configure_block assert(indexables.none? { |indexable| indexable.full_path.include?("test/fixtures") }) assert(indexables.none? { |indexable| indexable.full_path.include?("minitest-reporters") }) + assert(indexables.none? { |indexable| indexable.full_path.include?("ansi") }) + assert(indexables.any? { |indexable| indexable.full_path.include?("sorbet-runtime") }) assert(indexables.none? { |indexable| indexable.full_path == __FILE__ }) end diff --git a/lib/ruby_indexer/test/constant_test.rb b/lib/ruby_indexer/test/constant_test.rb index 4f40658e9..796a9ca91 100644 --- a/lib/ruby_indexer/test/constant_test.rb +++ b/lib/ruby_indexer/test/constant_test.rb @@ -104,5 +104,82 @@ def test_variable_path_constants_are_ignored assert_no_entry end + + def test_private_constant_indexing + index(<<~RUBY) + class A + B = 1 + private_constant(:B) + + C = 2 + private_constant("C") + + D = 1 + end + RUBY + + b_const = @index["A::B"].first + assert_equal(:private, b_const.visibility) + + c_const = @index["A::C"].first + assert_equal(:private, c_const.visibility) + + d_const = @index["A::D"].first + assert_equal(:public, d_const.visibility) + end + + def test_marking_constants_as_private_reopening_namespaces + index(<<~RUBY) + module A + module B + CONST_A = 1 + private_constant(:CONST_A) + + CONST_B = 2 + CONST_C = 3 + end + + module B + private_constant(:CONST_B) + end + end + + module A + module B + private_constant(:CONST_C) + end + end + RUBY + + a_const = @index["A::B::CONST_A"].first + assert_equal(:private, a_const.visibility) + + b_const = @index["A::B::CONST_B"].first + assert_equal(:private, b_const.visibility) + + c_const = @index["A::B::CONST_C"].first + assert_equal(:private, c_const.visibility) + end + + def test_marking_constants_as_private_with_receiver + index(<<~RUBY) + module A + module B + CONST_A = 1 + CONST_B = 2 + end + + B.private_constant(:CONST_A) + end + + A::B.private_constant(:CONST_B) + RUBY + + a_const = @index["A::B::CONST_A"].first + assert_equal(:private, a_const.visibility) + + b_const = @index["A::B::CONST_B"].first + assert_equal(:private, b_const.visibility) + end end end diff --git a/lib/ruby_lsp/document.rb b/lib/ruby_lsp/document.rb index 064f0b331..4bd9e9120 100644 --- a/lib/ruby_lsp/document.rb +++ b/lib/ruby_lsp/document.rb @@ -9,8 +9,8 @@ class Document RangeShape = T.type_alias { { start: PositionShape, end: PositionShape } } EditShape = T.type_alias { { range: RangeShape, text: String } } - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :tree + sig { returns(YARP::ParseResult) } + attr_reader :parse_result sig { returns(String) } attr_reader :source @@ -29,10 +29,17 @@ def initialize(source:, version:, uri:, encoding: Constant::PositionEncodingKind @version = T.let(version, Integer) @uri = T.let(uri, URI::Generic) @unparsed_edits = T.let([], T::Array[EditShape]) - @syntax_error = T.let(false, T::Boolean) - @tree = T.let(SyntaxTree.parse(@source), T.nilable(SyntaxTree::Node)) - rescue SyntaxTree::Parser::ParseError - @syntax_error = true + @parse_result = T.let(YARP.parse(@source), YARP::ParseResult) + end + + sig { returns(YARP::ProgramNode) } + def tree + @parse_result.value + end + + sig { returns(T::Array[YARP::Comment]) } + def comments + @parse_result.comments end sig { params(other: Document).returns(T::Boolean) } @@ -89,20 +96,12 @@ def parse return if @unparsed_edits.empty? @unparsed_edits.clear - @tree = SyntaxTree.parse(@source) - @syntax_error = false - rescue SyntaxTree::Parser::ParseError - @syntax_error = true + @parse_result = YARP.parse(@source) end sig { returns(T::Boolean) } def syntax_error? - @syntax_error - end - - sig { returns(T::Boolean) } - def parsed? - !@tree.nil? + @parse_result.failure? end sig { returns(Scanner) } @@ -113,27 +112,25 @@ def create_scanner sig do params( position: PositionShape, - node_types: T::Array[T.class_of(SyntaxTree::Node)], - ).returns([T.nilable(SyntaxTree::Node), T.nilable(SyntaxTree::Node), T::Array[String]]) + node_types: T::Array[T.class_of(YARP::Node)], + ).returns([T.nilable(YARP::Node), T.nilable(YARP::Node), T::Array[String]]) end def locate_node(position, node_types: []) - return [nil, nil, []] unless parsed? - - locate(T.must(@tree), create_scanner.find_char_position(position), node_types: node_types) + locate(@parse_result.value, create_scanner.find_char_position(position), node_types: node_types) end sig do params( - node: SyntaxTree::Node, + node: YARP::Node, char_position: Integer, - node_types: T::Array[T.class_of(SyntaxTree::Node)], - ).returns([T.nilable(SyntaxTree::Node), T.nilable(SyntaxTree::Node), T::Array[String]]) + node_types: T::Array[T.class_of(YARP::Node)], + ).returns([T.nilable(YARP::Node), T.nilable(YARP::Node), T::Array[String]]) end def locate(node, char_position, node_types: []) - queue = T.let(node.child_nodes.compact, T::Array[T.nilable(SyntaxTree::Node)]) + queue = T.let(node.child_nodes.compact, T::Array[T.nilable(YARP::Node)]) closest = node - parent = T.let(nil, T.nilable(SyntaxTree::Node)) - nesting = T.let([], T::Array[T.any(SyntaxTree::ClassDeclaration, SyntaxTree::ModuleDeclaration)]) + parent = T.let(nil, T.nilable(YARP::Node)) + nesting = T.let([], T::Array[T.any(YARP::ClassNode, YARP::ModuleNode)]) until queue.empty? candidate = queue.shift @@ -144,24 +141,24 @@ def locate(node, char_position, node_types: []) # Add the next child_nodes to the queue to be processed. The order here is important! We want to move in the # same order as the visiting mechanism, which means searching the child nodes before moving on to the next # sibling - queue.unshift(*candidate.child_nodes) + T.unsafe(queue).unshift(*candidate.child_nodes) # Skip if the current node doesn't cover the desired position loc = candidate.location - next unless (loc.start_char...loc.end_char).cover?(char_position) + next unless (loc.start_offset...loc.end_offset).cover?(char_position) # If the node's start character is already past the position, then we should've found the closest node # already - break if char_position < loc.start_char + break if char_position < loc.start_offset # If the candidate starts after the end of the previous nesting level, then we've exited that nesting level and # need to pop the stack previous_level = nesting.last - nesting.pop if previous_level && candidate.start_char > previous_level.end_char + nesting.pop if previous_level && loc.start_offset > previous_level.location.end_offset # Keep track of the nesting where we found the target. This is used to determine the fully qualified name of the # target when it is a constant - if candidate.is_a?(SyntaxTree::ClassDeclaration) || candidate.is_a?(SyntaxTree::ModuleDeclaration) + if candidate.is_a?(YARP::ClassNode) || candidate.is_a?(YARP::ModuleNode) nesting << candidate end @@ -170,13 +167,13 @@ def locate(node, char_position, node_types: []) # If the current node is narrower than or equal to the previous closest node, then it is more precise closest_loc = closest.location - if loc.end_char - loc.start_char <= closest_loc.end_char - closest_loc.start_char + if loc.end_offset - loc.start_offset <= closest_loc.end_offset - closest_loc.start_offset parent = closest closest = candidate end end - [closest, parent, nesting.map { |n| n.constant.constant.value }] + [closest, parent, nesting.map { |n| n.constant_path.location.slice }] end class Scanner diff --git a/lib/ruby_lsp/event_emitter.rb b/lib/ruby_lsp/event_emitter.rb index 6c2d49b90..cc4fdb6c2 100644 --- a/lib/ruby_lsp/event_emitter.rb +++ b/lib/ruby_lsp/event_emitter.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true module RubyLsp - # EventEmitter is an intermediary between our requests and Syntax Tree visitors. It's used to visit the document's AST + # EventEmitter is an intermediary between our requests and YARP visitors. It's used to visit the document's AST # and emit events that the requests can listen to for providing functionality. Usages: # # - For positional requests, locate the target node and use `emit_for_target` to fire events for each listener @@ -18,9 +18,8 @@ module RubyLsp # emitter.emit_for_target(target_node) # listener.response # ``` - class EventEmitter < SyntaxTree::Visitor + class EventEmitter < YARP::Visitor extend T::Sig - include SyntaxTree::WithScope sig { void } def initialize @@ -35,154 +34,317 @@ def register(listener, *events) # Emit events for a specific node. This is similar to the regular `visit` method, but avoids going deeper into the # tree for performance - sig { params(node: T.nilable(SyntaxTree::Node)).void } + sig { params(node: T.nilable(YARP::Node)).void } def emit_for_target(node) case node - when SyntaxTree::Command - @listeners[:on_command]&.each { |l| T.unsafe(l).on_command(node) } - when SyntaxTree::CallNode + when YARP::CallNode @listeners[:on_call]&.each { |l| T.unsafe(l).on_call(node) } - when SyntaxTree::TStringContent - @listeners[:on_tstring_content]&.each { |l| T.unsafe(l).on_tstring_content(node) } - when SyntaxTree::ConstPathRef - @listeners[:on_const_path_ref]&.each { |l| T.unsafe(l).on_const_path_ref(node) } - when SyntaxTree::Const - @listeners[:on_const]&.each { |l| T.unsafe(l).on_const(node) } - when SyntaxTree::TopConstRef - @listeners[:on_top_const_ref]&.each { |l| T.unsafe(l).on_top_const_ref(node) } + when YARP::ConstantPathNode + @listeners[:on_constant_path]&.each { |l| T.unsafe(l).on_constant_path(node) } + when YARP::StringNode + @listeners[:on_string]&.each { |l| T.unsafe(l).on_string(node) } + when YARP::ClassNode + @listeners[:on_class]&.each { |l| T.unsafe(l).on_class(node) } + when YARP::ModuleNode + @listeners[:on_module]&.each { |l| T.unsafe(l).on_module(node) } + when YARP::ConstantWriteNode + @listeners[:on_constant_write]&.each { |l| T.unsafe(l).on_constant_write(node) } + when YARP::ConstantReadNode + @listeners[:on_constant_read]&.each { |l| T.unsafe(l).on_constant_read(node) } end end # Visit dispatchers are below. Notice that for nodes that create a new scope (e.g.: classes, modules, method defs) # we need both an `on_*` and `after_*` event. This is because some requests must know when we exit the scope - sig { override.params(node: T.nilable(SyntaxTree::Node)).void } + sig { override.params(node: T.nilable(YARP::Node)).void } def visit(node) @listeners[:on_node]&.each { |l| T.unsafe(l).on_node(node) } super end - sig { override.params(node: SyntaxTree::ClassDeclaration).void } - def visit_class(node) + sig { params(nodes: T::Array[T.nilable(YARP::Node)]).void } + def visit_all(nodes) + nodes.each { |node| visit(node) } + end + + sig { override.params(node: YARP::ClassNode).void } + def visit_class_node(node) @listeners[:on_class]&.each { |l| T.unsafe(l).on_class(node) } super @listeners[:after_class]&.each { |l| T.unsafe(l).after_class(node) } end - sig { override.params(node: SyntaxTree::ModuleDeclaration).void } - def visit_module(node) + sig { override.params(node: YARP::ModuleNode).void } + def visit_module_node(node) @listeners[:on_module]&.each { |l| T.unsafe(l).on_module(node) } super @listeners[:after_module]&.each { |l| T.unsafe(l).after_module(node) } end - sig { override.params(node: SyntaxTree::Command).void } - def visit_command(node) - @listeners[:on_command]&.each { |l| T.unsafe(l).on_command(node) } + sig { override.params(node: YARP::CallNode).void } + def visit_call_node(node) + @listeners[:on_call]&.each { |l| T.unsafe(l).on_call(node) } super - @listeners[:after_command]&.each { |l| T.unsafe(l).after_command(node) } + @listeners[:after_call]&.each { |l| T.unsafe(l).after_call(node) } end - sig { override.params(node: SyntaxTree::CommandCall).void } - def visit_command_call(node) - @listeners[:on_command_call]&.each { |l| T.unsafe(l).on_command_call(node) } + sig { override.params(node: YARP::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node) + @listeners[:on_instance_variable_write]&.each { |l| T.unsafe(l).on_instance_variable_write(node) } super end - sig { override.params(node: SyntaxTree::CallNode).void } - def visit_call(node) - @listeners[:on_call]&.each { |l| T.unsafe(l).on_call(node) } + sig { override.params(node: YARP::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node) + @listeners[:on_class_variable_write]&.each { |l| T.unsafe(l).on_class_variable_write(node) } super - @listeners[:after_call]&.each { |l| T.unsafe(l).after_call(node) } end - sig { override.params(node: SyntaxTree::VCall).void } - def visit_vcall(node) - @listeners[:on_vcall]&.each { |l| T.unsafe(l).on_vcall(node) } + sig { override.params(node: YARP::DefNode).void } + def visit_def_node(node) + @listeners[:on_def]&.each { |l| T.unsafe(l).on_def(node) } super + @listeners[:after_def]&.each { |l| T.unsafe(l).after_def(node) } end - sig { override.params(node: SyntaxTree::ConstPathField).void } - def visit_const_path_field(node) - @listeners[:on_const_path_field]&.each { |l| T.unsafe(l).on_const_path_field(node) } + sig { override.params(node: YARP::BlockNode).void } + def visit_block_node(node) + @listeners[:on_block]&.each { |l| T.unsafe(l).on_block(node) } super + @listeners[:after_block]&.each { |l| T.unsafe(l).after_block(node) } end - sig { override.params(node: SyntaxTree::TopConstField).void } - def visit_top_const_field(node) - @listeners[:on_top_const_field]&.each { |l| T.unsafe(l).on_top_const_field(node) } + sig { override.params(node: YARP::SelfNode).void } + def visit_self_node(node) + @listeners[:on_self]&.each { |l| T.unsafe(l).on_self(node) } super end - sig { override.params(node: SyntaxTree::DefNode).void } - def visit_def(node) - @listeners[:on_def]&.each { |l| T.unsafe(l).on_def(node) } + sig { override.params(node: YARP::RescueNode).void } + def visit_rescue_node(node) + @listeners[:on_rescue]&.each { |l| T.unsafe(l).on_rescue(node) } super - @listeners[:after_def]&.each { |l| T.unsafe(l).after_def(node) } end - sig { override.params(node: SyntaxTree::VarField).void } - def visit_var_field(node) - @listeners[:on_var_field]&.each { |l| T.unsafe(l).on_var_field(node) } + sig { override.params(node: YARP::BlockParameterNode).void } + def visit_block_parameter_node(node) + @listeners[:on_block_parameter]&.each { |l| T.unsafe(l).on_block_parameter(node) } super end - sig { override.params(node: SyntaxTree::Comment).void } - def visit_comment(node) - @listeners[:on_comment]&.each { |l| T.unsafe(l).on_comment(node) } + sig { override.params(node: YARP::KeywordParameterNode).void } + def visit_keyword_parameter_node(node) + @listeners[:on_keyword_parameter]&.each { |l| T.unsafe(l).on_keyword_parameter(node) } super end - sig { override.params(node: SyntaxTree::Rescue).void } - def visit_rescue(node) - @listeners[:on_rescue]&.each { |l| T.unsafe(l).on_rescue(node) } + sig { override.params(node: YARP::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node) + @listeners[:on_keyword_rest_parameter]&.each { |l| T.unsafe(l).on_keyword_rest_parameter(node) } + super + end + + sig { override.params(node: YARP::OptionalParameterNode).void } + def visit_optional_parameter_node(node) + @listeners[:on_optional_parameter]&.each { |l| T.unsafe(l).on_optional_parameter(node) } + super + end + + sig { override.params(node: YARP::RequiredParameterNode).void } + def visit_required_parameter_node(node) + @listeners[:on_required_parameter]&.each { |l| T.unsafe(l).on_required_parameter(node) } + super + end + + sig { override.params(node: YARP::RestParameterNode).void } + def visit_rest_parameter_node(node) + @listeners[:on_rest_parameter]&.each { |l| T.unsafe(l).on_rest_parameter(node) } + super + end + + sig { override.params(node: YARP::ConstantReadNode).void } + def visit_constant_read_node(node) + @listeners[:on_constant_read]&.each { |l| T.unsafe(l).on_constant_read(node) } + super + end + + sig { override.params(node: YARP::ConstantPathNode).void } + def visit_constant_path_node(node) + @listeners[:on_constant_path]&.each { |l| T.unsafe(l).on_constant_path(node) } + super + end + + sig { override.params(node: YARP::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node) + @listeners[:on_constant_path_write]&.each { |l| T.unsafe(l).on_constant_path_write(node) } + super + end + + sig { override.params(node: YARP::ConstantWriteNode).void } + def visit_constant_write_node(node) + @listeners[:on_constant_write]&.each { |l| T.unsafe(l).on_constant_write(node) } + super + end + + sig { override.params(node: YARP::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node) + @listeners[:on_constant_and_write]&.each { |l| T.unsafe(l).on_constant_and_write(node) } + super + end + + sig { override.params(node: YARP::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node) + @listeners[:on_constant_operator_write]&.each { |l| T.unsafe(l).on_constant_operator_write(node) } + super + end + + sig { override.params(node: YARP::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node) + @listeners[:on_constant_or_write]&.each { |l| T.unsafe(l).on_constant_or_write(node) } + super + end + + sig { override.params(node: YARP::ConstantTargetNode).void } + def visit_constant_target_node(node) + @listeners[:on_constant_target]&.each { |l| T.unsafe(l).on_constant_target(node) } + super + end + + sig { override.params(node: YARP::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node) + @listeners[:on_local_variable_write]&.each { |l| T.unsafe(l).on_local_variable_write(node) } + super + end + + sig { override.params(node: YARP::LocalVariableReadNode).void } + def visit_local_variable_read_node(node) + @listeners[:on_local_variable_read]&.each { |l| T.unsafe(l).on_local_variable_read(node) } + super + end + + sig { override.params(node: YARP::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node) + @listeners[:on_local_variable_and_write]&.each { |l| T.unsafe(l).on_local_variable_and_write(node) } + super + end + + sig { override.params(node: YARP::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node) + @listeners[:on_local_variable_operator_write]&.each { |l| T.unsafe(l).on_local_variable_operator_write(node) } + super + end + + sig { override.params(node: YARP::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node) + @listeners[:on_local_variable_or_write]&.each { |l| T.unsafe(l).on_local_variable_or_write(node) } + super + end + + sig { override.params(node: YARP::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node) + @listeners[:on_local_variable_target]&.each { |l| T.unsafe(l).on_local_variable_target(node) } + super + end + + sig { override.params(node: YARP::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node) + @listeners[:on_block_local_variable]&.each { |l| T.unsafe(l).on_block_local_variable(node) } + super + end + + sig { override.params(node: YARP::IfNode).void } + def visit_if_node(node) + @listeners[:on_if]&.each { |l| T.unsafe(l).on_if(node) } + super + end + + sig { override.params(node: YARP::InNode).void } + def visit_in_node(node) + @listeners[:on_in]&.each { |l| T.unsafe(l).on_in(node) } + super + end + + sig { override.params(node: YARP::WhenNode).void } + def visit_when_node(node) + @listeners[:on_when]&.each { |l| T.unsafe(l).on_when(node) } + super + end + + sig { override.params(node: YARP::InterpolatedStringNode).void } + def visit_interpolated_string_node(node) + @listeners[:on_interpolated_string]&.each { |l| T.unsafe(l).on_interpolated_string(node) } + super + end + + sig { override.params(node: YARP::ArrayNode).void } + def visit_array_node(node) + @listeners[:on_array]&.each { |l| T.unsafe(l).on_array(node) } + super + end + + sig { override.params(node: YARP::CaseNode).void } + def visit_case_node(node) + @listeners[:on_case]&.each { |l| T.unsafe(l).on_case(node) } + super + end + + sig { override.params(node: YARP::ForNode).void } + def visit_for_node(node) + @listeners[:on_for]&.each { |l| T.unsafe(l).on_for(node) } + super + end + + sig { override.params(node: YARP::HashNode).void } + def visit_hash_node(node) + @listeners[:on_hash]&.each { |l| T.unsafe(l).on_hash(node) } super end - sig { override.params(node: SyntaxTree::Kw).void } - def visit_kw(node) - @listeners[:on_kw]&.each { |l| T.unsafe(l).on_kw(node) } + sig { override.params(node: YARP::SingletonClassNode).void } + def visit_singleton_class_node(node) + @listeners[:on_singleton_class]&.each { |l| T.unsafe(l).on_singleton_class(node) } super end - sig { override.params(node: SyntaxTree::Params).void } - def visit_params(node) - @listeners[:on_params]&.each { |l| T.unsafe(l).on_params(node) } + sig { override.params(node: YARP::UnlessNode).void } + def visit_unless_node(node) + @listeners[:on_unless]&.each { |l| T.unsafe(l).on_unless(node) } super end - sig { override.params(node: SyntaxTree::Field).void } - def visit_field(node) - @listeners[:on_field]&.each { |l| T.unsafe(l).on_field(node) } + sig { override.params(node: YARP::UntilNode).void } + def visit_until_node(node) + @listeners[:on_until]&.each { |l| T.unsafe(l).on_until(node) } super end - sig { override.params(node: SyntaxTree::VarRef).void } - def visit_var_ref(node) - @listeners[:on_var_ref]&.each { |l| T.unsafe(l).on_var_ref(node) } + sig { override.params(node: YARP::WhileNode).void } + def visit_while_node(node) + @listeners[:on_while]&.each { |l| T.unsafe(l).on_while(node) } super end - sig { override.params(node: SyntaxTree::BlockVar).void } - def visit_block_var(node) - @listeners[:on_block_var]&.each { |l| T.unsafe(l).on_block_var(node) } + sig { override.params(node: YARP::ElseNode).void } + def visit_else_node(node) + @listeners[:on_else]&.each { |l| T.unsafe(l).on_else(node) } super end - sig { override.params(node: SyntaxTree::LambdaVar).void } - def visit_lambda_var(node) - @listeners[:on_lambda_var]&.each { |l| T.unsafe(l).on_lambda_var(node) } + sig { override.params(node: YARP::EnsureNode).void } + def visit_ensure_node(node) + @listeners[:on_ensure]&.each { |l| T.unsafe(l).on_ensure(node) } super end - sig { override.params(node: SyntaxTree::Binary).void } - def visit_binary(node) + sig { override.params(node: YARP::BeginNode).void } + def visit_begin_node(node) + @listeners[:on_begin]&.each { |l| T.unsafe(l).on_begin(node) } super - @listeners[:after_binary]&.each { |l| T.unsafe(l).after_binary(node) } end - sig { override.params(node: SyntaxTree::Const).void } - def visit_const(node) - @listeners[:on_const]&.each { |l| T.unsafe(l).on_const(node) } + sig { override.params(node: YARP::StringConcatNode).void } + def visit_string_concat_node(node) + @listeners[:on_string_concat]&.each { |l| T.unsafe(l).on_string_concat(node) } super end end diff --git a/lib/ruby_lsp/executor.rb b/lib/ruby_lsp/executor.rb index fc11036c1..69961094e 100644 --- a/lib/ruby_lsp/executor.rb +++ b/lib/ruby_lsp/executor.rb @@ -82,12 +82,10 @@ def run(request) request.dig(:params, :contentChanges), request.dig(:params, :textDocument, :version), ) - when "textDocument/foldingRange" - folding_range(uri) when "textDocument/selectionRange" selection_range(uri, request.dig(:params, :positions)) when "textDocument/documentSymbol", "textDocument/documentLink", "textDocument/codeLens", - "textDocument/semanticTokens/full" + "textDocument/semanticTokens/full", "textDocument/foldingRange" document = @store.get(uri) # If the response has already been cached by another request, return it @@ -96,15 +94,17 @@ def run(request) # Run listeners for the document emitter = EventEmitter.new + folding_range = Requests::FoldingRanges.new(document.parse_result.comments, emitter, @message_queue) document_symbol = Requests::DocumentSymbol.new(emitter, @message_queue) - document_link = Requests::DocumentLink.new(uri, emitter, @message_queue) - code_lens = Requests::CodeLens.new(uri, emitter, @message_queue, @test_library) + document_link = Requests::DocumentLink.new(uri, document.comments, emitter, @message_queue) + code_lens = Requests::CodeLens.new(uri, @test_library, emitter, @message_queue) semantic_highlighting = Requests::SemanticHighlighting.new(emitter, @message_queue) - emitter.visit(document.tree) if document.parsed? + emitter.visit(document.tree) # Store all responses retrieve in this round of visits in the cache and then return the response for the request # we actually received + document.cache_set("textDocument/foldingRange", folding_range.response) document.cache_set("textDocument/documentSymbol", document_symbol.response) document.cache_set("textDocument/documentLink", document_link.response) document.cache_set("textDocument/codeLens", code_lens.response) @@ -246,14 +246,12 @@ def show_syntax_tree(uri, range) end def definition(uri, position) document = @store.get(uri) - return if document.syntax_error? - target, parent, nesting = document.locate_node( position, - node_types: [SyntaxTree::Command, SyntaxTree::Const, SyntaxTree::ConstPathRef], + node_types: [YARP::CallNode, YARP::ConstantReadNode, YARP::ConstantPathNode], ) - target = parent if target.is_a?(SyntaxTree::Const) && parent.is_a?(SyntaxTree::ConstPathRef) + target = parent if target.is_a?(YARP::ConstantReadNode) && parent.is_a?(YARP::ConstantPathNode) emitter = EventEmitter.new base_listener = Requests::Definition.new(uri, nesting, @index, emitter, @message_queue) @@ -261,13 +259,6 @@ def definition(uri, position) base_listener.response end - sig { params(uri: URI::Generic).returns(T::Array[Interface::FoldingRange]) } - def folding_range(uri) - @store.cache_fetch(uri, "textDocument/foldingRange") do |document| - Requests::FoldingRanges.new(document).run - end - end - sig do params( uri: URI::Generic, @@ -276,8 +267,6 @@ def folding_range(uri) end def hover(uri, position) document = @store.get(uri) - return if document.syntax_error? - target, parent, nesting = document.locate_node( position, node_types: Requests::Hover::ALLOWED_TARGETS, @@ -285,7 +274,7 @@ def hover(uri, position) if (Requests::Hover::ALLOWED_TARGETS.include?(parent.class) && !Requests::Hover::ALLOWED_TARGETS.include?(target.class)) || - (parent.is_a?(SyntaxTree::ConstPathRef) && target.is_a?(SyntaxTree::Const)) + (parent.is_a?(YARP::ConstantPathNode) && target.is_a?(YARP::ConstantReadNode)) target = parent end @@ -371,7 +360,6 @@ def on_type_formatting(uri, position, character) end def document_highlight(uri, position) document = @store.get(uri) - return if document.syntax_error? target, parent = document.locate_node(position) emitter = EventEmitter.new @@ -383,7 +371,6 @@ def document_highlight(uri, position) sig { params(uri: URI::Generic, range: Document::RangeShape).returns(T.nilable(T::Array[Interface::InlayHint])) } def inlay_hint(uri, range) document = @store.get(uri) - return if document.syntax_error? start_line = range.dig(:start, :line) end_line = range.dig(:end, :line) @@ -443,7 +430,7 @@ def diagnostic(uri) Requests::Diagnostics.new(document).run end - Interface::FullDocumentDiagnosticReport.new(kind: "full", items: response.map(&:to_lsp_diagnostic)) if response + Interface::FullDocumentDiagnosticReport.new(kind: "full", items: response) if response end sig { params(uri: URI::Generic, range: Document::RangeShape).returns(Interface::SemanticTokens) } @@ -458,7 +445,7 @@ def semantic_tokens_range(uri, range) @message_queue, range: start_line..end_line, ) - emitter.visit(document.tree) if document.parsed? + emitter.visit(document.tree) Requests::Support::SemanticTokenEncoder.new.encode(listener.response) end @@ -471,7 +458,6 @@ def semantic_tokens_range(uri, range) end def completion(uri, position) document = @store.get(uri) - return unless document.parsed? char_position = document.create_scanner.find_char_position(position) @@ -480,35 +466,29 @@ def completion(uri, position) # the node, as it could not be a constant target_node_types = if ("A".."Z").cover?(document.source[char_position - 1]) char_position -= 1 - [SyntaxTree::Const, SyntaxTree::ConstPathRef, SyntaxTree::TopConstRef] + [YARP::ConstantReadNode, YARP::ConstantPathNode] else - [SyntaxTree::Command, SyntaxTree::CommandCall, SyntaxTree::CallNode] + [YARP::CallNode] end - matched, parent, nesting = document.locate(T.must(document.tree), char_position, node_types: target_node_types) + matched, parent, nesting = document.locate(document.tree, char_position, node_types: target_node_types) return unless matched && parent target = case matched - when SyntaxTree::Command, SyntaxTree::CallNode, SyntaxTree::CommandCall + when YARP::CallNode message = matched.message - return if message.is_a?(Symbol) - return unless message.value == "require" - - args = matched.arguments - args = args.arguments if args.is_a?(SyntaxTree::ArgParen) - return if args.nil? || args.is_a?(SyntaxTree::ArgsForward) + return unless message == "require" - argument = args.parts.first - return unless argument.is_a?(SyntaxTree::StringLiteral) + args = matched.arguments&.arguments + return if args.nil? || args.is_a?(YARP::ForwardingArgumentsNode) - path_node = argument.parts.first - return unless path_node.is_a?(SyntaxTree::TStringContent) - return unless (path_node.location.start_char..path_node.location.end_char).cover?(char_position) + argument = args.first + return unless argument.is_a?(YARP::StringNode) + return unless (argument.location.start_offset..argument.location.end_offset).cover?(char_position) - path_node - when SyntaxTree::Const, SyntaxTree::ConstPathRef - if (parent.is_a?(SyntaxTree::ConstPathRef) || parent.is_a?(SyntaxTree::TopConstRef)) && - matched.is_a?(SyntaxTree::Const) + argument + when YARP::ConstantReadNode, YARP::ConstantPathNode + if parent.is_a?(YARP::ConstantPathNode) && matched.is_a?(YARP::ConstantReadNode) parent else matched diff --git a/lib/ruby_lsp/extension.rb b/lib/ruby_lsp/extension.rb index ac539efae..4d82ecb78 100644 --- a/lib/ruby_lsp/extension.rb +++ b/lib/ruby_lsp/extension.rb @@ -119,11 +119,13 @@ def create_code_lens_listener(uri, emitter, message_queue); end # Creates a new Hover listener. This method is invoked on every Hover request sig do overridable.params( + nesting: T::Array[String], + index: RubyIndexer::Index, emitter: EventEmitter, message_queue: Thread::Queue, ).returns(T.nilable(Listener[T.nilable(Interface::Hover)])) end - def create_hover_listener(emitter, message_queue); end + def create_hover_listener(nesting, index, emitter, message_queue); end # Creates a new DocumentSymbol listener. This method is invoked on every DocumentSymbol request sig do diff --git a/lib/ruby_lsp/internal.rb b/lib/ruby_lsp/internal.rb index d79e6866d..b54b96f8d 100644 --- a/lib/ruby_lsp/internal.rb +++ b/lib/ruby_lsp/internal.rb @@ -14,6 +14,7 @@ require "ruby_indexer/ruby_indexer" require "core_ext/uri" require "ruby_lsp/utils" +require "ruby_lsp/parameter_scope" require "ruby_lsp/server" require "ruby_lsp/executor" require "ruby_lsp/event_emitter" diff --git a/lib/ruby_lsp/parameter_scope.rb b/lib/ruby_lsp/parameter_scope.rb new file mode 100644 index 000000000..45d928734 --- /dev/null +++ b/lib/ruby_lsp/parameter_scope.rb @@ -0,0 +1,33 @@ +# typed: strict +# frozen_string_literal: true + +module RubyLsp + class ParameterScope + extend T::Sig + + sig { returns(T.nilable(ParameterScope)) } + attr_reader :parent + + sig { params(parent: T.nilable(ParameterScope)).void } + def initialize(parent = nil) + @parent = parent + @parameters = T.let(Set.new, T::Set[Symbol]) + end + + sig { params(name: T.any(String, Symbol)).void } + def <<(name) + @parameters << name.to_sym + end + + sig { params(name: T.any(Symbol, String)).returns(Symbol) } + def type_for(name) + parameter?(name) ? :parameter : :variable + end + + sig { params(name: T.any(Symbol, String)).returns(T::Boolean) } + def parameter?(name) + sym = name.to_sym + @parameters.include?(sym) || (!@parent.nil? && @parent.parameter?(sym)) + end + end +end diff --git a/lib/ruby_lsp/requests/base_request.rb b/lib/ruby_lsp/requests/base_request.rb index 6fffe211d..745e3427b 100644 --- a/lib/ruby_lsp/requests/base_request.rb +++ b/lib/ruby_lsp/requests/base_request.rb @@ -4,7 +4,7 @@ module RubyLsp module Requests # :nodoc: - class BaseRequest < SyntaxTree::Visitor + class BaseRequest < YARP::Visitor extend T::Sig extend T::Helpers include Support::Common @@ -20,10 +20,10 @@ def initialize(document) sig { abstract.returns(Object) } def run; end - # Syntax Tree implements `visit_all` using `map` instead of `each` for users who want to use the pattern + # YARP implements `visit_all` using `map` instead of `each` for users who want to use the pattern # `result = visitor.visit(tree)`. However, we don't use that pattern and should avoid producing a new array for # every single node visited - sig { params(nodes: T::Array[T.nilable(SyntaxTree::Node)]).void } + sig { params(nodes: T::Array[T.nilable(YARP::Node)]).void } def visit_all(nodes) nodes.each { |node| visit(node) } end diff --git a/lib/ruby_lsp/requests/code_action_resolve.rb b/lib/ruby_lsp/requests/code_action_resolve.rb index 58a3299ac..757e04f89 100644 --- a/lib/ruby_lsp/requests/code_action_resolve.rb +++ b/lib/ruby_lsp/requests/code_action_resolve.rb @@ -46,8 +46,6 @@ def run source_range = @code_action.dig(:data, :range) return Error::EmptySelection if source_range[:start] == source_range[:end] - return Error::InvalidTargetRange if @document.syntax_error? - scanner = @document.create_scanner start_index = scanner.find_char_position(source_range[:start]) end_index = scanner.find_char_position(source_range[:end]) @@ -55,26 +53,23 @@ def run # Find the closest statements node, so that we place the refactor in a valid position closest_statements, parent_statements = @document - .locate(T.must(@document.tree), start_index, node_types: [SyntaxTree::Statements]) + .locate(@document.tree, start_index, node_types: [YARP::StatementsNode, YARP::BlockNode]) + return Error::InvalidTargetRange if closest_statements.nil? # Find the node with the end line closest to the requested position, so that we can place the refactor # immediately after that closest node - closest_node = closest_statements.child_nodes.compact.min_by do |node| + closest_node = T.must(closest_statements.child_nodes.compact.min_by do |node| distance = source_range.dig(:start, :line) - (node.location.end_line - 1) distance <= 0 ? Float::INFINITY : distance - end + end) - # Find the parent expression of the closest node - parent_expression = parent_statements.child_nodes.compact.find do |node| - loc = node.location - loc.start_line - 1 <= source_range.dig(:start, :line) && loc.end_line - 1 >= source_range.dig(:end, :line) - end if parent_statements + return Error::InvalidTargetRange if closest_node.is_a?(YARP::MissingNode) closest_node_loc = closest_node.location # If the parent expression is a single line block, then we have to extract it inside of the oneline block - if parent_expression.is_a?(SyntaxTree::MethodAddBlock) && - parent_expression.location.start_line == parent_expression.location.end_line + if parent_statements.is_a?(YARP::BlockNode) && + parent_statements.location.start_line == parent_statements.location.end_line variable_source = " #{NEW_VARIABLE_NAME} = #{extracted_source};" character = source_range.dig(:start, :character) - 1 @@ -105,7 +100,10 @@ def run end: { line: target_line, character: indentation }, } - variable_source = if T.must(lines[target_line]).strip.empty? + line = lines[target_line] + return Error::InvalidTargetRange unless line + + variable_source = if line.strip.empty? "\n#{" " * indentation}#{NEW_VARIABLE_NAME} = #{extracted_source}" else "#{NEW_VARIABLE_NAME} = #{extracted_source}\n#{" " * indentation}" diff --git a/lib/ruby_lsp/requests/code_lens.rb b/lib/ruby_lsp/requests/code_lens.rb index c8ec78f2f..b60c7b2db 100644 --- a/lib/ruby_lsp/requests/code_lens.rb +++ b/lib/ruby_lsp/requests/code_lens.rb @@ -31,8 +31,8 @@ class CodeLens < ExtensibleListener sig { override.returns(ResponseType) } attr_reader :_response - sig { params(uri: URI::Generic, emitter: EventEmitter, message_queue: Thread::Queue, test_library: String).void } - def initialize(uri, emitter, message_queue, test_library) + sig { params(uri: URI::Generic, test_library: String, emitter: EventEmitter, message_queue: Thread::Queue).void } + def initialize(uri, test_library, emitter, message_queue) @uri = T.let(uri, URI::Generic) @test_library = T.let(test_library, String) @_response = T.let([], ResponseType) @@ -48,18 +48,15 @@ def initialize(uri, emitter, message_queue, test_library) :on_class, :after_class, :on_def, - :on_command, - :after_command, :on_call, :after_call, - :on_vcall, ) end - sig { params(node: SyntaxTree::ClassDeclaration).void } + sig { params(node: YARP::ClassNode).void } def on_class(node) @visibility_stack.push(["public", "public"]) - class_name = node.constant.constant.value + class_name = node.constant_path.slice @class_stack.push(class_name) if @path && class_name.end_with?("Test") @@ -72,20 +69,20 @@ def on_class(node) end end - sig { params(node: SyntaxTree::ClassDeclaration).void } + sig { params(node: YARP::ClassNode).void } def after_class(node) @visibility_stack.pop @class_stack.pop end - sig { params(node: SyntaxTree::DefNode).void } + sig { params(node: YARP::DefNode).void } def on_def(node) class_name = @class_stack.last return unless class_name&.end_with?("Test") visibility, _ = @visibility_stack.last if visibility == "public" - method_name = node.name.value + method_name = node.name.to_s if @path && method_name.start_with?("test_") add_test_code_lens( node, @@ -97,55 +94,41 @@ def on_def(node) end end - sig { params(node: SyntaxTree::Command).void } - def on_command(node) - node_message = node.message.value - if ACCESS_MODIFIERS.include?(node_message) && node.arguments.parts.any? - visibility, _ = @visibility_stack.pop - @visibility_stack.push([node_message, visibility]) - elsif @path&.include?("Gemfile") && node_message.include?("gem") && node.arguments.parts.any? - remote = resolve_gem_remote(node) - return unless remote + sig { params(node: YARP::CallNode).void } + def on_call(node) + name = node.name + arguments = node.arguments + + # If we found `private` by itself or `private def foo` + if ACCESS_MODIFIERS.include?(name) + if arguments.nil? + @visibility_stack.pop + @visibility_stack.push([name, name]) + elsif arguments.arguments.first.is_a?(YARP::DefNode) + visibility, _ = @visibility_stack.pop + @visibility_stack.push([name, visibility]) + end - add_open_gem_remote_code_lens(node, remote) + return end - end - sig { params(node: SyntaxTree::Command).void } - def after_command(node) - _, prev_visibility = @visibility_stack.pop - @visibility_stack.push([prev_visibility, prev_visibility]) - end + if @path&.include?("Gemfile") && name == "gem" && arguments + first_argument = arguments.arguments.first + return unless first_argument.is_a?(YARP::StringNode) - sig { params(node: SyntaxTree::CallNode).void } - def on_call(node) - ident = node.message if node.message.is_a?(SyntaxTree::Ident) + remote = resolve_gem_remote(first_argument) + return unless remote - if ident - ident_value = T.cast(ident, SyntaxTree::Ident).value - if ACCESS_MODIFIERS.include?(ident_value) - visibility, _ = @visibility_stack.pop - @visibility_stack.push([ident_value, visibility]) - end + add_open_gem_remote_code_lens(node, remote) end end - sig { params(node: SyntaxTree::CallNode).void } + sig { params(node: YARP::CallNode).void } def after_call(node) _, prev_visibility = @visibility_stack.pop @visibility_stack.push([prev_visibility, prev_visibility]) end - sig { params(node: SyntaxTree::VCall).void } - def on_vcall(node) - vcall_value = node.value.value - - if ACCESS_MODIFIERS.include?(vcall_value) - @visibility_stack.pop - @visibility_stack.push([vcall_value, vcall_value]) - end - end - sig { override.params(extension: RubyLsp::Extension).returns(T.nilable(Listener[ResponseType])) } def initialize_external_listener(extension) extension.create_code_lens_listener(@uri, @emitter, @message_queue) @@ -159,7 +142,7 @@ def merge_response!(other) private - sig { params(node: SyntaxTree::Node, name: String, command: String, kind: Symbol).void } + sig { params(node: YARP::Node, name: String, command: String, kind: Symbol).void } def add_test_code_lens(node, name:, command:, kind:) # don't add code lenses if the test library is not supported or unknown return unless SUPPORTED_TEST_LIBRARIES.include?(@test_library) && @path @@ -201,15 +184,9 @@ def add_test_code_lens(node, name:, command:, kind:) ) end - sig { params(node: SyntaxTree::Command).returns(T.nilable(String)) } - def resolve_gem_remote(node) - gem_statement = node.arguments.parts.first - return unless gem_statement.is_a?(SyntaxTree::StringLiteral) - - gem_name = gem_statement.parts.first - return unless gem_name.is_a?(SyntaxTree::TStringContent) - - spec = Gem::Specification.stubs.find { |gem| gem.name == gem_name.value }&.to_spec + sig { params(gem_name: YARP::StringNode).returns(T.nilable(String)) } + def resolve_gem_remote(gem_name) + spec = Gem::Specification.stubs.find { |gem| gem.name == gem_name.content }&.to_spec return if spec.nil? [spec.homepage, spec.metadata["source_code_uri"]].compact.find do |page| @@ -239,7 +216,7 @@ def generate_test_command(class_name:, method_name: nil) command end - sig { params(node: SyntaxTree::Command, remote: String).void } + sig { params(node: YARP::CallNode, remote: String).void } def add_open_gem_remote_code_lens(node, remote) @_response << create_code_lens( node, diff --git a/lib/ruby_lsp/requests/completion.rb b/lib/ruby_lsp/requests/completion.rb index be9291d39..e8525d546 100644 --- a/lib/ruby_lsp/requests/completion.rb +++ b/lib/ruby_lsp/requests/completion.rb @@ -40,22 +40,22 @@ def initialize(index, nesting, emitter, message_queue) @index = index @nesting = nesting - emitter.register(self, :on_tstring_content, :on_const_path_ref, :on_const, :on_top_const_ref) + emitter.register(self, :on_string, :on_constant_path, :on_constant_read) end - sig { params(node: SyntaxTree::TStringContent).void } - def on_tstring_content(node) - @index.search_require_paths(node.value).map!(&:require_path).sort!.each do |path| + sig { params(node: YARP::StringNode).void } + def on_string(node) + @index.search_require_paths(node.content).map!(&:require_path).sort!.each do |path| @_response << build_completion(T.must(path), node) end end # Handle completion on regular constant references (e.g. `Bar`) - sig { params(node: SyntaxTree::Const).void } - def on_const(node) + sig { params(node: YARP::ConstantReadNode).void } + def on_constant_read(node) return if DependencyDetector::HAS_TYPECHECKER - name = node.value + name = node.slice candidates = @index.prefix_search(name, @nesting) candidates.each do |entries| @_response << build_entry_completion(name, node, entries, top_level?(T.must(entries.first).name, candidates)) @@ -63,35 +63,38 @@ def on_const(node) end # Handle completion on namespaced constant references (e.g. `Foo::Bar`) - sig { params(node: SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node) + sig { params(node: YARP::ConstantPathNode).void } + def on_constant_path(node) return if DependencyDetector::HAS_TYPECHECKER - name = full_constant_name(node) - candidates = @index.prefix_search(name, @nesting) - candidates.each do |entries| - @_response << build_entry_completion(name, node, entries, top_level?(T.must(entries.first).name, candidates)) - end - end + name = node.slice - # Handle completion on top level constant references (e.g. `::Bar`) - sig { params(node: SyntaxTree::TopConstRef).void } - def on_top_const_ref(node) - return if DependencyDetector::HAS_TYPECHECKER + top_level_reference = if name.start_with?("::") + name = name.delete_prefix("::") + true + else + false + end - name = full_constant_name(node) - candidates = @index.prefix_search(name, []) - candidates.each { |entries| @_response << build_entry_completion(name, node, entries, true) } + candidates = @index.prefix_search(name, top_level_reference ? [] : @nesting) + candidates.each do |entries| + @_response << build_entry_completion( + name, + node, + entries, + top_level_reference || top_level?(T.must(entries.first).name, candidates), + ) + end end private - sig { params(label: String, node: SyntaxTree::TStringContent).returns(Interface::CompletionItem) } + sig { params(label: String, node: YARP::StringNode).returns(Interface::CompletionItem) } def build_completion(label, node) Interface::CompletionItem.new( label: label, text_edit: Interface::TextEdit.new( - range: range_from_syntax_tree_node(node), + range: range_from_node(node), new_text: label, ), kind: Constant::CompletionItemKind::REFERENCE, @@ -101,7 +104,7 @@ def build_completion(label, node) sig do params( name: String, - node: SyntaxTree::Node, + node: YARP::Node, entries: T::Array[RubyIndexer::Index::Entry], top_level: T::Boolean, ).returns(Interface::CompletionItem) @@ -146,7 +149,7 @@ def build_entry_completion(name, node, entries, top_level) label: first_entry.name, filter_text: top_level ? "::#{first_entry.name}" : first_entry.name, text_edit: Interface::TextEdit.new( - range: range_from_syntax_tree_node(node), + range: range_from_node(node), new_text: insertion_text, ), kind: kind, diff --git a/lib/ruby_lsp/requests/definition.rb b/lib/ruby_lsp/requests/definition.rb index 33928bd9b..dad604ff6 100644 --- a/lib/ruby_lsp/requests/definition.rb +++ b/lib/ruby_lsp/requests/definition.rb @@ -43,7 +43,7 @@ def initialize(uri, nesting, index, emitter, message_queue) super(emitter, message_queue) - emitter.register(self, :on_command, :on_const, :on_const_path_ref) + emitter.register(self, :on_call, :on_constant_read, :on_constant_path) end sig { override.params(ext: Extension).returns(T.nilable(RubyLsp::Listener[ResponseType])) } @@ -67,32 +67,21 @@ def merge_response!(other) self end - sig { params(node: SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node) - name = full_constant_name(node) - find_in_index(name) - end - - sig { params(node: SyntaxTree::Const).void } - def on_const(node) - find_in_index(node.value) - end - - sig { params(node: SyntaxTree::Command).void } - def on_command(node) - message = node.message.value + sig { params(node: YARP::CallNode).void } + def on_call(node) + message = node.name return unless message == "require" || message == "require_relative" - argument = node.arguments.parts.first - return unless argument.is_a?(SyntaxTree::StringLiteral) + arguments = node.arguments + return unless arguments - string = argument.parts.first - return unless string.is_a?(SyntaxTree::TStringContent) + argument = arguments.arguments.first + return unless argument.is_a?(YARP::StringNode) case message when "require" - entry = @index.search_require_paths(string.value).find do |indexable_path| - indexable_path.require_path == string.value + entry = @index.search_require_paths(argument.content).find do |indexable_path| + indexable_path.require_path == argument.content end if entry @@ -107,7 +96,7 @@ def on_command(node) ) end when "require_relative" - required_file = "#{string.value}.rb" + required_file = "#{argument.content}.rb" path = @uri.to_standardized_path current_folder = path ? Pathname.new(CGI.unescape(path)).dirname : Dir.pwd candidate = File.expand_path(File.join(current_folder, required_file)) @@ -122,6 +111,16 @@ def on_command(node) end end + sig { params(node: YARP::ConstantPathNode).void } + def on_constant_path(node) + find_in_index(node.slice) + end + + sig { params(node: YARP::ConstantReadNode).void } + def on_constant_read(node) + find_in_index(node.slice) + end + private sig { params(value: String).void } diff --git a/lib/ruby_lsp/requests/diagnostics.rb b/lib/ruby_lsp/requests/diagnostics.rb index bde2298c6..dc523f430 100644 --- a/lib/ruby_lsp/requests/diagnostics.rb +++ b/lib/ruby_lsp/requests/diagnostics.rb @@ -28,10 +28,10 @@ def initialize(document) @uri = T.let(document.uri, URI::Generic) end - sig { override.returns(T.nilable(T.all(T::Array[Support::RuboCopDiagnostic], Object))) } + sig { override.returns(T.nilable(T.all(T::Array[Interface::Diagnostic], Object))) } def run # Running RuboCop is slow, so to avoid excessive runs we only do so if the file is syntactically valid - return if @document.syntax_error? + return syntax_error_diagnostics if @document.syntax_error? return unless defined?(Support::RuboCopDiagnosticsRunner) @@ -39,7 +39,30 @@ def run path = @uri.to_standardized_path return unless path.nil? || path.start_with?(T.must(WORKSPACE_URI.to_standardized_path)) - Support::RuboCopDiagnosticsRunner.instance.run(@uri, @document) + Support::RuboCopDiagnosticsRunner.instance.run(@uri, @document).map!(&:to_lsp_diagnostic) + end + + private + + sig { returns(T.nilable(T::Array[Interface::Diagnostic])) } + def syntax_error_diagnostics + @document.parse_result.errors.map do |error| + Interface::Diagnostic.new( + range: Interface::Range.new( + start: Interface::Position.new( + line: error.location.start_line - 1, + character: error.location.start_column, + ), + end: Interface::Position.new( + line: error.location.end_line - 1, + character: error.location.end_column, + ), + ), + message: error.message, + severity: Constant::DiagnosticSeverity::ERROR, + source: "YARP", + ) + end end end end diff --git a/lib/ruby_lsp/requests/document_highlight.rb b/lib/ruby_lsp/requests/document_highlight.rb index da25948f2..791ab5a09 100644 --- a/lib/ruby_lsp/requests/document_highlight.rb +++ b/lib/ruby_lsp/requests/document_highlight.rb @@ -32,8 +32,8 @@ class DocumentHighlight < Listener sig do params( - target: T.nilable(SyntaxTree::Node), - parent: T.nilable(SyntaxTree::Node), + target: T.nilable(YARP::Node), + parent: T.nilable(YARP::Node), emitter: EventEmitter, message_queue: Thread::Queue, ).void @@ -47,11 +47,21 @@ def initialize(target, parent, emitter, message_queue) highlight_target = case target - when *DIRECT_HIGHLIGHTS + when YARP::GlobalVariableReadNode, YARP::GlobalVariableAndWriteNode, YARP::GlobalVariableOperatorWriteNode, + YARP::GlobalVariableOrWriteNode, YARP::GlobalVariableTargetNode, YARP::GlobalVariableWriteNode, + YARP::InstanceVariableAndWriteNode, YARP::InstanceVariableOperatorWriteNode, + YARP::InstanceVariableOrWriteNode, YARP::InstanceVariableReadNode, YARP::InstanceVariableTargetNode, + YARP::InstanceVariableWriteNode, YARP::ConstantAndWriteNode, YARP::ConstantOperatorWriteNode, + YARP::ConstantOrWriteNode, YARP::ConstantPathAndWriteNode, YARP::ConstantPathNode, + YARP::ConstantPathOperatorWriteNode, YARP::ConstantPathOrWriteNode, YARP::ConstantPathTargetNode, + YARP::ConstantPathWriteNode, YARP::ConstantReadNode, YARP::ConstantTargetNode, YARP::ConstantWriteNode, + YARP::ClassVariableAndWriteNode, YARP::ClassVariableOperatorWriteNode, YARP::ClassVariableOrWriteNode, + YARP::ClassVariableReadNode, YARP::ClassVariableTargetNode, YARP::ClassVariableWriteNode, + YARP::LocalVariableAndWriteNode, YARP::LocalVariableOperatorWriteNode, YARP::LocalVariableOrWriteNode, + YARP::LocalVariableReadNode, YARP::LocalVariableTargetNode, YARP::LocalVariableWriteNode, YARP::CallNode, + YARP::BlockParameterNode, YARP::KeywordParameterNode, YARP::KeywordRestParameterNode, + YARP::OptionalParameterNode, YARP::RequiredParameterNode, YARP::RestParameterNode Support::HighlightTarget.new(target) - when SyntaxTree::Ident - relevant_node = parent.is_a?(SyntaxTree::Params) ? target : parent - Support::HighlightTarget.new(relevant_node) end @target = T.let(highlight_target, T.nilable(Support::HighlightTarget)) @@ -59,7 +69,7 @@ def initialize(target, parent, emitter, message_queue) emitter.register(self, :on_node) if @target end - sig { params(node: T.nilable(SyntaxTree::Node)).void } + sig { params(node: T.nilable(YARP::Node)).void } def on_node(node) return if node.nil? @@ -69,20 +79,9 @@ def on_node(node) private - DIRECT_HIGHLIGHTS = T.let( - [ - SyntaxTree::GVar, - SyntaxTree::IVar, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::VarField, - ], - T::Array[T.class_of(SyntaxTree::Node)], - ) - sig { params(match: Support::HighlightTarget::HighlightMatch).void } def add_highlight(match) - range = range_from_syntax_tree_node(match.node) + range = range_from_location(match.location) @_response << Interface::DocumentHighlight.new(range: range, kind: match.type) end end diff --git a/lib/ruby_lsp/requests/document_link.rb b/lib/ruby_lsp/requests/document_link.rb index 321747cee..c75b16ae6 100644 --- a/lib/ruby_lsp/requests/document_link.rb +++ b/lib/ruby_lsp/requests/document_link.rb @@ -75,8 +75,15 @@ def gem_paths sig { override.returns(ResponseType) } attr_reader :_response - sig { params(uri: URI::Generic, emitter: EventEmitter, message_queue: Thread::Queue).void } - def initialize(uri, emitter, message_queue) + sig do + params( + uri: URI::Generic, + comments: T::Array[YARP::Comment], + emitter: EventEmitter, + message_queue: Thread::Queue, + ).void + end + def initialize(uri, comments, emitter, message_queue) super(emitter, message_queue) # Match the version based on the version in the RBI file name. Notice that the `@` symbol is sanitized to `%40` @@ -85,13 +92,49 @@ def initialize(uri, emitter, message_queue) version_match = path ? /(?<=%40)[\d.]+(?=\.rbi$)/.match(path) : nil @gem_version = T.let(version_match && version_match[0], T.nilable(String)) @_response = T.let([], T::Array[Interface::DocumentLink]) + @lines_to_comments = T.let( + comments.to_h do |comment| + [comment.location.end_line, comment] + end, + T::Hash[Integer, YARP::Comment], + ) - emitter.register(self, :on_comment) + emitter.register(self, :on_def, :on_class, :on_module, :on_constant_write, :on_constant_path_write) end - sig { params(node: SyntaxTree::Comment).void } - def on_comment(node) - match = node.value.match(%r{source://.*#\d+$}) + sig { params(node: YARP::DefNode).void } + def on_def(node) + extract_document_link(node) + end + + sig { params(node: YARP::ClassNode).void } + def on_class(node) + extract_document_link(node) + end + + sig { params(node: YARP::ModuleNode).void } + def on_module(node) + extract_document_link(node) + end + + sig { params(node: YARP::ConstantWriteNode).void } + def on_constant_write(node) + extract_document_link(node) + end + + sig { params(node: YARP::ConstantPathWriteNode).void } + def on_constant_path_write(node) + extract_document_link(node) + end + + private + + sig { params(node: YARP::Node).void } + def extract_document_link(node) + comment = @lines_to_comments[node.location.start_line - 1] + return unless comment + + match = comment.location.slice.match(%r{source://.*#\d+$}) return unless match uri = T.cast(URI(T.must(match[0])), URI::Source) @@ -102,14 +145,12 @@ def on_comment(node) return if file_path.nil? @_response << Interface::DocumentLink.new( - range: range_from_syntax_tree_node(node), + range: range_from_location(comment.location), target: "file://#{file_path}##{uri.line_number}", tooltip: "Jump to #{file_path}##{uri.line_number}", ) end - private - # Try to figure out the gem version for a source:// link. The order of precedence is: # 1. The version in the URI # 2. The version in the RBI file name diff --git a/lib/ruby_lsp/requests/document_symbol.rb b/lib/ruby_lsp/requests/document_symbol.rb index e0cf36e3f..ec3f74253 100644 --- a/lib/ruby_lsp/requests/document_symbol.rb +++ b/lib/ruby_lsp/requests/document_symbol.rb @@ -64,14 +64,15 @@ def initialize(emitter, message_queue) self, :on_class, :after_class, - :on_command, - :on_const_path_field, + :on_call, + :on_constant_path_write, + :on_constant_write, :on_def, :after_def, :on_module, :after_module, - :on_top_const_field, - :on_var_field, + :on_instance_variable_write, + :on_class_variable_write, ) end @@ -87,116 +88,122 @@ def merge_response!(other) self end - sig { params(node: SyntaxTree::ClassDeclaration).void } + sig { params(node: YARP::ClassNode).void } def on_class(node) @stack << create_document_symbol( - name: full_constant_name(node.constant), + name: node.constant_path.location.slice, kind: Constant::SymbolKind::CLASS, - range_node: node, - selection_range_node: node.constant, + range_location: node.location, + selection_range_location: node.constant_path.location, ) end - sig { params(node: SyntaxTree::ClassDeclaration).void } + sig { params(node: YARP::ClassNode).void } def after_class(node) @stack.pop end - sig { params(node: SyntaxTree::Command).void } - def on_command(node) - return unless ATTR_ACCESSORS.include?(node.message.value) + sig { params(node: YARP::CallNode).void } + def on_call(node) + return unless ATTR_ACCESSORS.include?(node.name) && node.receiver.nil? - node.arguments.parts.each do |argument| - next unless argument.is_a?(SyntaxTree::SymbolLiteral) + arguments = node.arguments + return unless arguments + + arguments.arguments.each do |argument| + next unless argument.is_a?(YARP::SymbolNode) + + name = argument.value + next unless name create_document_symbol( - name: argument.value.value, + name: name, kind: Constant::SymbolKind::FIELD, - range_node: argument, - selection_range_node: argument.value, + range_location: argument.location, + selection_range_location: T.must(argument.value_loc), ) end end - sig { params(node: SyntaxTree::ConstPathField).void } - def on_const_path_field(node) + sig { params(node: YARP::ConstantPathWriteNode).void } + def on_constant_path_write(node) + create_document_symbol( + name: node.target.location.slice, + kind: Constant::SymbolKind::CONSTANT, + range_location: node.location, + selection_range_location: node.target.location, + ) + end + + sig { params(node: YARP::ConstantWriteNode).void } + def on_constant_write(node) create_document_symbol( - name: node.constant.value, + name: node.name.to_s, kind: Constant::SymbolKind::CONSTANT, - range_node: node, - selection_range_node: node.constant, + range_location: node.location, + selection_range_location: node.name_loc, + ) + end + + sig { params(node: YARP::DefNode).void } + def after_def(node) + @stack.pop + end + + sig { params(node: YARP::ModuleNode).void } + def on_module(node) + @stack << create_document_symbol( + name: node.constant_path.location.slice, + kind: Constant::SymbolKind::MODULE, + range_location: node.location, + selection_range_location: node.constant_path.location, ) end - sig { params(node: SyntaxTree::DefNode).void } + sig { params(node: YARP::DefNode).void } def on_def(node) - target = node.target + receiver = node.receiver - if target.is_a?(SyntaxTree::VarRef) && target.value.is_a?(SyntaxTree::Kw) && target.value.value == "self" - name = "self.#{node.name.value}" + if receiver.is_a?(YARP::SelfNode) + name = "self.#{node.name}" kind = Constant::SymbolKind::METHOD else - name = node.name.value + name = node.name.to_s kind = name == "initialize" ? Constant::SymbolKind::CONSTRUCTOR : Constant::SymbolKind::METHOD end symbol = create_document_symbol( name: name, kind: kind, - range_node: node, - selection_range_node: node.name, + range_location: node.location, + selection_range_location: node.name_loc, ) @stack << symbol end - sig { params(node: SyntaxTree::DefNode).void } - def after_def(node) - @stack.pop - end - - sig { params(node: SyntaxTree::ModuleDeclaration).void } - def on_module(node) - @stack << create_document_symbol( - name: full_constant_name(node.constant), - kind: Constant::SymbolKind::MODULE, - range_node: node, - selection_range_node: node.constant, - ) - end - - sig { params(node: SyntaxTree::ModuleDeclaration).void } + sig { params(node: YARP::ModuleNode).void } def after_module(node) @stack.pop end - sig { params(node: SyntaxTree::TopConstField).void } - def on_top_const_field(node) + sig { params(node: YARP::InstanceVariableWriteNode).void } + def on_instance_variable_write(node) create_document_symbol( - name: node.constant.value, - kind: Constant::SymbolKind::CONSTANT, - range_node: node, - selection_range_node: node.constant, + name: node.name.to_s, + kind: Constant::SymbolKind::VARIABLE, + range_location: node.name_loc, + selection_range_location: node.name_loc, ) end - sig { params(node: SyntaxTree::VarField).void } - def on_var_field(node) - value = node.value - kind = case value - when SyntaxTree::Const - Constant::SymbolKind::CONSTANT - when SyntaxTree::CVar, SyntaxTree::IVar - Constant::SymbolKind::VARIABLE - else - return - end - + sig { params(node: YARP::ClassVariableWriteNode).void } + def on_class_variable_write(node) create_document_symbol( - name: value.value, - kind: kind, - range_node: node, - selection_range_node: value, + name: node.name.to_s, + kind: Constant::SymbolKind::VARIABLE, + range_location: node.name_loc, + selection_range_location: node.name_loc, ) end @@ -206,16 +213,16 @@ def on_var_field(node) params( name: String, kind: Integer, - range_node: SyntaxTree::Node, - selection_range_node: SyntaxTree::Node, + range_location: YARP::Location, + selection_range_location: YARP::Location, ).returns(Interface::DocumentSymbol) end - def create_document_symbol(name:, kind:, range_node:, selection_range_node:) + def create_document_symbol(name:, kind:, range_location:, selection_range_location:) symbol = Interface::DocumentSymbol.new( name: name, kind: kind, - range: range_from_syntax_tree_node(range_node), - selection_range: range_from_syntax_tree_node(selection_range_node), + range: range_from_location(range_location), + selection_range: range_from_location(selection_range_location), children: [], ) diff --git a/lib/ruby_lsp/requests/folding_ranges.rb b/lib/ruby_lsp/requests/folding_ranges.rb index fd75278f8..979d33bcc 100644 --- a/lib/ruby_lsp/requests/folding_ranges.rb +++ b/lib/ruby_lsp/requests/folding_ranges.rb @@ -15,288 +15,265 @@ module Requests # puts "Hello" # end # <-- folding range end # ``` - class FoldingRanges < BaseRequest + class FoldingRanges < Listener extend T::Sig - - SIMPLE_FOLDABLES = T.let( - [ - SyntaxTree::ArrayLiteral, - SyntaxTree::BlockNode, - SyntaxTree::Case, - SyntaxTree::ClassDeclaration, - SyntaxTree::For, - SyntaxTree::HashLiteral, - SyntaxTree::Heredoc, - SyntaxTree::ModuleDeclaration, - SyntaxTree::SClass, - SyntaxTree::UnlessNode, - SyntaxTree::UntilNode, - SyntaxTree::WhileNode, - SyntaxTree::Else, - SyntaxTree::Ensure, - SyntaxTree::Begin, - ].freeze, - T::Array[T.class_of(SyntaxTree::Node)], - ) - - NODES_WITH_STATEMENTS = T.let( - [ - SyntaxTree::IfNode, - SyntaxTree::Elsif, - SyntaxTree::In, - SyntaxTree::Rescue, - SyntaxTree::When, - ].freeze, - T::Array[T.class_of(SyntaxTree::Node)], - ) - - StatementNode = T.type_alias do - T.any( - SyntaxTree::IfNode, - SyntaxTree::Elsif, - SyntaxTree::In, - SyntaxTree::Rescue, - SyntaxTree::When, + extend T::Generic + + ResponseType = type_member { { fixed: T::Array[Interface::FoldingRange] } } + + sig { params(comments: T::Array[YARP::Comment], emitter: EventEmitter, queue: Thread::Queue).void } + def initialize(comments, emitter, queue) + super(emitter, queue) + + @_response = T.let([], ResponseType) + @requires = T.let([], T::Array[YARP::CallNode]) + @finalized_response = T.let(false, T::Boolean) + @comments = comments + + emitter.register( + self, + :on_if, + :on_in, + :on_rescue, + :on_when, + :on_interpolated_string, + :on_array, + :on_block, + :on_case, + :on_class, + :on_module, + :on_for, + :on_hash, + :on_singleton_class, + :on_unless, + :on_until, + :on_while, + :on_else, + :on_ensure, + :on_begin, + :on_string_concat, + :on_def, + :on_call, ) end - sig { params(document: Document).void } - def initialize(document) - super + sig { override.returns(ResponseType) } + def _response + unless @finalized_response + push_comment_ranges + emit_requires_range + @finalized_response = true + end - @ranges = T.let([], T::Array[Interface::FoldingRange]) - @partial_range = T.let(nil, T.nilable(PartialRange)) + @_response end - sig { override.returns(T.all(T::Array[Interface::FoldingRange], Object)) } - def run - if @document.parsed? - visit(@document.tree) - emit_partial_range - end + sig { params(node: YARP::IfNode).void } + def on_if(node) + add_statements_range(node) + end - @ranges + sig { params(node: YARP::InNode).void } + def on_in(node) + add_statements_range(node) end - private + sig { params(node: YARP::RescueNode).void } + def on_rescue(node) + add_statements_range(node) + end - sig { override.params(node: T.nilable(SyntaxTree::Node)).void } - def visit(node) - return unless handle_partial_range(node) + sig { params(node: YARP::WhenNode).void } + def on_when(node) + add_statements_range(node) + end - case node - when *SIMPLE_FOLDABLES - location = T.must(node).location - add_lines_range(location.start_line, location.end_line - 1) - when *NODES_WITH_STATEMENTS - add_statements_range(T.must(node), T.cast(node, StatementNode).statements) - when SyntaxTree::CallNode, SyntaxTree::CommandCall - # If there is a receiver, it may be a chained invocation, - # so we need to process it in special way. - if node.receiver.nil? - location = node.location - add_lines_range(location.start_line, location.end_line - 1) - else - add_call_range(node) - return - end - when SyntaxTree::Command - unless same_lines_for_command_and_block?(node) - location = node.location - add_lines_range(location.start_line, location.end_line - 1) - end - when SyntaxTree::DefNode - add_def_range(node) - when SyntaxTree::StringConcat - add_string_concat(node) - return - end + sig { params(node: YARP::InterpolatedStringNode).void } + def on_interpolated_string(node) + opening_loc = node.opening_loc + closing_loc = node.closing_loc - super + add_lines_range(opening_loc.start_line, closing_loc.end_line - 1) if opening_loc && closing_loc end - # This is to prevent duplicate ranges - sig { params(node: T.any(SyntaxTree::Command, SyntaxTree::CommandCall)).returns(T::Boolean) } - def same_lines_for_command_and_block?(node) - node_block = node.block - return false unless node_block + sig { params(node: YARP::ArrayNode).void } + def on_array(node) + add_simple_range(node) + end - location = node.location - block_location = node_block.location - block_location.start_line == location.start_line && block_location.end_line == location.end_line + sig { params(node: YARP::BlockNode).void } + def on_block(node) + add_simple_range(node) end - class PartialRange - extend T::Sig + sig { params(node: YARP::CaseNode).void } + def on_case(node) + add_simple_range(node) + end - sig { returns(String) } - attr_reader :kind + sig { params(node: YARP::ClassNode).void } + def on_class(node) + add_simple_range(node) + end - sig { returns(Integer) } - attr_reader :end_line + sig { params(node: YARP::ModuleNode).void } + def on_module(node) + add_simple_range(node) + end - class << self - extend T::Sig + sig { params(node: YARP::ForNode).void } + def on_for(node) + add_simple_range(node) + end - sig { params(node: SyntaxTree::Node, kind: String).returns(PartialRange) } - def from(node, kind) - new(node.location.start_line - 1, node.location.end_line - 1, kind) - end - end + sig { params(node: YARP::HashNode).void } + def on_hash(node) + add_simple_range(node) + end - sig { params(start_line: Integer, end_line: Integer, kind: String).void } - def initialize(start_line, end_line, kind) - @start_line = start_line - @end_line = end_line - @kind = kind - end + sig { params(node: YARP::SingletonClassNode).void } + def on_singleton_class(node) + add_simple_range(node) + end - sig { params(node: SyntaxTree::Node).returns(PartialRange) } - def extend_to(node) - @end_line = node.location.end_line - 1 - self - end + sig { params(node: YARP::UnlessNode).void } + def on_unless(node) + add_simple_range(node) + end - sig { params(node: SyntaxTree::Node).returns(T::Boolean) } - def new_section?(node) - node.is_a?(SyntaxTree::Comment) && @end_line + 1 != node.location.start_line - 1 - end + sig { params(node: YARP::UntilNode).void } + def on_until(node) + add_simple_range(node) + end - sig { returns(Interface::FoldingRange) } - def to_range - Interface::FoldingRange.new( - start_line: @start_line, - end_line: @end_line, - kind: @kind, - ) - end + sig { params(node: YARP::WhileNode).void } + def on_while(node) + add_simple_range(node) + end - sig { returns(T::Boolean) } - def multiline? - @end_line > @start_line - end + sig { params(node: YARP::ElseNode).void } + def on_else(node) + add_simple_range(node) end - sig { params(node: T.nilable(SyntaxTree::Node)).returns(T::Boolean) } - def handle_partial_range(node) - kind = partial_range_kind(node) + sig { params(node: YARP::EnsureNode).void } + def on_ensure(node) + add_simple_range(node) + end - if kind.nil? - emit_partial_range - return true - end + sig { params(node: YARP::BeginNode).void } + def on_begin(node) + add_simple_range(node) + end - target_node = T.must(node) - @partial_range = if @partial_range.nil? - PartialRange.from(target_node, kind) - elsif @partial_range.kind != kind || @partial_range.new_section?(target_node) - emit_partial_range - PartialRange.from(target_node, kind) - else - @partial_range.extend_to(target_node) - end + sig { params(node: YARP::Node).void } + def on_node(node) + emit_requires_range unless node.is_a?(YARP::CallNode) + end - false + sig { params(node: YARP::StringConcatNode).void } + def on_string_concat(node) + left = T.let(node.left, YARP::Node) + left = left.left while left.is_a?(YARP::StringConcatNode) + + add_lines_range(left.location.start_line, node.right.location.end_line - 1) end - sig { params(node: T.nilable(SyntaxTree::Node)).returns(T.nilable(String)) } - def partial_range_kind(node) - case node - when SyntaxTree::Comment - "comment" - when SyntaxTree::Command - if node.message.value == "require" || node.message.value == "require_relative" - "imports" - end + sig { params(node: YARP::DefNode).void } + def on_def(node) + params = node.parameters + parameter_loc = params&.location + location = node.location + + if params && parameter_loc.end_line > location.start_line + # Multiline parameters + add_lines_range(location.start_line, parameter_loc.end_line) + add_lines_range(parameter_loc.end_line + 1, location.end_line - 1) + else + add_lines_range(location.start_line, location.end_line - 1) end end - sig { void } - def emit_partial_range - return if @partial_range.nil? + sig { params(node: YARP::CallNode).void } + def on_call(node) + # If we find a require, don't visit the child nodes (prevent `super`), so that we can keep accumulating into + # the `@requires` array and then push the range whenever we find a node that isn't a CallNode + if require?(node) + @requires << node + return + end - @ranges << @partial_range.to_range if @partial_range.multiline? - @partial_range = nil + location = node.location + add_lines_range(location.start_line, location.end_line - 1) end - sig { params(node: T.any(SyntaxTree::CallNode, SyntaxTree::CommandCall)).void } - def add_call_range(node) - receiver = T.let(node.receiver, T.nilable(SyntaxTree::Node)) - - loop do - case receiver - when SyntaxTree::CallNode - visit(receiver.arguments) - receiver = receiver.receiver - when SyntaxTree::MethodAddBlock - visit(receiver.block) - receiver = receiver.call - - if receiver.is_a?(SyntaxTree::CallNode) || receiver.is_a?(SyntaxTree::CommandCall) - receiver = receiver.receiver - end - else - break - end + private + + sig { void } + def push_comment_ranges + # Group comments that are on consecutive lines and then push ranges for each group that has at least 2 comments + @comments.chunk_while do |this, other| + this.location.end_line + 1 == other.location.start_line + end.each do |chunk| + next if chunk.length == 1 + + @_response << Interface::FoldingRange.new( + start_line: T.must(chunk.first).location.start_line - 1, + end_line: T.must(chunk.last).location.end_line - 1, + kind: "comment", + ) end + end - if receiver - unless node.is_a?(SyntaxTree::CommandCall) && same_lines_for_command_and_block?(node) - add_lines_range( - receiver.location.start_line, - node.location.end_line - 1, - ) - end + sig { void } + def emit_requires_range + if @requires.length > 1 + @_response << Interface::FoldingRange.new( + start_line: T.must(@requires.first).location.start_line - 1, + end_line: T.must(@requires.last).location.end_line - 1, + kind: "imports", + ) end - visit(node.arguments) - visit(node.block) if node.is_a?(SyntaxTree::CommandCall) + @requires.clear end - sig { params(node: SyntaxTree::DefNode).void } - def add_def_range(node) - # For an endless method with no arguments, `node.params` returns `nil` for Ruby 3.0, but a `Syntax::Params` - # for Ruby 3.1 - params = node.params - return unless params + sig { params(node: YARP::CallNode).returns(T::Boolean) } + def require?(node) + message = node.message + return false unless message == "require" || message == "require_relative" - params_location = params.location + receiver = node.receiver + return false unless receiver.nil? || receiver.slice == "Kernel" - if params_location.start_line < params_location.end_line - add_lines_range(params_location.end_line, node.location.end_line - 1) - else - location = node.location - add_lines_range(location.start_line, location.end_line - 1) - end + arguments = node.arguments&.arguments + return false unless arguments - bodystmt = node.bodystmt - if bodystmt.is_a?(SyntaxTree::BodyStmt) - visit(bodystmt.statements) - else - visit(bodystmt) - end + arguments.length == 1 && arguments.first.is_a?(YARP::StringNode) end - sig { params(node: SyntaxTree::Node, statements: SyntaxTree::Statements).void } - def add_statements_range(node, statements) - return if statements.empty? + sig { params(node: T.any(YARP::IfNode, YARP::InNode, YARP::RescueNode, YARP::WhenNode)).void } + def add_statements_range(node) + statements = node.statements + return unless statements - add_lines_range(node.location.start_line, T.must(statements.body.last).location.end_line) - end + body = statements.body + return if body.empty? - sig { params(node: SyntaxTree::StringConcat).void } - def add_string_concat(node) - left = T.let(node.left, SyntaxTree::Node) - left = left.left while left.is_a?(SyntaxTree::StringConcat) + add_lines_range(node.location.start_line, T.must(body.last).location.end_line) + end - add_lines_range(left.location.start_line, node.right.location.end_line - 1) + sig { params(node: YARP::Node).void } + def add_simple_range(node) + location = node.location + add_lines_range(location.start_line, location.end_line - 1) end sig { params(start_line: Integer, end_line: Integer).void } def add_lines_range(start_line, end_line) return if start_line >= end_line - @ranges << Interface::FoldingRange.new( + @_response << Interface::FoldingRange.new( start_line: start_line - 1, end_line: end_line - 1, kind: "region", diff --git a/lib/ruby_lsp/requests/hover.rb b/lib/ruby_lsp/requests/hover.rb index 5cf9ff1b8..23eba552c 100644 --- a/lib/ruby_lsp/requests/hover.rb +++ b/lib/ruby_lsp/requests/hover.rb @@ -21,12 +21,12 @@ class Hover < ExtensibleListener ALLOWED_TARGETS = T.let( [ - SyntaxTree::Const, - SyntaxTree::Command, - SyntaxTree::CallNode, - SyntaxTree::ConstPathRef, + YARP::CallNode, + YARP::ConstantReadNode, + YARP::ConstantWriteNode, + YARP::ConstantPathNode, ], - T::Array[T.class_of(SyntaxTree::Node)], + T::Array[T.class_of(YARP::Node)], ) sig { override.returns(ResponseType) } @@ -46,12 +46,12 @@ def initialize(index, nesting, emitter, message_queue) @_response = T.let(nil, ResponseType) super(emitter, message_queue) - emitter.register(self, :on_const_path_ref, :on_const) + emitter.register(self, :on_constant_read, :on_constant_write, :on_constant_path) end sig { override.params(extension: RubyLsp::Extension).returns(T.nilable(Listener[ResponseType])) } def initialize_external_listener(extension) - extension.create_hover_listener(@emitter, @message_queue) + extension.create_hover_listener(@nesting, @index, @emitter, @message_queue) end # Merges responses from other hover listeners @@ -69,30 +69,36 @@ def merge_response!(other) self end - sig { params(node: SyntaxTree::ConstPathRef).void } - def on_const_path_ref(node) + sig { params(node: YARP::ConstantReadNode).void } + def on_constant_read(node) return if DependencyDetector::HAS_TYPECHECKER - name = full_constant_name(node) - generate_hover(name, node) + generate_hover(node.slice, node.location) end - sig { params(node: SyntaxTree::Const).void } - def on_const(node) + sig { params(node: YARP::ConstantWriteNode).void } + def on_constant_write(node) return if DependencyDetector::HAS_TYPECHECKER - generate_hover(node.value, node) + generate_hover(node.name.to_s, node.name_loc) + end + + sig { params(node: YARP::ConstantPathNode).void } + def on_constant_path(node) + return if DependencyDetector::HAS_TYPECHECKER + + generate_hover(node.slice, node.location) end private - sig { params(name: String, node: SyntaxTree::Node).void } - def generate_hover(name, node) + sig { params(name: String, location: YARP::Location).void } + def generate_hover(name, location) entries = @index.resolve(name, @nesting) return unless entries @_response = Interface::Hover.new( - range: range_from_syntax_tree_node(node), + range: range_from_location(location), contents: markdown_from_index_entries(name, entries), ) end diff --git a/lib/ruby_lsp/requests/inlay_hints.rb b/lib/ruby_lsp/requests/inlay_hints.rb index cbe654983..0a8d2a34d 100644 --- a/lib/ruby_lsp/requests/inlay_hints.rb +++ b/lib/ruby_lsp/requests/inlay_hints.rb @@ -39,10 +39,9 @@ def initialize(range, emitter, message_queue) emitter.register(self, :on_rescue) end - sig { params(node: SyntaxTree::Rescue).void } + sig { params(node: YARP::RescueNode).void } def on_rescue(node) - exception = node.exception - return unless exception.nil? || exception.exceptions.nil? + return unless node.exceptions.empty? loc = node.location return unless visible?(node, @range) diff --git a/lib/ruby_lsp/requests/selection_ranges.rb b/lib/ruby_lsp/requests/selection_ranges.rb index dea4765f3..c435850eb 100644 --- a/lib/ruby_lsp/requests/selection_ranges.rb +++ b/lib/ruby_lsp/requests/selection_ranges.rb @@ -25,41 +25,37 @@ class SelectionRanges < BaseRequest NODES_THAT_CAN_BE_PARENTS = T.let( [ - SyntaxTree::Assign, - SyntaxTree::ArrayLiteral, - SyntaxTree::Begin, - SyntaxTree::BlockNode, - SyntaxTree::CallNode, - SyntaxTree::Case, - SyntaxTree::ClassDeclaration, - SyntaxTree::Command, - SyntaxTree::DefNode, - SyntaxTree::Elsif, - SyntaxTree::Else, - SyntaxTree::EmbDoc, - SyntaxTree::Ensure, - SyntaxTree::For, - SyntaxTree::HashLiteral, - SyntaxTree::Heredoc, - SyntaxTree::HeredocBeg, - SyntaxTree::HshPtn, - SyntaxTree::IfNode, - SyntaxTree::In, - SyntaxTree::Lambda, - SyntaxTree::MethodAddBlock, - SyntaxTree::ModuleDeclaration, - SyntaxTree::Params, - SyntaxTree::Rescue, - SyntaxTree::RescueEx, - SyntaxTree::StringConcat, - SyntaxTree::StringLiteral, - SyntaxTree::UnlessNode, - SyntaxTree::UntilNode, - SyntaxTree::VCall, - SyntaxTree::When, - SyntaxTree::WhileNode, + YARP::ArgumentsNode, + YARP::ArrayNode, + YARP::AssocNode, + YARP::BeginNode, + YARP::BlockNode, + YARP::CallNode, + YARP::CaseNode, + YARP::ClassNode, + YARP::DefNode, + YARP::ElseNode, + YARP::EnsureNode, + YARP::ForNode, + YARP::HashNode, + YARP::HashPatternNode, + YARP::IfNode, + YARP::InNode, + YARP::InterpolatedStringNode, + YARP::KeywordHashNode, + YARP::LambdaNode, + YARP::LocalVariableWriteNode, + YARP::ModuleNode, + YARP::ParametersNode, + YARP::RescueNode, + YARP::StringConcatNode, + YARP::StringNode, + YARP::UnlessNode, + YARP::UntilNode, + YARP::WhenNode, + YARP::WhileNode, ].freeze, - T::Array[T.class_of(SyntaxTree::Node)], + T::Array[T.class_of(YARP::Node)], ) sig { params(document: Document).void } @@ -72,19 +68,23 @@ def initialize(document) sig { override.returns(T.all(T::Array[Support::SelectionRange], Object)) } def run - visit(@document.tree) if @document.parsed? + visit(@document.tree) @ranges.reverse! end private - sig { override.params(node: T.nilable(SyntaxTree::Node)).void } + sig { override.params(node: T.nilable(YARP::Node)).void } def visit(node) return if node.nil? - range = create_selection_range(node.location, @stack.last) - + range = if node.is_a?(YARP::InterpolatedStringNode) + create_heredoc_selection_range(node, @stack.last) + else + create_selection_range(node.location, @stack.last) + end @ranges << range + return if node.child_nodes.empty? @stack << range if NODES_THAT_CAN_BE_PARENTS.include?(node.class) @@ -94,11 +94,36 @@ def visit(node) sig do params( - location: SyntaxTree::Location, + node: YARP::InterpolatedStringNode, + parent: T.nilable(Support::SelectionRange), + ).returns(Support::SelectionRange) + end + def create_heredoc_selection_range(node, parent) + opening_loc = node.opening_loc || node.location + closing_loc = node.closing_loc || node.location + + RubyLsp::Requests::Support::SelectionRange.new( + range: Interface::Range.new( + start: Interface::Position.new( + line: opening_loc.start_line - 1, + character: opening_loc.start_column, + ), + end: Interface::Position.new( + line: closing_loc.end_line - 1, + character: closing_loc.end_column, + ), + ), + parent: parent, + ) + end + + sig do + params( + location: YARP::Location, parent: T.nilable(Support::SelectionRange), ).returns(Support::SelectionRange) end - def create_selection_range(location, parent = nil) + def create_selection_range(location, parent) RubyLsp::Requests::Support::SelectionRange.new( range: Interface::Range.new( start: Interface::Position.new( diff --git a/lib/ruby_lsp/requests/semantic_highlighting.rb b/lib/ruby_lsp/requests/semantic_highlighting.rb index d7f840e92..b1ff709e5 100644 --- a/lib/ruby_lsp/requests/semantic_highlighting.rb +++ b/lib/ruby_lsp/requests/semantic_highlighting.rb @@ -83,7 +83,7 @@ class SemanticHighlighting < Listener class SemanticToken extend T::Sig - sig { returns(SyntaxTree::Location) } + sig { returns(YARP::Location) } attr_reader :location sig { returns(Integer) } @@ -95,7 +95,7 @@ class SemanticToken sig { returns(T::Array[Integer]) } attr_reader :modifier - sig { params(location: SyntaxTree::Location, length: Integer, type: Integer, modifier: T::Array[Integer]).void } + sig { params(location: YARP::Location, length: Integer, type: Integer, modifier: T::Array[Integer]).void } def initialize(location:, length:, type:, modifier:) @location = location @length = length @@ -120,56 +120,60 @@ def initialize(emitter, message_queue, range: nil) @_response = T.let([], ResponseType) @range = range @special_methods = T.let(nil, T.nilable(T::Array[String])) + @current_scope = T.let(ParameterScope.new, ParameterScope) emitter.register( self, - :after_binary, - :on_block_var, :on_call, :on_class, - :on_command, - :on_command_call, - :on_const, :on_def, - :on_field, - :on_kw, - :on_lambda_var, + :after_def, + :on_block, + :after_block, + :on_self, :on_module, - :on_params, - :on_var_field, - :on_var_ref, - :on_vcall, + :on_local_variable_write, + :on_local_variable_read, + :on_block_parameter, + :on_keyword_parameter, + :on_keyword_rest_parameter, + :on_optional_parameter, + :on_required_parameter, + :on_rest_parameter, + :on_constant_read, + :on_constant_write, + :on_constant_and_write, + :on_constant_operator_write, + :on_constant_or_write, + :on_constant_target, + :on_local_variable_and_write, + :on_local_variable_operator_write, + :on_local_variable_or_write, + :on_local_variable_target, + :on_block_local_variable, ) end - sig { params(node: SyntaxTree::CallNode).void } + sig { params(node: YARP::CallNode).void } def on_call(node) return unless visible?(node, @range) message = node.message - if !message.is_a?(Symbol) && !special_method?(message.value) - type = Support::Sorbet.annotation?(node) ? :type : :method - add_token(message.location, type) - end - end - - sig { params(node: SyntaxTree::Command).void } - def on_command(node) - return unless visible?(node, @range) + return unless message - add_token(node.message.location, :method) unless special_method?(node.message.value) - end + # We can't push a semantic token for [] and []= because the argument inside the brackets is a part of + # the message_loc + return if message.start_with?("[") && (message.end_with?("]") || message.end_with?("]=")) - sig { params(node: SyntaxTree::CommandCall).void } - def on_command_call(node) - return unless visible?(node, @range) + return process_regexp_locals(node) if message == "=~" + return if special_method?(message) - message = node.message - add_token(message.location, :method) unless message.is_a?(Symbol) + type = Support::Sorbet.annotation?(node) ? :type : :method + add_token(T.must(node.message_loc), type) end - sig { params(node: SyntaxTree::Const).void } - def on_const(node) + sig { params(node: YARP::ConstantReadNode).void } + def on_constant_read(node) return unless visible?(node, @range) # When finding a module or class definition, we will have already pushed a token related to this constant. We # need to look at the previous two tokens and if they match this locatione exactly, avoid pushing another token @@ -179,153 +183,199 @@ def on_const(node) add_token(node.location, :namespace) end - sig { params(node: SyntaxTree::DefNode).void } - def on_def(node) + sig { params(node: YARP::ConstantWriteNode).void } + def on_constant_write(node) return unless visible?(node, @range) - add_token(node.name.location, :method, [:declaration]) + add_token(node.name_loc, :namespace) end - sig { params(node: SyntaxTree::Kw).void } - def on_kw(node) + sig { params(node: YARP::ConstantAndWriteNode).void } + def on_constant_and_write(node) return unless visible?(node, @range) - case node.value - when "self" - add_token(node.location, :variable, [:default_library]) - end + add_token(node.name_loc, :namespace) end - sig { params(node: SyntaxTree::Params).void } - def on_params(node) + sig { params(node: YARP::ConstantOperatorWriteNode).void } + def on_constant_operator_write(node) return unless visible?(node, @range) - node.keywords.each do |keyword, *| - location = keyword.location - add_token(location_without_colon(location), :parameter) - end + add_token(node.name_loc, :namespace) + end - node.requireds.each do |required| - add_token(required.location, :parameter) - end + sig { params(node: YARP::ConstantOrWriteNode).void } + def on_constant_or_write(node) + return unless visible?(node, @range) - rest = node.keyword_rest - if rest && !rest.is_a?(SyntaxTree::ArgsForward) && !rest.is_a?(Symbol) - name = rest.name - add_token(name.location, :parameter) if name - end + add_token(node.name_loc, :namespace) + end + + sig { params(node: YARP::ConstantTargetNode).void } + def on_constant_target(node) + return unless visible?(node, @range) + + add_token(node.location, :namespace) end - sig { params(node: SyntaxTree::Field).void } - def on_field(node) + sig { params(node: YARP::DefNode).void } + def on_def(node) + @current_scope = ParameterScope.new(@current_scope) return unless visible?(node, @range) - add_token(node.name.location, :method) + add_token(node.name_loc, :method, [:declaration]) + end + + sig { params(node: YARP::DefNode).void } + def after_def(node) + @current_scope = T.must(@current_scope.parent) + end + + sig { params(node: YARP::BlockNode).void } + def on_block(node) + @current_scope = ParameterScope.new(@current_scope) end - sig { params(node: SyntaxTree::VarField).void } - def on_var_field(node) + sig { params(node: YARP::BlockNode).void } + def after_block(node) + @current_scope = T.must(@current_scope.parent) + end + + sig { params(node: YARP::BlockLocalVariableNode).void } + def on_block_local_variable(node) + add_token(node.location, :variable) + end + + sig { params(node: YARP::BlockParameterNode).void } + def on_block_parameter(node) + name = node.name + @current_scope << name.to_sym if name + end + + sig { params(node: YARP::KeywordParameterNode).void } + def on_keyword_parameter(node) + name = node.name + @current_scope << name.to_s.delete_suffix(":").to_sym if name + return unless visible?(node, @range) - value = node.value + location = node.name_loc + add_token(location.copy(length: location.length - 1), :parameter) + end - case value - when SyntaxTree::Ident - type = type_for_local(value) - add_token(value.location, type) + sig { params(node: YARP::KeywordRestParameterNode).void } + def on_keyword_rest_parameter(node) + name = node.name + + if name + @current_scope << name.to_sym + + add_token(T.must(node.name_loc), :parameter) if visible?(node, @range) end end - sig { params(node: SyntaxTree::VarRef).void } - def on_var_ref(node) + sig { params(node: YARP::OptionalParameterNode).void } + def on_optional_parameter(node) + @current_scope << node.name + return unless visible?(node, @range) + + add_token(node.name_loc, :parameter) + end + + sig { params(node: YARP::RequiredParameterNode).void } + def on_required_parameter(node) + @current_scope << node.name return unless visible?(node, @range) - value = node.value + add_token(node.location, :parameter) + end + + sig { params(node: YARP::RestParameterNode).void } + def on_rest_parameter(node) + name = node.name - case value - when SyntaxTree::Ident - type = type_for_local(value) - add_token(value.location, type) + if name + @current_scope << name.to_sym + + add_token(T.must(node.name_loc), :parameter) if visible?(node, @range) end end - # All block locals are variables. E.g.: [].each do |x; block_local| - sig { params(node: SyntaxTree::BlockVar).void } - def on_block_var(node) - node.locals.each { |local| add_token(local.location, :variable) } + sig { params(node: YARP::SelfNode).void } + def on_self(node) + return unless visible?(node, @range) + + add_token(node.location, :variable, [:default_library]) end - # All lambda locals are variables. E.g.: ->(x; lambda_local) {} - sig { params(node: SyntaxTree::LambdaVar).void } - def on_lambda_var(node) - node.locals.each { |local| add_token(local.location, :variable) } + sig { params(node: YARP::LocalVariableWriteNode).void } + def on_local_variable_write(node) + return unless visible?(node, @range) + + add_token(node.name_loc, @current_scope.type_for(node.name)) end - sig { params(node: SyntaxTree::VCall).void } - def on_vcall(node) + sig { params(node: YARP::LocalVariableReadNode).void } + def on_local_variable_read(node) return unless visible?(node, @range) - # A VCall may exist as a local in the current_scope. This happens when used named capture groups in a regexp - ident = node.value - value = ident.value - local = @emitter.current_scope.find_local(value) - return if local.nil? && special_method?(value) - - type = if local - :variable - elsif Support::Sorbet.annotation?(node) - :type - else - :method + # Numbered parameters + if /_\d+/.match?(node.name) + add_token(node.location, :parameter) + return end - add_token(node.value.location, type) + add_token(node.location, @current_scope.type_for(node.name)) end - sig { params(node: SyntaxTree::Binary).void } - def after_binary(node) - # You can only capture local variables with regexp by using the =~ operator - return unless node.operator == :=~ + sig { params(node: YARP::LocalVariableAndWriteNode).void } + def on_local_variable_and_write(node) + return unless visible?(node, @range) - left = node.left - # The regexp needs to be on the left hand side of the =~ for local variable capture - return unless left.is_a?(SyntaxTree::RegexpLiteral) + add_token(node.name_loc, @current_scope.type_for(node.name)) + end - parts = left.parts - return unless parts.one? + sig { params(node: YARP::LocalVariableOperatorWriteNode).void } + def on_local_variable_operator_write(node) + return unless visible?(node, @range) - content = parts.first - return unless content.is_a?(SyntaxTree::TStringContent) + add_token(node.name_loc, @current_scope.type_for(node.name)) + end - # For each capture name we find in the regexp, look for a local in the current_scope - Regexp.new(content.value, Regexp::FIXEDENCODING).names.each do |name| - local = @emitter.current_scope.find_local(name) - next unless local + sig { params(node: YARP::LocalVariableOrWriteNode).void } + def on_local_variable_or_write(node) + return unless visible?(node, @range) - local.definitions.each { |definition| add_token(definition, :variable) } - end + add_token(node.name_loc, @current_scope.type_for(node.name)) + end + + sig { params(node: YARP::LocalVariableTargetNode).void } + def on_local_variable_target(node) + return unless visible?(node, @range) + + add_token(node.location, @current_scope.type_for(node.name)) end - sig { params(node: SyntaxTree::ClassDeclaration).void } + sig { params(node: YARP::ClassNode).void } def on_class(node) return unless visible?(node, @range) - add_token(node.constant.location, :class, [:declaration]) + add_token(node.constant_path.location, :class, [:declaration]) superclass = node.superclass add_token(superclass.location, :class) if superclass end - sig { params(node: SyntaxTree::ModuleDeclaration).void } + sig { params(node: YARP::ModuleNode).void } def on_module(node) return unless visible?(node, @range) - add_token(node.constant.location, :namespace, [:declaration]) + add_token(node.constant_path.location, :namespace, [:declaration]) end - sig { params(location: SyntaxTree::Location, type: Symbol, modifiers: T::Array[Symbol]).void } + sig { params(location: YARP::Location, type: Symbol, modifiers: T::Array[Symbol]).void } def add_token(location, type, modifiers = []) - length = location.end_char - location.start_char + length = location.end_offset - location.start_offset modifiers_indices = modifiers.filter_map { |modifier| TOKEN_MODIFIERS[modifier] } @_response.push( SemanticToken.new( @@ -339,38 +389,30 @@ def add_token(location, type, modifiers = []) private - # Exclude the ":" symbol at the end of a location - # We use it on keyword parameters to be consistent - # with the rest of the parameters - sig { params(location: T.untyped).returns(SyntaxTree::Location) } - def location_without_colon(location) - SyntaxTree::Location.new( - start_line: location.start_line, - start_column: location.start_column, - start_char: location.start_char, - end_char: location.end_char - 1, - end_column: location.end_column - 1, - end_line: location.end_line, - ) - end - - # Textmate provides highlighting for a subset - # of these special Ruby-specific methods. - # We want to utilize that highlighting, so we - # avoid making a semantic token for it. + # Textmate provides highlighting for a subset of these special Ruby-specific methods. We want to utilize that + # highlighting, so we avoid making a semantic token for it. sig { params(method_name: String).returns(T::Boolean) } def special_method?(method_name) SPECIAL_RUBY_METHODS.include?(method_name) end - sig { params(value: SyntaxTree::Ident).returns(Symbol) } - def type_for_local(value) - local = @emitter.current_scope.find_local(value.value) + sig { params(node: YARP::CallNode).void } + def process_regexp_locals(node) + receiver = node.receiver + + # The regexp needs to be the receiver of =~ for local variable capture + return unless receiver.is_a?(YARP::RegularExpressionNode) + + content = receiver.content + loc = receiver.content_loc + + # For each capture name we find in the regexp, look for a local in the current_scope + Regexp.new(content, Regexp::FIXEDENCODING).names.each do |name| + # The +3 is to compensate for the "(?<" part of the capture name + capture_name_offset = T.must(content.index("(?<#{name}>")) + 3 + local_var_loc = loc.copy(start_offset: loc.start_offset + capture_name_offset, length: name.length) - if local.nil? || local.type == :variable - :variable - else - :parameter + add_token(local_var_loc, @current_scope.type_for(name)) end end end diff --git a/lib/ruby_lsp/requests/show_syntax_tree.rb b/lib/ruby_lsp/requests/show_syntax_tree.rb index 8763ceb79..cfd80cb5d 100644 --- a/lib/ruby_lsp/requests/show_syntax_tree.rb +++ b/lib/ruby_lsp/requests/show_syntax_tree.rb @@ -29,7 +29,6 @@ def initialize(document, range) sig { override.returns(String) } def run - return "Document contains syntax error" if @document.syntax_error? return ast_for_range if @range output_string = +"" @@ -47,7 +46,7 @@ def ast_for_range start_char = scanner.find_char_position(range[:start]) end_char = scanner.find_char_position(range[:end]) - queue = T.cast(@document.tree, SyntaxTree::Program).statements.body.dup + queue = @document.tree.statements.body.dup found_nodes = [] until queue.empty? @@ -58,10 +57,10 @@ def ast_for_range # If the node is fully covered by the selection, then we found one of the nodes to be displayed and don't want # to continue descending into its children - if (start_char..end_char).cover?(loc.start_char..loc.end_char) + if (start_char..end_char).cover?(loc.start_offset..loc.end_offset) found_nodes << node else - queue.unshift(*node.child_nodes) + T.unsafe(queue).unshift(*node.child_nodes) end end diff --git a/lib/ruby_lsp/requests/support/annotation.rb b/lib/ruby_lsp/requests/support/annotation.rb index 1a9e19f42..3f659ba0e 100644 --- a/lib/ruby_lsp/requests/support/annotation.rb +++ b/lib/ruby_lsp/requests/support/annotation.rb @@ -17,28 +17,29 @@ def initialize(arity:, receiver: false) @receiver = receiver end - sig { returns(T.any(Integer, T::Range[Integer])) } - attr_reader :arity + sig { params(node: YARP::CallNode).returns(T::Boolean) } + def match?(node) + receiver_matches?(node) && arity_matches?(node) + end - sig { returns(T::Boolean) } - attr_reader :receiver + private - sig { params(arity: T.any(T::Range[Integer], Integer)).returns(T::Boolean) } - def supports_arity?(arity) - if @arity.is_a?(Integer) - @arity == arity - elsif @arity.is_a?(Range) - @arity.cover?(arity) - else - T.absurd(@arity) - end + sig { params(node: YARP::CallNode).returns(T::Boolean) } + def receiver_matches?(node) + node_receiver = node.receiver + (node_receiver && @receiver && node_receiver.location.slice == "T") || (!node_receiver && !@receiver) end - sig { params(receiver: T.nilable(String)).returns(T::Boolean) } - def supports_receiver?(receiver) - return receiver.nil? || receiver.empty? if @receiver == false + sig { params(node: YARP::CallNode).returns(T::Boolean) } + def arity_matches?(node) + node_arity = node.arguments&.arguments&.size || 0 - receiver == "T" + case @arity + when Integer + node_arity == @arity + when Range + @arity.cover?(node_arity) + end end end end diff --git a/lib/ruby_lsp/requests/support/common.rb b/lib/ruby_lsp/requests/support/common.rb index 10269fab9..5d98bcf2b 100644 --- a/lib/ruby_lsp/requests/support/common.rb +++ b/lib/ruby_lsp/requests/support/common.rb @@ -9,8 +9,8 @@ module Common # or extensions by created by developers outside of Shopify, so be cautious of changing anything. extend T::Sig - sig { params(node: SyntaxTree::Node).returns(Interface::Range) } - def range_from_syntax_tree_node(node) + sig { params(node: YARP::Node).returns(Interface::Range) } + def range_from_node(node) loc = node.location Interface::Range.new( @@ -22,28 +22,18 @@ def range_from_syntax_tree_node(node) ) end - sig do - params(node: T.any(SyntaxTree::ConstPathRef, SyntaxTree::ConstRef, SyntaxTree::TopConstRef)).returns(String) - end - def full_constant_name(node) - name = node.constant.value.dup - constant = T.let(node, SyntaxTree::Node) - - while constant.is_a?(SyntaxTree::ConstPathRef) - constant = constant.parent - - case constant - when SyntaxTree::ConstPathRef - name.prepend("#{constant.constant.value}::") - when SyntaxTree::VarRef - name.prepend("#{constant.value.value}::") - end - end - - name + sig { params(location: YARP::Location).returns(Interface::Range) } + def range_from_location(location) + Interface::Range.new( + start: Interface::Position.new( + line: location.start_line - 1, + character: location.start_column, + ), + end: Interface::Position.new(line: location.end_line - 1, character: location.end_column), + ) end - sig { params(node: T.nilable(SyntaxTree::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) } + sig { params(node: T.nilable(YARP::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) } def visible?(node, range) return true if range.nil? return false if node.nil? @@ -54,7 +44,7 @@ def visible?(node, range) sig do params( - node: SyntaxTree::Node, + node: YARP::Node, title: String, command_name: String, arguments: T.nilable(T::Array[T.untyped]), @@ -62,7 +52,7 @@ def visible?(node, range) ).returns(Interface::CodeLens) end def create_code_lens(node, title:, command_name:, arguments:, data:) - range = range_from_syntax_tree_node(node) + range = range_from_node(node) Interface::CodeLens.new( range: range, diff --git a/lib/ruby_lsp/requests/support/highlight_target.rb b/lib/ruby_lsp/requests/support/highlight_target.rb index 47895307e..8eadcf36d 100644 --- a/lib/ruby_lsp/requests/support/highlight_target.rb +++ b/lib/ruby_lsp/requests/support/highlight_target.rb @@ -16,81 +16,100 @@ class HighlightMatch sig { returns(Integer) } attr_reader :type - sig { returns(SyntaxTree::Node) } - attr_reader :node + sig { returns(YARP::Location) } + attr_reader :location - sig { params(type: Integer, node: SyntaxTree::Node).void } - def initialize(type:, node:) + sig { params(type: Integer, location: YARP::Location).void } + def initialize(type:, location:) @type = type - @node = node + @location = location end end - sig { params(node: SyntaxTree::Node).void } + sig { params(node: YARP::Node).void } def initialize(node) @node = node @value = T.let(value(node), T.nilable(String)) end - sig { params(other: SyntaxTree::Node).returns(T.nilable(HighlightMatch)) } + sig { params(other: YARP::Node).returns(T.nilable(HighlightMatch)) } def highlight_type(other) - matched_highlight(other) if other.is_a?(SyntaxTree::Params) || (@value && @value == value(other)) + matched_highlight(other) if @value && @value == value(other) end private # Match the target type (where the cursor is positioned) with the `other` type (the node we're currently # visiting) - sig { params(other: SyntaxTree::Node).returns(T.nilable(HighlightMatch)) } + sig { params(other: YARP::Node).returns(T.nilable(HighlightMatch)) } def matched_highlight(other) case @node # Method definitions and invocations - when SyntaxTree::VCall, SyntaxTree::CallNode, SyntaxTree::Command, - SyntaxTree::CommandCall, SyntaxTree::DefNode + when YARP::CallNode, YARP::DefNode case other - when SyntaxTree::VCall, SyntaxTree::CallNode, SyntaxTree::Command, SyntaxTree::CommandCall - HighlightMatch.new(type: READ, node: other) - when SyntaxTree::DefNode - HighlightMatch.new(type: WRITE, node: other.name) + when YARP::CallNode + HighlightMatch.new(type: READ, location: other.location) + when YARP::DefNode + HighlightMatch.new(type: WRITE, location: other.name_loc) end # Variables, parameters and constants - when SyntaxTree::GVar, SyntaxTree::IVar, SyntaxTree::Const, SyntaxTree::CVar, SyntaxTree::VarField, - SyntaxTree::VarRef, SyntaxTree::Ident + else case other - when SyntaxTree::VarField - HighlightMatch.new(type: WRITE, node: other) - when SyntaxTree::VarRef - HighlightMatch.new(type: READ, node: other) - when SyntaxTree::ClassDeclaration, SyntaxTree::ModuleDeclaration - HighlightMatch.new(type: WRITE, node: other.constant) - when SyntaxTree::ConstPathRef - HighlightMatch.new(type: READ, node: other.constant) - when SyntaxTree::Params - params = other.child_nodes.compact - match = params.find { |param| value(param) == @value } - HighlightMatch.new(type: WRITE, node: match) if match + when YARP::GlobalVariableTargetNode, YARP::InstanceVariableTargetNode, YARP::ConstantPathTargetNode, + YARP::ConstantTargetNode, YARP::ClassVariableTargetNode, YARP::LocalVariableTargetNode, + YARP::BlockParameterNode, YARP::RequiredParameterNode + + HighlightMatch.new(type: WRITE, location: other.location) + when YARP::LocalVariableWriteNode, YARP::KeywordParameterNode, YARP::RestParameterNode, + YARP::OptionalParameterNode, YARP::KeywordRestParameterNode, YARP::LocalVariableAndWriteNode, + YARP::LocalVariableOperatorWriteNode, YARP::LocalVariableOrWriteNode, YARP::ClassVariableWriteNode, + YARP::ClassVariableOrWriteNode, YARP::ClassVariableOperatorWriteNode, YARP::ClassVariableAndWriteNode, + YARP::ConstantWriteNode, YARP::ConstantOrWriteNode, YARP::ConstantOperatorWriteNode, + YARP::InstanceVariableWriteNode, YARP::ConstantAndWriteNode, YARP::InstanceVariableOrWriteNode, + YARP::InstanceVariableAndWriteNode, YARP::InstanceVariableOperatorWriteNode, + YARP::GlobalVariableWriteNode, YARP::GlobalVariableOrWriteNode, YARP::GlobalVariableAndWriteNode, + YARP::GlobalVariableOperatorWriteNode + + HighlightMatch.new(type: WRITE, location: T.must(other.name_loc)) if other.name + when YARP::ConstantPathWriteNode, YARP::ConstantPathOrWriteNode, YARP::ConstantPathAndWriteNode, + YARP::ConstantPathOperatorWriteNode + + HighlightMatch.new(type: WRITE, location: other.target.location) + when YARP::LocalVariableReadNode, YARP::ConstantPathNode, YARP::ConstantReadNode, + YARP::InstanceVariableReadNode, YARP::ClassVariableReadNode, YARP::GlobalVariableReadNode + + HighlightMatch.new(type: READ, location: other.location) + when YARP::ClassNode, YARP::ModuleNode + HighlightMatch.new(type: WRITE, location: other.constant_path.location) end end end - sig { params(node: SyntaxTree::Node).returns(T.nilable(String)) } + sig { params(node: YARP::Node).returns(T.nilable(String)) } def value(node) case node - when SyntaxTree::ConstPathRef, SyntaxTree::ConstPathField, SyntaxTree::TopConstField - node.constant.value - when SyntaxTree::GVar, SyntaxTree::IVar, SyntaxTree::Const, SyntaxTree::CVar, SyntaxTree::Ident - node.value - when SyntaxTree::Field, SyntaxTree::DefNode, SyntaxTree::RestParam, - SyntaxTree::KwRestParam, SyntaxTree::BlockArg - node.name&.value - when SyntaxTree::VarField, SyntaxTree::VarRef, SyntaxTree::VCall - value = node.value - value.value unless value.nil? || value.is_a?(Symbol) - when SyntaxTree::CallNode, SyntaxTree::Command, SyntaxTree::CommandCall - message = node.message - message.value unless message.is_a?(Symbol) - when SyntaxTree::ClassDeclaration, SyntaxTree::ModuleDeclaration - node.constant.constant.value + when YARP::ConstantReadNode, YARP::ConstantPathNode, YARP::BlockArgumentNode, YARP::ConstantTargetNode, + YARP::ConstantPathWriteNode, YARP::ConstantPathTargetNode, YARP::ConstantPathOrWriteNode, + YARP::ConstantPathOperatorWriteNode, YARP::ConstantPathAndWriteNode + node.slice + when YARP::GlobalVariableReadNode, YARP::GlobalVariableAndWriteNode, YARP::GlobalVariableOperatorWriteNode, + YARP::GlobalVariableOrWriteNode, YARP::GlobalVariableTargetNode, YARP::GlobalVariableWriteNode, + YARP::InstanceVariableAndWriteNode, YARP::InstanceVariableOperatorWriteNode, + YARP::InstanceVariableOrWriteNode, YARP::InstanceVariableReadNode, YARP::InstanceVariableTargetNode, + YARP::InstanceVariableWriteNode, YARP::ConstantAndWriteNode, YARP::ConstantOperatorWriteNode, + YARP::ConstantOrWriteNode, YARP::ConstantWriteNode, YARP::ClassVariableAndWriteNode, + YARP::ClassVariableOperatorWriteNode, YARP::ClassVariableOrWriteNode, YARP::ClassVariableReadNode, + YARP::ClassVariableTargetNode, YARP::ClassVariableWriteNode, YARP::LocalVariableAndWriteNode, + YARP::LocalVariableOperatorWriteNode, YARP::LocalVariableOrWriteNode, YARP::LocalVariableReadNode, + YARP::LocalVariableTargetNode, YARP::LocalVariableWriteNode, YARP::DefNode, YARP::BlockParameterNode, + YARP::KeywordParameterNode, YARP::KeywordRestParameterNode, YARP::OptionalParameterNode, + YARP::RequiredParameterNode, YARP::RestParameterNode + + node.name.to_s + when YARP::CallNode + node.message + when YARP::ClassNode, YARP::ModuleNode + node.constant_path.slice end end end diff --git a/lib/ruby_lsp/requests/support/selection_range.rb b/lib/ruby_lsp/requests/support/selection_range.rb index 4474c9421..8e0b59cac 100644 --- a/lib/ruby_lsp/requests/support/selection_range.rb +++ b/lib/ruby_lsp/requests/support/selection_range.rb @@ -9,10 +9,11 @@ class SelectionRange < Interface::SelectionRange sig { params(position: Document::PositionShape).returns(T::Boolean) } def cover?(position) - line_range = (range.start.line..range.end.line) - character_range = (range.start.character..range.end.character) - - line_range.cover?(position[:line]) && character_range.cover?(position[:character]) + start_covered = range.start.line < position[:line] || + (range.start.line == position[:line] && range.start.character <= position[:character]) + end_covered = range.end.line > position[:line] || + (range.end.line == position[:line] && range.end.character >= position[:character]) + start_covered && end_covered end end end diff --git a/lib/ruby_lsp/requests/support/sorbet.rb b/lib/ruby_lsp/requests/support/sorbet.rb index 9ff9871a7..1dcd96e5c 100644 --- a/lib/ruby_lsp/requests/support/sorbet.rb +++ b/lib/ruby_lsp/requests/support/sorbet.rb @@ -42,66 +42,11 @@ class << self sig do params( - node: T.any(SyntaxTree::CallNode, SyntaxTree::VCall), + node: YARP::CallNode, ).returns(T::Boolean) end def annotation?(node) - annotation = annotation(node) - - return false if annotation.nil? - - return false unless annotation.supports_receiver?(receiver_name(node)) - - annotation.supports_arity?(node.arity) - end - - private - - sig { params(node: T.any(SyntaxTree::CallNode, SyntaxTree::VCall)).returns(T.nilable(Annotation)) } - def annotation(node) - case node - when SyntaxTree::VCall - ANNOTATIONS[node.value.value] - when SyntaxTree::CallNode - message = node.message - ANNOTATIONS[message.value] unless message.is_a?(Symbol) - else - T.absurd(node) - end - end - - sig do - params(receiver: T.any(SyntaxTree::CallNode, SyntaxTree::VCall)).returns(T.nilable(String)) - end - def receiver_name(receiver) - case receiver - when SyntaxTree::CallNode - node_name(receiver.receiver) - when SyntaxTree::VCall - nil - else - T.absurd(receiver) - end - end - - sig do - params(node: T.nilable(SyntaxTree::Node)).returns(T.nilable(String)) - end - def node_name(node) - case node - when SyntaxTree::VarRef - node.value.value - when SyntaxTree::CallNode - node_name(node.receiver) - when SyntaxTree::VCall - node_name(node.value) - when SyntaxTree::Ident, SyntaxTree::Backtick, SyntaxTree::Const, SyntaxTree::Op - node.value - when NilClass, SyntaxTree::Node - nil - else - T.absurd(node) - end + !!ANNOTATIONS[node.name]&.match?(node) end end end diff --git a/ruby-lsp.gemspec b/ruby-lsp.gemspec index 391dccf23..35eb8065b 100644 --- a/ruby-lsp.gemspec +++ b/ruby-lsp.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.add_dependency("language_server-protocol", "~> 3.17.0") s.add_dependency("sorbet-runtime") s.add_dependency("syntax_tree", ">= 6.1.1", "< 7") - s.add_dependency("yarp", ">= 0.11", "< 0.12") + s.add_dependency("yarp", ">= 0.12", "< 0.13") s.required_ruby_version = ">= 3.0" end diff --git a/sorbet/rbi/gems/diff-lcs@1.5.0.rbi b/sorbet/rbi/gems/diff-lcs@1.5.0.rbi deleted file mode 100644 index 4e1f79154..000000000 --- a/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +++ /dev/null @@ -1,1083 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `diff-lcs` gem. -# Please instead update this file by running `bin/tapioca gem diff-lcs`. - -# source://diff-lcs//lib/diff/lcs.rb#3 -module Diff; end - -# source://diff-lcs//lib/diff/lcs.rb#51 -module Diff::LCS - # Returns the difference set between +self+ and +other+. See Diff::LCS#diff. - # - # source://diff-lcs//lib/diff/lcs.rb#75 - def diff(other, callbacks = T.unsafe(nil), &block); end - - # Returns an Array containing the longest common subsequence(s) between - # +self+ and +other+. See Diff::LCS#lcs. - # - # lcs = seq1.lcs(seq2) - # - # A note when using objects: Diff::LCS only works properly when each object - # can be used as a key in a Hash, which typically means that the objects must - # implement Object#eql? in a way that two identical values compare - # identically for key purposes. That is: - # - # O.new('a').eql?(O.new('a')) == true - # - # source://diff-lcs//lib/diff/lcs.rb#70 - def lcs(other, &block); end - - # Attempts to patch +self+ with the provided +patchset+. A new sequence based - # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Attempts - # to autodiscover the direction of the patch. - # - # source://diff-lcs//lib/diff/lcs.rb#101 - def patch(patchset); end - - # Attempts to patch +self+ with the provided +patchset+. A new sequence based - # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Does no - # patch direction autodiscovery. - # - # source://diff-lcs//lib/diff/lcs.rb#109 - def patch!(patchset); end - - # Attempts to patch +self+ with the provided +patchset+, using #patch!. If - # the sequence this is used on supports #replace, the value of +self+ will be - # replaced. See Diff::LCS#patch. Does no patch direction autodiscovery. - # - # source://diff-lcs//lib/diff/lcs.rb#123 - def patch_me(patchset); end - - # Returns the balanced ("side-by-side") difference set between +self+ and - # +other+. See Diff::LCS#sdiff. - # - # source://diff-lcs//lib/diff/lcs.rb#81 - def sdiff(other, callbacks = T.unsafe(nil), &block); end - - # Traverses the discovered longest common subsequences between +self+ and - # +other+ using the alternate, balanced algorithm. See - # Diff::LCS#traverse_balanced. - # - # source://diff-lcs//lib/diff/lcs.rb#94 - def traverse_balanced(other, callbacks = T.unsafe(nil), &block); end - - # Traverses the discovered longest common subsequences between +self+ and - # +other+. See Diff::LCS#traverse_sequences. - # - # source://diff-lcs//lib/diff/lcs.rb#87 - def traverse_sequences(other, callbacks = T.unsafe(nil), &block); end - - # Attempts to patch +self+ with the provided +patchset+. A new sequence based - # on +self+ and the +patchset+ will be created. See Diff::LCS#patch. Attempts - # to autodiscover the direction of the patch. - # - # source://diff-lcs//lib/diff/lcs.rb#101 - def unpatch(patchset); end - - # Attempts to unpatch +self+ with the provided +patchset+. A new sequence - # based on +self+ and the +patchset+ will be created. See Diff::LCS#unpatch. - # Does no patch direction autodiscovery. - # - # source://diff-lcs//lib/diff/lcs.rb#116 - def unpatch!(patchset); end - - # Attempts to unpatch +self+ with the provided +patchset+, using #unpatch!. - # If the sequence this is used on supports #replace, the value of +self+ will - # be replaced. See Diff::LCS#unpatch. Does no patch direction autodiscovery. - # - # source://diff-lcs//lib/diff/lcs.rb#134 - def unpatch_me(patchset); end - - class << self - # :yields seq1[i] for each matched: - # - # source://diff-lcs//lib/diff/lcs.rb#144 - def LCS(seq1, seq2, &block); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#52 - def callbacks_for(callbacks); end - - # #diff computes the smallest set of additions and deletions necessary to - # turn the first sequence into the second, and returns a description of these - # changes. - # - # See Diff::LCS::DiffCallbacks for the default behaviour. An alternate - # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a - # Class argument is provided for +callbacks+, #diff will attempt to - # initialise it. If the +callbacks+ object (possibly initialised) responds to - # #finish, it will be called. - # - # source://diff-lcs//lib/diff/lcs.rb#168 - def diff(seq1, seq2, callbacks = T.unsafe(nil), &block); end - - # :yields seq1[i] for each matched: - # - # source://diff-lcs//lib/diff/lcs.rb#144 - def lcs(seq1, seq2, &block); end - - # Applies a +patchset+ to the sequence +src+ according to the +direction+ - # (:patch or :unpatch), producing a new sequence. - # - # If the +direction+ is not specified, Diff::LCS::patch will attempt to - # discover the direction of the +patchset+. - # - # A +patchset+ can be considered to apply forward (:patch) if the - # following expression is true: - # - # patch(s1, diff(s1, s2)) -> s2 - # - # A +patchset+ can be considered to apply backward (:unpatch) if the - # following expression is true: - # - # patch(s2, diff(s1, s2)) -> s1 - # - # If the +patchset+ contains no changes, the +src+ value will be returned as - # either src.dup or +src+. A +patchset+ can be deemed as having no - # changes if the following predicate returns true: - # - # patchset.empty? or - # patchset.flatten(1).all? { |change| change.unchanged? } - # - # === Patchsets - # - # A +patchset+ is always an enumerable sequence of changes, hunks of changes, - # or a mix of the two. A hunk of changes is an enumerable sequence of - # changes: - # - # [ # patchset - # # change - # [ # hunk - # # change - # ] - # ] - # - # The +patch+ method accepts patchsets that are enumerable sequences - # containing either Diff::LCS::Change objects (or a subclass) or the array - # representations of those objects. Prior to application, array - # representations of Diff::LCS::Change objects will be reified. - # - # source://diff-lcs//lib/diff/lcs.rb#624 - def patch(src, patchset, direction = T.unsafe(nil)); end - - # Given a set of patchset, convert the current version to the next version. - # Does no auto-discovery. - # - # source://diff-lcs//lib/diff/lcs.rb#734 - def patch!(src, patchset); end - - # #sdiff computes all necessary components to show two sequences and their - # minimized differences side by side, just like the Unix utility - # sdiff does: - # - # old < - - # same same - # before | after - # - > new - # - # See Diff::LCS::SDiffCallbacks for the default behaviour. An alternate - # behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a - # Class argument is provided for +callbacks+, #diff will attempt to - # initialise it. If the +callbacks+ object (possibly initialised) responds to - # #finish, it will be called. - # - # Each element of a returned array is a Diff::LCS::ContextChange object, - # which can be implicitly converted to an array. - # - # Diff::LCS.sdiff(a, b).each do |action, (old_pos, old_element), (new_pos, new_element)| - # case action - # when '!' - # # replace - # when '-' - # # delete - # when '+' - # # insert - # end - # end - # - # source://diff-lcs//lib/diff/lcs.rb#200 - def sdiff(seq1, seq2, callbacks = T.unsafe(nil), &block); end - - # #traverse_balanced is an alternative to #traverse_sequences. It uses a - # different algorithm to iterate through the entries in the computed longest - # common subsequence. Instead of viewing the changes as insertions or - # deletions from one of the sequences, #traverse_balanced will report - # changes between the sequences. - # - # The arguments to #traverse_balanced are the two sequences to traverse and a - # callback object, like this: - # - # traverse_balanced(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new) - # - # #sdiff is implemented with #traverse_balanced. - # - # == Callback Methods - # - # Optional callback methods are emphasized. - # - # callbacks#match:: Called when +a+ and +b+ are pointing to - # common elements in +A+ and +B+. - # callbacks#discard_a:: Called when +a+ is pointing to an - # element not in +B+. - # callbacks#discard_b:: Called when +b+ is pointing to an - # element not in +A+. - # callbacks#change:: Called when +a+ and +b+ are pointing to - # the same relative position, but - # A[a] and B[b] are not - # the same; a change has - # occurred. - # - # #traverse_balanced might be a bit slower than #traverse_sequences, - # noticable only while processing huge amounts of data. - # - # == Algorithm - # - # a---+ - # v - # A = a b c e h j l m n p - # B = b c d e f j k l m r s t - # ^ - # b---+ - # - # === Matches - # - # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+ - # and +B+, the arrows will initially point to the first elements of their - # respective sequences. #traverse_sequences will advance the arrows through - # the sequences one element at a time, calling a method on the user-specified - # callback object before each advance. It will advance the arrows in such a - # way that if there are elements A[i] and B[j] which are - # both equal and part of the longest common subsequence, there will be some - # moment during the execution of #traverse_sequences when arrow +a+ is - # pointing to A[i] and arrow +b+ is pointing to B[j]. When - # this happens, #traverse_sequences will call callbacks#match and - # then it will advance both arrows. - # - # === Discards - # - # Otherwise, one of the arrows is pointing to an element of its sequence that - # is not part of the longest common subsequence. #traverse_sequences will - # advance that arrow and will call callbacks#discard_a or - # callbacks#discard_b, depending on which arrow it advanced. - # - # === Changes - # - # If both +a+ and +b+ point to elements that are not part of the longest - # common subsequence, then #traverse_sequences will try to call - # callbacks#change and advance both arrows. If - # callbacks#change is not implemented, then - # callbacks#discard_a and callbacks#discard_b will be - # called in turn. - # - # The methods for callbacks#match, callbacks#discard_a, - # callbacks#discard_b, and callbacks#change are invoked - # with an event comprising the action ("=", "+", "-", or "!", respectively), - # the indicies +i+ and +j+, and the elements A[i] and B[j]. - # Return values are discarded by #traverse_balanced. - # - # === Context - # - # Note that +i+ and +j+ may not be the same index position, even if +a+ and - # +b+ are considered to be pointing to matching or changed elements. - # - # source://diff-lcs//lib/diff/lcs.rb#475 - def traverse_balanced(seq1, seq2, callbacks = T.unsafe(nil)); end - - # #traverse_sequences is the most general facility provided by this module; - # #diff and #lcs are implemented as calls to it. - # - # The arguments to #traverse_sequences are the two sequences to traverse, and - # a callback object, like this: - # - # traverse_sequences(seq1, seq2, Diff::LCS::ContextDiffCallbacks.new) - # - # == Callback Methods - # - # Optional callback methods are emphasized. - # - # callbacks#match:: Called when +a+ and +b+ are pointing to - # common elements in +A+ and +B+. - # callbacks#discard_a:: Called when +a+ is pointing to an - # element not in +B+. - # callbacks#discard_b:: Called when +b+ is pointing to an - # element not in +A+. - # callbacks#finished_a:: Called when +a+ has reached the end of - # sequence +A+. - # callbacks#finished_b:: Called when +b+ has reached the end of - # sequence +B+. - # - # == Algorithm - # - # a---+ - # v - # A = a b c e h j l m n p - # B = b c d e f j k l m r s t - # ^ - # b---+ - # - # If there are two arrows (+a+ and +b+) pointing to elements of sequences +A+ - # and +B+, the arrows will initially point to the first elements of their - # respective sequences. #traverse_sequences will advance the arrows through - # the sequences one element at a time, calling a method on the user-specified - # callback object before each advance. It will advance the arrows in such a - # way that if there are elements A[i] and B[j] which are - # both equal and part of the longest common subsequence, there will be some - # moment during the execution of #traverse_sequences when arrow +a+ is - # pointing to A[i] and arrow +b+ is pointing to B[j]. When - # this happens, #traverse_sequences will call callbacks#match and - # then it will advance both arrows. - # - # Otherwise, one of the arrows is pointing to an element of its sequence that - # is not part of the longest common subsequence. #traverse_sequences will - # advance that arrow and will call callbacks#discard_a or - # callbacks#discard_b, depending on which arrow it advanced. If both - # arrows point to elements that are not part of the longest common - # subsequence, then #traverse_sequences will advance arrow +a+ and call the - # appropriate callback, then it will advance arrow +b+ and call the appropriate - # callback. - # - # The methods for callbacks#match, callbacks#discard_a, and - # callbacks#discard_b are invoked with an event comprising the - # action ("=", "+", or "-", respectively), the indicies +i+ and +j+, and the - # elements A[i] and B[j]. Return values are discarded by - # #traverse_sequences. - # - # === End of Sequences - # - # If arrow +a+ reaches the end of its sequence before arrow +b+ does, - # #traverse_sequence will try to call callbacks#finished_a with the - # last index and element of +A+ (A[-1]) and the current index and - # element of +B+ (B[j]). If callbacks#finished_a does not - # exist, then callbacks#discard_b will be called on each element of - # +B+ until the end of the sequence is reached (the call will be done with - # A[-1] and B[j] for each element). - # - # If +b+ reaches the end of +B+ before +a+ reaches the end of +A+, - # callbacks#finished_b will be called with the current index and - # element of +A+ (A[i]) and the last index and element of +B+ - # (A[-1]). Again, if callbacks#finished_b does not exist on - # the callback object, then callbacks#discard_a will be called on - # each element of +A+ until the end of the sequence is reached (A[i] - # and B[-1]). - # - # There is a chance that one additional callbacks#discard_a or - # callbacks#discard_b will be called after the end of the sequence - # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet - # reached the end of +B+. - # - # source://diff-lcs//lib/diff/lcs.rb#285 - def traverse_sequences(seq1, seq2, callbacks = T.unsafe(nil)); end - - # Given a set of patchset, convert the current version to the prior version. - # Does no auto-discovery. - # - # source://diff-lcs//lib/diff/lcs.rb#728 - def unpatch!(src, patchset); end - - private - - # source://diff-lcs//lib/diff/lcs/internals.rb#4 - def diff_traversal(method, seq1, seq2, callbacks, &block); end - end -end - -# An alias for DefaultCallbacks that is used in -# Diff::LCS#traverse_balanced. -# -# Diff::LCS.LCS(seq1, seq2, Diff::LCS::BalancedCallbacks) -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#50 -Diff::LCS::BalancedCallbacks = Diff::LCS::DefaultCallbacks - -# A block is an operation removing, adding, or changing a group of items. -# Basically, this is just a list of changes, where each change adds or -# deletes a single item. Used by bin/ldiff. -# -# source://diff-lcs//lib/diff/lcs/block.rb#6 -class Diff::LCS::Block - # @return [Block] a new instance of Block - # - # source://diff-lcs//lib/diff/lcs/block.rb#9 - def initialize(chunk); end - - # Returns the value of attribute changes. - # - # source://diff-lcs//lib/diff/lcs/block.rb#7 - def changes; end - - # source://diff-lcs//lib/diff/lcs/block.rb#21 - def diff_size; end - - # Returns the value of attribute insert. - # - # source://diff-lcs//lib/diff/lcs/block.rb#7 - def insert; end - - # source://diff-lcs//lib/diff/lcs/block.rb#25 - def op; end - - # Returns the value of attribute remove. - # - # source://diff-lcs//lib/diff/lcs/block.rb#7 - def remove; end -end - -# Represents a simplistic (non-contextual) change. Represents the removal or -# addition of an element from either the old or the new sequenced -# enumerable. -# -# source://diff-lcs//lib/diff/lcs/change.rb#6 -class Diff::LCS::Change - include ::Comparable - - # @return [Change] a new instance of Change - # - # source://diff-lcs//lib/diff/lcs/change.rb#27 - def initialize(*args); end - - # source://diff-lcs//lib/diff/lcs/change.rb#65 - def <=>(other); end - - # source://diff-lcs//lib/diff/lcs/change.rb#58 - def ==(other); end - - # Returns the action this Change represents. - # - # source://diff-lcs//lib/diff/lcs/change.rb#20 - def action; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#72 - def adding?; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#84 - def changed?; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#76 - def deleting?; end - - # Returns the sequence element of the Change. - # - # source://diff-lcs//lib/diff/lcs/change.rb#25 - def element; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#88 - def finished_a?; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#92 - def finished_b?; end - - # source://diff-lcs//lib/diff/lcs/change.rb#34 - def inspect(*_args); end - - # Returns the position of the Change. - # - # source://diff-lcs//lib/diff/lcs/change.rb#23 - def position; end - - # source://diff-lcs//lib/diff/lcs/change.rb#38 - def to_a; end - - # source://diff-lcs//lib/diff/lcs/change.rb#38 - def to_ary; end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#80 - def unchanged?; end - - class << self - # source://diff-lcs//lib/diff/lcs/change.rb#44 - def from_a(arr); end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/change.rb#15 - def valid_action?(action); end - end -end - -# source://diff-lcs//lib/diff/lcs/change.rb#7 -Diff::LCS::Change::IntClass = Integer - -# The only actions valid for changes are '+' (add), '-' (delete), '=' -# (no change), '!' (changed), '<' (tail changes from first sequence), or -# '>' (tail changes from second sequence). The last two ('<>') are only -# found with Diff::LCS::diff and Diff::LCS::sdiff. -# -# source://diff-lcs//lib/diff/lcs/change.rb#13 -Diff::LCS::Change::VALID_ACTIONS = T.let(T.unsafe(nil), Array) - -# Represents a contextual change. Contains the position and values of the -# elements in the old and the new sequenced enumerables as well as the action -# taken. -# -# source://diff-lcs//lib/diff/lcs/change.rb#100 -class Diff::LCS::ContextChange < ::Diff::LCS::Change - # @return [ContextChange] a new instance of ContextChange - # - # source://diff-lcs//lib/diff/lcs/change.rb#114 - def initialize(*args); end - - # source://diff-lcs//lib/diff/lcs/change.rb#166 - def <=>(other); end - - # source://diff-lcs//lib/diff/lcs/change.rb#157 - def ==(other); end - - # Returns the new element being changed. - # - # source://diff-lcs//lib/diff/lcs/change.rb#112 - def new_element; end - - # Returns the new position being changed. - # - # source://diff-lcs//lib/diff/lcs/change.rb#108 - def new_position; end - - # Returns the old element being changed. - # - # source://diff-lcs//lib/diff/lcs/change.rb#110 - def old_element; end - - # Returns the old position being changed. - # - # source://diff-lcs//lib/diff/lcs/change.rb#106 - def old_position; end - - # source://diff-lcs//lib/diff/lcs/change.rb#122 - def to_a; end - - # source://diff-lcs//lib/diff/lcs/change.rb#122 - def to_ary; end - - class << self - # source://diff-lcs//lib/diff/lcs/change.rb#132 - def from_a(arr); end - - # Simplifies a context change for use in some diff callbacks. '<' actions - # are converted to '-' and '>' actions are converted to '+'. - # - # source://diff-lcs//lib/diff/lcs/change.rb#138 - def simplify(event); end - end -end - -# This will produce a compound array of contextual diff change objects. Each -# element in the #diffs array is a "hunk" array, where each element in each -# "hunk" array is a single change. Each change is a Diff::LCS::ContextChange -# that contains both the old index and new index values for the change. The -# "hunk" provides the full context for the changes. Both old and new objects -# will be presented for changed objects. +nil+ will be substituted for a -# discarded object. -# -# seq1 = %w(a b c e h j l m n p) -# seq2 = %w(b c d e f j k l m r s t) -# -# diffs = Diff::LCS.diff(seq1, seq2, Diff::LCS::ContextDiffCallbacks) -# # This example shows a simplified array format. -# # [ [ [ '-', [ 0, 'a' ], [ 0, nil ] ] ], # 1 -# # [ [ '+', [ 3, nil ], [ 2, 'd' ] ] ], # 2 -# # [ [ '-', [ 4, 'h' ], [ 4, nil ] ], # 3 -# # [ '+', [ 5, nil ], [ 4, 'f' ] ] ], -# # [ [ '+', [ 6, nil ], [ 6, 'k' ] ] ], # 4 -# # [ [ '-', [ 8, 'n' ], [ 9, nil ] ], # 5 -# # [ '+', [ 9, nil ], [ 9, 'r' ] ], -# # [ '-', [ 9, 'p' ], [ 10, nil ] ], -# # [ '+', [ 10, nil ], [ 10, 's' ] ], -# # [ '+', [ 10, nil ], [ 11, 't' ] ] ] ] -# -# The five hunks shown are comprised of individual changes; if there is a -# related set of changes, they are still shown individually. -# -# This callback can also be used with Diff::LCS#sdiff, which will produce -# results like: -# -# diffs = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextCallbacks) -# # This example shows a simplified array format. -# # [ [ [ "-", [ 0, "a" ], [ 0, nil ] ] ], # 1 -# # [ [ "+", [ 3, nil ], [ 2, "d" ] ] ], # 2 -# # [ [ "!", [ 4, "h" ], [ 4, "f" ] ] ], # 3 -# # [ [ "+", [ 6, nil ], [ 6, "k" ] ] ], # 4 -# # [ [ "!", [ 8, "n" ], [ 9, "r" ] ], # 5 -# # [ "!", [ 9, "p" ], [ 10, "s" ] ], -# # [ "+", [ 10, nil ], [ 11, "t" ] ] ] ] -# -# The five hunks are still present, but are significantly shorter in total -# presentation, because changed items are shown as changes ("!") instead of -# potentially "mismatched" pairs of additions and deletions. -# -# The result of this operation is similar to that of -# Diff::LCS::SDiffCallbacks. They may be compared as: -# -# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" } -# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1) -# -# s == c # -> true -# -# === Use -# -# This callback object must be initialised and can be used by the -# Diff::LCS#diff or Diff::LCS#sdiff methods. -# -# cbo = Diff::LCS::ContextDiffCallbacks.new -# Diff::LCS.LCS(seq1, seq2, cbo) -# cbo.finish -# -# Note that the call to #finish is absolutely necessary, or the last set of -# changes will not be visible. Alternatively, can be used as: -# -# cbo = Diff::LCS::ContextDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } -# -# The necessary #finish call will be made. -# -# === Simplified Array Format -# -# The simplified array format used in the example above can be obtained -# with: -# -# require 'pp' -# pp diffs.map { |e| e.map { |f| f.to_a } } -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#223 -class Diff::LCS::ContextDiffCallbacks < ::Diff::LCS::DiffCallbacks - # source://diff-lcs//lib/diff/lcs/callbacks.rb#232 - def change(event); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#224 - def discard_a(event); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#228 - def discard_b(event); end -end - -# This callback object implements the default set of callback events, -# which only returns the event itself. Note that #finished_a and -# #finished_b are not implemented -- I haven't yet figured out where they -# would be useful. -# -# Note that this is intended to be called as is, e.g., -# -# Diff::LCS.LCS(seq1, seq2, Diff::LCS::DefaultCallbacks) -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#14 -class Diff::LCS::DefaultCallbacks - class << self - # Called when both the old and new values have changed. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#32 - def change(event); end - - # Called when the old value is discarded in favour of the new value. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#22 - def discard_a(event); end - - # Called when the new value is discarded in favour of the old value. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#27 - def discard_b(event); end - - # Called when two items match. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#17 - def match(event); end - - private - - def new(*_arg0); end - end -end - -# This will produce a compound array of simple diff change objects. Each -# element in the #diffs array is a +hunk+ or +hunk+ array, where each -# element in each +hunk+ array is a single Change object representing the -# addition or removal of a single element from one of the two tested -# sequences. The +hunk+ provides the full context for the changes. -# -# diffs = Diff::LCS.diff(seq1, seq2) -# # This example shows a simplified array format. -# # [ [ [ '-', 0, 'a' ] ], # 1 -# # [ [ '+', 2, 'd' ] ], # 2 -# # [ [ '-', 4, 'h' ], # 3 -# # [ '+', 4, 'f' ] ], -# # [ [ '+', 6, 'k' ] ], # 4 -# # [ [ '-', 8, 'n' ], # 5 -# # [ '-', 9, 'p' ], -# # [ '+', 9, 'r' ], -# # [ '+', 10, 's' ], -# # [ '+', 11, 't' ] ] ] -# -# There are five hunks here. The first hunk says that the +a+ at position 0 -# of the first sequence should be deleted ('-'). The second hunk -# says that the +d+ at position 2 of the second sequence should be inserted -# ('+'). The third hunk says that the +h+ at position 4 of the -# first sequence should be removed and replaced with the +f+ from position 4 -# of the second sequence. The other two hunks are described similarly. -# -# === Use -# -# This callback object must be initialised and is used by the Diff::LCS#diff -# method. -# -# cbo = Diff::LCS::DiffCallbacks.new -# Diff::LCS.LCS(seq1, seq2, cbo) -# cbo.finish -# -# Note that the call to #finish is absolutely necessary, or the last set of -# changes will not be visible. Alternatively, can be used as: -# -# cbo = Diff::LCS::DiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } -# -# The necessary #finish call will be made. -# -# === Simplified Array Format -# -# The simplified array format used in the example above can be obtained -# with: -# -# require 'pp' -# pp diffs.map { |e| e.map { |f| f.to_a } } -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#106 -class Diff::LCS::DiffCallbacks - # :yields self: - # - # @return [DiffCallbacks] a new instance of DiffCallbacks - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#110 - def initialize; end - - # Returns the difference set collected during the diff process. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#108 - def diffs; end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#133 - def discard_a(event); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#137 - def discard_b(event); end - - # Finalizes the diff process. If an unprocessed hunk still exists, then it - # is appended to the diff list. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#125 - def finish; end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#129 - def match(_event); end - - private - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#141 - def finish_hunk; end -end - -# A Hunk is a group of Blocks which overlap because of the context surrounding -# each block. (So if we're not using context, every hunk will contain one -# block.) Used in the diff program (bin/ldiff). -# -# source://diff-lcs//lib/diff/lcs/hunk.rb#8 -class Diff::LCS::Hunk - # Create a hunk using references to both the old and new data, as well as the - # piece of data. - # - # @return [Hunk] a new instance of Hunk - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#16 - def initialize(data_old, data_new, piece, flag_context, file_length_difference); end - - # Returns the value of attribute blocks. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#63 - def blocks; end - - # Returns a diff string based on a format. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#116 - def diff(format, last = T.unsafe(nil)); end - - # Returns the value of attribute end_new. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#65 - def end_new; end - - # Returns the value of attribute end_old. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#65 - def end_old; end - - # Returns the value of attribute file_length_difference. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#66 - def file_length_difference; end - - # Change the "start" and "end" fields to note that context should be added - # to this hunk. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#70 - def flag_context; end - - # source://diff-lcs//lib/diff/lcs/hunk.rb#72 - def flag_context=(context); end - - # Merges this hunk and the provided hunk together if they overlap. Returns - # a truthy value so that if there is no overlap, you can know the merge - # was skipped. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#98 - def merge(hunk); end - - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#326 - def missing_last_newline?(data); end - - # Determines whether there is an overlap between this hunk and the - # provided hunk. This will be true if the difference between the two hunks - # start or end positions is within one position of each other. - # - # @return [Boolean] - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#110 - def overlaps?(hunk); end - - # Returns the value of attribute start_new. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#64 - def start_new; end - - # Returns the value of attribute start_old. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#64 - def start_old; end - - # Merges this hunk and the provided hunk together if they overlap. Returns - # a truthy value so that if there is no overlap, you can know the merge - # was skipped. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#98 - def unshift(hunk); end - - private - - # source://diff-lcs//lib/diff/lcs/hunk.rb#213 - def context_diff(last = T.unsafe(nil)); end - - # Generate a range of item numbers to print. Only print 1 number if the - # range has only one item in it. Otherwise, it's 'start,end' - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#293 - def context_range(mode, op, last = T.unsafe(nil)); end - - # source://diff-lcs//lib/diff/lcs/hunk.rb#271 - def ed_diff(format, _last = T.unsafe(nil)); end - - # source://diff-lcs//lib/diff/lcs/hunk.rb#339 - def encode(literal, target_encoding = T.unsafe(nil)); end - - # source://diff-lcs//lib/diff/lcs/hunk.rb#343 - def encode_as(string, *args); end - - # Note that an old diff can't have any context. Therefore, we know that - # there's only one block in the hunk. - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#135 - def old_diff(_last = T.unsafe(nil)); end - - # source://diff-lcs//lib/diff/lcs/hunk.rb#160 - def unified_diff(last = T.unsafe(nil)); end - - # Generate a range of item numbers to print for unified diff. Print number - # where block starts, followed by number of lines in the block - # (don't print number of lines if it's 1) - # - # source://diff-lcs//lib/diff/lcs/hunk.rb#311 - def unified_range(mode, last); end -end - -# source://diff-lcs//lib/diff/lcs/hunk.rb#10 -Diff::LCS::Hunk::ED_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) - -# source://diff-lcs//lib/diff/lcs/hunk.rb#9 -Diff::LCS::Hunk::OLD_DIFF_OP_ACTION = T.let(T.unsafe(nil), Hash) - -# source://diff-lcs//lib/diff/lcs/internals.rb#29 -module Diff::LCS::Internals - class << self - # This method will analyze the provided patchset to provide a single-pass - # normalization (conversion of the array form of Diff::LCS::Change objects to - # the object form of same) and detection of whether the patchset represents - # changes to be made. - # - # source://diff-lcs//lib/diff/lcs/internals.rb#102 - def analyze_patchset(patchset, depth = T.unsafe(nil)); end - - # Examine the patchset and the source to see in which direction the - # patch should be applied. - # - # WARNING: By default, this examines the whole patch, so this could take - # some time. This also works better with Diff::LCS::ContextChange or - # Diff::LCS::Change as its source, as an array will cause the creation - # of one of the above. - # - # source://diff-lcs//lib/diff/lcs/internals.rb#147 - def intuit_diff_direction(src, patchset, limit = T.unsafe(nil)); end - - # Compute the longest common subsequence between the sequenced - # Enumerables +a+ and +b+. The result is an array whose contents is such - # that - # - # result = Diff::LCS::Internals.lcs(a, b) - # result.each_with_index do |e, i| - # assert_equal(a[i], b[e]) unless e.nil? - # end - # - # source://diff-lcs//lib/diff/lcs/internals.rb#41 - def lcs(a, b); end - - private - - # If +vector+ maps the matching elements of another collection onto this - # Enumerable, compute the inverse of +vector+ that maps this Enumerable - # onto the collection. (Currently unused.) - # - # source://diff-lcs//lib/diff/lcs/internals.rb#286 - def inverse_vector(a, vector); end - - # Returns a hash mapping each element of an Enumerable to the set of - # positions it occupies in the Enumerable, optionally restricted to the - # elements specified in the range of indexes specified by +interval+. - # - # source://diff-lcs//lib/diff/lcs/internals.rb#298 - def position_hash(enum, interval); end - - # Find the place at which +value+ would normally be inserted into the - # Enumerable. If that place is already occupied by +value+, do nothing - # and return +nil+. If the place does not exist (i.e., it is off the end - # of the Enumerable), add it to the end. Otherwise, replace the element - # at that point with +value+. It is assumed that the Enumerable's values - # are numeric. - # - # This operation preserves the sort order. - # - # source://diff-lcs//lib/diff/lcs/internals.rb#252 - def replace_next_larger(enum, value, last_index = T.unsafe(nil)); end - end -end - -# This will produce a simple array of diff change objects. Each element in -# the #diffs array is a single ContextChange. In the set of #diffs provided -# by SDiffCallbacks, both old and new objects will be presented for both -# changed and unchanged objects. +nil+ will be substituted -# for a discarded object. -# -# The diffset produced by this callback, when provided to Diff::LCS#sdiff, -# will compute and display the necessary components to show two sequences -# and their minimized differences side by side, just like the Unix utility -# +sdiff+. -# -# same same -# before | after -# old < - -# - > new -# -# seq1 = %w(a b c e h j l m n p) -# seq2 = %w(b c d e f j k l m r s t) -# -# diffs = Diff::LCS.sdiff(seq1, seq2) -# # This example shows a simplified array format. -# # [ [ "-", [ 0, "a"], [ 0, nil ] ], -# # [ "=", [ 1, "b"], [ 0, "b" ] ], -# # [ "=", [ 2, "c"], [ 1, "c" ] ], -# # [ "+", [ 3, nil], [ 2, "d" ] ], -# # [ "=", [ 3, "e"], [ 3, "e" ] ], -# # [ "!", [ 4, "h"], [ 4, "f" ] ], -# # [ "=", [ 5, "j"], [ 5, "j" ] ], -# # [ "+", [ 6, nil], [ 6, "k" ] ], -# # [ "=", [ 6, "l"], [ 7, "l" ] ], -# # [ "=", [ 7, "m"], [ 8, "m" ] ], -# # [ "!", [ 8, "n"], [ 9, "r" ] ], -# # [ "!", [ 9, "p"], [ 10, "s" ] ], -# # [ "+", [ 10, nil], [ 11, "t" ] ] ] -# -# The result of this operation is similar to that of -# Diff::LCS::ContextDiffCallbacks. They may be compared as: -# -# s = Diff::LCS.sdiff(seq1, seq2).reject { |e| e.action == "=" } -# c = Diff::LCS.sdiff(seq1, seq2, Diff::LCS::ContextDiffCallbacks).flatten(1) -# -# s == c # -> true -# -# === Use -# -# This callback object must be initialised and is used by the Diff::LCS#sdiff -# method. -# -# cbo = Diff::LCS::SDiffCallbacks.new -# Diff::LCS.LCS(seq1, seq2, cbo) -# -# As with the other initialisable callback objects, -# Diff::LCS::SDiffCallbacks can be initialised with a block. As there is no -# "fininishing" to be done, this has no effect on the state of the object. -# -# cbo = Diff::LCS::SDiffCallbacks.new { |tcbo| Diff::LCS.LCS(seq1, seq2, tcbo) } -# -# === Simplified Array Format -# -# The simplified array format used in the example above can be obtained -# with: -# -# require 'pp' -# pp diffs.map { |e| e.to_a } -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#301 -class Diff::LCS::SDiffCallbacks - # :yields self: - # - # @return [SDiffCallbacks] a new instance of SDiffCallbacks - # @yield [_self] - # @yieldparam _self [Diff::LCS::SDiffCallbacks] the object that the method was called on - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#305 - def initialize; end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#322 - def change(event); end - - # Returns the difference set collected during the diff process. - # - # source://diff-lcs//lib/diff/lcs/callbacks.rb#303 - def diffs; end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#314 - def discard_a(event); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#318 - def discard_b(event); end - - # source://diff-lcs//lib/diff/lcs/callbacks.rb#310 - def match(event); end -end - -# An alias for DefaultCallbacks that is used in -# Diff::LCS#traverse_sequences. -# -# Diff::LCS.LCS(seq1, seq2, Diff::LCS::SequenceCallbacks) -# -# source://diff-lcs//lib/diff/lcs/callbacks.rb#44 -Diff::LCS::SequenceCallbacks = Diff::LCS::DefaultCallbacks - -# source://diff-lcs//lib/diff/lcs.rb#52 -Diff::LCS::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/unparser@0.6.8.rbi b/sorbet/rbi/gems/unparser@0.6.8.rbi deleted file mode 100644 index 937e27312..000000000 --- a/sorbet/rbi/gems/unparser@0.6.8.rbi +++ /dev/null @@ -1,4525 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `unparser` gem. -# Please instead update this file by running `bin/tapioca gem unparser`. - -# Library namespace -# -# source://unparser//lib/unparser/equalizer.rb#3 -module Unparser - class << self - # Construct a parser buffer from string - # - # @param source [String] - # @return [Parser::Source::Buffer] - # - # source://unparser//lib/unparser.rb#147 - def buffer(source, identification = T.unsafe(nil)); end - - # Parse string into AST - # - # @param source [String] - # @return [Parser::AST::Node, nil] - # - # source://unparser//lib/unparser.rb#105 - def parse(source); end - - # Parse string into either syntax error or AST - # - # @param source [String] - # @return [Either] - # - # source://unparser//lib/unparser.rb#114 - def parse_either(source); end - - # Parse string into AST, with comments - # - # @param source [String] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser.rb#125 - def parse_with_comments(source); end - - # Parser instance that produces AST unparser understands - # - # @api private - # @return [Parser::Base] - # - # source://unparser//lib/unparser.rb#134 - def parser; end - - # Unparse an AST (and, optionally, comments) into a string - # - # @api public - # @param node [Parser::AST::Node, nil] - # @param comment_array [Array] - # @raise InvalidNodeError - # if the node passed is invalid - # @return [String] - # - # source://unparser//lib/unparser.rb#60 - def unparse(node, comment_array = T.unsafe(nil)); end - - # Unparse capturing errors - # - # This is mostly useful for writing testing tools against unparser. - # - # @param node [Parser::AST::Node, nil] - # @return [Either] - # - # source://unparser//lib/unparser.rb#96 - def unparse_either(node); end - - # Unparse with validation - # - # @param node [Parser::AST::Node, nil] - # @param comment_array [Array] - # @return [Either] - # - # source://unparser//lib/unparser.rb#78 - def unparse_validate(node, comment_array = T.unsafe(nil)); end - end -end - -# Namespace for AST processing tools -# -# source://unparser//lib/unparser/ast.rb#5 -module Unparser::AST - class << self - # Return local variables that get assigned in scope - # - # @api private - # @param node [Parser::AST::Node] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#57 - def local_variable_assignments(node); end - - # Return local variables read - # - # @api private - # @param node [Parser::AST::Node] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#72 - def local_variable_reads(node); end - - # Test for local variable inherited scope reset - # - # @api private - # @param node [Parser::AST::Node] - # @return [Boolean] - # - # source://unparser//lib/unparser/ast.rb#33 - def not_close_scope?(node); end - - # Test for local variable scope reset - # - # @api private - # @param node [Parser::AST::Node] - # @return [Boolean] - # - # source://unparser//lib/unparser/ast.rb#45 - def not_reset_scope?(node); end - end -end - -# Nodes that assign a local variable -# -# source://unparser//lib/unparser/ast.rb#14 -Unparser::AST::ASSIGN_NODES = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/ast.rb#11 -Unparser::AST::CLOSE_NODES = T.let(T.unsafe(nil), Array) - -# AST enumerator -# -# source://unparser//lib/unparser/ast.rb#80 -class Unparser::AST::Enumerator - include ::Enumerable - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Return each node - # - # @api private - # @return [Enumerator] if no block given - # @return [self] otherwise - # - # source://unparser//lib/unparser/ast.rb#106 - def each(&block); end - - # Return nodes selected by type - # - # @api private - # @param type [Symbol] - # @return [Enumerable] - # - # source://unparser//lib/unparser/ast.rb#130 - def type(type); end - - # Return nodes selected by types - # - # @api private - # @param types [Enumerable] - # @return [Enumerable] - # - # source://unparser//lib/unparser/ast.rb#118 - def types(types); end - - class << self - # Return new instance - # - # @api private - # @param node [Parser::AST::Node] - # @param controller [#call(node)] - # @return [Enumerator] - # - # source://unparser//lib/unparser/ast.rb#92 - def new(node, controller = T.unsafe(nil)); end - - private - - # Return frozne set of objects - # - # @api private - # @param enumerable [Enumerable] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#142 - def set(enumerable); end - - # Return nodes of type - # - # @api private - # @param node [Parser::AST::Node] - # @param type [Symbol] - # @return [Enumerable>] ] - # otherwise - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#121 - def each(node, &block); end - - private - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#127 - def current; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#156 - def define(name); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#141 - def enter(node); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#152 - def leave(node); end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#168 - def pop; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#164 - def push_inherit; end - - # source://unparser//lib/unparser/ast/local_variable_scope.rb#160 - def push_reset; end - - # @yield [node, current.dup, before] - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#131 - def visit(node, &block); end - - class << self - # Enumerate each node with its local variable scope - # - # @api private - # @param node [Parser::AST::Node] - # @return [self] - # - # source://unparser//lib/unparser/ast/local_variable_scope.rb#106 - def each(node, &block); end - end -end - -# source://unparser//lib/unparser/ast.rb#9 -Unparser::AST::RESET_NODES = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/ast.rb#7 -Unparser::AST::TAUTOLOGY = T.let(T.unsafe(nil), Proc) - -# Controlled AST walker walking the AST in deeth first search with pre order -# -# source://unparser//lib/unparser/ast.rb#164 -class Unparser::AST::Walker - include ::Unparser::Equalizer::Methods - - # Call walker with node - # - # @api private - # @param node [Parser::AST::Node] - # @return [undefined] - # - # source://unparser//lib/unparser/ast.rb#188 - def call(node); end - - class << self - # Call ast walker - # - # @api private - # @param node [Parser::AST::Node] - # @return [self] - # - # source://unparser//lib/unparser/ast.rb#175 - def call(node, controller = T.unsafe(nil), &block); end - end -end - -# Module to allow class and methods to be abstract -# -# Original code before vendoring and reduction from: https://github.com/dkubb/abstract_type. -# -# source://unparser//lib/unparser/abstract_type.rb#7 -module Unparser::AbstractType - mixes_in_class_methods ::Unparser::AbstractType::AbstractMethodDeclarations - - class << self - private - - # Define the new method on the abstract type - # - # Ensures that the instance cannot be of the abstract type - # and must be a descendant. - # - # @api private - # @param abstract_class [Class] - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#35 - def create_new_method(abstract_class); end - - # Hook called when module is included - # - # @api private - # @param descendant [Module] the module or class including AbstractType - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#17 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/abstract_type.rb#47 -module Unparser::AbstractType::AbstractMethodDeclarations - # Create abstract instance methods - # - # @api public - # @example - # class Foo - # include AbstractType - # - # # Create an abstract instance method - # abstract_method :some_method - # end - # @param names [Array<#to_s>] - # @return [self] - # - # source://unparser//lib/unparser/abstract_type.rb#64 - def abstract_method(*names); end - - # Create abstract singleton methods - # - # @api private - # @example - # class Foo - # include AbstractType - # - # # Create an abstract instance method - # abstract_singleton_method :some_method - # end - # @param names [Array<#to_s>] - # @return [self] - # - # source://unparser//lib/unparser/abstract_type.rb#84 - def abstract_singleton_method(*names); end - - private - - # Create abstract instance method - # - # @api private - # @param name [#to_s] the name of the method to create - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#113 - def create_abstract_instance_method(name); end - - # Create abstract singleton method - # - # @api private - # @param name [#to_s] the name of the method to create - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#99 - def create_abstract_singleton_method(name); end -end - -# Allows objects to be made immutable -# -# Original code before vendoring and reduction from: https://github.com/dkubb/adamantium. -# -# source://unparser//lib/unparser/adamantium.rb#7 -module Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - - mixes_in_class_methods ::Unparser::Adamantium::ModuleMethods - mixes_in_class_methods ::Unparser::Adamantium::ClassMethods - - class << self - private - - # ModuleMethods - # - # source://unparser//lib/unparser/adamantium.rb#141 - def included(descendant); end - end -end - -# Methods mixed in to adamantium classes -# -# source://unparser//lib/unparser/adamantium.rb#70 -module Unparser::Adamantium::ClassMethods - # Instantiate a new frozen object - # - # @api public - # @return [Object] - # - # source://unparser//lib/unparser/adamantium.rb#77 - def new(*_arg0); end -end - -# source://unparser//lib/unparser/adamantium.rb#8 -module Unparser::Adamantium::InstanceMethods - # A noop #dup for immutable objects - # - # @api public - # @return [self] - # - # source://unparser//lib/unparser/adamantium.rb#14 - def dup; end - - # Freeze the object - # - # @api public - # @return [Object] - # - # source://unparser//lib/unparser/adamantium.rb#23 - def freeze; end - - private - - # source://unparser//lib/unparser/adamantium.rb#30 - def memoized_method_cache; end -end - -# Storage for memoized methods -# -# source://unparser//lib/unparser/adamantium.rb#37 -class Unparser::Adamantium::Memory - # Initialize the memory storage for memoized methods - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/adamantium.rb#44 - def initialize(values); end - - # Fetch the value from memory, or evaluate if it does not exist - # - # @api public - # @param name [Symbol] - # @yieldreturn [Object] the value to memoize - # - # source://unparser//lib/unparser/adamantium.rb#58 - def fetch(name); end -end - -# Build the memoized method -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#6 -class Unparser::Adamantium::MethodBuilder - # Initialize an object to build a memoized method - # - # @api private - # @param descendant [Module] - # @param method_name [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#47 - def initialize(descendant, method_name); end - - # Build a new memoized method - # - # @api public - # @example - # method_builder.call # => creates new method - # @return [UnboundMethod] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#63 - def call; end - - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#72 - def assert_arity(arity); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#83 - def create_memoized_method; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#78 - def remove_original_method; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#97 - def set_method_visibility; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#101 - def visibility; end -end - -# Raised when a block is passed to a memoized method -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#25 -class Unparser::Adamantium::MethodBuilder::BlockNotAllowedError < ::ArgumentError - # Initialize a block not allowed exception - # - # @api private - # @param descendant [Module] - # @param method [Symbol] - # @return [BlockNotAllowedError] a new instance of BlockNotAllowedError - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#33 - def initialize(descendant, method); end -end - -# Raised when the method arity is invalid -# -# source://unparser//lib/unparser/adamantium/method_builder.rb#9 -class Unparser::Adamantium::MethodBuilder::InvalidArityError < ::ArgumentError - # Initialize an invalid arity exception - # - # @api private - # @param descendant [Module] - # @param method [Symbol] - # @param arity [Integer] - # @return [InvalidArityError] a new instance of InvalidArityError - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#18 - def initialize(descendant, method, arity); end -end - -# Methods mixed in to adamantium modules -# -# source://unparser//lib/unparser/adamantium.rb#84 -module Unparser::Adamantium::ModuleMethods - # Memoize a list of methods - # - # @api public - # @param methods [Array<#to_s>] a list of methods to memoize - # @return [self] - # - # source://unparser//lib/unparser/adamantium.rb#94 - def memoize(*methods); end - - # Test if method is memoized - # - # @param name [Symbol] - # @return [Bool] - # - # source://unparser//lib/unparser/adamantium.rb#104 - def memoized?(method_name); end - - # Return unmemoized instance method - # - # @api public - # @param name [Symbol] - # @raise [NameError] raised if the method is unknown - # @return [UnboundMethod] the memoized method - # - # source://unparser//lib/unparser/adamantium.rb#119 - def unmemoized_instance_method(method_name); end - - private - - # source://unparser//lib/unparser/adamantium.rb#127 - def memoize_method(method_name); end - - # source://unparser//lib/unparser/adamantium.rb#135 - def memoized_methods; end -end - -# Original code before vendoring and reduction from: https://github.com/mbj/anima. -# -# source://unparser//lib/unparser/anima.rb#5 -class Unparser::Anima < ::Module - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize object - # - # - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#18 - def initialize(*names); end - - # Return new anima with attributes added - # - # @example - # anima = Anima.new(:foo) - # anima.add(:bar) # equals Anima.new(:foo, :bar) - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#31 - def add(*names); end - - # Return attribute names - # - # @return [Enumerable] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def attribute_names(&block); end - - # Return names - # - # @return [AttributeSet] - # - # source://unparser//lib/unparser/anima.rb#11 - def attributes; end - - # Return attributes hash for instance - # - # @param object [Object] - # @return [Hash] - # - # source://unparser//lib/unparser/anima.rb#52 - def attributes_hash(object); end - - # Initialize instance - # - # @param object [Object] - # @param attribute_hash [Hash] - # @return [self] - # - # source://unparser//lib/unparser/anima.rb#73 - def initialize_instance(object, attribute_hash); end - - # Return new anima with attributes removed - # - # @example - # anima = Anima.new(:foo, :bar) - # anima.remove(:bar) # equals Anima.new(:foo) - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#43 - def remove(*names); end - - private - - # Fail unless keys in +attribute_hash+ matches #attribute_names - # - # @param klass [Class] the class being initialized - # @param attribute_hash [Hash] the attributes to initialize +object+ with - # @raise [Error] - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#164 - def assert_known_attributes(klass, attribute_hash); end - - # Infect the instance with anima - # - # @param scope [Class, Module] - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#137 - def included(descendant); end - - # Return new instance - # - # @param attributes [Enumerable] - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#180 - def new(attributes); end -end - -# An attribute -# -# source://unparser//lib/unparser/anima/attribute.rb#6 -class Unparser::Anima::Attribute - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize attribute - # - # @param name [Symbol] - # @return [Attribute] a new instance of Attribute - # - # source://unparser//lib/unparser/anima/attribute.rb#12 - def initialize(name); end - - # Get attribute value from object - # - # @param object [Object] - # @return [Object] - # - # source://unparser//lib/unparser/anima/attribute.rb#42 - def get(object); end - - # Return instance variable name - # - # @return [Symbol] - # - # source://unparser//lib/unparser/anima/attribute.rb#25 - def instance_variable_name; end - - # Load attribute - # - # @param object [Object] - # @param attributes [Hash] - # @return [self] - # - # source://unparser//lib/unparser/anima/attribute.rb#33 - def load(object, attributes); end - - # Return attribute name - # - # @return [Symbol] - # - # source://unparser//lib/unparser/anima/attribute.rb#20 - def name; end - - # Set attribute value in object - # - # @param object [Object] - # @param value [Object] - # @return [self] - # - # source://unparser//lib/unparser/anima/attribute.rb#52 - def set(object, value); end -end - -# Abstract base class for anima errors -# -# source://unparser//lib/unparser/anima/error.rb#6 -class Unparser::Anima::Error < ::RuntimeError - # Initialize object - # - # @param klass [Class] the class being initialized - # @param missing [Enumerable] - # @param unknown [Enumerable] - # @return [undefined] - # - # source://unparser//lib/unparser/anima/error.rb#18 - def initialize(klass, missing, unknown); end -end - -# source://unparser//lib/unparser/anima/error.rb#7 -Unparser::Anima::Error::FORMAT = T.let(T.unsafe(nil), String) - -# Static instance methods for anima infected classes -# -# source://unparser//lib/unparser/anima.rb#82 -module Unparser::Anima::InstanceMethods - # Initialize an anima infected object - # - # - # @param attributes [#to_h] a hash that matches anima defined attributes - # @return [undefined] - # - # source://unparser//lib/unparser/anima.rb#91 - def initialize(attributes); end - - # Return a hash representation of an anima infected object - # - # @api public - # @example - # anima.to_h # => { :foo => : bar } - # @return [Hash] - # - # source://unparser//lib/unparser/anima.rb#104 - def to_h; end - - # Return updated instance - # - # @api public - # @example - # klass = Class.new do - # include Anima.new(:foo, :bar) - # end - # - # foo = klass.new(:foo => 1, :bar => 2) - # updated = foo.with(:foo => 3) - # updated.foo # => 3 - # updated.bar # => 2 - # @param attributes [Hash] - # @return [Anima] - # - # source://unparser//lib/unparser/anima.rb#125 - def with(attributes); end -end - -# Buffer used to emit into -# -# source://unparser//lib/unparser/buffer.rb#6 -class Unparser::Buffer - # Initialize object - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/buffer.rb#16 - def initialize; end - - # Append string - # - # @api private - # @param string [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#29 - def append(string); end - - # Append a string without an indentation prefix - # - # @api private - # @param string [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#45 - def append_without_prefix(string); end - - # Return content of buffer - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/buffer.rb#104 - def content; end - - # Test for a fresh line - # - # @api private - # @return [Boolean] - # - # source://unparser//lib/unparser/buffer.rb#94 - def fresh_line?; end - - # Increase indent - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#55 - def indent; end - - # Write newline - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#77 - def nl; end - - # source://unparser//lib/unparser/buffer.rb#81 - def root_indent; end - - # Decrease indent - # - # @api private - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#66 - def unindent; end - - # Write raw fragment to buffer - # - # Does not do indentation logic. - # - # @param fragment [String] - # @return [self] - # - # source://unparser//lib/unparser/buffer.rb#115 - def write(fragment); end - - private - - # source://unparser//lib/unparser/buffer.rb#124 - def prefix; end -end - -# source://unparser//lib/unparser/buffer.rb#122 -Unparser::Buffer::INDENT_SPACE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/buffer.rb#8 -Unparser::Buffer::NL = T.let(T.unsafe(nil), String) - -# Unparser specific AST builder defaulting to modern AST format -# -# source://unparser//lib/unparser.rb#23 -class Unparser::Builder < ::Parser::Builders::Default - # @return [Builder] a new instance of Builder - # - # source://unparser//lib/unparser.rb#26 - def initialize; end -end - -# Unparser CLI implementation -# -# source://unparser//lib/unparser/cli.rb#5 -class Unparser::CLI - # Initialize object - # - # @api private - # @param arguments [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/cli.rb#74 - def initialize(arguments); end - - # Add options - # - # - # @api private - # @param builder [OptionParser] - # @return [undefined] - # - # source://unparser//lib/unparser/cli.rb#102 - def add_options(builder); end - - # Return exit status - # - # @api private - # @return [Integer] - # - # source://unparser//lib/unparser/cli.rb#132 - def exit_status; end - - private - - # source://unparser//lib/unparser/cli.rb#155 - def effective_targets; end - - # source://unparser//lib/unparser/cli.rb#143 - def process_target(target); end - - # source://unparser//lib/unparser/cli.rb#170 - def targets(file_name); end - - class << self - # Run CLI - # - # @api private - # @param arguments [Array] - # @return [Integer] the exit status - # - # source://unparser//lib/unparser/cli.rb#63 - def run(*arguments); end - end -end - -# source://unparser//lib/unparser/cli.rb#8 -Unparser::CLI::EXIT_FAILURE = T.let(T.unsafe(nil), Integer) - -# source://unparser//lib/unparser/cli.rb#7 -Unparser::CLI::EXIT_SUCCESS = T.let(T.unsafe(nil), Integer) - -# source://unparser//lib/unparser/cli.rb#10 -class Unparser::CLI::Target - include ::Unparser::AbstractType - extend ::Unparser::AbstractType::AbstractMethodDeclarations - - class << self - # source://unparser//lib/unparser/abstract_type.rb#36 - def new(*args, &block); end - end -end - -# Path target -# -# source://unparser//lib/unparser/cli.rb#14 -class Unparser::CLI::Target::Path < ::Unparser::CLI::Target - include ::Unparser::Equalizer::Methods - - # Literal for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#27 - def literal_validation; end - - # Validation for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#20 - def validation; end -end - -# String target -# -# source://unparser//lib/unparser/cli.rb#33 -class Unparser::CLI::Target::String - include ::Unparser::Equalizer::Methods - - # Literal for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#46 - def literal_validation; end - - # Validation for this target - # - # @return [Validation] - # - # source://unparser//lib/unparser/cli.rb#39 - def validation; end -end - -# Class to colorize strings -# -# source://unparser//lib/unparser/color.rb#5 -class Unparser::Color - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Format text with color - # - # @param text [String] - # @return [String] - # - # source://unparser//lib/unparser/color.rb#13 - def format(text); end -end - -# source://unparser//lib/unparser/color.rb#41 -Unparser::Color::GREEN = T.let(T.unsafe(nil), Unparser::Color) - -# source://unparser//lib/unparser/color.rb#17 -Unparser::Color::NONE = T.let(T.unsafe(nil), T.untyped) - -# source://unparser//lib/unparser/color.rb#40 -Unparser::Color::RED = T.let(T.unsafe(nil), Unparser::Color) - -# Holds the comments that remain to be emitted -# -# source://unparser//lib/unparser/comments.rb#6 -class Unparser::Comments - # Initialize object - # - # @api private - # @param comments [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#30 - def initialize(comments); end - - # Consume part or all of the node - # - # @api private - # @param node [Parser::AST::Node] - # @param source_part [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#44 - def consume(node, source_part = T.unsafe(nil)); end - - # Proxy to singleton - # - # NOTICE: - # Delegating to stateless helpers is a pattern I saw many times in our code. - # Maybe we should make another helper module? include SingletonDelegator.new(:source_range) ? - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/comments.rb#18 - def source_range(*arguments); end - - # Take all remaining comments - # - # @api private - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#68 - def take_all; end - - # Take comments appear in the source before the specified part of the node - # - # @api private - # @param node [Parser::AST::Node] - # @param source_part [Symbol] - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#81 - def take_before(node, source_part); end - - # Take end-of-line comments - # - # @api private - # @return [Array] - # - # source://unparser//lib/unparser/comments.rb#55 - def take_eol_comments; end - - private - - # source://unparser//lib/unparser/comments.rb#119 - def take_up_to_line(line); end - - # source://unparser//lib/unparser/comments.rb#114 - def take_while; end - - # source://unparser//lib/unparser/comments.rb#123 - def unshift_documents(comments); end - - class << self - # Return source location part - # - # FIXME: This method should not be needed. It does to much inline signalling. - # - # :reek:ManualDispatch - # - # @api private - # @param node [Parser::AST::Node] - # @param part [Symbol] - # @return [Parser::Source::Range] if present - # @return [nil] otherwise - # - # source://unparser//lib/unparser/comments.rb#107 - def source_range(node, part); end - end -end - -# A mixin to define a composition -# -# Original code before vendoring and reduction from: https://github.com/mbj/concord. -# -# source://unparser//lib/unparser/concord.rb#7 -class Unparser::Concord < ::Module - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize object - # - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#30 - def initialize(*names); end - - # Return names - # - # @api private - # @return [Enumerable] - # - # source://unparser//lib/unparser/concord.rb#19 - def names; end - - private - - # Define equalizer - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#48 - def define_equalizer; end - - # Define initialize method - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#72 - def define_initialize; end - - # Define readers - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#58 - def define_readers; end - - # Return instance variable names - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/concord.rb#92 - def instance_variable_names; end -end - -# The maximum number of objects the hosting class is composed of -# -# source://unparser//lib/unparser/concord.rb#11 -Unparser::Concord::MAX_NR_OF_OBJECTS = T.let(T.unsafe(nil), Integer) - -# Mixin for public attribute readers -# -# source://unparser//lib/unparser/concord.rb#97 -class Unparser::Concord::Public < ::Unparser::Concord - # Hook called when module is included - # - # @api private - # @param descendant [Class, Module] - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#107 - def included(descendant); end -end - -# All unparser constants maybe included in other libraries. -# -# source://unparser//lib/unparser/constants.rb#5 -module Unparser::Constants; end - -# All binary operators of the ruby language -# -# source://unparser//lib/unparser/constants.rb#13 -Unparser::Constants::BINARY_OPERATORS = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/constants.rb#63 -Unparser::Constants::KEYWORDS = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/constants.rb#45 -Unparser::Constants::K_ALIAS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#44 -Unparser::Constants::K_AND = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#23 -Unparser::Constants::K_BEGIN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#37 -Unparser::Constants::K_BREAK = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#24 -Unparser::Constants::K_CASE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#25 -Unparser::Constants::K_CLASS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#21 -Unparser::Constants::K_DEF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#28 -Unparser::Constants::K_DEFINE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#33 -Unparser::Constants::K_DEFINED = T.let(T.unsafe(nil), String) - -# Keywords -# -# source://unparser//lib/unparser/constants.rb#20 -Unparser::Constants::K_DO = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#59 -Unparser::Constants::K_EEND = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#46 -Unparser::Constants::K_ELSE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#47 -Unparser::Constants::K_ELSIF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#58 -Unparser::Constants::K_ENCODING = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#22 -Unparser::Constants::K_END = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#27 -Unparser::Constants::K_ENSURE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#41 -Unparser::Constants::K_FALSE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#60 -Unparser::Constants::K_FILE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#48 -Unparser::Constants::K_FOR = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#43 -Unparser::Constants::K_IF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#51 -Unparser::Constants::K_IN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#29 -Unparser::Constants::K_MODULE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#40 -Unparser::Constants::K_NEXT = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#49 -Unparser::Constants::K_NIL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#50 -Unparser::Constants::K_NOT = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#52 -Unparser::Constants::K_OR = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#35 -Unparser::Constants::K_POSTEXE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#34 -Unparser::Constants::K_PREEXE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#39 -Unparser::Constants::K_REDO = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#30 -Unparser::Constants::K_RESCUE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#38 -Unparser::Constants::K_RETRY = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#31 -Unparser::Constants::K_RETURN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#26 -Unparser::Constants::K_SELF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#36 -Unparser::Constants::K_SUPER = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#61 -Unparser::Constants::K_THEN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#42 -Unparser::Constants::K_TRUE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#32 -Unparser::Constants::K_UNDEF = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#53 -Unparser::Constants::K_UNLESS = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#56 -Unparser::Constants::K_UNTIL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#54 -Unparser::Constants::K_WHEN = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#55 -Unparser::Constants::K_WHILE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/constants.rb#57 -Unparser::Constants::K_YIELD = T.let(T.unsafe(nil), String) - -# All unary operators of the ruby language -# -# source://unparser//lib/unparser/constants.rb#8 -Unparser::Constants::UNARY_OPERATORS = T.let(T.unsafe(nil), Set) - -# DSL to help defining emitters -# -# source://unparser//lib/unparser/dsl.rb#5 -module Unparser::DSL - private - - # source://unparser//lib/unparser/dsl.rb#32 - def children(*names); end - - # source://unparser//lib/unparser/dsl.rb#17 - def define_child(name, index); end - - # source://unparser//lib/unparser/dsl.rb#24 - def define_group(name, range); end - - # source://unparser//lib/unparser/dsl.rb#9 - def define_remaining_children(names); end -end - -# Class to create diffs from source code -# -# source://unparser//lib/unparser/diff.rb#5 -class Unparser::Diff - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Colorized unified source diff between old and new - # - # @return [String] if there is a diff - # @return [nil] otherwise - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def colorized_diff(&block); end - - # Unified source diff between old and new - # - # @return [String] if there is exactly one diff - # @return [nil] otherwise - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def diff(&block); end - - private - - # source://unparser//lib/unparser/diff.rb#62 - def diffs; end - - # source://unparser//lib/unparser/diff.rb#66 - def hunks; end - - # source://unparser//lib/unparser/diff.rb#81 - def max_length; end - - # source://unparser//lib/unparser/diff.rb#72 - def minimized_hunk; end - - class << self - # Build new object from source strings - # - # @param old [String] - # @param new [String] - # @return [Diff] - # - # source://unparser//lib/unparser/diff.rb#46 - def build(old, new); end - - private - - # source://unparser//lib/unparser/diff.rb#85 - def colorize_line(line); end - - # Break up source into lines - # - # @param source [String] - # @return [Array] - # - # source://unparser//lib/unparser/diff.rb#55 - def lines(source); end - end -end - -# source://unparser//lib/unparser/diff.rb#8 -Unparser::Diff::ADDITION = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/diff.rb#9 -Unparser::Diff::DELETION = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/diff.rb#10 -Unparser::Diff::NEWLINE = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser.rb#34 -Unparser::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser.rb#33 -Unparser::EMPTY_STRING = T.let(T.unsafe(nil), String) - -# RequireBLock -# -# source://unparser//lib/unparser/either.rb#21 -class Unparser::Either - include ::Unparser::RequireBlock - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Test for left constructor - # - # @return [Boolean] - # - # source://unparser//lib/unparser/either.rb#42 - def left?; end - - # Test for right constructor - # - # @return [Boolean] - # - # source://unparser//lib/unparser/either.rb#49 - def right?; end - - class << self - # Execute block and wrap error in left - # - # @param exception [Class] - # @return [Either] - # - # source://unparser//lib/unparser/either.rb#33 - def wrap_error(*exceptions); end - end -end - -# source://unparser//lib/unparser/either.rb#53 -class Unparser::Either::Left < ::Unparser::Either - # Evaluate applicative block - # - # @return [Either::Left] - # - # source://unparser//lib/unparser/either.rb#64 - def bind(&block); end - - # Evaluate left side of branch - # - # @param left [#call] - # @param _right [#call] - # - # source://unparser//lib/unparser/either.rb#98 - def either(left, _right); end - - # Evaluate functor block - # - # @return [Either::Left] - # - # source://unparser//lib/unparser/either.rb#57 - def fmap(&block); end - - # Unwrap value from left - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#71 - def from_left; end - - # Unwrap value from right - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#79 - def from_right; end - - # Map over left value - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#90 - def lmap; end -end - -# Left -# -# source://unparser//lib/unparser/either.rb#103 -class Unparser::Either::Right < ::Unparser::Either - # Evaluate applicative block - # - # @return [Either] - # @yield [value] - # - # source://unparser//lib/unparser/either.rb#114 - def bind; end - - # Evaluate right side of branch - # - # @param _left [#call] - # @param right [#call] - # - # source://unparser//lib/unparser/either.rb#148 - def either(_left, right); end - - # Evaluate functor block - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#107 - def fmap; end - - # Unwrap value from left - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#122 - def from_left; end - - # Unwrap value from right - # - # @return [Object] - # - # source://unparser//lib/unparser/either.rb#133 - def from_right; end - - # Map over left value - # - # @return [Either::Right] - # - # source://unparser//lib/unparser/either.rb#140 - def lmap(&block); end -end - -# Emitter base class -# -# source://unparser//lib/unparser/emitter.rb#7 -class Unparser::Emitter - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Constants - include ::Unparser::AbstractType - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::AbstractType::AbstractMethodDeclarations - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # Dispatch node write as statement - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/abstract_type.rb#114 - def dispatch(*_arg0); end - - # source://unparser//lib/unparser/emitter.rb#59 - def emit_mlhs; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - # LocalVariableRoot - # - # source://unparser//lib/unparser/emitter.rb#38 - def node_type; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - - # Return emitter - # - # - # @api private - # @return [Emitter] - # - # source://unparser//lib/unparser/emitter.rb#70 - def emitter(buffer:, comments:, node:, local_variable_scope:); end - - # source://unparser//lib/unparser/abstract_type.rb#36 - def new(*args, &block); end - - private - - # Register emitter for type - # - # @api private - # @param types [Symbol] - # @return [undefined] - # - # source://unparser//lib/unparser/emitter.rb#50 - def handle(*types); end - end -end - -# Emitter for alias nodes -# -# source://unparser//lib/unparser/emitter/alias.rb#6 -class Unparser::Emitter::Alias < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/alias.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def source; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Arguments emitter -# -# source://unparser//lib/unparser/emitter/args.rb#6 -class Unparser::Emitter::Args < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/args.rb#7 - def emit_block_arguments; end - - # source://unparser//lib/unparser/emitter/args.rb#15 - def emit_def_arguments; end - - # source://unparser//lib/unparser/emitter/args.rb#19 - def emit_lambda_arguments; end - - private - - # source://unparser//lib/unparser/emitter/args.rb#26 - def emit_shadowargs; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def normal_arguments(&block); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def shadowargs(&block); end -end - -# Argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#84 -class Unparser::Emitter::Argument < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#91 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Array literal emitter -# -# source://unparser//lib/unparser/emitter/array.rb#6 -class Unparser::Emitter::Array < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/array.rb#9 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/array.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def emitters(&block); end -end - -# Emitter for array patterns -# -# source://unparser//lib/unparser/emitter/array_pattern.rb#6 -class Unparser::Emitter::ArrayPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/array_pattern.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/array_pattern.rb#20 - def emit_member(node); end -end - -# Base class for assignment emitters -# -# source://unparser//lib/unparser/emitter/assignment.rb#7 -class Unparser::Emitter::Assignment < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/assignment.rb#14 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/abstract_type.rb#114 - def emit_left(*_arg0); end - - # source://unparser//lib/unparser/emitter/assignment.rb#10 - def symbol_name; end - - private - - # source://unparser//lib/unparser/emitter/assignment.rb#22 - def dispatch; end - - # source://unparser//lib/unparser/emitter/assignment.rb#27 - def emit_right; end -end - -# source://unparser//lib/unparser/emitter/assignment.rb#8 -Unparser::Emitter::Assignment::BINARY_OPERATOR = T.let(T.unsafe(nil), Array) - -# Constant assignment emitter -# -# source://unparser//lib/unparser/emitter/assignment.rb#57 -class Unparser::Emitter::Assignment::Constant < ::Unparser::Emitter::Assignment - private - - # source://unparser//lib/unparser/dsl.rb#18 - def base; end - - # source://unparser//lib/unparser/emitter/assignment.rb#65 - def emit_left; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Variable assignment emitter -# -# source://unparser//lib/unparser/emitter/assignment.rb#42 -class Unparser::Emitter::Assignment::Variable < ::Unparser::Emitter::Assignment - private - - # source://unparser//lib/unparser/emitter/assignment.rb#50 - def emit_left; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for begin nodes -# -# source://unparser//lib/unparser/emitter/begin.rb#7 -class Unparser::Emitter::Begin < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/begin.rb#11 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/begin.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Non send binary operator / keyword emitter -# -# source://unparser//lib/unparser/emitter/binary.rb#6 -class Unparser::Emitter::Binary < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/binary.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def writer(&block); end -end - -# Base class for and and or op-assign -# -# source://unparser//lib/unparser/emitter/op_assign.rb#7 -class Unparser::Emitter::BinaryAssign < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/op_assign.rb#17 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/op_assign.rb#24 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def expression; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# source://unparser//lib/unparser/emitter/op_assign.rb#10 -Unparser::Emitter::BinaryAssign::MAP = T.let(T.unsafe(nil), Hash) - -# Block emitter -# -# source://unparser//lib/unparser/emitter/block.rb#7 -class Unparser::Emitter::Block < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/block.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/emitter/block.rb#75 - def emit_block_arguments; end - - # source://unparser//lib/unparser/emitter/block.rb#67 - def emit_lambda_arguments; end - - # source://unparser//lib/unparser/emitter/block.rb#61 - def emit_send_target; end - - # source://unparser//lib/unparser/emitter/block.rb#49 - def emit_target; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/block.rb#24 - def need_do?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/block.rb#71 - def numblock?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def target_writer(&block); end - - # source://unparser//lib/unparser/emitter/block.rb#36 - def write_close; end - - # source://unparser//lib/unparser/emitter/block.rb#28 - def write_open; end -end - -# Block pass node emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#123 -class Unparser::Emitter::BlockPass < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#130 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for toplevel constant reference nodes -# -# source://unparser//lib/unparser/emitter/cbase.rb#6 -class Unparser::Emitter::CBase < ::Unparser::Emitter - private - - # Perform dispatch - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/emitter/cbase.rb#17 - def dispatch; end -end - -# Emitter for case nodes -# -# source://unparser//lib/unparser/emitter/case.rb#6 -class Unparser::Emitter::Case < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/case.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case.rb#35 - def emit_condition; end - - # source://unparser//lib/unparser/emitter/case.rb#22 - def emit_else; end - - # source://unparser//lib/unparser/emitter/case.rb#30 - def emit_whens; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def whens(&block); end -end - -# Emitter for case guards -# -# source://unparser//lib/unparser/emitter/case_guard.rb#6 -class Unparser::Emitter::CaseGuard < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/case_guard.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/case_guard.rb#10 -Unparser::Emitter::CaseGuard::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for case matches -# -# source://unparser//lib/unparser/emitter/case_match.rb#6 -class Unparser::Emitter::CaseMatch < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/case_match.rb#20 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case_match.rb#16 - def else_branch; end - - # source://unparser//lib/unparser/emitter/case_match.rb#30 - def emit_else_branch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def patterns(&block); end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for class nodes -# -# source://unparser//lib/unparser/emitter/class.rb#6 -class Unparser::Emitter::Class < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/class.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/class.rb#23 - def emit_superclass; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def superclass; end -end - -# Emitter for constant access -# -# source://unparser//lib/unparser/emitter/variable.rb#21 -class Unparser::Emitter::Const < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#28 - def dispatch; end - - # source://unparser//lib/unparser/emitter/variable.rb#33 - def emit_scope; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def scope; end -end - -# Emitter for const pattern node -# -# source://unparser//lib/unparser/emitter/const_pattern.rb#6 -class Unparser::Emitter::ConstPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def const; end - - # source://unparser//lib/unparser/emitter/const_pattern.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Dynamic string emitter -# -# source://unparser//lib/unparser/emitter/dstr.rb#6 -class Unparser::Emitter::DStr < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/dstr.rb#10 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/dstr.rb#16 - def dispatch; end -end - -# Dynamic symbol literal emitter -# -# source://unparser//lib/unparser/emitter/dsym.rb#6 -class Unparser::Emitter::DSym < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/dsym.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/dsym.rb#34 - def emit_begin_child(component); end - - # source://unparser//lib/unparser/emitter/dsym.rb#24 - def emit_str_child(value); end -end - -# Emitter for def node -# -# source://unparser//lib/unparser/emitter/def.rb#6 -class Unparser::Emitter::Def < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/abstract_type.rb#114 - def body(*_arg0); end - - # source://unparser//lib/unparser/emitter/def.rb#17 - def dispatch; end - - # source://unparser//lib/unparser/emitter/def.rb#25 - def emit_arguments; end - - # source://unparser//lib/unparser/abstract_type.rb#114 - def emit_name(*_arg0); end -end - -# Instance def emitter -# -# source://unparser//lib/unparser/emitter/def.rb#34 -class Unparser::Emitter::Def::Instance < ::Unparser::Emitter::Def - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/def.rb#41 - def emit_name; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for defines on singleton -# -# source://unparser//lib/unparser/emitter/def.rb#48 -class Unparser::Emitter::Def::Singleton < ::Unparser::Emitter::Def - private - - # source://unparser//lib/unparser/dsl.rb#18 - def arguments; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/def.rb#56 - def emit_name; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/def.rb#63 - def subject_without_parens?; end -end - -# Emitter for defined? nodes -# -# source://unparser//lib/unparser/emitter/defined.rb#6 -class Unparser::Emitter::Defined < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/defined.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/find_pattern.rb#6 -class Unparser::Emitter::FindPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/find_pattern.rb#11 - def dispatch; end -end - -# Emitter for flip flops -# -# source://unparser//lib/unparser/emitter/flipflop.rb#6 -class Unparser::Emitter::FlipFlop < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/flipflop.rb#17 - def symbol_name; end - - private - - # source://unparser//lib/unparser/emitter/flipflop.rb#27 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# source://unparser//lib/unparser/emitter/flipflop.rb#7 -Unparser::Emitter::FlipFlop::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/flipflop.rb#12 -Unparser::Emitter::FlipFlop::SYMBOLS = T.let(T.unsafe(nil), Hash) - -# Emiter for float literals -# -# source://unparser//lib/unparser/emitter/float.rb#6 -class Unparser::Emitter::Float < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/float.rb#16 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# source://unparser//lib/unparser/emitter/float.rb#11 -Unparser::Emitter::Float::INFINITY = T.let(T.unsafe(nil), Float) - -# source://unparser//lib/unparser/emitter/float.rb#12 -Unparser::Emitter::Float::NEG_INFINITY = T.let(T.unsafe(nil), Float) - -# Emitter control flow modifiers -# -# source://unparser//lib/unparser/emitter/flow_modifier.rb#6 -class Unparser::Emitter::FlowModifier < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/flow_modifier.rb#17 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/flow_modifier.rb#25 - def dispatch; end - - # source://unparser//lib/unparser/emitter/flow_modifier.rb#36 - def emit_arguments; end -end - -# source://unparser//lib/unparser/emitter/flow_modifier.rb#7 -Unparser::Emitter::FlowModifier::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for for nodes -# -# source://unparser//lib/unparser/emitter/for.rb#6 -class Unparser::Emitter::For < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def assignment; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/for.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/for.rb#20 - def emit_condition; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for forwarding arguments -# -# source://unparser//lib/unparser/emitter/argument.rb#6 -class Unparser::Emitter::ForwardArg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#20 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/argument.rb#7 -Unparser::Emitter::ForwardArg::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for Hash literals -# -# source://unparser//lib/unparser/emitter/hash.rb#6 -class Unparser::Emitter::Hash < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/hash.rb#9 - def emit_heredoc_reminders; end - - private - - # source://unparser//lib/unparser/emitter/hash.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/hash.rb#31 - def emit_hash_body; end - - # source://unparser//lib/unparser/emitter/hash.rb#27 - def emit_heredoc_reminder_member(node); end -end - -# Emitter for hash patterns -# -# source://unparser//lib/unparser/emitter/hash_pattern.rb#6 -class Unparser::Emitter::HashPattern < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/hash_pattern.rb#10 - def emit_const_pattern; end - - private - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#18 - def dispatch; end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#24 - def emit_hash_body; end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#41 - def emit_match_var(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#28 - def emit_member(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#46 - def emit_pair(node); end - - # source://unparser//lib/unparser/emitter/hash_pattern.rb#62 - def write_symbol_body(symbol); end -end - -# Base class for pre and postexe emitters -# -# source://unparser//lib/unparser/emitter/hookexe.rb#6 -class Unparser::Emitter::Hookexe < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/hookexe.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/hookexe.rb#8 -Unparser::Emitter::Hookexe::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter if nodes -# -# source://unparser//lib/unparser/emitter/if.rb#6 -class Unparser::Emitter::If < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/if.rb#11 - def emit_ternary; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/if.rb#21 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def else_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#59 - def emit_condition; end - - # source://unparser//lib/unparser/emitter/if.rb#71 - def emit_else_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#63 - def emit_if_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#43 - def emit_normal; end - - # source://unparser//lib/unparser/emitter/if.rb#37 - def emit_postcondition; end - - # source://unparser//lib/unparser/dsl.rb#18 - def if_branch; end - - # source://unparser//lib/unparser/emitter/if.rb#55 - def keyword; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/if.rb#29 - def postcondition?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/if.rb#51 - def unless?; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/in_match.rb#6 -class Unparser::Emitter::InMatch < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/in_match.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/in_pattern.rb#6 -class Unparser::Emitter::InPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def branch; end - - # source://unparser//lib/unparser/emitter/in_pattern.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def else_branch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/dsl.rb#18 - def unless_guard; end -end - -# Emitter for send to index references -# -# source://unparser//lib/unparser/emitter/index.rb#6 -class Unparser::Emitter::Index < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/index.rb#10 - def dispatch; end - - # source://unparser//lib/unparser/emitter/index.rb#15 - def emit_receiver; end -end - -# Emitter for assign to index nodes -# -# source://unparser//lib/unparser/emitter/index.rb#34 -class Unparser::Emitter::Index::Assign < ::Unparser::Emitter::Index - # source://unparser//lib/unparser/emitter/index.rb#47 - def dispatch; end - - # source://unparser//lib/unparser/emitter/index.rb#43 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/emitter/index.rb#54 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/index.rb#61 - def emit_operation(indices); end -end - -# source://unparser//lib/unparser/emitter/index.rb#39 -Unparser::Emitter::Index::Assign::NO_VALUE_PARENT = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/emitter/index.rb#38 -Unparser::Emitter::Index::Assign::VALUE_RANGE = T.let(T.unsafe(nil), Range) - -# source://unparser//lib/unparser/emitter/index.rb#19 -class Unparser::Emitter::Index::Reference < ::Unparser::Emitter::Index - private - - # source://unparser//lib/unparser/emitter/index.rb#26 - def emit_operation; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def indices(&block); end -end - -# Emitter for explicit begins -# -# source://unparser//lib/unparser/emitter/kwbegin.rb#6 -class Unparser::Emitter::KWBegin < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/kwbegin.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/kwbegin.rb#25 - def emit_multiple_body; end -end - -# Optional keyword argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#41 -class Unparser::Emitter::KeywordOptional < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#48 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for splats -# -# source://unparser//lib/unparser/emitter/splat.rb#6 -class Unparser::Emitter::KwSplat < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/splat.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end -end - -# Keyword argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#56 -class Unparser::Emitter::Kwarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#63 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/kwargs.rb#5 -class Unparser::Emitter::Kwargs < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/kwargs.rb#8 - def dispatch; end -end - -# Emitter for lambda nodes -# -# source://unparser//lib/unparser/emitter/lambda.rb#6 -class Unparser::Emitter::Lambda < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/lambda.rb#11 - def dispatch; end -end - -# source://unparser//lib/unparser/emitter.rb#20 -module Unparser::Emitter::LocalVariableRoot - # Return local variable root - # - # @api private - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/emitter.rb#27 - def local_variable_scope; end - - class << self - # @private - # - # source://unparser//lib/unparser/emitter.rb#31 - def included(descendant); end - end -end - -# Emitter for multiple assignment nodes -# -# source://unparser//lib/unparser/emitter/masgn.rb#6 -class Unparser::Emitter::MASGN < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/masgn.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def source; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for multiple assignment left hand side -# -# source://unparser//lib/unparser/emitter/mlhs.rb#6 -class Unparser::Emitter::MLHS < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/mlhs.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/emitter/mlhs.rb#31 - def emit_many; end - - # source://unparser//lib/unparser/emitter/mlhs.rb#23 - def emit_one_child_mlhs; end -end - -# source://unparser//lib/unparser/emitter/mlhs.rb#9 -Unparser::Emitter::MLHS::NO_COMMA = T.let(T.unsafe(nil), Array) - -# Base class for special match node emitters -# -# source://unparser//lib/unparser/emitter/match.rb#7 -class Unparser::Emitter::Match < ::Unparser::Emitter; end - -# Emitter for match current line -# -# source://unparser//lib/unparser/emitter/match.rb#25 -class Unparser::Emitter::Match::CurrentLine < ::Unparser::Emitter::Match - private - - # source://unparser//lib/unparser/emitter/match.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def regexp; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for match with local variable assignment -# -# source://unparser//lib/unparser/emitter/match.rb#9 -class Unparser::Emitter::Match::Lvasgn < ::Unparser::Emitter::Match - private - - # source://unparser//lib/unparser/emitter/match.rb#16 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def lvasgn; end - - # source://unparser//lib/unparser/dsl.rb#18 - def regexp; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_alt.rb#6 -class Unparser::Emitter::MatchAlt < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_alt.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_as.rb#6 -class Unparser::Emitter::MatchAs < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_as.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_pattern.rb#6 -class Unparser::Emitter::MatchPattern < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_pattern.rb#23 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Modern ast format emits `match_pattern` -# node on single line pre 3.0, but 3.0+ uses `match_pattern_p` -# -# source://unparser//lib/unparser/emitter/match_pattern.rb#14 -Unparser::Emitter::MatchPattern::SYMBOL = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/emitter/match_pattern_p.rb#5 -class Unparser::Emitter::MatchPatternP < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_pattern_p.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def pattern; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emiter for match rest nodes -# -# source://unparser//lib/unparser/emitter/match_rest.rb#6 -class Unparser::Emitter::MatchRest < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/match_rest.rb#11 - def dispatch; end - - # source://unparser//lib/unparser/emitter/match_rest.rb#16 - def emit_array_pattern; end - - # source://unparser//lib/unparser/emitter/match_rest.rb#21 - def emit_hash_pattern; end - - private - - # source://unparser//lib/unparser/emitter/match_rest.rb#28 - def emit_match_var; end - - # source://unparser//lib/unparser/dsl.rb#18 - def match_var; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for in pattern nodes -# -# source://unparser//lib/unparser/emitter/match_var.rb#6 -class Unparser::Emitter::MatchVar < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/match_var.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for module nodes -# -# source://unparser//lib/unparser/emitter/module.rb#6 -class Unparser::Emitter::Module < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/module.rb#15 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter.rb#18 -Unparser::Emitter::NO_INDENT = T.let(T.unsafe(nil), Array) - -# Emitter for nth_ref nodes (regexp captures) -# -# source://unparser//lib/unparser/emitter/variable.rb#42 -class Unparser::Emitter::NthRef < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#50 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/variable.rb#43 -Unparser::Emitter::NthRef::PREFIX = T.let(T.unsafe(nil), String) - -# Emitter for op assign -# -# source://unparser//lib/unparser/emitter/op_assign.rb#33 -class Unparser::Emitter::OpAssign < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/op_assign.rb#40 - def dispatch; end - - # source://unparser//lib/unparser/emitter/op_assign.rb#46 - def emit_operator; end - - # source://unparser//lib/unparser/dsl.rb#18 - def operator; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Optional argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#27 -class Unparser::Emitter::Optarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#34 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for key value pairs in hash literals or kwargs -# -# source://unparser//lib/unparser/emitter/pair.rb#6 -class Unparser::Emitter::Pair < ::Unparser::Emitter - private - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/pair.rb#28 - def colon?(key); end - - # source://unparser//lib/unparser/emitter/pair.rb#17 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def key; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# source://unparser//lib/unparser/emitter/pair.rb#7 -Unparser::Emitter::Pair::BAREWORD = T.let(T.unsafe(nil), Regexp) - -# Emitter for pin nodes -# -# source://unparser//lib/unparser/emitter/pin.rb#6 -class Unparser::Emitter::Pin < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/pin.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def target; end -end - -# Emitter for postconditions -# -# source://unparser//lib/unparser/emitter/repetition.rb#7 -class Unparser::Emitter::Post < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/repetition.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/repetition.rb#10 -Unparser::Emitter::Post::MAP = T.let(T.unsafe(nil), Hash) - -# Base class for primitive emitters -# -# source://unparser//lib/unparser/emitter/primitive.rb#6 -class Unparser::Emitter::Primitive < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def value; end -end - -# Emitter for complex literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#24 -class Unparser::Emitter::Primitive::Complex < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#39 - def dispatch; end - - # source://unparser//lib/unparser/emitter/primitive.rb#44 - def emit_imaginary; end - - # source://unparser//lib/unparser/emitter/primitive.rb#48 - def imaginary_node; end -end - -# source://unparser//lib/unparser/emitter/primitive.rb#30 -Unparser::Emitter::Primitive::Complex::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/primitive.rb#28 -Unparser::Emitter::Primitive::Complex::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) - -# Emitter for primitives based on Object#inspect -# -# source://unparser//lib/unparser/emitter/primitive.rb#11 -class Unparser::Emitter::Primitive::Inspect < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#17 - def dispatch; end -end - -# Emiter for numeric literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#80 -class Unparser::Emitter::Primitive::Numeric < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#86 - def dispatch; end -end - -# Emitter for rational literals -# -# source://unparser//lib/unparser/emitter/primitive.rb#56 -class Unparser::Emitter::Primitive::Rational < ::Unparser::Emitter::Primitive - private - - # source://unparser//lib/unparser/emitter/primitive.rb#65 - def dispatch; end - - # source://unparser//lib/unparser/emitter/primitive.rb#73 - def write_rational(value); end -end - -# source://unparser//lib/unparser/emitter/primitive.rb#60 -Unparser::Emitter::Primitive::Rational::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) - -# Progarg emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#98 -class Unparser::Emitter::Procarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#105 - def dispatch; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/argument.rb#115 - def needs_parens?; end -end - -# source://unparser//lib/unparser/emitter/argument.rb#101 -Unparser::Emitter::Procarg::PARENS = T.let(T.unsafe(nil), Array) - -# Registry for node emitters -# -# source://unparser//lib/unparser/emitter.rb#16 -Unparser::Emitter::REGISTRY = T.let(T.unsafe(nil), Hash) - -# Range emitters -# -# source://unparser//lib/unparser/emitter/range.rb#6 -class Unparser::Emitter::Range < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/range.rb#17 - def symbol_name; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def begin_node; end - - # source://unparser//lib/unparser/emitter/range.rb#27 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def end_node; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/range.rb#12 -Unparser::Emitter::Range::SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/emitter/range.rb#7 -Unparser::Emitter::Range::TOKENS = T.let(T.unsafe(nil), Hash) - -# Emitter for regexp literals -# -# source://unparser//lib/unparser/emitter/regexp.rb#6 -class Unparser::Emitter::Regexp < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def body(&block); end - - # source://unparser//lib/unparser/emitter/regexp.rb#13 - def dispatch; end - - # source://unparser//lib/unparser/emitter/regexp.rb#24 - def emit_body(node); end - - # source://unparser//lib/unparser/emitter/regexp.rb#20 - def emit_options; end -end - -# Emitter for while and until nodes -# -# source://unparser//lib/unparser/emitter/repetition.rb#27 -class Unparser::Emitter::Repetition < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/dsl.rb#18 - def condition; end - - # source://unparser//lib/unparser/emitter/repetition.rb#39 - def dispatch; end - - # source://unparser//lib/unparser/emitter/repetition.rb#51 - def emit_keyword; end - - # source://unparser//lib/unparser/emitter/repetition.rb#55 - def emit_normal; end - - # source://unparser//lib/unparser/emitter/repetition.rb#66 - def emit_postcontrol; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/repetition.rb#47 - def postcontrol?; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/emitter/repetition.rb#28 -Unparser::Emitter::Repetition::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for rescue nodes -# -# source://unparser//lib/unparser/emitter/rescue.rb#6 -class Unparser::Emitter::Rescue < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/rescue.rb#11 - def dispatch; end -end - -# Rest argument emitter -# -# source://unparser//lib/unparser/emitter/argument.rb#70 -class Unparser::Emitter::Restarg < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/argument.rb#77 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Root emitter a special case -# -# source://unparser//lib/unparser/emitter/root.rb#6 -class Unparser::Emitter::Root < ::Unparser::Emitter - include ::Unparser::Emitter::LocalVariableRoot - - # source://unparser//lib/unparser/concord.rb#60 - def buffer; end - - # source://unparser//lib/unparser/concord.rb#60 - def comments; end - - # source://unparser//lib/unparser/emitter/root.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def local_variable_scope(&block); end - - # source://unparser//lib/unparser/concord.rb#60 - def node; end -end - -# source://unparser//lib/unparser/emitter/root.rb#10 -Unparser::Emitter::Root::END_NL = T.let(T.unsafe(nil), Array) - -# Emitter for sclass nodes -# -# source://unparser//lib/unparser/emitter/class.rb#33 -class Unparser::Emitter::SClass < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/emitter/class.rb#40 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def object; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for send -# -# source://unparser//lib/unparser/emitter/send.rb#6 -class Unparser::Emitter::Send < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/send.rb#13 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/emitter/send.rb#9 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/send.rb#19 - def dispatch; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def writer(&block); end -end - -# Emitter for simple nodes that generate a single token -# -# source://unparser//lib/unparser/emitter/simple.rb#6 -class Unparser::Emitter::Simple < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/simple.rb#28 - def dispatch; end -end - -# source://unparser//lib/unparser/emitter/simple.rb#7 -Unparser::Emitter::Simple::MAP = T.let(T.unsafe(nil), Hash) - -# Emitter for splats -# -# source://unparser//lib/unparser/emitter/splat.rb#20 -class Unparser::Emitter::Splat < ::Unparser::Emitter - # source://unparser//lib/unparser/emitter/splat.rb#25 - def emit_mlhs; end - - private - - # source://unparser//lib/unparser/emitter/splat.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def subject; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def subject_emitter(&block); end -end - -# Emitter for super nodes -# -# source://unparser//lib/unparser/emitter/super.rb#7 -class Unparser::Emitter::Super < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/super.rb#12 - def dispatch; end -end - -# Emitter for undef nodes -# -# source://unparser//lib/unparser/emitter/undef.rb#6 -class Unparser::Emitter::Undef < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/undef.rb#11 - def dispatch; end -end - -# Emitter for various variable accesses -# -# source://unparser//lib/unparser/emitter/variable.rb#7 -class Unparser::Emitter::Variable < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/variable.rb#14 - def dispatch; end - - # source://unparser//lib/unparser/dsl.rb#18 - def name; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# Emitter for when nodes -# -# source://unparser//lib/unparser/emitter/case.rb#44 -class Unparser::Emitter::When < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def captures(&block); end - - # source://unparser//lib/unparser/emitter/case.rb#51 - def dispatch; end - - # source://unparser//lib/unparser/emitter/case.rb#57 - def emit_captures; end -end - -# Dynamic execute string literal emitter -# -# source://unparser//lib/unparser/emitter/xstr.rb#6 -class Unparser::Emitter::XStr < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/xstr.rb#12 - def dispatch; end - - # source://unparser//lib/unparser/emitter/xstr.rb#65 - def emit_begin(component); end - - # source://unparser//lib/unparser/emitter/xstr.rb#24 - def emit_heredoc; end - - # source://unparser//lib/unparser/emitter/xstr.rb#51 - def emit_string(value); end - - # source://unparser//lib/unparser/emitter/xstr.rb#39 - def emit_xstr; end - - # source://unparser//lib/unparser/emitter/xstr.rb#55 - def escape_xstr(input); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/xstr.rb#20 - def heredoc?; end -end - -# Emitter for yield node -# -# source://unparser//lib/unparser/emitter/yield.rb#7 -class Unparser::Emitter::Yield < ::Unparser::Emitter - private - - # source://unparser//lib/unparser/emitter/yield.rb#12 - def dispatch; end -end - -# Define equality, equivalence and inspection methods -# -# Original code before vendoring and reduction from: https://github.com/dkubb/equalizer. -# -# source://unparser//lib/unparser/equalizer.rb#7 -class Unparser::Equalizer < ::Module - # Initialize an Equalizer with the given keys - # - # Will use the keys with which it is initialized to define #cmp?, - # #hash, and #inspect - # - # - # @api private - # @param keys [Array] - # @return [undefined] - # - # source://unparser//lib/unparser/equalizer.rb#20 - def initialize(*keys); end - - private - - # source://unparser//lib/unparser/equalizer.rb#39 - def define_cmp_method; end - - # source://unparser//lib/unparser/equalizer.rb#49 - def define_hash_method; end - - # source://unparser//lib/unparser/equalizer.rb#56 - def define_inspect_method; end - - # source://unparser//lib/unparser/equalizer.rb#33 - def define_methods; end - - # source://unparser//lib/unparser/equalizer.rb#29 - def included(descendant); end -end - -# The comparison methods -# -# source://unparser//lib/unparser/equalizer.rb#66 -module Unparser::Equalizer::Methods - # Compare the object with other object for equivalency - # - # @api public - # @example - # object == other # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] - # - # source://unparser//lib/unparser/equalizer.rb#93 - def ==(other); end - - # Compare the object with other object for equality - # - # @api public - # @example - # object.eql?(other) # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] - # - # source://unparser//lib/unparser/equalizer.rb#78 - def eql?(other); end -end - -# source://unparser//lib/unparser/generation.rb#5 -module Unparser::Generation - # source://unparser//lib/unparser/generation.rb#10 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/generation.rb#12 - def symbol_name; end - - # source://unparser//lib/unparser/generation.rb#14 - def write_to_buffer; end - - private - - # source://unparser//lib/unparser/generation.rb#247 - def children; end - - # source://unparser//lib/unparser/generation.rb#239 - def conditional_parentheses(flag, &block); end - - # source://unparser//lib/unparser/generation.rb#21 - def delimited(nodes, delimiter = T.unsafe(nil), &block); end - - # source://unparser//lib/unparser/generation.rb#123 - def emit_body(node, indent: T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#196 - def emit_body_ensure_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#145 - def emit_body_inner(node); end - - # source://unparser//lib/unparser/generation.rb#158 - def emit_body_member(node); end - - # source://unparser//lib/unparser/generation.rb#180 - def emit_body_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#77 - def emit_comments(comments); end - - # source://unparser//lib/unparser/generation.rb#69 - def emit_comments_before(source_part = T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#166 - def emit_ensure(node); end - - # source://unparser//lib/unparser/generation.rb#60 - def emit_eof_comments; end - - # source://unparser//lib/unparser/generation.rb#54 - def emit_eol_comments; end - - # source://unparser//lib/unparser/generation.rb#27 - def emit_join(nodes, emit_node, emit_delimiter); end - - # source://unparser//lib/unparser/generation.rb#115 - def emit_optional_body(node, indent: T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#188 - def emit_optional_body_ensure_rescue(node); end - - # source://unparser//lib/unparser/generation.rb#206 - def emit_rescue_postcontrol(node); end - - # source://unparser//lib/unparser/generation.rb#212 - def emit_rescue_regular(node); end - - # source://unparser//lib/unparser/generation.rb#220 - def emitter(node); end - - # source://unparser//lib/unparser/generation.rb#235 - def first_child; end - - # source://unparser//lib/unparser/generation.rb#106 - def indented; end - - # source://unparser//lib/unparser/generation.rb#93 - def k_end; end - - # source://unparser//lib/unparser/generation.rb#39 - def nl; end - - # source://unparser//lib/unparser/generation.rb#100 - def parentheses(open = T.unsafe(nil), close = T.unsafe(nil)); end - - # source://unparser//lib/unparser/generation.rb#224 - def visit(node); end - - # source://unparser//lib/unparser/generation.rb#228 - def visit_deep(node); end - - # source://unparser//lib/unparser/generation.rb#44 - def with_comments; end - - # source://unparser//lib/unparser/generation.rb#89 - def write(*strings); end - - # source://unparser//lib/unparser/generation.rb#216 - def writer_with(klass, node); end - - # source://unparser//lib/unparser/generation.rb#50 - def ws; end -end - -# source://unparser//lib/unparser/generation.rb#6 -Unparser::Generation::EXTRA_NL = T.let(T.unsafe(nil), Array) - -# Error raised when unparser encounters an invalid AST -# -# source://unparser//lib/unparser.rb#39 -class Unparser::InvalidNodeError < ::RuntimeError - # @return [InvalidNodeError] a new instance of InvalidNodeError - # - # source://unparser//lib/unparser.rb#42 - def initialize(message, node); end - - # Returns the value of attribute node. - # - # source://unparser//lib/unparser.rb#40 - def node; end -end - -# source://unparser//lib/unparser/node_details.rb#4 -module Unparser::NodeDetails - include ::Unparser::NodeHelpers - include ::Unparser::Constants - - private - - # source://unparser//lib/unparser/node_details.rb#17 - def children; end - - class << self - # @private - # - # source://unparser//lib/unparser/node_details.rb#7 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/node_details/send.rb#5 -class Unparser::NodeDetails::Send - include ::Unparser::NodeHelpers - include ::Unparser::Constants - include ::Unparser::NodeDetails - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def arguments(&block); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#37 - def arguments?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def assignment?(&block); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#33 - def assignment_operator?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#21 - def binary_syntax_allowed?; end - - # source://unparser//lib/unparser/node_details/send.rb#41 - def non_assignment_selector; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#17 - def selector_binary_operator?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_details/send.rb#29 - def selector_unary_operator?; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def string_selector(&block); end - - private - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end -end - -# source://unparser//lib/unparser/node_details/send.rb#8 -Unparser::NodeDetails::Send::ASSIGN_SUFFIX = T.let(T.unsafe(nil), String) - -# source://unparser//lib/unparser/node_details/send.rb#9 -Unparser::NodeDetails::Send::NON_ASSIGN_RANGE = T.let(T.unsafe(nil), Range) - -# source://unparser//lib/unparser/node_helpers.rb#4 -module Unparser::NodeHelpers - # Helper for building nodes - # - # @api private - # @param type [Symbol] - # @param children [Array] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/node_helpers.rb#26 - def n(type, children = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/node_helpers.rb#30 - def n?(type, node); end - - # Helper for building nodes - # - # @api private - # @param type [Symbol] - # @param children [Parser::AST::Node] - # @return [Parser::AST::Node] - # - # source://unparser//lib/unparser/node_helpers.rb#14 - def s(type, *children); end - - # source://unparser//lib/unparser/node_helpers.rb#71 - def unwrap_single_begin(node); end - - private - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_arg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_args?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_array?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_array_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_begin?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_block?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_cbase?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_const?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_dstr?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_empty_else?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_ensure?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_hash?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_hash_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_if?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_in_pattern?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_int?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwarg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwargs?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_kwsplat?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_lambda?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_match_rest?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_pair?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_rescue?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_send?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_shadowarg?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_splat?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_str?(node); end - - # source://unparser//lib/unparser/node_helpers.rb#65 - def n_sym?(node); end -end - -# source://unparser//lib/unparser/either.rb#4 -module Unparser::RequireBlock - private - - # Raise error unless block is provided - # - # @raise [MissingBlockError] if no block is given - # @return [self] - # - # source://unparser//lib/unparser/either.rb#14 - def require_block; end -end - -# source://unparser//lib/unparser/emitter.rb#4 -class Unparser::UnknownNodeError < ::ArgumentError; end - -# Validation of unparser results -# -# source://unparser//lib/unparser/validation.rb#5 -class Unparser::Validation - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # source://unparser//lib/unparser/anima.rb#146 - def generated_node; end - - # source://unparser//lib/unparser/anima.rb#146 - def generated_source; end - - # source://unparser//lib/unparser/anima.rb#146 - def identification; end - - # source://unparser//lib/unparser/anima.rb#146 - def original_node; end - - # source://unparser//lib/unparser/anima.rb#146 - def original_source; end - - # Return error report - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def report(&block); end - - # Test if source could be unparsed successfully - # - # - # @api private - # @return [Boolean] - # - # source://unparser//lib/unparser/validation.rb#21 - def success?; end - - private - - # source://unparser//lib/unparser/validation.rb#108 - def make_report(label, attribute_name); end - - # source://unparser//lib/unparser/validation.rb#120 - def node_diff_report; end - - # source://unparser//lib/unparser/validation.rb#112 - def report_exception(exception); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - - # Create validator from node - # - # @param original_node [Parser::AST::Node] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#81 - def from_node(original_node); end - - # Create validator from file - # - # @param path [Pathname] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#102 - def from_path(path); end - - # Create validator from string - # - # @param original_source [String] - # @return [Validator] - # - # source://unparser//lib/unparser/validation.rb#55 - def from_string(original_source); end - - private - - # source://unparser//lib/unparser/validation.rb#135 - def const_unit(_value); end - end -end - -# source://unparser//lib/unparser/validation.rb#138 -class Unparser::Validation::Literal < ::Unparser::Validation - # source://unparser//lib/unparser/validation.rb#143 - def report; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/validation.rb#139 - def success?; end - - private - - # source://unparser//lib/unparser/validation.rb#158 - def source_diff_report; end -end - -# source://unparser//lib/unparser/writer.rb#4 -module Unparser::Writer - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - - mixes_in_class_methods ::Unparser::DSL - - class << self - # @private - # - # source://unparser//lib/unparser/writer.rb#7 - def included(descendant); end - end -end - -# source://unparser//lib/unparser/writer/binary.rb#5 -class Unparser::Writer::Binary - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/binary.rb#54 - def dispatch; end - - # source://unparser//lib/unparser/writer/binary.rb#46 - def emit_operator; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - # source://unparser//lib/unparser/writer/binary.rb#50 - def symbol_name; end - - private - - # source://unparser//lib/unparser/writer/binary.rb#62 - def effective_symbol; end - - # source://unparser//lib/unparser/writer/binary.rb#74 - def emit_with(map); end - - # source://unparser//lib/unparser/writer/binary.rb#80 - def keyword_symbol; end - - # source://unparser//lib/unparser/dsl.rb#18 - def left; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def left_emitter(&block); end - - # source://unparser//lib/unparser/writer/binary.rb#84 - def operator_symbol; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def right; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def right_emitter(&block); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/binary.rb#22 -Unparser::Writer::Binary::KEYWORD_SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#16 -Unparser::Writer::Binary::KEYWORD_TOKENS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#34 -Unparser::Writer::Binary::MAP = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#42 -Unparser::Writer::Binary::NEED_KEYWORD = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/writer/binary.rb#28 -Unparser::Writer::Binary::OPERATOR_SYMBOLS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/binary.rb#10 -Unparser::Writer::Binary::OPERATOR_TOKENS = T.let(T.unsafe(nil), Hash) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#5 -class Unparser::Writer::DynamicString - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#32 - def dispatch; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#25 - def emit_heredoc_reminder; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#159 - def breakpoint?(child, current); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#63 - def classify(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#71 - def classify_str(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#193 - def emit_body(children); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#149 - def emit_dstr; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#132 - def emit_dynamic(child); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#145 - def emit_dynamic_component(node); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#54 - def emit_heredoc_body; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#59 - def emit_heredoc_footer; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#50 - def emit_heredoc_header; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#116 - def emit_normal_heredoc_body; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#185 - def emit_segment(children, index); end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#128 - def escape_dynamic(string); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#46 - def heredoc?; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#42 - def heredoc_header; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#95 - def heredoc_pattern?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#105 - def heredoc_pattern_2?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#99 - def heredoc_pattern_3?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#111 - def nl_last_child?; end - - # source://unparser//lib/unparser/writer/dynamic_string.rb#169 - def segments; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#87 - def str_empty?(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#83 - def str_nl?(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/dynamic_string.rb#91 - def str_ws?(node); end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/dynamic_string.rb#21 -Unparser::Writer::DynamicString::FLAT_INTERPOLATION = T.let(T.unsafe(nil), Set) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#8 -Unparser::Writer::DynamicString::PATTERNS_2 = T.let(T.unsafe(nil), Array) - -# source://unparser//lib/unparser/writer/dynamic_string.rb#14 -Unparser::Writer::DynamicString::PATTERNS_3 = T.let(T.unsafe(nil), Array) - -# Writer for rescue bodies -# -# source://unparser//lib/unparser/writer/resbody.rb#6 -class Unparser::Writer::Resbody - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/resbody.rb#11 - def emit_postcontrol; end - - # source://unparser//lib/unparser/writer/resbody.rb#16 - def emit_regular; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def assignment; end - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/writer/resbody.rb#32 - def emit_assignment; end - - # source://unparser//lib/unparser/writer/resbody.rb#25 - def emit_exception; end - - # source://unparser//lib/unparser/dsl.rb#18 - def exception; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# source://unparser//lib/unparser/writer/rescue.rb#5 -class Unparser::Writer::Rescue - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/rescue.rb#23 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/writer/rescue.rb#27 - def emit_postcontrol; end - - # source://unparser//lib/unparser/writer/rescue.rb#12 - def emit_regular; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/dsl.rb#18 - def body; end - - # source://unparser//lib/unparser/writer/rescue.rb#34 - def else_node; end - - # source://unparser//lib/unparser/writer/rescue.rb#38 - def emit_rescue_body(node); end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def rescue_bodies(&block); end - - # source://unparser//lib/unparser/dsl.rb#18 - def rescue_body; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# Writer for send -# -# source://unparser//lib/unparser/writer/send.rb#6 -class Unparser::Writer::Send - include ::Unparser::NodeHelpers - include ::Unparser::Generation - include ::Unparser::Constants - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - include ::Unparser::Writer - include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - extend ::Unparser::DSL - - # source://unparser//lib/unparser/anima.rb#146 - def buffer; end - - # source://unparser//lib/unparser/anima.rb#146 - def comments; end - - # source://unparser//lib/unparser/writer/send.rb#21 - def dispatch; end - - # source://unparser//lib/unparser/writer/send.rb#33 - def emit_heredoc_reminders; end - - # source://unparser//lib/unparser/writer/send.rb#25 - def emit_mlhs; end - - # source://unparser//lib/unparser/writer/send.rb#29 - def emit_selector; end - - # source://unparser//lib/unparser/anima.rb#146 - def local_variable_scope; end - - # source://unparser//lib/unparser/anima.rb#146 - def node; end - - private - - # source://unparser//lib/unparser/writer/send.rb#73 - def arguments; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#85 - def avoid_clash?; end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def details(&block); end - - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 - def effective_writer(&block); end - - # source://unparser//lib/unparser/writer/send.rb#45 - def effective_writer_class; end - - # source://unparser//lib/unparser/writer/send.rb#65 - def emit_arguments; end - - # source://unparser//lib/unparser/writer/send.rb#81 - def emit_heredoc_reminder(argument); end - - # source://unparser//lib/unparser/writer/send.rb#77 - def emit_normal_arguments; end - - # source://unparser//lib/unparser/writer/send.rb#61 - def emit_operator; end - - # source://unparser//lib/unparser/writer/send.rb#106 - def emit_send_regular(node); end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#89 - def local_variable_clash?; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#93 - def parses_as_constant?; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end - - # @return [Boolean] - # - # source://unparser//lib/unparser/writer/send.rb#57 - def write_as_attribute_assignment?; end - - class << self - # source://unparser//lib/unparser/anima.rb#140 - def anima; end - end -end - -# Writer for send as attribute assignment -# -# source://unparser//lib/unparser/writer/send/attribute_assignment.rb#7 -class Unparser::Writer::Send::AttributeAssignment < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#10 - def dispatch; end - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#22 - def emit_send_mlhs; end - - private - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#34 - def emit_attribute; end - - # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#29 - def emit_receiver; end - - # source://unparser//lib/unparser/dsl.rb#18 - def first_argument; end - - # source://unparser//lib/unparser/dsl.rb#18 - def receiver; end - - # source://unparser//lib/unparser/dsl.rb#11 - def remaining_children; end - - # source://unparser//lib/unparser/dsl.rb#18 - def selector; end -end - -# Writer for binary sends -# -# source://unparser//lib/unparser/writer/send/binary.rb#7 -class Unparser::Writer::Send::Binary < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/binary.rb#8 - def dispatch; end - - private - - # source://unparser//lib/unparser/writer/send/binary.rb#16 - def emit_operator; end - - # source://unparser//lib/unparser/writer/send/binary.rb#20 - def emit_right; end -end - -# source://unparser//lib/unparser/writer/send.rb#9 -Unparser::Writer::Send::INDEX_ASSIGN = T.let(T.unsafe(nil), Symbol) - -# source://unparser//lib/unparser/writer/send.rb#10 -Unparser::Writer::Send::INDEX_REFERENCE = T.let(T.unsafe(nil), Symbol) - -# source://unparser//lib/unparser/writer/send.rb#12 -Unparser::Writer::Send::OPERATORS = T.let(T.unsafe(nil), Hash) - -# Writer for "regular" receiver.selector(arguments...) case -# -# source://unparser//lib/unparser/writer/send/regular.rb#7 -class Unparser::Writer::Send::Regular < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/regular.rb#8 - def dispatch; end - - # source://unparser//lib/unparser/writer/send/regular.rb#18 - def emit_arguments_without_heredoc_body; end - - # source://unparser//lib/unparser/writer/send/regular.rb#22 - def emit_receiver; end - - # source://unparser//lib/unparser/writer/send/regular.rb#14 - def emit_send_mlhs; end -end - -# Writer for unary sends -# -# source://unparser//lib/unparser/writer/send/unary.rb#7 -class Unparser::Writer::Send::Unary < ::Unparser::Writer::Send - # source://unparser//lib/unparser/writer/send/unary.rb#15 - def dispatch; end -end - -# source://unparser//lib/unparser/writer/send/unary.rb#8 -Unparser::Writer::Send::Unary::MAP = T.let(T.unsafe(nil), Hash) diff --git a/sorbet/rbi/gems/yarp@0.11.0.rbi b/sorbet/rbi/gems/yarp@0.12.0.rbi similarity index 71% rename from sorbet/rbi/gems/yarp@0.11.0.rbi rename to sorbet/rbi/gems/yarp@0.12.0.rbi index acd3d42d8..a569756bd 100644 --- a/sorbet/rbi/gems/yarp@0.11.0.rbi +++ b/sorbet/rbi/gems/yarp@0.12.0.rbi @@ -4,9 +4,10 @@ # This is an autogenerated file for types exported from the `yarp` gem. # Please instead update this file by running `bin/tapioca gem yarp`. -# This file is generated by the templates/template.rb script and should not be -# modified manually. See templates/lib/yarp/node.rb.erb -# if you are looking to modify the template +# Reopening the YARP module after yarp/node is required so that constant +# reflection APIs will find the constants defined in the node file before these. +# This block is meant to contain extra APIs we define on YARP nodes that aren't +# templated and are meant as convenience methods. # # source://yarp//lib/yarp.rb#3 module YARP @@ -39,7 +40,7 @@ module YARP # Load the serialized AST using the source as a reference into a tree. # - # source://yarp//lib/yarp.rb#417 + # source://yarp//lib/yarp.rb#380 def load(source, serialized); end # Mirror the YARP.parse API by using the serialization API. @@ -58,16 +59,16 @@ module YARP end end -# Represents the use of the `alias` keyword. +# Represents the use of the `alias` keyword to alias a global variable. # -# alias foo bar -# ^^^^^^^^^^^^^ +# alias $foo $bar +# ^^^^^^^^^^^^^^^ # # source://yarp//lib/yarp/node.rb#13 -class YARP::AliasNode < ::YARP::Node +class YARP::AliasGlobalVariableNode < ::YARP::Node # def initialize: (new_name: Node, old_name: Node, keyword_loc: Location, location: Location) -> void # - # @return [AliasNode] a new instance of AliasNode + # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode # # source://yarp//lib/yarp/node.rb#24 def initialize(new_name, old_name, keyword_loc, location); end @@ -84,12 +85,17 @@ class YARP::AliasNode < ::YARP::Node # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#42 + # source://yarp//lib/yarp/node.rb#47 def comment_targets; end - # def copy: (**params) -> AliasNode + # def compact_child_nodes: () -> Array[Node] # - # source://yarp//lib/yarp/node.rb#47 + # source://yarp//lib/yarp/node.rb#42 + def compact_child_nodes; end + + # def copy: (**params) -> AliasGlobalVariableNode + # + # source://yarp//lib/yarp/node.rb#52 def copy(**params); end # def child_nodes: () -> Array[nil | Node] @@ -100,15 +106,22 @@ class YARP::AliasNode < ::YARP::Node # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#60 + # source://yarp//lib/yarp/node.rb#65 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#69 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#87 + def human; end + + # source://yarp//lib/yarp/node.rb#74 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#65 + # source://yarp//lib/yarp/node.rb#70 def keyword; end # attr_reader keyword_loc: Location @@ -127,72 +140,165 @@ class YARP::AliasNode < ::YARP::Node def old_name; end end +# Represents the use of the `alias` keyword to alias a method. +# +# alias foo bar +# ^^^^^^^^^^^^^ +# +# source://yarp//lib/yarp/node.rb#96 +class YARP::AliasMethodNode < ::YARP::Node + # def initialize: (new_name: Node, old_name: Node, keyword_loc: Location, location: Location) -> void + # + # @return [AliasMethodNode] a new instance of AliasMethodNode + # + # source://yarp//lib/yarp/node.rb#107 + def initialize(new_name, old_name, keyword_loc, location); end + + # def accept: (visitor: Visitor) -> void + # + # source://yarp//lib/yarp/node.rb#115 + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#120 + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://yarp//lib/yarp/node.rb#130 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#125 + def compact_child_nodes; end + + # def copy: (**params) -> AliasMethodNode + # + # source://yarp//lib/yarp/node.rb#135 + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#120 + def deconstruct; end + + # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # + # source://yarp//lib/yarp/node.rb#148 + def deconstruct_keys(keys); end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#170 + def human; end + + # source://yarp//lib/yarp/node.rb#157 + def inspect(inspector = T.unsafe(nil)); end + + # def keyword: () -> String + # + # source://yarp//lib/yarp/node.rb#153 + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://yarp//lib/yarp/node.rb#104 + def keyword_loc; end + + # attr_reader new_name: Node + # + # source://yarp//lib/yarp/node.rb#98 + def new_name; end + + # attr_reader old_name: Node + # + # source://yarp//lib/yarp/node.rb#101 + def old_name; end +end + # Represents an alternation pattern in pattern matching. # # foo => bar | baz # ^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#84 +# source://yarp//lib/yarp/node.rb#179 class YARP::AlternationPatternNode < ::YARP::Node # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void # # @return [AlternationPatternNode] a new instance of AlternationPatternNode # - # source://yarp//lib/yarp/node.rb#95 + # source://yarp//lib/yarp/node.rb#190 def initialize(left, right, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#103 + # source://yarp//lib/yarp/node.rb#198 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#108 + # source://yarp//lib/yarp/node.rb#203 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#113 + # source://yarp//lib/yarp/node.rb#213 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#208 + def compact_child_nodes; end + # def copy: (**params) -> AlternationPatternNode # - # source://yarp//lib/yarp/node.rb#118 + # source://yarp//lib/yarp/node.rb#218 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#108 + # source://yarp//lib/yarp/node.rb#203 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#131 + # source://yarp//lib/yarp/node.rb#231 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#140 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#253 + def human; end + + # source://yarp//lib/yarp/node.rb#240 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://yarp//lib/yarp/node.rb#86 + # source://yarp//lib/yarp/node.rb#181 def left; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#136 + # source://yarp//lib/yarp/node.rb#236 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#92 + # source://yarp//lib/yarp/node.rb#187 def operator_loc; end # attr_reader right: Node # - # source://yarp//lib/yarp/node.rb#89 + # source://yarp//lib/yarp/node.rb#184 def right; end end @@ -201,67 +307,79 @@ end # left and right # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#155 +# source://yarp//lib/yarp/node.rb#262 class YARP::AndNode < ::YARP::Node # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void # # @return [AndNode] a new instance of AndNode # - # source://yarp//lib/yarp/node.rb#166 + # source://yarp//lib/yarp/node.rb#273 def initialize(left, right, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#174 + # source://yarp//lib/yarp/node.rb#281 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#179 + # source://yarp//lib/yarp/node.rb#286 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#184 + # source://yarp//lib/yarp/node.rb#296 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#291 + def compact_child_nodes; end + # def copy: (**params) -> AndNode # - # source://yarp//lib/yarp/node.rb#189 + # source://yarp//lib/yarp/node.rb#301 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#179 + # source://yarp//lib/yarp/node.rb#286 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#202 + # source://yarp//lib/yarp/node.rb#314 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#211 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#336 + def human; end + + # source://yarp//lib/yarp/node.rb#323 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://yarp//lib/yarp/node.rb#157 + # source://yarp//lib/yarp/node.rb#264 def left; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#207 + # source://yarp//lib/yarp/node.rb#319 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#163 + # source://yarp//lib/yarp/node.rb#270 def operator_loc; end # attr_reader right: Node # - # source://yarp//lib/yarp/node.rb#160 + # source://yarp//lib/yarp/node.rb#267 def right; end end @@ -270,52 +388,64 @@ end # return foo, bar, baz # ^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#226 +# source://yarp//lib/yarp/node.rb#345 class YARP::ArgumentsNode < ::YARP::Node # def initialize: (arguments: Array[Node], location: Location) -> void # # @return [ArgumentsNode] a new instance of ArgumentsNode # - # source://yarp//lib/yarp/node.rb#231 + # source://yarp//lib/yarp/node.rb#350 def initialize(arguments, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#237 + # source://yarp//lib/yarp/node.rb#356 def accept(visitor); end # attr_reader arguments: Array[Node] # - # source://yarp//lib/yarp/node.rb#228 + # source://yarp//lib/yarp/node.rb#347 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#242 + # source://yarp//lib/yarp/node.rb#361 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#247 + # source://yarp//lib/yarp/node.rb#371 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#366 + def compact_child_nodes; end + # def copy: (**params) -> ArgumentsNode # - # source://yarp//lib/yarp/node.rb#252 + # source://yarp//lib/yarp/node.rb#376 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#242 + # source://yarp//lib/yarp/node.rb#361 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#263 + # source://yarp//lib/yarp/node.rb#387 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#267 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#400 + def human; end + + # source://yarp//lib/yarp/node.rb#391 def inspect(inspector = T.unsafe(nil)); end end @@ -325,72 +455,84 @@ end # [1, 2, 3] # ^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#279 +# source://yarp//lib/yarp/node.rb#410 class YARP::ArrayNode < ::YARP::Node # def initialize: (elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void # # @return [ArrayNode] a new instance of ArrayNode # - # source://yarp//lib/yarp/node.rb#290 + # source://yarp//lib/yarp/node.rb#421 def initialize(elements, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#298 + # source://yarp//lib/yarp/node.rb#429 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#303 + # source://yarp//lib/yarp/node.rb#434 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#336 + # source://yarp//lib/yarp/node.rb#472 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#287 + # source://yarp//lib/yarp/node.rb#418 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#308 + # source://yarp//lib/yarp/node.rb#444 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#439 + def compact_child_nodes; end + # def copy: (**params) -> ArrayNode # - # source://yarp//lib/yarp/node.rb#313 + # source://yarp//lib/yarp/node.rb#449 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#303 + # source://yarp//lib/yarp/node.rb#434 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#326 + # source://yarp//lib/yarp/node.rb#462 def deconstruct_keys(keys); end # attr_reader elements: Array[Node] # - # source://yarp//lib/yarp/node.rb#281 + # source://yarp//lib/yarp/node.rb#412 def elements; end - # source://yarp//lib/yarp/node.rb#340 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#487 + def human; end + + # source://yarp//lib/yarp/node.rb#476 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#331 + # source://yarp//lib/yarp/node.rb#467 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#284 + # source://yarp//lib/yarp/node.rb#415 def opening_loc; end end @@ -411,87 +553,99 @@ end # foo in Bar[1, 2, 3] # ^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#365 +# source://yarp//lib/yarp/node.rb#508 class YARP::ArrayPatternNode < ::YARP::Node # def initialize: (constant: Node?, requireds: Array[Node], rest: Node?, posts: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void # # @return [ArrayPatternNode] a new instance of ArrayPatternNode # - # source://yarp//lib/yarp/node.rb#385 + # source://yarp//lib/yarp/node.rb#528 def initialize(constant, requireds, rest, posts, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#396 + # source://yarp//lib/yarp/node.rb#539 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#401 + # source://yarp//lib/yarp/node.rb#544 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#437 + # source://yarp//lib/yarp/node.rb#590 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#382 + # source://yarp//lib/yarp/node.rb#525 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#406 + # source://yarp//lib/yarp/node.rb#559 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#549 + def compact_child_nodes; end + # attr_reader constant: Node? # - # source://yarp//lib/yarp/node.rb#367 + # source://yarp//lib/yarp/node.rb#510 def constant; end # def copy: (**params) -> ArrayPatternNode # - # source://yarp//lib/yarp/node.rb#411 + # source://yarp//lib/yarp/node.rb#564 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#401 + # source://yarp//lib/yarp/node.rb#544 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#427 + # source://yarp//lib/yarp/node.rb#580 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#441 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#618 + def human; end + + # source://yarp//lib/yarp/node.rb#594 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#432 + # source://yarp//lib/yarp/node.rb#585 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#379 + # source://yarp//lib/yarp/node.rb#522 def opening_loc; end # attr_reader posts: Array[Node] # - # source://yarp//lib/yarp/node.rb#376 + # source://yarp//lib/yarp/node.rb#519 def posts; end # attr_reader requireds: Array[Node] # - # source://yarp//lib/yarp/node.rb#370 + # source://yarp//lib/yarp/node.rb#513 def requireds; end # attr_reader rest: Node? # - # source://yarp//lib/yarp/node.rb#373 + # source://yarp//lib/yarp/node.rb#516 def rest; end end @@ -500,67 +654,79 @@ end # { a => b } # ^^^^^^ # -# source://yarp//lib/yarp/node.rb#467 +# source://yarp//lib/yarp/node.rb#627 class YARP::AssocNode < ::YARP::Node # def initialize: (key: Node, value: Node?, operator_loc: Location?, location: Location) -> void # # @return [AssocNode] a new instance of AssocNode # - # source://yarp//lib/yarp/node.rb#478 + # source://yarp//lib/yarp/node.rb#638 def initialize(key, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#486 + # source://yarp//lib/yarp/node.rb#646 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#491 + # source://yarp//lib/yarp/node.rb#651 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#496 + # source://yarp//lib/yarp/node.rb#664 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#656 + def compact_child_nodes; end + # def copy: (**params) -> AssocNode # - # source://yarp//lib/yarp/node.rb#501 + # source://yarp//lib/yarp/node.rb#669 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#491 + # source://yarp//lib/yarp/node.rb#651 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#514 + # source://yarp//lib/yarp/node.rb#682 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#523 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#708 + def human; end + + # source://yarp//lib/yarp/node.rb#691 def inspect(inspector = T.unsafe(nil)); end # attr_reader key: Node # - # source://yarp//lib/yarp/node.rb#469 + # source://yarp//lib/yarp/node.rb#629 def key; end # def operator: () -> String? # - # source://yarp//lib/yarp/node.rb#519 + # source://yarp//lib/yarp/node.rb#687 def operator; end # attr_reader operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#475 + # source://yarp//lib/yarp/node.rb#635 def operator_loc; end # attr_reader value: Node? # - # source://yarp//lib/yarp/node.rb#472 + # source://yarp//lib/yarp/node.rb#632 def value; end end @@ -569,62 +735,74 @@ end # { **foo } # ^^^^^ # -# source://yarp//lib/yarp/node.rb#542 +# source://yarp//lib/yarp/node.rb#717 class YARP::AssocSplatNode < ::YARP::Node # def initialize: (value: Node?, operator_loc: Location, location: Location) -> void # # @return [AssocSplatNode] a new instance of AssocSplatNode # - # source://yarp//lib/yarp/node.rb#550 + # source://yarp//lib/yarp/node.rb#725 def initialize(value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#557 + # source://yarp//lib/yarp/node.rb#732 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#562 + # source://yarp//lib/yarp/node.rb#737 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#567 + # source://yarp//lib/yarp/node.rb#749 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#742 + def compact_child_nodes; end + # def copy: (**params) -> AssocSplatNode # - # source://yarp//lib/yarp/node.rb#572 + # source://yarp//lib/yarp/node.rb#754 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#562 + # source://yarp//lib/yarp/node.rb#737 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#584 + # source://yarp//lib/yarp/node.rb#766 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#593 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#790 + def human; end + + # source://yarp//lib/yarp/node.rb#775 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#589 + # source://yarp//lib/yarp/node.rb#771 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#547 + # source://yarp//lib/yarp/node.rb#722 def operator_loc; end # attr_reader value: Node? # - # source://yarp//lib/yarp/node.rb#544 + # source://yarp//lib/yarp/node.rb#719 def value; end end @@ -635,47 +813,59 @@ YARP::BACKEND = T.let(T.unsafe(nil), Symbol) # $' # ^^ # -# source://yarp//lib/yarp/node.rb#610 +# source://yarp//lib/yarp/node.rb#799 class YARP::BackReferenceReadNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode # - # source://yarp//lib/yarp/node.rb#612 + # source://yarp//lib/yarp/node.rb#801 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#617 + # source://yarp//lib/yarp/node.rb#806 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#622 + # source://yarp//lib/yarp/node.rb#811 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#627 + # source://yarp//lib/yarp/node.rb#821 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#816 + def compact_child_nodes; end + # def copy: (**params) -> BackReferenceReadNode # - # source://yarp//lib/yarp/node.rb#632 + # source://yarp//lib/yarp/node.rb#826 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#622 + # source://yarp//lib/yarp/node.rb#811 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#642 + # source://yarp//lib/yarp/node.rb#836 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#646 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#848 + def human; end + + # source://yarp//lib/yarp/node.rb#840 def inspect(inspector = T.unsafe(nil)); end end @@ -703,90 +893,102 @@ end # end # ^^^^^ # -# source://yarp//lib/yarp/node.rb#658 +# source://yarp//lib/yarp/node.rb#859 class YARP::BeginNode < ::YARP::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 # # @return [BeginNode] a new instance of BeginNode # - # source://yarp//lib/yarp/node.rb#678 + # source://yarp//lib/yarp/node.rb#879 def initialize(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#689 + # source://yarp//lib/yarp/node.rb#890 def accept(visitor); end # def begin_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#729 + # source://yarp//lib/yarp/node.rb#940 def begin_keyword; end # attr_reader begin_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#660 + # source://yarp//lib/yarp/node.rb#861 def begin_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#698 + # source://yarp//lib/yarp/node.rb#899 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#703 + # source://yarp//lib/yarp/node.rb#914 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#904 + def compact_child_nodes; end + # def copy: (**params) -> BeginNode # - # source://yarp//lib/yarp/node.rb#708 + # source://yarp//lib/yarp/node.rb#919 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#698 + # source://yarp//lib/yarp/node.rb#899 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#724 + # source://yarp//lib/yarp/node.rb#935 def deconstruct_keys(keys); end # attr_reader else_clause: ElseNode? # - # source://yarp//lib/yarp/node.rb#669 + # source://yarp//lib/yarp/node.rb#870 def else_clause; end # def end_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#734 + # source://yarp//lib/yarp/node.rb#945 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#675 + # source://yarp//lib/yarp/node.rb#876 def end_keyword_loc; end # attr_reader ensure_clause: EnsureNode? # - # source://yarp//lib/yarp/node.rb#672 + # source://yarp//lib/yarp/node.rb#873 def ensure_clause; end - # source://yarp//lib/yarp/node.rb#738 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#983 + def human; end + + # source://yarp//lib/yarp/node.rb#949 def inspect(inspector = T.unsafe(nil)); end # attr_reader rescue_clause: RescueNode? # - # source://yarp//lib/yarp/node.rb#666 + # source://yarp//lib/yarp/node.rb#867 def rescue_clause; end - # source://yarp//lib/yarp/node.rb#693 + # source://yarp//lib/yarp/node.rb#894 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#663 + # source://yarp//lib/yarp/node.rb#864 def statements; end end @@ -795,62 +997,74 @@ end # bar(&args) # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#774 +# source://yarp//lib/yarp/node.rb#992 class YARP::BlockArgumentNode < ::YARP::Node # def initialize: (expression: Node?, operator_loc: Location, location: Location) -> void # # @return [BlockArgumentNode] a new instance of BlockArgumentNode # - # source://yarp//lib/yarp/node.rb#782 + # source://yarp//lib/yarp/node.rb#1000 def initialize(expression, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#789 + # source://yarp//lib/yarp/node.rb#1007 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#794 + # source://yarp//lib/yarp/node.rb#1012 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#799 + # source://yarp//lib/yarp/node.rb#1024 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1017 + def compact_child_nodes; end + # def copy: (**params) -> BlockArgumentNode # - # source://yarp//lib/yarp/node.rb#804 + # source://yarp//lib/yarp/node.rb#1029 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#794 + # source://yarp//lib/yarp/node.rb#1012 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#816 + # source://yarp//lib/yarp/node.rb#1041 def deconstruct_keys(keys); end # attr_reader expression: Node? # - # source://yarp//lib/yarp/node.rb#776 + # source://yarp//lib/yarp/node.rb#994 def expression; end - # source://yarp//lib/yarp/node.rb#825 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1065 + def human; end + + # source://yarp//lib/yarp/node.rb#1050 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#821 + # source://yarp//lib/yarp/node.rb#1046 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#779 + # source://yarp//lib/yarp/node.rb#997 def operator_loc; end end @@ -859,52 +1073,64 @@ end # a { |; b| } # ^ # -# source://yarp//lib/yarp/node.rb#842 +# source://yarp//lib/yarp/node.rb#1074 class YARP::BlockLocalVariableNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode # - # source://yarp//lib/yarp/node.rb#847 + # source://yarp//lib/yarp/node.rb#1079 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#853 + # source://yarp//lib/yarp/node.rb#1085 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#858 + # source://yarp//lib/yarp/node.rb#1090 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#863 + # source://yarp//lib/yarp/node.rb#1100 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1095 + def compact_child_nodes; end + # def copy: (**params) -> BlockLocalVariableNode # - # source://yarp//lib/yarp/node.rb#868 + # source://yarp//lib/yarp/node.rb#1105 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#858 + # source://yarp//lib/yarp/node.rb#1090 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#879 + # source://yarp//lib/yarp/node.rb#1116 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#883 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1129 + def human; end + + # source://yarp//lib/yarp/node.rb#1120 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#844 + # source://yarp//lib/yarp/node.rb#1076 def name; end end @@ -913,82 +1139,94 @@ end # [1, 2, 3].each { |i| puts x } # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#894 +# source://yarp//lib/yarp/node.rb#1138 class YARP::BlockNode < ::YARP::Node # def initialize: (locals: Array[Symbol], parameters: BlockParametersNode?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> void # # @return [BlockNode] a new instance of BlockNode # - # source://yarp//lib/yarp/node.rb#911 + # source://yarp//lib/yarp/node.rb#1155 def initialize(locals, parameters, body, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#921 + # source://yarp//lib/yarp/node.rb#1165 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#902 + # source://yarp//lib/yarp/node.rb#1146 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#926 + # source://yarp//lib/yarp/node.rb#1170 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#961 + # source://yarp//lib/yarp/node.rb#1213 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#908 + # source://yarp//lib/yarp/node.rb#1152 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#931 + # source://yarp//lib/yarp/node.rb#1183 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1175 + def compact_child_nodes; end + # def copy: (**params) -> BlockNode # - # source://yarp//lib/yarp/node.rb#936 + # source://yarp//lib/yarp/node.rb#1188 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#926 + # source://yarp//lib/yarp/node.rb#1170 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#951 + # source://yarp//lib/yarp/node.rb#1203 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#965 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1240 + def human; end + + # source://yarp//lib/yarp/node.rb#1217 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#896 + # source://yarp//lib/yarp/node.rb#1140 def locals; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#956 + # source://yarp//lib/yarp/node.rb#1208 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#905 + # source://yarp//lib/yarp/node.rb#1149 def opening_loc; end # attr_reader parameters: BlockParametersNode? # - # source://yarp//lib/yarp/node.rb#899 + # source://yarp//lib/yarp/node.rb#1143 def parameters; end end @@ -998,67 +1236,79 @@ end # ^^ # end # -# source://yarp//lib/yarp/node.rb#991 +# source://yarp//lib/yarp/node.rb#1250 class YARP::BlockParameterNode < ::YARP::Node # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void # # @return [BlockParameterNode] a new instance of BlockParameterNode # - # source://yarp//lib/yarp/node.rb#1002 + # source://yarp//lib/yarp/node.rb#1261 def initialize(name, name_loc, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1010 + # source://yarp//lib/yarp/node.rb#1269 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1015 + # source://yarp//lib/yarp/node.rb#1274 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1020 + # source://yarp//lib/yarp/node.rb#1284 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1279 + def compact_child_nodes; end + # def copy: (**params) -> BlockParameterNode # - # source://yarp//lib/yarp/node.rb#1025 + # source://yarp//lib/yarp/node.rb#1289 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1015 + # source://yarp//lib/yarp/node.rb#1274 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1038 + # source://yarp//lib/yarp/node.rb#1302 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#1047 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1322 + def human; end + + # source://yarp//lib/yarp/node.rb#1311 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://yarp//lib/yarp/node.rb#993 + # source://yarp//lib/yarp/node.rb#1252 def name; end # attr_reader name_loc: Location? # - # source://yarp//lib/yarp/node.rb#996 + # source://yarp//lib/yarp/node.rb#1255 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#1043 + # source://yarp//lib/yarp/node.rb#1307 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#999 + # source://yarp//lib/yarp/node.rb#1258 def operator_loc; end end @@ -1071,77 +1321,89 @@ end # ^^^^^^^^^^^^^^^^^ # end # -# source://yarp//lib/yarp/node.rb#1064 +# source://yarp//lib/yarp/node.rb#1335 class YARP::BlockParametersNode < ::YARP::Node # def initialize: (parameters: ParametersNode?, locals: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void # # @return [BlockParametersNode] a new instance of BlockParametersNode # - # source://yarp//lib/yarp/node.rb#1078 + # source://yarp//lib/yarp/node.rb#1349 def initialize(parameters, locals, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1087 + # source://yarp//lib/yarp/node.rb#1358 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1092 + # source://yarp//lib/yarp/node.rb#1363 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#1126 + # source://yarp//lib/yarp/node.rb#1405 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#1075 + # source://yarp//lib/yarp/node.rb#1346 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1097 + # source://yarp//lib/yarp/node.rb#1376 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1368 + def compact_child_nodes; end + # def copy: (**params) -> BlockParametersNode # - # source://yarp//lib/yarp/node.rb#1102 + # source://yarp//lib/yarp/node.rb#1381 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1092 + # source://yarp//lib/yarp/node.rb#1363 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1116 + # source://yarp//lib/yarp/node.rb#1395 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#1130 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1426 + def human; end + + # source://yarp//lib/yarp/node.rb#1409 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Node] # - # source://yarp//lib/yarp/node.rb#1069 + # source://yarp//lib/yarp/node.rb#1340 def locals; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#1121 + # source://yarp//lib/yarp/node.rb#1400 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#1072 + # source://yarp//lib/yarp/node.rb#1343 def opening_loc; end # attr_reader parameters: ParametersNode? # - # source://yarp//lib/yarp/node.rb#1066 + # source://yarp//lib/yarp/node.rb#1337 def parameters; end end @@ -1150,62 +1412,74 @@ end # break foo # ^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1149 +# source://yarp//lib/yarp/node.rb#1435 class YARP::BreakNode < ::YARP::Node # def initialize: (arguments: ArgumentsNode?, keyword_loc: Location, location: Location) -> void # # @return [BreakNode] a new instance of BreakNode # - # source://yarp//lib/yarp/node.rb#1157 + # source://yarp//lib/yarp/node.rb#1443 def initialize(arguments, keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1164 + # source://yarp//lib/yarp/node.rb#1450 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#1151 + # source://yarp//lib/yarp/node.rb#1437 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1169 + # source://yarp//lib/yarp/node.rb#1455 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1174 + # source://yarp//lib/yarp/node.rb#1467 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1460 + def compact_child_nodes; end + # def copy: (**params) -> BreakNode # - # source://yarp//lib/yarp/node.rb#1179 + # source://yarp//lib/yarp/node.rb#1472 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1169 + # source://yarp//lib/yarp/node.rb#1455 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1191 + # source://yarp//lib/yarp/node.rb#1484 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#1200 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1508 + def human; end + + # source://yarp//lib/yarp/node.rb#1493 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#1196 + # source://yarp//lib/yarp/node.rb#1489 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#1154 + # source://yarp//lib/yarp/node.rb#1440 def keyword_loc; end end @@ -1214,142 +1488,156 @@ end # foo.bar &&= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1217 +# source://yarp//lib/yarp/node.rb#1517 class YARP::CallAndWriteNode < ::YARP::Node # def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, flags: Integer, read_name: String, write_name: String, operator_loc: Location, value: Node, location: Location) -> void # # @return [CallAndWriteNode] a new instance of CallAndWriteNode # - # source://yarp//lib/yarp/node.rb#1252 + # source://yarp//lib/yarp/node.rb#1552 def initialize(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1268 + # source://yarp//lib/yarp/node.rb#1568 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#1231 + # source://yarp//lib/yarp/node.rb#1531 def arguments; end # def call_operator: () -> String? # - # source://yarp//lib/yarp/node.rb#1309 + # source://yarp//lib/yarp/node.rb#1618 def call_operator; end # attr_reader call_operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#1222 + # source://yarp//lib/yarp/node.rb#1522 def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1273 + # source://yarp//lib/yarp/node.rb#1573 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#1324 + # source://yarp//lib/yarp/node.rb#1633 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#1234 + # source://yarp//lib/yarp/node.rb#1534 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1278 + # source://yarp//lib/yarp/node.rb#1587 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1578 + def compact_child_nodes; end + # def copy: (**params) -> CallAndWriteNode # - # source://yarp//lib/yarp/node.rb#1283 + # source://yarp//lib/yarp/node.rb#1592 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1273 + # source://yarp//lib/yarp/node.rb#1573 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1304 + # source://yarp//lib/yarp/node.rb#1613 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#1237 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1683 + def human; end - # source://yarp//lib/yarp/node.rb#1343 + # source://yarp//lib/yarp/node.rb#1652 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://yarp//lib/yarp/node.rb#1314 + # source://yarp//lib/yarp/node.rb#1623 def message; end # attr_reader message_loc: Location? # - # source://yarp//lib/yarp/node.rb#1225 + # source://yarp//lib/yarp/node.rb#1525 def message_loc; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#1319 + # source://yarp//lib/yarp/node.rb#1628 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#1228 + # source://yarp//lib/yarp/node.rb#1528 def opening_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#1339 + # source://yarp//lib/yarp/node.rb#1648 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#1246 + # source://yarp//lib/yarp/node.rb#1546 def operator_loc; end # attr_reader read_name: String # - # source://yarp//lib/yarp/node.rb#1240 + # source://yarp//lib/yarp/node.rb#1540 def read_name; end # attr_reader receiver: Node? # - # source://yarp//lib/yarp/node.rb#1219 + # source://yarp//lib/yarp/node.rb#1519 def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1329 + # source://yarp//lib/yarp/node.rb#1638 def safe_navigation?; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#1249 + # source://yarp//lib/yarp/node.rb#1549 def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1334 + # source://yarp//lib/yarp/node.rb#1643 def variable_call?; end # attr_reader write_name: String # - # source://yarp//lib/yarp/node.rb#1243 + # source://yarp//lib/yarp/node.rb#1543 def write_name; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#1537 + def flags; end end # Represents a method call, in all of the various forms that can take. @@ -1372,140 +1660,154 @@ end # foo&.bar # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1390 +# source://yarp//lib/yarp/node.rb#1707 class YARP::CallNode < ::YARP::Node # def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: BlockNode?, flags: Integer, name: String, location: Location) -> void # # @return [CallNode] a new instance of CallNode # - # source://yarp//lib/yarp/node.rb#1419 + # source://yarp//lib/yarp/node.rb#1736 def initialize(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, block, flags, name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1433 + # source://yarp//lib/yarp/node.rb#1750 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#1404 + # source://yarp//lib/yarp/node.rb#1721 def arguments; end # attr_reader block: BlockNode? # - # source://yarp//lib/yarp/node.rb#1410 + # source://yarp//lib/yarp/node.rb#1727 def block; end # def call_operator: () -> String? # - # source://yarp//lib/yarp/node.rb#1472 + # source://yarp//lib/yarp/node.rb#1798 def call_operator; end # attr_reader call_operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#1395 + # source://yarp//lib/yarp/node.rb#1712 def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1438 + # source://yarp//lib/yarp/node.rb#1755 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#1487 + # source://yarp//lib/yarp/node.rb#1813 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#1407 + # source://yarp//lib/yarp/node.rb#1724 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1443 + # source://yarp//lib/yarp/node.rb#1769 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1760 + def compact_child_nodes; end + # def copy: (**params) -> CallNode # - # source://yarp//lib/yarp/node.rb#1448 + # source://yarp//lib/yarp/node.rb#1774 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1438 + # source://yarp//lib/yarp/node.rb#1755 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1467 + # source://yarp//lib/yarp/node.rb#1793 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#1413 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#1860 + def human; end - # source://yarp//lib/yarp/node.rb#1501 + # source://yarp//lib/yarp/node.rb#1827 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://yarp//lib/yarp/node.rb#1477 + # source://yarp//lib/yarp/node.rb#1803 def message; end # attr_reader message_loc: Location? # - # source://yarp//lib/yarp/node.rb#1398 + # source://yarp//lib/yarp/node.rb#1715 def message_loc; end # attr_reader name: String # - # source://yarp//lib/yarp/node.rb#1416 + # source://yarp//lib/yarp/node.rb#1733 def name; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#1482 + # source://yarp//lib/yarp/node.rb#1808 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#1401 + # source://yarp//lib/yarp/node.rb#1718 def opening_loc; end # attr_reader receiver: Node? # - # source://yarp//lib/yarp/node.rb#1392 + # source://yarp//lib/yarp/node.rb#1709 def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1492 + # source://yarp//lib/yarp/node.rb#1818 def safe_navigation?; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1497 + # source://yarp//lib/yarp/node.rb#1823 def variable_call?; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#1730 + def flags; end end -# source://yarp//lib/yarp/node.rb#10557 +# source://yarp//lib/yarp/node.rb#12895 module YARP::CallNodeFlags; end # &. operator # -# source://yarp//lib/yarp/node.rb#10559 +# source://yarp//lib/yarp/node.rb#12897 YARP::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer) # a call that could have been a local variable # -# source://yarp//lib/yarp/node.rb#10562 +# source://yarp//lib/yarp/node.rb#12900 YARP::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # Represents the use of an assignment operator on a call. @@ -1513,142 +1815,156 @@ YARP::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # foo.bar += baz # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1535 +# source://yarp//lib/yarp/node.rb#1869 class YARP::CallOperatorWriteNode < ::YARP::Node # def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, flags: Integer, read_name: String, write_name: String, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> void # # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#1573 + # source://yarp//lib/yarp/node.rb#1907 def initialize(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1590 + # source://yarp//lib/yarp/node.rb#1924 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#1549 + # source://yarp//lib/yarp/node.rb#1883 def arguments; end # def call_operator: () -> String? # - # source://yarp//lib/yarp/node.rb#1632 + # source://yarp//lib/yarp/node.rb#1975 def call_operator; end # attr_reader call_operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#1540 + # source://yarp//lib/yarp/node.rb#1874 def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1595 + # source://yarp//lib/yarp/node.rb#1929 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#1647 + # source://yarp//lib/yarp/node.rb#1990 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#1552 + # source://yarp//lib/yarp/node.rb#1886 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1600 + # source://yarp//lib/yarp/node.rb#1943 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#1934 + def compact_child_nodes; end + # def copy: (**params) -> CallOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#1605 + # source://yarp//lib/yarp/node.rb#1948 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1595 + # source://yarp//lib/yarp/node.rb#1929 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1627 + # source://yarp//lib/yarp/node.rb#1970 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#1555 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2036 + def human; end - # source://yarp//lib/yarp/node.rb#1661 + # source://yarp//lib/yarp/node.rb#2004 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://yarp//lib/yarp/node.rb#1637 + # source://yarp//lib/yarp/node.rb#1980 def message; end # attr_reader message_loc: Location? # - # source://yarp//lib/yarp/node.rb#1543 + # source://yarp//lib/yarp/node.rb#1877 def message_loc; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#1642 + # source://yarp//lib/yarp/node.rb#1985 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#1546 + # source://yarp//lib/yarp/node.rb#1880 def opening_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#1564 + # source://yarp//lib/yarp/node.rb#1898 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#1567 + # source://yarp//lib/yarp/node.rb#1901 def operator_loc; end # attr_reader read_name: String # - # source://yarp//lib/yarp/node.rb#1558 + # source://yarp//lib/yarp/node.rb#1892 def read_name; end # attr_reader receiver: Node? # - # source://yarp//lib/yarp/node.rb#1537 + # source://yarp//lib/yarp/node.rb#1871 def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1652 + # source://yarp//lib/yarp/node.rb#1995 def safe_navigation?; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#1570 + # source://yarp//lib/yarp/node.rb#1904 def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1657 + # source://yarp//lib/yarp/node.rb#2000 def variable_call?; end # attr_reader write_name: String # - # source://yarp//lib/yarp/node.rb#1561 + # source://yarp//lib/yarp/node.rb#1895 def write_name; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#1889 + def flags; end end # Represents the use of the `||=` operator on a call. @@ -1656,142 +1972,156 @@ end # foo.bar ||= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1694 +# source://yarp//lib/yarp/node.rb#2045 class YARP::CallOrWriteNode < ::YARP::Node # def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, flags: Integer, read_name: String, write_name: String, operator_loc: Location, value: Node, location: Location) -> void # # @return [CallOrWriteNode] a new instance of CallOrWriteNode # - # source://yarp//lib/yarp/node.rb#1729 + # source://yarp//lib/yarp/node.rb#2080 def initialize(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1745 + # source://yarp//lib/yarp/node.rb#2096 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#1708 + # source://yarp//lib/yarp/node.rb#2059 def arguments; end # def call_operator: () -> String? # - # source://yarp//lib/yarp/node.rb#1786 + # source://yarp//lib/yarp/node.rb#2146 def call_operator; end # attr_reader call_operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#1699 + # source://yarp//lib/yarp/node.rb#2050 def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1750 + # source://yarp//lib/yarp/node.rb#2101 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#1801 + # source://yarp//lib/yarp/node.rb#2161 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#1711 + # source://yarp//lib/yarp/node.rb#2062 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1755 + # source://yarp//lib/yarp/node.rb#2115 def comment_targets; end - # def copy: (**params) -> CallOrWriteNode + # def compact_child_nodes: () -> Array[Node] # - # source://yarp//lib/yarp/node.rb#1760 + # source://yarp//lib/yarp/node.rb#2106 + def compact_child_nodes; end + + # def copy: (**params) -> CallOrWriteNode + # + # source://yarp//lib/yarp/node.rb#2120 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1750 + # source://yarp//lib/yarp/node.rb#2101 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1781 + # source://yarp//lib/yarp/node.rb#2141 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#1714 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2211 + def human; end - # source://yarp//lib/yarp/node.rb#1820 + # source://yarp//lib/yarp/node.rb#2180 def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://yarp//lib/yarp/node.rb#1791 + # source://yarp//lib/yarp/node.rb#2151 def message; end # attr_reader message_loc: Location? # - # source://yarp//lib/yarp/node.rb#1702 + # source://yarp//lib/yarp/node.rb#2053 def message_loc; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#1796 + # source://yarp//lib/yarp/node.rb#2156 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#1705 + # source://yarp//lib/yarp/node.rb#2056 def opening_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#1816 + # source://yarp//lib/yarp/node.rb#2176 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#1723 + # source://yarp//lib/yarp/node.rb#2074 def operator_loc; end # attr_reader read_name: String # - # source://yarp//lib/yarp/node.rb#1717 + # source://yarp//lib/yarp/node.rb#2068 def read_name; end # attr_reader receiver: Node? # - # source://yarp//lib/yarp/node.rb#1696 + # source://yarp//lib/yarp/node.rb#2047 def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1806 + # source://yarp//lib/yarp/node.rb#2166 def safe_navigation?; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#1726 + # source://yarp//lib/yarp/node.rb#2077 def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#1811 + # source://yarp//lib/yarp/node.rb#2171 def variable_call?; end # attr_reader write_name: String # - # source://yarp//lib/yarp/node.rb#1720 + # source://yarp//lib/yarp/node.rb#2071 def write_name; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#2065 + def flags; end end # Represents assigning to a local variable in pattern matching. @@ -1799,67 +2129,79 @@ end # foo => [bar => baz] # ^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#1852 +# source://yarp//lib/yarp/node.rb#2220 class YARP::CapturePatternNode < ::YARP::Node # def initialize: (value: Node, target: Node, operator_loc: Location, location: Location) -> void # # @return [CapturePatternNode] a new instance of CapturePatternNode # - # source://yarp//lib/yarp/node.rb#1863 + # source://yarp//lib/yarp/node.rb#2231 def initialize(value, target, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1871 + # source://yarp//lib/yarp/node.rb#2239 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1876 + # source://yarp//lib/yarp/node.rb#2244 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1881 + # source://yarp//lib/yarp/node.rb#2254 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2249 + def compact_child_nodes; end + # def copy: (**params) -> CapturePatternNode # - # source://yarp//lib/yarp/node.rb#1886 + # source://yarp//lib/yarp/node.rb#2259 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1876 + # source://yarp//lib/yarp/node.rb#2244 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1899 + # source://yarp//lib/yarp/node.rb#2272 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#1908 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2294 + def human; end + + # source://yarp//lib/yarp/node.rb#2281 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#1904 + # source://yarp//lib/yarp/node.rb#2277 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#1860 + # source://yarp//lib/yarp/node.rb#2228 def operator_loc; end # attr_reader target: Node # - # source://yarp//lib/yarp/node.rb#1857 + # source://yarp//lib/yarp/node.rb#2225 def target; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#1854 + # source://yarp//lib/yarp/node.rb#2222 def value; end end @@ -1870,82 +2212,94 @@ end # when false # end # -# source://yarp//lib/yarp/node.rb#1925 +# source://yarp//lib/yarp/node.rb#2305 class YARP::CaseNode < ::YARP::Node # def initialize: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> void # # @return [CaseNode] a new instance of CaseNode # - # source://yarp//lib/yarp/node.rb#1942 + # source://yarp//lib/yarp/node.rb#2322 def initialize(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#1952 + # source://yarp//lib/yarp/node.rb#2332 def accept(visitor); end # def case_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#1987 + # source://yarp//lib/yarp/node.rb#2376 def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#1936 + # source://yarp//lib/yarp/node.rb#2316 def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1957 + # source://yarp//lib/yarp/node.rb#2337 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#1962 + # source://yarp//lib/yarp/node.rb#2351 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2342 + def compact_child_nodes; end + # attr_reader conditions: Array[Node] # - # source://yarp//lib/yarp/node.rb#1930 + # source://yarp//lib/yarp/node.rb#2310 def conditions; end # attr_reader consequent: ElseNode? # - # source://yarp//lib/yarp/node.rb#1933 + # source://yarp//lib/yarp/node.rb#2313 def consequent; end # def copy: (**params) -> CaseNode # - # source://yarp//lib/yarp/node.rb#1967 + # source://yarp//lib/yarp/node.rb#2356 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#1957 + # source://yarp//lib/yarp/node.rb#2337 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#1982 + # source://yarp//lib/yarp/node.rb#2371 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#1992 + # source://yarp//lib/yarp/node.rb#2381 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#1939 + # source://yarp//lib/yarp/node.rb#2319 def end_keyword_loc; end - # source://yarp//lib/yarp/node.rb#1996 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2408 + def human; end + + # source://yarp//lib/yarp/node.rb#2385 def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Node? # - # source://yarp//lib/yarp/node.rb#1927 + # source://yarp//lib/yarp/node.rb#2307 def predicate; end end @@ -1954,102 +2308,114 @@ end # class Foo end # ^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2021 +# source://yarp//lib/yarp/node.rb#2417 class YARP::ClassNode < ::YARP::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 # # @return [ClassNode] a new instance of ClassNode # - # source://yarp//lib/yarp/node.rb#2047 + # source://yarp//lib/yarp/node.rb#2443 def initialize(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2060 + # source://yarp//lib/yarp/node.rb#2456 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#2038 + # source://yarp//lib/yarp/node.rb#2434 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2065 + # source://yarp//lib/yarp/node.rb#2461 def child_nodes; end # def class_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#2098 + # source://yarp//lib/yarp/node.rb#2503 def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#2026 + # source://yarp//lib/yarp/node.rb#2422 def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2070 + # source://yarp//lib/yarp/node.rb#2475 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2466 + def compact_child_nodes; end + # attr_reader constant_path: Node # - # source://yarp//lib/yarp/node.rb#2029 + # source://yarp//lib/yarp/node.rb#2425 def constant_path; end # def copy: (**params) -> ClassNode # - # source://yarp//lib/yarp/node.rb#2075 + # source://yarp//lib/yarp/node.rb#2480 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2065 + # source://yarp//lib/yarp/node.rb#2461 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2093 + # source://yarp//lib/yarp/node.rb#2498 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#2108 + # source://yarp//lib/yarp/node.rb#2513 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#2041 + # source://yarp//lib/yarp/node.rb#2437 def end_keyword_loc; end + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2544 + def human; end + # def inheritance_operator: () -> String? # - # source://yarp//lib/yarp/node.rb#2103 + # source://yarp//lib/yarp/node.rb#2508 def inheritance_operator; end # attr_reader inheritance_operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#2032 + # source://yarp//lib/yarp/node.rb#2428 def inheritance_operator_loc; end - # source://yarp//lib/yarp/node.rb#2112 + # source://yarp//lib/yarp/node.rb#2517 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#2023 + # source://yarp//lib/yarp/node.rb#2419 def locals; end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2044 + # source://yarp//lib/yarp/node.rb#2440 def name; end # attr_reader superclass: Node? # - # source://yarp//lib/yarp/node.rb#2035 + # source://yarp//lib/yarp/node.rb#2431 def superclass; end end @@ -2058,72 +2424,84 @@ end # @@target &&= value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2141 +# source://yarp//lib/yarp/node.rb#2553 class YARP::ClassVariableAndWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#2155 + # source://yarp//lib/yarp/node.rb#2567 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2164 + # source://yarp//lib/yarp/node.rb#2576 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2169 + # source://yarp//lib/yarp/node.rb#2581 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2174 + # source://yarp//lib/yarp/node.rb#2591 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2586 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#2179 + # source://yarp//lib/yarp/node.rb#2596 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2169 + # source://yarp//lib/yarp/node.rb#2581 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2193 + # source://yarp//lib/yarp/node.rb#2610 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2202 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2632 + def human; end + + # source://yarp//lib/yarp/node.rb#2619 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2143 + # source://yarp//lib/yarp/node.rb#2555 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2146 + # source://yarp//lib/yarp/node.rb#2558 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#2198 + # source://yarp//lib/yarp/node.rb#2615 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2149 + # source://yarp//lib/yarp/node.rb#2561 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2152 + # source://yarp//lib/yarp/node.rb#2564 def value; end end @@ -2132,72 +2510,84 @@ end # @@target += value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2217 +# source://yarp//lib/yarp/node.rb#2641 class YARP::ClassVariableOperatorWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void # # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2234 + # source://yarp//lib/yarp/node.rb#2658 def initialize(name, name_loc, operator_loc, value, operator, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2244 + # source://yarp//lib/yarp/node.rb#2668 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2249 + # source://yarp//lib/yarp/node.rb#2673 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2254 + # source://yarp//lib/yarp/node.rb#2683 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2678 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2259 + # source://yarp//lib/yarp/node.rb#2688 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2249 + # source://yarp//lib/yarp/node.rb#2673 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2274 + # source://yarp//lib/yarp/node.rb#2703 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2278 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2721 + def human; end + + # source://yarp//lib/yarp/node.rb#2707 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2219 + # source://yarp//lib/yarp/node.rb#2643 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2222 + # source://yarp//lib/yarp/node.rb#2646 def name_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#2231 + # source://yarp//lib/yarp/node.rb#2655 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2225 + # source://yarp//lib/yarp/node.rb#2649 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2228 + # source://yarp//lib/yarp/node.rb#2652 def value; end end @@ -2206,72 +2596,84 @@ end # @@target ||= value # ^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2294 +# source://yarp//lib/yarp/node.rb#2730 class YARP::ClassVariableOrWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#2308 + # source://yarp//lib/yarp/node.rb#2744 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2317 + # source://yarp//lib/yarp/node.rb#2753 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2322 + # source://yarp//lib/yarp/node.rb#2758 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2327 + # source://yarp//lib/yarp/node.rb#2768 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2763 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#2332 + # source://yarp//lib/yarp/node.rb#2773 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2322 + # source://yarp//lib/yarp/node.rb#2758 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2346 + # source://yarp//lib/yarp/node.rb#2787 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2355 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2809 + def human; end + + # source://yarp//lib/yarp/node.rb#2796 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2296 + # source://yarp//lib/yarp/node.rb#2732 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2299 + # source://yarp//lib/yarp/node.rb#2735 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#2351 + # source://yarp//lib/yarp/node.rb#2792 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2302 + # source://yarp//lib/yarp/node.rb#2738 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2305 + # source://yarp//lib/yarp/node.rb#2741 def value; end end @@ -2280,52 +2682,64 @@ end # @@foo # ^^^^^ # -# source://yarp//lib/yarp/node.rb#2370 +# source://yarp//lib/yarp/node.rb#2818 class YARP::ClassVariableReadNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode # - # source://yarp//lib/yarp/node.rb#2375 + # source://yarp//lib/yarp/node.rb#2823 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2381 + # source://yarp//lib/yarp/node.rb#2829 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2386 + # source://yarp//lib/yarp/node.rb#2834 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2391 + # source://yarp//lib/yarp/node.rb#2844 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2839 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableReadNode # - # source://yarp//lib/yarp/node.rb#2396 + # source://yarp//lib/yarp/node.rb#2849 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2386 + # source://yarp//lib/yarp/node.rb#2834 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2407 + # source://yarp//lib/yarp/node.rb#2860 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2411 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2873 + def human; end + + # source://yarp//lib/yarp/node.rb#2864 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2372 + # source://yarp//lib/yarp/node.rb#2820 def name; end end @@ -2334,52 +2748,64 @@ end # @@foo, @@bar = baz # ^^^^^ ^^^^^ # -# source://yarp//lib/yarp/node.rb#2422 +# source://yarp//lib/yarp/node.rb#2882 class YARP::ClassVariableTargetNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode # - # source://yarp//lib/yarp/node.rb#2427 + # source://yarp//lib/yarp/node.rb#2887 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2433 + # source://yarp//lib/yarp/node.rb#2893 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2438 + # source://yarp//lib/yarp/node.rb#2898 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2443 + # source://yarp//lib/yarp/node.rb#2908 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2903 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableTargetNode # - # source://yarp//lib/yarp/node.rb#2448 + # source://yarp//lib/yarp/node.rb#2913 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2438 + # source://yarp//lib/yarp/node.rb#2898 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2459 + # source://yarp//lib/yarp/node.rb#2924 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2463 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#2937 + def human; end + + # source://yarp//lib/yarp/node.rb#2928 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2424 + # source://yarp//lib/yarp/node.rb#2884 def name; end end @@ -2388,72 +2814,84 @@ end # @@foo = 1 # ^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2474 +# source://yarp//lib/yarp/node.rb#2946 class YARP::ClassVariableWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location?, location: Location) -> void # # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode # - # source://yarp//lib/yarp/node.rb#2488 + # source://yarp//lib/yarp/node.rb#2960 def initialize(name, name_loc, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2497 + # source://yarp//lib/yarp/node.rb#2969 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2502 + # source://yarp//lib/yarp/node.rb#2974 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2507 + # source://yarp//lib/yarp/node.rb#2984 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#2979 + def compact_child_nodes; end + # def copy: (**params) -> ClassVariableWriteNode # - # source://yarp//lib/yarp/node.rb#2512 + # source://yarp//lib/yarp/node.rb#2989 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2502 + # source://yarp//lib/yarp/node.rb#2974 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2526 + # source://yarp//lib/yarp/node.rb#3003 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2535 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3025 + def human; end + + # source://yarp//lib/yarp/node.rb#3012 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2476 + # source://yarp//lib/yarp/node.rb#2948 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2479 + # source://yarp//lib/yarp/node.rb#2951 def name_loc; end # def operator: () -> String? # - # source://yarp//lib/yarp/node.rb#2531 + # source://yarp//lib/yarp/node.rb#3008 def operator; end # attr_reader operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#2485 + # source://yarp//lib/yarp/node.rb#2957 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2482 + # source://yarp//lib/yarp/node.rb#2954 def value; end end @@ -2498,72 +2936,84 @@ YARP::Comment::TYPES = T.let(T.unsafe(nil), Array) # Target &&= value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2550 +# source://yarp//lib/yarp/node.rb#3034 class YARP::ConstantAndWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode # - # source://yarp//lib/yarp/node.rb#2564 + # source://yarp//lib/yarp/node.rb#3048 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2573 + # source://yarp//lib/yarp/node.rb#3057 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2578 + # source://yarp//lib/yarp/node.rb#3062 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2583 + # source://yarp//lib/yarp/node.rb#3072 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3067 + def compact_child_nodes; end + # def copy: (**params) -> ConstantAndWriteNode # - # source://yarp//lib/yarp/node.rb#2588 + # source://yarp//lib/yarp/node.rb#3077 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2578 + # source://yarp//lib/yarp/node.rb#3062 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2602 + # source://yarp//lib/yarp/node.rb#3091 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2611 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3113 + def human; end + + # source://yarp//lib/yarp/node.rb#3100 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2552 + # source://yarp//lib/yarp/node.rb#3036 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2555 + # source://yarp//lib/yarp/node.rb#3039 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#2607 + # source://yarp//lib/yarp/node.rb#3096 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2558 + # source://yarp//lib/yarp/node.rb#3042 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2561 + # source://yarp//lib/yarp/node.rb#3045 def value; end end @@ -2572,72 +3022,84 @@ end # Target += value # ^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2626 +# source://yarp//lib/yarp/node.rb#3122 class YARP::ConstantOperatorWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void # # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2643 + # source://yarp//lib/yarp/node.rb#3139 def initialize(name, name_loc, operator_loc, value, operator, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2653 + # source://yarp//lib/yarp/node.rb#3149 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2658 + # source://yarp//lib/yarp/node.rb#3154 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2663 + # source://yarp//lib/yarp/node.rb#3164 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3159 + def compact_child_nodes; end + # def copy: (**params) -> ConstantOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2668 + # source://yarp//lib/yarp/node.rb#3169 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2658 + # source://yarp//lib/yarp/node.rb#3154 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2683 + # source://yarp//lib/yarp/node.rb#3184 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2687 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3202 + def human; end + + # source://yarp//lib/yarp/node.rb#3188 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2628 + # source://yarp//lib/yarp/node.rb#3124 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2631 + # source://yarp//lib/yarp/node.rb#3127 def name_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#2640 + # source://yarp//lib/yarp/node.rb#3136 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2634 + # source://yarp//lib/yarp/node.rb#3130 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2637 + # source://yarp//lib/yarp/node.rb#3133 def value; end end @@ -2646,72 +3108,84 @@ end # Target ||= value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2703 +# source://yarp//lib/yarp/node.rb#3211 class YARP::ConstantOrWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode # - # source://yarp//lib/yarp/node.rb#2717 + # source://yarp//lib/yarp/node.rb#3225 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2726 + # source://yarp//lib/yarp/node.rb#3234 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2731 + # source://yarp//lib/yarp/node.rb#3239 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2736 + # source://yarp//lib/yarp/node.rb#3249 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3244 + def compact_child_nodes; end + # def copy: (**params) -> ConstantOrWriteNode # - # source://yarp//lib/yarp/node.rb#2741 + # source://yarp//lib/yarp/node.rb#3254 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2731 + # source://yarp//lib/yarp/node.rb#3239 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2755 + # source://yarp//lib/yarp/node.rb#3268 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2764 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3290 + def human; end + + # source://yarp//lib/yarp/node.rb#3277 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#2705 + # source://yarp//lib/yarp/node.rb#3213 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#2708 + # source://yarp//lib/yarp/node.rb#3216 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#2760 + # source://yarp//lib/yarp/node.rb#3273 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2711 + # source://yarp//lib/yarp/node.rb#3219 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2714 + # source://yarp//lib/yarp/node.rb#3222 def value; end end @@ -2720,67 +3194,79 @@ end # Parent::Child &&= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2779 +# source://yarp//lib/yarp/node.rb#3299 class YARP::ConstantPathAndWriteNode < ::YARP::Node # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void # # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode # - # source://yarp//lib/yarp/node.rb#2790 + # source://yarp//lib/yarp/node.rb#3310 def initialize(target, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2798 + # source://yarp//lib/yarp/node.rb#3318 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2803 + # source://yarp//lib/yarp/node.rb#3323 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2808 + # source://yarp//lib/yarp/node.rb#3333 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3328 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathAndWriteNode # - # source://yarp//lib/yarp/node.rb#2813 + # source://yarp//lib/yarp/node.rb#3338 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2803 + # source://yarp//lib/yarp/node.rb#3323 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2826 + # source://yarp//lib/yarp/node.rb#3351 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2835 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3373 + def human; end + + # source://yarp//lib/yarp/node.rb#3360 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#2831 + # source://yarp//lib/yarp/node.rb#3356 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2784 + # source://yarp//lib/yarp/node.rb#3304 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://yarp//lib/yarp/node.rb#2781 + # source://yarp//lib/yarp/node.rb#3301 def target; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2787 + # source://yarp//lib/yarp/node.rb#3307 def value; end end @@ -2789,67 +3275,79 @@ end # Foo::Bar # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2850 +# source://yarp//lib/yarp/node.rb#3382 class YARP::ConstantPathNode < ::YARP::Node # def initialize: (parent: Node?, child: Node, delimiter_loc: Location, location: Location) -> void # # @return [ConstantPathNode] a new instance of ConstantPathNode # - # source://yarp//lib/yarp/node.rb#2861 + # source://yarp//lib/yarp/node.rb#3393 def initialize(parent, child, delimiter_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2869 + # source://yarp//lib/yarp/node.rb#3401 def accept(visitor); end # attr_reader child: Node # - # source://yarp//lib/yarp/node.rb#2855 + # source://yarp//lib/yarp/node.rb#3387 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2874 + # source://yarp//lib/yarp/node.rb#3406 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2879 + # source://yarp//lib/yarp/node.rb#3419 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3411 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathNode # - # source://yarp//lib/yarp/node.rb#2884 + # source://yarp//lib/yarp/node.rb#3424 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2874 + # source://yarp//lib/yarp/node.rb#3406 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2897 + # source://yarp//lib/yarp/node.rb#3437 def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://yarp//lib/yarp/node.rb#2902 + # source://yarp//lib/yarp/node.rb#3442 def delimiter; end # attr_reader delimiter_loc: Location # - # source://yarp//lib/yarp/node.rb#2858 + # source://yarp//lib/yarp/node.rb#3390 def delimiter_loc; end - # source://yarp//lib/yarp/node.rb#2906 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3463 + def human; end + + # source://yarp//lib/yarp/node.rb#3446 def inspect(inspector = T.unsafe(nil)); end # attr_reader parent: Node? # - # source://yarp//lib/yarp/node.rb#2852 + # source://yarp//lib/yarp/node.rb#3384 def parent; end end @@ -2858,67 +3356,79 @@ end # Parent::Child += value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2925 +# source://yarp//lib/yarp/node.rb#3472 class YARP::ConstantPathOperatorWriteNode < ::YARP::Node # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void # # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2939 + # source://yarp//lib/yarp/node.rb#3486 def initialize(target, operator_loc, value, operator, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#2948 + # source://yarp//lib/yarp/node.rb#3495 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2953 + # source://yarp//lib/yarp/node.rb#3500 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#2958 + # source://yarp//lib/yarp/node.rb#3510 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3505 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#2963 + # source://yarp//lib/yarp/node.rb#3515 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#2953 + # source://yarp//lib/yarp/node.rb#3500 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#2977 + # source://yarp//lib/yarp/node.rb#3529 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#2981 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3547 + def human; end + + # source://yarp//lib/yarp/node.rb#3533 def inspect(inspector = T.unsafe(nil)); end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#2936 + # source://yarp//lib/yarp/node.rb#3483 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#2930 + # source://yarp//lib/yarp/node.rb#3477 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://yarp//lib/yarp/node.rb#2927 + # source://yarp//lib/yarp/node.rb#3474 def target; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#2933 + # source://yarp//lib/yarp/node.rb#3480 def value; end end @@ -2927,67 +3437,79 @@ end # Parent::Child ||= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#2997 +# source://yarp//lib/yarp/node.rb#3556 class YARP::ConstantPathOrWriteNode < ::YARP::Node # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void # # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode # - # source://yarp//lib/yarp/node.rb#3008 + # source://yarp//lib/yarp/node.rb#3567 def initialize(target, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3016 + # source://yarp//lib/yarp/node.rb#3575 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3021 + # source://yarp//lib/yarp/node.rb#3580 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3026 + # source://yarp//lib/yarp/node.rb#3590 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3585 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathOrWriteNode # - # source://yarp//lib/yarp/node.rb#3031 + # source://yarp//lib/yarp/node.rb#3595 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3021 + # source://yarp//lib/yarp/node.rb#3580 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3044 + # source://yarp//lib/yarp/node.rb#3608 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3053 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3630 + def human; end + + # source://yarp//lib/yarp/node.rb#3617 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#3049 + # source://yarp//lib/yarp/node.rb#3613 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#3002 + # source://yarp//lib/yarp/node.rb#3561 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://yarp//lib/yarp/node.rb#2999 + # source://yarp//lib/yarp/node.rb#3558 def target; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#3005 + # source://yarp//lib/yarp/node.rb#3564 def value; end end @@ -2996,67 +3518,79 @@ end # Foo::Foo, Bar::Bar = baz # ^^^^^^^^ ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3068 +# source://yarp//lib/yarp/node.rb#3639 class YARP::ConstantPathTargetNode < ::YARP::Node # def initialize: (parent: Node?, child: Node, delimiter_loc: Location, location: Location) -> void # # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode # - # source://yarp//lib/yarp/node.rb#3079 + # source://yarp//lib/yarp/node.rb#3650 def initialize(parent, child, delimiter_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3087 + # source://yarp//lib/yarp/node.rb#3658 def accept(visitor); end # attr_reader child: Node # - # source://yarp//lib/yarp/node.rb#3073 + # source://yarp//lib/yarp/node.rb#3644 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3092 + # source://yarp//lib/yarp/node.rb#3663 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3097 + # source://yarp//lib/yarp/node.rb#3676 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3668 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathTargetNode # - # source://yarp//lib/yarp/node.rb#3102 + # source://yarp//lib/yarp/node.rb#3681 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3092 + # source://yarp//lib/yarp/node.rb#3663 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3115 + # source://yarp//lib/yarp/node.rb#3694 def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://yarp//lib/yarp/node.rb#3120 + # source://yarp//lib/yarp/node.rb#3699 def delimiter; end # attr_reader delimiter_loc: Location # - # source://yarp//lib/yarp/node.rb#3076 + # source://yarp//lib/yarp/node.rb#3647 def delimiter_loc; end - # source://yarp//lib/yarp/node.rb#3124 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3720 + def human; end + + # source://yarp//lib/yarp/node.rb#3703 def inspect(inspector = T.unsafe(nil)); end # attr_reader parent: Node? # - # source://yarp//lib/yarp/node.rb#3070 + # source://yarp//lib/yarp/node.rb#3641 def parent; end end @@ -3071,67 +3605,79 @@ end # ::Foo::Bar = 1 # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3149 +# source://yarp//lib/yarp/node.rb#3735 class YARP::ConstantPathWriteNode < ::YARP::Node # def initialize: (target: ConstantPathNode, operator_loc: Location, value: Node, location: Location) -> void # # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode # - # source://yarp//lib/yarp/node.rb#3160 + # source://yarp//lib/yarp/node.rb#3746 def initialize(target, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3168 + # source://yarp//lib/yarp/node.rb#3754 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3173 + # source://yarp//lib/yarp/node.rb#3759 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3178 + # source://yarp//lib/yarp/node.rb#3769 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3764 + def compact_child_nodes; end + # def copy: (**params) -> ConstantPathWriteNode # - # source://yarp//lib/yarp/node.rb#3183 + # source://yarp//lib/yarp/node.rb#3774 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3173 + # source://yarp//lib/yarp/node.rb#3759 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3196 + # source://yarp//lib/yarp/node.rb#3787 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3205 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3809 + def human; end + + # source://yarp//lib/yarp/node.rb#3796 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#3201 + # source://yarp//lib/yarp/node.rb#3792 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#3154 + # source://yarp//lib/yarp/node.rb#3740 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://yarp//lib/yarp/node.rb#3151 + # source://yarp//lib/yarp/node.rb#3737 def target; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#3157 + # source://yarp//lib/yarp/node.rb#3743 def value; end end @@ -3140,52 +3686,64 @@ end # Foo # ^^^ # -# source://yarp//lib/yarp/node.rb#3220 +# source://yarp//lib/yarp/node.rb#3818 class YARP::ConstantReadNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [ConstantReadNode] a new instance of ConstantReadNode # - # source://yarp//lib/yarp/node.rb#3225 + # source://yarp//lib/yarp/node.rb#3823 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3231 + # source://yarp//lib/yarp/node.rb#3829 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3236 + # source://yarp//lib/yarp/node.rb#3834 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3241 + # source://yarp//lib/yarp/node.rb#3844 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3839 + def compact_child_nodes; end + # def copy: (**params) -> ConstantReadNode # - # source://yarp//lib/yarp/node.rb#3246 + # source://yarp//lib/yarp/node.rb#3849 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3236 + # source://yarp//lib/yarp/node.rb#3834 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3257 + # source://yarp//lib/yarp/node.rb#3860 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3261 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3873 + def human; end + + # source://yarp//lib/yarp/node.rb#3864 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#3222 + # source://yarp//lib/yarp/node.rb#3820 def name; end end @@ -3194,52 +3752,64 @@ end # Foo, Bar = baz # ^^^ ^^^ # -# source://yarp//lib/yarp/node.rb#3272 +# source://yarp//lib/yarp/node.rb#3882 class YARP::ConstantTargetNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [ConstantTargetNode] a new instance of ConstantTargetNode # - # source://yarp//lib/yarp/node.rb#3277 + # source://yarp//lib/yarp/node.rb#3887 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3283 + # source://yarp//lib/yarp/node.rb#3893 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3288 + # source://yarp//lib/yarp/node.rb#3898 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3293 + # source://yarp//lib/yarp/node.rb#3908 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3903 + def compact_child_nodes; end + # def copy: (**params) -> ConstantTargetNode # - # source://yarp//lib/yarp/node.rb#3298 + # source://yarp//lib/yarp/node.rb#3913 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3288 + # source://yarp//lib/yarp/node.rb#3898 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3309 + # source://yarp//lib/yarp/node.rb#3924 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3313 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#3937 + def human; end + + # source://yarp//lib/yarp/node.rb#3928 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#3274 + # source://yarp//lib/yarp/node.rb#3884 def name; end end @@ -3248,784 +3818,821 @@ end # Foo = 1 # ^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3324 +# source://yarp//lib/yarp/node.rb#3946 class YARP::ConstantWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void # # @return [ConstantWriteNode] a new instance of ConstantWriteNode # - # source://yarp//lib/yarp/node.rb#3338 + # source://yarp//lib/yarp/node.rb#3960 def initialize(name, name_loc, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3347 + # source://yarp//lib/yarp/node.rb#3969 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3352 + # source://yarp//lib/yarp/node.rb#3974 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3357 + # source://yarp//lib/yarp/node.rb#3984 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#3979 + def compact_child_nodes; end + # def copy: (**params) -> ConstantWriteNode # - # source://yarp//lib/yarp/node.rb#3362 + # source://yarp//lib/yarp/node.rb#3989 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3352 + # source://yarp//lib/yarp/node.rb#3974 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3376 + # source://yarp//lib/yarp/node.rb#4003 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3385 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4025 + def human; end + + # source://yarp//lib/yarp/node.rb#4012 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#3326 + # source://yarp//lib/yarp/node.rb#3948 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#3329 + # source://yarp//lib/yarp/node.rb#3951 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#3381 + # source://yarp//lib/yarp/node.rb#4008 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#3335 + # source://yarp//lib/yarp/node.rb#3957 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#3332 + # source://yarp//lib/yarp/node.rb#3954 def value; end end -# source://yarp//lib/yarp/node.rb#11011 +# source://yarp//lib/yarp/node.rb#14408 module YARP::DSL private - # Create a new AliasNode node + # Create a new AliasGlobalVariableNode node + # + # source://yarp//lib/yarp/node.rb#14417 + def AliasGlobalVariableNode(new_name, old_name, keyword_loc, location = T.unsafe(nil)); end + + # Create a new AliasMethodNode node # - # source://yarp//lib/yarp/node.rb#11020 - def AliasNode(new_name, old_name, keyword_loc, location = T.unsafe(nil)); end + # source://yarp//lib/yarp/node.rb#14422 + def AliasMethodNode(new_name, old_name, keyword_loc, location = T.unsafe(nil)); end # Create a new AlternationPatternNode node # - # source://yarp//lib/yarp/node.rb#11025 + # source://yarp//lib/yarp/node.rb#14427 def AlternationPatternNode(left, right, operator_loc, location = T.unsafe(nil)); end # Create a new AndNode node # - # source://yarp//lib/yarp/node.rb#11030 + # source://yarp//lib/yarp/node.rb#14432 def AndNode(left, right, operator_loc, location = T.unsafe(nil)); end # Create a new ArgumentsNode node # - # source://yarp//lib/yarp/node.rb#11035 + # source://yarp//lib/yarp/node.rb#14437 def ArgumentsNode(arguments, location = T.unsafe(nil)); end # Create a new ArrayNode node # - # source://yarp//lib/yarp/node.rb#11040 + # source://yarp//lib/yarp/node.rb#14442 def ArrayNode(elements, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new ArrayPatternNode node # - # source://yarp//lib/yarp/node.rb#11045 + # source://yarp//lib/yarp/node.rb#14447 def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new AssocNode node # - # source://yarp//lib/yarp/node.rb#11050 + # source://yarp//lib/yarp/node.rb#14452 def AssocNode(key, value, operator_loc, location = T.unsafe(nil)); end # Create a new AssocSplatNode node # - # source://yarp//lib/yarp/node.rb#11055 + # source://yarp//lib/yarp/node.rb#14457 def AssocSplatNode(value, operator_loc, location = T.unsafe(nil)); end # Create a new BackReferenceReadNode node # - # source://yarp//lib/yarp/node.rb#11060 + # source://yarp//lib/yarp/node.rb#14462 def BackReferenceReadNode(location = T.unsafe(nil)); end # Create a new BeginNode node # - # source://yarp//lib/yarp/node.rb#11065 + # source://yarp//lib/yarp/node.rb#14467 def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location = T.unsafe(nil)); end # Create a new BlockArgumentNode node # - # source://yarp//lib/yarp/node.rb#11070 + # source://yarp//lib/yarp/node.rb#14472 def BlockArgumentNode(expression, operator_loc, location = T.unsafe(nil)); end # Create a new BlockLocalVariableNode node # - # source://yarp//lib/yarp/node.rb#11075 + # source://yarp//lib/yarp/node.rb#14477 def BlockLocalVariableNode(name, location = T.unsafe(nil)); end # Create a new BlockNode node # - # source://yarp//lib/yarp/node.rb#11080 + # source://yarp//lib/yarp/node.rb#14482 def BlockNode(locals, parameters, body, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new BlockParameterNode node # - # source://yarp//lib/yarp/node.rb#11085 + # source://yarp//lib/yarp/node.rb#14487 def BlockParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end # Create a new BlockParametersNode node # - # source://yarp//lib/yarp/node.rb#11090 + # source://yarp//lib/yarp/node.rb#14492 def BlockParametersNode(parameters, locals, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new BreakNode node # - # source://yarp//lib/yarp/node.rb#11095 + # source://yarp//lib/yarp/node.rb#14497 def BreakNode(arguments, keyword_loc, location = T.unsafe(nil)); end # Create a new CallAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11100 + # source://yarp//lib/yarp/node.rb#14502 def CallAndWriteNode(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator_loc, value, location = T.unsafe(nil)); end # Create a new CallNode node # - # source://yarp//lib/yarp/node.rb#11105 + # source://yarp//lib/yarp/node.rb#14507 def CallNode(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, block, flags, name, location = T.unsafe(nil)); end # Create a new CallOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11110 + # source://yarp//lib/yarp/node.rb#14512 def CallOperatorWriteNode(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator, operator_loc, value, location = T.unsafe(nil)); end # Create a new CallOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11115 + # source://yarp//lib/yarp/node.rb#14517 def CallOrWriteNode(receiver, call_operator_loc, message_loc, opening_loc, arguments, closing_loc, flags, read_name, write_name, operator_loc, value, location = T.unsafe(nil)); end # Create a new CapturePatternNode node # - # source://yarp//lib/yarp/node.rb#11120 + # source://yarp//lib/yarp/node.rb#14522 def CapturePatternNode(value, target, operator_loc, location = T.unsafe(nil)); end # Create a new CaseNode node # - # source://yarp//lib/yarp/node.rb#11125 + # source://yarp//lib/yarp/node.rb#14527 def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = T.unsafe(nil)); end # Create a new ClassNode node # - # source://yarp//lib/yarp/node.rb#11130 + # source://yarp//lib/yarp/node.rb#14532 def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location = T.unsafe(nil)); end # Create a new ClassVariableAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11135 + # source://yarp//lib/yarp/node.rb#14537 def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new ClassVariableOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11140 + # source://yarp//lib/yarp/node.rb#14542 def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end # Create a new ClassVariableOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11145 + # source://yarp//lib/yarp/node.rb#14547 def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new ClassVariableReadNode node # - # source://yarp//lib/yarp/node.rb#11150 + # source://yarp//lib/yarp/node.rb#14552 def ClassVariableReadNode(name, location = T.unsafe(nil)); end # Create a new ClassVariableTargetNode node # - # source://yarp//lib/yarp/node.rb#11155 + # source://yarp//lib/yarp/node.rb#14557 def ClassVariableTargetNode(name, location = T.unsafe(nil)); end # Create a new ClassVariableWriteNode node # - # source://yarp//lib/yarp/node.rb#11160 + # source://yarp//lib/yarp/node.rb#14562 def ClassVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end # Create a new ConstantAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11165 + # source://yarp//lib/yarp/node.rb#14567 def ConstantAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new ConstantOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11170 + # source://yarp//lib/yarp/node.rb#14572 def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end # Create a new ConstantOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11175 + # source://yarp//lib/yarp/node.rb#14577 def ConstantOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new ConstantPathAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11180 + # source://yarp//lib/yarp/node.rb#14582 def ConstantPathAndWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end # Create a new ConstantPathNode node # - # source://yarp//lib/yarp/node.rb#11185 + # source://yarp//lib/yarp/node.rb#14587 def ConstantPathNode(parent, child, delimiter_loc, location = T.unsafe(nil)); end # Create a new ConstantPathOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11190 + # source://yarp//lib/yarp/node.rb#14592 def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, location = T.unsafe(nil)); end # Create a new ConstantPathOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11195 + # source://yarp//lib/yarp/node.rb#14597 def ConstantPathOrWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end # Create a new ConstantPathTargetNode node # - # source://yarp//lib/yarp/node.rb#11200 + # source://yarp//lib/yarp/node.rb#14602 def ConstantPathTargetNode(parent, child, delimiter_loc, location = T.unsafe(nil)); end # Create a new ConstantPathWriteNode node # - # source://yarp//lib/yarp/node.rb#11205 + # source://yarp//lib/yarp/node.rb#14607 def ConstantPathWriteNode(target, operator_loc, value, location = T.unsafe(nil)); end # Create a new ConstantReadNode node # - # source://yarp//lib/yarp/node.rb#11210 + # source://yarp//lib/yarp/node.rb#14612 def ConstantReadNode(name, location = T.unsafe(nil)); end # Create a new ConstantTargetNode node # - # source://yarp//lib/yarp/node.rb#11215 + # source://yarp//lib/yarp/node.rb#14617 def ConstantTargetNode(name, location = T.unsafe(nil)); end # Create a new ConstantWriteNode node # - # source://yarp//lib/yarp/node.rb#11220 + # source://yarp//lib/yarp/node.rb#14622 def ConstantWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end # Create a new DefNode node # - # source://yarp//lib/yarp/node.rb#11225 + # source://yarp//lib/yarp/node.rb#14627 def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location = T.unsafe(nil)); end # Create a new DefinedNode node # - # source://yarp//lib/yarp/node.rb#11230 + # source://yarp//lib/yarp/node.rb#14632 def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, location = T.unsafe(nil)); end # Create a new ElseNode node # - # source://yarp//lib/yarp/node.rb#11235 + # source://yarp//lib/yarp/node.rb#14637 def ElseNode(else_keyword_loc, statements, end_keyword_loc, location = T.unsafe(nil)); end # Create a new EmbeddedStatementsNode node # - # source://yarp//lib/yarp/node.rb#11240 + # source://yarp//lib/yarp/node.rb#14642 def EmbeddedStatementsNode(opening_loc, statements, closing_loc, location = T.unsafe(nil)); end # Create a new EmbeddedVariableNode node # - # source://yarp//lib/yarp/node.rb#11245 + # source://yarp//lib/yarp/node.rb#14647 def EmbeddedVariableNode(operator_loc, variable, location = T.unsafe(nil)); end # Create a new EnsureNode node # - # source://yarp//lib/yarp/node.rb#11250 + # source://yarp//lib/yarp/node.rb#14652 def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, location = T.unsafe(nil)); end # Create a new FalseNode node # - # source://yarp//lib/yarp/node.rb#11255 + # source://yarp//lib/yarp/node.rb#14657 def FalseNode(location = T.unsafe(nil)); end # Create a new FindPatternNode node # - # source://yarp//lib/yarp/node.rb#11260 + # source://yarp//lib/yarp/node.rb#14662 def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new FlipFlopNode node # - # source://yarp//lib/yarp/node.rb#11265 + # source://yarp//lib/yarp/node.rb#14667 def FlipFlopNode(left, right, operator_loc, flags, location = T.unsafe(nil)); end # Create a new FloatNode node # - # source://yarp//lib/yarp/node.rb#11270 + # source://yarp//lib/yarp/node.rb#14672 def FloatNode(location = T.unsafe(nil)); end # Create a new ForNode node # - # source://yarp//lib/yarp/node.rb#11275 + # source://yarp//lib/yarp/node.rb#14677 def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location = T.unsafe(nil)); end # Create a new ForwardingArgumentsNode node # - # source://yarp//lib/yarp/node.rb#11280 + # source://yarp//lib/yarp/node.rb#14682 def ForwardingArgumentsNode(location = T.unsafe(nil)); end # Create a new ForwardingParameterNode node # - # source://yarp//lib/yarp/node.rb#11285 + # source://yarp//lib/yarp/node.rb#14687 def ForwardingParameterNode(location = T.unsafe(nil)); end # Create a new ForwardingSuperNode node # - # source://yarp//lib/yarp/node.rb#11290 + # source://yarp//lib/yarp/node.rb#14692 def ForwardingSuperNode(block, location = T.unsafe(nil)); end # Create a new GlobalVariableAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11295 + # source://yarp//lib/yarp/node.rb#14697 def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new GlobalVariableOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11300 + # source://yarp//lib/yarp/node.rb#14702 def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end # Create a new GlobalVariableOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11305 + # source://yarp//lib/yarp/node.rb#14707 def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new GlobalVariableReadNode node # - # source://yarp//lib/yarp/node.rb#11310 + # source://yarp//lib/yarp/node.rb#14712 def GlobalVariableReadNode(name, location = T.unsafe(nil)); end # Create a new GlobalVariableTargetNode node # - # source://yarp//lib/yarp/node.rb#11315 + # source://yarp//lib/yarp/node.rb#14717 def GlobalVariableTargetNode(name, location = T.unsafe(nil)); end # Create a new GlobalVariableWriteNode node # - # source://yarp//lib/yarp/node.rb#11320 + # source://yarp//lib/yarp/node.rb#14722 def GlobalVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end # Create a new HashNode node # - # source://yarp//lib/yarp/node.rb#11325 + # source://yarp//lib/yarp/node.rb#14727 def HashNode(opening_loc, elements, closing_loc, location = T.unsafe(nil)); end # Create a new HashPatternNode node # - # source://yarp//lib/yarp/node.rb#11330 + # source://yarp//lib/yarp/node.rb#14732 def HashPatternNode(constant, assocs, kwrest, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new IfNode node # - # source://yarp//lib/yarp/node.rb#11335 + # source://yarp//lib/yarp/node.rb#14737 def IfNode(if_keyword_loc, predicate, statements, consequent, end_keyword_loc, location = T.unsafe(nil)); end # Create a new ImaginaryNode node # - # source://yarp//lib/yarp/node.rb#11340 + # source://yarp//lib/yarp/node.rb#14742 def ImaginaryNode(numeric, location = T.unsafe(nil)); end + # Create a new ImplicitNode node + # + # source://yarp//lib/yarp/node.rb#14747 + def ImplicitNode(value, location = T.unsafe(nil)); end + # Create a new InNode node # - # source://yarp//lib/yarp/node.rb#11345 + # source://yarp//lib/yarp/node.rb#14752 def InNode(pattern, statements, in_loc, then_loc, location = T.unsafe(nil)); end # Create a new InstanceVariableAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11350 + # source://yarp//lib/yarp/node.rb#14757 def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new InstanceVariableOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11355 + # source://yarp//lib/yarp/node.rb#14762 def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = T.unsafe(nil)); end # Create a new InstanceVariableOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11360 + # source://yarp//lib/yarp/node.rb#14767 def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new InstanceVariableReadNode node # - # source://yarp//lib/yarp/node.rb#11365 + # source://yarp//lib/yarp/node.rb#14772 def InstanceVariableReadNode(name, location = T.unsafe(nil)); end # Create a new InstanceVariableTargetNode node # - # source://yarp//lib/yarp/node.rb#11370 + # source://yarp//lib/yarp/node.rb#14777 def InstanceVariableTargetNode(name, location = T.unsafe(nil)); end # Create a new InstanceVariableWriteNode node # - # source://yarp//lib/yarp/node.rb#11375 + # source://yarp//lib/yarp/node.rb#14782 def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location = T.unsafe(nil)); end # Create a new IntegerNode node # - # source://yarp//lib/yarp/node.rb#11380 - def IntegerNode(location = T.unsafe(nil)); end + # source://yarp//lib/yarp/node.rb#14787 + def IntegerNode(flags, location = T.unsafe(nil)); end + + # Create a new InterpolatedMatchLastLineNode node + # + # source://yarp//lib/yarp/node.rb#14792 + def InterpolatedMatchLastLineNode(opening_loc, parts, closing_loc, flags, location = T.unsafe(nil)); end # Create a new InterpolatedRegularExpressionNode node # - # source://yarp//lib/yarp/node.rb#11385 + # source://yarp//lib/yarp/node.rb#14797 def InterpolatedRegularExpressionNode(opening_loc, parts, closing_loc, flags, location = T.unsafe(nil)); end # Create a new InterpolatedStringNode node # - # source://yarp//lib/yarp/node.rb#11390 + # source://yarp//lib/yarp/node.rb#14802 def InterpolatedStringNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end # Create a new InterpolatedSymbolNode node # - # source://yarp//lib/yarp/node.rb#11395 + # source://yarp//lib/yarp/node.rb#14807 def InterpolatedSymbolNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end # Create a new InterpolatedXStringNode node # - # source://yarp//lib/yarp/node.rb#11400 + # source://yarp//lib/yarp/node.rb#14812 def InterpolatedXStringNode(opening_loc, parts, closing_loc, location = T.unsafe(nil)); end # Create a new KeywordHashNode node # - # source://yarp//lib/yarp/node.rb#11405 + # source://yarp//lib/yarp/node.rb#14817 def KeywordHashNode(elements, location = T.unsafe(nil)); end # Create a new KeywordParameterNode node # - # source://yarp//lib/yarp/node.rb#11410 + # source://yarp//lib/yarp/node.rb#14822 def KeywordParameterNode(name, name_loc, value, location = T.unsafe(nil)); end # Create a new KeywordRestParameterNode node # - # source://yarp//lib/yarp/node.rb#11415 + # source://yarp//lib/yarp/node.rb#14827 def KeywordRestParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end # Create a new LambdaNode node # - # source://yarp//lib/yarp/node.rb#11420 + # source://yarp//lib/yarp/node.rb#14832 def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, location = T.unsafe(nil)); end # Create a new LocalVariableAndWriteNode node # - # source://yarp//lib/yarp/node.rb#11425 + # source://yarp//lib/yarp/node.rb#14837 def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location = T.unsafe(nil)); end # Create a new LocalVariableOperatorWriteNode node # - # source://yarp//lib/yarp/node.rb#11430 + # source://yarp//lib/yarp/node.rb#14842 def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, location = T.unsafe(nil)); end # Create a new LocalVariableOrWriteNode node # - # source://yarp//lib/yarp/node.rb#11435 + # source://yarp//lib/yarp/node.rb#14847 def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, location = T.unsafe(nil)); end # Create a new LocalVariableReadNode node # - # source://yarp//lib/yarp/node.rb#11440 + # source://yarp//lib/yarp/node.rb#14852 def LocalVariableReadNode(name, depth, location = T.unsafe(nil)); end # Create a new LocalVariableTargetNode node # - # source://yarp//lib/yarp/node.rb#11445 + # source://yarp//lib/yarp/node.rb#14857 def LocalVariableTargetNode(name, depth, location = T.unsafe(nil)); end # Create a new LocalVariableWriteNode node # - # source://yarp//lib/yarp/node.rb#11450 + # source://yarp//lib/yarp/node.rb#14862 def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, location = T.unsafe(nil)); end # Create a new Location object # - # source://yarp//lib/yarp/node.rb#11015 + # source://yarp//lib/yarp/node.rb#14412 def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end + # Create a new MatchLastLineNode node + # + # source://yarp//lib/yarp/node.rb#14867 + def MatchLastLineNode(opening_loc, content_loc, closing_loc, unescaped, flags, location = T.unsafe(nil)); end + # Create a new MatchPredicateNode node # - # source://yarp//lib/yarp/node.rb#11455 + # source://yarp//lib/yarp/node.rb#14872 def MatchPredicateNode(value, pattern, operator_loc, location = T.unsafe(nil)); end # Create a new MatchRequiredNode node # - # source://yarp//lib/yarp/node.rb#11460 + # source://yarp//lib/yarp/node.rb#14877 def MatchRequiredNode(value, pattern, operator_loc, location = T.unsafe(nil)); end + # Create a new MatchWriteNode node + # + # source://yarp//lib/yarp/node.rb#14882 + def MatchWriteNode(call, locals, location = T.unsafe(nil)); end + # Create a new MissingNode node # - # source://yarp//lib/yarp/node.rb#11465 + # source://yarp//lib/yarp/node.rb#14887 def MissingNode(location = T.unsafe(nil)); end # Create a new ModuleNode node # - # source://yarp//lib/yarp/node.rb#11470 + # source://yarp//lib/yarp/node.rb#14892 def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location = T.unsafe(nil)); end # Create a new MultiTargetNode node # - # source://yarp//lib/yarp/node.rb#11475 + # source://yarp//lib/yarp/node.rb#14897 def MultiTargetNode(targets, lparen_loc, rparen_loc, location = T.unsafe(nil)); end # Create a new MultiWriteNode node # - # source://yarp//lib/yarp/node.rb#11480 + # source://yarp//lib/yarp/node.rb#14902 def MultiWriteNode(targets, lparen_loc, rparen_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new NextNode node # - # source://yarp//lib/yarp/node.rb#11485 + # source://yarp//lib/yarp/node.rb#14907 def NextNode(arguments, keyword_loc, location = T.unsafe(nil)); end # Create a new NilNode node # - # source://yarp//lib/yarp/node.rb#11490 + # source://yarp//lib/yarp/node.rb#14912 def NilNode(location = T.unsafe(nil)); end # Create a new NoKeywordsParameterNode node # - # source://yarp//lib/yarp/node.rb#11495 + # source://yarp//lib/yarp/node.rb#14917 def NoKeywordsParameterNode(operator_loc, keyword_loc, location = T.unsafe(nil)); end # Create a new NumberedReferenceReadNode node # - # source://yarp//lib/yarp/node.rb#11500 + # source://yarp//lib/yarp/node.rb#14922 def NumberedReferenceReadNode(number, location = T.unsafe(nil)); end # Create a new OptionalParameterNode node # - # source://yarp//lib/yarp/node.rb#11505 + # source://yarp//lib/yarp/node.rb#14927 def OptionalParameterNode(name, name_loc, operator_loc, value, location = T.unsafe(nil)); end # Create a new OrNode node # - # source://yarp//lib/yarp/node.rb#11510 + # source://yarp//lib/yarp/node.rb#14932 def OrNode(left, right, operator_loc, location = T.unsafe(nil)); end # Create a new ParametersNode node # - # source://yarp//lib/yarp/node.rb#11515 - def ParametersNode(requireds, optionals, posts, rest, keywords, keyword_rest, block, location = T.unsafe(nil)); end + # source://yarp//lib/yarp/node.rb#14937 + def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, location = T.unsafe(nil)); end # Create a new ParenthesesNode node # - # source://yarp//lib/yarp/node.rb#11520 + # source://yarp//lib/yarp/node.rb#14942 def ParenthesesNode(body, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new PinnedExpressionNode node # - # source://yarp//lib/yarp/node.rb#11525 + # source://yarp//lib/yarp/node.rb#14947 def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, location = T.unsafe(nil)); end # Create a new PinnedVariableNode node # - # source://yarp//lib/yarp/node.rb#11530 + # source://yarp//lib/yarp/node.rb#14952 def PinnedVariableNode(variable, operator_loc, location = T.unsafe(nil)); end # Create a new PostExecutionNode node # - # source://yarp//lib/yarp/node.rb#11535 + # source://yarp//lib/yarp/node.rb#14957 def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new PreExecutionNode node # - # source://yarp//lib/yarp/node.rb#11540 + # source://yarp//lib/yarp/node.rb#14962 def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new ProgramNode node # - # source://yarp//lib/yarp/node.rb#11545 + # source://yarp//lib/yarp/node.rb#14967 def ProgramNode(locals, statements, location = T.unsafe(nil)); end # Create a new RangeNode node # - # source://yarp//lib/yarp/node.rb#11550 + # source://yarp//lib/yarp/node.rb#14972 def RangeNode(left, right, operator_loc, flags, location = T.unsafe(nil)); end # Create a new RationalNode node # - # source://yarp//lib/yarp/node.rb#11555 + # source://yarp//lib/yarp/node.rb#14977 def RationalNode(numeric, location = T.unsafe(nil)); end # Create a new RedoNode node # - # source://yarp//lib/yarp/node.rb#11560 + # source://yarp//lib/yarp/node.rb#14982 def RedoNode(location = T.unsafe(nil)); end # Create a new RegularExpressionNode node # - # source://yarp//lib/yarp/node.rb#11565 + # source://yarp//lib/yarp/node.rb#14987 def RegularExpressionNode(opening_loc, content_loc, closing_loc, unescaped, flags, location = T.unsafe(nil)); end # Create a new RequiredDestructuredParameterNode node # - # source://yarp//lib/yarp/node.rb#11570 + # source://yarp//lib/yarp/node.rb#14992 def RequiredDestructuredParameterNode(parameters, opening_loc, closing_loc, location = T.unsafe(nil)); end # Create a new RequiredParameterNode node # - # source://yarp//lib/yarp/node.rb#11575 + # source://yarp//lib/yarp/node.rb#14997 def RequiredParameterNode(name, location = T.unsafe(nil)); end # Create a new RescueModifierNode node # - # source://yarp//lib/yarp/node.rb#11580 + # source://yarp//lib/yarp/node.rb#15002 def RescueModifierNode(expression, keyword_loc, rescue_expression, location = T.unsafe(nil)); end # Create a new RescueNode node # - # source://yarp//lib/yarp/node.rb#11585 + # source://yarp//lib/yarp/node.rb#15007 def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location = T.unsafe(nil)); end # Create a new RestParameterNode node # - # source://yarp//lib/yarp/node.rb#11590 + # source://yarp//lib/yarp/node.rb#15012 def RestParameterNode(name, name_loc, operator_loc, location = T.unsafe(nil)); end # Create a new RetryNode node # - # source://yarp//lib/yarp/node.rb#11595 + # source://yarp//lib/yarp/node.rb#15017 def RetryNode(location = T.unsafe(nil)); end # Create a new ReturnNode node # - # source://yarp//lib/yarp/node.rb#11600 + # source://yarp//lib/yarp/node.rb#15022 def ReturnNode(keyword_loc, arguments, location = T.unsafe(nil)); end # Create a new SelfNode node # - # source://yarp//lib/yarp/node.rb#11605 + # source://yarp//lib/yarp/node.rb#15027 def SelfNode(location = T.unsafe(nil)); end # Create a new SingletonClassNode node # - # source://yarp//lib/yarp/node.rb#11610 + # source://yarp//lib/yarp/node.rb#15032 def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location = T.unsafe(nil)); end # Create a new SourceEncodingNode node # - # source://yarp//lib/yarp/node.rb#11615 + # source://yarp//lib/yarp/node.rb#15037 def SourceEncodingNode(location = T.unsafe(nil)); end # Create a new SourceFileNode node # - # source://yarp//lib/yarp/node.rb#11620 + # source://yarp//lib/yarp/node.rb#15042 def SourceFileNode(filepath, location = T.unsafe(nil)); end # Create a new SourceLineNode node # - # source://yarp//lib/yarp/node.rb#11625 + # source://yarp//lib/yarp/node.rb#15047 def SourceLineNode(location = T.unsafe(nil)); end # Create a new SplatNode node # - # source://yarp//lib/yarp/node.rb#11630 + # source://yarp//lib/yarp/node.rb#15052 def SplatNode(operator_loc, expression, location = T.unsafe(nil)); end # Create a new StatementsNode node # - # source://yarp//lib/yarp/node.rb#11635 + # source://yarp//lib/yarp/node.rb#15057 def StatementsNode(body, location = T.unsafe(nil)); end # Create a new StringConcatNode node # - # source://yarp//lib/yarp/node.rb#11640 + # source://yarp//lib/yarp/node.rb#15062 def StringConcatNode(left, right, location = T.unsafe(nil)); end # Create a new StringNode node # - # source://yarp//lib/yarp/node.rb#11645 - def StringNode(opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end + # source://yarp//lib/yarp/node.rb#15067 + def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end # Create a new SuperNode node # - # source://yarp//lib/yarp/node.rb#11650 + # source://yarp//lib/yarp/node.rb#15072 def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, location = T.unsafe(nil)); end # Create a new SymbolNode node # - # source://yarp//lib/yarp/node.rb#11655 + # source://yarp//lib/yarp/node.rb#15077 def SymbolNode(opening_loc, value_loc, closing_loc, unescaped, location = T.unsafe(nil)); end # Create a new TrueNode node # - # source://yarp//lib/yarp/node.rb#11660 + # source://yarp//lib/yarp/node.rb#15082 def TrueNode(location = T.unsafe(nil)); end # Create a new UndefNode node # - # source://yarp//lib/yarp/node.rb#11665 + # source://yarp//lib/yarp/node.rb#15087 def UndefNode(names, keyword_loc, location = T.unsafe(nil)); end # Create a new UnlessNode node # - # source://yarp//lib/yarp/node.rb#11670 + # source://yarp//lib/yarp/node.rb#15092 def UnlessNode(keyword_loc, predicate, statements, consequent, end_keyword_loc, location = T.unsafe(nil)); end # Create a new UntilNode node # - # source://yarp//lib/yarp/node.rb#11675 + # source://yarp//lib/yarp/node.rb#15097 def UntilNode(keyword_loc, closing_loc, predicate, statements, flags, location = T.unsafe(nil)); end # Create a new WhenNode node # - # source://yarp//lib/yarp/node.rb#11680 + # source://yarp//lib/yarp/node.rb#15102 def WhenNode(keyword_loc, conditions, statements, location = T.unsafe(nil)); end # Create a new WhileNode node # - # source://yarp//lib/yarp/node.rb#11685 + # source://yarp//lib/yarp/node.rb#15107 def WhileNode(keyword_loc, closing_loc, predicate, statements, flags, location = T.unsafe(nil)); end # Create a new XStringNode node # - # source://yarp//lib/yarp/node.rb#11690 + # source://yarp//lib/yarp/node.rb#15112 def XStringNode(opening_loc, content_loc, closing_loc, unescaped, location = T.unsafe(nil)); end # Create a new YieldNode node # - # source://yarp//lib/yarp/node.rb#11695 + # source://yarp//lib/yarp/node.rb#15117 def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, 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://yarp//lib/yarp.rb#423 +# source://yarp//lib/yarp.rb#386 module YARP::Debug class << self # For the given source, compiles with CRuby and returns a list of all of the # sets of local variables that were encountered. # - # source://yarp//lib/yarp.rb#464 + # source://yarp//lib/yarp.rb#427 def cruby_locals(source); end def memsize(_arg0); end def named_captures(_arg0); end - # source://yarp//lib/yarp.rb#570 + # source://yarp//lib/yarp.rb#529 def newlines(source); end - # source://yarp//lib/yarp.rb#574 + # source://yarp//lib/yarp.rb#533 def parse_serialize_file(filepath); end def parse_serialize_file_metadata(_arg0, _arg1); end @@ -4037,33 +4644,33 @@ module YARP::Debug # For the given source, parses with YARP and returns a list of all of the # sets of local variables that were encountered. # - # source://yarp//lib/yarp.rb#503 + # source://yarp//lib/yarp.rb#462 def yarp_locals(source); end end end -# source://yarp//lib/yarp.rb#424 +# source://yarp//lib/yarp.rb#387 class YARP::Debug::ISeq # @return [ISeq] a new instance of ISeq # - # source://yarp//lib/yarp.rb#427 + # source://yarp//lib/yarp.rb#390 def initialize(parts); end - # source://yarp//lib/yarp.rb#443 + # source://yarp//lib/yarp.rb#406 def each_child; end - # source://yarp//lib/yarp.rb#439 + # source://yarp//lib/yarp.rb#402 def instructions; end - # source://yarp//lib/yarp.rb#435 + # source://yarp//lib/yarp.rb#398 def local_table; end # Returns the value of attribute parts. # - # source://yarp//lib/yarp.rb#425 + # source://yarp//lib/yarp.rb#388 def parts; end - # source://yarp//lib/yarp.rb#431 + # source://yarp//lib/yarp.rb#394 def type; end end @@ -4073,137 +4680,149 @@ end # end # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3401 +# source://yarp//lib/yarp/node.rb#4035 class YARP::DefNode < ::YARP::Node # def initialize: (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) -> void # # @return [DefNode] a new instance of DefNode # - # source://yarp//lib/yarp/node.rb#3439 + # source://yarp//lib/yarp/node.rb#4073 def initialize(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 # - # source://yarp//lib/yarp/node.rb#3456 + # source://yarp//lib/yarp/node.rb#4090 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#3415 + # source://yarp//lib/yarp/node.rb#4049 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3461 + # source://yarp//lib/yarp/node.rb#4095 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3466 + # source://yarp//lib/yarp/node.rb#4109 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4100 + def compact_child_nodes; end + # def copy: (**params) -> DefNode # - # source://yarp//lib/yarp/node.rb#3471 + # source://yarp//lib/yarp/node.rb#4114 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3461 + # source://yarp//lib/yarp/node.rb#4095 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3493 + # source://yarp//lib/yarp/node.rb#4136 def deconstruct_keys(keys); end # def def_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#3498 + # source://yarp//lib/yarp/node.rb#4141 def def_keyword; end # attr_reader def_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#3421 + # source://yarp//lib/yarp/node.rb#4055 def def_keyword_loc; end # def end_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#3523 + # source://yarp//lib/yarp/node.rb#4166 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#3436 + # source://yarp//lib/yarp/node.rb#4070 def end_keyword_loc; end # def equal: () -> String? # - # source://yarp//lib/yarp/node.rb#3518 + # source://yarp//lib/yarp/node.rb#4161 def equal; end # attr_reader equal_loc: Location? # - # source://yarp//lib/yarp/node.rb#3433 + # source://yarp//lib/yarp/node.rb#4067 def equal_loc; end - # source://yarp//lib/yarp/node.rb#3527 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4205 + def human; end + + # source://yarp//lib/yarp/node.rb#4170 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#3418 + # source://yarp//lib/yarp/node.rb#4052 def locals; end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#3508 + # source://yarp//lib/yarp/node.rb#4151 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#3427 + # source://yarp//lib/yarp/node.rb#4061 def lparen_loc; end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#3403 + # source://yarp//lib/yarp/node.rb#4037 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#3406 + # source://yarp//lib/yarp/node.rb#4040 def name_loc; end # def operator: () -> String? # - # source://yarp//lib/yarp/node.rb#3503 + # source://yarp//lib/yarp/node.rb#4146 def operator; end # attr_reader operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#3424 + # source://yarp//lib/yarp/node.rb#4058 def operator_loc; end # attr_reader parameters: ParametersNode? # - # source://yarp//lib/yarp/node.rb#3412 + # source://yarp//lib/yarp/node.rb#4046 def parameters; end # attr_reader receiver: Node? # - # source://yarp//lib/yarp/node.rb#3409 + # source://yarp//lib/yarp/node.rb#4043 def receiver; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#3513 + # source://yarp//lib/yarp/node.rb#4156 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#3430 + # source://yarp//lib/yarp/node.rb#4064 def rparen_loc; end end @@ -4212,82 +4831,94 @@ end # defined?(a) # ^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3564 +# source://yarp//lib/yarp/node.rb#4214 class YARP::DefinedNode < ::YARP::Node # def initialize: (lparen_loc: Location?, value: Node, rparen_loc: Location?, keyword_loc: Location, location: Location) -> void # # @return [DefinedNode] a new instance of DefinedNode # - # source://yarp//lib/yarp/node.rb#3578 + # source://yarp//lib/yarp/node.rb#4228 def initialize(lparen_loc, value, rparen_loc, keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3587 + # source://yarp//lib/yarp/node.rb#4237 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3592 + # source://yarp//lib/yarp/node.rb#4242 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3597 + # source://yarp//lib/yarp/node.rb#4252 def comment_targets; end - # def copy: (**params) -> DefinedNode + # def compact_child_nodes: () -> Array[Node] # - # source://yarp//lib/yarp/node.rb#3602 - def copy(**params); end + # source://yarp//lib/yarp/node.rb#4247 + def compact_child_nodes; end + + # def copy: (**params) -> DefinedNode + # + # source://yarp//lib/yarp/node.rb#4257 + def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3592 + # source://yarp//lib/yarp/node.rb#4242 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3616 + # source://yarp//lib/yarp/node.rb#4271 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3635 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4303 + def human; end + + # source://yarp//lib/yarp/node.rb#4290 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#3631 + # source://yarp//lib/yarp/node.rb#4286 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#3575 + # source://yarp//lib/yarp/node.rb#4225 def keyword_loc; end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#3621 + # source://yarp//lib/yarp/node.rb#4276 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#3566 + # source://yarp//lib/yarp/node.rb#4216 def lparen_loc; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#3626 + # source://yarp//lib/yarp/node.rb#4281 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#3572 + # source://yarp//lib/yarp/node.rb#4222 def rparen_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#3569 + # source://yarp//lib/yarp/node.rb#4219 def value; end end @@ -4439,77 +5070,126 @@ class YARP::DesugarVisitor < ::YARP::MutationVisitor def desugar_or_write_node(node, read_class, write_class, *arguments); 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 without having to repeat the same visits multiple times +# +# source://yarp//lib/yarp/node.rb#13385 +class YARP::Dispatcher + # @return [Dispatcher] a new instance of Dispatcher + # + # source://yarp//lib/yarp/node.rb#13389 + def initialize; end + + # Walks `root` dispatching events to all registered listeners + # + # def dispatch: (Node) -> void + # + # source://yarp//lib/yarp/node.rb#13403 + def dispatch(root); end + + # Dispatches a single event for `node` to all registered listeners + # + # def dispatch_once: (Node) -> void + # + # source://yarp//lib/yarp/node.rb#13979 + def dispatch_once(node); end + + # attr_reader listeners: Hash[Symbol, Array[Listener]] + # + # source://yarp//lib/yarp/node.rb#13387 + def listeners; end + + # Register a listener for one or more events + # + # def register: (Listener, *Symbol) -> void + # + # source://yarp//lib/yarp/node.rb#13396 + def register(listener, *events); end +end + # Represents an `else` clause in a `case`, `if`, or `unless` statement. # # if a then b else c end # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#3650 +# source://yarp//lib/yarp/node.rb#4312 class YARP::ElseNode < ::YARP::Node # def initialize: (else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location) -> void # # @return [ElseNode] a new instance of ElseNode # - # source://yarp//lib/yarp/node.rb#3661 + # source://yarp//lib/yarp/node.rb#4323 def initialize(else_keyword_loc, statements, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3669 + # source://yarp//lib/yarp/node.rb#4331 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3674 + # source://yarp//lib/yarp/node.rb#4336 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3679 + # source://yarp//lib/yarp/node.rb#4348 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4341 + def compact_child_nodes; end + # def copy: (**params) -> ElseNode # - # source://yarp//lib/yarp/node.rb#3684 + # source://yarp//lib/yarp/node.rb#4353 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3674 + # source://yarp//lib/yarp/node.rb#4336 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3697 + # source://yarp//lib/yarp/node.rb#4366 def deconstruct_keys(keys); end # def else_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#3702 + # source://yarp//lib/yarp/node.rb#4371 def else_keyword; end # attr_reader else_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#3652 + # source://yarp//lib/yarp/node.rb#4314 def else_keyword_loc; end # def end_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#3707 + # source://yarp//lib/yarp/node.rb#4376 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#3658 + # source://yarp//lib/yarp/node.rb#4320 def end_keyword_loc; end - # source://yarp//lib/yarp/node.rb#3711 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4396 + def human; end + + # source://yarp//lib/yarp/node.rb#4380 def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#3655 + # source://yarp//lib/yarp/node.rb#4317 def statements; end end @@ -4518,72 +5198,84 @@ end # "foo #{bar}" # ^^^^^^ # -# source://yarp//lib/yarp/node.rb#3729 +# source://yarp//lib/yarp/node.rb#4405 class YARP::EmbeddedStatementsNode < ::YARP::Node # def initialize: (opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location) -> void # # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode # - # source://yarp//lib/yarp/node.rb#3740 + # source://yarp//lib/yarp/node.rb#4416 def initialize(opening_loc, statements, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3748 + # source://yarp//lib/yarp/node.rb#4424 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3753 + # source://yarp//lib/yarp/node.rb#4429 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#3786 + # source://yarp//lib/yarp/node.rb#4469 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#3737 + # source://yarp//lib/yarp/node.rb#4413 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3758 + # source://yarp//lib/yarp/node.rb#4441 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4434 + def compact_child_nodes; end + # def copy: (**params) -> EmbeddedStatementsNode # - # source://yarp//lib/yarp/node.rb#3763 + # source://yarp//lib/yarp/node.rb#4446 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3753 + # source://yarp//lib/yarp/node.rb#4429 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3776 + # source://yarp//lib/yarp/node.rb#4459 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3790 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4489 + def human; end + + # source://yarp//lib/yarp/node.rb#4473 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#3781 + # source://yarp//lib/yarp/node.rb#4464 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#3731 + # source://yarp//lib/yarp/node.rb#4407 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#3734 + # source://yarp//lib/yarp/node.rb#4410 def statements; end end @@ -4592,62 +5284,74 @@ end # "foo #@bar" # ^^^^^ # -# source://yarp//lib/yarp/node.rb#3808 +# source://yarp//lib/yarp/node.rb#4498 class YARP::EmbeddedVariableNode < ::YARP::Node # def initialize: (operator_loc: Location, variable: Node, location: Location) -> void # # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode # - # source://yarp//lib/yarp/node.rb#3816 + # source://yarp//lib/yarp/node.rb#4506 def initialize(operator_loc, variable, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3823 + # source://yarp//lib/yarp/node.rb#4513 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3828 + # source://yarp//lib/yarp/node.rb#4518 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3833 + # source://yarp//lib/yarp/node.rb#4528 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4523 + def compact_child_nodes; end + # def copy: (**params) -> EmbeddedVariableNode # - # source://yarp//lib/yarp/node.rb#3838 + # source://yarp//lib/yarp/node.rb#4533 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3828 + # source://yarp//lib/yarp/node.rb#4518 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3850 + # source://yarp//lib/yarp/node.rb#4545 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3859 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4565 + def human; end + + # source://yarp//lib/yarp/node.rb#4554 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#3855 + # source://yarp//lib/yarp/node.rb#4550 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#3810 + # source://yarp//lib/yarp/node.rb#4500 def operator_loc; end # attr_reader variable: Node # - # source://yarp//lib/yarp/node.rb#3813 + # source://yarp//lib/yarp/node.rb#4503 def variable; end end @@ -4660,72 +5364,84 @@ end # bar # end # -# source://yarp//lib/yarp/node.rb#3876 +# source://yarp//lib/yarp/node.rb#4578 class YARP::EnsureNode < ::YARP::Node # def initialize: (ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location) -> void # # @return [EnsureNode] a new instance of EnsureNode # - # source://yarp//lib/yarp/node.rb#3887 + # source://yarp//lib/yarp/node.rb#4589 def initialize(ensure_keyword_loc, statements, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3895 + # source://yarp//lib/yarp/node.rb#4597 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3900 + # source://yarp//lib/yarp/node.rb#4602 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3905 + # source://yarp//lib/yarp/node.rb#4614 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4607 + def compact_child_nodes; end + # def copy: (**params) -> EnsureNode # - # source://yarp//lib/yarp/node.rb#3910 + # source://yarp//lib/yarp/node.rb#4619 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3900 + # source://yarp//lib/yarp/node.rb#4602 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3923 + # source://yarp//lib/yarp/node.rb#4632 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#3933 + # source://yarp//lib/yarp/node.rb#4642 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#3884 + # source://yarp//lib/yarp/node.rb#4586 def end_keyword_loc; end # def ensure_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#3928 + # source://yarp//lib/yarp/node.rb#4637 def ensure_keyword; end # attr_reader ensure_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#3878 + # source://yarp//lib/yarp/node.rb#4580 def ensure_keyword_loc; end - # source://yarp//lib/yarp/node.rb#3937 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4662 + def human; end + + # source://yarp//lib/yarp/node.rb#4646 def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#3881 + # source://yarp//lib/yarp/node.rb#4583 def statements; end end @@ -4734,47 +5450,59 @@ end # false # ^^^^^ # -# source://yarp//lib/yarp/node.rb#3955 +# source://yarp//lib/yarp/node.rb#4671 class YARP::FalseNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [FalseNode] a new instance of FalseNode # - # source://yarp//lib/yarp/node.rb#3957 + # source://yarp//lib/yarp/node.rb#4673 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#3962 + # source://yarp//lib/yarp/node.rb#4678 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3967 + # source://yarp//lib/yarp/node.rb#4683 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#3972 + # source://yarp//lib/yarp/node.rb#4693 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4688 + def compact_child_nodes; end + # def copy: (**params) -> FalseNode # - # source://yarp//lib/yarp/node.rb#3977 + # source://yarp//lib/yarp/node.rb#4698 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#3967 + # source://yarp//lib/yarp/node.rb#4683 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#3987 + # source://yarp//lib/yarp/node.rb#4708 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#3991 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4720 + def human; end + + # source://yarp//lib/yarp/node.rb#4712 def inspect(inspector = T.unsafe(nil)); end end @@ -4789,87 +5517,99 @@ end # foo in Foo(*bar, baz, *qux) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4007 +# source://yarp//lib/yarp/node.rb#4735 class YARP::FindPatternNode < ::YARP::Node # def initialize: (constant: Node?, left: Node, requireds: Array[Node], right: Node, opening_loc: Location?, closing_loc: Location?, location: Location) -> void # # @return [FindPatternNode] a new instance of FindPatternNode # - # source://yarp//lib/yarp/node.rb#4027 + # source://yarp//lib/yarp/node.rb#4755 def initialize(constant, left, requireds, right, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4038 + # source://yarp//lib/yarp/node.rb#4766 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4043 + # source://yarp//lib/yarp/node.rb#4771 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#4079 + # source://yarp//lib/yarp/node.rb#4817 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#4024 + # source://yarp//lib/yarp/node.rb#4752 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4048 + # source://yarp//lib/yarp/node.rb#4786 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4776 + def compact_child_nodes; end + # attr_reader constant: Node? # - # source://yarp//lib/yarp/node.rb#4009 + # source://yarp//lib/yarp/node.rb#4737 def constant; end # def copy: (**params) -> FindPatternNode # - # source://yarp//lib/yarp/node.rb#4053 + # source://yarp//lib/yarp/node.rb#4791 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4043 + # source://yarp//lib/yarp/node.rb#4771 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4069 + # source://yarp//lib/yarp/node.rb#4807 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4083 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4842 + def human; end + + # source://yarp//lib/yarp/node.rb#4821 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://yarp//lib/yarp/node.rb#4012 + # source://yarp//lib/yarp/node.rb#4740 def left; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#4074 + # source://yarp//lib/yarp/node.rb#4812 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#4021 + # source://yarp//lib/yarp/node.rb#4749 def opening_loc; end # attr_reader requireds: Array[Node] # - # source://yarp//lib/yarp/node.rb#4015 + # source://yarp//lib/yarp/node.rb#4743 def requireds; end # attr_reader right: Node # - # source://yarp//lib/yarp/node.rb#4018 + # source://yarp//lib/yarp/node.rb#4746 def right; end end @@ -4878,80 +5618,94 @@ end # baz if foo .. bar # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4106 +# source://yarp//lib/yarp/node.rb#4851 class YARP::FlipFlopNode < ::YARP::Node # def initialize: (left: Node?, right: Node?, operator_loc: Location, flags: Integer, location: Location) -> void # # @return [FlipFlopNode] a new instance of FlipFlopNode # - # source://yarp//lib/yarp/node.rb#4120 + # source://yarp//lib/yarp/node.rb#4865 def initialize(left, right, operator_loc, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4129 + # source://yarp//lib/yarp/node.rb#4874 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4134 + # source://yarp//lib/yarp/node.rb#4879 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4139 + # source://yarp//lib/yarp/node.rb#4892 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4884 + def compact_child_nodes; end + # def copy: (**params) -> FlipFlopNode # - # source://yarp//lib/yarp/node.rb#4144 + # source://yarp//lib/yarp/node.rb#4897 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4134 + # source://yarp//lib/yarp/node.rb#4879 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4158 + # source://yarp//lib/yarp/node.rb#4911 def deconstruct_keys(keys); end # def exclude_end?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#4168 + # source://yarp//lib/yarp/node.rb#4921 def exclude_end?; end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#4117 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#4948 + def human; end - # source://yarp//lib/yarp/node.rb#4172 + # source://yarp//lib/yarp/node.rb#4925 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node? # - # source://yarp//lib/yarp/node.rb#4108 + # source://yarp//lib/yarp/node.rb#4853 def left; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#4163 + # source://yarp//lib/yarp/node.rb#4916 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#4114 + # source://yarp//lib/yarp/node.rb#4859 def operator_loc; end # attr_reader right: Node? # - # source://yarp//lib/yarp/node.rb#4111 + # source://yarp//lib/yarp/node.rb#4856 def right; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#4862 + def flags; end end # Represents a floating point number literal. @@ -4959,50 +5713,64 @@ end # 1.0 # ^^^ # -# source://yarp//lib/yarp.rb#392 +# source://yarp//lib/yarp/node.rb#4957 class YARP::FloatNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [FloatNode] a new instance of FloatNode # - # source://yarp//lib/yarp/node.rb#4198 + # source://yarp//lib/yarp/node.rb#4959 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4203 + # source://yarp//lib/yarp/node.rb#4964 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4208 + # source://yarp//lib/yarp/node.rb#4969 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4213 + # source://yarp//lib/yarp/node.rb#4979 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#4974 + def compact_child_nodes; end + # def copy: (**params) -> FloatNode # - # source://yarp//lib/yarp/node.rb#4218 + # source://yarp//lib/yarp/node.rb#4984 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4208 + # source://yarp//lib/yarp/node.rb#4969 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4228 + # source://yarp//lib/yarp/node.rb#4994 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4232 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5006 + def human; end + + # source://yarp//lib/yarp/node.rb#4998 def inspect(inspector = T.unsafe(nil)); end - # source://yarp//lib/yarp.rb#393 + # Returns the value of the node as a Ruby Float. + # + # source://yarp//lib/yarp.rb#569 def value; end end @@ -5011,102 +5779,114 @@ end # for i in a end # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4242 +# source://yarp//lib/yarp/node.rb#5015 class YARP::ForNode < ::YARP::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 # # @return [ForNode] a new instance of ForNode # - # source://yarp//lib/yarp/node.rb#4265 + # source://yarp//lib/yarp/node.rb#5038 def initialize(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4277 + # source://yarp//lib/yarp/node.rb#5050 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4282 + # source://yarp//lib/yarp/node.rb#5055 def child_nodes; end # attr_reader collection: Node # - # source://yarp//lib/yarp/node.rb#4247 + # source://yarp//lib/yarp/node.rb#5020 def collection; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4287 + # source://yarp//lib/yarp/node.rb#5069 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5060 + def compact_child_nodes; end + # def copy: (**params) -> ForNode # - # source://yarp//lib/yarp/node.rb#4292 + # source://yarp//lib/yarp/node.rb#5074 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4282 + # source://yarp//lib/yarp/node.rb#5055 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4309 + # source://yarp//lib/yarp/node.rb#5091 def deconstruct_keys(keys); end # def do_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#4324 + # source://yarp//lib/yarp/node.rb#5106 def do_keyword; end # attr_reader do_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#4259 + # source://yarp//lib/yarp/node.rb#5032 def do_keyword_loc; end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#4329 + # source://yarp//lib/yarp/node.rb#5111 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#4262 + # source://yarp//lib/yarp/node.rb#5035 def end_keyword_loc; end # def for_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#4314 + # source://yarp//lib/yarp/node.rb#5096 def for_keyword; end # attr_reader for_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#4253 + # source://yarp//lib/yarp/node.rb#5026 def for_keyword_loc; end + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5137 + def human; end + # def in_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#4319 + # source://yarp//lib/yarp/node.rb#5101 def in_keyword; end # attr_reader in_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#4256 + # source://yarp//lib/yarp/node.rb#5029 def in_keyword_loc; end # attr_reader index: Node # - # source://yarp//lib/yarp/node.rb#4244 + # source://yarp//lib/yarp/node.rb#5017 def index; end - # source://yarp//lib/yarp/node.rb#4333 + # source://yarp//lib/yarp/node.rb#5115 def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#4250 + # source://yarp//lib/yarp/node.rb#5023 def statements; end end @@ -5117,47 +5897,59 @@ end # ^^^^^^^^ # end # -# source://yarp//lib/yarp/node.rb#4359 +# source://yarp//lib/yarp/node.rb#5148 class YARP::ForwardingArgumentsNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode # - # source://yarp//lib/yarp/node.rb#4361 + # source://yarp//lib/yarp/node.rb#5150 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4366 + # source://yarp//lib/yarp/node.rb#5155 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4371 + # source://yarp//lib/yarp/node.rb#5160 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4376 + # source://yarp//lib/yarp/node.rb#5170 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5165 + def compact_child_nodes; end + # def copy: (**params) -> ForwardingArgumentsNode # - # source://yarp//lib/yarp/node.rb#4381 + # source://yarp//lib/yarp/node.rb#5175 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4371 + # source://yarp//lib/yarp/node.rb#5160 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4391 + # source://yarp//lib/yarp/node.rb#5185 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4395 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5197 + def human; end + + # source://yarp//lib/yarp/node.rb#5189 def inspect(inspector = T.unsafe(nil)); end end @@ -5167,47 +5959,59 @@ end # ^^^ # end # -# source://yarp//lib/yarp/node.rb#4406 +# source://yarp//lib/yarp/node.rb#5207 class YARP::ForwardingParameterNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode # - # source://yarp//lib/yarp/node.rb#4408 + # source://yarp//lib/yarp/node.rb#5209 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4413 + # source://yarp//lib/yarp/node.rb#5214 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4418 + # source://yarp//lib/yarp/node.rb#5219 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4423 + # source://yarp//lib/yarp/node.rb#5229 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5224 + def compact_child_nodes; end + # def copy: (**params) -> ForwardingParameterNode # - # source://yarp//lib/yarp/node.rb#4428 + # source://yarp//lib/yarp/node.rb#5234 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4418 + # source://yarp//lib/yarp/node.rb#5219 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4438 + # source://yarp//lib/yarp/node.rb#5244 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4442 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5256 + def human; end + + # source://yarp//lib/yarp/node.rb#5248 def inspect(inspector = T.unsafe(nil)); end end @@ -5216,52 +6020,64 @@ end # super # ^^^^^ # -# source://yarp//lib/yarp/node.rb#4452 +# source://yarp//lib/yarp/node.rb#5265 class YARP::ForwardingSuperNode < ::YARP::Node # def initialize: (block: BlockNode?, location: Location) -> void # # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode # - # source://yarp//lib/yarp/node.rb#4457 + # source://yarp//lib/yarp/node.rb#5270 def initialize(block, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4463 + # source://yarp//lib/yarp/node.rb#5276 def accept(visitor); end # attr_reader block: BlockNode? # - # source://yarp//lib/yarp/node.rb#4454 + # source://yarp//lib/yarp/node.rb#5267 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4468 + # source://yarp//lib/yarp/node.rb#5281 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4473 + # source://yarp//lib/yarp/node.rb#5293 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5286 + def compact_child_nodes; end + # def copy: (**params) -> ForwardingSuperNode # - # source://yarp//lib/yarp/node.rb#4478 + # source://yarp//lib/yarp/node.rb#5298 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4468 + # source://yarp//lib/yarp/node.rb#5281 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4489 + # source://yarp//lib/yarp/node.rb#5309 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4493 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5327 + def human; end + + # source://yarp//lib/yarp/node.rb#5313 def inspect(inspector = T.unsafe(nil)); end end @@ -5270,72 +6086,84 @@ end # $target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4509 +# source://yarp//lib/yarp/node.rb#5336 class YARP::GlobalVariableAndWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#4523 + # source://yarp//lib/yarp/node.rb#5350 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4532 + # source://yarp//lib/yarp/node.rb#5359 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4537 + # source://yarp//lib/yarp/node.rb#5364 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4542 + # source://yarp//lib/yarp/node.rb#5374 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5369 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#4547 + # source://yarp//lib/yarp/node.rb#5379 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4537 + # source://yarp//lib/yarp/node.rb#5364 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4561 + # source://yarp//lib/yarp/node.rb#5393 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4570 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5415 + def human; end + + # source://yarp//lib/yarp/node.rb#5402 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4511 + # source://yarp//lib/yarp/node.rb#5338 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#4514 + # source://yarp//lib/yarp/node.rb#5341 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#4566 + # source://yarp//lib/yarp/node.rb#5398 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#4517 + # source://yarp//lib/yarp/node.rb#5344 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#4520 + # source://yarp//lib/yarp/node.rb#5347 def value; end end @@ -5344,72 +6172,84 @@ end # $target += value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4585 +# source://yarp//lib/yarp/node.rb#5424 class YARP::GlobalVariableOperatorWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void # # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#4602 + # source://yarp//lib/yarp/node.rb#5441 def initialize(name, name_loc, operator_loc, value, operator, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4612 + # source://yarp//lib/yarp/node.rb#5451 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4617 + # source://yarp//lib/yarp/node.rb#5456 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4622 + # source://yarp//lib/yarp/node.rb#5466 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5461 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#4627 + # source://yarp//lib/yarp/node.rb#5471 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4617 + # source://yarp//lib/yarp/node.rb#5456 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4642 + # source://yarp//lib/yarp/node.rb#5486 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4646 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5504 + def human; end + + # source://yarp//lib/yarp/node.rb#5490 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4587 + # source://yarp//lib/yarp/node.rb#5426 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#4590 + # source://yarp//lib/yarp/node.rb#5429 def name_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#4599 + # source://yarp//lib/yarp/node.rb#5438 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#4593 + # source://yarp//lib/yarp/node.rb#5432 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#4596 + # source://yarp//lib/yarp/node.rb#5435 def value; end end @@ -5418,72 +6258,84 @@ end # $target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4662 +# source://yarp//lib/yarp/node.rb#5513 class YARP::GlobalVariableOrWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#4676 + # source://yarp//lib/yarp/node.rb#5527 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4685 + # source://yarp//lib/yarp/node.rb#5536 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4690 + # source://yarp//lib/yarp/node.rb#5541 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4695 + # source://yarp//lib/yarp/node.rb#5551 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5546 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#4700 + # source://yarp//lib/yarp/node.rb#5556 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4690 + # source://yarp//lib/yarp/node.rb#5541 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4714 + # source://yarp//lib/yarp/node.rb#5570 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4723 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5592 + def human; end + + # source://yarp//lib/yarp/node.rb#5579 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4664 + # source://yarp//lib/yarp/node.rb#5515 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#4667 + # source://yarp//lib/yarp/node.rb#5518 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#4719 + # source://yarp//lib/yarp/node.rb#5575 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#4670 + # source://yarp//lib/yarp/node.rb#5521 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#4673 + # source://yarp//lib/yarp/node.rb#5524 def value; end end @@ -5492,52 +6344,64 @@ end # $foo # ^^^^ # -# source://yarp//lib/yarp/node.rb#4738 +# source://yarp//lib/yarp/node.rb#5601 class YARP::GlobalVariableReadNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode # - # source://yarp//lib/yarp/node.rb#4743 + # source://yarp//lib/yarp/node.rb#5606 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4749 + # source://yarp//lib/yarp/node.rb#5612 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4754 + # source://yarp//lib/yarp/node.rb#5617 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4759 + # source://yarp//lib/yarp/node.rb#5627 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5622 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableReadNode # - # source://yarp//lib/yarp/node.rb#4764 + # source://yarp//lib/yarp/node.rb#5632 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4754 + # source://yarp//lib/yarp/node.rb#5617 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4775 + # source://yarp//lib/yarp/node.rb#5643 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4779 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5656 + def human; end + + # source://yarp//lib/yarp/node.rb#5647 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4740 + # source://yarp//lib/yarp/node.rb#5603 def name; end end @@ -5546,52 +6410,64 @@ end # $foo, $bar = baz # ^^^^ ^^^^ # -# source://yarp//lib/yarp/node.rb#4790 +# source://yarp//lib/yarp/node.rb#5665 class YARP::GlobalVariableTargetNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode # - # source://yarp//lib/yarp/node.rb#4795 + # source://yarp//lib/yarp/node.rb#5670 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4801 + # source://yarp//lib/yarp/node.rb#5676 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4806 + # source://yarp//lib/yarp/node.rb#5681 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4811 + # source://yarp//lib/yarp/node.rb#5691 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5686 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableTargetNode # - # source://yarp//lib/yarp/node.rb#4816 + # source://yarp//lib/yarp/node.rb#5696 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4806 + # source://yarp//lib/yarp/node.rb#5681 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4827 + # source://yarp//lib/yarp/node.rb#5707 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4831 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5720 + def human; end + + # source://yarp//lib/yarp/node.rb#5711 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4792 + # source://yarp//lib/yarp/node.rb#5667 def name; end end @@ -5600,72 +6476,84 @@ end # $foo = 1 # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4842 +# source://yarp//lib/yarp/node.rb#5729 class YARP::GlobalVariableWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void # # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode # - # source://yarp//lib/yarp/node.rb#4856 + # source://yarp//lib/yarp/node.rb#5743 def initialize(name, name_loc, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4865 + # source://yarp//lib/yarp/node.rb#5752 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4870 + # source://yarp//lib/yarp/node.rb#5757 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4875 + # source://yarp//lib/yarp/node.rb#5767 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5762 + def compact_child_nodes; end + # def copy: (**params) -> GlobalVariableWriteNode # - # source://yarp//lib/yarp/node.rb#4880 + # source://yarp//lib/yarp/node.rb#5772 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4870 + # source://yarp//lib/yarp/node.rb#5757 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4894 + # source://yarp//lib/yarp/node.rb#5786 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#4903 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5808 + def human; end + + # source://yarp//lib/yarp/node.rb#5795 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#4844 + # source://yarp//lib/yarp/node.rb#5731 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#4847 + # source://yarp//lib/yarp/node.rb#5734 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#4899 + # source://yarp//lib/yarp/node.rb#5791 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#4853 + # source://yarp//lib/yarp/node.rb#5740 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#4850 + # source://yarp//lib/yarp/node.rb#5737 def value; end end @@ -5674,72 +6562,84 @@ end # { a => b } # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4918 +# source://yarp//lib/yarp/node.rb#5817 class YARP::HashNode < ::YARP::Node # def initialize: (opening_loc: Location, elements: Array[Node], closing_loc: Location, location: Location) -> void # # @return [HashNode] a new instance of HashNode # - # source://yarp//lib/yarp/node.rb#4929 + # source://yarp//lib/yarp/node.rb#5828 def initialize(opening_loc, elements, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#4937 + # source://yarp//lib/yarp/node.rb#5836 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4942 + # source://yarp//lib/yarp/node.rb#5841 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#4975 + # source://yarp//lib/yarp/node.rb#5879 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#4926 + # source://yarp//lib/yarp/node.rb#5825 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#4947 + # source://yarp//lib/yarp/node.rb#5851 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5846 + def compact_child_nodes; end + # def copy: (**params) -> HashNode # - # source://yarp//lib/yarp/node.rb#4952 + # source://yarp//lib/yarp/node.rb#5856 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#4942 + # source://yarp//lib/yarp/node.rb#5841 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#4965 + # source://yarp//lib/yarp/node.rb#5869 def deconstruct_keys(keys); end # attr_reader elements: Array[Node] # - # source://yarp//lib/yarp/node.rb#4923 + # source://yarp//lib/yarp/node.rb#5822 def elements; end - # source://yarp//lib/yarp/node.rb#4979 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#5894 + def human; end + + # source://yarp//lib/yarp/node.rb#5883 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#4970 + # source://yarp//lib/yarp/node.rb#5874 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#4920 + # source://yarp//lib/yarp/node.rb#5819 def opening_loc; end end @@ -5751,82 +6651,94 @@ end # foo => { a: 1, b: 2, **c } # ^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#4995 +# source://yarp//lib/yarp/node.rb#5906 class YARP::HashPatternNode < ::YARP::Node # def initialize: (constant: Node?, assocs: Array[Node], kwrest: Node?, opening_loc: Location?, closing_loc: Location?, location: Location) -> void # # @return [HashPatternNode] a new instance of HashPatternNode # - # source://yarp//lib/yarp/node.rb#5012 + # source://yarp//lib/yarp/node.rb#5923 def initialize(constant, assocs, kwrest, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5022 + # source://yarp//lib/yarp/node.rb#5933 def accept(visitor); end # attr_reader assocs: Array[Node] # - # source://yarp//lib/yarp/node.rb#5000 + # source://yarp//lib/yarp/node.rb#5911 def assocs; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5027 + # source://yarp//lib/yarp/node.rb#5938 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#5062 + # source://yarp//lib/yarp/node.rb#5982 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#5009 + # source://yarp//lib/yarp/node.rb#5920 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5032 + # source://yarp//lib/yarp/node.rb#5952 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#5943 + def compact_child_nodes; end + # attr_reader constant: Node? # - # source://yarp//lib/yarp/node.rb#4997 + # source://yarp//lib/yarp/node.rb#5908 def constant; end # def copy: (**params) -> HashPatternNode # - # source://yarp//lib/yarp/node.rb#5037 + # source://yarp//lib/yarp/node.rb#5957 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5027 + # source://yarp//lib/yarp/node.rb#5938 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5052 + # source://yarp//lib/yarp/node.rb#5972 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5066 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6009 + def human; end + + # source://yarp//lib/yarp/node.rb#5986 def inspect(inspector = T.unsafe(nil)); end # attr_reader kwrest: Node? # - # source://yarp//lib/yarp/node.rb#5003 + # source://yarp//lib/yarp/node.rb#5914 def kwrest; end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#5057 + # source://yarp//lib/yarp/node.rb#5977 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#5006 + # source://yarp//lib/yarp/node.rb#5917 def opening_loc; end end @@ -5838,85 +6750,97 @@ end # if foo then bar end # ^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5094 +# source://yarp//lib/yarp/node.rb#6021 class YARP::IfNode < ::YARP::Node # def initialize: (if_keyword_loc: Location?, predicate: Node, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> void # # @return [IfNode] a new instance of IfNode # - # source://yarp//lib/yarp/node.rb#5111 + # source://yarp//lib/yarp/node.rb#6038 def initialize(if_keyword_loc, predicate, statements, consequent, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5121 + # source://yarp//lib/yarp/node.rb#6048 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5130 + # source://yarp//lib/yarp/node.rb#6057 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5135 + # source://yarp//lib/yarp/node.rb#6071 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6062 + def compact_child_nodes; end + # attr_reader consequent: Node? # - # source://yarp//lib/yarp/node.rb#5105 + # source://yarp//lib/yarp/node.rb#6032 def consequent; end # def copy: (**params) -> IfNode # - # source://yarp//lib/yarp/node.rb#5140 + # source://yarp//lib/yarp/node.rb#6076 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5130 + # source://yarp//lib/yarp/node.rb#6057 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5155 + # source://yarp//lib/yarp/node.rb#6091 def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#5165 + # source://yarp//lib/yarp/node.rb#6101 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#5108 + # source://yarp//lib/yarp/node.rb#6035 def end_keyword_loc; end + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6129 + def human; end + # def if_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#5160 + # source://yarp//lib/yarp/node.rb#6096 def if_keyword; end # attr_reader if_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#5096 + # source://yarp//lib/yarp/node.rb#6023 def if_keyword_loc; end - # source://yarp//lib/yarp/node.rb#5169 + # source://yarp//lib/yarp/node.rb#6105 def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Node # - # source://yarp//lib/yarp/node.rb#5099 + # source://yarp//lib/yarp/node.rb#6026 def predicate; end - # source://yarp//lib/yarp/node.rb#5125 + # source://yarp//lib/yarp/node.rb#6052 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#5102 + # source://yarp//lib/yarp/node.rb#6029 def statements; end end @@ -5925,134 +6849,230 @@ end # 1.0i # ^^^^ # -# source://yarp//lib/yarp.rb#398 +# source://yarp//lib/yarp/node.rb#6138 class YARP::ImaginaryNode < ::YARP::Node # def initialize: (numeric: Node, location: Location) -> void # # @return [ImaginaryNode] a new instance of ImaginaryNode # - # source://yarp//lib/yarp/node.rb#5200 + # source://yarp//lib/yarp/node.rb#6143 def initialize(numeric, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5206 + # source://yarp//lib/yarp/node.rb#6149 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5211 + # source://yarp//lib/yarp/node.rb#6154 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5216 + # source://yarp//lib/yarp/node.rb#6164 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6159 + def compact_child_nodes; end + # def copy: (**params) -> ImaginaryNode # - # source://yarp//lib/yarp/node.rb#5221 + # source://yarp//lib/yarp/node.rb#6169 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5211 + # source://yarp//lib/yarp/node.rb#6154 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5232 + # source://yarp//lib/yarp/node.rb#6180 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5236 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6194 + def human; end + + # source://yarp//lib/yarp/node.rb#6184 def inspect(inspector = T.unsafe(nil)); end # attr_reader numeric: Node # - # source://yarp//lib/yarp/node.rb#5197 + # source://yarp//lib/yarp/node.rb#6140 def numeric; end - # source://yarp//lib/yarp.rb#399 + # Returns the value of the node as a Ruby Complex. + # + # source://yarp//lib/yarp.rb#576 def value; end end -# Represents the use of the `in` keyword in a case statement. +# Represents a node that is implicitly being added to the tree but doesn't +# correspond directly to a node in the source. # -# case a; in b then c end -# ^^^^^^^^^^^ +# { foo: } +# ^^^^ # -# source://yarp//lib/yarp/node.rb#5248 -class YARP::InNode < ::YARP::Node - # def initialize: (pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location) -> void +# { Foo: } +# ^^^^ +# +# source://yarp//lib/yarp/node.rb#6207 +class YARP::ImplicitNode < ::YARP::Node + # def initialize: (value: Node, location: Location) -> void # - # @return [InNode] a new instance of InNode + # @return [ImplicitNode] a new instance of ImplicitNode # - # source://yarp//lib/yarp/node.rb#5262 - def initialize(pattern, statements, in_loc, then_loc, location); end + # source://yarp//lib/yarp/node.rb#6212 + def initialize(value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5271 + # source://yarp//lib/yarp/node.rb#6218 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5276 + # source://yarp//lib/yarp/node.rb#6223 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5281 + # source://yarp//lib/yarp/node.rb#6233 def comment_targets; end - # def copy: (**params) -> InNode + # def compact_child_nodes: () -> Array[Node] # - # source://yarp//lib/yarp/node.rb#5286 + # source://yarp//lib/yarp/node.rb#6228 + def compact_child_nodes; end + + # def copy: (**params) -> ImplicitNode + # + # source://yarp//lib/yarp/node.rb#6238 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5276 + # source://yarp//lib/yarp/node.rb#6223 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5300 + # source://yarp//lib/yarp/node.rb#6249 def deconstruct_keys(keys); end - # def in: () -> String + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#5305 - def in; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6263 + def human; end + + # source://yarp//lib/yarp/node.rb#6253 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader value: Node + # + # source://yarp//lib/yarp/node.rb#6209 + def value; end +end + +# Represents the use of the `in` keyword in a case statement. +# +# case a; in b then c end +# ^^^^^^^^^^^ +# +# source://yarp//lib/yarp/node.rb#6272 +class YARP::InNode < ::YARP::Node + # def initialize: (pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location) -> void + # + # @return [InNode] a new instance of InNode + # + # source://yarp//lib/yarp/node.rb#6286 + def initialize(pattern, statements, in_loc, then_loc, location); end + + # def accept: (visitor: Visitor) -> void + # + # source://yarp//lib/yarp/node.rb#6295 + def accept(visitor); end + + # def child_nodes: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#6300 + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://yarp//lib/yarp/node.rb#6313 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6305 + def compact_child_nodes; end + + # def copy: (**params) -> InNode + # + # source://yarp//lib/yarp/node.rb#6318 + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#6300 + def deconstruct; end + + # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # + # source://yarp//lib/yarp/node.rb#6332 + def deconstruct_keys(keys); end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6364 + def human; end + + # def in: () -> String + # + # source://yarp//lib/yarp/node.rb#6337 + def in; end # attr_reader in_loc: Location # - # source://yarp//lib/yarp/node.rb#5256 + # source://yarp//lib/yarp/node.rb#6280 def in_loc; end - # source://yarp//lib/yarp/node.rb#5314 + # source://yarp//lib/yarp/node.rb#6346 def inspect(inspector = T.unsafe(nil)); end # attr_reader pattern: Node # - # source://yarp//lib/yarp/node.rb#5250 + # source://yarp//lib/yarp/node.rb#6274 def pattern; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#5253 + # source://yarp//lib/yarp/node.rb#6277 def statements; end # def then: () -> String? # - # source://yarp//lib/yarp/node.rb#5310 + # source://yarp//lib/yarp/node.rb#6342 def then; end # attr_reader then_loc: Location? # - # source://yarp//lib/yarp/node.rb#5259 + # source://yarp//lib/yarp/node.rb#6283 def then_loc; end end @@ -6061,72 +7081,84 @@ end # @target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5334 +# source://yarp//lib/yarp/node.rb#6373 class YARP::InstanceVariableAndWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#5348 + # source://yarp//lib/yarp/node.rb#6387 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5357 + # source://yarp//lib/yarp/node.rb#6396 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5362 + # source://yarp//lib/yarp/node.rb#6401 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5367 + # source://yarp//lib/yarp/node.rb#6411 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6406 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#5372 + # source://yarp//lib/yarp/node.rb#6416 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5362 + # source://yarp//lib/yarp/node.rb#6401 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5386 + # source://yarp//lib/yarp/node.rb#6430 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5395 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6452 + def human; end + + # source://yarp//lib/yarp/node.rb#6439 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5336 + # source://yarp//lib/yarp/node.rb#6375 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#5339 + # source://yarp//lib/yarp/node.rb#6378 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#5391 + # source://yarp//lib/yarp/node.rb#6435 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#5342 + # source://yarp//lib/yarp/node.rb#6381 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#5345 + # source://yarp//lib/yarp/node.rb#6384 def value; end end @@ -6135,72 +7167,84 @@ end # @target += value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5410 +# source://yarp//lib/yarp/node.rb#6461 class YARP::InstanceVariableOperatorWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void # # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#5427 + # source://yarp//lib/yarp/node.rb#6478 def initialize(name, name_loc, operator_loc, value, operator, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5437 + # source://yarp//lib/yarp/node.rb#6488 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5442 + # source://yarp//lib/yarp/node.rb#6493 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5447 + # source://yarp//lib/yarp/node.rb#6503 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6498 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#5452 + # source://yarp//lib/yarp/node.rb#6508 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5442 + # source://yarp//lib/yarp/node.rb#6493 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5467 + # source://yarp//lib/yarp/node.rb#6523 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5471 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6541 + def human; end + + # source://yarp//lib/yarp/node.rb#6527 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5412 + # source://yarp//lib/yarp/node.rb#6463 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#5415 + # source://yarp//lib/yarp/node.rb#6466 def name_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#5424 + # source://yarp//lib/yarp/node.rb#6475 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#5418 + # source://yarp//lib/yarp/node.rb#6469 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#5421 + # source://yarp//lib/yarp/node.rb#6472 def value; end end @@ -6209,72 +7253,84 @@ end # @target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5487 +# source://yarp//lib/yarp/node.rb#6550 class YARP::InstanceVariableOrWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#5501 + # source://yarp//lib/yarp/node.rb#6564 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5510 + # source://yarp//lib/yarp/node.rb#6573 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5515 + # source://yarp//lib/yarp/node.rb#6578 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5520 + # source://yarp//lib/yarp/node.rb#6588 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6583 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#5525 + # source://yarp//lib/yarp/node.rb#6593 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5515 + # source://yarp//lib/yarp/node.rb#6578 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5539 + # source://yarp//lib/yarp/node.rb#6607 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5548 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6629 + def human; end + + # source://yarp//lib/yarp/node.rb#6616 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5489 + # source://yarp//lib/yarp/node.rb#6552 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#5492 + # source://yarp//lib/yarp/node.rb#6555 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#5544 + # source://yarp//lib/yarp/node.rb#6612 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#5495 + # source://yarp//lib/yarp/node.rb#6558 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#5498 + # source://yarp//lib/yarp/node.rb#6561 def value; end end @@ -6283,52 +7339,64 @@ end # @foo # ^^^^ # -# source://yarp//lib/yarp/node.rb#5563 +# source://yarp//lib/yarp/node.rb#6638 class YARP::InstanceVariableReadNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode # - # source://yarp//lib/yarp/node.rb#5568 + # source://yarp//lib/yarp/node.rb#6643 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5574 + # source://yarp//lib/yarp/node.rb#6649 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5579 + # source://yarp//lib/yarp/node.rb#6654 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5584 + # source://yarp//lib/yarp/node.rb#6664 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6659 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableReadNode # - # source://yarp//lib/yarp/node.rb#5589 + # source://yarp//lib/yarp/node.rb#6669 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5579 + # source://yarp//lib/yarp/node.rb#6654 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5600 + # source://yarp//lib/yarp/node.rb#6680 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5604 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6693 + def human; end + + # source://yarp//lib/yarp/node.rb#6684 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5565 + # source://yarp//lib/yarp/node.rb#6640 def name; end end @@ -6337,52 +7405,64 @@ end # @foo, @bar = baz # ^^^^ ^^^^ # -# source://yarp//lib/yarp/node.rb#5615 +# source://yarp//lib/yarp/node.rb#6702 class YARP::InstanceVariableTargetNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode # - # source://yarp//lib/yarp/node.rb#5620 + # source://yarp//lib/yarp/node.rb#6707 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5626 + # source://yarp//lib/yarp/node.rb#6713 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5631 + # source://yarp//lib/yarp/node.rb#6718 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5636 + # source://yarp//lib/yarp/node.rb#6728 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6723 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableTargetNode # - # source://yarp//lib/yarp/node.rb#5641 + # source://yarp//lib/yarp/node.rb#6733 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5631 + # source://yarp//lib/yarp/node.rb#6718 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5652 + # source://yarp//lib/yarp/node.rb#6744 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5656 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6757 + def human; end + + # source://yarp//lib/yarp/node.rb#6748 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5617 + # source://yarp//lib/yarp/node.rb#6704 def name; end end @@ -6391,125 +7471,363 @@ end # @foo = 1 # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5667 +# source://yarp//lib/yarp/node.rb#6766 class YARP::InstanceVariableWriteNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void # # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode # - # source://yarp//lib/yarp/node.rb#5681 + # source://yarp//lib/yarp/node.rb#6780 def initialize(name, name_loc, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5690 + # source://yarp//lib/yarp/node.rb#6789 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5695 + # source://yarp//lib/yarp/node.rb#6794 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5700 + # source://yarp//lib/yarp/node.rb#6804 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6799 + def compact_child_nodes; end + # def copy: (**params) -> InstanceVariableWriteNode # - # source://yarp//lib/yarp/node.rb#5705 + # source://yarp//lib/yarp/node.rb#6809 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5695 + # source://yarp//lib/yarp/node.rb#6794 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5719 + # source://yarp//lib/yarp/node.rb#6823 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5728 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6845 + def human; end + + # source://yarp//lib/yarp/node.rb#6832 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#5669 + # source://yarp//lib/yarp/node.rb#6768 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#5672 + # source://yarp//lib/yarp/node.rb#6771 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#5724 + # source://yarp//lib/yarp/node.rb#6828 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#5678 + # source://yarp//lib/yarp/node.rb#6777 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#5675 + # source://yarp//lib/yarp/node.rb#6774 def value; end end +# source://yarp//lib/yarp/node.rb#12903 +module YARP::IntegerBaseFlags; end + +# 0b prefix +# +# source://yarp//lib/yarp/node.rb#12905 +YARP::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) + +# 0d or no prefix +# +# source://yarp//lib/yarp/node.rb#12911 +YARP::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + +# 0x prefix +# +# source://yarp//lib/yarp/node.rb#12914 +YARP::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + +# 0o or 0 prefix +# +# source://yarp//lib/yarp/node.rb#12908 +YARP::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + # Represents an integer number literal. # # 1 # ^ # -# source://yarp//lib/yarp.rb#404 +# source://yarp//lib/yarp/node.rb#6854 class YARP::IntegerNode < ::YARP::Node - # def initialize: (location: Location) -> void + # def initialize: (flags: Integer, location: Location) -> void # # @return [IntegerNode] a new instance of IntegerNode # - # source://yarp//lib/yarp/node.rb#5745 - def initialize(location); end + # source://yarp//lib/yarp/node.rb#6859 + def initialize(flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5750 + # source://yarp//lib/yarp/node.rb#6865 def accept(visitor); end + # def binary?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#6901 + def binary?; end + # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5755 + # source://yarp//lib/yarp/node.rb#6870 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5760 + # source://yarp//lib/yarp/node.rb#6880 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6875 + def compact_child_nodes; end + # def copy: (**params) -> IntegerNode # - # source://yarp//lib/yarp/node.rb#5765 + # source://yarp//lib/yarp/node.rb#6885 def copy(**params); end + # def decimal?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#6911 + def decimal?; end + # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5755 + # source://yarp//lib/yarp/node.rb#6870 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5775 + # source://yarp//lib/yarp/node.rb#6896 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5779 + # def hexadecimal?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#6916 + def hexadecimal?; end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#6930 + def human; end + + # source://yarp//lib/yarp/node.rb#6920 def inspect(inspector = T.unsafe(nil)); end - # source://yarp//lib/yarp.rb#405 + # def octal?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#6906 + def octal?; end + + # Returns the value of the node as a Ruby Integer. + # + # source://yarp//lib/yarp.rb#583 def value; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#6856 + def flags; 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. +# +# if /foo #{bar} baz/ then end +# ^^^^^^^^^^^^^^^^ +# +# source://yarp//lib/yarp/node.rb#6941 +class YARP::InterpolatedMatchLastLineNode < ::YARP::Node + # def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location, flags: Integer, location: Location) -> void + # + # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode + # + # source://yarp//lib/yarp/node.rb#6955 + def initialize(opening_loc, parts, closing_loc, flags, location); end + + # def accept: (visitor: Visitor) -> void + # + # source://yarp//lib/yarp/node.rb#6964 + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7038 + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#6974 + def child_nodes; end + + # def closing: () -> String + # + # source://yarp//lib/yarp/node.rb#7013 + def closing; end + + # attr_reader closing_loc: Location + # + # source://yarp//lib/yarp/node.rb#6949 + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://yarp//lib/yarp/node.rb#6984 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#6979 + def compact_child_nodes; end + + # def copy: (**params) -> InterpolatedMatchLastLineNode + # + # source://yarp//lib/yarp/node.rb#6989 + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#6974 + def deconstruct; end + + # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # + # source://yarp//lib/yarp/node.rb#7003 + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7033 + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7023 + def extended?; end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7070 + def human; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7018 + def ignore_case?; end + + # source://yarp//lib/yarp/node.rb#7057 + def inspect(inspector = T.unsafe(nil)); end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7028 + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7053 + def once?; end + + # def opening: () -> String + # + # source://yarp//lib/yarp/node.rb#7008 + def opening; end + + # attr_reader opening_loc: Location + # + # source://yarp//lib/yarp/node.rb#6943 + def opening_loc; end + + # attr_reader parts: Array[Node] + # + # source://yarp//lib/yarp/node.rb#6946 + def parts; end + + # source://yarp//lib/yarp/node.rb#6968 + def set_newline_flag(newline_marked); end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7048 + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#7043 + def windows_31j?; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#6952 + def flags; end end # Represents a regular expression literal that contains interpolation. @@ -6517,137 +7835,157 @@ end # /foo #{bar} baz/ # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5789 +# source://yarp//lib/yarp/node.rb#7079 class YARP::InterpolatedRegularExpressionNode < ::YARP::Node # def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location, flags: Integer, location: Location) -> void # # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode # - # source://yarp//lib/yarp/node.rb#5803 + # source://yarp//lib/yarp/node.rb#7093 def initialize(opening_loc, parts, closing_loc, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5812 + # source://yarp//lib/yarp/node.rb#7102 def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5881 + # source://yarp//lib/yarp/node.rb#7176 def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5822 + # source://yarp//lib/yarp/node.rb#7112 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#5856 + # source://yarp//lib/yarp/node.rb#7151 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#5797 + # source://yarp//lib/yarp/node.rb#7087 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5827 + # source://yarp//lib/yarp/node.rb#7122 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7117 + def compact_child_nodes; end + # def copy: (**params) -> InterpolatedRegularExpressionNode # - # source://yarp//lib/yarp/node.rb#5832 + # source://yarp//lib/yarp/node.rb#7127 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5822 + # source://yarp//lib/yarp/node.rb#7112 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5846 + # source://yarp//lib/yarp/node.rb#7141 def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5876 + # source://yarp//lib/yarp/node.rb#7171 def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5871 + # source://yarp//lib/yarp/node.rb#7161 def extended?; end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#5800 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7208 + def human; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5861 + # source://yarp//lib/yarp/node.rb#7156 def ignore_case?; end - # source://yarp//lib/yarp/node.rb#5900 + # source://yarp//lib/yarp/node.rb#7195 def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5866 + # source://yarp//lib/yarp/node.rb#7166 def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5896 + # source://yarp//lib/yarp/node.rb#7191 def once?; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#5851 + # source://yarp//lib/yarp/node.rb#7146 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#5791 + # source://yarp//lib/yarp/node.rb#7081 def opening_loc; end + # Returns a numeric value that represents the flags that were used to create + # the regular expression. + # + # source://yarp//lib/yarp.rb#591 + def options; end + # attr_reader parts: Array[Node] # - # source://yarp//lib/yarp/node.rb#5794 + # source://yarp//lib/yarp/node.rb#7084 def parts; end - # source://yarp//lib/yarp/node.rb#5816 + # source://yarp//lib/yarp/node.rb#7106 def set_newline_flag(newline_marked); end # def utf_8?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5891 + # source://yarp//lib/yarp/node.rb#7186 def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#5886 + # source://yarp//lib/yarp/node.rb#7181 def windows_31j?; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#7090 + def flags; end end # Represents a string literal that contains interpolation. @@ -6655,75 +7993,87 @@ end # "foo #{bar} baz" # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5914 +# source://yarp//lib/yarp/node.rb#7217 class YARP::InterpolatedStringNode < ::YARP::Node # def initialize: (opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location) -> void # # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode # - # source://yarp//lib/yarp/node.rb#5925 + # source://yarp//lib/yarp/node.rb#7228 def initialize(opening_loc, parts, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#5933 + # source://yarp//lib/yarp/node.rb#7236 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5943 + # source://yarp//lib/yarp/node.rb#7246 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#5976 + # source://yarp//lib/yarp/node.rb#7284 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#5922 + # source://yarp//lib/yarp/node.rb#7225 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#5948 + # source://yarp//lib/yarp/node.rb#7256 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7251 + def compact_child_nodes; end + # def copy: (**params) -> InterpolatedStringNode # - # source://yarp//lib/yarp/node.rb#5953 + # source://yarp//lib/yarp/node.rb#7261 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#5943 + # source://yarp//lib/yarp/node.rb#7246 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#5966 + # source://yarp//lib/yarp/node.rb#7274 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#5980 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7299 + def human; end + + # source://yarp//lib/yarp/node.rb#7288 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#5971 + # source://yarp//lib/yarp/node.rb#7279 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#5916 + # source://yarp//lib/yarp/node.rb#7219 def opening_loc; end # attr_reader parts: Array[Node] # - # source://yarp//lib/yarp/node.rb#5919 + # source://yarp//lib/yarp/node.rb#7222 def parts; end - # source://yarp//lib/yarp/node.rb#5937 + # source://yarp//lib/yarp/node.rb#7240 def set_newline_flag(newline_marked); end end @@ -6732,75 +8082,87 @@ end # :"foo #{bar} baz" # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#5993 +# source://yarp//lib/yarp/node.rb#7308 class YARP::InterpolatedSymbolNode < ::YARP::Node # def initialize: (opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location) -> void # # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode # - # source://yarp//lib/yarp/node.rb#6004 + # source://yarp//lib/yarp/node.rb#7319 def initialize(opening_loc, parts, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6012 + # source://yarp//lib/yarp/node.rb#7327 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6022 + # source://yarp//lib/yarp/node.rb#7337 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#6055 + # source://yarp//lib/yarp/node.rb#7375 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#6001 + # source://yarp//lib/yarp/node.rb#7316 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6027 + # source://yarp//lib/yarp/node.rb#7347 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7342 + def compact_child_nodes; end + # def copy: (**params) -> InterpolatedSymbolNode # - # source://yarp//lib/yarp/node.rb#6032 + # source://yarp//lib/yarp/node.rb#7352 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6022 + # source://yarp//lib/yarp/node.rb#7337 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6045 + # source://yarp//lib/yarp/node.rb#7365 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6059 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7390 + def human; end + + # source://yarp//lib/yarp/node.rb#7379 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#6050 + # source://yarp//lib/yarp/node.rb#7370 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#5995 + # source://yarp//lib/yarp/node.rb#7310 def opening_loc; end # attr_reader parts: Array[Node] # - # source://yarp//lib/yarp/node.rb#5998 + # source://yarp//lib/yarp/node.rb#7313 def parts; end - # source://yarp//lib/yarp/node.rb#6016 + # source://yarp//lib/yarp/node.rb#7331 def set_newline_flag(newline_marked); end end @@ -6809,75 +8171,87 @@ end # `foo #{bar} baz` # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6072 +# source://yarp//lib/yarp/node.rb#7399 class YARP::InterpolatedXStringNode < ::YARP::Node # def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void # # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode # - # source://yarp//lib/yarp/node.rb#6083 + # source://yarp//lib/yarp/node.rb#7410 def initialize(opening_loc, parts, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6091 + # source://yarp//lib/yarp/node.rb#7418 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6101 + # source://yarp//lib/yarp/node.rb#7428 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#6134 + # source://yarp//lib/yarp/node.rb#7466 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#6080 + # source://yarp//lib/yarp/node.rb#7407 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6106 + # source://yarp//lib/yarp/node.rb#7438 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7433 + def compact_child_nodes; end + # def copy: (**params) -> InterpolatedXStringNode # - # source://yarp//lib/yarp/node.rb#6111 + # source://yarp//lib/yarp/node.rb#7443 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6101 + # source://yarp//lib/yarp/node.rb#7428 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6124 + # source://yarp//lib/yarp/node.rb#7456 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6138 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7481 + def human; end + + # source://yarp//lib/yarp/node.rb#7470 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#6129 + # source://yarp//lib/yarp/node.rb#7461 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#6074 + # source://yarp//lib/yarp/node.rb#7401 def opening_loc; end # attr_reader parts: Array[Node] # - # source://yarp//lib/yarp/node.rb#6077 + # source://yarp//lib/yarp/node.rb#7404 def parts; end - # source://yarp//lib/yarp/node.rb#6095 + # source://yarp//lib/yarp/node.rb#7422 def set_newline_flag(newline_marked); end end @@ -6886,52 +8260,64 @@ end # foo(a: b) # ^^^^ # -# source://yarp//lib/yarp/node.rb#6151 +# source://yarp//lib/yarp/node.rb#7490 class YARP::KeywordHashNode < ::YARP::Node # def initialize: (elements: Array[Node], location: Location) -> void # # @return [KeywordHashNode] a new instance of KeywordHashNode # - # source://yarp//lib/yarp/node.rb#6156 + # source://yarp//lib/yarp/node.rb#7495 def initialize(elements, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6162 + # source://yarp//lib/yarp/node.rb#7501 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6167 + # source://yarp//lib/yarp/node.rb#7506 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6172 + # source://yarp//lib/yarp/node.rb#7516 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7511 + def compact_child_nodes; end + # def copy: (**params) -> KeywordHashNode # - # source://yarp//lib/yarp/node.rb#6177 + # source://yarp//lib/yarp/node.rb#7521 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6167 + # source://yarp//lib/yarp/node.rb#7506 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6188 + # source://yarp//lib/yarp/node.rb#7532 def deconstruct_keys(keys); end # attr_reader elements: Array[Node] # - # source://yarp//lib/yarp/node.rb#6153 + # source://yarp//lib/yarp/node.rb#7492 def elements; end - # source://yarp//lib/yarp/node.rb#6192 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7545 + def human; end + + # source://yarp//lib/yarp/node.rb#7536 def inspect(inspector = T.unsafe(nil)); end end @@ -6945,62 +8331,74 @@ end # ^^^^ # end # -# source://yarp//lib/yarp/node.rb#6208 +# source://yarp//lib/yarp/node.rb#7559 class YARP::KeywordParameterNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, value: Node?, location: Location) -> void # # @return [KeywordParameterNode] a new instance of KeywordParameterNode # - # source://yarp//lib/yarp/node.rb#6219 + # source://yarp//lib/yarp/node.rb#7570 def initialize(name, name_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6227 + # source://yarp//lib/yarp/node.rb#7578 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6232 + # source://yarp//lib/yarp/node.rb#7583 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6237 + # source://yarp//lib/yarp/node.rb#7595 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7588 + def compact_child_nodes; end + # def copy: (**params) -> KeywordParameterNode # - # source://yarp//lib/yarp/node.rb#6242 + # source://yarp//lib/yarp/node.rb#7600 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6232 + # source://yarp//lib/yarp/node.rb#7583 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6255 + # source://yarp//lib/yarp/node.rb#7613 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6259 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7633 + def human; end + + # source://yarp//lib/yarp/node.rb#7617 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6210 + # source://yarp//lib/yarp/node.rb#7561 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#6213 + # source://yarp//lib/yarp/node.rb#7564 def name_loc; end # attr_reader value: Node? # - # source://yarp//lib/yarp/node.rb#6216 + # source://yarp//lib/yarp/node.rb#7567 def value; end end @@ -7010,67 +8408,79 @@ end # ^^^ # end # -# source://yarp//lib/yarp/node.rb#6278 +# source://yarp//lib/yarp/node.rb#7643 class YARP::KeywordRestParameterNode < ::YARP::Node # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void # # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode # - # source://yarp//lib/yarp/node.rb#6289 + # source://yarp//lib/yarp/node.rb#7654 def initialize(name, name_loc, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6297 + # source://yarp//lib/yarp/node.rb#7662 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6302 + # source://yarp//lib/yarp/node.rb#7667 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6307 + # source://yarp//lib/yarp/node.rb#7677 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7672 + def compact_child_nodes; end + # def copy: (**params) -> KeywordRestParameterNode # - # source://yarp//lib/yarp/node.rb#6312 + # source://yarp//lib/yarp/node.rb#7682 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6302 + # source://yarp//lib/yarp/node.rb#7667 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6325 + # source://yarp//lib/yarp/node.rb#7695 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6334 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7715 + def human; end + + # source://yarp//lib/yarp/node.rb#7704 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://yarp//lib/yarp/node.rb#6280 + # source://yarp//lib/yarp/node.rb#7645 def name; end # attr_reader name_loc: Location? # - # source://yarp//lib/yarp/node.rb#6283 + # source://yarp//lib/yarp/node.rb#7648 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6330 + # source://yarp//lib/yarp/node.rb#7700 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6286 + # source://yarp//lib/yarp/node.rb#7651 def operator_loc; end end @@ -7079,92 +8489,104 @@ end # ->(value) { value * 2 } # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6347 +# source://yarp//lib/yarp/node.rb#7724 class YARP::LambdaNode < ::YARP::Node # def initialize: (locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: BlockParametersNode?, body: Node?, location: Location) -> void # # @return [LambdaNode] a new instance of LambdaNode # - # source://yarp//lib/yarp/node.rb#6367 + # source://yarp//lib/yarp/node.rb#7744 def initialize(locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6378 + # source://yarp//lib/yarp/node.rb#7755 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#6364 + # source://yarp//lib/yarp/node.rb#7741 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6383 + # source://yarp//lib/yarp/node.rb#7760 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#6424 + # source://yarp//lib/yarp/node.rb#7809 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#6358 + # source://yarp//lib/yarp/node.rb#7735 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6388 + # source://yarp//lib/yarp/node.rb#7773 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7765 + def compact_child_nodes; end + # def copy: (**params) -> LambdaNode # - # source://yarp//lib/yarp/node.rb#6393 + # source://yarp//lib/yarp/node.rb#7778 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6383 + # source://yarp//lib/yarp/node.rb#7760 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6409 + # source://yarp//lib/yarp/node.rb#7794 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6428 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7837 + def human; end + + # source://yarp//lib/yarp/node.rb#7813 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#6349 + # source://yarp//lib/yarp/node.rb#7726 def locals; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#6419 + # source://yarp//lib/yarp/node.rb#7804 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#6355 + # source://yarp//lib/yarp/node.rb#7732 def opening_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6414 + # source://yarp//lib/yarp/node.rb#7799 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6352 + # source://yarp//lib/yarp/node.rb#7729 def operator_loc; end # attr_reader parameters: BlockParametersNode? # - # source://yarp//lib/yarp/node.rb#6361 + # source://yarp//lib/yarp/node.rb#7738 def parameters; end end @@ -7398,77 +8820,89 @@ end # target &&= value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6454 +# source://yarp//lib/yarp/node.rb#7846 class YARP::LocalVariableAndWriteNode < ::YARP::Node # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void # # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#6471 + # source://yarp//lib/yarp/node.rb#7863 def initialize(name_loc, operator_loc, value, name, depth, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6481 + # source://yarp//lib/yarp/node.rb#7873 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6486 + # source://yarp//lib/yarp/node.rb#7878 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6491 + # source://yarp//lib/yarp/node.rb#7888 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7883 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableAndWriteNode # - # source://yarp//lib/yarp/node.rb#6496 + # source://yarp//lib/yarp/node.rb#7893 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6486 + # source://yarp//lib/yarp/node.rb#7878 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6511 + # source://yarp//lib/yarp/node.rb#7908 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6468 + # source://yarp//lib/yarp/node.rb#7860 def depth; end - # source://yarp//lib/yarp/node.rb#6520 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#7931 + def human; end + + # source://yarp//lib/yarp/node.rb#7917 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6465 + # source://yarp//lib/yarp/node.rb#7857 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#6456 + # source://yarp//lib/yarp/node.rb#7848 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6516 + # source://yarp//lib/yarp/node.rb#7913 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6459 + # source://yarp//lib/yarp/node.rb#7851 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6462 + # source://yarp//lib/yarp/node.rb#7854 def value; end end @@ -7477,77 +8911,89 @@ end # target += value # ^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6536 +# source://yarp//lib/yarp/node.rb#7940 class YARP::LocalVariableOperatorWriteNode < ::YARP::Node # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, operator: Symbol, depth: Integer, location: Location) -> void # # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#6556 + # source://yarp//lib/yarp/node.rb#7960 def initialize(name_loc, operator_loc, value, name, operator, depth, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6567 + # source://yarp//lib/yarp/node.rb#7971 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6572 + # source://yarp//lib/yarp/node.rb#7976 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6577 + # source://yarp//lib/yarp/node.rb#7986 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#7981 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableOperatorWriteNode # - # source://yarp//lib/yarp/node.rb#6582 + # source://yarp//lib/yarp/node.rb#7991 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6572 + # source://yarp//lib/yarp/node.rb#7976 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6598 + # source://yarp//lib/yarp/node.rb#8007 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6553 + # source://yarp//lib/yarp/node.rb#7957 def depth; end - # source://yarp//lib/yarp/node.rb#6602 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8026 + def human; end + + # source://yarp//lib/yarp/node.rb#8011 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6547 + # source://yarp//lib/yarp/node.rb#7951 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#6538 + # source://yarp//lib/yarp/node.rb#7942 def name_loc; end # attr_reader operator: Symbol # - # source://yarp//lib/yarp/node.rb#6550 + # source://yarp//lib/yarp/node.rb#7954 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6541 + # source://yarp//lib/yarp/node.rb#7945 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6544 + # source://yarp//lib/yarp/node.rb#7948 def value; end end @@ -7556,77 +9002,89 @@ end # target ||= value # ^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6619 +# source://yarp//lib/yarp/node.rb#8035 class YARP::LocalVariableOrWriteNode < ::YARP::Node # def initialize: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> void # # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#6636 + # source://yarp//lib/yarp/node.rb#8052 def initialize(name_loc, operator_loc, value, name, depth, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6646 + # source://yarp//lib/yarp/node.rb#8062 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6651 + # source://yarp//lib/yarp/node.rb#8067 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6656 + # source://yarp//lib/yarp/node.rb#8077 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8072 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableOrWriteNode # - # source://yarp//lib/yarp/node.rb#6661 + # source://yarp//lib/yarp/node.rb#8082 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6651 + # source://yarp//lib/yarp/node.rb#8067 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6676 + # source://yarp//lib/yarp/node.rb#8097 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6633 + # source://yarp//lib/yarp/node.rb#8049 def depth; end - # source://yarp//lib/yarp/node.rb#6685 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8120 + def human; end + + # source://yarp//lib/yarp/node.rb#8106 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6630 + # source://yarp//lib/yarp/node.rb#8046 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#6621 + # source://yarp//lib/yarp/node.rb#8037 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6681 + # source://yarp//lib/yarp/node.rb#8102 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6624 + # source://yarp//lib/yarp/node.rb#8040 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6627 + # source://yarp//lib/yarp/node.rb#8043 def value; end end @@ -7637,57 +9095,69 @@ end # foo # ^^^ # -# source://yarp//lib/yarp/node.rb#6703 +# source://yarp//lib/yarp/node.rb#8131 class YARP::LocalVariableReadNode < ::YARP::Node # def initialize: (name: Symbol, depth: Integer, location: Location) -> void # # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode # - # source://yarp//lib/yarp/node.rb#6711 + # source://yarp//lib/yarp/node.rb#8139 def initialize(name, depth, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6718 + # source://yarp//lib/yarp/node.rb#8146 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6723 + # source://yarp//lib/yarp/node.rb#8151 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6728 + # source://yarp//lib/yarp/node.rb#8161 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8156 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableReadNode # - # source://yarp//lib/yarp/node.rb#6733 + # source://yarp//lib/yarp/node.rb#8166 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6723 + # source://yarp//lib/yarp/node.rb#8151 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6745 + # source://yarp//lib/yarp/node.rb#8178 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6708 + # source://yarp//lib/yarp/node.rb#8136 def depth; end - # source://yarp//lib/yarp/node.rb#6749 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8192 + def human; end + + # source://yarp//lib/yarp/node.rb#8182 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6705 + # source://yarp//lib/yarp/node.rb#8133 def name; end end @@ -7696,57 +9166,69 @@ end # foo, bar = baz # ^^^ ^^^ # -# source://yarp//lib/yarp/node.rb#6761 +# source://yarp//lib/yarp/node.rb#8201 class YARP::LocalVariableTargetNode < ::YARP::Node # def initialize: (name: Symbol, depth: Integer, location: Location) -> void # # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode # - # source://yarp//lib/yarp/node.rb#6769 + # source://yarp//lib/yarp/node.rb#8209 def initialize(name, depth, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6776 + # source://yarp//lib/yarp/node.rb#8216 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6781 + # source://yarp//lib/yarp/node.rb#8221 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6786 + # source://yarp//lib/yarp/node.rb#8231 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8226 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableTargetNode # - # source://yarp//lib/yarp/node.rb#6791 + # source://yarp//lib/yarp/node.rb#8236 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6781 + # source://yarp//lib/yarp/node.rb#8221 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6803 + # source://yarp//lib/yarp/node.rb#8248 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6766 + # source://yarp//lib/yarp/node.rb#8206 def depth; end - # source://yarp//lib/yarp/node.rb#6807 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8262 + def human; end + + # source://yarp//lib/yarp/node.rb#8252 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6763 + # source://yarp//lib/yarp/node.rb#8203 def name; end end @@ -7755,77 +9237,89 @@ end # foo = 1 # ^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6819 +# source://yarp//lib/yarp/node.rb#8271 class YARP::LocalVariableWriteNode < ::YARP::Node # def initialize: (name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> void # # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode # - # source://yarp//lib/yarp/node.rb#6836 + # source://yarp//lib/yarp/node.rb#8288 def initialize(name, depth, name_loc, value, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6846 + # source://yarp//lib/yarp/node.rb#8298 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6851 + # source://yarp//lib/yarp/node.rb#8303 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6856 + # source://yarp//lib/yarp/node.rb#8313 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8308 + def compact_child_nodes; end + # def copy: (**params) -> LocalVariableWriteNode # - # source://yarp//lib/yarp/node.rb#6861 + # source://yarp//lib/yarp/node.rb#8318 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6851 + # source://yarp//lib/yarp/node.rb#8303 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6876 + # source://yarp//lib/yarp/node.rb#8333 def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://yarp//lib/yarp/node.rb#6824 + # source://yarp//lib/yarp/node.rb#8276 def depth; end - # source://yarp//lib/yarp/node.rb#6885 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8356 + def human; end + + # source://yarp//lib/yarp/node.rb#8342 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#6821 + # source://yarp//lib/yarp/node.rb#8273 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#6827 + # source://yarp//lib/yarp/node.rb#8279 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6881 + # source://yarp//lib/yarp/node.rb#8338 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6833 + # source://yarp//lib/yarp/node.rb#8285 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6830 + # source://yarp//lib/yarp/node.rb#8282 def value; end end @@ -7917,93 +9411,266 @@ class YARP::Location # source://yarp//lib/yarp.rb#48 def start_offset; end - protected + protected + + # Returns the value of attribute source. + # + # source://yarp//lib/yarp.rb#44 + def source; end + + class << self + # source://yarp//lib/yarp.rb#139 + def null; end + end +end + +# source://yarp//lib/yarp/node.rb#12917 +module YARP::LoopFlags; end + +# a loop after a begin statement, so the body is executed first before the condition +# +# source://yarp//lib/yarp/node.rb#12919 +YARP::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) + +# 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://yarp//lib/yarp/node.rb#8367 +class YARP::MatchLastLineNode < ::YARP::Node + # def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, flags: Integer, location: Location) -> void + # + # @return [MatchLastLineNode] a new instance of MatchLastLineNode + # + # source://yarp//lib/yarp/node.rb#8384 + def initialize(opening_loc, content_loc, closing_loc, unescaped, flags, location); end + + # def accept: (visitor: Visitor) -> void + # + # source://yarp//lib/yarp/node.rb#8394 + def accept(visitor); end + + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8469 + def ascii_8bit?; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#8399 + def child_nodes; end + + # def closing: () -> String + # + # source://yarp//lib/yarp/node.rb#8444 + def closing; end + + # attr_reader closing_loc: Location + # + # source://yarp//lib/yarp/node.rb#8375 + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://yarp//lib/yarp/node.rb#8409 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8404 + def compact_child_nodes; end + + # def content: () -> String + # + # source://yarp//lib/yarp/node.rb#8439 + def content; end + + # attr_reader content_loc: Location + # + # source://yarp//lib/yarp/node.rb#8372 + def content_loc; end + + # def copy: (**params) -> MatchLastLineNode + # + # source://yarp//lib/yarp/node.rb#8414 + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#8399 + def deconstruct; end + + # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # + # source://yarp//lib/yarp/node.rb#8429 + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8464 + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8454 + def extended?; end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8502 + def human; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8449 + def ignore_case?; end + + # source://yarp//lib/yarp/node.rb#8488 + def inspect(inspector = T.unsafe(nil)); end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8459 + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8484 + def once?; end + + # def opening: () -> String + # + # source://yarp//lib/yarp/node.rb#8434 + def opening; end + + # attr_reader opening_loc: Location + # + # source://yarp//lib/yarp/node.rb#8369 + def opening_loc; end + + # attr_reader unescaped: String + # + # source://yarp//lib/yarp/node.rb#8378 + def unescaped; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8479 + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#8474 + def windows_31j?; end + + private - # Returns the value of attribute source. + # Returns the value of attribute flags. # - # source://yarp//lib/yarp.rb#44 - def source; end - - class << self - # source://yarp//lib/yarp.rb#139 - def null; end - end + # source://yarp//lib/yarp/node.rb#8381 + def flags; end end -# source://yarp//lib/yarp/node.rb#10565 -module YARP::LoopFlags; end - -# a loop after a begin statement, so the body is executed first before the condition -# -# source://yarp//lib/yarp/node.rb#10567 -YARP::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) - # Represents the use of the modifier `in` operator. # # foo in bar # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6901 +# source://yarp//lib/yarp/node.rb#8511 class YARP::MatchPredicateNode < ::YARP::Node # def initialize: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> void # # @return [MatchPredicateNode] a new instance of MatchPredicateNode # - # source://yarp//lib/yarp/node.rb#6912 + # source://yarp//lib/yarp/node.rb#8522 def initialize(value, pattern, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6920 + # source://yarp//lib/yarp/node.rb#8530 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6925 + # source://yarp//lib/yarp/node.rb#8535 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#6930 + # source://yarp//lib/yarp/node.rb#8545 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8540 + def compact_child_nodes; end + # def copy: (**params) -> MatchPredicateNode # - # source://yarp//lib/yarp/node.rb#6935 + # source://yarp//lib/yarp/node.rb#8550 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6925 + # source://yarp//lib/yarp/node.rb#8535 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#6948 + # source://yarp//lib/yarp/node.rb#8563 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#6957 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8585 + def human; end + + # source://yarp//lib/yarp/node.rb#8572 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#6953 + # source://yarp//lib/yarp/node.rb#8568 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6909 + # source://yarp//lib/yarp/node.rb#8519 def operator_loc; end # attr_reader pattern: Node # - # source://yarp//lib/yarp/node.rb#6906 + # source://yarp//lib/yarp/node.rb#8516 def pattern; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6903 + # source://yarp//lib/yarp/node.rb#8513 def value; end end @@ -8012,114 +9679,210 @@ end # foo => bar # ^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#6972 +# source://yarp//lib/yarp/node.rb#8594 class YARP::MatchRequiredNode < ::YARP::Node # def initialize: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> void # # @return [MatchRequiredNode] a new instance of MatchRequiredNode # - # source://yarp//lib/yarp/node.rb#6983 + # source://yarp//lib/yarp/node.rb#8605 def initialize(value, pattern, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#6991 + # source://yarp//lib/yarp/node.rb#8613 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6996 + # source://yarp//lib/yarp/node.rb#8618 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7001 + # source://yarp//lib/yarp/node.rb#8628 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8623 + def compact_child_nodes; end + # def copy: (**params) -> MatchRequiredNode # - # source://yarp//lib/yarp/node.rb#7006 + # source://yarp//lib/yarp/node.rb#8633 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#6996 + # source://yarp//lib/yarp/node.rb#8618 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7019 + # source://yarp//lib/yarp/node.rb#8646 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7028 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8668 + def human; end + + # source://yarp//lib/yarp/node.rb#8655 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7024 + # source://yarp//lib/yarp/node.rb#8651 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#6980 + # source://yarp//lib/yarp/node.rb#8602 def operator_loc; end # attr_reader pattern: Node # - # source://yarp//lib/yarp/node.rb#6977 + # source://yarp//lib/yarp/node.rb#8599 def pattern; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#6974 + # source://yarp//lib/yarp/node.rb#8596 def value; end end +# Represents writing local variables using a regular expression match with +# named capture groups. +# +# /(?bar)/ =~ baz +# ^^^^^^^^^^^^^^^^^^^^ +# +# source://yarp//lib/yarp/node.rb#8678 +class YARP::MatchWriteNode < ::YARP::Node + # def initialize: (call: CallNode, locals: Array[Symbol], location: Location) -> void + # + # @return [MatchWriteNode] a new instance of MatchWriteNode + # + # source://yarp//lib/yarp/node.rb#8686 + def initialize(call, locals, location); end + + # def accept: (visitor: Visitor) -> void + # + # source://yarp//lib/yarp/node.rb#8693 + def accept(visitor); end + + # attr_reader call: CallNode + # + # source://yarp//lib/yarp/node.rb#8680 + def call; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#8698 + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://yarp//lib/yarp/node.rb#8708 + def comment_targets; end + + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8703 + def compact_child_nodes; end + + # def copy: (**params) -> MatchWriteNode + # + # source://yarp//lib/yarp/node.rb#8713 + def copy(**params); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://yarp//lib/yarp/node.rb#8698 + def deconstruct; end + + # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] + # + # source://yarp//lib/yarp/node.rb#8725 + def deconstruct_keys(keys); end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8740 + def human; end + + # source://yarp//lib/yarp/node.rb#8729 + def inspect(inspector = T.unsafe(nil)); end + + # attr_reader locals: Array[Symbol] + # + # source://yarp//lib/yarp/node.rb#8683 + def locals; end +end + # Represents a node that is missing from the source and results in a syntax # error. # -# source://yarp//lib/yarp/node.rb#7041 +# source://yarp//lib/yarp/node.rb#8747 class YARP::MissingNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [MissingNode] a new instance of MissingNode # - # source://yarp//lib/yarp/node.rb#7043 + # source://yarp//lib/yarp/node.rb#8749 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7048 + # source://yarp//lib/yarp/node.rb#8754 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7053 + # source://yarp//lib/yarp/node.rb#8759 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7058 + # source://yarp//lib/yarp/node.rb#8769 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8764 + def compact_child_nodes; end + # def copy: (**params) -> MissingNode # - # source://yarp//lib/yarp/node.rb#7063 + # source://yarp//lib/yarp/node.rb#8774 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7053 + # source://yarp//lib/yarp/node.rb#8759 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7073 + # source://yarp//lib/yarp/node.rb#8784 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7077 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8796 + def human; end + + # source://yarp//lib/yarp/node.rb#8788 def inspect(inspector = T.unsafe(nil)); end end @@ -8128,87 +9891,99 @@ end # module Foo end # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#7087 +# source://yarp//lib/yarp/node.rb#8805 class YARP::ModuleNode < ::YARP::Node # def initialize: (locals: Array[Symbol], module_keyword_loc: Location, constant_path: Node, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location) -> void # # @return [ModuleNode] a new instance of ModuleNode # - # source://yarp//lib/yarp/node.rb#7107 + # source://yarp//lib/yarp/node.rb#8825 def initialize(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7118 + # source://yarp//lib/yarp/node.rb#8836 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#7098 + # source://yarp//lib/yarp/node.rb#8816 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7123 + # source://yarp//lib/yarp/node.rb#8841 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7128 + # source://yarp//lib/yarp/node.rb#8854 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8846 + def compact_child_nodes; end + # attr_reader constant_path: Node # - # source://yarp//lib/yarp/node.rb#7095 + # source://yarp//lib/yarp/node.rb#8813 def constant_path; end # def copy: (**params) -> ModuleNode # - # source://yarp//lib/yarp/node.rb#7133 + # source://yarp//lib/yarp/node.rb#8859 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7123 + # source://yarp//lib/yarp/node.rb#8841 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7149 + # source://yarp//lib/yarp/node.rb#8875 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#7159 + # source://yarp//lib/yarp/node.rb#8885 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#7101 + # source://yarp//lib/yarp/node.rb#8819 def end_keyword_loc; end - # source://yarp//lib/yarp/node.rb#7163 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8909 + def human; end + + # source://yarp//lib/yarp/node.rb#8889 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#7089 + # source://yarp//lib/yarp/node.rb#8807 def locals; end # def module_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#7154 + # source://yarp//lib/yarp/node.rb#8880 def module_keyword; end # attr_reader module_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#7092 + # source://yarp//lib/yarp/node.rb#8810 def module_keyword_loc; end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#7104 + # source://yarp//lib/yarp/node.rb#8822 def name; end end @@ -8217,72 +9992,84 @@ end # a, b, c = 1, 2, 3 # ^^^^^^^ # -# source://yarp//lib/yarp/node.rb#7185 +# source://yarp//lib/yarp/node.rb#8918 class YARP::MultiTargetNode < ::YARP::Node # def initialize: (targets: Array[Node], lparen_loc: Location?, rparen_loc: Location?, location: Location) -> void # # @return [MultiTargetNode] a new instance of MultiTargetNode # - # source://yarp//lib/yarp/node.rb#7196 + # source://yarp//lib/yarp/node.rb#8929 def initialize(targets, lparen_loc, rparen_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7204 + # source://yarp//lib/yarp/node.rb#8937 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7209 + # source://yarp//lib/yarp/node.rb#8942 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7214 + # source://yarp//lib/yarp/node.rb#8952 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#8947 + def compact_child_nodes; end + # def copy: (**params) -> MultiTargetNode # - # source://yarp//lib/yarp/node.rb#7219 + # source://yarp//lib/yarp/node.rb#8957 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7209 + # source://yarp//lib/yarp/node.rb#8942 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7232 + # source://yarp//lib/yarp/node.rb#8970 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7246 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#8995 + def human; end + + # source://yarp//lib/yarp/node.rb#8984 def inspect(inspector = T.unsafe(nil)); end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#7237 + # source://yarp//lib/yarp/node.rb#8975 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#7190 + # source://yarp//lib/yarp/node.rb#8923 def lparen_loc; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#7242 + # source://yarp//lib/yarp/node.rb#8980 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#7193 + # source://yarp//lib/yarp/node.rb#8926 def rparen_loc; end # attr_reader targets: Array[Node] # - # source://yarp//lib/yarp/node.rb#7187 + # source://yarp//lib/yarp/node.rb#8920 def targets; end end @@ -8291,87 +10078,99 @@ end # a, b, c = 1, 2, 3 # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#7259 +# source://yarp//lib/yarp/node.rb#9004 class YARP::MultiWriteNode < ::YARP::Node # def initialize: (targets: Array[Node], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Node, location: Location) -> void # # @return [MultiWriteNode] a new instance of MultiWriteNode # - # source://yarp//lib/yarp/node.rb#7276 + # source://yarp//lib/yarp/node.rb#9021 def initialize(targets, lparen_loc, rparen_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7286 + # source://yarp//lib/yarp/node.rb#9031 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7291 + # source://yarp//lib/yarp/node.rb#9036 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7296 + # source://yarp//lib/yarp/node.rb#9046 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9041 + def compact_child_nodes; end + # def copy: (**params) -> MultiWriteNode # - # source://yarp//lib/yarp/node.rb#7301 + # source://yarp//lib/yarp/node.rb#9051 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7291 + # source://yarp//lib/yarp/node.rb#9036 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7316 + # source://yarp//lib/yarp/node.rb#9066 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7335 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9099 + def human; end + + # source://yarp//lib/yarp/node.rb#9085 def inspect(inspector = T.unsafe(nil)); end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#7321 + # source://yarp//lib/yarp/node.rb#9071 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#7264 + # source://yarp//lib/yarp/node.rb#9009 def lparen_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7331 + # source://yarp//lib/yarp/node.rb#9081 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#7270 + # source://yarp//lib/yarp/node.rb#9015 def operator_loc; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#7326 + # source://yarp//lib/yarp/node.rb#9076 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#7267 + # source://yarp//lib/yarp/node.rb#9012 def rparen_loc; end # attr_reader targets: Array[Node] # - # source://yarp//lib/yarp/node.rb#7261 + # source://yarp//lib/yarp/node.rb#9006 def targets; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#7273 + # source://yarp//lib/yarp/node.rb#9018 def value; end end @@ -8381,684 +10180,709 @@ end # # source://yarp//lib/yarp/mutation_visitor.rb#12 class YARP::MutationVisitor < ::YARP::BasicVisitor - # Copy a AliasNode node + # Copy a AliasGlobalVariableNode node # # source://yarp//lib/yarp/mutation_visitor.rb#14 - def visit_alias_node(node); end + def visit_alias_global_variable_node(node); end - # Copy a AlternationPatternNode node + # Copy a AliasMethodNode node # # source://yarp//lib/yarp/mutation_visitor.rb#19 + def visit_alias_method_node(node); end + + # Copy a AlternationPatternNode node + # + # source://yarp//lib/yarp/mutation_visitor.rb#24 def visit_alternation_pattern_node(node); end # Copy a AndNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#24 + # source://yarp//lib/yarp/mutation_visitor.rb#29 def visit_and_node(node); end # Copy a ArgumentsNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#29 + # source://yarp//lib/yarp/mutation_visitor.rb#34 def visit_arguments_node(node); end # Copy a ArrayNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#34 + # source://yarp//lib/yarp/mutation_visitor.rb#39 def visit_array_node(node); end # Copy a ArrayPatternNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#39 + # source://yarp//lib/yarp/mutation_visitor.rb#44 def visit_array_pattern_node(node); end # Copy a AssocNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#44 + # source://yarp//lib/yarp/mutation_visitor.rb#49 def visit_assoc_node(node); end # Copy a AssocSplatNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#49 + # source://yarp//lib/yarp/mutation_visitor.rb#54 def visit_assoc_splat_node(node); end # Copy a BackReferenceReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#54 + # source://yarp//lib/yarp/mutation_visitor.rb#59 def visit_back_reference_read_node(node); end # Copy a BeginNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#59 + # source://yarp//lib/yarp/mutation_visitor.rb#64 def visit_begin_node(node); end # Copy a BlockArgumentNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#64 + # source://yarp//lib/yarp/mutation_visitor.rb#69 def visit_block_argument_node(node); end # Copy a BlockLocalVariableNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#69 + # source://yarp//lib/yarp/mutation_visitor.rb#74 def visit_block_local_variable_node(node); end # Copy a BlockNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#74 + # source://yarp//lib/yarp/mutation_visitor.rb#79 def visit_block_node(node); end # Copy a BlockParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#79 + # source://yarp//lib/yarp/mutation_visitor.rb#84 def visit_block_parameter_node(node); end # Copy a BlockParametersNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#84 + # source://yarp//lib/yarp/mutation_visitor.rb#89 def visit_block_parameters_node(node); end # Copy a BreakNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#89 + # source://yarp//lib/yarp/mutation_visitor.rb#94 def visit_break_node(node); end # Copy a CallAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#94 + # source://yarp//lib/yarp/mutation_visitor.rb#99 def visit_call_and_write_node(node); end # Copy a CallNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#99 + # source://yarp//lib/yarp/mutation_visitor.rb#104 def visit_call_node(node); end # Copy a CallOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#104 + # source://yarp//lib/yarp/mutation_visitor.rb#109 def visit_call_operator_write_node(node); end # Copy a CallOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#109 + # source://yarp//lib/yarp/mutation_visitor.rb#114 def visit_call_or_write_node(node); end # Copy a CapturePatternNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#114 + # source://yarp//lib/yarp/mutation_visitor.rb#119 def visit_capture_pattern_node(node); end # Copy a CaseNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#119 + # source://yarp//lib/yarp/mutation_visitor.rb#124 def visit_case_node(node); end # Copy a ClassNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#124 + # source://yarp//lib/yarp/mutation_visitor.rb#129 def visit_class_node(node); end # Copy a ClassVariableAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#129 + # source://yarp//lib/yarp/mutation_visitor.rb#134 def visit_class_variable_and_write_node(node); end # Copy a ClassVariableOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#134 + # source://yarp//lib/yarp/mutation_visitor.rb#139 def visit_class_variable_operator_write_node(node); end # Copy a ClassVariableOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#139 + # source://yarp//lib/yarp/mutation_visitor.rb#144 def visit_class_variable_or_write_node(node); end # Copy a ClassVariableReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#144 + # source://yarp//lib/yarp/mutation_visitor.rb#149 def visit_class_variable_read_node(node); end # Copy a ClassVariableTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#149 + # source://yarp//lib/yarp/mutation_visitor.rb#154 def visit_class_variable_target_node(node); end # Copy a ClassVariableWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#154 + # source://yarp//lib/yarp/mutation_visitor.rb#159 def visit_class_variable_write_node(node); end # Copy a ConstantAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#159 + # source://yarp//lib/yarp/mutation_visitor.rb#164 def visit_constant_and_write_node(node); end # Copy a ConstantOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#164 + # source://yarp//lib/yarp/mutation_visitor.rb#169 def visit_constant_operator_write_node(node); end # Copy a ConstantOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#169 + # source://yarp//lib/yarp/mutation_visitor.rb#174 def visit_constant_or_write_node(node); end # Copy a ConstantPathAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#174 + # source://yarp//lib/yarp/mutation_visitor.rb#179 def visit_constant_path_and_write_node(node); end # Copy a ConstantPathNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#179 + # source://yarp//lib/yarp/mutation_visitor.rb#184 def visit_constant_path_node(node); end # Copy a ConstantPathOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#184 + # source://yarp//lib/yarp/mutation_visitor.rb#189 def visit_constant_path_operator_write_node(node); end # Copy a ConstantPathOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#189 + # source://yarp//lib/yarp/mutation_visitor.rb#194 def visit_constant_path_or_write_node(node); end # Copy a ConstantPathTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#194 + # source://yarp//lib/yarp/mutation_visitor.rb#199 def visit_constant_path_target_node(node); end # Copy a ConstantPathWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#199 + # source://yarp//lib/yarp/mutation_visitor.rb#204 def visit_constant_path_write_node(node); end # Copy a ConstantReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#204 + # source://yarp//lib/yarp/mutation_visitor.rb#209 def visit_constant_read_node(node); end # Copy a ConstantTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#209 + # source://yarp//lib/yarp/mutation_visitor.rb#214 def visit_constant_target_node(node); end # Copy a ConstantWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#214 + # source://yarp//lib/yarp/mutation_visitor.rb#219 def visit_constant_write_node(node); end # Copy a DefNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#219 + # source://yarp//lib/yarp/mutation_visitor.rb#224 def visit_def_node(node); end # Copy a DefinedNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#224 + # source://yarp//lib/yarp/mutation_visitor.rb#229 def visit_defined_node(node); end # Copy a ElseNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#229 + # source://yarp//lib/yarp/mutation_visitor.rb#234 def visit_else_node(node); end # Copy a EmbeddedStatementsNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#234 + # source://yarp//lib/yarp/mutation_visitor.rb#239 def visit_embedded_statements_node(node); end # Copy a EmbeddedVariableNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#239 + # source://yarp//lib/yarp/mutation_visitor.rb#244 def visit_embedded_variable_node(node); end # Copy a EnsureNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#244 + # source://yarp//lib/yarp/mutation_visitor.rb#249 def visit_ensure_node(node); end # Copy a FalseNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#249 + # source://yarp//lib/yarp/mutation_visitor.rb#254 def visit_false_node(node); end # Copy a FindPatternNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#254 + # source://yarp//lib/yarp/mutation_visitor.rb#259 def visit_find_pattern_node(node); end # Copy a FlipFlopNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#259 + # source://yarp//lib/yarp/mutation_visitor.rb#264 def visit_flip_flop_node(node); end # Copy a FloatNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#264 + # source://yarp//lib/yarp/mutation_visitor.rb#269 def visit_float_node(node); end # Copy a ForNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#269 + # source://yarp//lib/yarp/mutation_visitor.rb#274 def visit_for_node(node); end # Copy a ForwardingArgumentsNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#274 + # source://yarp//lib/yarp/mutation_visitor.rb#279 def visit_forwarding_arguments_node(node); end # Copy a ForwardingParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#279 + # source://yarp//lib/yarp/mutation_visitor.rb#284 def visit_forwarding_parameter_node(node); end # Copy a ForwardingSuperNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#284 + # source://yarp//lib/yarp/mutation_visitor.rb#289 def visit_forwarding_super_node(node); end # Copy a GlobalVariableAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#289 + # source://yarp//lib/yarp/mutation_visitor.rb#294 def visit_global_variable_and_write_node(node); end # Copy a GlobalVariableOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#294 + # source://yarp//lib/yarp/mutation_visitor.rb#299 def visit_global_variable_operator_write_node(node); end # Copy a GlobalVariableOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#299 + # source://yarp//lib/yarp/mutation_visitor.rb#304 def visit_global_variable_or_write_node(node); end # Copy a GlobalVariableReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#304 + # source://yarp//lib/yarp/mutation_visitor.rb#309 def visit_global_variable_read_node(node); end # Copy a GlobalVariableTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#309 + # source://yarp//lib/yarp/mutation_visitor.rb#314 def visit_global_variable_target_node(node); end # Copy a GlobalVariableWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#314 + # source://yarp//lib/yarp/mutation_visitor.rb#319 def visit_global_variable_write_node(node); end # Copy a HashNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#319 + # source://yarp//lib/yarp/mutation_visitor.rb#324 def visit_hash_node(node); end # Copy a HashPatternNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#324 + # source://yarp//lib/yarp/mutation_visitor.rb#329 def visit_hash_pattern_node(node); end # Copy a IfNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#329 + # source://yarp//lib/yarp/mutation_visitor.rb#334 def visit_if_node(node); end # Copy a ImaginaryNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#334 + # source://yarp//lib/yarp/mutation_visitor.rb#339 def visit_imaginary_node(node); end + # Copy a ImplicitNode node + # + # source://yarp//lib/yarp/mutation_visitor.rb#344 + def visit_implicit_node(node); end + # Copy a InNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#339 + # source://yarp//lib/yarp/mutation_visitor.rb#349 def visit_in_node(node); end # Copy a InstanceVariableAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#344 + # source://yarp//lib/yarp/mutation_visitor.rb#354 def visit_instance_variable_and_write_node(node); end # Copy a InstanceVariableOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#349 + # source://yarp//lib/yarp/mutation_visitor.rb#359 def visit_instance_variable_operator_write_node(node); end # Copy a InstanceVariableOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#354 + # source://yarp//lib/yarp/mutation_visitor.rb#364 def visit_instance_variable_or_write_node(node); end # Copy a InstanceVariableReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#359 + # source://yarp//lib/yarp/mutation_visitor.rb#369 def visit_instance_variable_read_node(node); end # Copy a InstanceVariableTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#364 + # source://yarp//lib/yarp/mutation_visitor.rb#374 def visit_instance_variable_target_node(node); end # Copy a InstanceVariableWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#369 + # source://yarp//lib/yarp/mutation_visitor.rb#379 def visit_instance_variable_write_node(node); end # Copy a IntegerNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#374 + # source://yarp//lib/yarp/mutation_visitor.rb#384 def visit_integer_node(node); end + # Copy a InterpolatedMatchLastLineNode node + # + # source://yarp//lib/yarp/mutation_visitor.rb#389 + def visit_interpolated_match_last_line_node(node); end + # Copy a InterpolatedRegularExpressionNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#379 + # source://yarp//lib/yarp/mutation_visitor.rb#394 def visit_interpolated_regular_expression_node(node); end # Copy a InterpolatedStringNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#384 + # source://yarp//lib/yarp/mutation_visitor.rb#399 def visit_interpolated_string_node(node); end # Copy a InterpolatedSymbolNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#389 + # source://yarp//lib/yarp/mutation_visitor.rb#404 def visit_interpolated_symbol_node(node); end # Copy a InterpolatedXStringNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#394 + # source://yarp//lib/yarp/mutation_visitor.rb#409 def visit_interpolated_x_string_node(node); end # Copy a KeywordHashNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#399 + # source://yarp//lib/yarp/mutation_visitor.rb#414 def visit_keyword_hash_node(node); end # Copy a KeywordParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#404 + # source://yarp//lib/yarp/mutation_visitor.rb#419 def visit_keyword_parameter_node(node); end # Copy a KeywordRestParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#409 + # source://yarp//lib/yarp/mutation_visitor.rb#424 def visit_keyword_rest_parameter_node(node); end # Copy a LambdaNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#414 + # source://yarp//lib/yarp/mutation_visitor.rb#429 def visit_lambda_node(node); end # Copy a LocalVariableAndWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#419 + # source://yarp//lib/yarp/mutation_visitor.rb#434 def visit_local_variable_and_write_node(node); end # Copy a LocalVariableOperatorWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#424 + # source://yarp//lib/yarp/mutation_visitor.rb#439 def visit_local_variable_operator_write_node(node); end # Copy a LocalVariableOrWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#429 + # source://yarp//lib/yarp/mutation_visitor.rb#444 def visit_local_variable_or_write_node(node); end # Copy a LocalVariableReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#434 + # source://yarp//lib/yarp/mutation_visitor.rb#449 def visit_local_variable_read_node(node); end # Copy a LocalVariableTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#439 + # source://yarp//lib/yarp/mutation_visitor.rb#454 def visit_local_variable_target_node(node); end # Copy a LocalVariableWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#444 + # source://yarp//lib/yarp/mutation_visitor.rb#459 def visit_local_variable_write_node(node); end + # Copy a MatchLastLineNode node + # + # source://yarp//lib/yarp/mutation_visitor.rb#464 + def visit_match_last_line_node(node); end + # Copy a MatchPredicateNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#449 + # source://yarp//lib/yarp/mutation_visitor.rb#469 def visit_match_predicate_node(node); end # Copy a MatchRequiredNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#454 + # source://yarp//lib/yarp/mutation_visitor.rb#474 def visit_match_required_node(node); end + # Copy a MatchWriteNode node + # + # source://yarp//lib/yarp/mutation_visitor.rb#479 + def visit_match_write_node(node); end + # Copy a MissingNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#459 + # source://yarp//lib/yarp/mutation_visitor.rb#484 def visit_missing_node(node); end # Copy a ModuleNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#464 + # source://yarp//lib/yarp/mutation_visitor.rb#489 def visit_module_node(node); end # Copy a MultiTargetNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#469 + # source://yarp//lib/yarp/mutation_visitor.rb#494 def visit_multi_target_node(node); end # Copy a MultiWriteNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#474 + # source://yarp//lib/yarp/mutation_visitor.rb#499 def visit_multi_write_node(node); end # Copy a NextNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#479 + # source://yarp//lib/yarp/mutation_visitor.rb#504 def visit_next_node(node); end # Copy a NilNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#484 + # source://yarp//lib/yarp/mutation_visitor.rb#509 def visit_nil_node(node); end # Copy a NoKeywordsParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#489 + # source://yarp//lib/yarp/mutation_visitor.rb#514 def visit_no_keywords_parameter_node(node); end # Copy a NumberedReferenceReadNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#494 + # source://yarp//lib/yarp/mutation_visitor.rb#519 def visit_numbered_reference_read_node(node); end # Copy a OptionalParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#499 + # source://yarp//lib/yarp/mutation_visitor.rb#524 def visit_optional_parameter_node(node); end # Copy a OrNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#504 + # source://yarp//lib/yarp/mutation_visitor.rb#529 def visit_or_node(node); end # Copy a ParametersNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#509 + # source://yarp//lib/yarp/mutation_visitor.rb#534 def visit_parameters_node(node); end # Copy a ParenthesesNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#514 + # source://yarp//lib/yarp/mutation_visitor.rb#539 def visit_parentheses_node(node); end # Copy a PinnedExpressionNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#519 + # source://yarp//lib/yarp/mutation_visitor.rb#544 def visit_pinned_expression_node(node); end # Copy a PinnedVariableNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#524 + # source://yarp//lib/yarp/mutation_visitor.rb#549 def visit_pinned_variable_node(node); end # Copy a PostExecutionNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#529 + # source://yarp//lib/yarp/mutation_visitor.rb#554 def visit_post_execution_node(node); end # Copy a PreExecutionNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#534 + # source://yarp//lib/yarp/mutation_visitor.rb#559 def visit_pre_execution_node(node); end # Copy a ProgramNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#539 + # source://yarp//lib/yarp/mutation_visitor.rb#564 def visit_program_node(node); end # Copy a RangeNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#544 + # source://yarp//lib/yarp/mutation_visitor.rb#569 def visit_range_node(node); end # Copy a RationalNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#549 + # source://yarp//lib/yarp/mutation_visitor.rb#574 def visit_rational_node(node); end # Copy a RedoNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#554 + # source://yarp//lib/yarp/mutation_visitor.rb#579 def visit_redo_node(node); end # Copy a RegularExpressionNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#559 + # source://yarp//lib/yarp/mutation_visitor.rb#584 def visit_regular_expression_node(node); end # Copy a RequiredDestructuredParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#564 + # source://yarp//lib/yarp/mutation_visitor.rb#589 def visit_required_destructured_parameter_node(node); end # Copy a RequiredParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#569 + # source://yarp//lib/yarp/mutation_visitor.rb#594 def visit_required_parameter_node(node); end # Copy a RescueModifierNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#574 + # source://yarp//lib/yarp/mutation_visitor.rb#599 def visit_rescue_modifier_node(node); end # Copy a RescueNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#579 + # source://yarp//lib/yarp/mutation_visitor.rb#604 def visit_rescue_node(node); end # Copy a RestParameterNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#584 + # source://yarp//lib/yarp/mutation_visitor.rb#609 def visit_rest_parameter_node(node); end # Copy a RetryNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#589 + # source://yarp//lib/yarp/mutation_visitor.rb#614 def visit_retry_node(node); end # Copy a ReturnNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#594 + # source://yarp//lib/yarp/mutation_visitor.rb#619 def visit_return_node(node); end # Copy a SelfNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#599 + # source://yarp//lib/yarp/mutation_visitor.rb#624 def visit_self_node(node); end # Copy a SingletonClassNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#604 + # source://yarp//lib/yarp/mutation_visitor.rb#629 def visit_singleton_class_node(node); end # Copy a SourceEncodingNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#609 + # source://yarp//lib/yarp/mutation_visitor.rb#634 def visit_source_encoding_node(node); end # Copy a SourceFileNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#614 + # source://yarp//lib/yarp/mutation_visitor.rb#639 def visit_source_file_node(node); end # Copy a SourceLineNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#619 + # source://yarp//lib/yarp/mutation_visitor.rb#644 def visit_source_line_node(node); end # Copy a SplatNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#624 + # source://yarp//lib/yarp/mutation_visitor.rb#649 def visit_splat_node(node); end # Copy a StatementsNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#629 + # source://yarp//lib/yarp/mutation_visitor.rb#654 def visit_statements_node(node); end # Copy a StringConcatNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#634 + # source://yarp//lib/yarp/mutation_visitor.rb#659 def visit_string_concat_node(node); end # Copy a StringNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#639 + # source://yarp//lib/yarp/mutation_visitor.rb#664 def visit_string_node(node); end # Copy a SuperNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#644 + # source://yarp//lib/yarp/mutation_visitor.rb#669 def visit_super_node(node); end # Copy a SymbolNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#649 + # source://yarp//lib/yarp/mutation_visitor.rb#674 def visit_symbol_node(node); end # Copy a TrueNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#654 + # source://yarp//lib/yarp/mutation_visitor.rb#679 def visit_true_node(node); end # Copy a UndefNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#659 + # source://yarp//lib/yarp/mutation_visitor.rb#684 def visit_undef_node(node); end # Copy a UnlessNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#664 + # source://yarp//lib/yarp/mutation_visitor.rb#689 def visit_unless_node(node); end # Copy a UntilNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#669 + # source://yarp//lib/yarp/mutation_visitor.rb#694 def visit_until_node(node); end # Copy a WhenNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#674 + # source://yarp//lib/yarp/mutation_visitor.rb#699 def visit_when_node(node); end # Copy a WhileNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#679 + # source://yarp//lib/yarp/mutation_visitor.rb#704 def visit_while_node(node); end # Copy a XStringNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#684 + # source://yarp//lib/yarp/mutation_visitor.rb#709 def visit_x_string_node(node); end # Copy a YieldNode node # - # source://yarp//lib/yarp/mutation_visitor.rb#689 + # source://yarp//lib/yarp/mutation_visitor.rb#714 def visit_yield_node(node); end end @@ -9067,62 +10891,74 @@ end # next 1 # ^^^^^^ # -# source://yarp//lib/yarp/node.rb#7351 +# source://yarp//lib/yarp/node.rb#9108 class YARP::NextNode < ::YARP::Node # def initialize: (arguments: ArgumentsNode?, keyword_loc: Location, location: Location) -> void # # @return [NextNode] a new instance of NextNode # - # source://yarp//lib/yarp/node.rb#7359 + # source://yarp//lib/yarp/node.rb#9116 def initialize(arguments, keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7366 + # source://yarp//lib/yarp/node.rb#9123 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#7353 + # source://yarp//lib/yarp/node.rb#9110 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7371 + # source://yarp//lib/yarp/node.rb#9128 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7376 + # source://yarp//lib/yarp/node.rb#9140 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9133 + def compact_child_nodes; end + # def copy: (**params) -> NextNode # - # source://yarp//lib/yarp/node.rb#7381 + # source://yarp//lib/yarp/node.rb#9145 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7371 + # source://yarp//lib/yarp/node.rb#9128 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7393 + # source://yarp//lib/yarp/node.rb#9157 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7402 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9181 + def human; end + + # source://yarp//lib/yarp/node.rb#9166 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#7398 + # source://yarp//lib/yarp/node.rb#9162 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#7356 + # source://yarp//lib/yarp/node.rb#9113 def keyword_loc; end end @@ -9131,47 +10967,59 @@ end # nil # ^^^ # -# source://yarp//lib/yarp/node.rb#7419 +# source://yarp//lib/yarp/node.rb#9190 class YARP::NilNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [NilNode] a new instance of NilNode # - # source://yarp//lib/yarp/node.rb#7421 + # source://yarp//lib/yarp/node.rb#9192 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7426 + # source://yarp//lib/yarp/node.rb#9197 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7431 + # source://yarp//lib/yarp/node.rb#9202 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7436 + # source://yarp//lib/yarp/node.rb#9212 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9207 + def compact_child_nodes; end + # def copy: (**params) -> NilNode # - # source://yarp//lib/yarp/node.rb#7441 + # source://yarp//lib/yarp/node.rb#9217 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7431 + # source://yarp//lib/yarp/node.rb#9202 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7451 + # source://yarp//lib/yarp/node.rb#9227 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7455 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9239 + def human; end + + # source://yarp//lib/yarp/node.rb#9231 def inspect(inspector = T.unsafe(nil)); end end @@ -9181,67 +11029,79 @@ end # ^^^^^ # end # -# source://yarp//lib/yarp/node.rb#7466 +# source://yarp//lib/yarp/node.rb#9249 class YARP::NoKeywordsParameterNode < ::YARP::Node # def initialize: (operator_loc: Location, keyword_loc: Location, location: Location) -> void # # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode # - # source://yarp//lib/yarp/node.rb#7474 + # source://yarp//lib/yarp/node.rb#9257 def initialize(operator_loc, keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7481 + # source://yarp//lib/yarp/node.rb#9264 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7486 + # source://yarp//lib/yarp/node.rb#9269 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7491 + # source://yarp//lib/yarp/node.rb#9279 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9274 + def compact_child_nodes; end + # def copy: (**params) -> NoKeywordsParameterNode # - # source://yarp//lib/yarp/node.rb#7496 + # source://yarp//lib/yarp/node.rb#9284 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7486 + # source://yarp//lib/yarp/node.rb#9269 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7508 + # source://yarp//lib/yarp/node.rb#9296 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7522 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9320 + def human; end + + # source://yarp//lib/yarp/node.rb#9310 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#7518 + # source://yarp//lib/yarp/node.rb#9306 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#7471 + # source://yarp//lib/yarp/node.rb#9254 def keyword_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7513 + # source://yarp//lib/yarp/node.rb#9301 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#7468 + # source://yarp//lib/yarp/node.rb#9251 def operator_loc; end end @@ -9274,58 +11134,58 @@ end # This object is responsible for generating the output for the inspect method # implementations of child nodes. # -# source://yarp//lib/yarp.rb#329 +# source://yarp//lib/yarp.rb#316 class YARP::NodeInspector # @return [NodeInspector] a new instance of NodeInspector # - # source://yarp//lib/yarp.rb#332 + # source://yarp//lib/yarp.rb#319 def initialize(prefix = T.unsafe(nil)); end # Appends a line to the output with the current prefix. # - # source://yarp//lib/yarp.rb#338 + # source://yarp//lib/yarp.rb#325 def <<(line); end # Returns a new inspector that can be used to inspect a child node. # - # source://yarp//lib/yarp.rb#382 + # source://yarp//lib/yarp.rb#369 def child_inspector(append); end # Generates a string that represents a child node. # - # source://yarp//lib/yarp.rb#377 + # source://yarp//lib/yarp.rb#364 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://yarp//lib/yarp.rb#344 + # source://yarp//lib/yarp.rb#331 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://yarp//lib/yarp.rb#354 + # source://yarp//lib/yarp.rb#341 def list(prefix, nodes); end # Generates a string that represents a location field on a node. # - # source://yarp//lib/yarp.rb#368 + # source://yarp//lib/yarp.rb#355 def location(value); end # Returns the value of attribute output. # - # source://yarp//lib/yarp.rb#330 + # source://yarp//lib/yarp.rb#317 def output; end # Returns the value of attribute prefix. # - # source://yarp//lib/yarp.rb#330 + # source://yarp//lib/yarp.rb#317 def prefix; end # Returns the output as a string. # - # source://yarp//lib/yarp.rb#387 + # source://yarp//lib/yarp.rb#374 def to_str; end end @@ -9334,52 +11194,64 @@ end # $1 # ^^ # -# source://yarp//lib/yarp/node.rb#7534 +# source://yarp//lib/yarp/node.rb#9329 class YARP::NumberedReferenceReadNode < ::YARP::Node # def initialize: (number: Integer, location: Location) -> void # # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode # - # source://yarp//lib/yarp/node.rb#7539 + # source://yarp//lib/yarp/node.rb#9334 def initialize(number, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7545 + # source://yarp//lib/yarp/node.rb#9340 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7550 + # source://yarp//lib/yarp/node.rb#9345 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7555 + # source://yarp//lib/yarp/node.rb#9355 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9350 + def compact_child_nodes; end + # def copy: (**params) -> NumberedReferenceReadNode # - # source://yarp//lib/yarp/node.rb#7560 + # source://yarp//lib/yarp/node.rb#9360 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7550 + # source://yarp//lib/yarp/node.rb#9345 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7571 + # source://yarp//lib/yarp/node.rb#9371 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7575 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9384 + def human; end + + # source://yarp//lib/yarp/node.rb#9375 def inspect(inspector = T.unsafe(nil)); end # attr_reader number: Integer # - # source://yarp//lib/yarp/node.rb#7536 + # source://yarp//lib/yarp/node.rb#9331 def number; end end @@ -9389,72 +11261,84 @@ end # ^^^^^ # end # -# source://yarp//lib/yarp/node.rb#7587 +# source://yarp//lib/yarp/node.rb#9394 class YARP::OptionalParameterNode < ::YARP::Node # def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> void # # @return [OptionalParameterNode] a new instance of OptionalParameterNode # - # source://yarp//lib/yarp/node.rb#7601 + # source://yarp//lib/yarp/node.rb#9408 def initialize(name, name_loc, operator_loc, value, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7610 + # source://yarp//lib/yarp/node.rb#9417 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7615 + # source://yarp//lib/yarp/node.rb#9422 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7620 + # source://yarp//lib/yarp/node.rb#9432 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9427 + def compact_child_nodes; end + # def copy: (**params) -> OptionalParameterNode # - # source://yarp//lib/yarp/node.rb#7625 + # source://yarp//lib/yarp/node.rb#9437 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7615 + # source://yarp//lib/yarp/node.rb#9422 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7639 + # source://yarp//lib/yarp/node.rb#9451 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7648 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9473 + def human; end + + # source://yarp//lib/yarp/node.rb#9460 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#7589 + # source://yarp//lib/yarp/node.rb#9396 def name; end # attr_reader name_loc: Location # - # source://yarp//lib/yarp/node.rb#7592 + # source://yarp//lib/yarp/node.rb#9399 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7644 + # source://yarp//lib/yarp/node.rb#9456 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#7595 + # source://yarp//lib/yarp/node.rb#9402 def operator_loc; end # attr_reader value: Node # - # source://yarp//lib/yarp/node.rb#7598 + # source://yarp//lib/yarp/node.rb#9405 def value; end end @@ -9463,67 +11347,79 @@ end # left or right # ^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#7663 +# source://yarp//lib/yarp/node.rb#9482 class YARP::OrNode < ::YARP::Node # def initialize: (left: Node, right: Node, operator_loc: Location, location: Location) -> void # # @return [OrNode] a new instance of OrNode # - # source://yarp//lib/yarp/node.rb#7674 + # source://yarp//lib/yarp/node.rb#9493 def initialize(left, right, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7682 + # source://yarp//lib/yarp/node.rb#9501 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7687 + # source://yarp//lib/yarp/node.rb#9506 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7692 + # source://yarp//lib/yarp/node.rb#9516 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9511 + def compact_child_nodes; end + # def copy: (**params) -> OrNode # - # source://yarp//lib/yarp/node.rb#7697 + # source://yarp//lib/yarp/node.rb#9521 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7687 + # source://yarp//lib/yarp/node.rb#9506 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7710 + # source://yarp//lib/yarp/node.rb#9534 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7719 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9556 + def human; end + + # source://yarp//lib/yarp/node.rb#9543 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://yarp//lib/yarp/node.rb#7665 + # source://yarp//lib/yarp/node.rb#9484 def left; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7715 + # source://yarp//lib/yarp/node.rb#9539 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#7671 + # source://yarp//lib/yarp/node.rb#9490 def operator_loc; end # attr_reader right: Node # - # source://yarp//lib/yarp/node.rb#7668 + # source://yarp//lib/yarp/node.rb#9487 def right; end end @@ -9755,82 +11651,94 @@ YARP::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) # ^^^^^^^ # end # -# source://yarp//lib/yarp/node.rb#7735 +# source://yarp//lib/yarp/node.rb#9566 class YARP::ParametersNode < ::YARP::Node - # def initialize: (requireds: Array[Node], optionals: Array[Node], posts: Array[Node], rest: RestParameterNode?, keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location) -> void + # def initialize: (requireds: Array[Node], optionals: Array[Node], rest: RestParameterNode?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location) -> void # # @return [ParametersNode] a new instance of ParametersNode # - # source://yarp//lib/yarp/node.rb#7758 - def initialize(requireds, optionals, posts, rest, keywords, keyword_rest, block, location); end + # source://yarp//lib/yarp/node.rb#9589 + def initialize(requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7770 + # source://yarp//lib/yarp/node.rb#9601 def accept(visitor); end # attr_reader block: BlockParameterNode? # - # source://yarp//lib/yarp/node.rb#7755 + # source://yarp//lib/yarp/node.rb#9586 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7775 + # source://yarp//lib/yarp/node.rb#9606 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7780 + # source://yarp//lib/yarp/node.rb#9624 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9611 + def compact_child_nodes; end + # def copy: (**params) -> ParametersNode # - # source://yarp//lib/yarp/node.rb#7785 + # source://yarp//lib/yarp/node.rb#9629 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7775 + # source://yarp//lib/yarp/node.rb#9606 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7802 + # source://yarp//lib/yarp/node.rb#9646 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7806 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9680 + def human; end + + # source://yarp//lib/yarp/node.rb#9650 def inspect(inspector = T.unsafe(nil)); end # attr_reader keyword_rest: Node? # - # source://yarp//lib/yarp/node.rb#7752 + # source://yarp//lib/yarp/node.rb#9583 def keyword_rest; end # attr_reader keywords: Array[Node] # - # source://yarp//lib/yarp/node.rb#7749 + # source://yarp//lib/yarp/node.rb#9580 def keywords; end # attr_reader optionals: Array[Node] # - # source://yarp//lib/yarp/node.rb#7740 + # source://yarp//lib/yarp/node.rb#9571 def optionals; end # attr_reader posts: Array[Node] # - # source://yarp//lib/yarp/node.rb#7743 + # source://yarp//lib/yarp/node.rb#9577 def posts; end # attr_reader requireds: Array[Node] # - # source://yarp//lib/yarp/node.rb#7737 + # source://yarp//lib/yarp/node.rb#9568 def requireds; end # attr_reader rest: RestParameterNode? # - # source://yarp//lib/yarp/node.rb#7746 + # source://yarp//lib/yarp/node.rb#9574 def rest; end end @@ -9839,75 +11747,87 @@ end # (10 + 34) # ^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#7838 +# source://yarp//lib/yarp/node.rb#9689 class YARP::ParenthesesNode < ::YARP::Node # def initialize: (body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> void # # @return [ParenthesesNode] a new instance of ParenthesesNode # - # source://yarp//lib/yarp/node.rb#7849 + # source://yarp//lib/yarp/node.rb#9700 def initialize(body, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7857 + # source://yarp//lib/yarp/node.rb#9708 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#7840 + # source://yarp//lib/yarp/node.rb#9691 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7866 + # source://yarp//lib/yarp/node.rb#9717 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#7899 + # source://yarp//lib/yarp/node.rb#9757 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#7846 + # source://yarp//lib/yarp/node.rb#9697 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7871 + # source://yarp//lib/yarp/node.rb#9729 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9722 + def compact_child_nodes; end + # def copy: (**params) -> ParenthesesNode # - # source://yarp//lib/yarp/node.rb#7876 + # source://yarp//lib/yarp/node.rb#9734 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7866 + # source://yarp//lib/yarp/node.rb#9717 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7889 + # source://yarp//lib/yarp/node.rb#9747 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#7903 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9777 + def human; end + + # source://yarp//lib/yarp/node.rb#9761 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#7894 + # source://yarp//lib/yarp/node.rb#9752 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#7843 + # source://yarp//lib/yarp/node.rb#9694 def opening_loc; end - # source://yarp//lib/yarp/node.rb#7861 + # source://yarp//lib/yarp/node.rb#9712 def set_newline_flag(newline_marked); end end @@ -10307,82 +12227,94 @@ end # foo in ^(bar) # ^^^^^^ # -# source://yarp//lib/yarp/node.rb#7922 +# source://yarp//lib/yarp/node.rb#9787 class YARP::PinnedExpressionNode < ::YARP::Node # def initialize: (expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location) -> void # # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode # - # source://yarp//lib/yarp/node.rb#7936 + # source://yarp//lib/yarp/node.rb#9801 def initialize(expression, operator_loc, lparen_loc, rparen_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#7945 + # source://yarp//lib/yarp/node.rb#9810 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7950 + # source://yarp//lib/yarp/node.rb#9815 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#7955 + # source://yarp//lib/yarp/node.rb#9825 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9820 + def compact_child_nodes; end + # def copy: (**params) -> PinnedExpressionNode # - # source://yarp//lib/yarp/node.rb#7960 + # source://yarp//lib/yarp/node.rb#9830 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#7950 + # source://yarp//lib/yarp/node.rb#9815 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#7974 + # source://yarp//lib/yarp/node.rb#9844 def deconstruct_keys(keys); end # attr_reader expression: Node # - # source://yarp//lib/yarp/node.rb#7924 + # source://yarp//lib/yarp/node.rb#9789 def expression; end - # source://yarp//lib/yarp/node.rb#7993 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9876 + def human; end + + # source://yarp//lib/yarp/node.rb#9863 def inspect(inspector = T.unsafe(nil)); end # def lparen: () -> String # - # source://yarp//lib/yarp/node.rb#7984 + # source://yarp//lib/yarp/node.rb#9854 def lparen; end # attr_reader lparen_loc: Location # - # source://yarp//lib/yarp/node.rb#7930 + # source://yarp//lib/yarp/node.rb#9795 def lparen_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#7979 + # source://yarp//lib/yarp/node.rb#9849 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#7927 + # source://yarp//lib/yarp/node.rb#9792 def operator_loc; end # def rparen: () -> String # - # source://yarp//lib/yarp/node.rb#7989 + # source://yarp//lib/yarp/node.rb#9859 def rparen; end # attr_reader rparen_loc: Location # - # source://yarp//lib/yarp/node.rb#7933 + # source://yarp//lib/yarp/node.rb#9798 def rparen_loc; end end @@ -10392,62 +12324,74 @@ end # foo in ^bar # ^^^^ # -# source://yarp//lib/yarp/node.rb#8009 +# source://yarp//lib/yarp/node.rb#9886 class YARP::PinnedVariableNode < ::YARP::Node # def initialize: (variable: Node, operator_loc: Location, location: Location) -> void # # @return [PinnedVariableNode] a new instance of PinnedVariableNode # - # source://yarp//lib/yarp/node.rb#8017 + # source://yarp//lib/yarp/node.rb#9894 def initialize(variable, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8024 + # source://yarp//lib/yarp/node.rb#9901 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8029 + # source://yarp//lib/yarp/node.rb#9906 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8034 + # source://yarp//lib/yarp/node.rb#9916 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9911 + def compact_child_nodes; end + # def copy: (**params) -> PinnedVariableNode # - # source://yarp//lib/yarp/node.rb#8039 + # source://yarp//lib/yarp/node.rb#9921 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8029 + # source://yarp//lib/yarp/node.rb#9906 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8051 + # source://yarp//lib/yarp/node.rb#9933 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8060 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#9953 + def human; end + + # source://yarp//lib/yarp/node.rb#9942 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#8056 + # source://yarp//lib/yarp/node.rb#9938 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#8014 + # source://yarp//lib/yarp/node.rb#9891 def operator_loc; end # attr_reader variable: Node # - # source://yarp//lib/yarp/node.rb#8011 + # source://yarp//lib/yarp/node.rb#9888 def variable; end end @@ -10456,82 +12400,94 @@ end # END { foo } # ^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#8073 +# source://yarp//lib/yarp/node.rb#9962 class YARP::PostExecutionNode < ::YARP::Node # def initialize: (statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void # # @return [PostExecutionNode] a new instance of PostExecutionNode # - # source://yarp//lib/yarp/node.rb#8087 + # source://yarp//lib/yarp/node.rb#9976 def initialize(statements, keyword_loc, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8096 + # source://yarp//lib/yarp/node.rb#9985 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8101 + # source://yarp//lib/yarp/node.rb#9990 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#8140 + # source://yarp//lib/yarp/node.rb#10036 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#8084 + # source://yarp//lib/yarp/node.rb#9973 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8106 + # source://yarp//lib/yarp/node.rb#10002 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#9995 + def compact_child_nodes; end + # def copy: (**params) -> PostExecutionNode # - # source://yarp//lib/yarp/node.rb#8111 + # source://yarp//lib/yarp/node.rb#10007 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8101 + # source://yarp//lib/yarp/node.rb#9990 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8125 + # source://yarp//lib/yarp/node.rb#10021 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8144 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10057 + def human; end + + # source://yarp//lib/yarp/node.rb#10040 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#8130 + # source://yarp//lib/yarp/node.rb#10026 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#8078 + # source://yarp//lib/yarp/node.rb#9967 def keyword_loc; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#8135 + # source://yarp//lib/yarp/node.rb#10031 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#8081 + # source://yarp//lib/yarp/node.rb#9970 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#8075 + # source://yarp//lib/yarp/node.rb#9964 def statements; end end @@ -10540,147 +12496,171 @@ end # BEGIN { foo } # ^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#8163 +# source://yarp//lib/yarp/node.rb#10066 class YARP::PreExecutionNode < ::YARP::Node # def initialize: (statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void # # @return [PreExecutionNode] a new instance of PreExecutionNode # - # source://yarp//lib/yarp/node.rb#8177 + # source://yarp//lib/yarp/node.rb#10080 def initialize(statements, keyword_loc, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8186 + # source://yarp//lib/yarp/node.rb#10089 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8191 + # source://yarp//lib/yarp/node.rb#10094 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#8230 + # source://yarp//lib/yarp/node.rb#10140 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#8174 + # source://yarp//lib/yarp/node.rb#10077 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8196 + # source://yarp//lib/yarp/node.rb#10106 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10099 + def compact_child_nodes; end + # def copy: (**params) -> PreExecutionNode # - # source://yarp//lib/yarp/node.rb#8201 + # source://yarp//lib/yarp/node.rb#10111 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8191 + # source://yarp//lib/yarp/node.rb#10094 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8215 + # source://yarp//lib/yarp/node.rb#10125 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8234 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10161 + def human; end + + # source://yarp//lib/yarp/node.rb#10144 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#8220 + # source://yarp//lib/yarp/node.rb#10130 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#8168 + # source://yarp//lib/yarp/node.rb#10071 def keyword_loc; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#8225 + # source://yarp//lib/yarp/node.rb#10135 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#8171 + # source://yarp//lib/yarp/node.rb#10074 def opening_loc; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#8165 + # source://yarp//lib/yarp/node.rb#10068 def statements; end end # The top level node of any parse tree. # -# source://yarp//lib/yarp/node.rb#8250 +# source://yarp//lib/yarp/node.rb#10167 class YARP::ProgramNode < ::YARP::Node # def initialize: (locals: Array[Symbol], statements: StatementsNode, location: Location) -> void # # @return [ProgramNode] a new instance of ProgramNode # - # source://yarp//lib/yarp/node.rb#8258 + # source://yarp//lib/yarp/node.rb#10175 def initialize(locals, statements, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8265 + # source://yarp//lib/yarp/node.rb#10182 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8270 + # source://yarp//lib/yarp/node.rb#10187 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8275 + # source://yarp//lib/yarp/node.rb#10197 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10192 + def compact_child_nodes; end + # def copy: (**params) -> ProgramNode # - # source://yarp//lib/yarp/node.rb#8280 + # source://yarp//lib/yarp/node.rb#10202 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8270 + # source://yarp//lib/yarp/node.rb#10187 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8292 + # source://yarp//lib/yarp/node.rb#10214 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8296 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10229 + def human; end + + # source://yarp//lib/yarp/node.rb#10218 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#8252 + # source://yarp//lib/yarp/node.rb#10169 def locals; end # attr_reader statements: StatementsNode # - # source://yarp//lib/yarp/node.rb#8255 + # source://yarp//lib/yarp/node.rb#10172 def statements; end end -# source://yarp//lib/yarp/node.rb#10570 +# source://yarp//lib/yarp/node.rb#12922 module YARP::RangeFlags; end # ... operator # -# source://yarp//lib/yarp/node.rb#10572 +# source://yarp//lib/yarp/node.rb#12924 YARP::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # Represents the use of the `..` or `...` operators. @@ -10691,80 +12671,94 @@ YARP::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # c if a =~ /left/ ... b =~ /right/ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#8312 +# source://yarp//lib/yarp/node.rb#10241 class YARP::RangeNode < ::YARP::Node # def initialize: (left: Node?, right: Node?, operator_loc: Location, flags: Integer, location: Location) -> void # # @return [RangeNode] a new instance of RangeNode # - # source://yarp//lib/yarp/node.rb#8326 + # source://yarp//lib/yarp/node.rb#10255 def initialize(left, right, operator_loc, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8335 + # source://yarp//lib/yarp/node.rb#10264 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8340 + # source://yarp//lib/yarp/node.rb#10269 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8345 + # source://yarp//lib/yarp/node.rb#10282 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10274 + def compact_child_nodes; end + # def copy: (**params) -> RangeNode # - # source://yarp//lib/yarp/node.rb#8350 + # source://yarp//lib/yarp/node.rb#10287 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8340 + # source://yarp//lib/yarp/node.rb#10269 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8364 + # source://yarp//lib/yarp/node.rb#10301 def deconstruct_keys(keys); end # def exclude_end?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8374 + # source://yarp//lib/yarp/node.rb#10311 def exclude_end?; end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#8323 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10338 + def human; end - # source://yarp//lib/yarp/node.rb#8378 + # source://yarp//lib/yarp/node.rb#10315 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node? # - # source://yarp//lib/yarp/node.rb#8314 + # source://yarp//lib/yarp/node.rb#10243 def left; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#8369 + # source://yarp//lib/yarp/node.rb#10306 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#8320 + # source://yarp//lib/yarp/node.rb#10249 def operator_loc; end # attr_reader right: Node? # - # source://yarp//lib/yarp/node.rb#8317 + # source://yarp//lib/yarp/node.rb#10246 def right; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#10252 + def flags; end end # Represents a rational number literal. @@ -10772,55 +12766,69 @@ end # 1.0r # ^^^^ # -# source://yarp//lib/yarp.rb#410 +# source://yarp//lib/yarp/node.rb#10347 class YARP::RationalNode < ::YARP::Node # def initialize: (numeric: Node, location: Location) -> void # # @return [RationalNode] a new instance of RationalNode # - # source://yarp//lib/yarp/node.rb#8407 + # source://yarp//lib/yarp/node.rb#10352 def initialize(numeric, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8413 + # source://yarp//lib/yarp/node.rb#10358 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8418 + # source://yarp//lib/yarp/node.rb#10363 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8423 + # source://yarp//lib/yarp/node.rb#10373 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10368 + def compact_child_nodes; end + # def copy: (**params) -> RationalNode # - # source://yarp//lib/yarp/node.rb#8428 + # source://yarp//lib/yarp/node.rb#10378 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8418 + # source://yarp//lib/yarp/node.rb#10363 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8439 + # source://yarp//lib/yarp/node.rb#10389 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8443 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10403 + def human; end + + # source://yarp//lib/yarp/node.rb#10393 def inspect(inspector = T.unsafe(nil)); end # attr_reader numeric: Node # - # source://yarp//lib/yarp/node.rb#8404 + # source://yarp//lib/yarp/node.rb#10349 def numeric; end - # source://yarp//lib/yarp.rb#411 + # Returns the value of the node as a Ruby Rational. + # + # source://yarp//lib/yarp.rb#601 def value; end end @@ -10829,91 +12837,103 @@ end # redo # ^^^^ # -# source://yarp//lib/yarp/node.rb#8455 +# source://yarp//lib/yarp/node.rb#10412 class YARP::RedoNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [RedoNode] a new instance of RedoNode # - # source://yarp//lib/yarp/node.rb#8457 + # source://yarp//lib/yarp/node.rb#10414 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8462 + # source://yarp//lib/yarp/node.rb#10419 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8467 + # source://yarp//lib/yarp/node.rb#10424 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8472 + # source://yarp//lib/yarp/node.rb#10434 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10429 + def compact_child_nodes; end + # def copy: (**params) -> RedoNode # - # source://yarp//lib/yarp/node.rb#8477 + # source://yarp//lib/yarp/node.rb#10439 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8467 + # source://yarp//lib/yarp/node.rb#10424 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8487 + # source://yarp//lib/yarp/node.rb#10449 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8491 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10461 + def human; end + + # source://yarp//lib/yarp/node.rb#10453 def inspect(inspector = T.unsafe(nil)); end end -# source://yarp//lib/yarp/node.rb#10575 +# source://yarp//lib/yarp/node.rb#12927 module YARP::RegularExpressionFlags; end # n - forces the ASCII-8BIT encoding # -# source://yarp//lib/yarp/node.rb#10589 +# source://yarp//lib/yarp/node.rb#12941 YARP::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) # e - forces the EUC-JP encoding # -# source://yarp//lib/yarp/node.rb#10586 +# source://yarp//lib/yarp/node.rb#12938 YARP::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) # x - ignores whitespace and allows comments in regular expressions # -# source://yarp//lib/yarp/node.rb#10583 +# source://yarp//lib/yarp/node.rb#12932 YARP::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) # i - ignores the case of characters when matching # -# source://yarp//lib/yarp/node.rb#10577 +# source://yarp//lib/yarp/node.rb#12929 YARP::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) # m - allows $ to match the end of lines within strings # -# source://yarp//lib/yarp/node.rb#10580 +# source://yarp//lib/yarp/node.rb#12935 YARP::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) # o - only interpolates values into the regular expression once # -# source://yarp//lib/yarp/node.rb#10598 +# source://yarp//lib/yarp/node.rb#12950 YARP::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) # u - forces the UTF-8 encoding # -# source://yarp//lib/yarp/node.rb#10595 +# source://yarp//lib/yarp/node.rb#12947 YARP::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) # s - forces the Windows-31J encoding # -# source://yarp//lib/yarp/node.rb#10592 +# source://yarp//lib/yarp/node.rb#12944 YARP::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # Represents a regular expression literal with no interpolation. @@ -10921,144 +12941,164 @@ YARP::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # /foo/i # ^^^^^^ # -# source://yarp//lib/yarp/node.rb#8501 +# source://yarp//lib/yarp/node.rb#10470 class YARP::RegularExpressionNode < ::YARP::Node # def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, flags: Integer, location: Location) -> void # # @return [RegularExpressionNode] a new instance of RegularExpressionNode # - # source://yarp//lib/yarp/node.rb#8518 + # source://yarp//lib/yarp/node.rb#10487 def initialize(opening_loc, content_loc, closing_loc, unescaped, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8528 + # source://yarp//lib/yarp/node.rb#10497 def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8598 + # source://yarp//lib/yarp/node.rb#10572 def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8533 + # source://yarp//lib/yarp/node.rb#10502 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#8573 + # source://yarp//lib/yarp/node.rb#10547 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#8509 + # source://yarp//lib/yarp/node.rb#10478 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8538 + # source://yarp//lib/yarp/node.rb#10512 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10507 + def compact_child_nodes; end + # def content: () -> String # - # source://yarp//lib/yarp/node.rb#8568 + # source://yarp//lib/yarp/node.rb#10542 def content; end # attr_reader content_loc: Location # - # source://yarp//lib/yarp/node.rb#8506 + # source://yarp//lib/yarp/node.rb#10475 def content_loc; end # def copy: (**params) -> RegularExpressionNode # - # source://yarp//lib/yarp/node.rb#8543 + # source://yarp//lib/yarp/node.rb#10517 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8533 + # source://yarp//lib/yarp/node.rb#10502 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8558 + # source://yarp//lib/yarp/node.rb#10532 def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8593 + # source://yarp//lib/yarp/node.rb#10567 def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8588 + # source://yarp//lib/yarp/node.rb#10557 def extended?; end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#8515 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10605 + def human; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8578 + # source://yarp//lib/yarp/node.rb#10552 def ignore_case?; end - # source://yarp//lib/yarp/node.rb#8617 + # source://yarp//lib/yarp/node.rb#10591 def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8583 + # source://yarp//lib/yarp/node.rb#10562 def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8613 + # source://yarp//lib/yarp/node.rb#10587 def once?; end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#8563 + # source://yarp//lib/yarp/node.rb#10537 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#8503 + # source://yarp//lib/yarp/node.rb#10472 def opening_loc; end + # Returns a numeric value that represents the flags that were used to create + # the regular expression. + # + # source://yarp//lib/yarp.rb#609 + def options; end + # attr_reader unescaped: String # - # source://yarp//lib/yarp/node.rb#8512 + # source://yarp//lib/yarp/node.rb#10481 def unescaped; end # def utf_8?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8608 + # source://yarp//lib/yarp/node.rb#10582 def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#8603 + # source://yarp//lib/yarp/node.rb#10577 def windows_31j?; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#10484 + def flags; end end # Represents a destructured required parameter node. @@ -11067,72 +13107,84 @@ end # ^^^^^^^^^^ # end # -# source://yarp//lib/yarp/node.rb#8633 +# source://yarp//lib/yarp/node.rb#10615 class YARP::RequiredDestructuredParameterNode < ::YARP::Node # def initialize: (parameters: Array[Node], opening_loc: Location, closing_loc: Location, location: Location) -> void # # @return [RequiredDestructuredParameterNode] a new instance of RequiredDestructuredParameterNode # - # source://yarp//lib/yarp/node.rb#8644 + # source://yarp//lib/yarp/node.rb#10626 def initialize(parameters, opening_loc, closing_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8652 + # source://yarp//lib/yarp/node.rb#10634 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8657 + # source://yarp//lib/yarp/node.rb#10639 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#8690 + # source://yarp//lib/yarp/node.rb#10677 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#8641 + # source://yarp//lib/yarp/node.rb#10623 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8662 + # source://yarp//lib/yarp/node.rb#10649 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10644 + def compact_child_nodes; end + # def copy: (**params) -> RequiredDestructuredParameterNode # - # source://yarp//lib/yarp/node.rb#8667 + # source://yarp//lib/yarp/node.rb#10654 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8657 + # source://yarp//lib/yarp/node.rb#10639 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8680 + # source://yarp//lib/yarp/node.rb#10667 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8694 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10692 + def human; end + + # source://yarp//lib/yarp/node.rb#10681 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#8685 + # source://yarp//lib/yarp/node.rb#10672 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#8638 + # source://yarp//lib/yarp/node.rb#10620 def opening_loc; end # attr_reader parameters: Array[Node] # - # source://yarp//lib/yarp/node.rb#8635 + # source://yarp//lib/yarp/node.rb#10617 def parameters; end end @@ -11142,52 +13194,64 @@ end # ^ # end # -# source://yarp//lib/yarp/node.rb#8708 +# source://yarp//lib/yarp/node.rb#10702 class YARP::RequiredParameterNode < ::YARP::Node # def initialize: (name: Symbol, location: Location) -> void # # @return [RequiredParameterNode] a new instance of RequiredParameterNode # - # source://yarp//lib/yarp/node.rb#8713 + # source://yarp//lib/yarp/node.rb#10707 def initialize(name, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8719 + # source://yarp//lib/yarp/node.rb#10713 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8724 + # source://yarp//lib/yarp/node.rb#10718 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8729 + # source://yarp//lib/yarp/node.rb#10728 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10723 + def compact_child_nodes; end + # def copy: (**params) -> RequiredParameterNode # - # source://yarp//lib/yarp/node.rb#8734 + # source://yarp//lib/yarp/node.rb#10733 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8724 + # source://yarp//lib/yarp/node.rb#10718 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8745 + # source://yarp//lib/yarp/node.rb#10744 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#8749 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10757 + def human; end + + # source://yarp//lib/yarp/node.rb#10748 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://yarp//lib/yarp/node.rb#8710 + # source://yarp//lib/yarp/node.rb#10704 def name; end end @@ -11196,70 +13260,82 @@ end # foo rescue nil # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#8760 +# source://yarp//lib/yarp/node.rb#10766 class YARP::RescueModifierNode < ::YARP::Node # def initialize: (expression: Node, keyword_loc: Location, rescue_expression: Node, location: Location) -> void # # @return [RescueModifierNode] a new instance of RescueModifierNode # - # source://yarp//lib/yarp/node.rb#8771 + # source://yarp//lib/yarp/node.rb#10777 def initialize(expression, keyword_loc, rescue_expression, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8779 + # source://yarp//lib/yarp/node.rb#10785 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8788 + # source://yarp//lib/yarp/node.rb#10794 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8793 + # source://yarp//lib/yarp/node.rb#10804 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10799 + def compact_child_nodes; end + # def copy: (**params) -> RescueModifierNode # - # source://yarp//lib/yarp/node.rb#8798 + # source://yarp//lib/yarp/node.rb#10809 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8788 + # source://yarp//lib/yarp/node.rb#10794 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8811 + # source://yarp//lib/yarp/node.rb#10822 def deconstruct_keys(keys); end # attr_reader expression: Node # - # source://yarp//lib/yarp/node.rb#8762 + # source://yarp//lib/yarp/node.rb#10768 def expression; end - # source://yarp//lib/yarp/node.rb#8820 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10844 + def human; end + + # source://yarp//lib/yarp/node.rb#10831 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#8816 + # source://yarp//lib/yarp/node.rb#10827 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#8765 + # source://yarp//lib/yarp/node.rb#10771 def keyword_loc; end # attr_reader rescue_expression: Node # - # source://yarp//lib/yarp/node.rb#8768 + # source://yarp//lib/yarp/node.rb#10774 def rescue_expression; end - # source://yarp//lib/yarp/node.rb#8783 + # source://yarp//lib/yarp/node.rb#10789 def set_newline_flag(newline_marked); end end @@ -11274,87 +13350,99 @@ end # `Foo, *splat, Bar` are in the `exceptions` field. # `ex` is in the `exception` field. # -# source://yarp//lib/yarp/node.rb#8841 +# source://yarp//lib/yarp/node.rb#10859 class YARP::RescueNode < ::YARP::Node # def initialize: (keyword_loc: Location, exceptions: Array[Node], operator_loc: Location?, reference: Node?, statements: StatementsNode?, consequent: RescueNode?, location: Location) -> void # # @return [RescueNode] a new instance of RescueNode # - # source://yarp//lib/yarp/node.rb#8861 + # source://yarp//lib/yarp/node.rb#10879 def initialize(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8872 + # source://yarp//lib/yarp/node.rb#10890 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8877 + # source://yarp//lib/yarp/node.rb#10895 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8882 + # source://yarp//lib/yarp/node.rb#10910 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#10900 + def compact_child_nodes; end + # attr_reader consequent: RescueNode? # - # source://yarp//lib/yarp/node.rb#8858 + # source://yarp//lib/yarp/node.rb#10876 def consequent; end # def copy: (**params) -> RescueNode # - # source://yarp//lib/yarp/node.rb#8887 + # source://yarp//lib/yarp/node.rb#10915 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8877 + # source://yarp//lib/yarp/node.rb#10895 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8903 + # source://yarp//lib/yarp/node.rb#10931 def deconstruct_keys(keys); end # attr_reader exceptions: Array[Node] # - # source://yarp//lib/yarp/node.rb#8846 + # source://yarp//lib/yarp/node.rb#10864 def exceptions; end - # source://yarp//lib/yarp/node.rb#8917 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#10974 + def human; end + + # source://yarp//lib/yarp/node.rb#10945 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#8908 + # source://yarp//lib/yarp/node.rb#10936 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#8843 + # source://yarp//lib/yarp/node.rb#10861 def keyword_loc; end # def operator: () -> String? # - # source://yarp//lib/yarp/node.rb#8913 + # source://yarp//lib/yarp/node.rb#10941 def operator; end # attr_reader operator_loc: Location? # - # source://yarp//lib/yarp/node.rb#8849 + # source://yarp//lib/yarp/node.rb#10867 def operator_loc; end # attr_reader reference: Node? # - # source://yarp//lib/yarp/node.rb#8852 + # source://yarp//lib/yarp/node.rb#10870 def reference; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#8855 + # source://yarp//lib/yarp/node.rb#10873 def statements; end end @@ -11364,67 +13452,79 @@ end # ^^ # end # -# source://yarp//lib/yarp/node.rb#8949 +# source://yarp//lib/yarp/node.rb#10984 class YARP::RestParameterNode < ::YARP::Node # def initialize: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> void # # @return [RestParameterNode] a new instance of RestParameterNode # - # source://yarp//lib/yarp/node.rb#8960 + # source://yarp//lib/yarp/node.rb#10995 def initialize(name, name_loc, operator_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#8968 + # source://yarp//lib/yarp/node.rb#11003 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8973 + # source://yarp//lib/yarp/node.rb#11008 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#8978 + # source://yarp//lib/yarp/node.rb#11018 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11013 + def compact_child_nodes; end + # def copy: (**params) -> RestParameterNode # - # source://yarp//lib/yarp/node.rb#8983 + # source://yarp//lib/yarp/node.rb#11023 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#8973 + # source://yarp//lib/yarp/node.rb#11008 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#8996 + # source://yarp//lib/yarp/node.rb#11036 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9005 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11056 + def human; end + + # source://yarp//lib/yarp/node.rb#11045 def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://yarp//lib/yarp/node.rb#8951 + # source://yarp//lib/yarp/node.rb#10986 def name; end # attr_reader name_loc: Location? # - # source://yarp//lib/yarp/node.rb#8954 + # source://yarp//lib/yarp/node.rb#10989 def name_loc; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#9001 + # source://yarp//lib/yarp/node.rb#11041 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#8957 + # source://yarp//lib/yarp/node.rb#10992 def operator_loc; end end @@ -11433,47 +13533,59 @@ end # retry # ^^^^^ # -# source://yarp//lib/yarp/node.rb#9018 +# source://yarp//lib/yarp/node.rb#11065 class YARP::RetryNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [RetryNode] a new instance of RetryNode # - # source://yarp//lib/yarp/node.rb#9020 + # source://yarp//lib/yarp/node.rb#11067 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9025 + # source://yarp//lib/yarp/node.rb#11072 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9030 + # source://yarp//lib/yarp/node.rb#11077 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9035 + # source://yarp//lib/yarp/node.rb#11087 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11082 + def compact_child_nodes; end + # def copy: (**params) -> RetryNode # - # source://yarp//lib/yarp/node.rb#9040 + # source://yarp//lib/yarp/node.rb#11092 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9030 + # source://yarp//lib/yarp/node.rb#11077 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9050 + # source://yarp//lib/yarp/node.rb#11102 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9054 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11114 + def human; end + + # source://yarp//lib/yarp/node.rb#11106 def inspect(inspector = T.unsafe(nil)); end end @@ -11482,62 +13594,74 @@ end # return 1 # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9064 +# source://yarp//lib/yarp/node.rb#11123 class YARP::ReturnNode < ::YARP::Node # def initialize: (keyword_loc: Location, arguments: ArgumentsNode?, location: Location) -> void # # @return [ReturnNode] a new instance of ReturnNode # - # source://yarp//lib/yarp/node.rb#9072 + # source://yarp//lib/yarp/node.rb#11131 def initialize(keyword_loc, arguments, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9079 + # source://yarp//lib/yarp/node.rb#11138 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#9069 + # source://yarp//lib/yarp/node.rb#11128 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9084 + # source://yarp//lib/yarp/node.rb#11143 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9089 + # source://yarp//lib/yarp/node.rb#11155 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11148 + def compact_child_nodes; end + # def copy: (**params) -> ReturnNode # - # source://yarp//lib/yarp/node.rb#9094 + # source://yarp//lib/yarp/node.rb#11160 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9084 + # source://yarp//lib/yarp/node.rb#11143 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9106 + # source://yarp//lib/yarp/node.rb#11172 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9115 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11196 + def human; end + + # source://yarp//lib/yarp/node.rb#11181 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#9111 + # source://yarp//lib/yarp/node.rb#11177 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#9066 + # source://yarp//lib/yarp/node.rb#11125 def keyword_loc; end end @@ -12886,47 +15010,59 @@ end # self # ^^^^ # -# source://yarp//lib/yarp/node.rb#9132 +# source://yarp//lib/yarp/node.rb#11205 class YARP::SelfNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [SelfNode] a new instance of SelfNode # - # source://yarp//lib/yarp/node.rb#9134 + # source://yarp//lib/yarp/node.rb#11207 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9139 + # source://yarp//lib/yarp/node.rb#11212 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9144 + # source://yarp//lib/yarp/node.rb#11217 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9149 + # source://yarp//lib/yarp/node.rb#11227 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11222 + def compact_child_nodes; end + # def copy: (**params) -> SelfNode # - # source://yarp//lib/yarp/node.rb#9154 + # source://yarp//lib/yarp/node.rb#11232 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9144 + # source://yarp//lib/yarp/node.rb#11217 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9164 + # source://yarp//lib/yarp/node.rb#11242 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9168 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11254 + def human; end + + # source://yarp//lib/yarp/node.rb#11246 def inspect(inspector = T.unsafe(nil)); end end @@ -13049,7 +15185,7 @@ YARP::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) # source://yarp//lib/yarp/serialize.rb#25 YARP::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) -# source://yarp//lib/yarp/serialize.rb#480 +# source://yarp//lib/yarp/serialize.rb#490 YARP::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) # Represents a singleton class declaration involving the `class` keyword. @@ -13057,92 +15193,104 @@ YARP::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) # class << self end # ^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9178 +# source://yarp//lib/yarp/node.rb#11263 class YARP::SingletonClassNode < ::YARP::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://yarp//lib/yarp/node.rb#9198 + # source://yarp//lib/yarp/node.rb#11283 def initialize(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9209 + # source://yarp//lib/yarp/node.rb#11294 def accept(visitor); end # attr_reader body: Node? # - # source://yarp//lib/yarp/node.rb#9192 + # source://yarp//lib/yarp/node.rb#11277 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9214 + # source://yarp//lib/yarp/node.rb#11299 def child_nodes; end # def class_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#9245 + # source://yarp//lib/yarp/node.rb#11338 def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#9183 + # source://yarp//lib/yarp/node.rb#11268 def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9219 + # source://yarp//lib/yarp/node.rb#11312 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11304 + def compact_child_nodes; end + # def copy: (**params) -> SingletonClassNode # - # source://yarp//lib/yarp/node.rb#9224 + # source://yarp//lib/yarp/node.rb#11317 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9214 + # source://yarp//lib/yarp/node.rb#11299 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9240 + # source://yarp//lib/yarp/node.rb#11333 def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://yarp//lib/yarp/node.rb#9255 + # source://yarp//lib/yarp/node.rb#11348 def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#9195 + # source://yarp//lib/yarp/node.rb#11280 def end_keyword_loc; end # attr_reader expression: Node # - # source://yarp//lib/yarp/node.rb#9189 + # source://yarp//lib/yarp/node.rb#11274 def expression; end - # source://yarp//lib/yarp/node.rb#9259 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11372 + def human; end + + # source://yarp//lib/yarp/node.rb#11352 def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://yarp//lib/yarp/node.rb#9180 + # source://yarp//lib/yarp/node.rb#11265 def locals; end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#9250 + # source://yarp//lib/yarp/node.rb#11343 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#9186 + # source://yarp//lib/yarp/node.rb#11271 def operator_loc; end end @@ -13190,47 +15338,59 @@ end # __ENCODING__ # ^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9281 +# source://yarp//lib/yarp/node.rb#11381 class YARP::SourceEncodingNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [SourceEncodingNode] a new instance of SourceEncodingNode # - # source://yarp//lib/yarp/node.rb#9283 + # source://yarp//lib/yarp/node.rb#11383 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9288 + # source://yarp//lib/yarp/node.rb#11388 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9293 + # source://yarp//lib/yarp/node.rb#11393 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9298 + # source://yarp//lib/yarp/node.rb#11403 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11398 + def compact_child_nodes; end + # def copy: (**params) -> SourceEncodingNode # - # source://yarp//lib/yarp/node.rb#9303 + # source://yarp//lib/yarp/node.rb#11408 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9293 + # source://yarp//lib/yarp/node.rb#11393 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9313 + # source://yarp//lib/yarp/node.rb#11418 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9317 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11430 + def human; end + + # source://yarp//lib/yarp/node.rb#11422 def inspect(inspector = T.unsafe(nil)); end end @@ -13239,52 +15399,64 @@ end # __FILE__ # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9327 +# source://yarp//lib/yarp/node.rb#11439 class YARP::SourceFileNode < ::YARP::Node # def initialize: (filepath: String, location: Location) -> void # # @return [SourceFileNode] a new instance of SourceFileNode # - # source://yarp//lib/yarp/node.rb#9332 + # source://yarp//lib/yarp/node.rb#11444 def initialize(filepath, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9338 + # source://yarp//lib/yarp/node.rb#11450 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9343 + # source://yarp//lib/yarp/node.rb#11455 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9348 + # source://yarp//lib/yarp/node.rb#11465 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11460 + def compact_child_nodes; end + # def copy: (**params) -> SourceFileNode # - # source://yarp//lib/yarp/node.rb#9353 + # source://yarp//lib/yarp/node.rb#11470 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9343 + # source://yarp//lib/yarp/node.rb#11455 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9364 + # source://yarp//lib/yarp/node.rb#11481 def deconstruct_keys(keys); end # attr_reader filepath: String # - # source://yarp//lib/yarp/node.rb#9329 + # source://yarp//lib/yarp/node.rb#11441 def filepath; end - # source://yarp//lib/yarp/node.rb#9368 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11494 + def human; end + + # source://yarp//lib/yarp/node.rb#11485 def inspect(inspector = T.unsafe(nil)); end end @@ -13293,47 +15465,59 @@ end # __LINE__ # ^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9379 +# source://yarp//lib/yarp/node.rb#11503 class YARP::SourceLineNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [SourceLineNode] a new instance of SourceLineNode # - # source://yarp//lib/yarp/node.rb#9381 + # source://yarp//lib/yarp/node.rb#11505 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9386 + # source://yarp//lib/yarp/node.rb#11510 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9391 + # source://yarp//lib/yarp/node.rb#11515 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9396 + # source://yarp//lib/yarp/node.rb#11525 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11520 + def compact_child_nodes; end + # def copy: (**params) -> SourceLineNode # - # source://yarp//lib/yarp/node.rb#9401 + # source://yarp//lib/yarp/node.rb#11530 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9391 + # source://yarp//lib/yarp/node.rb#11515 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9411 + # source://yarp//lib/yarp/node.rb#11540 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9415 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11552 + def human; end + + # source://yarp//lib/yarp/node.rb#11544 def inspect(inspector = T.unsafe(nil)); end end @@ -13342,62 +15526,74 @@ end # [*a] # ^^ # -# source://yarp//lib/yarp/node.rb#9425 +# source://yarp//lib/yarp/node.rb#11561 class YARP::SplatNode < ::YARP::Node # def initialize: (operator_loc: Location, expression: Node?, location: Location) -> void # # @return [SplatNode] a new instance of SplatNode # - # source://yarp//lib/yarp/node.rb#9433 + # source://yarp//lib/yarp/node.rb#11569 def initialize(operator_loc, expression, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9440 + # source://yarp//lib/yarp/node.rb#11576 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9445 + # source://yarp//lib/yarp/node.rb#11581 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9450 + # source://yarp//lib/yarp/node.rb#11593 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11586 + def compact_child_nodes; end + # def copy: (**params) -> SplatNode # - # source://yarp//lib/yarp/node.rb#9455 + # source://yarp//lib/yarp/node.rb#11598 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9445 + # source://yarp//lib/yarp/node.rb#11581 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9467 + # source://yarp//lib/yarp/node.rb#11610 def deconstruct_keys(keys); end # attr_reader expression: Node? # - # source://yarp//lib/yarp/node.rb#9430 + # source://yarp//lib/yarp/node.rb#11566 def expression; end - # source://yarp//lib/yarp/node.rb#9476 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11634 + def human; end + + # source://yarp//lib/yarp/node.rb#11619 def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://yarp//lib/yarp/node.rb#9472 + # source://yarp//lib/yarp/node.rb#11615 def operator; end # attr_reader operator_loc: Location # - # source://yarp//lib/yarp/node.rb#9427 + # source://yarp//lib/yarp/node.rb#11563 def operator_loc; end end @@ -13406,52 +15602,64 @@ end # foo; bar; baz # ^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9493 +# source://yarp//lib/yarp/node.rb#11643 class YARP::StatementsNode < ::YARP::Node # def initialize: (body: Array[Node], location: Location) -> void # # @return [StatementsNode] a new instance of StatementsNode # - # source://yarp//lib/yarp/node.rb#9498 + # source://yarp//lib/yarp/node.rb#11648 def initialize(body, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9504 + # source://yarp//lib/yarp/node.rb#11654 def accept(visitor); end # attr_reader body: Array[Node] # - # source://yarp//lib/yarp/node.rb#9495 + # source://yarp//lib/yarp/node.rb#11645 def body; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9509 + # source://yarp//lib/yarp/node.rb#11659 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9514 + # source://yarp//lib/yarp/node.rb#11669 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11664 + def compact_child_nodes; end + # def copy: (**params) -> StatementsNode # - # source://yarp//lib/yarp/node.rb#9519 + # source://yarp//lib/yarp/node.rb#11674 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9509 + # source://yarp//lib/yarp/node.rb#11659 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9530 + # source://yarp//lib/yarp/node.rb#11685 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9534 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11698 + def human; end + + # source://yarp//lib/yarp/node.rb#11689 def inspect(inspector = T.unsafe(nil)); end end @@ -13460,60 +15668,80 @@ end # "foo" "bar" # ^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9545 +# source://yarp//lib/yarp/node.rb#11707 class YARP::StringConcatNode < ::YARP::Node # def initialize: (left: Node, right: Node, location: Location) -> void # # @return [StringConcatNode] a new instance of StringConcatNode # - # source://yarp//lib/yarp/node.rb#9553 + # source://yarp//lib/yarp/node.rb#11715 def initialize(left, right, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9560 + # source://yarp//lib/yarp/node.rb#11722 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9565 + # source://yarp//lib/yarp/node.rb#11727 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9570 + # source://yarp//lib/yarp/node.rb#11737 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11732 + def compact_child_nodes; end + # def copy: (**params) -> StringConcatNode # - # source://yarp//lib/yarp/node.rb#9575 + # source://yarp//lib/yarp/node.rb#11742 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9565 + # source://yarp//lib/yarp/node.rb#11727 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9587 + # source://yarp//lib/yarp/node.rb#11754 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9591 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11770 + def human; end + + # source://yarp//lib/yarp/node.rb#11758 def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Node # - # source://yarp//lib/yarp/node.rb#9547 + # source://yarp//lib/yarp/node.rb#11709 def left; end # attr_reader right: Node # - # source://yarp//lib/yarp/node.rb#9550 + # source://yarp//lib/yarp/node.rb#11712 def right; end end +# source://yarp//lib/yarp/node.rb#12953 +module YARP::StringFlags; end + +# frozen by virtue of a frozen_string_literal comment +# +# source://yarp//lib/yarp/node.rb#12955 +YARP::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. # @@ -13526,83 +15754,109 @@ end # "foo #{bar} baz" # ^^^^ ^^^^ # -# source://yarp//lib/yarp/node.rb#9612 +# source://yarp//lib/yarp/node.rb#11786 class YARP::StringNode < ::YARP::Node - # def initialize: (opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location) -> void + # 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://yarp//lib/yarp/node.rb#9626 - def initialize(opening_loc, content_loc, closing_loc, unescaped, location); end + # source://yarp//lib/yarp/node.rb#11803 + def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9635 + # source://yarp//lib/yarp/node.rb#11813 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9640 + # source://yarp//lib/yarp/node.rb#11818 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#9679 + # source://yarp//lib/yarp/node.rb#11868 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#9620 + # source://yarp//lib/yarp/node.rb#11797 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9645 + # source://yarp//lib/yarp/node.rb#11828 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11823 + def compact_child_nodes; end + # def content: () -> String # - # source://yarp//lib/yarp/node.rb#9674 + # source://yarp//lib/yarp/node.rb#11863 def content; end # attr_reader content_loc: Location # - # source://yarp//lib/yarp/node.rb#9617 + # source://yarp//lib/yarp/node.rb#11794 def content_loc; end # def copy: (**params) -> StringNode # - # source://yarp//lib/yarp/node.rb#9650 + # source://yarp//lib/yarp/node.rb#11833 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9640 + # source://yarp//lib/yarp/node.rb#11818 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9664 + # source://yarp//lib/yarp/node.rb#11848 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9683 + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://yarp//lib/yarp/node.rb#11853 + def frozen?; end + + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#11886 + def human; end + + # source://yarp//lib/yarp/node.rb#11872 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#9669 + # source://yarp//lib/yarp/node.rb#11858 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#9614 + # source://yarp//lib/yarp/node.rb#11791 def opening_loc; end # attr_reader unescaped: String # - # source://yarp//lib/yarp/node.rb#9623 + # source://yarp//lib/yarp/node.rb#11800 def unescaped; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#11788 + def flags; end end # Represents the use of the `super` keyword with parentheses or arguments. @@ -13613,87 +15867,99 @@ end # super foo, bar # ^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9700 +# source://yarp//lib/yarp/node.rb#11898 class YARP::SuperNode < ::YARP::Node # def initialize: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: BlockNode?, location: Location) -> void # # @return [SuperNode] a new instance of SuperNode # - # source://yarp//lib/yarp/node.rb#9717 + # source://yarp//lib/yarp/node.rb#11915 def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9727 + # source://yarp//lib/yarp/node.rb#11925 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#9708 + # source://yarp//lib/yarp/node.rb#11906 def arguments; end # attr_reader block: BlockNode? # - # source://yarp//lib/yarp/node.rb#9714 + # source://yarp//lib/yarp/node.rb#11912 def block; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9732 + # source://yarp//lib/yarp/node.rb#11930 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9737 + # source://yarp//lib/yarp/node.rb#11943 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#11935 + def compact_child_nodes; end + # def copy: (**params) -> SuperNode # - # source://yarp//lib/yarp/node.rb#9742 + # source://yarp//lib/yarp/node.rb#11948 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9732 + # source://yarp//lib/yarp/node.rb#11930 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9757 + # source://yarp//lib/yarp/node.rb#11963 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9776 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12005 + def human; end + + # source://yarp//lib/yarp/node.rb#11982 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#9762 + # source://yarp//lib/yarp/node.rb#11968 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#9702 + # source://yarp//lib/yarp/node.rb#11900 def keyword_loc; end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#9767 + # source://yarp//lib/yarp/node.rb#11973 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#9705 + # source://yarp//lib/yarp/node.rb#11903 def lparen_loc; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#9772 + # source://yarp//lib/yarp/node.rb#11978 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#9711 + # source://yarp//lib/yarp/node.rb#11909 def rparen_loc; end end @@ -13705,82 +15971,94 @@ end # %i[foo] # ^^^ # -# source://yarp//lib/yarp/node.rb#9804 +# source://yarp//lib/yarp/node.rb#12017 class YARP::SymbolNode < ::YARP::Node # def initialize: (opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> void # # @return [SymbolNode] a new instance of SymbolNode # - # source://yarp//lib/yarp/node.rb#9818 + # source://yarp//lib/yarp/node.rb#12031 def initialize(opening_loc, value_loc, closing_loc, unescaped, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9827 + # source://yarp//lib/yarp/node.rb#12040 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9832 + # source://yarp//lib/yarp/node.rb#12045 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#9871 + # source://yarp//lib/yarp/node.rb#12089 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#9812 + # source://yarp//lib/yarp/node.rb#12025 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9837 + # source://yarp//lib/yarp/node.rb#12055 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12050 + def compact_child_nodes; end + # def copy: (**params) -> SymbolNode # - # source://yarp//lib/yarp/node.rb#9842 + # source://yarp//lib/yarp/node.rb#12060 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9832 + # source://yarp//lib/yarp/node.rb#12045 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9856 + # source://yarp//lib/yarp/node.rb#12074 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9875 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12105 + def human; end + + # source://yarp//lib/yarp/node.rb#12093 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://yarp//lib/yarp/node.rb#9861 + # source://yarp//lib/yarp/node.rb#12079 def opening; end # attr_reader opening_loc: Location? # - # source://yarp//lib/yarp/node.rb#9806 + # source://yarp//lib/yarp/node.rb#12019 def opening_loc; end # attr_reader unescaped: String # - # source://yarp//lib/yarp/node.rb#9815 + # source://yarp//lib/yarp/node.rb#12028 def unescaped; end # def value: () -> String? # - # source://yarp//lib/yarp/node.rb#9866 + # source://yarp//lib/yarp/node.rb#12084 def value; end # attr_reader value_loc: Location? # - # source://yarp//lib/yarp/node.rb#9809 + # source://yarp//lib/yarp/node.rb#12022 def value_loc; end end @@ -13823,47 +16101,59 @@ end # true # ^^^^ # -# source://yarp//lib/yarp/node.rb#9889 +# source://yarp//lib/yarp/node.rb#12114 class YARP::TrueNode < ::YARP::Node # def initialize: (location: Location) -> void # # @return [TrueNode] a new instance of TrueNode # - # source://yarp//lib/yarp/node.rb#9891 + # source://yarp//lib/yarp/node.rb#12116 def initialize(location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9896 + # source://yarp//lib/yarp/node.rb#12121 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9901 + # source://yarp//lib/yarp/node.rb#12126 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9906 + # source://yarp//lib/yarp/node.rb#12136 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12131 + def compact_child_nodes; end + # def copy: (**params) -> TrueNode # - # source://yarp//lib/yarp/node.rb#9911 + # source://yarp//lib/yarp/node.rb#12141 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9901 + # source://yarp//lib/yarp/node.rb#12126 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9921 + # source://yarp//lib/yarp/node.rb#12151 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9925 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12163 + def human; end + + # source://yarp//lib/yarp/node.rb#12155 def inspect(inspector = T.unsafe(nil)); end end @@ -13872,62 +16162,74 @@ end # undef :foo, :bar, :baz # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#9935 +# source://yarp//lib/yarp/node.rb#12172 class YARP::UndefNode < ::YARP::Node # def initialize: (names: Array[Node], keyword_loc: Location, location: Location) -> void # # @return [UndefNode] a new instance of UndefNode # - # source://yarp//lib/yarp/node.rb#9943 + # source://yarp//lib/yarp/node.rb#12180 def initialize(names, keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#9950 + # source://yarp//lib/yarp/node.rb#12187 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9955 + # source://yarp//lib/yarp/node.rb#12192 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#9960 + # source://yarp//lib/yarp/node.rb#12202 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12197 + def compact_child_nodes; end + # def copy: (**params) -> UndefNode # - # source://yarp//lib/yarp/node.rb#9965 + # source://yarp//lib/yarp/node.rb#12207 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#9955 + # source://yarp//lib/yarp/node.rb#12192 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#9977 + # source://yarp//lib/yarp/node.rb#12219 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#9986 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12238 + def human; end + + # source://yarp//lib/yarp/node.rb#12228 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#9982 + # source://yarp//lib/yarp/node.rb#12224 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#9940 + # source://yarp//lib/yarp/node.rb#12177 def keyword_loc; end # attr_reader names: Array[Node] # - # source://yarp//lib/yarp/node.rb#9937 + # source://yarp//lib/yarp/node.rb#12174 def names; end end @@ -13939,85 +16241,97 @@ end # unless foo then bar end # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#10001 +# source://yarp//lib/yarp/node.rb#12250 class YARP::UnlessNode < ::YARP::Node # def initialize: (keyword_loc: Location, predicate: Node, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> void # # @return [UnlessNode] a new instance of UnlessNode # - # source://yarp//lib/yarp/node.rb#10018 + # source://yarp//lib/yarp/node.rb#12267 def initialize(keyword_loc, predicate, statements, consequent, end_keyword_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10028 + # source://yarp//lib/yarp/node.rb#12277 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10037 + # source://yarp//lib/yarp/node.rb#12286 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10042 + # source://yarp//lib/yarp/node.rb#12300 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12291 + def compact_child_nodes; end + # attr_reader consequent: ElseNode? # - # source://yarp//lib/yarp/node.rb#10012 + # source://yarp//lib/yarp/node.rb#12261 def consequent; end # def copy: (**params) -> UnlessNode # - # source://yarp//lib/yarp/node.rb#10047 + # source://yarp//lib/yarp/node.rb#12305 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10037 + # source://yarp//lib/yarp/node.rb#12286 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10062 + # source://yarp//lib/yarp/node.rb#12320 def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://yarp//lib/yarp/node.rb#10072 + # source://yarp//lib/yarp/node.rb#12330 def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://yarp//lib/yarp/node.rb#10015 + # source://yarp//lib/yarp/node.rb#12264 def end_keyword_loc; end - # source://yarp//lib/yarp/node.rb#10076 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12358 + def human; end + + # source://yarp//lib/yarp/node.rb#12334 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#10067 + # source://yarp//lib/yarp/node.rb#12325 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#10003 + # source://yarp//lib/yarp/node.rb#12252 def keyword_loc; end # attr_reader predicate: Node # - # source://yarp//lib/yarp/node.rb#10006 + # source://yarp//lib/yarp/node.rb#12255 def predicate; end - # source://yarp//lib/yarp/node.rb#10032 + # source://yarp//lib/yarp/node.rb#12281 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#10009 + # source://yarp//lib/yarp/node.rb#12258 def statements; end end @@ -14029,93 +16343,107 @@ end # until foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#10105 +# source://yarp//lib/yarp/node.rb#12370 class YARP::UntilNode < ::YARP::Node # def initialize: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, flags: Integer, location: Location) -> void # # @return [UntilNode] a new instance of UntilNode # - # source://yarp//lib/yarp/node.rb#10122 + # source://yarp//lib/yarp/node.rb#12387 def initialize(keyword_loc, closing_loc, predicate, statements, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10132 + # source://yarp//lib/yarp/node.rb#12397 def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#10181 + # source://yarp//lib/yarp/node.rb#12454 def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10141 + # source://yarp//lib/yarp/node.rb#12406 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#10176 + # source://yarp//lib/yarp/node.rb#12449 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#10110 + # source://yarp//lib/yarp/node.rb#12375 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10146 + # source://yarp//lib/yarp/node.rb#12419 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12411 + def compact_child_nodes; end + # def copy: (**params) -> UntilNode # - # source://yarp//lib/yarp/node.rb#10151 + # source://yarp//lib/yarp/node.rb#12424 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10141 + # source://yarp//lib/yarp/node.rb#12406 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10166 + # source://yarp//lib/yarp/node.rb#12439 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#10119 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12478 + def human; end - # source://yarp//lib/yarp/node.rb#10185 + # source://yarp//lib/yarp/node.rb#12458 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#10171 + # source://yarp//lib/yarp/node.rb#12444 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#10107 + # source://yarp//lib/yarp/node.rb#12372 def keyword_loc; end # attr_reader predicate: Node # - # source://yarp//lib/yarp/node.rb#10113 + # source://yarp//lib/yarp/node.rb#12378 def predicate; end - # source://yarp//lib/yarp/node.rb#10136 + # source://yarp//lib/yarp/node.rb#12401 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#10116 + # source://yarp//lib/yarp/node.rb#12381 def statements; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#12384 + def flags; end end # The version constant is set by reading the result of calling yp_version. @@ -14123,10 +16451,15 @@ YARP::VERSION = T.let(T.unsafe(nil), String) # source://yarp//lib/yarp.rb#223 class YARP::Visitor < ::YARP::BasicVisitor - # Visit a AliasNode node + # Visit a AliasGlobalVariableNode node # # source://yarp//lib/yarp.rb#218 - def visit_alias_node(node); end + def visit_alias_global_variable_node(node); end + + # Visit a AliasMethodNode node + # + # source://yarp//lib/yarp.rb#218 + def visit_alias_method_node(node); end # Visit a AlternationPatternNode node # @@ -14448,6 +16781,11 @@ class YARP::Visitor < ::YARP::BasicVisitor # source://yarp//lib/yarp.rb#218 def visit_imaginary_node(node); end + # Visit a ImplicitNode node + # + # source://yarp//lib/yarp.rb#218 + def visit_implicit_node(node); end + # Visit a InNode node # # source://yarp//lib/yarp.rb#218 @@ -14488,6 +16826,11 @@ class YARP::Visitor < ::YARP::BasicVisitor # source://yarp//lib/yarp.rb#218 def visit_integer_node(node); end + # Visit a InterpolatedMatchLastLineNode node + # + # source://yarp//lib/yarp.rb#218 + def visit_interpolated_match_last_line_node(node); end + # Visit a InterpolatedRegularExpressionNode node # # source://yarp//lib/yarp.rb#218 @@ -14558,6 +16901,11 @@ class YARP::Visitor < ::YARP::BasicVisitor # source://yarp//lib/yarp.rb#218 def visit_local_variable_write_node(node); end + # Visit a MatchLastLineNode node + # + # source://yarp//lib/yarp.rb#218 + def visit_match_last_line_node(node); end + # Visit a MatchPredicateNode node # # source://yarp//lib/yarp.rb#218 @@ -14568,6 +16916,11 @@ class YARP::Visitor < ::YARP::BasicVisitor # source://yarp//lib/yarp.rb#218 def visit_match_required_node(node); end + # Visit a MatchWriteNode node + # + # source://yarp//lib/yarp.rb#218 + def visit_match_write_node(node); end + # Visit a MissingNode node # # source://yarp//lib/yarp.rb#218 @@ -14811,67 +17164,79 @@ end # ^^^^^^^^^ # end # -# source://yarp//lib/yarp/node.rb#10208 +# source://yarp//lib/yarp/node.rb#12489 class YARP::WhenNode < ::YARP::Node # def initialize: (keyword_loc: Location, conditions: Array[Node], statements: StatementsNode?, location: Location) -> void # # @return [WhenNode] a new instance of WhenNode # - # source://yarp//lib/yarp/node.rb#10219 + # source://yarp//lib/yarp/node.rb#12500 def initialize(keyword_loc, conditions, statements, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10227 + # source://yarp//lib/yarp/node.rb#12508 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10232 + # source://yarp//lib/yarp/node.rb#12513 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10237 + # source://yarp//lib/yarp/node.rb#12526 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12518 + def compact_child_nodes; end + # attr_reader conditions: Array[Node] # - # source://yarp//lib/yarp/node.rb#10213 + # source://yarp//lib/yarp/node.rb#12494 def conditions; end # def copy: (**params) -> WhenNode # - # source://yarp//lib/yarp/node.rb#10242 + # source://yarp//lib/yarp/node.rb#12531 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10232 + # source://yarp//lib/yarp/node.rb#12513 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10255 + # source://yarp//lib/yarp/node.rb#12544 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#10264 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12569 + def human; end + + # source://yarp//lib/yarp/node.rb#12553 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#10260 + # source://yarp//lib/yarp/node.rb#12549 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#10210 + # source://yarp//lib/yarp/node.rb#12491 def keyword_loc; end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#10216 + # source://yarp//lib/yarp/node.rb#12497 def statements; end end @@ -14883,93 +17248,107 @@ end # while foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://yarp//lib/yarp/node.rb#10285 +# source://yarp//lib/yarp/node.rb#12581 class YARP::WhileNode < ::YARP::Node # def initialize: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, flags: Integer, location: Location) -> void # # @return [WhileNode] a new instance of WhileNode # - # source://yarp//lib/yarp/node.rb#10302 + # source://yarp//lib/yarp/node.rb#12598 def initialize(keyword_loc, closing_loc, predicate, statements, flags, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10312 + # source://yarp//lib/yarp/node.rb#12608 def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://yarp//lib/yarp/node.rb#10361 + # source://yarp//lib/yarp/node.rb#12665 def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10321 + # source://yarp//lib/yarp/node.rb#12617 def child_nodes; end # def closing: () -> String? # - # source://yarp//lib/yarp/node.rb#10356 + # source://yarp//lib/yarp/node.rb#12660 def closing; end # attr_reader closing_loc: Location? # - # source://yarp//lib/yarp/node.rb#10290 + # source://yarp//lib/yarp/node.rb#12586 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10326 + # source://yarp//lib/yarp/node.rb#12630 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12622 + def compact_child_nodes; end + # def copy: (**params) -> WhileNode # - # source://yarp//lib/yarp/node.rb#10331 + # source://yarp//lib/yarp/node.rb#12635 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10321 + # source://yarp//lib/yarp/node.rb#12617 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10346 + # source://yarp//lib/yarp/node.rb#12650 def deconstruct_keys(keys); end - # attr_reader flags: Integer + # Returns a symbol representation of the type of node. # - # source://yarp//lib/yarp/node.rb#10299 - def flags; end + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12689 + def human; end - # source://yarp//lib/yarp/node.rb#10365 + # source://yarp//lib/yarp/node.rb#12669 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#10351 + # source://yarp//lib/yarp/node.rb#12655 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#10287 + # source://yarp//lib/yarp/node.rb#12583 def keyword_loc; end # attr_reader predicate: Node # - # source://yarp//lib/yarp/node.rb#10293 + # source://yarp//lib/yarp/node.rb#12589 def predicate; end - # source://yarp//lib/yarp/node.rb#10316 + # source://yarp//lib/yarp/node.rb#12612 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://yarp//lib/yarp/node.rb#10296 + # source://yarp//lib/yarp/node.rb#12592 def statements; end + + private + + # Returns the value of attribute flags. + # + # source://yarp//lib/yarp/node.rb#12595 + def flags; end end # Represents an xstring literal with no interpolation. @@ -14977,82 +17356,94 @@ end # `foo` # ^^^^^ # -# source://yarp//lib/yarp/node.rb#10386 +# source://yarp//lib/yarp/node.rb#12698 class YARP::XStringNode < ::YARP::Node # def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void # # @return [XStringNode] a new instance of XStringNode # - # source://yarp//lib/yarp/node.rb#10400 + # source://yarp//lib/yarp/node.rb#12712 def initialize(opening_loc, content_loc, closing_loc, unescaped, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10409 + # source://yarp//lib/yarp/node.rb#12721 def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10414 + # source://yarp//lib/yarp/node.rb#12726 def child_nodes; end # def closing: () -> String # - # source://yarp//lib/yarp/node.rb#10453 + # source://yarp//lib/yarp/node.rb#12770 def closing; end # attr_reader closing_loc: Location # - # source://yarp//lib/yarp/node.rb#10394 + # source://yarp//lib/yarp/node.rb#12706 def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10419 + # source://yarp//lib/yarp/node.rb#12736 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12731 + def compact_child_nodes; end + # def content: () -> String # - # source://yarp//lib/yarp/node.rb#10448 + # source://yarp//lib/yarp/node.rb#12765 def content; end # attr_reader content_loc: Location # - # source://yarp//lib/yarp/node.rb#10391 + # source://yarp//lib/yarp/node.rb#12703 def content_loc; end # def copy: (**params) -> XStringNode # - # source://yarp//lib/yarp/node.rb#10424 + # source://yarp//lib/yarp/node.rb#12741 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10414 + # source://yarp//lib/yarp/node.rb#12726 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10438 + # source://yarp//lib/yarp/node.rb#12755 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#10457 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12786 + def human; end + + # source://yarp//lib/yarp/node.rb#12774 def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://yarp//lib/yarp/node.rb#10443 + # source://yarp//lib/yarp/node.rb#12760 def opening; end # attr_reader opening_loc: Location # - # source://yarp//lib/yarp/node.rb#10388 + # source://yarp//lib/yarp/node.rb#12700 def opening_loc; end # attr_reader unescaped: String # - # source://yarp//lib/yarp/node.rb#10397 + # source://yarp//lib/yarp/node.rb#12709 def unescaped; end end @@ -15061,81 +17452,93 @@ end # yield 1 # ^^^^^^^ # -# source://yarp//lib/yarp/node.rb#10471 +# source://yarp//lib/yarp/node.rb#12795 class YARP::YieldNode < ::YARP::Node # def initialize: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location) -> void # # @return [YieldNode] a new instance of YieldNode # - # source://yarp//lib/yarp/node.rb#10485 + # source://yarp//lib/yarp/node.rb#12809 def initialize(keyword_loc, lparen_loc, arguments, rparen_loc, location); end # def accept: (visitor: Visitor) -> void # - # source://yarp//lib/yarp/node.rb#10494 + # source://yarp//lib/yarp/node.rb#12818 def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://yarp//lib/yarp/node.rb#10479 + # source://yarp//lib/yarp/node.rb#12803 def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10499 + # source://yarp//lib/yarp/node.rb#12823 def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://yarp//lib/yarp/node.rb#10504 + # source://yarp//lib/yarp/node.rb#12835 def comment_targets; end + # def compact_child_nodes: () -> Array[Node] + # + # source://yarp//lib/yarp/node.rb#12828 + def compact_child_nodes; end + # def copy: (**params) -> YieldNode # - # source://yarp//lib/yarp/node.rb#10509 + # source://yarp//lib/yarp/node.rb#12840 def copy(**params); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://yarp//lib/yarp/node.rb#10499 + # source://yarp//lib/yarp/node.rb#12823 def deconstruct; end # def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, nil | Node | Array[Node] | String | Token | Array[Token] | Location] # - # source://yarp//lib/yarp/node.rb#10523 + # source://yarp//lib/yarp/node.rb#12854 def deconstruct_keys(keys); end - # source://yarp//lib/yarp/node.rb#10542 + # Returns a symbol representation of the type of node. + # + # def human: () -> Symbol + # + # source://yarp//lib/yarp/node.rb#12890 + def human; end + + # source://yarp//lib/yarp/node.rb#12873 def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://yarp//lib/yarp/node.rb#10528 + # source://yarp//lib/yarp/node.rb#12859 def keyword; end # attr_reader keyword_loc: Location # - # source://yarp//lib/yarp/node.rb#10473 + # source://yarp//lib/yarp/node.rb#12797 def keyword_loc; end # def lparen: () -> String? # - # source://yarp//lib/yarp/node.rb#10533 + # source://yarp//lib/yarp/node.rb#12864 def lparen; end # attr_reader lparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#10476 + # source://yarp//lib/yarp/node.rb#12800 def lparen_loc; end # def rparen: () -> String? # - # source://yarp//lib/yarp/node.rb#10538 + # source://yarp//lib/yarp/node.rb#12869 def rparen; end # attr_reader rparen_loc: Location? # - # source://yarp//lib/yarp/node.rb#10482 + # source://yarp//lib/yarp/node.rb#12806 def rparen_loc; end end diff --git a/sorbet/rbi/shims/syntax_tree.rbi b/sorbet/rbi/shims/syntax_tree.rbi deleted file mode 100644 index 13a657153..000000000 --- a/sorbet/rbi/shims/syntax_tree.rbi +++ /dev/null @@ -1,11 +0,0 @@ -# typed: strict - -module SyntaxTree::WithScope - sig { returns(Scope)} - def current_scope; end - - class Scope - sig { params(name: String).returns(T.nilable(Local)) } - def find_local(name); end - end -end diff --git a/sorbet/rbi/shims/syntax_tree_nodes.rbi b/sorbet/rbi/shims/syntax_tree_nodes.rbi deleted file mode 100644 index 4e54bf0cb..000000000 --- a/sorbet/rbi/shims/syntax_tree_nodes.rbi +++ /dev/null @@ -1,7540 +0,0 @@ -# typed: strict - -class SyntaxTree::Node - # [Location] the location of this node - sig { returns(SyntaxTree::Location) } - attr_reader :location -end - -# ARef represents when you're pulling a value out of a collection at a -# specific index. Put another way, it's any time you're calling the method -# #[]. -# -# collection[index] -# -# The nodes usually contains two children, the collection and the index. In -# some cases, you don't necessarily have the second child node, because you -# can call procs with a pretty esoteric syntax. In the following example, you -# wouldn't have a second child node: -# -# collection[] -# -class SyntaxTree::ARef < SyntaxTree::Node - # [Node] the value being indexed - sig { returns(SyntaxTree::Node) } - attr_reader :collection - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Args] the value being passed within the brackets - sig { returns(T.nilable(SyntaxTree::Args)) } - attr_reader :index - - sig do - params( - collection: SyntaxTree::Node, - index: T.nilable(SyntaxTree::Args), - location: SyntaxTree::Location - ).void - end - def initialize(collection:, index:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ARefField represents assigning values into collections at specific indices. -# Put another way, it's any time you're calling the method #[]=. The -# ARefField node itself is just the left side of the assignment, and they're -# always wrapped in assign nodes. -# -# collection[index] = value -# -class SyntaxTree::ARefField < SyntaxTree::Node - # [Node] the value being indexed - sig { returns(SyntaxTree::Node) } - attr_reader :collection - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Args] the value being passed within the brackets - sig { returns(T.nilable(SyntaxTree::Args)) } - attr_reader :index - - sig do - params( - collection: SyntaxTree::Node, - index: T.nilable(SyntaxTree::Args), - location: SyntaxTree::Location - ).void - end - def initialize(collection:, index:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Alias represents the use of the +alias+ keyword with regular arguments (not -# global variables). The +alias+ keyword is used to make a method respond to -# another name as well as the current one. -# -# alias aliased_name name -# -# For the example above, in the current context you can now call aliased_name -# and it will execute the name method. When you're aliasing two methods, you -# can either provide bare words (like the example above) or you can provide -# symbols (note that this includes dynamic symbols like -# :"left-#{middle}-right"). -class SyntaxTree::AliasNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [DynaSymbol | GVar | SymbolLiteral] the new name of the method - sig do - returns( - T.any(SyntaxTree::DynaSymbol, SyntaxTree::GVar, SyntaxTree::SymbolLiteral) - ) - end - attr_reader :left - - # [Backref | DynaSymbol | GVar | SymbolLiteral] the old name of the method - sig do - returns( - T.any( - SyntaxTree::Backref, - SyntaxTree::DynaSymbol, - SyntaxTree::GVar, - SyntaxTree::SymbolLiteral - ) - ) - end - attr_reader :right - - sig do - params( - left: - T.any( - SyntaxTree::DynaSymbol, - SyntaxTree::GVar, - SyntaxTree::SymbolLiteral - ), - right: - T.any( - SyntaxTree::Backref, - SyntaxTree::DynaSymbol, - SyntaxTree::GVar, - SyntaxTree::SymbolLiteral - ), - location: SyntaxTree::Location - ).void - end - def initialize(left:, right:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ArgBlock represents using a block operator on an expression. -# -# method(&expression) -# -class SyntaxTree::ArgBlock < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the expression being turned into a block - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :value - - sig do - params( - value: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ArgParen represents wrapping arguments to a method inside a set of -# parentheses. -# -# method(argument) -# -# In the example above, there would be an ArgParen node around the Args node -# that represents the set of arguments being sent to the method method. The -# argument child node can be +nil+ if no arguments were passed, as in: -# -# method() -# -class SyntaxTree::ArgParen < SyntaxTree::Node - # [nil | Args | ArgsForward] the arguments inside the - # parentheses - sig { returns(T.nilable(T.any(SyntaxTree::Args, SyntaxTree::ArgsForward))) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - arguments: T.nilable(T.any(SyntaxTree::Args, SyntaxTree::ArgsForward)), - location: SyntaxTree::Location - ).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Star represents using a splat operator on an expression. -# -# method(*arguments) -# -class SyntaxTree::ArgStar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the expression being splatted - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :value - - sig do - params( - value: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Args represents a list of arguments being passed to a method call or array -# literal. -# -# method(first, second, third) -# -class SyntaxTree::Args < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ Node ]] the arguments that this node wraps - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :parts - - sig do - params( - parts: T::Array[SyntaxTree::Node], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ArgsForward represents forwarding all kinds of arguments onto another method -# call. -# -# def request(method, path, **headers, &block); end -# -# def get(...) -# request(:GET, ...) -# end -# -# def post(...) -# request(:POST, ...) -# end -# -# In the example above, both the get and post methods are forwarding all of -# their arguments (positional, keyword, and block) on to the request method. -# The ArgsForward node appears in both the caller (the request method calls) -# and the callee (the get and post definitions). -class SyntaxTree::ArgsForward < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig { params(location: SyntaxTree::Location).void } - def initialize(location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ArrayLiteral represents an array literal, which can optionally contain -# elements. -# -# [] -# [one, two, three] -# -class SyntaxTree::ArrayLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Args] the contents of the array - sig { returns(T.nilable(SyntaxTree::Args)) } - attr_reader :contents - - # [nil | LBracket | QSymbolsBeg | QWordsBeg | SymbolsBeg | WordsBeg] the - # bracket that opens this array - sig do - returns( - T.nilable( - T.any( - SyntaxTree::LBracket, - SyntaxTree::QSymbolsBeg, - SyntaxTree::QWordsBeg, - SyntaxTree::SymbolsBeg, - SyntaxTree::WordsBeg - ) - ) - ) - end - attr_reader :lbracket - - sig do - params( - lbracket: - T.nilable( - T.any( - SyntaxTree::LBracket, - SyntaxTree::QSymbolsBeg, - SyntaxTree::QWordsBeg, - SyntaxTree::SymbolsBeg, - SyntaxTree::WordsBeg - ) - ), - contents: T.nilable(SyntaxTree::Args), - location: SyntaxTree::Location - ).void - end - def initialize(lbracket:, contents:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# AryPtn represents matching against an array pattern using the Ruby 2.7+ -# pattern matching syntax. It’s one of the more complicated nodes, because -# the four parameters that it accepts can almost all be nil. -# -# case [1, 2, 3] -# in [Integer, Integer] -# "matched" -# in Container[Integer, Integer] -# "matched" -# in [Integer, *, Integer] -# "matched" -# end -# -# An AryPtn node is created with four parameters: an optional constant -# wrapper, an array of positional matches, an optional splat with identifier, -# and an optional array of positional matches that occur after the splat. -# All of the in clauses above would create an AryPtn node. -class SyntaxTree::AryPtn < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | VarRef] the optional constant wrapper - sig { returns(T.nilable(SyntaxTree::VarRef)) } - attr_reader :constant - - # [Array[ Node ]] the list of positional arguments occurring after the - # optional star if there is one - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :posts - - # [Array[ Node ]] the regular positional arguments that this array - # pattern is matching against - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :requireds - - # [nil | VarField] the optional starred identifier that grabs up a list of - # positional arguments - sig { returns(T.nilable(SyntaxTree::VarField)) } - attr_reader :rest - - sig do - params( - constant: T.nilable(SyntaxTree::VarRef), - requireds: T::Array[SyntaxTree::Node], - rest: T.nilable(SyntaxTree::VarField), - posts: T::Array[SyntaxTree::Node], - location: SyntaxTree::Location - ).void - end - def initialize(constant:, requireds:, rest:, posts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Assign represents assigning something to a variable or constant. Generally, -# the left side of the assignment is going to be any node that ends with the -# name "Field". -# -# variable = value -# -class SyntaxTree::Assign < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [ARefField | ConstPathField | Field | TopConstField | VarField] the target - # to assign the result of the expression to - sig do - returns( - T.any( - SyntaxTree::ARefField, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ) - ) - end - attr_reader :target - - # [Node] the expression to be assigned - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig do - params( - target: - T.any( - SyntaxTree::ARefField, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ), - value: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(target:, value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Assoc represents a key-value pair within a hash. It is a child node of -# either an AssocListFromArgs or a BareAssocHash. -# -# { key1: value1, key2: value2 } -# -# In the above example, the would be two Assoc nodes. -class SyntaxTree::Assoc < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the key of this pair - sig { returns(SyntaxTree::Node) } - attr_reader :key - - # [nil | Node] the value of this pair - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :value - - sig do - params( - key: SyntaxTree::Node, - value: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(key:, value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# AssocSplat represents double-splatting a value into a hash (either a hash -# literal or a bare hash in a method call). -# -# { **pairs } -# -class SyntaxTree::AssocSplat < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the expression that is being splatted - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :value - - sig do - params( - value: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# BEGINBlock represents the use of the +BEGIN+ keyword, which hooks into the -# lifecycle of the interpreter. Whatever is inside the block will get executed -# when the program starts. -# -# BEGIN { -# } -# -# Interestingly, the BEGIN keyword doesn't allow the do and end keywords for -# the block. Only braces are permitted. -class SyntaxTree::BEGINBlock < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [LBrace] the left brace that is seen after the keyword - sig { returns(SyntaxTree::LBrace) } - attr_reader :lbrace - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - lbrace: SyntaxTree::LBrace, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(lbrace:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Backref represents a global variable referencing a matched value. It comes -# in the form of a $ followed by a positive integer. -# -# $1 -# -class SyntaxTree::Backref < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the name of the global backreference variable - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Backtick represents the use of the ` operator. It's usually found being used -# for an XStringLiteral, but could also be found as the name of a method being -# defined. -class SyntaxTree::Backtick < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the backtick in the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# BareAssocHash represents a hash of contents being passed as a method -# argument (and therefore has omitted braces). It's very similar to an -# AssocListFromArgs node. -# -# method(key1: value1, key2: value2) -# -class SyntaxTree::BareAssocHash < SyntaxTree::Node - # [Array[ Assoc | AssocSplat ]] - sig { returns(T::Array[T.any(SyntaxTree::Assoc, SyntaxTree::AssocSplat)]) } - attr_reader :assocs - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - assocs: T::Array[T.any(SyntaxTree::Assoc, SyntaxTree::AssocSplat)], - location: SyntaxTree::Location - ).void - end - def initialize(assocs:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Begin represents a begin..end chain. -# -# begin -# value -# end -# -class SyntaxTree::Begin < SyntaxTree::Node - # [BodyStmt] the bodystmt that contains the contents of this begin block - sig { returns(SyntaxTree::BodyStmt) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params(bodystmt: SyntaxTree::BodyStmt, location: SyntaxTree::Location).void - end - def initialize(bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Binary represents any expression that involves two sub-expressions with an -# operator in between. This can be something that looks like a mathematical -# operation: -# -# 1 + 1 -# -# but can also be something like pushing a value onto an array: -# -# array << value -# -class SyntaxTree::Binary < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the left-hand side of the expression - sig { returns(SyntaxTree::Node) } - attr_reader :left - - # [Symbol] the operator used between the two expressions - sig { returns(Symbol) } - attr_reader :operator - - # [Node] the right-hand side of the expression - sig { returns(SyntaxTree::Node) } - attr_reader :right - - sig do - params( - left: SyntaxTree::Node, - operator: Symbol, - right: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(left:, operator:, right:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# BlockArg represents declaring a block parameter on a method definition. -# -# def method(&block); end -# -class SyntaxTree::BlockArg < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Ident] the name of the block argument - sig { returns(T.nilable(SyntaxTree::Ident)) } - attr_reader :name - - sig do - params( - name: T.nilable(SyntaxTree::Ident), - location: SyntaxTree::Location - ).void - end - def initialize(name:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Block represents passing a block to a method call using the +do+ and +end+ -# keywords or the +{+ and +}+ operators. -# -# method do |value| -# end -# -# method { |value| } -# -class SyntaxTree::BlockNode < SyntaxTree::Node - # [nil | BlockVar] the optional variable declaration within this block - sig { returns(T.nilable(SyntaxTree::BlockVar)) } - attr_reader :block_var - - # [BodyStmt | Statements] the expressions to be executed within this block - sig { returns(T.any(SyntaxTree::BodyStmt, SyntaxTree::Statements)) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [LBrace | Kw] the left brace or the do keyword that opens this block - sig { returns(T.any(SyntaxTree::LBrace, SyntaxTree::Kw)) } - attr_reader :opening - - sig do - params( - opening: T.any(SyntaxTree::LBrace, SyntaxTree::Kw), - block_var: T.nilable(SyntaxTree::BlockVar), - bodystmt: T.any(SyntaxTree::BodyStmt, SyntaxTree::Statements), - location: SyntaxTree::Location - ).void - end - def initialize(opening:, block_var:, bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# BlockVar represents the parameters being declared for a block. Effectively -# this node is everything contained within the pipes. This includes all of the -# various parameter types, as well as block-local variable declarations. -# -# method do |positional, optional = value, keyword:, █ local| -# end -# -class SyntaxTree::BlockVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ Ident ]] the list of block-local variable declarations - sig { returns(T::Array[SyntaxTree::Ident]) } - attr_reader :locals - - # [Params] the parameters being declared with the block - sig { returns(SyntaxTree::Params) } - attr_reader :params - - sig do - params( - params: SyntaxTree::Params, - locals: T::Array[SyntaxTree::Ident], - location: SyntaxTree::Location - ).void - end - def initialize(params:, locals:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# bodystmt can't actually determine its bounds appropriately because it -# doesn't necessarily know where it started. So the parent node needs to -# report back down into this one where it goes. -class SyntaxTree::BodyStmt < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Statements] the optional set of statements inside the else clause - sig { returns(T.nilable(SyntaxTree::Statements)) } - attr_reader :else_clause - - # [nil | Kw] the optional else keyword - sig { returns(T.nilable(SyntaxTree::Kw)) } - attr_reader :else_keyword - - # [nil | Ensure] the optional ensure clause - sig { returns(T.nilable(SyntaxTree::Ensure)) } - attr_reader :ensure_clause - - # [nil | Rescue] the optional rescue chain attached to the begin clause - sig { returns(T.nilable(SyntaxTree::Rescue)) } - attr_reader :rescue_clause - - # [Statements] the list of statements inside the begin clause - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - statements: SyntaxTree::Statements, - rescue_clause: T.nilable(SyntaxTree::Rescue), - else_keyword: T.nilable(SyntaxTree::Kw), - else_clause: T.nilable(SyntaxTree::Statements), - ensure_clause: T.nilable(SyntaxTree::Ensure), - location: SyntaxTree::Location - ).void - end - def initialize( - statements:, - rescue_clause:, - else_keyword:, - else_clause:, - ensure_clause:, - location: - ) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Break represents using the +break+ keyword. -# -# break -# -# It can also optionally accept arguments, as in: -# -# break 1 -# -class SyntaxTree::Break < SyntaxTree::Node - # [Args] the arguments being sent to the keyword - sig { returns(SyntaxTree::Args) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params(arguments: SyntaxTree::Args, location: SyntaxTree::Location).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# CHAR irepresents a single codepoint in the script encoding. -# -# ?a -# -# In the example above, the CHAR node represents the string literal "a". You -# can use control characters with this as well, as in ?\C-a. -class SyntaxTree::CHAR < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the character literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# CVar represents the use of a class variable. -# -# @@variable -# -class SyntaxTree::CVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the name of the class variable - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# CallNode represents a method call. -# -# receiver.message -# -class SyntaxTree::CallNode < SyntaxTree::Node - # [nil | ArgParen | Args] the arguments to the method call - sig { returns(T.nilable(T.any(SyntaxTree::ArgParen, SyntaxTree::Args))) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [:call | Backtick | Const | Ident | Op] the message being sent - sig do - returns( - T.any( - Symbol, - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::Ident, - SyntaxTree::Op - ) - ) - end - attr_reader :message - - # [nil | :"::" | Op | Period] the operator being used to send the message - sig { returns(T.nilable(T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period))) } - attr_reader :operator - - # [nil | Node] the receiver of the method call - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :receiver - - sig do - params( - receiver: T.nilable(SyntaxTree::Node), - operator: T.nilable(T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period)), - message: - T.any( - Symbol, - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::Ident, - SyntaxTree::Op - ), - arguments: T.nilable(T.any(SyntaxTree::ArgParen, SyntaxTree::Args)), - location: SyntaxTree::Location - ).void - end - def initialize(receiver:, operator:, message:, arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Case represents the beginning of a case chain. -# -# case value -# when 1 -# "one" -# when 2 -# "two" -# else -# "number" -# end -# -class SyntaxTree::Case < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [In | When] the next clause in the chain - sig { returns(T.any(SyntaxTree::In, SyntaxTree::When)) } - attr_reader :consequent - - # [Kw] the keyword that opens this expression - sig { returns(SyntaxTree::Kw) } - attr_reader :keyword - - # [nil | Node] optional value being switched on - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :value - - sig do - params( - keyword: SyntaxTree::Kw, - value: T.nilable(SyntaxTree::Node), - consequent: T.any(SyntaxTree::In, SyntaxTree::When), - location: SyntaxTree::Location - ).void - end - def initialize(keyword:, value:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Class represents defining a class using the +class+ keyword. -# -# class Container -# end -# -# Classes can have path names as their class name in case it's being nested -# under a namespace, as in: -# -# class Namespace::Container -# end -# -# Classes can also be defined as a top-level path, in the case that it's -# already in a namespace but you want to define it at the top-level instead, -# as in: -# -# module OtherNamespace -# class ::Namespace::Container -# end -# end -# -# All of these declarations can also have an optional superclass reference, as -# in: -# -# class Child < Parent -# end -# -# That superclass can actually be any Ruby expression, it doesn't necessarily -# need to be a constant, as in: -# -# class Child < method -# end -# -class SyntaxTree::ClassDeclaration < SyntaxTree::Node - # [BodyStmt] the expressions to execute within the context of the class - sig { returns(SyntaxTree::BodyStmt) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [ConstPathRef | ConstRef | TopConstRef] the name of the class being - # defined - sig do - returns( - T.any( - SyntaxTree::ConstPathRef, - SyntaxTree::ConstRef, - SyntaxTree::TopConstRef - ) - ) - end - attr_reader :constant - - # [nil | Node] the optional superclass declaration - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :superclass - - sig do - params( - constant: - T.any( - SyntaxTree::ConstPathRef, - SyntaxTree::ConstRef, - SyntaxTree::TopConstRef - ), - superclass: T.nilable(SyntaxTree::Node), - bodystmt: SyntaxTree::BodyStmt, - location: SyntaxTree::Location - ).void - end - def initialize(constant:, superclass:, bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Comma represents the use of the , operator. -class SyntaxTree::Comma < SyntaxTree::Node - # [String] the comma in the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Command represents a method call with arguments and no parentheses. Note -# that Command nodes only happen when there is no explicit receiver for this -# method. -# -# method argument -# -class SyntaxTree::Command < SyntaxTree::Node - # [Args] the arguments being sent with the message - sig { returns(SyntaxTree::Args) } - attr_reader :arguments - - # [nil | BlockNode] the optional block being passed to the method - sig { returns(T.nilable(SyntaxTree::BlockNode)) } - attr_reader :block - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const | Ident] the message being sent to the implicit receiver - sig { returns(T.any(SyntaxTree::Const, SyntaxTree::Ident)) } - attr_reader :message - - sig do - params( - message: T.any(SyntaxTree::Const, SyntaxTree::Ident), - arguments: SyntaxTree::Args, - block: T.nilable(SyntaxTree::BlockNode), - location: SyntaxTree::Location - ).void - end - def initialize(message:, arguments:, block:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# CommandCall represents a method call on an object with arguments and no -# parentheses. -# -# object.method argument -# -class SyntaxTree::CommandCall < SyntaxTree::Node - # [nil | Args | ArgParen] the arguments going along with the message - sig { returns(T.nilable(T.any(SyntaxTree::Args, SyntaxTree::ArgParen))) } - attr_reader :arguments - - # [nil | BlockNode] the block associated with this method call - sig { returns(T.nilable(SyntaxTree::BlockNode)) } - attr_reader :block - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [:call | Const | Ident | Op] the message being send - sig do - returns(T.any(Symbol, SyntaxTree::Const, SyntaxTree::Ident, SyntaxTree::Op)) - end - attr_reader :message - - # [nil | :"::" | Op | Period] the operator used to send the message - sig { returns(T.nilable(T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period))) } - attr_reader :operator - - # [nil | Node] the receiver of the message - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :receiver - - sig do - params( - receiver: T.nilable(SyntaxTree::Node), - operator: T.nilable(T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period)), - message: - T.any(Symbol, SyntaxTree::Const, SyntaxTree::Ident, SyntaxTree::Op), - arguments: T.nilable(T.any(SyntaxTree::Args, SyntaxTree::ArgParen)), - block: T.nilable(SyntaxTree::BlockNode), - location: SyntaxTree::Location - ).void - end - def initialize(receiver:, operator:, message:, arguments:, block:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Comment represents a comment in the source. -# -# # comment -# -class SyntaxTree::Comment < SyntaxTree::Node - # [boolean] whether or not there is code on the same line as this comment. - # If there is, then inline will be true. - sig { returns(T.any(TrueClass, FalseClass)) } - attr_reader :inline - - # [String] the contents of the comment - sig { returns(String) } - attr_reader :value - - sig do - params( - value: String, - inline: T.any(TrueClass, FalseClass), - location: SyntaxTree::Location - ).void - end - def initialize(value:, inline:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Const represents a literal value that _looks_ like a constant. This could -# actually be a reference to a constant: -# -# Constant -# -# It could also be something that looks like a constant in another context, as -# in a method call to a capitalized method: -# -# object.Constant -# -# or a symbol that starts with a capital letter: -# -# :Constant -# -class SyntaxTree::Const < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the name of the constant - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ConstPathField represents the child node of some kind of assignment. It -# represents when you're assigning to a constant that is being referenced as -# a child of another variable. -# -# object::Const = value -# -class SyntaxTree::ConstPathField < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const] the constant itself - sig { returns(SyntaxTree::Const) } - attr_reader :constant - - # [Node] the source of the constant - sig { returns(SyntaxTree::Node) } - attr_reader :parent - - sig do - params( - parent: SyntaxTree::Node, - constant: SyntaxTree::Const, - location: SyntaxTree::Location - ).void - end - def initialize(parent:, constant:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ConstPathRef represents referencing a constant by a path. -# -# object::Const -# -class SyntaxTree::ConstPathRef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const] the constant itself - sig { returns(SyntaxTree::Const) } - attr_reader :constant - - # [Node] the source of the constant - sig { returns(SyntaxTree::Node) } - attr_reader :parent - - sig do - params( - parent: SyntaxTree::Node, - constant: SyntaxTree::Const, - location: SyntaxTree::Location - ).void - end - def initialize(parent:, constant:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ConstRef represents the name of the constant being used in a class or module -# declaration. -# -# class Container -# end -# -class SyntaxTree::ConstRef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const] the constant itself - sig { returns(SyntaxTree::Const) } - attr_reader :constant - - sig do - params(constant: SyntaxTree::Const, location: SyntaxTree::Location).void - end - def initialize(constant:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Def represents defining a regular method on the current self object. -# -# def method(param) result end -# def object.method(param) result end -# -class SyntaxTree::DefNode < SyntaxTree::Node - # [BodyStmt | Node] the expressions to be executed by the method - sig { returns(T.any(SyntaxTree::BodyStmt, SyntaxTree::Node)) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Backtick | Const | Ident | Kw | Op] the name of the method - sig do - returns( - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::Ident, - SyntaxTree::Kw, - SyntaxTree::Op - ) - ) - end - attr_reader :name - - # [nil | Op | Period] the operator being used to declare the method - sig { returns(T.nilable(T.any(SyntaxTree::Op, SyntaxTree::Period))) } - attr_reader :operator - - # [nil | Params | Paren] the parameter declaration for the method - sig { returns(T.nilable(T.any(SyntaxTree::Params, SyntaxTree::Paren))) } - attr_reader :params - - # [nil | Node] the target where the method is being defined - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :target - - sig do - params( - target: T.nilable(SyntaxTree::Node), - operator: T.nilable(T.any(SyntaxTree::Op, SyntaxTree::Period)), - name: - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::Ident, - SyntaxTree::Kw, - SyntaxTree::Op - ), - params: T.nilable(T.any(SyntaxTree::Params, SyntaxTree::Paren)), - bodystmt: T.any(SyntaxTree::BodyStmt, SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(target:, operator:, name:, params:, bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Defined represents the use of the +defined?+ operator. It can be used with -# and without parentheses. -# -# defined?(variable) -# -class SyntaxTree::Defined < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the value being sent to the keyword - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig { params(value: SyntaxTree::Node, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# DynaSymbol represents a symbol literal that uses quotes to dynamically -# define its value. -# -# :"#{variable}" -# -# They can also be used as a special kind of dynamic hash key, as in: -# -# { "#{key}": value } -# -class SyntaxTree::DynaSymbol < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the - # dynamic symbol - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringDVar, - SyntaxTree::StringEmbExpr, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - # [nil | String] the quote used to delimit the dynamic symbol - sig { returns(T.nilable(String)) } - attr_reader :quote - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringDVar, - SyntaxTree::StringEmbExpr, - SyntaxTree::TStringContent - ) - ], - quote: T.nilable(String), - location: SyntaxTree::Location - ).void - end - def initialize(parts:, quote:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ENDBlock represents the use of the +END+ keyword, which hooks into the -# lifecycle of the interpreter. Whatever is inside the block will get executed -# when the program ends. -# -# END { -# } -# -# Interestingly, the END keyword doesn't allow the do and end keywords for the -# block. Only braces are permitted. -class SyntaxTree::ENDBlock < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [LBrace] the left brace that is seen after the keyword - sig { returns(SyntaxTree::LBrace) } - attr_reader :lbrace - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - lbrace: SyntaxTree::LBrace, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(lbrace:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Else represents the end of an +if+, +unless+, or +case+ chain. -# -# if variable -# else -# end -# -class SyntaxTree::Else < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Kw] the else keyword - sig { returns(SyntaxTree::Kw) } - attr_reader :keyword - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - keyword: SyntaxTree::Kw, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(keyword:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Elsif represents another clause in an +if+ or +unless+ chain. -# -# if variable -# elsif other_variable -# end -# -class SyntaxTree::Elsif < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Elsif | Else] the next clause in the chain - sig { returns(T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else))) } - attr_reader :consequent - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - predicate: SyntaxTree::Node, - statements: SyntaxTree::Statements, - consequent: T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else)), - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# EmbDoc represents a multi-line comment. -# -# =begin -# first line -# second line -# =end -# -class SyntaxTree::EmbDoc < SyntaxTree::Node - # [String] the contents of the comment - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# EmbExprBeg represents the beginning token for using interpolation inside of -# a parent node that accepts string content (like a string or regular -# expression). -# -# "Hello, #{person}!" -# -class SyntaxTree::EmbExprBeg < SyntaxTree::Node - # [String] the #{ used in the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# EmbExprEnd represents the ending token for using interpolation inside of a -# parent node that accepts string content (like a string or regular -# expression). -# -# "Hello, #{person}!" -# -class SyntaxTree::EmbExprEnd < SyntaxTree::Node - # [String] the } used in the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# EmbVar represents the use of shorthand interpolation for an instance, class, -# or global variable into a parent node that accepts string content (like a -# string or regular expression). -# -# "#@variable" -# -# In the example above, an EmbVar node represents the # because it forces -# @variable to be interpolated. -class SyntaxTree::EmbVar < SyntaxTree::Node - # [String] the # used in the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# EndContent represents the use of __END__ syntax, which allows individual -# scripts to keep content after the main ruby code that can be read through -# the DATA constant. -# -# puts DATA.read -# -# __END__ -# some other content that is not executed by the program -# -class SyntaxTree::EndContent < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the content after the script - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Ensure represents the use of the +ensure+ keyword and its subsequent -# statements. -# -# begin -# ensure -# end -# -class SyntaxTree::Ensure < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Kw] the ensure keyword that began this node - sig { returns(SyntaxTree::Kw) } - attr_reader :keyword - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - keyword: SyntaxTree::Kw, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(keyword:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ExcessedComma represents a trailing comma in a list of block parameters. It -# changes the block parameters such that they will destructure. -# -# [[1, 2, 3], [2, 3, 4]].each do |first, second,| -# end -# -# In the above example, an ExcessedComma node would appear in the third -# position of the Params node that is used to declare that block. The third -# position typically represents a rest-type parameter, but in this case is -# used to indicate that a trailing comma was used. -class SyntaxTree::ExcessedComma < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the comma - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Field is always the child of an assignment. It represents assigning to a -# “field” on an object. -# -# object.variable = value -# -class SyntaxTree::Field < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const | Ident] the name of the field being assigned - sig { returns(T.any(SyntaxTree::Const, SyntaxTree::Ident)) } - attr_reader :name - - # [:"::" | Op | Period] the operator being used for the assignment - sig { returns(T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period)) } - attr_reader :operator - - # [Node] the parent object that owns the field being assigned - sig { returns(SyntaxTree::Node) } - attr_reader :parent - - sig do - params( - parent: SyntaxTree::Node, - operator: T.any(Symbol, SyntaxTree::Op, SyntaxTree::Period), - name: T.any(SyntaxTree::Const, SyntaxTree::Ident), - location: SyntaxTree::Location - ).void - end - def initialize(parent:, operator:, name:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# FloatLiteral represents a floating point number literal. -# -# 1.0 -# -class SyntaxTree::FloatLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the floating point number literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# FndPtn represents matching against a pattern where you find a pattern in an -# array using the Ruby 3.0+ pattern matching syntax. -# -# case value -# in [*, 7, *] -# end -# -class SyntaxTree::FndPtn < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the optional constant wrapper - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :constant - - # [VarField] the splat on the left-hand side - sig { returns(SyntaxTree::VarField) } - attr_reader :left - - # [VarField] the splat on the right-hand side - sig { returns(SyntaxTree::VarField) } - attr_reader :right - - # [Array[ Node ]] the list of positional expressions in the pattern that - # are being matched - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :values - - sig do - params( - constant: T.nilable(SyntaxTree::Node), - left: SyntaxTree::VarField, - values: T::Array[SyntaxTree::Node], - right: SyntaxTree::VarField, - location: SyntaxTree::Location - ).void - end - def initialize(constant:, left:, values:, right:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# For represents using a +for+ loop. -# -# for value in list do -# end -# -class SyntaxTree::For < SyntaxTree::Node - # [Node] the object being enumerated in the loop - sig { returns(SyntaxTree::Node) } - attr_reader :collection - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [MLHS | VarField] the variable declaration being used to - # pull values out of the object being enumerated - sig { returns(T.any(SyntaxTree::MLHS, SyntaxTree::VarField)) } - attr_reader :index - - # [Statements] the statements to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - index: T.any(SyntaxTree::MLHS, SyntaxTree::VarField), - collection: SyntaxTree::Node, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(index:, collection:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# GVar represents a global variable literal. -# -# $variable -# -class SyntaxTree::GVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the name of the global variable - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# HashLiteral represents a hash literal. -# -# { key => value } -# -class SyntaxTree::HashLiteral < SyntaxTree::Node - # [Array[ Assoc | AssocSplat ]] the optional contents of the hash - sig { returns(T::Array[T.any(SyntaxTree::Assoc, SyntaxTree::AssocSplat)]) } - attr_reader :assocs - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [LBrace] the left brace that opens this hash - sig { returns(SyntaxTree::LBrace) } - attr_reader :lbrace - - sig do - params( - lbrace: SyntaxTree::LBrace, - assocs: T::Array[T.any(SyntaxTree::Assoc, SyntaxTree::AssocSplat)], - location: SyntaxTree::Location - ).void - end - def initialize(lbrace:, assocs:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Heredoc represents a heredoc string literal. -# -# <<~DOC -# contents -# DOC -# -class SyntaxTree::Heredoc < SyntaxTree::Node - # [HeredocBeg] the opening of the heredoc - sig { returns(SyntaxTree::HeredocBeg) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Integer] how far to dedent the heredoc - sig { returns(Integer) } - attr_reader :dedent - - # [HeredocEnd] the ending of the heredoc - sig { returns(SyntaxTree::HeredocEnd) } - attr_reader :ending - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # heredoc string literal - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - beginning: SyntaxTree::HeredocBeg, - location: SyntaxTree::Location, - ending: SyntaxTree::HeredocEnd, - dedent: Integer, - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ).void - end - def initialize( - beginning:, - location:, - ending: T.unsafe(nil), - dedent: T.unsafe(nil), - parts: T.unsafe(nil) - ) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# HeredocBeg represents the beginning declaration of a heredoc. -# -# <<~DOC -# contents -# DOC -# -# In the example above the HeredocBeg node represents <<~DOC. -class SyntaxTree::HeredocBeg < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the opening declaration of the heredoc - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# HeredocEnd represents the closing declaration of a heredoc. -# -# <<~DOC -# contents -# DOC -# -# In the example above the HeredocEnd node represents the closing DOC. -class SyntaxTree::HeredocEnd < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the closing declaration of the heredoc - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# HshPtn represents matching against a hash pattern using the Ruby 2.7+ -# pattern matching syntax. -# -# case value -# in { key: } -# end -# -class SyntaxTree::HshPtn < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the optional constant wrapper - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :constant - - # [nil | VarField] an optional parameter to gather up all remaining keywords - sig { returns(T.nilable(SyntaxTree::VarField)) } - attr_reader :keyword_rest - - # [Array[ [DynaSymbol | Label, nil | Node] ]] the set of tuples - # representing the keywords that should be matched against in the pattern - sig do - returns( - T::Array[ - [ - T.any(SyntaxTree::DynaSymbol, SyntaxTree::Label), - T.nilable(SyntaxTree::Node) - ] - ] - ) - end - attr_reader :keywords - - sig do - params( - constant: T.nilable(SyntaxTree::Node), - keywords: - T::Array[ - [ - T.any(SyntaxTree::DynaSymbol, SyntaxTree::Label), - T.nilable(SyntaxTree::Node) - ] - ], - keyword_rest: T.nilable(SyntaxTree::VarField), - location: SyntaxTree::Location - ).void - end - def initialize(constant:, keywords:, keyword_rest:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# IVar represents an instance variable literal. -# -# @variable -# -class SyntaxTree::IVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the name of the instance variable - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Ident represents an identifier anywhere in code. It can represent a very -# large number of things, depending on where it is in the syntax tree. -# -# value -# -class SyntaxTree::Ident < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the identifier - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# If represents the first clause in an +if+ chain. -# -# if predicate -# end -# -class SyntaxTree::IfNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Elsif | Else] the next clause in the chain - sig { returns(T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else))) } - attr_reader :consequent - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - predicate: SyntaxTree::Node, - statements: SyntaxTree::Statements, - consequent: T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else)), - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# IfOp represents a ternary clause. -# -# predicate ? truthy : falsy -# -class SyntaxTree::IfOp < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the expression to be executed if the predicate is falsy - sig { returns(SyntaxTree::Node) } - attr_reader :falsy - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Node] the expression to be executed if the predicate is truthy - sig { returns(SyntaxTree::Node) } - attr_reader :truthy - - sig do - params( - predicate: SyntaxTree::Node, - truthy: SyntaxTree::Node, - falsy: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, truthy:, falsy:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Imaginary represents an imaginary number literal. -# -# 1i -# -class SyntaxTree::Imaginary < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the imaginary number literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# In represents using the +in+ keyword within the Ruby 2.7+ pattern matching -# syntax. -# -# case value -# in pattern -# end -# -class SyntaxTree::In < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | In | Else] the next clause in the chain - sig { returns(T.nilable(T.any(SyntaxTree::In, SyntaxTree::Else))) } - attr_reader :consequent - - # [Node] the pattern to check against - sig { returns(SyntaxTree::Node) } - attr_reader :pattern - - # [Statements] the expressions to execute if the pattern matched - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - pattern: SyntaxTree::Node, - statements: SyntaxTree::Statements, - consequent: T.nilable(T.any(SyntaxTree::In, SyntaxTree::Else)), - location: SyntaxTree::Location - ).void - end - def initialize(pattern:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Int represents an integer number literal. -# -# 1 -# -class SyntaxTree::Int < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the integer - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Kw represents the use of a keyword. It can be almost anywhere in the syntax -# tree, so you end up seeing it quite a lot. -# -# if value -# end -# -# In the above example, there would be two Kw nodes: one for the if and one -# for the end. Note that anything that matches the list of keywords in Ruby -# will use a Kw, so if you use a keyword in a symbol literal for instance: -# -# :if -# -# then the contents of the symbol node will contain a Kw node. -class SyntaxTree::Kw < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Symbol] the symbol version of the value - sig { returns(Symbol) } - attr_reader :name - - # [String] the value of the keyword - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# KwRestParam represents defining a parameter in a method definition that -# accepts all remaining keyword parameters. -# -# def method(**kwargs) end -# -class SyntaxTree::KwRestParam < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Ident] the name of the parameter - sig { returns(T.nilable(SyntaxTree::Ident)) } - attr_reader :name - - sig do - params( - name: T.nilable(SyntaxTree::Ident), - location: SyntaxTree::Location - ).void - end - def initialize(name:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# LBrace represents the use of a left brace, i.e., {. -class SyntaxTree::LBrace < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the left brace - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# LBracket represents the use of a left bracket, i.e., [. -class SyntaxTree::LBracket < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the left bracket - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# LParen represents the use of a left parenthesis, i.e., (. -class SyntaxTree::LParen < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the left parenthesis - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Label represents the use of an identifier to associate with an object. You -# can find it in a hash key, as in: -# -# { key: value } -# -# In this case "key:" would be the body of the label. You can also find it in -# pattern matching, as in: -# -# case value -# in key: -# end -# -# In this case "key:" would be the body of the label. -class SyntaxTree::Label < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the value of the label - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# LabelEnd represents the end of a dynamic symbol. -# -# { "key": value } -# -# In the example above, LabelEnd represents the "\":" token at the end of the -# hash key. This node is important for determining the type of quote being -# used by the label. -class SyntaxTree::LabelEnd < SyntaxTree::Node - # [String] the end of the label - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Lambda represents using a lambda literal (not the lambda method call). -# -# ->(value) { value * 2 } -# -class SyntaxTree::Lambda < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [LambdaVar | Paren] the parameter declaration for this lambda - sig { returns(T.any(SyntaxTree::LambdaVar, SyntaxTree::Paren)) } - attr_reader :params - - # [BodyStmt | Statements] the expressions to be executed in this lambda - sig { returns(T.any(SyntaxTree::BodyStmt, SyntaxTree::Statements)) } - attr_reader :statements - - sig do - params( - params: T.any(SyntaxTree::LambdaVar, SyntaxTree::Paren), - statements: T.any(SyntaxTree::BodyStmt, SyntaxTree::Statements), - location: SyntaxTree::Location - ).void - end - def initialize(params:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# LambdaVar represents the parameters being declared for a lambda. Effectively -# this node is everything contained within the parentheses. This includes all -# of the various parameter types, as well as block-local variable -# declarations. -# -# -> (positional, optional = value, keyword:, █ local) do -# end -# -class SyntaxTree::LambdaVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ Ident ]] the list of block-local variable declarations - sig { returns(T::Array[SyntaxTree::Ident]) } - attr_reader :locals - - # [Params] the parameters being declared with the block - sig { returns(SyntaxTree::Params) } - attr_reader :params - - sig do - params( - params: SyntaxTree::Params, - locals: T::Array[SyntaxTree::Ident], - location: SyntaxTree::Location - ).void - end - def initialize(params:, locals:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# MAssign is a parent node of any kind of multiple assignment. This includes -# splitting out variables on the left like: -# -# first, second, third = value -# -# as well as splitting out variables on the right, as in: -# -# value = first, second, third -# -# Both sides support splats, as well as variables following them. There's also -# destructuring behavior that you can achieve with the following: -# -# first, = value -# -class SyntaxTree::MAssign < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [MLHS | MLHSParen] the target of the multiple assignment - sig { returns(T.any(SyntaxTree::MLHS, SyntaxTree::MLHSParen)) } - attr_reader :target - - # [Node] the value being assigned - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig do - params( - target: T.any(SyntaxTree::MLHS, SyntaxTree::MLHSParen), - value: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(target:, value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# MLHS represents a list of values being destructured on the left-hand side -# of a multiple assignment. -# -# first, second, third = value -# -class SyntaxTree::MLHS < SyntaxTree::Node - # [boolean] whether or not there is a trailing comma at the end of this - # list, which impacts destructuring. It's an attr_accessor so that while - # the syntax tree is being built it can be set by its parent node - sig { returns(T.any(TrueClass, FalseClass)) } - attr_reader :comma - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [ - # Array[ - # ARefField | ArgStar | ConstPathField | Field | Ident | MLHSParen | - # TopConstField | VarField - # ] - # ] the parts of the left-hand side of a multiple assignment - sig do - returns( - T::Array[ - T.any( - SyntaxTree::ARefField, - SyntaxTree::ArgStar, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::Ident, - SyntaxTree::MLHSParen, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ) - ] - ) - end - attr_reader :parts - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::ARefField, - SyntaxTree::ArgStar, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::Ident, - SyntaxTree::MLHSParen, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ) - ], - location: SyntaxTree::Location, - comma: T.any(TrueClass, FalseClass) - ).void - end - def initialize(parts:, location:, comma: T.unsafe(nil)) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# MLHSParen represents parentheses being used to destruct values in a multiple -# assignment on the left hand side. -# -# (left, right) = value -# -class SyntaxTree::MLHSParen < SyntaxTree::Node - # [boolean] whether or not there is a trailing comma at the end of this - # list, which impacts destructuring. It's an attr_accessor so that while - # the syntax tree is being built it can be set by its parent node - sig { returns(T.any(TrueClass, FalseClass)) } - attr_reader :comma - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [MLHS | MLHSParen] the contents inside of the parentheses - sig { returns(T.any(SyntaxTree::MLHS, SyntaxTree::MLHSParen)) } - attr_reader :contents - - sig do - params( - contents: T.any(SyntaxTree::MLHS, SyntaxTree::MLHSParen), - location: SyntaxTree::Location, - comma: T.any(TrueClass, FalseClass) - ).void - end - def initialize(contents:, location:, comma: T.unsafe(nil)) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# MRHS represents the values that are being assigned on the right-hand side of -# a multiple assignment. -# -# values = first, second, third -# -class SyntaxTree::MRHS < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[Node]] the parts that are being assigned - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :parts - - sig do - params( - parts: T::Array[SyntaxTree::Node], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# MethodAddBlock represents a method call with a block argument. -# -# method {} -# -class SyntaxTree::MethodAddBlock < SyntaxTree::Node - # [BlockNode] the block being sent with the method call - sig { returns(SyntaxTree::BlockNode) } - attr_reader :block - - # [ARef | CallNode | Command | CommandCall | Super | ZSuper] the method call - sig do - returns( - T.any( - SyntaxTree::ARef, - SyntaxTree::CallNode, - SyntaxTree::Command, - SyntaxTree::CommandCall, - SyntaxTree::Super, - SyntaxTree::ZSuper - ) - ) - end - attr_reader :call - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - call: - T.any( - SyntaxTree::ARef, - SyntaxTree::CallNode, - SyntaxTree::Command, - SyntaxTree::CommandCall, - SyntaxTree::Super, - SyntaxTree::ZSuper - ), - block: SyntaxTree::BlockNode, - location: SyntaxTree::Location - ).void - end - def initialize(call:, block:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ModuleDeclaration represents defining a module using the +module+ keyword. -# -# module Namespace -# end -# -class SyntaxTree::ModuleDeclaration < SyntaxTree::Node - # [BodyStmt] the expressions to be executed in the context of the module - sig { returns(SyntaxTree::BodyStmt) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [ConstPathRef | ConstRef | TopConstRef] the name of the module - sig do - returns( - T.any( - SyntaxTree::ConstPathRef, - SyntaxTree::ConstRef, - SyntaxTree::TopConstRef - ) - ) - end - attr_reader :constant - - sig do - params( - constant: - T.any( - SyntaxTree::ConstPathRef, - SyntaxTree::ConstRef, - SyntaxTree::TopConstRef - ), - bodystmt: SyntaxTree::BodyStmt, - location: SyntaxTree::Location - ).void - end - def initialize(constant:, bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Next represents using the +next+ keyword. -# -# next -# -# The +next+ keyword can also optionally be called with an argument: -# -# next value -# -# +next+ can even be called with multiple arguments, but only if parentheses -# are omitted, as in: -# -# next first, second, third -# -# If a single value is being given, parentheses can be used, as in: -# -# next(value) -# -class SyntaxTree::Next < SyntaxTree::Node - # [Args] the arguments passed to the next keyword - sig { returns(SyntaxTree::Args) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params(arguments: SyntaxTree::Args, location: SyntaxTree::Location).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Not represents the unary +not+ method being called on an expression. -# -# not value -# -class SyntaxTree::Not < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [boolean] whether or not parentheses were used - sig { returns(T.any(TrueClass, FalseClass)) } - attr_reader :parentheses - - # [nil | Node] the statement on which to operate - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :statement - - sig do - params( - statement: T.nilable(SyntaxTree::Node), - parentheses: T.any(TrueClass, FalseClass), - location: SyntaxTree::Location - ).void - end - def initialize(statement:, parentheses:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Op represents an operator literal in the source. -# -# 1 + 2 -# -# In the example above, the Op node represents the + operator. -class SyntaxTree::Op < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Symbol] the symbol version of the value - sig { returns(Symbol) } - attr_reader :name - - # [String] the operator - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# OpAssign represents assigning a value to a variable or constant using an -# operator like += or ||=. -# -# variable += value -# -class SyntaxTree::OpAssign < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Op] the operator being used for the assignment - sig { returns(SyntaxTree::Op) } - attr_reader :operator - - # [ARefField | ConstPathField | Field | TopConstField | VarField] the target - # to assign the result of the expression to - sig do - returns( - T.any( - SyntaxTree::ARefField, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ) - ) - end - attr_reader :target - - # [Node] the expression to be assigned - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig do - params( - target: - T.any( - SyntaxTree::ARefField, - SyntaxTree::ConstPathField, - SyntaxTree::Field, - SyntaxTree::TopConstField, - SyntaxTree::VarField - ), - operator: SyntaxTree::Op, - value: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(target:, operator:, value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# def on_operator_ambiguous(value) -# value -# end -# Params represents defining parameters on a method or lambda. -# -# def method(param) end -# -class SyntaxTree::Params < SyntaxTree::Node - # [nil | BlockArg] the optional block parameter - sig { returns(T.nilable(SyntaxTree::BlockArg)) } - attr_reader :block - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | :nil | ArgsForward | KwRestParam] the optional keyword rest - # parameter - sig do - returns( - T.nilable(T.any(Symbol, SyntaxTree::ArgsForward, SyntaxTree::KwRestParam)) - ) - end - attr_reader :keyword_rest - - # [Array[ [ Label, nil | Node ] ]] any keyword parameters and their - # optional default values - sig { returns(T::Array[[SyntaxTree::Label, T.nilable(SyntaxTree::Node)]]) } - attr_reader :keywords - - # [Array[ [ Ident, Node ] ]] any optional parameters and their default - # values - sig { returns(T::Array[[SyntaxTree::Ident, SyntaxTree::Node]]) } - attr_reader :optionals - - # [Array[ Ident ]] any positional parameters that exist after a rest - # parameter - sig { returns(T::Array[SyntaxTree::Ident]) } - attr_reader :posts - - # [Array[ Ident | MLHSParen ]] any required parameters - sig { returns(T::Array[T.any(SyntaxTree::Ident, SyntaxTree::MLHSParen)]) } - attr_reader :requireds - - # [nil | ArgsForward | ExcessedComma | RestParam] the optional rest - # parameter - sig do - returns( - T.nilable( - T.any( - SyntaxTree::ArgsForward, - SyntaxTree::ExcessedComma, - SyntaxTree::RestParam - ) - ) - ) - end - attr_reader :rest - - sig do - params( - location: SyntaxTree::Location, - requireds: T::Array[T.any(SyntaxTree::Ident, SyntaxTree::MLHSParen)], - optionals: T::Array[[SyntaxTree::Ident, SyntaxTree::Node]], - rest: - T.nilable( - T.any( - SyntaxTree::ArgsForward, - SyntaxTree::ExcessedComma, - SyntaxTree::RestParam - ) - ), - posts: T::Array[SyntaxTree::Ident], - keywords: T::Array[[SyntaxTree::Label, T.nilable(SyntaxTree::Node)]], - keyword_rest: - T.nilable( - T.any(Symbol, SyntaxTree::ArgsForward, SyntaxTree::KwRestParam) - ), - block: T.nilable(SyntaxTree::BlockArg) - ).void - end - def initialize( - location:, - requireds: T.unsafe(nil), - optionals: T.unsafe(nil), - rest: T.unsafe(nil), - posts: T.unsafe(nil), - keywords: T.unsafe(nil), - keyword_rest: T.unsafe(nil), - block: T.unsafe(nil) - ) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Paren represents using balanced parentheses in a couple places in a Ruby -# program. In general parentheses can be used anywhere a Ruby expression can -# be used. -# -# (1 + 2) -# -class SyntaxTree::Paren < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the expression inside the parentheses - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :contents - - # [LParen] the left parenthesis that opened this statement - sig { returns(SyntaxTree::LParen) } - attr_reader :lparen - - sig do - params( - lparen: SyntaxTree::LParen, - contents: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(lparen:, contents:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Period represents the use of the +.+ operator. It is usually found in method -# calls. -class SyntaxTree::Period < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the period - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# PinnedBegin represents a pinning a nested statement within pattern matching. -# -# case value -# in ^(statement) -# end -# -class SyntaxTree::PinnedBegin < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the expression being pinned - sig { returns(SyntaxTree::Node) } - attr_reader :statement - - sig do - params(statement: SyntaxTree::Node, location: SyntaxTree::Location).void - end - def initialize(statement:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# PinnedVarRef represents a pinned variable reference within a pattern -# matching pattern. -# -# case value -# in ^variable -# end -# -# This can be a plain local variable like the example above. It can also be a -# a class variable, a global variable, or an instance variable. -class SyntaxTree::PinnedVarRef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const | CVar | GVar | Ident | IVar] the value of this node - sig do - returns( - T.any( - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar - ) - ) - end - attr_reader :value - - sig do - params( - value: - T.any( - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar - ), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Program represents the overall syntax tree. -class SyntaxTree::Program < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Statements] the top-level expressions of the program - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# QSymbols represents a symbol literal array without interpolation. -# -# %i[one two three] -# -class SyntaxTree::QSymbols < SyntaxTree::Node - # [QSymbolsBeg] the token that opens this array literal - sig { returns(SyntaxTree::QSymbolsBeg) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ TStringContent ]] the elements of the array - sig { returns(T::Array[SyntaxTree::TStringContent]) } - attr_reader :elements - - sig do - params( - beginning: SyntaxTree::QSymbolsBeg, - elements: T::Array[SyntaxTree::TStringContent], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, elements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# QSymbolsBeg represents the beginning of a symbol literal array. -# -# %i[one two three] -# -# In the snippet above, QSymbolsBeg represents the "%i[" token. Note that -# these kinds of arrays can start with a lot of different delimiter types -# (e.g., %i| or %i<). -class SyntaxTree::QSymbolsBeg < SyntaxTree::Node - # [String] the beginning of the array literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# QWords represents a string literal array without interpolation. -# -# %w[one two three] -# -class SyntaxTree::QWords < SyntaxTree::Node - # [QWordsBeg] the token that opens this array literal - sig { returns(SyntaxTree::QWordsBeg) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ TStringContent ]] the elements of the array - sig { returns(T::Array[SyntaxTree::TStringContent]) } - attr_reader :elements - - sig do - params( - beginning: SyntaxTree::QWordsBeg, - elements: T::Array[SyntaxTree::TStringContent], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, elements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# QWordsBeg represents the beginning of a string literal array. -# -# %w[one two three] -# -# In the snippet above, QWordsBeg represents the "%w[" token. Note that these -# kinds of arrays can start with a lot of different delimiter types (e.g., -# %w| or %w<). -class SyntaxTree::QWordsBeg < SyntaxTree::Node - # [String] the beginning of the array literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RAssign represents a single-line pattern match. -# -# value in pattern -# value => pattern -# -class SyntaxTree::RAssign < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Kw | Op] the operator being used to match against the pattern, which is - # either => or in - sig { returns(T.any(SyntaxTree::Kw, SyntaxTree::Op)) } - attr_reader :operator - - # [Node] the pattern on the right-hand side of the expression - sig { returns(SyntaxTree::Node) } - attr_reader :pattern - - # [Node] the left-hand expression - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig do - params( - value: SyntaxTree::Node, - operator: T.any(SyntaxTree::Kw, SyntaxTree::Op), - pattern: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(value:, operator:, pattern:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RBrace represents the use of a right brace, i.e., +++. -class SyntaxTree::RBrace < SyntaxTree::Node - # [String] the right brace - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RBracket represents the use of a right bracket, i.e., +]+. -class SyntaxTree::RBracket < SyntaxTree::Node - # [String] the right bracket - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RParen represents the use of a right parenthesis, i.e., +)+. -class SyntaxTree::RParen < SyntaxTree::Node - # [String] the parenthesis - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RangeNode represents using the .. or the ... operator between two -# expressions. Usually this is to create a range object. -# -# 1..2 -# -# Sometimes this operator is used to create a flip-flop. -# -# if value == 5 .. value == 10 -# end -# -# One of the sides of the expression may be nil, but not both. -class SyntaxTree::RangeNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the left side of the expression - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :left - - # [Op] the operator used for this range - sig { returns(SyntaxTree::Op) } - attr_reader :operator - - # [nil | Node] the right side of the expression - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :right - - sig do - params( - left: T.nilable(SyntaxTree::Node), - operator: SyntaxTree::Op, - right: T.nilable(SyntaxTree::Node), - location: SyntaxTree::Location - ).void - end - def initialize(left:, operator:, right:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RationalLiteral represents the use of a rational number literal. -# -# 1r -# -class SyntaxTree::RationalLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the rational number literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Redo represents the use of the +redo+ keyword. -# -# redo -# -class SyntaxTree::Redo < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig { params(location: SyntaxTree::Location).void } - def initialize(location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RegexpBeg represents the start of a regular expression literal. -# -# /.+/ -# -# In the example above, RegexpBeg represents the first / token. Regular -# expression literals can also be declared using the %r syntax, as in: -# -# %r{.+} -# -class SyntaxTree::RegexpBeg < SyntaxTree::Node - # [String] the beginning of the regular expression - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RegexpContent represents the body of a regular expression. -# -# /.+ #{pattern} .+/ -# -# In the example above, a RegexpContent node represents everything contained -# within the forward slashes. -class SyntaxTree::RegexpContent < SyntaxTree::Node - # [String] the opening of the regular expression - sig { returns(String) } - attr_reader :beginning - - # [Array[ StringDVar | StringEmbExpr | TStringContent ]] the parts of the - # regular expression - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringDVar, - SyntaxTree::StringEmbExpr, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - beginning: String, - parts: - T::Array[ - T.any( - SyntaxTree::StringDVar, - SyntaxTree::StringEmbExpr, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RegexpEnd represents the end of a regular expression literal. -# -# /.+/m -# -# In the example above, the RegexpEnd event represents the /m at the end of -# the regular expression literal. You can also declare regular expression -# literals using %r, as in: -# -# %r{.+}m -# -class SyntaxTree::RegexpEnd < SyntaxTree::Node - # [String] the end of the regular expression - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RegexpLiteral represents a regular expression literal. -# -# /.+/ -# -class SyntaxTree::RegexpLiteral < SyntaxTree::Node - # [String] the beginning of the regular expression literal - sig { returns(String) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the ending of the regular expression literal - sig { returns(String) } - attr_reader :ending - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # regular expression literal - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - beginning: String, - ending: String, - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, ending:, parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Rescue represents the use of the rescue keyword inside of a BodyStmt node. -# -# begin -# rescue -# end -# -class SyntaxTree::Rescue < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Rescue] the optional next clause in the chain - sig { returns(T.nilable(SyntaxTree::Rescue)) } - attr_reader :consequent - - # [nil | RescueEx] the exceptions being rescued - sig { returns(T.nilable(SyntaxTree::RescueEx)) } - attr_reader :exception - - # [Kw] the rescue keyword - sig { returns(SyntaxTree::Kw) } - attr_reader :keyword - - # [Statements] the expressions to evaluate when an error is rescued - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - keyword: SyntaxTree::Kw, - exception: T.nilable(SyntaxTree::RescueEx), - statements: SyntaxTree::Statements, - consequent: T.nilable(SyntaxTree::Rescue), - location: SyntaxTree::Location - ).void - end - def initialize(keyword:, exception:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RescueEx represents the list of exceptions being rescued in a rescue clause. -# -# begin -# rescue Exception => exception -# end -# -class SyntaxTree::RescueEx < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Node] the list of exceptions being rescued - sig { returns(T.nilable(SyntaxTree::Node)) } - attr_reader :exceptions - - # [nil | Field | VarField] the expression being used to capture the raised - # exception - sig { returns(T.nilable(T.any(SyntaxTree::Field, SyntaxTree::VarField))) } - attr_reader :variable - - sig do - params( - exceptions: T.nilable(SyntaxTree::Node), - variable: T.nilable(T.any(SyntaxTree::Field, SyntaxTree::VarField)), - location: SyntaxTree::Location - ).void - end - def initialize(exceptions:, variable:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RescueMod represents the use of the modifier form of a +rescue+ clause. -# -# expression rescue value -# -class SyntaxTree::RescueMod < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the expression to execute - sig { returns(SyntaxTree::Node) } - attr_reader :statement - - # [Node] the value to use if the executed expression raises an error - sig { returns(SyntaxTree::Node) } - attr_reader :value - - sig do - params( - statement: SyntaxTree::Node, - value: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(statement:, value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# RestParam represents defining a parameter in a method definition that -# accepts all remaining positional parameters. -# -# def method(*rest) end -# -class SyntaxTree::RestParam < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Ident] the name of the parameter - sig { returns(T.nilable(SyntaxTree::Ident)) } - attr_reader :name - - sig do - params( - name: T.nilable(SyntaxTree::Ident), - location: SyntaxTree::Location - ).void - end - def initialize(name:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Retry represents the use of the +retry+ keyword. -# -# retry -# -class SyntaxTree::Retry < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig { params(location: SyntaxTree::Location).void } - def initialize(location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Return represents using the +return+ keyword with arguments. -# -# return value -# -class SyntaxTree::ReturnNode < SyntaxTree::Node - # [nil | Args] the arguments being passed to the keyword - sig { returns(T.nilable(SyntaxTree::Args)) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - arguments: T.nilable(SyntaxTree::Args), - location: SyntaxTree::Location - ).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# SClass represents a block of statements that should be evaluated within the -# context of the singleton class of an object. It's frequently used to define -# singleton methods. -# -# class << self -# end -# -class SyntaxTree::SClass < SyntaxTree::Node - # [BodyStmt] the expressions to be executed - sig { returns(SyntaxTree::BodyStmt) } - attr_reader :bodystmt - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the target of the singleton class to enter - sig { returns(SyntaxTree::Node) } - attr_reader :target - - sig do - params( - target: SyntaxTree::Node, - bodystmt: SyntaxTree::BodyStmt, - location: SyntaxTree::Location - ).void - end - def initialize(target:, bodystmt:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Everything that has a block of code inside of it has a list of statements. -# Normally we would just track those as a node that has an array body, but we -# have some special handling in order to handle empty statement lists. They -# need to have the right location information, so all of the parent node of -# stmts nodes will report back down the location information. We then -# propagate that onto void_stmt nodes inside the stmts in order to make sure -# all comments get printed appropriately. -class SyntaxTree::Statements < SyntaxTree::Node - # [Array[ Node ]] the list of expressions contained within this node - sig { returns(T::Array[SyntaxTree::Node]) } - attr_reader :body - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - body: T::Array[SyntaxTree::Node], - location: SyntaxTree::Location - ).void - end - def initialize(body:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# StringConcat represents concatenating two strings together using a backward -# slash. -# -# "first" \ -# "second" -# -class SyntaxTree::StringConcat < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Heredoc | StringConcat | StringLiteral] the left side of the - # concatenation - sig do - returns( - T.any( - SyntaxTree::Heredoc, - SyntaxTree::StringConcat, - SyntaxTree::StringLiteral - ) - ) - end - attr_reader :left - - # [StringLiteral] the right side of the concatenation - sig { returns(SyntaxTree::StringLiteral) } - attr_reader :right - - sig do - params( - left: - T.any( - SyntaxTree::Heredoc, - SyntaxTree::StringConcat, - SyntaxTree::StringLiteral - ), - right: SyntaxTree::StringLiteral, - location: SyntaxTree::Location - ).void - end - def initialize(left:, right:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# StringContent represents the contents of a string-like value. -# -# "string" -# -class SyntaxTree::StringContent < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # string - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# StringDVar represents shorthand interpolation of a variable into a string. -# It allows you to take an instance variable, class variable, or global -# variable and omit the braces when interpolating. -# -# "#@variable" -# -class SyntaxTree::StringDVar < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Backref | VarRef] the variable being interpolated - sig { returns(T.any(SyntaxTree::Backref, SyntaxTree::VarRef)) } - attr_reader :variable - - sig do - params( - variable: T.any(SyntaxTree::Backref, SyntaxTree::VarRef), - location: SyntaxTree::Location - ).void - end - def initialize(variable:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# StringEmbExpr represents interpolated content. It can be contained within a -# couple of different parent nodes, including regular expressions, strings, -# and dynamic symbols. -# -# "string #{expression}" -# -class SyntaxTree::StringEmbExpr < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Statements] the expressions to be interpolated - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# StringLiteral represents a string literal. -# -# "string" -# -class SyntaxTree::StringLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # string literal - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - # [nil | String] which quote was used by the string literal - sig { returns(T.nilable(String)) } - attr_reader :quote - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - quote: T.nilable(String), - location: SyntaxTree::Location - ).void - end - def initialize(parts:, quote:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Super represents using the +super+ keyword with arguments. It can optionally -# use parentheses. -# -# super(value) -# -class SyntaxTree::Super < SyntaxTree::Node - # [ArgParen | Args] the arguments to the keyword - sig { returns(T.any(SyntaxTree::ArgParen, SyntaxTree::Args)) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - arguments: T.any(SyntaxTree::ArgParen, SyntaxTree::Args), - location: SyntaxTree::Location - ).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# SymBeg represents the beginning of a symbol literal. -# -# :symbol -# -# SymBeg is also used for dynamic symbols, as in: -# -# :"symbol" -# -# Finally, SymBeg is also used for symbols using the %s syntax, as in: -# -# %s[symbol] -# -# The value of this node is a string. In most cases (as in the first example -# above) it will contain just ":". In the case of dynamic symbols it will -# contain ":'" or ":\"". In the case of %s symbols, it will contain the start -# of the symbol including the %s and the delimiter. -class SyntaxTree::SymBeg < SyntaxTree::Node - # [String] the beginning of the symbol - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# SymbolContent represents symbol contents and is always the child of a -# SymbolLiteral node. -# -# :symbol -# -class SyntaxTree::SymbolContent < SyntaxTree::Node - # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op] the value of the - # symbol - sig do - returns( - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw, - SyntaxTree::Op - ) - ) - end - attr_reader :value - - sig do - params( - value: - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw, - SyntaxTree::Op - ), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# SymbolLiteral represents a symbol in the system with no interpolation -# (as opposed to a DynaSymbol which has interpolation). -# -# :symbol -# -class SyntaxTree::SymbolLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op | TStringContent] - # the value of the symbol - sig do - returns( - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw, - SyntaxTree::Op, - SyntaxTree::TStringContent - ) - ) - end - attr_reader :value - - sig do - params( - value: - T.any( - SyntaxTree::Backtick, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw, - SyntaxTree::Op, - SyntaxTree::TStringContent - ), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Symbols represents a symbol array literal with interpolation. -# -# %I[one two three] -# -class SyntaxTree::Symbols < SyntaxTree::Node - # [SymbolsBeg] the token that opens this array literal - sig { returns(SyntaxTree::SymbolsBeg) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ Word ]] the words in the symbol array literal - sig { returns(T::Array[SyntaxTree::Word]) } - attr_reader :elements - - sig do - params( - beginning: SyntaxTree::SymbolsBeg, - elements: T::Array[SyntaxTree::Word], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, elements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# SymbolsBeg represents the start of a symbol array literal with -# interpolation. -# -# %I[one two three] -# -# In the snippet above, SymbolsBeg represents the "%I[" token. Note that these -# kinds of arrays can start with a lot of different delimiter types -# (e.g., %I| or %I<). -class SyntaxTree::SymbolsBeg < SyntaxTree::Node - # [String] the beginning of the symbol literal array - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TLamBeg represents the beginning of the body of a lambda literal using -# braces. -# -# -> { value } -# -# In the example above the TLamBeg represents the +{+ operator. -class SyntaxTree::TLamBeg < SyntaxTree::Node - # [String] the beginning of the body of the lambda literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TLambda represents the beginning of a lambda literal. -# -# -> { value } -# -# In the example above the TLambda represents the +->+ operator. -class SyntaxTree::TLambda < SyntaxTree::Node - # [String] the beginning of the lambda literal - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TStringBeg represents the beginning of a string literal. -# -# "string" -# -# In the example above, TStringBeg represents the first set of quotes. Strings -# can also use single quotes. They can also be declared using the +%q+ and -# +%Q+ syntax, as in: -# -# %q{string} -# -class SyntaxTree::TStringBeg < SyntaxTree::Node - # [String] the beginning of the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TStringContent represents plain characters inside of an entity that accepts -# string content like a string, heredoc, command string, or regular -# expression. -# -# "string" -# -# In the example above, TStringContent represents the +string+ token contained -# within the string. -class SyntaxTree::TStringContent < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the content of the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TStringEnd represents the end of a string literal. -# -# "string" -# -# In the example above, TStringEnd represents the second set of quotes. -# Strings can also use single quotes. They can also be declared using the +%q+ -# and +%Q+ syntax, as in: -# -# %q{string} -# -class SyntaxTree::TStringEnd < SyntaxTree::Node - # [String] the end of the string - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TopConstField is always the child node of some kind of assignment. It -# represents when you're assigning to a constant that is being referenced at -# the top level. -# -# ::Constant = value -# -class SyntaxTree::TopConstField < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const] the constant being assigned - sig { returns(SyntaxTree::Const) } - attr_reader :constant - - sig do - params(constant: SyntaxTree::Const, location: SyntaxTree::Location).void - end - def initialize(constant:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# TopConstRef is very similar to TopConstField except that it is not involved -# in an assignment. -# -# ::Constant -# -class SyntaxTree::TopConstRef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const] the constant being referenced - sig { returns(SyntaxTree::Const) } - attr_reader :constant - - sig do - params(constant: SyntaxTree::Const, location: SyntaxTree::Location).void - end - def initialize(constant:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Unary represents a unary method being called on an expression, as in +!+ or -# +~+. -# -# !value -# -class SyntaxTree::Unary < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [String] the operator being used - sig { returns(String) } - attr_reader :operator - - # [Node] the statement on which to operate - sig { returns(SyntaxTree::Node) } - attr_reader :statement - - sig do - params( - operator: String, - statement: SyntaxTree::Node, - location: SyntaxTree::Location - ).void - end - def initialize(operator:, statement:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Undef represents the use of the +undef+ keyword. -# -# undef method -# -class SyntaxTree::Undef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ DynaSymbol | SymbolLiteral ]] the symbols to undefine - sig do - returns(T::Array[T.any(SyntaxTree::DynaSymbol, SyntaxTree::SymbolLiteral)]) - end - attr_reader :symbols - - sig do - params( - symbols: - T::Array[T.any(SyntaxTree::DynaSymbol, SyntaxTree::SymbolLiteral)], - location: SyntaxTree::Location - ).void - end - def initialize(symbols:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Unless represents the first clause in an +unless+ chain. -# -# unless predicate -# end -# -class SyntaxTree::UnlessNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Elsif | Else] the next clause in the chain - sig { returns(T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else))) } - attr_reader :consequent - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - predicate: SyntaxTree::Node, - statements: SyntaxTree::Statements, - consequent: T.nilable(T.any(SyntaxTree::Elsif, SyntaxTree::Else)), - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Until represents an +until+ loop. -# -# until predicate -# end -# -class SyntaxTree::UntilNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - predicate: SyntaxTree::Node, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# VCall represent any plain named object with Ruby that could be either a -# local variable or a method call. -# -# variable -# -class SyntaxTree::VCall < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Ident] the value of this expression - sig { returns(SyntaxTree::Ident) } - attr_reader :value - - sig { params(value: SyntaxTree::Ident, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# VarField represents a variable that is being assigned a value. As such, it -# is always a child of an assignment type node. -# -# variable = value -# -# In the example above, the VarField node represents the +variable+ token. -class SyntaxTree::VarField < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | :nil | Const | CVar | GVar | Ident | IVar] the target of this node - sig do - returns( - T.nilable( - T.any( - Symbol, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar - ) - ) - ) - end - attr_reader :value - - sig do - params( - value: - T.nilable( - T.any( - Symbol, - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar - ) - ), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# VarRef represents a variable reference. -# -# true -# -# This can be a plain local variable like the example above. It can also be a -# constant, a class variable, a global variable, an instance variable, a -# keyword (like +self+, +nil+, +true+, or +false+), or a numbered block -# variable. -class SyntaxTree::VarRef < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Const | CVar | GVar | Ident | IVar | Kw] the value of this node - sig do - returns( - T.any( - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw - ) - ) - end - attr_reader :value - - sig do - params( - value: - T.any( - SyntaxTree::Const, - SyntaxTree::CVar, - SyntaxTree::GVar, - SyntaxTree::Ident, - SyntaxTree::IVar, - SyntaxTree::Kw - ), - location: SyntaxTree::Location - ).void - end - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# VoidStmt represents an empty lexical block of code. -# -# ;; -# -class SyntaxTree::VoidStmt < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig { params(location: SyntaxTree::Location).void } - def initialize(location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# When represents a +when+ clause in a +case+ chain. -# -# case value -# when predicate -# end -# -class SyntaxTree::When < SyntaxTree::Node - # [Args] the arguments to the when clause - sig { returns(SyntaxTree::Args) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [nil | Else | When] the next clause in the chain - sig { returns(T.nilable(T.any(SyntaxTree::Else, SyntaxTree::When))) } - attr_reader :consequent - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - arguments: SyntaxTree::Args, - statements: SyntaxTree::Statements, - consequent: T.nilable(T.any(SyntaxTree::Else, SyntaxTree::When)), - location: SyntaxTree::Location - ).void - end - def initialize(arguments:, statements:, consequent:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# While represents a +while+ loop. -# -# while predicate -# end -# -class SyntaxTree::WhileNode < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Node] the expression to be checked - sig { returns(SyntaxTree::Node) } - attr_reader :predicate - - # [Statements] the expressions to be executed - sig { returns(SyntaxTree::Statements) } - attr_reader :statements - - sig do - params( - predicate: SyntaxTree::Node, - statements: SyntaxTree::Statements, - location: SyntaxTree::Location - ).void - end - def initialize(predicate:, statements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Word represents an element within a special array literal that accepts -# interpolation. -# -# %W[a#{b}c xyz] -# -# In the example above, there would be two Word nodes within a parent Words -# node. -class SyntaxTree::Word < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # word - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Words represents a string literal array with interpolation. -# -# %W[one two three] -# -class SyntaxTree::Words < SyntaxTree::Node - # [WordsBeg] the token that opens this array literal - sig { returns(SyntaxTree::WordsBeg) } - attr_reader :beginning - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ Word ]] the elements of this array - sig { returns(T::Array[SyntaxTree::Word]) } - attr_reader :elements - - sig do - params( - beginning: SyntaxTree::WordsBeg, - elements: T::Array[SyntaxTree::Word], - location: SyntaxTree::Location - ).void - end - def initialize(beginning:, elements:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# WordsBeg represents the beginning of a string literal array with -# interpolation. -# -# %W[one two three] -# -# In the snippet above, a WordsBeg would be created with the value of "%W[". -# Note that these kinds of arrays can start with a lot of different delimiter -# types (e.g., %W| or %W<). -class SyntaxTree::WordsBeg < SyntaxTree::Node - # [String] the start of the word literal array - sig { returns(String) } - attr_reader :value - - sig { params(value: String, location: SyntaxTree::Location).void } - def initialize(value:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# XString represents the contents of an XStringLiteral. -# -# `ls` -# -class SyntaxTree::XString < SyntaxTree::Node - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # xstring - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# XStringLiteral represents a string that gets executed. -# -# `ls` -# -class SyntaxTree::XStringLiteral < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - # [Array[ StringEmbExpr | StringDVar | TStringContent ]] the parts of the - # xstring - sig do - returns( - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ] - ) - end - attr_reader :parts - - sig do - params( - parts: - T::Array[ - T.any( - SyntaxTree::StringEmbExpr, - SyntaxTree::StringDVar, - SyntaxTree::TStringContent - ) - ], - location: SyntaxTree::Location - ).void - end - def initialize(parts:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# Yield represents using the +yield+ keyword with arguments. -# -# yield value -# -class SyntaxTree::YieldNode < SyntaxTree::Node - # [nil | Args | Paren] the arguments passed to the yield - sig { returns(T.nilable(T.any(SyntaxTree::Args, SyntaxTree::Paren))) } - attr_reader :arguments - - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig do - params( - arguments: T.nilable(T.any(SyntaxTree::Args, SyntaxTree::Paren)), - location: SyntaxTree::Location - ).void - end - def initialize(arguments:, location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -# ZSuper represents the bare +super+ keyword with no arguments. -# -# super -# -class SyntaxTree::ZSuper < SyntaxTree::Node - # [Array[ Comment | EmbDoc ]] the comments attached to this node - sig { returns(T::Array[T.any(SyntaxTree::Comment, SyntaxTree::EmbDoc)]) } - attr_reader :comments - - sig { params(location: SyntaxTree::Location).void } - def initialize(location:) - end - - sig { params(visitor: SyntaxTree::BasicVisitor).returns(T.untyped) } - def accept(visitor) - end - - sig { returns(T::Array[T.nilable(SyntaxTree::Node)]) } - def child_nodes - end - - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other) - end -end - -class SyntaxTree::BasicVisitor - sig { overridable.params(node: SyntaxTree::BEGINBlock).returns(T.untyped) } - def visit_BEGIN(node) - end - - sig { overridable.params(node: SyntaxTree::CHAR).returns(T.untyped) } - def visit_CHAR(node) - end - - sig { overridable.params(node: SyntaxTree::ENDBlock).returns(T.untyped) } - def visit_END(node) - end - - sig { overridable.params(node: SyntaxTree::EndContent).returns(T.untyped) } - def visit___end__(node) - end - - sig { overridable.params(node: SyntaxTree::AliasNode).returns(T.untyped) } - def visit_alias(node) - end - - sig { overridable.params(node: SyntaxTree::ARef).returns(T.untyped) } - def visit_aref(node) - end - - sig { overridable.params(node: SyntaxTree::ARefField).returns(T.untyped) } - def visit_aref_field(node) - end - - sig { overridable.params(node: SyntaxTree::ArgParen).returns(T.untyped) } - def visit_arg_paren(node) - end - - sig { overridable.params(node: SyntaxTree::Args).returns(T.untyped) } - def visit_args(node) - end - - sig { overridable.params(node: SyntaxTree::ArgBlock).returns(T.untyped) } - def visit_arg_block(node) - end - - sig { overridable.params(node: SyntaxTree::ArgStar).returns(T.untyped) } - def visit_arg_star(node) - end - - sig { overridable.params(node: SyntaxTree::ArgsForward).returns(T.untyped) } - def visit_args_forward(node) - end - - sig { overridable.params(node: SyntaxTree::ArrayLiteral).returns(T.untyped) } - def visit_array(node) - end - - sig { overridable.params(node: SyntaxTree::AryPtn).returns(T.untyped) } - def visit_aryptn(node) - end - - sig { overridable.params(node: SyntaxTree::Assign).returns(T.untyped) } - def visit_assign(node) - end - - sig { overridable.params(node: SyntaxTree::Assoc).returns(T.untyped) } - def visit_assoc(node) - end - - sig { overridable.params(node: SyntaxTree::AssocSplat).returns(T.untyped) } - def visit_assoc_splat(node) - end - - sig { overridable.params(node: SyntaxTree::Backref).returns(T.untyped) } - def visit_backref(node) - end - - sig { overridable.params(node: SyntaxTree::Backtick).returns(T.untyped) } - def visit_backtick(node) - end - - sig { overridable.params(node: SyntaxTree::BareAssocHash).returns(T.untyped) } - def visit_bare_assoc_hash(node) - end - - sig { overridable.params(node: SyntaxTree::Begin).returns(T.untyped) } - def visit_begin(node) - end - - sig { overridable.params(node: SyntaxTree::PinnedBegin).returns(T.untyped) } - def visit_pinned_begin(node) - end - - sig { overridable.params(node: SyntaxTree::Binary).returns(T.untyped) } - def visit_binary(node) - end - - sig { overridable.params(node: SyntaxTree::BlockVar).returns(T.untyped) } - def visit_block_var(node) - end - - sig { overridable.params(node: SyntaxTree::BlockArg).returns(T.untyped) } - def visit_blockarg(node) - end - - sig { overridable.params(node: SyntaxTree::BodyStmt).returns(T.untyped) } - def visit_bodystmt(node) - end - - sig { overridable.params(node: SyntaxTree::Break).returns(T.untyped) } - def visit_break(node) - end - - sig { overridable.params(node: SyntaxTree::CallNode).returns(T.untyped) } - def visit_call(node) - end - - sig { overridable.params(node: SyntaxTree::Case).returns(T.untyped) } - def visit_case(node) - end - - sig { overridable.params(node: SyntaxTree::RAssign).returns(T.untyped) } - def visit_rassign(node) - end - - sig do - overridable.params(node: SyntaxTree::ClassDeclaration).returns(T.untyped) - end - def visit_class(node) - end - - sig { overridable.params(node: SyntaxTree::Comma).returns(T.untyped) } - def visit_comma(node) - end - - sig { overridable.params(node: SyntaxTree::Command).returns(T.untyped) } - def visit_command(node) - end - - sig { overridable.params(node: SyntaxTree::CommandCall).returns(T.untyped) } - def visit_command_call(node) - end - - sig { overridable.params(node: SyntaxTree::Comment).returns(T.untyped) } - def visit_comment(node) - end - - sig { overridable.params(node: SyntaxTree::Const).returns(T.untyped) } - def visit_const(node) - end - - sig do - overridable.params(node: SyntaxTree::ConstPathField).returns(T.untyped) - end - def visit_const_path_field(node) - end - - sig { overridable.params(node: SyntaxTree::ConstPathRef).returns(T.untyped) } - def visit_const_path_ref(node) - end - - sig { overridable.params(node: SyntaxTree::ConstRef).returns(T.untyped) } - def visit_const_ref(node) - end - - sig { overridable.params(node: SyntaxTree::CVar).returns(T.untyped) } - def visit_cvar(node) - end - - sig { overridable.params(node: SyntaxTree::DefNode).returns(T.untyped) } - def visit_def(node) - end - - sig { overridable.params(node: SyntaxTree::Defined).returns(T.untyped) } - def visit_defined(node) - end - - sig { overridable.params(node: SyntaxTree::BlockNode).returns(T.untyped) } - def visit_block(node) - end - - sig { overridable.params(node: SyntaxTree::RangeNode).returns(T.untyped) } - def visit_range(node) - end - - sig { overridable.params(node: SyntaxTree::DynaSymbol).returns(T.untyped) } - def visit_dyna_symbol(node) - end - - sig { overridable.params(node: SyntaxTree::Else).returns(T.untyped) } - def visit_else(node) - end - - sig { overridable.params(node: SyntaxTree::Elsif).returns(T.untyped) } - def visit_elsif(node) - end - - sig { overridable.params(node: SyntaxTree::EmbDoc).returns(T.untyped) } - def visit_embdoc(node) - end - - sig { overridable.params(node: SyntaxTree::EmbExprBeg).returns(T.untyped) } - def visit_embexpr_beg(node) - end - - sig { overridable.params(node: SyntaxTree::EmbExprEnd).returns(T.untyped) } - def visit_embexpr_end(node) - end - - sig { overridable.params(node: SyntaxTree::EmbVar).returns(T.untyped) } - def visit_embvar(node) - end - - sig { overridable.params(node: SyntaxTree::Ensure).returns(T.untyped) } - def visit_ensure(node) - end - - sig { overridable.params(node: SyntaxTree::ExcessedComma).returns(T.untyped) } - def visit_excessed_comma(node) - end - - sig { overridable.params(node: SyntaxTree::Field).returns(T.untyped) } - def visit_field(node) - end - - sig { overridable.params(node: SyntaxTree::FloatLiteral).returns(T.untyped) } - def visit_float(node) - end - - sig { overridable.params(node: SyntaxTree::FndPtn).returns(T.untyped) } - def visit_fndptn(node) - end - - sig { overridable.params(node: SyntaxTree::For).returns(T.untyped) } - def visit_for(node) - end - - sig { overridable.params(node: SyntaxTree::GVar).returns(T.untyped) } - def visit_gvar(node) - end - - sig { overridable.params(node: SyntaxTree::HashLiteral).returns(T.untyped) } - def visit_hash(node) - end - - sig { overridable.params(node: SyntaxTree::Heredoc).returns(T.untyped) } - def visit_heredoc(node) - end - - sig { overridable.params(node: SyntaxTree::HeredocBeg).returns(T.untyped) } - def visit_heredoc_beg(node) - end - - sig { overridable.params(node: SyntaxTree::HeredocEnd).returns(T.untyped) } - def visit_heredoc_end(node) - end - - sig { overridable.params(node: SyntaxTree::HshPtn).returns(T.untyped) } - def visit_hshptn(node) - end - - sig { overridable.params(node: SyntaxTree::Ident).returns(T.untyped) } - def visit_ident(node) - end - - sig { overridable.params(node: SyntaxTree::IfNode).returns(T.untyped) } - def visit_if(node) - end - - sig { overridable.params(node: SyntaxTree::IfOp).returns(T.untyped) } - def visit_if_op(node) - end - - sig { overridable.params(node: SyntaxTree::Imaginary).returns(T.untyped) } - def visit_imaginary(node) - end - - sig { overridable.params(node: SyntaxTree::In).returns(T.untyped) } - def visit_in(node) - end - - sig { overridable.params(node: SyntaxTree::Int).returns(T.untyped) } - def visit_int(node) - end - - sig { overridable.params(node: SyntaxTree::IVar).returns(T.untyped) } - def visit_ivar(node) - end - - sig { overridable.params(node: SyntaxTree::Kw).returns(T.untyped) } - def visit_kw(node) - end - - sig { overridable.params(node: SyntaxTree::KwRestParam).returns(T.untyped) } - def visit_kwrest_param(node) - end - - sig { overridable.params(node: SyntaxTree::Label).returns(T.untyped) } - def visit_label(node) - end - - sig { overridable.params(node: SyntaxTree::LabelEnd).returns(T.untyped) } - def visit_label_end(node) - end - - sig { overridable.params(node: SyntaxTree::Lambda).returns(T.untyped) } - def visit_lambda(node) - end - - sig { overridable.params(node: SyntaxTree::LambdaVar).returns(T.untyped) } - def visit_lambda_var(node) - end - - sig { overridable.params(node: SyntaxTree::LBrace).returns(T.untyped) } - def visit_lbrace(node) - end - - sig { overridable.params(node: SyntaxTree::LBracket).returns(T.untyped) } - def visit_lbracket(node) - end - - sig { overridable.params(node: SyntaxTree::LParen).returns(T.untyped) } - def visit_lparen(node) - end - - sig { overridable.params(node: SyntaxTree::MAssign).returns(T.untyped) } - def visit_massign(node) - end - - sig do - overridable.params(node: SyntaxTree::MethodAddBlock).returns(T.untyped) - end - def visit_method_add_block(node) - end - - sig { overridable.params(node: SyntaxTree::MLHS).returns(T.untyped) } - def visit_mlhs(node) - end - - sig { overridable.params(node: SyntaxTree::MLHSParen).returns(T.untyped) } - def visit_mlhs_paren(node) - end - - sig do - overridable.params(node: SyntaxTree::ModuleDeclaration).returns(T.untyped) - end - def visit_module(node) - end - - sig { overridable.params(node: SyntaxTree::MRHS).returns(T.untyped) } - def visit_mrhs(node) - end - - sig { overridable.params(node: SyntaxTree::Next).returns(T.untyped) } - def visit_next(node) - end - - sig { overridable.params(node: SyntaxTree::Op).returns(T.untyped) } - def visit_op(node) - end - - sig { overridable.params(node: SyntaxTree::OpAssign).returns(T.untyped) } - def visit_opassign(node) - end - - sig { overridable.params(node: SyntaxTree::Params).returns(T.untyped) } - def visit_params(node) - end - - sig { overridable.params(node: SyntaxTree::Paren).returns(T.untyped) } - def visit_paren(node) - end - - sig { overridable.params(node: SyntaxTree::Period).returns(T.untyped) } - def visit_period(node) - end - - sig { overridable.params(node: SyntaxTree::Program).returns(T.untyped) } - def visit_program(node) - end - - sig { overridable.params(node: SyntaxTree::QSymbols).returns(T.untyped) } - def visit_qsymbols(node) - end - - sig { overridable.params(node: SyntaxTree::QSymbolsBeg).returns(T.untyped) } - def visit_qsymbols_beg(node) - end - - sig { overridable.params(node: SyntaxTree::QWords).returns(T.untyped) } - def visit_qwords(node) - end - - sig { overridable.params(node: SyntaxTree::QWordsBeg).returns(T.untyped) } - def visit_qwords_beg(node) - end - - sig do - overridable.params(node: SyntaxTree::RationalLiteral).returns(T.untyped) - end - def visit_rational(node) - end - - sig { overridable.params(node: SyntaxTree::RBrace).returns(T.untyped) } - def visit_rbrace(node) - end - - sig { overridable.params(node: SyntaxTree::RBracket).returns(T.untyped) } - def visit_rbracket(node) - end - - sig { overridable.params(node: SyntaxTree::Redo).returns(T.untyped) } - def visit_redo(node) - end - - sig { overridable.params(node: SyntaxTree::RegexpContent).returns(T.untyped) } - def visit_regexp_content(node) - end - - sig { overridable.params(node: SyntaxTree::RegexpBeg).returns(T.untyped) } - def visit_regexp_beg(node) - end - - sig { overridable.params(node: SyntaxTree::RegexpEnd).returns(T.untyped) } - def visit_regexp_end(node) - end - - sig { overridable.params(node: SyntaxTree::RegexpLiteral).returns(T.untyped) } - def visit_regexp_literal(node) - end - - sig { overridable.params(node: SyntaxTree::RescueEx).returns(T.untyped) } - def visit_rescue_ex(node) - end - - sig { overridable.params(node: SyntaxTree::Rescue).returns(T.untyped) } - def visit_rescue(node) - end - - sig { overridable.params(node: SyntaxTree::RescueMod).returns(T.untyped) } - def visit_rescue_mod(node) - end - - sig { overridable.params(node: SyntaxTree::RestParam).returns(T.untyped) } - def visit_rest_param(node) - end - - sig { overridable.params(node: SyntaxTree::Retry).returns(T.untyped) } - def visit_retry(node) - end - - sig { overridable.params(node: SyntaxTree::ReturnNode).returns(T.untyped) } - def visit_return(node) - end - - sig { overridable.params(node: SyntaxTree::RParen).returns(T.untyped) } - def visit_rparen(node) - end - - sig { overridable.params(node: SyntaxTree::SClass).returns(T.untyped) } - def visit_sclass(node) - end - - sig { overridable.params(node: SyntaxTree::Statements).returns(T.untyped) } - def visit_statements(node) - end - - sig { overridable.params(node: SyntaxTree::StringContent).returns(T.untyped) } - def visit_string_content(node) - end - - sig { overridable.params(node: SyntaxTree::StringConcat).returns(T.untyped) } - def visit_string_concat(node) - end - - sig { overridable.params(node: SyntaxTree::StringDVar).returns(T.untyped) } - def visit_string_dvar(node) - end - - sig { overridable.params(node: SyntaxTree::StringEmbExpr).returns(T.untyped) } - def visit_string_embexpr(node) - end - - sig { overridable.params(node: SyntaxTree::StringLiteral).returns(T.untyped) } - def visit_string_literal(node) - end - - sig { overridable.params(node: SyntaxTree::Super).returns(T.untyped) } - def visit_super(node) - end - - sig { overridable.params(node: SyntaxTree::SymBeg).returns(T.untyped) } - def visit_symbeg(node) - end - - sig { overridable.params(node: SyntaxTree::SymbolContent).returns(T.untyped) } - def visit_symbol_content(node) - end - - sig { overridable.params(node: SyntaxTree::SymbolLiteral).returns(T.untyped) } - def visit_symbol_literal(node) - end - - sig { overridable.params(node: SyntaxTree::Symbols).returns(T.untyped) } - def visit_symbols(node) - end - - sig { overridable.params(node: SyntaxTree::SymbolsBeg).returns(T.untyped) } - def visit_symbols_beg(node) - end - - sig { overridable.params(node: SyntaxTree::TLambda).returns(T.untyped) } - def visit_tlambda(node) - end - - sig { overridable.params(node: SyntaxTree::TLamBeg).returns(T.untyped) } - def visit_tlambeg(node) - end - - sig { overridable.params(node: SyntaxTree::TopConstField).returns(T.untyped) } - def visit_top_const_field(node) - end - - sig { overridable.params(node: SyntaxTree::TopConstRef).returns(T.untyped) } - def visit_top_const_ref(node) - end - - sig { overridable.params(node: SyntaxTree::TStringBeg).returns(T.untyped) } - def visit_tstring_beg(node) - end - - sig do - overridable.params(node: SyntaxTree::TStringContent).returns(T.untyped) - end - def visit_tstring_content(node) - end - - sig { overridable.params(node: SyntaxTree::TStringEnd).returns(T.untyped) } - def visit_tstring_end(node) - end - - sig { overridable.params(node: SyntaxTree::Not).returns(T.untyped) } - def visit_not(node) - end - - sig { overridable.params(node: SyntaxTree::Unary).returns(T.untyped) } - def visit_unary(node) - end - - sig { overridable.params(node: SyntaxTree::Undef).returns(T.untyped) } - def visit_undef(node) - end - - sig { overridable.params(node: SyntaxTree::UnlessNode).returns(T.untyped) } - def visit_unless(node) - end - - sig { overridable.params(node: SyntaxTree::UntilNode).returns(T.untyped) } - def visit_until(node) - end - - sig { overridable.params(node: SyntaxTree::VarField).returns(T.untyped) } - def visit_var_field(node) - end - - sig { overridable.params(node: SyntaxTree::VarRef).returns(T.untyped) } - def visit_var_ref(node) - end - - sig { overridable.params(node: SyntaxTree::PinnedVarRef).returns(T.untyped) } - def visit_pinned_var_ref(node) - end - - sig { overridable.params(node: SyntaxTree::VCall).returns(T.untyped) } - def visit_vcall(node) - end - - sig { overridable.params(node: SyntaxTree::VoidStmt).returns(T.untyped) } - def visit_void_stmt(node) - end - - sig { overridable.params(node: SyntaxTree::When).returns(T.untyped) } - def visit_when(node) - end - - sig { overridable.params(node: SyntaxTree::WhileNode).returns(T.untyped) } - def visit_while(node) - end - - sig { overridable.params(node: SyntaxTree::Word).returns(T.untyped) } - def visit_word(node) - end - - sig { overridable.params(node: SyntaxTree::Words).returns(T.untyped) } - def visit_words(node) - end - - sig { overridable.params(node: SyntaxTree::WordsBeg).returns(T.untyped) } - def visit_words_beg(node) - end - - sig { overridable.params(node: SyntaxTree::XString).returns(T.untyped) } - def visit_xstring(node) - end - - sig do - overridable.params(node: SyntaxTree::XStringLiteral).returns(T.untyped) - end - def visit_xstring_literal(node) - end - - sig { overridable.params(node: SyntaxTree::YieldNode).returns(T.untyped) } - def visit_yield(node) - end - - sig { overridable.params(node: SyntaxTree::ZSuper).returns(T.untyped) } - def visit_zsuper(node) - end -end - -class SyntaxTree::Visitor < SyntaxTree::BasicVisitor - sig { override.params(node: SyntaxTree::BEGINBlock).returns(T.untyped) } - def visit_BEGIN(node) - end - - sig { override.params(node: SyntaxTree::CHAR).returns(T.untyped) } - def visit_CHAR(node) - end - - sig { override.params(node: SyntaxTree::ENDBlock).returns(T.untyped) } - def visit_END(node) - end - - sig { override.params(node: SyntaxTree::EndContent).returns(T.untyped) } - def visit___end__(node) - end - - sig { override.params(node: SyntaxTree::AliasNode).returns(T.untyped) } - def visit_alias(node) - end - - sig { override.params(node: SyntaxTree::ARef).returns(T.untyped) } - def visit_aref(node) - end - - sig { override.params(node: SyntaxTree::ARefField).returns(T.untyped) } - def visit_aref_field(node) - end - - sig { override.params(node: SyntaxTree::ArgParen).returns(T.untyped) } - def visit_arg_paren(node) - end - - sig { override.params(node: SyntaxTree::Args).returns(T.untyped) } - def visit_args(node) - end - - sig { override.params(node: SyntaxTree::ArgBlock).returns(T.untyped) } - def visit_arg_block(node) - end - - sig { override.params(node: SyntaxTree::ArgStar).returns(T.untyped) } - def visit_arg_star(node) - end - - sig { override.params(node: SyntaxTree::ArgsForward).returns(T.untyped) } - def visit_args_forward(node) - end - - sig { override.params(node: SyntaxTree::ArrayLiteral).returns(T.untyped) } - def visit_array(node) - end - - sig { override.params(node: SyntaxTree::AryPtn).returns(T.untyped) } - def visit_aryptn(node) - end - - sig { override.params(node: SyntaxTree::Assign).returns(T.untyped) } - def visit_assign(node) - end - - sig { override.params(node: SyntaxTree::Assoc).returns(T.untyped) } - def visit_assoc(node) - end - - sig { override.params(node: SyntaxTree::AssocSplat).returns(T.untyped) } - def visit_assoc_splat(node) - end - - sig { override.params(node: SyntaxTree::Backref).returns(T.untyped) } - def visit_backref(node) - end - - sig { override.params(node: SyntaxTree::Backtick).returns(T.untyped) } - def visit_backtick(node) - end - - sig { override.params(node: SyntaxTree::BareAssocHash).returns(T.untyped) } - def visit_bare_assoc_hash(node) - end - - sig { override.params(node: SyntaxTree::Begin).returns(T.untyped) } - def visit_begin(node) - end - - sig { override.params(node: SyntaxTree::PinnedBegin).returns(T.untyped) } - def visit_pinned_begin(node) - end - - sig { override.params(node: SyntaxTree::Binary).returns(T.untyped) } - def visit_binary(node) - end - - sig { override.params(node: SyntaxTree::BlockVar).returns(T.untyped) } - def visit_block_var(node) - end - - sig { override.params(node: SyntaxTree::BlockArg).returns(T.untyped) } - def visit_blockarg(node) - end - - sig { override.params(node: SyntaxTree::BodyStmt).returns(T.untyped) } - def visit_bodystmt(node) - end - - sig { override.params(node: SyntaxTree::Break).returns(T.untyped) } - def visit_break(node) - end - - sig { override.params(node: SyntaxTree::CallNode).returns(T.untyped) } - def visit_call(node) - end - - sig { override.params(node: SyntaxTree::Case).returns(T.untyped) } - def visit_case(node) - end - - sig { override.params(node: SyntaxTree::RAssign).returns(T.untyped) } - def visit_rassign(node) - end - - sig { override.params(node: SyntaxTree::ClassDeclaration).returns(T.untyped) } - def visit_class(node) - end - - sig { override.params(node: SyntaxTree::Comma).returns(T.untyped) } - def visit_comma(node) - end - - sig { override.params(node: SyntaxTree::Command).returns(T.untyped) } - def visit_command(node) - end - - sig { override.params(node: SyntaxTree::CommandCall).returns(T.untyped) } - def visit_command_call(node) - end - - sig { override.params(node: SyntaxTree::Comment).returns(T.untyped) } - def visit_comment(node) - end - - sig { override.params(node: SyntaxTree::Const).returns(T.untyped) } - def visit_const(node) - end - - sig { override.params(node: SyntaxTree::ConstPathField).returns(T.untyped) } - def visit_const_path_field(node) - end - - sig { override.params(node: SyntaxTree::ConstPathRef).returns(T.untyped) } - def visit_const_path_ref(node) - end - - sig { override.params(node: SyntaxTree::ConstRef).returns(T.untyped) } - def visit_const_ref(node) - end - - sig { override.params(node: SyntaxTree::CVar).returns(T.untyped) } - def visit_cvar(node) - end - - sig { override.params(node: SyntaxTree::DefNode).returns(T.untyped) } - def visit_def(node) - end - - sig { override.params(node: SyntaxTree::Defined).returns(T.untyped) } - def visit_defined(node) - end - - sig { override.params(node: SyntaxTree::BlockNode).returns(T.untyped) } - def visit_block(node) - end - - sig { override.params(node: SyntaxTree::RangeNode).returns(T.untyped) } - def visit_range(node) - end - - sig { override.params(node: SyntaxTree::DynaSymbol).returns(T.untyped) } - def visit_dyna_symbol(node) - end - - sig { override.params(node: SyntaxTree::Else).returns(T.untyped) } - def visit_else(node) - end - - sig { override.params(node: SyntaxTree::Elsif).returns(T.untyped) } - def visit_elsif(node) - end - - sig { override.params(node: SyntaxTree::EmbDoc).returns(T.untyped) } - def visit_embdoc(node) - end - - sig { override.params(node: SyntaxTree::EmbExprBeg).returns(T.untyped) } - def visit_embexpr_beg(node) - end - - sig { override.params(node: SyntaxTree::EmbExprEnd).returns(T.untyped) } - def visit_embexpr_end(node) - end - - sig { override.params(node: SyntaxTree::EmbVar).returns(T.untyped) } - def visit_embvar(node) - end - - sig { override.params(node: SyntaxTree::Ensure).returns(T.untyped) } - def visit_ensure(node) - end - - sig { override.params(node: SyntaxTree::ExcessedComma).returns(T.untyped) } - def visit_excessed_comma(node) - end - - sig { override.params(node: SyntaxTree::Field).returns(T.untyped) } - def visit_field(node) - end - - sig { override.params(node: SyntaxTree::FloatLiteral).returns(T.untyped) } - def visit_float(node) - end - - sig { override.params(node: SyntaxTree::FndPtn).returns(T.untyped) } - def visit_fndptn(node) - end - - sig { override.params(node: SyntaxTree::For).returns(T.untyped) } - def visit_for(node) - end - - sig { override.params(node: SyntaxTree::GVar).returns(T.untyped) } - def visit_gvar(node) - end - - sig { override.params(node: SyntaxTree::HashLiteral).returns(T.untyped) } - def visit_hash(node) - end - - sig { override.params(node: SyntaxTree::Heredoc).returns(T.untyped) } - def visit_heredoc(node) - end - - sig { override.params(node: SyntaxTree::HeredocBeg).returns(T.untyped) } - def visit_heredoc_beg(node) - end - - sig { override.params(node: SyntaxTree::HeredocEnd).returns(T.untyped) } - def visit_heredoc_end(node) - end - - sig { override.params(node: SyntaxTree::HshPtn).returns(T.untyped) } - def visit_hshptn(node) - end - - sig { override.params(node: SyntaxTree::Ident).returns(T.untyped) } - def visit_ident(node) - end - - sig { override.params(node: SyntaxTree::IfNode).returns(T.untyped) } - def visit_if(node) - end - - sig { override.params(node: SyntaxTree::IfOp).returns(T.untyped) } - def visit_if_op(node) - end - - sig { override.params(node: SyntaxTree::Imaginary).returns(T.untyped) } - def visit_imaginary(node) - end - - sig { override.params(node: SyntaxTree::In).returns(T.untyped) } - def visit_in(node) - end - - sig { override.params(node: SyntaxTree::Int).returns(T.untyped) } - def visit_int(node) - end - - sig { override.params(node: SyntaxTree::IVar).returns(T.untyped) } - def visit_ivar(node) - end - - sig { override.params(node: SyntaxTree::Kw).returns(T.untyped) } - def visit_kw(node) - end - - sig { override.params(node: SyntaxTree::KwRestParam).returns(T.untyped) } - def visit_kwrest_param(node) - end - - sig { override.params(node: SyntaxTree::Label).returns(T.untyped) } - def visit_label(node) - end - - sig { override.params(node: SyntaxTree::LabelEnd).returns(T.untyped) } - def visit_label_end(node) - end - - sig { override.params(node: SyntaxTree::Lambda).returns(T.untyped) } - def visit_lambda(node) - end - - sig { override.params(node: SyntaxTree::LambdaVar).returns(T.untyped) } - def visit_lambda_var(node) - end - - sig { override.params(node: SyntaxTree::LBrace).returns(T.untyped) } - def visit_lbrace(node) - end - - sig { override.params(node: SyntaxTree::LBracket).returns(T.untyped) } - def visit_lbracket(node) - end - - sig { override.params(node: SyntaxTree::LParen).returns(T.untyped) } - def visit_lparen(node) - end - - sig { override.params(node: SyntaxTree::MAssign).returns(T.untyped) } - def visit_massign(node) - end - - sig { override.params(node: SyntaxTree::MethodAddBlock).returns(T.untyped) } - def visit_method_add_block(node) - end - - sig { override.params(node: SyntaxTree::MLHS).returns(T.untyped) } - def visit_mlhs(node) - end - - sig { override.params(node: SyntaxTree::MLHSParen).returns(T.untyped) } - def visit_mlhs_paren(node) - end - - sig do - override.params(node: SyntaxTree::ModuleDeclaration).returns(T.untyped) - end - def visit_module(node) - end - - sig { override.params(node: SyntaxTree::MRHS).returns(T.untyped) } - def visit_mrhs(node) - end - - sig { override.params(node: SyntaxTree::Next).returns(T.untyped) } - def visit_next(node) - end - - sig { override.params(node: SyntaxTree::Op).returns(T.untyped) } - def visit_op(node) - end - - sig { override.params(node: SyntaxTree::OpAssign).returns(T.untyped) } - def visit_opassign(node) - end - - sig { override.params(node: SyntaxTree::Params).returns(T.untyped) } - def visit_params(node) - end - - sig { override.params(node: SyntaxTree::Paren).returns(T.untyped) } - def visit_paren(node) - end - - sig { override.params(node: SyntaxTree::Period).returns(T.untyped) } - def visit_period(node) - end - - sig { override.params(node: SyntaxTree::Program).returns(T.untyped) } - def visit_program(node) - end - - sig { override.params(node: SyntaxTree::QSymbols).returns(T.untyped) } - def visit_qsymbols(node) - end - - sig { override.params(node: SyntaxTree::QSymbolsBeg).returns(T.untyped) } - def visit_qsymbols_beg(node) - end - - sig { override.params(node: SyntaxTree::QWords).returns(T.untyped) } - def visit_qwords(node) - end - - sig { override.params(node: SyntaxTree::QWordsBeg).returns(T.untyped) } - def visit_qwords_beg(node) - end - - sig { override.params(node: SyntaxTree::RationalLiteral).returns(T.untyped) } - def visit_rational(node) - end - - sig { override.params(node: SyntaxTree::RBrace).returns(T.untyped) } - def visit_rbrace(node) - end - - sig { override.params(node: SyntaxTree::RBracket).returns(T.untyped) } - def visit_rbracket(node) - end - - sig { override.params(node: SyntaxTree::Redo).returns(T.untyped) } - def visit_redo(node) - end - - sig { override.params(node: SyntaxTree::RegexpContent).returns(T.untyped) } - def visit_regexp_content(node) - end - - sig { override.params(node: SyntaxTree::RegexpBeg).returns(T.untyped) } - def visit_regexp_beg(node) - end - - sig { override.params(node: SyntaxTree::RegexpEnd).returns(T.untyped) } - def visit_regexp_end(node) - end - - sig { override.params(node: SyntaxTree::RegexpLiteral).returns(T.untyped) } - def visit_regexp_literal(node) - end - - sig { override.params(node: SyntaxTree::RescueEx).returns(T.untyped) } - def visit_rescue_ex(node) - end - - sig { override.params(node: SyntaxTree::Rescue).returns(T.untyped) } - def visit_rescue(node) - end - - sig { override.params(node: SyntaxTree::RescueMod).returns(T.untyped) } - def visit_rescue_mod(node) - end - - sig { override.params(node: SyntaxTree::RestParam).returns(T.untyped) } - def visit_rest_param(node) - end - - sig { override.params(node: SyntaxTree::Retry).returns(T.untyped) } - def visit_retry(node) - end - - sig { override.params(node: SyntaxTree::ReturnNode).returns(T.untyped) } - def visit_return(node) - end - - sig { override.params(node: SyntaxTree::RParen).returns(T.untyped) } - def visit_rparen(node) - end - - sig { override.params(node: SyntaxTree::SClass).returns(T.untyped) } - def visit_sclass(node) - end - - sig { override.params(node: SyntaxTree::Statements).returns(T.untyped) } - def visit_statements(node) - end - - sig { override.params(node: SyntaxTree::StringContent).returns(T.untyped) } - def visit_string_content(node) - end - - sig { override.params(node: SyntaxTree::StringConcat).returns(T.untyped) } - def visit_string_concat(node) - end - - sig { override.params(node: SyntaxTree::StringDVar).returns(T.untyped) } - def visit_string_dvar(node) - end - - sig { override.params(node: SyntaxTree::StringEmbExpr).returns(T.untyped) } - def visit_string_embexpr(node) - end - - sig { override.params(node: SyntaxTree::StringLiteral).returns(T.untyped) } - def visit_string_literal(node) - end - - sig { override.params(node: SyntaxTree::Super).returns(T.untyped) } - def visit_super(node) - end - - sig { override.params(node: SyntaxTree::SymBeg).returns(T.untyped) } - def visit_symbeg(node) - end - - sig { override.params(node: SyntaxTree::SymbolContent).returns(T.untyped) } - def visit_symbol_content(node) - end - - sig { override.params(node: SyntaxTree::SymbolLiteral).returns(T.untyped) } - def visit_symbol_literal(node) - end - - sig { override.params(node: SyntaxTree::Symbols).returns(T.untyped) } - def visit_symbols(node) - end - - sig { override.params(node: SyntaxTree::SymbolsBeg).returns(T.untyped) } - def visit_symbols_beg(node) - end - - sig { override.params(node: SyntaxTree::TLambda).returns(T.untyped) } - def visit_tlambda(node) - end - - sig { override.params(node: SyntaxTree::TLamBeg).returns(T.untyped) } - def visit_tlambeg(node) - end - - sig { override.params(node: SyntaxTree::TopConstField).returns(T.untyped) } - def visit_top_const_field(node) - end - - sig { override.params(node: SyntaxTree::TopConstRef).returns(T.untyped) } - def visit_top_const_ref(node) - end - - sig { override.params(node: SyntaxTree::TStringBeg).returns(T.untyped) } - def visit_tstring_beg(node) - end - - sig { override.params(node: SyntaxTree::TStringContent).returns(T.untyped) } - def visit_tstring_content(node) - end - - sig { override.params(node: SyntaxTree::TStringEnd).returns(T.untyped) } - def visit_tstring_end(node) - end - - sig { override.params(node: SyntaxTree::Not).returns(T.untyped) } - def visit_not(node) - end - - sig { override.params(node: SyntaxTree::Unary).returns(T.untyped) } - def visit_unary(node) - end - - sig { override.params(node: SyntaxTree::Undef).returns(T.untyped) } - def visit_undef(node) - end - - sig { override.params(node: SyntaxTree::UnlessNode).returns(T.untyped) } - def visit_unless(node) - end - - sig { override.params(node: SyntaxTree::UntilNode).returns(T.untyped) } - def visit_until(node) - end - - sig { override.params(node: SyntaxTree::VarField).returns(T.untyped) } - def visit_var_field(node) - end - - sig { override.params(node: SyntaxTree::VarRef).returns(T.untyped) } - def visit_var_ref(node) - end - - sig { override.params(node: SyntaxTree::PinnedVarRef).returns(T.untyped) } - def visit_pinned_var_ref(node) - end - - sig { override.params(node: SyntaxTree::VCall).returns(T.untyped) } - def visit_vcall(node) - end - - sig { override.params(node: SyntaxTree::VoidStmt).returns(T.untyped) } - def visit_void_stmt(node) - end - - sig { override.params(node: SyntaxTree::When).returns(T.untyped) } - def visit_when(node) - end - - sig { override.params(node: SyntaxTree::WhileNode).returns(T.untyped) } - def visit_while(node) - end - - sig { override.params(node: SyntaxTree::Word).returns(T.untyped) } - def visit_word(node) - end - - sig { override.params(node: SyntaxTree::Words).returns(T.untyped) } - def visit_words(node) - end - - sig { override.params(node: SyntaxTree::WordsBeg).returns(T.untyped) } - def visit_words_beg(node) - end - - sig { override.params(node: SyntaxTree::XString).returns(T.untyped) } - def visit_xstring(node) - end - - sig { override.params(node: SyntaxTree::XStringLiteral).returns(T.untyped) } - def visit_xstring_literal(node) - end - - sig { override.params(node: SyntaxTree::YieldNode).returns(T.untyped) } - def visit_yield(node) - end - - sig { override.params(node: SyntaxTree::ZSuper).returns(T.untyped) } - def visit_zsuper(node) - end -end diff --git a/sorbet/rbi/shims/yarp.rbi b/sorbet/rbi/shims/yarp.rbi index f654d534d..505cd85fb 100644 --- a/sorbet/rbi/shims/yarp.rbi +++ b/sorbet/rbi/shims/yarp.rbi @@ -7,7 +7,26 @@ if you are looking to modify the template =end module YARP - class NodeInspector; end + class Node + sig { returns(T::Array[T.nilable(Node)]) } + def child_nodes; end + + sig { returns(Location) } + def location; end + end + + class Location + sig { returns(String) } + def slice; end + + sig { returns(T::Array[Comment]) } + def comments; end + end + + class Comment + sig { returns(Location) } + def location; end + end # Represents the use of the `alias` keyword to alias a global variable. # @@ -2875,6 +2894,40 @@ module YARP def inspect(inspector); end end + # Represents a node that is implicitly being added to the tree but doesn't + # correspond directly to a node in the source. + # + # { foo: } + # ^^^^ + # + # { Foo: } + # ^^^^ + class ImplicitNode < Node + sig { returns(Node) } + attr_reader :value + + sig { params(value: Node, location: Location).void } + def initialize(value, location); end + + sig { params(visitor: Visitor).void } + def accept(visitor); end + + sig { returns(T::Array[T.nilable(Node)]) } + def child_nodes; end + + sig { returns(T::Array[T.nilable(Node)]) } + def deconstruct; end + + sig { params(params: T.untyped).returns(ImplicitNode) } + def copy(**params); end + + sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Node, T::Array[Node], String, Token, T::Array[Token], Location))]) } + def deconstruct_keys(keys); end + + sig { params(inspector: NodeInspector).returns(String) } + def inspect(inspector); end + end + # Represents the use of the `in` keyword in a case statement. # # case a; in b then c end @@ -3156,8 +3209,8 @@ module YARP sig { returns(Integer) } attr_reader :flags - sig { params(location: Location).void } - def initialize(location); end + sig { params(flags: Integer, location: Location).void } + def initialize(flags, location); end sig { params(visitor: Visitor).void } def accept(visitor); end @@ -4034,6 +4087,40 @@ module YARP def inspect(inspector); end end + # Represents writing local variables using a regular expression match with + # named capture groups. + # + # /(?bar)/ =~ baz + # ^^^^^^^^^^^^^^^^^^^^ + class MatchWriteNode < Node + sig { returns(CallNode) } + attr_reader :call + + sig { returns(T::Array[Symbol]) } + attr_reader :locals + + sig { params(call: CallNode, locals: T::Array[Symbol], location: Location).void } + def initialize(call, locals, location); end + + sig { params(visitor: Visitor).void } + def accept(visitor); end + + sig { returns(T::Array[T.nilable(Node)]) } + def child_nodes; end + + sig { returns(T::Array[T.nilable(Node)]) } + def deconstruct; end + + sig { params(params: T.untyped).returns(MatchWriteNode) } + def copy(**params); end + + sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Node, T::Array[Node], String, Token, T::Array[Token], Location))]) } + def deconstruct_keys(keys); end + + sig { params(inspector: NodeInspector).returns(String) } + def inspect(inspector); end + end + # Represents a node that is missing from the source and results in a syntax # error. class MissingNode < Node @@ -5454,6 +5541,9 @@ module YARP # "foo #{bar} baz" # ^^^^ ^^^^ class StringNode < Node + sig { returns(Integer) } + attr_reader :flags + sig { returns(T.nilable(Location)) } attr_reader :opening_loc @@ -5466,8 +5556,8 @@ module YARP sig { returns(String) } attr_reader :unescaped - sig { params(opening_loc: T.nilable(Location), content_loc: Location, closing_loc: T.nilable(Location), unescaped: String, location: Location).void } - def initialize(opening_loc, content_loc, closing_loc, unescaped, location); end + sig { params(flags: Integer, opening_loc: T.nilable(Location), content_loc: Location, closing_loc: T.nilable(Location), unescaped: String, location: Location).void } + def initialize(flags, opening_loc, content_loc, closing_loc, unescaped, location); end sig { params(visitor: Visitor).void } def accept(visitor); end @@ -5484,6 +5574,9 @@ module YARP sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Node, T::Array[Node], String, Token, T::Array[Token], Location))]) } def deconstruct_keys(keys); end + sig { returns(T::Boolean) } + def frozen?; end + sig { returns(T.nilable(String)) } def opening; end @@ -6025,6 +6118,11 @@ module YARP ONCE = 1 << 7 end + module StringFlags + # frozen by virtue of a frozen_string_literal comment + FROZEN = 1 << 0 + end + class Visitor < BasicVisitor # Visit a AliasGlobalVariableNode node sig { params(node: AliasGlobalVariableNode).void } @@ -6290,6 +6388,10 @@ module YARP sig { params(node: ImaginaryNode).void } def visit_imaginary_node(node); end + # Visit a ImplicitNode node + sig { params(node: ImplicitNode).void } + def visit_implicit_node(node); end + # Visit a InNode node sig { params(node: InNode).void } def visit_in_node(node); end @@ -6394,6 +6496,10 @@ module YARP sig { params(node: MatchRequiredNode).void } def visit_match_required_node(node); end + # Visit a MatchWriteNode node + sig { params(node: MatchWriteNode).void } + def visit_match_write_node(node); end + # Visit a MissingNode node sig { params(node: MissingNode).void } def visit_missing_node(node); end @@ -6788,6 +6894,9 @@ module YARP # Create a new ImaginaryNode node sig { params(numeric: Node, location: Location).returns(ImaginaryNode) } def ImaginaryNode(numeric, location); end + # Create a new ImplicitNode node + sig { params(value: Node, location: Location).returns(ImplicitNode) } + def ImplicitNode(value, location); end # Create a new InNode node sig { params(pattern: Node, statements: T.nilable(StatementsNode), in_loc: Location, then_loc: T.nilable(Location), location: Location).returns(InNode) } def InNode(pattern, statements, in_loc, then_loc, location); end @@ -6810,8 +6919,8 @@ module YARP sig { params(name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location).returns(InstanceVariableWriteNode) } def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location); end # Create a new IntegerNode node - sig { params(location: Location).returns(IntegerNode) } - def IntegerNode(location); end + sig { params(flags: Integer, location: Location).returns(IntegerNode) } + def IntegerNode(flags, location); end # Create a new InterpolatedMatchLastLineNode node sig { params(opening_loc: Location, parts: T::Array[Node], closing_loc: Location, flags: Integer, location: Location).returns(InterpolatedMatchLastLineNode) } def InterpolatedMatchLastLineNode(opening_loc, parts, closing_loc, flags, location); end @@ -6866,6 +6975,9 @@ module YARP # Create a new MatchRequiredNode node sig { params(value: Node, pattern: Node, operator_loc: Location, location: Location).returns(MatchRequiredNode) } def MatchRequiredNode(value, pattern, operator_loc, location); end + # Create a new MatchWriteNode node + sig { params(call: CallNode, locals: T::Array[Symbol], location: Location).returns(MatchWriteNode) } + def MatchWriteNode(call, locals, location); end # Create a new MissingNode node sig { params(location: Location).returns(MissingNode) } def MissingNode(location); end @@ -6975,8 +7087,8 @@ module YARP sig { params(left: Node, right: Node, location: Location).returns(StringConcatNode) } def StringConcatNode(left, right, location); end # Create a new StringNode node - sig { params(opening_loc: T.nilable(Location), content_loc: Location, closing_loc: T.nilable(Location), unescaped: String, location: Location).returns(StringNode) } - def StringNode(opening_loc, content_loc, closing_loc, unescaped, location); end + sig { params(flags: Integer, opening_loc: T.nilable(Location), content_loc: Location, closing_loc: T.nilable(Location), unescaped: String, location: Location).returns(StringNode) } + def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location); end # Create a new SuperNode node sig { params(keyword_loc: Location, lparen_loc: T.nilable(Location), arguments: T.nilable(ArgumentsNode), rparen_loc: T.nilable(Location), block: T.nilable(BlockNode), location: Location).returns(SuperNode) } def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb index 3a93b02db..f5273c3f4 100644 --- a/sorbet/tapioca/require.rb +++ b/sorbet/tapioca/require.rb @@ -4,8 +4,7 @@ # Add your extra requires here (`bin/tapioca require` can be used to bootstrap this list) require "language_server-protocol" -require "syntax_tree" -require "syntax_tree/cli" +require "yarp" require "mocha/minitest" require "rubocop/minitest/assert_offense" require "yarp" diff --git a/test/document_test.rb b/test/document_test.rb index efef6cfe0..cf7e319fc 100644 --- a/test/document_test.rb +++ b/test/document_test.rb @@ -319,23 +319,6 @@ def test_pushing_edits_to_document_with_unicode RUBY end - def test_parsed_returns_true_when_parsed_successfully - document = RubyLsp::Document.new(source: +<<~RUBY, version: 1, uri: URI("file:///foo.rb")) - # frozen_string_literal: true - puts 'hello' - RUBY - - assert_predicate(document, :parsed?) - end - - def test_parsed_returns_false_when_parsing_fails - document = RubyLsp::Document.new(source: +<<~RUBY, version: 1, uri: URI("file:///foo.rb")) - class Foo - RUBY - - refute_predicate(document, :parsed?) - end - def test_document_handle_4_byte_unicode_characters document = RubyLsp::Document.new(source: +<<~RUBY, version: 1, uri: URI("file:///foo.rb"), encoding: "utf-16") class Foo @@ -351,7 +334,6 @@ class Foo ) document.parse - assert_predicate(document, :parsed?) assert_equal(<<~RUBY, document.source) class Foo @@ -397,7 +379,6 @@ class Foo ) document.parse - assert_predicate(document, :parsed?) assert_equal(<<~RUBY, document.source) class Foo @@ -447,33 +428,33 @@ class Post < ActiveRecord::Base # Locate the `ActiveRecord` module found, parent = document.locate_node({ line: 0, character: 19 }) - assert_instance_of(SyntaxTree::Const, found) - assert_equal("ActiveRecord", T.cast(found, SyntaxTree::Const).value) + assert_instance_of(YARP::ConstantReadNode, found) + assert_equal("ActiveRecord", T.cast(found, YARP::ConstantReadNode).location.slice) - assert_instance_of(SyntaxTree::VarRef, parent) - assert_equal("ActiveRecord", T.cast(parent, SyntaxTree::VarRef).value.value) + assert_instance_of(YARP::ConstantPathNode, parent) + assert_equal("ActiveRecord", T.must(T.cast(parent, YARP::ConstantPathNode).child_nodes.first).location.slice) # Locate the `Base` class found, parent = T.cast( document.locate_node({ line: 0, character: 27 }), - [SyntaxTree::Const, SyntaxTree::ConstPathRef, T::Array[String]], + [YARP::ConstantReadNode, YARP::ConstantPathNode, T::Array[String]], ) - assert_instance_of(SyntaxTree::Const, found) - assert_equal("Base", found.value) + assert_instance_of(YARP::ConstantReadNode, found) + assert_equal("Base", found.location.slice) - assert_instance_of(SyntaxTree::ConstPathRef, parent) - assert_equal("Base", parent.constant.value) - assert_equal("ActiveRecord", T.cast(parent.parent, SyntaxTree::VarRef).value.value) + assert_instance_of(YARP::ConstantPathNode, parent) + assert_equal("Base", T.must(parent.child_nodes[1]).location.slice) + assert_equal("ActiveRecord", T.must(parent.child_nodes[0]).location.slice) # Locate the `where` invocation found, parent = T.cast( document.locate_node({ line: 3, character: 4 }), - [SyntaxTree::Ident, SyntaxTree::CallNode, T::Array[String]], + [YARP::CallNode, YARP::StatementsNode, T::Array[String]], ) - assert_instance_of(SyntaxTree::Ident, found) - assert_equal("where", found.value) + assert_instance_of(YARP::CallNode, found) + assert_equal("where", T.must(found.message_loc).slice) - assert_instance_of(SyntaxTree::CallNode, parent) + assert_instance_of(YARP::StatementsNode, parent) end def test_locate_returns_nesting @@ -494,11 +475,11 @@ def baz RUBY found, _parent, nesting = document.locate_node({ line: 9, character: 6 }) - assert_equal("Qux", T.cast(found, SyntaxTree::Const).value) + assert_equal("Qux", T.cast(found, YARP::ConstantReadNode).location.slice) assert_equal(["Foo", "Bar"], nesting) found, _parent, nesting = document.locate_node({ line: 3, character: 6 }) - assert_equal("Hello", T.cast(found, SyntaxTree::Const).value) + assert_equal("Hello", T.cast(found, YARP::ConstantReadNode).location.slice) assert_equal(["Foo", "Other"], nesting) end @@ -513,8 +494,8 @@ def baz end RUBY - found, _parent, nesting = document.locate_node({ line: 3, character: 6 }, node_types: [SyntaxTree::Const]) - assert_equal("Qux", T.cast(found, SyntaxTree::Const).value) + found, _parent, nesting = document.locate_node({ line: 3, character: 6 }, node_types: [YARP::ConstantReadNode]) + assert_equal("Qux", T.cast(found, YARP::ConstantReadNode).location.slice) assert_equal(["Foo", "Bar"], nesting) end diff --git a/test/expectations/code_lens/Gemfile.exp.json b/test/expectations/code_lens/Gemfile.exp.json index 52cdd8ecd..5e1ea16ff 100644 --- a/test/expectations/code_lens/Gemfile.exp.json +++ b/test/expectations/code_lens/Gemfile.exp.json @@ -14,7 +14,9 @@ "command": { "title": "Open remote", "command": "rubyLsp.openLink", - "arguments": ["https://github.com/ruby/rake"] + "arguments": [ + "https://github.com/ruby/rake" + ] }, "data": { "type": "link" @@ -34,7 +36,9 @@ "command": { "title": "Open remote", "command": "rubyLsp.openLink", - "arguments": ["https://github.com/rubocop/rubocop-minitest"] + "arguments": [ + "https://github.com/rubocop/rubocop-minitest" + ] }, "data": { "type": "link" @@ -54,7 +58,9 @@ "command": { "title": "Open remote", "command": "rubyLsp.openLink", - "arguments": ["https://github.com/ruby/debug"] + "arguments": [ + "https://github.com/ruby/debug" + ] }, "data": { "type": "link" diff --git a/test/expectations/document_highlight/class_and_reference.exp.json b/test/expectations/document_highlight/class_and_reference.exp.json index 322366301..5dbf09cb3 100644 --- a/test/expectations/document_highlight/class_and_reference.exp.json +++ b/test/expectations/document_highlight/class_and_reference.exp.json @@ -19,6 +19,19 @@ }, "kind": 3 }, + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "kind": 2 + }, { "range": { "start": { diff --git a/test/expectations/document_highlight/full_name_highlight.exp.json b/test/expectations/document_highlight/full_name_highlight.exp.json index 117e253a5..c134f4862 100644 --- a/test/expectations/document_highlight/full_name_highlight.exp.json +++ b/test/expectations/document_highlight/full_name_highlight.exp.json @@ -6,19 +6,6 @@ } ], "result": [ - { - "range": { - "start": { - "line": 0, - "character": 6 - }, - "end": { - "line": 0, - "character": 14 - } - }, - "kind": 3 - }, { "range": { "start": { diff --git a/test/expectations/document_highlight/module_and_reference.exp.json b/test/expectations/document_highlight/module_and_reference.exp.json index 21ee64780..6feb63851 100644 --- a/test/expectations/document_highlight/module_and_reference.exp.json +++ b/test/expectations/document_highlight/module_and_reference.exp.json @@ -19,6 +19,19 @@ }, "kind": 3 }, + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 10 + } + }, + "kind": 2 + }, { "range": { "start": { diff --git a/test/expectations/document_link/source_comment.exp.json b/test/expectations/document_link/source_comment.exp.json index 5196d8937..a33e6aba5 100644 --- a/test/expectations/document_link/source_comment.exp.json +++ b/test/expectations/document_link/source_comment.exp.json @@ -41,6 +41,76 @@ }, "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#39", "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#39" + }, + { + "range": { + "start": { + "line": 12, + "character": 0 + }, + "end": { + "line": 12, + "character": 44 + } + }, + "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#1", + "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#1" + }, + { + "range": { + "start": { + "line": 16, + "character": 0 + }, + "end": { + "line": 16, + "character": 44 + } + }, + "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#2", + "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#2" + }, + { + "range": { + "start": { + "line": 20, + "character": 0 + }, + "end": { + "line": 20, + "character": 44 + } + }, + "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#3", + "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#3" + }, + { + "range": { + "start": { + "line": 24, + "character": 0 + }, + "end": { + "line": 24, + "character": 44 + } + }, + "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#4", + "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#4" + }, + { + "range": { + "start": { + "line": 27, + "character": 0 + }, + "end": { + "line": 27, + "character": 44 + } + }, + "target": "file://BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#5", + "tooltip": "Jump to BUNDLER_PATH/gems/syntax_tree-SYNTAX_TREE_VERSION/lib/syntax_tree.rb#5" } ] } diff --git a/test/expectations/document_symbol/const.exp.json b/test/expectations/document_symbol/const.exp.json index ed7b03197..e8fa48529 100644 --- a/test/expectations/document_symbol/const.exp.json +++ b/test/expectations/document_symbol/const.exp.json @@ -10,7 +10,7 @@ }, "end": { "line": 0, - "character": 2 + "character": 7 } }, "selectionRange": { @@ -26,7 +26,7 @@ "children": [] }, { - "name": "C2", + "name": "::C2", "kind": 14, "range": { "start": { @@ -35,13 +35,13 @@ }, "end": { "line": 1, - "character": 4 + "character": 9 } }, "selectionRange": { "start": { "line": 1, - "character": 2 + "character": 0 }, "end": { "line": 1, @@ -51,7 +51,7 @@ "children": [] }, { - "name": "C3", + "name": "Foo::C3", "kind": 14, "range": { "start": { @@ -60,13 +60,13 @@ }, "end": { "line": 2, - "character": 7 + "character": 12 } }, "selectionRange": { "start": { "line": 2, - "character": 5 + "character": 0 }, "end": { "line": 2, @@ -76,7 +76,7 @@ "children": [] }, { - "name": "C4", + "name": "::Foo::C4", "kind": 14, "range": { "start": { @@ -85,13 +85,13 @@ }, "end": { "line": 3, - "character": 9 + "character": 14 } }, "selectionRange": { "start": { "line": 3, - "character": 7 + "character": 0 }, "end": { "line": 3, diff --git a/test/expectations/document_symbol/def_with_decorators.exp.json b/test/expectations/document_symbol/def_with_decorators.exp.json index b68bd61b0..54640fbe5 100644 --- a/test/expectations/document_symbol/def_with_decorators.exp.json +++ b/test/expectations/document_symbol/def_with_decorators.exp.json @@ -23,9 +23,7 @@ "character": 15 } }, - "children": [ - - ] + "children": [] }, { "name": "bar", @@ -50,9 +48,7 @@ "character": 18 } }, - "children": [ - - ] + "children": [] }, { "name": "baz", @@ -77,12 +73,8 @@ "character": 33 } }, - "children": [ - - ] + "children": [] } ], - "params": [ - - ] + "params": [] } diff --git a/test/expectations/folding_ranges/block_with_class.exp.json b/test/expectations/folding_ranges/block_with_class.exp.json index b95bb529d..4edb78f2c 100644 --- a/test/expectations/folding_ranges/block_with_class.exp.json +++ b/test/expectations/folding_ranges/block_with_class.exp.json @@ -5,6 +5,16 @@ "endLine": 3, "kind": "region" }, + { + "startLine": 0, + "endLine": 3, + "kind": "region" + }, + { + "startLine": 1, + "endLine": 2, + "kind": "region" + }, { "startLine": 1, "endLine": 2, diff --git a/test/expectations/folding_ranges/block_with_class_no_parens.exp.json b/test/expectations/folding_ranges/block_with_class_no_parens.exp.json index b95bb529d..4edb78f2c 100644 --- a/test/expectations/folding_ranges/block_with_class_no_parens.exp.json +++ b/test/expectations/folding_ranges/block_with_class_no_parens.exp.json @@ -5,6 +5,16 @@ "endLine": 3, "kind": "region" }, + { + "startLine": 0, + "endLine": 3, + "kind": "region" + }, + { + "startLine": 1, + "endLine": 2, + "kind": "region" + }, { "startLine": 1, "endLine": 2, diff --git a/test/expectations/folding_ranges/call_chained.exp.json b/test/expectations/folding_ranges/call_chained.exp.json index 3c9ecbea7..ea44bef5a 100644 --- a/test/expectations/folding_ranges/call_chained.exp.json +++ b/test/expectations/folding_ranges/call_chained.exp.json @@ -1,5 +1,25 @@ { "result": [ + { + "startLine": 0, + "endLine": 9, + "kind": "region" + }, + { + "startLine": 0, + "endLine": 8, + "kind": "region" + }, + { + "startLine": 0, + "endLine": 7, + "kind": "region" + }, + { + "startLine": 0, + "endLine": 6, + "kind": "region" + }, { "startLine": 1, "endLine": 6, @@ -14,11 +34,6 @@ "startLine": 4, "endLine": 5, "kind": "region" - }, - { - "startLine": 0, - "endLine": 9, - "kind": "region" } ] } diff --git a/test/expectations/folding_ranges/def_multiline_params.exp.json b/test/expectations/folding_ranges/def_multiline_params.exp.json index 6fcfe1e25..80eeb880e 100644 --- a/test/expectations/folding_ranges/def_multiline_params.exp.json +++ b/test/expectations/folding_ranges/def_multiline_params.exp.json @@ -1,5 +1,10 @@ { "result": [ + { + "startLine": 0, + "endLine": 2, + "kind": "region" + }, { "startLine": 3, "endLine": 5, diff --git a/test/expectations/folding_ranges/defs_multiline_params.exp.json b/test/expectations/folding_ranges/defs_multiline_params.exp.json index 6fcfe1e25..80eeb880e 100644 --- a/test/expectations/folding_ranges/defs_multiline_params.exp.json +++ b/test/expectations/folding_ranges/defs_multiline_params.exp.json @@ -1,5 +1,10 @@ { "result": [ + { + "startLine": 0, + "endLine": 2, + "kind": "region" + }, { "startLine": 3, "endLine": 5, diff --git a/test/expectations/folding_ranges/do_blocks.exp.json b/test/expectations/folding_ranges/do_blocks.exp.json index f72751b04..4abc35f77 100644 --- a/test/expectations/folding_ranges/do_blocks.exp.json +++ b/test/expectations/folding_ranges/do_blocks.exp.json @@ -1,5 +1,10 @@ { "result": [ + { + "startLine": 0, + "endLine": 1, + "kind": "region" + }, { "startLine": 0, "endLine": 1, diff --git a/test/expectations/folding_ranges/lambdas.exp.json b/test/expectations/folding_ranges/lambdas.exp.json index f72751b04..4abc35f77 100644 --- a/test/expectations/folding_ranges/lambdas.exp.json +++ b/test/expectations/folding_ranges/lambdas.exp.json @@ -1,5 +1,10 @@ { "result": [ + { + "startLine": 0, + "endLine": 1, + "kind": "region" + }, { "startLine": 0, "endLine": 1, diff --git a/test/expectations/folding_ranges/multiline_block.exp.json b/test/expectations/folding_ranges/multiline_block.exp.json index f72751b04..4abc35f77 100644 --- a/test/expectations/folding_ranges/multiline_block.exp.json +++ b/test/expectations/folding_ranges/multiline_block.exp.json @@ -1,5 +1,10 @@ { "result": [ + { + "startLine": 0, + "endLine": 1, + "kind": "region" + }, { "startLine": 0, "endLine": 1, diff --git a/test/expectations/selection_ranges/begin_rescue_ensure.exp.json b/test/expectations/selection_ranges/begin_rescue_ensure.exp.json index 11ac4944d..cc0bf74f7 100644 --- a/test/expectations/selection_ranges/begin_rescue_ensure.exp.json +++ b/test/expectations/selection_ranges/begin_rescue_ensure.exp.json @@ -14,14 +14,14 @@ }, "end": { "line": 5, - "character": 6 + "character": 18 } }, "parent": { "range": { "start": { - "line": 5, - "character": 2 + "line": 4, + "character": 0 }, "end": { "line": 5, @@ -31,35 +31,23 @@ "parent": { "range": { "start": { - "line": 4, + "line": 2, "character": 0 }, "end": { - "line": 6, - "character": 0 + "line": 5, + "character": 18 } }, "parent": { "range": { "start": { - "line": 2, + "line": 0, "character": 0 }, "end": { - "line": 6, - "character": 0 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 8, - "character": 3 - } + "line": 8, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/case_when.exp.json b/test/expectations/selection_ranges/case_when.exp.json index 56c396f1c..2779c0f43 100644 --- a/test/expectations/selection_ranges/case_when.exp.json +++ b/test/expectations/selection_ranges/case_when.exp.json @@ -14,14 +14,14 @@ }, "end": { "line": 2, - "character": 6 + "character": 13 } }, "parent": { "range": { "start": { - "line": 2, - "character": 2 + "line": 1, + "character": 0 }, "end": { "line": 2, @@ -31,25 +31,13 @@ "parent": { "range": { "start": { - "line": 1, + "line": 0, "character": 0 }, "end": { "line": 5, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 5, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/class_declaration.exp.json b/test/expectations/selection_ranges/class_declaration.exp.json index f6478d841..e3f46d592 100644 --- a/test/expectations/selection_ranges/class_declaration.exp.json +++ b/test/expectations/selection_ranges/class_declaration.exp.json @@ -14,41 +14,29 @@ }, "end": { "line": 2, - "character": 8 + "character": 17 } }, "parent": { "range": { "start": { - "line": 2, - "character": 4 + "line": 1, + "character": 2 }, "end": { - "line": 2, - "character": 17 + "line": 3, + "character": 5 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 3, - "character": 5 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 4, - "character": 3 - } + "line": 4, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/def.exp.json b/test/expectations/selection_ranges/def.exp.json index 87d3465f4..12b3cf112 100644 --- a/test/expectations/selection_ranges/def.exp.json +++ b/test/expectations/selection_ranges/def.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 3 + "character": 7 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 7 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 3, - "character": 3 - } + "line": 3, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/def_multiline_params.exp.json b/test/expectations/selection_ranges/def_multiline_params.exp.json index d3a13aae1..6169a5a85 100644 --- a/test/expectations/selection_ranges/def_multiline_params.exp.json +++ b/test/expectations/selection_ranges/def_multiline_params.exp.json @@ -21,11 +21,11 @@ "range": { "start": { "line": 1, - "character": 8 + "character": 2 }, "end": { "line": 2, - "character": 0 + "character": 3 } }, "parent": { diff --git a/test/expectations/selection_ranges/defs_multiline_params.exp.json b/test/expectations/selection_ranges/defs_multiline_params.exp.json index b43b7b98b..6169a5a85 100644 --- a/test/expectations/selection_ranges/defs_multiline_params.exp.json +++ b/test/expectations/selection_ranges/defs_multiline_params.exp.json @@ -21,11 +21,11 @@ "range": { "start": { "line": 1, - "character": 13 + "character": 2 }, "end": { "line": 2, - "character": 0 + "character": 3 } }, "parent": { diff --git a/test/expectations/selection_ranges/do_blocks.exp.json b/test/expectations/selection_ranges/do_blocks.exp.json index 73d55244c..f398b5a4d 100644 --- a/test/expectations/selection_ranges/do_blocks.exp.json +++ b/test/expectations/selection_ranges/do_blocks.exp.json @@ -13,32 +13,20 @@ "character": 10 }, "end": { - "line": 0, - "character": 12 + "line": 2, + "character": 3 } }, "parent": { "range": { "start": { "line": 0, - "character": 10 + "character": 0 }, "end": { "line": 2, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/ensure.exp.json b/test/expectations/selection_ranges/ensure.exp.json index 106be9eb6..74043124e 100644 --- a/test/expectations/selection_ranges/ensure.exp.json +++ b/test/expectations/selection_ranges/ensure.exp.json @@ -14,42 +14,30 @@ }, "end": { "line": 3, - "character": 6 + "character": 15 } }, "parent": { "range": { "start": { - "line": 3, - "character": 2 + "line": 2, + "character": 0 }, "end": { - "line": 3, - "character": 15 + "line": 4, + "character": 3 } }, "parent": { "range": { "start": { - "line": 2, + "line": 0, "character": 0 }, "end": { "line": 4, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 4, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/for.exp.json b/test/expectations/selection_ranges/for.exp.json index 5e89d1f53..230d31b86 100644 --- a/test/expectations/selection_ranges/for.exp.json +++ b/test/expectations/selection_ranges/for.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 6 + "character": 14 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 14 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } + "line": 2, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/hash_literal.exp.json b/test/expectations/selection_ranges/hash_literal.exp.json index 8c1b42149..086ace4de 100644 --- a/test/expectations/selection_ranges/hash_literal.exp.json +++ b/test/expectations/selection_ranges/hash_literal.exp.json @@ -20,24 +20,36 @@ "parent": { "range": { "start": { - "line": 0, - "character": 4 + "line": 1, + "character": 2 }, "end": { - "line": 3, - "character": 1 + "line": 1, + "character": 6 } }, "parent": { "range": { "start": { "line": 0, - "character": 0 + "character": 4 }, "end": { "line": 3, "character": 1 } + }, + "parent": { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 3, + "character": 1 + } + } } } } diff --git a/test/expectations/selection_ranges/hash_literal_oneline.exp.json b/test/expectations/selection_ranges/hash_literal_oneline.exp.json index 49d8f27d4..29dd4d676 100644 --- a/test/expectations/selection_ranges/hash_literal_oneline.exp.json +++ b/test/expectations/selection_ranges/hash_literal_oneline.exp.json @@ -21,23 +21,35 @@ "range": { "start": { "line": 0, - "character": 4 + "character": 6 }, "end": { "line": 0, - "character": 18 + "character": 10 } }, "parent": { "range": { "start": { "line": 0, - "character": 0 + "character": 4 }, "end": { "line": 0, "character": 18 } + }, + "parent": { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 18 + } + } } } } diff --git a/test/expectations/selection_ranges/heredoc.exp.json b/test/expectations/selection_ranges/heredoc.exp.json index 63f0acc7c..cef498415 100644 --- a/test/expectations/selection_ranges/heredoc.exp.json +++ b/test/expectations/selection_ranges/heredoc.exp.json @@ -25,7 +25,7 @@ }, "end": { "line": 2, - "character": 8 + "character": 0 } } } diff --git a/test/expectations/selection_ranges/if.exp.json b/test/expectations/selection_ranges/if.exp.json index 4df47d4c1..55959a702 100644 --- a/test/expectations/selection_ranges/if.exp.json +++ b/test/expectations/selection_ranges/if.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 6 + "character": 15 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 15 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } + "line": 2, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/if_elsif_else.exp.json b/test/expectations/selection_ranges/if_elsif_else.exp.json index 447b5d404..9fff145dc 100644 --- a/test/expectations/selection_ranges/if_elsif_else.exp.json +++ b/test/expectations/selection_ranges/if_elsif_else.exp.json @@ -14,24 +14,24 @@ }, "end": { "line": 5, - "character": 6 + "character": 11 } }, "parent": { "range": { "start": { - "line": 5, - "character": 2 + "line": 4, + "character": 0 }, "end": { - "line": 5, - "character": 11 + "line": 6, + "character": 3 } }, "parent": { "range": { "start": { - "line": 4, + "line": 2, "character": 0 }, "end": { @@ -42,25 +42,13 @@ "parent": { "range": { "start": { - "line": 2, + "line": 0, "character": 0 }, "end": { "line": 6, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 6, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/if_elsif_else_empty.exp.json b/test/expectations/selection_ranges/if_elsif_else_empty.exp.json index 424836834..9a8759bc9 100644 --- a/test/expectations/selection_ranges/if_elsif_else_empty.exp.json +++ b/test/expectations/selection_ranges/if_elsif_else_empty.exp.json @@ -13,14 +13,14 @@ "character": 0 }, "end": { - "line": 2, - "character": 4 + "line": 3, + "character": 3 } }, "parent": { "range": { "start": { - "line": 2, + "line": 1, "character": 0 }, "end": { @@ -31,25 +31,13 @@ "parent": { "range": { "start": { - "line": 1, + "line": 0, "character": 0 }, "end": { "line": 3, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 3, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/lambdas.exp.json b/test/expectations/selection_ranges/lambdas.exp.json index 4e2cf8985..9eebe8a5b 100644 --- a/test/expectations/selection_ranges/lambdas.exp.json +++ b/test/expectations/selection_ranges/lambdas.exp.json @@ -14,42 +14,30 @@ }, "end": { "line": 1, - "character": 6 + "character": 11 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 7 }, "end": { - "line": 1, - "character": 11 + "line": 2, + "character": 1 } }, "parent": { "range": { "start": { "line": 0, - "character": 7 + "character": 0 }, "end": { "line": 2, "character": 1 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 1 - } - } } } } diff --git a/test/expectations/selection_ranges/multiline_block.exp.json b/test/expectations/selection_ranges/multiline_block.exp.json index f3a1c04fc..679c237e4 100644 --- a/test/expectations/selection_ranges/multiline_block.exp.json +++ b/test/expectations/selection_ranges/multiline_block.exp.json @@ -13,32 +13,20 @@ "character": 10 }, "end": { - "line": 0, - "character": 11 + "line": 2, + "character": 1 } }, "parent": { "range": { "start": { "line": 0, - "character": 10 + "character": 0 }, "end": { "line": 2, "character": 1 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 1 - } - } } } } diff --git a/test/expectations/selection_ranges/multiline_invocation.exp.json b/test/expectations/selection_ranges/multiline_invocation.exp.json index f4c981f5c..ae75d49af 100644 --- a/test/expectations/selection_ranges/multiline_invocation.exp.json +++ b/test/expectations/selection_ranges/multiline_invocation.exp.json @@ -20,12 +20,48 @@ "parent": { "range": { "start": { - "line": 0, - "character": 0 + "line": 1, + "character": 2 }, "end": { - "line": 3, - "character": 1 + "line": 1, + "character": 6 + } + }, + "parent": { + "range": { + "start": { + "line": 1, + "character": 2 + }, + "end": { + "line": 2, + "character": 6 + } + }, + "parent": { + "range": { + "start": { + "line": 1, + "character": 2 + }, + "end": { + "line": 2, + "character": 6 + } + }, + "parent": { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 3, + "character": 1 + } + } + } } } } diff --git a/test/expectations/selection_ranges/nested_invocation.exp.json b/test/expectations/selection_ranges/nested_invocation.exp.json index 3bda68041..64770cbf1 100644 --- a/test/expectations/selection_ranges/nested_invocation.exp.json +++ b/test/expectations/selection_ranges/nested_invocation.exp.json @@ -20,23 +20,47 @@ "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 2, + "character": 4 }, "end": { - "line": 4, - "character": 3 + "line": 3, + "character": 5 } }, "parent": { "range": { "start": { - "line": 0, - "character": 0 + "line": 1, + "character": 2 }, "end": { - "line": 5, - "character": 1 + "line": 4, + "character": 3 + } + }, + "parent": { + "range": { + "start": { + "line": 1, + "character": 2 + }, + "end": { + "line": 4, + "character": 3 + } + }, + "parent": { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 5, + "character": 1 + } + } } } } diff --git a/test/expectations/selection_ranges/nested_invocation_no_parenthesis.exp.json b/test/expectations/selection_ranges/nested_invocation_no_parenthesis.exp.json index fe00c4769..39443a858 100644 --- a/test/expectations/selection_ranges/nested_invocation_no_parenthesis.exp.json +++ b/test/expectations/selection_ranges/nested_invocation_no_parenthesis.exp.json @@ -21,7 +21,7 @@ "range": { "start": { "line": 1, - "character": 2 + "character": 21 }, "end": { "line": 2, @@ -31,12 +31,36 @@ "parent": { "range": { "start": { - "line": 0, - "character": 0 + "line": 1, + "character": 2 }, "end": { - "line": 3, - "character": 1 + "line": 2, + "character": 5 + } + }, + "parent": { + "range": { + "start": { + "line": 1, + "character": 2 + }, + "end": { + "line": 2, + "character": 5 + } + }, + "parent": { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 3, + "character": 1 + } + } } } } diff --git a/test/expectations/selection_ranges/pattern_matching.exp.json b/test/expectations/selection_ranges/pattern_matching.exp.json index 7e009e32b..897b10012 100644 --- a/test/expectations/selection_ranges/pattern_matching.exp.json +++ b/test/expectations/selection_ranges/pattern_matching.exp.json @@ -14,14 +14,14 @@ }, "end": { "line": 2, - "character": 6 + "character": 10 } }, "parent": { "range": { "start": { - "line": 2, - "character": 2 + "line": 1, + "character": 0 }, "end": { "line": 2, @@ -31,25 +31,13 @@ "parent": { "range": { "start": { - "line": 1, + "line": 0, "character": 0 }, "end": { "line": 5, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 5, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/rescue_multiple.exp.json b/test/expectations/selection_ranges/rescue_multiple.exp.json index e7d3882b0..c8b35faa7 100644 --- a/test/expectations/selection_ranges/rescue_multiple.exp.json +++ b/test/expectations/selection_ranges/rescue_multiple.exp.json @@ -21,7 +21,7 @@ "range": { "start": { "line": 1, - "character": 7 + "character": 0 }, "end": { "line": 1, @@ -31,25 +31,13 @@ "parent": { "range": { "start": { - "line": 1, + "line": 0, "character": 0 }, "end": { "line": 2, "character": 3 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } - } } } } diff --git a/test/expectations/selection_ranges/string_concat.exp.json b/test/expectations/selection_ranges/string_concat.exp.json index 1b8053249..5ddb824bf 100644 --- a/test/expectations/selection_ranges/string_concat.exp.json +++ b/test/expectations/selection_ranges/string_concat.exp.json @@ -10,18 +10,18 @@ "range": { "start": { "line": 1, - "character": 3 + "character": 2 }, "end": { "line": 1, - "character": 6 + "character": 7 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { "line": 1, @@ -35,21 +35,9 @@ "character": 0 }, "end": { - "line": 1, + "line": 2, "character": 7 } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 7 - } - } } } } diff --git a/test/expectations/selection_ranges/unless.exp.json b/test/expectations/selection_ranges/unless.exp.json index 099748ff1..e61319355 100644 --- a/test/expectations/selection_ranges/unless.exp.json +++ b/test/expectations/selection_ranges/unless.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 6 + "character": 13 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 13 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } + "line": 2, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/until.exp.json b/test/expectations/selection_ranges/until.exp.json index 5e89d1f53..230d31b86 100644 --- a/test/expectations/selection_ranges/until.exp.json +++ b/test/expectations/selection_ranges/until.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 6 + "character": 14 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 14 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } + "line": 2, + "character": 3 } } } diff --git a/test/expectations/selection_ranges/while.exp.json b/test/expectations/selection_ranges/while.exp.json index 5e89d1f53..230d31b86 100644 --- a/test/expectations/selection_ranges/while.exp.json +++ b/test/expectations/selection_ranges/while.exp.json @@ -14,30 +14,18 @@ }, "end": { "line": 1, - "character": 6 + "character": 14 } }, "parent": { "range": { "start": { - "line": 1, - "character": 2 + "line": 0, + "character": 0 }, "end": { - "line": 1, - "character": 14 - } - }, - "parent": { - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 2, - "character": 3 - } + "line": 2, + "character": 3 } } } diff --git a/test/expectations/semantic_highlighting/destructured_splat_block_arg.exp.json b/test/expectations/semantic_highlighting/destructured_splat_block_arg.exp.json index 6a981c13e..686ac1dea 100644 --- a/test/expectations/semantic_highlighting/destructured_splat_block_arg.exp.json +++ b/test/expectations/semantic_highlighting/destructured_splat_block_arg.exp.json @@ -9,8 +9,15 @@ }, { "delta_line": 0, - "delta_start_char": 9, - "length": 10, + "delta_start_char": 10, + "length": 1, + "token_type": 7, + "token_modifiers": 0 + }, + { + "delta_line": 0, + "delta_start_char": 4, + "length": 4, "token_type": 7, "token_modifiers": 0 } diff --git a/test/expectations/semantic_highlighting/method_params.exp.json b/test/expectations/semantic_highlighting/method_params.exp.json index b3cdbc2a8..05ffcf886 100644 --- a/test/expectations/semantic_highlighting/method_params.exp.json +++ b/test/expectations/semantic_highlighting/method_params.exp.json @@ -16,7 +16,28 @@ }, { "delta_line": 0, - "delta_start_char": 17, + "delta_start_char": 3, + "length": 1, + "token_type": 7, + "token_modifiers": 0 + }, + { + "delta_line": 0, + "delta_start_char": 8, + "length": 1, + "token_type": 7, + "token_modifiers": 0 + }, + { + "delta_line": 0, + "delta_start_char": 3, + "length": 1, + "token_type": 7, + "token_modifiers": 0 + }, + { + "delta_line": 0, + "delta_start_char": 3, "length": 1, "token_type": 7, "token_modifiers": 0 diff --git a/test/expectations/semantic_highlighting/numbered_parameters.exp.json b/test/expectations/semantic_highlighting/numbered_parameters.exp.json index 234c757cb..5ac2c83f9 100644 --- a/test/expectations/semantic_highlighting/numbered_parameters.exp.json +++ b/test/expectations/semantic_highlighting/numbered_parameters.exp.json @@ -4,7 +4,7 @@ "delta_line": 1, "delta_start_char": 7, "length": 2, - "token_type": 8, + "token_type": 7, "token_modifiers": 0 } ] diff --git a/test/expectations/semantic_highlighting/pinned_variable.exp.json b/test/expectations/semantic_highlighting/pinned_variable.exp.json index 544b01c8d..b84ba009a 100644 --- a/test/expectations/semantic_highlighting/pinned_variable.exp.json +++ b/test/expectations/semantic_highlighting/pinned_variable.exp.json @@ -16,7 +16,14 @@ }, { "delta_line": 2, - "delta_start_char": 10, + "delta_start_char": 6, + "length": 1, + "token_type": 8, + "token_modifiers": 0 + }, + { + "delta_line": 0, + "delta_start_char": 4, "length": 4, "token_type": 8, "token_modifiers": 0 diff --git a/test/fixtures/source_comment.rb b/test/fixtures/source_comment.rb index e8b062a7c..170425b20 100644 --- a/test/fixtures/source_comment.rb +++ b/test/fixtures/source_comment.rb @@ -10,6 +10,24 @@ def bar def baz end +# source://syntax_tree//lib/syntax_tree.rb#1 +class Foo +end + +# source://syntax_tree//lib/syntax_tree.rb#2 +class Foo::Bar +end + +# source://syntax_tree//lib/syntax_tree.rb#3 +module Foo +end + +# source://syntax_tree//lib/syntax_tree.rb#4 +FOO = 1 + +# source://syntax_tree//lib/syntax_tree.rb#5 +FOO::BAR = 1 + # source://deleted//lib/foo.rb.rb#1 def baz end diff --git a/test/parameter_scope_test.rb b/test/parameter_scope_test.rb new file mode 100644 index 000000000..a9621d7a1 --- /dev/null +++ b/test/parameter_scope_test.rb @@ -0,0 +1,27 @@ +# typed: true +# frozen_string_literal: true + +require "test_helper" + +class ParameterScopeTest < Minitest::Test + def test_finding_parameter_in_immediate_scope + scope = RubyLsp::ParameterScope.new + scope << "foo" + + assert(scope.parameter?("foo")) + end + + def test_finding_parameter_in_parent_scope + parent = RubyLsp::ParameterScope.new + parent << "foo" + + scope = RubyLsp::ParameterScope.new(parent) + + assert(scope.parameter?("foo")) + end + + def test_not_finding_parameter + scope = RubyLsp::ParameterScope.new + refute(scope.parameter?("foo")) + end +end diff --git a/test/requests/code_lens_expectations_test.rb b/test/requests/code_lens_expectations_test.rb index c8145ada5..04094515a 100644 --- a/test/requests/code_lens_expectations_test.rb +++ b/test/requests/code_lens_expectations_test.rb @@ -12,7 +12,7 @@ def run_expectations(source) document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "minitest") + listener = RubyLsp::Requests::CodeLens.new(uri, "minitest", emitter, @message_queue) emitter.visit(document.tree) listener.response end @@ -28,7 +28,7 @@ def test_bar; end document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "test-unit") + listener = RubyLsp::Requests::CodeLens.new(uri, "test-unit", emitter, @message_queue) emitter.visit(document.tree) response = listener.response @@ -54,7 +54,7 @@ def test_bar; end document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "unknown") + listener = RubyLsp::Requests::CodeLens.new(uri, "unknown", emitter, @message_queue) emitter.visit(document.tree) response = listener.response @@ -72,7 +72,7 @@ def test_bar; end document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "rspec") + listener = RubyLsp::Requests::CodeLens.new(uri, "rspec", emitter, @message_queue) emitter.visit(document.tree) response = listener.response @@ -90,7 +90,7 @@ def test_bar; end document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::CodeLens.new(uri, emitter, @message_queue, "minitest") + listener = RubyLsp::Requests::CodeLens.new(uri, "minitest", emitter, @message_queue) emitter.visit(document.tree) response = listener.response @@ -141,9 +141,9 @@ def on_class(node) T.bind(self, RubyLsp::Listener[T.untyped]) @_response = [RubyLsp::Interface::CodeLens.new( - range: range_from_syntax_tree_node(node), + range: range_from_node(node), command: RubyLsp::Interface::Command.new( - title: "Run #{node.constant.constant.value}", + title: "Run #{node.constant_path.slice}", command: "rubyLsp.runTest", ), )] diff --git a/test/requests/completion_test.rb b/test/requests/completion_test.rb index a5980db8c..7b1408270 100644 --- a/test/requests/completion_test.rb +++ b/test/requests/completion_test.rb @@ -22,20 +22,21 @@ def test_completion_command require "#{prefix}" RUBY + end_char = T.must(document.source.rindex('"')) start_position = { line: 0, - character: T.must(document.source.index('"')) + 1, + character: T.must(document.source.index('"')), } end_position = { line: 0, - character: document.source.rindex('"'), + character: end_char + 1, } result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) run_request( method: "textDocument/completion", - params: { textDocument: { uri: @uri.to_s }, position: end_position }, + params: { textDocument: { uri: @uri.to_s }, position: { line: 0, character: end_char } }, ) end @@ -58,20 +59,21 @@ def test_completion_call require("#{prefix}") RUBY + end_char = T.must(document.source.rindex('"')) start_position = { line: 0, - character: T.must(document.source.index('"')) + 1, + character: T.must(document.source.index('"')), } end_position = { line: 0, - character: document.source.rindex('"'), + character: end_char + 1, } result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) run_request( method: "textDocument/completion", - params: { textDocument: { uri: @uri.to_s }, position: end_position }, + params: { textDocument: { uri: @uri.to_s }, position: { line: 0, character: end_char } }, ) end @@ -94,20 +96,21 @@ def test_completion_command_call Kernel.require "#{prefix}" RUBY + end_char = T.must(document.source.rindex('"')) start_position = { line: 0, - character: T.must(document.source.index('"')) + 1, + character: T.must(document.source.index('"')), } end_position = { line: 0, - character: document.source.rindex('"'), + character: end_char + 1, } result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) run_request( method: "textDocument/completion", - params: { textDocument: { uri: @uri.to_s }, position: end_position }, + params: { textDocument: { uri: @uri.to_s }, position: { line: 0, character: end_char } }, ) end @@ -130,20 +133,21 @@ def test_completion_with_partial_path require "#{prefix}" RUBY + end_char = T.must(document.source.rindex('"')) start_position = { line: 0, - character: T.must(document.source.index('"')) + 1, + character: T.must(document.source.index('"')), } end_position = { line: 0, - character: document.source.rindex('"'), + character: end_char + 1, } result = with_file_structure do @store.set(uri: @uri, source: document.source, version: 1) run_request( method: "textDocument/completion", - params: { textDocument: { uri: @uri.to_s }, position: end_position }, + params: { textDocument: { uri: @uri.to_s }, position: { line: 0, character: end_char } }, ) end diff --git a/test/requests/definition_expectations_test.rb b/test/requests/definition_expectations_test.rb index e61a3216a..72933f5d7 100644 --- a/test/requests/definition_expectations_test.rb +++ b/test/requests/definition_expectations_test.rb @@ -178,10 +178,10 @@ def create_definition_listener(uri, nesting, index, emitter, message_queue) def initialize(uri, _, _, emitter, message_queue) super(emitter, message_queue) @uri = uri - emitter.register(self, :on_const) + emitter.register(self, :on_constant_read) end - def on_const(node) + def on_constant_read(node) location = node.location @_response = RubyLsp::Interface::Location.new( uri: "file:///generated_by_extension.rb", diff --git a/test/requests/diagnostics_expectations_test.rb b/test/requests/diagnostics_expectations_test.rb index 7f9f6fbf0..c88b1558b 100644 --- a/test/requests/diagnostics_expectations_test.rb +++ b/test/requests/diagnostics_expectations_test.rb @@ -10,19 +10,19 @@ class DiagnosticsExpectationsTest < ExpectationsTestRunner def run_expectations(source) document = RubyLsp::Document.new(source: source, version: 1, uri: URI::Generic.from_path(path: __FILE__)) RubyLsp::Requests::Diagnostics.new(document).run - result = T.let(nil, T.nilable(T::Array[RubyLsp::Requests::Support::RuboCopDiagnostic])) + result = T.let(nil, T.nilable(T::Array[RubyLsp::Interface::Diagnostic])) stdout, _ = capture_io do result = T.cast( RubyLsp::Requests::Diagnostics.new(document).run, - T::Array[RubyLsp::Requests::Support::RuboCopDiagnostic], + T::Array[RubyLsp::Interface::Diagnostic], ) end assert_empty(stdout) # On Windows, RuboCop will complain that the file is missing a carriage return at the end. We need to ignore these - T.must(result).map(&:to_lsp_diagnostic).reject { |diagnostic| diagnostic.code == "Layout/EndOfLine" } + T.must(result).reject { |diagnostic| diagnostic.code == "Layout/EndOfLine" } end def assert_expectations(source, expected) diff --git a/test/requests/diagnostics_test.rb b/test/requests/diagnostics_test.rb index 45bff8e9b..d8a3daf65 100644 --- a/test/requests/diagnostics_test.rb +++ b/test/requests/diagnostics_test.rb @@ -25,4 +25,15 @@ def foo assert_nil(RubyLsp::Requests::Diagnostics.new(document).run) end + + def test_returns_syntax_error_diagnostics + document = RubyLsp::Document.new(source: <<~RUBY, version: 1, uri: URI("file:///fake/file.rb")) + def foo + RUBY + + diagnostics = T.must(RubyLsp::Requests::Diagnostics.new(document).run) + + assert_equal(2, diagnostics.length) + assert_equal("Expected an `end` to close the `def` statement", T.must(diagnostics.last).message) + end end diff --git a/test/requests/document_link_expectations_test.rb b/test/requests/document_link_expectations_test.rb index 5b1ab655f..0309325f5 100644 --- a/test/requests/document_link_expectations_test.rb +++ b/test/requests/document_link_expectations_test.rb @@ -26,7 +26,7 @@ def run_expectations(source) document = RubyLsp::Document.new(source: source, version: 1, uri: uri) emitter = RubyLsp::EventEmitter.new - listener = RubyLsp::Requests::DocumentLink.new(uri, emitter, message_queue) + listener = RubyLsp::Requests::DocumentLink.new(uri, document.comments, emitter, message_queue) emitter.visit(document.tree) listener.response ensure diff --git a/test/requests/document_symbol_expectations_test.rb b/test/requests/document_symbol_expectations_test.rb index 473ebf69d..e5cafcd26 100644 --- a/test/requests/document_symbol_expectations_test.rb +++ b/test/requests/document_symbol_expectations_test.rb @@ -16,7 +16,7 @@ def test_document_symbol_extensions test_extension(:create_document_symbol_extension, source: source) do |executor| response = executor.execute({ method: "textDocument/documentSymbol", - params: { textDocument: { uri: "file:///fake.rb" }, position: { line: 0, character: 1 } }, + params: { textDocument: { uri: "file:///fake.rb" } }, }).response assert_equal("foo", response.first.name) @@ -40,22 +40,20 @@ def create_document_symbol_listener(emitter, message_queue) def initialize(emitter, message_queue) super - emitter.register(self, :on_command) + emitter.register(self, :on_call) end - def on_command(node) + def on_call(node) T.bind(self, RubyLsp::Listener[T.untyped]) - message_value = node.message.value - return unless message_value == "test" && node.arguments.parts.any? - - first_argument = node.arguments.parts.first - test_name = first_argument.parts.map(&:value).join + message_value = node.message + arguments = node.arguments&.arguments + return unless message_value == "test" && arguments&.any? @_response = [RubyLsp::Interface::DocumentSymbol.new( - name: test_name, + name: arguments.first.content, kind: LanguageServer::Protocol::Constant::SymbolKind::METHOD, - selection_range: range_from_syntax_tree_node(node), - range: range_from_syntax_tree_node(node), + selection_range: range_from_node(node), + range: range_from_node(node), )] end end diff --git a/test/requests/folding_ranges_expectations_test.rb b/test/requests/folding_ranges_expectations_test.rb index 87ecf8609..d47d14e47 100644 --- a/test/requests/folding_ranges_expectations_test.rb +++ b/test/requests/folding_ranges_expectations_test.rb @@ -1,4 +1,4 @@ -# typed: strict +# typed: true # frozen_string_literal: true require "test_helper" @@ -6,4 +6,17 @@ class FoldingRangesExpectationsTest < ExpectationsTestRunner expectations_tests RubyLsp::Requests::FoldingRanges, "folding_ranges" + + def run_expectations(source) + message_queue = Thread::Queue.new + uri = URI("file://#{@_path}") + document = RubyLsp::Document.new(source: source, version: 1, uri: uri) + + emitter = RubyLsp::EventEmitter.new + listener = RubyLsp::Requests::FoldingRanges.new(document.parse_result.comments, emitter, message_queue) + emitter.visit(document.tree) + listener.response + ensure + T.must(message_queue).close + end end diff --git a/test/requests/hover_expectations_test.rb b/test/requests/hover_expectations_test.rb index 4d17f8c57..93fd6962e 100644 --- a/test/requests/hover_expectations_test.rb +++ b/test/requests/hover_expectations_test.rb @@ -61,22 +61,22 @@ def name "HoverExtension" end - def create_hover_listener(emitter, message_queue) + def create_hover_listener(nesting, index, emitter, message_queue) klass = Class.new(RubyLsp::Listener) do attr_reader :_response def initialize(emitter, message_queue) super - emitter.register(self, :on_const) + emitter.register(self, :on_constant_read) end - def on_const(node) + def on_constant_read(node) T.bind(self, RubyLsp::Listener[T.untyped]) contents = RubyLsp::Interface::MarkupContent.new( kind: "markdown", - value: "Hello from middleware: #{node.value}", + value: "Hello from middleware: #{node.slice}", ) - @_response = RubyLsp::Interface::Hover.new(range: range_from_syntax_tree_node(node), contents: contents) + @_response = RubyLsp::Interface::Hover.new(range: range_from_location(node.location), contents: contents) end end diff --git a/test/requests/show_syntax_tree_test.rb b/test/requests/show_syntax_tree_test.rb index c9f31fd09..ee91fe8ef 100644 --- a/test/requests/show_syntax_tree_test.rb +++ b/test/requests/show_syntax_tree_test.rb @@ -12,7 +12,7 @@ def teardown @message_queue.close end - def test_returns_nil_if_document_has_syntax_error + def test_returns_partial_tree_if_document_has_syntax_error store = RubyLsp::Store.new store.set(uri: URI("file:///fake.rb"), source: "foo do", version: 1) response = RubyLsp::Executor.new(store, @message_queue).execute({ @@ -20,7 +20,32 @@ def test_returns_nil_if_document_has_syntax_error params: { textDocument: { uri: "file:///fake.rb" } }, }).response - assert_equal("Document contains syntax error", response[:ast]) + assert_equal(<<~AST, response[:ast]) + @ ProgramNode (location: (0...6)) + ├── locals: [] + └── statements: + @ StatementsNode (location: (0...6)) + └── body: (length: 1) + └── @ CallNode (location: (0...6)) + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── message_loc: (0...3) = "foo" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── block: + │ @ BlockNode (location: (4...6)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (4...6)) + │ │ └── body: (length: 1) + │ │ └── @ MissingNode (location: (4...6)) + │ ├── opening_loc: (4...6) = "do" + │ └── closing_loc: (6...6) = "" + ├── flags: ∅ + └── name: "foo" + AST end def test_returns_ast_if_document_is_parsed @@ -35,7 +60,19 @@ def test_returns_ast_if_document_is_parsed }).response assert_equal(<<~AST, response[:ast]) - (program (statements ((assign (var_field (ident "foo")) (int "123"))))) + @ ProgramNode (location: (0...9)) + ├── locals: [:foo] + └── statements: + @ StatementsNode (location: (0...9)) + └── body: (length: 1) + └── @ LocalVariableWriteNode (location: (0...9)) + ├── name: :foo + ├── depth: 0 + ├── name_loc: (0...3) = "foo" + ├── value: + │ @ IntegerNode (location: (6...9)) + │ └── flags: decimal + └── operator_loc: (4...5) = "=" AST end @@ -59,11 +96,27 @@ def test_returns_ast_for_a_selection }).response assert_equal(<<~AST, response[:ast]) - (assign (var_field (ident "foo")) (int "123")) + @ LocalVariableWriteNode (location: (0...9)) + ├── name: :foo + ├── depth: 0 + ├── name_loc: (0...3) = "foo" + ├── value: + │ @ IntegerNode (location: (6...9)) + │ └── flags: decimal + └── operator_loc: (4...5) = "=" - (assign (var_field (ident "bar")) (int "456")) + @ LocalVariableWriteNode (location: (10...19)) + ├── name: :bar + ├── depth: 0 + ├── name_loc: (10...13) = "bar" + ├── value: + │ @ IntegerNode (location: (16...19)) + │ └── flags: decimal + └── operator_loc: (14...15) = "=" AST + # We execute twice just to make sure we do not mutate by mistake. + response = RubyLsp::Executor.new(store, @message_queue).execute({ method: "rubyLsp/textDocument/showSyntaxTree", params: { diff --git a/test/requests/support/semantic_token_encoder_test.rb b/test/requests/support/semantic_token_encoder_test.rb index 0fb5f0f8f..7f6dc0d7d 100644 --- a/test/requests/support/semantic_token_encoder_test.rb +++ b/test/requests/support/semantic_token_encoder_test.rb @@ -96,15 +96,12 @@ def test_encoded_modifiers_with_some_modifiers private def stub_token(start_line, start_column, length, type, modifier) + location = YARP::Location.new("", 123, 123) + location.expects(:start_line).returns(start_line).at_least_once + location.expects(:start_column).returns(start_column).at_least_once + RubyLsp::Requests::SemanticHighlighting::SemanticToken.new( - location: SyntaxTree::Location.new( - start_line: start_line, - start_column: start_column, - start_char: 0, - end_char: 0, - end_column: 0, - end_line: 0, - ), + location: location, length: length, type: type, modifier: modifier, diff --git a/test/requests/support/sorbet_test.rb b/test/requests/support/sorbet_test.rb index d85d3e238..93b21799f 100644 --- a/test/requests/support/sorbet_test.rb +++ b/test/requests/support/sorbet_test.rb @@ -497,25 +497,20 @@ def annotation?(source) sig do params(source: String) - .returns(T.any(SyntaxTree::CallNode, SyntaxTree::VCall)) + .returns(YARP::CallNode) end def parse(source) - program = T.let(SyntaxTree.parse(source), SyntaxTree::Node) + program = T.let(YARP.parse(source).value, YARP::Node) select_relevant_node([program]) end sig do - params(nodes: T::Array[SyntaxTree::Node]) - .returns(T.any(SyntaxTree::CallNode, SyntaxTree::VCall)) + params(nodes: T::Array[YARP::Node]).returns(YARP::CallNode) end def select_relevant_node(nodes) nodes.each do |node| - case node - when SyntaxTree::CallNode, - SyntaxTree::VCall - return node - end + return node if node.is_a?(YARP::CallNode) end select_relevant_node(nodes.map(&:child_nodes).flatten.compact) diff --git a/test/store_test.rb b/test/store_test.rb index 51f984afe..45e789429 100644 --- a/test/store_test.rb +++ b/test/store_test.rb @@ -88,31 +88,6 @@ def test_reads_from_file_if_missing_in_store file&.unlink end - def test_push_edits_recovers_from_initial_syntax_error - file = Tempfile.new("foo.rb") - file.write("def great_code") - file.rewind - uri = URI("file://#{file.path}") - document = @store.get(uri) - - refute_nil(document) - assert_nil(document.tree) - - @store.push_edits( - uri: uri, - edits: [{ range: { start: { line: 0, character: 14 }, end: { line: 0, character: 14 } }, text: " ; end" }], - version: 2, - ) - - document = @store.get(uri) - document.parse - refute_nil(document) - refute_nil(document.tree) - ensure - file&.close - file&.unlink - end - def test_clear @store.clear