From 431b85465e9936cfd75efcb567f786ec82157f62 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 8 Mar 2026 11:06:06 -0400 Subject: [PATCH] Remove generated types from checkin --- .gitattributes | 3 - .github/workflows/main.yml | 2 + .gitignore | 2 + Rakefile | 2 +- prism.gemspec | 46 +- rbi/generated/prism.rbi | 79 - rbi/generated/prism/compiler.rbi | 489 - rbi/generated/prism/desugar_compiler.rbi | 306 - rbi/generated/prism/dispatcher.rbi | 1138 - rbi/generated/prism/dot_visitor.rbi | 618 - rbi/generated/prism/dsl.rbi | 747 - rbi/generated/prism/inspect_visitor.rbi | 503 - rbi/generated/prism/lex_compat.rbi | 155 - rbi/generated/prism/mutation_compiler.rbi | 464 - rbi/generated/prism/node.rbi | 14280 ----------- rbi/generated/prism/node_ext.rbi | 333 - rbi/generated/prism/parse_result.rbi | 744 - rbi/generated/prism/parse_result/comments.rbi | 90 - rbi/generated/prism/parse_result/errors.rbi | 21 - rbi/generated/prism/parse_result/newlines.rbi | 121 - rbi/generated/prism/pattern.rbi | 134 - rbi/generated/prism/reflection.rbi | 89 - rbi/generated/prism/relocation.rbi | 389 - rbi/generated/prism/serialize.rbi | 169 - rbi/generated/prism/string_query.rbi | 36 - rbi/generated/prism/translation.rbi | 7 - rbi/generated/prism/visitor.rbi | 650 - sig/generated/prism.rbs | 76 - sig/generated/prism/compiler.rbs | 492 - sig/generated/prism/desugar_compiler.rbs | 305 - sig/generated/prism/dispatcher.rbs | 1292 - sig/generated/prism/dot_visitor.rbs | 635 - sig/generated/prism/dsl.rbs | 921 - sig/generated/prism/inspect_visitor.rbs | 509 - sig/generated/prism/lex_compat.rbs | 160 - sig/generated/prism/mutation_compiler.rbs | 464 - sig/generated/prism/node.rbs | 20895 ---------------- sig/generated/prism/node_ext.rbs | 387 - sig/generated/prism/parse_result.rbs | 851 - sig/generated/prism/parse_result/comments.rbs | 108 - sig/generated/prism/parse_result/errors.rbs | 22 - sig/generated/prism/parse_result/newlines.rbs | 129 - sig/generated/prism/pattern.rbs | 156 - sig/generated/prism/reflection.rbs | 101 - sig/generated/prism/relocation.rbs | 502 - sig/generated/prism/serialize.rbs | 181 - sig/generated/prism/string_query.rbs | 36 - sig/generated/prism/translation.rbs | 8 - sig/generated/prism/visitor.rbs | 1111 - 49 files changed, 7 insertions(+), 50951 deletions(-) delete mode 100644 rbi/generated/prism.rbi delete mode 100644 rbi/generated/prism/compiler.rbi delete mode 100644 rbi/generated/prism/desugar_compiler.rbi delete mode 100644 rbi/generated/prism/dispatcher.rbi delete mode 100644 rbi/generated/prism/dot_visitor.rbi delete mode 100644 rbi/generated/prism/dsl.rbi delete mode 100644 rbi/generated/prism/inspect_visitor.rbi delete mode 100644 rbi/generated/prism/lex_compat.rbi delete mode 100644 rbi/generated/prism/mutation_compiler.rbi delete mode 100644 rbi/generated/prism/node.rbi delete mode 100644 rbi/generated/prism/node_ext.rbi delete mode 100644 rbi/generated/prism/parse_result.rbi delete mode 100644 rbi/generated/prism/parse_result/comments.rbi delete mode 100644 rbi/generated/prism/parse_result/errors.rbi delete mode 100644 rbi/generated/prism/parse_result/newlines.rbi delete mode 100644 rbi/generated/prism/pattern.rbi delete mode 100644 rbi/generated/prism/reflection.rbi delete mode 100644 rbi/generated/prism/relocation.rbi delete mode 100644 rbi/generated/prism/serialize.rbi delete mode 100644 rbi/generated/prism/string_query.rbi delete mode 100644 rbi/generated/prism/translation.rbi delete mode 100644 rbi/generated/prism/visitor.rbi delete mode 100644 sig/generated/prism.rbs delete mode 100644 sig/generated/prism/compiler.rbs delete mode 100644 sig/generated/prism/desugar_compiler.rbs delete mode 100644 sig/generated/prism/dispatcher.rbs delete mode 100644 sig/generated/prism/dot_visitor.rbs delete mode 100644 sig/generated/prism/dsl.rbs delete mode 100644 sig/generated/prism/inspect_visitor.rbs delete mode 100644 sig/generated/prism/lex_compat.rbs delete mode 100644 sig/generated/prism/mutation_compiler.rbs delete mode 100644 sig/generated/prism/node.rbs delete mode 100644 sig/generated/prism/node_ext.rbs delete mode 100644 sig/generated/prism/parse_result.rbs delete mode 100644 sig/generated/prism/parse_result/comments.rbs delete mode 100644 sig/generated/prism/parse_result/errors.rbs delete mode 100644 sig/generated/prism/parse_result/newlines.rbs delete mode 100644 sig/generated/prism/pattern.rbs delete mode 100644 sig/generated/prism/reflection.rbs delete mode 100644 sig/generated/prism/relocation.rbs delete mode 100644 sig/generated/prism/serialize.rbs delete mode 100644 sig/generated/prism/string_query.rbs delete mode 100644 sig/generated/prism/translation.rbs delete mode 100644 sig/generated/prism/visitor.rbs diff --git a/.gitattributes b/.gitattributes index fee51d19c2..21fd53cb14 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,9 +8,6 @@ test/prism/fixtures/unparser/**/*.txt linguist-vendored test/prism/fixtures/whitequark/**/*.txt linguist-vendored test/prism/snapshots/**/*.txt linguist-generated -rbi/generated/**/*.rbi linguist-generated -sig/generated/**/*.rbs linguist-generated - # All .rb files should have LF line ending, even on Windows, regardless of the git config core.autocrlf value. # All .txt should have their line endings as committed in the repository (there are some intentional CR in there), # regardless of the git config core.autocrlf value. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ed312d4d5..8890ae61c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,6 +50,8 @@ jobs: with: ruby-version: "3.4" bundler-cache: true + - name: Generate types + run: bundle exec rake typecheck:rbs_inline typecheck:rbi - name: Check Sorbet run: bundle exec rake typecheck:tapioca typecheck:sorbet - name: Check Steep diff --git a/.gitignore b/.gitignore index b914ce4cd9..2c047d817f 100644 --- a/.gitignore +++ b/.gitignore @@ -60,9 +60,11 @@ out.svg /src/serialize.c /src/token_type.c /src/**/*.o +/rbi/generated/ /rbi/prism/dsl.rbi /rbi/prism/node.rbi /rbi/prism/visitor.rbi +/sig/generated/ compile_commands.json .cache/ diff --git a/Rakefile b/Rakefile index 6e79e08b7f..cc3c4d5537 100644 --- a/Rakefile +++ b/Rakefile @@ -23,7 +23,7 @@ task compile_no_debug: %i[make_no_debug compile] task compile_minimal: %i[make_minimal compile] # decorate the gem build task with prerequisites -task build: [:check_manifest, :templates] +task build: [:check_manifest, :templates, "typecheck:rbs_inline", "typecheck:rbi"] # the C extension task "compile:prism" => ["templates"] # must be before the ExtensionTask is created diff --git a/prism.gemspec b/prism.gemspec index d8b86c6fba..2d6b35df5c 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -111,53 +111,11 @@ Gem::Specification.new do |spec| "lib/prism/translation/ruby_parser.rb", "lib/prism/visitor.rb", "prism.gemspec", - "rbi/generated/prism.rbi", - "rbi/generated/prism/compiler.rbi", - "rbi/generated/prism/desugar_compiler.rbi", - "rbi/generated/prism/dispatcher.rbi", - "rbi/generated/prism/dot_visitor.rbi", - "rbi/generated/prism/dsl.rbi", - "rbi/generated/prism/inspect_visitor.rbi", - "rbi/generated/prism/lex_compat.rbi", - "rbi/generated/prism/mutation_compiler.rbi", - "rbi/generated/prism/node.rbi", - "rbi/generated/prism/node_ext.rbi", - "rbi/generated/prism/parse_result.rbi", - "rbi/generated/prism/pattern.rbi", - "rbi/generated/prism/reflection.rbi", - "rbi/generated/prism/relocation.rbi", - "rbi/generated/prism/serialize.rbi", - "rbi/generated/prism/string_query.rbi", - "rbi/generated/prism/translation.rbi", - "rbi/generated/prism/visitor.rbi", - "rbi/generated/prism/parse_result/comments.rbi", - "rbi/generated/prism/parse_result/errors.rbi", - "rbi/generated/prism/parse_result/newlines.rbi", + *Dir.glob("rbi/generated/**/*.rbi"), "rbi/prism/translation/parser.rbi", "rbi/prism/translation/parser_versions.rbi", "rbi/prism/translation/ripper.rbi", - "sig/generated/prism.rbs", - "sig/generated/prism/compiler.rbs", - "sig/generated/prism/desugar_compiler.rbs", - "sig/generated/prism/dispatcher.rbs", - "sig/generated/prism/dot_visitor.rbs", - "sig/generated/prism/dsl.rbs", - "sig/generated/prism/inspect_visitor.rbs", - "sig/generated/prism/lex_compat.rbs", - "sig/generated/prism/mutation_compiler.rbs", - "sig/generated/prism/node.rbs", - "sig/generated/prism/node_ext.rbs", - "sig/generated/prism/parse_result.rbs", - "sig/generated/prism/pattern.rbs", - "sig/generated/prism/reflection.rbs", - "sig/generated/prism/relocation.rbs", - "sig/generated/prism/serialize.rbs", - "sig/generated/prism/string_query.rbs", - "sig/generated/prism/translation.rbs", - "sig/generated/prism/visitor.rbs", - "sig/generated/prism/parse_result/comments.rbs", - "sig/generated/prism/parse_result/errors.rbs", - "sig/generated/prism/parse_result/newlines.rbs", + *Dir.glob("sig/generated/**/*.rbs"), "src/diagnostic.c", "src/encoding.c", "src/node.c", diff --git a/rbi/generated/prism.rbi b/rbi/generated/prism.rbi deleted file mode 100644 index 037c50382c..0000000000 --- a/rbi/generated/prism.rbi +++ /dev/null @@ -1,79 +0,0 @@ -# typed: true - -# The Prism Ruby parser. -# -# "Parsing Ruby is suddenly manageable!" -# - You, hopefully -module Prism - # Raised when requested to parse as the currently running Ruby version but Prism has no support for it. - class CurrentVersionError < ArgumentError - # Initialize a new exception for the given ruby version string. - sig { params(version: String).void } - def initialize(version); end - end - - # Returns a parse result whose value is an array of tokens that closely - # resembles the return value of Ripper.lex. - # - # For supported options, see Prism.parse. - sig { params(source: String, options: ::T.untyped).returns(LexCompat::Result) } - def self.lex_compat(source, **options); end - - # Load the serialized AST using the source as a reference into a tree. - sig { params(source: String, serialized: String, freeze: T::Boolean).returns(ParseResult) } - def self.load(source, serialized, freeze = T.unsafe(nil)); end - - VERSION = T.let(nil, String) - BACKEND = T.let(nil, Symbol) - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(ParseResult) } - def self.parse(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).void } - def self.profile(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(LexResult) } - def self.lex(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(ParseLexResult) } - def self.parse_lex(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(String) } - def self.dump(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Array[Comment]) } - def self.parse_comments(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Boolean) } - def self.parse_success?(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(source: String, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Boolean) } - def self.parse_failure?(source, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(stream: ::T.untyped, filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(ParseResult) } - def self.parse_stream(stream, filepath: T.unsafe(nil), command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(ParseResult) } - def self.parse_file(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).void } - def self.profile_file(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(LexResult) } - def self.lex_file(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(ParseLexResult) } - def self.parse_lex_file(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(String) } - def self.dump_file(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Array[Comment]) } - def self.parse_file_comments(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Boolean) } - def self.parse_file_success?(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end - - sig { params(filepath: String, command_line: String, encoding: ::T.any(Encoding, FalseClass), freeze: T::Boolean, frozen_string_literal: T::Boolean, line: Integer, main_script: T::Boolean, partial_script: T::Boolean, scopes: T::Array[T::Array[Symbol]], version: String).returns(T::Boolean) } - def self.parse_file_failure?(filepath, command_line: T.unsafe(nil), encoding: T.unsafe(nil), freeze: T.unsafe(nil), frozen_string_literal: T.unsafe(nil), line: T.unsafe(nil), main_script: T.unsafe(nil), partial_script: T.unsafe(nil), scopes: T.unsafe(nil), version: T.unsafe(nil)); end -end diff --git a/rbi/generated/prism/compiler.rbi b/rbi/generated/prism/compiler.rbi deleted file mode 100644 index af86919953..0000000000 --- a/rbi/generated/prism/compiler.rbi +++ /dev/null @@ -1,489 +0,0 @@ -# typed: true - -module Prism - # A compiler is a visitor that returns the value of each node as it visits. - # This is as opposed to a visitor which will only walk the tree. This can be - # useful when you are trying to compile a tree into a different format. - # - # For example, to build a representation of the tree as s-expressions, you - # could write: - # - # class SExpressions < Prism::Compiler - # def visit_arguments_node(node) = [:arguments, super] - # def visit_call_node(node) = [:call, super] - # def visit_integer_node(node) = [:integer] - # def visit_program_node(node) = [:program, super] - # end - # - # Prism.parse("1 + 2").value.accept(SExpressions.new) - # # => [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] - class Compiler < Visitor - # Visit an individual node. - sig { params(arg0: ::T.nilable(Node)).returns(::T.untyped) } - def visit(arg0); end - - # Visit a list of nodes. - sig { params(arg0: T::Array[::T.nilable(Node)]).returns(::T.untyped) } - def visit_all(arg0); end - - # Visit the child nodes of the given node. - sig { params(arg0: Node).returns(T::Array[::T.untyped]) } - def visit_child_nodes(arg0); end - - sig { params(arg0: AliasGlobalVariableNode).returns(T::Array[::T.untyped]) } - def visit_alias_global_variable_node(arg0); end - - sig { params(arg0: AliasMethodNode).returns(T::Array[::T.untyped]) } - def visit_alias_method_node(arg0); end - - sig { params(arg0: AlternationPatternNode).returns(T::Array[::T.untyped]) } - def visit_alternation_pattern_node(arg0); end - - sig { params(arg0: AndNode).returns(T::Array[::T.untyped]) } - def visit_and_node(arg0); end - - sig { params(arg0: ArgumentsNode).returns(T::Array[::T.untyped]) } - def visit_arguments_node(arg0); end - - sig { params(arg0: ArrayNode).returns(T::Array[::T.untyped]) } - def visit_array_node(arg0); end - - sig { params(arg0: ArrayPatternNode).returns(T::Array[::T.untyped]) } - def visit_array_pattern_node(arg0); end - - sig { params(arg0: AssocNode).returns(T::Array[::T.untyped]) } - def visit_assoc_node(arg0); end - - sig { params(arg0: AssocSplatNode).returns(T::Array[::T.untyped]) } - def visit_assoc_splat_node(arg0); end - - sig { params(arg0: BackReferenceReadNode).returns(T::Array[::T.untyped]) } - def visit_back_reference_read_node(arg0); end - - sig { params(arg0: BeginNode).returns(T::Array[::T.untyped]) } - def visit_begin_node(arg0); end - - sig { params(arg0: BlockArgumentNode).returns(T::Array[::T.untyped]) } - def visit_block_argument_node(arg0); end - - sig { params(arg0: BlockLocalVariableNode).returns(T::Array[::T.untyped]) } - def visit_block_local_variable_node(arg0); end - - sig { params(arg0: BlockNode).returns(T::Array[::T.untyped]) } - def visit_block_node(arg0); end - - sig { params(arg0: BlockParameterNode).returns(T::Array[::T.untyped]) } - def visit_block_parameter_node(arg0); end - - sig { params(arg0: BlockParametersNode).returns(T::Array[::T.untyped]) } - def visit_block_parameters_node(arg0); end - - sig { params(arg0: BreakNode).returns(T::Array[::T.untyped]) } - def visit_break_node(arg0); end - - sig { params(arg0: CallAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_call_and_write_node(arg0); end - - sig { params(arg0: CallNode).returns(T::Array[::T.untyped]) } - def visit_call_node(arg0); end - - sig { params(arg0: CallOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_call_operator_write_node(arg0); end - - sig { params(arg0: CallOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_call_or_write_node(arg0); end - - sig { params(arg0: CallTargetNode).returns(T::Array[::T.untyped]) } - def visit_call_target_node(arg0); end - - sig { params(arg0: CapturePatternNode).returns(T::Array[::T.untyped]) } - def visit_capture_pattern_node(arg0); end - - sig { params(arg0: CaseMatchNode).returns(T::Array[::T.untyped]) } - def visit_case_match_node(arg0); end - - sig { params(arg0: CaseNode).returns(T::Array[::T.untyped]) } - def visit_case_node(arg0); end - - sig { params(arg0: ClassNode).returns(T::Array[::T.untyped]) } - def visit_class_node(arg0); end - - sig { params(arg0: ClassVariableAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_and_write_node(arg0); end - - sig { params(arg0: ClassVariableOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_operator_write_node(arg0); end - - sig { params(arg0: ClassVariableOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_or_write_node(arg0); end - - sig { params(arg0: ClassVariableReadNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_read_node(arg0); end - - sig { params(arg0: ClassVariableTargetNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_target_node(arg0); end - - sig { params(arg0: ClassVariableWriteNode).returns(T::Array[::T.untyped]) } - def visit_class_variable_write_node(arg0); end - - sig { params(arg0: ConstantAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_and_write_node(arg0); end - - sig { params(arg0: ConstantOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_operator_write_node(arg0); end - - sig { params(arg0: ConstantOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_or_write_node(arg0); end - - sig { params(arg0: ConstantPathAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_and_write_node(arg0); end - - sig { params(arg0: ConstantPathNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_node(arg0); end - - sig { params(arg0: ConstantPathOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_operator_write_node(arg0); end - - sig { params(arg0: ConstantPathOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_or_write_node(arg0); end - - sig { params(arg0: ConstantPathTargetNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_target_node(arg0); end - - sig { params(arg0: ConstantPathWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_path_write_node(arg0); end - - sig { params(arg0: ConstantReadNode).returns(T::Array[::T.untyped]) } - def visit_constant_read_node(arg0); end - - sig { params(arg0: ConstantTargetNode).returns(T::Array[::T.untyped]) } - def visit_constant_target_node(arg0); end - - sig { params(arg0: ConstantWriteNode).returns(T::Array[::T.untyped]) } - def visit_constant_write_node(arg0); end - - sig { params(arg0: DefNode).returns(T::Array[::T.untyped]) } - def visit_def_node(arg0); end - - sig { params(arg0: DefinedNode).returns(T::Array[::T.untyped]) } - def visit_defined_node(arg0); end - - sig { params(arg0: ElseNode).returns(T::Array[::T.untyped]) } - def visit_else_node(arg0); end - - sig { params(arg0: EmbeddedStatementsNode).returns(T::Array[::T.untyped]) } - def visit_embedded_statements_node(arg0); end - - sig { params(arg0: EmbeddedVariableNode).returns(T::Array[::T.untyped]) } - def visit_embedded_variable_node(arg0); end - - sig { params(arg0: EnsureNode).returns(T::Array[::T.untyped]) } - def visit_ensure_node(arg0); end - - sig { params(arg0: FalseNode).returns(T::Array[::T.untyped]) } - def visit_false_node(arg0); end - - sig { params(arg0: FindPatternNode).returns(T::Array[::T.untyped]) } - def visit_find_pattern_node(arg0); end - - sig { params(arg0: FlipFlopNode).returns(T::Array[::T.untyped]) } - def visit_flip_flop_node(arg0); end - - sig { params(arg0: FloatNode).returns(T::Array[::T.untyped]) } - def visit_float_node(arg0); end - - sig { params(arg0: ForNode).returns(T::Array[::T.untyped]) } - def visit_for_node(arg0); end - - sig { params(arg0: ForwardingArgumentsNode).returns(T::Array[::T.untyped]) } - def visit_forwarding_arguments_node(arg0); end - - sig { params(arg0: ForwardingParameterNode).returns(T::Array[::T.untyped]) } - def visit_forwarding_parameter_node(arg0); end - - sig { params(arg0: ForwardingSuperNode).returns(T::Array[::T.untyped]) } - def visit_forwarding_super_node(arg0); end - - sig { params(arg0: GlobalVariableAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_and_write_node(arg0); end - - sig { params(arg0: GlobalVariableOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_operator_write_node(arg0); end - - sig { params(arg0: GlobalVariableOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_or_write_node(arg0); end - - sig { params(arg0: GlobalVariableReadNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_read_node(arg0); end - - sig { params(arg0: GlobalVariableTargetNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_target_node(arg0); end - - sig { params(arg0: GlobalVariableWriteNode).returns(T::Array[::T.untyped]) } - def visit_global_variable_write_node(arg0); end - - sig { params(arg0: HashNode).returns(T::Array[::T.untyped]) } - def visit_hash_node(arg0); end - - sig { params(arg0: HashPatternNode).returns(T::Array[::T.untyped]) } - def visit_hash_pattern_node(arg0); end - - sig { params(arg0: IfNode).returns(T::Array[::T.untyped]) } - def visit_if_node(arg0); end - - sig { params(arg0: ImaginaryNode).returns(T::Array[::T.untyped]) } - def visit_imaginary_node(arg0); end - - sig { params(arg0: ImplicitNode).returns(T::Array[::T.untyped]) } - def visit_implicit_node(arg0); end - - sig { params(arg0: ImplicitRestNode).returns(T::Array[::T.untyped]) } - def visit_implicit_rest_node(arg0); end - - sig { params(arg0: InNode).returns(T::Array[::T.untyped]) } - def visit_in_node(arg0); end - - sig { params(arg0: IndexAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_index_and_write_node(arg0); end - - sig { params(arg0: IndexOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_index_operator_write_node(arg0); end - - sig { params(arg0: IndexOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_index_or_write_node(arg0); end - - sig { params(arg0: IndexTargetNode).returns(T::Array[::T.untyped]) } - def visit_index_target_node(arg0); end - - sig { params(arg0: InstanceVariableAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_and_write_node(arg0); end - - sig { params(arg0: InstanceVariableOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_operator_write_node(arg0); end - - sig { params(arg0: InstanceVariableOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_or_write_node(arg0); end - - sig { params(arg0: InstanceVariableReadNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_read_node(arg0); end - - sig { params(arg0: InstanceVariableTargetNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_target_node(arg0); end - - sig { params(arg0: InstanceVariableWriteNode).returns(T::Array[::T.untyped]) } - def visit_instance_variable_write_node(arg0); end - - sig { params(arg0: IntegerNode).returns(T::Array[::T.untyped]) } - def visit_integer_node(arg0); end - - sig { params(arg0: InterpolatedMatchLastLineNode).returns(T::Array[::T.untyped]) } - def visit_interpolated_match_last_line_node(arg0); end - - sig { params(arg0: InterpolatedRegularExpressionNode).returns(T::Array[::T.untyped]) } - def visit_interpolated_regular_expression_node(arg0); end - - sig { params(arg0: InterpolatedStringNode).returns(T::Array[::T.untyped]) } - def visit_interpolated_string_node(arg0); end - - sig { params(arg0: InterpolatedSymbolNode).returns(T::Array[::T.untyped]) } - def visit_interpolated_symbol_node(arg0); end - - sig { params(arg0: InterpolatedXStringNode).returns(T::Array[::T.untyped]) } - def visit_interpolated_x_string_node(arg0); end - - sig { params(arg0: ItLocalVariableReadNode).returns(T::Array[::T.untyped]) } - def visit_it_local_variable_read_node(arg0); end - - sig { params(arg0: ItParametersNode).returns(T::Array[::T.untyped]) } - def visit_it_parameters_node(arg0); end - - sig { params(arg0: KeywordHashNode).returns(T::Array[::T.untyped]) } - def visit_keyword_hash_node(arg0); end - - sig { params(arg0: KeywordRestParameterNode).returns(T::Array[::T.untyped]) } - def visit_keyword_rest_parameter_node(arg0); end - - sig { params(arg0: LambdaNode).returns(T::Array[::T.untyped]) } - def visit_lambda_node(arg0); end - - sig { params(arg0: LocalVariableAndWriteNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_and_write_node(arg0); end - - sig { params(arg0: LocalVariableOperatorWriteNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_operator_write_node(arg0); end - - sig { params(arg0: LocalVariableOrWriteNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_or_write_node(arg0); end - - sig { params(arg0: LocalVariableReadNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_read_node(arg0); end - - sig { params(arg0: LocalVariableTargetNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_target_node(arg0); end - - sig { params(arg0: LocalVariableWriteNode).returns(T::Array[::T.untyped]) } - def visit_local_variable_write_node(arg0); end - - sig { params(arg0: MatchLastLineNode).returns(T::Array[::T.untyped]) } - def visit_match_last_line_node(arg0); end - - sig { params(arg0: MatchPredicateNode).returns(T::Array[::T.untyped]) } - def visit_match_predicate_node(arg0); end - - sig { params(arg0: MatchRequiredNode).returns(T::Array[::T.untyped]) } - def visit_match_required_node(arg0); end - - sig { params(arg0: MatchWriteNode).returns(T::Array[::T.untyped]) } - def visit_match_write_node(arg0); end - - sig { params(arg0: MissingNode).returns(T::Array[::T.untyped]) } - def visit_missing_node(arg0); end - - sig { params(arg0: ModuleNode).returns(T::Array[::T.untyped]) } - def visit_module_node(arg0); end - - sig { params(arg0: MultiTargetNode).returns(T::Array[::T.untyped]) } - def visit_multi_target_node(arg0); end - - sig { params(arg0: MultiWriteNode).returns(T::Array[::T.untyped]) } - def visit_multi_write_node(arg0); end - - sig { params(arg0: NextNode).returns(T::Array[::T.untyped]) } - def visit_next_node(arg0); end - - sig { params(arg0: NilNode).returns(T::Array[::T.untyped]) } - def visit_nil_node(arg0); end - - sig { params(arg0: NoBlockParameterNode).returns(T::Array[::T.untyped]) } - def visit_no_block_parameter_node(arg0); end - - sig { params(arg0: NoKeywordsParameterNode).returns(T::Array[::T.untyped]) } - def visit_no_keywords_parameter_node(arg0); end - - sig { params(arg0: NumberedParametersNode).returns(T::Array[::T.untyped]) } - def visit_numbered_parameters_node(arg0); end - - sig { params(arg0: NumberedReferenceReadNode).returns(T::Array[::T.untyped]) } - def visit_numbered_reference_read_node(arg0); end - - sig { params(arg0: OptionalKeywordParameterNode).returns(T::Array[::T.untyped]) } - def visit_optional_keyword_parameter_node(arg0); end - - sig { params(arg0: OptionalParameterNode).returns(T::Array[::T.untyped]) } - def visit_optional_parameter_node(arg0); end - - sig { params(arg0: OrNode).returns(T::Array[::T.untyped]) } - def visit_or_node(arg0); end - - sig { params(arg0: ParametersNode).returns(T::Array[::T.untyped]) } - def visit_parameters_node(arg0); end - - sig { params(arg0: ParenthesesNode).returns(T::Array[::T.untyped]) } - def visit_parentheses_node(arg0); end - - sig { params(arg0: PinnedExpressionNode).returns(T::Array[::T.untyped]) } - def visit_pinned_expression_node(arg0); end - - sig { params(arg0: PinnedVariableNode).returns(T::Array[::T.untyped]) } - def visit_pinned_variable_node(arg0); end - - sig { params(arg0: PostExecutionNode).returns(T::Array[::T.untyped]) } - def visit_post_execution_node(arg0); end - - sig { params(arg0: PreExecutionNode).returns(T::Array[::T.untyped]) } - def visit_pre_execution_node(arg0); end - - sig { params(arg0: ProgramNode).returns(T::Array[::T.untyped]) } - def visit_program_node(arg0); end - - sig { params(arg0: RangeNode).returns(T::Array[::T.untyped]) } - def visit_range_node(arg0); end - - sig { params(arg0: RationalNode).returns(T::Array[::T.untyped]) } - def visit_rational_node(arg0); end - - sig { params(arg0: RedoNode).returns(T::Array[::T.untyped]) } - def visit_redo_node(arg0); end - - sig { params(arg0: RegularExpressionNode).returns(T::Array[::T.untyped]) } - def visit_regular_expression_node(arg0); end - - sig { params(arg0: RequiredKeywordParameterNode).returns(T::Array[::T.untyped]) } - def visit_required_keyword_parameter_node(arg0); end - - sig { params(arg0: RequiredParameterNode).returns(T::Array[::T.untyped]) } - def visit_required_parameter_node(arg0); end - - sig { params(arg0: RescueModifierNode).returns(T::Array[::T.untyped]) } - def visit_rescue_modifier_node(arg0); end - - sig { params(arg0: RescueNode).returns(T::Array[::T.untyped]) } - def visit_rescue_node(arg0); end - - sig { params(arg0: RestParameterNode).returns(T::Array[::T.untyped]) } - def visit_rest_parameter_node(arg0); end - - sig { params(arg0: RetryNode).returns(T::Array[::T.untyped]) } - def visit_retry_node(arg0); end - - sig { params(arg0: ReturnNode).returns(T::Array[::T.untyped]) } - def visit_return_node(arg0); end - - sig { params(arg0: SelfNode).returns(T::Array[::T.untyped]) } - def visit_self_node(arg0); end - - sig { params(arg0: ShareableConstantNode).returns(T::Array[::T.untyped]) } - def visit_shareable_constant_node(arg0); end - - sig { params(arg0: SingletonClassNode).returns(T::Array[::T.untyped]) } - def visit_singleton_class_node(arg0); end - - sig { params(arg0: SourceEncodingNode).returns(T::Array[::T.untyped]) } - def visit_source_encoding_node(arg0); end - - sig { params(arg0: SourceFileNode).returns(T::Array[::T.untyped]) } - def visit_source_file_node(arg0); end - - sig { params(arg0: SourceLineNode).returns(T::Array[::T.untyped]) } - def visit_source_line_node(arg0); end - - sig { params(arg0: SplatNode).returns(T::Array[::T.untyped]) } - def visit_splat_node(arg0); end - - sig { params(arg0: StatementsNode).returns(T::Array[::T.untyped]) } - def visit_statements_node(arg0); end - - sig { params(arg0: StringNode).returns(T::Array[::T.untyped]) } - def visit_string_node(arg0); end - - sig { params(arg0: SuperNode).returns(T::Array[::T.untyped]) } - def visit_super_node(arg0); end - - sig { params(arg0: SymbolNode).returns(T::Array[::T.untyped]) } - def visit_symbol_node(arg0); end - - sig { params(arg0: TrueNode).returns(T::Array[::T.untyped]) } - def visit_true_node(arg0); end - - sig { params(arg0: UndefNode).returns(T::Array[::T.untyped]) } - def visit_undef_node(arg0); end - - sig { params(arg0: UnlessNode).returns(T::Array[::T.untyped]) } - def visit_unless_node(arg0); end - - sig { params(arg0: UntilNode).returns(T::Array[::T.untyped]) } - def visit_until_node(arg0); end - - sig { params(arg0: WhenNode).returns(T::Array[::T.untyped]) } - def visit_when_node(arg0); end - - sig { params(arg0: WhileNode).returns(T::Array[::T.untyped]) } - def visit_while_node(arg0); end - - sig { params(arg0: XStringNode).returns(T::Array[::T.untyped]) } - def visit_x_string_node(arg0); end - - sig { params(arg0: YieldNode).returns(T::Array[::T.untyped]) } - def visit_yield_node(arg0); end - end -end diff --git a/rbi/generated/prism/desugar_compiler.rbi b/rbi/generated/prism/desugar_compiler.rbi deleted file mode 100644 index 167624b9b6..0000000000 --- a/rbi/generated/prism/desugar_compiler.rbi +++ /dev/null @@ -1,306 +0,0 @@ -# typed: true - -module Prism - class DesugarAndWriteNode - include DSL - - sig { returns(::T.any(ClassVariableAndWriteNode, ConstantAndWriteNode, GlobalVariableAndWriteNode, InstanceVariableAndWriteNode, LocalVariableAndWriteNode)) } - attr_reader :node - - sig { returns(Source) } - attr_reader :default_source - - sig { returns(Symbol) } - attr_reader :read_class - - sig { returns(Symbol) } - attr_reader :write_class - - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :arguments - - sig { params(node: ::T.any(ClassVariableAndWriteNode, ConstantAndWriteNode, GlobalVariableAndWriteNode, InstanceVariableAndWriteNode, LocalVariableAndWriteNode), default_source: Source, read_class: Symbol, write_class: Symbol, arguments: ::T.untyped).void } - def initialize(node, default_source, read_class, write_class, **arguments); end - - # Desugar `x &&= y` to `x && x = y` - sig { returns(Node) } - def compile; end - end - - class DesugarOrWriteDefinedNode - include DSL - - sig { returns(::T.any(ClassVariableOrWriteNode, ConstantOrWriteNode, GlobalVariableOrWriteNode)) } - attr_reader :node - - sig { returns(Source) } - attr_reader :default_source - - sig { returns(Symbol) } - attr_reader :read_class - - sig { returns(Symbol) } - attr_reader :write_class - - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :arguments - - sig { params(node: ::T.any(ClassVariableOrWriteNode, ConstantOrWriteNode, GlobalVariableOrWriteNode), default_source: Source, read_class: Symbol, write_class: Symbol, arguments: ::T.untyped).void } - def initialize(node, default_source, read_class, write_class, **arguments); end - - # Desugar `x ||= y` to `defined?(x) ? x : x = y` - sig { returns(Node) } - def compile; end - end - - class DesugarOperatorWriteNode - include DSL - - sig { returns(::T.any(ClassVariableOperatorWriteNode, ConstantOperatorWriteNode, GlobalVariableOperatorWriteNode, InstanceVariableOperatorWriteNode, LocalVariableOperatorWriteNode)) } - attr_reader :node - - sig { returns(Source) } - attr_reader :default_source - - sig { returns(Symbol) } - attr_reader :read_class - - sig { returns(Symbol) } - attr_reader :write_class - - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :arguments - - sig { params(node: ::T.any(ClassVariableOperatorWriteNode, ConstantOperatorWriteNode, GlobalVariableOperatorWriteNode, InstanceVariableOperatorWriteNode, LocalVariableOperatorWriteNode), default_source: Source, read_class: Symbol, write_class: Symbol, arguments: ::T.untyped).void } - def initialize(node, default_source, read_class, write_class, **arguments); end - - # Desugar `x += y` to `x = x + y` - sig { returns(Node) } - def compile; end - end - - class DesugarOrWriteNode - include DSL - - sig { returns(::T.any(InstanceVariableOrWriteNode, LocalVariableOrWriteNode)) } - attr_reader :node - - sig { returns(Source) } - attr_reader :default_source - - sig { returns(Symbol) } - attr_reader :read_class - - sig { returns(Symbol) } - attr_reader :write_class - - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :arguments - - sig { params(node: ::T.any(InstanceVariableOrWriteNode, LocalVariableOrWriteNode), default_source: Source, read_class: Symbol, write_class: Symbol, arguments: ::T.untyped).void } - def initialize(node, default_source, read_class, write_class, **arguments); end - - # Desugar `x ||= y` to `x || x = y` - sig { returns(Node) } - def compile; end - end - - class ClassVariableAndWriteNode - sig { returns(Node) } - def desugar; end - end - - class ClassVariableOrWriteNode - sig { returns(Node) } - def desugar; end - end - - class ClassVariableOperatorWriteNode - sig { returns(Node) } - def desugar; end - end - - class ConstantAndWriteNode - sig { returns(Node) } - def desugar; end - end - - class ConstantOrWriteNode - sig { returns(Node) } - def desugar; end - end - - class ConstantOperatorWriteNode - sig { returns(Node) } - def desugar; end - end - - class GlobalVariableAndWriteNode - sig { returns(Node) } - def desugar; end - end - - class GlobalVariableOrWriteNode - sig { returns(Node) } - def desugar; end - end - - class GlobalVariableOperatorWriteNode - sig { returns(Node) } - def desugar; end - end - - class InstanceVariableAndWriteNode - sig { returns(Node) } - def desugar; end - end - - class InstanceVariableOrWriteNode - sig { returns(Node) } - def desugar; end - end - - class InstanceVariableOperatorWriteNode - sig { returns(Node) } - def desugar; end - end - - class LocalVariableAndWriteNode - sig { returns(Node) } - def desugar; end - end - - class LocalVariableOrWriteNode - sig { returns(Node) } - def desugar; end - end - - class LocalVariableOperatorWriteNode - sig { returns(Node) } - def desugar; end - end - - # DesugarCompiler is a compiler that desugars Ruby code into a more primitive - # form. This is useful for consumers that want to deal with fewer node types. - class DesugarCompiler < MutationCompiler - # `@@foo &&= bar` - # - # becomes - # - # `@@foo && @@foo = bar` - sig { params(node: ClassVariableAndWriteNode).returns(Node) } - def visit_class_variable_and_write_node(node); end - - # `@@foo ||= bar` - # - # becomes - # - # `defined?(@@foo) ? @@foo : @@foo = bar` - sig { params(node: ClassVariableOrWriteNode).returns(Node) } - def visit_class_variable_or_write_node(node); end - - # `@@foo += bar` - # - # becomes - # - # `@@foo = @@foo + bar` - sig { params(node: ClassVariableOperatorWriteNode).returns(Node) } - def visit_class_variable_operator_write_node(node); end - - # `Foo &&= bar` - # - # becomes - # - # `Foo && Foo = bar` - sig { params(node: ConstantAndWriteNode).returns(Node) } - def visit_constant_and_write_node(node); end - - # `Foo ||= bar` - # - # becomes - # - # `defined?(Foo) ? Foo : Foo = bar` - sig { params(node: ConstantOrWriteNode).returns(Node) } - def visit_constant_or_write_node(node); end - - # `Foo += bar` - # - # becomes - # - # `Foo = Foo + bar` - sig { params(node: ConstantOperatorWriteNode).returns(Node) } - def visit_constant_operator_write_node(node); end - - # `$foo &&= bar` - # - # becomes - # - # `$foo && $foo = bar` - sig { params(node: GlobalVariableAndWriteNode).returns(Node) } - def visit_global_variable_and_write_node(node); end - - # `$foo ||= bar` - # - # becomes - # - # `defined?($foo) ? $foo : $foo = bar` - sig { params(node: GlobalVariableOrWriteNode).returns(Node) } - def visit_global_variable_or_write_node(node); end - - # `$foo += bar` - # - # becomes - # - # `$foo = $foo + bar` - sig { params(node: GlobalVariableOperatorWriteNode).returns(Node) } - def visit_global_variable_operator_write_node(node); end - - # `@foo &&= bar` - # - # becomes - # - # `@foo && @foo = bar` - sig { params(node: InstanceVariableAndWriteNode).returns(Node) } - def visit_instance_variable_and_write_node(node); end - - # `@foo ||= bar` - # - # becomes - # - # `@foo || @foo = bar` - sig { params(node: InstanceVariableOrWriteNode).returns(Node) } - def visit_instance_variable_or_write_node(node); end - - # `@foo += bar` - # - # becomes - # - # `@foo = @foo + bar` - sig { params(node: InstanceVariableOperatorWriteNode).returns(Node) } - def visit_instance_variable_operator_write_node(node); end - - # `foo &&= bar` - # - # becomes - # - # `foo && foo = bar` - sig { params(node: LocalVariableAndWriteNode).returns(Node) } - def visit_local_variable_and_write_node(node); end - - # `foo ||= bar` - # - # becomes - # - # `foo || foo = bar` - sig { params(node: LocalVariableOrWriteNode).returns(Node) } - def visit_local_variable_or_write_node(node); end - - # `foo += bar` - # - # becomes - # - # `foo = foo + bar` - sig { params(node: LocalVariableOperatorWriteNode).returns(Node) } - def visit_local_variable_operator_write_node(node); end - end -end diff --git a/rbi/generated/prism/dispatcher.rbi b/rbi/generated/prism/dispatcher.rbi deleted file mode 100644 index 2dfeedf26f..0000000000 --- a/rbi/generated/prism/dispatcher.rbi +++ /dev/null @@ -1,1138 +0,0 @@ -# typed: true - -module Prism - # The dispatcher class fires events for nodes that are found while walking an - # AST to all registered listeners. It's useful for performing different types - # of analysis on the AST while only having to walk the tree once. - # - # To use the dispatcher, you would first instantiate it and register listeners - # for the events you're interested in: - # - # class OctalListener - # def on_integer_node_enter(node) - # if node.octal? && !node.slice.start_with?("0o") - # warn("Octal integers should be written with the 0o prefix") - # end - # end - # end - # - # listener = OctalListener.new - # dispatcher = Prism::Dispatcher.new - # dispatcher.register(listener, :on_integer_node_enter) - # - # Then, you can walk any number of trees and dispatch events to the listeners: - # - # result = Prism.parse("001 + 002 + 003") - # dispatcher.dispatch(result.value) - # - # Optionally, you can also use `#dispatch_once` to dispatch enter and leave - # events for a single node without recursing further down the tree. This can - # be useful in circumstances where you want to reuse the listeners you already - # have registers but want to stop walking the tree at a certain point. - # - # integer = result.value.statements.body.first.receiver.receiver - # dispatcher.dispatch_once(integer) - class Dispatcher < Visitor - # A hash mapping event names to arrays of listeners that should be notified - # when that event is fired. - sig { returns(T::Hash[Symbol, T::Array[::T.untyped]]) } - attr_reader :listeners - - # Initialize a new dispatcher. - sig { void } - def initialize; end - - # Register a listener for one or more events. - sig { params(arg0: ::T.untyped, args: Symbol).void } - def register(arg0, *args); end - - # Register all public methods of a listener that match the pattern - # `on__(enter|leave)`. - sig { params(arg0: ::T.untyped).void } - def register_public_methods(arg0); end - - # Register a listener for the given events. - sig { params(arg0: ::T.untyped, arg1: T::Array[Symbol]).void } - def register_events(arg0, arg1); end - - # Walks `root` dispatching events to all registered listeners. - sig { params(node: ::T.nilable(Node)).returns(::T.untyped) } - def dispatch(node); end - - # Dispatches a single event for `node` to all registered listeners. - sig { params(node: Node).void } - def dispatch_once(node); end - - sig { params(node: AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end - - sig { params(node: AliasMethodNode).void } - def visit_alias_method_node(node); end - - sig { params(node: AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end - - sig { params(node: AndNode).void } - def visit_and_node(node); end - - sig { params(node: ArgumentsNode).void } - def visit_arguments_node(node); end - - sig { params(node: ArrayNode).void } - def visit_array_node(node); end - - sig { params(node: ArrayPatternNode).void } - def visit_array_pattern_node(node); end - - sig { params(node: AssocNode).void } - def visit_assoc_node(node); end - - sig { params(node: AssocSplatNode).void } - def visit_assoc_splat_node(node); end - - sig { params(node: BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end - - sig { params(node: BeginNode).void } - def visit_begin_node(node); end - - sig { params(node: BlockArgumentNode).void } - def visit_block_argument_node(node); end - - sig { params(node: BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end - - sig { params(node: BlockNode).void } - def visit_block_node(node); end - - sig { params(node: BlockParameterNode).void } - def visit_block_parameter_node(node); end - - sig { params(node: BlockParametersNode).void } - def visit_block_parameters_node(node); end - - sig { params(node: BreakNode).void } - def visit_break_node(node); end - - sig { params(node: CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - sig { params(node: CallNode).void } - def visit_call_node(node); end - - sig { params(node: CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - sig { params(node: CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - sig { params(node: CallTargetNode).void } - def visit_call_target_node(node); end - - sig { params(node: CapturePatternNode).void } - def visit_capture_pattern_node(node); end - - sig { params(node: CaseMatchNode).void } - def visit_case_match_node(node); end - - sig { params(node: CaseNode).void } - def visit_case_node(node); end - - sig { params(node: ClassNode).void } - def visit_class_node(node); end - - sig { params(node: ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end - - sig { params(node: ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end - - sig { params(node: ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end - - sig { params(node: ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end - - sig { params(node: ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end - - sig { params(node: ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end - - sig { params(node: ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - sig { params(node: ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - sig { params(node: ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - sig { params(node: ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end - - sig { params(node: ConstantPathNode).void } - def visit_constant_path_node(node); end - - sig { params(node: ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end - - sig { params(node: ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end - - sig { params(node: ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end - - sig { params(node: ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - sig { params(node: ConstantReadNode).void } - def visit_constant_read_node(node); end - - sig { params(node: ConstantTargetNode).void } - def visit_constant_target_node(node); end - - sig { params(node: ConstantWriteNode).void } - def visit_constant_write_node(node); end - - sig { params(node: DefNode).void } - def visit_def_node(node); end - - sig { params(node: DefinedNode).void } - def visit_defined_node(node); end - - sig { params(node: ElseNode).void } - def visit_else_node(node); end - - sig { params(node: EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end - - sig { params(node: EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end - - sig { params(node: EnsureNode).void } - def visit_ensure_node(node); end - - sig { params(node: FalseNode).void } - def visit_false_node(node); end - - sig { params(node: FindPatternNode).void } - def visit_find_pattern_node(node); end - - sig { params(node: FlipFlopNode).void } - def visit_flip_flop_node(node); end - - sig { params(node: FloatNode).void } - def visit_float_node(node); end - - sig { params(node: ForNode).void } - def visit_for_node(node); end - - sig { params(node: ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end - - sig { params(node: ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end - - sig { params(node: ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end - - sig { params(node: GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end - - sig { params(node: GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end - - sig { params(node: GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end - - sig { params(node: GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end - - sig { params(node: GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end - - sig { params(node: GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end - - sig { params(node: HashNode).void } - def visit_hash_node(node); end - - sig { params(node: HashPatternNode).void } - def visit_hash_pattern_node(node); end - - sig { params(node: IfNode).void } - def visit_if_node(node); end - - sig { params(node: ImaginaryNode).void } - def visit_imaginary_node(node); end - - sig { params(node: ImplicitNode).void } - def visit_implicit_node(node); end - - sig { params(node: ImplicitRestNode).void } - def visit_implicit_rest_node(node); end - - sig { params(node: InNode).void } - def visit_in_node(node); end - - sig { params(node: IndexAndWriteNode).void } - def visit_index_and_write_node(node); end - - sig { params(node: IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end - - sig { params(node: IndexOrWriteNode).void } - def visit_index_or_write_node(node); end - - sig { params(node: IndexTargetNode).void } - def visit_index_target_node(node); end - - sig { params(node: InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end - - sig { params(node: InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end - - sig { params(node: InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end - - sig { params(node: InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end - - sig { params(node: InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end - - sig { params(node: InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end - - sig { params(node: IntegerNode).void } - def visit_integer_node(node); end - - sig { params(node: InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end - - sig { params(node: InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end - - sig { params(node: InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end - - sig { params(node: InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end - - sig { params(node: InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end - - sig { params(node: ItLocalVariableReadNode).void } - def visit_it_local_variable_read_node(node); end - - sig { params(node: ItParametersNode).void } - def visit_it_parameters_node(node); end - - sig { params(node: KeywordHashNode).void } - def visit_keyword_hash_node(node); end - - sig { params(node: KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end - - sig { params(node: LambdaNode).void } - def visit_lambda_node(node); end - - sig { params(node: LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - sig { params(node: LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - sig { params(node: LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - sig { params(node: LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - sig { params(node: LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - sig { params(node: LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - sig { params(node: MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - sig { params(node: MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - sig { params(node: MatchRequiredNode).void } - def visit_match_required_node(node); end - - sig { params(node: MatchWriteNode).void } - def visit_match_write_node(node); end - - sig { params(node: MissingNode).void } - def visit_missing_node(node); end - - sig { params(node: ModuleNode).void } - def visit_module_node(node); end - - sig { params(node: MultiTargetNode).void } - def visit_multi_target_node(node); end - - sig { params(node: MultiWriteNode).void } - def visit_multi_write_node(node); end - - sig { params(node: NextNode).void } - def visit_next_node(node); end - - sig { params(node: NilNode).void } - def visit_nil_node(node); end - - sig { params(node: NoBlockParameterNode).void } - def visit_no_block_parameter_node(node); end - - sig { params(node: NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - sig { params(node: NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - sig { params(node: NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - sig { params(node: OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - sig { params(node: OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - sig { params(node: OrNode).void } - def visit_or_node(node); end - - sig { params(node: ParametersNode).void } - def visit_parameters_node(node); end - - sig { params(node: ParenthesesNode).void } - def visit_parentheses_node(node); end - - sig { params(node: PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - sig { params(node: PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - sig { params(node: PostExecutionNode).void } - def visit_post_execution_node(node); end - - sig { params(node: PreExecutionNode).void } - def visit_pre_execution_node(node); end - - sig { params(node: ProgramNode).void } - def visit_program_node(node); end - - sig { params(node: RangeNode).void } - def visit_range_node(node); end - - sig { params(node: RationalNode).void } - def visit_rational_node(node); end - - sig { params(node: RedoNode).void } - def visit_redo_node(node); end - - sig { params(node: RegularExpressionNode).void } - def visit_regular_expression_node(node); end - - sig { params(node: RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end - - sig { params(node: RequiredParameterNode).void } - def visit_required_parameter_node(node); end - - sig { params(node: RescueModifierNode).void } - def visit_rescue_modifier_node(node); end - - sig { params(node: RescueNode).void } - def visit_rescue_node(node); end - - sig { params(node: RestParameterNode).void } - def visit_rest_parameter_node(node); end - - sig { params(node: RetryNode).void } - def visit_retry_node(node); end - - sig { params(node: ReturnNode).void } - def visit_return_node(node); end - - sig { params(node: SelfNode).void } - def visit_self_node(node); end - - sig { params(node: ShareableConstantNode).void } - def visit_shareable_constant_node(node); end - - sig { params(node: SingletonClassNode).void } - def visit_singleton_class_node(node); end - - sig { params(node: SourceEncodingNode).void } - def visit_source_encoding_node(node); end - - sig { params(node: SourceFileNode).void } - def visit_source_file_node(node); end - - sig { params(node: SourceLineNode).void } - def visit_source_line_node(node); end - - sig { params(node: SplatNode).void } - def visit_splat_node(node); end - - sig { params(node: StatementsNode).void } - def visit_statements_node(node); end - - sig { params(node: StringNode).void } - def visit_string_node(node); end - - sig { params(node: SuperNode).void } - def visit_super_node(node); end - - sig { params(node: SymbolNode).void } - def visit_symbol_node(node); end - - sig { params(node: TrueNode).void } - def visit_true_node(node); end - - sig { params(node: UndefNode).void } - def visit_undef_node(node); end - - sig { params(node: UnlessNode).void } - def visit_unless_node(node); end - - sig { params(node: UntilNode).void } - def visit_until_node(node); end - - sig { params(node: WhenNode).void } - def visit_when_node(node); end - - sig { params(node: WhileNode).void } - def visit_while_node(node); end - - sig { params(node: XStringNode).void } - def visit_x_string_node(node); end - - sig { params(node: YieldNode).void } - def visit_yield_node(node); end - - class DispatchOnce < Visitor - sig { returns(T::Hash[Symbol, T::Array[::T.untyped]]) } - attr_reader :listeners - - sig { params(listeners: T::Hash[Symbol, T::Array[::T.untyped]]).void } - def initialize(listeners); end - - # Dispatch enter and leave events for AliasGlobalVariableNode nodes. - sig { params(node: AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end - - # Dispatch enter and leave events for AliasMethodNode nodes. - sig { params(node: AliasMethodNode).void } - def visit_alias_method_node(node); end - - # Dispatch enter and leave events for AlternationPatternNode nodes. - sig { params(node: AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end - - # Dispatch enter and leave events for AndNode nodes. - sig { params(node: AndNode).void } - def visit_and_node(node); end - - # Dispatch enter and leave events for ArgumentsNode nodes. - sig { params(node: ArgumentsNode).void } - def visit_arguments_node(node); end - - # Dispatch enter and leave events for ArrayNode nodes. - sig { params(node: ArrayNode).void } - def visit_array_node(node); end - - # Dispatch enter and leave events for ArrayPatternNode nodes. - sig { params(node: ArrayPatternNode).void } - def visit_array_pattern_node(node); end - - # Dispatch enter and leave events for AssocNode nodes. - sig { params(node: AssocNode).void } - def visit_assoc_node(node); end - - # Dispatch enter and leave events for AssocSplatNode nodes. - sig { params(node: AssocSplatNode).void } - def visit_assoc_splat_node(node); end - - # Dispatch enter and leave events for BackReferenceReadNode nodes. - sig { params(node: BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end - - # Dispatch enter and leave events for BeginNode nodes. - sig { params(node: BeginNode).void } - def visit_begin_node(node); end - - # Dispatch enter and leave events for BlockArgumentNode nodes. - sig { params(node: BlockArgumentNode).void } - def visit_block_argument_node(node); end - - # Dispatch enter and leave events for BlockLocalVariableNode nodes. - sig { params(node: BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end - - # Dispatch enter and leave events for BlockNode nodes. - sig { params(node: BlockNode).void } - def visit_block_node(node); end - - # Dispatch enter and leave events for BlockParameterNode nodes. - sig { params(node: BlockParameterNode).void } - def visit_block_parameter_node(node); end - - # Dispatch enter and leave events for BlockParametersNode nodes. - sig { params(node: BlockParametersNode).void } - def visit_block_parameters_node(node); end - - # Dispatch enter and leave events for BreakNode nodes. - sig { params(node: BreakNode).void } - def visit_break_node(node); end - - # Dispatch enter and leave events for CallAndWriteNode nodes. - sig { params(node: CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - # Dispatch enter and leave events for CallNode nodes. - sig { params(node: CallNode).void } - def visit_call_node(node); end - - # Dispatch enter and leave events for CallOperatorWriteNode nodes. - sig { params(node: CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - # Dispatch enter and leave events for CallOrWriteNode nodes. - sig { params(node: CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - # Dispatch enter and leave events for CallTargetNode nodes. - sig { params(node: CallTargetNode).void } - def visit_call_target_node(node); end - - # Dispatch enter and leave events for CapturePatternNode nodes. - sig { params(node: CapturePatternNode).void } - def visit_capture_pattern_node(node); end - - # Dispatch enter and leave events for CaseMatchNode nodes. - sig { params(node: CaseMatchNode).void } - def visit_case_match_node(node); end - - # Dispatch enter and leave events for CaseNode nodes. - sig { params(node: CaseNode).void } - def visit_case_node(node); end - - # Dispatch enter and leave events for ClassNode nodes. - sig { params(node: ClassNode).void } - def visit_class_node(node); end - - # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. - sig { params(node: ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end - - # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. - sig { params(node: ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end - - # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. - sig { params(node: ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end - - # Dispatch enter and leave events for ClassVariableReadNode nodes. - sig { params(node: ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end - - # Dispatch enter and leave events for ClassVariableTargetNode nodes. - sig { params(node: ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end - - # Dispatch enter and leave events for ClassVariableWriteNode nodes. - sig { params(node: ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end - - # Dispatch enter and leave events for ConstantAndWriteNode nodes. - sig { params(node: ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. - sig { params(node: ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - # Dispatch enter and leave events for ConstantOrWriteNode nodes. - sig { params(node: ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. - sig { params(node: ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end - - # Dispatch enter and leave events for ConstantPathNode nodes. - sig { params(node: ConstantPathNode).void } - def visit_constant_path_node(node); end - - # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. - sig { params(node: ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end - - # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. - sig { params(node: ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end - - # Dispatch enter and leave events for ConstantPathTargetNode nodes. - sig { params(node: ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end - - # Dispatch enter and leave events for ConstantPathWriteNode nodes. - sig { params(node: ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # Dispatch enter and leave events for ConstantReadNode nodes. - sig { params(node: ConstantReadNode).void } - def visit_constant_read_node(node); end - - # Dispatch enter and leave events for ConstantTargetNode nodes. - sig { params(node: ConstantTargetNode).void } - def visit_constant_target_node(node); end - - # Dispatch enter and leave events for ConstantWriteNode nodes. - sig { params(node: ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # Dispatch enter and leave events for DefNode nodes. - sig { params(node: DefNode).void } - def visit_def_node(node); end - - # Dispatch enter and leave events for DefinedNode nodes. - sig { params(node: DefinedNode).void } - def visit_defined_node(node); end - - # Dispatch enter and leave events for ElseNode nodes. - sig { params(node: ElseNode).void } - def visit_else_node(node); end - - # Dispatch enter and leave events for EmbeddedStatementsNode nodes. - sig { params(node: EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end - - # Dispatch enter and leave events for EmbeddedVariableNode nodes. - sig { params(node: EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end - - # Dispatch enter and leave events for EnsureNode nodes. - sig { params(node: EnsureNode).void } - def visit_ensure_node(node); end - - # Dispatch enter and leave events for FalseNode nodes. - sig { params(node: FalseNode).void } - def visit_false_node(node); end - - # Dispatch enter and leave events for FindPatternNode nodes. - sig { params(node: FindPatternNode).void } - def visit_find_pattern_node(node); end - - # Dispatch enter and leave events for FlipFlopNode nodes. - sig { params(node: FlipFlopNode).void } - def visit_flip_flop_node(node); end - - # Dispatch enter and leave events for FloatNode nodes. - sig { params(node: FloatNode).void } - def visit_float_node(node); end - - # Dispatch enter and leave events for ForNode nodes. - sig { params(node: ForNode).void } - def visit_for_node(node); end - - # Dispatch enter and leave events for ForwardingArgumentsNode nodes. - sig { params(node: ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end - - # Dispatch enter and leave events for ForwardingParameterNode nodes. - sig { params(node: ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end - - # Dispatch enter and leave events for ForwardingSuperNode nodes. - sig { params(node: ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end - - # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. - sig { params(node: GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end - - # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. - sig { params(node: GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end - - # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. - sig { params(node: GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end - - # Dispatch enter and leave events for GlobalVariableReadNode nodes. - sig { params(node: GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end - - # Dispatch enter and leave events for GlobalVariableTargetNode nodes. - sig { params(node: GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end - - # Dispatch enter and leave events for GlobalVariableWriteNode nodes. - sig { params(node: GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end - - # Dispatch enter and leave events for HashNode nodes. - sig { params(node: HashNode).void } - def visit_hash_node(node); end - - # Dispatch enter and leave events for HashPatternNode nodes. - sig { params(node: HashPatternNode).void } - def visit_hash_pattern_node(node); end - - # Dispatch enter and leave events for IfNode nodes. - sig { params(node: IfNode).void } - def visit_if_node(node); end - - # Dispatch enter and leave events for ImaginaryNode nodes. - sig { params(node: ImaginaryNode).void } - def visit_imaginary_node(node); end - - # Dispatch enter and leave events for ImplicitNode nodes. - sig { params(node: ImplicitNode).void } - def visit_implicit_node(node); end - - # Dispatch enter and leave events for ImplicitRestNode nodes. - sig { params(node: ImplicitRestNode).void } - def visit_implicit_rest_node(node); end - - # Dispatch enter and leave events for InNode nodes. - sig { params(node: InNode).void } - def visit_in_node(node); end - - # Dispatch enter and leave events for IndexAndWriteNode nodes. - sig { params(node: IndexAndWriteNode).void } - def visit_index_and_write_node(node); end - - # Dispatch enter and leave events for IndexOperatorWriteNode nodes. - sig { params(node: IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end - - # Dispatch enter and leave events for IndexOrWriteNode nodes. - sig { params(node: IndexOrWriteNode).void } - def visit_index_or_write_node(node); end - - # Dispatch enter and leave events for IndexTargetNode nodes. - sig { params(node: IndexTargetNode).void } - def visit_index_target_node(node); end - - # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. - sig { params(node: InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end - - # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. - sig { params(node: InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end - - # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. - sig { params(node: InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end - - # Dispatch enter and leave events for InstanceVariableReadNode nodes. - sig { params(node: InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end - - # Dispatch enter and leave events for InstanceVariableTargetNode nodes. - sig { params(node: InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end - - # Dispatch enter and leave events for InstanceVariableWriteNode nodes. - sig { params(node: InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end - - # Dispatch enter and leave events for IntegerNode nodes. - sig { params(node: IntegerNode).void } - def visit_integer_node(node); end - - # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. - sig { params(node: InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end - - # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. - sig { params(node: InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end - - # Dispatch enter and leave events for InterpolatedStringNode nodes. - sig { params(node: InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end - - # Dispatch enter and leave events for InterpolatedSymbolNode nodes. - sig { params(node: InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end - - # Dispatch enter and leave events for InterpolatedXStringNode nodes. - sig { params(node: InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end - - # Dispatch enter and leave events for ItLocalVariableReadNode nodes. - sig { params(node: ItLocalVariableReadNode).void } - def visit_it_local_variable_read_node(node); end - - # Dispatch enter and leave events for ItParametersNode nodes. - sig { params(node: ItParametersNode).void } - def visit_it_parameters_node(node); end - - # Dispatch enter and leave events for KeywordHashNode nodes. - sig { params(node: KeywordHashNode).void } - def visit_keyword_hash_node(node); end - - # Dispatch enter and leave events for KeywordRestParameterNode nodes. - sig { params(node: KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end - - # Dispatch enter and leave events for LambdaNode nodes. - sig { params(node: LambdaNode).void } - def visit_lambda_node(node); end - - # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. - sig { params(node: LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. - sig { params(node: LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. - sig { params(node: LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - # Dispatch enter and leave events for LocalVariableReadNode nodes. - sig { params(node: LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - # Dispatch enter and leave events for LocalVariableTargetNode nodes. - sig { params(node: LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - # Dispatch enter and leave events for LocalVariableWriteNode nodes. - sig { params(node: LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - # Dispatch enter and leave events for MatchLastLineNode nodes. - sig { params(node: MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - # Dispatch enter and leave events for MatchPredicateNode nodes. - sig { params(node: MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - # Dispatch enter and leave events for MatchRequiredNode nodes. - sig { params(node: MatchRequiredNode).void } - def visit_match_required_node(node); end - - # Dispatch enter and leave events for MatchWriteNode nodes. - sig { params(node: MatchWriteNode).void } - def visit_match_write_node(node); end - - # Dispatch enter and leave events for MissingNode nodes. - sig { params(node: MissingNode).void } - def visit_missing_node(node); end - - # Dispatch enter and leave events for ModuleNode nodes. - sig { params(node: ModuleNode).void } - def visit_module_node(node); end - - # Dispatch enter and leave events for MultiTargetNode nodes. - sig { params(node: MultiTargetNode).void } - def visit_multi_target_node(node); end - - # Dispatch enter and leave events for MultiWriteNode nodes. - sig { params(node: MultiWriteNode).void } - def visit_multi_write_node(node); end - - # Dispatch enter and leave events for NextNode nodes. - sig { params(node: NextNode).void } - def visit_next_node(node); end - - # Dispatch enter and leave events for NilNode nodes. - sig { params(node: NilNode).void } - def visit_nil_node(node); end - - # Dispatch enter and leave events for NoBlockParameterNode nodes. - sig { params(node: NoBlockParameterNode).void } - def visit_no_block_parameter_node(node); end - - # Dispatch enter and leave events for NoKeywordsParameterNode nodes. - sig { params(node: NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - # Dispatch enter and leave events for NumberedParametersNode nodes. - sig { params(node: NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - # Dispatch enter and leave events for NumberedReferenceReadNode nodes. - sig { params(node: NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. - sig { params(node: OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - # Dispatch enter and leave events for OptionalParameterNode nodes. - sig { params(node: OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - # Dispatch enter and leave events for OrNode nodes. - sig { params(node: OrNode).void } - def visit_or_node(node); end - - # Dispatch enter and leave events for ParametersNode nodes. - sig { params(node: ParametersNode).void } - def visit_parameters_node(node); end - - # Dispatch enter and leave events for ParenthesesNode nodes. - sig { params(node: ParenthesesNode).void } - def visit_parentheses_node(node); end - - # Dispatch enter and leave events for PinnedExpressionNode nodes. - sig { params(node: PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - # Dispatch enter and leave events for PinnedVariableNode nodes. - sig { params(node: PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - # Dispatch enter and leave events for PostExecutionNode nodes. - sig { params(node: PostExecutionNode).void } - def visit_post_execution_node(node); end - - # Dispatch enter and leave events for PreExecutionNode nodes. - sig { params(node: PreExecutionNode).void } - def visit_pre_execution_node(node); end - - # Dispatch enter and leave events for ProgramNode nodes. - sig { params(node: ProgramNode).void } - def visit_program_node(node); end - - # Dispatch enter and leave events for RangeNode nodes. - sig { params(node: RangeNode).void } - def visit_range_node(node); end - - # Dispatch enter and leave events for RationalNode nodes. - sig { params(node: RationalNode).void } - def visit_rational_node(node); end - - # Dispatch enter and leave events for RedoNode nodes. - sig { params(node: RedoNode).void } - def visit_redo_node(node); end - - # Dispatch enter and leave events for RegularExpressionNode nodes. - sig { params(node: RegularExpressionNode).void } - def visit_regular_expression_node(node); end - - # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. - sig { params(node: RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end - - # Dispatch enter and leave events for RequiredParameterNode nodes. - sig { params(node: RequiredParameterNode).void } - def visit_required_parameter_node(node); end - - # Dispatch enter and leave events for RescueModifierNode nodes. - sig { params(node: RescueModifierNode).void } - def visit_rescue_modifier_node(node); end - - # Dispatch enter and leave events for RescueNode nodes. - sig { params(node: RescueNode).void } - def visit_rescue_node(node); end - - # Dispatch enter and leave events for RestParameterNode nodes. - sig { params(node: RestParameterNode).void } - def visit_rest_parameter_node(node); end - - # Dispatch enter and leave events for RetryNode nodes. - sig { params(node: RetryNode).void } - def visit_retry_node(node); end - - # Dispatch enter and leave events for ReturnNode nodes. - sig { params(node: ReturnNode).void } - def visit_return_node(node); end - - # Dispatch enter and leave events for SelfNode nodes. - sig { params(node: SelfNode).void } - def visit_self_node(node); end - - # Dispatch enter and leave events for ShareableConstantNode nodes. - sig { params(node: ShareableConstantNode).void } - def visit_shareable_constant_node(node); end - - # Dispatch enter and leave events for SingletonClassNode nodes. - sig { params(node: SingletonClassNode).void } - def visit_singleton_class_node(node); end - - # Dispatch enter and leave events for SourceEncodingNode nodes. - sig { params(node: SourceEncodingNode).void } - def visit_source_encoding_node(node); end - - # Dispatch enter and leave events for SourceFileNode nodes. - sig { params(node: SourceFileNode).void } - def visit_source_file_node(node); end - - # Dispatch enter and leave events for SourceLineNode nodes. - sig { params(node: SourceLineNode).void } - def visit_source_line_node(node); end - - # Dispatch enter and leave events for SplatNode nodes. - sig { params(node: SplatNode).void } - def visit_splat_node(node); end - - # Dispatch enter and leave events for StatementsNode nodes. - sig { params(node: StatementsNode).void } - def visit_statements_node(node); end - - # Dispatch enter and leave events for StringNode nodes. - sig { params(node: StringNode).void } - def visit_string_node(node); end - - # Dispatch enter and leave events for SuperNode nodes. - sig { params(node: SuperNode).void } - def visit_super_node(node); end - - # Dispatch enter and leave events for SymbolNode nodes. - sig { params(node: SymbolNode).void } - def visit_symbol_node(node); end - - # Dispatch enter and leave events for TrueNode nodes. - sig { params(node: TrueNode).void } - def visit_true_node(node); end - - # Dispatch enter and leave events for UndefNode nodes. - sig { params(node: UndefNode).void } - def visit_undef_node(node); end - - # Dispatch enter and leave events for UnlessNode nodes. - sig { params(node: UnlessNode).void } - def visit_unless_node(node); end - - # Dispatch enter and leave events for UntilNode nodes. - sig { params(node: UntilNode).void } - def visit_until_node(node); end - - # Dispatch enter and leave events for WhenNode nodes. - sig { params(node: WhenNode).void } - def visit_when_node(node); end - - # Dispatch enter and leave events for WhileNode nodes. - sig { params(node: WhileNode).void } - def visit_while_node(node); end - - # Dispatch enter and leave events for XStringNode nodes. - sig { params(node: XStringNode).void } - def visit_x_string_node(node); end - - # Dispatch enter and leave events for YieldNode nodes. - sig { params(node: YieldNode).void } - def visit_yield_node(node); end - end - end -end diff --git a/rbi/generated/prism/dot_visitor.rbi b/rbi/generated/prism/dot_visitor.rbi deleted file mode 100644 index d707be5a1a..0000000000 --- a/rbi/generated/prism/dot_visitor.rbi +++ /dev/null @@ -1,618 +0,0 @@ -# typed: true - -module Prism - # This visitor provides the ability to call Node#to_dot, which converts a - # subtree into a graphviz dot graph. - class DotVisitor < Visitor - class Field - sig { returns(String) } - attr_reader :name - - sig { returns(::T.nilable(String)) } - attr_reader :value - - sig { returns(T::Boolean) } - attr_reader :port - - sig { params(name: String, value: ::T.nilable(String), port: T::Boolean).void } - def initialize(name, value, port); end - - sig { returns(String) } - def to_dot; end - end - - class Table - sig { returns(String) } - attr_reader :name - - sig { returns(T::Array[Field]) } - attr_reader :fields - - sig { params(name: String).void } - def initialize(name); end - - sig { params(name: String, value: ::T.nilable(String), port: T::Boolean).void } - def field(name, value = T.unsafe(nil), port: T.unsafe(nil)); end - - sig { returns(String) } - def to_dot; end - end - - class Digraph - sig { returns(T::Array[String]) } - attr_reader :nodes - - sig { returns(T::Array[String]) } - attr_reader :waypoints - - sig { returns(T::Array[String]) } - attr_reader :edges - - sig { void } - def initialize; end - - sig { params(value: String).void } - def node(value); end - - sig { params(value: String).void } - def waypoint(value); end - - sig { params(value: String).void } - def edge(value); end - - sig { returns(String) } - def to_dot; end - end - - # The digraph that is being built. - sig { returns(Digraph) } - attr_reader :digraph - - # Initialize a new dot visitor. - sig { void } - def initialize; end - - # Convert this visitor into a graphviz dot graph string. - sig { returns(String) } - def to_dot; end - - sig { params(arg0: AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(arg0); end - - sig { params(arg0: AliasMethodNode).void } - def visit_alias_method_node(arg0); end - - sig { params(arg0: AlternationPatternNode).void } - def visit_alternation_pattern_node(arg0); end - - sig { params(arg0: AndNode).void } - def visit_and_node(arg0); end - - sig { params(arg0: ArgumentsNode).void } - def visit_arguments_node(arg0); end - - sig { params(arg0: ArrayNode).void } - def visit_array_node(arg0); end - - sig { params(arg0: ArrayPatternNode).void } - def visit_array_pattern_node(arg0); end - - sig { params(arg0: AssocNode).void } - def visit_assoc_node(arg0); end - - sig { params(arg0: AssocSplatNode).void } - def visit_assoc_splat_node(arg0); end - - sig { params(arg0: BackReferenceReadNode).void } - def visit_back_reference_read_node(arg0); end - - sig { params(arg0: BeginNode).void } - def visit_begin_node(arg0); end - - sig { params(arg0: BlockArgumentNode).void } - def visit_block_argument_node(arg0); end - - sig { params(arg0: BlockLocalVariableNode).void } - def visit_block_local_variable_node(arg0); end - - sig { params(arg0: BlockNode).void } - def visit_block_node(arg0); end - - sig { params(arg0: BlockParameterNode).void } - def visit_block_parameter_node(arg0); end - - sig { params(arg0: BlockParametersNode).void } - def visit_block_parameters_node(arg0); end - - sig { params(arg0: BreakNode).void } - def visit_break_node(arg0); end - - sig { params(arg0: CallAndWriteNode).void } - def visit_call_and_write_node(arg0); end - - sig { params(arg0: CallNode).void } - def visit_call_node(arg0); end - - sig { params(arg0: CallOperatorWriteNode).void } - def visit_call_operator_write_node(arg0); end - - sig { params(arg0: CallOrWriteNode).void } - def visit_call_or_write_node(arg0); end - - sig { params(arg0: CallTargetNode).void } - def visit_call_target_node(arg0); end - - sig { params(arg0: CapturePatternNode).void } - def visit_capture_pattern_node(arg0); end - - sig { params(arg0: CaseMatchNode).void } - def visit_case_match_node(arg0); end - - sig { params(arg0: CaseNode).void } - def visit_case_node(arg0); end - - sig { params(arg0: ClassNode).void } - def visit_class_node(arg0); end - - sig { params(arg0: ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(arg0); end - - sig { params(arg0: ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(arg0); end - - sig { params(arg0: ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(arg0); end - - sig { params(arg0: ClassVariableReadNode).void } - def visit_class_variable_read_node(arg0); end - - sig { params(arg0: ClassVariableTargetNode).void } - def visit_class_variable_target_node(arg0); end - - sig { params(arg0: ClassVariableWriteNode).void } - def visit_class_variable_write_node(arg0); end - - sig { params(arg0: ConstantAndWriteNode).void } - def visit_constant_and_write_node(arg0); end - - sig { params(arg0: ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(arg0); end - - sig { params(arg0: ConstantOrWriteNode).void } - def visit_constant_or_write_node(arg0); end - - sig { params(arg0: ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(arg0); end - - sig { params(arg0: ConstantPathNode).void } - def visit_constant_path_node(arg0); end - - sig { params(arg0: ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(arg0); end - - sig { params(arg0: ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(arg0); end - - sig { params(arg0: ConstantPathTargetNode).void } - def visit_constant_path_target_node(arg0); end - - sig { params(arg0: ConstantPathWriteNode).void } - def visit_constant_path_write_node(arg0); end - - sig { params(arg0: ConstantReadNode).void } - def visit_constant_read_node(arg0); end - - sig { params(arg0: ConstantTargetNode).void } - def visit_constant_target_node(arg0); end - - sig { params(arg0: ConstantWriteNode).void } - def visit_constant_write_node(arg0); end - - sig { params(arg0: DefNode).void } - def visit_def_node(arg0); end - - sig { params(arg0: DefinedNode).void } - def visit_defined_node(arg0); end - - sig { params(arg0: ElseNode).void } - def visit_else_node(arg0); end - - sig { params(arg0: EmbeddedStatementsNode).void } - def visit_embedded_statements_node(arg0); end - - sig { params(arg0: EmbeddedVariableNode).void } - def visit_embedded_variable_node(arg0); end - - sig { params(arg0: EnsureNode).void } - def visit_ensure_node(arg0); end - - sig { params(arg0: FalseNode).void } - def visit_false_node(arg0); end - - sig { params(arg0: FindPatternNode).void } - def visit_find_pattern_node(arg0); end - - sig { params(arg0: FlipFlopNode).void } - def visit_flip_flop_node(arg0); end - - sig { params(arg0: FloatNode).void } - def visit_float_node(arg0); end - - sig { params(arg0: ForNode).void } - def visit_for_node(arg0); end - - sig { params(arg0: ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(arg0); end - - sig { params(arg0: ForwardingParameterNode).void } - def visit_forwarding_parameter_node(arg0); end - - sig { params(arg0: ForwardingSuperNode).void } - def visit_forwarding_super_node(arg0); end - - sig { params(arg0: GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(arg0); end - - sig { params(arg0: GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(arg0); end - - sig { params(arg0: GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(arg0); end - - sig { params(arg0: GlobalVariableReadNode).void } - def visit_global_variable_read_node(arg0); end - - sig { params(arg0: GlobalVariableTargetNode).void } - def visit_global_variable_target_node(arg0); end - - sig { params(arg0: GlobalVariableWriteNode).void } - def visit_global_variable_write_node(arg0); end - - sig { params(arg0: HashNode).void } - def visit_hash_node(arg0); end - - sig { params(arg0: HashPatternNode).void } - def visit_hash_pattern_node(arg0); end - - sig { params(arg0: IfNode).void } - def visit_if_node(arg0); end - - sig { params(arg0: ImaginaryNode).void } - def visit_imaginary_node(arg0); end - - sig { params(arg0: ImplicitNode).void } - def visit_implicit_node(arg0); end - - sig { params(arg0: ImplicitRestNode).void } - def visit_implicit_rest_node(arg0); end - - sig { params(arg0: InNode).void } - def visit_in_node(arg0); end - - sig { params(arg0: IndexAndWriteNode).void } - def visit_index_and_write_node(arg0); end - - sig { params(arg0: IndexOperatorWriteNode).void } - def visit_index_operator_write_node(arg0); end - - sig { params(arg0: IndexOrWriteNode).void } - def visit_index_or_write_node(arg0); end - - sig { params(arg0: IndexTargetNode).void } - def visit_index_target_node(arg0); end - - sig { params(arg0: InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(arg0); end - - sig { params(arg0: InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(arg0); end - - sig { params(arg0: InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(arg0); end - - sig { params(arg0: InstanceVariableReadNode).void } - def visit_instance_variable_read_node(arg0); end - - sig { params(arg0: InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(arg0); end - - sig { params(arg0: InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(arg0); end - - sig { params(arg0: IntegerNode).void } - def visit_integer_node(arg0); end - - sig { params(arg0: InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(arg0); end - - sig { params(arg0: InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(arg0); end - - sig { params(arg0: InterpolatedStringNode).void } - def visit_interpolated_string_node(arg0); end - - sig { params(arg0: InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(arg0); end - - sig { params(arg0: InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(arg0); end - - sig { params(arg0: ItLocalVariableReadNode).void } - def visit_it_local_variable_read_node(arg0); end - - sig { params(arg0: ItParametersNode).void } - def visit_it_parameters_node(arg0); end - - sig { params(arg0: KeywordHashNode).void } - def visit_keyword_hash_node(arg0); end - - sig { params(arg0: KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(arg0); end - - sig { params(arg0: LambdaNode).void } - def visit_lambda_node(arg0); end - - sig { params(arg0: LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(arg0); end - - sig { params(arg0: LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(arg0); end - - sig { params(arg0: LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(arg0); end - - sig { params(arg0: LocalVariableReadNode).void } - def visit_local_variable_read_node(arg0); end - - sig { params(arg0: LocalVariableTargetNode).void } - def visit_local_variable_target_node(arg0); end - - sig { params(arg0: LocalVariableWriteNode).void } - def visit_local_variable_write_node(arg0); end - - sig { params(arg0: MatchLastLineNode).void } - def visit_match_last_line_node(arg0); end - - sig { params(arg0: MatchPredicateNode).void } - def visit_match_predicate_node(arg0); end - - sig { params(arg0: MatchRequiredNode).void } - def visit_match_required_node(arg0); end - - sig { params(arg0: MatchWriteNode).void } - def visit_match_write_node(arg0); end - - sig { params(arg0: MissingNode).void } - def visit_missing_node(arg0); end - - sig { params(arg0: ModuleNode).void } - def visit_module_node(arg0); end - - sig { params(arg0: MultiTargetNode).void } - def visit_multi_target_node(arg0); end - - sig { params(arg0: MultiWriteNode).void } - def visit_multi_write_node(arg0); end - - sig { params(arg0: NextNode).void } - def visit_next_node(arg0); end - - sig { params(arg0: NilNode).void } - def visit_nil_node(arg0); end - - sig { params(arg0: NoBlockParameterNode).void } - def visit_no_block_parameter_node(arg0); end - - sig { params(arg0: NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(arg0); end - - sig { params(arg0: NumberedParametersNode).void } - def visit_numbered_parameters_node(arg0); end - - sig { params(arg0: NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(arg0); end - - sig { params(arg0: OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(arg0); end - - sig { params(arg0: OptionalParameterNode).void } - def visit_optional_parameter_node(arg0); end - - sig { params(arg0: OrNode).void } - def visit_or_node(arg0); end - - sig { params(arg0: ParametersNode).void } - def visit_parameters_node(arg0); end - - sig { params(arg0: ParenthesesNode).void } - def visit_parentheses_node(arg0); end - - sig { params(arg0: PinnedExpressionNode).void } - def visit_pinned_expression_node(arg0); end - - sig { params(arg0: PinnedVariableNode).void } - def visit_pinned_variable_node(arg0); end - - sig { params(arg0: PostExecutionNode).void } - def visit_post_execution_node(arg0); end - - sig { params(arg0: PreExecutionNode).void } - def visit_pre_execution_node(arg0); end - - sig { params(arg0: ProgramNode).void } - def visit_program_node(arg0); end - - sig { params(arg0: RangeNode).void } - def visit_range_node(arg0); end - - sig { params(arg0: RationalNode).void } - def visit_rational_node(arg0); end - - sig { params(arg0: RedoNode).void } - def visit_redo_node(arg0); end - - sig { params(arg0: RegularExpressionNode).void } - def visit_regular_expression_node(arg0); end - - sig { params(arg0: RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(arg0); end - - sig { params(arg0: RequiredParameterNode).void } - def visit_required_parameter_node(arg0); end - - sig { params(arg0: RescueModifierNode).void } - def visit_rescue_modifier_node(arg0); end - - sig { params(arg0: RescueNode).void } - def visit_rescue_node(arg0); end - - sig { params(arg0: RestParameterNode).void } - def visit_rest_parameter_node(arg0); end - - sig { params(arg0: RetryNode).void } - def visit_retry_node(arg0); end - - sig { params(arg0: ReturnNode).void } - def visit_return_node(arg0); end - - sig { params(arg0: SelfNode).void } - def visit_self_node(arg0); end - - sig { params(arg0: ShareableConstantNode).void } - def visit_shareable_constant_node(arg0); end - - sig { params(arg0: SingletonClassNode).void } - def visit_singleton_class_node(arg0); end - - sig { params(arg0: SourceEncodingNode).void } - def visit_source_encoding_node(arg0); end - - sig { params(arg0: SourceFileNode).void } - def visit_source_file_node(arg0); end - - sig { params(arg0: SourceLineNode).void } - def visit_source_line_node(arg0); end - - sig { params(arg0: SplatNode).void } - def visit_splat_node(arg0); end - - sig { params(arg0: StatementsNode).void } - def visit_statements_node(arg0); end - - sig { params(arg0: StringNode).void } - def visit_string_node(arg0); end - - sig { params(arg0: SuperNode).void } - def visit_super_node(arg0); end - - sig { params(arg0: SymbolNode).void } - def visit_symbol_node(arg0); end - - sig { params(arg0: TrueNode).void } - def visit_true_node(arg0); end - - sig { params(arg0: UndefNode).void } - def visit_undef_node(arg0); end - - sig { params(arg0: UnlessNode).void } - def visit_unless_node(arg0); end - - sig { params(arg0: UntilNode).void } - def visit_until_node(arg0); end - - sig { params(arg0: WhenNode).void } - def visit_when_node(arg0); end - - sig { params(arg0: WhileNode).void } - def visit_while_node(arg0); end - - sig { params(arg0: XStringNode).void } - def visit_x_string_node(arg0); end - - sig { params(arg0: YieldNode).void } - def visit_yield_node(arg0); end - - # Generate a unique node ID for a node throughout the digraph. - sig { params(arg0: Node).returns(String) } - private def node_id(arg0); end - - # Inspect a location to display the start and end line and columns in bytes. - sig { params(arg0: Location).returns(String) } - private def location_inspect(arg0); end - - # Inspect a node that has arguments_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ArgumentsNode).returns(String) } - private def arguments_node_flags_inspect(node); end - - # Inspect a node that has array_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ArrayNode).returns(String) } - private def array_node_flags_inspect(node); end - - # Inspect a node that has call_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(CallAndWriteNode, CallNode, CallOperatorWriteNode, CallOrWriteNode, CallTargetNode, IndexAndWriteNode, IndexOperatorWriteNode, IndexOrWriteNode, IndexTargetNode)).returns(String) } - private def call_node_flags_inspect(node); end - - # Inspect a node that has encoding_flags flags to display the flags as a - # comma-separated list. - sig { params(node: XStringNode).returns(String) } - private def encoding_flags_inspect(node); end - - # Inspect a node that has integer_base_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(IntegerNode, RationalNode)).returns(String) } - private def integer_base_flags_inspect(node); end - - # Inspect a node that has interpolated_string_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: InterpolatedStringNode).returns(String) } - private def interpolated_string_node_flags_inspect(node); end - - # Inspect a node that has keyword_hash_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: KeywordHashNode).returns(String) } - private def keyword_hash_node_flags_inspect(node); end - - # Inspect a node that has loop_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(UntilNode, WhileNode)).returns(String) } - private def loop_flags_inspect(node); end - - # Inspect a node that has parameter_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(BlockLocalVariableNode, BlockParameterNode, KeywordRestParameterNode, OptionalKeywordParameterNode, OptionalParameterNode, RequiredKeywordParameterNode, RequiredParameterNode, RestParameterNode)).returns(String) } - private def parameter_flags_inspect(node); end - - # Inspect a node that has parentheses_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ParenthesesNode).returns(String) } - private def parentheses_node_flags_inspect(node); end - - # Inspect a node that has range_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(FlipFlopNode, RangeNode)).returns(String) } - private def range_flags_inspect(node); end - - # Inspect a node that has regular_expression_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(InterpolatedMatchLastLineNode, InterpolatedRegularExpressionNode, MatchLastLineNode, RegularExpressionNode)).returns(String) } - private def regular_expression_flags_inspect(node); end - - # Inspect a node that has shareable_constant_node_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ShareableConstantNode).returns(String) } - private def shareable_constant_node_flags_inspect(node); end - - # Inspect a node that has string_flags flags to display the flags as a - # comma-separated list. - sig { params(node: ::T.any(SourceFileNode, StringNode)).returns(String) } - private def string_flags_inspect(node); end - - # Inspect a node that has symbol_flags flags to display the flags as a - # comma-separated list. - sig { params(node: SymbolNode).returns(String) } - private def symbol_flags_inspect(node); end - end -end diff --git a/rbi/generated/prism/dsl.rbi b/rbi/generated/prism/dsl.rbi deleted file mode 100644 index ac4e68bfa7..0000000000 --- a/rbi/generated/prism/dsl.rbi +++ /dev/null @@ -1,747 +0,0 @@ -# typed: true - -module Prism - # The DSL module provides a set of methods that can be used to create prism - # nodes in a more concise manner. For example, instead of writing: - # - # source = Prism::Source.for("[1]", 1, []) - # - # Prism::ArrayNode.new( - # source, - # 0, - # Prism::Location.new(source, 0, 3), - # 0, - # [ - # Prism::IntegerNode.new( - # source, - # 0, - # Prism::Location.new(source, 1, 1), - # Prism::IntegerBaseFlags::DECIMAL, - # 1 - # ) - # ], - # Prism::Location.new(source, 0, 1), - # Prism::Location.new(source, 2, 1) - # ) - # - # you could instead write: - # - # class Builder - # include Prism::DSL - # - # attr_reader :default_source - # - # def initialize - # @default_source = source("[1]") - # end - # - # def build - # array_node( - # location: location(start_offset: 0, length: 3), - # elements: [ - # integer_node( - # location: location(start_offset: 1, length: 1), - # flags: integer_base_flag(:decimal), - # value: 1 - # ) - # ], - # opening_loc: location(start_offset: 0, length: 1), - # closing_loc: location(start_offset: 2, length: 1) - # ) - # end - # end - # - # This is mostly helpful in the context of generating trees programmatically. - module DSL - # Create a new Source object. - sig { params(string: String).returns(Source) } - def source(string); end - - # Create a new Location object. - sig { params(source: Source, start_offset: Integer, length: Integer).returns(Location) } - def location(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end - - # Create a new AliasGlobalVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode), old_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, SymbolNode, MissingNode), keyword_loc: Location).returns(AliasGlobalVariableNode) } - def alias_global_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new AliasMethodNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(SymbolNode, InterpolatedSymbolNode), old_name: ::T.any(SymbolNode, InterpolatedSymbolNode, GlobalVariableReadNode, MissingNode), keyword_loc: Location).returns(AliasMethodNode) } - def alias_method_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new AlternationPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(AlternationPatternNode) } - def alternation_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new AndNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(AndNode) } - def and_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new ArgumentsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: T::Array[Node]).returns(ArgumentsNode) } - def arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end - - # Create a new ArrayNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, elements: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(ArrayNode) } - def array_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new ArrayPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), requireds: T::Array[Node], rest: ::T.nilable(Node), posts: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(ArrayPatternNode) } - def array_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new AssocNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, key: Node, value: Node, operator_loc: ::T.nilable(Location)).returns(AssocNode) } - def assoc_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new AssocSplatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: ::T.nilable(Node), operator_loc: Location).returns(AssocSplatNode) } - def assoc_splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new BackReferenceReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(BackReferenceReadNode) } - def back_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new BeginNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, begin_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), rescue_clause: ::T.nilable(RescueNode), else_clause: ::T.nilable(ElseNode), ensure_clause: ::T.nilable(EnsureNode), end_keyword_loc: ::T.nilable(Location)).returns(BeginNode) } - def begin_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new BlockArgumentNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: ::T.nilable(Node), operator_loc: Location).returns(BlockArgumentNode) } - def block_argument_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new BlockLocalVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(BlockLocalVariableNode) } - def block_local_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new BlockNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), opening_loc: Location, closing_loc: Location).returns(BlockNode) } - def block_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new BlockParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(BlockParameterNode) } - def block_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new BlockParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parameters: ::T.nilable(ParametersNode), locals: T::Array[BlockLocalVariableNode], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(BlockParametersNode) } - def block_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new BreakNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).returns(BreakNode) } - def break_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new CallAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).returns(CallAndWriteNode) } - def call_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new CallNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), name: Symbol, message_loc: ::T.nilable(Location), opening_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), closing_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).returns(CallNode) } - def call_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - # Create a new CallOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Node).returns(CallOperatorWriteNode) } - def call_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new CallOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).returns(CallOrWriteNode) } - def call_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new CallTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location).returns(CallTargetNode) } - def call_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end - - # Create a new CapturePatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, target: LocalVariableTargetNode, operator_loc: Location).returns(CapturePatternNode) } - def capture_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new CaseMatchNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[InNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).returns(CaseMatchNode) } - def case_match_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new CaseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[WhenNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).returns(CaseNode) } - def case_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new ClassNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, CallNode), inheritance_operator_loc: ::T.nilable(Location), superclass: ::T.nilable(Node), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).returns(ClassNode) } - def class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new ClassVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ClassVariableAndWriteNode) } - def class_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ClassVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ClassVariableOperatorWriteNode) } - def class_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - # Create a new ClassVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ClassVariableOrWriteNode) } - def class_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ClassVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ClassVariableReadNode) } - def class_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new ClassVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ClassVariableTargetNode) } - def class_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new ClassVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(ClassVariableWriteNode) } - def class_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new ConstantAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ConstantAndWriteNode) } - def constant_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ConstantOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ConstantOperatorWriteNode) } - def constant_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - # Create a new ConstantOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ConstantOrWriteNode) } - def constant_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ConstantPathAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathAndWriteNode) } - def constant_path_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ConstantPathNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).returns(ConstantPathNode) } - def constant_path_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - # Create a new ConstantPathOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ConstantPathOperatorWriteNode) } - def constant_path_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - # Create a new ConstantPathOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathOrWriteNode) } - def constant_path_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ConstantPathTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).returns(ConstantPathTargetNode) } - def constant_path_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - # Create a new ConstantPathWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathWriteNode) } - def constant_path_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ConstantReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ConstantReadNode) } - def constant_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new ConstantTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ConstantTargetNode) } - def constant_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new ConstantWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(ConstantWriteNode) } - def constant_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new DefNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, receiver: ::T.nilable(Node), parameters: ::T.nilable(ParametersNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), locals: T::Array[Symbol], def_keyword_loc: Location, operator_loc: ::T.nilable(Location), lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), end_keyword_loc: ::T.nilable(Location)).returns(DefNode) } - def def_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new DefinedNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lparen_loc: ::T.nilable(Location), value: Node, rparen_loc: ::T.nilable(Location), keyword_loc: Location).returns(DefinedNode) } - def defined_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new ElseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, else_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: ::T.nilable(Location)).returns(ElseNode) } - def else_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new EmbeddedStatementsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, statements: ::T.nilable(StatementsNode), closing_loc: Location).returns(EmbeddedStatementsNode) } - def embedded_statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new EmbeddedVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, variable: ::T.any(InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode)).returns(EmbeddedVariableNode) } - def embedded_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end - - # Create a new EnsureNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, ensure_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: Location).returns(EnsureNode) } - def ensure_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new FalseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(FalseNode) } - def false_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new FindPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), left: SplatNode, requireds: T::Array[Node], right: ::T.any(SplatNode, MissingNode), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(FindPatternNode) } - def find_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new FlipFlopNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).returns(FlipFlopNode) } - def flip_flop_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new FloatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Float).returns(FloatNode) } - def float_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ForNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, index: ::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode), collection: Node, statements: ::T.nilable(StatementsNode), for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), end_keyword_loc: Location).returns(ForNode) } - def for_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new ForwardingArgumentsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(ForwardingArgumentsNode) } - def forwarding_arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ForwardingParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(ForwardingParameterNode) } - def forwarding_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ForwardingSuperNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, block: ::T.nilable(BlockNode)).returns(ForwardingSuperNode) } - def forwarding_super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end - - # Create a new GlobalVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(GlobalVariableAndWriteNode) } - def global_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new GlobalVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(GlobalVariableOperatorWriteNode) } - def global_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - # Create a new GlobalVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(GlobalVariableOrWriteNode) } - def global_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new GlobalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(GlobalVariableReadNode) } - def global_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new GlobalVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(GlobalVariableTargetNode) } - def global_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new GlobalVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(GlobalVariableWriteNode) } - def global_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new HashNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, elements: T::Array[::T.any(AssocNode, AssocSplatNode)], closing_loc: Location).returns(HashNode) } - def hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new HashPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), elements: T::Array[AssocNode], rest: ::T.nilable(::T.any(AssocSplatNode, NoKeywordsParameterNode)), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(HashPatternNode) } - def hash_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new IfNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, if_keyword_loc: ::T.nilable(Location), predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(::T.any(ElseNode, IfNode)), end_keyword_loc: ::T.nilable(Location)).returns(IfNode) } - def if_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new ImaginaryNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, numeric: ::T.any(FloatNode, IntegerNode, RationalNode)).returns(ImaginaryNode) } - def imaginary_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end - - # Create a new ImplicitNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: ::T.any(LocalVariableReadNode, CallNode, ConstantReadNode, LocalVariableTargetNode)).returns(ImplicitNode) } - def implicit_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new ImplicitRestNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(ImplicitRestNode) } - def implicit_rest_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new InNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, pattern: Node, statements: ::T.nilable(StatementsNode), in_loc: Location, then_loc: ::T.nilable(Location)).returns(InNode) } - def in_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end - - # Create a new IndexAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).returns(IndexAndWriteNode) } - def index_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new IndexOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), binary_operator: Symbol, binary_operator_loc: Location, value: Node).returns(IndexOperatorWriteNode) } - def index_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new IndexOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).returns(IndexOrWriteNode) } - def index_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new IndexTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: Node, opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode)).returns(IndexTargetNode) } - def index_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - # Create a new InstanceVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(InstanceVariableAndWriteNode) } - def instance_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new InstanceVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(InstanceVariableOperatorWriteNode) } - def instance_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - # Create a new InstanceVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(InstanceVariableOrWriteNode) } - def instance_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new InstanceVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(InstanceVariableReadNode) } - def instance_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new InstanceVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(InstanceVariableTargetNode) } - def instance_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new InstanceVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(InstanceVariableWriteNode) } - def instance_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new IntegerNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Integer).returns(IntegerNode) } - def integer_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new InterpolatedMatchLastLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedMatchLastLineNode) } - def interpolated_match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new InterpolatedRegularExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedRegularExpressionNode) } - def interpolated_regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new InterpolatedStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode, InterpolatedStringNode, XStringNode, InterpolatedXStringNode, SymbolNode, InterpolatedSymbolNode)], closing_loc: ::T.nilable(Location)).returns(InterpolatedStringNode) } - def interpolated_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new InterpolatedSymbolNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: ::T.nilable(Location)).returns(InterpolatedSymbolNode) } - def interpolated_symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new InterpolatedXStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedXStringNode) } - def interpolated_x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new ItLocalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(ItLocalVariableReadNode) } - def it_local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ItParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(ItParametersNode) } - def it_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new KeywordHashNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, elements: T::Array[::T.any(AssocNode, AssocSplatNode)]).returns(KeywordHashNode) } - def keyword_hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end - - # Create a new KeywordRestParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(KeywordRestParameterNode) } - def keyword_rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new LambdaNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode))).returns(LambdaNode) } - def lambda_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end - - # Create a new LocalVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).returns(LocalVariableAndWriteNode) } - def local_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - # Create a new LocalVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, binary_operator_loc: Location, value: Node, name: Symbol, binary_operator: Symbol, depth: Integer).returns(LocalVariableOperatorWriteNode) } - def local_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end - - # Create a new LocalVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).returns(LocalVariableOrWriteNode) } - def local_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - # Create a new LocalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).returns(LocalVariableReadNode) } - def local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - # Create a new LocalVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).returns(LocalVariableTargetNode) } - def local_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - # Create a new LocalVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location).returns(LocalVariableWriteNode) } - def local_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new MatchLastLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(MatchLastLineNode) } - def match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - # Create a new MatchPredicateNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).returns(MatchPredicateNode) } - def match_predicate_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new MatchRequiredNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).returns(MatchRequiredNode) } - def match_required_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new MatchWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, call: CallNode, targets: T::Array[LocalVariableTargetNode]).returns(MatchWriteNode) } - def match_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end - - # Create a new MissingNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(MissingNode) } - def missing_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ModuleNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], module_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, MissingNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).returns(ModuleNode) } - def module_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new MultiTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location)).returns(MultiTargetNode) } - def multi_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - # Create a new MultiWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), operator_loc: Location, value: Node).returns(MultiWriteNode) } - def multi_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new NextNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).returns(NextNode) } - def next_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new NilNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(NilNode) } - def nil_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new NoBlockParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).returns(NoBlockParameterNode) } - def no_block_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new NoKeywordsParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).returns(NoKeywordsParameterNode) } - def no_keywords_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new NumberedParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, maximum: Integer).returns(NumberedParametersNode) } - def numbered_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end - - # Create a new NumberedReferenceReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, number: Integer).returns(NumberedReferenceReadNode) } - def numbered_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end - - # Create a new OptionalKeywordParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node).returns(OptionalKeywordParameterNode) } - def optional_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new OptionalParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(OptionalParameterNode) } - def optional_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - # Create a new OrNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(OrNode) } - def or_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new ParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, requireds: T::Array[::T.any(RequiredParameterNode, MultiTargetNode)], optionals: T::Array[OptionalParameterNode], rest: ::T.nilable(::T.any(RestParameterNode, ImplicitRestNode)), posts: T::Array[::T.any(RequiredParameterNode, MultiTargetNode, KeywordRestParameterNode, NoKeywordsParameterNode, ForwardingParameterNode, BlockParameterNode, NoBlockParameterNode)], keywords: T::Array[::T.any(RequiredKeywordParameterNode, OptionalKeywordParameterNode)], keyword_rest: ::T.nilable(::T.any(KeywordRestParameterNode, ForwardingParameterNode, NoKeywordsParameterNode)), block: ::T.nilable(::T.any(BlockParameterNode, NoBlockParameterNode))).returns(ParametersNode) } - def parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), 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 - - # Create a new ParenthesesNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, body: ::T.nilable(Node), opening_loc: Location, closing_loc: Location).returns(ParenthesesNode) } - def parentheses_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new PinnedExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location).returns(PinnedExpressionNode) } - def pinned_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - # Create a new PinnedVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, variable: ::T.any(LocalVariableReadNode, InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, ItLocalVariableReadNode, MissingNode), operator_loc: Location).returns(PinnedVariableNode) } - def pinned_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new PostExecutionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).returns(PostExecutionNode) } - def post_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new PreExecutionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).returns(PreExecutionNode) } - def pre_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - # Create a new ProgramNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], statements: StatementsNode).returns(ProgramNode) } - def program_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end - - # Create a new RangeNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).returns(RangeNode) } - def range_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new RationalNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, numerator: Integer, denominator: Integer).returns(RationalNode) } - def rational_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end - - # Create a new RedoNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(RedoNode) } - def redo_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new RegularExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(RegularExpressionNode) } - def regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - # Create a new RequiredKeywordParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location).returns(RequiredKeywordParameterNode) } - def required_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - # Create a new RequiredParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(RequiredParameterNode) } - def required_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - # Create a new RescueModifierNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: Node, keyword_loc: Location, rescue_expression: Node).returns(RescueModifierNode) } - def rescue_modifier_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end - - # Create a new RescueNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, exceptions: T::Array[Node], operator_loc: ::T.nilable(Location), reference: ::T.nilable(::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode)), then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(RescueNode)).returns(RescueNode) } - def rescue_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end - - # Create a new RestParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(RestParameterNode) } - def rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - # Create a new RetryNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(RetryNode) } - def retry_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ReturnNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, arguments: ::T.nilable(ArgumentsNode)).returns(ReturnNode) } - def return_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end - - # Create a new SelfNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(SelfNode) } - def self_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new ShareableConstantNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, write: ::T.any(ConstantWriteNode, ConstantAndWriteNode, ConstantOrWriteNode, ConstantOperatorWriteNode, ConstantPathWriteNode, ConstantPathAndWriteNode, ConstantPathOrWriteNode, ConstantPathOperatorWriteNode)).returns(ShareableConstantNode) } - def shareable_constant_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end - - # Create a new SingletonClassNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Node, body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location).returns(SingletonClassNode) } - def singleton_class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new SourceEncodingNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(SourceEncodingNode) } - def source_encoding_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new SourceFileNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, filepath: String).returns(SourceFileNode) } - def source_file_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end - - # Create a new SourceLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(SourceLineNode) } - def source_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new SplatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, expression: ::T.nilable(Node)).returns(SplatNode) } - def splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end - - # Create a new StatementsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, body: T::Array[Node]).returns(StatementsNode) } - def statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end - - # Create a new StringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), content_loc: Location, closing_loc: ::T.nilable(Location), unescaped: String).returns(StringNode) } - def string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - # Create a new SuperNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).returns(SuperNode) } - def super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - # Create a new SymbolNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), value_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), unescaped: String).returns(SymbolNode) } - def symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - # Create a new TrueNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).returns(TrueNode) } - def true_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - # Create a new UndefNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, names: T::Array[::T.any(SymbolNode, InterpolatedSymbolNode)], keyword_loc: Location).returns(UndefNode) } - def undef_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - # Create a new UnlessNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), else_clause: ::T.nilable(ElseNode), end_keyword_loc: ::T.nilable(Location)).returns(UnlessNode) } - def unless_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - # Create a new UntilNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).returns(UntilNode) } - def until_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - - # Create a new WhenNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, conditions: T::Array[Node], then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode)).returns(WhenNode) } - def when_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end - - # Create a new WhileNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).returns(WhileNode) } - def while_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - - # Create a new XStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(XStringNode) } - def x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - # Create a new YieldNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location)).returns(YieldNode) } - def yield_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - # Retrieve the value of one of the ArgumentsNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def arguments_node_flag(name); end - - # Retrieve the value of one of the ArrayNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def array_node_flag(name); end - - # Retrieve the value of one of the CallNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def call_node_flag(name); end - - # Retrieve the value of one of the EncodingFlags flags. - sig { params(name: Symbol).returns(Integer) } - def encoding_flag(name); end - - # Retrieve the value of one of the IntegerBaseFlags flags. - sig { params(name: Symbol).returns(Integer) } - def integer_base_flag(name); end - - # Retrieve the value of one of the InterpolatedStringNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def interpolated_string_node_flag(name); end - - # Retrieve the value of one of the KeywordHashNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def keyword_hash_node_flag(name); end - - # Retrieve the value of one of the LoopFlags flags. - sig { params(name: Symbol).returns(Integer) } - def loop_flag(name); end - - # Retrieve the value of one of the ParameterFlags flags. - sig { params(name: Symbol).returns(Integer) } - def parameter_flag(name); end - - # Retrieve the value of one of the ParenthesesNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def parentheses_node_flag(name); end - - # Retrieve the value of one of the RangeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def range_flag(name); end - - # Retrieve the value of one of the RegularExpressionFlags flags. - sig { params(name: Symbol).returns(Integer) } - def regular_expression_flag(name); end - - # Retrieve the value of one of the ShareableConstantNodeFlags flags. - sig { params(name: Symbol).returns(Integer) } - def shareable_constant_node_flag(name); end - - # Retrieve the value of one of the StringFlags flags. - sig { params(name: Symbol).returns(Integer) } - def string_flag(name); end - - # Retrieve the value of one of the SymbolFlags flags. - sig { params(name: Symbol).returns(Integer) } - def symbol_flag(name); end - - # The default source object that gets attached to nodes and locations if no - # source is specified. - sig { returns(Source) } - private def default_source; end - - # The default location object that gets attached to nodes if no location is - # specified, which uses the given source. - sig { returns(Location) } - private def default_location; end - - # The default node that gets attached to nodes if no node is specified for a - # required node field. - sig { params(source: Source, location: Location).returns(Node) } - private def default_node(source, location); end - end -end diff --git a/rbi/generated/prism/inspect_visitor.rbi b/rbi/generated/prism/inspect_visitor.rbi deleted file mode 100644 index 449a531c38..0000000000 --- a/rbi/generated/prism/inspect_visitor.rbi +++ /dev/null @@ -1,503 +0,0 @@ -# typed: true - -module Prism - # This visitor is responsible for composing the strings that get returned by - # the various #inspect methods defined on each of the nodes. - class InspectVisitor < Visitor - # Most of the time, we can simply pass down the indent to the next node. - # However, when we are inside a list we want some extra special formatting - # when we hit an element in that list. In this case, we have a special - # command that replaces the subsequent indent with the given value. - class Replace - sig { returns(String) } - attr_reader :value - - sig { params(value: String).void } - def initialize(value); end - end - - # The current prefix string. - sig { returns(String) } - attr_reader :indent - - # The list of commands that we need to execute in order to compose the - # final string. - sig { returns(T::Array[[::T.any(String, Node, Replace), String]]) } - attr_reader :commands - - sig { params(indent: String).void } - def initialize(indent = T.unsafe(nil)); end - - # Compose an inspect string for the given node. - sig { params(node: Node).returns(String) } - def self.compose(node); end - - # Compose the final string. - sig { returns(String) } - def compose; end - - sig { params(node: AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end - - sig { params(node: AliasMethodNode).void } - def visit_alias_method_node(node); end - - sig { params(node: AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end - - sig { params(node: AndNode).void } - def visit_and_node(node); end - - sig { params(node: ArgumentsNode).void } - def visit_arguments_node(node); end - - sig { params(node: ArrayNode).void } - def visit_array_node(node); end - - sig { params(node: ArrayPatternNode).void } - def visit_array_pattern_node(node); end - - sig { params(node: AssocNode).void } - def visit_assoc_node(node); end - - sig { params(node: AssocSplatNode).void } - def visit_assoc_splat_node(node); end - - sig { params(node: BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end - - sig { params(node: BeginNode).void } - def visit_begin_node(node); end - - sig { params(node: BlockArgumentNode).void } - def visit_block_argument_node(node); end - - sig { params(node: BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end - - sig { params(node: BlockNode).void } - def visit_block_node(node); end - - sig { params(node: BlockParameterNode).void } - def visit_block_parameter_node(node); end - - sig { params(node: BlockParametersNode).void } - def visit_block_parameters_node(node); end - - sig { params(node: BreakNode).void } - def visit_break_node(node); end - - sig { params(node: CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - sig { params(node: CallNode).void } - def visit_call_node(node); end - - sig { params(node: CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - sig { params(node: CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - sig { params(node: CallTargetNode).void } - def visit_call_target_node(node); end - - sig { params(node: CapturePatternNode).void } - def visit_capture_pattern_node(node); end - - sig { params(node: CaseMatchNode).void } - def visit_case_match_node(node); end - - sig { params(node: CaseNode).void } - def visit_case_node(node); end - - sig { params(node: ClassNode).void } - def visit_class_node(node); end - - sig { params(node: ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end - - sig { params(node: ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end - - sig { params(node: ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end - - sig { params(node: ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end - - sig { params(node: ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end - - sig { params(node: ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end - - sig { params(node: ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - sig { params(node: ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - sig { params(node: ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - sig { params(node: ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end - - sig { params(node: ConstantPathNode).void } - def visit_constant_path_node(node); end - - sig { params(node: ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end - - sig { params(node: ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end - - sig { params(node: ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end - - sig { params(node: ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - sig { params(node: ConstantReadNode).void } - def visit_constant_read_node(node); end - - sig { params(node: ConstantTargetNode).void } - def visit_constant_target_node(node); end - - sig { params(node: ConstantWriteNode).void } - def visit_constant_write_node(node); end - - sig { params(node: DefNode).void } - def visit_def_node(node); end - - sig { params(node: DefinedNode).void } - def visit_defined_node(node); end - - sig { params(node: ElseNode).void } - def visit_else_node(node); end - - sig { params(node: EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end - - sig { params(node: EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end - - sig { params(node: EnsureNode).void } - def visit_ensure_node(node); end - - sig { params(node: FalseNode).void } - def visit_false_node(node); end - - sig { params(node: FindPatternNode).void } - def visit_find_pattern_node(node); end - - sig { params(node: FlipFlopNode).void } - def visit_flip_flop_node(node); end - - sig { params(node: FloatNode).void } - def visit_float_node(node); end - - sig { params(node: ForNode).void } - def visit_for_node(node); end - - sig { params(node: ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end - - sig { params(node: ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end - - sig { params(node: ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end - - sig { params(node: GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end - - sig { params(node: GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end - - sig { params(node: GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end - - sig { params(node: GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end - - sig { params(node: GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end - - sig { params(node: GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end - - sig { params(node: HashNode).void } - def visit_hash_node(node); end - - sig { params(node: HashPatternNode).void } - def visit_hash_pattern_node(node); end - - sig { params(node: IfNode).void } - def visit_if_node(node); end - - sig { params(node: ImaginaryNode).void } - def visit_imaginary_node(node); end - - sig { params(node: ImplicitNode).void } - def visit_implicit_node(node); end - - sig { params(node: ImplicitRestNode).void } - def visit_implicit_rest_node(node); end - - sig { params(node: InNode).void } - def visit_in_node(node); end - - sig { params(node: IndexAndWriteNode).void } - def visit_index_and_write_node(node); end - - sig { params(node: IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end - - sig { params(node: IndexOrWriteNode).void } - def visit_index_or_write_node(node); end - - sig { params(node: IndexTargetNode).void } - def visit_index_target_node(node); end - - sig { params(node: InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end - - sig { params(node: InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end - - sig { params(node: InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end - - sig { params(node: InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end - - sig { params(node: InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end - - sig { params(node: InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end - - sig { params(node: IntegerNode).void } - def visit_integer_node(node); end - - sig { params(node: InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end - - sig { params(node: InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end - - sig { params(node: InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end - - sig { params(node: InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end - - sig { params(node: InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end - - sig { params(node: ItLocalVariableReadNode).void } - def visit_it_local_variable_read_node(node); end - - sig { params(node: ItParametersNode).void } - def visit_it_parameters_node(node); end - - sig { params(node: KeywordHashNode).void } - def visit_keyword_hash_node(node); end - - sig { params(node: KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end - - sig { params(node: LambdaNode).void } - def visit_lambda_node(node); end - - sig { params(node: LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - sig { params(node: LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - sig { params(node: LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - sig { params(node: LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - sig { params(node: LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - sig { params(node: LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - sig { params(node: MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - sig { params(node: MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - sig { params(node: MatchRequiredNode).void } - def visit_match_required_node(node); end - - sig { params(node: MatchWriteNode).void } - def visit_match_write_node(node); end - - sig { params(node: MissingNode).void } - def visit_missing_node(node); end - - sig { params(node: ModuleNode).void } - def visit_module_node(node); end - - sig { params(node: MultiTargetNode).void } - def visit_multi_target_node(node); end - - sig { params(node: MultiWriteNode).void } - def visit_multi_write_node(node); end - - sig { params(node: NextNode).void } - def visit_next_node(node); end - - sig { params(node: NilNode).void } - def visit_nil_node(node); end - - sig { params(node: NoBlockParameterNode).void } - def visit_no_block_parameter_node(node); end - - sig { params(node: NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - sig { params(node: NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - sig { params(node: NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - sig { params(node: OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - sig { params(node: OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - sig { params(node: OrNode).void } - def visit_or_node(node); end - - sig { params(node: ParametersNode).void } - def visit_parameters_node(node); end - - sig { params(node: ParenthesesNode).void } - def visit_parentheses_node(node); end - - sig { params(node: PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - sig { params(node: PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - sig { params(node: PostExecutionNode).void } - def visit_post_execution_node(node); end - - sig { params(node: PreExecutionNode).void } - def visit_pre_execution_node(node); end - - sig { params(node: ProgramNode).void } - def visit_program_node(node); end - - sig { params(node: RangeNode).void } - def visit_range_node(node); end - - sig { params(node: RationalNode).void } - def visit_rational_node(node); end - - sig { params(node: RedoNode).void } - def visit_redo_node(node); end - - sig { params(node: RegularExpressionNode).void } - def visit_regular_expression_node(node); end - - sig { params(node: RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end - - sig { params(node: RequiredParameterNode).void } - def visit_required_parameter_node(node); end - - sig { params(node: RescueModifierNode).void } - def visit_rescue_modifier_node(node); end - - sig { params(node: RescueNode).void } - def visit_rescue_node(node); end - - sig { params(node: RestParameterNode).void } - def visit_rest_parameter_node(node); end - - sig { params(node: RetryNode).void } - def visit_retry_node(node); end - - sig { params(node: ReturnNode).void } - def visit_return_node(node); end - - sig { params(node: SelfNode).void } - def visit_self_node(node); end - - sig { params(node: ShareableConstantNode).void } - def visit_shareable_constant_node(node); end - - sig { params(node: SingletonClassNode).void } - def visit_singleton_class_node(node); end - - sig { params(node: SourceEncodingNode).void } - def visit_source_encoding_node(node); end - - sig { params(node: SourceFileNode).void } - def visit_source_file_node(node); end - - sig { params(node: SourceLineNode).void } - def visit_source_line_node(node); end - - sig { params(node: SplatNode).void } - def visit_splat_node(node); end - - sig { params(node: StatementsNode).void } - def visit_statements_node(node); end - - sig { params(node: StringNode).void } - def visit_string_node(node); end - - sig { params(node: SuperNode).void } - def visit_super_node(node); end - - sig { params(node: SymbolNode).void } - def visit_symbol_node(node); end - - sig { params(node: TrueNode).void } - def visit_true_node(node); end - - sig { params(node: UndefNode).void } - def visit_undef_node(node); end - - sig { params(node: UnlessNode).void } - def visit_unless_node(node); end - - sig { params(node: UntilNode).void } - def visit_until_node(node); end - - sig { params(node: WhenNode).void } - def visit_when_node(node); end - - sig { params(node: WhileNode).void } - def visit_while_node(node); end - - sig { params(node: XStringNode).void } - def visit_x_string_node(node); end - - sig { params(node: YieldNode).void } - def visit_yield_node(node); end - - # Compose a header for the given node. - sig { params(name: String, node: Node).returns(String) } - private def inspect_node(name, node); end - - # Compose a string representing the given inner location field. - sig { params(location: ::T.nilable(Location)).returns(String) } - private def inspect_location(location); end - end -end diff --git a/rbi/generated/prism/lex_compat.rbi b/rbi/generated/prism/lex_compat.rbi deleted file mode 100644 index 5ce03767c8..0000000000 --- a/rbi/generated/prism/lex_compat.rbi +++ /dev/null @@ -1,155 +0,0 @@ -# typed: true - -module Prism - module Translation - class Ripper - EXPR_NONE = T.let(nil, Integer) - EXPR_BEG = T.let(nil, Integer) - EXPR_MID = T.let(nil, Integer) - EXPR_END = T.let(nil, Integer) - EXPR_CLASS = T.let(nil, Integer) - EXPR_VALUE = T.let(nil, Integer) - EXPR_ARG = T.let(nil, Integer) - EXPR_CMDARG = T.let(nil, Integer) - EXPR_ENDARG = T.let(nil, Integer) - EXPR_ENDFN = T.let(nil, Integer) - - class Lexer < Ripper - class State - sig { params(value: Integer).returns(State) } - def self.[](value); end - end - end - end - end - - # This class is responsible for lexing the source using prism and then - # converting those tokens to be compatible with Ripper. In the vast majority - # of cases, this is a one-to-one mapping of the token type. Everything else - # generally lines up. However, there are a few cases that require special - # handling. - class LexCompat - # A result class specialized for holding tokens produced by the lexer. - class Result < Prism::Result - # The list of tokens that were produced by the lexer. - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - attr_reader :value - - # Create a new lex compat result object with the given values. - sig { params(value: T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]], comments: T::Array[Comment], magic_comments: T::Array[MagicComment], data_loc: ::T.nilable(Location), errors: T::Array[ParseError], warnings: T::Array[ParseWarning], source: Source).void } - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - - # Implement the hash pattern matching interface for Result. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - end - - # This is a mapping of prism token types to Ripper token types. This is a - # many-to-one mapping because we split up our token types, whereas Ripper - # tends to group them. - RIPPER = T.let(nil, ::T.untyped) - - # A heredoc in this case is a list of tokens that belong to the body of the - # heredoc that should be appended onto the list of tokens when the heredoc - # closes. - module Heredoc - # Heredocs that are no dash or tilde heredocs are just a list of tokens. - # We need to keep them around so that we can insert them in the correct - # order back into the token stream and set the state of the last token to - # the state that the heredoc was opened in. - class PlainHeredoc - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - attr_reader :tokens - - sig { void } - def initialize; end - - sig { params(token: [[Integer, Integer], Symbol, String, ::T.untyped]).void } - def <<(token); end - - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - def to_a; end - end - - # Dash heredocs are a little more complicated. They are a list of tokens - # that need to be split on "\\\n" to mimic Ripper's behavior. We also need - # to keep track of the state that the heredoc was opened in. - class DashHeredoc - sig { returns(T::Boolean) } - attr_reader :split - - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - attr_reader :tokens - - sig { params(split: T::Boolean).void } - def initialize(split); end - - sig { params(token: [[Integer, Integer], Symbol, String, ::T.untyped]).void } - def <<(token); end - - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - def to_a; end - end - - # Heredocs that are dedenting heredocs are a little more complicated. - # Ripper outputs on_ignored_sp tokens for the whitespace that is being - # removed from the output. prism only modifies the node itself and keeps - # the token the same. This simplifies prism, but makes comparing against - # Ripper much harder because there is a length mismatch. - # - # Fortunately, we already have to pull out the heredoc tokens in order to - # insert them into the stream in the correct order. As such, we can do - # some extra manipulation on the tokens to make them match Ripper's - # output by mirroring the dedent logic that Ripper uses. - class DedentingHeredoc - TAB_WIDTH = T.let(nil, Integer) - - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - attr_reader :tokens - - sig { returns(T::Boolean) } - attr_reader :dedent_next - - sig { returns(::T.nilable(Integer)) } - attr_reader :dedent - - sig { returns(Integer) } - attr_reader :embexpr_balance - - sig { void } - def initialize; end - - # As tokens are coming in, we track the minimum amount of common leading - # whitespace on plain string content tokens. This allows us to later - # remove that amount of whitespace from the beginning of each line. - # - sig { params(token: [[Integer, Integer], Symbol, String, ::T.untyped]).void } - def <<(token); end - - sig { returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - def to_a; end - end - - # Here we will split between the two types of heredocs and return the - # object that will store their tokens. - sig { params(opening: [[Integer, Integer], Symbol, String, ::T.untyped]).returns(::T.any(PlainHeredoc, DashHeredoc, DedentingHeredoc)) } - def self.build(opening); end - end - - # In previous versions of Ruby, Ripper wouldn't flush the bom before the - # first token, so we had to have a hack in place to account for that. - BOM_FLUSHED = T.let(nil, ::T.untyped) - - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :options - - sig { params(source: String, options: ::T.untyped).void } - def initialize(source, **options); end - - sig { returns(Result) } - def result; end - - sig { params(tokens: T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]], source: Source, data_loc: ::T.nilable(Location), bom: T::Boolean, eof_token: ::T.nilable(Token)).returns(T::Array[[[Integer, Integer], Symbol, String, ::T.untyped]]) } - private def post_process_tokens(tokens, source, data_loc, bom, eof_token); end - end -end diff --git a/rbi/generated/prism/mutation_compiler.rbi b/rbi/generated/prism/mutation_compiler.rbi deleted file mode 100644 index 21be124fed..0000000000 --- a/rbi/generated/prism/mutation_compiler.rbi +++ /dev/null @@ -1,464 +0,0 @@ -# typed: true - -module Prism - # This visitor walks through the tree and copies each node as it is being - # visited. This is useful for consumers that want to mutate the tree, as you - # can change subtrees in place without effecting the rest of the tree. - class MutationCompiler < Compiler - sig { params(arg0: AliasGlobalVariableNode).returns(::T.nilable(Node)) } - def visit_alias_global_variable_node(arg0); end - - sig { params(arg0: AliasMethodNode).returns(::T.nilable(Node)) } - def visit_alias_method_node(arg0); end - - sig { params(arg0: AlternationPatternNode).returns(::T.nilable(Node)) } - def visit_alternation_pattern_node(arg0); end - - sig { params(arg0: AndNode).returns(::T.nilable(Node)) } - def visit_and_node(arg0); end - - sig { params(arg0: ArgumentsNode).returns(::T.nilable(Node)) } - def visit_arguments_node(arg0); end - - sig { params(arg0: ArrayNode).returns(::T.nilable(Node)) } - def visit_array_node(arg0); end - - sig { params(arg0: ArrayPatternNode).returns(::T.nilable(Node)) } - def visit_array_pattern_node(arg0); end - - sig { params(arg0: AssocNode).returns(::T.nilable(Node)) } - def visit_assoc_node(arg0); end - - sig { params(arg0: AssocSplatNode).returns(::T.nilable(Node)) } - def visit_assoc_splat_node(arg0); end - - sig { params(arg0: BackReferenceReadNode).returns(::T.nilable(Node)) } - def visit_back_reference_read_node(arg0); end - - sig { params(arg0: BeginNode).returns(::T.nilable(Node)) } - def visit_begin_node(arg0); end - - sig { params(arg0: BlockArgumentNode).returns(::T.nilable(Node)) } - def visit_block_argument_node(arg0); end - - sig { params(arg0: BlockLocalVariableNode).returns(::T.nilable(Node)) } - def visit_block_local_variable_node(arg0); end - - sig { params(arg0: BlockNode).returns(::T.nilable(Node)) } - def visit_block_node(arg0); end - - sig { params(arg0: BlockParameterNode).returns(::T.nilable(Node)) } - def visit_block_parameter_node(arg0); end - - sig { params(arg0: BlockParametersNode).returns(::T.nilable(Node)) } - def visit_block_parameters_node(arg0); end - - sig { params(arg0: BreakNode).returns(::T.nilable(Node)) } - def visit_break_node(arg0); end - - sig { params(arg0: CallAndWriteNode).returns(::T.nilable(Node)) } - def visit_call_and_write_node(arg0); end - - sig { params(arg0: CallNode).returns(::T.nilable(Node)) } - def visit_call_node(arg0); end - - sig { params(arg0: CallOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_call_operator_write_node(arg0); end - - sig { params(arg0: CallOrWriteNode).returns(::T.nilable(Node)) } - def visit_call_or_write_node(arg0); end - - sig { params(arg0: CallTargetNode).returns(::T.nilable(Node)) } - def visit_call_target_node(arg0); end - - sig { params(arg0: CapturePatternNode).returns(::T.nilable(Node)) } - def visit_capture_pattern_node(arg0); end - - sig { params(arg0: CaseMatchNode).returns(::T.nilable(Node)) } - def visit_case_match_node(arg0); end - - sig { params(arg0: CaseNode).returns(::T.nilable(Node)) } - def visit_case_node(arg0); end - - sig { params(arg0: ClassNode).returns(::T.nilable(Node)) } - def visit_class_node(arg0); end - - sig { params(arg0: ClassVariableAndWriteNode).returns(::T.nilable(Node)) } - def visit_class_variable_and_write_node(arg0); end - - sig { params(arg0: ClassVariableOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_class_variable_operator_write_node(arg0); end - - sig { params(arg0: ClassVariableOrWriteNode).returns(::T.nilable(Node)) } - def visit_class_variable_or_write_node(arg0); end - - sig { params(arg0: ClassVariableReadNode).returns(::T.nilable(Node)) } - def visit_class_variable_read_node(arg0); end - - sig { params(arg0: ClassVariableTargetNode).returns(::T.nilable(Node)) } - def visit_class_variable_target_node(arg0); end - - sig { params(arg0: ClassVariableWriteNode).returns(::T.nilable(Node)) } - def visit_class_variable_write_node(arg0); end - - sig { params(arg0: ConstantAndWriteNode).returns(::T.nilable(Node)) } - def visit_constant_and_write_node(arg0); end - - sig { params(arg0: ConstantOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_constant_operator_write_node(arg0); end - - sig { params(arg0: ConstantOrWriteNode).returns(::T.nilable(Node)) } - def visit_constant_or_write_node(arg0); end - - sig { params(arg0: ConstantPathAndWriteNode).returns(::T.nilable(Node)) } - def visit_constant_path_and_write_node(arg0); end - - sig { params(arg0: ConstantPathNode).returns(::T.nilable(Node)) } - def visit_constant_path_node(arg0); end - - sig { params(arg0: ConstantPathOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_constant_path_operator_write_node(arg0); end - - sig { params(arg0: ConstantPathOrWriteNode).returns(::T.nilable(Node)) } - def visit_constant_path_or_write_node(arg0); end - - sig { params(arg0: ConstantPathTargetNode).returns(::T.nilable(Node)) } - def visit_constant_path_target_node(arg0); end - - sig { params(arg0: ConstantPathWriteNode).returns(::T.nilable(Node)) } - def visit_constant_path_write_node(arg0); end - - sig { params(arg0: ConstantReadNode).returns(::T.nilable(Node)) } - def visit_constant_read_node(arg0); end - - sig { params(arg0: ConstantTargetNode).returns(::T.nilable(Node)) } - def visit_constant_target_node(arg0); end - - sig { params(arg0: ConstantWriteNode).returns(::T.nilable(Node)) } - def visit_constant_write_node(arg0); end - - sig { params(arg0: DefNode).returns(::T.nilable(Node)) } - def visit_def_node(arg0); end - - sig { params(arg0: DefinedNode).returns(::T.nilable(Node)) } - def visit_defined_node(arg0); end - - sig { params(arg0: ElseNode).returns(::T.nilable(Node)) } - def visit_else_node(arg0); end - - sig { params(arg0: EmbeddedStatementsNode).returns(::T.nilable(Node)) } - def visit_embedded_statements_node(arg0); end - - sig { params(arg0: EmbeddedVariableNode).returns(::T.nilable(Node)) } - def visit_embedded_variable_node(arg0); end - - sig { params(arg0: EnsureNode).returns(::T.nilable(Node)) } - def visit_ensure_node(arg0); end - - sig { params(arg0: FalseNode).returns(::T.nilable(Node)) } - def visit_false_node(arg0); end - - sig { params(arg0: FindPatternNode).returns(::T.nilable(Node)) } - def visit_find_pattern_node(arg0); end - - sig { params(arg0: FlipFlopNode).returns(::T.nilable(Node)) } - def visit_flip_flop_node(arg0); end - - sig { params(arg0: FloatNode).returns(::T.nilable(Node)) } - def visit_float_node(arg0); end - - sig { params(arg0: ForNode).returns(::T.nilable(Node)) } - def visit_for_node(arg0); end - - sig { params(arg0: ForwardingArgumentsNode).returns(::T.nilable(Node)) } - def visit_forwarding_arguments_node(arg0); end - - sig { params(arg0: ForwardingParameterNode).returns(::T.nilable(Node)) } - def visit_forwarding_parameter_node(arg0); end - - sig { params(arg0: ForwardingSuperNode).returns(::T.nilable(Node)) } - def visit_forwarding_super_node(arg0); end - - sig { params(arg0: GlobalVariableAndWriteNode).returns(::T.nilable(Node)) } - def visit_global_variable_and_write_node(arg0); end - - sig { params(arg0: GlobalVariableOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_global_variable_operator_write_node(arg0); end - - sig { params(arg0: GlobalVariableOrWriteNode).returns(::T.nilable(Node)) } - def visit_global_variable_or_write_node(arg0); end - - sig { params(arg0: GlobalVariableReadNode).returns(::T.nilable(Node)) } - def visit_global_variable_read_node(arg0); end - - sig { params(arg0: GlobalVariableTargetNode).returns(::T.nilable(Node)) } - def visit_global_variable_target_node(arg0); end - - sig { params(arg0: GlobalVariableWriteNode).returns(::T.nilable(Node)) } - def visit_global_variable_write_node(arg0); end - - sig { params(arg0: HashNode).returns(::T.nilable(Node)) } - def visit_hash_node(arg0); end - - sig { params(arg0: HashPatternNode).returns(::T.nilable(Node)) } - def visit_hash_pattern_node(arg0); end - - sig { params(arg0: IfNode).returns(::T.nilable(Node)) } - def visit_if_node(arg0); end - - sig { params(arg0: ImaginaryNode).returns(::T.nilable(Node)) } - def visit_imaginary_node(arg0); end - - sig { params(arg0: ImplicitNode).returns(::T.nilable(Node)) } - def visit_implicit_node(arg0); end - - sig { params(arg0: ImplicitRestNode).returns(::T.nilable(Node)) } - def visit_implicit_rest_node(arg0); end - - sig { params(arg0: InNode).returns(::T.nilable(Node)) } - def visit_in_node(arg0); end - - sig { params(arg0: IndexAndWriteNode).returns(::T.nilable(Node)) } - def visit_index_and_write_node(arg0); end - - sig { params(arg0: IndexOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_index_operator_write_node(arg0); end - - sig { params(arg0: IndexOrWriteNode).returns(::T.nilable(Node)) } - def visit_index_or_write_node(arg0); end - - sig { params(arg0: IndexTargetNode).returns(::T.nilable(Node)) } - def visit_index_target_node(arg0); end - - sig { params(arg0: InstanceVariableAndWriteNode).returns(::T.nilable(Node)) } - def visit_instance_variable_and_write_node(arg0); end - - sig { params(arg0: InstanceVariableOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_instance_variable_operator_write_node(arg0); end - - sig { params(arg0: InstanceVariableOrWriteNode).returns(::T.nilable(Node)) } - def visit_instance_variable_or_write_node(arg0); end - - sig { params(arg0: InstanceVariableReadNode).returns(::T.nilable(Node)) } - def visit_instance_variable_read_node(arg0); end - - sig { params(arg0: InstanceVariableTargetNode).returns(::T.nilable(Node)) } - def visit_instance_variable_target_node(arg0); end - - sig { params(arg0: InstanceVariableWriteNode).returns(::T.nilable(Node)) } - def visit_instance_variable_write_node(arg0); end - - sig { params(arg0: IntegerNode).returns(::T.nilable(Node)) } - def visit_integer_node(arg0); end - - sig { params(arg0: InterpolatedMatchLastLineNode).returns(::T.nilable(Node)) } - def visit_interpolated_match_last_line_node(arg0); end - - sig { params(arg0: InterpolatedRegularExpressionNode).returns(::T.nilable(Node)) } - def visit_interpolated_regular_expression_node(arg0); end - - sig { params(arg0: InterpolatedStringNode).returns(::T.nilable(Node)) } - def visit_interpolated_string_node(arg0); end - - sig { params(arg0: InterpolatedSymbolNode).returns(::T.nilable(Node)) } - def visit_interpolated_symbol_node(arg0); end - - sig { params(arg0: InterpolatedXStringNode).returns(::T.nilable(Node)) } - def visit_interpolated_x_string_node(arg0); end - - sig { params(arg0: ItLocalVariableReadNode).returns(::T.nilable(Node)) } - def visit_it_local_variable_read_node(arg0); end - - sig { params(arg0: ItParametersNode).returns(::T.nilable(Node)) } - def visit_it_parameters_node(arg0); end - - sig { params(arg0: KeywordHashNode).returns(::T.nilable(Node)) } - def visit_keyword_hash_node(arg0); end - - sig { params(arg0: KeywordRestParameterNode).returns(::T.nilable(Node)) } - def visit_keyword_rest_parameter_node(arg0); end - - sig { params(arg0: LambdaNode).returns(::T.nilable(Node)) } - def visit_lambda_node(arg0); end - - sig { params(arg0: LocalVariableAndWriteNode).returns(::T.nilable(Node)) } - def visit_local_variable_and_write_node(arg0); end - - sig { params(arg0: LocalVariableOperatorWriteNode).returns(::T.nilable(Node)) } - def visit_local_variable_operator_write_node(arg0); end - - sig { params(arg0: LocalVariableOrWriteNode).returns(::T.nilable(Node)) } - def visit_local_variable_or_write_node(arg0); end - - sig { params(arg0: LocalVariableReadNode).returns(::T.nilable(Node)) } - def visit_local_variable_read_node(arg0); end - - sig { params(arg0: LocalVariableTargetNode).returns(::T.nilable(Node)) } - def visit_local_variable_target_node(arg0); end - - sig { params(arg0: LocalVariableWriteNode).returns(::T.nilable(Node)) } - def visit_local_variable_write_node(arg0); end - - sig { params(arg0: MatchLastLineNode).returns(::T.nilable(Node)) } - def visit_match_last_line_node(arg0); end - - sig { params(arg0: MatchPredicateNode).returns(::T.nilable(Node)) } - def visit_match_predicate_node(arg0); end - - sig { params(arg0: MatchRequiredNode).returns(::T.nilable(Node)) } - def visit_match_required_node(arg0); end - - sig { params(arg0: MatchWriteNode).returns(::T.nilable(Node)) } - def visit_match_write_node(arg0); end - - sig { params(arg0: MissingNode).returns(::T.nilable(Node)) } - def visit_missing_node(arg0); end - - sig { params(arg0: ModuleNode).returns(::T.nilable(Node)) } - def visit_module_node(arg0); end - - sig { params(arg0: MultiTargetNode).returns(::T.nilable(Node)) } - def visit_multi_target_node(arg0); end - - sig { params(arg0: MultiWriteNode).returns(::T.nilable(Node)) } - def visit_multi_write_node(arg0); end - - sig { params(arg0: NextNode).returns(::T.nilable(Node)) } - def visit_next_node(arg0); end - - sig { params(arg0: NilNode).returns(::T.nilable(Node)) } - def visit_nil_node(arg0); end - - sig { params(arg0: NoBlockParameterNode).returns(::T.nilable(Node)) } - def visit_no_block_parameter_node(arg0); end - - sig { params(arg0: NoKeywordsParameterNode).returns(::T.nilable(Node)) } - def visit_no_keywords_parameter_node(arg0); end - - sig { params(arg0: NumberedParametersNode).returns(::T.nilable(Node)) } - def visit_numbered_parameters_node(arg0); end - - sig { params(arg0: NumberedReferenceReadNode).returns(::T.nilable(Node)) } - def visit_numbered_reference_read_node(arg0); end - - sig { params(arg0: OptionalKeywordParameterNode).returns(::T.nilable(Node)) } - def visit_optional_keyword_parameter_node(arg0); end - - sig { params(arg0: OptionalParameterNode).returns(::T.nilable(Node)) } - def visit_optional_parameter_node(arg0); end - - sig { params(arg0: OrNode).returns(::T.nilable(Node)) } - def visit_or_node(arg0); end - - sig { params(arg0: ParametersNode).returns(::T.nilable(Node)) } - def visit_parameters_node(arg0); end - - sig { params(arg0: ParenthesesNode).returns(::T.nilable(Node)) } - def visit_parentheses_node(arg0); end - - sig { params(arg0: PinnedExpressionNode).returns(::T.nilable(Node)) } - def visit_pinned_expression_node(arg0); end - - sig { params(arg0: PinnedVariableNode).returns(::T.nilable(Node)) } - def visit_pinned_variable_node(arg0); end - - sig { params(arg0: PostExecutionNode).returns(::T.nilable(Node)) } - def visit_post_execution_node(arg0); end - - sig { params(arg0: PreExecutionNode).returns(::T.nilable(Node)) } - def visit_pre_execution_node(arg0); end - - sig { params(arg0: ProgramNode).returns(::T.nilable(Node)) } - def visit_program_node(arg0); end - - sig { params(arg0: RangeNode).returns(::T.nilable(Node)) } - def visit_range_node(arg0); end - - sig { params(arg0: RationalNode).returns(::T.nilable(Node)) } - def visit_rational_node(arg0); end - - sig { params(arg0: RedoNode).returns(::T.nilable(Node)) } - def visit_redo_node(arg0); end - - sig { params(arg0: RegularExpressionNode).returns(::T.nilable(Node)) } - def visit_regular_expression_node(arg0); end - - sig { params(arg0: RequiredKeywordParameterNode).returns(::T.nilable(Node)) } - def visit_required_keyword_parameter_node(arg0); end - - sig { params(arg0: RequiredParameterNode).returns(::T.nilable(Node)) } - def visit_required_parameter_node(arg0); end - - sig { params(arg0: RescueModifierNode).returns(::T.nilable(Node)) } - def visit_rescue_modifier_node(arg0); end - - sig { params(arg0: RescueNode).returns(::T.nilable(Node)) } - def visit_rescue_node(arg0); end - - sig { params(arg0: RestParameterNode).returns(::T.nilable(Node)) } - def visit_rest_parameter_node(arg0); end - - sig { params(arg0: RetryNode).returns(::T.nilable(Node)) } - def visit_retry_node(arg0); end - - sig { params(arg0: ReturnNode).returns(::T.nilable(Node)) } - def visit_return_node(arg0); end - - sig { params(arg0: SelfNode).returns(::T.nilable(Node)) } - def visit_self_node(arg0); end - - sig { params(arg0: ShareableConstantNode).returns(::T.nilable(Node)) } - def visit_shareable_constant_node(arg0); end - - sig { params(arg0: SingletonClassNode).returns(::T.nilable(Node)) } - def visit_singleton_class_node(arg0); end - - sig { params(arg0: SourceEncodingNode).returns(::T.nilable(Node)) } - def visit_source_encoding_node(arg0); end - - sig { params(arg0: SourceFileNode).returns(::T.nilable(Node)) } - def visit_source_file_node(arg0); end - - sig { params(arg0: SourceLineNode).returns(::T.nilable(Node)) } - def visit_source_line_node(arg0); end - - sig { params(arg0: SplatNode).returns(::T.nilable(Node)) } - def visit_splat_node(arg0); end - - sig { params(arg0: StatementsNode).returns(::T.nilable(Node)) } - def visit_statements_node(arg0); end - - sig { params(arg0: StringNode).returns(::T.nilable(Node)) } - def visit_string_node(arg0); end - - sig { params(arg0: SuperNode).returns(::T.nilable(Node)) } - def visit_super_node(arg0); end - - sig { params(arg0: SymbolNode).returns(::T.nilable(Node)) } - def visit_symbol_node(arg0); end - - sig { params(arg0: TrueNode).returns(::T.nilable(Node)) } - def visit_true_node(arg0); end - - sig { params(arg0: UndefNode).returns(::T.nilable(Node)) } - def visit_undef_node(arg0); end - - sig { params(arg0: UnlessNode).returns(::T.nilable(Node)) } - def visit_unless_node(arg0); end - - sig { params(arg0: UntilNode).returns(::T.nilable(Node)) } - def visit_until_node(arg0); end - - sig { params(arg0: WhenNode).returns(::T.nilable(Node)) } - def visit_when_node(arg0); end - - sig { params(arg0: WhileNode).returns(::T.nilable(Node)) } - def visit_while_node(arg0); end - - sig { params(arg0: XStringNode).returns(::T.nilable(Node)) } - def visit_x_string_node(arg0); end - - sig { params(arg0: YieldNode).returns(::T.nilable(Node)) } - def visit_yield_node(arg0); end - end -end diff --git a/rbi/generated/prism/node.rbi b/rbi/generated/prism/node.rbi deleted file mode 100644 index 3b62926afb..0000000000 --- a/rbi/generated/prism/node.rbi +++ /dev/null @@ -1,14280 +0,0 @@ -# typed: true - -module Prism - # This represents a node in the tree. It is the parent class of all of the - # various node types. - class Node - abstract! - - # A pointer to the source that this node was created from. - sig { returns(Source) } - attr_reader :source - - # A unique identifier for this node. This is used in a very specific - # use case where you want to keep around a reference to a node without - # having to keep around the syntax tree in memory. This unique identifier - # will be consistent across multiple parses of the same source code. - sig { returns(Integer) } - attr_reader :node_id - - # Save this node using a saved source so that it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save(repository); end - - # A Location instance that represents the location of this node in the - # source. - sig { returns(Location) } - def location; end - - # Save the location using a saved source so that it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_location(repository); end - - # Delegates to [`start_line`](rdoc-ref:Location#start_line) of the associated location object. - sig { returns(Integer) } - def start_line; end - - # Delegates to [`end_line`](rdoc-ref:Location#end_line) of the associated location object. - sig { returns(Integer) } - def end_line; end - - # Delegates to [`start_offset`](rdoc-ref:Location#start_offset) of the associated location object. - sig { returns(Integer) } - def start_offset; end - - # Delegates to [`end_offset`](rdoc-ref:Location#end_offset) of the associated location object. - sig { returns(Integer) } - def end_offset; end - - # Delegates to [`start_character_offset`](rdoc-ref:Location#start_character_offset) - # of the associated location object. - sig { returns(Integer) } - def start_character_offset; end - - # Delegates to [`end_character_offset`](rdoc-ref:Location#end_character_offset) - # of the associated location object. - sig { returns(Integer) } - def end_character_offset; end - - # Delegates to [`cached_start_code_units_offset`](rdoc-ref:Location#cached_start_code_units_offset) - # of the associated location object. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_start_code_units_offset(cache); end - - # Delegates to [`cached_end_code_units_offset`](rdoc-ref:Location#cached_end_code_units_offset) - # of the associated location object. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_end_code_units_offset(cache); end - - # Delegates to [`start_column`](rdoc-ref:Location#start_column) of the associated location object. - sig { returns(Integer) } - def start_column; end - - # Delegates to [`end_column`](rdoc-ref:Location#end_column) of the associated location object. - sig { returns(Integer) } - def end_column; end - - # Delegates to [`start_character_column`](rdoc-ref:Location#start_character_column) - # of the associated location object. - sig { returns(Integer) } - def start_character_column; end - - # Delegates to [`end_character_column`](rdoc-ref:Location#end_character_column) - # of the associated location object. - sig { returns(Integer) } - def end_character_column; end - - # Delegates to [`cached_start_code_units_column`](rdoc-ref:Location#cached_start_code_units_column) - # of the associated location object. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_start_code_units_column(cache); end - - # Delegates to [`cached_end_code_units_column`](rdoc-ref:Location#cached_end_code_units_column) - # of the associated location object. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_end_code_units_column(cache); end - - # Delegates to [`leading_comments`](rdoc-ref:Location#leading_comments) of the associated location object. - sig { returns(T::Array[Comment]) } - def leading_comments; end - - # Delegates to [`trailing_comments`](rdoc-ref:Location#trailing_comments) of the associated location object. - sig { returns(T::Array[Comment]) } - def trailing_comments; end - - # Delegates to [`comments`](rdoc-ref:Location#comments) of the associated location object. - sig { returns(T::Array[Comment]) } - def comments; end - - # Returns all of the lines of the source code associated with this node. - sig { returns(T::Array[String]) } - def source_lines; end - - # An alias for source_lines, used to mimic the API from - # RubyVM::AbstractSyntaxTree to make it easier to migrate. - sig { returns(T::Array[String]) } - def script_lines; end - - # Slice the location of the node from the source. - sig { returns(String) } - def slice; end - - # Slice the location of the node from the source, starting at the beginning - # of the line that the location starts on, ending at the end of the line - # that the location ends on. - sig { returns(String) } - def slice_lines; end - - # An bitset of flags for this node. There are certain flags that are common - # for all nodes, and then some nodes have specific flags. - sig { returns(Integer) } - attr_reader :flags - - # Returns true if the node has the newline flag set. - sig { returns(T::Boolean) } - def newline?; end - - # Returns true if the node has the static literal flag set. - sig { returns(T::Boolean) } - def static_literal?; end - - # Similar to inspect, but respects the current level of indentation given by - # the pretty print object. - sig { params(q: PP).void } - def pretty_print(q); end - - # Convert this node into a graphviz dot graph string. - sig { returns(String) } - def to_dot; end - - # Returns a list of nodes that are descendants of this node that contain the - # given line and column. This is useful for locating a node that is selected - # based on the line and column of the source code. - # - # Important to note is that the column given to this method should be in - # bytes, as opposed to characters or code units. - sig { params(line: Integer, column: Integer).returns(T::Array[Node]) } - def tunnel(line, column); end - - # Returns the first node that matches the given block when visited in a - # breadth-first search. This is useful for finding a node that matches a - # particular condition. - # - # node.breadth_first_search { |node| node.node_id == node_id } - sig { params(blk: ::T.proc.params(arg0: Node).returns(T::Boolean)).returns(::T.nilable(Node)) } - def breadth_first_search(&blk); end - - sig { params(blk: ::T.proc.params(arg0: Node).returns(T::Boolean)).returns(::T.nilable(Node)) } - def find(&blk); end - - # Returns all of the nodes that match the given block when visited in a - # breadth-first search. This is useful for finding all nodes that match a - # particular condition. - # - # node.breadth_first_search_all { |node| node.is_a?(Prism::CallNode) } - sig { params(blk: ::T.proc.params(arg0: Node).returns(T::Boolean)).returns(T::Array[Node]) } - def breadth_first_search_all(&blk); end - - sig { params(blk: ::T.proc.params(arg0: Node).returns(T::Boolean)).returns(T::Array[Node]) } - def find_all(&blk); end - - # Returns a list of the fields that exist for this node class. Fields - # describe the structure of the node. This kind of reflection is useful for - # things like recursively visiting each node _and_ field in the tree. - sig { returns(T::Array[Reflection::Field]) } - def self.fields; end - - # Accepts a visitor and calls back into the specialized visit function. - sig { abstract.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # Returns an array of child nodes, including `nil`s in the place of optional - # nodes that were not present. - sig { abstract.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - sig { abstract.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - # With a block given, yields each child node. Without a block, returns - # an enumerator that contains each child node. Excludes any `nil`s in - # the place of optional nodes that were not present. - sig { abstract.returns(T::Enumerator[Node]) } - sig { abstract.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # Returns an array of child nodes, excluding any `nil`s in the place of - # optional nodes that were not present. - sig { abstract.returns(T::Array[Node]) } - def compact_child_nodes; end - - # Returns an array of child nodes and locations that could potentially have - # comments attached to them. - sig { abstract.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Returns a string representation of the node. - sig { abstract.returns(String) } - def inspect; end - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - sig { abstract.returns(Symbol) } - def type; end - - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - sig { abstract.returns(Symbol) } - def self.type; end - end - - # Represents the use of the `alias` keyword to alias a global variable. - # - # alias $foo $bar - # ^^^^^^^^^^^^^^^ - class AliasGlobalVariableNode < Node - # Initialize a new AliasGlobalVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode), old_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, SymbolNode, MissingNode), keyword_loc: Location).void } - def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode), old_name: ::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, SymbolNode, MissingNode), keyword_loc: Location).returns(AliasGlobalVariableNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the new name of the global variable that can be used after aliasing. - # - # alias $foo $bar - # ^^^^ - sig { returns(::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode)) } - def new_name; end - - # Represents the old name of the global variable that can be used before aliasing. - # - # alias $foo $bar - # ^^^^ - sig { returns(::T.any(GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, SymbolNode, MissingNode)) } - def old_name; end - - # The Location of the `alias` keyword. - # - # alias $foo $bar - # ^^^^^ - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `alias` keyword to alias a method. - # - # alias foo bar - # ^^^^^^^^^^^^^ - class AliasMethodNode < Node - # Initialize a new AliasMethodNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(SymbolNode, InterpolatedSymbolNode), old_name: ::T.any(SymbolNode, InterpolatedSymbolNode, GlobalVariableReadNode, MissingNode), keyword_loc: Location).void } - def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, new_name: ::T.any(SymbolNode, InterpolatedSymbolNode), old_name: ::T.any(SymbolNode, InterpolatedSymbolNode, GlobalVariableReadNode, MissingNode), keyword_loc: Location).returns(AliasMethodNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the new name of the method that will be aliased. - # - # alias foo bar - # ^^^ - # - # alias :foo :bar - # ^^^^ - # - # alias :"#{foo}" :"#{bar}" - # ^^^^^^^^^ - sig { returns(::T.any(SymbolNode, InterpolatedSymbolNode)) } - def new_name; end - - # Represents the old name of the method that will be aliased. - # - # alias foo bar - # ^^^ - # - # alias :foo :bar - # ^^^^ - # - # alias :"#{foo}" :"#{bar}" - # ^^^^^^^^^ - sig { returns(::T.any(SymbolNode, InterpolatedSymbolNode, GlobalVariableReadNode, MissingNode)) } - def old_name; end - - # Represents the Location of the `alias` keyword. - # - # alias foo bar - # ^^^^^ - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an alternation pattern in pattern matching. - # - # foo => bar | baz - # ^^^^^^^^^ - class AlternationPatternNode < Node - # Initialize a new AlternationPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, left, right, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(AlternationPatternNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the left side of the expression. - # - # foo => bar | baz - # ^^^ - sig { returns(Node) } - def left; end - - # Represents the right side of the expression. - # - # foo => bar | baz - # ^^^ - sig { returns(Node) } - def right; end - - # Represents the alternation operator Location. - # - # foo => bar | baz - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&` operator or the `and` keyword. - # - # left and right - # ^^^^^^^^^^^^^^ - class AndNode < Node - # Initialize a new AndNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, left, right, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(AndNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # left and right - # ^^^^ - # - # 1 && 2 - # ^ - sig { returns(Node) } - def left; end - - # Represents the right side of the expression. - # - # left && right - # ^^^^^ - # - # 1 and 2 - # ^ - sig { returns(Node) } - def right; end - - # The Location of the `and` keyword or the `&&` operator. - # - # left and right - # ^^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a set of arguments to a method or a keyword. - # - # return foo, bar, baz - # ^^^^^^^^^^^^^ - class ArgumentsNode < Node - # Initialize a new ArgumentsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: T::Array[Node]).void } - def initialize(source, node_id, location, flags, arguments); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, arguments: T::Array[Node]).returns(ArgumentsNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # if the arguments contain forwarding - sig { returns(T::Boolean) } - def contains_forwarding?; end - - # if the arguments contain keywords - sig { returns(T::Boolean) } - def contains_keywords?; end - - # if the arguments contain a keyword splat - sig { returns(T::Boolean) } - def contains_keyword_splat?; end - - # if the arguments contain a splat - sig { returns(T::Boolean) } - def contains_splat?; end - - # if the arguments contain multiple splats - sig { returns(T::Boolean) } - def contains_multiple_splats?; end - - # The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(bar, baz) - # ^^^^^^^^ - sig { returns(T::Array[Node]) } - def arguments; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. - # - # [1, 2, 3] - # ^^^^^^^^^ - class ArrayNode < Node - # Initialize a new ArrayNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, elements: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, elements, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, elements: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(ArrayNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # if array contains splat nodes - sig { returns(T::Boolean) } - def contains_splat?; end - - # Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. - sig { returns(T::Array[Node]) } - def elements; end - - # Represents the optional source Location for the opening token. - # - # [1,2,3] # "[" - # %w[foo bar baz] # "%w[" - # %I(apple orange banana) # "%I(" - # foo = 1, 2, 3 # nil - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Represents the optional source Location for the closing token. - # - # [1,2,3] # "]" - # %w[foo bar baz] # "]" - # %I(apple orange banana) # ")" - # foo = 1, 2, 3 # nil - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an array pattern in pattern matching. - # - # foo in 1, 2 - # ^^^^ - # - # foo in [1, 2] - # ^^^^^^ - # - # foo in *bar - # ^^^^ - # - # foo in Bar[] - # ^^^^^ - # - # foo in Bar[1, 2, 3] - # ^^^^^^^^^^^^ - class ArrayPatternNode < Node - # Initialize a new ArrayPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), requireds: T::Array[Node], rest: ::T.nilable(Node), posts: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), requireds: T::Array[Node], rest: ::T.nilable(Node), posts: T::Array[Node], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(ArrayPatternNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the optional constant preceding the Array - # - # foo in Bar[] - # ^^^ - # - # foo in Bar[1, 2, 3] - # ^^^ - # - # foo in Bar::Baz[1, 2, 3] - # ^^^^^^^^ - sig { returns(::T.nilable(::T.any(ConstantPathNode, ConstantReadNode))) } - def constant; end - - # Represents the required elements of the array pattern. - # - # foo in [1, 2] - # ^ ^ - sig { returns(T::Array[Node]) } - def requireds; end - - # Represents the rest element of the array pattern. - # - # foo in *bar - # ^^^^ - sig { returns(::T.nilable(Node)) } - def rest; end - - # Represents the elements after the rest element of the array pattern. - # - # foo in *bar, baz - # ^^^ - sig { returns(T::Array[Node]) } - def posts; end - - # Represents the opening Location of the array pattern. - # - # foo in [1, 2] - # ^ - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Represents the closing Location of the array pattern. - # - # foo in [1, 2] - # ^ - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a hash key/value pair. - # - # { a => b } - # ^^^^^^ - class AssocNode < Node - # Initialize a new AssocNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, key: Node, value: Node, operator_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, key, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, key: Node, value: Node, operator_loc: ::T.nilable(Location)).returns(AssocNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # { a: b } - # ^ - # - # { foo => bar } - # ^^^ - # - # { def a; end => 1 } - # ^^^^^^^^^^ - sig { returns(Node) } - def key; end - - # The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # { foo => bar } - # ^^^ - # - # { x: 1 } - # ^ - sig { returns(Node) } - def value; end - - # The Location of the `=>` operator, if present. - # - # { foo => bar } - # ^^ - sig { returns(::T.nilable(Location)) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(::T.nilable(String)) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a splat in a hash literal. - # - # { **foo } - # ^^^^^ - class AssocSplatNode < Node - # Initialize a new AssocSplatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: ::T.nilable(Node), operator_loc: Location).void } - def initialize(source, node_id, location, flags, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: ::T.nilable(Node), operator_loc: Location).returns(AssocSplatNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. - # - # { **foo } - # ^^^ - sig { returns(::T.nilable(Node)) } - def value; end - - # The Location of the `**` operator. - # - # { **x } - # ^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents reading a reference to a field in the previous match. - # - # $' - # ^^ - class BackReferenceReadNode < Node - # Initialize a new BackReferenceReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(BackReferenceReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the back-reference variable, including the leading `$`. - # - # $& # name `:$&` - # - # $+ # name `:$+` - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a begin statement. - # - # begin - # foo - # end - # ^^^^^ - class BeginNode < Node - # Initialize a new BeginNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, begin_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), rescue_clause: ::T.nilable(RescueNode), else_clause: ::T.nilable(ElseNode), ensure_clause: ::T.nilable(EnsureNode), end_keyword_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, begin_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), rescue_clause: ::T.nilable(RescueNode), else_clause: ::T.nilable(ElseNode), ensure_clause: ::T.nilable(EnsureNode), end_keyword_loc: ::T.nilable(Location)).returns(BeginNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the Location of the `begin` keyword. - # - # begin x end - # ^^^^^ - sig { returns(::T.nilable(Location)) } - def begin_keyword_loc; end - - # Save the begin_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_begin_keyword_loc(repository); end - - # Represents the statements within the begin block. - # - # begin x end - # ^ - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Represents the rescue clause within the begin block. - # - # begin x; rescue y; end - # ^^^^^^^^ - sig { returns(::T.nilable(RescueNode)) } - def rescue_clause; end - - # Represents the else clause within the begin block. - # - # begin x; rescue y; else z; end - # ^^^^^^^^^^^ - sig { returns(::T.nilable(ElseNode)) } - def else_clause; end - - # Represents the ensure clause within the begin block. - # - # begin x; ensure y; end - # ^^^^^^^^ - sig { returns(::T.nilable(EnsureNode)) } - def ensure_clause; end - - # Represents the Location of the `end` keyword. - # - # begin x end - # ^^^ - sig { returns(::T.nilable(Location)) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_end_keyword_loc(repository); end - - # Slice the location of begin_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def begin_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a block argument using `&`. - # - # bar(&args) - # ^^^^^ - class BlockArgumentNode < Node - # Initialize a new BlockArgumentNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: ::T.nilable(Node), operator_loc: Location).void } - def initialize(source, node_id, location, flags, expression, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, expression: ::T.nilable(Node), operator_loc: Location).returns(BlockArgumentNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(&args) - # ^^^^ - sig { returns(::T.nilable(Node)) } - def expression; end - - # Represents the Location of the `&` operator. - # - # foo(&args) - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a block local variable. - # - # a { |; b| } - # ^ - class BlockLocalVariableNode < Node - # Initialize a new BlockLocalVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(BlockLocalVariableNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # The name of the block local variable. - # - # a { |; b| } # name `:b` - # ^ - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a block of ruby code. - # - # [1, 2, 3].each { |i| puts x } - # ^^^^^^^^^^^^^^ - class BlockNode < Node - # Initialize a new BlockNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), opening_loc: Location, closing_loc: Location).void } - def initialize(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), opening_loc: Location, closing_loc: Location).returns(BlockNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The local variables declared in the block. - # - # [1, 2, 3].each { |i| puts x } # locals: [:i] - # ^ - sig { returns(T::Array[Symbol]) } - def locals; end - - # The parameters of the block. - # - # [1, 2, 3].each { |i| puts x } - # ^^^ - # [1, 2, 3].each { puts _1 } - # ^^^^^^^^^^^ - # [1, 2, 3].each { puts it } - # ^^^^^^^^^^^ - sig { returns(::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode))) } - def parameters; end - - # The body of the block. - # - # [1, 2, 3].each { |i| puts x } - # ^^^^^^ - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Represents the Location of the opening `{` or `do`. - # - # [1, 2, 3].each { |i| puts x } - # ^ - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Represents the Location of the closing `}` or `end`. - # - # [1, 2, 3].each { |i| puts x } - # ^ - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a block parameter of a method, block, or lambda definition. - # - # def a(&b) - # ^^ - # end - class BlockParameterNode < Node - # Initialize a new BlockParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(BlockParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # The name of the block parameter. - # - # def a(&b) # name `:b` - # ^ - # end - sig { returns(::T.nilable(Symbol)) } - def name; end - - # Represents the Location of the block parameter name. - # - # def a(&b) - # ^ - sig { returns(::T.nilable(Location)) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_name_loc(repository); end - - # Represents the Location of the `&` operator. - # - # def a(&b) - # ^ - # end - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a block's parameters declaration. - # - # -> (a, b = 1; local) { } - # ^^^^^^^^^^^^^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^^^^^^^^^^^^^ - # end - class BlockParametersNode < Node - # Initialize a new BlockParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parameters: ::T.nilable(ParametersNode), locals: T::Array[BlockLocalVariableNode], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, parameters: ::T.nilable(ParametersNode), locals: T::Array[BlockLocalVariableNode], opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(BlockParametersNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the parameters of the block. - # - # -> (a, b = 1; local) { } - # ^^^^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^^^^ - # end - sig { returns(::T.nilable(ParametersNode)) } - def parameters; end - - # Represents the local variables of the block. - # - # -> (a, b = 1; local) { } - # ^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^ - # end - sig { returns(T::Array[BlockLocalVariableNode]) } - def locals; end - - # Represents the opening Location of the block parameters. - # - # -> (a, b = 1; local) { } - # ^ - # - # foo do |a, b = 1; local| - # ^ - # end - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Represents the closing Location of the block parameters. - # - # -> (a, b = 1; local) { } - # ^ - # - # foo do |a, b = 1; local| - # ^ - # end - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `break` keyword. - # - # break foo - # ^^^^^^^^^ - class BreakNode < Node - # Initialize a new BreakNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).void } - def initialize(source, node_id, location, flags, arguments, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).returns(BreakNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # break foo - # ^^^ - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # The Location of the `break` keyword. - # - # break foo - # ^^^^^ - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator on a call. - # - # foo.bar &&= value - # ^^^^^^^^^^^^^^^^^ - class CallAndWriteNode < Node - # Initialize a new CallAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).returns(CallAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar &&= value - # ^^^ - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Represents the Location of the call operator. - # - # foo.bar &&= value - # ^ - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Represents the Location of the message. - # - # foo.bar &&= value - # ^^^ - sig { returns(::T.nilable(Location)) } - def message_loc; end - - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_message_loc(repository); end - - # Represents the name of the method being called. - # - # foo.bar &&= value # read_name `:bar` - # ^^^ - sig { returns(Symbol) } - def read_name; end - - # Represents the name of the method being written to. - # - # foo.bar &&= value # write_name `:bar=` - # ^^^ - sig { returns(Symbol) } - def write_name; end - - # Represents the Location of the operator. - # - # foo.bar &&= value - # ^^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Represents the value being assigned. - # - # foo.bar &&= value - # ^^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of message_loc from the source. - sig { returns(::T.nilable(String)) } - def message; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a method call, in all of the various forms that can take. - # - # foo - # ^^^ - # - # foo() - # ^^^^^ - # - # +foo - # ^^^^ - # - # foo + bar - # ^^^^^^^^^ - # - # foo.bar - # ^^^^^^^ - # - # foo&.bar - # ^^^^^^^^ - class CallNode < Node - # Initialize a new CallNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), name: Symbol, message_loc: ::T.nilable(Location), opening_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), closing_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, equal_loc, block); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), name: Symbol, message_loc: ::T.nilable(Location), opening_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), closing_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).returns(CallNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar - # ^^^ - # - # +foo - # ^^^ - # - # foo + bar - # ^^^ - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Represents the Location of the call operator. - # - # foo.bar - # ^ - # - # foo&.bar - # ^^ - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Represents the name of the method being called. - # - # foo.bar # name `:foo` - # ^^^ - sig { returns(Symbol) } - def name; end - - # Represents the Location of the message. - # - # foo.bar - # ^^^ - sig { returns(::T.nilable(Location)) } - def message_loc; end - - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_message_loc(repository); end - - # Represents the Location of the left parenthesis. - # - # foo(bar) - # ^ - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(bar) - # ^^^ - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Represents the Location of the right parenthesis. - # - # foo(bar) - # ^ - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Represents the Location of the equal sign, in the case that this is an attribute write. - # - # foo.bar = value - # ^ - # - # foo[bar] = value - # ^ - sig { returns(::T.nilable(Location)) } - def equal_loc; end - - # Save the equal_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_equal_loc(repository); end - - # Represents the block that is being passed to the method. - # - # foo { |a| a } - # ^^^^^^^^^ - sig { returns(::T.nilable(::T.any(BlockNode, BlockArgumentNode))) } - def block; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of message_loc from the source. - sig { returns(::T.nilable(String)) } - def message; end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - # Slice the location of equal_loc from the source. - sig { returns(::T.nilable(String)) } - def equal; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of an assignment operator on a call. - # - # foo.bar += baz - # ^^^^^^^^^^^^^^ - class CallOperatorWriteNode < Node - # Initialize a new CallOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Node).returns(CallOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar += value - # ^^^ - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Represents the Location of the call operator. - # - # foo.bar += value - # ^ - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Represents the Location of the message. - # - # foo.bar += value - # ^^^ - sig { returns(::T.nilable(Location)) } - def message_loc; end - - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_message_loc(repository); end - - # Represents the name of the method being called. - # - # foo.bar += value # read_name `:bar` - # ^^^ - sig { returns(Symbol) } - def read_name; end - - # Represents the name of the method being written to. - # - # foo.bar += value # write_name `:bar=` - # ^^^ - sig { returns(Symbol) } - def write_name; end - - # Represents the binary operator being used. - # - # foo.bar += value # binary_operator `:+` - # ^ - sig { returns(Symbol) } - def binary_operator; end - - # Represents the Location of the binary operator. - # - # foo.bar += value - # ^^ - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Represents the value being assigned. - # - # foo.bar += value - # ^^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of message_loc from the source. - sig { returns(::T.nilable(String)) } - def message; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator on a call. - # - # foo.bar ||= value - # ^^^^^^^^^^^^^^^^^ - class CallOrWriteNode < Node - # Initialize a new CallOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), message_loc: ::T.nilable(Location), read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node).returns(CallOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar ||= value - # ^^^ - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Represents the Location of the call operator. - # - # foo.bar ||= value - # ^ - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Represents the Location of the message. - # - # foo.bar ||= value - # ^^^ - sig { returns(::T.nilable(Location)) } - def message_loc; end - - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_message_loc(repository); end - - # Represents the name of the method being called. - # - # foo.bar ||= value # read_name `:bar` - # ^^^ - sig { returns(Symbol) } - def read_name; end - - # Represents the name of the method being written to. - # - # foo.bar ||= value # write_name `:bar=` - # ^^^ - sig { returns(Symbol) } - def write_name; end - - # Represents the Location of the operator. - # - # foo.bar ||= value - # ^^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Represents the value being assigned. - # - # foo.bar ||= value - # ^^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of message_loc from the source. - sig { returns(::T.nilable(String)) } - def message; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a method call. - # - # foo.bar, = 1 - # ^^^^^^^ - # - # begin - # rescue => foo.bar - # ^^^^^^^ - # end - # - # for foo.bar in baz do end - # ^^^^^^^ - class CallTargetNode < Node - # Initialize a new CallTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location).returns(CallTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar = 1 - # ^^^ - sig { returns(Node) } - def receiver; end - - # Represents the Location of the call operator. - # - # foo.bar = 1 - # ^ - sig { returns(Location) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_call_operator_loc(repository); end - - # Represents the name of the method being called. - # - # foo.bar = 1 # name `:foo` - # ^^^ - sig { returns(Symbol) } - def name; end - - # Represents the Location of the message. - # - # foo.bar = 1 - # ^^^ - sig { returns(Location) } - def message_loc; end - - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_message_loc(repository); end - - # Slice the location of call_operator_loc from the source. - sig { returns(String) } - def call_operator; end - - # Slice the location of message_loc from the source. - sig { returns(String) } - def message; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a local variable in pattern matching. - # - # foo => [bar => baz] - # ^^^^^^^^^^ - class CapturePatternNode < Node - # Initialize a new CapturePatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, target: LocalVariableTargetNode, operator_loc: Location).void } - def initialize(source, node_id, location, flags, value, target, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: Node, target: LocalVariableTargetNode, operator_loc: Location).returns(CapturePatternNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the value to capture. - # - # foo => bar - # ^^^ - sig { returns(Node) } - def value; end - - # Represents the target of the capture. - # - # foo => bar - # ^^^ - sig { returns(LocalVariableTargetNode) } - def target; end - - # Represents the Location of the `=>` operator. - # - # foo => bar - # ^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of a case statement for pattern matching. - # - # case true - # in false - # end - # ^^^^^^^^^ - class CaseMatchNode < Node - # Initialize a new CaseMatchNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[InNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).void } - def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[InNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).returns(CaseMatchNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # case true; in false; end - # ^^^^ - sig { returns(::T.nilable(Node)) } - def predicate; end - - # Represents the conditions of the case match. - # - # case true; in false; end - # ^^^^^^^^ - sig { returns(T::Array[InNode]) } - def conditions; end - - # Represents the else clause of the case match. - # - # case true; in false; else; end - # ^^^^^^^^^ - sig { returns(::T.nilable(ElseNode)) } - def else_clause; end - - # Represents the Location of the `case` keyword. - # - # case true; in false; end - # ^^^^ - sig { returns(Location) } - def case_keyword_loc; end - - # Save the case_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_case_keyword_loc(repository); end - - # Represents the Location of the `end` keyword. - # - # case true; in false; end - # ^^^ - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Slice the location of case_keyword_loc from the source. - sig { returns(String) } - def case_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of a case statement. - # - # case true - # when false - # end - # ^^^^^^^^^^ - class CaseNode < Node - # Initialize a new CaseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[WhenNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).void } - def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, predicate: ::T.nilable(Node), conditions: T::Array[WhenNode], else_clause: ::T.nilable(ElseNode), case_keyword_loc: Location, end_keyword_loc: Location).returns(CaseNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # case true; when false; end - # ^^^^ - sig { returns(::T.nilable(Node)) } - def predicate; end - - # Represents the conditions of the case statement. - # - # case true; when false; end - # ^^^^^^^^^^ - sig { returns(T::Array[WhenNode]) } - def conditions; end - - # Represents the else clause of the case statement. - # - # case true; when false; else; end - # ^^^^^^^^^ - sig { returns(::T.nilable(ElseNode)) } - def else_clause; end - - # Represents the Location of the `case` keyword. - # - # case true; when false; end - # ^^^^ - sig { returns(Location) } - def case_keyword_loc; end - - # Save the case_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_case_keyword_loc(repository); end - - # Represents the Location of the `end` keyword. - # - # case true; when false; end - # ^^^ - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Slice the location of case_keyword_loc from the source. - sig { returns(String) } - def case_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a class declaration involving the `class` keyword. - # - # class Foo end - # ^^^^^^^^^^^^^ - class ClassNode < Node - # Initialize a new ClassNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, CallNode), inheritance_operator_loc: ::T.nilable(Location), superclass: ::T.nilable(Node), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).void } - def initialize(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, CallNode), inheritance_operator_loc: ::T.nilable(Location), superclass: ::T.nilable(Node), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).returns(ClassNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Represents the Location of the `class` keyword. - # - # class Foo end - # ^^^^^ - sig { returns(Location) } - def class_keyword_loc; end - - # Save the class_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_class_keyword_loc(repository); end - - # Returns the `constant_path` attribute. - sig { returns(::T.any(ConstantReadNode, ConstantPathNode, CallNode)) } - def constant_path; end - - # Represents the Location of the `<` operator. - # - # class Foo < Bar - # ^ - sig { returns(::T.nilable(Location)) } - def inheritance_operator_loc; end - - # Save the inheritance_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_inheritance_operator_loc(repository); end - - # Represents the superclass of the class. - # - # class Foo < Bar - # ^^^ - sig { returns(::T.nilable(Node)) } - def superclass; end - - # Represents the body of the class. - # - # class Foo; bar; end - # ^^^ - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Represents the Location of the `end` keyword. - # - # class Foo end - # ^^^ - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # The name of the class. - # - # class Foo end # name `:Foo` - sig { returns(Symbol) } - def name; end - - # Slice the location of class_keyword_loc from the source. - sig { returns(String) } - def class_keyword; end - - # Slice the location of inheritance_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def inheritance_operator; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to a class variable. - # - # @@target &&= value - # ^^^^^^^^^^^^^^^^^^ - class ClassVariableAndWriteNode < Node - # Initialize a new ClassVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ClassVariableAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@target &&= value # name `:@@target` - # ^^^^^^^^ - sig { returns(Symbol) } - def name; end - - # Represents the Location of the variable name. - # - # @@target &&= value - # ^^^^^^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Represents the Location of the `&&=` operator. - # - # @@target &&= value - # ^^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @@target &&= value - # ^^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a class variable using an operator that isn't `=`. - # - # @@target += value - # ^^^^^^^^^^^^^^^^^ - class ClassVariableOperatorWriteNode < Node - # Initialize a new ClassVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).void } - def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ClassVariableOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to a class variable. - # - # @@target ||= value - # ^^^^^^^^^^^^^^^^^^ - class ClassVariableOrWriteNode < Node - # Initialize a new ClassVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ClassVariableOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents referencing a class variable. - # - # @@foo - # ^^^^^ - class ClassVariableReadNode < Node - # Initialize a new ClassVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ClassVariableReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@abc # name `:@@abc` - # - # @@_test # name `:@@_test` - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a class variable in a context that doesn't have an explicit value. - # - # @@foo, @@bar = baz - # ^^^^^ ^^^^^ - class ClassVariableTargetNode < Node - # Initialize a new ClassVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ClassVariableTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a class variable. - # - # @@foo = 1 - # ^^^^^^^^^ - class ClassVariableWriteNode < Node - # Initialize a new ClassVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(ClassVariableWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@abc = 123 # name `@@abc` - # - # @@_test = :test # name `@@_test` - sig { returns(Symbol) } - def name; end - - # The Location of the variable name. - # - # @@foo = :bar - # ^^^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @@foo = :bar - # ^^^^ - # - # @@_xyz = 123 - # ^^^ - sig { returns(Node) } - def value; end - - # The Location of the `=` operator. - # - # @@foo = :bar - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to a constant. - # - # Target &&= value - # ^^^^^^^^^^^^^^^^ - class ConstantAndWriteNode < Node - # Initialize a new ConstantAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ConstantAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a constant using an operator that isn't `=`. - # - # Target += value - # ^^^^^^^^^^^^^^^ - class ConstantOperatorWriteNode < Node - # Initialize a new ConstantOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).void } - def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ConstantOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to a constant. - # - # Target ||= value - # ^^^^^^^^^^^^^^^^ - class ConstantOrWriteNode < Node - # Initialize a new ConstantOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(ConstantOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to a constant path. - # - # Parent::Child &&= value - # ^^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathAndWriteNode < Node - # Initialize a new ConstantPathAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, target, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `target` attribute. - sig { returns(ConstantPathNode) } - def target; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents accessing a constant through a path of `::` operators. - # - # Foo::Bar - # ^^^^^^^^ - class ConstantPathNode < Node - # Initialize a new ConstantPathNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).void } - def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).returns(ConstantPathNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. - # - # Foo::Bar - # ^^^ - # - # self::Test - # ^^^^ - # - # a.b::C - # ^^^ - sig { returns(::T.nilable(Node)) } - def parent; end - - # The name of the constant being accessed. This could be `nil` in the event of a syntax error. - sig { returns(::T.nilable(Symbol)) } - def name; end - - # The Location of the `::` delimiter. - # - # ::Foo - # ^^ - # - # One::Two - # ^^ - sig { returns(Location) } - def delimiter_loc; end - - # Save the delimiter_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_delimiter_loc(repository); end - - # The Location of the name of the constant. - # - # ::Foo - # ^^^ - # - # One::Two - # ^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Slice the location of delimiter_loc from the source. - sig { returns(String) } - def delimiter; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a constant path using an operator that isn't `=`. - # - # Parent::Child += value - # ^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathOperatorWriteNode < Node - # Initialize a new ConstantPathOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, binary_operator_loc: Location, value: Node, binary_operator: Symbol).void } - def initialize(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(ConstantPathOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `target` attribute. - sig { returns(ConstantPathNode) } - def target; end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to a constant path. - # - # Parent::Child ||= value - # ^^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathOrWriteNode < Node - # Initialize a new ConstantPathOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, target, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `target` attribute. - sig { returns(ConstantPathNode) } - def target; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a constant path in a context that doesn't have an explicit value. - # - # Foo::Foo, Bar::Bar = baz - # ^^^^^^^^ ^^^^^^^^ - class ConstantPathTargetNode < Node - # Initialize a new ConstantPathTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).void } - def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, parent: ::T.nilable(Node), name: ::T.nilable(Symbol), delimiter_loc: Location, name_loc: Location).returns(ConstantPathTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `parent` attribute. - sig { returns(::T.nilable(Node)) } - def parent; end - - # Returns the `name` attribute. - sig { returns(::T.nilable(Symbol)) } - def name; end - - # Returns the Location represented by `delimiter_loc`. - sig { returns(Location) } - def delimiter_loc; end - - # Save the delimiter_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_delimiter_loc(repository); end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Slice the location of delimiter_loc from the source. - sig { returns(String) } - def delimiter; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a constant path. - # - # ::Foo = 1 - # ^^^^^^^^^ - # - # Foo::Bar = 1 - # ^^^^^^^^^^^^ - # - # ::Foo::Bar = 1 - # ^^^^^^^^^^^^^^ - class ConstantPathWriteNode < Node - # Initialize a new ConstantPathWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, target, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, target: ConstantPathNode, operator_loc: Location, value: Node).returns(ConstantPathWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # A node representing the constant path being written to. - # - # Foo::Bar = 1 - # ^^^^^^^^ - # - # ::Foo = :abc - # ^^^^^ - sig { returns(ConstantPathNode) } - def target; end - - # The Location of the `=` operator. - # - # ::ABC = 123 - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # FOO::BAR = :abc - # ^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents referencing a constant. - # - # Foo - # ^^^ - class ConstantReadNode < Node - # Initialize a new ConstantReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ConstantReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - # - # X # name `:X` - # - # SOME_CONSTANT # name `:SOME_CONSTANT` - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a constant in a context that doesn't have an explicit value. - # - # Foo, Bar = baz - # ^^^ ^^^ - class ConstantTargetNode < Node - # Initialize a new ConstantTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(ConstantTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a constant. - # - # Foo = 1 - # ^^^^^^^ - class ConstantWriteNode < Node - # Initialize a new ConstantWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(ConstantWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - # - # Foo = :bar # name `:Foo` - # - # XYZ = 1 # name `:XYZ` - sig { returns(Symbol) } - def name; end - - # The Location of the constant name. - # - # FOO = 1 - # ^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # FOO = :bar - # ^^^^ - # - # MyClass = Class.new - # ^^^^^^^^^ - sig { returns(Node) } - def value; end - - # The Location of the `=` operator. - # - # FOO = :bar - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a method definition. - # - # def method - # end - # ^^^^^^^^^^ - class DefNode < Node - # Initialize a new DefNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, receiver: ::T.nilable(Node), parameters: ::T.nilable(ParametersNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), locals: T::Array[Symbol], def_keyword_loc: Location, operator_loc: ::T.nilable(Location), lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), end_keyword_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, receiver: ::T.nilable(Node), parameters: ::T.nilable(ParametersNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), locals: T::Array[Symbol], def_keyword_loc: Location, operator_loc: ::T.nilable(Location), lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), equal_loc: ::T.nilable(Location), end_keyword_loc: ::T.nilable(Location)).returns(DefNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the `receiver` attribute. - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Returns the `parameters` attribute. - sig { returns(::T.nilable(ParametersNode)) } - def parameters; end - - # Returns the `body` attribute. - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Returns the Location represented by `def_keyword_loc`. - sig { returns(Location) } - def def_keyword_loc; end - - # Save the def_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_def_keyword_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(::T.nilable(Location)) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_operator_loc(repository); end - - # Returns the Location represented by `lparen_loc`. - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # Returns the Location represented by `rparen_loc`. - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # Returns the Location represented by `equal_loc`. - sig { returns(::T.nilable(Location)) } - def equal_loc; end - - # Save the equal_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_equal_loc(repository); end - - # Returns the Location represented by `end_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_end_keyword_loc(repository); end - - # Slice the location of def_keyword_loc from the source. - sig { returns(String) } - def def_keyword; end - - # Slice the location of operator_loc from the source. - sig { returns(::T.nilable(String)) } - def operator; end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - # Slice the location of equal_loc from the source. - sig { returns(::T.nilable(String)) } - def equal; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `defined?` keyword. - # - # defined?(a) - # ^^^^^^^^^^^ - class DefinedNode < Node - # Initialize a new DefinedNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lparen_loc: ::T.nilable(Location), value: Node, rparen_loc: ::T.nilable(Location), keyword_loc: Location).void } - def initialize(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, lparen_loc: ::T.nilable(Location), value: Node, rparen_loc: ::T.nilable(Location), keyword_loc: Location).returns(DefinedNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `lparen_loc`. - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the Location represented by `rparen_loc`. - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an `else` clause in a `case`, `if`, or `unless` statement. - # - # if a then b else c end - # ^^^^^^^^^^ - class ElseNode < Node - # Initialize a new ElseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, else_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, else_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: ::T.nilable(Location)).returns(ElseNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `else_keyword_loc`. - sig { returns(Location) } - def else_keyword_loc; end - - # Save the else_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_else_keyword_loc(repository); end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `end_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_end_keyword_loc(repository); end - - # Slice the location of else_keyword_loc from the source. - sig { returns(String) } - def else_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an interpolated set of statements. - # - # "foo #{bar}" - # ^^^^^^ - class EmbeddedStatementsNode < Node - # Initialize a new EmbeddedStatementsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, statements: ::T.nilable(StatementsNode), closing_loc: Location).void } - def initialize(source, node_id, location, flags, opening_loc, statements, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, statements: ::T.nilable(StatementsNode), closing_loc: Location).returns(EmbeddedStatementsNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an interpolated variable. - # - # "foo #@bar" - # ^^^^^ - class EmbeddedVariableNode < Node - # Initialize a new EmbeddedVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, variable: ::T.any(InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode)).void } - def initialize(source, node_id, location, flags, operator_loc, variable); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, operator_loc: Location, variable: ::T.any(InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode)).returns(EmbeddedVariableNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `variable` attribute. - sig { returns(::T.any(InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode)) } - def variable; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an `ensure` clause in a `begin` statement. - # - # begin - # foo - # ensure - # ^^^^^^ - # bar - # end - class EnsureNode < Node - # Initialize a new EnsureNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, ensure_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: Location).void } - def initialize(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, ensure_keyword_loc: Location, statements: ::T.nilable(StatementsNode), end_keyword_loc: Location).returns(EnsureNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `ensure_keyword_loc`. - sig { returns(Location) } - def ensure_keyword_loc; end - - # Save the ensure_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_ensure_keyword_loc(repository); end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `end_keyword_loc`. - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Slice the location of ensure_keyword_loc from the source. - sig { returns(String) } - def ensure_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the literal `false` keyword. - # - # false - # ^^^^^ - class FalseNode < Node - # Initialize a new FalseNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(FalseNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a find pattern in pattern matching. - # - # foo in *bar, baz, *qux - # ^^^^^^^^^^^^^^^ - # - # foo in [*bar, baz, *qux] - # ^^^^^^^^^^^^^^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^^^^^^^^^^^^^^^^^ - # - # foo => *bar, baz, *qux - # ^^^^^^^^^^^^^^^ - class FindPatternNode < Node - # Initialize a new FindPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), left: SplatNode, requireds: T::Array[Node], right: ::T.any(SplatNode, MissingNode), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), left: SplatNode, requireds: T::Array[Node], right: ::T.any(SplatNode, MissingNode), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(FindPatternNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the optional constant preceding the pattern - # - # foo in Foo(*bar, baz, *qux) - # ^^^ - sig { returns(::T.nilable(::T.any(ConstantPathNode, ConstantReadNode))) } - def constant; end - - # Represents the first wildcard node in the pattern. - # - # foo in *bar, baz, *qux - # ^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^ - sig { returns(SplatNode) } - def left; end - - # Represents the nodes in between the wildcards. - # - # foo in *bar, baz, *qux - # ^^^ - # - # foo in Foo(*bar, baz, 1, *qux) - # ^^^^^^ - sig { returns(T::Array[Node]) } - def requireds; end - - # Represents the second wildcard node in the pattern. - # - # foo in *bar, baz, *qux - # ^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^ - sig { returns(::T.any(SplatNode, MissingNode)) } - def right; end - - # The Location of the opening brace. - # - # foo in [*bar, baz, *qux] - # ^ - # - # foo in Foo(*bar, baz, *qux) - # ^ - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # The Location of the closing brace. - # - # foo in [*bar, baz, *qux] - # ^ - # - # foo in Foo(*bar, baz, *qux) - # ^ - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `..` or `...` operators to create flip flops. - # - # baz if foo .. bar - # ^^^^^^^^^^ - class FlipFlopNode < Node - # Initialize a new FlipFlopNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).void } - def initialize(source, node_id, location, flags, left, right, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).returns(FlipFlopNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # ... operator - sig { returns(T::Boolean) } - def exclude_end?; end - - # Returns the `left` attribute. - sig { returns(::T.nilable(Node)) } - def left; end - - # Returns the `right` attribute. - sig { returns(::T.nilable(Node)) } - def right; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a floating point number literal. - # - # 1.0 - # ^^^ - class FloatNode < Node - # Initialize a new FloatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Float).void } - def initialize(source, node_id, location, flags, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: Float).returns(FloatNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The value of the floating point number as a Float. - sig { returns(Float) } - def value; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `for` keyword. - # - # for i in a end - # ^^^^^^^^^^^^^^ - class ForNode < Node - # Initialize a new ForNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, index: ::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode), collection: Node, statements: ::T.nilable(StatementsNode), for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), end_keyword_loc: Location).void } - def initialize(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, index: ::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode), collection: Node, statements: ::T.nilable(StatementsNode), for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), end_keyword_loc: Location).returns(ForNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The index expression for `for` loops. - # - # for i in a end - # ^ - sig { returns(::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode)) } - def index; end - - # The collection to iterate over. - # - # for i in a end - # ^ - sig { returns(Node) } - def collection; end - - # Represents the body of statements to execute for each iteration of the loop. - # - # for i in a - # foo(i) - # ^^^^^^ - # end - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # The Location of the `for` keyword. - # - # for i in a end - # ^^^ - sig { returns(Location) } - def for_keyword_loc; end - - # Save the for_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_for_keyword_loc(repository); end - - # The Location of the `in` keyword. - # - # for i in a end - # ^^ - sig { returns(Location) } - def in_keyword_loc; end - - # Save the in_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_in_keyword_loc(repository); end - - # The Location of the `do` keyword, if present. - # - # for i in a do end - # ^^ - sig { returns(::T.nilable(Location)) } - def do_keyword_loc; end - - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_do_keyword_loc(repository); end - - # The Location of the `end` keyword. - # - # for i in a end - # ^^^ - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Slice the location of for_keyword_loc from the source. - sig { returns(String) } - def for_keyword; end - - # Slice the location of in_keyword_loc from the source. - sig { returns(String) } - def in_keyword; end - - # Slice the location of do_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def do_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents forwarding all arguments to this method to another method. - # - # def foo(...) - # bar(...) - # ^^^ - # end - class ForwardingArgumentsNode < Node - # Initialize a new ForwardingArgumentsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(ForwardingArgumentsNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the forwarding parameter in a method, block, or lambda declaration. - # - # def foo(...) - # ^^^ - # end - class ForwardingParameterNode < Node - # Initialize a new ForwardingParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(ForwardingParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `super` keyword without parentheses or arguments, but which might have a block. - # - # super - # ^^^^^ - # - # super { 123 } - # ^^^^^^^^^^^^^ - # - # If it has any other arguments, it would be a `SuperNode` instead. - class ForwardingSuperNode < Node - # Initialize a new ForwardingSuperNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, block: ::T.nilable(BlockNode)).void } - def initialize(source, node_id, location, flags, block); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, block: ::T.nilable(BlockNode)).returns(ForwardingSuperNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # All other arguments are forwarded as normal, except the original block is replaced with the new block. - sig { returns(::T.nilable(BlockNode)) } - def block; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to a global variable. - # - # $target &&= value - # ^^^^^^^^^^^^^^^^^ - class GlobalVariableAndWriteNode < Node - # Initialize a new GlobalVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(GlobalVariableAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a global variable using an operator that isn't `=`. - # - # $target += value - # ^^^^^^^^^^^^^^^^ - class GlobalVariableOperatorWriteNode < Node - # Initialize a new GlobalVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).void } - def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(GlobalVariableOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to a global variable. - # - # $target ||= value - # ^^^^^^^^^^^^^^^^^ - class GlobalVariableOrWriteNode < Node - # Initialize a new GlobalVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(GlobalVariableOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents referencing a global variable. - # - # $foo - # ^^^^ - class GlobalVariableReadNode < Node - # Initialize a new GlobalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(GlobalVariableReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - # - # $foo # name `:$foo` - # - # $_Test # name `:$_Test` - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a global variable in a context that doesn't have an explicit value. - # - # $foo, $bar = baz - # ^^^^ ^^^^ - class GlobalVariableTargetNode < Node - # Initialize a new GlobalVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(GlobalVariableTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a global variable. - # - # $foo = 1 - # ^^^^^^^^ - class GlobalVariableWriteNode < Node - # Initialize a new GlobalVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(GlobalVariableWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - # - # $foo = :bar # name `:$foo` - # - # $_Test = 123 # name `:$_Test` - sig { returns(Symbol) } - def name; end - - # The Location of the global variable's name. - # - # $foo = :bar - # ^^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # $foo = :bar - # ^^^^ - # - # $-xyz = 123 - # ^^^ - sig { returns(Node) } - def value; end - - # The Location of the `=` operator. - # - # $foo = :bar - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a hash literal. - # - # { a => b } - # ^^^^^^^^^^ - class HashNode < Node - # Initialize a new HashNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, elements: T::Array[::T.any(AssocNode, AssocSplatNode)], closing_loc: Location).void } - def initialize(source, node_id, location, flags, opening_loc, elements, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, elements: T::Array[::T.any(AssocNode, AssocSplatNode)], closing_loc: Location).returns(HashNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The Location of the opening brace. - # - # { a => b } - # ^ - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. - # - # { a: b } - # ^^^^ - # - # { **foo } - # ^^^^^ - sig { returns(T::Array[::T.any(AssocNode, AssocSplatNode)]) } - def elements; end - - # The Location of the closing brace. - # - # { a => b } - # ^ - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a hash pattern in pattern matching. - # - # foo => { a: 1, b: 2 } - # ^^^^^^^^^^^^^^ - # - # foo => { a: 1, b: 2, **c } - # ^^^^^^^^^^^^^^^^^^^ - # - # foo => Bar[a: 1, b: 2] - # ^^^^^^^^^^^^^^^ - # - # foo in { a: 1, b: 2 } - # ^^^^^^^^^^^^^^ - class HashPatternNode < Node - # Initialize a new HashPatternNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), elements: T::Array[AssocNode], rest: ::T.nilable(::T.any(AssocSplatNode, NoKeywordsParameterNode)), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, constant: ::T.nilable(::T.any(ConstantPathNode, ConstantReadNode)), elements: T::Array[AssocNode], rest: ::T.nilable(::T.any(AssocSplatNode, NoKeywordsParameterNode)), opening_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location)).returns(HashPatternNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the optional constant preceding the Hash. - # - # foo => Bar[a: 1, b: 2] - # ^^^ - # - # foo => Bar::Baz[a: 1, b: 2] - # ^^^^^^^^ - sig { returns(::T.nilable(::T.any(ConstantPathNode, ConstantReadNode))) } - def constant; end - - # Represents the explicit named hash keys and values. - # - # foo => { a: 1, b:, ** } - # ^^^^^^^^ - sig { returns(T::Array[AssocNode]) } - def elements; end - - # Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`. - # - # foo => { a: 1, b:, **c } - # ^^^ - # - # foo => { a: 1, b:, ** } - # ^^ - # - # foo => { a: 1, b:, **nil } - # ^^^^^ - sig { returns(::T.nilable(::T.any(AssocSplatNode, NoKeywordsParameterNode))) } - def rest; end - - # The Location of the opening brace. - # - # foo => { a: 1 } - # ^ - # - # foo => Bar[a: 1] - # ^ - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # The Location of the closing brace. - # - # foo => { a: 1 } - # ^ - # - # foo => Bar[a: 1] - # ^ - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. - # - # bar if foo - # ^^^^^^^^^^ - # - # if foo then bar end - # ^^^^^^^^^^^^^^^^^^^ - # - # foo ? bar : baz - # ^^^^^^^^^^^^^^^ - class IfNode < Node - # Initialize a new IfNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, if_keyword_loc: ::T.nilable(Location), predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(::T.any(ElseNode, IfNode)), end_keyword_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, if_keyword_loc: ::T.nilable(Location), predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(::T.any(ElseNode, IfNode)), end_keyword_loc: ::T.nilable(Location)).returns(IfNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The Location of the `if` keyword if present. - # - # bar if foo - # ^^ - # - # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. - sig { returns(::T.nilable(Location)) } - def if_keyword_loc; end - - # Save the if_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_if_keyword_loc(repository); end - - # The node for the condition the `IfNode` is testing. - # - # if foo - # ^^^ - # bar - # end - # - # bar if foo - # ^^^ - # - # foo ? bar : baz - # ^^^ - sig { returns(Node) } - def predicate; end - - # The Location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. - # - # if foo then bar end - # ^^^^ - # - # a ? b : c - # ^ - sig { returns(::T.nilable(Location)) } - def then_keyword_loc; end - - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_then_keyword_loc(repository); end - - # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. - # - # if foo - # bar - # ^^^ - # baz - # ^^^ - # end - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. - # - # if foo - # bar - # elsif baz - # ^^^^^^^^^ - # qux - # ^^^ - # end - # ^^^ - # - # if foo then bar else baz end - # ^^^^^^^^^^^^ - sig { returns(::T.nilable(::T.any(ElseNode, IfNode))) } - def subsequent; end - - # The Location of the `end` keyword if present, `nil` otherwise. - # - # if foo - # bar - # end - # ^^^ - sig { returns(::T.nilable(Location)) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_end_keyword_loc(repository); end - - # Slice the location of if_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def if_keyword; end - - # Slice the location of then_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def then_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an imaginary number literal. - # - # 1.0i - # ^^^^ - class ImaginaryNode < Node - # Initialize a new ImaginaryNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, numeric: ::T.any(FloatNode, IntegerNode, RationalNode)).void } - def initialize(source, node_id, location, flags, numeric); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, numeric: ::T.any(FloatNode, IntegerNode, RationalNode)).returns(ImaginaryNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `numeric` attribute. - sig { returns(::T.any(FloatNode, IntegerNode, RationalNode)) } - def numeric; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); 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: } - # ^^^^ - # - # foo in { bar: } - # ^^^^ - class ImplicitNode < Node - # Initialize a new ImplicitNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: ::T.any(LocalVariableReadNode, CallNode, ConstantReadNode, LocalVariableTargetNode)).void } - def initialize(source, node_id, location, flags, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: ::T.any(LocalVariableReadNode, CallNode, ConstantReadNode, LocalVariableTargetNode)).returns(ImplicitNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `value` attribute. - sig { returns(::T.any(LocalVariableReadNode, CallNode, ConstantReadNode, LocalVariableTargetNode)) } - def value; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents using a trailing comma to indicate an implicit rest parameter. - # - # foo { |bar,| } - # ^ - # - # foo in [bar,] - # ^ - # - # for foo, in bar do end - # ^ - # - # foo, = bar - # ^ - class ImplicitRestNode < Node - # Initialize a new ImplicitRestNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(ImplicitRestNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `in` keyword in a case statement. - # - # case a; in b then c end - # ^^^^^^^^^^^ - class InNode < Node - # Initialize a new InNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, pattern: Node, statements: ::T.nilable(StatementsNode), in_loc: Location, then_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, pattern, statements, in_loc, then_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, pattern: Node, statements: ::T.nilable(StatementsNode), in_loc: Location, then_loc: ::T.nilable(Location)).returns(InNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `pattern` attribute. - sig { returns(Node) } - def pattern; end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `in_loc`. - sig { returns(Location) } - def in_loc; end - - # Save the in_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_in_loc(repository); end - - # Returns the Location represented by `then_loc`. - sig { returns(::T.nilable(Location)) } - def then_loc; end - - # Save the then_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_then_loc(repository); end - - # Slice the location of in_loc from the source. - sig { returns(String) } - def in; end - - # Slice the location of then_loc from the source. - sig { returns(::T.nilable(String)) } - def then; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator on a call to the `[]` method. - # - # foo.bar[baz] &&= value - # ^^^^^^^^^^^^^^^^^^^^^^ - class IndexAndWriteNode < Node - # Initialize a new IndexAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).returns(IndexAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # Returns the `receiver` attribute. - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Returns the Location represented by `call_operator_loc`. - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `block` attribute. - sig { returns(::T.nilable(BlockArgumentNode)) } - def block; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of an assignment operator on a call to `[]`. - # - # foo.bar[baz] += value - # ^^^^^^^^^^^^^^^^^^^^^ - class IndexOperatorWriteNode < Node - # Initialize a new IndexOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), binary_operator: Symbol, binary_operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), binary_operator: Symbol, binary_operator_loc: Location, value: Node).returns(IndexOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # Returns the `receiver` attribute. - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Returns the Location represented by `call_operator_loc`. - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `block` attribute. - sig { returns(::T.nilable(BlockArgumentNode)) } - def block; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator on a call to `[]`. - # - # foo.bar[baz] ||= value - # ^^^^^^^^^^^^^^^^^^^^^^ - class IndexOrWriteNode < Node - # Initialize a new IndexOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: ::T.nilable(Node), call_operator_loc: ::T.nilable(Location), opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode), operator_loc: Location, value: Node).returns(IndexOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # Returns the `receiver` attribute. - sig { returns(::T.nilable(Node)) } - def receiver; end - - # Returns the Location represented by `call_operator_loc`. - sig { returns(::T.nilable(Location)) } - def call_operator_loc; end - - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_call_operator_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `block` attribute. - sig { returns(::T.nilable(BlockArgumentNode)) } - def block; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of call_operator_loc from the source. - sig { returns(::T.nilable(String)) } - def call_operator; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to an index. - # - # foo[bar], = 1 - # ^^^^^^^^ - # - # begin - # rescue => foo[bar] - # ^^^^^^^^ - # end - # - # for foo[bar] in baz do end - # ^^^^^^^^ - class IndexTargetNode < Node - # Initialize a new IndexTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, receiver: Node, opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode)).void } - def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, receiver: Node, opening_loc: Location, arguments: ::T.nilable(ArgumentsNode), closing_loc: Location, block: ::T.nilable(BlockArgumentNode)).returns(IndexTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # &. operator - sig { returns(T::Boolean) } - def safe_navigation?; end - - # a call that could have been a local variable - sig { returns(T::Boolean) } - def variable_call?; end - - # a call that is an attribute write, so the value being written should be returned - sig { returns(T::Boolean) } - def attribute_write?; end - - # a call that ignores method visibility - sig { returns(T::Boolean) } - def ignore_visibility?; end - - # Returns the `receiver` attribute. - sig { returns(Node) } - def receiver; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `block` attribute. - sig { returns(::T.nilable(BlockArgumentNode)) } - def block; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to an instance variable. - # - # @target &&= value - # ^^^^^^^^^^^^^^^^^ - class InstanceVariableAndWriteNode < Node - # Initialize a new InstanceVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(InstanceVariableAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to an instance variable using an operator that isn't `=`. - # - # @target += value - # ^^^^^^^^^^^^^^^^ - class InstanceVariableOperatorWriteNode < Node - # Initialize a new InstanceVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).void } - def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Node, binary_operator: Symbol).returns(InstanceVariableOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to an instance variable. - # - # @target ||= value - # ^^^^^^^^^^^^^^^^^ - class InstanceVariableOrWriteNode < Node - # Initialize a new InstanceVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(InstanceVariableOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents referencing an instance variable. - # - # @foo - # ^^^^ - class InstanceVariableReadNode < Node - # Initialize a new InstanceVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(InstanceVariableReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @x # name `:@x` - # - # @_test # name `:@_test` - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to an instance variable in a context that doesn't have an explicit value. - # - # @foo, @bar = baz - # ^^^^ ^^^^ - class InstanceVariableTargetNode < Node - # Initialize a new InstanceVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(InstanceVariableTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to an instance variable. - # - # @foo = 1 - # ^^^^^^^^ - class InstanceVariableWriteNode < Node - # Initialize a new InstanceVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node, operator_loc: Location).returns(InstanceVariableWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @x = :y # name `:@x` - # - # @_foo = "bar" # name `@_foo` - sig { returns(Symbol) } - def name; end - - # The Location of the variable name. - # - # @_x = 1 - # ^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @foo = :bar - # ^^^^ - # - # @_x = 1234 - # ^^^^ - sig { returns(Node) } - def value; end - - # The Location of the `=` operator. - # - # @x = y - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an integer number literal. - # - # 1 - # ^ - class IntegerNode < Node - # Initialize a new IntegerNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Integer).void } - def initialize(source, node_id, location, flags, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: Integer).returns(IntegerNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # 0b prefix - sig { returns(T::Boolean) } - def binary?; end - - # 0d or no prefix - sig { returns(T::Boolean) } - def decimal?; end - - # 0o or 0 prefix - sig { returns(T::Boolean) } - def octal?; end - - # 0x prefix - sig { returns(T::Boolean) } - def hexadecimal?; end - - # The value of the integer literal as a number. - sig { returns(Integer) } - def value; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); 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 - # ^^^^^^^^^^^^^^^^ - class InterpolatedMatchLastLineNode < Node - # Initialize a new InterpolatedMatchLastLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).void } - def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedMatchLastLineNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # i - ignores the case of characters when matching - sig { returns(T::Boolean) } - def ignore_case?; end - - # x - ignores whitespace and allows comments in regular expressions - sig { returns(T::Boolean) } - def extended?; end - - # m - allows $ to match the end of lines within strings - sig { returns(T::Boolean) } - def multi_line?; end - - # o - only interpolates values into the regular expression once - sig { returns(T::Boolean) } - def once?; end - - # e - forces the EUC-JP encoding - sig { returns(T::Boolean) } - def euc_jp?; end - - # n - forces the ASCII-8BIT encoding - sig { returns(T::Boolean) } - def ascii_8bit?; end - - # s - forces the Windows-31J encoding - sig { returns(T::Boolean) } - def windows_31j?; end - - # u - forces the UTF-8 encoding - sig { returns(T::Boolean) } - def utf_8?; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # internal bytes forced the encoding to US-ASCII - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `parts` attribute. - sig { returns(T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)]) } - def parts; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a regular expression literal that contains interpolation. - # - # /foo #{bar} baz/ - # ^^^^^^^^^^^^^^^^ - class InterpolatedRegularExpressionNode < Node - # Initialize a new InterpolatedRegularExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).void } - def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedRegularExpressionNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # i - ignores the case of characters when matching - sig { returns(T::Boolean) } - def ignore_case?; end - - # x - ignores whitespace and allows comments in regular expressions - sig { returns(T::Boolean) } - def extended?; end - - # m - allows $ to match the end of lines within strings - sig { returns(T::Boolean) } - def multi_line?; end - - # o - only interpolates values into the regular expression once - sig { returns(T::Boolean) } - def once?; end - - # e - forces the EUC-JP encoding - sig { returns(T::Boolean) } - def euc_jp?; end - - # n - forces the ASCII-8BIT encoding - sig { returns(T::Boolean) } - def ascii_8bit?; end - - # s - forces the Windows-31J encoding - sig { returns(T::Boolean) } - def windows_31j?; end - - # u - forces the UTF-8 encoding - sig { returns(T::Boolean) } - def utf_8?; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # internal bytes forced the encoding to US-ASCII - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `parts` attribute. - sig { returns(T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)]) } - def parts; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a string literal that contains interpolation. - # - # "foo #{bar} baz" - # ^^^^^^^^^^^^^^^^ - class InterpolatedStringNode < Node - # Initialize a new InterpolatedStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode, InterpolatedStringNode, XStringNode, InterpolatedXStringNode, SymbolNode, InterpolatedSymbolNode)], closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode, InterpolatedStringNode, XStringNode, InterpolatedXStringNode, SymbolNode, InterpolatedSymbolNode)], closing_loc: ::T.nilable(Location)).returns(InterpolatedStringNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - sig { returns(T::Boolean) } - def frozen?; end - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - sig { returns(T::Boolean) } - def mutable?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Returns the `parts` attribute. - sig { returns(T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode, InterpolatedStringNode, XStringNode, InterpolatedXStringNode, SymbolNode, InterpolatedSymbolNode)]) } - def parts; end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a symbol literal that contains interpolation. - # - # :"foo #{bar} baz" - # ^^^^^^^^^^^^^^^^^ - class InterpolatedSymbolNode < Node - # Initialize a new InterpolatedSymbolNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: ::T.nilable(Location)).returns(InterpolatedSymbolNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `opening_loc`. - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Returns the `parts` attribute. - sig { returns(T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)]) } - def parts; end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an xstring literal that contains interpolation. - # - # `foo #{bar} baz` - # ^^^^^^^^^^^^^^^^ - class InterpolatedXStringNode < Node - # Initialize a new InterpolatedXStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).void } - def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, parts: T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)], closing_loc: Location).returns(InterpolatedXStringNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the `parts` attribute. - sig { returns(T::Array[::T.any(StringNode, EmbeddedStatementsNode, EmbeddedVariableNode)]) } - def parts; end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents reading from the implicit `it` local variable. - # - # -> { it } - # ^^ - class ItLocalVariableReadNode < Node - # Initialize a new ItLocalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(ItLocalVariableReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda. - # - # -> { it + it } - # ^^^^^^^^^^^^^^ - class ItParametersNode < Node - # Initialize a new ItParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(ItParametersNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a hash literal without opening and closing braces. - # - # foo(a: b) - # ^^^^ - class KeywordHashNode < Node - # Initialize a new KeywordHashNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, elements: T::Array[::T.any(AssocNode, AssocSplatNode)]).void } - def initialize(source, node_id, location, flags, elements); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, elements: T::Array[::T.any(AssocNode, AssocSplatNode)]).returns(KeywordHashNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments - sig { returns(T::Boolean) } - def symbol_keys?; end - - # Returns the `elements` attribute. - sig { returns(T::Array[::T.any(AssocNode, AssocSplatNode)]) } - def elements; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a keyword rest parameter to a method, block, or lambda definition. - # - # def a(**b) - # ^^^ - # end - class KeywordRestParameterNode < Node - # Initialize a new KeywordRestParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(KeywordRestParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(::T.nilable(Symbol)) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(::T.nilable(Location)) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents using a lambda literal (not the lambda method call). - # - # ->(value) { value * 2 } - # ^^^^^^^^^^^^^^^^^^^^^^^ - class LambdaNode < Node - # Initialize a new LambdaNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode))).void } - def initialize(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: ::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode)), body: ::T.nilable(::T.any(StatementsNode, BeginNode))).returns(LambdaNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `parameters` attribute. - sig { returns(::T.nilable(::T.any(BlockParametersNode, NumberedParametersNode, ItParametersNode))) } - def parameters; end - - # Returns the `body` attribute. - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `&&=` operator for assignment to a local variable. - # - # target &&= value - # ^^^^^^^^^^^^^^^^ - class LocalVariableAndWriteNode < Node - # Initialize a new LocalVariableAndWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).void } - def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).returns(LocalVariableAndWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the `depth` attribute. - sig { returns(Integer) } - def depth; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents assigning to a local variable using an operator that isn't `=`. - # - # target += value - # ^^^^^^^^^^^^^^^ - class LocalVariableOperatorWriteNode < Node - # Initialize a new LocalVariableOperatorWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, binary_operator_loc: Location, value: Node, name: Symbol, binary_operator: Symbol, depth: Integer).void } - def initialize(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name_loc: Location, binary_operator_loc: Location, value: Node, name: Symbol, binary_operator: Symbol, depth: Integer).returns(LocalVariableOperatorWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `binary_operator_loc`. - sig { returns(Location) } - def binary_operator_loc; end - - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_binary_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the `binary_operator` attribute. - sig { returns(Symbol) } - def binary_operator; end - - # Returns the `depth` attribute. - sig { returns(Integer) } - def depth; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||=` operator for assignment to a local variable. - # - # target ||= value - # ^^^^^^^^^^^^^^^^ - class LocalVariableOrWriteNode < Node - # Initialize a new LocalVariableOrWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).void } - def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer).returns(LocalVariableOrWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the `depth` attribute. - sig { returns(Integer) } - def depth; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. - # - # foo - # ^^^ - class LocalVariableReadNode < Node - # Initialize a new LocalVariableReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).void } - def initialize(source, node_id, location, flags, name, depth); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).returns(LocalVariableReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # x # name `:x` - # - # _Test # name `:_Test` - # - # Note that this can also be an underscore followed by a number for the default block parameters. - # - # _1 # name `:_1` - sig { returns(Symbol) } - def name; end - - # The number of visible scopes that should be searched to find the origin of this local variable. - # - # foo = 1; foo # depth 0 - # - # bar = 2; tap { bar } # depth 1 - # - # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - sig { returns(Integer) } - def depth; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a local variable in a context that doesn't have an explicit value. - # - # foo, bar = baz - # ^^^ ^^^ - # - # foo => baz - # ^^^ - class LocalVariableTargetNode < Node - # Initialize a new LocalVariableTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).void } - def initialize(source, node_id, location, flags, name, depth); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer).returns(LocalVariableTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the `depth` attribute. - sig { returns(Integer) } - def depth; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing to a local variable. - # - # foo = 1 - # ^^^^^^^ - class LocalVariableWriteNode < Node - # Initialize a new LocalVariableWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, depth, name_loc, value, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location).returns(LocalVariableWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # foo = :bar # name `:foo` - # - # abc = 123 # name `:abc` - sig { returns(Symbol) } - def name; end - - # The number of semantic scopes we have to traverse to find the declaration of this variable. - # - # foo = 1 # depth 0 - # - # tap { foo = 1 } # depth 1 - # - # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - sig { returns(Integer) } - def depth; end - - # The Location of the variable name. - # - # foo = :bar - # ^^^ - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo = :bar - # ^^^^ - # - # abc = 1234 - # ^^^^ - # - # Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. - # - # foo = foo - sig { returns(Node) } - def value; end - - # The Location of the `=` operator. - # - # x = :y - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. - # - # if /foo/i then end - # ^^^^^^ - class MatchLastLineNode < Node - # Initialize a new MatchLastLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).void } - def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(MatchLastLineNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # i - ignores the case of characters when matching - sig { returns(T::Boolean) } - def ignore_case?; end - - # x - ignores whitespace and allows comments in regular expressions - sig { returns(T::Boolean) } - def extended?; end - - # m - allows $ to match the end of lines within strings - sig { returns(T::Boolean) } - def multi_line?; end - - # o - only interpolates values into the regular expression once - sig { returns(T::Boolean) } - def once?; end - - # e - forces the EUC-JP encoding - sig { returns(T::Boolean) } - def euc_jp?; end - - # n - forces the ASCII-8BIT encoding - sig { returns(T::Boolean) } - def ascii_8bit?; end - - # s - forces the Windows-31J encoding - sig { returns(T::Boolean) } - def windows_31j?; end - - # u - forces the UTF-8 encoding - sig { returns(T::Boolean) } - def utf_8?; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # internal bytes forced the encoding to US-ASCII - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `content_loc`. - sig { returns(Location) } - def content_loc; end - - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_content_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `unescaped` attribute. - sig { returns(String) } - def unescaped; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of content_loc from the source. - sig { returns(String) } - def content; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the modifier `in` operator. - # - # foo in bar - # ^^^^^^^^^^ - class MatchPredicateNode < Node - # Initialize a new MatchPredicateNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, value, pattern, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).returns(MatchPredicateNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Returns the `pattern` attribute. - sig { returns(Node) } - def pattern; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `=>` operator. - # - # foo => bar - # ^^^^^^^^^^ - class MatchRequiredNode < Node - # Initialize a new MatchRequiredNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, value, pattern, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, value: Node, pattern: Node, operator_loc: Location).returns(MatchRequiredNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the left-hand side of the operator. - # - # foo => bar - # ^^^ - sig { returns(Node) } - def value; end - - # Represents the right-hand side of the operator. The type of the node depends on the expression. - # - # Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`. - # - # foo => a # This is equivalent to writing `a = foo` - # ^ - # - # Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant. - # - # foo => [a] - # ^^^ - # - # foo => a, b - # ^^^^ - # - # foo => Bar[a, b] - # ^^^^^^^^^ - # - # If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead. - # - # foo => *, 1, *a - # ^^^^^ - # - # Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`. - # - # foo => { a: 1, b: } - # - # foo => Bar[a: 1, b:] - # - # foo => Bar[**] - # - # To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode` - # - # foo => ^a - # ^^ - # - # Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`. - # - # foo => ^(a + 1) - # - # Anything else will result in the regular node for that expression, for example a `ConstantReadNode`. - # - # foo => CONST - sig { returns(Node) } - def pattern; end - - # The Location of the operator. - # - # foo => bar - # ^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents writing local variables using a regular expression match with named capture groups. - # - # /(?bar)/ =~ baz - # ^^^^^^^^^^^^^^^^^^^^ - class MatchWriteNode < Node - # Initialize a new MatchWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, call: CallNode, targets: T::Array[LocalVariableTargetNode]).void } - def initialize(source, node_id, location, flags, call, targets); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, call: CallNode, targets: T::Array[LocalVariableTargetNode]).returns(MatchWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `call` attribute. - sig { returns(CallNode) } - def call; end - - # Returns the `targets` attribute. - sig { returns(T::Array[LocalVariableTargetNode]) } - def targets; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a node that is missing from the source and results in a syntax error. - class MissingNode < Node - # Initialize a new MissingNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(MissingNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a module declaration involving the `module` keyword. - # - # module Foo end - # ^^^^^^^^^^^^^^ - class ModuleNode < Node - # Initialize a new ModuleNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], module_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, MissingNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).void } - def initialize(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], module_keyword_loc: Location, constant_path: ::T.any(ConstantReadNode, ConstantPathNode, MissingNode), body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location, name: Symbol).returns(ModuleNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Returns the Location represented by `module_keyword_loc`. - sig { returns(Location) } - def module_keyword_loc; end - - # Save the module_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_module_keyword_loc(repository); end - - # Returns the `constant_path` attribute. - sig { returns(::T.any(ConstantReadNode, ConstantPathNode, MissingNode)) } - def constant_path; end - - # Returns the `body` attribute. - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Returns the Location represented by `end_keyword_loc`. - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Slice the location of module_keyword_loc from the source. - sig { returns(String) } - def module_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a multi-target expression. - # - # a, (b, c) = 1, 2, 3 - # ^^^^^^ - # - # This can be a part of `MultiWriteNode` as above, or the target of a `for` loop - # - # for a, b in [[1, 2], [3, 4]] - # ^^^^ - class MultiTargetNode < Node - # Initialize a new MultiTargetNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location)).returns(MultiTargetNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the targets expressions before a splat node. - # - # a, (b, c, *) = 1, 2, 3, 4, 5 - # ^^^^ - # - # The splat node can be absent, in that case all target expressions are in the left field. - # - # a, (b, c) = 1, 2, 3, 4, 5 - # ^^^^ - sig { returns(T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)]) } - def lefts; end - - # Represents a splat node in the target expression. - # - # a, (b, *c) = 1, 2, 3, 4 - # ^^ - # - # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - # - # a, (b, *) = 1, 2, 3, 4 - # ^ - # - # If the `*` is omitted, this field will contain an `ImplicitRestNode` - # - # a, (b,) = 1, 2, 3, 4 - # ^ - sig { returns(::T.nilable(::T.any(ImplicitRestNode, SplatNode))) } - def rest; end - - # Represents the targets expressions after a splat node. - # - # a, (*, b, c) = 1, 2, 3, 4, 5 - # ^^^^ - sig { returns(T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, RequiredParameterNode, BackReferenceReadNode, NumberedReferenceReadNode)]) } - def rights; end - - # The Location of the opening parenthesis. - # - # a, (b, c) = 1, 2, 3 - # ^ - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # The Location of the closing parenthesis. - # - # a, (b, c) = 1, 2, 3 - # ^ - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a write to a multi-target expression. - # - # a, b, c = 1, 2, 3 - # ^^^^^^^^^^^^^^^^^ - class MultiWriteNode < Node - # Initialize a new MultiWriteNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, lefts: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], rest: ::T.nilable(::T.any(ImplicitRestNode, SplatNode)), rights: T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)], lparen_loc: ::T.nilable(Location), rparen_loc: ::T.nilable(Location), operator_loc: Location, value: Node).returns(MultiWriteNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the targets expressions before a splat node. - # - # a, b, * = 1, 2, 3, 4, 5 - # ^^^^ - # - # The splat node can be absent, in that case all target expressions are in the left field. - # - # a, b, c = 1, 2, 3, 4, 5 - # ^^^^^^^ - sig { returns(T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)]) } - def lefts; end - - # Represents a splat node in the target expression. - # - # a, b, *c = 1, 2, 3, 4 - # ^^ - # - # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - # - # a, b, * = 1, 2, 3, 4 - # ^ - # - # If the `*` is omitted, this field will contain an `ImplicitRestNode` - # - # a, b, = 1, 2, 3, 4 - # ^ - sig { returns(::T.nilable(::T.any(ImplicitRestNode, SplatNode))) } - def rest; end - - # Represents the targets expressions after a splat node. - # - # a, *, b, c = 1, 2, 3, 4, 5 - # ^^^^ - sig { returns(T::Array[::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, MultiTargetNode, BackReferenceReadNode, NumberedReferenceReadNode)]) } - def rights; end - - # The Location of the opening parenthesis. - # - # (a, b, c) = 1, 2, 3 - # ^ - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # The Location of the closing parenthesis. - # - # (a, b, c) = 1, 2, 3 - # ^ - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # The Location of the operator. - # - # a, b, c = 1, 2, 3 - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # a, b, c = 1, 2, 3 - # ^^^^^^^ - sig { returns(Node) } - def value; end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `next` keyword. - # - # next 1 - # ^^^^^^ - class NextNode < Node - # Initialize a new NextNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).void } - def initialize(source, node_id, location, flags, arguments, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, arguments: ::T.nilable(ArgumentsNode), keyword_loc: Location).returns(NextNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `nil` keyword. - # - # nil - # ^^^ - class NilNode < Node - # Initialize a new NilNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(NilNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of `&nil` inside method arguments. - # - # def a(&nil) - # ^^^^ - # end - class NoBlockParameterNode < Node - # Initialize a new NoBlockParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).void } - def initialize(source, node_id, location, flags, operator_loc, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).returns(NoBlockParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of `**nil` inside method arguments. - # - # def a(**nil) - # ^^^^^ - # end - class NoKeywordsParameterNode < Node - # Initialize a new NoKeywordsParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).void } - def initialize(source, node_id, location, flags, operator_loc, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, operator_loc: Location, keyword_loc: Location).returns(NoKeywordsParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. - # - # -> { _1 + _2 } - # ^^^^^^^^^^^^^^ - class NumberedParametersNode < Node - # Initialize a new NumberedParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, maximum: Integer).void } - def initialize(source, node_id, location, flags, maximum); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, maximum: Integer).returns(NumberedParametersNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `maximum` attribute. - sig { returns(Integer) } - def maximum; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents reading a numbered reference to a capture in the previous match. - # - # $1 - # ^^ - class NumberedReferenceReadNode < Node - # Initialize a new NumberedReferenceReadNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, number: Integer).void } - def initialize(source, node_id, location, flags, number); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, number: Integer).returns(NumberedReferenceReadNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. - # - # $1 # number `1` - # - # $5432 # number `5432` - # - # $4294967296 # number `0` - sig { returns(Integer) } - def number; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an optional keyword parameter to a method, block, or lambda definition. - # - # def a(b: 1) - # ^^^^ - # end - class OptionalKeywordParameterNode < Node - # Initialize a new OptionalKeywordParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, value: Node).returns(OptionalKeywordParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an optional parameter to a method, block, or lambda definition. - # - # def a(b = 1) - # ^^^^^ - # end - class OptionalParameterNode < Node - # Initialize a new OptionalParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node).returns(OptionalParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `value` attribute. - sig { returns(Node) } - def value; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `||` operator or the `or` keyword. - # - # left or right - # ^^^^^^^^^^^^^ - class OrNode < Node - # Initialize a new OrNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).void } - def initialize(source, node_id, location, flags, left, right, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, left: Node, right: Node, operator_loc: Location).returns(OrNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # left or right - # ^^^^ - # - # 1 || 2 - # ^ - sig { returns(Node) } - def left; end - - # Represents the right side of the expression. - # - # left || right - # ^^^^^ - # - # 1 or 2 - # ^ - sig { returns(Node) } - def right; end - - # The Location of the `or` keyword or the `||` operator. - # - # left or right - # ^^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the list of parameters on a method, block, or lambda definition. - # - # def a(b, c, d) - # ^^^^^^^ - # end - class ParametersNode < Node - # Initialize a new ParametersNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, requireds: T::Array[::T.any(RequiredParameterNode, MultiTargetNode)], optionals: T::Array[OptionalParameterNode], rest: ::T.nilable(::T.any(RestParameterNode, ImplicitRestNode)), posts: T::Array[::T.any(RequiredParameterNode, MultiTargetNode, KeywordRestParameterNode, NoKeywordsParameterNode, ForwardingParameterNode, BlockParameterNode, NoBlockParameterNode)], keywords: T::Array[::T.any(RequiredKeywordParameterNode, OptionalKeywordParameterNode)], keyword_rest: ::T.nilable(::T.any(KeywordRestParameterNode, ForwardingParameterNode, NoKeywordsParameterNode)), block: ::T.nilable(::T.any(BlockParameterNode, NoBlockParameterNode))).void } - def initialize(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, requireds: T::Array[::T.any(RequiredParameterNode, MultiTargetNode)], optionals: T::Array[OptionalParameterNode], rest: ::T.nilable(::T.any(RestParameterNode, ImplicitRestNode)), posts: T::Array[::T.any(RequiredParameterNode, MultiTargetNode, KeywordRestParameterNode, NoKeywordsParameterNode, ForwardingParameterNode, BlockParameterNode, NoBlockParameterNode)], keywords: T::Array[::T.any(RequiredKeywordParameterNode, OptionalKeywordParameterNode)], keyword_rest: ::T.nilable(::T.any(KeywordRestParameterNode, ForwardingParameterNode, NoKeywordsParameterNode)), block: ::T.nilable(::T.any(BlockParameterNode, NoBlockParameterNode))).returns(ParametersNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), 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 { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `requireds` attribute. - sig { returns(T::Array[::T.any(RequiredParameterNode, MultiTargetNode)]) } - def requireds; end - - # Returns the `optionals` attribute. - sig { returns(T::Array[OptionalParameterNode]) } - def optionals; end - - # Returns the `rest` attribute. - sig { returns(::T.nilable(::T.any(RestParameterNode, ImplicitRestNode))) } - def rest; end - - # Returns the `posts` attribute. - sig { returns(T::Array[::T.any(RequiredParameterNode, MultiTargetNode, KeywordRestParameterNode, NoKeywordsParameterNode, ForwardingParameterNode, BlockParameterNode, NoBlockParameterNode)]) } - def posts; end - - # Returns the `keywords` attribute. - sig { returns(T::Array[::T.any(RequiredKeywordParameterNode, OptionalKeywordParameterNode)]) } - def keywords; end - - # Returns the `keyword_rest` attribute. - sig { returns(::T.nilable(::T.any(KeywordRestParameterNode, ForwardingParameterNode, NoKeywordsParameterNode))) } - def keyword_rest; end - - # Returns the `block` attribute. - sig { returns(::T.nilable(::T.any(BlockParameterNode, NoBlockParameterNode))) } - def block; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a parenthesized expression - # - # (10 + 34) - # ^^^^^^^^^ - class ParenthesesNode < Node - # Initialize a new ParenthesesNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, body: ::T.nilable(Node), opening_loc: Location, closing_loc: Location).void } - def initialize(source, node_id, location, flags, body, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, body: ::T.nilable(Node), opening_loc: Location, closing_loc: Location).returns(ParenthesesNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # parentheses that contain multiple potentially void statements - sig { returns(T::Boolean) } - def multiple_statements?; end - - # Returns the `body` attribute. - sig { returns(::T.nilable(Node)) } - def body; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `^` operator for pinning an expression in a pattern matching expression. - # - # foo in ^(bar) - # ^^^^^^ - class PinnedExpressionNode < Node - # Initialize a new PinnedExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location).void } - def initialize(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location).returns(PinnedExpressionNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The expression used in the pinned expression - # - # foo in ^(bar) - # ^^^ - sig { returns(Node) } - def expression; end - - # The Location of the `^` operator - # - # foo in ^(bar) - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # The Location of the opening parenthesis. - # - # foo in ^(bar) - # ^ - sig { returns(Location) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_lparen_loc(repository); end - - # The Location of the closing parenthesis. - # - # foo in ^(bar) - # ^ - sig { returns(Location) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_rparen_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - # Slice the location of lparen_loc from the source. - sig { returns(String) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(String) } - def rparen; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `^` operator for pinning a variable in a pattern matching expression. - # - # foo in ^bar - # ^^^^ - class PinnedVariableNode < Node - # Initialize a new PinnedVariableNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, variable: ::T.any(LocalVariableReadNode, InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, ItLocalVariableReadNode, MissingNode), operator_loc: Location).void } - def initialize(source, node_id, location, flags, variable, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, variable: ::T.any(LocalVariableReadNode, InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, ItLocalVariableReadNode, MissingNode), operator_loc: Location).returns(PinnedVariableNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The variable used in the pinned expression - # - # foo in ^bar - # ^^^ - sig { returns(::T.any(LocalVariableReadNode, InstanceVariableReadNode, ClassVariableReadNode, GlobalVariableReadNode, BackReferenceReadNode, NumberedReferenceReadNode, ItLocalVariableReadNode, MissingNode)) } - def variable; end - - # The Location of the `^` operator - # - # foo in ^bar - # ^ - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `END` keyword. - # - # END { foo } - # ^^^^^^^^^^^ - class PostExecutionNode < Node - # Initialize a new PostExecutionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).void } - def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).returns(PostExecutionNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `BEGIN` keyword. - # - # BEGIN { foo } - # ^^^^^^^^^^^^^ - class PreExecutionNode < Node - # Initialize a new PreExecutionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).void } - def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, statements: ::T.nilable(StatementsNode), keyword_loc: Location, opening_loc: Location, closing_loc: Location).returns(PreExecutionNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # The top level node of any parse tree. - class ProgramNode < Node - # Initialize a new ProgramNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], statements: StatementsNode).void } - def initialize(source, node_id, location, flags, locals, statements); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], statements: StatementsNode).returns(ProgramNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Returns the `statements` attribute. - sig { returns(StatementsNode) } - def statements; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `..` or `...` operators. - # - # 1..2 - # ^^^^ - # - # c if a =~ /left/ ... b =~ /right/ - # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - class RangeNode < Node - # Initialize a new RangeNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).void } - def initialize(source, node_id, location, flags, left, right, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, left: ::T.nilable(Node), right: ::T.nilable(Node), operator_loc: Location).returns(RangeNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # ... operator - sig { returns(T::Boolean) } - def exclude_end?; end - - # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # 1... - # ^ - # - # hello...goodbye - # ^^^^^ - sig { returns(::T.nilable(Node)) } - def left; end - - # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # ..5 - # ^ - # - # 1...foo - # ^^^ - # If neither right-hand or left-hand side was included, this will be a MissingNode. - sig { returns(::T.nilable(Node)) } - def right; end - - # The Location of the `..` or `...` operator. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a rational number literal. - # - # 1.0r - # ^^^^ - class RationalNode < Node - # Initialize a new RationalNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, numerator: Integer, denominator: Integer).void } - def initialize(source, node_id, location, flags, numerator, denominator); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, numerator: Integer, denominator: Integer).returns(RationalNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # 0b prefix - sig { returns(T::Boolean) } - def binary?; end - - # 0d or no prefix - sig { returns(T::Boolean) } - def decimal?; end - - # 0o or 0 prefix - sig { returns(T::Boolean) } - def octal?; end - - # 0x prefix - sig { returns(T::Boolean) } - def hexadecimal?; end - - # The numerator of the rational number. - # - # 1.5r # numerator 3 - sig { returns(Integer) } - def numerator; end - - # The denominator of the rational number. - # - # 1.5r # denominator 2 - sig { returns(Integer) } - def denominator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `redo` keyword. - # - # redo - # ^^^^ - class RedoNode < Node - # Initialize a new RedoNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(RedoNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a regular expression literal with no interpolation. - # - # /foo/i - # ^^^^^^ - class RegularExpressionNode < Node - # Initialize a new RegularExpressionNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).void } - def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(RegularExpressionNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # i - ignores the case of characters when matching - sig { returns(T::Boolean) } - def ignore_case?; end - - # x - ignores whitespace and allows comments in regular expressions - sig { returns(T::Boolean) } - def extended?; end - - # m - allows $ to match the end of lines within strings - sig { returns(T::Boolean) } - def multi_line?; end - - # o - only interpolates values into the regular expression once - sig { returns(T::Boolean) } - def once?; end - - # e - forces the EUC-JP encoding - sig { returns(T::Boolean) } - def euc_jp?; end - - # n - forces the ASCII-8BIT encoding - sig { returns(T::Boolean) } - def ascii_8bit?; end - - # s - forces the Windows-31J encoding - sig { returns(T::Boolean) } - def windows_31j?; end - - # u - forces the UTF-8 encoding - sig { returns(T::Boolean) } - def utf_8?; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # internal bytes forced the encoding to US-ASCII - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `content_loc`. - sig { returns(Location) } - def content_loc; end - - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_content_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `unescaped` attribute. - sig { returns(String) } - def unescaped; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of content_loc from the source. - sig { returns(String) } - def content; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a required keyword parameter to a method, block, or lambda definition. - # - # def a(b: ) - # ^^ - # end - class RequiredKeywordParameterNode < Node - # Initialize a new RequiredKeywordParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol, name_loc: Location).returns(RequiredKeywordParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(Location) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_name_loc(repository); end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a required parameter to a method, block, or lambda definition. - # - # def a(b) - # ^ - # end - class RequiredParameterNode < Node - # Initialize a new RequiredParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: Symbol).void } - def initialize(source, node_id, location, flags, name); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: Symbol).returns(RequiredParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(Symbol) } - def name; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an expression modified with a rescue. - # - # foo rescue nil - # ^^^^^^^^^^^^^^ - class RescueModifierNode < Node - # Initialize a new RescueModifierNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, expression: Node, keyword_loc: Location, rescue_expression: Node).void } - def initialize(source, node_id, location, flags, expression, keyword_loc, rescue_expression); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, expression: Node, keyword_loc: Location, rescue_expression: Node).returns(RescueModifierNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `expression` attribute. - sig { returns(Node) } - def expression; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the `rescue_expression` attribute. - sig { returns(Node) } - def rescue_expression; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a rescue statement. - # - # begin - # rescue Foo, *splat, Bar => ex - # foo - # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - # end - # - # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field. - class RescueNode < Node - # Initialize a new RescueNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, exceptions: T::Array[Node], operator_loc: ::T.nilable(Location), reference: ::T.nilable(::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode)), then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(RescueNode)).void } - def initialize(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, then_keyword_loc, statements, subsequent); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, exceptions: T::Array[Node], operator_loc: ::T.nilable(Location), reference: ::T.nilable(::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode)), then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), subsequent: ::T.nilable(RescueNode)).returns(RescueNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the `exceptions` attribute. - sig { returns(T::Array[Node]) } - def exceptions; end - - # Returns the Location represented by `operator_loc`. - sig { returns(::T.nilable(Location)) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_operator_loc(repository); end - - # Returns the `reference` attribute. - sig { returns(::T.nilable(::T.any(LocalVariableTargetNode, InstanceVariableTargetNode, ClassVariableTargetNode, GlobalVariableTargetNode, ConstantTargetNode, ConstantPathTargetNode, CallTargetNode, IndexTargetNode, BackReferenceReadNode, NumberedReferenceReadNode, MissingNode))) } - def reference; end - - # Returns the Location represented by `then_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def then_keyword_loc; end - - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_then_keyword_loc(repository); end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Returns the `subsequent` attribute. - sig { returns(::T.nilable(RescueNode)) } - def subsequent; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of operator_loc from the source. - sig { returns(::T.nilable(String)) } - def operator; end - - # Slice the location of then_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def then_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a rest parameter to a method, block, or lambda definition. - # - # def a(*b) - # ^^ - # end - class RestParameterNode < Node - # Initialize a new RestParameterNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).void } - def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, name: ::T.nilable(Symbol), name_loc: ::T.nilable(Location), operator_loc: Location).returns(RestParameterNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a parameter name that has been repeated in the method signature - sig { returns(T::Boolean) } - def repeated_parameter?; end - - # Returns the `name` attribute. - sig { returns(::T.nilable(Symbol)) } - def name; end - - # Returns the Location represented by `name_loc`. - sig { returns(::T.nilable(Location)) } - def name_loc; end - - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_name_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `retry` keyword. - # - # retry - # ^^^^^ - class RetryNode < Node - # Initialize a new RetryNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(RetryNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `return` keyword. - # - # return 1 - # ^^^^^^^^ - class ReturnNode < Node - # Initialize a new ReturnNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, arguments: ::T.nilable(ArgumentsNode)).void } - def initialize(source, node_id, location, flags, keyword_loc, arguments); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, arguments: ::T.nilable(ArgumentsNode)).returns(ReturnNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the `self` keyword. - # - # self - # ^^^^ - class SelfNode < Node - # Initialize a new SelfNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(SelfNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified. - # - # # shareable_constant_value: literal - # C = { a: 1 } - # ^^^^^^^^^^^^ - class ShareableConstantNode < Node - # Initialize a new ShareableConstantNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, write: ::T.any(ConstantWriteNode, ConstantAndWriteNode, ConstantOrWriteNode, ConstantOperatorWriteNode, ConstantPathWriteNode, ConstantPathAndWriteNode, ConstantPathOrWriteNode, ConstantPathOperatorWriteNode)).void } - def initialize(source, node_id, location, flags, write); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, write: ::T.any(ConstantWriteNode, ConstantAndWriteNode, ConstantOrWriteNode, ConstantOperatorWriteNode, ConstantPathWriteNode, ConstantPathAndWriteNode, ConstantPathOrWriteNode, ConstantPathOperatorWriteNode)).returns(ShareableConstantNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # constant writes that should be modified with shareable constant value literal - sig { returns(T::Boolean) } - def literal?; end - - # constant writes that should be modified with shareable constant value experimental everything - sig { returns(T::Boolean) } - def experimental_everything?; end - - # constant writes that should be modified with shareable constant value experimental copy - sig { returns(T::Boolean) } - def experimental_copy?; end - - # The constant write that should be modified with the shareability state. - sig { returns(::T.any(ConstantWriteNode, ConstantAndWriteNode, ConstantOrWriteNode, ConstantOperatorWriteNode, ConstantPathWriteNode, ConstantPathAndWriteNode, ConstantPathOrWriteNode, ConstantPathOperatorWriteNode)) } - def write; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a singleton class declaration involving the `class` keyword. - # - # class << self end - # ^^^^^^^^^^^^^^^^^ - class SingletonClassNode < Node - # Initialize a new SingletonClassNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Node, body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location).void } - def initialize(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, locals: T::Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Node, body: ::T.nilable(::T.any(StatementsNode, BeginNode)), end_keyword_loc: Location).returns(SingletonClassNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `locals` attribute. - sig { returns(T::Array[Symbol]) } - def locals; end - - # Returns the Location represented by `class_keyword_loc`. - sig { returns(Location) } - def class_keyword_loc; end - - # Save the class_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_class_keyword_loc(repository); end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `expression` attribute. - sig { returns(Node) } - def expression; end - - # Returns the `body` attribute. - sig { returns(::T.nilable(::T.any(StatementsNode, BeginNode))) } - def body; end - - # Returns the Location represented by `end_keyword_loc`. - sig { returns(Location) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_end_keyword_loc(repository); end - - # Slice the location of class_keyword_loc from the source. - sig { returns(String) } - def class_keyword; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(String) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `__ENCODING__` keyword. - # - # __ENCODING__ - # ^^^^^^^^^^^^ - class SourceEncodingNode < Node - # Initialize a new SourceEncodingNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(SourceEncodingNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `__FILE__` keyword. - # - # __FILE__ - # ^^^^^^^^ - class SourceFileNode < Node - # Initialize a new SourceFileNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, filepath: String).void } - def initialize(source, node_id, location, flags, filepath); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, filepath: String).returns(SourceFileNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - sig { returns(T::Boolean) } - def frozen?; end - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - sig { returns(T::Boolean) } - def mutable?; end - - # Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism.parse*` APIs. - sig { returns(String) } - def filepath; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `__LINE__` keyword. - # - # __LINE__ - # ^^^^^^^^ - class SourceLineNode < Node - # Initialize a new SourceLineNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(SourceLineNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the splat operator. - # - # [*a] - # ^^ - class SplatNode < Node - # Initialize a new SplatNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, operator_loc: Location, expression: ::T.nilable(Node)).void } - def initialize(source, node_id, location, flags, operator_loc, expression); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, operator_loc: Location, expression: ::T.nilable(Node)).returns(SplatNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `operator_loc`. - sig { returns(Location) } - def operator_loc; end - - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_operator_loc(repository); end - - # Returns the `expression` attribute. - sig { returns(::T.nilable(Node)) } - def expression; end - - # Slice the location of operator_loc from the source. - sig { returns(String) } - def operator; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a set of statements contained within some scope. - # - # foo; bar; baz - # ^^^^^^^^^^^^^ - class StatementsNode < Node - # Initialize a new StatementsNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, body: T::Array[Node]).void } - def initialize(source, node_id, location, flags, body); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, body: T::Array[Node]).returns(StatementsNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `body` attribute. - sig { returns(T::Array[Node]) } - def body; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. - # - # "foo" - # ^^^^^ - # - # %w[foo] - # ^^^ - # - # "foo #{bar} baz" - # ^^^^ ^^^^ - class StringNode < Node - # Initialize a new StringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), content_loc: Location, closing_loc: ::T.nilable(Location), unescaped: String).void } - def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), content_loc: Location, closing_loc: ::T.nilable(Location), unescaped: String).returns(StringNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - sig { returns(T::Boolean) } - def frozen?; end - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - sig { returns(T::Boolean) } - def mutable?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Returns the Location represented by `content_loc`. - sig { returns(Location) } - def content_loc; end - - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_content_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Returns the `unescaped` attribute. - sig { returns(String) } - def unescaped; end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of content_loc from the source. - sig { returns(String) } - def content; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `super` keyword with parentheses or arguments. - # - # super() - # ^^^^^^^ - # - # super foo, bar - # ^^^^^^^^^^^^^^ - # - # If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead. - class SuperNode < Node - # Initialize a new SuperNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).void } - def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location), block: ::T.nilable(::T.any(BlockNode, BlockArgumentNode))).returns(SuperNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `lparen_loc`. - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # Can be only `nil` when there are empty parentheses, like `super()`. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `rparen_loc`. - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # Returns the `block` attribute. - sig { returns(::T.nilable(::T.any(BlockNode, BlockArgumentNode))) } - def block; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents a symbol literal or a symbol contained within a `%i` list. - # - # :foo - # ^^^^ - # - # %i[foo] - # ^^^ - class SymbolNode < Node - # Initialize a new SymbolNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), value_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), unescaped: String).void } - def initialize(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: ::T.nilable(Location), value_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), unescaped: String).returns(SymbolNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # internal bytes forced the encoding to US-ASCII - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(::T.nilable(Location)) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_opening_loc(repository); end - - # Returns the Location represented by `value_loc`. - sig { returns(::T.nilable(Location)) } - def value_loc; end - - # Save the value_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_value_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Returns the `unescaped` attribute. - sig { returns(String) } - def unescaped; end - - # Slice the location of opening_loc from the source. - sig { returns(::T.nilable(String)) } - def opening; end - - # Slice the location of value_loc from the source. - sig { returns(::T.nilable(String)) } - def value; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the literal `true` keyword. - # - # true - # ^^^^ - class TrueNode < Node - # Initialize a new TrueNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer).void } - def initialize(source, node_id, location, flags); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer).returns(TrueNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `undef` keyword. - # - # undef :foo, :bar, :baz - # ^^^^^^^^^^^^^^^^^^^^^^ - class UndefNode < Node - # Initialize a new UndefNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, names: T::Array[::T.any(SymbolNode, InterpolatedSymbolNode)], keyword_loc: Location).void } - def initialize(source, node_id, location, flags, names, keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, names: T::Array[::T.any(SymbolNode, InterpolatedSymbolNode)], keyword_loc: Location).returns(UndefNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the `names` attribute. - sig { returns(T::Array[::T.any(SymbolNode, InterpolatedSymbolNode)]) } - def names; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `unless` keyword, either in the block form or the modifier form. - # - # bar unless foo - # ^^^^^^^^^^^^^^ - # - # unless foo then bar end - # ^^^^^^^^^^^^^^^^^^^^^^^ - class UnlessNode < Node - # Initialize a new UnlessNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), else_clause: ::T.nilable(ElseNode), end_keyword_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, predicate: Node, then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode), else_clause: ::T.nilable(ElseNode), end_keyword_loc: ::T.nilable(Location)).returns(UnlessNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # The Location of the `unless` keyword. - # - # unless cond then bar end - # ^^^^^^ - # - # bar unless cond - # ^^^^^^ - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # unless cond then bar end - # ^^^^ - # - # bar unless cond - # ^^^^ - sig { returns(Node) } - def predicate; end - - # The Location of the `then` keyword, if present. - # - # unless cond then bar end - # ^^^^ - sig { returns(::T.nilable(Location)) } - def then_keyword_loc; end - - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_then_keyword_loc(repository); end - - # The body of statements that will executed if the unless condition is - # falsey. Will be `nil` if no body is provided. - # - # unless cond then bar end - # ^^^ - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # The else clause of the unless expression, if present. - # - # unless cond then bar else baz end - # ^^^^^^^^^^^^ - sig { returns(::T.nilable(ElseNode)) } - def else_clause; end - - # The Location of the `end` keyword, if present. - # - # unless cond then bar end - # ^^^ - sig { returns(::T.nilable(Location)) } - def end_keyword_loc; end - - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_end_keyword_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of then_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def then_keyword; end - - # Slice the location of end_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def end_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `until` keyword, either in the block form or the modifier form. - # - # bar until foo - # ^^^^^^^^^^^^^ - # - # until foo do bar end - # ^^^^^^^^^^^^^^^^^^^^ - class UntilNode < Node - # Initialize a new UntilNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).void } - def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).returns(UntilNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a loop after a begin statement, so the body is executed first before the condition - sig { returns(T::Boolean) } - def begin_modifier?; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `do_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def do_keyword_loc; end - - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_do_keyword_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Returns the `predicate` attribute. - sig { returns(Node) } - def predicate; end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of do_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def do_keyword; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `when` keyword within a case statement. - # - # case true - # when true - # ^^^^^^^^^ - # end - class WhenNode < Node - # Initialize a new WhenNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, conditions: T::Array[Node], then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode)).void } - def initialize(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, conditions: T::Array[Node], then_keyword_loc: ::T.nilable(Location), statements: ::T.nilable(StatementsNode)).returns(WhenNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the `conditions` attribute. - sig { returns(T::Array[Node]) } - def conditions; end - - # Returns the Location represented by `then_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def then_keyword_loc; end - - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_then_keyword_loc(repository); end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of then_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def then_keyword; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `while` keyword, either in the block form or the modifier form. - # - # bar while foo - # ^^^^^^^^^^^^^ - # - # while foo do bar end - # ^^^^^^^^^^^^^^^^^^^^ - class WhileNode < Node - # Initialize a new WhileNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).void } - def initialize(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, do_keyword_loc: ::T.nilable(Location), closing_loc: ::T.nilable(Location), predicate: Node, statements: ::T.nilable(StatementsNode)).returns(WhileNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # a loop after a begin statement, so the body is executed first before the condition - sig { returns(T::Boolean) } - def begin_modifier?; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `do_keyword_loc`. - sig { returns(::T.nilable(Location)) } - def do_keyword_loc; end - - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_do_keyword_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(::T.nilable(Location)) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_closing_loc(repository); end - - # Returns the `predicate` attribute. - sig { returns(Node) } - def predicate; end - - # Returns the `statements` attribute. - sig { returns(::T.nilable(StatementsNode)) } - def statements; end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of do_keyword_loc from the source. - sig { returns(::T.nilable(String)) } - def do_keyword; end - - # Slice the location of closing_loc from the source. - sig { returns(::T.nilable(String)) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents an xstring literal with no interpolation. - # - # `foo` - # ^^^^^ - class XStringNode < Node - # Initialize a new XStringNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).void } - def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String).returns(XStringNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # internal bytes forced the encoding to UTF-8 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # internal bytes forced the encoding to binary - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # Returns the Location represented by `opening_loc`. - sig { returns(Location) } - def opening_loc; end - - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_opening_loc(repository); end - - # Returns the Location represented by `content_loc`. - sig { returns(Location) } - def content_loc; end - - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_content_loc(repository); end - - # Returns the Location represented by `closing_loc`. - sig { returns(Location) } - def closing_loc; end - - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_closing_loc(repository); end - - # Returns the `unescaped` attribute. - sig { returns(String) } - def unescaped; end - - # Slice the location of opening_loc from the source. - sig { returns(String) } - def opening; end - - # Slice the location of content_loc from the source. - sig { returns(String) } - def content; end - - # Slice the location of closing_loc from the source. - sig { returns(String) } - def closing; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Represents the use of the `yield` keyword. - # - # yield 1 - # ^^^^^^^ - class YieldNode < Node - # Initialize a new YieldNode node. - sig { params(source: Source, node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location)).void } - def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc); end - - # See Node.accept. - sig { override.params(visitor: Visitor).returns(::T.untyped) } - def accept(visitor); end - - # See Node.child_nodes. - sig { override.returns(T::Array[::T.nilable(Node)]) } - def child_nodes; end - - # See Node.each_child_node. - sig { override.returns(T::Enumerator[Node]) } - sig { override.params(blk: ::T.proc.params(arg0: Node).void).void } - def each_child_node(&blk); end - - # See Node.compact_child_nodes. - sig { override.returns(T::Array[Node]) } - def compact_child_nodes; end - - # See Node.comment_targets. - sig { override.returns(T::Array[::T.any(Node, Location)]) } - def comment_targets; end - - # Creates a copy of self with the given fields, using self as the template. - sig { params(node_id: Integer, location: Location, flags: Integer, keyword_loc: Location, lparen_loc: ::T.nilable(Location), arguments: ::T.nilable(ArgumentsNode), rparen_loc: ::T.nilable(Location)).returns(YieldNode) } - def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end - - sig { override.returns(T::Array[::T.nilable(Node)]) } - def deconstruct; end - - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # See `Node#type`. - sig { override.returns(Symbol) } - def type; end - - # See `Node.type`. - sig { override.returns(Symbol) } - def self.type; end - - sig { override.returns(String) } - def inspect; end - - # Returns the Location represented by `keyword_loc`. - sig { returns(Location) } - def keyword_loc; end - - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(Relocation::Entry) } - def save_keyword_loc(repository); end - - # Returns the Location represented by `lparen_loc`. - sig { returns(::T.nilable(Location)) } - def lparen_loc; end - - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_lparen_loc(repository); end - - # Returns the `arguments` attribute. - sig { returns(::T.nilable(ArgumentsNode)) } - def arguments; end - - # Returns the Location represented by `rparen_loc`. - sig { returns(::T.nilable(Location)) } - def rparen_loc; end - - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - sig { params(repository: ::T.untyped).returns(::T.nilable(Relocation::Entry)) } - def save_rparen_loc(repository); end - - # Slice the location of keyword_loc from the source. - sig { returns(String) } - def keyword; end - - # Slice the location of lparen_loc from the source. - sig { returns(::T.nilable(String)) } - def lparen; end - - # Slice the location of rparen_loc from the source. - sig { returns(::T.nilable(String)) } - def rparen; end - - sig { params(other: ::T.untyped).returns(::T.nilable(T::Boolean)) } - def ===(other); end - end - - # Flags for arguments nodes. - module ArgumentsNodeFlags - # if the arguments contain forwarding - CONTAINS_FORWARDING = T.let(nil, ::T.untyped) - - # if the arguments contain keywords - CONTAINS_KEYWORDS = T.let(nil, ::T.untyped) - - # if the arguments contain a keyword splat - CONTAINS_KEYWORD_SPLAT = T.let(nil, ::T.untyped) - - # if the arguments contain a splat - CONTAINS_SPLAT = T.let(nil, ::T.untyped) - - # if the arguments contain multiple splats - CONTAINS_MULTIPLE_SPLATS = T.let(nil, ::T.untyped) - end - - # Flags for array nodes. - module ArrayNodeFlags - # if array contains splat nodes - CONTAINS_SPLAT = T.let(nil, ::T.untyped) - end - - # Flags for call nodes. - module CallNodeFlags - # &. operator - SAFE_NAVIGATION = T.let(nil, ::T.untyped) - - # a call that could have been a local variable - VARIABLE_CALL = T.let(nil, ::T.untyped) - - # a call that is an attribute write, so the value being written should be returned - ATTRIBUTE_WRITE = T.let(nil, ::T.untyped) - - # a call that ignores method visibility - IGNORE_VISIBILITY = T.let(nil, ::T.untyped) - end - - # Flags for nodes that have unescaped content. - module EncodingFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING = T.let(nil, ::T.untyped) - end - - # Flags for integer nodes that correspond to the base of the integer. - module IntegerBaseFlags - # 0b prefix - BINARY = T.let(nil, ::T.untyped) - - # 0d or no prefix - DECIMAL = T.let(nil, ::T.untyped) - - # 0o or 0 prefix - OCTAL = T.let(nil, ::T.untyped) - - # 0x prefix - HEXADECIMAL = T.let(nil, ::T.untyped) - end - - # Flags for interpolated string nodes that indicated mutability if they are also marked as literals. - module InterpolatedStringNodeFlags - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - FROZEN = T.let(nil, ::T.untyped) - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - MUTABLE = T.let(nil, ::T.untyped) - end - - # Flags for keyword hash nodes. - module KeywordHashNodeFlags - # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments - SYMBOL_KEYS = T.let(nil, ::T.untyped) - end - - # Flags for while and until loop nodes. - module LoopFlags - # a loop after a begin statement, so the body is executed first before the condition - BEGIN_MODIFIER = T.let(nil, ::T.untyped) - end - - # Flags for parameter nodes. - module ParameterFlags - # a parameter name that has been repeated in the method signature - REPEATED_PARAMETER = T.let(nil, ::T.untyped) - end - - # Flags for parentheses nodes. - module ParenthesesNodeFlags - # parentheses that contain multiple potentially void statements - MULTIPLE_STATEMENTS = T.let(nil, ::T.untyped) - end - - # Flags for range and flip-flop nodes. - module RangeFlags - # ... operator - EXCLUDE_END = T.let(nil, ::T.untyped) - end - - # Flags for regular expression and match last line nodes. - module RegularExpressionFlags - # i - ignores the case of characters when matching - IGNORE_CASE = T.let(nil, ::T.untyped) - - # x - ignores whitespace and allows comments in regular expressions - EXTENDED = T.let(nil, ::T.untyped) - - # m - allows $ to match the end of lines within strings - MULTI_LINE = T.let(nil, ::T.untyped) - - # o - only interpolates values into the regular expression once - ONCE = T.let(nil, ::T.untyped) - - # e - forces the EUC-JP encoding - EUC_JP = T.let(nil, ::T.untyped) - - # n - forces the ASCII-8BIT encoding - ASCII_8BIT = T.let(nil, ::T.untyped) - - # s - forces the Windows-31J encoding - WINDOWS_31J = T.let(nil, ::T.untyped) - - # u - forces the UTF-8 encoding - UTF_8 = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to US-ASCII - FORCED_US_ASCII_ENCODING = T.let(nil, ::T.untyped) - end - - # Flags for shareable constant nodes. - module ShareableConstantNodeFlags - # constant writes that should be modified with shareable constant value literal - LITERAL = T.let(nil, ::T.untyped) - - # constant writes that should be modified with shareable constant value experimental everything - EXPERIMENTAL_EVERYTHING = T.let(nil, ::T.untyped) - - # constant writes that should be modified with shareable constant value experimental copy - EXPERIMENTAL_COPY = T.let(nil, ::T.untyped) - end - - # Flags for string nodes. - module StringFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING = T.let(nil, ::T.untyped) - - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - FROZEN = T.let(nil, ::T.untyped) - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - MUTABLE = T.let(nil, ::T.untyped) - end - - # Flags for symbol nodes. - module SymbolFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING = T.let(nil, ::T.untyped) - - # internal bytes forced the encoding to US-ASCII - FORCED_US_ASCII_ENCODING = T.let(nil, ::T.untyped) - end - - # The flags that are common to all nodes. - module NodeFlags - # A flag to indicate that the node is a candidate to emit a :line event - # through tracepoint when compiled. - NEWLINE = T.let(nil, Integer) - - # A flag to indicate that the value that the node represents is a value that - # can be determined at parse-time. - STATIC_LITERAL = T.let(nil, Integer) - end -end diff --git a/rbi/generated/prism/node_ext.rbi b/rbi/generated/prism/node_ext.rbi deleted file mode 100644 index 25255d073b..0000000000 --- a/rbi/generated/prism/node_ext.rbi +++ /dev/null @@ -1,333 +0,0 @@ -# typed: true - -module Prism - class Node - abstract! - - sig { params(replacements: String).void } - def deprecated(*replacements); end - end - - module RegularExpressionOptions - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - sig { params(flags: Integer).returns(Integer) } - def self.options(flags); end - end - - class InterpolatedMatchLastLineNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - sig { returns(Integer) } - def options; end - end - - class InterpolatedRegularExpressionNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - sig { returns(Integer) } - def options; end - end - - class MatchLastLineNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - sig { returns(Integer) } - def options; end - end - - class RegularExpressionNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - sig { returns(Integer) } - def options; end - end - - module HeredocQuery - # Returns true if this node was represented as a heredoc in the source code. - sig { params(opening: ::T.nilable(String)).returns(::T.nilable(T::Boolean)) } - def self.heredoc?(opening); end - end - - class InterpolatedStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - sig { returns(::T.nilable(T::Boolean)) } - def heredoc?; end - end - - class InterpolatedXStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - sig { returns(::T.nilable(T::Boolean)) } - def heredoc?; end - end - - class StringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - sig { returns(::T.nilable(T::Boolean)) } - def heredoc?; end - - # Occasionally it's helpful to treat a string as if it were interpolated so - # that there's a consistent interface for working with strings. - sig { returns(InterpolatedStringNode) } - def to_interpolated; end - end - - class XStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - sig { returns(::T.nilable(T::Boolean)) } - def heredoc?; end - - # Occasionally it's helpful to treat a string as if it were interpolated so - # that there's a consistent interface for working with strings. - sig { returns(InterpolatedXStringNode) } - def to_interpolated; end - end - - class ImaginaryNode < Node - # Returns the value of the node as a Ruby Complex. - sig { returns(Complex) } - def value; end - end - - class RationalNode < Node - # Returns the value of the node as a Ruby Rational. - sig { returns(Rational) } - def value; end - - # Returns the value of the node as an IntegerNode or a FloatNode. This - # method is deprecated in favor of #value or #numerator/#denominator. - sig { returns(::T.any(IntegerNode, FloatNode)) } - def numeric; end - end - - class ConstantReadNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - sig { returns(T::Array[Symbol]) } - def full_name_parts; end - - # Returns the full name of this constant. For example: "Foo" - sig { returns(String) } - def full_name; end - end - - class ConstantWriteNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - sig { returns(T::Array[Symbol]) } - def full_name_parts; end - - # Returns the full name of this constant. For example: "Foo" - sig { returns(String) } - def full_name; end - end - - class ConstantPathNode < Node - # An error class raised when dynamic parts are found while computing a - # constant path's full name. For example: - # Foo::Bar::Baz -> does not raise because all parts of the constant path are - # simple constants - # var::Bar::Baz -> raises because the first part of the constant path is a - # local variable - class DynamicPartsInConstantPathError < StandardError; end - - # An error class raised when missing nodes are found while computing a - # constant path's full name. For example: - # Foo:: -> raises because the constant path is missing the last part - class MissingNodesInConstantPathError < StandardError; end - - # Returns the list of parts for the full name of this constant path. - # For example: [:Foo, :Bar] - sig { returns(T::Array[Symbol]) } - def full_name_parts; end - - # Returns the full name of this constant path. For example: "Foo::Bar" - sig { returns(String) } - def full_name; end - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - sig { returns(::T.any(ConstantReadNode, MissingNode)) } - def child; end - end - - class ConstantPathTargetNode < Node - # Returns the list of parts for the full name of this constant path. - # For example: [:Foo, :Bar] - sig { returns(T::Array[Symbol]) } - def full_name_parts; end - - # Returns the full name of this constant path. For example: "Foo::Bar" - sig { returns(String) } - def full_name; end - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - sig { returns(::T.any(ConstantReadNode, MissingNode)) } - def child; end - end - - class ConstantTargetNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - sig { returns(T::Array[Symbol]) } - def full_name_parts; end - - # Returns the full name of this constant. For example: "Foo" - sig { returns(String) } - def full_name; end - end - - class ParametersNode < Node - # Mirrors the Method#parameters method. - sig { returns(T::Array[::T.any([Symbol, Symbol], [Symbol])]) } - def signature; end - end - - class CallNode < Node - # When a call node has the attribute_write flag set, it means that the call - # is using the attribute write syntax. This is either a method call to []= - # or a method call to a method that ends with =. Either way, the = sign is - # present in the source. - # - # Prism returns the message_loc _without_ the = sign attached, because there - # can be any amount of space between the message and the = sign. However, - # sometimes you want the location of the full message including the inner - # space and the = sign. This method provides that. - sig { returns(::T.nilable(Location)) } - def full_message_loc; end - end - - class CallOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ClassVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ConstantOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class ConstantPathOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class GlobalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class IndexOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class InstanceVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class LocalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - sig { returns(Symbol) } - def operator; end - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - sig { returns(Location) } - def operator_loc; end - end - - class CaseMatchNode < Node - # Returns the else clause of the case match node. This method is deprecated - # in favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end - - class CaseNode < Node - # Returns the else clause of the case node. This method is deprecated in - # favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end - - class IfNode < Node - # Returns the subsequent if/elsif/else clause of the if node. This method is - # deprecated in favor of #subsequent. - sig { returns(::T.nilable(::T.any(IfNode, ElseNode))) } - def consequent; end - end - - class RescueNode < Node - # Returns the subsequent rescue clause of the rescue node. This method is - # deprecated in favor of #subsequent. - sig { returns(::T.nilable(RescueNode)) } - def consequent; end - end - - class UnlessNode < Node - # Returns the else clause of the unless node. This method is deprecated in - # favor of #else_clause. - sig { returns(::T.nilable(ElseNode)) } - def consequent; end - end -end diff --git a/rbi/generated/prism/parse_result.rbi b/rbi/generated/prism/parse_result.rbi deleted file mode 100644 index 4a904e85e1..0000000000 --- a/rbi/generated/prism/parse_result.rbi +++ /dev/null @@ -1,744 +0,0 @@ -# typed: true - -module Prism - # This represents a source of Ruby code that has been parsed. It is used in - # conjunction with locations to allow them to resolve line numbers and source - # ranges. - class Source - # Create a new source object with the given source code. This method should - # be used instead of `new` and it will return either a `Source` or a - # specialized and more performant `ASCIISource` if no multibyte characters - # are present in the source code. - # - # Note that if you are calling this method manually, you will need to supply - # the start_line and offsets parameters. start_line is the line number that - # the source starts on, which is typically 1 but can be different if this - # source is a subset of a larger source or if this is an eval. offsets is an - # array of byte offsets for the start of each line in the source code, which - # can be calculated by iterating through the source code and recording the - # byte offset whenever a newline character is encountered. - sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).returns(Source) } - def self.for(source, start_line, offsets); end - - # The source code that this source object represents. - sig { returns(String) } - attr_reader :source - - # The line number where this source starts. - sig { returns(Integer) } - attr_reader :start_line - - # The list of newline byte offsets in the source code. - sig { returns(T::Array[Integer]) } - attr_reader :offsets - - # Create a new source object with the given source code. - sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void } - def initialize(source, start_line, offsets); end - - # Replace the value of start_line with the given value. - sig { params(start_line: Integer).void } - def replace_start_line(start_line); end - - # Replace the value of offsets with the given value. - sig { params(offsets: T::Array[Integer]).void } - def replace_offsets(offsets); end - - # Returns the encoding of the source code, which is set by parameters to the - # parser or by the encoding magic comment. - sig { returns(Encoding) } - def encoding; end - - # Returns the lines of the source code as an array of strings. - sig { returns(T::Array[String]) } - def lines; end - - # Perform a byteslice on the source code using the given byte offset and - # byte length. - sig { params(byte_offset: Integer, length: Integer).returns(String) } - def slice(byte_offset, length); end - - # Converts the line number and column in bytes to a byte offset. - sig { params(line: Integer, column: Integer).returns(Integer) } - def byte_offset(line, column); end - - # Binary search through the offsets to find the line number for the given - # byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def line(byte_offset); end - - # Return the byte offset of the start of the line corresponding to the given - # byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def line_start(byte_offset); end - - # Returns the byte offset of the end of the line corresponding to the given - # byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def line_end(byte_offset); end - - # Return the column in bytes for the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def column(byte_offset); end - - # Return the character offset for the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def character_offset(byte_offset); end - - # Return the column in characters for the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def character_column(byte_offset); end - - # Returns the offset from the start of the file for the given byte offset - # counting in code units for the given encoding. - # - # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the - # concept of code units that differs from the number of characters in other - # encodings, it is not captured here. - # - # We purposefully replace invalid and undefined characters with replacement - # characters in this conversion. This happens for two reasons. First, it's - # possible that the given byte offset will not occur on a character - # boundary. Second, it's possible that the source code will contain a - # character that has no equivalent in the given encoding. - sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } - def code_units_offset(byte_offset, encoding); end - - # Generate a cache that targets a specific encoding for calculating code - # unit offsets. - sig { params(encoding: Encoding).returns(CodeUnitsCache) } - def code_units_cache(encoding); end - - # Returns the column in code units for the given encoding for the - # given byte offset. - sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } - def code_units_column(byte_offset, encoding); end - - # Freeze this object and the objects it contains. - sig { void } - def deep_freeze; end - - # Binary search through the offsets to find the line number for the given - # byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - private def find_line(byte_offset); end - end - - # A cache that can be used to quickly compute code unit offsets from byte - # offsets. It purposefully provides only a single #[] method to access the - # cache in order to minimize surface area. - # - # Note that there are some known issues here that may or may not be addressed - # in the future: - # - # * The first is that there are issues when the cache computes values that are - # not on character boundaries. This can result in subsequent computations - # being off by one or more code units. - # * The second is that this cache is currently unbounded. In theory we could - # introduce some kind of LRU cache to limit the number of entries, but this - # has not yet been implemented. - class CodeUnitsCache - class UTF16Counter - sig { params(source: String, encoding: Encoding).void } - def initialize(source, encoding); end - - sig { params(byte_offset: Integer, byte_length: Integer).returns(Integer) } - def count(byte_offset, byte_length); end - end - - class LengthCounter - sig { params(source: String, encoding: Encoding).void } - def initialize(source, encoding); end - - sig { params(byte_offset: Integer, byte_length: Integer).returns(Integer) } - def count(byte_offset, byte_length); end - end - - # Initialize a new cache with the given source and encoding. - sig { params(source: String, encoding: Encoding).void } - def initialize(source, encoding); end - - # Retrieve the code units offset from the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def [](byte_offset); end - end - - # Specialized version of Prism::Source for source code that includes ASCII - # characters only. This class is used to apply performance optimizations that - # cannot be applied to sources that include multibyte characters. - # - # In the extremely rare case that a source includes multi-byte characters but - # is marked as binary because of a magic encoding comment and it cannot be - # eagerly converted to UTF-8, this class will be used as well. This is because - # at that point we will treat everything as single-byte characters. - class ASCIISource < Source - # Return the character offset for the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def character_offset(byte_offset); end - - # Return the column in characters for the given byte offset. - sig { params(byte_offset: Integer).returns(Integer) } - def character_column(byte_offset); end - - # Returns the offset from the start of the file for the given byte offset - # counting in code units for the given encoding. - # - # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the - # concept of code units that differs from the number of characters in other - # encodings, it is not captured here. - sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } - def code_units_offset(byte_offset, encoding); end - - # Returns a cache that is the identity function in order to maintain the - # same interface. We can do this because code units are always equivalent to - # byte offsets for ASCII-only sources. - sig { params(encoding: Encoding).returns(::T.untyped) } - def code_units_cache(encoding); end - - # Specialized version of `code_units_column` that does not depend on - # `code_units_offset`, which is a more expensive operation. This is - # essentially the same as `Prism::Source#column`. - sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } - def code_units_column(byte_offset, encoding); end - end - - # This represents a location in the source. - class Location - # A Source object that is used to determine more information from the given - # offset and length. - sig { returns(Source) } - attr_reader :source - - # The byte offset from the beginning of the source where this location - # starts. - sig { returns(Integer) } - attr_reader :start_offset - - # The length of this location in bytes. - sig { returns(Integer) } - attr_reader :length - - # Create a new location object with the given source, start byte offset, and - # byte length. - sig { params(source: Source, start_offset: Integer, length: Integer).void } - def initialize(source, start_offset, length); end - - # These are the comments that are associated with this location that exist - # before the start of this location. - sig { returns(T::Array[Comment]) } - def leading_comments; end - - # Attach a comment to the leading comments of this location. - sig { params(comment: Comment).void } - def leading_comment(comment); end - - # These are the comments that are associated with this location that exist - # after the end of this location. - sig { returns(T::Array[Comment]) } - def trailing_comments; end - - # Attach a comment to the trailing comments of this location. - sig { params(comment: Comment).void } - def trailing_comment(comment); end - - # Returns all comments that are associated with this location (both leading - # and trailing comments). - sig { returns(T::Array[Comment]) } - def comments; end - - # Create a new location object with the given options. - sig { params(source: Source, start_offset: Integer, length: Integer).returns(Location) } - def copy(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end - - # Returns a new location that is the result of chopping off the last byte. - sig { returns(Location) } - def chop; end - - # Returns a string representation of this location. - sig { returns(String) } - def inspect; end - - # Returns all of the lines of the source code associated with this location. - sig { returns(T::Array[String]) } - def source_lines; end - - # The source code that this location represents. - sig { returns(String) } - def slice; end - - # The source code that this location represents starting from the beginning - # of the line that this location starts on to the end of the line that this - # location ends on. - sig { returns(String) } - def slice_lines; end - - # The character offset from the beginning of the source where this location - # starts. - sig { returns(Integer) } - def start_character_offset; end - - # The offset from the start of the file in code units of the given encoding. - sig { params(encoding: Encoding).returns(Integer) } - def start_code_units_offset(encoding); end - - # The start offset from the start of the file in code units using the given - # cache to fetch or calculate the value. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_start_code_units_offset(cache); end - - # The byte offset from the beginning of the source where this location ends. - sig { returns(Integer) } - def end_offset; end - - # The character offset from the beginning of the source where this location - # ends. - sig { returns(Integer) } - def end_character_offset; end - - # The offset from the start of the file in code units of the given encoding. - sig { params(encoding: Encoding).returns(Integer) } - def end_code_units_offset(encoding); end - - # The end offset from the start of the file in code units using the given - # cache to fetch or calculate the value. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_end_code_units_offset(cache); end - - # The line number where this location starts. - sig { returns(Integer) } - def start_line; end - - # The content of the line where this location starts before this location. - sig { returns(String) } - def start_line_slice; end - - # The line number where this location ends. - sig { returns(Integer) } - def end_line; end - - # The column in bytes where this location starts from the start of - # the line. - sig { returns(Integer) } - def start_column; end - - # The column in characters where this location ends from the start of - # the line. - sig { returns(Integer) } - def start_character_column; end - - # The column in code units of the given encoding where this location - # starts from the start of the line. - sig { params(encoding: Encoding).returns(Integer) } - def start_code_units_column(encoding = T.unsafe(nil)); end - - # The start column in code units using the given cache to fetch or calculate - # the value. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_start_code_units_column(cache); end - - # The column in bytes where this location ends from the start of the - # line. - sig { returns(Integer) } - def end_column; end - - # The column in characters where this location ends from the start of - # the line. - sig { returns(Integer) } - def end_character_column; end - - # The column in code units of the given encoding where this location - # ends from the start of the line. - sig { params(encoding: Encoding).returns(Integer) } - def end_code_units_column(encoding = T.unsafe(nil)); end - - # The end column in code units using the given cache to fetch or calculate - # the value. - sig { params(cache: ::T.untyped).returns(Integer) } - def cached_end_code_units_column(cache); end - - # Implement the hash pattern matching interface for Location. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Implement the pretty print interface for Location. - sig { params(q: PP).void } - def pretty_print(q); end - - # Returns true if the given other location is equal to this location. - sig { params(other: ::T.untyped).returns(T::Boolean) } - def ==(other); end - - # Returns a new location that stretches from this location to the given - # other location. Raises an error if this location is not before the other - # location or if they don't share the same source. - sig { params(other: Location).returns(Location) } - def join(other); end - - # Join this location with the first occurrence of the string in the source - # that occurs after this location on the same line, and return the new - # location. This will raise an error if the string does not exist. - sig { params(string: String).returns(Location) } - def adjoin(string); end - end - - # This represents a comment that was encountered during parsing. It is the - # base class for all comment types. - class Comment - # The Location of this comment in the source. - sig { returns(Location) } - attr_reader :location - - # Create a new comment object with the given location. - sig { params(location: Location).void } - def initialize(location); end - - # Implement the hash pattern matching interface for Comment. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Returns the content of the comment by slicing it from the source code. - sig { returns(String) } - def slice; end - - # Returns true if this comment happens on the same line as other code and - # false if the comment is by itself. This can only be true for inline - # comments and should be false for block comments. - sig { returns(T::Boolean) } - def trailing?; end - end - - # InlineComment objects are the most common. They correspond to comments in - # the source file like this one that start with #. - class InlineComment < Comment - # Returns true if this comment happens on the same line as other code and - # false if the comment is by itself. - sig { returns(T::Boolean) } - def trailing?; end - - # Returns a string representation of this comment. - sig { returns(String) } - def inspect; end - end - - # EmbDocComment objects correspond to comments that are surrounded by =begin - # and =end. - class EmbDocComment < Comment - # Returns false. This can only be true for inline comments. - sig { returns(T::Boolean) } - def trailing?; end - - # Returns a string representation of this comment. - sig { returns(String) } - def inspect; end - end - - # This represents a magic comment that was encountered during parsing. - class MagicComment - # A Location object representing the location of the key in the source. - sig { returns(Location) } - attr_reader :key_loc - - # A Location object representing the location of the value in the source. - sig { returns(Location) } - attr_reader :value_loc - - # Create a new magic comment object with the given key and value locations. - sig { params(key_loc: Location, value_loc: Location).void } - def initialize(key_loc, value_loc); end - - # Returns the key of the magic comment by slicing it from the source code. - sig { returns(String) } - def key; end - - # Returns the value of the magic comment by slicing it from the source code. - sig { returns(String) } - def value; end - - # Implement the hash pattern matching interface for MagicComment. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Returns a string representation of this magic comment. - sig { returns(String) } - def inspect; end - end - - # This represents an error that was encountered during parsing. - class ParseError - # The type of error. This is an _internal_ symbol that is used for - # communicating with translation layers. It is not meant to be public API. - sig { returns(Symbol) } - attr_reader :type - - # The message associated with this error. - sig { returns(String) } - attr_reader :message - - # A Location object representing the location of this error in the source. - sig { returns(Location) } - attr_reader :location - - # The level of this error. - sig { returns(Symbol) } - attr_reader :level - - # Create a new error object with the given message and location. - sig { params(type: Symbol, message: String, location: Location, level: Symbol).void } - def initialize(type, message, location, level); end - - # Implement the hash pattern matching interface for ParseError. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Returns a string representation of this error. - sig { returns(String) } - def inspect; end - end - - # This represents a warning that was encountered during parsing. - class ParseWarning - # The type of warning. This is an _internal_ symbol that is used for - # communicating with translation layers. It is not meant to be public API. - sig { returns(Symbol) } - attr_reader :type - - # The message associated with this warning. - sig { returns(String) } - attr_reader :message - - # A Location object representing the location of this warning in the source. - sig { returns(Location) } - attr_reader :location - - # The level of this warning. - sig { returns(Symbol) } - attr_reader :level - - # Create a new warning object with the given message and location. - sig { params(type: Symbol, message: String, location: Location, level: Symbol).void } - def initialize(type, message, location, level); end - - # Implement the hash pattern matching interface for ParseWarning. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Returns a string representation of this warning. - sig { returns(String) } - def inspect; end - end - - # This represents the result of a call to Prism.parse or Prism.parse_file. - # It contains the requested structure, any comments that were encounters, - # and any errors that were encountered. - class Result - # The list of comments that were encountered during parsing. - sig { returns(T::Array[Comment]) } - attr_reader :comments - - # The list of magic comments that were encountered during parsing. - sig { returns(T::Array[MagicComment]) } - attr_reader :magic_comments - - # An optional location that represents the location of the __END__ marker - # and the rest of the content of the file. This content is loaded into the - # DATA constant when the file being parsed is the main file being executed. - sig { returns(::T.nilable(Location)) } - attr_reader :data_loc - - # The list of errors that were generated during parsing. - sig { returns(T::Array[ParseError]) } - attr_reader :errors - - # The list of warnings that were generated during parsing. - sig { returns(T::Array[ParseWarning]) } - attr_reader :warnings - - # A Source instance that represents the source code that was parsed. - sig { returns(Source) } - attr_reader :source - - # Create a new result object with the given values. - sig { params(comments: T::Array[Comment], magic_comments: T::Array[MagicComment], data_loc: ::T.nilable(Location), errors: T::Array[ParseError], warnings: T::Array[ParseWarning], source: Source).void } - def initialize(comments, magic_comments, data_loc, errors, warnings, source); end - - # Implement the hash pattern matching interface for Result. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Returns the encoding of the source code that was parsed. - sig { returns(Encoding) } - def encoding; end - - # Returns true if there were no errors during parsing and false if there - # were. - sig { returns(T::Boolean) } - def success?; end - - # Returns true if there were errors during parsing and false if there were - # not. - sig { returns(T::Boolean) } - def failure?; end - - # Returns true if the parsed source is an incomplete expression that could - # become valid with additional input. This is useful for REPL contexts (such - # as IRB) where the user may be entering a multi-line expression one line at - # a time and the implementation needs to determine whether to wait for more - # input or to evaluate what has been entered so far. - # - # Concretely, this returns true when every error present is caused by the - # parser reaching the end of the input before a construct was closed (e.g. - # an unclosed string, array, block, or keyword), and returns false when any - # error is caused by a token that makes the input structurally invalid - # regardless of what might follow (e.g. a stray `end`, `]`, or `)` with no - # matching opener). - # - # Examples: - # - # Prism.parse("1 + [").continuable? #=> true (unclosed array) - # Prism.parse("1 + ]").continuable? #=> false (stray ]) - # Prism.parse("tap do").continuable? #=> true (unclosed block) - # Prism.parse("end.tap do").continuable? #=> false (stray end) - # - sig { returns(T::Boolean) } - def continuable?; end - - # The set of error types whose location the parser places at the opening - # token of an unclosed construct rather than at the end of the source. These - # errors always indicate incomplete input regardless of their byte position, - # so they are checked by type rather than by location. - CONTINUABLE = T.let(nil, ::T.untyped) - - # Create a code units cache for the given encoding. - sig { params(encoding: Encoding).returns(::T.untyped) } - def code_units_cache(encoding); end - end - - # This is a result specific to the `parse` and `parse_file` methods. - class ParseResult < Result - # The syntax tree that was parsed from the source code. - sig { returns(ProgramNode) } - attr_reader :value - - # Create a new parse result object with the given values. - sig { params(value: ProgramNode, comments: T::Array[Comment], magic_comments: T::Array[MagicComment], data_loc: ::T.nilable(Location), errors: T::Array[ParseError], warnings: T::Array[ParseWarning], source: Source).void } - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - - # Implement the hash pattern matching interface for ParseResult. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # Attach the list of comments to their respective locations in the tree. - sig { void } - def attach_comments!; end - - # Walk the tree and mark nodes that are on a new line, loosely emulating - # the behavior of CRuby's `:line` tracepoint event. - sig { void } - def mark_newlines!; end - - # Returns a string representation of the syntax tree with the errors - # displayed inline. - sig { returns(String) } - def errors_format; end - end - - # This is a result specific to the `lex` and `lex_file` methods. - class LexResult < Result - # The list of tokens that were parsed from the source code. - sig { returns(T::Array[[Token, Integer]]) } - attr_reader :value - - # Create a new lex result object with the given values. - sig { params(value: T::Array[[Token, Integer]], comments: T::Array[Comment], magic_comments: T::Array[MagicComment], data_loc: ::T.nilable(Location), errors: T::Array[ParseError], warnings: T::Array[ParseWarning], source: Source).void } - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - - # Implement the hash pattern matching interface for LexResult. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - end - - # This is a result specific to the `parse_lex` and `parse_lex_file` methods. - class ParseLexResult < Result - # A tuple of the syntax tree and the list of tokens that were parsed from - # the source code. - sig { returns([ProgramNode, T::Array[[Token, Integer]]]) } - attr_reader :value - - # Create a new parse lex result object with the given values. - sig { params(value: [ProgramNode, T::Array[[Token, Integer]]], comments: T::Array[Comment], magic_comments: T::Array[MagicComment], data_loc: ::T.nilable(Location), errors: T::Array[ParseError], warnings: T::Array[ParseWarning], source: Source).void } - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - - # Implement the hash pattern matching interface for ParseLexResult. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - end - - # This represents a token from the Ruby source. - class Token - # The Source object that represents the source this token came from. - sig { returns(Source) } - attr_reader :source - - # The type of token that this token is. - sig { returns(Symbol) } - attr_reader :type - - # A byteslice of the source that this token represents. - sig { returns(String) } - attr_reader :value - - # Create a new token object with the given type, value, and location. - sig { params(source: Source, type: Symbol, value: String, location: ::T.any(Location, Integer)).void } - def initialize(source, type, value, location); end - - # Implement the hash pattern matching interface for Token. - sig { params(keys: ::T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, ::T.untyped]) } - def deconstruct_keys(keys); end - - # A Location object representing the location of this token in the source. - sig { returns(Location) } - def location; end - - # Implement the pretty print interface for Token. - sig { params(q: PP).void } - def pretty_print(q); end - - # Returns true if the given other token is equal to this token. - sig { params(other: ::T.untyped).returns(T::Boolean) } - def ==(other); end - - # Returns a string representation of this token. - sig { returns(String) } - def inspect; end - - # Freeze this object and the objects it contains. - sig { void } - def deep_freeze; end - end - - # This object is passed to the various Prism.* methods that accept the - # `scopes` option as an element of the list. It defines both the local - # variables visible at that scope as well as the forwarding parameters - # available at that scope. - class Scope - # The list of local variables that are defined in this scope. This should be - # defined as an array of symbols. - sig { returns(T::Array[Symbol]) } - attr_reader :locals - - # The list of local variables that are forwarded to the next scope. This - # should by defined as an array of symbols containing the specific values of - sig { returns(T::Array[Symbol]) } - attr_reader :forwarding - - # Create a new scope object with the given locals and forwarding. - sig { params(locals: T::Array[Symbol], forwarding: T::Array[Symbol]).void } - def initialize(locals, forwarding); end - end - - # Create a new scope with the given locals and forwarding options that is - # suitable for passing into one of the Prism.* methods that accepts the - # `scopes` option. - sig { params(locals: T::Array[Symbol], forwarding: T::Array[Symbol]).returns(Scope) } - def self.scope(locals: T.unsafe(nil), forwarding: T.unsafe(nil)); end -end diff --git a/rbi/generated/prism/parse_result/comments.rbi b/rbi/generated/prism/parse_result/comments.rbi deleted file mode 100644 index f386d03f34..0000000000 --- a/rbi/generated/prism/parse_result/comments.rbi +++ /dev/null @@ -1,90 +0,0 @@ -# typed: true - -module Prism - class ParseResult < Result - # When we've parsed the source, we have both the syntax tree and the list of - # comments that we found in the source. This class is responsible for - # walking the tree and finding the nearest location to attach each comment. - # - # It does this by first finding the nearest locations to each comment. - # Locations can either come from nodes directly or from location fields on - # nodes. For example, a `ClassNode` has an overall location encompassing the - # entire class, but it also has a location for the `class` keyword. - # - # Once the nearest locations are found, it determines which one to attach - # to. If it's a trailing comment (a comment on the same line as other source - # code), it will favor attaching to the nearest location that occurs before - # the comment. Otherwise it will favor attaching to the nearest location - # that is after the comment. - class Comments - # A target for attaching comments that is based on a specific node's - # location. - class NodeTarget - sig { returns(Node) } - attr_reader :node - - sig { params(node: Node).void } - def initialize(node); end - - sig { returns(Integer) } - def start_offset; end - - sig { returns(Integer) } - def end_offset; end - - sig { params(comment: Comment).returns(T::Boolean) } - def encloses?(comment); end - - sig { params(comment: Comment).void } - def leading_comment(comment); end - - sig { params(comment: Comment).void } - def trailing_comment(comment); end - end - - # A target for attaching comments that is based on a location field on a - # node. For example, the `end` token of a ClassNode. - class LocationTarget - sig { returns(Location) } - attr_reader :location - - sig { params(location: Location).void } - def initialize(location); end - - sig { returns(Integer) } - def start_offset; end - - sig { returns(Integer) } - def end_offset; end - - sig { params(comment: Comment).returns(T::Boolean) } - def encloses?(comment); end - - sig { params(comment: Comment).void } - def leading_comment(comment); end - - sig { params(comment: Comment).void } - def trailing_comment(comment); end - end - - # The parse result that we are attaching comments to. - sig { returns(ParseResult) } - attr_reader :parse_result - - # Create a new Comments object that will attach comments to the given - # parse result. - sig { params(parse_result: ParseResult).void } - def initialize(parse_result); end - - # Attach the comments to their respective locations in the tree by - # mutating the parse result. - sig { void } - def attach!; end - - # Responsible for finding the nearest targets to the given comment within - # the context of the given encapsulating node. - sig { params(node: Node, comment: Comment).returns([::T.untyped, ::T.untyped, ::T.untyped]) } - private def nearest_targets(node, comment); end - end - end -end diff --git a/rbi/generated/prism/parse_result/errors.rbi b/rbi/generated/prism/parse_result/errors.rbi deleted file mode 100644 index f864a3f8c2..0000000000 --- a/rbi/generated/prism/parse_result/errors.rbi +++ /dev/null @@ -1,21 +0,0 @@ -# typed: true - -module Prism - class ParseResult < Result - # An object to represent the set of errors on a parse result. This object - # can be used to format the errors in a human-readable way. - class Errors - # The parse result that contains the errors. - sig { returns(ParseResult) } - attr_reader :parse_result - - # Initialize a new set of errors from the given parse result. - sig { params(parse_result: ParseResult).void } - def initialize(parse_result); end - - # Formats the errors in a human-readable way and return them as a string. - sig { returns(String) } - def format; end - end - end -end diff --git a/rbi/generated/prism/parse_result/newlines.rbi b/rbi/generated/prism/parse_result/newlines.rbi deleted file mode 100644 index f77dee3bbf..0000000000 --- a/rbi/generated/prism/parse_result/newlines.rbi +++ /dev/null @@ -1,121 +0,0 @@ -# typed: true - -module Prism - class ParseResult < Result - # The :line tracepoint event gets fired whenever the Ruby VM encounters an - # expression on a new line. The types of expressions that can trigger this - # event are: - # - # * if statements - # * unless statements - # * nodes that are children of statements lists - # - # In order to keep track of the newlines, we have a list of offsets that - # come back from the parser. We assign these offsets to the first nodes that - # we find in the tree that are on those lines. - # - # Note that the logic in this file should be kept in sync with the Java - # MarkNewlinesVisitor, since that visitor is responsible for marking the - # newlines for JRuby/TruffleRuby. - # - # This file is autoloaded only when `mark_newlines!` is called, so the - # re-opening of the various nodes in this file will only be performed in - # that case. We do that to avoid storing the extra `@newline` instance - # variable on every node if we don't need it. - class Newlines < Visitor - # Create a new Newlines visitor with the given newline offsets. - sig { params(lines: Integer).void } - def initialize(lines); end - - # Permit block nodes to mark newlines within themselves. - sig { params(node: BlockNode).void } - def visit_block_node(node); end - - # Permit lambda nodes to mark newlines within themselves. - sig { params(node: LambdaNode).void } - def visit_lambda_node(node); end - - # Mark if nodes as newlines. - sig { params(node: IfNode).void } - def visit_if_node(node); end - - # Mark unless nodes as newlines. - sig { params(node: UnlessNode).void } - def visit_unless_node(node); end - - # Permit statements lists to mark newlines within themselves. - sig { params(node: StatementsNode).void } - def visit_statements_node(node); end - end - end - - class Node - abstract! - - sig { returns(T::Boolean) } - def newline_flag?; end - - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class BeginNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class ParenthesesNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class IfNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class UnlessNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class UntilNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class WhileNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class RescueModifierNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class InterpolatedMatchLastLineNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class InterpolatedRegularExpressionNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class InterpolatedStringNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class InterpolatedSymbolNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end - - class InterpolatedXStringNode < Node - sig { params(lines: T::Array[T::Boolean]).void } - def newline_flag!(lines); end - end -end diff --git a/rbi/generated/prism/pattern.rbi b/rbi/generated/prism/pattern.rbi deleted file mode 100644 index 375518b8f7..0000000000 --- a/rbi/generated/prism/pattern.rbi +++ /dev/null @@ -1,134 +0,0 @@ -# typed: true - -module Prism - # A pattern is an object that wraps a Ruby pattern matching expression. The - # expression would normally be passed to an `in` clause within a `case` - # expression or a rightward assignment expression. For example, in the - # following snippet: - # - # case node - # in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] - # end - # - # the pattern is the ConstantPathNode[...] expression. - # - # The pattern gets compiled into an object that responds to #call by running - # the #compile method. This method itself will run back through Prism to - # parse the expression into a tree, then walk the tree to generate the - # necessary callable objects. For example, if you wanted to compile the - # expression above into a callable, you would: - # - # callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile - # callable.call(node) - # - # The callable object returned by #compile is guaranteed to respond to #call - # with a single argument, which is the node to match against. It also is - # guaranteed to respond to #===, which means it itself can be used in a `case` - # expression, as in: - # - # case node - # when callable - # end - # - # If the query given to the initializer cannot be compiled into a valid - # matcher (either because of a syntax error or because it is using syntax we - # do not yet support) then a Prism::Pattern::CompilationError will be - # raised. - class Pattern - # Raised when the query given to a pattern is either invalid Ruby syntax or - # is using syntax that we don't yet support. - class CompilationError < StandardError - # Create a new CompilationError with the given representation of the node - # that caused the error. - sig { params(repr: String).void } - def initialize(repr); end - end - - # The query that this pattern was initialized with. - sig { returns(String) } - attr_reader :query - - # Create a new pattern with the given query. The query should be a string - # containing a Ruby pattern matching expression. - sig { params(query: String).void } - def initialize(query); end - - # Compile the query into a callable object that can be used to match against - # nodes. - sig { returns(Proc) } - def compile; end - - # Scan the given node and all of its children for nodes that match the - # pattern. If a block is given, it will be called with each node that - # matches the pattern. If no block is given, an enumerator will be returned - # that will yield each node that matches the pattern. - sig { params(root: Node).returns(T::Enumerator[Node]) } - sig { params(root: Node, blk: ::T.proc.params(arg0: Node).void).void } - def scan(root, &blk); end - - # Shortcut for combining two procs into one that returns true if both return - # true. - sig { params(left: Proc, right: Proc).returns(Proc) } - private def combine_and(left, right); end - - # Shortcut for combining two procs into one that returns true if either - # returns true. - sig { params(left: Proc, right: Proc).returns(Proc) } - private def combine_or(left, right); end - - # Raise an error because the given node is not supported. Note purposefully - # not typing this method since it is a no return method that Steep does not - # understand. - sig { params(node: Node).returns(::T.noreturn) } - private def compile_error(node); end - - # in [foo, bar, baz] - sig { params(node: ArrayPatternNode).returns(Proc) } - private def compile_array_pattern_node(node); end - - # in foo | bar - sig { params(node: AlternationPatternNode).returns(Proc) } - private def compile_alternation_pattern_node(node); end - - # in Prism::ConstantReadNode - sig { params(node: ConstantPathNode).returns(Proc) } - private def compile_constant_path_node(node); end - - # in ConstantReadNode - # in String - sig { params(node: ConstantReadNode).returns(Proc) } - private def compile_constant_read_node(node); end - - # Compile a name associated with a constant. - sig { params(node: ::T.any(ConstantPathNode, ConstantReadNode), name: Symbol).returns(Proc) } - private def compile_constant_name(node, name); end - - # in InstanceVariableReadNode[name: Symbol] - # in { name: Symbol } - sig { params(node: HashPatternNode).returns(Proc) } - private def compile_hash_pattern_node(node); end - - # in nil - sig { params(node: NilNode).returns(Proc) } - private def compile_nil_node(node); end - - # in /foo/ - sig { params(node: RegularExpressionNode).returns(Proc) } - private def compile_regular_expression_node(node); end - - # in "" - # in "foo" - sig { params(node: StringNode).returns(Proc) } - private def compile_string_node(node); end - - # in :+ - # in :foo - sig { params(node: SymbolNode).returns(Proc) } - private def compile_symbol_node(node); end - - # Compile any kind of node. Dispatch out to the individual compilation - # methods based on the type of node. - sig { params(node: Node).returns(Proc) } - private def compile_node(node); end - end -end diff --git a/rbi/generated/prism/reflection.rbi b/rbi/generated/prism/reflection.rbi deleted file mode 100644 index 1094c461f4..0000000000 --- a/rbi/generated/prism/reflection.rbi +++ /dev/null @@ -1,89 +0,0 @@ -# typed: true - -module Prism - # The Reflection module provides the ability to reflect on the structure of - # the syntax tree itself, as opposed to looking at a single syntax tree. This - # is useful in metaprogramming contexts. - module Reflection - # A field represents a single piece of data on a node. It is the base class - # for all other field types. - class Field - # The name of the field. - sig { returns(Symbol) } - attr_reader :name - - # Initializes the field with the given name. - sig { params(name: Symbol).void } - def initialize(name); end - end - - # A node field represents a single child node in the syntax tree. It - # resolves to a Prism::Node in Ruby. - class NodeField < Field; end - - # An optional node field represents a single child node in the syntax tree - # that may or may not be present. It resolves to either a Prism::Node or nil - # in Ruby. - class OptionalNodeField < Field; end - - # A node list field represents a list of child nodes in the syntax tree. It - # resolves to an array of Prism::Node instances in Ruby. - class NodeListField < Field; end - - # A constant field represents a constant value on a node. Effectively, it - # represents an identifier found within the source. It resolves to a symbol - # in Ruby. - class ConstantField < Field; end - - # An optional constant field represents a constant value on a node that may - # or may not be present. It resolves to either a symbol or nil in Ruby. - class OptionalConstantField < Field; end - - # A constant list field represents a list of constant values on a node. It - # resolves to an array of symbols in Ruby. - class ConstantListField < Field; end - - # A string field represents a string value on a node. It almost always - # represents the unescaped value of a string-like literal. It resolves to a - # string in Ruby. - class StringField < Field; end - - # A location field represents the location of some part of the node in the - # source code. For example, the location of a keyword or an operator. It - # resolves to a Prism::Location in Ruby. - class LocationField < Field; end - - # An optional location field represents the location of some part of the - # node in the source code that may or may not be present. It resolves to - # either a Prism::Location or nil in Ruby. - class OptionalLocationField < Field; end - - # An integer field represents an integer value. It is used to represent the - # value of an integer literal, the depth of local variables, and the number - # of a numbered reference. It resolves to an Integer in Ruby. - class IntegerField < Field; end - - # A float field represents a double-precision floating point value. It is - # used exclusively to represent the value of a floating point literal. It - # resolves to a Float in Ruby. - class FloatField < Field; end - - # A flags field represents a bitset of flags on a node. It resolves to an - # integer in Ruby. Note that the flags cannot be accessed directly on the - # node because the integer is kept private. Instead, the various flags in - # the bitset should be accessed through their query methods. - class FlagsField < Field - # The names of the flags in the bitset. - sig { returns(T::Array[Symbol]) } - attr_reader :flags - - # Initializes the flags field with the given name and flags. - sig { params(name: Symbol, flags: T::Array[Symbol]).void } - def initialize(name, flags); end - end - - # Returns the fields for the given node. - sig { params(node: ::T.class_of(Node)).returns(T::Array[Field]) } - def self.fields_for(node); end - end -end diff --git a/rbi/generated/prism/relocation.rbi b/rbi/generated/prism/relocation.rbi deleted file mode 100644 index 7868d065b0..0000000000 --- a/rbi/generated/prism/relocation.rbi +++ /dev/null @@ -1,389 +0,0 @@ -# typed: true - -module Prism - # Prism parses deterministically for the same input. This provides a nice - # property that is exposed through the #node_id API on nodes. Effectively this - # means that for the same input, these values will remain consistent every - # time the source is parsed. This means we can reparse the source same with a - # #node_id value and find the exact same node again. - # - # The Relocation module provides an API around this property. It allows you to - # "save" nodes and locations using a minimal amount of memory (just the - # node_id and a field identifier) and then reify them later. - module Relocation - # An entry in a repository that will lazily reify its values when they are - # first accessed. - class Entry - # Raised if a value that could potentially be on an entry is missing - # because it was either not configured on the repository or it has not yet - # been fetched. - class MissingValueError < StandardError; end - - # Initialize a new entry with the given repository. - sig { params(repository: Repository).void } - def initialize(repository); end - - # Fetch the filepath of the value. - sig { returns(String) } - def filepath; end - - # Fetch the start line of the value. - sig { returns(Integer) } - def start_line; end - - # Fetch the end line of the value. - sig { returns(Integer) } - def end_line; end - - # Fetch the start byte offset of the value. - sig { returns(Integer) } - def start_offset; end - - # Fetch the end byte offset of the value. - sig { returns(Integer) } - def end_offset; end - - # Fetch the start character offset of the value. - sig { returns(Integer) } - def start_character_offset; end - - # Fetch the end character offset of the value. - sig { returns(Integer) } - def end_character_offset; end - - # Fetch the start code units offset of the value, for the encoding that - # was configured on the repository. - sig { returns(Integer) } - def start_code_units_offset; end - - # Fetch the end code units offset of the value, for the encoding that was - # configured on the repository. - sig { returns(Integer) } - def end_code_units_offset; end - - # Fetch the start byte column of the value. - sig { returns(Integer) } - def start_column; end - - # Fetch the end byte column of the value. - sig { returns(Integer) } - def end_column; end - - # Fetch the start character column of the value. - sig { returns(Integer) } - def start_character_column; end - - # Fetch the end character column of the value. - sig { returns(Integer) } - def end_character_column; end - - # Fetch the start code units column of the value, for the encoding that - # was configured on the repository. - sig { returns(Integer) } - def start_code_units_column; end - - # Fetch the end code units column of the value, for the encoding that was - # configured on the repository. - sig { returns(Integer) } - def end_code_units_column; end - - # Fetch the leading comments of the value. - sig { returns(T::Array[CommentsField::Comment]) } - def leading_comments; end - - # Fetch the trailing comments of the value. - sig { returns(T::Array[CommentsField::Comment]) } - def trailing_comments; end - - # Fetch the leading and trailing comments of the value. - sig { returns(T::Array[CommentsField::Comment]) } - def comments; end - - # Reify the values on this entry with the given values. This is an - # internal-only API that is called from the repository when it is time to - # reify the values. - sig { params(values: T::Hash[Symbol, ::T.untyped]).void } - def reify!(values); end - - # Fetch a value from the entry, raising an error if it is missing. - sig { params(name: Symbol).returns(::T.untyped) } - private def fetch_value(name); end - - # Return the values from the repository, reifying them if necessary. - sig { returns(T::Hash[Symbol, ::T.untyped]) } - private def values; end - end - - # Represents the source of a repository that will be reparsed. - class Source - # The value that will need to be reparsed. - sig { returns(::T.untyped) } - attr_reader :value - - # Initialize the source with the given value. - sig { params(value: ::T.untyped).void } - def initialize(value); end - - # Reparse the value and return the parse result. - sig { returns(ParseResult) } - def result; end - - # Create a code units cache for the given encoding. - sig { params(encoding: Encoding).returns(::T.untyped) } - def code_units_cache(encoding); end - end - - # A source that is represented by a file path. - class SourceFilepath < Source - # Reparse the file and return the parse result. - sig { returns(ParseResult) } - def result; end - end - - # A source that is represented by a string. - class SourceString < Source - # Reparse the string and return the parse result. - sig { returns(ParseResult) } - def result; end - end - - # A field that represents the file path. - class FilepathField - # The file path that this field represents. - sig { returns(String) } - attr_reader :value - - # Initialize a new field with the given file path. - sig { params(value: String).void } - def initialize(value); end - - # Fetch the file path. - sig { params(_value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(_value); end - end - - # A field representing the start and end lines. - class LinesField - # Fetches the start and end line of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the start and end byte offsets. - class OffsetsField - # Fetches the start and end byte offset of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the start and end character offsets. - class CharacterOffsetsField - # Fetches the start and end character offset of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the start and end code unit offsets. - class CodeUnitOffsetsField - # A pointer to the repository object that is used for lazily creating a - # code units cache. - sig { returns(Repository) } - attr_reader :repository - - # The associated encoding for the code units. - sig { returns(Encoding) } - attr_reader :encoding - - # Initialize a new field with the associated repository and encoding. - sig { params(repository: Repository, encoding: Encoding).void } - def initialize(repository, encoding); end - - # Fetches the start and end code units offset of a value for a particular - # encoding. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - - # Lazily create a code units cache for the associated encoding. - sig { returns(::T.untyped) } - private def cache; end - end - - # A field representing the start and end byte columns. - class ColumnsField - # Fetches the start and end byte column of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the start and end character columns. - class CharacterColumnsField - # Fetches the start and end character column of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the start and end code unit columns for a specific - # encoding. - class CodeUnitColumnsField - # The repository object that is used for lazily creating a code units - # cache. - sig { returns(Repository) } - attr_reader :repository - - # The associated encoding for the code units. - sig { returns(Encoding) } - attr_reader :encoding - - # Initialize a new field with the associated repository and encoding. - sig { params(repository: Repository, encoding: Encoding).void } - def initialize(repository, encoding); end - - # Fetches the start and end code units column of a value for a particular - # encoding. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - - # Lazily create a code units cache for the associated encoding. - sig { returns(::T.untyped) } - private def cache; end - end - - # An abstract field used as the parent class of the two comments fields. - class CommentsField - # An object that represents a slice of a comment. - class Comment - # The slice of the comment. - sig { returns(String) } - attr_reader :slice - - # Initialize a new comment with the given slice. - # - sig { params(slice: String).void } - def initialize(slice); end - end - - # Create comment objects from the given values. - sig { params(values: ::T.untyped).returns(T::Array[Comment]) } - private def comments(values); end - end - - # A field representing the leading comments. - class LeadingCommentsField < CommentsField - # Fetches the leading comments of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A field representing the trailing comments. - class TrailingCommentsField < CommentsField - # Fetches the trailing comments of a value. - sig { params(value: ::T.untyped).returns(T::Hash[Symbol, ::T.untyped]) } - def fields(value); end - end - - # A repository is a configured collection of fields and a set of entries - # that knows how to reparse a source and reify the values. - class Repository - # Raised when multiple fields of the same type are configured on the same - # repository. - class ConfigurationError < StandardError; end - - # The source associated with this repository. This will be either a - # SourceFilepath (the most common use case) or a SourceString. - sig { returns(Source) } - attr_reader :source - - # The fields that have been configured on this repository. - sig { returns(T::Hash[Symbol, ::T.untyped]) } - attr_reader :fields - - # The entries that have been saved on this repository. - sig { returns(T::Hash[Integer, T::Hash[Symbol, Entry]]) } - attr_reader :entries - - # Initialize a new repository with the given source. - sig { params(source: Source).void } - def initialize(source); end - - # Create a code units cache for the given encoding from the source. - sig { params(encoding: Encoding).returns(::T.untyped) } - def code_units_cache(encoding); end - - # Configure the filepath field for this repository and return self. - sig { returns(::T.self_type) } - def filepath; end - - # Configure the lines field for this repository and return self. - sig { returns(::T.self_type) } - def lines; end - - # Configure the offsets field for this repository and return self. - sig { returns(::T.self_type) } - def offsets; end - - # Configure the character offsets field for this repository and return - # self. - sig { returns(::T.self_type) } - def character_offsets; end - - # Configure the code unit offsets field for this repository for a specific - # encoding and return self. - sig { params(encoding: Encoding).returns(::T.self_type) } - def code_unit_offsets(encoding); end - - # Configure the columns field for this repository and return self. - sig { returns(::T.self_type) } - def columns; end - - # Configure the character columns field for this repository and return - # self. - sig { returns(::T.self_type) } - def character_columns; end - - # Configure the code unit columns field for this repository for a specific - # encoding and return self. - sig { params(encoding: Encoding).returns(::T.self_type) } - def code_unit_columns(encoding); end - - # Configure the leading comments field for this repository and return - # self. - sig { returns(::T.self_type) } - def leading_comments; end - - # Configure the trailing comments field for this repository and return - # self. - sig { returns(::T.self_type) } - def trailing_comments; end - - # Configure both the leading and trailing comment fields for this - # repository and return self. - sig { returns(::T.self_type) } - def comments; end - - # This method is called from nodes and locations when they want to enter - # themselves into the repository. It it internal-only and meant to be - # called from the #save* APIs. - sig { params(node_id: Integer, field_name: Symbol).returns(Entry) } - def enter(node_id, field_name); end - - # This method is called from the entries in the repository when they need - # to reify their values. It is internal-only and meant to be called from - # the various value APIs. - sig { void } - def reify!; end - - # Append the given field to the repository and return the repository so - # that these calls can be chained. - sig { params(name: Symbol, arg0: ::T.untyped).returns(::T.self_type) } - private def field(name, arg0); end - end - - # Create a new repository for the given filepath. - sig { params(value: String).returns(Repository) } - def self.filepath(value); end - - # Create a new repository for the given string. - sig { params(value: String).returns(Repository) } - def self.string(value); end - end -end diff --git a/rbi/generated/prism/serialize.rbi b/rbi/generated/prism/serialize.rbi deleted file mode 100644 index 80bf9be1da..0000000000 --- a/rbi/generated/prism/serialize.rbi +++ /dev/null @@ -1,169 +0,0 @@ -# typed: true - -module Prism - # A module responsible for deserializing parse results. - module Serialize - # The major version of prism that we are expecting to find in the serialized - # strings. - MAJOR_VERSION = T.let(nil, Integer) - - # The minor version of prism that we are expecting to find in the serialized - # strings. - MINOR_VERSION = T.let(nil, Integer) - - # The patch version of prism that we are expecting to find in the serialized - # strings. - PATCH_VERSION = T.let(nil, Integer) - - # Deserialize the dumped output from a request to parse or parse_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - sig { params(input: String, serialized: String, freeze: T::Boolean).returns(ParseResult) } - def self.load_parse(input, serialized, freeze); end - - # Deserialize the dumped output from a request to lex or lex_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - sig { params(input: String, serialized: String, freeze: T::Boolean).returns(LexResult) } - def self.load_lex(input, serialized, freeze); end - - # Deserialize the dumped output from a request to parse_comments or - # parse_file_comments. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - sig { params(input: String, serialized: String, freeze: T::Boolean).returns(T::Array[Comment]) } - def self.load_parse_comments(input, serialized, freeze); end - - # Deserialize the dumped output from a request to parse_lex or - # parse_lex_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - sig { params(input: String, serialized: String, freeze: T::Boolean).returns(ParseLexResult) } - def self.load_parse_lex(input, serialized, freeze); end - - class ConstantPool - sig { returns(Integer) } - attr_reader :size - - sig { params(serialized: String, base: Integer, size: Integer).void } - def initialize(serialized, base, size); end - - sig { params(index: Integer, encoding: Encoding).returns(Symbol) } - def get(index, encoding); end - end - - FastStringIO = T.let(nil, ::T.untyped) - - class Loader - sig { returns(String) } - attr_reader :input - - sig { returns(StringIO) } - attr_reader :io - - sig { returns(Source) } - attr_reader :source - - sig { params(source: Source, serialized: String).void } - def initialize(source, serialized); end - - sig { returns(T::Boolean) } - def eof?; end - - sig { params(constant_pool: ConstantPool).void } - def load_constant_pool(constant_pool); end - - sig { void } - def load_header; end - - sig { returns(Encoding) } - def load_encoding; end - - sig { params(freeze: T::Boolean).returns(T::Array[Integer]) } - def load_line_offsets(freeze); end - - sig { params(freeze: T::Boolean).returns(T::Array[Comment]) } - def load_comments(freeze); end - - sig { params(freeze: T::Boolean).returns(T::Array[MagicComment]) } - def load_magic_comments(freeze); end - - DIAGNOSTIC_TYPES = T.let(nil, T::Array[Symbol]) - - sig { returns(Symbol) } - def load_error_level; end - - sig { params(encoding: Encoding, freeze: T::Boolean).returns(T::Array[ParseError]) } - def load_errors(encoding, freeze); end - - sig { returns(Symbol) } - def load_warning_level; end - - sig { params(encoding: Encoding, freeze: T::Boolean).returns(T::Array[ParseWarning]) } - def load_warnings(encoding, freeze); end - - sig { returns(T::Array[[Token, Integer]]) } - def load_tokens; end - - # variable-length integer using https://en.wikipedia.org/wiki/LEB128 - # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints - sig { returns(Integer) } - def load_varuint; end - - sig { returns(Integer) } - def load_varsint; end - - sig { returns(Integer) } - def load_integer; end - - sig { returns(Float) } - def load_double; end - - sig { returns(Integer) } - def load_uint32; end - - sig { params(constant_pool: ConstantPool, encoding: Encoding, freeze: T::Boolean).returns(::T.nilable(Node)) } - def load_optional_node(constant_pool, encoding, freeze); end - - sig { params(encoding: Encoding).returns(String) } - def load_string(encoding); end - - sig { params(freeze: T::Boolean).returns(Location) } - def load_location_object(freeze); end - - # Load a location object from the serialized data. Note that we are lying - # about the signature a bit here, because we sometimes load it as a packed - # integer instead of an object. - sig { params(freeze: T::Boolean).returns(Location) } - def load_location(freeze); end - - # Load an optional location object from the serialized data if it is - # present. Note that we are lying about the signature a bit here, because - # we sometimes load it as a packed integer instead of an object. - sig { params(freeze: T::Boolean).returns(::T.nilable(Location)) } - def load_optional_location(freeze); end - - sig { params(freeze: T::Boolean).returns(::T.nilable(Location)) } - def load_optional_location_object(freeze); end - - sig { params(constant_pool: ConstantPool, encoding: Encoding).returns(Symbol) } - def load_constant(constant_pool, encoding); end - - sig { params(constant_pool: ConstantPool, encoding: Encoding).returns(::T.nilable(Symbol)) } - def load_optional_constant(constant_pool, encoding); end - - sig { params(constant_pool: ConstantPool, encoding: Encoding, freeze: T::Boolean).returns(Node) } - def load_node(constant_pool, encoding, freeze); end - - sig { void } - def define_load_node_lambdas; end - end - - # The token types that can be indexed by their enum values. - TOKEN_TYPES = T.let(nil, T::Array[::T.nilable(Symbol)]) - end -end diff --git a/rbi/generated/prism/string_query.rbi b/rbi/generated/prism/string_query.rbi deleted file mode 100644 index 688ea4f08b..0000000000 --- a/rbi/generated/prism/string_query.rbi +++ /dev/null @@ -1,36 +0,0 @@ -# typed: true - -module Prism - # Query methods that allow categorizing strings based on their context for - # where they could be valid in a Ruby syntax tree. - class StringQuery - sig { params(string: String).returns(T::Boolean) } - def self.local?(string); end - - sig { params(string: String).returns(T::Boolean) } - def self.constant?(string); end - - sig { params(string: String).returns(T::Boolean) } - def self.method_name?(string); end - - # The string that this query is wrapping. - sig { returns(String) } - attr_reader :string - - # Initialize a new query with the given string. - sig { params(string: String).void } - def initialize(string); end - - # Whether or not this string is a valid local variable name. - sig { returns(T::Boolean) } - def local?; end - - # Whether or not this string is a valid constant name. - sig { returns(T::Boolean) } - def constant?; end - - # Whether or not this string is a valid method name. - sig { returns(T::Boolean) } - def method_name?; end - end -end diff --git a/rbi/generated/prism/translation.rbi b/rbi/generated/prism/translation.rbi deleted file mode 100644 index 007625b541..0000000000 --- a/rbi/generated/prism/translation.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: true - -module Prism - # This module is responsible for converting the prism syntax tree into other - # syntax trees. - module Translation; end -end diff --git a/rbi/generated/prism/visitor.rbi b/rbi/generated/prism/visitor.rbi deleted file mode 100644 index 53534f1dc6..0000000000 --- a/rbi/generated/prism/visitor.rbi +++ /dev/null @@ -1,650 +0,0 @@ -# typed: true - -module Prism - # A class that knows how to walk down the tree. None of the individual visit - # methods are implemented on this visitor, so it forces the consumer to - # implement each one that they need. For a default implementation that - # continues walking the tree, see the Visitor class. - class BasicVisitor - # Calls `accept` on the given node if it is not `nil`, which in turn should - # call back into this visitor by calling the appropriate `visit_*` method. - sig { params(node: ::T.nilable(Node)).void } - def visit(node); end - - # Visits each node in `nodes` by calling `accept` on each one. - sig { params(nodes: T::Array[::T.nilable(Node)]).void } - def visit_all(nodes); end - - # Visits the child nodes of `node` by calling `accept` on each one. - sig { params(node: Node).void } - def visit_child_nodes(node); end - end - - # A visitor is a class that provides a default implementation for every accept - # method defined on the nodes. This means it can walk a tree without the - # caller needing to define any special handling. This allows you to handle a - # subset of the tree, while still walking the whole tree. - # - # For example, to find all of the method calls that call the `foo` method, you - # could write: - # - # class FooCalls < Prism::Visitor - # def visit_call_node(node) - # if node.name == :foo - # # Do something with the node - # end - # - # # Call super so that the visitor continues walking the tree - # super - # end - # end - class Visitor < BasicVisitor - # Visit a AliasGlobalVariableNode node - sig { params(node: AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end - - # Visit a AliasMethodNode node - sig { params(node: AliasMethodNode).void } - def visit_alias_method_node(node); end - - # Visit a AlternationPatternNode node - sig { params(node: AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end - - # Visit a AndNode node - sig { params(node: AndNode).void } - def visit_and_node(node); end - - # Visit a ArgumentsNode node - sig { params(node: ArgumentsNode).void } - def visit_arguments_node(node); end - - # Visit a ArrayNode node - sig { params(node: ArrayNode).void } - def visit_array_node(node); end - - # Visit a ArrayPatternNode node - sig { params(node: ArrayPatternNode).void } - def visit_array_pattern_node(node); end - - # Visit a AssocNode node - sig { params(node: AssocNode).void } - def visit_assoc_node(node); end - - # Visit a AssocSplatNode node - sig { params(node: AssocSplatNode).void } - def visit_assoc_splat_node(node); end - - # Visit a BackReferenceReadNode node - sig { params(node: BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end - - # Visit a BeginNode node - sig { params(node: BeginNode).void } - def visit_begin_node(node); end - - # Visit a BlockArgumentNode node - sig { params(node: BlockArgumentNode).void } - def visit_block_argument_node(node); end - - # Visit a BlockLocalVariableNode node - sig { params(node: BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end - - # Visit a BlockNode node - sig { params(node: BlockNode).void } - def visit_block_node(node); end - - # Visit a BlockParameterNode node - sig { params(node: BlockParameterNode).void } - def visit_block_parameter_node(node); end - - # Visit a BlockParametersNode node - sig { params(node: BlockParametersNode).void } - def visit_block_parameters_node(node); end - - # Visit a BreakNode node - sig { params(node: BreakNode).void } - def visit_break_node(node); end - - # Visit a CallAndWriteNode node - sig { params(node: CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - # Visit a CallNode node - sig { params(node: CallNode).void } - def visit_call_node(node); end - - # Visit a CallOperatorWriteNode node - sig { params(node: CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - # Visit a CallOrWriteNode node - sig { params(node: CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - # Visit a CallTargetNode node - sig { params(node: CallTargetNode).void } - def visit_call_target_node(node); end - - # Visit a CapturePatternNode node - sig { params(node: CapturePatternNode).void } - def visit_capture_pattern_node(node); end - - # Visit a CaseMatchNode node - sig { params(node: CaseMatchNode).void } - def visit_case_match_node(node); end - - # Visit a CaseNode node - sig { params(node: CaseNode).void } - def visit_case_node(node); end - - # Visit a ClassNode node - sig { params(node: ClassNode).void } - def visit_class_node(node); end - - # Visit a ClassVariableAndWriteNode node - sig { params(node: ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end - - # Visit a ClassVariableOperatorWriteNode node - sig { params(node: ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end - - # Visit a ClassVariableOrWriteNode node - sig { params(node: ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end - - # Visit a ClassVariableReadNode node - sig { params(node: ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end - - # Visit a ClassVariableTargetNode node - sig { params(node: ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end - - # Visit a ClassVariableWriteNode node - sig { params(node: ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end - - # Visit a ConstantAndWriteNode node - sig { params(node: ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - # Visit a ConstantOperatorWriteNode node - sig { params(node: ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - # Visit a ConstantOrWriteNode node - sig { params(node: ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - # Visit a ConstantPathAndWriteNode node - sig { params(node: ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end - - # Visit a ConstantPathNode node - sig { params(node: ConstantPathNode).void } - def visit_constant_path_node(node); end - - # Visit a ConstantPathOperatorWriteNode node - sig { params(node: ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end - - # Visit a ConstantPathOrWriteNode node - sig { params(node: ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end - - # Visit a ConstantPathTargetNode node - sig { params(node: ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end - - # Visit a ConstantPathWriteNode node - sig { params(node: ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # Visit a ConstantReadNode node - sig { params(node: ConstantReadNode).void } - def visit_constant_read_node(node); end - - # Visit a ConstantTargetNode node - sig { params(node: ConstantTargetNode).void } - def visit_constant_target_node(node); end - - # Visit a ConstantWriteNode node - sig { params(node: ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # Visit a DefNode node - sig { params(node: DefNode).void } - def visit_def_node(node); end - - # Visit a DefinedNode node - sig { params(node: DefinedNode).void } - def visit_defined_node(node); end - - # Visit a ElseNode node - sig { params(node: ElseNode).void } - def visit_else_node(node); end - - # Visit a EmbeddedStatementsNode node - sig { params(node: EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end - - # Visit a EmbeddedVariableNode node - sig { params(node: EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end - - # Visit a EnsureNode node - sig { params(node: EnsureNode).void } - def visit_ensure_node(node); end - - # Visit a FalseNode node - sig { params(node: FalseNode).void } - def visit_false_node(node); end - - # Visit a FindPatternNode node - sig { params(node: FindPatternNode).void } - def visit_find_pattern_node(node); end - - # Visit a FlipFlopNode node - sig { params(node: FlipFlopNode).void } - def visit_flip_flop_node(node); end - - # Visit a FloatNode node - sig { params(node: FloatNode).void } - def visit_float_node(node); end - - # Visit a ForNode node - sig { params(node: ForNode).void } - def visit_for_node(node); end - - # Visit a ForwardingArgumentsNode node - sig { params(node: ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end - - # Visit a ForwardingParameterNode node - sig { params(node: ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end - - # Visit a ForwardingSuperNode node - sig { params(node: ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end - - # Visit a GlobalVariableAndWriteNode node - sig { params(node: GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end - - # Visit a GlobalVariableOperatorWriteNode node - sig { params(node: GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end - - # Visit a GlobalVariableOrWriteNode node - sig { params(node: GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end - - # Visit a GlobalVariableReadNode node - sig { params(node: GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end - - # Visit a GlobalVariableTargetNode node - sig { params(node: GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end - - # Visit a GlobalVariableWriteNode node - sig { params(node: GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end - - # Visit a HashNode node - sig { params(node: HashNode).void } - def visit_hash_node(node); end - - # Visit a HashPatternNode node - sig { params(node: HashPatternNode).void } - def visit_hash_pattern_node(node); end - - # Visit a IfNode node - sig { params(node: IfNode).void } - def visit_if_node(node); end - - # Visit a ImaginaryNode node - 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 ImplicitRestNode node - sig { params(node: ImplicitRestNode).void } - def visit_implicit_rest_node(node); end - - # Visit a InNode node - sig { params(node: InNode).void } - def visit_in_node(node); end - - # Visit a IndexAndWriteNode node - sig { params(node: IndexAndWriteNode).void } - def visit_index_and_write_node(node); end - - # Visit a IndexOperatorWriteNode node - sig { params(node: IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end - - # Visit a IndexOrWriteNode node - sig { params(node: IndexOrWriteNode).void } - def visit_index_or_write_node(node); end - - # Visit a IndexTargetNode node - sig { params(node: IndexTargetNode).void } - def visit_index_target_node(node); end - - # Visit a InstanceVariableAndWriteNode node - sig { params(node: InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end - - # Visit a InstanceVariableOperatorWriteNode node - sig { params(node: InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end - - # Visit a InstanceVariableOrWriteNode node - sig { params(node: InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end - - # Visit a InstanceVariableReadNode node - sig { params(node: InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end - - # Visit a InstanceVariableTargetNode node - sig { params(node: InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end - - # Visit a InstanceVariableWriteNode node - sig { params(node: InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end - - # Visit a IntegerNode node - sig { params(node: IntegerNode).void } - def visit_integer_node(node); end - - # Visit a InterpolatedMatchLastLineNode node - sig { params(node: InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end - - # Visit a InterpolatedRegularExpressionNode node - sig { params(node: InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end - - # Visit a InterpolatedStringNode node - sig { params(node: InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end - - # Visit a InterpolatedSymbolNode node - sig { params(node: InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end - - # Visit a InterpolatedXStringNode node - sig { params(node: InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end - - # Visit a ItLocalVariableReadNode node - sig { params(node: ItLocalVariableReadNode).void } - def visit_it_local_variable_read_node(node); end - - # Visit a ItParametersNode node - sig { params(node: ItParametersNode).void } - def visit_it_parameters_node(node); end - - # Visit a KeywordHashNode node - sig { params(node: KeywordHashNode).void } - def visit_keyword_hash_node(node); end - - # Visit a KeywordRestParameterNode node - sig { params(node: KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end - - # Visit a LambdaNode node - sig { params(node: LambdaNode).void } - def visit_lambda_node(node); end - - # Visit a LocalVariableAndWriteNode node - sig { params(node: LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - # Visit a LocalVariableOperatorWriteNode node - sig { params(node: LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - # Visit a LocalVariableOrWriteNode node - sig { params(node: LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - # Visit a LocalVariableReadNode node - sig { params(node: LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - # Visit a LocalVariableTargetNode node - sig { params(node: LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - # Visit a LocalVariableWriteNode node - sig { params(node: LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - # Visit a MatchLastLineNode node - sig { params(node: MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - # Visit a MatchPredicateNode node - sig { params(node: MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - # Visit a MatchRequiredNode node - 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 - - # Visit a ModuleNode node - sig { params(node: ModuleNode).void } - def visit_module_node(node); end - - # Visit a MultiTargetNode node - sig { params(node: MultiTargetNode).void } - def visit_multi_target_node(node); end - - # Visit a MultiWriteNode node - sig { params(node: MultiWriteNode).void } - def visit_multi_write_node(node); end - - # Visit a NextNode node - sig { params(node: NextNode).void } - def visit_next_node(node); end - - # Visit a NilNode node - sig { params(node: NilNode).void } - def visit_nil_node(node); end - - # Visit a NoBlockParameterNode node - sig { params(node: NoBlockParameterNode).void } - def visit_no_block_parameter_node(node); end - - # Visit a NoKeywordsParameterNode node - sig { params(node: NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - # Visit a NumberedParametersNode node - sig { params(node: NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - # Visit a NumberedReferenceReadNode node - sig { params(node: NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - # Visit a OptionalKeywordParameterNode node - sig { params(node: OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - # Visit a OptionalParameterNode node - sig { params(node: OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - # Visit a OrNode node - sig { params(node: OrNode).void } - def visit_or_node(node); end - - # Visit a ParametersNode node - sig { params(node: ParametersNode).void } - def visit_parameters_node(node); end - - # Visit a ParenthesesNode node - sig { params(node: ParenthesesNode).void } - def visit_parentheses_node(node); end - - # Visit a PinnedExpressionNode node - sig { params(node: PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - # Visit a PinnedVariableNode node - sig { params(node: PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - # Visit a PostExecutionNode node - sig { params(node: PostExecutionNode).void } - def visit_post_execution_node(node); end - - # Visit a PreExecutionNode node - sig { params(node: PreExecutionNode).void } - def visit_pre_execution_node(node); end - - # Visit a ProgramNode node - sig { params(node: ProgramNode).void } - def visit_program_node(node); end - - # Visit a RangeNode node - sig { params(node: RangeNode).void } - def visit_range_node(node); end - - # Visit a RationalNode node - sig { params(node: RationalNode).void } - def visit_rational_node(node); end - - # Visit a RedoNode node - sig { params(node: RedoNode).void } - def visit_redo_node(node); end - - # Visit a RegularExpressionNode node - sig { params(node: RegularExpressionNode).void } - def visit_regular_expression_node(node); end - - # Visit a RequiredKeywordParameterNode node - sig { params(node: RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end - - # Visit a RequiredParameterNode node - sig { params(node: RequiredParameterNode).void } - def visit_required_parameter_node(node); end - - # Visit a RescueModifierNode node - sig { params(node: RescueModifierNode).void } - def visit_rescue_modifier_node(node); end - - # Visit a RescueNode node - sig { params(node: RescueNode).void } - def visit_rescue_node(node); end - - # Visit a RestParameterNode node - sig { params(node: RestParameterNode).void } - def visit_rest_parameter_node(node); end - - # Visit a RetryNode node - sig { params(node: RetryNode).void } - def visit_retry_node(node); end - - # Visit a ReturnNode node - sig { params(node: ReturnNode).void } - def visit_return_node(node); end - - # Visit a SelfNode node - sig { params(node: SelfNode).void } - def visit_self_node(node); end - - # Visit a ShareableConstantNode node - sig { params(node: ShareableConstantNode).void } - def visit_shareable_constant_node(node); end - - # Visit a SingletonClassNode node - sig { params(node: SingletonClassNode).void } - def visit_singleton_class_node(node); end - - # Visit a SourceEncodingNode node - sig { params(node: SourceEncodingNode).void } - def visit_source_encoding_node(node); end - - # Visit a SourceFileNode node - sig { params(node: SourceFileNode).void } - def visit_source_file_node(node); end - - # Visit a SourceLineNode node - sig { params(node: SourceLineNode).void } - def visit_source_line_node(node); end - - # Visit a SplatNode node - sig { params(node: SplatNode).void } - def visit_splat_node(node); end - - # Visit a StatementsNode node - sig { params(node: StatementsNode).void } - def visit_statements_node(node); end - - # Visit a StringNode node - sig { params(node: StringNode).void } - def visit_string_node(node); end - - # Visit a SuperNode node - sig { params(node: SuperNode).void } - def visit_super_node(node); end - - # Visit a SymbolNode node - sig { params(node: SymbolNode).void } - def visit_symbol_node(node); end - - # Visit a TrueNode node - sig { params(node: TrueNode).void } - def visit_true_node(node); end - - # Visit a UndefNode node - sig { params(node: UndefNode).void } - def visit_undef_node(node); end - - # Visit a UnlessNode node - sig { params(node: UnlessNode).void } - def visit_unless_node(node); end - - # Visit a UntilNode node - sig { params(node: UntilNode).void } - def visit_until_node(node); end - - # Visit a WhenNode node - sig { params(node: WhenNode).void } - def visit_when_node(node); end - - # Visit a WhileNode node - sig { params(node: WhileNode).void } - def visit_while_node(node); end - - # Visit a XStringNode node - sig { params(node: XStringNode).void } - def visit_x_string_node(node); end - - # Visit a YieldNode node - sig { params(node: YieldNode).void } - def visit_yield_node(node); end - end -end diff --git a/sig/generated/prism.rbs b/sig/generated/prism.rbs deleted file mode 100644 index 4777914d3e..0000000000 --- a/sig/generated/prism.rbs +++ /dev/null @@ -1,76 +0,0 @@ -# Generated from lib/prism.rb with RBS::Inline - -# The Prism Ruby parser. -# -# "Parsing Ruby is suddenly manageable!" -# - You, hopefully -module Prism - # Raised when requested to parse as the currently running Ruby version but Prism has no support for it. - class CurrentVersionError < ArgumentError - # Initialize a new exception for the given ruby version string. - # -- - # : (String version) -> void - def initialize: (String version) -> void - end - - # :call-seq: - # lex_compat(source, **options) -> LexCompat::Result - # - # Returns a parse result whose value is an array of tokens that closely - # resembles the return value of Ripper.lex. - # - # For supported options, see Prism.parse. - # -- - # : (String source, **untyped options) -> LexCompat::Result - def self.lex_compat: (String source, **untyped options) -> LexCompat::Result - - # :call-seq: - # load(source, serialized, freeze) -> ParseResult - # - # Load the serialized AST using the source as a reference into a tree. - # -- - # : (String source, String serialized, ?bool freeze) -> ParseResult - def self.load: (String source, String serialized, ?bool freeze) -> ParseResult - - VERSION: String - - BACKEND: :CEXT | :FFI - - interface _Stream - def gets: (?Integer integer) -> (String | nil) - end - - def self.parse: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> ParseResult - - def self.profile: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> void - - def self.lex: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> LexResult - - def self.parse_lex: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> ParseLexResult - - def self.dump: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> String - - def self.parse_comments: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> Array[Comment] - - def self.parse_success?: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> bool - - def self.parse_failure?: (String source, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> bool - - def self.parse_stream: (_Stream stream, ?filepath: String, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> ParseResult - - def self.parse_file: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> ParseResult - - def self.profile_file: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> void - - def self.lex_file: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> LexResult - - def self.parse_lex_file: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> ParseLexResult - - def self.dump_file: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> String - - def self.parse_file_comments: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> Array[Comment] - - def self.parse_file_success?: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> bool - - def self.parse_file_failure?: (String filepath, ?command_line: String, ?encoding: Encoding | false, ?freeze: bool, ?frozen_string_literal: bool, ?line: Integer, ?main_script: bool, ?partial_script: bool, ?scopes: Array[Array[Symbol]], ?version: String) -> bool -end diff --git a/sig/generated/prism/compiler.rbs b/sig/generated/prism/compiler.rbs deleted file mode 100644 index c2e4db0ace..0000000000 --- a/sig/generated/prism/compiler.rbs +++ /dev/null @@ -1,492 +0,0 @@ -# Generated from lib/prism/compiler.rb with RBS::Inline - -module Prism - # A compiler is a visitor that returns the value of each node as it visits. - # This is as opposed to a visitor which will only walk the tree. This can be - # useful when you are trying to compile a tree into a different format. - # - # For example, to build a representation of the tree as s-expressions, you - # could write: - # - # class SExpressions < Prism::Compiler - # def visit_arguments_node(node) = [:arguments, super] - # def visit_call_node(node) = [:call, super] - # def visit_integer_node(node) = [:integer] - # def visit_program_node(node) = [:program, super] - # end - # - # Prism.parse("1 + 2").value.accept(SExpressions.new) - # # => [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] - class Compiler < Visitor - # Visit an individual node. - # -- - # : (node?) -> untyped - def visit: (node?) -> untyped - - # Visit a list of nodes. - # -- - # : (Array[node?]) -> untyped - def visit_all: (Array[node?]) -> untyped - - # Visit the child nodes of the given node. - # -- - # : (node) -> Array[untyped] - def visit_child_nodes: (node) -> Array[untyped] - - # : (AliasGlobalVariableNode) -> Array[untyped] - def visit_alias_global_variable_node: (AliasGlobalVariableNode) -> Array[untyped] - - # : (AliasMethodNode) -> Array[untyped] - def visit_alias_method_node: (AliasMethodNode) -> Array[untyped] - - # : (AlternationPatternNode) -> Array[untyped] - def visit_alternation_pattern_node: (AlternationPatternNode) -> Array[untyped] - - # : (AndNode) -> Array[untyped] - def visit_and_node: (AndNode) -> Array[untyped] - - # : (ArgumentsNode) -> Array[untyped] - def visit_arguments_node: (ArgumentsNode) -> Array[untyped] - - # : (ArrayNode) -> Array[untyped] - def visit_array_node: (ArrayNode) -> Array[untyped] - - # : (ArrayPatternNode) -> Array[untyped] - def visit_array_pattern_node: (ArrayPatternNode) -> Array[untyped] - - # : (AssocNode) -> Array[untyped] - def visit_assoc_node: (AssocNode) -> Array[untyped] - - # : (AssocSplatNode) -> Array[untyped] - def visit_assoc_splat_node: (AssocSplatNode) -> Array[untyped] - - # : (BackReferenceReadNode) -> Array[untyped] - def visit_back_reference_read_node: (BackReferenceReadNode) -> Array[untyped] - - # : (BeginNode) -> Array[untyped] - def visit_begin_node: (BeginNode) -> Array[untyped] - - # : (BlockArgumentNode) -> Array[untyped] - def visit_block_argument_node: (BlockArgumentNode) -> Array[untyped] - - # : (BlockLocalVariableNode) -> Array[untyped] - def visit_block_local_variable_node: (BlockLocalVariableNode) -> Array[untyped] - - # : (BlockNode) -> Array[untyped] - def visit_block_node: (BlockNode) -> Array[untyped] - - # : (BlockParameterNode) -> Array[untyped] - def visit_block_parameter_node: (BlockParameterNode) -> Array[untyped] - - # : (BlockParametersNode) -> Array[untyped] - def visit_block_parameters_node: (BlockParametersNode) -> Array[untyped] - - # : (BreakNode) -> Array[untyped] - def visit_break_node: (BreakNode) -> Array[untyped] - - # : (CallAndWriteNode) -> Array[untyped] - def visit_call_and_write_node: (CallAndWriteNode) -> Array[untyped] - - # : (CallNode) -> Array[untyped] - def visit_call_node: (CallNode) -> Array[untyped] - - # : (CallOperatorWriteNode) -> Array[untyped] - def visit_call_operator_write_node: (CallOperatorWriteNode) -> Array[untyped] - - # : (CallOrWriteNode) -> Array[untyped] - def visit_call_or_write_node: (CallOrWriteNode) -> Array[untyped] - - # : (CallTargetNode) -> Array[untyped] - def visit_call_target_node: (CallTargetNode) -> Array[untyped] - - # : (CapturePatternNode) -> Array[untyped] - def visit_capture_pattern_node: (CapturePatternNode) -> Array[untyped] - - # : (CaseMatchNode) -> Array[untyped] - def visit_case_match_node: (CaseMatchNode) -> Array[untyped] - - # : (CaseNode) -> Array[untyped] - def visit_case_node: (CaseNode) -> Array[untyped] - - # : (ClassNode) -> Array[untyped] - def visit_class_node: (ClassNode) -> Array[untyped] - - # : (ClassVariableAndWriteNode) -> Array[untyped] - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode) -> Array[untyped] - - # : (ClassVariableOperatorWriteNode) -> Array[untyped] - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode) -> Array[untyped] - - # : (ClassVariableOrWriteNode) -> Array[untyped] - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode) -> Array[untyped] - - # : (ClassVariableReadNode) -> Array[untyped] - def visit_class_variable_read_node: (ClassVariableReadNode) -> Array[untyped] - - # : (ClassVariableTargetNode) -> Array[untyped] - def visit_class_variable_target_node: (ClassVariableTargetNode) -> Array[untyped] - - # : (ClassVariableWriteNode) -> Array[untyped] - def visit_class_variable_write_node: (ClassVariableWriteNode) -> Array[untyped] - - # : (ConstantAndWriteNode) -> Array[untyped] - def visit_constant_and_write_node: (ConstantAndWriteNode) -> Array[untyped] - - # : (ConstantOperatorWriteNode) -> Array[untyped] - def visit_constant_operator_write_node: (ConstantOperatorWriteNode) -> Array[untyped] - - # : (ConstantOrWriteNode) -> Array[untyped] - def visit_constant_or_write_node: (ConstantOrWriteNode) -> Array[untyped] - - # : (ConstantPathAndWriteNode) -> Array[untyped] - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode) -> Array[untyped] - - # : (ConstantPathNode) -> Array[untyped] - def visit_constant_path_node: (ConstantPathNode) -> Array[untyped] - - # : (ConstantPathOperatorWriteNode) -> Array[untyped] - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode) -> Array[untyped] - - # : (ConstantPathOrWriteNode) -> Array[untyped] - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode) -> Array[untyped] - - # : (ConstantPathTargetNode) -> Array[untyped] - def visit_constant_path_target_node: (ConstantPathTargetNode) -> Array[untyped] - - # : (ConstantPathWriteNode) -> Array[untyped] - def visit_constant_path_write_node: (ConstantPathWriteNode) -> Array[untyped] - - # : (ConstantReadNode) -> Array[untyped] - def visit_constant_read_node: (ConstantReadNode) -> Array[untyped] - - # : (ConstantTargetNode) -> Array[untyped] - def visit_constant_target_node: (ConstantTargetNode) -> Array[untyped] - - # : (ConstantWriteNode) -> Array[untyped] - def visit_constant_write_node: (ConstantWriteNode) -> Array[untyped] - - # : (DefNode) -> Array[untyped] - def visit_def_node: (DefNode) -> Array[untyped] - - # : (DefinedNode) -> Array[untyped] - def visit_defined_node: (DefinedNode) -> Array[untyped] - - # : (ElseNode) -> Array[untyped] - def visit_else_node: (ElseNode) -> Array[untyped] - - # : (EmbeddedStatementsNode) -> Array[untyped] - def visit_embedded_statements_node: (EmbeddedStatementsNode) -> Array[untyped] - - # : (EmbeddedVariableNode) -> Array[untyped] - def visit_embedded_variable_node: (EmbeddedVariableNode) -> Array[untyped] - - # : (EnsureNode) -> Array[untyped] - def visit_ensure_node: (EnsureNode) -> Array[untyped] - - # : (FalseNode) -> Array[untyped] - def visit_false_node: (FalseNode) -> Array[untyped] - - # : (FindPatternNode) -> Array[untyped] - def visit_find_pattern_node: (FindPatternNode) -> Array[untyped] - - # : (FlipFlopNode) -> Array[untyped] - def visit_flip_flop_node: (FlipFlopNode) -> Array[untyped] - - # : (FloatNode) -> Array[untyped] - def visit_float_node: (FloatNode) -> Array[untyped] - - # : (ForNode) -> Array[untyped] - def visit_for_node: (ForNode) -> Array[untyped] - - # : (ForwardingArgumentsNode) -> Array[untyped] - def visit_forwarding_arguments_node: (ForwardingArgumentsNode) -> Array[untyped] - - # : (ForwardingParameterNode) -> Array[untyped] - def visit_forwarding_parameter_node: (ForwardingParameterNode) -> Array[untyped] - - # : (ForwardingSuperNode) -> Array[untyped] - def visit_forwarding_super_node: (ForwardingSuperNode) -> Array[untyped] - - # : (GlobalVariableAndWriteNode) -> Array[untyped] - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode) -> Array[untyped] - - # : (GlobalVariableOperatorWriteNode) -> Array[untyped] - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode) -> Array[untyped] - - # : (GlobalVariableOrWriteNode) -> Array[untyped] - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode) -> Array[untyped] - - # : (GlobalVariableReadNode) -> Array[untyped] - def visit_global_variable_read_node: (GlobalVariableReadNode) -> Array[untyped] - - # : (GlobalVariableTargetNode) -> Array[untyped] - def visit_global_variable_target_node: (GlobalVariableTargetNode) -> Array[untyped] - - # : (GlobalVariableWriteNode) -> Array[untyped] - def visit_global_variable_write_node: (GlobalVariableWriteNode) -> Array[untyped] - - # : (HashNode) -> Array[untyped] - def visit_hash_node: (HashNode) -> Array[untyped] - - # : (HashPatternNode) -> Array[untyped] - def visit_hash_pattern_node: (HashPatternNode) -> Array[untyped] - - # : (IfNode) -> Array[untyped] - def visit_if_node: (IfNode) -> Array[untyped] - - # : (ImaginaryNode) -> Array[untyped] - def visit_imaginary_node: (ImaginaryNode) -> Array[untyped] - - # : (ImplicitNode) -> Array[untyped] - def visit_implicit_node: (ImplicitNode) -> Array[untyped] - - # : (ImplicitRestNode) -> Array[untyped] - def visit_implicit_rest_node: (ImplicitRestNode) -> Array[untyped] - - # : (InNode) -> Array[untyped] - def visit_in_node: (InNode) -> Array[untyped] - - # : (IndexAndWriteNode) -> Array[untyped] - def visit_index_and_write_node: (IndexAndWriteNode) -> Array[untyped] - - # : (IndexOperatorWriteNode) -> Array[untyped] - def visit_index_operator_write_node: (IndexOperatorWriteNode) -> Array[untyped] - - # : (IndexOrWriteNode) -> Array[untyped] - def visit_index_or_write_node: (IndexOrWriteNode) -> Array[untyped] - - # : (IndexTargetNode) -> Array[untyped] - def visit_index_target_node: (IndexTargetNode) -> Array[untyped] - - # : (InstanceVariableAndWriteNode) -> Array[untyped] - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode) -> Array[untyped] - - # : (InstanceVariableOperatorWriteNode) -> Array[untyped] - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode) -> Array[untyped] - - # : (InstanceVariableOrWriteNode) -> Array[untyped] - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode) -> Array[untyped] - - # : (InstanceVariableReadNode) -> Array[untyped] - def visit_instance_variable_read_node: (InstanceVariableReadNode) -> Array[untyped] - - # : (InstanceVariableTargetNode) -> Array[untyped] - def visit_instance_variable_target_node: (InstanceVariableTargetNode) -> Array[untyped] - - # : (InstanceVariableWriteNode) -> Array[untyped] - def visit_instance_variable_write_node: (InstanceVariableWriteNode) -> Array[untyped] - - # : (IntegerNode) -> Array[untyped] - def visit_integer_node: (IntegerNode) -> Array[untyped] - - # : (InterpolatedMatchLastLineNode) -> Array[untyped] - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode) -> Array[untyped] - - # : (InterpolatedRegularExpressionNode) -> Array[untyped] - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode) -> Array[untyped] - - # : (InterpolatedStringNode) -> Array[untyped] - def visit_interpolated_string_node: (InterpolatedStringNode) -> Array[untyped] - - # : (InterpolatedSymbolNode) -> Array[untyped] - def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> Array[untyped] - - # : (InterpolatedXStringNode) -> Array[untyped] - def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> Array[untyped] - - # : (ItLocalVariableReadNode) -> Array[untyped] - def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> Array[untyped] - - # : (ItParametersNode) -> Array[untyped] - def visit_it_parameters_node: (ItParametersNode) -> Array[untyped] - - # : (KeywordHashNode) -> Array[untyped] - def visit_keyword_hash_node: (KeywordHashNode) -> Array[untyped] - - # : (KeywordRestParameterNode) -> Array[untyped] - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> Array[untyped] - - # : (LambdaNode) -> Array[untyped] - def visit_lambda_node: (LambdaNode) -> Array[untyped] - - # : (LocalVariableAndWriteNode) -> Array[untyped] - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode) -> Array[untyped] - - # : (LocalVariableOperatorWriteNode) -> Array[untyped] - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode) -> Array[untyped] - - # : (LocalVariableOrWriteNode) -> Array[untyped] - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode) -> Array[untyped] - - # : (LocalVariableReadNode) -> Array[untyped] - def visit_local_variable_read_node: (LocalVariableReadNode) -> Array[untyped] - - # : (LocalVariableTargetNode) -> Array[untyped] - def visit_local_variable_target_node: (LocalVariableTargetNode) -> Array[untyped] - - # : (LocalVariableWriteNode) -> Array[untyped] - def visit_local_variable_write_node: (LocalVariableWriteNode) -> Array[untyped] - - # : (MatchLastLineNode) -> Array[untyped] - def visit_match_last_line_node: (MatchLastLineNode) -> Array[untyped] - - # : (MatchPredicateNode) -> Array[untyped] - def visit_match_predicate_node: (MatchPredicateNode) -> Array[untyped] - - # : (MatchRequiredNode) -> Array[untyped] - def visit_match_required_node: (MatchRequiredNode) -> Array[untyped] - - # : (MatchWriteNode) -> Array[untyped] - def visit_match_write_node: (MatchWriteNode) -> Array[untyped] - - # : (MissingNode) -> Array[untyped] - def visit_missing_node: (MissingNode) -> Array[untyped] - - # : (ModuleNode) -> Array[untyped] - def visit_module_node: (ModuleNode) -> Array[untyped] - - # : (MultiTargetNode) -> Array[untyped] - def visit_multi_target_node: (MultiTargetNode) -> Array[untyped] - - # : (MultiWriteNode) -> Array[untyped] - def visit_multi_write_node: (MultiWriteNode) -> Array[untyped] - - # : (NextNode) -> Array[untyped] - def visit_next_node: (NextNode) -> Array[untyped] - - # : (NilNode) -> Array[untyped] - def visit_nil_node: (NilNode) -> Array[untyped] - - # : (NoBlockParameterNode) -> Array[untyped] - def visit_no_block_parameter_node: (NoBlockParameterNode) -> Array[untyped] - - # : (NoKeywordsParameterNode) -> Array[untyped] - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode) -> Array[untyped] - - # : (NumberedParametersNode) -> Array[untyped] - def visit_numbered_parameters_node: (NumberedParametersNode) -> Array[untyped] - - # : (NumberedReferenceReadNode) -> Array[untyped] - def visit_numbered_reference_read_node: (NumberedReferenceReadNode) -> Array[untyped] - - # : (OptionalKeywordParameterNode) -> Array[untyped] - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode) -> Array[untyped] - - # : (OptionalParameterNode) -> Array[untyped] - def visit_optional_parameter_node: (OptionalParameterNode) -> Array[untyped] - - # : (OrNode) -> Array[untyped] - def visit_or_node: (OrNode) -> Array[untyped] - - # : (ParametersNode) -> Array[untyped] - def visit_parameters_node: (ParametersNode) -> Array[untyped] - - # : (ParenthesesNode) -> Array[untyped] - def visit_parentheses_node: (ParenthesesNode) -> Array[untyped] - - # : (PinnedExpressionNode) -> Array[untyped] - def visit_pinned_expression_node: (PinnedExpressionNode) -> Array[untyped] - - # : (PinnedVariableNode) -> Array[untyped] - def visit_pinned_variable_node: (PinnedVariableNode) -> Array[untyped] - - # : (PostExecutionNode) -> Array[untyped] - def visit_post_execution_node: (PostExecutionNode) -> Array[untyped] - - # : (PreExecutionNode) -> Array[untyped] - def visit_pre_execution_node: (PreExecutionNode) -> Array[untyped] - - # : (ProgramNode) -> Array[untyped] - def visit_program_node: (ProgramNode) -> Array[untyped] - - # : (RangeNode) -> Array[untyped] - def visit_range_node: (RangeNode) -> Array[untyped] - - # : (RationalNode) -> Array[untyped] - def visit_rational_node: (RationalNode) -> Array[untyped] - - # : (RedoNode) -> Array[untyped] - def visit_redo_node: (RedoNode) -> Array[untyped] - - # : (RegularExpressionNode) -> Array[untyped] - def visit_regular_expression_node: (RegularExpressionNode) -> Array[untyped] - - # : (RequiredKeywordParameterNode) -> Array[untyped] - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode) -> Array[untyped] - - # : (RequiredParameterNode) -> Array[untyped] - def visit_required_parameter_node: (RequiredParameterNode) -> Array[untyped] - - # : (RescueModifierNode) -> Array[untyped] - def visit_rescue_modifier_node: (RescueModifierNode) -> Array[untyped] - - # : (RescueNode) -> Array[untyped] - def visit_rescue_node: (RescueNode) -> Array[untyped] - - # : (RestParameterNode) -> Array[untyped] - def visit_rest_parameter_node: (RestParameterNode) -> Array[untyped] - - # : (RetryNode) -> Array[untyped] - def visit_retry_node: (RetryNode) -> Array[untyped] - - # : (ReturnNode) -> Array[untyped] - def visit_return_node: (ReturnNode) -> Array[untyped] - - # : (SelfNode) -> Array[untyped] - def visit_self_node: (SelfNode) -> Array[untyped] - - # : (ShareableConstantNode) -> Array[untyped] - def visit_shareable_constant_node: (ShareableConstantNode) -> Array[untyped] - - # : (SingletonClassNode) -> Array[untyped] - def visit_singleton_class_node: (SingletonClassNode) -> Array[untyped] - - # : (SourceEncodingNode) -> Array[untyped] - def visit_source_encoding_node: (SourceEncodingNode) -> Array[untyped] - - # : (SourceFileNode) -> Array[untyped] - def visit_source_file_node: (SourceFileNode) -> Array[untyped] - - # : (SourceLineNode) -> Array[untyped] - def visit_source_line_node: (SourceLineNode) -> Array[untyped] - - # : (SplatNode) -> Array[untyped] - def visit_splat_node: (SplatNode) -> Array[untyped] - - # : (StatementsNode) -> Array[untyped] - def visit_statements_node: (StatementsNode) -> Array[untyped] - - # : (StringNode) -> Array[untyped] - def visit_string_node: (StringNode) -> Array[untyped] - - # : (SuperNode) -> Array[untyped] - def visit_super_node: (SuperNode) -> Array[untyped] - - # : (SymbolNode) -> Array[untyped] - def visit_symbol_node: (SymbolNode) -> Array[untyped] - - # : (TrueNode) -> Array[untyped] - def visit_true_node: (TrueNode) -> Array[untyped] - - # : (UndefNode) -> Array[untyped] - def visit_undef_node: (UndefNode) -> Array[untyped] - - # : (UnlessNode) -> Array[untyped] - def visit_unless_node: (UnlessNode) -> Array[untyped] - - # : (UntilNode) -> Array[untyped] - def visit_until_node: (UntilNode) -> Array[untyped] - - # : (WhenNode) -> Array[untyped] - def visit_when_node: (WhenNode) -> Array[untyped] - - # : (WhileNode) -> Array[untyped] - def visit_while_node: (WhileNode) -> Array[untyped] - - # : (XStringNode) -> Array[untyped] - def visit_x_string_node: (XStringNode) -> Array[untyped] - - # : (YieldNode) -> Array[untyped] - def visit_yield_node: (YieldNode) -> Array[untyped] - end -end diff --git a/sig/generated/prism/desugar_compiler.rbs b/sig/generated/prism/desugar_compiler.rbs deleted file mode 100644 index d5bb07edf1..0000000000 --- a/sig/generated/prism/desugar_compiler.rbs +++ /dev/null @@ -1,305 +0,0 @@ -# Generated from lib/prism/desugar_compiler.rb with RBS::Inline - -module Prism - class DesugarAndWriteNode - include DSL - - attr_reader node: ClassVariableAndWriteNode | ConstantAndWriteNode | GlobalVariableAndWriteNode | InstanceVariableAndWriteNode | LocalVariableAndWriteNode - - attr_reader default_source: Source - - attr_reader read_class: Symbol - - attr_reader write_class: Symbol - - attr_reader arguments: Hash[Symbol, untyped] - - # : ((ClassVariableAndWriteNode | ConstantAndWriteNode | GlobalVariableAndWriteNode | InstanceVariableAndWriteNode | LocalVariableAndWriteNode) node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - def initialize: (ClassVariableAndWriteNode | ConstantAndWriteNode | GlobalVariableAndWriteNode | InstanceVariableAndWriteNode | LocalVariableAndWriteNode node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - - # Desugar `x &&= y` to `x && x = y` - # -- - # : () -> node - def compile: () -> node - end - - class DesugarOrWriteDefinedNode - include DSL - - attr_reader node: ClassVariableOrWriteNode | ConstantOrWriteNode | GlobalVariableOrWriteNode - - attr_reader default_source: Source - - attr_reader read_class: Symbol - - attr_reader write_class: Symbol - - attr_reader arguments: Hash[Symbol, untyped] - - # : ((ClassVariableOrWriteNode | ConstantOrWriteNode | GlobalVariableOrWriteNode) node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - def initialize: (ClassVariableOrWriteNode | ConstantOrWriteNode | GlobalVariableOrWriteNode node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - - # Desugar `x ||= y` to `defined?(x) ? x : x = y` - # -- - # : () -> node - def compile: () -> node - end - - class DesugarOperatorWriteNode - include DSL - - attr_reader node: ClassVariableOperatorWriteNode | ConstantOperatorWriteNode | GlobalVariableOperatorWriteNode | InstanceVariableOperatorWriteNode | LocalVariableOperatorWriteNode - - attr_reader default_source: Source - - attr_reader read_class: Symbol - - attr_reader write_class: Symbol - - attr_reader arguments: Hash[Symbol, untyped] - - # : ((ClassVariableOperatorWriteNode | ConstantOperatorWriteNode | GlobalVariableOperatorWriteNode | InstanceVariableOperatorWriteNode | LocalVariableOperatorWriteNode) node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - def initialize: (ClassVariableOperatorWriteNode | ConstantOperatorWriteNode | GlobalVariableOperatorWriteNode | InstanceVariableOperatorWriteNode | LocalVariableOperatorWriteNode node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - - # Desugar `x += y` to `x = x + y` - # -- - # : () -> node - def compile: () -> node - end - - class DesugarOrWriteNode - include DSL - - attr_reader node: InstanceVariableOrWriteNode | LocalVariableOrWriteNode - - attr_reader default_source: Source - - attr_reader read_class: Symbol - - attr_reader write_class: Symbol - - attr_reader arguments: Hash[Symbol, untyped] - - # : ((InstanceVariableOrWriteNode | LocalVariableOrWriteNode) node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - def initialize: (InstanceVariableOrWriteNode | LocalVariableOrWriteNode node, Source default_source, Symbol read_class, Symbol write_class, **untyped arguments) -> void - - # Desugar `x ||= y` to `x || x = y` - # -- - # : () -> node - def compile: () -> node - end - - class ClassVariableAndWriteNode - # : () -> node - def desugar: () -> node - end - - class ClassVariableOrWriteNode - # : () -> node - def desugar: () -> node - end - - class ClassVariableOperatorWriteNode - # : () -> node - def desugar: () -> node - end - - class ConstantAndWriteNode - # : () -> node - def desugar: () -> node - end - - class ConstantOrWriteNode - # : () -> node - def desugar: () -> node - end - - class ConstantOperatorWriteNode - # : () -> node - def desugar: () -> node - end - - class GlobalVariableAndWriteNode - # : () -> node - def desugar: () -> node - end - - class GlobalVariableOrWriteNode - # : () -> node - def desugar: () -> node - end - - class GlobalVariableOperatorWriteNode - # : () -> node - def desugar: () -> node - end - - class InstanceVariableAndWriteNode - # : () -> node - def desugar: () -> node - end - - class InstanceVariableOrWriteNode - # : () -> node - def desugar: () -> node - end - - class InstanceVariableOperatorWriteNode - # : () -> node - def desugar: () -> node - end - - class LocalVariableAndWriteNode - # : () -> node - def desugar: () -> node - end - - class LocalVariableOrWriteNode - # : () -> node - def desugar: () -> node - end - - class LocalVariableOperatorWriteNode - # : () -> node - def desugar: () -> node - end - - # DesugarCompiler is a compiler that desugars Ruby code into a more primitive - # form. This is useful for consumers that want to deal with fewer node types. - class DesugarCompiler < MutationCompiler - # `@@foo &&= bar` - # - # becomes - # - # `@@foo && @@foo = bar` - # -- - # : (ClassVariableAndWriteNode node) -> node - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode node) -> node - - # `@@foo ||= bar` - # - # becomes - # - # `defined?(@@foo) ? @@foo : @@foo = bar` - # -- - # : (ClassVariableOrWriteNode node) -> node - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode node) -> node - - # `@@foo += bar` - # - # becomes - # - # `@@foo = @@foo + bar` - # -- - # : (ClassVariableOperatorWriteNode node) -> node - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode node) -> node - - # `Foo &&= bar` - # - # becomes - # - # `Foo && Foo = bar` - # -- - # : (ConstantAndWriteNode node) -> node - def visit_constant_and_write_node: (ConstantAndWriteNode node) -> node - - # `Foo ||= bar` - # - # becomes - # - # `defined?(Foo) ? Foo : Foo = bar` - # -- - # : (ConstantOrWriteNode node) -> node - def visit_constant_or_write_node: (ConstantOrWriteNode node) -> node - - # `Foo += bar` - # - # becomes - # - # `Foo = Foo + bar` - # -- - # : (ConstantOperatorWriteNode node) -> node - def visit_constant_operator_write_node: (ConstantOperatorWriteNode node) -> node - - # `$foo &&= bar` - # - # becomes - # - # `$foo && $foo = bar` - # -- - # : (GlobalVariableAndWriteNode node) -> node - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode node) -> node - - # `$foo ||= bar` - # - # becomes - # - # `defined?($foo) ? $foo : $foo = bar` - # -- - # : (GlobalVariableOrWriteNode node) -> node - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode node) -> node - - # `$foo += bar` - # - # becomes - # - # `$foo = $foo + bar` - # -- - # : (GlobalVariableOperatorWriteNode node) -> node - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode node) -> node - - # `@foo &&= bar` - # - # becomes - # - # `@foo && @foo = bar` - # -- - # : (InstanceVariableAndWriteNode node) -> node - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode node) -> node - - # `@foo ||= bar` - # - # becomes - # - # `@foo || @foo = bar` - # -- - # : (InstanceVariableOrWriteNode node) -> node - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode node) -> node - - # `@foo += bar` - # - # becomes - # - # `@foo = @foo + bar` - # -- - # : (InstanceVariableOperatorWriteNode node) -> node - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode node) -> node - - # `foo &&= bar` - # - # becomes - # - # `foo && foo = bar` - # -- - # : (LocalVariableAndWriteNode node) -> node - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode node) -> node - - # `foo ||= bar` - # - # becomes - # - # `foo || foo = bar` - # -- - # : (LocalVariableOrWriteNode node) -> node - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode node) -> node - - # `foo += bar` - # - # becomes - # - # `foo = foo + bar` - # -- - # : (LocalVariableOperatorWriteNode node) -> node - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode node) -> node - end -end diff --git a/sig/generated/prism/dispatcher.rbs b/sig/generated/prism/dispatcher.rbs deleted file mode 100644 index 0463d2b0ba..0000000000 --- a/sig/generated/prism/dispatcher.rbs +++ /dev/null @@ -1,1292 +0,0 @@ -# Generated from lib/prism/dispatcher.rb with RBS::Inline - -module Prism - # The dispatcher class fires events for nodes that are found while walking an - # AST to all registered listeners. It's useful for performing different types - # of analysis on the AST while only having to walk the tree once. - # - # To use the dispatcher, you would first instantiate it and register listeners - # for the events you're interested in: - # - # class OctalListener - # def on_integer_node_enter(node) - # if node.octal? && !node.slice.start_with?("0o") - # warn("Octal integers should be written with the 0o prefix") - # end - # end - # end - # - # listener = OctalListener.new - # dispatcher = Prism::Dispatcher.new - # dispatcher.register(listener, :on_integer_node_enter) - # - # Then, you can walk any number of trees and dispatch events to the listeners: - # - # result = Prism.parse("001 + 002 + 003") - # dispatcher.dispatch(result.value) - # - # Optionally, you can also use `#dispatch_once` to dispatch enter and leave - # events for a single node without recursing further down the tree. This can - # be useful in circumstances where you want to reuse the listeners you already - # have registers but want to stop walking the tree at a certain point. - # - # integer = result.value.statements.body.first.receiver.receiver - # dispatcher.dispatch_once(integer) - class Dispatcher < Visitor - # A hash mapping event names to arrays of listeners that should be notified - # when that event is fired. - attr_reader listeners: Hash[Symbol, Array[untyped]] - - # Initialize a new dispatcher. - # -- - # : () -> void - def initialize: () -> void - - # Register a listener for one or more events. - # -- - # : (untyped, *Symbol) -> void - def register: (untyped, *Symbol) -> void - - # Register all public methods of a listener that match the pattern - # `on__(enter|leave)`. - # -- - # : (untyped) -> void - def register_public_methods: (untyped) -> void - - # Register a listener for the given events. - # -- - # : (untyped, Array[Symbol]) -> void - private def register_events: (untyped, Array[Symbol]) -> void - - # Walks `root` dispatching events to all registered listeners. - alias dispatch visit - - # Dispatches a single event for `node` to all registered listeners. - # -- - # : (node node) -> void - def dispatch_once: (node node) -> void - - # : (AliasGlobalVariableNode node) -> void - def visit_alias_global_variable_node: (AliasGlobalVariableNode node) -> void - - # : (AliasMethodNode node) -> void - def visit_alias_method_node: (AliasMethodNode node) -> void - - # : (AlternationPatternNode node) -> void - def visit_alternation_pattern_node: (AlternationPatternNode node) -> void - - # : (AndNode node) -> void - def visit_and_node: (AndNode node) -> void - - # : (ArgumentsNode node) -> void - def visit_arguments_node: (ArgumentsNode node) -> void - - # : (ArrayNode node) -> void - def visit_array_node: (ArrayNode node) -> void - - # : (ArrayPatternNode node) -> void - def visit_array_pattern_node: (ArrayPatternNode node) -> void - - # : (AssocNode node) -> void - def visit_assoc_node: (AssocNode node) -> void - - # : (AssocSplatNode node) -> void - def visit_assoc_splat_node: (AssocSplatNode node) -> void - - # : (BackReferenceReadNode node) -> void - def visit_back_reference_read_node: (BackReferenceReadNode node) -> void - - # : (BeginNode node) -> void - def visit_begin_node: (BeginNode node) -> void - - # : (BlockArgumentNode node) -> void - def visit_block_argument_node: (BlockArgumentNode node) -> void - - # : (BlockLocalVariableNode node) -> void - def visit_block_local_variable_node: (BlockLocalVariableNode node) -> void - - # : (BlockNode node) -> void - def visit_block_node: (BlockNode node) -> void - - # : (BlockParameterNode node) -> void - def visit_block_parameter_node: (BlockParameterNode node) -> void - - # : (BlockParametersNode node) -> void - def visit_block_parameters_node: (BlockParametersNode node) -> void - - # : (BreakNode node) -> void - def visit_break_node: (BreakNode node) -> void - - # : (CallAndWriteNode node) -> void - def visit_call_and_write_node: (CallAndWriteNode node) -> void - - # : (CallNode node) -> void - def visit_call_node: (CallNode node) -> void - - # : (CallOperatorWriteNode node) -> void - def visit_call_operator_write_node: (CallOperatorWriteNode node) -> void - - # : (CallOrWriteNode node) -> void - def visit_call_or_write_node: (CallOrWriteNode node) -> void - - # : (CallTargetNode node) -> void - def visit_call_target_node: (CallTargetNode node) -> void - - # : (CapturePatternNode node) -> void - def visit_capture_pattern_node: (CapturePatternNode node) -> void - - # : (CaseMatchNode node) -> void - def visit_case_match_node: (CaseMatchNode node) -> void - - # : (CaseNode node) -> void - def visit_case_node: (CaseNode node) -> void - - # : (ClassNode node) -> void - def visit_class_node: (ClassNode node) -> void - - # : (ClassVariableAndWriteNode node) -> void - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode node) -> void - - # : (ClassVariableOperatorWriteNode node) -> void - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode node) -> void - - # : (ClassVariableOrWriteNode node) -> void - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode node) -> void - - # : (ClassVariableReadNode node) -> void - def visit_class_variable_read_node: (ClassVariableReadNode node) -> void - - # : (ClassVariableTargetNode node) -> void - def visit_class_variable_target_node: (ClassVariableTargetNode node) -> void - - # : (ClassVariableWriteNode node) -> void - def visit_class_variable_write_node: (ClassVariableWriteNode node) -> void - - # : (ConstantAndWriteNode node) -> void - def visit_constant_and_write_node: (ConstantAndWriteNode node) -> void - - # : (ConstantOperatorWriteNode node) -> void - def visit_constant_operator_write_node: (ConstantOperatorWriteNode node) -> void - - # : (ConstantOrWriteNode node) -> void - def visit_constant_or_write_node: (ConstantOrWriteNode node) -> void - - # : (ConstantPathAndWriteNode node) -> void - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode node) -> void - - # : (ConstantPathNode node) -> void - def visit_constant_path_node: (ConstantPathNode node) -> void - - # : (ConstantPathOperatorWriteNode node) -> void - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode node) -> void - - # : (ConstantPathOrWriteNode node) -> void - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode node) -> void - - # : (ConstantPathTargetNode node) -> void - def visit_constant_path_target_node: (ConstantPathTargetNode node) -> void - - # : (ConstantPathWriteNode node) -> void - def visit_constant_path_write_node: (ConstantPathWriteNode node) -> void - - # : (ConstantReadNode node) -> void - def visit_constant_read_node: (ConstantReadNode node) -> void - - # : (ConstantTargetNode node) -> void - def visit_constant_target_node: (ConstantTargetNode node) -> void - - # : (ConstantWriteNode node) -> void - def visit_constant_write_node: (ConstantWriteNode node) -> void - - # : (DefNode node) -> void - def visit_def_node: (DefNode node) -> void - - # : (DefinedNode node) -> void - def visit_defined_node: (DefinedNode node) -> void - - # : (ElseNode node) -> void - def visit_else_node: (ElseNode node) -> void - - # : (EmbeddedStatementsNode node) -> void - def visit_embedded_statements_node: (EmbeddedStatementsNode node) -> void - - # : (EmbeddedVariableNode node) -> void - def visit_embedded_variable_node: (EmbeddedVariableNode node) -> void - - # : (EnsureNode node) -> void - def visit_ensure_node: (EnsureNode node) -> void - - # : (FalseNode node) -> void - def visit_false_node: (FalseNode node) -> void - - # : (FindPatternNode node) -> void - def visit_find_pattern_node: (FindPatternNode node) -> void - - # : (FlipFlopNode node) -> void - def visit_flip_flop_node: (FlipFlopNode node) -> void - - # : (FloatNode node) -> void - def visit_float_node: (FloatNode node) -> void - - # : (ForNode node) -> void - def visit_for_node: (ForNode node) -> void - - # : (ForwardingArgumentsNode node) -> void - def visit_forwarding_arguments_node: (ForwardingArgumentsNode node) -> void - - # : (ForwardingParameterNode node) -> void - def visit_forwarding_parameter_node: (ForwardingParameterNode node) -> void - - # : (ForwardingSuperNode node) -> void - def visit_forwarding_super_node: (ForwardingSuperNode node) -> void - - # : (GlobalVariableAndWriteNode node) -> void - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode node) -> void - - # : (GlobalVariableOperatorWriteNode node) -> void - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode node) -> void - - # : (GlobalVariableOrWriteNode node) -> void - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode node) -> void - - # : (GlobalVariableReadNode node) -> void - def visit_global_variable_read_node: (GlobalVariableReadNode node) -> void - - # : (GlobalVariableTargetNode node) -> void - def visit_global_variable_target_node: (GlobalVariableTargetNode node) -> void - - # : (GlobalVariableWriteNode node) -> void - def visit_global_variable_write_node: (GlobalVariableWriteNode node) -> void - - # : (HashNode node) -> void - def visit_hash_node: (HashNode node) -> void - - # : (HashPatternNode node) -> void - def visit_hash_pattern_node: (HashPatternNode node) -> void - - # : (IfNode node) -> void - def visit_if_node: (IfNode node) -> void - - # : (ImaginaryNode node) -> void - def visit_imaginary_node: (ImaginaryNode node) -> void - - # : (ImplicitNode node) -> void - def visit_implicit_node: (ImplicitNode node) -> void - - # : (ImplicitRestNode node) -> void - def visit_implicit_rest_node: (ImplicitRestNode node) -> void - - # : (InNode node) -> void - def visit_in_node: (InNode node) -> void - - # : (IndexAndWriteNode node) -> void - def visit_index_and_write_node: (IndexAndWriteNode node) -> void - - # : (IndexOperatorWriteNode node) -> void - def visit_index_operator_write_node: (IndexOperatorWriteNode node) -> void - - # : (IndexOrWriteNode node) -> void - def visit_index_or_write_node: (IndexOrWriteNode node) -> void - - # : (IndexTargetNode node) -> void - def visit_index_target_node: (IndexTargetNode node) -> void - - # : (InstanceVariableAndWriteNode node) -> void - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode node) -> void - - # : (InstanceVariableOperatorWriteNode node) -> void - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode node) -> void - - # : (InstanceVariableOrWriteNode node) -> void - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode node) -> void - - # : (InstanceVariableReadNode node) -> void - def visit_instance_variable_read_node: (InstanceVariableReadNode node) -> void - - # : (InstanceVariableTargetNode node) -> void - def visit_instance_variable_target_node: (InstanceVariableTargetNode node) -> void - - # : (InstanceVariableWriteNode node) -> void - def visit_instance_variable_write_node: (InstanceVariableWriteNode node) -> void - - # : (IntegerNode node) -> void - def visit_integer_node: (IntegerNode node) -> void - - # : (InterpolatedMatchLastLineNode node) -> void - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode node) -> void - - # : (InterpolatedRegularExpressionNode node) -> void - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode node) -> void - - # : (InterpolatedStringNode node) -> void - def visit_interpolated_string_node: (InterpolatedStringNode node) -> void - - # : (InterpolatedSymbolNode node) -> void - def visit_interpolated_symbol_node: (InterpolatedSymbolNode node) -> void - - # : (InterpolatedXStringNode node) -> void - def visit_interpolated_x_string_node: (InterpolatedXStringNode node) -> void - - # : (ItLocalVariableReadNode node) -> void - def visit_it_local_variable_read_node: (ItLocalVariableReadNode node) -> void - - # : (ItParametersNode node) -> void - def visit_it_parameters_node: (ItParametersNode node) -> void - - # : (KeywordHashNode node) -> void - def visit_keyword_hash_node: (KeywordHashNode node) -> void - - # : (KeywordRestParameterNode node) -> void - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode node) -> void - - # : (LambdaNode node) -> void - def visit_lambda_node: (LambdaNode node) -> void - - # : (LocalVariableAndWriteNode node) -> void - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode node) -> void - - # : (LocalVariableOperatorWriteNode node) -> void - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode node) -> void - - # : (LocalVariableOrWriteNode node) -> void - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode node) -> void - - # : (LocalVariableReadNode node) -> void - def visit_local_variable_read_node: (LocalVariableReadNode node) -> void - - # : (LocalVariableTargetNode node) -> void - def visit_local_variable_target_node: (LocalVariableTargetNode node) -> void - - # : (LocalVariableWriteNode node) -> void - def visit_local_variable_write_node: (LocalVariableWriteNode node) -> void - - # : (MatchLastLineNode node) -> void - def visit_match_last_line_node: (MatchLastLineNode node) -> void - - # : (MatchPredicateNode node) -> void - def visit_match_predicate_node: (MatchPredicateNode node) -> void - - # : (MatchRequiredNode node) -> void - def visit_match_required_node: (MatchRequiredNode node) -> void - - # : (MatchWriteNode node) -> void - def visit_match_write_node: (MatchWriteNode node) -> void - - # : (MissingNode node) -> void - def visit_missing_node: (MissingNode node) -> void - - # : (ModuleNode node) -> void - def visit_module_node: (ModuleNode node) -> void - - # : (MultiTargetNode node) -> void - def visit_multi_target_node: (MultiTargetNode node) -> void - - # : (MultiWriteNode node) -> void - def visit_multi_write_node: (MultiWriteNode node) -> void - - # : (NextNode node) -> void - def visit_next_node: (NextNode node) -> void - - # : (NilNode node) -> void - def visit_nil_node: (NilNode node) -> void - - # : (NoBlockParameterNode node) -> void - def visit_no_block_parameter_node: (NoBlockParameterNode node) -> void - - # : (NoKeywordsParameterNode node) -> void - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode node) -> void - - # : (NumberedParametersNode node) -> void - def visit_numbered_parameters_node: (NumberedParametersNode node) -> void - - # : (NumberedReferenceReadNode node) -> void - def visit_numbered_reference_read_node: (NumberedReferenceReadNode node) -> void - - # : (OptionalKeywordParameterNode node) -> void - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode node) -> void - - # : (OptionalParameterNode node) -> void - def visit_optional_parameter_node: (OptionalParameterNode node) -> void - - # : (OrNode node) -> void - def visit_or_node: (OrNode node) -> void - - # : (ParametersNode node) -> void - def visit_parameters_node: (ParametersNode node) -> void - - # : (ParenthesesNode node) -> void - def visit_parentheses_node: (ParenthesesNode node) -> void - - # : (PinnedExpressionNode node) -> void - def visit_pinned_expression_node: (PinnedExpressionNode node) -> void - - # : (PinnedVariableNode node) -> void - def visit_pinned_variable_node: (PinnedVariableNode node) -> void - - # : (PostExecutionNode node) -> void - def visit_post_execution_node: (PostExecutionNode node) -> void - - # : (PreExecutionNode node) -> void - def visit_pre_execution_node: (PreExecutionNode node) -> void - - # : (ProgramNode node) -> void - def visit_program_node: (ProgramNode node) -> void - - # : (RangeNode node) -> void - def visit_range_node: (RangeNode node) -> void - - # : (RationalNode node) -> void - def visit_rational_node: (RationalNode node) -> void - - # : (RedoNode node) -> void - def visit_redo_node: (RedoNode node) -> void - - # : (RegularExpressionNode node) -> void - def visit_regular_expression_node: (RegularExpressionNode node) -> void - - # : (RequiredKeywordParameterNode node) -> void - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode node) -> void - - # : (RequiredParameterNode node) -> void - def visit_required_parameter_node: (RequiredParameterNode node) -> void - - # : (RescueModifierNode node) -> void - def visit_rescue_modifier_node: (RescueModifierNode node) -> void - - # : (RescueNode node) -> void - def visit_rescue_node: (RescueNode node) -> void - - # : (RestParameterNode node) -> void - def visit_rest_parameter_node: (RestParameterNode node) -> void - - # : (RetryNode node) -> void - def visit_retry_node: (RetryNode node) -> void - - # : (ReturnNode node) -> void - def visit_return_node: (ReturnNode node) -> void - - # : (SelfNode node) -> void - def visit_self_node: (SelfNode node) -> void - - # : (ShareableConstantNode node) -> void - def visit_shareable_constant_node: (ShareableConstantNode node) -> void - - # : (SingletonClassNode node) -> void - def visit_singleton_class_node: (SingletonClassNode node) -> void - - # : (SourceEncodingNode node) -> void - def visit_source_encoding_node: (SourceEncodingNode node) -> void - - # : (SourceFileNode node) -> void - def visit_source_file_node: (SourceFileNode node) -> void - - # : (SourceLineNode node) -> void - def visit_source_line_node: (SourceLineNode node) -> void - - # : (SplatNode node) -> void - def visit_splat_node: (SplatNode node) -> void - - # : (StatementsNode node) -> void - def visit_statements_node: (StatementsNode node) -> void - - # : (StringNode node) -> void - def visit_string_node: (StringNode node) -> void - - # : (SuperNode node) -> void - def visit_super_node: (SuperNode node) -> void - - # : (SymbolNode node) -> void - def visit_symbol_node: (SymbolNode node) -> void - - # : (TrueNode node) -> void - def visit_true_node: (TrueNode node) -> void - - # : (UndefNode node) -> void - def visit_undef_node: (UndefNode node) -> void - - # : (UnlessNode node) -> void - def visit_unless_node: (UnlessNode node) -> void - - # : (UntilNode node) -> void - def visit_until_node: (UntilNode node) -> void - - # : (WhenNode node) -> void - def visit_when_node: (WhenNode node) -> void - - # : (WhileNode node) -> void - def visit_while_node: (WhileNode node) -> void - - # : (XStringNode node) -> void - def visit_x_string_node: (XStringNode node) -> void - - # : (YieldNode node) -> void - def visit_yield_node: (YieldNode node) -> void - - class DispatchOnce < Visitor - attr_reader listeners: Hash[Symbol, Array[untyped]] - - # : (Hash[Symbol, Array[untyped]] listeners) -> void - def initialize: (Hash[Symbol, Array[untyped]] listeners) -> void - - # Dispatch enter and leave events for AliasGlobalVariableNode nodes. - # -- - # : (AliasGlobalVariableNode node) -> void - def visit_alias_global_variable_node: (AliasGlobalVariableNode node) -> void - - # Dispatch enter and leave events for AliasMethodNode nodes. - # -- - # : (AliasMethodNode node) -> void - def visit_alias_method_node: (AliasMethodNode node) -> void - - # Dispatch enter and leave events for AlternationPatternNode nodes. - # -- - # : (AlternationPatternNode node) -> void - def visit_alternation_pattern_node: (AlternationPatternNode node) -> void - - # Dispatch enter and leave events for AndNode nodes. - # -- - # : (AndNode node) -> void - def visit_and_node: (AndNode node) -> void - - # Dispatch enter and leave events for ArgumentsNode nodes. - # -- - # : (ArgumentsNode node) -> void - def visit_arguments_node: (ArgumentsNode node) -> void - - # Dispatch enter and leave events for ArrayNode nodes. - # -- - # : (ArrayNode node) -> void - def visit_array_node: (ArrayNode node) -> void - - # Dispatch enter and leave events for ArrayPatternNode nodes. - # -- - # : (ArrayPatternNode node) -> void - def visit_array_pattern_node: (ArrayPatternNode node) -> void - - # Dispatch enter and leave events for AssocNode nodes. - # -- - # : (AssocNode node) -> void - def visit_assoc_node: (AssocNode node) -> void - - # Dispatch enter and leave events for AssocSplatNode nodes. - # -- - # : (AssocSplatNode node) -> void - def visit_assoc_splat_node: (AssocSplatNode node) -> void - - # Dispatch enter and leave events for BackReferenceReadNode nodes. - # -- - # : (BackReferenceReadNode node) -> void - def visit_back_reference_read_node: (BackReferenceReadNode node) -> void - - # Dispatch enter and leave events for BeginNode nodes. - # -- - # : (BeginNode node) -> void - def visit_begin_node: (BeginNode node) -> void - - # Dispatch enter and leave events for BlockArgumentNode nodes. - # -- - # : (BlockArgumentNode node) -> void - def visit_block_argument_node: (BlockArgumentNode node) -> void - - # Dispatch enter and leave events for BlockLocalVariableNode nodes. - # -- - # : (BlockLocalVariableNode node) -> void - def visit_block_local_variable_node: (BlockLocalVariableNode node) -> void - - # Dispatch enter and leave events for BlockNode nodes. - # -- - # : (BlockNode node) -> void - def visit_block_node: (BlockNode node) -> void - - # Dispatch enter and leave events for BlockParameterNode nodes. - # -- - # : (BlockParameterNode node) -> void - def visit_block_parameter_node: (BlockParameterNode node) -> void - - # Dispatch enter and leave events for BlockParametersNode nodes. - # -- - # : (BlockParametersNode node) -> void - def visit_block_parameters_node: (BlockParametersNode node) -> void - - # Dispatch enter and leave events for BreakNode nodes. - # -- - # : (BreakNode node) -> void - def visit_break_node: (BreakNode node) -> void - - # Dispatch enter and leave events for CallAndWriteNode nodes. - # -- - # : (CallAndWriteNode node) -> void - def visit_call_and_write_node: (CallAndWriteNode node) -> void - - # Dispatch enter and leave events for CallNode nodes. - # -- - # : (CallNode node) -> void - def visit_call_node: (CallNode node) -> void - - # Dispatch enter and leave events for CallOperatorWriteNode nodes. - # -- - # : (CallOperatorWriteNode node) -> void - def visit_call_operator_write_node: (CallOperatorWriteNode node) -> void - - # Dispatch enter and leave events for CallOrWriteNode nodes. - # -- - # : (CallOrWriteNode node) -> void - def visit_call_or_write_node: (CallOrWriteNode node) -> void - - # Dispatch enter and leave events for CallTargetNode nodes. - # -- - # : (CallTargetNode node) -> void - def visit_call_target_node: (CallTargetNode node) -> void - - # Dispatch enter and leave events for CapturePatternNode nodes. - # -- - # : (CapturePatternNode node) -> void - def visit_capture_pattern_node: (CapturePatternNode node) -> void - - # Dispatch enter and leave events for CaseMatchNode nodes. - # -- - # : (CaseMatchNode node) -> void - def visit_case_match_node: (CaseMatchNode node) -> void - - # Dispatch enter and leave events for CaseNode nodes. - # -- - # : (CaseNode node) -> void - def visit_case_node: (CaseNode node) -> void - - # Dispatch enter and leave events for ClassNode nodes. - # -- - # : (ClassNode node) -> void - def visit_class_node: (ClassNode node) -> void - - # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. - # -- - # : (ClassVariableAndWriteNode node) -> void - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode node) -> void - - # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. - # -- - # : (ClassVariableOperatorWriteNode node) -> void - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode node) -> void - - # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. - # -- - # : (ClassVariableOrWriteNode node) -> void - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode node) -> void - - # Dispatch enter and leave events for ClassVariableReadNode nodes. - # -- - # : (ClassVariableReadNode node) -> void - def visit_class_variable_read_node: (ClassVariableReadNode node) -> void - - # Dispatch enter and leave events for ClassVariableTargetNode nodes. - # -- - # : (ClassVariableTargetNode node) -> void - def visit_class_variable_target_node: (ClassVariableTargetNode node) -> void - - # Dispatch enter and leave events for ClassVariableWriteNode nodes. - # -- - # : (ClassVariableWriteNode node) -> void - def visit_class_variable_write_node: (ClassVariableWriteNode node) -> void - - # Dispatch enter and leave events for ConstantAndWriteNode nodes. - # -- - # : (ConstantAndWriteNode node) -> void - def visit_constant_and_write_node: (ConstantAndWriteNode node) -> void - - # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. - # -- - # : (ConstantOperatorWriteNode node) -> void - def visit_constant_operator_write_node: (ConstantOperatorWriteNode node) -> void - - # Dispatch enter and leave events for ConstantOrWriteNode nodes. - # -- - # : (ConstantOrWriteNode node) -> void - def visit_constant_or_write_node: (ConstantOrWriteNode node) -> void - - # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. - # -- - # : (ConstantPathAndWriteNode node) -> void - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode node) -> void - - # Dispatch enter and leave events for ConstantPathNode nodes. - # -- - # : (ConstantPathNode node) -> void - def visit_constant_path_node: (ConstantPathNode node) -> void - - # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. - # -- - # : (ConstantPathOperatorWriteNode node) -> void - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode node) -> void - - # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. - # -- - # : (ConstantPathOrWriteNode node) -> void - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode node) -> void - - # Dispatch enter and leave events for ConstantPathTargetNode nodes. - # -- - # : (ConstantPathTargetNode node) -> void - def visit_constant_path_target_node: (ConstantPathTargetNode node) -> void - - # Dispatch enter and leave events for ConstantPathWriteNode nodes. - # -- - # : (ConstantPathWriteNode node) -> void - def visit_constant_path_write_node: (ConstantPathWriteNode node) -> void - - # Dispatch enter and leave events for ConstantReadNode nodes. - # -- - # : (ConstantReadNode node) -> void - def visit_constant_read_node: (ConstantReadNode node) -> void - - # Dispatch enter and leave events for ConstantTargetNode nodes. - # -- - # : (ConstantTargetNode node) -> void - def visit_constant_target_node: (ConstantTargetNode node) -> void - - # Dispatch enter and leave events for ConstantWriteNode nodes. - # -- - # : (ConstantWriteNode node) -> void - def visit_constant_write_node: (ConstantWriteNode node) -> void - - # Dispatch enter and leave events for DefNode nodes. - # -- - # : (DefNode node) -> void - def visit_def_node: (DefNode node) -> void - - # Dispatch enter and leave events for DefinedNode nodes. - # -- - # : (DefinedNode node) -> void - def visit_defined_node: (DefinedNode node) -> void - - # Dispatch enter and leave events for ElseNode nodes. - # -- - # : (ElseNode node) -> void - def visit_else_node: (ElseNode node) -> void - - # Dispatch enter and leave events for EmbeddedStatementsNode nodes. - # -- - # : (EmbeddedStatementsNode node) -> void - def visit_embedded_statements_node: (EmbeddedStatementsNode node) -> void - - # Dispatch enter and leave events for EmbeddedVariableNode nodes. - # -- - # : (EmbeddedVariableNode node) -> void - def visit_embedded_variable_node: (EmbeddedVariableNode node) -> void - - # Dispatch enter and leave events for EnsureNode nodes. - # -- - # : (EnsureNode node) -> void - def visit_ensure_node: (EnsureNode node) -> void - - # Dispatch enter and leave events for FalseNode nodes. - # -- - # : (FalseNode node) -> void - def visit_false_node: (FalseNode node) -> void - - # Dispatch enter and leave events for FindPatternNode nodes. - # -- - # : (FindPatternNode node) -> void - def visit_find_pattern_node: (FindPatternNode node) -> void - - # Dispatch enter and leave events for FlipFlopNode nodes. - # -- - # : (FlipFlopNode node) -> void - def visit_flip_flop_node: (FlipFlopNode node) -> void - - # Dispatch enter and leave events for FloatNode nodes. - # -- - # : (FloatNode node) -> void - def visit_float_node: (FloatNode node) -> void - - # Dispatch enter and leave events for ForNode nodes. - # -- - # : (ForNode node) -> void - def visit_for_node: (ForNode node) -> void - - # Dispatch enter and leave events for ForwardingArgumentsNode nodes. - # -- - # : (ForwardingArgumentsNode node) -> void - def visit_forwarding_arguments_node: (ForwardingArgumentsNode node) -> void - - # Dispatch enter and leave events for ForwardingParameterNode nodes. - # -- - # : (ForwardingParameterNode node) -> void - def visit_forwarding_parameter_node: (ForwardingParameterNode node) -> void - - # Dispatch enter and leave events for ForwardingSuperNode nodes. - # -- - # : (ForwardingSuperNode node) -> void - def visit_forwarding_super_node: (ForwardingSuperNode node) -> void - - # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. - # -- - # : (GlobalVariableAndWriteNode node) -> void - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode node) -> void - - # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. - # -- - # : (GlobalVariableOperatorWriteNode node) -> void - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode node) -> void - - # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. - # -- - # : (GlobalVariableOrWriteNode node) -> void - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode node) -> void - - # Dispatch enter and leave events for GlobalVariableReadNode nodes. - # -- - # : (GlobalVariableReadNode node) -> void - def visit_global_variable_read_node: (GlobalVariableReadNode node) -> void - - # Dispatch enter and leave events for GlobalVariableTargetNode nodes. - # -- - # : (GlobalVariableTargetNode node) -> void - def visit_global_variable_target_node: (GlobalVariableTargetNode node) -> void - - # Dispatch enter and leave events for GlobalVariableWriteNode nodes. - # -- - # : (GlobalVariableWriteNode node) -> void - def visit_global_variable_write_node: (GlobalVariableWriteNode node) -> void - - # Dispatch enter and leave events for HashNode nodes. - # -- - # : (HashNode node) -> void - def visit_hash_node: (HashNode node) -> void - - # Dispatch enter and leave events for HashPatternNode nodes. - # -- - # : (HashPatternNode node) -> void - def visit_hash_pattern_node: (HashPatternNode node) -> void - - # Dispatch enter and leave events for IfNode nodes. - # -- - # : (IfNode node) -> void - def visit_if_node: (IfNode node) -> void - - # Dispatch enter and leave events for ImaginaryNode nodes. - # -- - # : (ImaginaryNode node) -> void - def visit_imaginary_node: (ImaginaryNode node) -> void - - # Dispatch enter and leave events for ImplicitNode nodes. - # -- - # : (ImplicitNode node) -> void - def visit_implicit_node: (ImplicitNode node) -> void - - # Dispatch enter and leave events for ImplicitRestNode nodes. - # -- - # : (ImplicitRestNode node) -> void - def visit_implicit_rest_node: (ImplicitRestNode node) -> void - - # Dispatch enter and leave events for InNode nodes. - # -- - # : (InNode node) -> void - def visit_in_node: (InNode node) -> void - - # Dispatch enter and leave events for IndexAndWriteNode nodes. - # -- - # : (IndexAndWriteNode node) -> void - def visit_index_and_write_node: (IndexAndWriteNode node) -> void - - # Dispatch enter and leave events for IndexOperatorWriteNode nodes. - # -- - # : (IndexOperatorWriteNode node) -> void - def visit_index_operator_write_node: (IndexOperatorWriteNode node) -> void - - # Dispatch enter and leave events for IndexOrWriteNode nodes. - # -- - # : (IndexOrWriteNode node) -> void - def visit_index_or_write_node: (IndexOrWriteNode node) -> void - - # Dispatch enter and leave events for IndexTargetNode nodes. - # -- - # : (IndexTargetNode node) -> void - def visit_index_target_node: (IndexTargetNode node) -> void - - # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. - # -- - # : (InstanceVariableAndWriteNode node) -> void - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode node) -> void - - # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. - # -- - # : (InstanceVariableOperatorWriteNode node) -> void - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode node) -> void - - # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. - # -- - # : (InstanceVariableOrWriteNode node) -> void - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode node) -> void - - # Dispatch enter and leave events for InstanceVariableReadNode nodes. - # -- - # : (InstanceVariableReadNode node) -> void - def visit_instance_variable_read_node: (InstanceVariableReadNode node) -> void - - # Dispatch enter and leave events for InstanceVariableTargetNode nodes. - # -- - # : (InstanceVariableTargetNode node) -> void - def visit_instance_variable_target_node: (InstanceVariableTargetNode node) -> void - - # Dispatch enter and leave events for InstanceVariableWriteNode nodes. - # -- - # : (InstanceVariableWriteNode node) -> void - def visit_instance_variable_write_node: (InstanceVariableWriteNode node) -> void - - # Dispatch enter and leave events for IntegerNode nodes. - # -- - # : (IntegerNode node) -> void - def visit_integer_node: (IntegerNode node) -> void - - # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. - # -- - # : (InterpolatedMatchLastLineNode node) -> void - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode node) -> void - - # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. - # -- - # : (InterpolatedRegularExpressionNode node) -> void - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode node) -> void - - # Dispatch enter and leave events for InterpolatedStringNode nodes. - # -- - # : (InterpolatedStringNode node) -> void - def visit_interpolated_string_node: (InterpolatedStringNode node) -> void - - # Dispatch enter and leave events for InterpolatedSymbolNode nodes. - # -- - # : (InterpolatedSymbolNode node) -> void - def visit_interpolated_symbol_node: (InterpolatedSymbolNode node) -> void - - # Dispatch enter and leave events for InterpolatedXStringNode nodes. - # -- - # : (InterpolatedXStringNode node) -> void - def visit_interpolated_x_string_node: (InterpolatedXStringNode node) -> void - - # Dispatch enter and leave events for ItLocalVariableReadNode nodes. - # -- - # : (ItLocalVariableReadNode node) -> void - def visit_it_local_variable_read_node: (ItLocalVariableReadNode node) -> void - - # Dispatch enter and leave events for ItParametersNode nodes. - # -- - # : (ItParametersNode node) -> void - def visit_it_parameters_node: (ItParametersNode node) -> void - - # Dispatch enter and leave events for KeywordHashNode nodes. - # -- - # : (KeywordHashNode node) -> void - def visit_keyword_hash_node: (KeywordHashNode node) -> void - - # Dispatch enter and leave events for KeywordRestParameterNode nodes. - # -- - # : (KeywordRestParameterNode node) -> void - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode node) -> void - - # Dispatch enter and leave events for LambdaNode nodes. - # -- - # : (LambdaNode node) -> void - def visit_lambda_node: (LambdaNode node) -> void - - # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. - # -- - # : (LocalVariableAndWriteNode node) -> void - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode node) -> void - - # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. - # -- - # : (LocalVariableOperatorWriteNode node) -> void - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode node) -> void - - # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. - # -- - # : (LocalVariableOrWriteNode node) -> void - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode node) -> void - - # Dispatch enter and leave events for LocalVariableReadNode nodes. - # -- - # : (LocalVariableReadNode node) -> void - def visit_local_variable_read_node: (LocalVariableReadNode node) -> void - - # Dispatch enter and leave events for LocalVariableTargetNode nodes. - # -- - # : (LocalVariableTargetNode node) -> void - def visit_local_variable_target_node: (LocalVariableTargetNode node) -> void - - # Dispatch enter and leave events for LocalVariableWriteNode nodes. - # -- - # : (LocalVariableWriteNode node) -> void - def visit_local_variable_write_node: (LocalVariableWriteNode node) -> void - - # Dispatch enter and leave events for MatchLastLineNode nodes. - # -- - # : (MatchLastLineNode node) -> void - def visit_match_last_line_node: (MatchLastLineNode node) -> void - - # Dispatch enter and leave events for MatchPredicateNode nodes. - # -- - # : (MatchPredicateNode node) -> void - def visit_match_predicate_node: (MatchPredicateNode node) -> void - - # Dispatch enter and leave events for MatchRequiredNode nodes. - # -- - # : (MatchRequiredNode node) -> void - def visit_match_required_node: (MatchRequiredNode node) -> void - - # Dispatch enter and leave events for MatchWriteNode nodes. - # -- - # : (MatchWriteNode node) -> void - def visit_match_write_node: (MatchWriteNode node) -> void - - # Dispatch enter and leave events for MissingNode nodes. - # -- - # : (MissingNode node) -> void - def visit_missing_node: (MissingNode node) -> void - - # Dispatch enter and leave events for ModuleNode nodes. - # -- - # : (ModuleNode node) -> void - def visit_module_node: (ModuleNode node) -> void - - # Dispatch enter and leave events for MultiTargetNode nodes. - # -- - # : (MultiTargetNode node) -> void - def visit_multi_target_node: (MultiTargetNode node) -> void - - # Dispatch enter and leave events for MultiWriteNode nodes. - # -- - # : (MultiWriteNode node) -> void - def visit_multi_write_node: (MultiWriteNode node) -> void - - # Dispatch enter and leave events for NextNode nodes. - # -- - # : (NextNode node) -> void - def visit_next_node: (NextNode node) -> void - - # Dispatch enter and leave events for NilNode nodes. - # -- - # : (NilNode node) -> void - def visit_nil_node: (NilNode node) -> void - - # Dispatch enter and leave events for NoBlockParameterNode nodes. - # -- - # : (NoBlockParameterNode node) -> void - def visit_no_block_parameter_node: (NoBlockParameterNode node) -> void - - # Dispatch enter and leave events for NoKeywordsParameterNode nodes. - # -- - # : (NoKeywordsParameterNode node) -> void - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode node) -> void - - # Dispatch enter and leave events for NumberedParametersNode nodes. - # -- - # : (NumberedParametersNode node) -> void - def visit_numbered_parameters_node: (NumberedParametersNode node) -> void - - # Dispatch enter and leave events for NumberedReferenceReadNode nodes. - # -- - # : (NumberedReferenceReadNode node) -> void - def visit_numbered_reference_read_node: (NumberedReferenceReadNode node) -> void - - # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. - # -- - # : (OptionalKeywordParameterNode node) -> void - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode node) -> void - - # Dispatch enter and leave events for OptionalParameterNode nodes. - # -- - # : (OptionalParameterNode node) -> void - def visit_optional_parameter_node: (OptionalParameterNode node) -> void - - # Dispatch enter and leave events for OrNode nodes. - # -- - # : (OrNode node) -> void - def visit_or_node: (OrNode node) -> void - - # Dispatch enter and leave events for ParametersNode nodes. - # -- - # : (ParametersNode node) -> void - def visit_parameters_node: (ParametersNode node) -> void - - # Dispatch enter and leave events for ParenthesesNode nodes. - # -- - # : (ParenthesesNode node) -> void - def visit_parentheses_node: (ParenthesesNode node) -> void - - # Dispatch enter and leave events for PinnedExpressionNode nodes. - # -- - # : (PinnedExpressionNode node) -> void - def visit_pinned_expression_node: (PinnedExpressionNode node) -> void - - # Dispatch enter and leave events for PinnedVariableNode nodes. - # -- - # : (PinnedVariableNode node) -> void - def visit_pinned_variable_node: (PinnedVariableNode node) -> void - - # Dispatch enter and leave events for PostExecutionNode nodes. - # -- - # : (PostExecutionNode node) -> void - def visit_post_execution_node: (PostExecutionNode node) -> void - - # Dispatch enter and leave events for PreExecutionNode nodes. - # -- - # : (PreExecutionNode node) -> void - def visit_pre_execution_node: (PreExecutionNode node) -> void - - # Dispatch enter and leave events for ProgramNode nodes. - # -- - # : (ProgramNode node) -> void - def visit_program_node: (ProgramNode node) -> void - - # Dispatch enter and leave events for RangeNode nodes. - # -- - # : (RangeNode node) -> void - def visit_range_node: (RangeNode node) -> void - - # Dispatch enter and leave events for RationalNode nodes. - # -- - # : (RationalNode node) -> void - def visit_rational_node: (RationalNode node) -> void - - # Dispatch enter and leave events for RedoNode nodes. - # -- - # : (RedoNode node) -> void - def visit_redo_node: (RedoNode node) -> void - - # Dispatch enter and leave events for RegularExpressionNode nodes. - # -- - # : (RegularExpressionNode node) -> void - def visit_regular_expression_node: (RegularExpressionNode node) -> void - - # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. - # -- - # : (RequiredKeywordParameterNode node) -> void - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode node) -> void - - # Dispatch enter and leave events for RequiredParameterNode nodes. - # -- - # : (RequiredParameterNode node) -> void - def visit_required_parameter_node: (RequiredParameterNode node) -> void - - # Dispatch enter and leave events for RescueModifierNode nodes. - # -- - # : (RescueModifierNode node) -> void - def visit_rescue_modifier_node: (RescueModifierNode node) -> void - - # Dispatch enter and leave events for RescueNode nodes. - # -- - # : (RescueNode node) -> void - def visit_rescue_node: (RescueNode node) -> void - - # Dispatch enter and leave events for RestParameterNode nodes. - # -- - # : (RestParameterNode node) -> void - def visit_rest_parameter_node: (RestParameterNode node) -> void - - # Dispatch enter and leave events for RetryNode nodes. - # -- - # : (RetryNode node) -> void - def visit_retry_node: (RetryNode node) -> void - - # Dispatch enter and leave events for ReturnNode nodes. - # -- - # : (ReturnNode node) -> void - def visit_return_node: (ReturnNode node) -> void - - # Dispatch enter and leave events for SelfNode nodes. - # -- - # : (SelfNode node) -> void - def visit_self_node: (SelfNode node) -> void - - # Dispatch enter and leave events for ShareableConstantNode nodes. - # -- - # : (ShareableConstantNode node) -> void - def visit_shareable_constant_node: (ShareableConstantNode node) -> void - - # Dispatch enter and leave events for SingletonClassNode nodes. - # -- - # : (SingletonClassNode node) -> void - def visit_singleton_class_node: (SingletonClassNode node) -> void - - # Dispatch enter and leave events for SourceEncodingNode nodes. - # -- - # : (SourceEncodingNode node) -> void - def visit_source_encoding_node: (SourceEncodingNode node) -> void - - # Dispatch enter and leave events for SourceFileNode nodes. - # -- - # : (SourceFileNode node) -> void - def visit_source_file_node: (SourceFileNode node) -> void - - # Dispatch enter and leave events for SourceLineNode nodes. - # -- - # : (SourceLineNode node) -> void - def visit_source_line_node: (SourceLineNode node) -> void - - # Dispatch enter and leave events for SplatNode nodes. - # -- - # : (SplatNode node) -> void - def visit_splat_node: (SplatNode node) -> void - - # Dispatch enter and leave events for StatementsNode nodes. - # -- - # : (StatementsNode node) -> void - def visit_statements_node: (StatementsNode node) -> void - - # Dispatch enter and leave events for StringNode nodes. - # -- - # : (StringNode node) -> void - def visit_string_node: (StringNode node) -> void - - # Dispatch enter and leave events for SuperNode nodes. - # -- - # : (SuperNode node) -> void - def visit_super_node: (SuperNode node) -> void - - # Dispatch enter and leave events for SymbolNode nodes. - # -- - # : (SymbolNode node) -> void - def visit_symbol_node: (SymbolNode node) -> void - - # Dispatch enter and leave events for TrueNode nodes. - # -- - # : (TrueNode node) -> void - def visit_true_node: (TrueNode node) -> void - - # Dispatch enter and leave events for UndefNode nodes. - # -- - # : (UndefNode node) -> void - def visit_undef_node: (UndefNode node) -> void - - # Dispatch enter and leave events for UnlessNode nodes. - # -- - # : (UnlessNode node) -> void - def visit_unless_node: (UnlessNode node) -> void - - # Dispatch enter and leave events for UntilNode nodes. - # -- - # : (UntilNode node) -> void - def visit_until_node: (UntilNode node) -> void - - # Dispatch enter and leave events for WhenNode nodes. - # -- - # : (WhenNode node) -> void - def visit_when_node: (WhenNode node) -> void - - # Dispatch enter and leave events for WhileNode nodes. - # -- - # : (WhileNode node) -> void - def visit_while_node: (WhileNode node) -> void - - # Dispatch enter and leave events for XStringNode nodes. - # -- - # : (XStringNode node) -> void - def visit_x_string_node: (XStringNode node) -> void - - # Dispatch enter and leave events for YieldNode nodes. - # -- - # : (YieldNode node) -> void - def visit_yield_node: (YieldNode node) -> void - end - end -end diff --git a/sig/generated/prism/dot_visitor.rbs b/sig/generated/prism/dot_visitor.rbs deleted file mode 100644 index 2cbc0ee31b..0000000000 --- a/sig/generated/prism/dot_visitor.rbs +++ /dev/null @@ -1,635 +0,0 @@ -# Generated from lib/prism/dot_visitor.rb with RBS::Inline - -module Prism - # This visitor provides the ability to call Node#to_dot, which converts a - # subtree into a graphviz dot graph. - class DotVisitor < Visitor - class Field - # :nodoc: - attr_reader name: String - - attr_reader value: String? - - attr_reader port: bool - - # : (String name, String? value, bool port) -> void - def initialize: (String name, String? value, bool port) -> void - - # : () -> String - def to_dot: () -> String - end - - class Table - # :nodoc: - attr_reader name: String - - attr_reader fields: Array[Field] - - # : (String name) -> void - def initialize: (String name) -> void - - # : (String name, ?String? value, ?port: bool) -> void - def field: (String name, ?String? value, ?port: bool) -> void - - # : () -> String - def to_dot: () -> String - end - - class Digraph - # :nodoc: - attr_reader nodes: Array[String] - - # :nodoc: - attr_reader waypoints: Array[String] - - # :nodoc: - attr_reader edges: Array[String] - - # : () -> void - def initialize: () -> void - - # : (String value) -> void - def node: (String value) -> void - - # : (String value) -> void - def waypoint: (String value) -> void - - # : (String value) -> void - def edge: (String value) -> void - - # : () -> String - def to_dot: () -> String - end - - # The digraph that is being built. - attr_reader digraph: Digraph - - # Initialize a new dot visitor. - # -- - # : () -> void - def initialize: () -> void - - # Convert this visitor into a graphviz dot graph string. - # -- - # : () -> String - def to_dot: () -> String - - # : (AliasGlobalVariableNode) -> void - def visit_alias_global_variable_node: (AliasGlobalVariableNode) -> void - - # : (AliasMethodNode) -> void - def visit_alias_method_node: (AliasMethodNode) -> void - - # : (AlternationPatternNode) -> void - def visit_alternation_pattern_node: (AlternationPatternNode) -> void - - # : (AndNode) -> void - def visit_and_node: (AndNode) -> void - - # : (ArgumentsNode) -> void - def visit_arguments_node: (ArgumentsNode) -> void - - # : (ArrayNode) -> void - def visit_array_node: (ArrayNode) -> void - - # : (ArrayPatternNode) -> void - def visit_array_pattern_node: (ArrayPatternNode) -> void - - # : (AssocNode) -> void - def visit_assoc_node: (AssocNode) -> void - - # : (AssocSplatNode) -> void - def visit_assoc_splat_node: (AssocSplatNode) -> void - - # : (BackReferenceReadNode) -> void - def visit_back_reference_read_node: (BackReferenceReadNode) -> void - - # : (BeginNode) -> void - def visit_begin_node: (BeginNode) -> void - - # : (BlockArgumentNode) -> void - def visit_block_argument_node: (BlockArgumentNode) -> void - - # : (BlockLocalVariableNode) -> void - def visit_block_local_variable_node: (BlockLocalVariableNode) -> void - - # : (BlockNode) -> void - def visit_block_node: (BlockNode) -> void - - # : (BlockParameterNode) -> void - def visit_block_parameter_node: (BlockParameterNode) -> void - - # : (BlockParametersNode) -> void - def visit_block_parameters_node: (BlockParametersNode) -> void - - # : (BreakNode) -> void - def visit_break_node: (BreakNode) -> void - - # : (CallAndWriteNode) -> void - def visit_call_and_write_node: (CallAndWriteNode) -> void - - # : (CallNode) -> void - def visit_call_node: (CallNode) -> void - - # : (CallOperatorWriteNode) -> void - def visit_call_operator_write_node: (CallOperatorWriteNode) -> void - - # : (CallOrWriteNode) -> void - def visit_call_or_write_node: (CallOrWriteNode) -> void - - # : (CallTargetNode) -> void - def visit_call_target_node: (CallTargetNode) -> void - - # : (CapturePatternNode) -> void - def visit_capture_pattern_node: (CapturePatternNode) -> void - - # : (CaseMatchNode) -> void - def visit_case_match_node: (CaseMatchNode) -> void - - # : (CaseNode) -> void - def visit_case_node: (CaseNode) -> void - - # : (ClassNode) -> void - def visit_class_node: (ClassNode) -> void - - # : (ClassVariableAndWriteNode) -> void - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode) -> void - - # : (ClassVariableOperatorWriteNode) -> void - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode) -> void - - # : (ClassVariableOrWriteNode) -> void - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode) -> void - - # : (ClassVariableReadNode) -> void - def visit_class_variable_read_node: (ClassVariableReadNode) -> void - - # : (ClassVariableTargetNode) -> void - def visit_class_variable_target_node: (ClassVariableTargetNode) -> void - - # : (ClassVariableWriteNode) -> void - def visit_class_variable_write_node: (ClassVariableWriteNode) -> void - - # : (ConstantAndWriteNode) -> void - def visit_constant_and_write_node: (ConstantAndWriteNode) -> void - - # : (ConstantOperatorWriteNode) -> void - def visit_constant_operator_write_node: (ConstantOperatorWriteNode) -> void - - # : (ConstantOrWriteNode) -> void - def visit_constant_or_write_node: (ConstantOrWriteNode) -> void - - # : (ConstantPathAndWriteNode) -> void - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode) -> void - - # : (ConstantPathNode) -> void - def visit_constant_path_node: (ConstantPathNode) -> void - - # : (ConstantPathOperatorWriteNode) -> void - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode) -> void - - # : (ConstantPathOrWriteNode) -> void - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode) -> void - - # : (ConstantPathTargetNode) -> void - def visit_constant_path_target_node: (ConstantPathTargetNode) -> void - - # : (ConstantPathWriteNode) -> void - def visit_constant_path_write_node: (ConstantPathWriteNode) -> void - - # : (ConstantReadNode) -> void - def visit_constant_read_node: (ConstantReadNode) -> void - - # : (ConstantTargetNode) -> void - def visit_constant_target_node: (ConstantTargetNode) -> void - - # : (ConstantWriteNode) -> void - def visit_constant_write_node: (ConstantWriteNode) -> void - - # : (DefNode) -> void - def visit_def_node: (DefNode) -> void - - # : (DefinedNode) -> void - def visit_defined_node: (DefinedNode) -> void - - # : (ElseNode) -> void - def visit_else_node: (ElseNode) -> void - - # : (EmbeddedStatementsNode) -> void - def visit_embedded_statements_node: (EmbeddedStatementsNode) -> void - - # : (EmbeddedVariableNode) -> void - def visit_embedded_variable_node: (EmbeddedVariableNode) -> void - - # : (EnsureNode) -> void - def visit_ensure_node: (EnsureNode) -> void - - # : (FalseNode) -> void - def visit_false_node: (FalseNode) -> void - - # : (FindPatternNode) -> void - def visit_find_pattern_node: (FindPatternNode) -> void - - # : (FlipFlopNode) -> void - def visit_flip_flop_node: (FlipFlopNode) -> void - - # : (FloatNode) -> void - def visit_float_node: (FloatNode) -> void - - # : (ForNode) -> void - def visit_for_node: (ForNode) -> void - - # : (ForwardingArgumentsNode) -> void - def visit_forwarding_arguments_node: (ForwardingArgumentsNode) -> void - - # : (ForwardingParameterNode) -> void - def visit_forwarding_parameter_node: (ForwardingParameterNode) -> void - - # : (ForwardingSuperNode) -> void - def visit_forwarding_super_node: (ForwardingSuperNode) -> void - - # : (GlobalVariableAndWriteNode) -> void - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode) -> void - - # : (GlobalVariableOperatorWriteNode) -> void - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode) -> void - - # : (GlobalVariableOrWriteNode) -> void - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode) -> void - - # : (GlobalVariableReadNode) -> void - def visit_global_variable_read_node: (GlobalVariableReadNode) -> void - - # : (GlobalVariableTargetNode) -> void - def visit_global_variable_target_node: (GlobalVariableTargetNode) -> void - - # : (GlobalVariableWriteNode) -> void - def visit_global_variable_write_node: (GlobalVariableWriteNode) -> void - - # : (HashNode) -> void - def visit_hash_node: (HashNode) -> void - - # : (HashPatternNode) -> void - def visit_hash_pattern_node: (HashPatternNode) -> void - - # : (IfNode) -> void - def visit_if_node: (IfNode) -> void - - # : (ImaginaryNode) -> void - def visit_imaginary_node: (ImaginaryNode) -> void - - # : (ImplicitNode) -> void - def visit_implicit_node: (ImplicitNode) -> void - - # : (ImplicitRestNode) -> void - def visit_implicit_rest_node: (ImplicitRestNode) -> void - - # : (InNode) -> void - def visit_in_node: (InNode) -> void - - # : (IndexAndWriteNode) -> void - def visit_index_and_write_node: (IndexAndWriteNode) -> void - - # : (IndexOperatorWriteNode) -> void - def visit_index_operator_write_node: (IndexOperatorWriteNode) -> void - - # : (IndexOrWriteNode) -> void - def visit_index_or_write_node: (IndexOrWriteNode) -> void - - # : (IndexTargetNode) -> void - def visit_index_target_node: (IndexTargetNode) -> void - - # : (InstanceVariableAndWriteNode) -> void - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode) -> void - - # : (InstanceVariableOperatorWriteNode) -> void - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode) -> void - - # : (InstanceVariableOrWriteNode) -> void - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode) -> void - - # : (InstanceVariableReadNode) -> void - def visit_instance_variable_read_node: (InstanceVariableReadNode) -> void - - # : (InstanceVariableTargetNode) -> void - def visit_instance_variable_target_node: (InstanceVariableTargetNode) -> void - - # : (InstanceVariableWriteNode) -> void - def visit_instance_variable_write_node: (InstanceVariableWriteNode) -> void - - # : (IntegerNode) -> void - def visit_integer_node: (IntegerNode) -> void - - # : (InterpolatedMatchLastLineNode) -> void - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode) -> void - - # : (InterpolatedRegularExpressionNode) -> void - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode) -> void - - # : (InterpolatedStringNode) -> void - def visit_interpolated_string_node: (InterpolatedStringNode) -> void - - # : (InterpolatedSymbolNode) -> void - def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> void - - # : (InterpolatedXStringNode) -> void - def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> void - - # : (ItLocalVariableReadNode) -> void - def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> void - - # : (ItParametersNode) -> void - def visit_it_parameters_node: (ItParametersNode) -> void - - # : (KeywordHashNode) -> void - def visit_keyword_hash_node: (KeywordHashNode) -> void - - # : (KeywordRestParameterNode) -> void - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> void - - # : (LambdaNode) -> void - def visit_lambda_node: (LambdaNode) -> void - - # : (LocalVariableAndWriteNode) -> void - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode) -> void - - # : (LocalVariableOperatorWriteNode) -> void - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode) -> void - - # : (LocalVariableOrWriteNode) -> void - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode) -> void - - # : (LocalVariableReadNode) -> void - def visit_local_variable_read_node: (LocalVariableReadNode) -> void - - # : (LocalVariableTargetNode) -> void - def visit_local_variable_target_node: (LocalVariableTargetNode) -> void - - # : (LocalVariableWriteNode) -> void - def visit_local_variable_write_node: (LocalVariableWriteNode) -> void - - # : (MatchLastLineNode) -> void - def visit_match_last_line_node: (MatchLastLineNode) -> void - - # : (MatchPredicateNode) -> void - def visit_match_predicate_node: (MatchPredicateNode) -> void - - # : (MatchRequiredNode) -> void - def visit_match_required_node: (MatchRequiredNode) -> void - - # : (MatchWriteNode) -> void - def visit_match_write_node: (MatchWriteNode) -> void - - # : (MissingNode) -> void - def visit_missing_node: (MissingNode) -> void - - # : (ModuleNode) -> void - def visit_module_node: (ModuleNode) -> void - - # : (MultiTargetNode) -> void - def visit_multi_target_node: (MultiTargetNode) -> void - - # : (MultiWriteNode) -> void - def visit_multi_write_node: (MultiWriteNode) -> void - - # : (NextNode) -> void - def visit_next_node: (NextNode) -> void - - # : (NilNode) -> void - def visit_nil_node: (NilNode) -> void - - # : (NoBlockParameterNode) -> void - def visit_no_block_parameter_node: (NoBlockParameterNode) -> void - - # : (NoKeywordsParameterNode) -> void - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode) -> void - - # : (NumberedParametersNode) -> void - def visit_numbered_parameters_node: (NumberedParametersNode) -> void - - # : (NumberedReferenceReadNode) -> void - def visit_numbered_reference_read_node: (NumberedReferenceReadNode) -> void - - # : (OptionalKeywordParameterNode) -> void - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode) -> void - - # : (OptionalParameterNode) -> void - def visit_optional_parameter_node: (OptionalParameterNode) -> void - - # : (OrNode) -> void - def visit_or_node: (OrNode) -> void - - # : (ParametersNode) -> void - def visit_parameters_node: (ParametersNode) -> void - - # : (ParenthesesNode) -> void - def visit_parentheses_node: (ParenthesesNode) -> void - - # : (PinnedExpressionNode) -> void - def visit_pinned_expression_node: (PinnedExpressionNode) -> void - - # : (PinnedVariableNode) -> void - def visit_pinned_variable_node: (PinnedVariableNode) -> void - - # : (PostExecutionNode) -> void - def visit_post_execution_node: (PostExecutionNode) -> void - - # : (PreExecutionNode) -> void - def visit_pre_execution_node: (PreExecutionNode) -> void - - # : (ProgramNode) -> void - def visit_program_node: (ProgramNode) -> void - - # : (RangeNode) -> void - def visit_range_node: (RangeNode) -> void - - # : (RationalNode) -> void - def visit_rational_node: (RationalNode) -> void - - # : (RedoNode) -> void - def visit_redo_node: (RedoNode) -> void - - # : (RegularExpressionNode) -> void - def visit_regular_expression_node: (RegularExpressionNode) -> void - - # : (RequiredKeywordParameterNode) -> void - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode) -> void - - # : (RequiredParameterNode) -> void - def visit_required_parameter_node: (RequiredParameterNode) -> void - - # : (RescueModifierNode) -> void - def visit_rescue_modifier_node: (RescueModifierNode) -> void - - # : (RescueNode) -> void - def visit_rescue_node: (RescueNode) -> void - - # : (RestParameterNode) -> void - def visit_rest_parameter_node: (RestParameterNode) -> void - - # : (RetryNode) -> void - def visit_retry_node: (RetryNode) -> void - - # : (ReturnNode) -> void - def visit_return_node: (ReturnNode) -> void - - # : (SelfNode) -> void - def visit_self_node: (SelfNode) -> void - - # : (ShareableConstantNode) -> void - def visit_shareable_constant_node: (ShareableConstantNode) -> void - - # : (SingletonClassNode) -> void - def visit_singleton_class_node: (SingletonClassNode) -> void - - # : (SourceEncodingNode) -> void - def visit_source_encoding_node: (SourceEncodingNode) -> void - - # : (SourceFileNode) -> void - def visit_source_file_node: (SourceFileNode) -> void - - # : (SourceLineNode) -> void - def visit_source_line_node: (SourceLineNode) -> void - - # : (SplatNode) -> void - def visit_splat_node: (SplatNode) -> void - - # : (StatementsNode) -> void - def visit_statements_node: (StatementsNode) -> void - - # : (StringNode) -> void - def visit_string_node: (StringNode) -> void - - # : (SuperNode) -> void - def visit_super_node: (SuperNode) -> void - - # : (SymbolNode) -> void - def visit_symbol_node: (SymbolNode) -> void - - # : (TrueNode) -> void - def visit_true_node: (TrueNode) -> void - - # : (UndefNode) -> void - def visit_undef_node: (UndefNode) -> void - - # : (UnlessNode) -> void - def visit_unless_node: (UnlessNode) -> void - - # : (UntilNode) -> void - def visit_until_node: (UntilNode) -> void - - # : (WhenNode) -> void - def visit_when_node: (WhenNode) -> void - - # : (WhileNode) -> void - def visit_while_node: (WhileNode) -> void - - # : (XStringNode) -> void - def visit_x_string_node: (XStringNode) -> void - - # : (YieldNode) -> void - def visit_yield_node: (YieldNode) -> void - - private - - # Generate a unique node ID for a node throughout the digraph. - # -- - # : (node) -> String - def node_id: (node) -> String - - # Inspect a location to display the start and end line and columns in bytes. - # -- - # : (Location) -> String - def location_inspect: (Location) -> String - - # Inspect a node that has arguments_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (ArgumentsNode node) -> String - def arguments_node_flags_inspect: (ArgumentsNode node) -> String - - # Inspect a node that has array_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (ArrayNode node) -> String - def array_node_flags_inspect: (ArrayNode node) -> String - - # Inspect a node that has call_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (CallAndWriteNode | CallNode | CallOperatorWriteNode | CallOrWriteNode | CallTargetNode | IndexAndWriteNode | IndexOperatorWriteNode | IndexOrWriteNode | IndexTargetNode node) -> String - def call_node_flags_inspect: (CallAndWriteNode | CallNode | CallOperatorWriteNode | CallOrWriteNode | CallTargetNode | IndexAndWriteNode | IndexOperatorWriteNode | IndexOrWriteNode | IndexTargetNode node) -> String - - # Inspect a node that has encoding_flags flags to display the flags as a - # comma-separated list. - # -- - # : (XStringNode node) -> String - def encoding_flags_inspect: (XStringNode node) -> String - - # Inspect a node that has integer_base_flags flags to display the flags as a - # comma-separated list. - # -- - # : (IntegerNode | RationalNode node) -> String - def integer_base_flags_inspect: (IntegerNode | RationalNode node) -> String - - # Inspect a node that has interpolated_string_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (InterpolatedStringNode node) -> String - def interpolated_string_node_flags_inspect: (InterpolatedStringNode node) -> String - - # Inspect a node that has keyword_hash_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (KeywordHashNode node) -> String - def keyword_hash_node_flags_inspect: (KeywordHashNode node) -> String - - # Inspect a node that has loop_flags flags to display the flags as a - # comma-separated list. - # -- - # : (UntilNode | WhileNode node) -> String - def loop_flags_inspect: (UntilNode | WhileNode node) -> String - - # Inspect a node that has parameter_flags flags to display the flags as a - # comma-separated list. - # -- - # : (BlockLocalVariableNode | BlockParameterNode | KeywordRestParameterNode | OptionalKeywordParameterNode | OptionalParameterNode | RequiredKeywordParameterNode | RequiredParameterNode | RestParameterNode node) -> String - def parameter_flags_inspect: (BlockLocalVariableNode | BlockParameterNode | KeywordRestParameterNode | OptionalKeywordParameterNode | OptionalParameterNode | RequiredKeywordParameterNode | RequiredParameterNode | RestParameterNode node) -> String - - # Inspect a node that has parentheses_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (ParenthesesNode node) -> String - def parentheses_node_flags_inspect: (ParenthesesNode node) -> String - - # Inspect a node that has range_flags flags to display the flags as a - # comma-separated list. - # -- - # : (FlipFlopNode | RangeNode node) -> String - def range_flags_inspect: (FlipFlopNode | RangeNode node) -> String - - # Inspect a node that has regular_expression_flags flags to display the flags as a - # comma-separated list. - # -- - # : (InterpolatedMatchLastLineNode | InterpolatedRegularExpressionNode | MatchLastLineNode | RegularExpressionNode node) -> String - def regular_expression_flags_inspect: (InterpolatedMatchLastLineNode | InterpolatedRegularExpressionNode | MatchLastLineNode | RegularExpressionNode node) -> String - - # Inspect a node that has shareable_constant_node_flags flags to display the flags as a - # comma-separated list. - # -- - # : (ShareableConstantNode node) -> String - def shareable_constant_node_flags_inspect: (ShareableConstantNode node) -> String - - # Inspect a node that has string_flags flags to display the flags as a - # comma-separated list. - # -- - # : (SourceFileNode | StringNode node) -> String - def string_flags_inspect: (SourceFileNode | StringNode node) -> String - - # Inspect a node that has symbol_flags flags to display the flags as a - # comma-separated list. - # -- - # : (SymbolNode node) -> String - def symbol_flags_inspect: (SymbolNode node) -> String - end -end diff --git a/sig/generated/prism/dsl.rbs b/sig/generated/prism/dsl.rbs deleted file mode 100644 index 4b09efccd3..0000000000 --- a/sig/generated/prism/dsl.rbs +++ /dev/null @@ -1,921 +0,0 @@ -# Generated from lib/prism/dsl.rb with RBS::Inline - -module Prism - # The DSL module provides a set of methods that can be used to create prism - # nodes in a more concise manner. For example, instead of writing: - # - # source = Prism::Source.for("[1]", 1, []) - # - # Prism::ArrayNode.new( - # source, - # 0, - # Prism::Location.new(source, 0, 3), - # 0, - # [ - # Prism::IntegerNode.new( - # source, - # 0, - # Prism::Location.new(source, 1, 1), - # Prism::IntegerBaseFlags::DECIMAL, - # 1 - # ) - # ], - # Prism::Location.new(source, 0, 1), - # Prism::Location.new(source, 2, 1) - # ) - # - # you could instead write: - # - # class Builder - # include Prism::DSL - # - # attr_reader :default_source - # - # def initialize - # @default_source = source("[1]") - # end - # - # def build - # array_node( - # location: location(start_offset: 0, length: 3), - # elements: [ - # integer_node( - # location: location(start_offset: 1, length: 1), - # flags: integer_base_flag(:decimal), - # value: 1 - # ) - # ], - # opening_loc: location(start_offset: 0, length: 1), - # closing_loc: location(start_offset: 2, length: 1) - # ) - # end - # end - # - # This is mostly helpful in the context of generating trees programmatically. - module DSL - # Create a new Source object. - # -- - # : (String string) -> Source - def source: (String string) -> Source - - # Create a new Location object. - # -- - # : (?source: Source, ?start_offset: Integer, ?length: Integer) -> Location - def location: (?source: Source, ?start_offset: Integer, ?length: Integer) -> Location - - # Create a new AliasGlobalVariableNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode), ?old_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode), ?keyword_loc: Location) -> AliasGlobalVariableNode - def alias_global_variable_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, ?keyword_loc: Location) -> AliasGlobalVariableNode - - # Create a new AliasMethodNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (SymbolNode | InterpolatedSymbolNode), ?old_name: (SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode), ?keyword_loc: Location) -> AliasMethodNode - def alias_method_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, ?keyword_loc: Location) -> AliasMethodNode - - # Create a new AlternationPatternNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode - def alternation_pattern_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode - - # Create a new AndNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode - def and_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode - - # Create a new ArgumentsNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode - def arguments_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode - - # Create a new ArrayNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode - def array_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode - - # Create a new ArrayPatternNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode - def array_pattern_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode - - # Create a new AssocNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode - def assoc_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode - - # Create a new AssocSplatNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode - def assoc_splat_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode - - # Create a new BackReferenceReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode - def back_reference_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode - - # Create a new BeginNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode - def begin_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode - - # Create a new BlockArgumentNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode - def block_argument_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode - - # Create a new BlockLocalVariableNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode - def block_local_variable_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode - - # Create a new BlockNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode - def block_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode - - # Create a new BlockParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode - def block_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode - - # Create a new BlockParametersNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode - def block_parameters_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode - - # Create a new BreakNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode - def break_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode - - # Create a new CallAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode - def call_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode - - # Create a new CallNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> CallNode - def call_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> CallNode - - # Create a new CallOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode - def call_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode - - # Create a new CallOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode - def call_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode - - # Create a new CallTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode - def call_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode - - # Create a new CapturePatternNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode - def capture_pattern_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode - - # Create a new CaseMatchNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode - def case_match_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode - - # Create a new CaseNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode - def case_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode - - # Create a new ClassNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode | CallNode), ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode - def class_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | CallNode, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode - - # Create a new ClassVariableAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode - def class_variable_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode - - # Create a new ClassVariableOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode - def class_variable_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode - - # Create a new ClassVariableOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode - def class_variable_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode - - # Create a new ClassVariableReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode - def class_variable_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode - - # Create a new ClassVariableTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode - def class_variable_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode - - # Create a new ClassVariableWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode - def class_variable_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode - - # Create a new ConstantAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode - def constant_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode - - # Create a new ConstantOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode - def constant_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode - - # Create a new ConstantOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode - def constant_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode - - # Create a new ConstantPathAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode - def constant_path_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode - - # Create a new ConstantPathNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode - def constant_path_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode - - # Create a new ConstantPathOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode - def constant_path_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode - - # Create a new ConstantPathOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode - def constant_path_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode - - # Create a new ConstantPathTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode - def constant_path_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode - - # Create a new ConstantPathWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode - def constant_path_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode - - # Create a new ConstantReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode - def constant_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode - - # Create a new ConstantTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode - def constant_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode - - # Create a new ConstantWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode - def constant_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode - - # Create a new DefNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: (StatementsNode | BeginNode)?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode - def def_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: (StatementsNode | BeginNode)?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode - - # Create a new DefinedNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode - def defined_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode - - # Create a new ElseNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode - def else_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode - - # Create a new EmbeddedStatementsNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode - def embedded_statements_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode - - # Create a new EmbeddedVariableNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode)) -> EmbeddedVariableNode - def embedded_variable_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) -> EmbeddedVariableNode - - # Create a new EnsureNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode - def ensure_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode - - # Create a new FalseNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode - def false_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode - - # Create a new FindPatternNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: (SplatNode | MissingNode), ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode - def find_pattern_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode | MissingNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode - - # Create a new FlipFlopNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode - def flip_flop_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode - - # Create a new FloatNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode - def float_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode - - # Create a new ForNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?index: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode), ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode - def for_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode - - # Create a new ForwardingArgumentsNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode - def forwarding_arguments_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode - - # Create a new ForwardingParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode - def forwarding_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode - - # Create a new ForwardingSuperNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode - def forwarding_super_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode - - # Create a new GlobalVariableAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode - def global_variable_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode - - # Create a new GlobalVariableOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode - def global_variable_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode - - # Create a new GlobalVariableOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode - def global_variable_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode - - # Create a new GlobalVariableReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode - def global_variable_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode - - # Create a new GlobalVariableTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode - def global_variable_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode - - # Create a new GlobalVariableWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode - def global_variable_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode - - # Create a new HashNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode - def hash_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode - - # Create a new HashPatternNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?elements: Array[AssocNode], ?rest: (AssocSplatNode | NoKeywordsParameterNode)?, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode - def hash_pattern_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?elements: Array[AssocNode], ?rest: (AssocSplatNode | NoKeywordsParameterNode)?, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode - - # Create a new IfNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: (ElseNode | IfNode)?, ?end_keyword_loc: Location?) -> IfNode - def if_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: (ElseNode | IfNode)?, ?end_keyword_loc: Location?) -> IfNode - - # Create a new ImaginaryNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: (FloatNode | IntegerNode | RationalNode)) -> ImaginaryNode - def imaginary_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode - - # Create a new ImplicitNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode)) -> ImplicitNode - def implicit_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) -> ImplicitNode - - # Create a new ImplicitRestNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode - def implicit_rest_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode - - # Create a new InNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode - def in_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode - - # Create a new IndexAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode - def index_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode - - # Create a new IndexOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode - def index_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode - - # Create a new IndexOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode - def index_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode - - # Create a new IndexTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode - def index_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode - - # Create a new InstanceVariableAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode - def instance_variable_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode - - # Create a new InstanceVariableOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode - def instance_variable_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode - - # Create a new InstanceVariableOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode - def instance_variable_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode - - # Create a new InstanceVariableReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode - def instance_variable_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode - - # Create a new InstanceVariableTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode - def instance_variable_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode - - # Create a new InstanceVariableWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode - def instance_variable_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode - - # Create a new IntegerNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode - def integer_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode - - # Create a new InterpolatedMatchLastLineNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode - def interpolated_match_last_line_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode - - # Create a new InterpolatedRegularExpressionNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode - def interpolated_regular_expression_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode - - # Create a new InterpolatedStringNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], ?closing_loc: Location?) -> InterpolatedStringNode - def interpolated_string_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], ?closing_loc: Location?) -> InterpolatedStringNode - - # Create a new InterpolatedSymbolNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode - def interpolated_symbol_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode - - # Create a new InterpolatedXStringNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode - def interpolated_x_string_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode - - # Create a new ItLocalVariableReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode - def it_local_variable_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode - - # Create a new ItParametersNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode - def it_parameters_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode - - # Create a new KeywordHashNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode - def keyword_hash_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode - - # Create a new KeywordRestParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode - def keyword_rest_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode - - # Create a new LambdaNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?) -> LambdaNode - def lambda_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?) -> LambdaNode - - # Create a new LocalVariableAndWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode - def local_variable_and_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode - - # Create a new LocalVariableOperatorWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode - def local_variable_operator_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode - - # Create a new LocalVariableOrWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode - def local_variable_or_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode - - # Create a new LocalVariableReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode - def local_variable_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode - - # Create a new LocalVariableTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode - def local_variable_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode - - # Create a new LocalVariableWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode - def local_variable_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode - - # Create a new MatchLastLineNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode - def match_last_line_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode - - # Create a new MatchPredicateNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode - def match_predicate_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode - - # Create a new MatchRequiredNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode - def match_required_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode - - # Create a new MatchWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode - def match_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode - - # Create a new MissingNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode - def missing_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode - - # Create a new ModuleNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode | MissingNode), ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode - def module_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | MissingNode, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode - - # Create a new MultiTargetNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode - def multi_target_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode - - # Create a new MultiWriteNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode - def multi_write_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode - - # Create a new NextNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode - def next_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode - - # Create a new NilNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode - def nil_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode - - # Create a new NoBlockParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoBlockParameterNode - def no_block_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoBlockParameterNode - - # Create a new NoKeywordsParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode - def no_keywords_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode - - # Create a new NumberedParametersNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode - def numbered_parameters_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode - - # Create a new NumberedReferenceReadNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode - def numbered_reference_read_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode - - # Create a new OptionalKeywordParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode - def optional_keyword_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode - - # Create a new OptionalParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode - def optional_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode - - # Create a new OrNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode - def or_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode - - # Create a new ParametersNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: (RestParameterNode | ImplicitRestNode)?, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)?, ?block: (BlockParameterNode | NoBlockParameterNode)?) -> ParametersNode - def parameters_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: (RestParameterNode | ImplicitRestNode)?, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)?, ?block: (BlockParameterNode | NoBlockParameterNode)?) -> ParametersNode - - # Create a new ParenthesesNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode - def parentheses_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode - - # Create a new PinnedExpressionNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode - def pinned_expression_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode - - # Create a new PinnedVariableNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode), ?operator_loc: Location) -> PinnedVariableNode - def pinned_variable_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, ?operator_loc: Location) -> PinnedVariableNode - - # Create a new PostExecutionNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode - def post_execution_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode - - # Create a new PreExecutionNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode - def pre_execution_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode - - # Create a new ProgramNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode - def program_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode - - # Create a new RangeNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode - def range_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode - - # Create a new RationalNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode - def rational_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode - - # Create a new RedoNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode - def redo_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode - - # Create a new RegularExpressionNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode - def regular_expression_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode - - # Create a new RequiredKeywordParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode - def required_keyword_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode - - # Create a new RequiredParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode - def required_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode - - # Create a new RescueModifierNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode - def rescue_modifier_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode - - # Create a new RescueNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)?, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode - def rescue_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)?, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode - - # Create a new RestParameterNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode - def rest_parameter_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode - - # Create a new RetryNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode - def retry_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode - - # Create a new ReturnNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode - def return_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode - - # Create a new SelfNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode - def self_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode - - # Create a new ShareableConstantNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?write: (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode)) -> ShareableConstantNode - def shareable_constant_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode - - # Create a new SingletonClassNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location) -> SingletonClassNode - def singleton_class_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location) -> SingletonClassNode - - # Create a new SourceEncodingNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode - def source_encoding_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode - - # Create a new SourceFileNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode - def source_file_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode - - # Create a new SourceLineNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode - def source_line_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode - - # Create a new SplatNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode - def splat_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode - - # Create a new StatementsNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode - def statements_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode - - # Create a new StringNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode - def string_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode - - # Create a new SuperNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> SuperNode - def super_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> SuperNode - - # Create a new SymbolNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode - def symbol_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode - - # Create a new TrueNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode - def true_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode - - # Create a new UndefNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode - def undef_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode - - # Create a new UnlessNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode - def unless_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode - - # Create a new UntilNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode - def until_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode - - # Create a new WhenNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode - def when_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode - - # Create a new WhileNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode - def while_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode - - # Create a new XStringNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode - def x_string_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode - - # Create a new YieldNode node. - # -- - # : (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode - def yield_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode - - # Retrieve the value of one of the ArgumentsNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def arguments_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the ArrayNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def array_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the CallNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def call_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the EncodingFlags flags. - # -- - # : (Symbol name) -> Integer - def encoding_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the IntegerBaseFlags flags. - # -- - # : (Symbol name) -> Integer - def integer_base_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the InterpolatedStringNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def interpolated_string_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the KeywordHashNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def keyword_hash_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the LoopFlags flags. - # -- - # : (Symbol name) -> Integer - def loop_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the ParameterFlags flags. - # -- - # : (Symbol name) -> Integer - def parameter_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the ParenthesesNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def parentheses_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the RangeFlags flags. - # -- - # : (Symbol name) -> Integer - def range_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the RegularExpressionFlags flags. - # -- - # : (Symbol name) -> Integer - def regular_expression_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the ShareableConstantNodeFlags flags. - # -- - # : (Symbol name) -> Integer - def shareable_constant_node_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the StringFlags flags. - # -- - # : (Symbol name) -> Integer - def string_flag: (Symbol name) -> Integer - - # Retrieve the value of one of the SymbolFlags flags. - # -- - # : (Symbol name) -> Integer - def symbol_flag: (Symbol name) -> Integer - - private - - # The default source object that gets attached to nodes and locations if no - # source is specified. - # -- - # : () -> Source - def default_source: () -> Source - - # The default location object that gets attached to nodes if no location is - # specified, which uses the given source. - # -- - # : () -> Location - def default_location: () -> Location - - # The default node that gets attached to nodes if no node is specified for a - # required node field. - # -- - # : (Source source, Location location) -> node - def default_node: (Source source, Location location) -> node - end -end diff --git a/sig/generated/prism/inspect_visitor.rbs b/sig/generated/prism/inspect_visitor.rbs deleted file mode 100644 index 1219427ceb..0000000000 --- a/sig/generated/prism/inspect_visitor.rbs +++ /dev/null @@ -1,509 +0,0 @@ -# Generated from lib/prism/inspect_visitor.rb with RBS::Inline - -module Prism - # This visitor is responsible for composing the strings that get returned by - # the various #inspect methods defined on each of the nodes. - class InspectVisitor < Visitor - # Most of the time, we can simply pass down the indent to the next node. - # However, when we are inside a list we want some extra special formatting - # when we hit an element in that list. In this case, we have a special - # command that replaces the subsequent indent with the given value. - class Replace - # :nodoc: - attr_reader value: String - - # : (String value) -> void - def initialize: (String value) -> void - end - - # The current prefix string. - # :stopdoc: - attr_reader indent: String - - # The list of commands that we need to execute in order to compose the - # final string. - # : stopdoc: - attr_reader commands: Array[[ String | node | Replace, String ]] - - # : (?String indent) -> void - def initialize: (?String indent) -> void - - # Compose an inspect string for the given node. - # -- - # : (node node) -> String - def self.compose: (node node) -> String - - # Compose the final string. - # -- - # : () -> String - def compose: () -> String - - # : (AliasGlobalVariableNode node) -> void - def visit_alias_global_variable_node: (AliasGlobalVariableNode node) -> void - - # : (AliasMethodNode node) -> void - def visit_alias_method_node: (AliasMethodNode node) -> void - - # : (AlternationPatternNode node) -> void - def visit_alternation_pattern_node: (AlternationPatternNode node) -> void - - # : (AndNode node) -> void - def visit_and_node: (AndNode node) -> void - - # : (ArgumentsNode node) -> void - def visit_arguments_node: (ArgumentsNode node) -> void - - # : (ArrayNode node) -> void - def visit_array_node: (ArrayNode node) -> void - - # : (ArrayPatternNode node) -> void - def visit_array_pattern_node: (ArrayPatternNode node) -> void - - # : (AssocNode node) -> void - def visit_assoc_node: (AssocNode node) -> void - - # : (AssocSplatNode node) -> void - def visit_assoc_splat_node: (AssocSplatNode node) -> void - - # : (BackReferenceReadNode node) -> void - def visit_back_reference_read_node: (BackReferenceReadNode node) -> void - - # : (BeginNode node) -> void - def visit_begin_node: (BeginNode node) -> void - - # : (BlockArgumentNode node) -> void - def visit_block_argument_node: (BlockArgumentNode node) -> void - - # : (BlockLocalVariableNode node) -> void - def visit_block_local_variable_node: (BlockLocalVariableNode node) -> void - - # : (BlockNode node) -> void - def visit_block_node: (BlockNode node) -> void - - # : (BlockParameterNode node) -> void - def visit_block_parameter_node: (BlockParameterNode node) -> void - - # : (BlockParametersNode node) -> void - def visit_block_parameters_node: (BlockParametersNode node) -> void - - # : (BreakNode node) -> void - def visit_break_node: (BreakNode node) -> void - - # : (CallAndWriteNode node) -> void - def visit_call_and_write_node: (CallAndWriteNode node) -> void - - # : (CallNode node) -> void - def visit_call_node: (CallNode node) -> void - - # : (CallOperatorWriteNode node) -> void - def visit_call_operator_write_node: (CallOperatorWriteNode node) -> void - - # : (CallOrWriteNode node) -> void - def visit_call_or_write_node: (CallOrWriteNode node) -> void - - # : (CallTargetNode node) -> void - def visit_call_target_node: (CallTargetNode node) -> void - - # : (CapturePatternNode node) -> void - def visit_capture_pattern_node: (CapturePatternNode node) -> void - - # : (CaseMatchNode node) -> void - def visit_case_match_node: (CaseMatchNode node) -> void - - # : (CaseNode node) -> void - def visit_case_node: (CaseNode node) -> void - - # : (ClassNode node) -> void - def visit_class_node: (ClassNode node) -> void - - # : (ClassVariableAndWriteNode node) -> void - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode node) -> void - - # : (ClassVariableOperatorWriteNode node) -> void - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode node) -> void - - # : (ClassVariableOrWriteNode node) -> void - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode node) -> void - - # : (ClassVariableReadNode node) -> void - def visit_class_variable_read_node: (ClassVariableReadNode node) -> void - - # : (ClassVariableTargetNode node) -> void - def visit_class_variable_target_node: (ClassVariableTargetNode node) -> void - - # : (ClassVariableWriteNode node) -> void - def visit_class_variable_write_node: (ClassVariableWriteNode node) -> void - - # : (ConstantAndWriteNode node) -> void - def visit_constant_and_write_node: (ConstantAndWriteNode node) -> void - - # : (ConstantOperatorWriteNode node) -> void - def visit_constant_operator_write_node: (ConstantOperatorWriteNode node) -> void - - # : (ConstantOrWriteNode node) -> void - def visit_constant_or_write_node: (ConstantOrWriteNode node) -> void - - # : (ConstantPathAndWriteNode node) -> void - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode node) -> void - - # : (ConstantPathNode node) -> void - def visit_constant_path_node: (ConstantPathNode node) -> void - - # : (ConstantPathOperatorWriteNode node) -> void - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode node) -> void - - # : (ConstantPathOrWriteNode node) -> void - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode node) -> void - - # : (ConstantPathTargetNode node) -> void - def visit_constant_path_target_node: (ConstantPathTargetNode node) -> void - - # : (ConstantPathWriteNode node) -> void - def visit_constant_path_write_node: (ConstantPathWriteNode node) -> void - - # : (ConstantReadNode node) -> void - def visit_constant_read_node: (ConstantReadNode node) -> void - - # : (ConstantTargetNode node) -> void - def visit_constant_target_node: (ConstantTargetNode node) -> void - - # : (ConstantWriteNode node) -> void - def visit_constant_write_node: (ConstantWriteNode node) -> void - - # : (DefNode node) -> void - def visit_def_node: (DefNode node) -> void - - # : (DefinedNode node) -> void - def visit_defined_node: (DefinedNode node) -> void - - # : (ElseNode node) -> void - def visit_else_node: (ElseNode node) -> void - - # : (EmbeddedStatementsNode node) -> void - def visit_embedded_statements_node: (EmbeddedStatementsNode node) -> void - - # : (EmbeddedVariableNode node) -> void - def visit_embedded_variable_node: (EmbeddedVariableNode node) -> void - - # : (EnsureNode node) -> void - def visit_ensure_node: (EnsureNode node) -> void - - # : (FalseNode node) -> void - def visit_false_node: (FalseNode node) -> void - - # : (FindPatternNode node) -> void - def visit_find_pattern_node: (FindPatternNode node) -> void - - # : (FlipFlopNode node) -> void - def visit_flip_flop_node: (FlipFlopNode node) -> void - - # : (FloatNode node) -> void - def visit_float_node: (FloatNode node) -> void - - # : (ForNode node) -> void - def visit_for_node: (ForNode node) -> void - - # : (ForwardingArgumentsNode node) -> void - def visit_forwarding_arguments_node: (ForwardingArgumentsNode node) -> void - - # : (ForwardingParameterNode node) -> void - def visit_forwarding_parameter_node: (ForwardingParameterNode node) -> void - - # : (ForwardingSuperNode node) -> void - def visit_forwarding_super_node: (ForwardingSuperNode node) -> void - - # : (GlobalVariableAndWriteNode node) -> void - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode node) -> void - - # : (GlobalVariableOperatorWriteNode node) -> void - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode node) -> void - - # : (GlobalVariableOrWriteNode node) -> void - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode node) -> void - - # : (GlobalVariableReadNode node) -> void - def visit_global_variable_read_node: (GlobalVariableReadNode node) -> void - - # : (GlobalVariableTargetNode node) -> void - def visit_global_variable_target_node: (GlobalVariableTargetNode node) -> void - - # : (GlobalVariableWriteNode node) -> void - def visit_global_variable_write_node: (GlobalVariableWriteNode node) -> void - - # : (HashNode node) -> void - def visit_hash_node: (HashNode node) -> void - - # : (HashPatternNode node) -> void - def visit_hash_pattern_node: (HashPatternNode node) -> void - - # : (IfNode node) -> void - def visit_if_node: (IfNode node) -> void - - # : (ImaginaryNode node) -> void - def visit_imaginary_node: (ImaginaryNode node) -> void - - # : (ImplicitNode node) -> void - def visit_implicit_node: (ImplicitNode node) -> void - - # : (ImplicitRestNode node) -> void - def visit_implicit_rest_node: (ImplicitRestNode node) -> void - - # : (InNode node) -> void - def visit_in_node: (InNode node) -> void - - # : (IndexAndWriteNode node) -> void - def visit_index_and_write_node: (IndexAndWriteNode node) -> void - - # : (IndexOperatorWriteNode node) -> void - def visit_index_operator_write_node: (IndexOperatorWriteNode node) -> void - - # : (IndexOrWriteNode node) -> void - def visit_index_or_write_node: (IndexOrWriteNode node) -> void - - # : (IndexTargetNode node) -> void - def visit_index_target_node: (IndexTargetNode node) -> void - - # : (InstanceVariableAndWriteNode node) -> void - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode node) -> void - - # : (InstanceVariableOperatorWriteNode node) -> void - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode node) -> void - - # : (InstanceVariableOrWriteNode node) -> void - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode node) -> void - - # : (InstanceVariableReadNode node) -> void - def visit_instance_variable_read_node: (InstanceVariableReadNode node) -> void - - # : (InstanceVariableTargetNode node) -> void - def visit_instance_variable_target_node: (InstanceVariableTargetNode node) -> void - - # : (InstanceVariableWriteNode node) -> void - def visit_instance_variable_write_node: (InstanceVariableWriteNode node) -> void - - # : (IntegerNode node) -> void - def visit_integer_node: (IntegerNode node) -> void - - # : (InterpolatedMatchLastLineNode node) -> void - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode node) -> void - - # : (InterpolatedRegularExpressionNode node) -> void - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode node) -> void - - # : (InterpolatedStringNode node) -> void - def visit_interpolated_string_node: (InterpolatedStringNode node) -> void - - # : (InterpolatedSymbolNode node) -> void - def visit_interpolated_symbol_node: (InterpolatedSymbolNode node) -> void - - # : (InterpolatedXStringNode node) -> void - def visit_interpolated_x_string_node: (InterpolatedXStringNode node) -> void - - # : (ItLocalVariableReadNode node) -> void - def visit_it_local_variable_read_node: (ItLocalVariableReadNode node) -> void - - # : (ItParametersNode node) -> void - def visit_it_parameters_node: (ItParametersNode node) -> void - - # : (KeywordHashNode node) -> void - def visit_keyword_hash_node: (KeywordHashNode node) -> void - - # : (KeywordRestParameterNode node) -> void - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode node) -> void - - # : (LambdaNode node) -> void - def visit_lambda_node: (LambdaNode node) -> void - - # : (LocalVariableAndWriteNode node) -> void - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode node) -> void - - # : (LocalVariableOperatorWriteNode node) -> void - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode node) -> void - - # : (LocalVariableOrWriteNode node) -> void - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode node) -> void - - # : (LocalVariableReadNode node) -> void - def visit_local_variable_read_node: (LocalVariableReadNode node) -> void - - # : (LocalVariableTargetNode node) -> void - def visit_local_variable_target_node: (LocalVariableTargetNode node) -> void - - # : (LocalVariableWriteNode node) -> void - def visit_local_variable_write_node: (LocalVariableWriteNode node) -> void - - # : (MatchLastLineNode node) -> void - def visit_match_last_line_node: (MatchLastLineNode node) -> void - - # : (MatchPredicateNode node) -> void - def visit_match_predicate_node: (MatchPredicateNode node) -> void - - # : (MatchRequiredNode node) -> void - def visit_match_required_node: (MatchRequiredNode node) -> void - - # : (MatchWriteNode node) -> void - def visit_match_write_node: (MatchWriteNode node) -> void - - # : (MissingNode node) -> void - def visit_missing_node: (MissingNode node) -> void - - # : (ModuleNode node) -> void - def visit_module_node: (ModuleNode node) -> void - - # : (MultiTargetNode node) -> void - def visit_multi_target_node: (MultiTargetNode node) -> void - - # : (MultiWriteNode node) -> void - def visit_multi_write_node: (MultiWriteNode node) -> void - - # : (NextNode node) -> void - def visit_next_node: (NextNode node) -> void - - # : (NilNode node) -> void - def visit_nil_node: (NilNode node) -> void - - # : (NoBlockParameterNode node) -> void - def visit_no_block_parameter_node: (NoBlockParameterNode node) -> void - - # : (NoKeywordsParameterNode node) -> void - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode node) -> void - - # : (NumberedParametersNode node) -> void - def visit_numbered_parameters_node: (NumberedParametersNode node) -> void - - # : (NumberedReferenceReadNode node) -> void - def visit_numbered_reference_read_node: (NumberedReferenceReadNode node) -> void - - # : (OptionalKeywordParameterNode node) -> void - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode node) -> void - - # : (OptionalParameterNode node) -> void - def visit_optional_parameter_node: (OptionalParameterNode node) -> void - - # : (OrNode node) -> void - def visit_or_node: (OrNode node) -> void - - # : (ParametersNode node) -> void - def visit_parameters_node: (ParametersNode node) -> void - - # : (ParenthesesNode node) -> void - def visit_parentheses_node: (ParenthesesNode node) -> void - - # : (PinnedExpressionNode node) -> void - def visit_pinned_expression_node: (PinnedExpressionNode node) -> void - - # : (PinnedVariableNode node) -> void - def visit_pinned_variable_node: (PinnedVariableNode node) -> void - - # : (PostExecutionNode node) -> void - def visit_post_execution_node: (PostExecutionNode node) -> void - - # : (PreExecutionNode node) -> void - def visit_pre_execution_node: (PreExecutionNode node) -> void - - # : (ProgramNode node) -> void - def visit_program_node: (ProgramNode node) -> void - - # : (RangeNode node) -> void - def visit_range_node: (RangeNode node) -> void - - # : (RationalNode node) -> void - def visit_rational_node: (RationalNode node) -> void - - # : (RedoNode node) -> void - def visit_redo_node: (RedoNode node) -> void - - # : (RegularExpressionNode node) -> void - def visit_regular_expression_node: (RegularExpressionNode node) -> void - - # : (RequiredKeywordParameterNode node) -> void - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode node) -> void - - # : (RequiredParameterNode node) -> void - def visit_required_parameter_node: (RequiredParameterNode node) -> void - - # : (RescueModifierNode node) -> void - def visit_rescue_modifier_node: (RescueModifierNode node) -> void - - # : (RescueNode node) -> void - def visit_rescue_node: (RescueNode node) -> void - - # : (RestParameterNode node) -> void - def visit_rest_parameter_node: (RestParameterNode node) -> void - - # : (RetryNode node) -> void - def visit_retry_node: (RetryNode node) -> void - - # : (ReturnNode node) -> void - def visit_return_node: (ReturnNode node) -> void - - # : (SelfNode node) -> void - def visit_self_node: (SelfNode node) -> void - - # : (ShareableConstantNode node) -> void - def visit_shareable_constant_node: (ShareableConstantNode node) -> void - - # : (SingletonClassNode node) -> void - def visit_singleton_class_node: (SingletonClassNode node) -> void - - # : (SourceEncodingNode node) -> void - def visit_source_encoding_node: (SourceEncodingNode node) -> void - - # : (SourceFileNode node) -> void - def visit_source_file_node: (SourceFileNode node) -> void - - # : (SourceLineNode node) -> void - def visit_source_line_node: (SourceLineNode node) -> void - - # : (SplatNode node) -> void - def visit_splat_node: (SplatNode node) -> void - - # : (StatementsNode node) -> void - def visit_statements_node: (StatementsNode node) -> void - - # : (StringNode node) -> void - def visit_string_node: (StringNode node) -> void - - # : (SuperNode node) -> void - def visit_super_node: (SuperNode node) -> void - - # : (SymbolNode node) -> void - def visit_symbol_node: (SymbolNode node) -> void - - # : (TrueNode node) -> void - def visit_true_node: (TrueNode node) -> void - - # : (UndefNode node) -> void - def visit_undef_node: (UndefNode node) -> void - - # : (UnlessNode node) -> void - def visit_unless_node: (UnlessNode node) -> void - - # : (UntilNode node) -> void - def visit_until_node: (UntilNode node) -> void - - # : (WhenNode node) -> void - def visit_when_node: (WhenNode node) -> void - - # : (WhileNode node) -> void - def visit_while_node: (WhileNode node) -> void - - # : (XStringNode node) -> void - def visit_x_string_node: (XStringNode node) -> void - - # : (YieldNode node) -> void - def visit_yield_node: (YieldNode node) -> void - - private - - # Compose a header for the given node. - # -- - # : (String name, node node) -> String - def inspect_node: (String name, node node) -> String - - # Compose a string representing the given inner location field. - # -- - # : (Location? location) -> String - def inspect_location: (Location? location) -> String - end -end diff --git a/sig/generated/prism/lex_compat.rbs b/sig/generated/prism/lex_compat.rbs deleted file mode 100644 index d6bf985b0a..0000000000 --- a/sig/generated/prism/lex_compat.rbs +++ /dev/null @@ -1,160 +0,0 @@ -# Generated from lib/prism/lex_compat.rb with RBS::Inline - -module Prism - module Translation - class Ripper - EXPR_NONE: Integer - EXPR_BEG: Integer - EXPR_MID: Integer - EXPR_END: Integer - EXPR_CLASS: Integer - EXPR_VALUE: Integer - EXPR_ARG: Integer - EXPR_CMDARG: Integer - EXPR_ENDARG: Integer - EXPR_ENDFN: Integer - - class Lexer < Ripper - class State - def self.[]: (Integer value) -> State - end - end - end - end - - # This class is responsible for lexing the source using prism and then - # converting those tokens to be compatible with Ripper. In the vast majority - # of cases, this is a one-to-one mapping of the token type. Everything else - # generally lines up. However, there are a few cases that require special - # handling. - class LexCompat - # A token produced by the Ripper lexer that Prism is replicating. - type lex_compat_token = [ [ Integer, Integer ], Symbol, String, untyped ] - - # A result class specialized for holding tokens produced by the lexer. - class Result < Prism::Result - # The list of tokens that were produced by the lexer. - attr_reader value: Array[lex_compat_token] - - # Create a new lex compat result object with the given values. - # -- - # : (Array[lex_compat_token] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - def initialize: (Array[lex_compat_token] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - - # Implement the hash pattern matching interface for Result. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - end - - # This is a mapping of prism token types to Ripper token types. This is a - # many-to-one mapping because we split up our token types, whereas Ripper - # tends to group them. - RIPPER: untyped - - # A heredoc in this case is a list of tokens that belong to the body of the - # heredoc that should be appended onto the list of tokens when the heredoc - # closes. - module Heredoc - # Heredocs that are no dash or tilde heredocs are just a list of tokens. - # We need to keep them around so that we can insert them in the correct - # order back into the token stream and set the state of the last token to - # the state that the heredoc was opened in. - class PlainHeredoc - # :nodoc: - attr_reader tokens: Array[lex_compat_token] - - # : () -> void - def initialize: () -> void - - # : (lex_compat_token token) -> void - def <<: (lex_compat_token token) -> void - - # : () -> Array[lex_compat_token] - def to_a: () -> Array[lex_compat_token] - end - - # Dash heredocs are a little more complicated. They are a list of tokens - # that need to be split on "\\\n" to mimic Ripper's behavior. We also need - # to keep track of the state that the heredoc was opened in. - class DashHeredoc - # :nodoc: - attr_reader split: bool - - attr_reader tokens: Array[lex_compat_token] - - # : (bool split) -> void - def initialize: (bool split) -> void - - # : (lex_compat_token token) -> void - def <<: (lex_compat_token token) -> void - - # : () -> Array[lex_compat_token] - def to_a: () -> Array[lex_compat_token] - end - - # Heredocs that are dedenting heredocs are a little more complicated. - # Ripper outputs on_ignored_sp tokens for the whitespace that is being - # removed from the output. prism only modifies the node itself and keeps - # the token the same. This simplifies prism, but makes comparing against - # Ripper much harder because there is a length mismatch. - # - # Fortunately, we already have to pull out the heredoc tokens in order to - # insert them into the stream in the correct order. As such, we can do - # some extra manipulation on the tokens to make them match Ripper's - # output by mirroring the dedent logic that Ripper uses. - class DedentingHeredoc - # :nodoc: - TAB_WIDTH: ::Integer - - attr_reader tokens: Array[lex_compat_token] - - attr_reader dedent_next: bool - - attr_reader dedent: Integer? - - attr_reader embexpr_balance: Integer - - @ended_on_newline: bool - - # : () -> void - def initialize: () -> void - - # As tokens are coming in, we track the minimum amount of common leading - # whitespace on plain string content tokens. This allows us to later - # remove that amount of whitespace from the beginning of each line. - # - # : (lex_compat_token token) -> void - def <<: (lex_compat_token token) -> void - - # : () -> Array[lex_compat_token] - def to_a: () -> Array[lex_compat_token] - end - - # Here we will split between the two types of heredocs and return the - # object that will store their tokens. - # -- - # : (lex_compat_token opening) -> (PlainHeredoc | DashHeredoc | DedentingHeredoc) - def self.build: (lex_compat_token opening) -> (PlainHeredoc | DashHeredoc | DedentingHeredoc) - end - - # In previous versions of Ruby, Ripper wouldn't flush the bom before the - # first token, so we had to have a hack in place to account for that. - BOM_FLUSHED: untyped - - attr_reader options: Hash[Symbol, untyped] - - @source: String - - # : (String source, **untyped options) -> void - def initialize: (String source, **untyped options) -> void - - # : () -> Result - def result: () -> Result - - private - - # : (Array[lex_compat_token] tokens, Source source, Location? data_loc, bool bom, Token? eof_token) -> Array[lex_compat_token] - def post_process_tokens: (Array[lex_compat_token] tokens, Source source, Location? data_loc, bool bom, Token? eof_token) -> Array[lex_compat_token] - end -end diff --git a/sig/generated/prism/mutation_compiler.rbs b/sig/generated/prism/mutation_compiler.rbs deleted file mode 100644 index e79f254372..0000000000 --- a/sig/generated/prism/mutation_compiler.rbs +++ /dev/null @@ -1,464 +0,0 @@ -# Generated from lib/prism/mutation_compiler.rb with RBS::Inline - -module Prism - # This visitor walks through the tree and copies each node as it is being - # visited. This is useful for consumers that want to mutate the tree, as you - # can change subtrees in place without effecting the rest of the tree. - class MutationCompiler < Compiler - # : (AliasGlobalVariableNode) -> node? - def visit_alias_global_variable_node: (AliasGlobalVariableNode) -> node? - - # : (AliasMethodNode) -> node? - def visit_alias_method_node: (AliasMethodNode) -> node? - - # : (AlternationPatternNode) -> node? - def visit_alternation_pattern_node: (AlternationPatternNode) -> node? - - # : (AndNode) -> node? - def visit_and_node: (AndNode) -> node? - - # : (ArgumentsNode) -> node? - def visit_arguments_node: (ArgumentsNode) -> node? - - # : (ArrayNode) -> node? - def visit_array_node: (ArrayNode) -> node? - - # : (ArrayPatternNode) -> node? - def visit_array_pattern_node: (ArrayPatternNode) -> node? - - # : (AssocNode) -> node? - def visit_assoc_node: (AssocNode) -> node? - - # : (AssocSplatNode) -> node? - def visit_assoc_splat_node: (AssocSplatNode) -> node? - - # : (BackReferenceReadNode) -> node? - def visit_back_reference_read_node: (BackReferenceReadNode) -> node? - - # : (BeginNode) -> node? - def visit_begin_node: (BeginNode) -> node? - - # : (BlockArgumentNode) -> node? - def visit_block_argument_node: (BlockArgumentNode) -> node? - - # : (BlockLocalVariableNode) -> node? - def visit_block_local_variable_node: (BlockLocalVariableNode) -> node? - - # : (BlockNode) -> node? - def visit_block_node: (BlockNode) -> node? - - # : (BlockParameterNode) -> node? - def visit_block_parameter_node: (BlockParameterNode) -> node? - - # : (BlockParametersNode) -> node? - def visit_block_parameters_node: (BlockParametersNode) -> node? - - # : (BreakNode) -> node? - def visit_break_node: (BreakNode) -> node? - - # : (CallAndWriteNode) -> node? - def visit_call_and_write_node: (CallAndWriteNode) -> node? - - # : (CallNode) -> node? - def visit_call_node: (CallNode) -> node? - - # : (CallOperatorWriteNode) -> node? - def visit_call_operator_write_node: (CallOperatorWriteNode) -> node? - - # : (CallOrWriteNode) -> node? - def visit_call_or_write_node: (CallOrWriteNode) -> node? - - # : (CallTargetNode) -> node? - def visit_call_target_node: (CallTargetNode) -> node? - - # : (CapturePatternNode) -> node? - def visit_capture_pattern_node: (CapturePatternNode) -> node? - - # : (CaseMatchNode) -> node? - def visit_case_match_node: (CaseMatchNode) -> node? - - # : (CaseNode) -> node? - def visit_case_node: (CaseNode) -> node? - - # : (ClassNode) -> node? - def visit_class_node: (ClassNode) -> node? - - # : (ClassVariableAndWriteNode) -> node? - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode) -> node? - - # : (ClassVariableOperatorWriteNode) -> node? - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode) -> node? - - # : (ClassVariableOrWriteNode) -> node? - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode) -> node? - - # : (ClassVariableReadNode) -> node? - def visit_class_variable_read_node: (ClassVariableReadNode) -> node? - - # : (ClassVariableTargetNode) -> node? - def visit_class_variable_target_node: (ClassVariableTargetNode) -> node? - - # : (ClassVariableWriteNode) -> node? - def visit_class_variable_write_node: (ClassVariableWriteNode) -> node? - - # : (ConstantAndWriteNode) -> node? - def visit_constant_and_write_node: (ConstantAndWriteNode) -> node? - - # : (ConstantOperatorWriteNode) -> node? - def visit_constant_operator_write_node: (ConstantOperatorWriteNode) -> node? - - # : (ConstantOrWriteNode) -> node? - def visit_constant_or_write_node: (ConstantOrWriteNode) -> node? - - # : (ConstantPathAndWriteNode) -> node? - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode) -> node? - - # : (ConstantPathNode) -> node? - def visit_constant_path_node: (ConstantPathNode) -> node? - - # : (ConstantPathOperatorWriteNode) -> node? - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode) -> node? - - # : (ConstantPathOrWriteNode) -> node? - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode) -> node? - - # : (ConstantPathTargetNode) -> node? - def visit_constant_path_target_node: (ConstantPathTargetNode) -> node? - - # : (ConstantPathWriteNode) -> node? - def visit_constant_path_write_node: (ConstantPathWriteNode) -> node? - - # : (ConstantReadNode) -> node? - def visit_constant_read_node: (ConstantReadNode) -> node? - - # : (ConstantTargetNode) -> node? - def visit_constant_target_node: (ConstantTargetNode) -> node? - - # : (ConstantWriteNode) -> node? - def visit_constant_write_node: (ConstantWriteNode) -> node? - - # : (DefNode) -> node? - def visit_def_node: (DefNode) -> node? - - # : (DefinedNode) -> node? - def visit_defined_node: (DefinedNode) -> node? - - # : (ElseNode) -> node? - def visit_else_node: (ElseNode) -> node? - - # : (EmbeddedStatementsNode) -> node? - def visit_embedded_statements_node: (EmbeddedStatementsNode) -> node? - - # : (EmbeddedVariableNode) -> node? - def visit_embedded_variable_node: (EmbeddedVariableNode) -> node? - - # : (EnsureNode) -> node? - def visit_ensure_node: (EnsureNode) -> node? - - # : (FalseNode) -> node? - def visit_false_node: (FalseNode) -> node? - - # : (FindPatternNode) -> node? - def visit_find_pattern_node: (FindPatternNode) -> node? - - # : (FlipFlopNode) -> node? - def visit_flip_flop_node: (FlipFlopNode) -> node? - - # : (FloatNode) -> node? - def visit_float_node: (FloatNode) -> node? - - # : (ForNode) -> node? - def visit_for_node: (ForNode) -> node? - - # : (ForwardingArgumentsNode) -> node? - def visit_forwarding_arguments_node: (ForwardingArgumentsNode) -> node? - - # : (ForwardingParameterNode) -> node? - def visit_forwarding_parameter_node: (ForwardingParameterNode) -> node? - - # : (ForwardingSuperNode) -> node? - def visit_forwarding_super_node: (ForwardingSuperNode) -> node? - - # : (GlobalVariableAndWriteNode) -> node? - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode) -> node? - - # : (GlobalVariableOperatorWriteNode) -> node? - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode) -> node? - - # : (GlobalVariableOrWriteNode) -> node? - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode) -> node? - - # : (GlobalVariableReadNode) -> node? - def visit_global_variable_read_node: (GlobalVariableReadNode) -> node? - - # : (GlobalVariableTargetNode) -> node? - def visit_global_variable_target_node: (GlobalVariableTargetNode) -> node? - - # : (GlobalVariableWriteNode) -> node? - def visit_global_variable_write_node: (GlobalVariableWriteNode) -> node? - - # : (HashNode) -> node? - def visit_hash_node: (HashNode) -> node? - - # : (HashPatternNode) -> node? - def visit_hash_pattern_node: (HashPatternNode) -> node? - - # : (IfNode) -> node? - def visit_if_node: (IfNode) -> node? - - # : (ImaginaryNode) -> node? - def visit_imaginary_node: (ImaginaryNode) -> node? - - # : (ImplicitNode) -> node? - def visit_implicit_node: (ImplicitNode) -> node? - - # : (ImplicitRestNode) -> node? - def visit_implicit_rest_node: (ImplicitRestNode) -> node? - - # : (InNode) -> node? - def visit_in_node: (InNode) -> node? - - # : (IndexAndWriteNode) -> node? - def visit_index_and_write_node: (IndexAndWriteNode) -> node? - - # : (IndexOperatorWriteNode) -> node? - def visit_index_operator_write_node: (IndexOperatorWriteNode) -> node? - - # : (IndexOrWriteNode) -> node? - def visit_index_or_write_node: (IndexOrWriteNode) -> node? - - # : (IndexTargetNode) -> node? - def visit_index_target_node: (IndexTargetNode) -> node? - - # : (InstanceVariableAndWriteNode) -> node? - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode) -> node? - - # : (InstanceVariableOperatorWriteNode) -> node? - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode) -> node? - - # : (InstanceVariableOrWriteNode) -> node? - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode) -> node? - - # : (InstanceVariableReadNode) -> node? - def visit_instance_variable_read_node: (InstanceVariableReadNode) -> node? - - # : (InstanceVariableTargetNode) -> node? - def visit_instance_variable_target_node: (InstanceVariableTargetNode) -> node? - - # : (InstanceVariableWriteNode) -> node? - def visit_instance_variable_write_node: (InstanceVariableWriteNode) -> node? - - # : (IntegerNode) -> node? - def visit_integer_node: (IntegerNode) -> node? - - # : (InterpolatedMatchLastLineNode) -> node? - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode) -> node? - - # : (InterpolatedRegularExpressionNode) -> node? - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode) -> node? - - # : (InterpolatedStringNode) -> node? - def visit_interpolated_string_node: (InterpolatedStringNode) -> node? - - # : (InterpolatedSymbolNode) -> node? - def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> node? - - # : (InterpolatedXStringNode) -> node? - def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> node? - - # : (ItLocalVariableReadNode) -> node? - def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> node? - - # : (ItParametersNode) -> node? - def visit_it_parameters_node: (ItParametersNode) -> node? - - # : (KeywordHashNode) -> node? - def visit_keyword_hash_node: (KeywordHashNode) -> node? - - # : (KeywordRestParameterNode) -> node? - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> node? - - # : (LambdaNode) -> node? - def visit_lambda_node: (LambdaNode) -> node? - - # : (LocalVariableAndWriteNode) -> node? - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode) -> node? - - # : (LocalVariableOperatorWriteNode) -> node? - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode) -> node? - - # : (LocalVariableOrWriteNode) -> node? - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode) -> node? - - # : (LocalVariableReadNode) -> node? - def visit_local_variable_read_node: (LocalVariableReadNode) -> node? - - # : (LocalVariableTargetNode) -> node? - def visit_local_variable_target_node: (LocalVariableTargetNode) -> node? - - # : (LocalVariableWriteNode) -> node? - def visit_local_variable_write_node: (LocalVariableWriteNode) -> node? - - # : (MatchLastLineNode) -> node? - def visit_match_last_line_node: (MatchLastLineNode) -> node? - - # : (MatchPredicateNode) -> node? - def visit_match_predicate_node: (MatchPredicateNode) -> node? - - # : (MatchRequiredNode) -> node? - def visit_match_required_node: (MatchRequiredNode) -> node? - - # : (MatchWriteNode) -> node? - def visit_match_write_node: (MatchWriteNode) -> node? - - # : (MissingNode) -> node? - def visit_missing_node: (MissingNode) -> node? - - # : (ModuleNode) -> node? - def visit_module_node: (ModuleNode) -> node? - - # : (MultiTargetNode) -> node? - def visit_multi_target_node: (MultiTargetNode) -> node? - - # : (MultiWriteNode) -> node? - def visit_multi_write_node: (MultiWriteNode) -> node? - - # : (NextNode) -> node? - def visit_next_node: (NextNode) -> node? - - # : (NilNode) -> node? - def visit_nil_node: (NilNode) -> node? - - # : (NoBlockParameterNode) -> node? - def visit_no_block_parameter_node: (NoBlockParameterNode) -> node? - - # : (NoKeywordsParameterNode) -> node? - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode) -> node? - - # : (NumberedParametersNode) -> node? - def visit_numbered_parameters_node: (NumberedParametersNode) -> node? - - # : (NumberedReferenceReadNode) -> node? - def visit_numbered_reference_read_node: (NumberedReferenceReadNode) -> node? - - # : (OptionalKeywordParameterNode) -> node? - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode) -> node? - - # : (OptionalParameterNode) -> node? - def visit_optional_parameter_node: (OptionalParameterNode) -> node? - - # : (OrNode) -> node? - def visit_or_node: (OrNode) -> node? - - # : (ParametersNode) -> node? - def visit_parameters_node: (ParametersNode) -> node? - - # : (ParenthesesNode) -> node? - def visit_parentheses_node: (ParenthesesNode) -> node? - - # : (PinnedExpressionNode) -> node? - def visit_pinned_expression_node: (PinnedExpressionNode) -> node? - - # : (PinnedVariableNode) -> node? - def visit_pinned_variable_node: (PinnedVariableNode) -> node? - - # : (PostExecutionNode) -> node? - def visit_post_execution_node: (PostExecutionNode) -> node? - - # : (PreExecutionNode) -> node? - def visit_pre_execution_node: (PreExecutionNode) -> node? - - # : (ProgramNode) -> node? - def visit_program_node: (ProgramNode) -> node? - - # : (RangeNode) -> node? - def visit_range_node: (RangeNode) -> node? - - # : (RationalNode) -> node? - def visit_rational_node: (RationalNode) -> node? - - # : (RedoNode) -> node? - def visit_redo_node: (RedoNode) -> node? - - # : (RegularExpressionNode) -> node? - def visit_regular_expression_node: (RegularExpressionNode) -> node? - - # : (RequiredKeywordParameterNode) -> node? - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode) -> node? - - # : (RequiredParameterNode) -> node? - def visit_required_parameter_node: (RequiredParameterNode) -> node? - - # : (RescueModifierNode) -> node? - def visit_rescue_modifier_node: (RescueModifierNode) -> node? - - # : (RescueNode) -> node? - def visit_rescue_node: (RescueNode) -> node? - - # : (RestParameterNode) -> node? - def visit_rest_parameter_node: (RestParameterNode) -> node? - - # : (RetryNode) -> node? - def visit_retry_node: (RetryNode) -> node? - - # : (ReturnNode) -> node? - def visit_return_node: (ReturnNode) -> node? - - # : (SelfNode) -> node? - def visit_self_node: (SelfNode) -> node? - - # : (ShareableConstantNode) -> node? - def visit_shareable_constant_node: (ShareableConstantNode) -> node? - - # : (SingletonClassNode) -> node? - def visit_singleton_class_node: (SingletonClassNode) -> node? - - # : (SourceEncodingNode) -> node? - def visit_source_encoding_node: (SourceEncodingNode) -> node? - - # : (SourceFileNode) -> node? - def visit_source_file_node: (SourceFileNode) -> node? - - # : (SourceLineNode) -> node? - def visit_source_line_node: (SourceLineNode) -> node? - - # : (SplatNode) -> node? - def visit_splat_node: (SplatNode) -> node? - - # : (StatementsNode) -> node? - def visit_statements_node: (StatementsNode) -> node? - - # : (StringNode) -> node? - def visit_string_node: (StringNode) -> node? - - # : (SuperNode) -> node? - def visit_super_node: (SuperNode) -> node? - - # : (SymbolNode) -> node? - def visit_symbol_node: (SymbolNode) -> node? - - # : (TrueNode) -> node? - def visit_true_node: (TrueNode) -> node? - - # : (UndefNode) -> node? - def visit_undef_node: (UndefNode) -> node? - - # : (UnlessNode) -> node? - def visit_unless_node: (UnlessNode) -> node? - - # : (UntilNode) -> node? - def visit_until_node: (UntilNode) -> node? - - # : (WhenNode) -> node? - def visit_when_node: (WhenNode) -> node? - - # : (WhileNode) -> node? - def visit_while_node: (WhileNode) -> node? - - # : (XStringNode) -> node? - def visit_x_string_node: (XStringNode) -> node? - - # : (YieldNode) -> node? - def visit_yield_node: (YieldNode) -> node? - end -end diff --git a/sig/generated/prism/node.rbs b/sig/generated/prism/node.rbs deleted file mode 100644 index 94b8967bd4..0000000000 --- a/sig/generated/prism/node.rbs +++ /dev/null @@ -1,20895 +0,0 @@ -# Generated from lib/prism/node.rb with RBS::Inline - -module Prism - interface _Repository - def enter: (Integer node_id, Symbol field_name) -> Relocation::Entry - end - - interface _Node - def deconstruct: () -> Array[Prism::node?] - - def inspect: () -> String - end - - type node = Node & _Node - - # This represents a node in the tree. It is the parent class of all of the - # various node types. - class Node - # A pointer to the source that this node was created from. - # :stopdoc: - attr_reader source: Source - - # A unique identifier for this node. This is used in a very specific - # use case where you want to keep around a reference to a node without - # having to keep around the syntax tree in memory. This unique identifier - # will be consistent across multiple parses of the same source code. - attr_reader node_id: Integer - - @location: Location | Integer - - # Save this node using a saved source so that it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save: (_Repository repository) -> Relocation::Entry - - # A Location instance that represents the location of this node in the - # source. - # -- - # : () -> Location - def location: () -> Location - - # Save the location using a saved source so that it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_location: (_Repository repository) -> Relocation::Entry - - # Delegates to [`start_line`](rdoc-ref:Location#start_line) of the associated location object. - # -- - # : () -> Integer - def start_line: () -> Integer - - # Delegates to [`end_line`](rdoc-ref:Location#end_line) of the associated location object. - # -- - # : () -> Integer - def end_line: () -> Integer - - # Delegates to [`start_offset`](rdoc-ref:Location#start_offset) of the associated location object. - # -- - # : () -> Integer - def start_offset: () -> Integer - - # Delegates to [`end_offset`](rdoc-ref:Location#end_offset) of the associated location object. - # -- - # : () -> Integer - def end_offset: () -> Integer - - # Delegates to [`start_character_offset`](rdoc-ref:Location#start_character_offset) - # of the associated location object. - # -- - # : () -> Integer - def start_character_offset: () -> Integer - - # Delegates to [`end_character_offset`](rdoc-ref:Location#end_character_offset) - # of the associated location object. - # -- - # : () -> Integer - def end_character_offset: () -> Integer - - # Delegates to [`cached_start_code_units_offset`](rdoc-ref:Location#cached_start_code_units_offset) - # of the associated location object. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_start_code_units_offset: (_CodeUnitsCache cache) -> Integer - - # Delegates to [`cached_end_code_units_offset`](rdoc-ref:Location#cached_end_code_units_offset) - # of the associated location object. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_end_code_units_offset: (_CodeUnitsCache cache) -> Integer - - # Delegates to [`start_column`](rdoc-ref:Location#start_column) of the associated location object. - # -- - # : () -> Integer - def start_column: () -> Integer - - # Delegates to [`end_column`](rdoc-ref:Location#end_column) of the associated location object. - # -- - # : () -> Integer - def end_column: () -> Integer - - # Delegates to [`start_character_column`](rdoc-ref:Location#start_character_column) - # of the associated location object. - # -- - # : () -> Integer - def start_character_column: () -> Integer - - # Delegates to [`end_character_column`](rdoc-ref:Location#end_character_column) - # of the associated location object. - # -- - # : () -> Integer - def end_character_column: () -> Integer - - # Delegates to [`cached_start_code_units_column`](rdoc-ref:Location#cached_start_code_units_column) - # of the associated location object. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_start_code_units_column: (_CodeUnitsCache cache) -> Integer - - # Delegates to [`cached_end_code_units_column`](rdoc-ref:Location#cached_end_code_units_column) - # of the associated location object. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_end_code_units_column: (_CodeUnitsCache cache) -> Integer - - # Delegates to [`leading_comments`](rdoc-ref:Location#leading_comments) of the associated location object. - # -- - # : () -> Array[Comment] - def leading_comments: () -> Array[Comment] - - # Delegates to [`trailing_comments`](rdoc-ref:Location#trailing_comments) of the associated location object. - # -- - # : () -> Array[Comment] - def trailing_comments: () -> Array[Comment] - - # Delegates to [`comments`](rdoc-ref:Location#comments) of the associated location object. - # -- - # : () -> Array[Comment] - def comments: () -> Array[Comment] - - # Returns all of the lines of the source code associated with this node. - # -- - # : () -> Array[String] - def source_lines: () -> Array[String] - - # An alias for source_lines, used to mimic the API from - # RubyVM::AbstractSyntaxTree to make it easier to migrate. - alias script_lines source_lines - - # Slice the location of the node from the source. - # -- - # : () -> String - def slice: () -> String - - # Slice the location of the node from the source, starting at the beginning - # of the line that the location starts on, ending at the end of the line - # that the location ends on. - # -- - # : () -> String - def slice_lines: () -> String - - # An bitset of flags for this node. There are certain flags that are common - # for all nodes, and then some nodes have specific flags. - # :stopdoc: - attr_reader flags: Integer - - # Returns true if the node has the newline flag set. - # -- - # : () -> bool - def newline?: () -> bool - - # Returns true if the node has the static literal flag set. - # -- - # : () -> bool - def static_literal?: () -> bool - - # Similar to inspect, but respects the current level of indentation given by - # the pretty print object. - # -- - # : (PP q) -> void - def pretty_print: (PP q) -> void - - # Convert this node into a graphviz dot graph string. - # -- - # : () -> String - def to_dot: () -> String - - # Returns a list of nodes that are descendants of this node that contain the - # given line and column. This is useful for locating a node that is selected - # based on the line and column of the source code. - # - # Important to note is that the column given to this method should be in - # bytes, as opposed to characters or code units. - # -- - # : (Integer line, Integer column) -> Array[node] - def tunnel: (Integer line, Integer column) -> Array[node] - - # Returns the first node that matches the given block when visited in a - # breadth-first search. This is useful for finding a node that matches a - # particular condition. - # - # node.breadth_first_search { |node| node.node_id == node_id } - # -- - # : () { (node) -> bool } -> node? - def breadth_first_search: () { (node) -> bool } -> node? - - alias find breadth_first_search - - # Returns all of the nodes that match the given block when visited in a - # breadth-first search. This is useful for finding all nodes that match a - # particular condition. - # - # node.breadth_first_search_all { |node| node.is_a?(Prism::CallNode) } - # -- - # : () { (node) -> bool } -> Array[node] - def breadth_first_search_all: () { (node) -> bool } -> Array[node] - - alias find_all breadth_first_search_all - - # Returns a list of the fields that exist for this node class. Fields - # describe the structure of the node. This kind of reflection is useful for - # things like recursively visiting each node _and_ field in the tree. - # -- - # : () -> Array[Reflection::Field] - def self.fields: () -> Array[Reflection::Field] - - # Accepts a visitor and calls back into the specialized visit function. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # Returns an array of child nodes, including `nil`s in the place of optional - # nodes that were not present. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - alias deconstruct child_nodes - - # With a block given, yields each child node. Without a block, returns - # an enumerator that contains each child node. Excludes any `nil`s in - # the place of optional nodes that were not present. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # Returns an array of child nodes, excluding any `nil`s in the place of - # optional nodes that were not present. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # Returns an array of child nodes and locations that could potentially have - # comments attached to them. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # Returns a string representation of the node. - # -- - # : () -> String - def inspect: () -> String - - # Sometimes you want to check an instance of a node against a list of - # classes to see what kind of behavior to perform. Usually this is done by - # calling `[cls1, cls2].include?(node.class)` or putting the node into a - # case statement and doing `case node; when cls1; when cls2; end`. Both of - # these approaches are relatively slow because of the constant lookups, - # method calls, and/or array allocations. - # - # Instead, you can call #type, which will return to you a symbol that you - # can use for comparison. This is faster than the other approaches because - # it uses a single integer comparison, but also because if you're on CRuby - # you can take advantage of the fact that case statements with all symbol - # keys will use a jump table. - # -- - # : () -> Symbol - def type: () -> Symbol - - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # -- - # : () -> Symbol - def self.type: () -> Symbol - end - - # Represents the use of the `alias` keyword to alias a global variable. - # - # alias $foo $bar - # ^^^^^^^^^^^^^^^ - class AliasGlobalVariableNode < Node - @keyword_loc: Location - - @old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode - - @new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode - - # Initialize a new AliasGlobalVariableNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) new_name, (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode) old_name, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode new_name, GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode old_name, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AliasGlobalVariableNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode), ?old_name: (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode), ?keyword_loc: Location) -> AliasGlobalVariableNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, ?keyword_loc: Location) -> AliasGlobalVariableNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :alias_global_variable_node - def type: () -> :alias_global_variable_node - - # See `Node.type`. - # -- - # : () -> :alias_global_variable_node - def self.type: () -> :alias_global_variable_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # new_name -> GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode - # - # Represents the new name of the global variable that can be used after aliasing. - # - # alias $foo $bar - # ^^^^ - # -- - # : () -> (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) - def new_name: () -> (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) - - # :call-seq: - # old_name -> GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode - # - # Represents the old name of the global variable that can be used before aliasing. - # - # alias $foo $bar - # ^^^^ - # -- - # : () -> (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode) - def old_name: () -> (GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode) - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # The Location of the `alias` keyword. - # - # alias $foo $bar - # ^^^^^ - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `alias` keyword to alias a method. - # - # alias foo bar - # ^^^^^^^^^^^^^ - class AliasMethodNode < Node - @keyword_loc: Location - - @old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode - - @new_name: SymbolNode | InterpolatedSymbolNode - - # Initialize a new AliasMethodNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (SymbolNode | InterpolatedSymbolNode) new_name, (SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode) old_name, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, SymbolNode | InterpolatedSymbolNode new_name, SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode old_name, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AliasMethodNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: (SymbolNode | InterpolatedSymbolNode), ?old_name: (SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode), ?keyword_loc: Location) -> AliasMethodNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, ?keyword_loc: Location) -> AliasMethodNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :alias_method_node - def type: () -> :alias_method_node - - # See `Node.type`. - # -- - # : () -> :alias_method_node - def self.type: () -> :alias_method_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # new_name -> SymbolNode | InterpolatedSymbolNode - # - # Represents the new name of the method that will be aliased. - # - # alias foo bar - # ^^^ - # - # alias :foo :bar - # ^^^^ - # - # alias :"#{foo}" :"#{bar}" - # ^^^^^^^^^ - # -- - # : () -> (SymbolNode | InterpolatedSymbolNode) - def new_name: () -> (SymbolNode | InterpolatedSymbolNode) - - # :call-seq: - # old_name -> SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode - # - # Represents the old name of the method that will be aliased. - # - # alias foo bar - # ^^^ - # - # alias :foo :bar - # ^^^^ - # - # alias :"#{foo}" :"#{bar}" - # ^^^^^^^^^ - # -- - # : () -> (SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode) - def old_name: () -> (SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode) - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Represents the Location of the `alias` keyword. - # - # alias foo bar - # ^^^^^ - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an alternation pattern in pattern matching. - # - # foo => bar | baz - # ^^^^^^^^^ - class AlternationPatternNode < Node - @operator_loc: Location - - @right: Prism::node - - @left: Prism::node - - # Initialize a new AlternationPatternNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AlternationPatternNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :alternation_pattern_node - def type: () -> :alternation_pattern_node - - # See `Node.type`. - # -- - # : () -> :alternation_pattern_node - def self.type: () -> :alternation_pattern_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # left -> Node - # - # Represents the left side of the expression. - # - # foo => bar | baz - # ^^^ - # -- - # : () -> Prism::node - def left: () -> Prism::node - - # :call-seq: - # right -> Node - # - # Represents the right side of the expression. - # - # foo => bar | baz - # ^^^ - # -- - # : () -> Prism::node - def right: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the alternation operator Location. - # - # foo => bar | baz - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&` operator or the `and` keyword. - # - # left and right - # ^^^^^^^^^^^^^^ - class AndNode < Node - @operator_loc: Location - - @right: Prism::node - - @left: Prism::node - - # Initialize a new AndNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AndNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :and_node - def type: () -> :and_node - - # See `Node.type`. - # -- - # : () -> :and_node - def self.type: () -> :and_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # left -> Node - # - # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # left and right - # ^^^^ - # - # 1 && 2 - # ^ - # -- - # : () -> Prism::node - def left: () -> Prism::node - - # :call-seq: - # right -> Node - # - # Represents the right side of the expression. - # - # left && right - # ^^^^^ - # - # 1 and 2 - # ^ - # -- - # : () -> Prism::node - def right: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `and` keyword or the `&&` operator. - # - # left and right - # ^^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a set of arguments to a method or a keyword. - # - # return foo, bar, baz - # ^^^^^^^^^^^^^ - class ArgumentsNode < Node - @arguments: Array[Prism::node] - - # Initialize a new ArgumentsNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] arguments) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] arguments) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ArgumentsNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :arguments_node - def type: () -> :arguments_node - - # See `Node.type`. - # -- - # : () -> :arguments_node - def self.type: () -> :arguments_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # if the arguments contain forwarding - # -- - # : () -> bool - def contains_forwarding?: () -> bool - - # :category: Flags - # if the arguments contain keywords - # -- - # : () -> bool - def contains_keywords?: () -> bool - - # :category: Flags - # if the arguments contain a keyword splat - # -- - # : () -> bool - def contains_keyword_splat?: () -> bool - - # :category: Flags - # if the arguments contain a splat - # -- - # : () -> bool - def contains_splat?: () -> bool - - # :category: Flags - # if the arguments contain multiple splats - # -- - # : () -> bool - def contains_multiple_splats?: () -> bool - - # :call-seq: - # arguments -> Array[Node] - # - # The list of arguments, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(bar, baz) - # ^^^^^^^^ - # -- - # : () -> Array[Prism::node] - def arguments: () -> Array[Prism::node] - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. - # - # [1, 2, 3] - # ^^^^^^^^^ - class ArrayNode < Node - @closing_loc: Location? - - @opening_loc: Location? - - @elements: Array[Prism::node] - - # Initialize a new ArrayNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ArrayNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :array_node - def type: () -> :array_node - - # See `Node.type`. - # -- - # : () -> :array_node - def self.type: () -> :array_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # if array contains splat nodes - # -- - # : () -> bool - def contains_splat?: () -> bool - - # :call-seq: - # elements -> Array[Node] - # - # Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array. - # -- - # : () -> Array[Prism::node] - def elements: () -> Array[Prism::node] - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Represents the optional source Location for the opening token. - # - # [1,2,3] # "[" - # %w[foo bar baz] # "%w[" - # %I(apple orange banana) # "%I(" - # foo = 1, 2, 3 # nil - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Represents the optional source Location for the closing token. - # - # [1,2,3] # "]" - # %w[foo bar baz] # "]" - # %I(apple orange banana) # ")" - # foo = 1, 2, 3 # nil - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an array pattern in pattern matching. - # - # foo in 1, 2 - # ^^^^ - # - # foo in [1, 2] - # ^^^^^^ - # - # foo in *bar - # ^^^^ - # - # foo in Bar[] - # ^^^^^ - # - # foo in Bar[1, 2, 3] - # ^^^^^^^^^^^^ - class ArrayPatternNode < Node - @closing_loc: Location? - - @opening_loc: Location? - - @posts: Array[Prism::node] - - @rest: Prism::node? - - @requireds: Array[Prism::node] - - @constant: (ConstantPathNode | ConstantReadNode)? - - # Initialize a new ArrayPatternNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ArrayPatternNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :array_pattern_node - def type: () -> :array_pattern_node - - # See `Node.type`. - # -- - # : () -> :array_pattern_node - def self.type: () -> :array_pattern_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # constant -> ConstantPathNode | ConstantReadNode | nil - # - # Represents the optional constant preceding the Array - # - # foo in Bar[] - # ^^^ - # - # foo in Bar[1, 2, 3] - # ^^^ - # - # foo in Bar::Baz[1, 2, 3] - # ^^^^^^^^ - # -- - # : () -> (ConstantPathNode | ConstantReadNode)? - def constant: () -> (ConstantPathNode | ConstantReadNode)? - - # :call-seq: - # requireds -> Array[Node] - # - # Represents the required elements of the array pattern. - # - # foo in [1, 2] - # ^ ^ - # -- - # : () -> Array[Prism::node] - def requireds: () -> Array[Prism::node] - - # :call-seq: - # rest -> Node | nil - # - # Represents the rest element of the array pattern. - # - # foo in *bar - # ^^^^ - # -- - # : () -> Prism::node? - def rest: () -> Prism::node? - - # :call-seq: - # posts -> Array[Node] - # - # Represents the elements after the rest element of the array pattern. - # - # foo in *bar, baz - # ^^^ - # -- - # : () -> Array[Prism::node] - def posts: () -> Array[Prism::node] - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Represents the opening Location of the array pattern. - # - # foo in [1, 2] - # ^ - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Represents the closing Location of the array pattern. - # - # foo in [1, 2] - # ^ - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a hash key/value pair. - # - # { a => b } - # ^^^^^^ - class AssocNode < Node - @operator_loc: Location? - - @value: Prism::node - - @key: Prism::node - - # Initialize a new AssocNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node key, Prism::node value, Location? operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node key, Prism::node value, Location? operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AssocNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :assoc_node - def type: () -> :assoc_node - - # See `Node.type`. - # -- - # : () -> :assoc_node - def self.type: () -> :assoc_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # key -> Node - # - # The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # { a: b } - # ^ - # - # { foo => bar } - # ^^^ - # - # { def a; end => 1 } - # ^^^^^^^^^^ - # -- - # : () -> Prism::node - def key: () -> Prism::node - - # :call-seq: - # value -> Node - # - # The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # { foo => bar } - # ^^^ - # - # { x: 1 } - # ^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location | nil - # - # The Location of the `=>` operator, if present. - # - # { foo => bar } - # ^^ - # -- - # : () -> Location? - def operator_loc: () -> Location? - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # operator -> String | nil - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String? - def operator: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a splat in a hash literal. - # - # { **foo } - # ^^^^^ - class AssocSplatNode < Node - @operator_loc: Location - - @value: Prism::node? - - # Initialize a new AssocSplatNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> AssocSplatNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :assoc_splat_node - def type: () -> :assoc_splat_node - - # See `Node.type`. - # -- - # : () -> :assoc_splat_node - def self.type: () -> :assoc_splat_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> Node | nil - # - # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. - # - # { **foo } - # ^^^ - # -- - # : () -> Prism::node? - def value: () -> Prism::node? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `**` operator. - # - # { **x } - # ^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents reading a reference to a field in the previous match. - # - # $' - # ^^ - class BackReferenceReadNode < Node - @name: Symbol - - # Initialize a new BackReferenceReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BackReferenceReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :back_reference_read_node - def type: () -> :back_reference_read_node - - # See `Node.type`. - # -- - # : () -> :back_reference_read_node - def self.type: () -> :back_reference_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the back-reference variable, including the leading `$`. - # - # $& # name `:$&` - # - # $+ # name `:$+` - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a begin statement. - # - # begin - # foo - # end - # ^^^^^ - class BeginNode < Node - @end_keyword_loc: Location? - - @ensure_clause: EnsureNode? - - @else_clause: ElseNode? - - @rescue_clause: RescueNode? - - @statements: StatementsNode? - - @begin_keyword_loc: Location? - - # Initialize a new BeginNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BeginNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :begin_node - def type: () -> :begin_node - - # See `Node.type`. - # -- - # : () -> :begin_node - def self.type: () -> :begin_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # begin_keyword_loc -> Location | nil - # - # Represents the Location of the `begin` keyword. - # - # begin x end - # ^^^^^ - # -- - # : () -> Location? - def begin_keyword_loc: () -> Location? - - # :category: Repository - # Save the begin_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_begin_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # statements -> StatementsNode | nil - # - # Represents the statements within the begin block. - # - # begin x end - # ^ - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # rescue_clause -> RescueNode | nil - # - # Represents the rescue clause within the begin block. - # - # begin x; rescue y; end - # ^^^^^^^^ - # -- - # : () -> RescueNode? - def rescue_clause: () -> RescueNode? - - # :call-seq: - # else_clause -> ElseNode | nil - # - # Represents the else clause within the begin block. - # - # begin x; rescue y; else z; end - # ^^^^^^^^^^^ - # -- - # : () -> ElseNode? - def else_clause: () -> ElseNode? - - # :call-seq: - # ensure_clause -> EnsureNode | nil - # - # Represents the ensure clause within the begin block. - # - # begin x; ensure y; end - # ^^^^^^^^ - # -- - # : () -> EnsureNode? - def ensure_clause: () -> EnsureNode? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location | nil - # - # Represents the Location of the `end` keyword. - # - # begin x end - # ^^^ - # -- - # : () -> Location? - def end_keyword_loc: () -> Location? - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # begin_keyword -> String | nil - # - # Slice the location of begin_keyword_loc from the source. - # -- - # : () -> String? - def begin_keyword: () -> String? - - # :call-seq: - # end_keyword -> String | nil - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String? - def end_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a block argument using `&`. - # - # bar(&args) - # ^^^^^ - class BlockArgumentNode < Node - @operator_loc: Location - - @expression: Prism::node? - - # Initialize a new BlockArgumentNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? expression, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? expression, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BlockArgumentNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :block_argument_node - def type: () -> :block_argument_node - - # See `Node.type`. - # -- - # : () -> :block_argument_node - def self.type: () -> :block_argument_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # expression -> Node | nil - # - # The expression that is being passed as a block argument. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(&args) - # ^^^^ - # -- - # : () -> Prism::node? - def expression: () -> Prism::node? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the `&` operator. - # - # foo(&args) - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a block local variable. - # - # a { |; b| } - # ^ - class BlockLocalVariableNode < Node - @name: Symbol - - # Initialize a new BlockLocalVariableNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BlockLocalVariableNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :block_local_variable_node - def type: () -> :block_local_variable_node - - # See `Node.type`. - # -- - # : () -> :block_local_variable_node - def self.type: () -> :block_local_variable_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol - # - # The name of the block local variable. - # - # a { |; b| } # name `:b` - # ^ - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a block of ruby code. - # - # [1, 2, 3].each { |i| puts x } - # ^^^^^^^^^^^^^^ - class BlockNode < Node - @closing_loc: Location - - @opening_loc: Location - - @body: (StatementsNode | BeginNode)? - - @parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - - @locals: Array[Symbol] - - # Initialize a new BlockNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, (BlockParametersNode | NumberedParametersNode | ItParametersNode)? parameters, (StatementsNode | BeginNode)? body, Location opening_loc, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, (BlockParametersNode | NumberedParametersNode | ItParametersNode)? parameters, (StatementsNode | BeginNode)? body, Location opening_loc, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BlockNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :block_node - def type: () -> :block_node - - # See `Node.type`. - # -- - # : () -> :block_node - def self.type: () -> :block_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # The local variables declared in the block. - # - # [1, 2, 3].each { |i| puts x } # locals: [:i] - # ^ - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :call-seq: - # parameters -> BlockParametersNode | NumberedParametersNode | ItParametersNode | nil - # - # The parameters of the block. - # - # [1, 2, 3].each { |i| puts x } - # ^^^ - # [1, 2, 3].each { puts _1 } - # ^^^^^^^^^^^ - # [1, 2, 3].each { puts it } - # ^^^^^^^^^^^ - # -- - # : () -> (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - def parameters: () -> (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # The body of the block. - # - # [1, 2, 3].each { |i| puts x } - # ^^^^^^ - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Represents the Location of the opening `{` or `do`. - # - # [1, 2, 3].each { |i| puts x } - # ^ - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Represents the Location of the closing `}` or `end`. - # - # [1, 2, 3].each { |i| puts x } - # ^ - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a block parameter of a method, block, or lambda definition. - # - # def a(&b) - # ^^ - # end - class BlockParameterNode < Node - @operator_loc: Location - - @name_loc: Location? - - @name: Symbol? - - # Initialize a new BlockParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BlockParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :block_parameter_node - def type: () -> :block_parameter_node - - # See `Node.type`. - # -- - # : () -> :block_parameter_node - def self.type: () -> :block_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol | nil - # - # The name of the block parameter. - # - # def a(&b) # name `:b` - # ^ - # end - # -- - # : () -> Symbol? - def name: () -> Symbol? - - # :category: Locations - # :call-seq: - # name_loc -> Location | nil - # - # Represents the Location of the block parameter name. - # - # def a(&b) - # ^ - # -- - # : () -> Location? - def name_loc: () -> Location? - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_name_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the `&` operator. - # - # def a(&b) - # ^ - # end - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a block's parameters declaration. - # - # -> (a, b = 1; local) { } - # ^^^^^^^^^^^^^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^^^^^^^^^^^^^ - # end - class BlockParametersNode < Node - @closing_loc: Location? - - @opening_loc: Location? - - @locals: Array[BlockLocalVariableNode] - - @parameters: ParametersNode? - - # Initialize a new BlockParametersNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BlockParametersNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :block_parameters_node - def type: () -> :block_parameters_node - - # See `Node.type`. - # -- - # : () -> :block_parameters_node - def self.type: () -> :block_parameters_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # parameters -> ParametersNode | nil - # - # Represents the parameters of the block. - # - # -> (a, b = 1; local) { } - # ^^^^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^^^^ - # end - # -- - # : () -> ParametersNode? - def parameters: () -> ParametersNode? - - # :call-seq: - # locals -> Array[BlockLocalVariableNode] - # - # Represents the local variables of the block. - # - # -> (a, b = 1; local) { } - # ^^^^^ - # - # foo do |a, b = 1; local| - # ^^^^^ - # end - # -- - # : () -> Array[BlockLocalVariableNode] - def locals: () -> Array[BlockLocalVariableNode] - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Represents the opening Location of the block parameters. - # - # -> (a, b = 1; local) { } - # ^ - # - # foo do |a, b = 1; local| - # ^ - # end - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Represents the closing Location of the block parameters. - # - # -> (a, b = 1; local) { } - # ^ - # - # foo do |a, b = 1; local| - # ^ - # end - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `break` keyword. - # - # break foo - # ^^^^^^^^^ - class BreakNode < Node - @keyword_loc: Location - - @arguments: ArgumentsNode? - - # Initialize a new BreakNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> BreakNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :break_node - def type: () -> :break_node - - # See `Node.type`. - # -- - # : () -> :break_node - def self.type: () -> :break_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # break foo - # ^^^ - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # The Location of the `break` keyword. - # - # break foo - # ^^^^^ - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator on a call. - # - # foo.bar &&= value - # ^^^^^^^^^^^^^^^^^ - class CallAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @write_name: Symbol - - @read_name: Symbol - - @message_loc: Location? - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new CallAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CallAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :call_and_write_node - def type: () -> :call_and_write_node - - # See `Node.type`. - # -- - # : () -> :call_and_write_node - def self.type: () -> :call_and_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar &&= value - # ^^^ - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Represents the Location of the call operator. - # - # foo.bar &&= value - # ^ - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # message_loc -> Location | nil - # - # Represents the Location of the message. - # - # foo.bar &&= value - # ^^^ - # -- - # : () -> Location? - def message_loc: () -> Location? - - # :category: Repository - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_message_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # read_name -> Symbol - # - # Represents the name of the method being called. - # - # foo.bar &&= value # read_name `:bar` - # ^^^ - # -- - # : () -> Symbol - def read_name: () -> Symbol - - # :call-seq: - # write_name -> Symbol - # - # Represents the name of the method being written to. - # - # foo.bar &&= value # write_name `:bar=` - # ^^^ - # -- - # : () -> Symbol - def write_name: () -> Symbol - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the operator. - # - # foo.bar &&= value - # ^^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Represents the value being assigned. - # - # foo.bar &&= value - # ^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # message -> String | nil - # - # Slice the location of message_loc from the source. - # -- - # : () -> String? - def message: () -> String? - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a method call, in all of the various forms that can take. - # - # foo - # ^^^ - # - # foo() - # ^^^^^ - # - # +foo - # ^^^^ - # - # foo + bar - # ^^^^^^^^^ - # - # foo.bar - # ^^^^^^^ - # - # foo&.bar - # ^^^^^^^^ - class CallNode < Node - @block: (BlockNode | BlockArgumentNode)? - - @equal_loc: Location? - - @closing_loc: Location? - - @arguments: ArgumentsNode? - - @opening_loc: Location? - - @message_loc: Location? - - @name: Symbol - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new CallNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Location? equal_loc, (BlockNode | BlockArgumentNode)? block) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Location? equal_loc, (BlockNode | BlockArgumentNode)? block) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CallNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> CallNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?equal_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> CallNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :call_node - def type: () -> :call_node - - # See `Node.type`. - # -- - # : () -> :call_node - def self.type: () -> :call_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # The object that the method is being called on. This can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar - # ^^^ - # - # +foo - # ^^^ - # - # foo + bar - # ^^^ - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Represents the Location of the call operator. - # - # foo.bar - # ^ - # - # foo&.bar - # ^^ - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # name -> Symbol - # - # Represents the name of the method being called. - # - # foo.bar # name `:foo` - # ^^^ - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # message_loc -> Location | nil - # - # Represents the Location of the message. - # - # foo.bar - # ^^^ - # -- - # : () -> Location? - def message_loc: () -> Location? - - # :category: Repository - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_message_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Represents the Location of the left parenthesis. - # - # foo(bar) - # ^ - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Represents the arguments to the method call. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo(bar) - # ^^^ - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Represents the Location of the right parenthesis. - # - # foo(bar) - # ^ - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # equal_loc -> Location | nil - # - # Represents the Location of the equal sign, in the case that this is an attribute write. - # - # foo.bar = value - # ^ - # - # foo[bar] = value - # ^ - # -- - # : () -> Location? - def equal_loc: () -> Location? - - # :category: Repository - # Save the equal_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_equal_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # block -> BlockNode | BlockArgumentNode | nil - # - # Represents the block that is being passed to the method. - # - # foo { |a| a } - # ^^^^^^^^^ - # -- - # : () -> (BlockNode | BlockArgumentNode)? - def block: () -> (BlockNode | BlockArgumentNode)? - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # message -> String | nil - # - # Slice the location of message_loc from the source. - # -- - # : () -> String? - def message: () -> String? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # :call-seq: - # equal -> String | nil - # - # Slice the location of equal_loc from the source. - # -- - # : () -> String? - def equal: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of an assignment operator on a call. - # - # foo.bar += baz - # ^^^^^^^^^^^^^^ - class CallOperatorWriteNode < Node - @value: Prism::node - - @binary_operator_loc: Location - - @binary_operator: Symbol - - @write_name: Symbol - - @read_name: Symbol - - @message_loc: Location? - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new CallOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CallOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :call_operator_write_node - def type: () -> :call_operator_write_node - - # See `Node.type`. - # -- - # : () -> :call_operator_write_node - def self.type: () -> :call_operator_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar += value - # ^^^ - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Represents the Location of the call operator. - # - # foo.bar += value - # ^ - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # message_loc -> Location | nil - # - # Represents the Location of the message. - # - # foo.bar += value - # ^^^ - # -- - # : () -> Location? - def message_loc: () -> Location? - - # :category: Repository - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_message_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # read_name -> Symbol - # - # Represents the name of the method being called. - # - # foo.bar += value # read_name `:bar` - # ^^^ - # -- - # : () -> Symbol - def read_name: () -> Symbol - - # :call-seq: - # write_name -> Symbol - # - # Represents the name of the method being written to. - # - # foo.bar += value # write_name `:bar=` - # ^^^ - # -- - # : () -> Symbol - def write_name: () -> Symbol - - # :call-seq: - # binary_operator -> Symbol - # - # Represents the binary operator being used. - # - # foo.bar += value # binary_operator `:+` - # ^ - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Represents the Location of the binary operator. - # - # foo.bar += value - # ^^ - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Represents the value being assigned. - # - # foo.bar += value - # ^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # message -> String | nil - # - # Slice the location of message_loc from the source. - # -- - # : () -> String? - def message: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator on a call. - # - # foo.bar ||= value - # ^^^^^^^^^^^^^^^^^ - class CallOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @write_name: Symbol - - @read_name: Symbol - - @message_loc: Location? - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new CallOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CallOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :call_or_write_node - def type: () -> :call_or_write_node - - # See `Node.type`. - # -- - # : () -> :call_or_write_node - def self.type: () -> :call_or_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar ||= value - # ^^^ - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Represents the Location of the call operator. - # - # foo.bar ||= value - # ^ - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # message_loc -> Location | nil - # - # Represents the Location of the message. - # - # foo.bar ||= value - # ^^^ - # -- - # : () -> Location? - def message_loc: () -> Location? - - # :category: Repository - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_message_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # read_name -> Symbol - # - # Represents the name of the method being called. - # - # foo.bar ||= value # read_name `:bar` - # ^^^ - # -- - # : () -> Symbol - def read_name: () -> Symbol - - # :call-seq: - # write_name -> Symbol - # - # Represents the name of the method being written to. - # - # foo.bar ||= value # write_name `:bar=` - # ^^^ - # -- - # : () -> Symbol - def write_name: () -> Symbol - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the operator. - # - # foo.bar ||= value - # ^^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Represents the value being assigned. - # - # foo.bar ||= value - # ^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # message -> String | nil - # - # Slice the location of message_loc from the source. - # -- - # : () -> String? - def message: () -> String? - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a method call. - # - # foo.bar, = 1 - # ^^^^^^^ - # - # begin - # rescue => foo.bar - # ^^^^^^^ - # end - # - # for foo.bar in baz do end - # ^^^^^^^ - class CallTargetNode < Node - @message_loc: Location - - @name: Symbol - - @call_operator_loc: Location - - @receiver: Prism::node - - # Initialize a new CallTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CallTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :call_target_node - def type: () -> :call_target_node - - # See `Node.type`. - # -- - # : () -> :call_target_node - def self.type: () -> :call_target_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node - # - # The object that the method is being called on. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo.bar = 1 - # ^^^ - # -- - # : () -> Prism::node - def receiver: () -> Prism::node - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location - # - # Represents the Location of the call operator. - # - # foo.bar = 1 - # ^ - # -- - # : () -> Location - def call_operator_loc: () -> Location - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # name -> Symbol - # - # Represents the name of the method being called. - # - # foo.bar = 1 # name `:foo` - # ^^^ - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # message_loc -> Location - # - # Represents the Location of the message. - # - # foo.bar = 1 - # ^^^ - # -- - # : () -> Location - def message_loc: () -> Location - - # :category: Repository - # Save the message_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_message_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # call_operator -> String - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String - def call_operator: () -> String - - # :call-seq: - # message -> String - # - # Slice the location of message_loc from the source. - # -- - # : () -> String - def message: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a local variable in pattern matching. - # - # foo => [bar => baz] - # ^^^^^^^^^^ - class CapturePatternNode < Node - @operator_loc: Location - - @target: LocalVariableTargetNode - - @value: Prism::node - - # Initialize a new CapturePatternNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node value, LocalVariableTargetNode target, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, LocalVariableTargetNode target, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CapturePatternNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :capture_pattern_node - def type: () -> :capture_pattern_node - - # See `Node.type`. - # -- - # : () -> :capture_pattern_node - def self.type: () -> :capture_pattern_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> Node - # - # Represents the value to capture. - # - # foo => bar - # ^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # target -> LocalVariableTargetNode - # - # Represents the target of the capture. - # - # foo => bar - # ^^^ - # -- - # : () -> LocalVariableTargetNode - def target: () -> LocalVariableTargetNode - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the `=>` operator. - # - # foo => bar - # ^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of a case statement for pattern matching. - # - # case true - # in false - # end - # ^^^^^^^^^ - class CaseMatchNode < Node - @end_keyword_loc: Location - - @case_keyword_loc: Location - - @else_clause: ElseNode? - - @conditions: Array[InNode] - - @predicate: Prism::node? - - # Initialize a new CaseMatchNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[InNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[InNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CaseMatchNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :case_match_node - def type: () -> :case_match_node - - # See `Node.type`. - # -- - # : () -> :case_match_node - def self.type: () -> :case_match_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # predicate -> Node | nil - # - # Represents the predicate of the case match. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # case true; in false; end - # ^^^^ - # -- - # : () -> Prism::node? - def predicate: () -> Prism::node? - - # :call-seq: - # conditions -> Array[InNode] - # - # Represents the conditions of the case match. - # - # case true; in false; end - # ^^^^^^^^ - # -- - # : () -> Array[InNode] - def conditions: () -> Array[InNode] - - # :call-seq: - # else_clause -> ElseNode | nil - # - # Represents the else clause of the case match. - # - # case true; in false; else; end - # ^^^^^^^^^ - # -- - # : () -> ElseNode? - def else_clause: () -> ElseNode? - - # :category: Locations - # :call-seq: - # case_keyword_loc -> Location - # - # Represents the Location of the `case` keyword. - # - # case true; in false; end - # ^^^^ - # -- - # : () -> Location - def case_keyword_loc: () -> Location - - # :category: Repository - # Save the case_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_case_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Represents the Location of the `end` keyword. - # - # case true; in false; end - # ^^^ - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # case_keyword -> String - # - # Slice the location of case_keyword_loc from the source. - # -- - # : () -> String - def case_keyword: () -> String - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of a case statement. - # - # case true - # when false - # end - # ^^^^^^^^^^ - class CaseNode < Node - @end_keyword_loc: Location - - @case_keyword_loc: Location - - @else_clause: ElseNode? - - @conditions: Array[WhenNode] - - @predicate: Prism::node? - - # Initialize a new CaseNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[WhenNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? predicate, Array[WhenNode] conditions, ElseNode? else_clause, Location case_keyword_loc, Location end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> CaseNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :case_node - def type: () -> :case_node - - # See `Node.type`. - # -- - # : () -> :case_node - def self.type: () -> :case_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # predicate -> Node | nil - # - # Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # case true; when false; end - # ^^^^ - # -- - # : () -> Prism::node? - def predicate: () -> Prism::node? - - # :call-seq: - # conditions -> Array[WhenNode] - # - # Represents the conditions of the case statement. - # - # case true; when false; end - # ^^^^^^^^^^ - # -- - # : () -> Array[WhenNode] - def conditions: () -> Array[WhenNode] - - # :call-seq: - # else_clause -> ElseNode | nil - # - # Represents the else clause of the case statement. - # - # case true; when false; else; end - # ^^^^^^^^^ - # -- - # : () -> ElseNode? - def else_clause: () -> ElseNode? - - # :category: Locations - # :call-seq: - # case_keyword_loc -> Location - # - # Represents the Location of the `case` keyword. - # - # case true; when false; end - # ^^^^ - # -- - # : () -> Location - def case_keyword_loc: () -> Location - - # :category: Repository - # Save the case_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_case_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Represents the Location of the `end` keyword. - # - # case true; when false; end - # ^^^ - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # case_keyword -> String - # - # Slice the location of case_keyword_loc from the source. - # -- - # : () -> String - def case_keyword: () -> String - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a class declaration involving the `class` keyword. - # - # class Foo end - # ^^^^^^^^^^^^^ - class ClassNode < Node - @name: Symbol - - @end_keyword_loc: Location - - @body: (StatementsNode | BeginNode)? - - @superclass: Prism::node? - - @inheritance_operator_loc: Location? - - @constant_path: ConstantReadNode | ConstantPathNode | CallNode - - @class_keyword_loc: Location - - @locals: Array[Symbol] - - # Initialize a new ClassNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, (ConstantReadNode | ConstantPathNode | CallNode) constant_path, Location? inheritance_operator_loc, Prism::node? superclass, (StatementsNode | BeginNode)? body, Location end_keyword_loc, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, ConstantReadNode | ConstantPathNode | CallNode constant_path, Location? inheritance_operator_loc, Prism::node? superclass, (StatementsNode | BeginNode)? body, Location end_keyword_loc, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode | CallNode), ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | CallNode, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_node - def type: () -> :class_node - - # See `Node.type`. - # -- - # : () -> :class_node - def self.type: () -> :class_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :category: Locations - # :call-seq: - # class_keyword_loc -> Location - # - # Represents the Location of the `class` keyword. - # - # class Foo end - # ^^^^^ - # -- - # : () -> Location - def class_keyword_loc: () -> Location - - # :category: Repository - # Save the class_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_class_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # constant_path -> ConstantReadNode | ConstantPathNode | CallNode - # - # Returns the `constant_path` attribute. - # -- - # : () -> (ConstantReadNode | ConstantPathNode | CallNode) - def constant_path: () -> (ConstantReadNode | ConstantPathNode | CallNode) - - # :category: Locations - # :call-seq: - # inheritance_operator_loc -> Location | nil - # - # Represents the Location of the `<` operator. - # - # class Foo < Bar - # ^ - # -- - # : () -> Location? - def inheritance_operator_loc: () -> Location? - - # :category: Repository - # Save the inheritance_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_inheritance_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # superclass -> Node | nil - # - # Represents the superclass of the class. - # - # class Foo < Bar - # ^^^ - # -- - # : () -> Prism::node? - def superclass: () -> Prism::node? - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # Represents the body of the class. - # - # class Foo; bar; end - # ^^^ - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Represents the Location of the `end` keyword. - # - # class Foo end - # ^^^ - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # name -> Symbol - # - # The name of the class. - # - # class Foo end # name `:Foo` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # class_keyword -> String - # - # Slice the location of class_keyword_loc from the source. - # -- - # : () -> String - def class_keyword: () -> String - - # :call-seq: - # inheritance_operator -> String | nil - # - # Slice the location of inheritance_operator_loc from the source. - # -- - # : () -> String? - def inheritance_operator: () -> String? - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to a class variable. - # - # @@target &&= value - # ^^^^^^^^^^^^^^^^^^ - class ClassVariableAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ClassVariableAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_and_write_node - def type: () -> :class_variable_and_write_node - - # See `Node.type`. - # -- - # : () -> :class_variable_and_write_node - def self.type: () -> :class_variable_and_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@target &&= value # name `:@@target` - # ^^^^^^^^ - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Represents the Location of the variable name. - # - # @@target &&= value - # ^^^^^^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Represents the Location of the `&&=` operator. - # - # @@target &&= value - # ^^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Represents the value being assigned. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @@target &&= value - # ^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a class variable using an operator that isn't `=`. - # - # @@target += value - # ^^^^^^^^^^^^^^^^^ - class ClassVariableOperatorWriteNode < Node - @binary_operator: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ClassVariableOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_operator_write_node - def type: () -> :class_variable_operator_write_node - - # See `Node.type`. - # -- - # : () -> :class_variable_operator_write_node - def self.type: () -> :class_variable_operator_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to a class variable. - # - # @@target ||= value - # ^^^^^^^^^^^^^^^^^^ - class ClassVariableOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ClassVariableOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_or_write_node - def type: () -> :class_variable_or_write_node - - # See `Node.type`. - # -- - # : () -> :class_variable_or_write_node - def self.type: () -> :class_variable_or_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents referencing a class variable. - # - # @@foo - # ^^^^^ - class ClassVariableReadNode < Node - @name: Symbol - - # Initialize a new ClassVariableReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_read_node - def type: () -> :class_variable_read_node - - # See `Node.type`. - # -- - # : () -> :class_variable_read_node - def self.type: () -> :class_variable_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@abc # name `:@@abc` - # - # @@_test # name `:@@_test` - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a class variable in a context that doesn't have an explicit value. - # - # @@foo, @@bar = baz - # ^^^^^ ^^^^^ - class ClassVariableTargetNode < Node - @name: Symbol - - # Initialize a new ClassVariableTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_target_node - def type: () -> :class_variable_target_node - - # See `Node.type`. - # -- - # : () -> :class_variable_target_node - def self.type: () -> :class_variable_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a class variable. - # - # @@foo = 1 - # ^^^^^^^^^ - class ClassVariableWriteNode < Node - @operator_loc: Location - - @value: Prism::node - - @name_loc: Location - - @name: Symbol - - # Initialize a new ClassVariableWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ClassVariableWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :class_variable_write_node - def type: () -> :class_variable_write_node - - # See `Node.type`. - # -- - # : () -> :class_variable_write_node - def self.type: () -> :class_variable_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @@abc = 123 # name `@@abc` - # - # @@_test = :test # name `@@_test` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the variable name. - # - # @@foo = :bar - # ^^^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @@foo = :bar - # ^^^^ - # - # @@_xyz = 123 - # ^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # @@foo = :bar - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to a constant. - # - # Target &&= value - # ^^^^^^^^^^^^^^^^ - class ConstantAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ConstantAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_and_write_node - def type: () -> :constant_and_write_node - - # See `Node.type`. - # -- - # : () -> :constant_and_write_node - def self.type: () -> :constant_and_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a constant using an operator that isn't `=`. - # - # Target += value - # ^^^^^^^^^^^^^^^ - class ConstantOperatorWriteNode < Node - @binary_operator: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ConstantOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_operator_write_node - def type: () -> :constant_operator_write_node - - # See `Node.type`. - # -- - # : () -> :constant_operator_write_node - def self.type: () -> :constant_operator_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to a constant. - # - # Target ||= value - # ^^^^^^^^^^^^^^^^ - class ConstantOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new ConstantOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_or_write_node - def type: () -> :constant_or_write_node - - # See `Node.type`. - # -- - # : () -> :constant_or_write_node - def self.type: () -> :constant_or_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to a constant path. - # - # Parent::Child &&= value - # ^^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @target: ConstantPathNode - - # Initialize a new ConstantPathAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_and_write_node - def type: () -> :constant_path_and_write_node - - # See `Node.type`. - # -- - # : () -> :constant_path_and_write_node - def self.type: () -> :constant_path_and_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # target -> ConstantPathNode - # - # Returns the `target` attribute. - # -- - # : () -> ConstantPathNode - def target: () -> ConstantPathNode - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents accessing a constant through a path of `::` operators. - # - # Foo::Bar - # ^^^^^^^^ - class ConstantPathNode < Node - @name_loc: Location - - @delimiter_loc: Location - - @name: Symbol? - - @parent: Prism::node? - - # Initialize a new ConstantPathNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_node - def type: () -> :constant_path_node - - # See `Node.type`. - # -- - # : () -> :constant_path_node - def self.type: () -> :constant_path_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # parent -> Node | nil - # - # The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. - # - # Foo::Bar - # ^^^ - # - # self::Test - # ^^^^ - # - # a.b::C - # ^^^ - # -- - # : () -> Prism::node? - def parent: () -> Prism::node? - - # :call-seq: - # name -> Symbol | nil - # - # The name of the constant being accessed. This could be `nil` in the event of a syntax error. - # -- - # : () -> Symbol? - def name: () -> Symbol? - - # :category: Locations - # :call-seq: - # delimiter_loc -> Location - # - # The Location of the `::` delimiter. - # - # ::Foo - # ^^ - # - # One::Two - # ^^ - # -- - # : () -> Location - def delimiter_loc: () -> Location - - # :category: Repository - # Save the delimiter_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_delimiter_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the name of the constant. - # - # ::Foo - # ^^^ - # - # One::Two - # ^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # delimiter -> String - # - # Slice the location of delimiter_loc from the source. - # -- - # : () -> String - def delimiter: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a constant path using an operator that isn't `=`. - # - # Parent::Child += value - # ^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathOperatorWriteNode < Node - @binary_operator: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @target: ConstantPathNode - - # Initialize a new ConstantPathOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_operator_write_node - def type: () -> :constant_path_operator_write_node - - # See `Node.type`. - # -- - # : () -> :constant_path_operator_write_node - def self.type: () -> :constant_path_operator_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # target -> ConstantPathNode - # - # Returns the `target` attribute. - # -- - # : () -> ConstantPathNode - def target: () -> ConstantPathNode - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to a constant path. - # - # Parent::Child ||= value - # ^^^^^^^^^^^^^^^^^^^^^^^ - class ConstantPathOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @target: ConstantPathNode - - # Initialize a new ConstantPathOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_or_write_node - def type: () -> :constant_path_or_write_node - - # See `Node.type`. - # -- - # : () -> :constant_path_or_write_node - def self.type: () -> :constant_path_or_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # target -> ConstantPathNode - # - # Returns the `target` attribute. - # -- - # : () -> ConstantPathNode - def target: () -> ConstantPathNode - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a constant path in a context that doesn't have an explicit value. - # - # Foo::Foo, Bar::Bar = baz - # ^^^^^^^^ ^^^^^^^^ - class ConstantPathTargetNode < Node - @name_loc: Location - - @delimiter_loc: Location - - @name: Symbol? - - @parent: Prism::node? - - # Initialize a new ConstantPathTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_target_node - def type: () -> :constant_path_target_node - - # See `Node.type`. - # -- - # : () -> :constant_path_target_node - def self.type: () -> :constant_path_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # parent -> Node | nil - # - # Returns the `parent` attribute. - # -- - # : () -> Prism::node? - def parent: () -> Prism::node? - - # :call-seq: - # name -> Symbol | nil - # - # Returns the `name` attribute. - # -- - # : () -> Symbol? - def name: () -> Symbol? - - # :category: Locations - # :call-seq: - # delimiter_loc -> Location - # - # Returns the Location represented by `delimiter_loc`. - # -- - # : () -> Location - def delimiter_loc: () -> Location - - # :category: Repository - # Save the delimiter_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_delimiter_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # delimiter -> String - # - # Slice the location of delimiter_loc from the source. - # -- - # : () -> String - def delimiter: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a constant path. - # - # ::Foo = 1 - # ^^^^^^^^^ - # - # Foo::Bar = 1 - # ^^^^^^^^^^^^ - # - # ::Foo::Bar = 1 - # ^^^^^^^^^^^^^^ - class ConstantPathWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @target: ConstantPathNode - - # Initialize a new ConstantPathWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantPathNode target, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantPathWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_path_write_node - def type: () -> :constant_path_write_node - - # See `Node.type`. - # -- - # : () -> :constant_path_write_node - def self.type: () -> :constant_path_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # target -> ConstantPathNode - # - # A node representing the constant path being written to. - # - # Foo::Bar = 1 - # ^^^^^^^^ - # - # ::Foo = :abc - # ^^^^^ - # -- - # : () -> ConstantPathNode - def target: () -> ConstantPathNode - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # ::ABC = 123 - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # FOO::BAR = :abc - # ^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents referencing a constant. - # - # Foo - # ^^^ - class ConstantReadNode < Node - @name: Symbol - - # Initialize a new ConstantReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_read_node - def type: () -> :constant_read_node - - # See `Node.type`. - # -- - # : () -> :constant_read_node - def self.type: () -> :constant_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - # - # X # name `:X` - # - # SOME_CONSTANT # name `:SOME_CONSTANT` - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a constant in a context that doesn't have an explicit value. - # - # Foo, Bar = baz - # ^^^ ^^^ - class ConstantTargetNode < Node - @name: Symbol - - # Initialize a new ConstantTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_target_node - def type: () -> :constant_target_node - - # See `Node.type`. - # -- - # : () -> :constant_target_node - def self.type: () -> :constant_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a constant. - # - # Foo = 1 - # ^^^^^^^ - class ConstantWriteNode < Node - @operator_loc: Location - - @value: Prism::node - - @name_loc: Location - - @name: Symbol - - # Initialize a new ConstantWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ConstantWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :constant_write_node - def type: () -> :constant_write_node - - # See `Node.type`. - # -- - # : () -> :constant_write_node - def self.type: () -> :constant_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). - # - # Foo = :bar # name `:Foo` - # - # XYZ = 1 # name `:XYZ` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the constant name. - # - # FOO = 1 - # ^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # FOO = :bar - # ^^^^ - # - # MyClass = Class.new - # ^^^^^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # FOO = :bar - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a method definition. - # - # def method - # end - # ^^^^^^^^^^ - class DefNode < Node - @end_keyword_loc: Location? - - @equal_loc: Location? - - @rparen_loc: Location? - - @lparen_loc: Location? - - @operator_loc: Location? - - @def_keyword_loc: Location - - @locals: Array[Symbol] - - @body: (StatementsNode | BeginNode)? - - @parameters: ParametersNode? - - @receiver: Prism::node? - - @name_loc: Location - - @name: Symbol - - # Initialize a new DefNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, (StatementsNode | BeginNode)? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, (StatementsNode | BeginNode)? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> DefNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: (StatementsNode | BeginNode)?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: (StatementsNode | BeginNode)?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :def_node - def type: () -> :def_node - - # See `Node.type`. - # -- - # : () -> :def_node - def self.type: () -> :def_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # receiver -> Node | nil - # - # Returns the `receiver` attribute. - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :call-seq: - # parameters -> ParametersNode | nil - # - # Returns the `parameters` attribute. - # -- - # : () -> ParametersNode? - def parameters: () -> ParametersNode? - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # Returns the `body` attribute. - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :category: Locations - # :call-seq: - # def_keyword_loc -> Location - # - # Returns the Location represented by `def_keyword_loc`. - # -- - # : () -> Location - def def_keyword_loc: () -> Location - - # :category: Repository - # Save the def_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_def_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location | nil - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location? - def operator_loc: () -> Location? - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # Returns the Location represented by `lparen_loc`. - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # Returns the Location represented by `rparen_loc`. - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # equal_loc -> Location | nil - # - # Returns the Location represented by `equal_loc`. - # -- - # : () -> Location? - def equal_loc: () -> Location? - - # :category: Repository - # Save the equal_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_equal_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location | nil - # - # Returns the Location represented by `end_keyword_loc`. - # -- - # : () -> Location? - def end_keyword_loc: () -> Location? - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # def_keyword -> String - # - # Slice the location of def_keyword_loc from the source. - # -- - # : () -> String - def def_keyword: () -> String - - # :call-seq: - # operator -> String | nil - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String? - def operator: () -> String? - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # :call-seq: - # equal -> String | nil - # - # Slice the location of equal_loc from the source. - # -- - # : () -> String? - def equal: () -> String? - - # :call-seq: - # end_keyword -> String | nil - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String? - def end_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `defined?` keyword. - # - # defined?(a) - # ^^^^^^^^^^^ - class DefinedNode < Node - @keyword_loc: Location - - @rparen_loc: Location? - - @value: Prism::node - - @lparen_loc: Location? - - # Initialize a new DefinedNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> DefinedNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :defined_node - def type: () -> :defined_node - - # See `Node.type`. - # -- - # : () -> :defined_node - def self.type: () -> :defined_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # Returns the Location represented by `lparen_loc`. - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # Returns the Location represented by `rparen_loc`. - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an `else` clause in a `case`, `if`, or `unless` statement. - # - # if a then b else c end - # ^^^^^^^^^^ - class ElseNode < Node - @end_keyword_loc: Location? - - @statements: StatementsNode? - - @else_keyword_loc: Location - - # Initialize a new ElseNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ElseNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :else_node - def type: () -> :else_node - - # See `Node.type`. - # -- - # : () -> :else_node - def self.type: () -> :else_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # else_keyword_loc -> Location - # - # Returns the Location represented by `else_keyword_loc`. - # -- - # : () -> Location - def else_keyword_loc: () -> Location - - # :category: Repository - # Save the else_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_else_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location | nil - # - # Returns the Location represented by `end_keyword_loc`. - # -- - # : () -> Location? - def end_keyword_loc: () -> Location? - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # else_keyword -> String - # - # Slice the location of else_keyword_loc from the source. - # -- - # : () -> String - def else_keyword: () -> String - - # :call-seq: - # end_keyword -> String | nil - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String? - def end_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an interpolated set of statements. - # - # "foo #{bar}" - # ^^^^^^ - class EmbeddedStatementsNode < Node - @closing_loc: Location - - @statements: StatementsNode? - - @opening_loc: Location - - # Initialize a new EmbeddedStatementsNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, StatementsNode? statements, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, StatementsNode? statements, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> EmbeddedStatementsNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :embedded_statements_node - def type: () -> :embedded_statements_node - - # See `Node.type`. - # -- - # : () -> :embedded_statements_node - def self.type: () -> :embedded_statements_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an interpolated variable. - # - # "foo #@bar" - # ^^^^^ - class EmbeddedVariableNode < Node - @variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode - - @operator_loc: Location - - # Initialize a new EmbeddedVariableNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) variable) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode variable) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> EmbeddedVariableNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode)) -> EmbeddedVariableNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) -> EmbeddedVariableNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :embedded_variable_node - def type: () -> :embedded_variable_node - - # See `Node.type`. - # -- - # : () -> :embedded_variable_node - def self.type: () -> :embedded_variable_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # variable -> InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode - # - # Returns the `variable` attribute. - # -- - # : () -> (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) - def variable: () -> (InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an `ensure` clause in a `begin` statement. - # - # begin - # foo - # ensure - # ^^^^^^ - # bar - # end - class EnsureNode < Node - @end_keyword_loc: Location - - @statements: StatementsNode? - - @ensure_keyword_loc: Location - - # Initialize a new EnsureNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> EnsureNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :ensure_node - def type: () -> :ensure_node - - # See `Node.type`. - # -- - # : () -> :ensure_node - def self.type: () -> :ensure_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # ensure_keyword_loc -> Location - # - # Returns the Location represented by `ensure_keyword_loc`. - # -- - # : () -> Location - def ensure_keyword_loc: () -> Location - - # :category: Repository - # Save the ensure_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_ensure_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Returns the Location represented by `end_keyword_loc`. - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # ensure_keyword -> String - # - # Slice the location of ensure_keyword_loc from the source. - # -- - # : () -> String - def ensure_keyword: () -> String - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the literal `false` keyword. - # - # false - # ^^^^^ - class FalseNode < Node - # Initialize a new FalseNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> FalseNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> FalseNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :false_node - def type: () -> :false_node - - # See `Node.type`. - # -- - # : () -> :false_node - def self.type: () -> :false_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a find pattern in pattern matching. - # - # foo in *bar, baz, *qux - # ^^^^^^^^^^^^^^^ - # - # foo in [*bar, baz, *qux] - # ^^^^^^^^^^^^^^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^^^^^^^^^^^^^^^^^ - # - # foo => *bar, baz, *qux - # ^^^^^^^^^^^^^^^ - class FindPatternNode < Node - @closing_loc: Location? - - @opening_loc: Location? - - @right: SplatNode | MissingNode - - @requireds: Array[Prism::node] - - @left: SplatNode - - @constant: (ConstantPathNode | ConstantReadNode)? - - # Initialize a new FindPatternNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, SplatNode left, Array[Prism::node] requireds, (SplatNode | MissingNode) right, Location? opening_loc, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, SplatNode left, Array[Prism::node] requireds, SplatNode | MissingNode right, Location? opening_loc, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> FindPatternNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: (SplatNode | MissingNode), ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode | MissingNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :find_pattern_node - def type: () -> :find_pattern_node - - # See `Node.type`. - # -- - # : () -> :find_pattern_node - def self.type: () -> :find_pattern_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # constant -> ConstantPathNode | ConstantReadNode | nil - # - # Represents the optional constant preceding the pattern - # - # foo in Foo(*bar, baz, *qux) - # ^^^ - # -- - # : () -> (ConstantPathNode | ConstantReadNode)? - def constant: () -> (ConstantPathNode | ConstantReadNode)? - - # :call-seq: - # left -> SplatNode - # - # Represents the first wildcard node in the pattern. - # - # foo in *bar, baz, *qux - # ^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^ - # -- - # : () -> SplatNode - def left: () -> SplatNode - - # :call-seq: - # requireds -> Array[Node] - # - # Represents the nodes in between the wildcards. - # - # foo in *bar, baz, *qux - # ^^^ - # - # foo in Foo(*bar, baz, 1, *qux) - # ^^^^^^ - # -- - # : () -> Array[Prism::node] - def requireds: () -> Array[Prism::node] - - # :call-seq: - # right -> SplatNode | MissingNode - # - # Represents the second wildcard node in the pattern. - # - # foo in *bar, baz, *qux - # ^^^^ - # - # foo in Foo(*bar, baz, *qux) - # ^^^^ - # -- - # : () -> (SplatNode | MissingNode) - def right: () -> (SplatNode | MissingNode) - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # The Location of the opening brace. - # - # foo in [*bar, baz, *qux] - # ^ - # - # foo in Foo(*bar, baz, *qux) - # ^ - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # The Location of the closing brace. - # - # foo in [*bar, baz, *qux] - # ^ - # - # foo in Foo(*bar, baz, *qux) - # ^ - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `..` or `...` operators to create flip flops. - # - # baz if foo .. bar - # ^^^^^^^^^^ - class FlipFlopNode < Node - @operator_loc: Location - - @right: Prism::node? - - @left: Prism::node? - - # Initialize a new FlipFlopNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> FlipFlopNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :flip_flop_node - def type: () -> :flip_flop_node - - # See `Node.type`. - # -- - # : () -> :flip_flop_node - def self.type: () -> :flip_flop_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # ... operator - # -- - # : () -> bool - def exclude_end?: () -> bool - - # :call-seq: - # left -> Node | nil - # - # Returns the `left` attribute. - # -- - # : () -> Prism::node? - def left: () -> Prism::node? - - # :call-seq: - # right -> Node | nil - # - # Returns the `right` attribute. - # -- - # : () -> Prism::node? - def right: () -> Prism::node? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a floating point number literal. - # - # 1.0 - # ^^^ - class FloatNode < Node - @value: Float - - # Initialize a new FloatNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Float value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Float value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> FloatNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :float_node - def type: () -> :float_node - - # See `Node.type`. - # -- - # : () -> :float_node - def self.type: () -> :float_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> Float - # - # The value of the floating point number as a Float. - # -- - # : () -> Float - def value: () -> Float - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `for` keyword. - # - # for i in a end - # ^^^^^^^^^^^^^^ - class ForNode < Node - @end_keyword_loc: Location - - @do_keyword_loc: Location? - - @in_keyword_loc: Location - - @for_keyword_loc: Location - - @statements: StatementsNode? - - @collection: Prism::node - - @index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode - - # Initialize a new ForNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode) index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ForNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode), ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :for_node - def type: () -> :for_node - - # See `Node.type`. - # -- - # : () -> :for_node - def self.type: () -> :for_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # index -> LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode - # - # The index expression for `for` loops. - # - # for i in a end - # ^ - # -- - # : () -> (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode) - def index: () -> (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode) - - # :call-seq: - # collection -> Node - # - # The collection to iterate over. - # - # for i in a end - # ^ - # -- - # : () -> Prism::node - def collection: () -> Prism::node - - # :call-seq: - # statements -> StatementsNode | nil - # - # Represents the body of statements to execute for each iteration of the loop. - # - # for i in a - # foo(i) - # ^^^^^^ - # end - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # for_keyword_loc -> Location - # - # The Location of the `for` keyword. - # - # for i in a end - # ^^^ - # -- - # : () -> Location - def for_keyword_loc: () -> Location - - # :category: Repository - # Save the for_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_for_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # in_keyword_loc -> Location - # - # The Location of the `in` keyword. - # - # for i in a end - # ^^ - # -- - # : () -> Location - def in_keyword_loc: () -> Location - - # :category: Repository - # Save the in_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_in_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # do_keyword_loc -> Location | nil - # - # The Location of the `do` keyword, if present. - # - # for i in a do end - # ^^ - # -- - # : () -> Location? - def do_keyword_loc: () -> Location? - - # :category: Repository - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_do_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # The Location of the `end` keyword. - # - # for i in a end - # ^^^ - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # for_keyword -> String - # - # Slice the location of for_keyword_loc from the source. - # -- - # : () -> String - def for_keyword: () -> String - - # :call-seq: - # in_keyword -> String - # - # Slice the location of in_keyword_loc from the source. - # -- - # : () -> String - def in_keyword: () -> String - - # :call-seq: - # do_keyword -> String | nil - # - # Slice the location of do_keyword_loc from the source. - # -- - # : () -> String? - def do_keyword: () -> String? - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents forwarding all arguments to this method to another method. - # - # def foo(...) - # bar(...) - # ^^^ - # end - class ForwardingArgumentsNode < Node - # Initialize a new ForwardingArgumentsNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ForwardingArgumentsNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ForwardingArgumentsNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :forwarding_arguments_node - def type: () -> :forwarding_arguments_node - - # See `Node.type`. - # -- - # : () -> :forwarding_arguments_node - def self.type: () -> :forwarding_arguments_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the forwarding parameter in a method, block, or lambda declaration. - # - # def foo(...) - # ^^^ - # end - class ForwardingParameterNode < Node - # Initialize a new ForwardingParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ForwardingParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ForwardingParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :forwarding_parameter_node - def type: () -> :forwarding_parameter_node - - # See `Node.type`. - # -- - # : () -> :forwarding_parameter_node - def self.type: () -> :forwarding_parameter_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `super` keyword without parentheses or arguments, but which might have a block. - # - # super - # ^^^^^ - # - # super { 123 } - # ^^^^^^^^^^^^^ - # - # If it has any other arguments, it would be a `SuperNode` instead. - class ForwardingSuperNode < Node - @block: BlockNode? - - # Initialize a new ForwardingSuperNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, BlockNode? block) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, BlockNode? block) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ForwardingSuperNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :forwarding_super_node - def type: () -> :forwarding_super_node - - # See `Node.type`. - # -- - # : () -> :forwarding_super_node - def self.type: () -> :forwarding_super_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # block -> BlockNode | nil - # - # All other arguments are forwarded as normal, except the original block is replaced with the new block. - # -- - # : () -> BlockNode? - def block: () -> BlockNode? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to a global variable. - # - # $target &&= value - # ^^^^^^^^^^^^^^^^^ - class GlobalVariableAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new GlobalVariableAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_and_write_node - def type: () -> :global_variable_and_write_node - - # See `Node.type`. - # -- - # : () -> :global_variable_and_write_node - def self.type: () -> :global_variable_and_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a global variable using an operator that isn't `=`. - # - # $target += value - # ^^^^^^^^^^^^^^^^ - class GlobalVariableOperatorWriteNode < Node - @binary_operator: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new GlobalVariableOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_operator_write_node - def type: () -> :global_variable_operator_write_node - - # See `Node.type`. - # -- - # : () -> :global_variable_operator_write_node - def self.type: () -> :global_variable_operator_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to a global variable. - # - # $target ||= value - # ^^^^^^^^^^^^^^^^^ - class GlobalVariableOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new GlobalVariableOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_or_write_node - def type: () -> :global_variable_or_write_node - - # See `Node.type`. - # -- - # : () -> :global_variable_or_write_node - def self.type: () -> :global_variable_or_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents referencing a global variable. - # - # $foo - # ^^^^ - class GlobalVariableReadNode < Node - @name: Symbol - - # Initialize a new GlobalVariableReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_read_node - def type: () -> :global_variable_read_node - - # See `Node.type`. - # -- - # : () -> :global_variable_read_node - def self.type: () -> :global_variable_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - # - # $foo # name `:$foo` - # - # $_Test # name `:$_Test` - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a global variable in a context that doesn't have an explicit value. - # - # $foo, $bar = baz - # ^^^^ ^^^^ - class GlobalVariableTargetNode < Node - @name: Symbol - - # Initialize a new GlobalVariableTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_target_node - def type: () -> :global_variable_target_node - - # See `Node.type`. - # -- - # : () -> :global_variable_target_node - def self.type: () -> :global_variable_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a global variable. - # - # $foo = 1 - # ^^^^^^^^ - class GlobalVariableWriteNode < Node - @operator_loc: Location - - @value: Prism::node - - @name_loc: Location - - @name: Symbol - - # Initialize a new GlobalVariableWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> GlobalVariableWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :global_variable_write_node - def type: () -> :global_variable_write_node - - # See `Node.type`. - # -- - # : () -> :global_variable_write_node - def self.type: () -> :global_variable_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. - # - # $foo = :bar # name `:$foo` - # - # $_Test = 123 # name `:$_Test` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the global variable's name. - # - # $foo = :bar - # ^^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # $foo = :bar - # ^^^^ - # - # $-xyz = 123 - # ^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # $foo = :bar - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a hash literal. - # - # { a => b } - # ^^^^^^^^^^ - class HashNode < Node - @closing_loc: Location - - @elements: Array[AssocNode | AssocSplatNode] - - @opening_loc: Location - - # Initialize a new HashNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> HashNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :hash_node - def type: () -> :hash_node - - # See `Node.type`. - # -- - # : () -> :hash_node - def self.type: () -> :hash_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # The Location of the opening brace. - # - # { a => b } - # ^ - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # elements -> Array[AssocNode | AssocSplatNode] - # - # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. - # - # { a: b } - # ^^^^ - # - # { **foo } - # ^^^^^ - # -- - # : () -> Array[AssocNode | AssocSplatNode] - def elements: () -> Array[AssocNode | AssocSplatNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # The Location of the closing brace. - # - # { a => b } - # ^ - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a hash pattern in pattern matching. - # - # foo => { a: 1, b: 2 } - # ^^^^^^^^^^^^^^ - # - # foo => { a: 1, b: 2, **c } - # ^^^^^^^^^^^^^^^^^^^ - # - # foo => Bar[a: 1, b: 2] - # ^^^^^^^^^^^^^^^ - # - # foo in { a: 1, b: 2 } - # ^^^^^^^^^^^^^^ - class HashPatternNode < Node - @closing_loc: Location? - - @opening_loc: Location? - - @rest: (AssocSplatNode | NoKeywordsParameterNode)? - - @elements: Array[AssocNode] - - @constant: (ConstantPathNode | ConstantReadNode)? - - # Initialize a new HashPatternNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, Array[AssocNode] elements, (AssocSplatNode | NoKeywordsParameterNode)? rest, Location? opening_loc, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, (ConstantPathNode | ConstantReadNode)? constant, Array[AssocNode] elements, (AssocSplatNode | NoKeywordsParameterNode)? rest, Location? opening_loc, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> HashPatternNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?elements: Array[AssocNode], ?rest: (AssocSplatNode | NoKeywordsParameterNode)?, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: (ConstantPathNode | ConstantReadNode)?, ?elements: Array[AssocNode], ?rest: (AssocSplatNode | NoKeywordsParameterNode)?, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :hash_pattern_node - def type: () -> :hash_pattern_node - - # See `Node.type`. - # -- - # : () -> :hash_pattern_node - def self.type: () -> :hash_pattern_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # constant -> ConstantPathNode | ConstantReadNode | nil - # - # Represents the optional constant preceding the Hash. - # - # foo => Bar[a: 1, b: 2] - # ^^^ - # - # foo => Bar::Baz[a: 1, b: 2] - # ^^^^^^^^ - # -- - # : () -> (ConstantPathNode | ConstantReadNode)? - def constant: () -> (ConstantPathNode | ConstantReadNode)? - - # :call-seq: - # elements -> Array[AssocNode] - # - # Represents the explicit named hash keys and values. - # - # foo => { a: 1, b:, ** } - # ^^^^^^^^ - # -- - # : () -> Array[AssocNode] - def elements: () -> Array[AssocNode] - - # :call-seq: - # rest -> AssocSplatNode | NoKeywordsParameterNode | nil - # - # Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`. - # - # foo => { a: 1, b:, **c } - # ^^^ - # - # foo => { a: 1, b:, ** } - # ^^ - # - # foo => { a: 1, b:, **nil } - # ^^^^^ - # -- - # : () -> (AssocSplatNode | NoKeywordsParameterNode)? - def rest: () -> (AssocSplatNode | NoKeywordsParameterNode)? - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # The Location of the opening brace. - # - # foo => { a: 1 } - # ^ - # - # foo => Bar[a: 1] - # ^ - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # The Location of the closing brace. - # - # foo => { a: 1 } - # ^ - # - # foo => Bar[a: 1] - # ^ - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. - # - # bar if foo - # ^^^^^^^^^^ - # - # if foo then bar end - # ^^^^^^^^^^^^^^^^^^^ - # - # foo ? bar : baz - # ^^^^^^^^^^^^^^^ - class IfNode < Node - @end_keyword_loc: Location? - - @subsequent: (ElseNode | IfNode)? - - @statements: StatementsNode? - - @then_keyword_loc: Location? - - @predicate: Prism::node - - @if_keyword_loc: Location? - - # Initialize a new IfNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, (ElseNode | IfNode)? subsequent, Location? end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, (ElseNode | IfNode)? subsequent, Location? end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IfNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: (ElseNode | IfNode)?, ?end_keyword_loc: Location?) -> IfNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: (ElseNode | IfNode)?, ?end_keyword_loc: Location?) -> IfNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :if_node - def type: () -> :if_node - - # See `Node.type`. - # -- - # : () -> :if_node - def self.type: () -> :if_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # if_keyword_loc -> Location | nil - # - # The Location of the `if` keyword if present. - # - # bar if foo - # ^^ - # - # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. - # -- - # : () -> Location? - def if_keyword_loc: () -> Location? - - # :category: Repository - # Save the if_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_if_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # predicate -> Node - # - # The node for the condition the `IfNode` is testing. - # - # if foo - # ^^^ - # bar - # end - # - # bar if foo - # ^^^ - # - # foo ? bar : baz - # ^^^ - # -- - # : () -> Prism::node - def predicate: () -> Prism::node - - # :category: Locations - # :call-seq: - # then_keyword_loc -> Location | nil - # - # The Location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. - # - # if foo then bar end - # ^^^^ - # - # a ? b : c - # ^ - # -- - # : () -> Location? - def then_keyword_loc: () -> Location? - - # :category: Repository - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_then_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # statements -> StatementsNode | nil - # - # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. - # - # if foo - # bar - # ^^^ - # baz - # ^^^ - # end - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # subsequent -> ElseNode | IfNode | nil - # - # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement. - # - # if foo - # bar - # elsif baz - # ^^^^^^^^^ - # qux - # ^^^ - # end - # ^^^ - # - # if foo then bar else baz end - # ^^^^^^^^^^^^ - # -- - # : () -> (ElseNode | IfNode)? - def subsequent: () -> (ElseNode | IfNode)? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location | nil - # - # The Location of the `end` keyword if present, `nil` otherwise. - # - # if foo - # bar - # end - # ^^^ - # -- - # : () -> Location? - def end_keyword_loc: () -> Location? - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # if_keyword -> String | nil - # - # Slice the location of if_keyword_loc from the source. - # -- - # : () -> String? - def if_keyword: () -> String? - - # :call-seq: - # then_keyword -> String | nil - # - # Slice the location of then_keyword_loc from the source. - # -- - # : () -> String? - def then_keyword: () -> String? - - # :call-seq: - # end_keyword -> String | nil - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String? - def end_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an imaginary number literal. - # - # 1.0i - # ^^^^ - class ImaginaryNode < Node - @numeric: FloatNode | IntegerNode | RationalNode - - # Initialize a new ImaginaryNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (FloatNode | IntegerNode | RationalNode) numeric) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, FloatNode | IntegerNode | RationalNode numeric) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ImaginaryNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: (FloatNode | IntegerNode | RationalNode)) -> ImaginaryNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :imaginary_node - def type: () -> :imaginary_node - - # See `Node.type`. - # -- - # : () -> :imaginary_node - def self.type: () -> :imaginary_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # numeric -> FloatNode | IntegerNode | RationalNode - # - # Returns the `numeric` attribute. - # -- - # : () -> (FloatNode | IntegerNode | RationalNode) - def numeric: () -> (FloatNode | IntegerNode | RationalNode) - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - 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: } - # ^^^^ - # - # foo in { bar: } - # ^^^^ - class ImplicitNode < Node - @value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode - - # Initialize a new ImplicitNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ImplicitNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode)) -> ImplicitNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) -> ImplicitNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :implicit_node - def type: () -> :implicit_node - - # See `Node.type`. - # -- - # : () -> :implicit_node - def self.type: () -> :implicit_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode - # - # Returns the `value` attribute. - # -- - # : () -> (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) - def value: () -> (LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents using a trailing comma to indicate an implicit rest parameter. - # - # foo { |bar,| } - # ^ - # - # foo in [bar,] - # ^ - # - # for foo, in bar do end - # ^ - # - # foo, = bar - # ^ - class ImplicitRestNode < Node - # Initialize a new ImplicitRestNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ImplicitRestNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ImplicitRestNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :implicit_rest_node - def type: () -> :implicit_rest_node - - # See `Node.type`. - # -- - # : () -> :implicit_rest_node - def self.type: () -> :implicit_rest_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `in` keyword in a case statement. - # - # case a; in b then c end - # ^^^^^^^^^^^ - class InNode < Node - @then_loc: Location? - - @in_loc: Location - - @statements: StatementsNode? - - @pattern: Prism::node - - # Initialize a new InNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :in_node - def type: () -> :in_node - - # See `Node.type`. - # -- - # : () -> :in_node - def self.type: () -> :in_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # pattern -> Node - # - # Returns the `pattern` attribute. - # -- - # : () -> Prism::node - def pattern: () -> Prism::node - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # in_loc -> Location - # - # Returns the Location represented by `in_loc`. - # -- - # : () -> Location - def in_loc: () -> Location - - # :category: Repository - # Save the in_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_in_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # then_loc -> Location | nil - # - # Returns the Location represented by `then_loc`. - # -- - # : () -> Location? - def then_loc: () -> Location? - - # :category: Repository - # Save the then_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_then_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # in -> String - # - # Slice the location of in_loc from the source. - # -- - # : () -> String - def in: () -> String - - # :call-seq: - # then -> String | nil - # - # Slice the location of then_loc from the source. - # -- - # : () -> String? - def then: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator on a call to the `[]` method. - # - # foo.bar[baz] &&= value - # ^^^^^^^^^^^^^^^^^^^^^^ - class IndexAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @block: BlockArgumentNode? - - @closing_loc: Location - - @arguments: ArgumentsNode? - - @opening_loc: Location - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new IndexAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IndexAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :index_and_write_node - def type: () -> :index_and_write_node - - # See `Node.type`. - # -- - # : () -> :index_and_write_node - def self.type: () -> :index_and_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # Returns the `receiver` attribute. - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Returns the Location represented by `call_operator_loc`. - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # block -> BlockArgumentNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> BlockArgumentNode? - def block: () -> BlockArgumentNode? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of an assignment operator on a call to `[]`. - # - # foo.bar[baz] += value - # ^^^^^^^^^^^^^^^^^^^^^ - class IndexOperatorWriteNode < Node - @value: Prism::node - - @binary_operator_loc: Location - - @binary_operator: Symbol - - @block: BlockArgumentNode? - - @closing_loc: Location - - @arguments: ArgumentsNode? - - @opening_loc: Location - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new IndexOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IndexOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :index_operator_write_node - def type: () -> :index_operator_write_node - - # See `Node.type`. - # -- - # : () -> :index_operator_write_node - def self.type: () -> :index_operator_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # Returns the `receiver` attribute. - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Returns the Location represented by `call_operator_loc`. - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # block -> BlockArgumentNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> BlockArgumentNode? - def block: () -> BlockArgumentNode? - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator on a call to `[]`. - # - # foo.bar[baz] ||= value - # ^^^^^^^^^^^^^^^^^^^^^^ - class IndexOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @block: BlockArgumentNode? - - @closing_loc: Location - - @arguments: ArgumentsNode? - - @opening_loc: Location - - @call_operator_loc: Location? - - @receiver: Prism::node? - - # Initialize a new IndexOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IndexOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :index_or_write_node - def type: () -> :index_or_write_node - - # See `Node.type`. - # -- - # : () -> :index_or_write_node - def self.type: () -> :index_or_write_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node | nil - # - # Returns the `receiver` attribute. - # -- - # : () -> Prism::node? - def receiver: () -> Prism::node? - - # :category: Locations - # :call-seq: - # call_operator_loc -> Location | nil - # - # Returns the Location represented by `call_operator_loc`. - # -- - # : () -> Location? - def call_operator_loc: () -> Location? - - # :category: Repository - # Save the call_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_call_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # block -> BlockArgumentNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> BlockArgumentNode? - def block: () -> BlockArgumentNode? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # call_operator -> String | nil - # - # Slice the location of call_operator_loc from the source. - # -- - # : () -> String? - def call_operator: () -> String? - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to an index. - # - # foo[bar], = 1 - # ^^^^^^^^ - # - # begin - # rescue => foo[bar] - # ^^^^^^^^ - # end - # - # for foo[bar] in baz do end - # ^^^^^^^^ - class IndexTargetNode < Node - @block: BlockArgumentNode? - - @closing_loc: Location - - @arguments: ArgumentsNode? - - @opening_loc: Location - - @receiver: Prism::node - - # Initialize a new IndexTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, BlockArgumentNode? block) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IndexTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :index_target_node - def type: () -> :index_target_node - - # See `Node.type`. - # -- - # : () -> :index_target_node - def self.type: () -> :index_target_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # &. operator - # -- - # : () -> bool - def safe_navigation?: () -> bool - - # :category: Flags - # a call that could have been a local variable - # -- - # : () -> bool - def variable_call?: () -> bool - - # :category: Flags - # a call that is an attribute write, so the value being written should be returned - # -- - # : () -> bool - def attribute_write?: () -> bool - - # :category: Flags - # a call that ignores method visibility - # -- - # : () -> bool - def ignore_visibility?: () -> bool - - # :call-seq: - # receiver -> Node - # - # Returns the `receiver` attribute. - # -- - # : () -> Prism::node - def receiver: () -> Prism::node - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # block -> BlockArgumentNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> BlockArgumentNode? - def block: () -> BlockArgumentNode? - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to an instance variable. - # - # @target &&= value - # ^^^^^^^^^^^^^^^^^ - class InstanceVariableAndWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new InstanceVariableAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_and_write_node - def type: () -> :instance_variable_and_write_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_and_write_node - def self.type: () -> :instance_variable_and_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to an instance variable using an operator that isn't `=`. - # - # @target += value - # ^^^^^^^^^^^^^^^^ - class InstanceVariableOperatorWriteNode < Node - @binary_operator: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new InstanceVariableOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_operator_write_node - def type: () -> :instance_variable_operator_write_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_operator_write_node - def self.type: () -> :instance_variable_operator_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to an instance variable. - # - # @target ||= value - # ^^^^^^^^^^^^^^^^^ - class InstanceVariableOrWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new InstanceVariableOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_or_write_node - def type: () -> :instance_variable_or_write_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_or_write_node - def self.type: () -> :instance_variable_or_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents referencing an instance variable. - # - # @foo - # ^^^^ - class InstanceVariableReadNode < Node - @name: Symbol - - # Initialize a new InstanceVariableReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_read_node - def type: () -> :instance_variable_read_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_read_node - def self.type: () -> :instance_variable_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @x # name `:@x` - # - # @_test # name `:@_test` - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to an instance variable in a context that doesn't have an explicit value. - # - # @foo, @bar = baz - # ^^^^ ^^^^ - class InstanceVariableTargetNode < Node - @name: Symbol - - # Initialize a new InstanceVariableTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_target_node - def type: () -> :instance_variable_target_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_target_node - def self.type: () -> :instance_variable_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to an instance variable. - # - # @foo = 1 - # ^^^^^^^^ - class InstanceVariableWriteNode < Node - @operator_loc: Location - - @value: Prism::node - - @name_loc: Location - - @name: Symbol - - # Initialize a new InstanceVariableWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InstanceVariableWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :instance_variable_write_node - def type: () -> :instance_variable_write_node - - # See `Node.type`. - # -- - # : () -> :instance_variable_write_node - def self.type: () -> :instance_variable_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # @x = :y # name `:@x` - # - # @_foo = "bar" # name `@_foo` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the variable name. - # - # @_x = 1 - # ^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # @foo = :bar - # ^^^^ - # - # @_x = 1234 - # ^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # @x = y - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an integer number literal. - # - # 1 - # ^ - class IntegerNode < Node - @value: Integer - - # Initialize a new IntegerNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Integer value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> IntegerNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :integer_node - def type: () -> :integer_node - - # See `Node.type`. - # -- - # : () -> :integer_node - def self.type: () -> :integer_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # 0b prefix - # -- - # : () -> bool - def binary?: () -> bool - - # :category: Flags - # 0d or no prefix - # -- - # : () -> bool - def decimal?: () -> bool - - # :category: Flags - # 0o or 0 prefix - # -- - # : () -> bool - def octal?: () -> bool - - # :category: Flags - # 0x prefix - # -- - # : () -> bool - def hexadecimal?: () -> bool - - # :call-seq: - # value -> Integer - # - # The value of the integer literal as a number. - # -- - # : () -> Integer - def value: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - 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 - # ^^^^^^^^^^^^^^^^ - class InterpolatedMatchLastLineNode < Node - @closing_loc: Location - - @parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - @opening_loc: Location - - # Initialize a new InterpolatedMatchLastLineNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InterpolatedMatchLastLineNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :interpolated_match_last_line_node - def type: () -> :interpolated_match_last_line_node - - # See `Node.type`. - # -- - # : () -> :interpolated_match_last_line_node - def self.type: () -> :interpolated_match_last_line_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # i - ignores the case of characters when matching - # -- - # : () -> bool - def ignore_case?: () -> bool - - # :category: Flags - # x - ignores whitespace and allows comments in regular expressions - # -- - # : () -> bool - def extended?: () -> bool - - # :category: Flags - # m - allows $ to match the end of lines within strings - # -- - # : () -> bool - def multi_line?: () -> bool - - # :category: Flags - # o - only interpolates values into the regular expression once - # -- - # : () -> bool - def once?: () -> bool - - # :category: Flags - # e - forces the EUC-JP encoding - # -- - # : () -> bool - def euc_jp?: () -> bool - - # :category: Flags - # n - forces the ASCII-8BIT encoding - # -- - # : () -> bool - def ascii_8bit?: () -> bool - - # :category: Flags - # s - forces the Windows-31J encoding - # -- - # : () -> bool - def windows_31j?: () -> bool - - # :category: Flags - # u - forces the UTF-8 encoding - # -- - # : () -> bool - def utf_8?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to US-ASCII - # -- - # : () -> bool - def forced_us_ascii_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # parts -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - # - # Returns the `parts` attribute. - # -- - # : () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - def parts: () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a regular expression literal that contains interpolation. - # - # /foo #{bar} baz/ - # ^^^^^^^^^^^^^^^^ - class InterpolatedRegularExpressionNode < Node - @closing_loc: Location - - @parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - @opening_loc: Location - - # Initialize a new InterpolatedRegularExpressionNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InterpolatedRegularExpressionNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :interpolated_regular_expression_node - def type: () -> :interpolated_regular_expression_node - - # See `Node.type`. - # -- - # : () -> :interpolated_regular_expression_node - def self.type: () -> :interpolated_regular_expression_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # i - ignores the case of characters when matching - # -- - # : () -> bool - def ignore_case?: () -> bool - - # :category: Flags - # x - ignores whitespace and allows comments in regular expressions - # -- - # : () -> bool - def extended?: () -> bool - - # :category: Flags - # m - allows $ to match the end of lines within strings - # -- - # : () -> bool - def multi_line?: () -> bool - - # :category: Flags - # o - only interpolates values into the regular expression once - # -- - # : () -> bool - def once?: () -> bool - - # :category: Flags - # e - forces the EUC-JP encoding - # -- - # : () -> bool - def euc_jp?: () -> bool - - # :category: Flags - # n - forces the ASCII-8BIT encoding - # -- - # : () -> bool - def ascii_8bit?: () -> bool - - # :category: Flags - # s - forces the Windows-31J encoding - # -- - # : () -> bool - def windows_31j?: () -> bool - - # :category: Flags - # u - forces the UTF-8 encoding - # -- - # : () -> bool - def utf_8?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to US-ASCII - # -- - # : () -> bool - def forced_us_ascii_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # parts -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - # - # Returns the `parts` attribute. - # -- - # : () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - def parts: () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a string literal that contains interpolation. - # - # "foo #{bar} baz" - # ^^^^^^^^^^^^^^^^ - class InterpolatedStringNode < Node - @closing_loc: Location? - - @parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] - - @opening_loc: Location? - - # Initialize a new InterpolatedStringNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] parts, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] parts, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InterpolatedStringNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], ?closing_loc: Location?) -> InterpolatedStringNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode], ?closing_loc: Location?) -> InterpolatedStringNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :interpolated_string_node - def type: () -> :interpolated_string_node - - # See `Node.type`. - # -- - # : () -> :interpolated_string_node - def self.type: () -> :interpolated_string_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - # -- - # : () -> bool - def frozen?: () -> bool - - # :category: Flags - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - # -- - # : () -> bool - def mutable?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # parts -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] - # - # Returns the `parts` attribute. - # -- - # : () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] - def parts: () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode | XStringNode | InterpolatedXStringNode | SymbolNode | InterpolatedSymbolNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a symbol literal that contains interpolation. - # - # :"foo #{bar} baz" - # ^^^^^^^^^^^^^^^^^ - class InterpolatedSymbolNode < Node - @closing_loc: Location? - - @parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - @opening_loc: Location? - - # Initialize a new InterpolatedSymbolNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InterpolatedSymbolNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :interpolated_symbol_node - def type: () -> :interpolated_symbol_node - - # See `Node.type`. - # -- - # : () -> :interpolated_symbol_node - def self.type: () -> :interpolated_symbol_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # parts -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - # - # Returns the `parts` attribute. - # -- - # : () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - def parts: () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an xstring literal that contains interpolation. - # - # `foo #{bar} baz` - # ^^^^^^^^^^^^^^^^ - class InterpolatedXStringNode < Node - @closing_loc: Location - - @parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - @opening_loc: Location - - # Initialize a new InterpolatedXStringNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> InterpolatedXStringNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :interpolated_x_string_node - def type: () -> :interpolated_x_string_node - - # See `Node.type`. - # -- - # : () -> :interpolated_x_string_node - def self.type: () -> :interpolated_x_string_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # parts -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - # - # Returns the `parts` attribute. - # -- - # : () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - def parts: () -> Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents reading from the implicit `it` local variable. - # - # -> { it } - # ^^ - class ItLocalVariableReadNode < Node - # Initialize a new ItLocalVariableReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ItLocalVariableReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ItLocalVariableReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :it_local_variable_read_node - def type: () -> :it_local_variable_read_node - - # See `Node.type`. - # -- - # : () -> :it_local_variable_read_node - def self.type: () -> :it_local_variable_read_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda. - # - # -> { it + it } - # ^^^^^^^^^^^^^^ - class ItParametersNode < Node - # Initialize a new ItParametersNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ItParametersNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> ItParametersNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :it_parameters_node - def type: () -> :it_parameters_node - - # See `Node.type`. - # -- - # : () -> :it_parameters_node - def self.type: () -> :it_parameters_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a hash literal without opening and closing braces. - # - # foo(a: b) - # ^^^^ - class KeywordHashNode < Node - @elements: Array[AssocNode | AssocSplatNode] - - # Initialize a new KeywordHashNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[AssocNode | AssocSplatNode] elements) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[AssocNode | AssocSplatNode] elements) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> KeywordHashNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :keyword_hash_node - def type: () -> :keyword_hash_node - - # See `Node.type`. - # -- - # : () -> :keyword_hash_node - def self.type: () -> :keyword_hash_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments - # -- - # : () -> bool - def symbol_keys?: () -> bool - - # :call-seq: - # elements -> Array[AssocNode | AssocSplatNode] - # - # Returns the `elements` attribute. - # -- - # : () -> Array[AssocNode | AssocSplatNode] - def elements: () -> Array[AssocNode | AssocSplatNode] - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a keyword rest parameter to a method, block, or lambda definition. - # - # def a(**b) - # ^^^ - # end - class KeywordRestParameterNode < Node - @operator_loc: Location - - @name_loc: Location? - - @name: Symbol? - - # Initialize a new KeywordRestParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> KeywordRestParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :keyword_rest_parameter_node - def type: () -> :keyword_rest_parameter_node - - # See `Node.type`. - # -- - # : () -> :keyword_rest_parameter_node - def self.type: () -> :keyword_rest_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol | nil - # - # Returns the `name` attribute. - # -- - # : () -> Symbol? - def name: () -> Symbol? - - # :category: Locations - # :call-seq: - # name_loc -> Location | nil - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location? - def name_loc: () -> Location? - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_name_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents using a lambda literal (not the lambda method call). - # - # ->(value) { value * 2 } - # ^^^^^^^^^^^^^^^^^^^^^^^ - class LambdaNode < Node - @body: (StatementsNode | BeginNode)? - - @parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - - @closing_loc: Location - - @opening_loc: Location - - @operator_loc: Location - - @locals: Array[Symbol] - - # Initialize a new LambdaNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, (BlockParametersNode | NumberedParametersNode | ItParametersNode)? parameters, (StatementsNode | BeginNode)? body) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, (BlockParametersNode | NumberedParametersNode | ItParametersNode)? parameters, (StatementsNode | BeginNode)? body) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LambdaNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?) -> LambdaNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: (BlockParametersNode | NumberedParametersNode | ItParametersNode)?, ?body: (StatementsNode | BeginNode)?) -> LambdaNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :lambda_node - def type: () -> :lambda_node - - # See `Node.type`. - # -- - # : () -> :lambda_node - def self.type: () -> :lambda_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # parameters -> BlockParametersNode | NumberedParametersNode | ItParametersNode | nil - # - # Returns the `parameters` attribute. - # -- - # : () -> (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - def parameters: () -> (BlockParametersNode | NumberedParametersNode | ItParametersNode)? - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # Returns the `body` attribute. - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `&&=` operator for assignment to a local variable. - # - # target &&= value - # ^^^^^^^^^^^^^^^^ - class LocalVariableAndWriteNode < Node - @depth: Integer - - @name: Symbol - - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - # Initialize a new LocalVariableAndWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableAndWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_and_write_node - def type: () -> :local_variable_and_write_node - - # See `Node.type`. - # -- - # : () -> :local_variable_and_write_node - def self.type: () -> :local_variable_and_write_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # Returns the `depth` attribute. - # -- - # : () -> Integer - def depth: () -> Integer - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents assigning to a local variable using an operator that isn't `=`. - # - # target += value - # ^^^^^^^^^^^^^^^ - class LocalVariableOperatorWriteNode < Node - @depth: Integer - - @binary_operator: Symbol - - @name: Symbol - - @value: Prism::node - - @binary_operator_loc: Location - - @name_loc: Location - - # Initialize a new LocalVariableOperatorWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableOperatorWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_operator_write_node - def type: () -> :local_variable_operator_write_node - - # See `Node.type`. - # -- - # : () -> :local_variable_operator_write_node - def self.type: () -> :local_variable_operator_write_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # binary_operator_loc -> Location - # - # Returns the Location represented by `binary_operator_loc`. - # -- - # : () -> Location - def binary_operator_loc: () -> Location - - # :category: Repository - # Save the binary_operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_binary_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # binary_operator -> Symbol - # - # Returns the `binary_operator` attribute. - # -- - # : () -> Symbol - def binary_operator: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # Returns the `depth` attribute. - # -- - # : () -> Integer - def depth: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||=` operator for assignment to a local variable. - # - # target ||= value - # ^^^^^^^^^^^^^^^^ - class LocalVariableOrWriteNode < Node - @depth: Integer - - @name: Symbol - - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - # Initialize a new LocalVariableOrWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableOrWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_or_write_node - def type: () -> :local_variable_or_write_node - - # See `Node.type`. - # -- - # : () -> :local_variable_or_write_node - def self.type: () -> :local_variable_or_write_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # Returns the `depth` attribute. - # -- - # : () -> Integer - def depth: () -> Integer - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. - # - # foo - # ^^^ - class LocalVariableReadNode < Node - @depth: Integer - - @name: Symbol - - # Initialize a new LocalVariableReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_read_node - def type: () -> :local_variable_read_node - - # See `Node.type`. - # -- - # : () -> :local_variable_read_node - def self.type: () -> :local_variable_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # x # name `:x` - # - # _Test # name `:_Test` - # - # Note that this can also be an underscore followed by a number for the default block parameters. - # - # _1 # name `:_1` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # The number of visible scopes that should be searched to find the origin of this local variable. - # - # foo = 1; foo # depth 0 - # - # bar = 2; tap { bar } # depth 1 - # - # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - # -- - # : () -> Integer - def depth: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a local variable in a context that doesn't have an explicit value. - # - # foo, bar = baz - # ^^^ ^^^ - # - # foo => baz - # ^^^ - class LocalVariableTargetNode < Node - @depth: Integer - - @name: Symbol - - # Initialize a new LocalVariableTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_target_node - def type: () -> :local_variable_target_node - - # See `Node.type`. - # -- - # : () -> :local_variable_target_node - def self.type: () -> :local_variable_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # Returns the `depth` attribute. - # -- - # : () -> Integer - def depth: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing to a local variable. - # - # foo = 1 - # ^^^^^^^ - class LocalVariableWriteNode < Node - @operator_loc: Location - - @value: Prism::node - - @name_loc: Location - - @depth: Integer - - @name: Symbol - - # Initialize a new LocalVariableWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> LocalVariableWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :local_variable_write_node - def type: () -> :local_variable_write_node - - # See `Node.type`. - # -- - # : () -> :local_variable_write_node - def self.type: () -> :local_variable_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # name -> Symbol - # - # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # foo = :bar # name `:foo` - # - # abc = 123 # name `:abc` - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # depth -> Integer - # - # The number of semantic scopes we have to traverse to find the declaration of this variable. - # - # foo = 1 # depth 0 - # - # tap { foo = 1 } # depth 1 - # - # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). - # -- - # : () -> Integer - def depth: () -> Integer - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # The Location of the variable name. - # - # foo = :bar - # ^^^ - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # foo = :bar - # ^^^^ - # - # abc = 1234 - # ^^^^ - # - # Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. - # - # foo = foo - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `=` operator. - # - # x = :y - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. - # - # if /foo/i then end - # ^^^^^^ - class MatchLastLineNode < Node - @unescaped: String - - @closing_loc: Location - - @content_loc: Location - - @opening_loc: Location - - # Initialize a new MatchLastLineNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MatchLastLineNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :match_last_line_node - def type: () -> :match_last_line_node - - # See `Node.type`. - # -- - # : () -> :match_last_line_node - def self.type: () -> :match_last_line_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # i - ignores the case of characters when matching - # -- - # : () -> bool - def ignore_case?: () -> bool - - # :category: Flags - # x - ignores whitespace and allows comments in regular expressions - # -- - # : () -> bool - def extended?: () -> bool - - # :category: Flags - # m - allows $ to match the end of lines within strings - # -- - # : () -> bool - def multi_line?: () -> bool - - # :category: Flags - # o - only interpolates values into the regular expression once - # -- - # : () -> bool - def once?: () -> bool - - # :category: Flags - # e - forces the EUC-JP encoding - # -- - # : () -> bool - def euc_jp?: () -> bool - - # :category: Flags - # n - forces the ASCII-8BIT encoding - # -- - # : () -> bool - def ascii_8bit?: () -> bool - - # :category: Flags - # s - forces the Windows-31J encoding - # -- - # : () -> bool - def windows_31j?: () -> bool - - # :category: Flags - # u - forces the UTF-8 encoding - # -- - # : () -> bool - def utf_8?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to US-ASCII - # -- - # : () -> bool - def forced_us_ascii_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # content_loc -> Location - # - # Returns the Location represented by `content_loc`. - # -- - # : () -> Location - def content_loc: () -> Location - - # :category: Repository - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_content_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # unescaped -> String - # - # Returns the `unescaped` attribute. - # -- - # : () -> String - def unescaped: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # content -> String - # - # Slice the location of content_loc from the source. - # -- - # : () -> String - def content: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the modifier `in` operator. - # - # foo in bar - # ^^^^^^^^^^ - class MatchPredicateNode < Node - @operator_loc: Location - - @pattern: Prism::node - - @value: Prism::node - - # Initialize a new MatchPredicateNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MatchPredicateNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :match_predicate_node - def type: () -> :match_predicate_node - - # See `Node.type`. - # -- - # : () -> :match_predicate_node - def self.type: () -> :match_predicate_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # pattern -> Node - # - # Returns the `pattern` attribute. - # -- - # : () -> Prism::node - def pattern: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `=>` operator. - # - # foo => bar - # ^^^^^^^^^^ - class MatchRequiredNode < Node - @operator_loc: Location - - @pattern: Prism::node - - @value: Prism::node - - # Initialize a new MatchRequiredNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node value, Prism::node pattern, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MatchRequiredNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :match_required_node - def type: () -> :match_required_node - - # See `Node.type`. - # -- - # : () -> :match_required_node - def self.type: () -> :match_required_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # value -> Node - # - # Represents the left-hand side of the operator. - # - # foo => bar - # ^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # pattern -> Node - # - # Represents the right-hand side of the operator. The type of the node depends on the expression. - # - # Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`. - # - # foo => a # This is equivalent to writing `a = foo` - # ^ - # - # Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant. - # - # foo => [a] - # ^^^ - # - # foo => a, b - # ^^^^ - # - # foo => Bar[a, b] - # ^^^^^^^^^ - # - # If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead. - # - # foo => *, 1, *a - # ^^^^^ - # - # Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`. - # - # foo => { a: 1, b: } - # - # foo => Bar[a: 1, b:] - # - # foo => Bar[**] - # - # To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode` - # - # foo => ^a - # ^^ - # - # Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`. - # - # foo => ^(a + 1) - # - # Anything else will result in the regular node for that expression, for example a `ConstantReadNode`. - # - # foo => CONST - # -- - # : () -> Prism::node - def pattern: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the operator. - # - # foo => bar - # ^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents writing local variables using a regular expression match with named capture groups. - # - # /(?bar)/ =~ baz - # ^^^^^^^^^^^^^^^^^^^^ - class MatchWriteNode < Node - @targets: Array[LocalVariableTargetNode] - - @call: CallNode - - # Initialize a new MatchWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, CallNode call, Array[LocalVariableTargetNode] targets) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, CallNode call, Array[LocalVariableTargetNode] targets) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MatchWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :match_write_node - def type: () -> :match_write_node - - # See `Node.type`. - # -- - # : () -> :match_write_node - def self.type: () -> :match_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # call -> CallNode - # - # Returns the `call` attribute. - # -- - # : () -> CallNode - def call: () -> CallNode - - # :call-seq: - # targets -> Array[LocalVariableTargetNode] - # - # Returns the `targets` attribute. - # -- - # : () -> Array[LocalVariableTargetNode] - def targets: () -> Array[LocalVariableTargetNode] - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a node that is missing from the source and results in a syntax error. - class MissingNode < Node - # Initialize a new MissingNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MissingNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> MissingNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :missing_node - def type: () -> :missing_node - - # See `Node.type`. - # -- - # : () -> :missing_node - def self.type: () -> :missing_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a module declaration involving the `module` keyword. - # - # module Foo end - # ^^^^^^^^^^^^^^ - class ModuleNode < Node - @name: Symbol - - @end_keyword_loc: Location - - @body: (StatementsNode | BeginNode)? - - @constant_path: ConstantReadNode | ConstantPathNode | MissingNode - - @module_keyword_loc: Location - - @locals: Array[Symbol] - - # Initialize a new ModuleNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location module_keyword_loc, (ConstantReadNode | ConstantPathNode | MissingNode) constant_path, (StatementsNode | BeginNode)? body, Location end_keyword_loc, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location module_keyword_loc, ConstantReadNode | ConstantPathNode | MissingNode constant_path, (StatementsNode | BeginNode)? body, Location end_keyword_loc, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ModuleNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: (ConstantReadNode | ConstantPathNode | MissingNode), ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | MissingNode, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :module_node - def type: () -> :module_node - - # See `Node.type`. - # -- - # : () -> :module_node - def self.type: () -> :module_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :category: Locations - # :call-seq: - # module_keyword_loc -> Location - # - # Returns the Location represented by `module_keyword_loc`. - # -- - # : () -> Location - def module_keyword_loc: () -> Location - - # :category: Repository - # Save the module_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_module_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # constant_path -> ConstantReadNode | ConstantPathNode | MissingNode - # - # Returns the `constant_path` attribute. - # -- - # : () -> (ConstantReadNode | ConstantPathNode | MissingNode) - def constant_path: () -> (ConstantReadNode | ConstantPathNode | MissingNode) - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # Returns the `body` attribute. - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Returns the Location represented by `end_keyword_loc`. - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :call-seq: - # module_keyword -> String - # - # Slice the location of module_keyword_loc from the source. - # -- - # : () -> String - def module_keyword: () -> String - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a multi-target expression. - # - # a, (b, c) = 1, 2, 3 - # ^^^^^^ - # - # This can be a part of `MultiWriteNode` as above, or the target of a `for` loop - # - # for a, b in [[1, 2], [3, 4]] - # ^^^^ - class MultiTargetNode < Node - @rparen_loc: Location? - - @lparen_loc: Location? - - @rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - - @rest: (ImplicitRestNode | SplatNode)? - - @lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # Initialize a new MultiTargetNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, (ImplicitRestNode | SplatNode)? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, (ImplicitRestNode | SplatNode)? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MultiTargetNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :multi_target_node - def type: () -> :multi_target_node - - # See `Node.type`. - # -- - # : () -> :multi_target_node - def self.type: () -> :multi_target_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # lefts -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - # - # Represents the targets expressions before a splat node. - # - # a, (b, c, *) = 1, 2, 3, 4, 5 - # ^^^^ - # - # The splat node can be absent, in that case all target expressions are in the left field. - # - # a, (b, c) = 1, 2, 3, 4, 5 - # ^^^^ - # -- - # : () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - def lefts: () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # :call-seq: - # rest -> ImplicitRestNode | SplatNode | nil - # - # Represents a splat node in the target expression. - # - # a, (b, *c) = 1, 2, 3, 4 - # ^^ - # - # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - # - # a, (b, *) = 1, 2, 3, 4 - # ^ - # - # If the `*` is omitted, this field will contain an `ImplicitRestNode` - # - # a, (b,) = 1, 2, 3, 4 - # ^ - # -- - # : () -> (ImplicitRestNode | SplatNode)? - def rest: () -> (ImplicitRestNode | SplatNode)? - - # :call-seq: - # rights -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - # - # Represents the targets expressions after a splat node. - # - # a, (*, b, c) = 1, 2, 3, 4, 5 - # ^^^^ - # -- - # : () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - def rights: () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # The Location of the opening parenthesis. - # - # a, (b, c) = 1, 2, 3 - # ^ - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # The Location of the closing parenthesis. - # - # a, (b, c) = 1, 2, 3 - # ^ - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a write to a multi-target expression. - # - # a, b, c = 1, 2, 3 - # ^^^^^^^^^^^^^^^^^ - class MultiWriteNode < Node - @value: Prism::node - - @operator_loc: Location - - @rparen_loc: Location? - - @lparen_loc: Location? - - @rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - - @rest: (ImplicitRestNode | SplatNode)? - - @lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # Initialize a new MultiWriteNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, (ImplicitRestNode | SplatNode)? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, (ImplicitRestNode | SplatNode)? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> MultiWriteNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: (ImplicitRestNode | SplatNode)?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :multi_write_node - def type: () -> :multi_write_node - - # See `Node.type`. - # -- - # : () -> :multi_write_node - def self.type: () -> :multi_write_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # lefts -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - # - # Represents the targets expressions before a splat node. - # - # a, b, * = 1, 2, 3, 4, 5 - # ^^^^ - # - # The splat node can be absent, in that case all target expressions are in the left field. - # - # a, b, c = 1, 2, 3, 4, 5 - # ^^^^^^^ - # -- - # : () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - def lefts: () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # :call-seq: - # rest -> ImplicitRestNode | SplatNode | nil - # - # Represents a splat node in the target expression. - # - # a, b, *c = 1, 2, 3, 4 - # ^^ - # - # The variable can be empty, this results in a `SplatNode` with a `nil` expression field. - # - # a, b, * = 1, 2, 3, 4 - # ^ - # - # If the `*` is omitted, this field will contain an `ImplicitRestNode` - # - # a, b, = 1, 2, 3, 4 - # ^ - # -- - # : () -> (ImplicitRestNode | SplatNode)? - def rest: () -> (ImplicitRestNode | SplatNode)? - - # :call-seq: - # rights -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - # - # Represents the targets expressions after a splat node. - # - # a, *, b, c = 1, 2, 3, 4, 5 - # ^^^^ - # -- - # : () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - def rights: () -> Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode] - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # The Location of the opening parenthesis. - # - # (a, b, c) = 1, 2, 3 - # ^ - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # The Location of the closing parenthesis. - # - # (a, b, c) = 1, 2, 3 - # ^ - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the operator. - # - # a, b, c = 1, 2, 3 - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # a, b, c = 1, 2, 3 - # ^^^^^^^ - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `next` keyword. - # - # next 1 - # ^^^^^^ - class NextNode < Node - @keyword_loc: Location - - @arguments: ArgumentsNode? - - # Initialize a new NextNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ArgumentsNode? arguments, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NextNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :next_node - def type: () -> :next_node - - # See `Node.type`. - # -- - # : () -> :next_node - def self.type: () -> :next_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `nil` keyword. - # - # nil - # ^^^ - class NilNode < Node - # Initialize a new NilNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NilNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> NilNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :nil_node - def type: () -> :nil_node - - # See `Node.type`. - # -- - # : () -> :nil_node - def self.type: () -> :nil_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of `&nil` inside method arguments. - # - # def a(&nil) - # ^^^^ - # end - class NoBlockParameterNode < Node - @keyword_loc: Location - - @operator_loc: Location - - # Initialize a new NoBlockParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NoBlockParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoBlockParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoBlockParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :no_block_parameter_node - def type: () -> :no_block_parameter_node - - # See `Node.type`. - # -- - # : () -> :no_block_parameter_node - def self.type: () -> :no_block_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of `**nil` inside method arguments. - # - # def a(**nil) - # ^^^^^ - # end - class NoKeywordsParameterNode < Node - @keyword_loc: Location - - @operator_loc: Location - - # Initialize a new NoKeywordsParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NoKeywordsParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :no_keywords_parameter_node - def type: () -> :no_keywords_parameter_node - - # See `Node.type`. - # -- - # : () -> :no_keywords_parameter_node - def self.type: () -> :no_keywords_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. - # - # -> { _1 + _2 } - # ^^^^^^^^^^^^^^ - class NumberedParametersNode < Node - @maximum: Integer - - # Initialize a new NumberedParametersNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Integer maximum) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer maximum) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NumberedParametersNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :numbered_parameters_node - def type: () -> :numbered_parameters_node - - # See `Node.type`. - # -- - # : () -> :numbered_parameters_node - def self.type: () -> :numbered_parameters_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # maximum -> Integer - # - # Returns the `maximum` attribute. - # -- - # : () -> Integer - def maximum: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents reading a numbered reference to a capture in the previous match. - # - # $1 - # ^^ - class NumberedReferenceReadNode < Node - @number: Integer - - # Initialize a new NumberedReferenceReadNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Integer number) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer number) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> NumberedReferenceReadNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :numbered_reference_read_node - def type: () -> :numbered_reference_read_node - - # See `Node.type`. - # -- - # : () -> :numbered_reference_read_node - def self.type: () -> :numbered_reference_read_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # number -> Integer - # - # The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. - # - # $1 # number `1` - # - # $5432 # number `5432` - # - # $4294967296 # number `0` - # -- - # : () -> Integer - def number: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an optional keyword parameter to a method, block, or lambda definition. - # - # def a(b: 1) - # ^^^^ - # end - class OptionalKeywordParameterNode < Node - @value: Prism::node - - @name_loc: Location - - @name: Symbol - - # Initialize a new OptionalKeywordParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> OptionalKeywordParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :optional_keyword_parameter_node - def type: () -> :optional_keyword_parameter_node - - # See `Node.type`. - # -- - # : () -> :optional_keyword_parameter_node - def self.type: () -> :optional_keyword_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an optional parameter to a method, block, or lambda definition. - # - # def a(b = 1) - # ^^^^^ - # end - class OptionalParameterNode < Node - @value: Prism::node - - @operator_loc: Location - - @name_loc: Location - - @name: Symbol - - # Initialize a new OptionalParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> OptionalParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :optional_parameter_node - def type: () -> :optional_parameter_node - - # See `Node.type`. - # -- - # : () -> :optional_parameter_node - def self.type: () -> :optional_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # value -> Node - # - # Returns the `value` attribute. - # -- - # : () -> Prism::node - def value: () -> Prism::node - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `||` operator or the `or` keyword. - # - # left or right - # ^^^^^^^^^^^^^ - class OrNode < Node - @operator_loc: Location - - @right: Prism::node - - @left: Prism::node - - # Initialize a new OrNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node left, Prism::node right, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> OrNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :or_node - def type: () -> :or_node - - # See `Node.type`. - # -- - # : () -> :or_node - def self.type: () -> :or_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # left -> Node - # - # Represents the left side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # left or right - # ^^^^ - # - # 1 || 2 - # ^ - # -- - # : () -> Prism::node - def left: () -> Prism::node - - # :call-seq: - # right -> Node - # - # Represents the right side of the expression. - # - # left || right - # ^^^^^ - # - # 1 or 2 - # ^ - # -- - # : () -> Prism::node - def right: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `or` keyword or the `||` operator. - # - # left or right - # ^^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the list of parameters on a method, block, or lambda definition. - # - # def a(b, c, d) - # ^^^^^^^ - # end - class ParametersNode < Node - @block: (BlockParameterNode | NoBlockParameterNode)? - - @keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)? - - @keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] - - @posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] - - @rest: (RestParameterNode | ImplicitRestNode)? - - @optionals: Array[OptionalParameterNode] - - @requireds: Array[RequiredParameterNode | MultiTargetNode] - - # Initialize a new ParametersNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, (RestParameterNode | ImplicitRestNode)? rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)? keyword_rest, (BlockParameterNode | NoBlockParameterNode)? block) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, (RestParameterNode | ImplicitRestNode)? rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)? keyword_rest, (BlockParameterNode | NoBlockParameterNode)? block) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ParametersNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: (RestParameterNode | ImplicitRestNode)?, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)?, ?block: (BlockParameterNode | NoBlockParameterNode)?) -> ParametersNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: (RestParameterNode | ImplicitRestNode)?, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)?, ?block: (BlockParameterNode | NoBlockParameterNode)?) -> ParametersNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :parameters_node - def type: () -> :parameters_node - - # See `Node.type`. - # -- - # : () -> :parameters_node - def self.type: () -> :parameters_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # requireds -> Array[RequiredParameterNode | MultiTargetNode] - # - # Returns the `requireds` attribute. - # -- - # : () -> Array[RequiredParameterNode | MultiTargetNode] - def requireds: () -> Array[RequiredParameterNode | MultiTargetNode] - - # :call-seq: - # optionals -> Array[OptionalParameterNode] - # - # Returns the `optionals` attribute. - # -- - # : () -> Array[OptionalParameterNode] - def optionals: () -> Array[OptionalParameterNode] - - # :call-seq: - # rest -> RestParameterNode | ImplicitRestNode | nil - # - # Returns the `rest` attribute. - # -- - # : () -> (RestParameterNode | ImplicitRestNode)? - def rest: () -> (RestParameterNode | ImplicitRestNode)? - - # :call-seq: - # posts -> Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] - # - # Returns the `posts` attribute. - # -- - # : () -> Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] - def posts: () -> Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode | BlockParameterNode | NoBlockParameterNode] - - # :call-seq: - # keywords -> Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] - # - # Returns the `keywords` attribute. - # -- - # : () -> Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] - def keywords: () -> Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] - - # :call-seq: - # keyword_rest -> KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil - # - # Returns the `keyword_rest` attribute. - # -- - # : () -> (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)? - def keyword_rest: () -> (KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode)? - - # :call-seq: - # block -> BlockParameterNode | NoBlockParameterNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> (BlockParameterNode | NoBlockParameterNode)? - def block: () -> (BlockParameterNode | NoBlockParameterNode)? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a parenthesized expression - # - # (10 + 34) - # ^^^^^^^^^ - class ParenthesesNode < Node - @closing_loc: Location - - @opening_loc: Location - - @body: Prism::node? - - # Initialize a new ParenthesesNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? body, Location opening_loc, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? body, Location opening_loc, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ParenthesesNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :parentheses_node - def type: () -> :parentheses_node - - # See `Node.type`. - # -- - # : () -> :parentheses_node - def self.type: () -> :parentheses_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # parentheses that contain multiple potentially void statements - # -- - # : () -> bool - def multiple_statements?: () -> bool - - # :call-seq: - # body -> Node | nil - # - # Returns the `body` attribute. - # -- - # : () -> Prism::node? - def body: () -> Prism::node? - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `^` operator for pinning an expression in a pattern matching expression. - # - # foo in ^(bar) - # ^^^^^^ - class PinnedExpressionNode < Node - @rparen_loc: Location - - @lparen_loc: Location - - @operator_loc: Location - - @expression: Prism::node - - # Initialize a new PinnedExpressionNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> PinnedExpressionNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :pinned_expression_node - def type: () -> :pinned_expression_node - - # See `Node.type`. - # -- - # : () -> :pinned_expression_node - def self.type: () -> :pinned_expression_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # expression -> Node - # - # The expression used in the pinned expression - # - # foo in ^(bar) - # ^^^ - # -- - # : () -> Prism::node - def expression: () -> Prism::node - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `^` operator - # - # foo in ^(bar) - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # lparen_loc -> Location - # - # The Location of the opening parenthesis. - # - # foo in ^(bar) - # ^ - # -- - # : () -> Location - def lparen_loc: () -> Location - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_lparen_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # rparen_loc -> Location - # - # The Location of the closing parenthesis. - # - # foo in ^(bar) - # ^ - # -- - # : () -> Location - def rparen_loc: () -> Location - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_rparen_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # :call-seq: - # lparen -> String - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String - def lparen: () -> String - - # :call-seq: - # rparen -> String - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String - def rparen: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `^` operator for pinning a variable in a pattern matching expression. - # - # foo in ^bar - # ^^^^ - class PinnedVariableNode < Node - @operator_loc: Location - - @variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode - - # Initialize a new PinnedVariableNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode) variable, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode variable, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> PinnedVariableNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode), ?operator_loc: Location) -> PinnedVariableNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, ?operator_loc: Location) -> PinnedVariableNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :pinned_variable_node - def type: () -> :pinned_variable_node - - # See `Node.type`. - # -- - # : () -> :pinned_variable_node - def self.type: () -> :pinned_variable_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # variable -> LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode - # - # The variable used in the pinned expression - # - # foo in ^bar - # ^^^ - # -- - # : () -> (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode) - def variable: () -> (LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode) - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `^` operator - # - # foo in ^bar - # ^ - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `END` keyword. - # - # END { foo } - # ^^^^^^^^^^^ - class PostExecutionNode < Node - @closing_loc: Location - - @opening_loc: Location - - @keyword_loc: Location - - @statements: StatementsNode? - - # Initialize a new PostExecutionNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> PostExecutionNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :post_execution_node - def type: () -> :post_execution_node - - # See `Node.type`. - # -- - # : () -> :post_execution_node - def self.type: () -> :post_execution_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `BEGIN` keyword. - # - # BEGIN { foo } - # ^^^^^^^^^^^^^ - class PreExecutionNode < Node - @closing_loc: Location - - @opening_loc: Location - - @keyword_loc: Location - - @statements: StatementsNode? - - # Initialize a new PreExecutionNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> PreExecutionNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :pre_execution_node - def type: () -> :pre_execution_node - - # See `Node.type`. - # -- - # : () -> :pre_execution_node - def self.type: () -> :pre_execution_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # The top level node of any parse tree. - class ProgramNode < Node - @statements: StatementsNode - - @locals: Array[Symbol] - - # Initialize a new ProgramNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, StatementsNode statements) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, StatementsNode statements) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ProgramNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :program_node - def type: () -> :program_node - - # See `Node.type`. - # -- - # : () -> :program_node - def self.type: () -> :program_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :call-seq: - # statements -> StatementsNode - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode - def statements: () -> StatementsNode - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `..` or `...` operators. - # - # 1..2 - # ^^^^ - # - # c if a =~ /left/ ... b =~ /right/ - # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - class RangeNode < Node - @operator_loc: Location - - @right: Prism::node? - - @left: Prism::node? - - # Initialize a new RangeNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node? left, Prism::node? right, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RangeNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :range_node - def type: () -> :range_node - - # See `Node.type`. - # -- - # : () -> :range_node - def self.type: () -> :range_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # ... operator - # -- - # : () -> bool - def exclude_end?: () -> bool - - # :call-seq: - # left -> Node | nil - # - # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # 1... - # ^ - # - # hello...goodbye - # ^^^^^ - # -- - # : () -> Prism::node? - def left: () -> Prism::node? - - # :call-seq: - # right -> Node | nil - # - # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # ..5 - # ^ - # - # 1...foo - # ^^^ - # If neither right-hand or left-hand side was included, this will be a MissingNode. - # -- - # : () -> Prism::node? - def right: () -> Prism::node? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # The Location of the `..` or `...` operator. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a rational number literal. - # - # 1.0r - # ^^^^ - class RationalNode < Node - @denominator: Integer - - @numerator: Integer - - # Initialize a new RationalNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Integer numerator, Integer denominator) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Integer numerator, Integer denominator) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RationalNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :rational_node - def type: () -> :rational_node - - # See `Node.type`. - # -- - # : () -> :rational_node - def self.type: () -> :rational_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # 0b prefix - # -- - # : () -> bool - def binary?: () -> bool - - # :category: Flags - # 0d or no prefix - # -- - # : () -> bool - def decimal?: () -> bool - - # :category: Flags - # 0o or 0 prefix - # -- - # : () -> bool - def octal?: () -> bool - - # :category: Flags - # 0x prefix - # -- - # : () -> bool - def hexadecimal?: () -> bool - - # :call-seq: - # numerator -> Integer - # - # The numerator of the rational number. - # - # 1.5r # numerator 3 - # -- - # : () -> Integer - def numerator: () -> Integer - - # :call-seq: - # denominator -> Integer - # - # The denominator of the rational number. - # - # 1.5r # denominator 2 - # -- - # : () -> Integer - def denominator: () -> Integer - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `redo` keyword. - # - # redo - # ^^^^ - class RedoNode < Node - # Initialize a new RedoNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RedoNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> RedoNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :redo_node - def type: () -> :redo_node - - # See `Node.type`. - # -- - # : () -> :redo_node - def self.type: () -> :redo_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a regular expression literal with no interpolation. - # - # /foo/i - # ^^^^^^ - class RegularExpressionNode < Node - @unescaped: String - - @closing_loc: Location - - @content_loc: Location - - @opening_loc: Location - - # Initialize a new RegularExpressionNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RegularExpressionNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :regular_expression_node - def type: () -> :regular_expression_node - - # See `Node.type`. - # -- - # : () -> :regular_expression_node - def self.type: () -> :regular_expression_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # i - ignores the case of characters when matching - # -- - # : () -> bool - def ignore_case?: () -> bool - - # :category: Flags - # x - ignores whitespace and allows comments in regular expressions - # -- - # : () -> bool - def extended?: () -> bool - - # :category: Flags - # m - allows $ to match the end of lines within strings - # -- - # : () -> bool - def multi_line?: () -> bool - - # :category: Flags - # o - only interpolates values into the regular expression once - # -- - # : () -> bool - def once?: () -> bool - - # :category: Flags - # e - forces the EUC-JP encoding - # -- - # : () -> bool - def euc_jp?: () -> bool - - # :category: Flags - # n - forces the ASCII-8BIT encoding - # -- - # : () -> bool - def ascii_8bit?: () -> bool - - # :category: Flags - # s - forces the Windows-31J encoding - # -- - # : () -> bool - def windows_31j?: () -> bool - - # :category: Flags - # u - forces the UTF-8 encoding - # -- - # : () -> bool - def utf_8?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to US-ASCII - # -- - # : () -> bool - def forced_us_ascii_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # content_loc -> Location - # - # Returns the Location represented by `content_loc`. - # -- - # : () -> Location - def content_loc: () -> Location - - # :category: Repository - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_content_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # unescaped -> String - # - # Returns the `unescaped` attribute. - # -- - # : () -> String - def unescaped: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # content -> String - # - # Slice the location of content_loc from the source. - # -- - # : () -> String - def content: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a required keyword parameter to a method, block, or lambda definition. - # - # def a(b: ) - # ^^ - # end - class RequiredKeywordParameterNode < Node - @name_loc: Location - - @name: Symbol - - # Initialize a new RequiredKeywordParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name, Location name_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RequiredKeywordParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :required_keyword_parameter_node - def type: () -> :required_keyword_parameter_node - - # See `Node.type`. - # -- - # : () -> :required_keyword_parameter_node - def self.type: () -> :required_keyword_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # :category: Locations - # :call-seq: - # name_loc -> Location - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location - def name_loc: () -> Location - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_name_loc: (_Repository repository) -> Relocation::Entry - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a required parameter to a method, block, or lambda definition. - # - # def a(b) - # ^ - # end - class RequiredParameterNode < Node - @name: Symbol - - # Initialize a new RequiredParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol name) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RequiredParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :required_parameter_node - def type: () -> :required_parameter_node - - # See `Node.type`. - # -- - # : () -> :required_parameter_node - def self.type: () -> :required_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol - # - # Returns the `name` attribute. - # -- - # : () -> Symbol - def name: () -> Symbol - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an expression modified with a rescue. - # - # foo rescue nil - # ^^^^^^^^^^^^^^ - class RescueModifierNode < Node - @rescue_expression: Prism::node - - @keyword_loc: Location - - @expression: Prism::node - - # Initialize a new RescueModifierNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location keyword_loc, Prism::node rescue_expression) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Prism::node expression, Location keyword_loc, Prism::node rescue_expression) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RescueModifierNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :rescue_modifier_node - def type: () -> :rescue_modifier_node - - # See `Node.type`. - # -- - # : () -> :rescue_modifier_node - def self.type: () -> :rescue_modifier_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # expression -> Node - # - # Returns the `expression` attribute. - # -- - # : () -> Prism::node - def expression: () -> Prism::node - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # rescue_expression -> Node - # - # Returns the `rescue_expression` attribute. - # -- - # : () -> Prism::node - def rescue_expression: () -> Prism::node - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a rescue statement. - # - # begin - # rescue Foo, *splat, Bar => ex - # foo - # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - # end - # - # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field. - class RescueNode < Node - @subsequent: RescueNode? - - @statements: StatementsNode? - - @then_keyword_loc: Location? - - @reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)? - - @operator_loc: Location? - - @exceptions: Array[Prism::node] - - @keyword_loc: Location - - # Initialize a new RescueNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)? reference, Location? then_keyword_loc, StatementsNode? statements, RescueNode? subsequent) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)? reference, Location? then_keyword_loc, StatementsNode? statements, RescueNode? subsequent) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RescueNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)?, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)?, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :rescue_node - def type: () -> :rescue_node - - # See `Node.type`. - # -- - # : () -> :rescue_node - def self.type: () -> :rescue_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # exceptions -> Array[Node] - # - # Returns the `exceptions` attribute. - # -- - # : () -> Array[Prism::node] - def exceptions: () -> Array[Prism::node] - - # :category: Locations - # :call-seq: - # operator_loc -> Location | nil - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location? - def operator_loc: () -> Location? - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_operator_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # reference -> LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil - # - # Returns the `reference` attribute. - # -- - # : () -> (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)? - def reference: () -> (LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode)? - - # :category: Locations - # :call-seq: - # then_keyword_loc -> Location | nil - # - # Returns the Location represented by `then_keyword_loc`. - # -- - # : () -> Location? - def then_keyword_loc: () -> Location? - - # :category: Repository - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_then_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # subsequent -> RescueNode | nil - # - # Returns the `subsequent` attribute. - # -- - # : () -> RescueNode? - def subsequent: () -> RescueNode? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # operator -> String | nil - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String? - def operator: () -> String? - - # :call-seq: - # then_keyword -> String | nil - # - # Slice the location of then_keyword_loc from the source. - # -- - # : () -> String? - def then_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a rest parameter to a method, block, or lambda definition. - # - # def a(*b) - # ^^ - # end - class RestParameterNode < Node - @operator_loc: Location - - @name_loc: Location? - - @name: Symbol? - - # Initialize a new RestParameterNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Symbol? name, Location? name_loc, Location operator_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RestParameterNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :rest_parameter_node - def type: () -> :rest_parameter_node - - # See `Node.type`. - # -- - # : () -> :rest_parameter_node - def self.type: () -> :rest_parameter_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a parameter name that has been repeated in the method signature - # -- - # : () -> bool - def repeated_parameter?: () -> bool - - # :call-seq: - # name -> Symbol | nil - # - # Returns the `name` attribute. - # -- - # : () -> Symbol? - def name: () -> Symbol? - - # :category: Locations - # :call-seq: - # name_loc -> Location | nil - # - # Returns the Location represented by `name_loc`. - # -- - # : () -> Location? - def name_loc: () -> Location? - - # :category: Repository - # Save the name_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_name_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `retry` keyword. - # - # retry - # ^^^^^ - class RetryNode < Node - # Initialize a new RetryNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> RetryNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> RetryNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :retry_node - def type: () -> :retry_node - - # See `Node.type`. - # -- - # : () -> :retry_node - def self.type: () -> :retry_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `return` keyword. - # - # return 1 - # ^^^^^^^^ - class ReturnNode < Node - @arguments: ArgumentsNode? - - @keyword_loc: Location - - # Initialize a new ReturnNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, ArgumentsNode? arguments) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, ArgumentsNode? arguments) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ReturnNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :return_node - def type: () -> :return_node - - # See `Node.type`. - # -- - # : () -> :return_node - def self.type: () -> :return_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the `self` keyword. - # - # self - # ^^^^ - class SelfNode < Node - # Initialize a new SelfNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SelfNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> SelfNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :self_node - def type: () -> :self_node - - # See `Node.type`. - # -- - # : () -> :self_node - def self.type: () -> :self_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified. - # - # # shareable_constant_value: literal - # C = { a: 1 } - # ^^^^^^^^^^^^ - class ShareableConstantNode < Node - @write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode - - # Initialize a new ShareableConstantNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) write) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> ShareableConstantNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode)) -> ShareableConstantNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :shareable_constant_node - def type: () -> :shareable_constant_node - - # See `Node.type`. - # -- - # : () -> :shareable_constant_node - def self.type: () -> :shareable_constant_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # constant writes that should be modified with shareable constant value literal - # -- - # : () -> bool - def literal?: () -> bool - - # :category: Flags - # constant writes that should be modified with shareable constant value experimental everything - # -- - # : () -> bool - def experimental_everything?: () -> bool - - # :category: Flags - # constant writes that should be modified with shareable constant value experimental copy - # -- - # : () -> bool - def experimental_copy?: () -> bool - - # :call-seq: - # write -> ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode - # - # The constant write that should be modified with the shareability state. - # -- - # : () -> (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) - def write: () -> (ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a singleton class declaration involving the `class` keyword. - # - # class << self end - # ^^^^^^^^^^^^^^^^^ - class SingletonClassNode < Node - @end_keyword_loc: Location - - @body: (StatementsNode | BeginNode)? - - @expression: Prism::node - - @operator_loc: Location - - @class_keyword_loc: Location - - @locals: Array[Symbol] - - # Initialize a new SingletonClassNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, (StatementsNode | BeginNode)? body, Location end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, (StatementsNode | BeginNode)? body, Location end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SingletonClassNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location) -> SingletonClassNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: (StatementsNode | BeginNode)?, ?end_keyword_loc: Location) -> SingletonClassNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :singleton_class_node - def type: () -> :singleton_class_node - - # See `Node.type`. - # -- - # : () -> :singleton_class_node - def self.type: () -> :singleton_class_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # locals -> Array[Symbol] - # - # Returns the `locals` attribute. - # -- - # : () -> Array[Symbol] - def locals: () -> Array[Symbol] - - # :category: Locations - # :call-seq: - # class_keyword_loc -> Location - # - # Returns the Location represented by `class_keyword_loc`. - # -- - # : () -> Location - def class_keyword_loc: () -> Location - - # :category: Repository - # Save the class_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_class_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # expression -> Node - # - # Returns the `expression` attribute. - # -- - # : () -> Prism::node - def expression: () -> Prism::node - - # :call-seq: - # body -> StatementsNode | BeginNode | nil - # - # Returns the `body` attribute. - # -- - # : () -> (StatementsNode | BeginNode)? - def body: () -> (StatementsNode | BeginNode)? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location - # - # Returns the Location represented by `end_keyword_loc`. - # -- - # : () -> Location - def end_keyword_loc: () -> Location - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # class_keyword -> String - # - # Slice the location of class_keyword_loc from the source. - # -- - # : () -> String - def class_keyword: () -> String - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # :call-seq: - # end_keyword -> String - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String - def end_keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `__ENCODING__` keyword. - # - # __ENCODING__ - # ^^^^^^^^^^^^ - class SourceEncodingNode < Node - # Initialize a new SourceEncodingNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SourceEncodingNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> SourceEncodingNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :source_encoding_node - def type: () -> :source_encoding_node - - # See `Node.type`. - # -- - # : () -> :source_encoding_node - def self.type: () -> :source_encoding_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `__FILE__` keyword. - # - # __FILE__ - # ^^^^^^^^ - class SourceFileNode < Node - @filepath: String - - # Initialize a new SourceFileNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, String filepath) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, String filepath) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SourceFileNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :source_file_node - def type: () -> :source_file_node - - # See `Node.type`. - # -- - # : () -> :source_file_node - def self.type: () -> :source_file_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - # -- - # : () -> bool - def frozen?: () -> bool - - # :category: Flags - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - # -- - # : () -> bool - def mutable?: () -> bool - - # :call-seq: - # filepath -> String - # - # Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism.parse*` APIs. - # -- - # : () -> String - def filepath: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `__LINE__` keyword. - # - # __LINE__ - # ^^^^^^^^ - class SourceLineNode < Node - # Initialize a new SourceLineNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SourceLineNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> SourceLineNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :source_line_node - def type: () -> :source_line_node - - # See `Node.type`. - # -- - # : () -> :source_line_node - def self.type: () -> :source_line_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the splat operator. - # - # [*a] - # ^^ - class SplatNode < Node - @expression: Prism::node? - - @operator_loc: Location - - # Initialize a new SplatNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Prism::node? expression) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location operator_loc, Prism::node? expression) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SplatNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :splat_node - def type: () -> :splat_node - - # See `Node.type`. - # -- - # : () -> :splat_node - def self.type: () -> :splat_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # operator_loc -> Location - # - # Returns the Location represented by `operator_loc`. - # -- - # : () -> Location - def operator_loc: () -> Location - - # :category: Repository - # Save the operator_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_operator_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # expression -> Node | nil - # - # Returns the `expression` attribute. - # -- - # : () -> Prism::node? - def expression: () -> Prism::node? - - # :call-seq: - # operator -> String - # - # Slice the location of operator_loc from the source. - # -- - # : () -> String - def operator: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a set of statements contained within some scope. - # - # foo; bar; baz - # ^^^^^^^^^^^^^ - class StatementsNode < Node - @body: Array[Prism::node] - - # Initialize a new StatementsNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] body) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] body) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> StatementsNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :statements_node - def type: () -> :statements_node - - # See `Node.type`. - # -- - # : () -> :statements_node - def self.type: () -> :statements_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # body -> Array[Node] - # - # Returns the `body` attribute. - # -- - # : () -> Array[Prism::node] - def body: () -> Array[Prism::node] - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. - # - # "foo" - # ^^^^^ - # - # %w[foo] - # ^^^ - # - # "foo #{bar} baz" - # ^^^^ ^^^^ - class StringNode < Node - @unescaped: String - - @closing_loc: Location? - - @content_loc: Location - - @opening_loc: Location? - - # Initialize a new StringNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> StringNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :string_node - def type: () -> :string_node - - # See `Node.type`. - # -- - # : () -> :string_node - def self.type: () -> :string_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - # -- - # : () -> bool - def frozen?: () -> bool - - # :category: Flags - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - # -- - # : () -> bool - def mutable?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # content_loc -> Location - # - # Returns the Location represented by `content_loc`. - # -- - # : () -> Location - def content_loc: () -> Location - - # :category: Repository - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_content_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # unescaped -> String - # - # Returns the `unescaped` attribute. - # -- - # : () -> String - def unescaped: () -> String - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # content -> String - # - # Slice the location of content_loc from the source. - # -- - # : () -> String - def content: () -> String - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `super` keyword with parentheses or arguments. - # - # super() - # ^^^^^^^ - # - # super foo, bar - # ^^^^^^^^^^^^^^ - # - # If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead. - class SuperNode < Node - @block: (BlockNode | BlockArgumentNode)? - - @rparen_loc: Location? - - @arguments: ArgumentsNode? - - @lparen_loc: Location? - - @keyword_loc: Location - - # Initialize a new SuperNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, (BlockNode | BlockArgumentNode)? block) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, (BlockNode | BlockArgumentNode)? block) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SuperNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> SuperNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: (BlockNode | BlockArgumentNode)?) -> SuperNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :super_node - def type: () -> :super_node - - # See `Node.type`. - # -- - # : () -> :super_node - def self.type: () -> :super_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # Returns the Location represented by `lparen_loc`. - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Can be only `nil` when there are empty parentheses, like `super()`. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # Returns the Location represented by `rparen_loc`. - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # block -> BlockNode | BlockArgumentNode | nil - # - # Returns the `block` attribute. - # -- - # : () -> (BlockNode | BlockArgumentNode)? - def block: () -> (BlockNode | BlockArgumentNode)? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents a symbol literal or a symbol contained within a `%i` list. - # - # :foo - # ^^^^ - # - # %i[foo] - # ^^^ - class SymbolNode < Node - @unescaped: String - - @closing_loc: Location? - - @value_loc: Location? - - @opening_loc: Location? - - # Initialize a new SymbolNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> SymbolNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :symbol_node - def type: () -> :symbol_node - - # See `Node.type`. - # -- - # : () -> :symbol_node - def self.type: () -> :symbol_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to US-ASCII - # -- - # : () -> bool - def forced_us_ascii_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location | nil - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location? - def opening_loc: () -> Location? - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_opening_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # value_loc -> Location | nil - # - # Returns the Location represented by `value_loc`. - # -- - # : () -> Location? - def value_loc: () -> Location? - - # :category: Repository - # Save the value_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_value_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # unescaped -> String - # - # Returns the `unescaped` attribute. - # -- - # : () -> String - def unescaped: () -> String - - # :call-seq: - # opening -> String | nil - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String? - def opening: () -> String? - - # :call-seq: - # value -> String | nil - # - # Slice the location of value_loc from the source. - # -- - # : () -> String? - def value: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the literal `true` keyword. - # - # true - # ^^^^ - class TrueNode < Node - # Initialize a new TrueNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, ) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> TrueNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ) -> TrueNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :true_node - def type: () -> :true_node - - # See `Node.type`. - # -- - # : () -> :true_node - def self.type: () -> :true_node - - # : () -> String - def inspect: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `undef` keyword. - # - # undef :foo, :bar, :baz - # ^^^^^^^^^^^^^^^^^^^^^^ - class UndefNode < Node - @keyword_loc: Location - - @names: Array[SymbolNode | InterpolatedSymbolNode] - - # Initialize a new UndefNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> UndefNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :undef_node - def type: () -> :undef_node - - # See `Node.type`. - # -- - # : () -> :undef_node - def self.type: () -> :undef_node - - # : () -> String - def inspect: () -> String - - # :call-seq: - # names -> Array[SymbolNode | InterpolatedSymbolNode] - # - # Returns the `names` attribute. - # -- - # : () -> Array[SymbolNode | InterpolatedSymbolNode] - def names: () -> Array[SymbolNode | InterpolatedSymbolNode] - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `unless` keyword, either in the block form or the modifier form. - # - # bar unless foo - # ^^^^^^^^^^^^^^ - # - # unless foo then bar end - # ^^^^^^^^^^^^^^^^^^^^^^^ - class UnlessNode < Node - @end_keyword_loc: Location? - - @else_clause: ElseNode? - - @statements: StatementsNode? - - @then_keyword_loc: Location? - - @predicate: Prism::node - - @keyword_loc: Location - - # Initialize a new UnlessNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? else_clause, Location? end_keyword_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? else_clause, Location? end_keyword_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> UnlessNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :unless_node - def type: () -> :unless_node - - # See `Node.type`. - # -- - # : () -> :unless_node - def self.type: () -> :unless_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # The Location of the `unless` keyword. - # - # unless cond then bar end - # ^^^^^^ - # - # bar unless cond - # ^^^^^^ - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # predicate -> Node - # - # The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # unless cond then bar end - # ^^^^ - # - # bar unless cond - # ^^^^ - # -- - # : () -> Prism::node - def predicate: () -> Prism::node - - # :category: Locations - # :call-seq: - # then_keyword_loc -> Location | nil - # - # The Location of the `then` keyword, if present. - # - # unless cond then bar end - # ^^^^ - # -- - # : () -> Location? - def then_keyword_loc: () -> Location? - - # :category: Repository - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_then_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # statements -> StatementsNode | nil - # - # The body of statements that will executed if the unless condition is - # falsey. Will be `nil` if no body is provided. - # - # unless cond then bar end - # ^^^ - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # else_clause -> ElseNode | nil - # - # The else clause of the unless expression, if present. - # - # unless cond then bar else baz end - # ^^^^^^^^^^^^ - # -- - # : () -> ElseNode? - def else_clause: () -> ElseNode? - - # :category: Locations - # :call-seq: - # end_keyword_loc -> Location | nil - # - # The Location of the `end` keyword, if present. - # - # unless cond then bar end - # ^^^ - # -- - # : () -> Location? - def end_keyword_loc: () -> Location? - - # :category: Repository - # Save the end_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_end_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # then_keyword -> String | nil - # - # Slice the location of then_keyword_loc from the source. - # -- - # : () -> String? - def then_keyword: () -> String? - - # :call-seq: - # end_keyword -> String | nil - # - # Slice the location of end_keyword_loc from the source. - # -- - # : () -> String? - def end_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `until` keyword, either in the block form or the modifier form. - # - # bar until foo - # ^^^^^^^^^^^^^ - # - # until foo do bar end - # ^^^^^^^^^^^^^^^^^^^^ - class UntilNode < Node - @statements: StatementsNode? - - @predicate: Prism::node - - @closing_loc: Location? - - @do_keyword_loc: Location? - - @keyword_loc: Location - - # Initialize a new UntilNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> UntilNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :until_node - def type: () -> :until_node - - # See `Node.type`. - # -- - # : () -> :until_node - def self.type: () -> :until_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a loop after a begin statement, so the body is executed first before the condition - # -- - # : () -> bool - def begin_modifier?: () -> bool - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # do_keyword_loc -> Location | nil - # - # Returns the Location represented by `do_keyword_loc`. - # -- - # : () -> Location? - def do_keyword_loc: () -> Location? - - # :category: Repository - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_do_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # predicate -> Node - # - # Returns the `predicate` attribute. - # -- - # : () -> Prism::node - def predicate: () -> Prism::node - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # do_keyword -> String | nil - # - # Slice the location of do_keyword_loc from the source. - # -- - # : () -> String? - def do_keyword: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `when` keyword within a case statement. - # - # case true - # when true - # ^^^^^^^^^ - # end - class WhenNode < Node - @statements: StatementsNode? - - @then_keyword_loc: Location? - - @conditions: Array[Prism::node] - - @keyword_loc: Location - - # Initialize a new WhenNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> WhenNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :when_node - def type: () -> :when_node - - # See `Node.type`. - # -- - # : () -> :when_node - def self.type: () -> :when_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # conditions -> Array[Node] - # - # Returns the `conditions` attribute. - # -- - # : () -> Array[Prism::node] - def conditions: () -> Array[Prism::node] - - # :category: Locations - # :call-seq: - # then_keyword_loc -> Location | nil - # - # Returns the Location represented by `then_keyword_loc`. - # -- - # : () -> Location? - def then_keyword_loc: () -> Location? - - # :category: Repository - # Save the then_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_then_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # then_keyword -> String | nil - # - # Slice the location of then_keyword_loc from the source. - # -- - # : () -> String? - def then_keyword: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `while` keyword, either in the block form or the modifier form. - # - # bar while foo - # ^^^^^^^^^^^^^ - # - # while foo do bar end - # ^^^^^^^^^^^^^^^^^^^^ - class WhileNode < Node - @statements: StatementsNode? - - @predicate: Prism::node - - @closing_loc: Location? - - @do_keyword_loc: Location? - - @keyword_loc: Location - - # Initialize a new WhileNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> WhileNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :while_node - def type: () -> :while_node - - # See `Node.type`. - # -- - # : () -> :while_node - def self.type: () -> :while_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # a loop after a begin statement, so the body is executed first before the condition - # -- - # : () -> bool - def begin_modifier?: () -> bool - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # do_keyword_loc -> Location | nil - # - # Returns the Location represented by `do_keyword_loc`. - # -- - # : () -> Location? - def do_keyword_loc: () -> Location? - - # :category: Repository - # Save the do_keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_do_keyword_loc: (_Repository repository) -> Relocation::Entry? - - # :category: Locations - # :call-seq: - # closing_loc -> Location | nil - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location? - def closing_loc: () -> Location? - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_closing_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # predicate -> Node - # - # Returns the `predicate` attribute. - # -- - # : () -> Prism::node - def predicate: () -> Prism::node - - # :call-seq: - # statements -> StatementsNode | nil - # - # Returns the `statements` attribute. - # -- - # : () -> StatementsNode? - def statements: () -> StatementsNode? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # do_keyword -> String | nil - # - # Slice the location of do_keyword_loc from the source. - # -- - # : () -> String? - def do_keyword: () -> String? - - # :call-seq: - # closing -> String | nil - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String? - def closing: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents an xstring literal with no interpolation. - # - # `foo` - # ^^^^^ - class XStringNode < Node - @unescaped: String - - @closing_loc: Location - - @content_loc: Location - - @opening_loc: Location - - # Initialize a new XStringNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> XStringNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :x_string_node - def type: () -> :x_string_node - - # See `Node.type`. - # -- - # : () -> :x_string_node - def self.type: () -> :x_string_node - - # : () -> String - def inspect: () -> String - - # :category: Flags - # internal bytes forced the encoding to UTF-8 - # -- - # : () -> bool - def forced_utf8_encoding?: () -> bool - - # :category: Flags - # internal bytes forced the encoding to binary - # -- - # : () -> bool - def forced_binary_encoding?: () -> bool - - # :category: Locations - # :call-seq: - # opening_loc -> Location - # - # Returns the Location represented by `opening_loc`. - # -- - # : () -> Location - def opening_loc: () -> Location - - # :category: Repository - # Save the opening_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_opening_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # content_loc -> Location - # - # Returns the Location represented by `content_loc`. - # -- - # : () -> Location - def content_loc: () -> Location - - # :category: Repository - # Save the content_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_content_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # closing_loc -> Location - # - # Returns the Location represented by `closing_loc`. - # -- - # : () -> Location - def closing_loc: () -> Location - - # :category: Repository - # Save the closing_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_closing_loc: (_Repository repository) -> Relocation::Entry - - # :call-seq: - # unescaped -> String - # - # Returns the `unescaped` attribute. - # -- - # : () -> String - def unescaped: () -> String - - # :call-seq: - # opening -> String - # - # Slice the location of opening_loc from the source. - # -- - # : () -> String - def opening: () -> String - - # :call-seq: - # content -> String - # - # Slice the location of content_loc from the source. - # -- - # : () -> String - def content: () -> String - - # :call-seq: - # closing -> String - # - # Slice the location of closing_loc from the source. - # -- - # : () -> String - def closing: () -> String - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Represents the use of the `yield` keyword. - # - # yield 1 - # ^^^^^^^ - class YieldNode < Node - @rparen_loc: Location? - - @arguments: ArgumentsNode? - - @lparen_loc: Location? - - @keyword_loc: Location - - # Initialize a new YieldNode node. - # -- - # : (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc) -> void - def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc) -> void - - # See Node.accept. - # -- - # : (_Visitor visitor) -> untyped - def accept: (_Visitor visitor) -> untyped - - # See Node.child_nodes. - # -- - # : () -> Array[node?] - def child_nodes: () -> Array[node?] - - # See Node.each_child_node. - # -- - # : () -> Enumerator[node, void] - # : () { (node) -> void } -> void - def each_child_node: () -> Enumerator[node, void] - | () { (node) -> void } -> void - - # See Node.compact_child_nodes. - # -- - # : () -> Array[node] - def compact_child_nodes: () -> Array[node] - - # See Node.comment_targets. - # -- - # : () -> Array[node | Location] - def comment_targets: () -> Array[node | Location] - - # :call-seq: - # copy(**fields) -> YieldNode - # - # Creates a copy of self with the given fields, using self as the template. - # -- - # : (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode - def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode - - alias deconstruct child_nodes - - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # See `Node#type`. - # -- - # : () -> :yield_node - def type: () -> :yield_node - - # See `Node.type`. - # -- - # : () -> :yield_node - def self.type: () -> :yield_node - - # : () -> String - def inspect: () -> String - - # :category: Locations - # :call-seq: - # keyword_loc -> Location - # - # Returns the Location represented by `keyword_loc`. - # -- - # : () -> Location - def keyword_loc: () -> Location - - # :category: Repository - # Save the keyword_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry - def save_keyword_loc: (_Repository repository) -> Relocation::Entry - - # :category: Locations - # :call-seq: - # lparen_loc -> Location | nil - # - # Returns the Location represented by `lparen_loc`. - # -- - # : () -> Location? - def lparen_loc: () -> Location? - - # :category: Repository - # Save the lparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_lparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # arguments -> ArgumentsNode | nil - # - # Returns the `arguments` attribute. - # -- - # : () -> ArgumentsNode? - def arguments: () -> ArgumentsNode? - - # :category: Locations - # :call-seq: - # rparen_loc -> Location | nil - # - # Returns the Location represented by `rparen_loc`. - # -- - # : () -> Location? - def rparen_loc: () -> Location? - - # :category: Repository - # Save the rparen_loc location using the given saved source so that - # it can be retrieved later. - # -- - # : (_Repository repository) -> Relocation::Entry? - def save_rparen_loc: (_Repository repository) -> Relocation::Entry? - - # :call-seq: - # keyword -> String - # - # Slice the location of keyword_loc from the source. - # -- - # : () -> String - def keyword: () -> String - - # :call-seq: - # lparen -> String | nil - # - # Slice the location of lparen_loc from the source. - # -- - # : () -> String? - def lparen: () -> String? - - # :call-seq: - # rparen -> String | nil - # - # Slice the location of rparen_loc from the source. - # -- - # : () -> String? - def rparen: () -> String? - - # : (untyped other) -> boolish - def ===: (untyped other) -> boolish - end - - # Flags for arguments nodes. - module ArgumentsNodeFlags - # if the arguments contain forwarding - CONTAINS_FORWARDING: untyped - - # if the arguments contain keywords - CONTAINS_KEYWORDS: untyped - - # if the arguments contain a keyword splat - CONTAINS_KEYWORD_SPLAT: untyped - - # if the arguments contain a splat - CONTAINS_SPLAT: untyped - - # if the arguments contain multiple splats - CONTAINS_MULTIPLE_SPLATS: untyped - end - - # Flags for array nodes. - module ArrayNodeFlags - # if array contains splat nodes - CONTAINS_SPLAT: untyped - end - - # Flags for call nodes. - module CallNodeFlags - # &. operator - SAFE_NAVIGATION: untyped - - # a call that could have been a local variable - VARIABLE_CALL: untyped - - # a call that is an attribute write, so the value being written should be returned - ATTRIBUTE_WRITE: untyped - - # a call that ignores method visibility - IGNORE_VISIBILITY: untyped - end - - # Flags for nodes that have unescaped content. - module EncodingFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING: untyped - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING: untyped - end - - # Flags for integer nodes that correspond to the base of the integer. - module IntegerBaseFlags - # 0b prefix - BINARY: untyped - - # 0d or no prefix - DECIMAL: untyped - - # 0o or 0 prefix - OCTAL: untyped - - # 0x prefix - HEXADECIMAL: untyped - end - - # Flags for interpolated string nodes that indicated mutability if they are also marked as literals. - module InterpolatedStringNodeFlags - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - FROZEN: untyped - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'` - MUTABLE: untyped - end - - # Flags for keyword hash nodes. - module KeywordHashNodeFlags - # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments - SYMBOL_KEYS: untyped - end - - # Flags for while and until loop nodes. - module LoopFlags - # a loop after a begin statement, so the body is executed first before the condition - BEGIN_MODIFIER: untyped - end - - # Flags for parameter nodes. - module ParameterFlags - # a parameter name that has been repeated in the method signature - REPEATED_PARAMETER: untyped - end - - # Flags for parentheses nodes. - module ParenthesesNodeFlags - # parentheses that contain multiple potentially void statements - MULTIPLE_STATEMENTS: untyped - end - - # Flags for range and flip-flop nodes. - module RangeFlags - # ... operator - EXCLUDE_END: untyped - end - - # Flags for regular expression and match last line nodes. - module RegularExpressionFlags - # i - ignores the case of characters when matching - IGNORE_CASE: untyped - - # x - ignores whitespace and allows comments in regular expressions - EXTENDED: untyped - - # m - allows $ to match the end of lines within strings - MULTI_LINE: untyped - - # o - only interpolates values into the regular expression once - ONCE: untyped - - # e - forces the EUC-JP encoding - EUC_JP: untyped - - # n - forces the ASCII-8BIT encoding - ASCII_8BIT: untyped - - # s - forces the Windows-31J encoding - WINDOWS_31J: untyped - - # u - forces the UTF-8 encoding - UTF_8: untyped - - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING: untyped - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING: untyped - - # internal bytes forced the encoding to US-ASCII - FORCED_US_ASCII_ENCODING: untyped - end - - # Flags for shareable constant nodes. - module ShareableConstantNodeFlags - # constant writes that should be modified with shareable constant value literal - LITERAL: untyped - - # constant writes that should be modified with shareable constant value experimental everything - EXPERIMENTAL_EVERYTHING: untyped - - # constant writes that should be modified with shareable constant value experimental copy - EXPERIMENTAL_COPY: untyped - end - - # Flags for string nodes. - module StringFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING: untyped - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING: untyped - - # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal` - FROZEN: untyped - - # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal` - MUTABLE: untyped - end - - # Flags for symbol nodes. - module SymbolFlags - # internal bytes forced the encoding to UTF-8 - FORCED_UTF8_ENCODING: untyped - - # internal bytes forced the encoding to binary - FORCED_BINARY_ENCODING: untyped - - # internal bytes forced the encoding to US-ASCII - FORCED_US_ASCII_ENCODING: untyped - end - - # The flags that are common to all nodes. - module NodeFlags - # A flag to indicate that the node is a candidate to emit a :line event - # through tracepoint when compiled. - NEWLINE: ::Integer - - # A flag to indicate that the value that the node represents is a value that - # can be determined at parse-time. - STATIC_LITERAL: ::Integer - end -end diff --git a/sig/generated/prism/node_ext.rbs b/sig/generated/prism/node_ext.rbs deleted file mode 100644 index 273e591eb8..0000000000 --- a/sig/generated/prism/node_ext.rbs +++ /dev/null @@ -1,387 +0,0 @@ -# Generated from lib/prism/node_ext.rb with RBS::Inline - -# -- -# Here we are reopening the prism module to provide methods on nodes that aren't -# templated and are meant as convenience methods. -# ++ -module Prism - class Node - # : (*String replacements) -> void - def deprecated: (*String replacements) -> void - end - - module RegularExpressionOptions - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # -- - # : (Integer flags) -> Integer - def self.options: (Integer flags) -> Integer - end - - class InterpolatedMatchLastLineNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # -- - # : () -> Integer - def options: () -> Integer - end - - class InterpolatedRegularExpressionNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # -- - # : () -> Integer - def options: () -> Integer - end - - class MatchLastLineNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # -- - # : () -> Integer - def options: () -> Integer - end - - class RegularExpressionNode < Node - # Returns a numeric value that represents the flags that were used to create - # the regular expression. - # -- - # : () -> Integer - def options: () -> Integer - end - - module HeredocQuery - # Returns true if this node was represented as a heredoc in the source code. - # -- - # : (String? opening) -> bool? - def self.heredoc?: (String? opening) -> bool? - end - - class InterpolatedStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - # -- - # : () -> bool? - def heredoc?: () -> bool? - end - - class InterpolatedXStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - # -- - # : () -> bool? - def heredoc?: () -> bool? - end - - class StringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - # -- - # : () -> bool? - def heredoc?: () -> bool? - - # Occasionally it's helpful to treat a string as if it were interpolated so - # that there's a consistent interface for working with strings. - # -- - # : () -> InterpolatedStringNode - def to_interpolated: () -> InterpolatedStringNode - end - - class XStringNode < Node - # Returns true if this node was represented as a heredoc in the source code. - # -- - # : () -> bool? - def heredoc?: () -> bool? - - # Occasionally it's helpful to treat a string as if it were interpolated so - # that there's a consistent interface for working with strings. - # -- - # : () -> InterpolatedXStringNode - def to_interpolated: () -> InterpolatedXStringNode - end - - class ImaginaryNode < Node - # Returns the value of the node as a Ruby Complex. - # -- - # : () -> Complex - def value: () -> Complex - end - - class RationalNode < Node - # Returns the value of the node as a Ruby Rational. - # -- - # : () -> Rational - def value: () -> Rational - - # Returns the value of the node as an IntegerNode or a FloatNode. This - # method is deprecated in favor of #value or #numerator/#denominator. - # -- - # : () -> (IntegerNode | FloatNode) - def numeric: () -> (IntegerNode | FloatNode) - end - - class ConstantReadNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - # -- - # : () -> Array[Symbol] - def full_name_parts: () -> Array[Symbol] - - # Returns the full name of this constant. For example: "Foo" - # -- - # : () -> String - def full_name: () -> String - end - - class ConstantWriteNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - # -- - # : () -> Array[Symbol] - def full_name_parts: () -> Array[Symbol] - - # Returns the full name of this constant. For example: "Foo" - # -- - # : () -> String - def full_name: () -> String - end - - class ConstantPathNode < Node - # An error class raised when dynamic parts are found while computing a - # constant path's full name. For example: - # Foo::Bar::Baz -> does not raise because all parts of the constant path are - # simple constants - # var::Bar::Baz -> raises because the first part of the constant path is a - # local variable - class DynamicPartsInConstantPathError < StandardError - end - - # An error class raised when missing nodes are found while computing a - # constant path's full name. For example: - # Foo:: -> raises because the constant path is missing the last part - class MissingNodesInConstantPathError < StandardError - end - - # Returns the list of parts for the full name of this constant path. - # For example: [:Foo, :Bar] - # -- - # : () -> Array[Symbol] - def full_name_parts: () -> Array[Symbol] - - # Returns the full name of this constant path. For example: "Foo::Bar" - # -- - # : () -> String - def full_name: () -> String - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - # -- - # : () -> (ConstantReadNode | MissingNode) - def child: () -> (ConstantReadNode | MissingNode) - end - - class ConstantPathTargetNode < Node - # Returns the list of parts for the full name of this constant path. - # For example: [:Foo, :Bar] - # -- - # : () -> Array[Symbol] - def full_name_parts: () -> Array[Symbol] - - # Returns the full name of this constant path. For example: "Foo::Bar" - # -- - # : () -> String - def full_name: () -> String - - # Previously, we had a child node on this class that contained either a - # constant read or a missing node. To not cause a breaking change, we - # continue to supply that API. - # -- - # : () -> (ConstantReadNode | MissingNode) - def child: () -> (ConstantReadNode | MissingNode) - end - - class ConstantTargetNode < Node - # Returns the list of parts for the full name of this constant. - # For example: [:Foo] - # -- - # : () -> Array[Symbol] - def full_name_parts: () -> Array[Symbol] - - # Returns the full name of this constant. For example: "Foo" - # -- - # : () -> String - def full_name: () -> String - end - - class ParametersNode < Node - # Mirrors the Method#parameters method. - # -- - # : () -> Array[[Symbol, Symbol] | [Symbol]] - def signature: () -> Array[[ Symbol, Symbol ] | [ Symbol ]] - end - - class CallNode < Node - # When a call node has the attribute_write flag set, it means that the call - # is using the attribute write syntax. This is either a method call to []= - # or a method call to a method that ends with =. Either way, the = sign is - # present in the source. - # - # Prism returns the message_loc _without_ the = sign attached, because there - # can be any amount of space between the message and the = sign. However, - # sometimes you want the location of the full message including the inner - # space and the = sign. This method provides that. - # -- - # : () -> Location? - def full_message_loc: () -> Location? - end - - class CallOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ClassVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ConstantOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class ConstantPathOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class GlobalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class IndexOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class InstanceVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class LocalVariableOperatorWriteNode < Node - # Returns the binary operator used to modify the receiver. This method is - # deprecated in favor of #binary_operator. - # -- - # : () -> Symbol - def operator: () -> Symbol - - # Returns the location of the binary operator used to modify the receiver. - # This method is deprecated in favor of #binary_operator_loc. - # -- - # : () -> Location - def operator_loc: () -> Location - end - - class CaseMatchNode < Node - # Returns the else clause of the case match node. This method is deprecated - # in favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end - - class CaseNode < Node - # Returns the else clause of the case node. This method is deprecated in - # favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end - - class IfNode < Node - # Returns the subsequent if/elsif/else clause of the if node. This method is - # deprecated in favor of #subsequent. - # -- - # : () -> (IfNode | ElseNode)? - def consequent: () -> (IfNode | ElseNode)? - end - - class RescueNode < Node - # Returns the subsequent rescue clause of the rescue node. This method is - # deprecated in favor of #subsequent. - # -- - # : () -> RescueNode? - def consequent: () -> RescueNode? - end - - class UnlessNode < Node - # Returns the else clause of the unless node. This method is deprecated in - # favor of #else_clause. - # -- - # : () -> ElseNode? - def consequent: () -> ElseNode? - end -end diff --git a/sig/generated/prism/parse_result.rbs b/sig/generated/prism/parse_result.rbs deleted file mode 100644 index dc56214867..0000000000 --- a/sig/generated/prism/parse_result.rbs +++ /dev/null @@ -1,851 +0,0 @@ -# Generated from lib/prism/parse_result.rb with RBS::Inline - -module Prism - # An internal interface for a cache that can be used to compute code - # units from byte offsets. - interface _CodeUnitsCache - def []: (Integer byte_offset) -> Integer - end - - # This represents a source of Ruby code that has been parsed. It is used in - # conjunction with locations to allow them to resolve line numbers and source - # ranges. - class Source - # Create a new source object with the given source code. This method should - # be used instead of `new` and it will return either a `Source` or a - # specialized and more performant `ASCIISource` if no multibyte characters - # are present in the source code. - # - # Note that if you are calling this method manually, you will need to supply - # the start_line and offsets parameters. start_line is the line number that - # the source starts on, which is typically 1 but can be different if this - # source is a subset of a larger source or if this is an eval. offsets is an - # array of byte offsets for the start of each line in the source code, which - # can be calculated by iterating through the source code and recording the - # byte offset whenever a newline character is encountered. - # -- - # : (String source, Integer start_line, Array[Integer] offsets) -> Source - def self.for: (String source, Integer start_line, Array[Integer] offsets) -> Source - - # The source code that this source object represents. - attr_reader source: String - - # The line number where this source starts. - attr_reader start_line: Integer - - # The list of newline byte offsets in the source code. - attr_reader offsets: Array[Integer] - - # Create a new source object with the given source code. - # -- - # : (String source, Integer start_line, Array[Integer] offsets) -> void - def initialize: (String source, Integer start_line, Array[Integer] offsets) -> void - - # Replace the value of start_line with the given value. - # -- - # : (Integer start_line) -> void - def replace_start_line: (Integer start_line) -> void - - # Replace the value of offsets with the given value. - # -- - # : (Array[Integer] offsets) -> void - def replace_offsets: (Array[Integer] offsets) -> void - - # Returns the encoding of the source code, which is set by parameters to the - # parser or by the encoding magic comment. - # -- - # : () -> Encoding - def encoding: () -> Encoding - - # Returns the lines of the source code as an array of strings. - # -- - # : () -> Array[String] - def lines: () -> Array[String] - - # Perform a byteslice on the source code using the given byte offset and - # byte length. - # -- - # : (Integer byte_offset, Integer length) -> String - def slice: (Integer byte_offset, Integer length) -> String - - # Converts the line number and column in bytes to a byte offset. - # -- - # : (Integer line, Integer column) -> Integer - def byte_offset: (Integer line, Integer column) -> Integer - - # Binary search through the offsets to find the line number for the given - # byte offset. - # -- - # : (Integer byte_offset) -> Integer - def line: (Integer byte_offset) -> Integer - - # Return the byte offset of the start of the line corresponding to the given - # byte offset. - # -- - # : (Integer byte_offset) -> Integer - def line_start: (Integer byte_offset) -> Integer - - # Returns the byte offset of the end of the line corresponding to the given - # byte offset. - # -- - # : (Integer byte_offset) -> Integer - def line_end: (Integer byte_offset) -> Integer - - # Return the column in bytes for the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def column: (Integer byte_offset) -> Integer - - # Return the character offset for the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def character_offset: (Integer byte_offset) -> Integer - - # Return the column in characters for the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def character_column: (Integer byte_offset) -> Integer - - # Returns the offset from the start of the file for the given byte offset - # counting in code units for the given encoding. - # - # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the - # concept of code units that differs from the number of characters in other - # encodings, it is not captured here. - # - # We purposefully replace invalid and undefined characters with replacement - # characters in this conversion. This happens for two reasons. First, it's - # possible that the given byte offset will not occur on a character - # boundary. Second, it's possible that the source code will contain a - # character that has no equivalent in the given encoding. - # -- - # : (Integer byte_offset, Encoding encoding) -> Integer - def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer - - # Generate a cache that targets a specific encoding for calculating code - # unit offsets. - # -- - # : (Encoding encoding) -> CodeUnitsCache - def code_units_cache: (Encoding encoding) -> CodeUnitsCache - - # Returns the column in code units for the given encoding for the - # given byte offset. - # -- - # : (Integer byte_offset, Encoding encoding) -> Integer - def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer - - # Freeze this object and the objects it contains. - # -- - # : () -> void - def deep_freeze: () -> void - - private - - # Binary search through the offsets to find the line number for the given - # byte offset. - # -- - # : (Integer byte_offset) -> Integer - def find_line: (Integer byte_offset) -> Integer - end - - # A cache that can be used to quickly compute code unit offsets from byte - # offsets. It purposefully provides only a single #[] method to access the - # cache in order to minimize surface area. - # - # Note that there are some known issues here that may or may not be addressed - # in the future: - # - # * The first is that there are issues when the cache computes values that are - # not on character boundaries. This can result in subsequent computations - # being off by one or more code units. - # * The second is that this cache is currently unbounded. In theory we could - # introduce some kind of LRU cache to limit the number of entries, but this - # has not yet been implemented. - class CodeUnitsCache - class UTF16Counter - @source: String - - @encoding: Encoding - - # : (String source, Encoding encoding) -> void - def initialize: (String source, Encoding encoding) -> void - - # : (Integer byte_offset, Integer byte_length) -> Integer - def count: (Integer byte_offset, Integer byte_length) -> Integer - end - - class LengthCounter - @source: String - - @encoding: Encoding - - # : (String source, Encoding encoding) -> void - def initialize: (String source, Encoding encoding) -> void - - # : (Integer byte_offset, Integer byte_length) -> Integer - def count: (Integer byte_offset, Integer byte_length) -> Integer - end - - @source: String - - @counter: UTF16Counter | LengthCounter - - @cache: Hash[Integer, Integer] - - @offsets: Array[Integer] - - # Initialize a new cache with the given source and encoding. - # -- - # : (String source, Encoding encoding) -> void - def initialize: (String source, Encoding encoding) -> void - - # Retrieve the code units offset from the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def []: (Integer byte_offset) -> Integer - end - - # Specialized version of Prism::Source for source code that includes ASCII - # characters only. This class is used to apply performance optimizations that - # cannot be applied to sources that include multibyte characters. - # - # In the extremely rare case that a source includes multi-byte characters but - # is marked as binary because of a magic encoding comment and it cannot be - # eagerly converted to UTF-8, this class will be used as well. This is because - # at that point we will treat everything as single-byte characters. - class ASCIISource < Source - # Return the character offset for the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def character_offset: (Integer byte_offset) -> Integer - - # Return the column in characters for the given byte offset. - # -- - # : (Integer byte_offset) -> Integer - def character_column: (Integer byte_offset) -> Integer - - # Returns the offset from the start of the file for the given byte offset - # counting in code units for the given encoding. - # - # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the - # concept of code units that differs from the number of characters in other - # encodings, it is not captured here. - # -- - # : (Integer byte_offset, Encoding encoding) -> Integer - def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer - - # Returns a cache that is the identity function in order to maintain the - # same interface. We can do this because code units are always equivalent to - # byte offsets for ASCII-only sources. - # -- - # : (Encoding encoding) -> _CodeUnitsCache - def code_units_cache: (Encoding encoding) -> _CodeUnitsCache - - # Specialized version of `code_units_column` that does not depend on - # `code_units_offset`, which is a more expensive operation. This is - # essentially the same as `Prism::Source#column`. - # -- - # : (Integer byte_offset, Encoding encoding) -> Integer - def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer - end - - # This represents a location in the source. - class Location - # A Source object that is used to determine more information from the given - # offset and length. - attr_reader source: Source - - # The byte offset from the beginning of the source where this location - # starts. - attr_reader start_offset: Integer - - # The length of this location in bytes. - attr_reader length: Integer - - @trailing_comments: Array[Comment]? - - @leading_comments: Array[Comment]? - - # Create a new location object with the given source, start byte offset, and - # byte length. - # -- - # : (Source source, Integer start_offset, Integer length) -> void - def initialize: (Source source, Integer start_offset, Integer length) -> void - - # These are the comments that are associated with this location that exist - # before the start of this location. - # -- - # : () -> Array[Comment] - def leading_comments: () -> Array[Comment] - - # Attach a comment to the leading comments of this location. - # -- - # : (Comment comment) -> void - def leading_comment: (Comment comment) -> void - - # These are the comments that are associated with this location that exist - # after the end of this location. - # -- - # : () -> Array[Comment] - def trailing_comments: () -> Array[Comment] - - # Attach a comment to the trailing comments of this location. - # -- - # : (Comment comment) -> void - def trailing_comment: (Comment comment) -> void - - # Returns all comments that are associated with this location (both leading - # and trailing comments). - # -- - # : () -> Array[Comment] - def comments: () -> Array[Comment] - - # Create a new location object with the given options. - # -- - # : (?source: Source, ?start_offset: Integer, ?length: Integer) -> Location - def copy: (?source: Source, ?start_offset: Integer, ?length: Integer) -> Location - - # Returns a new location that is the result of chopping off the last byte. - # -- - # : () -> Location - def chop: () -> Location - - # Returns a string representation of this location. - # -- - # : () -> String - def inspect: () -> String - - # Returns all of the lines of the source code associated with this location. - # -- - # : () -> Array[String] - def source_lines: () -> Array[String] - - # The source code that this location represents. - # -- - # : () -> String - def slice: () -> String - - # The source code that this location represents starting from the beginning - # of the line that this location starts on to the end of the line that this - # location ends on. - # -- - # : () -> String - def slice_lines: () -> String - - # The character offset from the beginning of the source where this location - # starts. - # -- - # : () -> Integer - def start_character_offset: () -> Integer - - # The offset from the start of the file in code units of the given encoding. - # -- - # : (Encoding encoding) -> Integer - def start_code_units_offset: (Encoding encoding) -> Integer - - # The start offset from the start of the file in code units using the given - # cache to fetch or calculate the value. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_start_code_units_offset: (_CodeUnitsCache cache) -> Integer - - # The byte offset from the beginning of the source where this location ends. - # -- - # : () -> Integer - def end_offset: () -> Integer - - # The character offset from the beginning of the source where this location - # ends. - # -- - # : () -> Integer - def end_character_offset: () -> Integer - - # The offset from the start of the file in code units of the given encoding. - # -- - # : (Encoding encoding) -> Integer - def end_code_units_offset: (Encoding encoding) -> Integer - - # The end offset from the start of the file in code units using the given - # cache to fetch or calculate the value. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_end_code_units_offset: (_CodeUnitsCache cache) -> Integer - - # The line number where this location starts. - # -- - # : () -> Integer - def start_line: () -> Integer - - # The content of the line where this location starts before this location. - # -- - # : () -> String - def start_line_slice: () -> String - - # The line number where this location ends. - # -- - # : () -> Integer - def end_line: () -> Integer - - # The column in bytes where this location starts from the start of - # the line. - # -- - # : () -> Integer - def start_column: () -> Integer - - # The column in characters where this location ends from the start of - # the line. - # -- - # : () -> Integer - def start_character_column: () -> Integer - - # The column in code units of the given encoding where this location - # starts from the start of the line. - # -- - # : (?Encoding encoding) -> Integer - def start_code_units_column: (?Encoding encoding) -> Integer - - # The start column in code units using the given cache to fetch or calculate - # the value. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_start_code_units_column: (_CodeUnitsCache cache) -> Integer - - # The column in bytes where this location ends from the start of the - # line. - # -- - # : () -> Integer - def end_column: () -> Integer - - # The column in characters where this location ends from the start of - # the line. - # -- - # : () -> Integer - def end_character_column: () -> Integer - - # The column in code units of the given encoding where this location - # ends from the start of the line. - # -- - # : (?Encoding encoding) -> Integer - def end_code_units_column: (?Encoding encoding) -> Integer - - # The end column in code units using the given cache to fetch or calculate - # the value. - # -- - # : (_CodeUnitsCache cache) -> Integer - def cached_end_code_units_column: (_CodeUnitsCache cache) -> Integer - - # Implement the hash pattern matching interface for Location. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Implement the pretty print interface for Location. - # -- - # : (PP q) -> void - def pretty_print: (PP q) -> void - - # Returns true if the given other location is equal to this location. - # -- - # : (untyped other) -> bool - def ==: (untyped other) -> bool - - # Returns a new location that stretches from this location to the given - # other location. Raises an error if this location is not before the other - # location or if they don't share the same source. - # -- - # : (Location other) -> Location - def join: (Location other) -> Location - - # Join this location with the first occurrence of the string in the source - # that occurs after this location on the same line, and return the new - # location. This will raise an error if the string does not exist. - # -- - # : (String string) -> Location - def adjoin: (String string) -> Location - end - - # This represents a comment that was encountered during parsing. It is the - # base class for all comment types. - class Comment - # The Location of this comment in the source. - attr_reader location: Location - - # Create a new comment object with the given location. - # -- - # : (Location location) -> void - def initialize: (Location location) -> void - - # Implement the hash pattern matching interface for Comment. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Returns the content of the comment by slicing it from the source code. - # -- - # : () -> String - def slice: () -> String - - # Returns true if this comment happens on the same line as other code and - # false if the comment is by itself. This can only be true for inline - # comments and should be false for block comments. - # -- - # : () -> bool - def trailing?: () -> bool - end - - # InlineComment objects are the most common. They correspond to comments in - # the source file like this one that start with #. - class InlineComment < Comment - # Returns true if this comment happens on the same line as other code and - # false if the comment is by itself. - # -- - # : () -> bool - def trailing?: () -> bool - - # Returns a string representation of this comment. - # -- - # : () -> String - def inspect: () -> String - end - - # EmbDocComment objects correspond to comments that are surrounded by =begin - # and =end. - class EmbDocComment < Comment - # Returns false. This can only be true for inline comments. - # -- - # : () -> bool - def trailing?: () -> bool - - # Returns a string representation of this comment. - # -- - # : () -> String - def inspect: () -> String - end - - # This represents a magic comment that was encountered during parsing. - class MagicComment - # A Location object representing the location of the key in the source. - attr_reader key_loc: Location - - # A Location object representing the location of the value in the source. - attr_reader value_loc: Location - - # Create a new magic comment object with the given key and value locations. - # -- - # : (Location key_loc, Location value_loc) -> void - def initialize: (Location key_loc, Location value_loc) -> void - - # Returns the key of the magic comment by slicing it from the source code. - # -- - # : () -> String - def key: () -> String - - # Returns the value of the magic comment by slicing it from the source code. - # -- - # : () -> String - def value: () -> String - - # Implement the hash pattern matching interface for MagicComment. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Returns a string representation of this magic comment. - # -- - # : () -> String - def inspect: () -> String - end - - # This represents an error that was encountered during parsing. - class ParseError - # The type of error. This is an _internal_ symbol that is used for - # communicating with translation layers. It is not meant to be public API. - attr_reader type: Symbol - - # The message associated with this error. - attr_reader message: String - - # A Location object representing the location of this error in the source. - attr_reader location: Location - - # The level of this error. - attr_reader level: Symbol - - # Create a new error object with the given message and location. - # -- - # : (Symbol type, String message, Location location, Symbol level) -> void - def initialize: (Symbol type, String message, Location location, Symbol level) -> void - - # Implement the hash pattern matching interface for ParseError. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Returns a string representation of this error. - # -- - # : () -> String - def inspect: () -> String - end - - # This represents a warning that was encountered during parsing. - class ParseWarning - # The type of warning. This is an _internal_ symbol that is used for - # communicating with translation layers. It is not meant to be public API. - attr_reader type: Symbol - - # The message associated with this warning. - attr_reader message: String - - # A Location object representing the location of this warning in the source. - attr_reader location: Location - - # The level of this warning. - attr_reader level: Symbol - - # Create a new warning object with the given message and location. - # -- - # : (Symbol type, String message, Location location, Symbol level) -> void - def initialize: (Symbol type, String message, Location location, Symbol level) -> void - - # Implement the hash pattern matching interface for ParseWarning. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Returns a string representation of this warning. - # -- - # : () -> String - def inspect: () -> String - end - - # This represents the result of a call to Prism.parse or Prism.parse_file. - # It contains the requested structure, any comments that were encounters, - # and any errors that were encountered. - class Result - # The list of comments that were encountered during parsing. - attr_reader comments: Array[Comment] - - # The list of magic comments that were encountered during parsing. - attr_reader magic_comments: Array[MagicComment] - - # An optional location that represents the location of the __END__ marker - # and the rest of the content of the file. This content is loaded into the - # DATA constant when the file being parsed is the main file being executed. - attr_reader data_loc: Location? - - # The list of errors that were generated during parsing. - attr_reader errors: Array[ParseError] - - # The list of warnings that were generated during parsing. - attr_reader warnings: Array[ParseWarning] - - # A Source instance that represents the source code that was parsed. - attr_reader source: Source - - # Create a new result object with the given values. - # -- - # : (Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - def initialize: (Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - - # Implement the hash pattern matching interface for Result. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Returns the encoding of the source code that was parsed. - # -- - # : () -> Encoding - def encoding: () -> Encoding - - # Returns true if there were no errors during parsing and false if there - # were. - # -- - # : () -> bool - def success?: () -> bool - - # Returns true if there were errors during parsing and false if there were - # not. - # -- - # : () -> bool - def failure?: () -> bool - - # Returns true if the parsed source is an incomplete expression that could - # become valid with additional input. This is useful for REPL contexts (such - # as IRB) where the user may be entering a multi-line expression one line at - # a time and the implementation needs to determine whether to wait for more - # input or to evaluate what has been entered so far. - # - # Concretely, this returns true when every error present is caused by the - # parser reaching the end of the input before a construct was closed (e.g. - # an unclosed string, array, block, or keyword), and returns false when any - # error is caused by a token that makes the input structurally invalid - # regardless of what might follow (e.g. a stray `end`, `]`, or `)` with no - # matching opener). - # - # Examples: - # - # Prism.parse("1 + [").continuable? #=> true (unclosed array) - # Prism.parse("1 + ]").continuable? #=> false (stray ]) - # Prism.parse("tap do").continuable? #=> true (unclosed block) - # Prism.parse("end.tap do").continuable? #=> false (stray end) - # - # -- - # : () -> bool - def continuable?: () -> bool - - # The set of error types whose location the parser places at the opening - # token of an unclosed construct rather than at the end of the source. These - # errors always indicate incomplete input regardless of their byte position, - # so they are checked by type rather than by location. - # -- - # : Array[Symbol] - CONTINUABLE: untyped - - # Create a code units cache for the given encoding. - # -- - # : (Encoding encoding) -> _CodeUnitsCache - def code_units_cache: (Encoding encoding) -> _CodeUnitsCache - end - - # This is a result specific to the `parse` and `parse_file` methods. - class ParseResult < Result - # The syntax tree that was parsed from the source code. - attr_reader value: ProgramNode - - # Create a new parse result object with the given values. - # -- - # : (ProgramNode value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - def initialize: (ProgramNode value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - - # Implement the hash pattern matching interface for ParseResult. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # Attach the list of comments to their respective locations in the tree. - # -- - # : () -> void - def attach_comments!: () -> void - - # Walk the tree and mark nodes that are on a new line, loosely emulating - # the behavior of CRuby's `:line` tracepoint event. - # -- - # : () -> void - def mark_newlines!: () -> void - - # Returns a string representation of the syntax tree with the errors - # displayed inline. - # -- - # : () -> String - def errors_format: () -> String - end - - # This is a result specific to the `lex` and `lex_file` methods. - class LexResult < Result - # The list of tokens that were parsed from the source code. - attr_reader value: Array[[ Token, Integer ]] - - # Create a new lex result object with the given values. - # -- - # : (Array[[Token, Integer]] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - def initialize: (Array[[ Token, Integer ]] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - - # Implement the hash pattern matching interface for LexResult. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - end - - # This is a result specific to the `parse_lex` and `parse_lex_file` methods. - class ParseLexResult < Result - # A tuple of the syntax tree and the list of tokens that were parsed from - # the source code. - attr_reader value: [ ProgramNode, Array[[ Token, Integer ]] ] - - # Create a new parse lex result object with the given values. - # -- - # : ([ProgramNode, Array[[Token, Integer]]] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - def initialize: ([ ProgramNode, Array[[ Token, Integer ]] ] value, Array[Comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void - - # Implement the hash pattern matching interface for ParseLexResult. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - end - - # This represents a token from the Ruby source. - class Token - # The Source object that represents the source this token came from. - attr_reader source: Source - - # The type of token that this token is. - attr_reader type: Symbol - - # A byteslice of the source that this token represents. - attr_reader value: String - - @location: Location | Integer - - # Create a new token object with the given type, value, and location. - # -- - # : (Source source, Symbol type, String value, Location | Integer location) -> void - def initialize: (Source source, Symbol type, String value, Location | Integer location) -> void - - # Implement the hash pattern matching interface for Token. - # -- - # : (Array[Symbol]? keys) -> Hash[Symbol, untyped] - def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped] - - # A Location object representing the location of this token in the source. - # -- - # : () -> Location - def location: () -> Location - - # Implement the pretty print interface for Token. - # -- - # : (PP q) -> void - def pretty_print: (PP q) -> void - - # Returns true if the given other token is equal to this token. - # -- - # : (untyped other) -> bool - def ==: (untyped other) -> bool - - # Returns a string representation of this token. - # -- - # : () -> String - def inspect: () -> String - - # Freeze this object and the objects it contains. - # -- - # : () -> void - def deep_freeze: () -> void - end - - # This object is passed to the various Prism.* methods that accept the - # `scopes` option as an element of the list. It defines both the local - # variables visible at that scope as well as the forwarding parameters - # available at that scope. - class Scope - # The list of local variables that are defined in this scope. This should be - # defined as an array of symbols. - attr_reader locals: Array[Symbol] - - # The list of local variables that are forwarded to the next scope. This - # should by defined as an array of symbols containing the specific values of - # :*, :**, :&, or :"...". - attr_reader forwarding: Array[Symbol] - - # Create a new scope object with the given locals and forwarding. - # -- - # : (Array[Symbol] locals, Array[Symbol] forwarding) -> void - def initialize: (Array[Symbol] locals, Array[Symbol] forwarding) -> void - end - - # Create a new scope with the given locals and forwarding options that is - # suitable for passing into one of the Prism.* methods that accepts the - # `scopes` option. - # -- - # : (?locals: Array[Symbol], ?forwarding: Array[Symbol]) -> Scope - def self.scope: (?locals: Array[Symbol], ?forwarding: Array[Symbol]) -> Scope -end diff --git a/sig/generated/prism/parse_result/comments.rbs b/sig/generated/prism/parse_result/comments.rbs deleted file mode 100644 index 1dc7ae974b..0000000000 --- a/sig/generated/prism/parse_result/comments.rbs +++ /dev/null @@ -1,108 +0,0 @@ -# Generated from lib/prism/parse_result/comments.rb with RBS::Inline - -module Prism - class ParseResult < Result - # When we've parsed the source, we have both the syntax tree and the list of - # comments that we found in the source. This class is responsible for - # walking the tree and finding the nearest location to attach each comment. - # - # It does this by first finding the nearest locations to each comment. - # Locations can either come from nodes directly or from location fields on - # nodes. For example, a `ClassNode` has an overall location encompassing the - # entire class, but it also has a location for the `class` keyword. - # - # Once the nearest locations are found, it determines which one to attach - # to. If it's a trailing comment (a comment on the same line as other source - # code), it will favor attaching to the nearest location that occurs before - # the comment. Otherwise it will favor attaching to the nearest location - # that is after the comment. - class Comments - # An internal interface for a target that comments can be attached - # to. This is either going to be a NodeTarget or a CommentTarget. - interface _CommentTarget - def start_offset: () -> Integer - - def end_offset: () -> Integer - - def encloses?: (Comment) -> bool - - def leading_comment: (Comment) -> void - - def trailing_comment: (Comment) -> void - end - - # A target for attaching comments that is based on a specific node's - # location. - class NodeTarget - # :nodoc: - attr_reader node: node - - # : (node node) -> void - def initialize: (node node) -> void - - # : () -> Integer - def start_offset: () -> Integer - - # : () -> Integer - def end_offset: () -> Integer - - # : (Comment comment) -> bool - def encloses?: (Comment comment) -> bool - - # : (Comment comment) -> void - def leading_comment: (Comment comment) -> void - - # : (Comment comment) -> void - def trailing_comment: (Comment comment) -> void - end - - # A target for attaching comments that is based on a location field on a - # node. For example, the `end` token of a ClassNode. - class LocationTarget - # :nodoc: - attr_reader location: Location - - # : (Location location) -> void - def initialize: (Location location) -> void - - # : () -> Integer - def start_offset: () -> Integer - - # : () -> Integer - def end_offset: () -> Integer - - # : (Comment comment) -> bool - def encloses?: (Comment comment) -> bool - - # : (Comment comment) -> void - def leading_comment: (Comment comment) -> void - - # : (Comment comment) -> void - def trailing_comment: (Comment comment) -> void - end - - # The parse result that we are attaching comments to. - attr_reader parse_result: ParseResult - - # Create a new Comments object that will attach comments to the given - # parse result. - # -- - # : (ParseResult parse_result) -> void - def initialize: (ParseResult parse_result) -> void - - # Attach the comments to their respective locations in the tree by - # mutating the parse result. - # -- - # : () -> void - def attach!: () -> void - - private - - # Responsible for finding the nearest targets to the given comment within - # the context of the given encapsulating node. - # -- - # : (node node, Comment comment) -> [_CommentTarget?, _CommentTarget?, _CommentTarget?] - def nearest_targets: (node node, Comment comment) -> [ _CommentTarget?, _CommentTarget?, _CommentTarget? ] - end - end -end diff --git a/sig/generated/prism/parse_result/errors.rbs b/sig/generated/prism/parse_result/errors.rbs deleted file mode 100644 index 1b97d8a763..0000000000 --- a/sig/generated/prism/parse_result/errors.rbs +++ /dev/null @@ -1,22 +0,0 @@ -# Generated from lib/prism/parse_result/errors.rb with RBS::Inline - -module Prism - class ParseResult < Result - # An object to represent the set of errors on a parse result. This object - # can be used to format the errors in a human-readable way. - class Errors - # The parse result that contains the errors. - attr_reader parse_result: ParseResult - - # Initialize a new set of errors from the given parse result. - # -- - # : (ParseResult parse_result) -> void - def initialize: (ParseResult parse_result) -> void - - # Formats the errors in a human-readable way and return them as a string. - # -- - # : () -> String - def format: () -> String - end - end -end diff --git a/sig/generated/prism/parse_result/newlines.rbs b/sig/generated/prism/parse_result/newlines.rbs deleted file mode 100644 index 45c04783d0..0000000000 --- a/sig/generated/prism/parse_result/newlines.rbs +++ /dev/null @@ -1,129 +0,0 @@ -# Generated from lib/prism/parse_result/newlines.rb with RBS::Inline - -module Prism - class ParseResult < Result - # The :line tracepoint event gets fired whenever the Ruby VM encounters an - # expression on a new line. The types of expressions that can trigger this - # event are: - # - # * if statements - # * unless statements - # * nodes that are children of statements lists - # - # In order to keep track of the newlines, we have a list of offsets that - # come back from the parser. We assign these offsets to the first nodes that - # we find in the tree that are on those lines. - # - # Note that the logic in this file should be kept in sync with the Java - # MarkNewlinesVisitor, since that visitor is responsible for marking the - # newlines for JRuby/TruffleRuby. - # - # This file is autoloaded only when `mark_newlines!` is called, so the - # re-opening of the various nodes in this file will only be performed in - # that case. We do that to avoid storing the extra `@newline` instance - # variable on every node if we don't need it. - class Newlines < Visitor - @lines: Array[bool] - - # Create a new Newlines visitor with the given newline offsets. - # -- - # : (Integer lines) -> void - def initialize: (Integer lines) -> void - - # Permit block nodes to mark newlines within themselves. - # -- - # : (BlockNode node) -> void - def visit_block_node: (BlockNode node) -> void - - # Permit lambda nodes to mark newlines within themselves. - # -- - # : (LambdaNode node) -> void - def visit_lambda_node: (LambdaNode node) -> void - - # Mark if nodes as newlines. - # -- - # : (IfNode node) -> void - def visit_if_node: (IfNode node) -> void - - # Mark unless nodes as newlines. - # -- - # : (UnlessNode node) -> void - def visit_unless_node: (UnlessNode node) -> void - - # Permit statements lists to mark newlines within themselves. - # -- - # : (StatementsNode node) -> void - def visit_statements_node: (StatementsNode node) -> void - end - end - - class Node - @newline_flag: bool - - # : () -> bool - def newline_flag?: () -> bool - - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class BeginNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class ParenthesesNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class IfNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class UnlessNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class UntilNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class WhileNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class RescueModifierNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class InterpolatedMatchLastLineNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class InterpolatedRegularExpressionNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class InterpolatedStringNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class InterpolatedSymbolNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end - - class InterpolatedXStringNode < Node - # : (Array[bool] lines) -> void - def newline_flag!: (Array[bool] lines) -> void - end -end diff --git a/sig/generated/prism/pattern.rbs b/sig/generated/prism/pattern.rbs deleted file mode 100644 index 7ea2808da4..0000000000 --- a/sig/generated/prism/pattern.rbs +++ /dev/null @@ -1,156 +0,0 @@ -# Generated from lib/prism/pattern.rb with RBS::Inline - -module Prism - # A pattern is an object that wraps a Ruby pattern matching expression. The - # expression would normally be passed to an `in` clause within a `case` - # expression or a rightward assignment expression. For example, in the - # following snippet: - # - # case node - # in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] - # end - # - # the pattern is the ConstantPathNode[...] expression. - # - # The pattern gets compiled into an object that responds to #call by running - # the #compile method. This method itself will run back through Prism to - # parse the expression into a tree, then walk the tree to generate the - # necessary callable objects. For example, if you wanted to compile the - # expression above into a callable, you would: - # - # callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile - # callable.call(node) - # - # The callable object returned by #compile is guaranteed to respond to #call - # with a single argument, which is the node to match against. It also is - # guaranteed to respond to #===, which means it itself can be used in a `case` - # expression, as in: - # - # case node - # when callable - # end - # - # If the query given to the initializer cannot be compiled into a valid - # matcher (either because of a syntax error or because it is using syntax we - # do not yet support) then a Prism::Pattern::CompilationError will be - # raised. - class Pattern - # Raised when the query given to a pattern is either invalid Ruby syntax or - # is using syntax that we don't yet support. - class CompilationError < StandardError - # Create a new CompilationError with the given representation of the node - # that caused the error. - # -- - # : (String repr) -> void - def initialize: (String repr) -> void - end - - # The query that this pattern was initialized with. - attr_reader query: String - - @compiled: Proc? - - # Create a new pattern with the given query. The query should be a string - # containing a Ruby pattern matching expression. - # -- - # : (String query) -> void - def initialize: (String query) -> void - - # Compile the query into a callable object that can be used to match against - # nodes. - # -- - # : () -> Proc - def compile: () -> Proc - - # Scan the given node and all of its children for nodes that match the - # pattern. If a block is given, it will be called with each node that - # matches the pattern. If no block is given, an enumerator will be returned - # that will yield each node that matches the pattern. - # -- - # : (node root) -> Enumerator[node, void] - # : (node root) { (node) -> void } -> void - def scan: (node root) -> Enumerator[node, void] - | (node root) { (node) -> void } -> void - - private - - # Shortcut for combining two procs into one that returns true if both return - # true. - # -- - # : (Proc left, Proc right) -> Proc - def combine_and: (Proc left, Proc right) -> Proc - - # Shortcut for combining two procs into one that returns true if either - # returns true. - # -- - # : (Proc left, Proc right) -> Proc - def combine_or: (Proc left, Proc right) -> Proc - - # Raise an error because the given node is not supported. Note purposefully - # not typing this method since it is a no return method that Steep does not - # understand. - # -- - # : (node node) -> bot - def compile_error: (node node) -> bot - - # in [foo, bar, baz] - # -- - # : (ArrayPatternNode node) -> Proc - def compile_array_pattern_node: (ArrayPatternNode node) -> Proc - - # in foo | bar - # -- - # : (AlternationPatternNode node) -> Proc - def compile_alternation_pattern_node: (AlternationPatternNode node) -> Proc - - # in Prism::ConstantReadNode - # -- - # : (ConstantPathNode node) -> Proc - def compile_constant_path_node: (ConstantPathNode node) -> Proc - - # in ConstantReadNode - # in String - # -- - # : (ConstantReadNode node) -> Proc - def compile_constant_read_node: (ConstantReadNode node) -> Proc - - # Compile a name associated with a constant. - # -- - # : ((ConstantPathNode | ConstantReadNode) node, Symbol name) -> Proc - def compile_constant_name: (ConstantPathNode | ConstantReadNode node, Symbol name) -> Proc - - # in InstanceVariableReadNode[name: Symbol] - # in { name: Symbol } - # -- - # : (HashPatternNode node) -> Proc - def compile_hash_pattern_node: (HashPatternNode node) -> Proc - - # in nil - # -- - # : (NilNode node) -> Proc - def compile_nil_node: (NilNode node) -> Proc - - # in /foo/ - # -- - # : (RegularExpressionNode node) -> Proc - def compile_regular_expression_node: (RegularExpressionNode node) -> Proc - - # in "" - # in "foo" - # -- - # : (StringNode node) -> Proc - def compile_string_node: (StringNode node) -> Proc - - # in :+ - # in :foo - # -- - # : (SymbolNode node) -> Proc - def compile_symbol_node: (SymbolNode node) -> Proc - - # Compile any kind of node. Dispatch out to the individual compilation - # methods based on the type of node. - # -- - # : (node node) -> Proc - def compile_node: (node node) -> Proc - end -end diff --git a/sig/generated/prism/reflection.rbs b/sig/generated/prism/reflection.rbs deleted file mode 100644 index 8237da3a2e..0000000000 --- a/sig/generated/prism/reflection.rbs +++ /dev/null @@ -1,101 +0,0 @@ -# Generated from lib/prism/reflection.rb with RBS::Inline - -module Prism - # The Reflection module provides the ability to reflect on the structure of - # the syntax tree itself, as opposed to looking at a single syntax tree. This - # is useful in metaprogramming contexts. - module Reflection - # A field represents a single piece of data on a node. It is the base class - # for all other field types. - class Field - # The name of the field. - attr_reader name: Symbol - - # Initializes the field with the given name. - # -- - # : (Symbol name) -> void - def initialize: (Symbol name) -> void - end - - # A node field represents a single child node in the syntax tree. It - # resolves to a Prism::Node in Ruby. - class NodeField < Field - end - - # An optional node field represents a single child node in the syntax tree - # that may or may not be present. It resolves to either a Prism::Node or nil - # in Ruby. - class OptionalNodeField < Field - end - - # A node list field represents a list of child nodes in the syntax tree. It - # resolves to an array of Prism::Node instances in Ruby. - class NodeListField < Field - end - - # A constant field represents a constant value on a node. Effectively, it - # represents an identifier found within the source. It resolves to a symbol - # in Ruby. - class ConstantField < Field - end - - # An optional constant field represents a constant value on a node that may - # or may not be present. It resolves to either a symbol or nil in Ruby. - class OptionalConstantField < Field - end - - # A constant list field represents a list of constant values on a node. It - # resolves to an array of symbols in Ruby. - class ConstantListField < Field - end - - # A string field represents a string value on a node. It almost always - # represents the unescaped value of a string-like literal. It resolves to a - # string in Ruby. - class StringField < Field - end - - # A location field represents the location of some part of the node in the - # source code. For example, the location of a keyword or an operator. It - # resolves to a Prism::Location in Ruby. - class LocationField < Field - end - - # An optional location field represents the location of some part of the - # node in the source code that may or may not be present. It resolves to - # either a Prism::Location or nil in Ruby. - class OptionalLocationField < Field - end - - # An integer field represents an integer value. It is used to represent the - # value of an integer literal, the depth of local variables, and the number - # of a numbered reference. It resolves to an Integer in Ruby. - class IntegerField < Field - end - - # A float field represents a double-precision floating point value. It is - # used exclusively to represent the value of a floating point literal. It - # resolves to a Float in Ruby. - class FloatField < Field - end - - # A flags field represents a bitset of flags on a node. It resolves to an - # integer in Ruby. Note that the flags cannot be accessed directly on the - # node because the integer is kept private. Instead, the various flags in - # the bitset should be accessed through their query methods. - class FlagsField < Field - # The names of the flags in the bitset. - attr_reader flags: Array[Symbol] - - # Initializes the flags field with the given name and flags. - # -- - # : (Symbol name, Array[Symbol] flags) -> void - def initialize: (Symbol name, Array[Symbol] flags) -> void - end - - # Returns the fields for the given node. - # -- - # : (singleton(Node) node) -> Array[Field] - def self.fields_for: (singleton(Node) node) -> Array[Field] - end -end diff --git a/sig/generated/prism/relocation.rbs b/sig/generated/prism/relocation.rbs deleted file mode 100644 index 35238609ca..0000000000 --- a/sig/generated/prism/relocation.rbs +++ /dev/null @@ -1,502 +0,0 @@ -# Generated from lib/prism/relocation.rb with RBS::Inline - -module Prism - # Prism parses deterministically for the same input. This provides a nice - # property that is exposed through the #node_id API on nodes. Effectively this - # means that for the same input, these values will remain consistent every - # time the source is parsed. This means we can reparse the source same with a - # #node_id value and find the exact same node again. - # - # The Relocation module provides an API around this property. It allows you to - # "save" nodes and locations using a minimal amount of memory (just the - # node_id and a field identifier) and then reify them later. - module Relocation - type entry_value = untyped - - type entry_values = Hash[Symbol, entry_value] - - interface _Value - def start_line: () -> Integer - - def end_line: () -> Integer - - def start_offset: () -> Integer - - def end_offset: () -> Integer - - def start_character_offset: () -> Integer - - def end_character_offset: () -> Integer - - def cached_start_code_units_offset: (_CodeUnitsCache cache) -> Integer - - def cached_end_code_units_offset: (_CodeUnitsCache cache) -> Integer - - def start_column: () -> Integer - - def end_column: () -> Integer - - def start_character_column: () -> Integer - - def end_character_column: () -> Integer - - def cached_start_code_units_column: (_CodeUnitsCache cache) -> Integer - - def cached_end_code_units_column: (_CodeUnitsCache cache) -> Integer - - def leading_comments: () -> Array[Comment] - - def trailing_comments: () -> Array[Comment] - end - - interface _Field - def fields: (_Value value) -> entry_values - end - - # An entry in a repository that will lazily reify its values when they are - # first accessed. - class Entry - # Raised if a value that could potentially be on an entry is missing - # because it was either not configured on the repository or it has not yet - # been fetched. - class MissingValueError < StandardError - end - - @values: Hash[Symbol, untyped]? - - @repository: Repository? - - # Initialize a new entry with the given repository. - # -- - # : (Repository repository) -> void - def initialize: (Repository repository) -> void - - # Fetch the filepath of the value. - # -- - # : () -> String - def filepath: () -> String - - # Fetch the start line of the value. - # -- - # : () -> Integer - def start_line: () -> Integer - - # Fetch the end line of the value. - # -- - # : () -> Integer - def end_line: () -> Integer - - # Fetch the start byte offset of the value. - # -- - # : () -> Integer - def start_offset: () -> Integer - - # Fetch the end byte offset of the value. - # -- - # : () -> Integer - def end_offset: () -> Integer - - # Fetch the start character offset of the value. - # -- - # : () -> Integer - def start_character_offset: () -> Integer - - # Fetch the end character offset of the value. - # -- - # : () -> Integer - def end_character_offset: () -> Integer - - # Fetch the start code units offset of the value, for the encoding that - # was configured on the repository. - # -- - # : () -> Integer - def start_code_units_offset: () -> Integer - - # Fetch the end code units offset of the value, for the encoding that was - # configured on the repository. - # -- - # : () -> Integer - def end_code_units_offset: () -> Integer - - # Fetch the start byte column of the value. - # -- - # : () -> Integer - def start_column: () -> Integer - - # Fetch the end byte column of the value. - # -- - # : () -> Integer - def end_column: () -> Integer - - # Fetch the start character column of the value. - # -- - # : () -> Integer - def start_character_column: () -> Integer - - # Fetch the end character column of the value. - # -- - # : () -> Integer - def end_character_column: () -> Integer - - # Fetch the start code units column of the value, for the encoding that - # was configured on the repository. - # -- - # : () -> Integer - def start_code_units_column: () -> Integer - - # Fetch the end code units column of the value, for the encoding that was - # configured on the repository. - # -- - # : () -> Integer - def end_code_units_column: () -> Integer - - # Fetch the leading comments of the value. - # -- - # : () -> Array[CommentsField::Comment] - def leading_comments: () -> Array[CommentsField::Comment] - - # Fetch the trailing comments of the value. - # -- - # : () -> Array[CommentsField::Comment] - def trailing_comments: () -> Array[CommentsField::Comment] - - # Fetch the leading and trailing comments of the value. - # -- - # : () -> Array[CommentsField::Comment] - def comments: () -> Array[CommentsField::Comment] - - # Reify the values on this entry with the given values. This is an - # internal-only API that is called from the repository when it is time to - # reify the values. - # -- - # : (entry_values values) -> void - def reify!: (entry_values values) -> void - - private - - # Fetch a value from the entry, raising an error if it is missing. - # -- - # : (Symbol name) -> entry_value - def fetch_value: (Symbol name) -> entry_value - - # Return the values from the repository, reifying them if necessary. - # -- - # : () -> entry_values - def values: () -> entry_values - end - - # Represents the source of a repository that will be reparsed. - class Source - # The value that will need to be reparsed. - attr_reader value: untyped - - # Initialize the source with the given value. - # -- - # : (untyped value) -> void - def initialize: (untyped value) -> void - - # Reparse the value and return the parse result. - # -- - # : () -> ParseResult - def result: () -> ParseResult - - # Create a code units cache for the given encoding. - # -- - # : (Encoding encoding) -> _CodeUnitsCache - def code_units_cache: (Encoding encoding) -> _CodeUnitsCache - end - - # A source that is represented by a file path. - class SourceFilepath < Source - # Reparse the file and return the parse result. - # -- - # : () -> ParseResult - def result: () -> ParseResult - end - - # A source that is represented by a string. - class SourceString < Source - # Reparse the string and return the parse result. - # -- - # : () -> ParseResult - def result: () -> ParseResult - end - - # A field that represents the file path. - class FilepathField - # The file path that this field represents. - attr_reader value: String - - # Initialize a new field with the given file path. - # -- - # : (String value) -> void - def initialize: (String value) -> void - - # Fetch the file path. - # -- - # : (_Value _value) -> entry_values - def fields: (_Value _value) -> entry_values - end - - # A field representing the start and end lines. - class LinesField - # Fetches the start and end line of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the start and end byte offsets. - class OffsetsField - # Fetches the start and end byte offset of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the start and end character offsets. - class CharacterOffsetsField - # Fetches the start and end character offset of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the start and end code unit offsets. - class CodeUnitOffsetsField - # A pointer to the repository object that is used for lazily creating a - # code units cache. - attr_reader repository: Repository - - # The associated encoding for the code units. - attr_reader encoding: Encoding - - @cache: _CodeUnitsCache? - - # Initialize a new field with the associated repository and encoding. - # -- - # : (Repository repository, Encoding encoding) -> void - def initialize: (Repository repository, Encoding encoding) -> void - - # Fetches the start and end code units offset of a value for a particular - # encoding. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - - private - - # Lazily create a code units cache for the associated encoding. - # -- - # : () -> _CodeUnitsCache - def cache: () -> _CodeUnitsCache - end - - # A field representing the start and end byte columns. - class ColumnsField - # Fetches the start and end byte column of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the start and end character columns. - class CharacterColumnsField - # Fetches the start and end character column of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the start and end code unit columns for a specific - # encoding. - class CodeUnitColumnsField - # The repository object that is used for lazily creating a code units - # cache. - attr_reader repository: Repository - - # The associated encoding for the code units. - attr_reader encoding: Encoding - - @cache: _CodeUnitsCache? - - # Initialize a new field with the associated repository and encoding. - # -- - # : (Repository repository, Encoding encoding) -> void - def initialize: (Repository repository, Encoding encoding) -> void - - # Fetches the start and end code units column of a value for a particular - # encoding. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - - private - - # Lazily create a code units cache for the associated encoding. - # -- - # : () -> _CodeUnitsCache - def cache: () -> _CodeUnitsCache - end - - # An abstract field used as the parent class of the two comments fields. - class CommentsField - # An object that represents a slice of a comment. - class Comment - # The slice of the comment. - attr_reader slice: String - - # Initialize a new comment with the given slice. - # - # : (String slice) -> void - def initialize: (String slice) -> void - end - - private - - # Create comment objects from the given values. - # -- - # : (entry_value values) -> Array[Comment] - def comments: (entry_value values) -> Array[Comment] - end - - # A field representing the leading comments. - class LeadingCommentsField < CommentsField - # Fetches the leading comments of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A field representing the trailing comments. - class TrailingCommentsField < CommentsField - # Fetches the trailing comments of a value. - # -- - # : (_Value value) -> entry_values - def fields: (_Value value) -> entry_values - end - - # A repository is a configured collection of fields and a set of entries - # that knows how to reparse a source and reify the values. - class Repository - # Raised when multiple fields of the same type are configured on the same - # repository. - class ConfigurationError < StandardError - end - - # The source associated with this repository. This will be either a - # SourceFilepath (the most common use case) or a SourceString. - attr_reader source: Source - - # The fields that have been configured on this repository. - attr_reader fields: Hash[Symbol, _Field] - - # The entries that have been saved on this repository. - attr_reader entries: Hash[Integer, Hash[Symbol, Entry]] - - # Initialize a new repository with the given source. - # -- - # : (Source source) -> void - def initialize: (Source source) -> void - - # Create a code units cache for the given encoding from the source. - # -- - # : (Encoding encoding) -> _CodeUnitsCache - def code_units_cache: (Encoding encoding) -> _CodeUnitsCache - - # Configure the filepath field for this repository and return self. - # -- - # : () -> self - def filepath: () -> self - - # Configure the lines field for this repository and return self. - # -- - # : () -> self - def lines: () -> self - - # Configure the offsets field for this repository and return self. - # -- - # : () -> self - def offsets: () -> self - - # Configure the character offsets field for this repository and return - # self. - # -- - # : () -> self - def character_offsets: () -> self - - # Configure the code unit offsets field for this repository for a specific - # encoding and return self. - # -- - # : (Encoding encoding) -> self - def code_unit_offsets: (Encoding encoding) -> self - - # Configure the columns field for this repository and return self. - # -- - # : () -> self - def columns: () -> self - - # Configure the character columns field for this repository and return - # self. - # -- - # : () -> self - def character_columns: () -> self - - # Configure the code unit columns field for this repository for a specific - # encoding and return self. - # -- - # : (Encoding encoding) -> self - def code_unit_columns: (Encoding encoding) -> self - - # Configure the leading comments field for this repository and return - # self. - # -- - # : () -> self - def leading_comments: () -> self - - # Configure the trailing comments field for this repository and return - # self. - # -- - # : () -> self - def trailing_comments: () -> self - - # Configure both the leading and trailing comment fields for this - # repository and return self. - # -- - # : () -> self - def comments: () -> self - - # This method is called from nodes and locations when they want to enter - # themselves into the repository. It it internal-only and meant to be - # called from the #save* APIs. - # -- - # : (Integer node_id, Symbol field_name) -> Entry - def enter: (Integer node_id, Symbol field_name) -> Entry - - # This method is called from the entries in the repository when they need - # to reify their values. It is internal-only and meant to be called from - # the various value APIs. - # -- - # : () -> void - def reify!: () -> void - - private - - # Append the given field to the repository and return the repository so - # that these calls can be chained. - # -- - # : (Symbol name, _Field) -> self - def field: (Symbol name, _Field) -> self - end - - # Create a new repository for the given filepath. - # -- - # : (String value) -> Repository - def self.filepath: (String value) -> Repository - - # Create a new repository for the given string. - # -- - # : (String value) -> Repository - def self.string: (String value) -> Repository - end -end diff --git a/sig/generated/prism/serialize.rbs b/sig/generated/prism/serialize.rbs deleted file mode 100644 index e0b944856b..0000000000 --- a/sig/generated/prism/serialize.rbs +++ /dev/null @@ -1,181 +0,0 @@ -# Generated from lib/prism/serialize.rb with RBS::Inline - -module Prism - # A module responsible for deserializing parse results. - module Serialize - # The major version of prism that we are expecting to find in the serialized - # strings. - MAJOR_VERSION: ::Integer - - # The minor version of prism that we are expecting to find in the serialized - # strings. - MINOR_VERSION: ::Integer - - # The patch version of prism that we are expecting to find in the serialized - # strings. - PATCH_VERSION: ::Integer - - # Deserialize the dumped output from a request to parse or parse_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - # -- - # : (String input, String serialized, bool freeze) -> ParseResult - def self.load_parse: (String input, String serialized, bool freeze) -> ParseResult - - # Deserialize the dumped output from a request to lex or lex_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - # -- - # : (String input, String serialized, bool freeze) -> LexResult - def self.load_lex: (String input, String serialized, bool freeze) -> LexResult - - # Deserialize the dumped output from a request to parse_comments or - # parse_file_comments. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - # -- - # : (String input, String serialized, bool freeze) -> Array[Comment] - def self.load_parse_comments: (String input, String serialized, bool freeze) -> Array[Comment] - - # Deserialize the dumped output from a request to parse_lex or - # parse_lex_file. - # - # The formatting of the source of this method is purposeful to illustrate - # the structure of the serialized data. - # -- - # : (String input, String serialized, bool freeze) -> ParseLexResult - def self.load_parse_lex: (String input, String serialized, bool freeze) -> ParseLexResult - - class ConstantPool - # :nodoc: - attr_reader size: Integer - - @serialized: String - - @base: Integer - - @pool: Array[Symbol?] - - # : (String serialized, Integer base, Integer size) -> void - def initialize: (String serialized, Integer base, Integer size) -> void - - # : (Integer index, Encoding encoding) -> Symbol - def get: (Integer index, Encoding encoding) -> Symbol - end - - FastStringIO: untyped - - class Loader - # :nodoc: - attr_reader input: String - - attr_reader io: StringIO - - attr_reader source: Source - - # : (Source source, String serialized) -> void - def initialize: (Source source, String serialized) -> void - - # : () -> bool - def eof?: () -> bool - - # : (ConstantPool constant_pool) -> void - def load_constant_pool: (ConstantPool constant_pool) -> void - - # : () -> void - def load_header: () -> void - - # : () -> Encoding - def load_encoding: () -> Encoding - - # : (bool freeze) -> Array[Integer] - def load_line_offsets: (bool freeze) -> Array[Integer] - - # : (bool freeze) -> Array[Comment] - def load_comments: (bool freeze) -> Array[Comment] - - # : (bool freeze) -> Array[MagicComment] - def load_magic_comments: (bool freeze) -> Array[MagicComment] - - DIAGNOSTIC_TYPES: Array[Symbol] - - # : () -> Symbol - def load_error_level: () -> Symbol - - # : (Encoding encoding, bool freeze) -> Array[ParseError] - def load_errors: (Encoding encoding, bool freeze) -> Array[ParseError] - - # : () -> Symbol - def load_warning_level: () -> Symbol - - # : (Encoding encoding, bool freeze) -> Array[ParseWarning] - def load_warnings: (Encoding encoding, bool freeze) -> Array[ParseWarning] - - # : () -> Array[[Token, Integer]] - def load_tokens: () -> Array[[ Token, Integer ]] - - # variable-length integer using https://en.wikipedia.org/wiki/LEB128 - # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints - # -- - # : () -> Integer - def load_varuint: () -> Integer - - # : () -> Integer - def load_varsint: () -> Integer - - # : () -> Integer - def load_integer: () -> Integer - - # : () -> Float - def load_double: () -> Float - - # : () -> Integer - def load_uint32: () -> Integer - - # : (ConstantPool constant_pool, Encoding encoding, bool freeze) -> node? - def load_optional_node: (ConstantPool constant_pool, Encoding encoding, bool freeze) -> node? - - # : (Encoding encoding) -> String - def load_string: (Encoding encoding) -> String - - # : (bool freeze) -> Location - def load_location_object: (bool freeze) -> Location - - # Load a location object from the serialized data. Note that we are lying - # about the signature a bit here, because we sometimes load it as a packed - # integer instead of an object. - # -- - # : (bool freeze) -> Location - def load_location: (bool freeze) -> Location - - # Load an optional location object from the serialized data if it is - # present. Note that we are lying about the signature a bit here, because - # we sometimes load it as a packed integer instead of an object. - # -- - # : (bool freeze) -> Location? - def load_optional_location: (bool freeze) -> Location? - - # : (bool freeze) -> Location? - def load_optional_location_object: (bool freeze) -> Location? - - # : (ConstantPool constant_pool, Encoding encoding) -> Symbol - def load_constant: (ConstantPool constant_pool, Encoding encoding) -> Symbol - - # : (ConstantPool constant_pool, Encoding encoding) -> Symbol? - def load_optional_constant: (ConstantPool constant_pool, Encoding encoding) -> Symbol? - - # : (ConstantPool constant_pool, Encoding encoding, bool freeze) -> node - def load_node: (ConstantPool constant_pool, Encoding encoding, bool freeze) -> node - - @load_node_lambdas: Array[Proc] - - def define_load_node_lambdas: () -> void - end - - # The token types that can be indexed by their enum values. - TOKEN_TYPES: Array[Symbol?] - end -end diff --git a/sig/generated/prism/string_query.rbs b/sig/generated/prism/string_query.rbs deleted file mode 100644 index de2183a731..0000000000 --- a/sig/generated/prism/string_query.rbs +++ /dev/null @@ -1,36 +0,0 @@ -# Generated from lib/prism/string_query.rb with RBS::Inline - -module Prism - # Query methods that allow categorizing strings based on their context for - # where they could be valid in a Ruby syntax tree. - class StringQuery - def self.local?: (String string) -> bool - - def self.constant?: (String string) -> bool - - def self.method_name?: (String string) -> bool - - # The string that this query is wrapping. - attr_reader string: String - - # Initialize a new query with the given string. - # -- - # : (String string) -> void - def initialize: (String string) -> void - - # Whether or not this string is a valid local variable name. - # -- - # : () -> bool - def local?: () -> bool - - # Whether or not this string is a valid constant name. - # -- - # : () -> bool - def constant?: () -> bool - - # Whether or not this string is a valid method name. - # -- - # : () -> bool - def method_name?: () -> bool - end -end diff --git a/sig/generated/prism/translation.rbs b/sig/generated/prism/translation.rbs deleted file mode 100644 index 09971a2971..0000000000 --- a/sig/generated/prism/translation.rbs +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from lib/prism/translation.rb with RBS::Inline - -module Prism - # This module is responsible for converting the prism syntax tree into other - # syntax trees. - module Translation - end -end diff --git a/sig/generated/prism/visitor.rbs b/sig/generated/prism/visitor.rbs deleted file mode 100644 index ec65adbb29..0000000000 --- a/sig/generated/prism/visitor.rbs +++ /dev/null @@ -1,1111 +0,0 @@ -# Generated from lib/prism/visitor.rb with RBS::Inline - -module Prism - interface _Visitor - def visit_alias_global_variable_node: (AliasGlobalVariableNode) -> void - - def visit_alias_method_node: (AliasMethodNode) -> void - - def visit_alternation_pattern_node: (AlternationPatternNode) -> void - - def visit_and_node: (AndNode) -> void - - def visit_arguments_node: (ArgumentsNode) -> void - - def visit_array_node: (ArrayNode) -> void - - def visit_array_pattern_node: (ArrayPatternNode) -> void - - def visit_assoc_node: (AssocNode) -> void - - def visit_assoc_splat_node: (AssocSplatNode) -> void - - def visit_back_reference_read_node: (BackReferenceReadNode) -> void - - def visit_begin_node: (BeginNode) -> void - - def visit_block_argument_node: (BlockArgumentNode) -> void - - def visit_block_local_variable_node: (BlockLocalVariableNode) -> void - - def visit_block_node: (BlockNode) -> void - - def visit_block_parameter_node: (BlockParameterNode) -> void - - def visit_block_parameters_node: (BlockParametersNode) -> void - - def visit_break_node: (BreakNode) -> void - - def visit_call_and_write_node: (CallAndWriteNode) -> void - - def visit_call_node: (CallNode) -> void - - def visit_call_operator_write_node: (CallOperatorWriteNode) -> void - - def visit_call_or_write_node: (CallOrWriteNode) -> void - - def visit_call_target_node: (CallTargetNode) -> void - - def visit_capture_pattern_node: (CapturePatternNode) -> void - - def visit_case_match_node: (CaseMatchNode) -> void - - def visit_case_node: (CaseNode) -> void - - def visit_class_node: (ClassNode) -> void - - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode) -> void - - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode) -> void - - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode) -> void - - def visit_class_variable_read_node: (ClassVariableReadNode) -> void - - def visit_class_variable_target_node: (ClassVariableTargetNode) -> void - - def visit_class_variable_write_node: (ClassVariableWriteNode) -> void - - def visit_constant_and_write_node: (ConstantAndWriteNode) -> void - - def visit_constant_operator_write_node: (ConstantOperatorWriteNode) -> void - - def visit_constant_or_write_node: (ConstantOrWriteNode) -> void - - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode) -> void - - def visit_constant_path_node: (ConstantPathNode) -> void - - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode) -> void - - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode) -> void - - def visit_constant_path_target_node: (ConstantPathTargetNode) -> void - - def visit_constant_path_write_node: (ConstantPathWriteNode) -> void - - def visit_constant_read_node: (ConstantReadNode) -> void - - def visit_constant_target_node: (ConstantTargetNode) -> void - - def visit_constant_write_node: (ConstantWriteNode) -> void - - def visit_def_node: (DefNode) -> void - - def visit_defined_node: (DefinedNode) -> void - - def visit_else_node: (ElseNode) -> void - - def visit_embedded_statements_node: (EmbeddedStatementsNode) -> void - - def visit_embedded_variable_node: (EmbeddedVariableNode) -> void - - def visit_ensure_node: (EnsureNode) -> void - - def visit_false_node: (FalseNode) -> void - - def visit_find_pattern_node: (FindPatternNode) -> void - - def visit_flip_flop_node: (FlipFlopNode) -> void - - def visit_float_node: (FloatNode) -> void - - def visit_for_node: (ForNode) -> void - - def visit_forwarding_arguments_node: (ForwardingArgumentsNode) -> void - - def visit_forwarding_parameter_node: (ForwardingParameterNode) -> void - - def visit_forwarding_super_node: (ForwardingSuperNode) -> void - - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode) -> void - - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode) -> void - - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode) -> void - - def visit_global_variable_read_node: (GlobalVariableReadNode) -> void - - def visit_global_variable_target_node: (GlobalVariableTargetNode) -> void - - def visit_global_variable_write_node: (GlobalVariableWriteNode) -> void - - def visit_hash_node: (HashNode) -> void - - def visit_hash_pattern_node: (HashPatternNode) -> void - - def visit_if_node: (IfNode) -> void - - def visit_imaginary_node: (ImaginaryNode) -> void - - def visit_implicit_node: (ImplicitNode) -> void - - def visit_implicit_rest_node: (ImplicitRestNode) -> void - - def visit_in_node: (InNode) -> void - - def visit_index_and_write_node: (IndexAndWriteNode) -> void - - def visit_index_operator_write_node: (IndexOperatorWriteNode) -> void - - def visit_index_or_write_node: (IndexOrWriteNode) -> void - - def visit_index_target_node: (IndexTargetNode) -> void - - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode) -> void - - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode) -> void - - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode) -> void - - def visit_instance_variable_read_node: (InstanceVariableReadNode) -> void - - def visit_instance_variable_target_node: (InstanceVariableTargetNode) -> void - - def visit_instance_variable_write_node: (InstanceVariableWriteNode) -> void - - def visit_integer_node: (IntegerNode) -> void - - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode) -> void - - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode) -> void - - def visit_interpolated_string_node: (InterpolatedStringNode) -> void - - def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> void - - def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> void - - def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> void - - def visit_it_parameters_node: (ItParametersNode) -> void - - def visit_keyword_hash_node: (KeywordHashNode) -> void - - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> void - - def visit_lambda_node: (LambdaNode) -> void - - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode) -> void - - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode) -> void - - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode) -> void - - def visit_local_variable_read_node: (LocalVariableReadNode) -> void - - def visit_local_variable_target_node: (LocalVariableTargetNode) -> void - - def visit_local_variable_write_node: (LocalVariableWriteNode) -> void - - def visit_match_last_line_node: (MatchLastLineNode) -> void - - def visit_match_predicate_node: (MatchPredicateNode) -> void - - def visit_match_required_node: (MatchRequiredNode) -> void - - def visit_match_write_node: (MatchWriteNode) -> void - - def visit_missing_node: (MissingNode) -> void - - def visit_module_node: (ModuleNode) -> void - - def visit_multi_target_node: (MultiTargetNode) -> void - - def visit_multi_write_node: (MultiWriteNode) -> void - - def visit_next_node: (NextNode) -> void - - def visit_nil_node: (NilNode) -> void - - def visit_no_block_parameter_node: (NoBlockParameterNode) -> void - - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode) -> void - - def visit_numbered_parameters_node: (NumberedParametersNode) -> void - - def visit_numbered_reference_read_node: (NumberedReferenceReadNode) -> void - - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode) -> void - - def visit_optional_parameter_node: (OptionalParameterNode) -> void - - def visit_or_node: (OrNode) -> void - - def visit_parameters_node: (ParametersNode) -> void - - def visit_parentheses_node: (ParenthesesNode) -> void - - def visit_pinned_expression_node: (PinnedExpressionNode) -> void - - def visit_pinned_variable_node: (PinnedVariableNode) -> void - - def visit_post_execution_node: (PostExecutionNode) -> void - - def visit_pre_execution_node: (PreExecutionNode) -> void - - def visit_program_node: (ProgramNode) -> void - - def visit_range_node: (RangeNode) -> void - - def visit_rational_node: (RationalNode) -> void - - def visit_redo_node: (RedoNode) -> void - - def visit_regular_expression_node: (RegularExpressionNode) -> void - - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode) -> void - - def visit_required_parameter_node: (RequiredParameterNode) -> void - - def visit_rescue_modifier_node: (RescueModifierNode) -> void - - def visit_rescue_node: (RescueNode) -> void - - def visit_rest_parameter_node: (RestParameterNode) -> void - - def visit_retry_node: (RetryNode) -> void - - def visit_return_node: (ReturnNode) -> void - - def visit_self_node: (SelfNode) -> void - - def visit_shareable_constant_node: (ShareableConstantNode) -> void - - def visit_singleton_class_node: (SingletonClassNode) -> void - - def visit_source_encoding_node: (SourceEncodingNode) -> void - - def visit_source_file_node: (SourceFileNode) -> void - - def visit_source_line_node: (SourceLineNode) -> void - - def visit_splat_node: (SplatNode) -> void - - def visit_statements_node: (StatementsNode) -> void - - def visit_string_node: (StringNode) -> void - - def visit_super_node: (SuperNode) -> void - - def visit_symbol_node: (SymbolNode) -> void - - def visit_true_node: (TrueNode) -> void - - def visit_undef_node: (UndefNode) -> void - - def visit_unless_node: (UnlessNode) -> void - - def visit_until_node: (UntilNode) -> void - - def visit_when_node: (WhenNode) -> void - - def visit_while_node: (WhileNode) -> void - - def visit_x_string_node: (XStringNode) -> void - - def visit_yield_node: (YieldNode) -> void - end - - # A class that knows how to walk down the tree. None of the individual visit - # methods are implemented on this visitor, so it forces the consumer to - # implement each one that they need. For a default implementation that - # continues walking the tree, see the Visitor class. - class BasicVisitor - # Calls `accept` on the given node if it is not `nil`, which in turn should - # call back into this visitor by calling the appropriate `visit_*` method. - # -- - # : (node? node) -> void - def visit: (node? node) -> void - - # Visits each node in `nodes` by calling `accept` on each one. - # -- - # : (Array[node?] nodes) -> void - def visit_all: (Array[node?] nodes) -> void - - # Visits the child nodes of `node` by calling `accept` on each one. - # -- - # : (node node) -> void - def visit_child_nodes: (node node) -> void - end - - # A visitor is a class that provides a default implementation for every accept - # method defined on the nodes. This means it can walk a tree without the - # caller needing to define any special handling. This allows you to handle a - # subset of the tree, while still walking the whole tree. - # - # For example, to find all of the method calls that call the `foo` method, you - # could write: - # - # class FooCalls < Prism::Visitor - # def visit_call_node(node) - # if node.name == :foo - # # Do something with the node - # end - # - # # Call super so that the visitor continues walking the tree - # super - # end - # end - class Visitor < BasicVisitor - # Visit a AliasGlobalVariableNode node - # -- - # : (AliasGlobalVariableNode node) -> void - def visit_alias_global_variable_node: (AliasGlobalVariableNode node) -> void - - # Visit a AliasMethodNode node - # -- - # : (AliasMethodNode node) -> void - def visit_alias_method_node: (AliasMethodNode node) -> void - - # Visit a AlternationPatternNode node - # -- - # : (AlternationPatternNode node) -> void - def visit_alternation_pattern_node: (AlternationPatternNode node) -> void - - # Visit a AndNode node - # -- - # : (AndNode node) -> void - def visit_and_node: (AndNode node) -> void - - # Visit a ArgumentsNode node - # -- - # : (ArgumentsNode node) -> void - def visit_arguments_node: (ArgumentsNode node) -> void - - # Visit a ArrayNode node - # -- - # : (ArrayNode node) -> void - def visit_array_node: (ArrayNode node) -> void - - # Visit a ArrayPatternNode node - # -- - # : (ArrayPatternNode node) -> void - def visit_array_pattern_node: (ArrayPatternNode node) -> void - - # Visit a AssocNode node - # -- - # : (AssocNode node) -> void - def visit_assoc_node: (AssocNode node) -> void - - # Visit a AssocSplatNode node - # -- - # : (AssocSplatNode node) -> void - def visit_assoc_splat_node: (AssocSplatNode node) -> void - - # Visit a BackReferenceReadNode node - # -- - # : (BackReferenceReadNode node) -> void - def visit_back_reference_read_node: (BackReferenceReadNode node) -> void - - # Visit a BeginNode node - # -- - # : (BeginNode node) -> void - def visit_begin_node: (BeginNode node) -> void - - # Visit a BlockArgumentNode node - # -- - # : (BlockArgumentNode node) -> void - def visit_block_argument_node: (BlockArgumentNode node) -> void - - # Visit a BlockLocalVariableNode node - # -- - # : (BlockLocalVariableNode node) -> void - def visit_block_local_variable_node: (BlockLocalVariableNode node) -> void - - # Visit a BlockNode node - # -- - # : (BlockNode node) -> void - def visit_block_node: (BlockNode node) -> void - - # Visit a BlockParameterNode node - # -- - # : (BlockParameterNode node) -> void - def visit_block_parameter_node: (BlockParameterNode node) -> void - - # Visit a BlockParametersNode node - # -- - # : (BlockParametersNode node) -> void - def visit_block_parameters_node: (BlockParametersNode node) -> void - - # Visit a BreakNode node - # -- - # : (BreakNode node) -> void - def visit_break_node: (BreakNode node) -> void - - # Visit a CallAndWriteNode node - # -- - # : (CallAndWriteNode node) -> void - def visit_call_and_write_node: (CallAndWriteNode node) -> void - - # Visit a CallNode node - # -- - # : (CallNode node) -> void - def visit_call_node: (CallNode node) -> void - - # Visit a CallOperatorWriteNode node - # -- - # : (CallOperatorWriteNode node) -> void - def visit_call_operator_write_node: (CallOperatorWriteNode node) -> void - - # Visit a CallOrWriteNode node - # -- - # : (CallOrWriteNode node) -> void - def visit_call_or_write_node: (CallOrWriteNode node) -> void - - # Visit a CallTargetNode node - # -- - # : (CallTargetNode node) -> void - def visit_call_target_node: (CallTargetNode node) -> void - - # Visit a CapturePatternNode node - # -- - # : (CapturePatternNode node) -> void - def visit_capture_pattern_node: (CapturePatternNode node) -> void - - # Visit a CaseMatchNode node - # -- - # : (CaseMatchNode node) -> void - def visit_case_match_node: (CaseMatchNode node) -> void - - # Visit a CaseNode node - # -- - # : (CaseNode node) -> void - def visit_case_node: (CaseNode node) -> void - - # Visit a ClassNode node - # -- - # : (ClassNode node) -> void - def visit_class_node: (ClassNode node) -> void - - # Visit a ClassVariableAndWriteNode node - # -- - # : (ClassVariableAndWriteNode node) -> void - def visit_class_variable_and_write_node: (ClassVariableAndWriteNode node) -> void - - # Visit a ClassVariableOperatorWriteNode node - # -- - # : (ClassVariableOperatorWriteNode node) -> void - def visit_class_variable_operator_write_node: (ClassVariableOperatorWriteNode node) -> void - - # Visit a ClassVariableOrWriteNode node - # -- - # : (ClassVariableOrWriteNode node) -> void - def visit_class_variable_or_write_node: (ClassVariableOrWriteNode node) -> void - - # Visit a ClassVariableReadNode node - # -- - # : (ClassVariableReadNode node) -> void - def visit_class_variable_read_node: (ClassVariableReadNode node) -> void - - # Visit a ClassVariableTargetNode node - # -- - # : (ClassVariableTargetNode node) -> void - def visit_class_variable_target_node: (ClassVariableTargetNode node) -> void - - # Visit a ClassVariableWriteNode node - # -- - # : (ClassVariableWriteNode node) -> void - def visit_class_variable_write_node: (ClassVariableWriteNode node) -> void - - # Visit a ConstantAndWriteNode node - # -- - # : (ConstantAndWriteNode node) -> void - def visit_constant_and_write_node: (ConstantAndWriteNode node) -> void - - # Visit a ConstantOperatorWriteNode node - # -- - # : (ConstantOperatorWriteNode node) -> void - def visit_constant_operator_write_node: (ConstantOperatorWriteNode node) -> void - - # Visit a ConstantOrWriteNode node - # -- - # : (ConstantOrWriteNode node) -> void - def visit_constant_or_write_node: (ConstantOrWriteNode node) -> void - - # Visit a ConstantPathAndWriteNode node - # -- - # : (ConstantPathAndWriteNode node) -> void - def visit_constant_path_and_write_node: (ConstantPathAndWriteNode node) -> void - - # Visit a ConstantPathNode node - # -- - # : (ConstantPathNode node) -> void - def visit_constant_path_node: (ConstantPathNode node) -> void - - # Visit a ConstantPathOperatorWriteNode node - # -- - # : (ConstantPathOperatorWriteNode node) -> void - def visit_constant_path_operator_write_node: (ConstantPathOperatorWriteNode node) -> void - - # Visit a ConstantPathOrWriteNode node - # -- - # : (ConstantPathOrWriteNode node) -> void - def visit_constant_path_or_write_node: (ConstantPathOrWriteNode node) -> void - - # Visit a ConstantPathTargetNode node - # -- - # : (ConstantPathTargetNode node) -> void - def visit_constant_path_target_node: (ConstantPathTargetNode node) -> void - - # Visit a ConstantPathWriteNode node - # -- - # : (ConstantPathWriteNode node) -> void - def visit_constant_path_write_node: (ConstantPathWriteNode node) -> void - - # Visit a ConstantReadNode node - # -- - # : (ConstantReadNode node) -> void - def visit_constant_read_node: (ConstantReadNode node) -> void - - # Visit a ConstantTargetNode node - # -- - # : (ConstantTargetNode node) -> void - def visit_constant_target_node: (ConstantTargetNode node) -> void - - # Visit a ConstantWriteNode node - # -- - # : (ConstantWriteNode node) -> void - def visit_constant_write_node: (ConstantWriteNode node) -> void - - # Visit a DefNode node - # -- - # : (DefNode node) -> void - def visit_def_node: (DefNode node) -> void - - # Visit a DefinedNode node - # -- - # : (DefinedNode node) -> void - def visit_defined_node: (DefinedNode node) -> void - - # Visit a ElseNode node - # -- - # : (ElseNode node) -> void - def visit_else_node: (ElseNode node) -> void - - # Visit a EmbeddedStatementsNode node - # -- - # : (EmbeddedStatementsNode node) -> void - def visit_embedded_statements_node: (EmbeddedStatementsNode node) -> void - - # Visit a EmbeddedVariableNode node - # -- - # : (EmbeddedVariableNode node) -> void - def visit_embedded_variable_node: (EmbeddedVariableNode node) -> void - - # Visit a EnsureNode node - # -- - # : (EnsureNode node) -> void - def visit_ensure_node: (EnsureNode node) -> void - - # Visit a FalseNode node - # -- - # : (FalseNode node) -> void - def visit_false_node: (FalseNode node) -> void - - # Visit a FindPatternNode node - # -- - # : (FindPatternNode node) -> void - def visit_find_pattern_node: (FindPatternNode node) -> void - - # Visit a FlipFlopNode node - # -- - # : (FlipFlopNode node) -> void - def visit_flip_flop_node: (FlipFlopNode node) -> void - - # Visit a FloatNode node - # -- - # : (FloatNode node) -> void - def visit_float_node: (FloatNode node) -> void - - # Visit a ForNode node - # -- - # : (ForNode node) -> void - def visit_for_node: (ForNode node) -> void - - # Visit a ForwardingArgumentsNode node - # -- - # : (ForwardingArgumentsNode node) -> void - def visit_forwarding_arguments_node: (ForwardingArgumentsNode node) -> void - - # Visit a ForwardingParameterNode node - # -- - # : (ForwardingParameterNode node) -> void - def visit_forwarding_parameter_node: (ForwardingParameterNode node) -> void - - # Visit a ForwardingSuperNode node - # -- - # : (ForwardingSuperNode node) -> void - def visit_forwarding_super_node: (ForwardingSuperNode node) -> void - - # Visit a GlobalVariableAndWriteNode node - # -- - # : (GlobalVariableAndWriteNode node) -> void - def visit_global_variable_and_write_node: (GlobalVariableAndWriteNode node) -> void - - # Visit a GlobalVariableOperatorWriteNode node - # -- - # : (GlobalVariableOperatorWriteNode node) -> void - def visit_global_variable_operator_write_node: (GlobalVariableOperatorWriteNode node) -> void - - # Visit a GlobalVariableOrWriteNode node - # -- - # : (GlobalVariableOrWriteNode node) -> void - def visit_global_variable_or_write_node: (GlobalVariableOrWriteNode node) -> void - - # Visit a GlobalVariableReadNode node - # -- - # : (GlobalVariableReadNode node) -> void - def visit_global_variable_read_node: (GlobalVariableReadNode node) -> void - - # Visit a GlobalVariableTargetNode node - # -- - # : (GlobalVariableTargetNode node) -> void - def visit_global_variable_target_node: (GlobalVariableTargetNode node) -> void - - # Visit a GlobalVariableWriteNode node - # -- - # : (GlobalVariableWriteNode node) -> void - def visit_global_variable_write_node: (GlobalVariableWriteNode node) -> void - - # Visit a HashNode node - # -- - # : (HashNode node) -> void - def visit_hash_node: (HashNode node) -> void - - # Visit a HashPatternNode node - # -- - # : (HashPatternNode node) -> void - def visit_hash_pattern_node: (HashPatternNode node) -> void - - # Visit a IfNode node - # -- - # : (IfNode node) -> void - def visit_if_node: (IfNode node) -> void - - # Visit a ImaginaryNode node - # -- - # : (ImaginaryNode node) -> void - def visit_imaginary_node: (ImaginaryNode node) -> void - - # Visit a ImplicitNode node - # -- - # : (ImplicitNode node) -> void - def visit_implicit_node: (ImplicitNode node) -> void - - # Visit a ImplicitRestNode node - # -- - # : (ImplicitRestNode node) -> void - def visit_implicit_rest_node: (ImplicitRestNode node) -> void - - # Visit a InNode node - # -- - # : (InNode node) -> void - def visit_in_node: (InNode node) -> void - - # Visit a IndexAndWriteNode node - # -- - # : (IndexAndWriteNode node) -> void - def visit_index_and_write_node: (IndexAndWriteNode node) -> void - - # Visit a IndexOperatorWriteNode node - # -- - # : (IndexOperatorWriteNode node) -> void - def visit_index_operator_write_node: (IndexOperatorWriteNode node) -> void - - # Visit a IndexOrWriteNode node - # -- - # : (IndexOrWriteNode node) -> void - def visit_index_or_write_node: (IndexOrWriteNode node) -> void - - # Visit a IndexTargetNode node - # -- - # : (IndexTargetNode node) -> void - def visit_index_target_node: (IndexTargetNode node) -> void - - # Visit a InstanceVariableAndWriteNode node - # -- - # : (InstanceVariableAndWriteNode node) -> void - def visit_instance_variable_and_write_node: (InstanceVariableAndWriteNode node) -> void - - # Visit a InstanceVariableOperatorWriteNode node - # -- - # : (InstanceVariableOperatorWriteNode node) -> void - def visit_instance_variable_operator_write_node: (InstanceVariableOperatorWriteNode node) -> void - - # Visit a InstanceVariableOrWriteNode node - # -- - # : (InstanceVariableOrWriteNode node) -> void - def visit_instance_variable_or_write_node: (InstanceVariableOrWriteNode node) -> void - - # Visit a InstanceVariableReadNode node - # -- - # : (InstanceVariableReadNode node) -> void - def visit_instance_variable_read_node: (InstanceVariableReadNode node) -> void - - # Visit a InstanceVariableTargetNode node - # -- - # : (InstanceVariableTargetNode node) -> void - def visit_instance_variable_target_node: (InstanceVariableTargetNode node) -> void - - # Visit a InstanceVariableWriteNode node - # -- - # : (InstanceVariableWriteNode node) -> void - def visit_instance_variable_write_node: (InstanceVariableWriteNode node) -> void - - # Visit a IntegerNode node - # -- - # : (IntegerNode node) -> void - def visit_integer_node: (IntegerNode node) -> void - - # Visit a InterpolatedMatchLastLineNode node - # -- - # : (InterpolatedMatchLastLineNode node) -> void - def visit_interpolated_match_last_line_node: (InterpolatedMatchLastLineNode node) -> void - - # Visit a InterpolatedRegularExpressionNode node - # -- - # : (InterpolatedRegularExpressionNode node) -> void - def visit_interpolated_regular_expression_node: (InterpolatedRegularExpressionNode node) -> void - - # Visit a InterpolatedStringNode node - # -- - # : (InterpolatedStringNode node) -> void - def visit_interpolated_string_node: (InterpolatedStringNode node) -> void - - # Visit a InterpolatedSymbolNode node - # -- - # : (InterpolatedSymbolNode node) -> void - def visit_interpolated_symbol_node: (InterpolatedSymbolNode node) -> void - - # Visit a InterpolatedXStringNode node - # -- - # : (InterpolatedXStringNode node) -> void - def visit_interpolated_x_string_node: (InterpolatedXStringNode node) -> void - - # Visit a ItLocalVariableReadNode node - # -- - # : (ItLocalVariableReadNode node) -> void - def visit_it_local_variable_read_node: (ItLocalVariableReadNode node) -> void - - # Visit a ItParametersNode node - # -- - # : (ItParametersNode node) -> void - def visit_it_parameters_node: (ItParametersNode node) -> void - - # Visit a KeywordHashNode node - # -- - # : (KeywordHashNode node) -> void - def visit_keyword_hash_node: (KeywordHashNode node) -> void - - # Visit a KeywordRestParameterNode node - # -- - # : (KeywordRestParameterNode node) -> void - def visit_keyword_rest_parameter_node: (KeywordRestParameterNode node) -> void - - # Visit a LambdaNode node - # -- - # : (LambdaNode node) -> void - def visit_lambda_node: (LambdaNode node) -> void - - # Visit a LocalVariableAndWriteNode node - # -- - # : (LocalVariableAndWriteNode node) -> void - def visit_local_variable_and_write_node: (LocalVariableAndWriteNode node) -> void - - # Visit a LocalVariableOperatorWriteNode node - # -- - # : (LocalVariableOperatorWriteNode node) -> void - def visit_local_variable_operator_write_node: (LocalVariableOperatorWriteNode node) -> void - - # Visit a LocalVariableOrWriteNode node - # -- - # : (LocalVariableOrWriteNode node) -> void - def visit_local_variable_or_write_node: (LocalVariableOrWriteNode node) -> void - - # Visit a LocalVariableReadNode node - # -- - # : (LocalVariableReadNode node) -> void - def visit_local_variable_read_node: (LocalVariableReadNode node) -> void - - # Visit a LocalVariableTargetNode node - # -- - # : (LocalVariableTargetNode node) -> void - def visit_local_variable_target_node: (LocalVariableTargetNode node) -> void - - # Visit a LocalVariableWriteNode node - # -- - # : (LocalVariableWriteNode node) -> void - def visit_local_variable_write_node: (LocalVariableWriteNode node) -> void - - # Visit a MatchLastLineNode node - # -- - # : (MatchLastLineNode node) -> void - def visit_match_last_line_node: (MatchLastLineNode node) -> void - - # Visit a MatchPredicateNode node - # -- - # : (MatchPredicateNode node) -> void - def visit_match_predicate_node: (MatchPredicateNode node) -> void - - # Visit a MatchRequiredNode node - # -- - # : (MatchRequiredNode node) -> void - def visit_match_required_node: (MatchRequiredNode node) -> void - - # Visit a MatchWriteNode node - # -- - # : (MatchWriteNode node) -> void - def visit_match_write_node: (MatchWriteNode node) -> void - - # Visit a MissingNode node - # -- - # : (MissingNode node) -> void - def visit_missing_node: (MissingNode node) -> void - - # Visit a ModuleNode node - # -- - # : (ModuleNode node) -> void - def visit_module_node: (ModuleNode node) -> void - - # Visit a MultiTargetNode node - # -- - # : (MultiTargetNode node) -> void - def visit_multi_target_node: (MultiTargetNode node) -> void - - # Visit a MultiWriteNode node - # -- - # : (MultiWriteNode node) -> void - def visit_multi_write_node: (MultiWriteNode node) -> void - - # Visit a NextNode node - # -- - # : (NextNode node) -> void - def visit_next_node: (NextNode node) -> void - - # Visit a NilNode node - # -- - # : (NilNode node) -> void - def visit_nil_node: (NilNode node) -> void - - # Visit a NoBlockParameterNode node - # -- - # : (NoBlockParameterNode node) -> void - def visit_no_block_parameter_node: (NoBlockParameterNode node) -> void - - # Visit a NoKeywordsParameterNode node - # -- - # : (NoKeywordsParameterNode node) -> void - def visit_no_keywords_parameter_node: (NoKeywordsParameterNode node) -> void - - # Visit a NumberedParametersNode node - # -- - # : (NumberedParametersNode node) -> void - def visit_numbered_parameters_node: (NumberedParametersNode node) -> void - - # Visit a NumberedReferenceReadNode node - # -- - # : (NumberedReferenceReadNode node) -> void - def visit_numbered_reference_read_node: (NumberedReferenceReadNode node) -> void - - # Visit a OptionalKeywordParameterNode node - # -- - # : (OptionalKeywordParameterNode node) -> void - def visit_optional_keyword_parameter_node: (OptionalKeywordParameterNode node) -> void - - # Visit a OptionalParameterNode node - # -- - # : (OptionalParameterNode node) -> void - def visit_optional_parameter_node: (OptionalParameterNode node) -> void - - # Visit a OrNode node - # -- - # : (OrNode node) -> void - def visit_or_node: (OrNode node) -> void - - # Visit a ParametersNode node - # -- - # : (ParametersNode node) -> void - def visit_parameters_node: (ParametersNode node) -> void - - # Visit a ParenthesesNode node - # -- - # : (ParenthesesNode node) -> void - def visit_parentheses_node: (ParenthesesNode node) -> void - - # Visit a PinnedExpressionNode node - # -- - # : (PinnedExpressionNode node) -> void - def visit_pinned_expression_node: (PinnedExpressionNode node) -> void - - # Visit a PinnedVariableNode node - # -- - # : (PinnedVariableNode node) -> void - def visit_pinned_variable_node: (PinnedVariableNode node) -> void - - # Visit a PostExecutionNode node - # -- - # : (PostExecutionNode node) -> void - def visit_post_execution_node: (PostExecutionNode node) -> void - - # Visit a PreExecutionNode node - # -- - # : (PreExecutionNode node) -> void - def visit_pre_execution_node: (PreExecutionNode node) -> void - - # Visit a ProgramNode node - # -- - # : (ProgramNode node) -> void - def visit_program_node: (ProgramNode node) -> void - - # Visit a RangeNode node - # -- - # : (RangeNode node) -> void - def visit_range_node: (RangeNode node) -> void - - # Visit a RationalNode node - # -- - # : (RationalNode node) -> void - def visit_rational_node: (RationalNode node) -> void - - # Visit a RedoNode node - # -- - # : (RedoNode node) -> void - def visit_redo_node: (RedoNode node) -> void - - # Visit a RegularExpressionNode node - # -- - # : (RegularExpressionNode node) -> void - def visit_regular_expression_node: (RegularExpressionNode node) -> void - - # Visit a RequiredKeywordParameterNode node - # -- - # : (RequiredKeywordParameterNode node) -> void - def visit_required_keyword_parameter_node: (RequiredKeywordParameterNode node) -> void - - # Visit a RequiredParameterNode node - # -- - # : (RequiredParameterNode node) -> void - def visit_required_parameter_node: (RequiredParameterNode node) -> void - - # Visit a RescueModifierNode node - # -- - # : (RescueModifierNode node) -> void - def visit_rescue_modifier_node: (RescueModifierNode node) -> void - - # Visit a RescueNode node - # -- - # : (RescueNode node) -> void - def visit_rescue_node: (RescueNode node) -> void - - # Visit a RestParameterNode node - # -- - # : (RestParameterNode node) -> void - def visit_rest_parameter_node: (RestParameterNode node) -> void - - # Visit a RetryNode node - # -- - # : (RetryNode node) -> void - def visit_retry_node: (RetryNode node) -> void - - # Visit a ReturnNode node - # -- - # : (ReturnNode node) -> void - def visit_return_node: (ReturnNode node) -> void - - # Visit a SelfNode node - # -- - # : (SelfNode node) -> void - def visit_self_node: (SelfNode node) -> void - - # Visit a ShareableConstantNode node - # -- - # : (ShareableConstantNode node) -> void - def visit_shareable_constant_node: (ShareableConstantNode node) -> void - - # Visit a SingletonClassNode node - # -- - # : (SingletonClassNode node) -> void - def visit_singleton_class_node: (SingletonClassNode node) -> void - - # Visit a SourceEncodingNode node - # -- - # : (SourceEncodingNode node) -> void - def visit_source_encoding_node: (SourceEncodingNode node) -> void - - # Visit a SourceFileNode node - # -- - # : (SourceFileNode node) -> void - def visit_source_file_node: (SourceFileNode node) -> void - - # Visit a SourceLineNode node - # -- - # : (SourceLineNode node) -> void - def visit_source_line_node: (SourceLineNode node) -> void - - # Visit a SplatNode node - # -- - # : (SplatNode node) -> void - def visit_splat_node: (SplatNode node) -> void - - # Visit a StatementsNode node - # -- - # : (StatementsNode node) -> void - def visit_statements_node: (StatementsNode node) -> void - - # Visit a StringNode node - # -- - # : (StringNode node) -> void - def visit_string_node: (StringNode node) -> void - - # Visit a SuperNode node - # -- - # : (SuperNode node) -> void - def visit_super_node: (SuperNode node) -> void - - # Visit a SymbolNode node - # -- - # : (SymbolNode node) -> void - def visit_symbol_node: (SymbolNode node) -> void - - # Visit a TrueNode node - # -- - # : (TrueNode node) -> void - def visit_true_node: (TrueNode node) -> void - - # Visit a UndefNode node - # -- - # : (UndefNode node) -> void - def visit_undef_node: (UndefNode node) -> void - - # Visit a UnlessNode node - # -- - # : (UnlessNode node) -> void - def visit_unless_node: (UnlessNode node) -> void - - # Visit a UntilNode node - # -- - # : (UntilNode node) -> void - def visit_until_node: (UntilNode node) -> void - - # Visit a WhenNode node - # -- - # : (WhenNode node) -> void - def visit_when_node: (WhenNode node) -> void - - # Visit a WhileNode node - # -- - # : (WhileNode node) -> void - def visit_while_node: (WhileNode node) -> void - - # Visit a XStringNode node - # -- - # : (XStringNode node) -> void - def visit_x_string_node: (XStringNode node) -> void - - # Visit a YieldNode node - # -- - # : (YieldNode node) -> void - def visit_yield_node: (YieldNode node) -> void - end -end