diff --git a/Gemfile.lock b/Gemfile.lock index 61aad309..286d3a80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rbi (0.1.11) - prism (>= 0.18.0, < 0.27) + prism (>= 0.18.0, < 0.28) sorbet-runtime (>= 0.5.9204) GEM @@ -26,7 +26,7 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc - prism (0.26.0) + prism (0.27.0) racc (1.7.3) rainbow (3.1.1) rake (13.1.0) diff --git a/rbi.gemspec b/rbi.gemspec index 15686cf7..deab63dd 100644 --- a/rbi.gemspec +++ b/rbi.gemspec @@ -24,6 +24,6 @@ Gem::Specification.new do |spec| "Rakefile", ] - spec.add_dependency("prism", ">= 0.18.0", "< 0.27") + spec.add_dependency("prism", ">= 0.18.0", "< 0.28") spec.add_dependency("sorbet-runtime", ">= 0.5.9204") end diff --git a/sorbet/rbi/gems/prism@0.25.0.rbi b/sorbet/rbi/gems/prism@0.27.0.rbi similarity index 68% rename from sorbet/rbi/gems/prism@0.25.0.rbi rename to sorbet/rbi/gems/prism@0.27.0.rbi index 83968ee5..36267480 100644 --- a/sorbet/rbi/gems/prism@0.25.0.rbi +++ b/sorbet/rbi/gems/prism@0.27.0.rbi @@ -4,6 +4,33 @@ # This is an autogenerated file for types exported from the `prism` gem. # Please instead update this file by running `bin/tapioca gem prism`. +# typed: strict + +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/node.rbi.erb +# if you are looking to modify the template +# =end +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/visitor.rbi.erb +# if you are looking to modify the template +# =end + +# We keep these shims in here because our client libraries might not have +# ast/parser in their bundle. +module AST; end + +class AST::Node; end + +# We keep these shims in here because our client libraries might not have parser +# in their bundle. +module Parser; end + +module Parser::AST; end +class Parser::AST::Node < AST::Node; end +class Parser::Base; end + # The Prism Ruby parser. # # "Parsing Ruby is suddenly manageable!" @@ -22,7 +49,7 @@ module Prism def lex(*_arg0); end # :call-seq: - # Prism::lex_compat(source, **options) -> ParseResult + # Prism::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. The main difference is that the @@ -30,7 +57,8 @@ module Prism # # For supported options, see Prism::parse. # - # source://prism//lib/prism.rb#46 + # source://prism//lib/prism.rb#47 + sig { params(source: String, options: T::Hash[Symbol, T.untyped]).returns(Prism::LexCompat::Result) } def lex_compat(source, **options); end # Mirror the Prism.lex_file API by using the serialization API. @@ -43,7 +71,8 @@ module Prism # returns the same tokens. Raises SyntaxError if the syntax in source is # invalid. # - # source://prism//lib/prism.rb#56 + # source://prism//lib/prism.rb#57 + sig { params(source: String).returns(T::Array[T.untyped]) } def lex_ripper(source); end # :call-seq: @@ -51,7 +80,8 @@ module Prism # # Load the serialized AST using the source as a reference into a tree. # - # source://prism//lib/prism.rb#64 + # source://prism//lib/prism.rb#65 + sig { params(source: String, serialized: String).returns(Prism::ParseResult) } def load(source, serialized); end # Mirror the Prism.parse API by using the serialization API. @@ -60,15 +90,10 @@ module Prism # Mirror the Prism.parse_comments API by using the serialization API. def parse_comments(*_arg0); end - # :call-seq: - # Prism::parse_failure?(source, **options) -> bool - # - # Returns true if the source parses with errors. + # Mirror the Prism.parse_failure? API by using the serialization API. # # @return [Boolean] - # - # source://prism//lib/prism.rb#72 - def parse_failure?(source, **options); end + def parse_failure?(*_arg0); end # Mirror the Prism.parse_file API by using the serialization API. This uses # native strings instead of Ruby strings because it allows us to use mmap @@ -80,15 +105,10 @@ module Prism # to use mmap when it is available. def parse_file_comments(*_arg0); end - # :call-seq: - # Prism::parse_file_failure?(filepath, **options) -> bool - # - # Returns true if the file at filepath parses with errors. + # Mirror the Prism.parse_file_failure? API by using the serialization API. # # @return [Boolean] - # - # source://prism//lib/prism.rb#80 - def parse_file_failure?(filepath, **options); end + def parse_file_failure?(*_arg0); end # Mirror the Prism.parse_file_success? API by using the serialization API. # @@ -116,74 +136,120 @@ end # alias $foo $bar # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#119 +# source://prism//lib/prism/node.rb#135 class Prism::AliasGlobalVariableNode < ::Prism::Node # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void # # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode # - # source://prism//lib/prism/node.rb#121 + # source://prism//lib/prism/node.rb#137 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, new_name, old_name, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#247 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#131 + # source://prism//lib/prism/node.rb#147 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#136 + # source://prism//lib/prism/node.rb#152 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#146 + # source://prism//lib/prism/node.rb#162 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#141 + # source://prism//lib/prism/node.rb#157 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasGlobalVariableNode # - # source://prism//lib/prism/node.rb#151 + # source://prism//lib/prism/node.rb#167 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AliasGlobalVariableNode) + end def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#136 + # source://prism//lib/prism/node.rb#152 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#159 + # source://prism//lib/prism/node.rb#175 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#183 + # source://prism//lib/prism/node.rb#207 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#178 + # source://prism//lib/prism/node.rb#202 + sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `alias` keyword. + # + # alias $foo $bar + # ^^^^^ # - # source://prism//lib/prism/node.rb#170 + # source://prism//lib/prism/node.rb#195 + sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader new_name: Prism::node + # Represents the new name of the global variable that can be used after aliasing. This can be either a global variable, a back reference, or a numbered reference. + # + # alias $foo $bar + # ^^^^ # - # source://prism//lib/prism/node.rb#164 + # source://prism//lib/prism/node.rb#183 + sig { returns(Prism::Node) } def new_name; end - # attr_reader old_name: Prism::node + # Represents the old name of the global variable that could be used before aliasing. This can be either a global variable, a back reference, or a numbered reference. # - # source://prism//lib/prism/node.rb#167 + # alias $foo $bar + # ^^^^ + # + # source://prism//lib/prism/node.rb#189 + sig { returns(Prism::Node) } def old_name; end # Sometimes you want to check an instance of a node against a list of @@ -201,7 +267,8 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#207 + # source://prism//lib/prism/node.rb#231 + sig { override.returns(Symbol) } def type; end class << self @@ -212,7 +279,7 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#217 + # source://prism//lib/prism/node.rb#241 def type; end end end @@ -222,74 +289,111 @@ end # alias foo bar # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#226 +# source://prism//lib/prism/node.rb#259 class Prism::AliasMethodNode < ::Prism::Node # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void # # @return [AliasMethodNode] a new instance of AliasMethodNode # - # source://prism//lib/prism/node.rb#228 + # source://prism//lib/prism/node.rb#261 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, new_name, old_name, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#362 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#238 + # source://prism//lib/prism/node.rb#271 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#243 + # source://prism//lib/prism/node.rb#276 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#253 + # source://prism//lib/prism/node.rb#286 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#248 + # source://prism//lib/prism/node.rb#281 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasMethodNode # - # source://prism//lib/prism/node.rb#258 + # source://prism//lib/prism/node.rb#291 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AliasMethodNode) + end def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#243 + # source://prism//lib/prism/node.rb#276 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#266 + # source://prism//lib/prism/node.rb#299 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#290 + # source://prism//lib/prism/node.rb#322 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#285 + # source://prism//lib/prism/node.rb#317 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#277 + # source://prism//lib/prism/node.rb#310 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader new_name: Prism::node # - # source://prism//lib/prism/node.rb#271 + # source://prism//lib/prism/node.rb#304 + sig { returns(Prism::Node) } def new_name; end # attr_reader old_name: Prism::node # - # source://prism//lib/prism/node.rb#274 + # source://prism//lib/prism/node.rb#307 + sig { returns(Prism::Node) } def old_name; end # Sometimes you want to check an instance of a node against a list of @@ -307,7 +411,8 @@ class Prism::AliasMethodNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#314 + # source://prism//lib/prism/node.rb#346 + sig { override.returns(Symbol) } def type; end class << self @@ -318,7 +423,7 @@ class Prism::AliasMethodNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#324 + # source://prism//lib/prism/node.rb#356 def type; end end end @@ -328,74 +433,111 @@ end # foo => bar | baz # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#333 +# source://prism//lib/prism/node.rb#374 class Prism::AlternationPatternNode < ::Prism::Node # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # # @return [AlternationPatternNode] a new instance of AlternationPatternNode # - # source://prism//lib/prism/node.rb#335 + # source://prism//lib/prism/node.rb#376 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, left, right, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#477 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#345 + # source://prism//lib/prism/node.rb#386 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#350 + # source://prism//lib/prism/node.rb#391 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#360 + # source://prism//lib/prism/node.rb#401 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#355 + # source://prism//lib/prism/node.rb#396 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AlternationPatternNode # - # source://prism//lib/prism/node.rb#365 + # source://prism//lib/prism/node.rb#406 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AlternationPatternNode) + end def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#350 + # source://prism//lib/prism/node.rb#391 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#373 + # source://prism//lib/prism/node.rb#414 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#397 + # source://prism//lib/prism/node.rb#437 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Prism::node # - # source://prism//lib/prism/node.rb#378 + # source://prism//lib/prism/node.rb#419 + sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#392 + # source://prism//lib/prism/node.rb#432 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#384 + # source://prism//lib/prism/node.rb#425 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader right: Prism::node # - # source://prism//lib/prism/node.rb#381 + # source://prism//lib/prism/node.rb#422 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -413,7 +555,8 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#421 + # source://prism//lib/prism/node.rb#461 + sig { override.returns(Symbol) } def type; end class << self @@ -424,7 +567,7 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#431 + # source://prism//lib/prism/node.rb#471 def type; end end end @@ -434,54 +577,87 @@ end # left and right # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#440 +# source://prism//lib/prism/node.rb#489 class Prism::AndNode < ::Prism::Node # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # # @return [AndNode] a new instance of AndNode # - # source://prism//lib/prism/node.rb#442 + # source://prism//lib/prism/node.rb#491 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, left, right, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#607 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#452 + # source://prism//lib/prism/node.rb#501 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#457 + # source://prism//lib/prism/node.rb#506 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#467 + # source://prism//lib/prism/node.rb#516 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#462 + # source://prism//lib/prism/node.rb#511 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AndNode # - # source://prism//lib/prism/node.rb#472 + # source://prism//lib/prism/node.rb#521 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AndNode) + end def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#457 + # source://prism//lib/prism/node.rb#506 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#480 + # source://prism//lib/prism/node.rb#529 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#519 + # source://prism//lib/prism/node.rb#567 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -492,12 +668,14 @@ class Prism::AndNode < ::Prism::Node # 1 && 2 # ^ # - # source://prism//lib/prism/node.rb#491 + # source://prism//lib/prism/node.rb#540 + sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#514 + # source://prism//lib/prism/node.rb#562 + sig { returns(String) } def operator; end # The location of the `and` keyword or the `&&` operator. @@ -505,7 +683,8 @@ class Prism::AndNode < ::Prism::Node # left and right # ^^^ # - # source://prism//lib/prism/node.rb#506 + # source://prism//lib/prism/node.rb#555 + sig { returns(Prism::Location) } def operator_loc; end # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). @@ -516,7 +695,8 @@ class Prism::AndNode < ::Prism::Node # 1 and 2 # ^ # - # source://prism//lib/prism/node.rb#500 + # source://prism//lib/prism/node.rb#549 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -534,7 +714,8 @@ class Prism::AndNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#543 + # source://prism//lib/prism/node.rb#591 + sig { override.returns(Symbol) } def type; end class << self @@ -545,7 +726,7 @@ class Prism::AndNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#553 + # source://prism//lib/prism/node.rb#601 def type; end end end @@ -555,66 +736,99 @@ end # return foo, bar, baz # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#562 +# source://prism//lib/prism/node.rb#619 class Prism::ArgumentsNode < ::Prism::Node # def initialize: (Integer flags, Array[Prism::node] arguments, Location location) -> void # # @return [ArgumentsNode] a new instance of ArgumentsNode # - # source://prism//lib/prism/node.rb#564 + # source://prism//lib/prism/node.rb#621 + sig do + params( + source: Prism::Source, + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).void + end def initialize(source, flags, arguments, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#713 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#573 + # source://prism//lib/prism/node.rb#630 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: Array[Prism::node] # - # source://prism//lib/prism/node.rb#610 + # source://prism//lib/prism/node.rb#667 + sig { returns(T::Array[Prism::Node]) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#578 + # source://prism//lib/prism/node.rb#635 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#588 + # source://prism//lib/prism/node.rb#645 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#583 + # source://prism//lib/prism/node.rb#640 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def contains_keyword_splat?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#614 + # source://prism//lib/prism/node.rb#670 + sig { returns(T::Boolean) } def contains_keyword_splat?; end # def copy: (?flags: Integer, ?arguments: Array[Prism::node], ?location: Location) -> ArgumentsNode # - # source://prism//lib/prism/node.rb#593 + # source://prism//lib/prism/node.rb#650 + sig do + params( + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).returns(Prism::ArgumentsNode) + end def copy(flags: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#578 + # source://prism//lib/prism/node.rb#635 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Prism::node], location: Location } # - # source://prism//lib/prism/node.rb#601 + # source://prism//lib/prism/node.rb#658 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#619 + # source://prism//lib/prism/node.rb#675 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -632,14 +846,16 @@ class Prism::ArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#641 + # source://prism//lib/prism/node.rb#697 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#606 + # source://prism//lib/prism/node.rb#663 + sig { returns(Integer) } def flags; end class << self @@ -650,19 +866,19 @@ class Prism::ArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#651 + # source://prism//lib/prism/node.rb#707 def type; end end end # Flags for arguments nodes. # -# source://prism//lib/prism/node.rb#18814 +# source://prism//lib/prism/node.rb#20337 module Prism::ArgumentsNodeFlags; end # if arguments contain keyword splat # -# source://prism//lib/prism/node.rb#18816 +# source://prism//lib/prism/node.rb#20339 Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer) # Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i. @@ -670,86 +886,137 @@ Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer # [1, 2, 3] # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#660 +# source://prism//lib/prism/node.rb#725 class Prism::ArrayNode < ::Prism::Node # def initialize: (Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [ArrayNode] a new instance of ArrayNode # - # source://prism//lib/prism/node.rb#662 + # source://prism//lib/prism/node.rb#727 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, flags, elements, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#869 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#673 + # source://prism//lib/prism/node.rb#738 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#678 + # source://prism//lib/prism/node.rb#743 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#750 + # source://prism//lib/prism/node.rb#824 + sig { returns(T.nilable(String)) } def closing; end - # attr_reader closing_loc: Location? + # Represents the optional source location for the closing token. # - # source://prism//lib/prism/node.rb#726 + # [1,2,3] # "]" + # %w[foo bar baz] # "]" + # %I(apple orange banana) # ")" + # foo = 1, 2, 3 # nil + # + # source://prism//lib/prism/node.rb#801 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#688 + # source://prism//lib/prism/node.rb#753 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#683 + # source://prism//lib/prism/node.rb#748 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def contains_splat?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#740 + # source://prism//lib/prism/node.rb#814 + sig { returns(T::Boolean) } def contains_splat?; end # def copy: (?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayNode # - # source://prism//lib/prism/node.rb#693 + # source://prism//lib/prism/node.rb#758 + sig do + params( + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::ArrayNode) + end def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#678 + # source://prism//lib/prism/node.rb#743 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#701 + # source://prism//lib/prism/node.rb#766 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader elements: Array[Prism::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. # - # source://prism//lib/prism/node.rb#710 + # source://prism//lib/prism/node.rb#775 + sig { returns(T::Array[Prism::Node]) } def elements; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#755 + # source://prism//lib/prism/node.rb#829 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#745 + # source://prism//lib/prism/node.rb#819 + sig { returns(T.nilable(String)) } def opening; end - # attr_reader opening_loc: Location? + # Represents the optional source location for the opening token. # - # source://prism//lib/prism/node.rb#713 + # [1,2,3] # "[" + # %w[foo bar baz] # "%w[" + # %I(apple orange banana) # "%I(" + # foo = 1, 2, 3 # nil + # + # source://prism//lib/prism/node.rb#783 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # Sometimes you want to check an instance of a node against a list of @@ -767,14 +1034,16 @@ class Prism::ArrayNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#779 + # source://prism//lib/prism/node.rb#853 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#706 + # source://prism//lib/prism/node.rb#771 + sig { returns(Integer) } def flags; end class << self @@ -785,19 +1054,19 @@ class Prism::ArrayNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#789 + # source://prism//lib/prism/node.rb#863 def type; end end end # Flags for array nodes. # -# source://prism//lib/prism/node.rb#18820 +# source://prism//lib/prism/node.rb#20343 module Prism::ArrayNodeFlags; end # if array contains splat nodes # -# source://prism//lib/prism/node.rb#18822 +# source://prism//lib/prism/node.rb#20345 Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # Represents an array pattern in pattern matching. @@ -817,94 +1086,141 @@ Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # foo in Bar[1, 2, 3] # ^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#810 +# source://prism//lib/prism/node.rb#895 class Prism::ArrayPatternNode < ::Prism::Node # def initialize: (Prism::node? constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [ArrayPatternNode] a new instance of ArrayPatternNode # - # source://prism//lib/prism/node.rb#812 + # source://prism//lib/prism/node.rb#897 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + requireds: T::Array[Prism::Node], + rest: T.nilable(Prism::Node), + posts: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, constant, requireds, rest, posts, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1047 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#825 + # source://prism//lib/prism/node.rb#910 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#830 + # source://prism//lib/prism/node.rb#915 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#907 + # source://prism//lib/prism/node.rb#991 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#888 + # source://prism//lib/prism/node.rb#973 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#845 + # source://prism//lib/prism/node.rb#930 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#835 + # source://prism//lib/prism/node.rb#920 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#863 + # source://prism//lib/prism/node.rb#948 + sig { returns(T.nilable(Prism::Node)) } def constant; end # def copy: (?constant: Prism::node?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayPatternNode # - # source://prism//lib/prism/node.rb#850 + # source://prism//lib/prism/node.rb#935 + sig do + params( + constant: T.nilable(Prism::Node), + requireds: T::Array[Prism::Node], + rest: T.nilable(Prism::Node), + posts: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::ArrayPatternNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#830 + # source://prism//lib/prism/node.rb#915 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#858 + # source://prism//lib/prism/node.rb#943 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#912 + # source://prism//lib/prism/node.rb#996 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#902 + # source://prism//lib/prism/node.rb#986 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#875 + # source://prism//lib/prism/node.rb#960 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader posts: Array[Prism::node] # - # source://prism//lib/prism/node.rb#872 + # source://prism//lib/prism/node.rb#957 + sig { returns(T::Array[Prism::Node]) } def posts; end # attr_reader requireds: Array[Prism::node] # - # source://prism//lib/prism/node.rb#866 + # source://prism//lib/prism/node.rb#951 + sig { returns(T::Array[Prism::Node]) } def requireds; end # attr_reader rest: Prism::node? # - # source://prism//lib/prism/node.rb#869 + # source://prism//lib/prism/node.rb#954 + sig { returns(T.nilable(Prism::Node)) } def rest; end # Sometimes you want to check an instance of a node against a list of @@ -922,7 +1238,8 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#947 + # source://prism//lib/prism/node.rb#1031 + sig { override.returns(Symbol) } def type; end class << self @@ -933,7 +1250,7 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#957 + # source://prism//lib/prism/node.rb#1041 def type; end end end @@ -943,54 +1260,87 @@ end # { a => b } # ^^^^^^ # -# source://prism//lib/prism/node.rb#966 +# source://prism//lib/prism/node.rb#1064 class Prism::AssocNode < ::Prism::Node # def initialize: (Prism::node key, Prism::node value, Location? operator_loc, Location location) -> void # # @return [AssocNode] a new instance of AssocNode # - # source://prism//lib/prism/node.rb#968 + # source://prism//lib/prism/node.rb#1066 + sig do + params( + source: Prism::Source, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, key, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1191 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#978 + # source://prism//lib/prism/node.rb#1076 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#983 + # source://prism//lib/prism/node.rb#1081 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#993 + # source://prism//lib/prism/node.rb#1091 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#988 + # source://prism//lib/prism/node.rb#1086 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?, ?location: Location) -> AssocNode # - # source://prism//lib/prism/node.rb#998 + # source://prism//lib/prism/node.rb#1096 + sig do + params( + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::AssocNode) + end def copy(key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#983 + # source://prism//lib/prism/node.rb#1081 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { key: Prism::node, value: Prism::node, operator_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#1006 + # source://prism//lib/prism/node.rb#1104 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1054 + # source://prism//lib/prism/node.rb#1151 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -1004,12 +1354,14 @@ class Prism::AssocNode < ::Prism::Node # { def a; end => 1 } # ^^^^^^^^^^ # - # source://prism//lib/prism/node.rb#1020 + # source://prism//lib/prism/node.rb#1118 + sig { returns(Prism::Node) } def key; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#1049 + # source://prism//lib/prism/node.rb#1146 + sig { returns(T.nilable(String)) } def operator; end # The location of the `=>` operator, if present. @@ -1017,7 +1369,8 @@ class Prism::AssocNode < ::Prism::Node # { foo => bar } # ^^ # - # source://prism//lib/prism/node.rb#1035 + # source://prism//lib/prism/node.rb#1133 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1035,7 +1388,8 @@ class Prism::AssocNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1078 + # source://prism//lib/prism/node.rb#1175 + sig { override.returns(Symbol) } def type; 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). @@ -1046,7 +1400,8 @@ class Prism::AssocNode < ::Prism::Node # { x: 1 } # ^ # - # source://prism//lib/prism/node.rb#1029 + # source://prism//lib/prism/node.rb#1127 + sig { returns(Prism::Node) } def value; end class << self @@ -1057,7 +1412,7 @@ class Prism::AssocNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1088 + # source://prism//lib/prism/node.rb#1185 def type; end end end @@ -1067,59 +1422,91 @@ end # { **foo } # ^^^^^ # -# source://prism//lib/prism/node.rb#1097 +# source://prism//lib/prism/node.rb#1203 class Prism::AssocSplatNode < ::Prism::Node # def initialize: (Prism::node? value, Location operator_loc, Location location) -> void # # @return [AssocSplatNode] a new instance of AssocSplatNode # - # source://prism//lib/prism/node.rb#1099 + # source://prism//lib/prism/node.rb#1205 + sig do + params( + source: Prism::Source, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1312 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1108 + # source://prism//lib/prism/node.rb#1214 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1113 + # source://prism//lib/prism/node.rb#1219 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1125 + # source://prism//lib/prism/node.rb#1231 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1118 + # source://prism//lib/prism/node.rb#1224 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Prism::node?, ?operator_loc: Location, ?location: Location) -> AssocSplatNode # - # source://prism//lib/prism/node.rb#1130 + # source://prism//lib/prism/node.rb#1236 + sig do + params( + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AssocSplatNode) + end def copy(value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1113 + # source://prism//lib/prism/node.rb#1219 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#1138 + # source://prism//lib/prism/node.rb#1244 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1165 + # source://prism//lib/prism/node.rb#1270 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1160 + # source://prism//lib/prism/node.rb#1265 + sig { returns(String) } def operator; end # The location of the `**` operator. @@ -1127,7 +1514,8 @@ class Prism::AssocSplatNode < ::Prism::Node # { **x } # ^^ # - # source://prism//lib/prism/node.rb#1152 + # source://prism//lib/prism/node.rb#1258 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1145,7 +1533,8 @@ class Prism::AssocSplatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1191 + # source://prism//lib/prism/node.rb#1296 + sig { override.returns(Symbol) } def type; end # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. @@ -1153,7 +1542,8 @@ class Prism::AssocSplatNode < ::Prism::Node # { **foo } # ^^^ # - # source://prism//lib/prism/node.rb#1146 + # source://prism//lib/prism/node.rb#1252 + sig { returns(T.nilable(Prism::Node)) } def value; end class << self @@ -1164,14 +1554,14 @@ class Prism::AssocSplatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1201 + # source://prism//lib/prism/node.rb#1306 def type; end end end # The FFI backend is used on other Ruby implementations. # -# source://prism//lib/prism.rb#99 +# source://prism//lib/prism.rb#84 Prism::BACKEND = T.let(T.unsafe(nil), Symbol) # Represents reading a reference to a field in the previous match. @@ -1179,54 +1569,72 @@ Prism::BACKEND = T.let(T.unsafe(nil), Symbol) # $' # ^^ # -# source://prism//lib/prism/node.rb#1210 +# source://prism//lib/prism/node.rb#1323 class Prism::BackReferenceReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode # - # source://prism//lib/prism/node.rb#1212 + # source://prism//lib/prism/node.rb#1325 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1409 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1220 + # source://prism//lib/prism/node.rb#1333 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1225 + # source://prism//lib/prism/node.rb#1338 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1235 + # source://prism//lib/prism/node.rb#1348 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1230 + # source://prism//lib/prism/node.rb#1343 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> BackReferenceReadNode # - # source://prism//lib/prism/node.rb#1240 + # source://prism//lib/prism/node.rb#1353 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::BackReferenceReadNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1225 + # source://prism//lib/prism/node.rb#1338 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#1248 + # source://prism//lib/prism/node.rb#1361 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1261 + # source://prism//lib/prism/node.rb#1373 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # The name of the back-reference variable, including the leading `$`. @@ -1235,7 +1643,8 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # $+ # name `:$+` # - # source://prism//lib/prism/node.rb#1257 + # source://prism//lib/prism/node.rb#1370 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -1253,7 +1662,8 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1281 + # source://prism//lib/prism/node.rb#1393 + sig { override.returns(Symbol) } def type; end class << self @@ -1264,7 +1674,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1291 + # source://prism//lib/prism/node.rb#1403 def type; end end end @@ -1280,16 +1690,19 @@ class Prism::BasicVisitor # call back into this visitor by calling the appropriate `visit_*` method. # # source://prism//lib/prism/visitor.rb#17 + sig { params(node: T.nilable(Prism::Node)).void } def visit(node); end # Visits each node in `nodes` by calling `accept` on each one. # # source://prism//lib/prism/visitor.rb#23 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void } def visit_all(nodes); end # Visits the child nodes of `node` by calling `accept` on each one. # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::Node).void } def visit_child_nodes(node); end end @@ -1300,97 +1713,144 @@ end # end # ^^^^^ # -# source://prism//lib/prism/node.rb#1302 +# source://prism//lib/prism/node.rb#1421 class Prism::BeginNode < ::Prism::Node # def initialize: (Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc, Location location) -> void # # @return [BeginNode] a new instance of BeginNode # - # source://prism//lib/prism/node.rb#1304 + # source://prism//lib/prism/node.rb#1423 + sig do + params( + source: Prism::Source, + begin_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + rescue_clause: T.nilable(Prism::RescueNode), + else_clause: T.nilable(Prism::ElseNode), + ensure_clause: T.nilable(Prism::EnsureNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1587 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1317 + # source://prism//lib/prism/node.rb#1436 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_keyword: () -> String? # - # source://prism//lib/prism/node.rb#1398 + # source://prism//lib/prism/node.rb#1516 + sig { returns(T.nilable(String)) } def begin_keyword; end # attr_reader begin_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#1359 + # source://prism//lib/prism/node.rb#1478 + sig { returns(T.nilable(Prism::Location)) } def begin_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1326 + # source://prism//lib/prism/node.rb#1445 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1341 + # source://prism//lib/prism/node.rb#1460 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1331 + # source://prism//lib/prism/node.rb#1450 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?, ?location: Location) -> BeginNode # - # source://prism//lib/prism/node.rb#1346 + # source://prism//lib/prism/node.rb#1465 + sig do + params( + begin_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + rescue_clause: T.nilable(Prism::RescueNode), + else_clause: T.nilable(Prism::ElseNode), + ensure_clause: T.nilable(Prism::EnsureNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::BeginNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1326 + # source://prism//lib/prism/node.rb#1445 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#1354 + # source://prism//lib/prism/node.rb#1473 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader else_clause: ElseNode? # - # source://prism//lib/prism/node.rb#1378 + # source://prism//lib/prism/node.rb#1497 + sig { returns(T.nilable(Prism::ElseNode)) } def else_clause; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#1403 + # source://prism//lib/prism/node.rb#1521 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#1384 + # source://prism//lib/prism/node.rb#1503 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # attr_reader ensure_clause: EnsureNode? # - # source://prism//lib/prism/node.rb#1381 + # source://prism//lib/prism/node.rb#1500 + sig { returns(T.nilable(Prism::EnsureNode)) } def ensure_clause; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1408 + # source://prism//lib/prism/node.rb#1526 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader rescue_clause: RescueNode? # - # source://prism//lib/prism/node.rb#1375 + # source://prism//lib/prism/node.rb#1494 + sig { returns(T.nilable(Prism::RescueNode)) } def rescue_clause; end - # source://prism//lib/prism/node.rb#1321 + # source://prism//lib/prism/node.rb#1440 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#1372 + # source://prism//lib/prism/node.rb#1491 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -1408,7 +1868,8 @@ class Prism::BeginNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1453 + # source://prism//lib/prism/node.rb#1571 + sig { override.returns(Symbol) } def type; end class << self @@ -1419,7 +1880,7 @@ class Prism::BeginNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1463 + # source://prism//lib/prism/node.rb#1581 def type; end end end @@ -1429,69 +1890,103 @@ end # bar(&args) # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#1472 +# source://prism//lib/prism/node.rb#1602 class Prism::BlockArgumentNode < ::Prism::Node # def initialize: (Prism::node? expression, Location operator_loc, Location location) -> void # # @return [BlockArgumentNode] a new instance of BlockArgumentNode # - # source://prism//lib/prism/node.rb#1474 + # source://prism//lib/prism/node.rb#1604 + sig do + params( + source: Prism::Source, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, expression, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1705 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1483 + # source://prism//lib/prism/node.rb#1613 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1488 + # source://prism//lib/prism/node.rb#1618 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1500 + # source://prism//lib/prism/node.rb#1630 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1493 + # source://prism//lib/prism/node.rb#1623 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?expression: Prism::node?, ?operator_loc: Location, ?location: Location) -> BlockArgumentNode # - # source://prism//lib/prism/node.rb#1505 + # source://prism//lib/prism/node.rb#1635 + sig do + params( + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockArgumentNode) + end def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1488 + # source://prism//lib/prism/node.rb#1618 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#1513 + # source://prism//lib/prism/node.rb#1643 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader expression: Prism::node? # - # source://prism//lib/prism/node.rb#1518 + # source://prism//lib/prism/node.rb#1648 + sig { returns(T.nilable(Prism::Node)) } def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1534 + # source://prism//lib/prism/node.rb#1663 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1529 + # source://prism//lib/prism/node.rb#1658 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#1521 + # source://prism//lib/prism/node.rb#1651 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -1509,7 +2004,8 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1560 + # source://prism//lib/prism/node.rb#1689 + sig { override.returns(Symbol) } def type; end class << self @@ -1520,7 +2016,7 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1570 + # source://prism//lib/prism/node.rb#1699 def type; end end end @@ -1530,66 +2026,86 @@ end # a { |; b| } # ^ # -# source://prism//lib/prism/node.rb#1579 +# source://prism//lib/prism/node.rb#1716 class Prism::BlockLocalVariableNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location location) -> void # # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode # - # source://prism//lib/prism/node.rb#1581 + # source://prism//lib/prism/node.rb#1718 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } def initialize(source, flags, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1810 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1590 + # source://prism//lib/prism/node.rb#1727 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1595 + # source://prism//lib/prism/node.rb#1732 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1605 + # source://prism//lib/prism/node.rb#1742 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1600 + # source://prism//lib/prism/node.rb#1737 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> BlockLocalVariableNode # - # source://prism//lib/prism/node.rb#1610 + # source://prism//lib/prism/node.rb#1747 + sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::BlockLocalVariableNode) } def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1595 + # source://prism//lib/prism/node.rb#1732 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#1618 + # source://prism//lib/prism/node.rb#1755 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1636 + # source://prism//lib/prism/node.rb#1772 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#1627 + # source://prism//lib/prism/node.rb#1764 + sig { returns(Symbol) } def name; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#1631 + # source://prism//lib/prism/node.rb#1767 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -1607,14 +2123,16 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1658 + # source://prism//lib/prism/node.rb#1794 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#1623 + # source://prism//lib/prism/node.rb#1760 + sig { returns(Integer) } def flags; end class << self @@ -1625,7 +2143,7 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1668 + # source://prism//lib/prism/node.rb#1804 def type; end end end @@ -1635,89 +2153,133 @@ end # [1, 2, 3].each { |i| puts x } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#1677 +# source://prism//lib/prism/node.rb#1821 class Prism::BlockNode < ::Prism::Node # def initialize: (Array[Symbol] locals, Prism::node? parameters, Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void # # @return [BlockNode] a new instance of BlockNode # - # source://prism//lib/prism/node.rb#1679 + # source://prism//lib/prism/node.rb#1823 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, locals, parameters, body, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#1954 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1691 + # source://prism//lib/prism/node.rb#1835 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#1733 + # source://prism//lib/prism/node.rb#1877 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1696 + # source://prism//lib/prism/node.rb#1840 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#1756 + # source://prism//lib/prism/node.rb#1899 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#1743 + # source://prism//lib/prism/node.rb#1887 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1709 + # source://prism//lib/prism/node.rb#1853 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1701 + # source://prism//lib/prism/node.rb#1845 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?locals: Array[Symbol], ?parameters: Prism::node?, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> BlockNode # - # source://prism//lib/prism/node.rb#1714 + # source://prism//lib/prism/node.rb#1858 + sig do + params( + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockNode) + end def copy(locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1696 + # source://prism//lib/prism/node.rb#1840 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Prism::node?, body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#1722 + # source://prism//lib/prism/node.rb#1866 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1761 + # source://prism//lib/prism/node.rb#1904 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#1727 + # source://prism//lib/prism/node.rb#1871 + sig { returns(T::Array[Symbol]) } def locals; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#1751 + # source://prism//lib/prism/node.rb#1894 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#1736 + # source://prism//lib/prism/node.rb#1880 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader parameters: Prism::node? # - # source://prism//lib/prism/node.rb#1730 + # source://prism//lib/prism/node.rb#1874 + sig { returns(T.nilable(Prism::Node)) } def parameters; end # Sometimes you want to check an instance of a node against a list of @@ -1735,7 +2297,8 @@ class Prism::BlockNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1795 + # source://prism//lib/prism/node.rb#1938 + sig { override.returns(Symbol) } def type; end class << self @@ -1746,7 +2309,7 @@ class Prism::BlockNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1805 + # source://prism//lib/prism/node.rb#1948 def type; end end end @@ -1757,81 +2320,121 @@ end # ^^ # end # -# source://prism//lib/prism/node.rb#1815 +# source://prism//lib/prism/node.rb#1970 class Prism::BlockParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # # @return [BlockParameterNode] a new instance of BlockParameterNode # - # source://prism//lib/prism/node.rb#1817 + # source://prism//lib/prism/node.rb#1972 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2097 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1828 + # source://prism//lib/prism/node.rb#1983 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1833 + # source://prism//lib/prism/node.rb#1988 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1843 + # source://prism//lib/prism/node.rb#1998 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1838 + # source://prism//lib/prism/node.rb#1993 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> BlockParameterNode # - # source://prism//lib/prism/node.rb#1848 + # source://prism//lib/prism/node.rb#2003 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1833 + # source://prism//lib/prism/node.rb#1988 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#1856 + # source://prism//lib/prism/node.rb#2011 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#1899 + # source://prism//lib/prism/node.rb#2053 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#1865 + # source://prism//lib/prism/node.rb#2020 + sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#1868 + # source://prism//lib/prism/node.rb#2023 + sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#1894 + # source://prism//lib/prism/node.rb#2048 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#1881 + # source://prism//lib/prism/node.rb#2036 + sig { returns(Prism::Location) } def operator_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#1889 + # source://prism//lib/prism/node.rb#2043 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -1849,14 +2452,16 @@ class Prism::BlockParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#1927 + # source://prism//lib/prism/node.rb#2081 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#1861 + # source://prism//lib/prism/node.rb#2016 + sig { returns(Integer) } def flags; end class << self @@ -1867,7 +2472,7 @@ class Prism::BlockParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#1937 + # source://prism//lib/prism/node.rb#2091 def type; end end end @@ -1881,84 +2486,125 @@ end # ^^^^^^^^^^^^^^^^^ # end # -# source://prism//lib/prism/node.rb#1950 +# source://prism//lib/prism/node.rb#2114 class Prism::BlockParametersNode < ::Prism::Node # def initialize: (ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [BlockParametersNode] a new instance of BlockParametersNode # - # source://prism//lib/prism/node.rb#1952 + # source://prism//lib/prism/node.rb#2116 + sig do + params( + source: Prism::Source, + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, parameters, locals, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2249 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#1963 + # source://prism//lib/prism/node.rb#2127 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1968 + # source://prism//lib/prism/node.rb#2132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#2037 + # source://prism//lib/prism/node.rb#2200 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#2018 + # source://prism//lib/prism/node.rb#2182 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#1981 + # source://prism//lib/prism/node.rb#2145 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#1973 + # source://prism//lib/prism/node.rb#2137 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> BlockParametersNode # - # source://prism//lib/prism/node.rb#1986 + # source://prism//lib/prism/node.rb#2150 + sig do + params( + parameters: T.nilable(Prism::ParametersNode), + locals: T::Array[Prism::BlockLocalVariableNode], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::BlockParametersNode) + end def copy(parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#1968 + # source://prism//lib/prism/node.rb#2132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#1994 + # source://prism//lib/prism/node.rb#2158 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2042 + # source://prism//lib/prism/node.rb#2205 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[BlockLocalVariableNode] # - # source://prism//lib/prism/node.rb#2002 + # source://prism//lib/prism/node.rb#2166 + sig { returns(T::Array[Prism::BlockLocalVariableNode]) } def locals; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#2032 + # source://prism//lib/prism/node.rb#2195 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#2005 + # source://prism//lib/prism/node.rb#2169 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//lib/prism/node.rb#1999 + # source://prism//lib/prism/node.rb#2163 + sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end # Sometimes you want to check an instance of a node against a list of @@ -1976,7 +2622,8 @@ class Prism::BlockParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#2070 + # source://prism//lib/prism/node.rb#2233 + sig { override.returns(Symbol) } def type; end class << self @@ -1987,7 +2634,7 @@ class Prism::BlockParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#2080 + # source://prism//lib/prism/node.rb#2243 def type; end end end @@ -1997,69 +2644,109 @@ end # break foo # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2089 +# source://prism//lib/prism/node.rb#2263 class Prism::BreakNode < ::Prism::Node # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # # @return [BreakNode] a new instance of BreakNode # - # source://prism//lib/prism/node.rb#2091 + # source://prism//lib/prism/node.rb#2265 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, arguments, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2372 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2100 + # source://prism//lib/prism/node.rb#2274 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? + # 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). # - # source://prism//lib/prism/node.rb#2135 + # break foo + # ^^^ + # + # source://prism//lib/prism/node.rb#2312 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2105 + # source://prism//lib/prism/node.rb#2279 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2117 + # source://prism//lib/prism/node.rb#2291 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2110 + # source://prism//lib/prism/node.rb#2284 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> BreakNode # - # source://prism//lib/prism/node.rb#2122 + # source://prism//lib/prism/node.rb#2296 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BreakNode) + end def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2105 + # source://prism//lib/prism/node.rb#2279 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#2130 + # source://prism//lib/prism/node.rb#2304 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2151 + # source://prism//lib/prism/node.rb#2330 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#2146 + # source://prism//lib/prism/node.rb#2325 + sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `break` keyword. # - # source://prism//lib/prism/node.rb#2138 + # break foo + # ^^^^^ + # + # source://prism//lib/prism/node.rb#2318 + sig { returns(Prism::Location) } def keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -2077,7 +2764,8 @@ class Prism::BreakNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#2177 + # source://prism//lib/prism/node.rb#2356 + sig { override.returns(Symbol) } def type; end class << self @@ -2088,7 +2776,7 @@ class Prism::BreakNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#2187 + # source://prism//lib/prism/node.rb#2366 def type; end end end @@ -2098,115 +2786,169 @@ end # foo.bar &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2196 +# source://prism//lib/prism/node.rb#2383 class Prism::CallAndWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void # # @return [CallAndWriteNode] a new instance of CallAndWriteNode # - # source://prism//lib/prism/node.rb#2198 + # source://prism//lib/prism/node.rb#2385 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2570 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2213 + # source://prism//lib/prism/node.rb#2400 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2309 + # source://prism//lib/prism/node.rb#2495 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2319 + # source://prism//lib/prism/node.rb#2505 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2256 + # source://prism//lib/prism/node.rb#2443 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2218 + # source://prism//lib/prism/node.rb#2405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2231 + # source://prism//lib/prism/node.rb#2418 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2223 + # source://prism//lib/prism/node.rb#2410 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallAndWriteNode # - # source://prism//lib/prism/node.rb#2236 + # source://prism//lib/prism/node.rb#2423 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::CallAndWriteNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2218 + # source://prism//lib/prism/node.rb#2405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#2244 + # source://prism//lib/prism/node.rb#2431 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2314 + # source://prism//lib/prism/node.rb#2500 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2334 + # source://prism//lib/prism/node.rb#2520 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2324 + # source://prism//lib/prism/node.rb#2510 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2269 + # source://prism//lib/prism/node.rb#2456 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#2329 + # source://prism//lib/prism/node.rb#2515 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#2288 + # source://prism//lib/prism/node.rb#2475 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2282 + # source://prism//lib/prism/node.rb#2469 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2253 + # source://prism//lib/prism/node.rb#2440 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2299 + # source://prism//lib/prism/node.rb#2485 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2224,31 +2966,36 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#2368 + # source://prism//lib/prism/node.rb#2554 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2295 + # source://prism//lib/prism/node.rb#2482 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2304 + # source://prism//lib/prism/node.rb#2490 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2285 + # source://prism//lib/prism/node.rb#2472 + sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#2249 + # source://prism//lib/prism/node.rb#2436 + sig { returns(Integer) } def flags; end class << self @@ -2259,7 +3006,7 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#2378 + # source://prism//lib/prism/node.rb#2564 def type; end end end @@ -2284,123 +3031,181 @@ end # foo&.bar # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#2402 +# source://prism//lib/prism/node.rb#2602 class Prism::CallNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Prism::node? block, Location location) -> void # # @return [CallNode] a new instance of CallNode # - # source://prism//lib/prism/node.rb#2404 + # source://prism//lib/prism/node.rb#2604 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + name: Symbol, + message_loc: T.nilable(Prism::Location), + opening_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#2834 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2420 + # source://prism//lib/prism/node.rb#2620 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#2515 + # source://prism//lib/prism/node.rb#2715 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2545 + # source://prism//lib/prism/node.rb#2744 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#2531 + # source://prism//lib/prism/node.rb#2731 + sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2555 + # source://prism//lib/prism/node.rb#2754 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2473 + # source://prism//lib/prism/node.rb#2673 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2425 + # source://prism//lib/prism/node.rb#2625 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#2570 + # source://prism//lib/prism/node.rb#2769 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#2518 + # source://prism//lib/prism/node.rb#2718 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2439 + # source://prism//lib/prism/node.rb#2639 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2430 + # source://prism//lib/prism/node.rb#2630 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: Prism::node?, ?location: Location) -> CallNode # - # source://prism//lib/prism/node.rb#2444 + # source://prism//lib/prism/node.rb#2644 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + name: Symbol, + message_loc: T.nilable(Prism::Location), + opening_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::CallNode) + end def copy(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), block: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2425 + # source://prism//lib/prism/node.rb#2625 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Prism::node?, location: Location } # - # source://prism//lib/prism/node.rb#2452 + # source://prism//lib/prism/node.rb#2652 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2550 + # source://prism//lib/prism/node.rb#2749 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2575 + # source://prism//lib/prism/node.rb#2774 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2560 + # source://prism//lib/prism/node.rb#2759 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2489 + # source://prism//lib/prism/node.rb#2689 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#2486 + # source://prism//lib/prism/node.rb#2686 + sig { returns(Symbol) } def name; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#2565 + # source://prism//lib/prism/node.rb#2764 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#2502 + # source://prism//lib/prism/node.rb#2702 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; 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). @@ -2414,14 +3219,16 @@ class Prism::CallNode < ::Prism::Node # foo + bar # ^^^ # - # source://prism//lib/prism/node.rb#2470 + # source://prism//lib/prism/node.rb#2670 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2535 + # source://prism//lib/prism/node.rb#2734 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2439,21 +3246,24 @@ class Prism::CallNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#2619 + # source://prism//lib/prism/node.rb#2818 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2540 + # source://prism//lib/prism/node.rb#2739 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#2457 + # source://prism//lib/prism/node.rb#2657 + sig { returns(Integer) } def flags; end class << self @@ -2464,34 +3274,34 @@ class Prism::CallNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#2629 + # source://prism//lib/prism/node.rb#2828 def type; end end end # Flags for call nodes. # -# source://prism//lib/prism/node.rb#18826 +# source://prism//lib/prism/node.rb#20349 module Prism::CallNodeFlags; end # a call that is an attribute write, so the value being written should be returned # -# source://prism//lib/prism/node.rb#18834 +# source://prism//lib/prism/node.rb#20357 Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) # a call that ignores method visibility # -# source://prism//lib/prism/node.rb#18837 +# source://prism//lib/prism/node.rb#20360 Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) # &. operator # -# source://prism//lib/prism/node.rb#18828 +# source://prism//lib/prism/node.rb#20351 Prism::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer) # a call that could have been a local variable # -# source://prism//lib/prism/node.rb#18831 +# source://prism//lib/prism/node.rb#20354 Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # Represents the use of an assignment operator on a call. @@ -2499,115 +3309,171 @@ Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # foo.bar += baz # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2638 +# source://prism//lib/prism/node.rb#2852 class Prism::CallOperatorWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void # # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode # - # source://prism//lib/prism/node.rb#2640 + # source://prism//lib/prism/node.rb#2854 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3039 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2656 + # source://prism//lib/prism/node.rb#2870 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2755 + # source://prism//lib/prism/node.rb#2968 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2765 + # source://prism//lib/prism/node.rb#2978 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2699 + # source://prism//lib/prism/node.rb#2913 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2661 + # source://prism//lib/prism/node.rb#2875 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2674 + # source://prism//lib/prism/node.rb#2888 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2666 + # source://prism//lib/prism/node.rb#2880 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode # - # source://prism//lib/prism/node.rb#2679 + # source://prism//lib/prism/node.rb#2893 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::CallOperatorWriteNode) + end def copy(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: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2661 + # source://prism//lib/prism/node.rb#2875 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#2687 + # source://prism//lib/prism/node.rb#2901 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2760 + # source://prism//lib/prism/node.rb#2973 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2775 + # source://prism//lib/prism/node.rb#2988 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2770 + # source://prism//lib/prism/node.rb#2983 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2712 + # source://prism//lib/prism/node.rb#2926 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#2731 + # source://prism//lib/prism/node.rb#2945 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#2734 + # source://prism//lib/prism/node.rb#2948 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2725 + # source://prism//lib/prism/node.rb#2939 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2696 + # source://prism//lib/prism/node.rb#2910 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2745 + # source://prism//lib/prism/node.rb#2958 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2625,31 +3491,36 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#2810 + # source://prism//lib/prism/node.rb#3023 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2741 + # source://prism//lib/prism/node.rb#2955 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2750 + # source://prism//lib/prism/node.rb#2963 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2728 + # source://prism//lib/prism/node.rb#2942 + sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#2692 + # source://prism//lib/prism/node.rb#2906 + sig { returns(Integer) } def flags; end class << self @@ -2660,7 +3531,7 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#2820 + # source://prism//lib/prism/node.rb#3033 def type; end end end @@ -2670,115 +3541,169 @@ end # foo.bar ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#2829 +# source://prism//lib/prism/node.rb#3057 class Prism::CallOrWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void # # @return [CallOrWriteNode] a new instance of CallOrWriteNode # - # source://prism//lib/prism/node.rb#2831 + # source://prism//lib/prism/node.rb#3059 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3244 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#2846 + # source://prism//lib/prism/node.rb#3074 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2942 + # source://prism//lib/prism/node.rb#3169 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#2952 + # source://prism//lib/prism/node.rb#3179 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#2889 + # source://prism//lib/prism/node.rb#3117 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2851 + # source://prism//lib/prism/node.rb#3079 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#2864 + # source://prism//lib/prism/node.rb#3092 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#2856 + # source://prism//lib/prism/node.rb#3084 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOrWriteNode # - # source://prism//lib/prism/node.rb#2869 + # source://prism//lib/prism/node.rb#3097 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + message_loc: T.nilable(Prism::Location), + read_name: Symbol, + write_name: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::CallOrWriteNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#2851 + # source://prism//lib/prism/node.rb#3079 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#2877 + # source://prism//lib/prism/node.rb#3105 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2947 + # source://prism//lib/prism/node.rb#3174 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#2967 + # source://prism//lib/prism/node.rb#3194 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def message: () -> String? # - # source://prism//lib/prism/node.rb#2957 + # source://prism//lib/prism/node.rb#3184 + sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism//lib/prism/node.rb#2902 + # source://prism//lib/prism/node.rb#3130 + sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#2962 + # source://prism//lib/prism/node.rb#3189 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#2921 + # source://prism//lib/prism/node.rb#3149 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism//lib/prism/node.rb#2915 + # source://prism//lib/prism/node.rb#3143 + sig { returns(Symbol) } def read_name; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#2886 + # source://prism//lib/prism/node.rb#3114 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2932 + # source://prism//lib/prism/node.rb#3159 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2796,31 +3721,36 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3001 + # source://prism//lib/prism/node.rb#3228 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#2928 + # source://prism//lib/prism/node.rb#3156 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#2937 + # source://prism//lib/prism/node.rb#3164 + sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism//lib/prism/node.rb#2918 + # source://prism//lib/prism/node.rb#3146 + sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#2882 + # source://prism//lib/prism/node.rb#3110 + sig { returns(Integer) } def flags; end class << self @@ -2831,7 +3761,7 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3011 + # source://prism//lib/prism/node.rb#3238 def type; end end end @@ -2849,105 +3779,151 @@ end # for foo.bar in baz do end # ^^^^^^^ # -# source://prism//lib/prism/node.rb#3028 +# source://prism//lib/prism/node.rb#3269 class Prism::CallTargetNode < ::Prism::Node # def initialize: (Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void # # @return [CallTargetNode] a new instance of CallTargetNode # - # source://prism//lib/prism/node.rb#3030 + # source://prism//lib/prism/node.rb#3271 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3412 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3042 + # source://prism//lib/prism/node.rb#3283 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3110 + # source://prism//lib/prism/node.rb#3350 + sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String # - # source://prism//lib/prism/node.rb#3120 + # source://prism//lib/prism/node.rb#3360 + sig { returns(String) } def call_operator; end # attr_reader call_operator_loc: Location # - # source://prism//lib/prism/node.rb#3082 + # source://prism//lib/prism/node.rb#3323 + sig { returns(Prism::Location) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3047 + # source://prism//lib/prism/node.rb#3288 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3057 + # source://prism//lib/prism/node.rb#3298 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3052 + # source://prism//lib/prism/node.rb#3293 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location, ?location: Location) -> CallTargetNode # - # source://prism//lib/prism/node.rb#3062 + # source://prism//lib/prism/node.rb#3303 + sig do + params( + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CallTargetNode) + end def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3047 + # source://prism//lib/prism/node.rb#3288 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#3070 + # source://prism//lib/prism/node.rb#3311 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3115 + # source://prism//lib/prism/node.rb#3355 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3130 + # source://prism//lib/prism/node.rb#3370 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def message: () -> String # - # source://prism//lib/prism/node.rb#3125 + # source://prism//lib/prism/node.rb#3365 + sig { returns(String) } def message; end # attr_reader message_loc: Location # - # source://prism//lib/prism/node.rb#3092 + # source://prism//lib/prism/node.rb#3333 + sig { returns(Prism::Location) } def message_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3089 + # source://prism//lib/prism/node.rb#3330 + sig { returns(Symbol) } def name; end # attr_reader receiver: Prism::node # - # source://prism//lib/prism/node.rb#3079 + # source://prism//lib/prism/node.rb#3320 + sig { returns(Prism::Node) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3100 + # source://prism//lib/prism/node.rb#3340 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -2965,21 +3941,24 @@ class Prism::CallTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3156 + # source://prism//lib/prism/node.rb#3396 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#3105 + # source://prism//lib/prism/node.rb#3345 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#3075 + # source://prism//lib/prism/node.rb#3316 + sig { returns(Integer) } def flags; end class << self @@ -2990,7 +3969,7 @@ class Prism::CallTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3166 + # source://prism//lib/prism/node.rb#3406 def type; end end end @@ -3000,69 +3979,105 @@ end # foo => [bar => baz] # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3175 +# source://prism//lib/prism/node.rb#3426 class Prism::CapturePatternNode < ::Prism::Node # def initialize: (Prism::node value, Prism::node target, Location operator_loc, Location location) -> void # # @return [CapturePatternNode] a new instance of CapturePatternNode # - # source://prism//lib/prism/node.rb#3177 + # source://prism//lib/prism/node.rb#3428 + sig do + params( + source: Prism::Source, + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, target, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3529 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3187 + # source://prism//lib/prism/node.rb#3438 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3192 + # source://prism//lib/prism/node.rb#3443 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3202 + # source://prism//lib/prism/node.rb#3453 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3197 + # source://prism//lib/prism/node.rb#3448 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Prism::node, ?target: Prism::node, ?operator_loc: Location, ?location: Location) -> CapturePatternNode # - # source://prism//lib/prism/node.rb#3207 + # source://prism//lib/prism/node.rb#3458 + sig do + params( + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CapturePatternNode) + end def copy(value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3192 + # source://prism//lib/prism/node.rb#3443 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, target: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#3215 + # source://prism//lib/prism/node.rb#3466 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3239 + # source://prism//lib/prism/node.rb#3489 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#3234 + # source://prism//lib/prism/node.rb#3484 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#3226 + # source://prism//lib/prism/node.rb#3477 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: Prism::node # - # source://prism//lib/prism/node.rb#3223 + # source://prism//lib/prism/node.rb#3474 + sig { returns(Prism::Node) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -3080,12 +4095,14 @@ class Prism::CapturePatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3263 + # source://prism//lib/prism/node.rb#3513 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3220 + # source://prism//lib/prism/node.rb#3471 + sig { returns(Prism::Node) } def value; end class << self @@ -3096,7 +4113,7 @@ class Prism::CapturePatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3273 + # source://prism//lib/prism/node.rb#3523 def type; end end end @@ -3108,89 +4125,133 @@ end # end # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3284 +# source://prism//lib/prism/node.rb#3543 class Prism::CaseMatchNode < ::Prism::Node # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseMatchNode] a new instance of CaseMatchNode # - # source://prism//lib/prism/node.rb#3286 + # source://prism//lib/prism/node.rb#3545 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3677 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3298 + # source://prism//lib/prism/node.rb#3557 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def case_keyword: () -> String # - # source://prism//lib/prism/node.rb#3359 + # source://prism//lib/prism/node.rb#3617 + sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3344 + # source://prism//lib/prism/node.rb#3603 + sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3303 + # source://prism//lib/prism/node.rb#3562 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3317 + # source://prism//lib/prism/node.rb#3576 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3308 + # source://prism//lib/prism/node.rb#3567 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#3338 + # source://prism//lib/prism/node.rb#3597 + sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism//lib/prism/node.rb#3341 + # source://prism//lib/prism/node.rb#3600 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseMatchNode # - # source://prism//lib/prism/node.rb#3322 + # source://prism//lib/prism/node.rb#3581 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CaseMatchNode) + end def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3303 + # source://prism//lib/prism/node.rb#3562 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#3330 + # source://prism//lib/prism/node.rb#3589 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3364 + # source://prism//lib/prism/node.rb#3622 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3351 + # source://prism//lib/prism/node.rb#3610 + sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3369 + # source://prism//lib/prism/node.rb#3627 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Prism::node? # - # source://prism//lib/prism/node.rb#3335 + # source://prism//lib/prism/node.rb#3594 + sig { returns(T.nilable(Prism::Node)) } def predicate; end # Sometimes you want to check an instance of a node against a list of @@ -3208,7 +4269,8 @@ class Prism::CaseMatchNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3403 + # source://prism//lib/prism/node.rb#3661 + sig { override.returns(Symbol) } def type; end class << self @@ -3219,7 +4281,7 @@ class Prism::CaseMatchNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3413 + # source://prism//lib/prism/node.rb#3671 def type; end end end @@ -3231,89 +4293,133 @@ end # end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3424 +# source://prism//lib/prism/node.rb#3694 class Prism::CaseNode < ::Prism::Node # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseNode] a new instance of CaseNode # - # source://prism//lib/prism/node.rb#3426 + # source://prism//lib/prism/node.rb#3696 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#3828 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3438 + # source://prism//lib/prism/node.rb#3708 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def case_keyword: () -> String # - # source://prism//lib/prism/node.rb#3499 + # source://prism//lib/prism/node.rb#3768 + sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3484 + # source://prism//lib/prism/node.rb#3754 + sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3443 + # source://prism//lib/prism/node.rb#3713 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3457 + # source://prism//lib/prism/node.rb#3727 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3448 + # source://prism//lib/prism/node.rb#3718 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#3478 + # source://prism//lib/prism/node.rb#3748 + sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism//lib/prism/node.rb#3481 + # source://prism//lib/prism/node.rb#3751 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseNode # - # source://prism//lib/prism/node.rb#3462 + # source://prism//lib/prism/node.rb#3732 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::CaseNode) + end def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3443 + # source://prism//lib/prism/node.rb#3713 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#3470 + # source://prism//lib/prism/node.rb#3740 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3504 + # source://prism//lib/prism/node.rb#3773 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3491 + # source://prism//lib/prism/node.rb#3761 + sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3509 + # source://prism//lib/prism/node.rb#3778 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader predicate: Prism::node? # - # source://prism//lib/prism/node.rb#3475 + # source://prism//lib/prism/node.rb#3745 + sig { returns(T.nilable(Prism::Node)) } def predicate; end # Sometimes you want to check an instance of a node against a list of @@ -3331,7 +4437,8 @@ class Prism::CaseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3543 + # source://prism//lib/prism/node.rb#3812 + sig { override.returns(Symbol) } def type; end class << self @@ -3342,7 +4449,7 @@ class Prism::CaseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3553 + # source://prism//lib/prism/node.rb#3822 def type; end end end @@ -3352,109 +4459,163 @@ end # class Foo end # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3562 +# source://prism//lib/prism/node.rb#3843 class Prism::ClassNode < ::Prism::Node # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Prism::node constant_path, Location? inheritance_operator_loc, Prism::node? superclass, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void # # @return [ClassNode] a new instance of ClassNode # - # source://prism//lib/prism/node.rb#3564 + # source://prism//lib/prism/node.rb#3845 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4008 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3579 + # source://prism//lib/prism/node.rb#3860 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#3645 + # source://prism//lib/prism/node.rb#3926 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3584 + # source://prism//lib/prism/node.rb#3865 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def class_keyword: () -> String # - # source://prism//lib/prism/node.rb#3659 + # source://prism//lib/prism/node.rb#3939 + sig { returns(String) } def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3619 + # source://prism//lib/prism/node.rb#3900 + sig { returns(Prism::Location) } def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3598 + # source://prism//lib/prism/node.rb#3879 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3589 + # source://prism//lib/prism/node.rb#3870 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader constant_path: Prism::node # - # source://prism//lib/prism/node.rb#3626 + # source://prism//lib/prism/node.rb#3907 + sig { returns(Prism::Node) } def constant_path; end # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: Prism::node, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ClassNode # - # source://prism//lib/prism/node.rb#3603 + # source://prism//lib/prism/node.rb#3884 + sig do + params( + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).returns(Prism::ClassNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3584 + # source://prism//lib/prism/node.rb#3865 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, constant_path: Prism::node, inheritance_operator_loc: Location?, superclass: Prism::node?, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#3611 + # source://prism//lib/prism/node.rb#3892 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#3669 + # source://prism//lib/prism/node.rb#3949 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#3648 + # source://prism//lib/prism/node.rb#3929 + sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inheritance_operator: () -> String? # - # source://prism//lib/prism/node.rb#3664 + # source://prism//lib/prism/node.rb#3944 + sig { returns(T.nilable(String)) } def inheritance_operator; end # attr_reader inheritance_operator_loc: Location? # - # source://prism//lib/prism/node.rb#3629 + # source://prism//lib/prism/node.rb#3910 + sig { returns(T.nilable(Prism::Location)) } def inheritance_operator_loc; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3674 + # source://prism//lib/prism/node.rb#3954 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#3616 + # source://prism//lib/prism/node.rb#3897 + sig { returns(T::Array[Symbol]) } def locals; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3655 + # source://prism//lib/prism/node.rb#3936 + sig { returns(Symbol) } def name; end # attr_reader superclass: Prism::node? # - # source://prism//lib/prism/node.rb#3642 + # source://prism//lib/prism/node.rb#3923 + sig { returns(T.nilable(Prism::Node)) } def superclass; end # Sometimes you want to check an instance of a node against a list of @@ -3472,7 +4633,8 @@ class Prism::ClassNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3712 + # source://prism//lib/prism/node.rb#3992 + sig { override.returns(Symbol) } def type; end class << self @@ -3483,7 +4645,7 @@ class Prism::ClassNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3722 + # source://prism//lib/prism/node.rb#4002 def type; end end end @@ -3493,77 +4655,116 @@ end # @@target &&= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3731 +# source://prism//lib/prism/node.rb#4026 class Prism::ClassVariableAndWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode # - # source://prism//lib/prism/node.rb#3733 + # source://prism//lib/prism/node.rb#4028 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4137 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3744 + # source://prism//lib/prism/node.rb#4039 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3749 + # source://prism//lib/prism/node.rb#4044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3759 + # source://prism//lib/prism/node.rb#4054 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3754 + # source://prism//lib/prism/node.rb#4049 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableAndWriteNode # - # source://prism//lib/prism/node.rb#3764 + # source://prism//lib/prism/node.rb#4059 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ClassVariableAndWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3749 + # source://prism//lib/prism/node.rb#4044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#3772 + # source://prism//lib/prism/node.rb#4067 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#125 + # source://prism//lib/prism/desugar_compiler.rb#127 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3803 + # source://prism//lib/prism/node.rb#4097 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3777 + # source://prism//lib/prism/node.rb#4072 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#3780 + # source://prism//lib/prism/node.rb#4075 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#3798 + # source://prism//lib/prism/node.rb#4092 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#3787 + # source://prism//lib/prism/node.rb#4082 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3581,12 +4782,14 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3827 + # source://prism//lib/prism/node.rb#4121 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3794 + # source://prism//lib/prism/node.rb#4089 + sig { returns(Prism::Node) } def value; end class << self @@ -3597,7 +4800,7 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3837 + # source://prism//lib/prism/node.rb#4131 def type; end end end @@ -3607,77 +4810,118 @@ end # @@target += value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3846 +# source://prism//lib/prism/node.rb#4150 class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void # # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#3848 + # source://prism//lib/prism/node.rb#4152 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4261 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3860 + # source://prism//lib/prism/node.rb#4164 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3865 + # source://prism//lib/prism/node.rb#4169 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3875 + # source://prism//lib/prism/node.rb#4179 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3870 + # source://prism//lib/prism/node.rb#4174 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#3880 + # source://prism//lib/prism/node.rb#4184 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).returns(Prism::ClassVariableOperatorWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), operator: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3865 + # source://prism//lib/prism/node.rb#4169 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#3888 + # source://prism//lib/prism/node.rb#4192 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#137 + # source://prism//lib/prism/desugar_compiler.rb#139 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#3917 + # source://prism//lib/prism/node.rb#4220 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#3893 + # source://prism//lib/prism/node.rb#4197 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#3896 + # source://prism//lib/prism/node.rb#4200 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#3913 + # source://prism//lib/prism/node.rb#4217 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#3903 + # source://prism//lib/prism/node.rb#4207 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3695,12 +4939,14 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#3942 + # source://prism//lib/prism/node.rb#4245 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#3910 + # source://prism//lib/prism/node.rb#4214 + sig { returns(Prism::Node) } def value; end class << self @@ -3711,7 +4957,7 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#3952 + # source://prism//lib/prism/node.rb#4255 def type; end end end @@ -3721,77 +4967,116 @@ end # @@target ||= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#3961 +# source://prism//lib/prism/node.rb#4275 class Prism::ClassVariableOrWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode # - # source://prism//lib/prism/node.rb#3963 + # source://prism//lib/prism/node.rb#4277 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4386 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#3974 + # source://prism//lib/prism/node.rb#4288 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3979 + # source://prism//lib/prism/node.rb#4293 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#3989 + # source://prism//lib/prism/node.rb#4303 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#3984 + # source://prism//lib/prism/node.rb#4298 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableOrWriteNode # - # source://prism//lib/prism/node.rb#3994 + # source://prism//lib/prism/node.rb#4308 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ClassVariableOrWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#3979 + # source://prism//lib/prism/node.rb#4293 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#4002 + # source://prism//lib/prism/node.rb#4316 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#131 + # source://prism//lib/prism/desugar_compiler.rb#133 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4033 + # source://prism//lib/prism/node.rb#4346 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4007 + # source://prism//lib/prism/node.rb#4321 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4010 + # source://prism//lib/prism/node.rb#4324 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4028 + # source://prism//lib/prism/node.rb#4341 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4017 + # source://prism//lib/prism/node.rb#4331 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -3809,12 +5094,14 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4057 + # source://prism//lib/prism/node.rb#4370 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4024 + # source://prism//lib/prism/node.rb#4338 + sig { returns(Prism::Node) } def value; end class << self @@ -3825,7 +5112,7 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4067 + # source://prism//lib/prism/node.rb#4380 def type; end end end @@ -3835,54 +5122,72 @@ end # @@foo # ^^^^^ # -# source://prism//lib/prism/node.rb#4076 +# source://prism//lib/prism/node.rb#4399 class Prism::ClassVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode # - # source://prism//lib/prism/node.rb#4078 + # source://prism//lib/prism/node.rb#4401 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4485 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4086 + # source://prism//lib/prism/node.rb#4409 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4091 + # source://prism//lib/prism/node.rb#4414 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4101 + # source://prism//lib/prism/node.rb#4424 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4096 + # source://prism//lib/prism/node.rb#4419 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> ClassVariableReadNode # - # source://prism//lib/prism/node.rb#4106 + # source://prism//lib/prism/node.rb#4429 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableReadNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4091 + # source://prism//lib/prism/node.rb#4414 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#4114 + # source://prism//lib/prism/node.rb#4437 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4127 + # source://prism//lib/prism/node.rb#4449 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -3891,7 +5196,8 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # @@_test # name `:@@_test` # - # source://prism//lib/prism/node.rb#4123 + # source://prism//lib/prism/node.rb#4446 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -3909,7 +5215,8 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4147 + # source://prism//lib/prism/node.rb#4469 + sig { override.returns(Symbol) } def type; end class << self @@ -3920,7 +5227,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4157 + # source://prism//lib/prism/node.rb#4479 def type; end end end @@ -3930,59 +5237,78 @@ end # @@foo, @@bar = baz # ^^^^^ ^^^^^ # -# source://prism//lib/prism/node.rb#4166 +# source://prism//lib/prism/node.rb#4495 class Prism::ClassVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode # - # source://prism//lib/prism/node.rb#4168 + # source://prism//lib/prism/node.rb#4497 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4577 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4176 + # source://prism//lib/prism/node.rb#4505 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4181 + # source://prism//lib/prism/node.rb#4510 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4191 + # source://prism//lib/prism/node.rb#4520 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4186 + # source://prism//lib/prism/node.rb#4515 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> ClassVariableTargetNode # - # source://prism//lib/prism/node.rb#4196 + # source://prism//lib/prism/node.rb#4525 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableTargetNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4181 + # source://prism//lib/prism/node.rb#4510 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#4204 + # source://prism//lib/prism/node.rb#4533 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4213 + # source://prism//lib/prism/node.rb#4541 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4209 + # source://prism//lib/prism/node.rb#4538 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -4000,7 +5326,8 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4233 + # source://prism//lib/prism/node.rb#4561 + sig { override.returns(Symbol) } def type; end class << self @@ -4011,7 +5338,7 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4243 + # source://prism//lib/prism/node.rb#4571 def type; end end end @@ -4021,54 +5348,89 @@ end # @@foo = 1 # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4252 +# source://prism//lib/prism/node.rb#4587 class Prism::ClassVariableWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode # - # source://prism//lib/prism/node.rb#4254 + # source://prism//lib/prism/node.rb#4589 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4714 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4265 + # source://prism//lib/prism/node.rb#4600 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4270 + # source://prism//lib/prism/node.rb#4605 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4280 + # source://prism//lib/prism/node.rb#4615 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4275 + # source://prism//lib/prism/node.rb#4610 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ClassVariableWriteNode # - # source://prism//lib/prism/node.rb#4285 + # source://prism//lib/prism/node.rb#4620 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ClassVariableWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4270 + # source://prism//lib/prism/node.rb#4605 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#4293 + # source://prism//lib/prism/node.rb#4628 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4341 + # source://prism//lib/prism/node.rb#4674 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -4077,7 +5439,8 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # @@_test = :test # name `@@_test` # - # source://prism//lib/prism/node.rb#4302 + # source://prism//lib/prism/node.rb#4637 + sig { returns(Symbol) } def name; end # The location of the variable name. @@ -4085,12 +5448,14 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@foo = :bar # ^^^^^ # - # source://prism//lib/prism/node.rb#4308 + # source://prism//lib/prism/node.rb#4643 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4336 + # source://prism//lib/prism/node.rb#4669 + sig { returns(String) } def operator; end # The location of the `=` operator. @@ -4098,7 +5463,8 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@foo = :bar # ^ # - # source://prism//lib/prism/node.rb#4328 + # source://prism//lib/prism/node.rb#4662 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -4116,11 +5482,11 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4365 + # source://prism//lib/prism/node.rb#4698 + sig { override.returns(Symbol) } def type; end - # The value to assign to the class variable. Can be any node that - # represents a non-void expression. + # 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 # ^^^^ @@ -4128,7 +5494,8 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # @@_xyz = 123 # ^^^ # - # source://prism//lib/prism/node.rb#4322 + # source://prism//lib/prism/node.rb#4656 + sig { returns(Prism::Node) } def value; end class << self @@ -4139,7 +5506,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4375 + # source://prism//lib/prism/node.rb#4708 def type; end end end @@ -4147,29 +5514,38 @@ end # This represents a comment that was encountered during parsing. It is the # base class for all comment types. # -# source://prism//lib/prism/parse_result.rb#283 +# source://prism//lib/prism/parse_result.rb#288 class Prism::Comment + abstract! + # Create a new comment object with the given location. # # @return [Comment] a new instance of Comment # - # source://prism//lib/prism/parse_result.rb#288 + # source://prism//lib/prism/parse_result.rb#293 + sig { params(location: Prism::Location).void } def initialize(location); end # Implement the hash pattern matching interface for Comment. # - # source://prism//lib/prism/parse_result.rb#293 + # source://prism//lib/prism/parse_result.rb#298 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # The location of this comment in the source. # - # source://prism//lib/prism/parse_result.rb#285 + # source://prism//lib/prism/parse_result.rb#290 + sig { returns(Prism::Location) } def location; end # Returns the content of the comment by slicing it from the source code. # - # source://prism//lib/prism/parse_result.rb#298 + # source://prism//lib/prism/parse_result.rb#303 + sig { returns(String) } def slice; end + + sig { abstract.returns(T::Boolean) } + def trailing?; end end # A compiler is a visitor that returns the value of each node as it visits. @@ -4194,6 +5570,7 @@ class Prism::Compiler < ::Prism::Visitor # Visit an individual node. # # source://prism//lib/prism/compiler.rb#29 + sig { params(node: T.nilable(Prism::Node)).returns(T.nilable(Result)) } def visit(node); end # Visit the child nodes of the given node. @@ -4211,6 +5588,7 @@ class Prism::Compiler < ::Prism::Visitor # Visit a list of nodes. # # source://prism//lib/prism/compiler.rb#34 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).returns(T::Array[T.nilable(Result)]) } def visit_all(nodes); end # Visit the child nodes of the given node. @@ -4354,6 +5732,7 @@ class Prism::Compiler < ::Prism::Visitor # Visit the child nodes of the given node. # # source://prism//lib/prism/compiler.rb#39 + sig { params(node: Prism::Node).returns(T::Array[T.nilable(Result)]) } def visit_child_nodes(node); end # Visit the child nodes of the given node. @@ -5105,6 +6484,8 @@ class Prism::Compiler < ::Prism::Visitor # # source://prism//lib/prism/compiler.rb#39 def visit_yield_node(node); end + + Result = type_member end # Represents the use of the `&&=` operator for assignment to a constant. @@ -5112,77 +6493,116 @@ end # Target &&= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4384 +# source://prism//lib/prism/node.rb#4727 class Prism::ConstantAndWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode # - # source://prism//lib/prism/node.rb#4386 + # source://prism//lib/prism/node.rb#4729 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4838 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4397 + # source://prism//lib/prism/node.rb#4740 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4402 + # source://prism//lib/prism/node.rb#4745 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4412 + # source://prism//lib/prism/node.rb#4755 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4407 + # source://prism//lib/prism/node.rb#4750 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantAndWriteNode # - # source://prism//lib/prism/node.rb#4417 + # source://prism//lib/prism/node.rb#4760 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantAndWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4402 + # source://prism//lib/prism/node.rb#4745 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#4425 + # source://prism//lib/prism/node.rb#4768 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#143 + # source://prism//lib/prism/desugar_compiler.rb#145 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4456 + # source://prism//lib/prism/node.rb#4798 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4430 + # source://prism//lib/prism/node.rb#4773 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4433 + # source://prism//lib/prism/node.rb#4776 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4451 + # source://prism//lib/prism/node.rb#4793 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4440 + # source://prism//lib/prism/node.rb#4783 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -5200,12 +6620,14 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4480 + # source://prism//lib/prism/node.rb#4822 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4447 + # source://prism//lib/prism/node.rb#4790 + sig { returns(Prism::Node) } def value; end class << self @@ -5216,7 +6638,7 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4490 + # source://prism//lib/prism/node.rb#4832 def type; end end end @@ -5226,77 +6648,118 @@ end # Target += value # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4499 +# source://prism//lib/prism/node.rb#4851 class Prism::ConstantOperatorWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void # # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode # - # source://prism//lib/prism/node.rb#4501 + # source://prism//lib/prism/node.rb#4853 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#4962 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4513 + # source://prism//lib/prism/node.rb#4865 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4518 + # source://prism//lib/prism/node.rb#4870 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4528 + # source://prism//lib/prism/node.rb#4880 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4523 + # source://prism//lib/prism/node.rb#4875 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode # - # source://prism//lib/prism/node.rb#4533 + # source://prism//lib/prism/node.rb#4885 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).returns(Prism::ConstantOperatorWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), operator: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4518 + # source://prism//lib/prism/node.rb#4870 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#4541 + # source://prism//lib/prism/node.rb#4893 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#155 + # source://prism//lib/prism/desugar_compiler.rb#157 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4570 + # source://prism//lib/prism/node.rb#4921 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4546 + # source://prism//lib/prism/node.rb#4898 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4549 + # source://prism//lib/prism/node.rb#4901 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#4566 + # source://prism//lib/prism/node.rb#4918 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4556 + # source://prism//lib/prism/node.rb#4908 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -5314,12 +6777,14 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4595 + # source://prism//lib/prism/node.rb#4946 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4563 + # source://prism//lib/prism/node.rb#4915 + sig { returns(Prism::Node) } def value; end class << self @@ -5330,7 +6795,7 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4605 + # source://prism//lib/prism/node.rb#4956 def type; end end end @@ -5340,77 +6805,116 @@ end # Target ||= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4614 +# source://prism//lib/prism/node.rb#4976 class Prism::ConstantOrWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode # - # source://prism//lib/prism/node.rb#4616 + # source://prism//lib/prism/node.rb#4978 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5087 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4627 + # source://prism//lib/prism/node.rb#4989 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4632 + # source://prism//lib/prism/node.rb#4994 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4642 + # source://prism//lib/prism/node.rb#5004 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4637 + # source://prism//lib/prism/node.rb#4999 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantOrWriteNode # - # source://prism//lib/prism/node.rb#4647 + # source://prism//lib/prism/node.rb#5009 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantOrWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4632 + # source://prism//lib/prism/node.rb#4994 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#4655 + # source://prism//lib/prism/node.rb#5017 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#149 + # source://prism//lib/prism/desugar_compiler.rb#151 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4686 + # source://prism//lib/prism/node.rb#5047 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#4660 + # source://prism//lib/prism/node.rb#5022 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#4663 + # source://prism//lib/prism/node.rb#5025 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4681 + # source://prism//lib/prism/node.rb#5042 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4670 + # source://prism//lib/prism/node.rb#5032 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -5428,12 +6932,14 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4710 + # source://prism//lib/prism/node.rb#5071 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4677 + # source://prism//lib/prism/node.rb#5039 + sig { returns(Prism::Node) } def value; end class << self @@ -5444,7 +6950,7 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4720 + # source://prism//lib/prism/node.rb#5081 def type; end end end @@ -5454,69 +6960,105 @@ end # Parent::Child &&= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4729 +# source://prism//lib/prism/node.rb#5100 class Prism::ConstantPathAndWriteNode < ::Prism::Node # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode # - # source://prism//lib/prism/node.rb#4731 + # source://prism//lib/prism/node.rb#5102 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5203 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4741 + # source://prism//lib/prism/node.rb#5112 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4746 + # source://prism//lib/prism/node.rb#5117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4756 + # source://prism//lib/prism/node.rb#5127 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4751 + # source://prism//lib/prism/node.rb#5122 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathAndWriteNode # - # source://prism//lib/prism/node.rb#4761 + # source://prism//lib/prism/node.rb#5132 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathAndWriteNode) + end def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4746 + # source://prism//lib/prism/node.rb#5117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#4769 + # source://prism//lib/prism/node.rb#5140 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4793 + # source://prism//lib/prism/node.rb#5163 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#4788 + # source://prism//lib/prism/node.rb#5158 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4777 + # source://prism//lib/prism/node.rb#5148 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#4774 + # source://prism//lib/prism/node.rb#5145 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5534,12 +7076,14 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4817 + # source://prism//lib/prism/node.rb#5187 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#4784 + # source://prism//lib/prism/node.rb#5155 + sig { returns(Prism::Node) } def value; end class << self @@ -5550,7 +7094,7 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4827 + # source://prism//lib/prism/node.rb#5197 def type; end end end @@ -5560,85 +7104,149 @@ end # Foo::Bar # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#4836 +# source://prism//lib/prism/node.rb#5215 class Prism::ConstantPathNode < ::Prism::Node # def initialize: (Prism::node? parent, ConstantReadNode | MissingNode child, Location delimiter_loc, Location location) -> void # # @return [ConstantPathNode] a new instance of ConstantPathNode # - # source://prism//lib/prism/node.rb#4838 + # source://prism//lib/prism/node.rb#5217 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + child: T.any(Prism::ConstantReadNode, Prism::MissingNode), + delimiter_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, parent, child, delimiter_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5350 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4848 + # source://prism//lib/prism/node.rb#5227 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader child: ConstantReadNode | MissingNode + # The right-hand node of the path. Always a `ConstantReadNode` in a + # valid Ruby syntax tree. + # + # ::Foo + # ^^^ + # + # self::Test + # ^^^^ + # + # a.b::C + # ^ # - # source://prism//lib/prism/node.rb#4887 + # source://prism//lib/prism/node.rb#5285 + sig { returns(T.any(Prism::ConstantReadNode, Prism::MissingNode)) } def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4853 + # source://prism//lib/prism/node.rb#5232 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4866 + # source://prism//lib/prism/node.rb#5245 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4858 + # source://prism//lib/prism/node.rb#5237 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?parent: Prism::node?, ?child: ConstantReadNode | MissingNode, ?delimiter_loc: Location, ?location: Location) -> ConstantPathNode # - # source://prism//lib/prism/node.rb#4871 + # source://prism//lib/prism/node.rb#5250 + sig do + params( + parent: T.nilable(Prism::Node), + child: T.any(Prism::ConstantReadNode, Prism::MissingNode), + delimiter_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantPathNode) + end def copy(parent: T.unsafe(nil), child: T.unsafe(nil), delimiter_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4853 + # source://prism//lib/prism/node.rb#5232 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, child: ConstantReadNode | MissingNode, delimiter_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#4879 + # source://prism//lib/prism/node.rb#5258 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//lib/prism/node.rb#4898 + # source://prism//lib/prism/node.rb#5301 + sig { returns(String) } def delimiter; end - # attr_reader delimiter_loc: Location + # The location of the `::` delimiter. + # + # ::Foo + # ^^ + # + # One::Two + # ^^ # - # source://prism//lib/prism/node.rb#4890 + # source://prism//lib/prism/node.rb#5294 + sig { returns(Prism::Location) } def delimiter_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant path. For example: "Foo::Bar" # # source://prism//lib/prism/node_ext.rb#162 + sig { returns(String) } def full_name; end # Returns the list of parts for the full name of this constant path. # For example: [:Foo, :Bar] # # source://prism//lib/prism/node_ext.rb#141 + sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#4903 + # source://prism//lib/prism/node.rb#5306 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end - # attr_reader parent: Prism::node? + # 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. # - # source://prism//lib/prism/node.rb#4884 + # Foo::Bar + # ^^^ + # + # self::Test + # ^^^^ + # + # a.b::C + # ^^^ + # + # source://prism//lib/prism/node.rb#5272 + sig { returns(T.nilable(Prism::Node)) } def parent; end # Sometimes you want to check an instance of a node against a list of @@ -5656,7 +7264,8 @@ class Prism::ConstantPathNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#4931 + # source://prism//lib/prism/node.rb#5334 + sig { override.returns(Symbol) } def type; end class << self @@ -5667,7 +7276,7 @@ class Prism::ConstantPathNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#4941 + # source://prism//lib/prism/node.rb#5344 def type; end end end @@ -5694,69 +7303,107 @@ class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError # Parent::Child += value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#4950 +# source://prism//lib/prism/node.rb#5362 class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void # # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode # - # source://prism//lib/prism/node.rb#4952 + # source://prism//lib/prism/node.rb#5364 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, operator, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5465 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#4963 + # source://prism//lib/prism/node.rb#5375 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4968 + # source://prism//lib/prism/node.rb#5380 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#4978 + # source://prism//lib/prism/node.rb#5390 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#4973 + # source://prism//lib/prism/node.rb#5385 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode # - # source://prism//lib/prism/node.rb#4983 + # source://prism//lib/prism/node.rb#5395 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).returns(Prism::ConstantPathOperatorWriteNode) + end def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), operator: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#4968 + # source://prism//lib/prism/node.rb#5380 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#4991 + # source://prism//lib/prism/node.rb#5403 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5013 + # source://prism//lib/prism/node.rb#5424 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#5009 + # source://prism//lib/prism/node.rb#5421 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#4999 + # source://prism//lib/prism/node.rb#5411 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#4996 + # source://prism//lib/prism/node.rb#5408 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5774,12 +7421,14 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5038 + # source://prism//lib/prism/node.rb#5449 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#5006 + # source://prism//lib/prism/node.rb#5418 + sig { returns(Prism::Node) } def value; end class << self @@ -5790,7 +7439,7 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5048 + # source://prism//lib/prism/node.rb#5459 def type; end end end @@ -5800,69 +7449,105 @@ end # Parent::Child ||= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5057 +# source://prism//lib/prism/node.rb#5478 class Prism::ConstantPathOrWriteNode < ::Prism::Node # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode # - # source://prism//lib/prism/node.rb#5059 + # source://prism//lib/prism/node.rb#5480 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5581 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5069 + # source://prism//lib/prism/node.rb#5490 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5074 + # source://prism//lib/prism/node.rb#5495 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5084 + # source://prism//lib/prism/node.rb#5505 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5079 + # source://prism//lib/prism/node.rb#5500 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathOrWriteNode # - # source://prism//lib/prism/node.rb#5089 + # source://prism//lib/prism/node.rb#5510 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathOrWriteNode) + end def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5074 + # source://prism//lib/prism/node.rb#5495 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#5097 + # source://prism//lib/prism/node.rb#5518 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5121 + # source://prism//lib/prism/node.rb#5541 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5116 + # source://prism//lib/prism/node.rb#5536 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#5105 + # source://prism//lib/prism/node.rb#5526 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism//lib/prism/node.rb#5102 + # source://prism//lib/prism/node.rb#5523 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -5880,12 +7565,14 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5145 + # source://prism//lib/prism/node.rb#5565 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#5112 + # source://prism//lib/prism/node.rb#5533 + sig { returns(Prism::Node) } def value; end class << self @@ -5896,7 +7583,7 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5155 + # source://prism//lib/prism/node.rb#5575 def type; end end end @@ -5906,85 +7593,124 @@ end # Foo::Foo, Bar::Bar = baz # ^^^^^^^^ ^^^^^^^^ # -# source://prism//lib/prism/node.rb#5164 +# source://prism//lib/prism/node.rb#5593 class Prism::ConstantPathTargetNode < ::Prism::Node # def initialize: (Prism::node? parent, ConstantReadNode | MissingNode child, Location delimiter_loc, Location location) -> void # # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode # - # source://prism//lib/prism/node.rb#5166 + # source://prism//lib/prism/node.rb#5595 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + child: T.any(Prism::ConstantReadNode, Prism::MissingNode), + delimiter_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, parent, child, delimiter_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5703 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5176 + # source://prism//lib/prism/node.rb#5605 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader child: ConstantReadNode | MissingNode # - # source://prism//lib/prism/node.rb#5215 + # source://prism//lib/prism/node.rb#5644 + sig { returns(T.any(Prism::ConstantReadNode, Prism::MissingNode)) } def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5181 + # source://prism//lib/prism/node.rb#5610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5194 + # source://prism//lib/prism/node.rb#5623 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5186 + # source://prism//lib/prism/node.rb#5615 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?parent: Prism::node?, ?child: ConstantReadNode | MissingNode, ?delimiter_loc: Location, ?location: Location) -> ConstantPathTargetNode # - # source://prism//lib/prism/node.rb#5199 + # source://prism//lib/prism/node.rb#5628 + sig do + params( + parent: T.nilable(Prism::Node), + child: T.any(Prism::ConstantReadNode, Prism::MissingNode), + delimiter_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantPathTargetNode) + end def copy(parent: T.unsafe(nil), child: T.unsafe(nil), delimiter_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5181 + # source://prism//lib/prism/node.rb#5610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, child: ConstantReadNode | MissingNode, delimiter_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#5207 + # source://prism//lib/prism/node.rb#5636 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def delimiter: () -> String # - # source://prism//lib/prism/node.rb#5226 + # source://prism//lib/prism/node.rb#5654 + sig { returns(String) } def delimiter; end # attr_reader delimiter_loc: Location # - # source://prism//lib/prism/node.rb#5218 + # source://prism//lib/prism/node.rb#5647 + sig { returns(Prism::Location) } def delimiter_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant path. For example: "Foo::Bar" # # source://prism//lib/prism/node_ext.rb#190 + sig { returns(String) } def full_name; end # Returns the list of parts for the full name of this constant path. # For example: [:Foo, :Bar] # # source://prism//lib/prism/node_ext.rb#170 + sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5231 + # source://prism//lib/prism/node.rb#5659 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader parent: Prism::node? # - # source://prism//lib/prism/node.rb#5212 + # source://prism//lib/prism/node.rb#5641 + sig { returns(T.nilable(Prism::Node)) } def parent; end # Sometimes you want to check an instance of a node against a list of @@ -6002,7 +7728,8 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5259 + # source://prism//lib/prism/node.rb#5687 + sig { override.returns(Symbol) } def type; end class << self @@ -6013,7 +7740,7 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5269 + # source://prism//lib/prism/node.rb#5697 def type; end end end @@ -6029,69 +7756,114 @@ end # ::Foo::Bar = 1 # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5284 +# source://prism//lib/prism/node.rb#5721 class Prism::ConstantPathWriteNode < ::Prism::Node # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode # - # source://prism//lib/prism/node.rb#5286 + # source://prism//lib/prism/node.rb#5723 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5836 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5296 + # source://prism//lib/prism/node.rb#5733 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5301 + # source://prism//lib/prism/node.rb#5738 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5311 + # source://prism//lib/prism/node.rb#5748 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5306 + # source://prism//lib/prism/node.rb#5743 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathWriteNode # - # source://prism//lib/prism/node.rb#5316 + # source://prism//lib/prism/node.rb#5753 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::ConstantPathWriteNode) + end def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5301 + # source://prism//lib/prism/node.rb#5738 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#5324 + # source://prism//lib/prism/node.rb#5761 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5348 + # source://prism//lib/prism/node.rb#5796 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5343 + # source://prism//lib/prism/node.rb#5791 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. # - # source://prism//lib/prism/node.rb#5332 + # ::ABC = 123 + # ^ + # + # source://prism//lib/prism/node.rb#5778 + sig { returns(Prism::Location) } def operator_loc; end - # attr_reader target: ConstantPathNode + # A node representing the constant path being written to. + # + # Foo::Bar = 1 + # ^^^^^^^^ + # + # ::Foo = :abc + # ^^^^^ # - # source://prism//lib/prism/node.rb#5329 + # source://prism//lib/prism/node.rb#5772 + sig { returns(Prism::ConstantPathNode) } def target; end # Sometimes you want to check an instance of a node against a list of @@ -6109,12 +7881,17 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5372 + # source://prism//lib/prism/node.rb#5820 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Prism::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). # - # source://prism//lib/prism/node.rb#5339 + # FOO::BAR = :abc + # ^^^^ + # + # source://prism//lib/prism/node.rb#5788 + sig { returns(Prism::Node) } def value; end class << self @@ -6125,7 +7902,7 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5382 + # source://prism//lib/prism/node.rb#5830 def type; end end end @@ -6135,65 +7912,85 @@ end # Foo # ^^^ # -# source://prism//lib/prism/node.rb#5391 +# source://prism//lib/prism/node.rb#5848 class Prism::ConstantReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ConstantReadNode] a new instance of ConstantReadNode # - # source://prism//lib/prism/node.rb#5393 + # source://prism//lib/prism/node.rb#5850 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#5934 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5401 + # source://prism//lib/prism/node.rb#5858 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5406 + # source://prism//lib/prism/node.rb#5863 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5416 + # source://prism//lib/prism/node.rb#5873 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5411 + # source://prism//lib/prism/node.rb#5868 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> ConstantReadNode # - # source://prism//lib/prism/node.rb#5421 + # source://prism//lib/prism/node.rb#5878 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantReadNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5406 + # source://prism//lib/prism/node.rb#5863 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#5429 + # source://prism//lib/prism/node.rb#5886 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant. For example: "Foo" # # source://prism//lib/prism/node_ext.rb#107 + sig { returns(String) } def full_name; end # Returns the list of parts for the full name of this constant. # For example: [:Foo] # # source://prism//lib/prism/node_ext.rb#102 + sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5442 + # source://prism//lib/prism/node.rb#5898 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). @@ -6202,7 +7999,8 @@ class Prism::ConstantReadNode < ::Prism::Node # # SOME_CONSTANT # name `:SOME_CONSTANT` # - # source://prism//lib/prism/node.rb#5438 + # source://prism//lib/prism/node.rb#5895 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -6220,7 +8018,8 @@ class Prism::ConstantReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5462 + # source://prism//lib/prism/node.rb#5918 + sig { override.returns(Symbol) } def type; end class << self @@ -6231,7 +8030,7 @@ class Prism::ConstantReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5472 + # source://prism//lib/prism/node.rb#5928 def type; end end end @@ -6241,70 +8040,91 @@ end # Foo, Bar = baz # ^^^ ^^^ # -# source://prism//lib/prism/node.rb#5481 +# source://prism//lib/prism/node.rb#5944 class Prism::ConstantTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ConstantTargetNode] a new instance of ConstantTargetNode # - # source://prism//lib/prism/node.rb#5483 + # source://prism//lib/prism/node.rb#5946 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6026 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5491 + # source://prism//lib/prism/node.rb#5954 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5496 + # source://prism//lib/prism/node.rb#5959 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5506 + # source://prism//lib/prism/node.rb#5969 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5501 + # source://prism//lib/prism/node.rb#5964 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> ConstantTargetNode # - # source://prism//lib/prism/node.rb#5511 + # source://prism//lib/prism/node.rb#5974 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantTargetNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5496 + # source://prism//lib/prism/node.rb#5959 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#5519 + # source://prism//lib/prism/node.rb#5982 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant. For example: "Foo" # # source://prism//lib/prism/node_ext.rb#203 + sig { returns(String) } def full_name; end # Returns the list of parts for the full name of this constant. # For example: [:Foo] # # source://prism//lib/prism/node_ext.rb#198 + sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5528 + # source://prism//lib/prism/node.rb#5990 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#5524 + # source://prism//lib/prism/node.rb#5987 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -6322,7 +8142,8 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5548 + # source://prism//lib/prism/node.rb#6010 + sig { override.returns(Symbol) } def type; end class << self @@ -6333,7 +8154,7 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5558 + # source://prism//lib/prism/node.rb#6020 def type; end end end @@ -6343,85 +8164,136 @@ end # Foo = 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#5567 +# source://prism//lib/prism/node.rb#6036 class Prism::ConstantWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [ConstantWriteNode] a new instance of ConstantWriteNode # - # source://prism//lib/prism/node.rb#5569 + # source://prism//lib/prism/node.rb#6038 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6163 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5580 + # source://prism//lib/prism/node.rb#6049 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5585 + # source://prism//lib/prism/node.rb#6054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5595 + # source://prism//lib/prism/node.rb#6064 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5590 + # source://prism//lib/prism/node.rb#6059 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ConstantWriteNode # - # source://prism//lib/prism/node.rb#5600 + # source://prism//lib/prism/node.rb#6069 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ConstantWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5585 + # source://prism//lib/prism/node.rb#6054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#5608 + # source://prism//lib/prism/node.rb#6077 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant. For example: "Foo" # # source://prism//lib/prism/node_ext.rb#120 + sig { returns(String) } def full_name; end # Returns the list of parts for the full name of this constant. # For example: [:Foo] # # source://prism//lib/prism/node_ext.rb#115 + sig { returns(T::Array[Symbol]) } def full_name_parts; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5639 + # source://prism//lib/prism/node.rb#6123 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end - # attr_reader name: Symbol + # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). + # + # Foo = :bar # name `:Foo` # - # source://prism//lib/prism/node.rb#5613 + # XYZ = 1 # name `:XYZ` + # + # source://prism//lib/prism/node.rb#6086 + sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the constant name. # - # source://prism//lib/prism/node.rb#5616 + # FOO = 1 + # ^^^ + # + # source://prism//lib/prism/node.rb#6092 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#5634 + # source://prism//lib/prism/node.rb#6118 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. # - # source://prism//lib/prism/node.rb#5626 + # FOO = :bar + # ^ + # + # source://prism//lib/prism/node.rb#6111 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -6439,12 +8311,20 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5663 + # source://prism//lib/prism/node.rb#6147 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Prism::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). # - # source://prism//lib/prism/node.rb#5623 + # FOO = :bar + # ^^^^ + # + # MyClass = Class.new + # ^^^^^^^^^ + # + # source://prism//lib/prism/node.rb#6105 + sig { returns(Prism::Node) } def value; end class << self @@ -6455,7 +8335,7 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5673 + # source://prism//lib/prism/node.rb#6157 def type; end end end @@ -7401,144 +9281,213 @@ end # end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5683 +# source://prism//lib/prism/node.rb#6177 class Prism::DefNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, Prism::node? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc, Location location) -> void # # @return [DefNode] a new instance of DefNode # - # source://prism//lib/prism/node.rb#5685 + # source://prism//lib/prism/node.rb#6179 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(Prism::Node), + locals: T::Array[Symbol], + def_keyword_loc: Prism::Location, + operator_loc: T.nilable(Prism::Location), + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6421 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5704 + # source://prism//lib/prism/node.rb#6198 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#5757 + # source://prism//lib/prism/node.rb#6251 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5709 + # source://prism//lib/prism/node.rb#6203 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5723 + # source://prism//lib/prism/node.rb#6217 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5714 + # source://prism//lib/prism/node.rb#6208 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: Prism::node?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?, ?location: Location) -> DefNode # - # source://prism//lib/prism/node.rb#5728 + # source://prism//lib/prism/node.rb#6222 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + receiver: T.nilable(Prism::Node), + parameters: T.nilable(Prism::ParametersNode), + body: T.nilable(Prism::Node), + locals: T::Array[Symbol], + def_keyword_loc: Prism::Location, + operator_loc: T.nilable(Prism::Location), + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + equal_loc: T.nilable(Prism::Location), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::DefNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5709 + # source://prism//lib/prism/node.rb#6203 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: Prism::node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#5736 + # source://prism//lib/prism/node.rb#6230 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def def_keyword: () -> String # - # source://prism//lib/prism/node.rb#5836 + # source://prism//lib/prism/node.rb#6329 + sig { returns(String) } def def_keyword; end # attr_reader def_keyword_loc: Location # - # source://prism//lib/prism/node.rb#5763 + # source://prism//lib/prism/node.rb#6257 + sig { returns(Prism::Location) } def def_keyword_loc; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#5861 + # source://prism//lib/prism/node.rb#6354 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#5822 + # source://prism//lib/prism/node.rb#6316 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # def equal: () -> String? # - # source://prism//lib/prism/node.rb#5856 + # source://prism//lib/prism/node.rb#6349 + sig { returns(T.nilable(String)) } def equal; end # attr_reader equal_loc: Location? # - # source://prism//lib/prism/node.rb#5809 + # source://prism//lib/prism/node.rb#6303 + sig { returns(T.nilable(Prism::Location)) } def equal_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#5866 + # source://prism//lib/prism/node.rb#6359 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#5760 + # source://prism//lib/prism/node.rb#6254 + sig { returns(T::Array[Symbol]) } def locals; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#5846 + # source://prism//lib/prism/node.rb#6339 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#5783 + # source://prism//lib/prism/node.rb#6277 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#5741 + # source://prism//lib/prism/node.rb#6235 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#5744 + # source://prism//lib/prism/node.rb#6238 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#5841 + # source://prism//lib/prism/node.rb#6334 + sig { returns(T.nilable(String)) } def operator; end # attr_reader operator_loc: Location? # - # source://prism//lib/prism/node.rb#5770 + # source://prism//lib/prism/node.rb#6264 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # attr_reader parameters: ParametersNode? # - # source://prism//lib/prism/node.rb#5754 + # source://prism//lib/prism/node.rb#6248 + sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#5751 + # source://prism//lib/prism/node.rb#6245 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#5851 + # source://prism//lib/prism/node.rb#6344 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#5796 + # source://prism//lib/prism/node.rb#6290 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -7556,7 +9505,8 @@ class Prism::DefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#5912 + # source://prism//lib/prism/node.rb#6405 + sig { override.returns(Symbol) } def type; end class << self @@ -7567,7 +9517,7 @@ class Prism::DefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#5922 + # source://prism//lib/prism/node.rb#6415 def type; end end end @@ -7577,84 +9527,125 @@ end # defined?(a) # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#5931 +# source://prism//lib/prism/node.rb#6443 class Prism::DefinedNode < ::Prism::Node # def initialize: (Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc, Location location) -> void # # @return [DefinedNode] a new instance of DefinedNode # - # source://prism//lib/prism/node.rb#5933 + # source://prism//lib/prism/node.rb#6445 + sig do + params( + source: Prism::Source, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, lparen_loc, value, rparen_loc, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6580 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#5944 + # source://prism//lib/prism/node.rb#6456 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5949 + # source://prism//lib/prism/node.rb#6461 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#5959 + # source://prism//lib/prism/node.rb#6471 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#5954 + # source://prism//lib/prism/node.rb#6466 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location, ?location: Location) -> DefinedNode # - # source://prism//lib/prism/node.rb#5964 + # source://prism//lib/prism/node.rb#6476 + sig do + params( + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::DefinedNode) + end def copy(lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#5949 + # source://prism//lib/prism/node.rb#6461 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#5972 + # source://prism//lib/prism/node.rb#6484 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6029 + # source://prism//lib/prism/node.rb#6540 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#6024 + # source://prism//lib/prism/node.rb#6535 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#6006 + # source://prism//lib/prism/node.rb#6518 + sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#6014 + # source://prism//lib/prism/node.rb#6525 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#5977 + # source://prism//lib/prism/node.rb#6489 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#6019 + # source://prism//lib/prism/node.rb#6530 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#5993 + # source://prism//lib/prism/node.rb#6505 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -7672,12 +9663,14 @@ class Prism::DefinedNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6053 + # source://prism//lib/prism/node.rb#6564 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#5990 + # source://prism//lib/prism/node.rb#6502 + sig { returns(Prism::Node) } def value; end class << self @@ -7688,7 +9681,7 @@ class Prism::DefinedNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6063 + # source://prism//lib/prism/node.rb#6574 def type; end end end @@ -7734,15 +9727,17 @@ end # DesugarCompiler is a compiler that desugars Ruby code into a more primitive # form. This is useful for consumers that want to deal with fewer node types. # -# source://prism//lib/prism/desugar_compiler.rb#216 +# source://prism//lib/prism/desugar_compiler.rb#218 class Prism::DesugarCompiler < ::Prism::MutationCompiler + Result = type_member { { fixed: Prism::Node } } + # @@foo &&= bar # # becomes # # @@foo && @@foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#222 + # source://prism//lib/prism/desugar_compiler.rb#224 def visit_class_variable_and_write_node(node); end # @@foo += bar @@ -7751,7 +9746,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo = @@foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#240 + # source://prism//lib/prism/desugar_compiler.rb#242 def visit_class_variable_operator_write_node(node); end # @@foo ||= bar @@ -7760,7 +9755,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(@@foo) ? @@foo : @@foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#231 + # source://prism//lib/prism/desugar_compiler.rb#233 def visit_class_variable_or_write_node(node); end # Foo &&= bar @@ -7769,7 +9764,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo && Foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#249 + # source://prism//lib/prism/desugar_compiler.rb#251 def visit_constant_and_write_node(node); end # Foo += bar @@ -7778,7 +9773,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo = Foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#267 + # source://prism//lib/prism/desugar_compiler.rb#269 def visit_constant_operator_write_node(node); end # Foo ||= bar @@ -7787,7 +9782,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(Foo) ? Foo : Foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#258 + # source://prism//lib/prism/desugar_compiler.rb#260 def visit_constant_or_write_node(node); end # $foo &&= bar @@ -7796,7 +9791,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo && $foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#276 + # source://prism//lib/prism/desugar_compiler.rb#278 def visit_global_variable_and_write_node(node); end # $foo += bar @@ -7805,7 +9800,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo = $foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#294 + # source://prism//lib/prism/desugar_compiler.rb#296 def visit_global_variable_operator_write_node(node); end # $foo ||= bar @@ -7814,22 +9809,22 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?($foo) ? $foo : $foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#285 + # source://prism//lib/prism/desugar_compiler.rb#287 def visit_global_variable_or_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#303 + # source://prism//lib/prism/desugar_compiler.rb#305 def visit_instance_variable_and_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#321 + # source://prism//lib/prism/desugar_compiler.rb#323 def visit_instance_variable_operator_write_node(node); end # becomes # - # source://prism//lib/prism/desugar_compiler.rb#312 + # source://prism//lib/prism/desugar_compiler.rb#314 def visit_instance_variable_or_write_node(node); end # foo &&= bar @@ -7838,7 +9833,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo && foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#330 + # source://prism//lib/prism/desugar_compiler.rb#332 def visit_local_variable_and_write_node(node); end # foo += bar @@ -7847,7 +9842,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo = foo + bar # - # source://prism//lib/prism/desugar_compiler.rb#348 + # source://prism//lib/prism/desugar_compiler.rb#350 def visit_local_variable_operator_write_node(node); end # foo ||= bar @@ -7856,7 +9851,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo || foo = bar # - # source://prism//lib/prism/desugar_compiler.rb#339 + # source://prism//lib/prism/desugar_compiler.rb#341 def visit_local_variable_or_write_node(node); end end @@ -7936,41 +9931,41 @@ class Prism::DesugarOrWriteDefinedNode def write_class; end end -# source://prism//lib/prism/desugar_compiler.rb#99 +# source://prism//lib/prism/desugar_compiler.rb#101 class Prism::DesugarOrWriteNode # @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode # - # source://prism//lib/prism/desugar_compiler.rb#102 + # source://prism//lib/prism/desugar_compiler.rb#104 def initialize(node, source, read_class, write_class, *arguments); end # Returns the value of attribute arguments. # - # source://prism//lib/prism/desugar_compiler.rb#100 + # source://prism//lib/prism/desugar_compiler.rb#102 def arguments; end # Desugar `x ||= y` to `x || x = y` # - # source://prism//lib/prism/desugar_compiler.rb#111 + # source://prism//lib/prism/desugar_compiler.rb#113 def compile; end # Returns the value of attribute node. # - # source://prism//lib/prism/desugar_compiler.rb#100 + # source://prism//lib/prism/desugar_compiler.rb#102 def node; end # Returns the value of attribute read_class. # - # source://prism//lib/prism/desugar_compiler.rb#100 + # source://prism//lib/prism/desugar_compiler.rb#102 def read_class; end # Returns the value of attribute source. # - # source://prism//lib/prism/desugar_compiler.rb#100 + # source://prism//lib/prism/desugar_compiler.rb#102 def source; end # Returns the value of attribute write_class. # - # source://prism//lib/prism/desugar_compiler.rb#100 + # source://prism//lib/prism/desugar_compiler.rb#102 def write_class; end end @@ -10663,79 +12658,117 @@ end # if a then b else c end # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6072 +# source://prism//lib/prism/node.rb#6593 class Prism::ElseNode < ::Prism::Node # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void # # @return [ElseNode] a new instance of ElseNode # - # source://prism//lib/prism/node.rb#6074 + # source://prism//lib/prism/node.rb#6595 + sig do + params( + source: Prism::Source, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, else_keyword_loc, statements, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6716 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6084 + # source://prism//lib/prism/node.rb#6605 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6089 + # source://prism//lib/prism/node.rb#6610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6101 + # source://prism//lib/prism/node.rb#6622 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6094 + # source://prism//lib/prism/node.rb#6615 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?, ?location: Location) -> ElseNode # - # source://prism//lib/prism/node.rb#6106 + # source://prism//lib/prism/node.rb#6627 + sig do + params( + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::ElseNode) + end def copy(else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6089 + # source://prism//lib/prism/node.rb#6610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#6114 + # source://prism//lib/prism/node.rb#6635 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def else_keyword: () -> String # - # source://prism//lib/prism/node.rb#6143 + # source://prism//lib/prism/node.rb#6663 + sig { returns(String) } def else_keyword; end # attr_reader else_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6119 + # source://prism//lib/prism/node.rb#6640 + sig { returns(Prism::Location) } def else_keyword_loc; end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#6148 + # source://prism//lib/prism/node.rb#6668 + sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#6129 + # source://prism//lib/prism/node.rb#6650 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6153 + # source://prism//lib/prism/node.rb#6673 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6126 + # source://prism//lib/prism/node.rb#6647 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -10753,7 +12786,8 @@ class Prism::ElseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6180 + # source://prism//lib/prism/node.rb#6700 + sig { override.returns(Symbol) } def type; end class << self @@ -10764,7 +12798,7 @@ class Prism::ElseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6190 + # source://prism//lib/prism/node.rb#6710 def type; end end end @@ -10772,18 +12806,20 @@ end # EmbDocComment objects correspond to comments that are surrounded by =begin # and =end. # -# source://prism//lib/prism/parse_result.rb#320 +# source://prism//lib/prism/parse_result.rb#325 class Prism::EmbDocComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism//lib/prism/parse_result.rb#327 + # source://prism//lib/prism/parse_result.rb#332 + sig { returns(String) } def inspect; end # This can only be true for inline comments. # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#322 + # source://prism//lib/prism/parse_result.rb#327 + sig { override.returns(T::Boolean) } def trailing?; end end @@ -10792,79 +12828,117 @@ end # "foo #{bar}" # ^^^^^^ # -# source://prism//lib/prism/node.rb#6199 +# source://prism//lib/prism/node.rb#6728 class Prism::EmbeddedStatementsNode < ::Prism::Node # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void # # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode # - # source://prism//lib/prism/node.rb#6201 + # source://prism//lib/prism/node.rb#6730 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, opening_loc, statements, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6845 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6211 + # source://prism//lib/prism/node.rb#6740 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6216 + # source://prism//lib/prism/node.rb#6745 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#6269 + # source://prism//lib/prism/node.rb#6797 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#6256 + # source://prism//lib/prism/node.rb#6785 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6228 + # source://prism//lib/prism/node.rb#6757 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6221 + # source://prism//lib/prism/node.rb#6750 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location, ?location: Location) -> EmbeddedStatementsNode # - # source://prism//lib/prism/node.rb#6233 + # source://prism//lib/prism/node.rb#6762 + sig do + params( + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::EmbeddedStatementsNode) + end def copy(opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6216 + # source://prism//lib/prism/node.rb#6745 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#6241 + # source://prism//lib/prism/node.rb#6770 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6274 + # source://prism//lib/prism/node.rb#6802 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#6264 + # source://prism//lib/prism/node.rb#6792 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#6246 + # source://prism//lib/prism/node.rb#6775 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6253 + # source://prism//lib/prism/node.rb#6782 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -10882,7 +12956,8 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6301 + # source://prism//lib/prism/node.rb#6829 + sig { override.returns(Symbol) } def type; end class << self @@ -10893,7 +12968,7 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6311 + # source://prism//lib/prism/node.rb#6839 def type; end end end @@ -10903,64 +12978,97 @@ end # "foo #@bar" # ^^^^^ # -# source://prism//lib/prism/node.rb#6320 +# source://prism//lib/prism/node.rb#6857 class Prism::EmbeddedVariableNode < ::Prism::Node # def initialize: (Location operator_loc, Prism::node variable, Location location) -> void # # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode # - # source://prism//lib/prism/node.rb#6322 + # source://prism//lib/prism/node.rb#6859 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, operator_loc, variable, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#6954 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6331 + # source://prism//lib/prism/node.rb#6868 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6336 + # source://prism//lib/prism/node.rb#6873 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6346 + # source://prism//lib/prism/node.rb#6883 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6341 + # source://prism//lib/prism/node.rb#6878 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?operator_loc: Location, ?variable: Prism::node, ?location: Location) -> EmbeddedVariableNode # - # source://prism//lib/prism/node.rb#6351 + # source://prism//lib/prism/node.rb#6888 + sig do + params( + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).returns(Prism::EmbeddedVariableNode) + end def copy(operator_loc: T.unsafe(nil), variable: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6336 + # source://prism//lib/prism/node.rb#6873 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#6359 + # source://prism//lib/prism/node.rb#6896 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6380 + # source://prism//lib/prism/node.rb#6916 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#6375 + # source://prism//lib/prism/node.rb#6911 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#6364 + # source://prism//lib/prism/node.rb#6901 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -10978,12 +13086,14 @@ class Prism::EmbeddedVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6402 + # source://prism//lib/prism/node.rb#6938 + sig { override.returns(Symbol) } def type; end # attr_reader variable: Prism::node # - # source://prism//lib/prism/node.rb#6371 + # source://prism//lib/prism/node.rb#6908 + sig { returns(Prism::Node) } def variable; end class << self @@ -10994,24 +13104,24 @@ class Prism::EmbeddedVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6412 + # source://prism//lib/prism/node.rb#6948 def type; end end end # Flags for nodes that have unescaped content. # -# source://prism//lib/prism/node.rb#18841 +# source://prism//lib/prism/node.rb#20364 module Prism::EncodingFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#18846 +# source://prism//lib/prism/node.rb#20369 Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to UTF-8 # -# source://prism//lib/prism/node.rb#18843 +# source://prism//lib/prism/node.rb#20366 Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # Represents an `ensure` clause in a `begin` statement. @@ -11023,79 +13133,117 @@ Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # bar # end # -# source://prism//lib/prism/node.rb#6425 +# source://prism//lib/prism/node.rb#6969 class Prism::EnsureNode < ::Prism::Node # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void # # @return [EnsureNode] a new instance of EnsureNode # - # source://prism//lib/prism/node.rb#6427 + # source://prism//lib/prism/node.rb#6971 + sig do + params( + source: Prism::Source, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, ensure_keyword_loc, statements, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7086 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6437 + # source://prism//lib/prism/node.rb#6981 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6442 + # source://prism//lib/prism/node.rb#6986 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6454 + # source://prism//lib/prism/node.rb#6998 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6447 + # source://prism//lib/prism/node.rb#6991 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location, ?location: Location) -> EnsureNode # - # source://prism//lib/prism/node.rb#6459 + # source://prism//lib/prism/node.rb#7003 + sig do + params( + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::EnsureNode) + end def copy(ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6442 + # source://prism//lib/prism/node.rb#6986 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#6467 + # source://prism//lib/prism/node.rb#7011 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#6495 + # source://prism//lib/prism/node.rb#7038 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6482 + # source://prism//lib/prism/node.rb#7026 + sig { returns(Prism::Location) } def end_keyword_loc; end # def ensure_keyword: () -> String # - # source://prism//lib/prism/node.rb#6490 + # source://prism//lib/prism/node.rb#7033 + sig { returns(String) } def ensure_keyword; end # attr_reader ensure_keyword_loc: Location # - # source://prism//lib/prism/node.rb#6472 + # source://prism//lib/prism/node.rb#7016 + sig { returns(Prism::Location) } def ensure_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6500 + # source://prism//lib/prism/node.rb#7043 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#6479 + # source://prism//lib/prism/node.rb#7023 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -11113,7 +13261,8 @@ class Prism::EnsureNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6527 + # source://prism//lib/prism/node.rb#7070 + sig { override.returns(Symbol) } def type; end class << self @@ -11124,7 +13273,7 @@ class Prism::EnsureNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6537 + # source://prism//lib/prism/node.rb#7080 def type; end end end @@ -11134,54 +13283,72 @@ end # false # ^^^^^ # -# source://prism//lib/prism/node.rb#6546 +# source://prism//lib/prism/node.rb#7098 class Prism::FalseNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [FalseNode] a new instance of FalseNode # - # source://prism//lib/prism/node.rb#6548 + # source://prism//lib/prism/node.rb#7100 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7175 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6555 + # source://prism//lib/prism/node.rb#7107 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6560 + # source://prism//lib/prism/node.rb#7112 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6570 + # source://prism//lib/prism/node.rb#7122 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6565 + # source://prism//lib/prism/node.rb#7117 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> FalseNode # - # source://prism//lib/prism/node.rb#6575 + # source://prism//lib/prism/node.rb#7127 + sig { params(location: Prism::Location).returns(Prism::FalseNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6560 + # source://prism//lib/prism/node.rb#7112 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#6583 + # source://prism//lib/prism/node.rb#7135 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6589 + # source://prism//lib/prism/node.rb#7140 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -11199,7 +13366,8 @@ class Prism::FalseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6608 + # source://prism//lib/prism/node.rb#7159 + sig { override.returns(Symbol) } def type; end class << self @@ -11210,7 +13378,7 @@ class Prism::FalseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6618 + # source://prism//lib/prism/node.rb#7169 def type; end end end @@ -11226,94 +13394,141 @@ end # foo in Foo(*bar, baz, *qux) # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6633 +# source://prism//lib/prism/node.rb#7190 class Prism::FindPatternNode < ::Prism::Node # def initialize: (Prism::node? constant, Prism::node left, Array[Prism::node] requireds, Prism::node right, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [FindPatternNode] a new instance of FindPatternNode # - # source://prism//lib/prism/node.rb#6635 + # source://prism//lib/prism/node.rb#7192 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, constant, left, requireds, right, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7339 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6648 + # source://prism//lib/prism/node.rb#7205 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6653 + # source://prism//lib/prism/node.rb#7210 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#6730 + # source://prism//lib/prism/node.rb#7286 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#6711 + # source://prism//lib/prism/node.rb#7268 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6668 + # source://prism//lib/prism/node.rb#7225 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6658 + # source://prism//lib/prism/node.rb#7215 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#6686 + # source://prism//lib/prism/node.rb#7243 + sig { returns(T.nilable(Prism::Node)) } def constant; end # def copy: (?constant: Prism::node?, ?left: Prism::node, ?requireds: Array[Prism::node], ?right: Prism::node, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> FindPatternNode # - # source://prism//lib/prism/node.rb#6673 + # source://prism//lib/prism/node.rb#7230 + sig do + params( + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::FindPatternNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6653 + # source://prism//lib/prism/node.rb#7210 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, left: Prism::node, requireds: Array[Prism::node], right: Prism::node, opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#6681 + # source://prism//lib/prism/node.rb#7238 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6735 + # source://prism//lib/prism/node.rb#7291 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Prism::node # - # source://prism//lib/prism/node.rb#6689 + # source://prism//lib/prism/node.rb#7246 + sig { returns(Prism::Node) } def left; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#6725 + # source://prism//lib/prism/node.rb#7281 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#6698 + # source://prism//lib/prism/node.rb#7255 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader requireds: Array[Prism::node] # - # source://prism//lib/prism/node.rb#6692 + # source://prism//lib/prism/node.rb#7249 + sig { returns(T::Array[Prism::Node]) } def requireds; end # attr_reader right: Prism::node # - # source://prism//lib/prism/node.rb#6695 + # source://prism//lib/prism/node.rb#7252 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -11331,7 +13546,8 @@ class Prism::FindPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6767 + # source://prism//lib/prism/node.rb#7323 + sig { override.returns(Symbol) } def type; end class << self @@ -11342,7 +13558,7 @@ class Prism::FindPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6777 + # source://prism//lib/prism/node.rb#7333 def type; end end end @@ -11352,81 +13568,121 @@ end # baz if foo .. bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#6786 +# source://prism//lib/prism/node.rb#7355 class Prism::FlipFlopNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void # # @return [FlipFlopNode] a new instance of FlipFlopNode # - # source://prism//lib/prism/node.rb#6788 + # source://prism//lib/prism/node.rb#7357 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, left, right, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7481 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6799 + # source://prism//lib/prism/node.rb#7368 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6804 + # source://prism//lib/prism/node.rb#7373 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6817 + # source://prism//lib/prism/node.rb#7386 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6809 + # source://prism//lib/prism/node.rb#7378 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> FlipFlopNode # - # source://prism//lib/prism/node.rb#6822 + # source://prism//lib/prism/node.rb#7391 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::FlipFlopNode) + end def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6804 + # source://prism//lib/prism/node.rb#7373 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#6830 + # source://prism//lib/prism/node.rb#7399 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def exclude_end?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#6853 + # source://prism//lib/prism/node.rb#7421 + sig { returns(T::Boolean) } def exclude_end?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6863 + # source://prism//lib/prism/node.rb#7431 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader left: Prism::node? # - # source://prism//lib/prism/node.rb#6839 + # source://prism//lib/prism/node.rb#7408 + sig { returns(T.nilable(Prism::Node)) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#6858 + # source://prism//lib/prism/node.rb#7426 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#6845 + # source://prism//lib/prism/node.rb#7414 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader right: Prism::node? # - # source://prism//lib/prism/node.rb#6842 + # source://prism//lib/prism/node.rb#7411 + sig { returns(T.nilable(Prism::Node)) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -11444,14 +13700,16 @@ class Prism::FlipFlopNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6897 + # source://prism//lib/prism/node.rb#7465 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#6835 + # source://prism//lib/prism/node.rb#7404 + sig { returns(Integer) } def flags; end class << self @@ -11462,7 +13720,7 @@ class Prism::FlipFlopNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6907 + # source://prism//lib/prism/node.rb#7475 def type; end end end @@ -11472,54 +13730,72 @@ end # 1.0 # ^^^ # -# source://prism//lib/prism/node.rb#6916 +# source://prism//lib/prism/node.rb#7494 class Prism::FloatNode < ::Prism::Node # def initialize: (Float value, Location location) -> void # # @return [FloatNode] a new instance of FloatNode # - # source://prism//lib/prism/node.rb#6918 + # source://prism//lib/prism/node.rb#7496 + sig { params(source: Prism::Source, value: Float, location: Prism::Location).void } def initialize(source, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7576 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#6926 + # source://prism//lib/prism/node.rb#7504 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6931 + # source://prism//lib/prism/node.rb#7509 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#6941 + # source://prism//lib/prism/node.rb#7519 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#6936 + # source://prism//lib/prism/node.rb#7514 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Float, ?location: Location) -> FloatNode # - # source://prism//lib/prism/node.rb#6946 + # source://prism//lib/prism/node.rb#7524 + sig { params(value: Float, location: Prism::Location).returns(Prism::FloatNode) } def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#6931 + # source://prism//lib/prism/node.rb#7509 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Float, location: Location } # - # source://prism//lib/prism/node.rb#6954 + # source://prism//lib/prism/node.rb#7532 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#6963 + # source://prism//lib/prism/node.rb#7540 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -11537,12 +13813,14 @@ class Prism::FloatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#6983 + # source://prism//lib/prism/node.rb#7560 + sig { override.returns(Symbol) } def type; end # The value of the floating point number as a Float. # - # source://prism//lib/prism/node.rb#6959 + # source://prism//lib/prism/node.rb#7537 + sig { returns(Float) } def value; end class << self @@ -11553,7 +13831,7 @@ class Prism::FloatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#6993 + # source://prism//lib/prism/node.rb#7570 def type; end end end @@ -11563,109 +13841,161 @@ end # for i in a end # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7002 +# source://prism//lib/prism/node.rb#7586 class Prism::ForNode < ::Prism::Node # def initialize: (Prism::node index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [ForNode] a new instance of ForNode # - # source://prism//lib/prism/node.rb#7004 + # source://prism//lib/prism/node.rb#7588 + sig do + params( + source: Prism::Source, + index: Prism::Node, + collection: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + for_keyword_loc: Prism::Location, + in_keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7751 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7018 + # source://prism//lib/prism/node.rb#7602 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7023 + # source://prism//lib/prism/node.rb#7607 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # attr_reader collection: Prism::node # - # source://prism//lib/prism/node.rb#7058 + # source://prism//lib/prism/node.rb#7642 + sig { returns(Prism::Node) } def collection; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7037 + # source://prism//lib/prism/node.rb#7621 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7028 + # source://prism//lib/prism/node.rb#7612 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?index: Prism::node, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location, ?location: Location) -> ForNode # - # source://prism//lib/prism/node.rb#7042 + # source://prism//lib/prism/node.rb#7626 + sig do + params( + index: Prism::Node, + collection: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + for_keyword_loc: Prism::Location, + in_keyword_loc: Prism::Location, + do_keyword_loc: T.nilable(Prism::Location), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ForNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7023 + # source://prism//lib/prism/node.rb#7607 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { index: Prism::node, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#7050 + # source://prism//lib/prism/node.rb#7634 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def do_keyword: () -> String? # - # source://prism//lib/prism/node.rb#7109 + # source://prism//lib/prism/node.rb#7692 + sig { returns(T.nilable(String)) } def do_keyword; end # attr_reader do_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#7078 + # source://prism//lib/prism/node.rb#7662 + sig { returns(T.nilable(Prism::Location)) } def do_keyword_loc; end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#7114 + # source://prism//lib/prism/node.rb#7697 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#7091 + # source://prism//lib/prism/node.rb#7675 + sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def for_keyword: () -> String # - # source://prism//lib/prism/node.rb#7099 + # source://prism//lib/prism/node.rb#7682 + sig { returns(String) } def for_keyword; end # attr_reader for_keyword_loc: Location # - # source://prism//lib/prism/node.rb#7064 + # source://prism//lib/prism/node.rb#7648 + sig { returns(Prism::Location) } def for_keyword_loc; end # def in_keyword: () -> String # - # source://prism//lib/prism/node.rb#7104 + # source://prism//lib/prism/node.rb#7687 + sig { returns(String) } def in_keyword; end # attr_reader in_keyword_loc: Location # - # source://prism//lib/prism/node.rb#7071 + # source://prism//lib/prism/node.rb#7655 + sig { returns(Prism::Location) } def in_keyword_loc; end # attr_reader index: Prism::node # - # source://prism//lib/prism/node.rb#7055 + # source://prism//lib/prism/node.rb#7639 + sig { returns(Prism::Node) } def index; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7119 + # source://prism//lib/prism/node.rb#7702 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#7061 + # source://prism//lib/prism/node.rb#7645 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -11683,7 +14013,8 @@ class Prism::ForNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7152 + # source://prism//lib/prism/node.rb#7735 + sig { override.returns(Symbol) } def type; end class << self @@ -11694,7 +14025,7 @@ class Prism::ForNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7162 + # source://prism//lib/prism/node.rb#7745 def type; end end end @@ -11706,54 +14037,72 @@ end # ^^^ # end # -# source://prism//lib/prism/node.rb#7173 +# source://prism//lib/prism/node.rb#7769 class Prism::ForwardingArgumentsNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode # - # source://prism//lib/prism/node.rb#7175 + # source://prism//lib/prism/node.rb#7771 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7846 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7182 + # source://prism//lib/prism/node.rb#7778 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7187 + # source://prism//lib/prism/node.rb#7783 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7197 + # source://prism//lib/prism/node.rb#7793 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7192 + # source://prism//lib/prism/node.rb#7788 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> ForwardingArgumentsNode # - # source://prism//lib/prism/node.rb#7202 + # source://prism//lib/prism/node.rb#7798 + sig { params(location: Prism::Location).returns(Prism::ForwardingArgumentsNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7187 + # source://prism//lib/prism/node.rb#7783 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#7210 + # source://prism//lib/prism/node.rb#7806 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7216 + # source://prism//lib/prism/node.rb#7811 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -11771,7 +14120,8 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7235 + # source://prism//lib/prism/node.rb#7830 + sig { override.returns(Symbol) } def type; end class << self @@ -11782,7 +14132,7 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7245 + # source://prism//lib/prism/node.rb#7840 def type; end end end @@ -11793,54 +14143,72 @@ end # ^^^ # end # -# source://prism//lib/prism/node.rb#7255 +# source://prism//lib/prism/node.rb#7856 class Prism::ForwardingParameterNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode # - # source://prism//lib/prism/node.rb#7257 + # source://prism//lib/prism/node.rb#7858 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#7933 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7264 + # source://prism//lib/prism/node.rb#7865 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7269 + # source://prism//lib/prism/node.rb#7870 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7279 + # source://prism//lib/prism/node.rb#7880 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7274 + # source://prism//lib/prism/node.rb#7875 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> ForwardingParameterNode # - # source://prism//lib/prism/node.rb#7284 + # source://prism//lib/prism/node.rb#7885 + sig { params(location: Prism::Location).returns(Prism::ForwardingParameterNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7269 + # source://prism//lib/prism/node.rb#7870 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#7292 + # source://prism//lib/prism/node.rb#7893 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7298 + # source://prism//lib/prism/node.rb#7898 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -11858,7 +14226,8 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7317 + # source://prism//lib/prism/node.rb#7917 + sig { override.returns(Symbol) } def type; end class << self @@ -11869,7 +14238,7 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7327 + # source://prism//lib/prism/node.rb#7927 def type; end end end @@ -11879,59 +14248,78 @@ end # super # ^^^^^ # -# source://prism//lib/prism/node.rb#7336 +# source://prism//lib/prism/node.rb#7942 class Prism::ForwardingSuperNode < ::Prism::Node # def initialize: (BlockNode? block, Location location) -> void # # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode # - # source://prism//lib/prism/node.rb#7338 + # source://prism//lib/prism/node.rb#7944 + sig { params(source: Prism::Source, block: T.nilable(Prism::BlockNode), location: Prism::Location).void } def initialize(source, block, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8031 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7346 + # source://prism//lib/prism/node.rb#7952 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader block: BlockNode? # - # source://prism//lib/prism/node.rb#7381 + # source://prism//lib/prism/node.rb#7987 + sig { returns(T.nilable(Prism::BlockNode)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7351 + # source://prism//lib/prism/node.rb#7957 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7363 + # source://prism//lib/prism/node.rb#7969 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7356 + # source://prism//lib/prism/node.rb#7962 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?block: BlockNode?, ?location: Location) -> ForwardingSuperNode # - # source://prism//lib/prism/node.rb#7368 + # source://prism//lib/prism/node.rb#7974 + sig { params(block: T.nilable(Prism::BlockNode), location: Prism::Location).returns(Prism::ForwardingSuperNode) } def copy(block: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7351 + # source://prism//lib/prism/node.rb#7957 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location } # - # source://prism//lib/prism/node.rb#7376 + # source://prism//lib/prism/node.rb#7982 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7385 + # source://prism//lib/prism/node.rb#7990 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -11949,7 +14337,8 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7410 + # source://prism//lib/prism/node.rb#8015 + sig { override.returns(Symbol) } def type; end class << self @@ -11960,7 +14349,7 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7420 + # source://prism//lib/prism/node.rb#8025 def type; end end end @@ -11970,77 +14359,116 @@ end # $target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7429 +# source://prism//lib/prism/node.rb#8041 class Prism::GlobalVariableAndWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#7431 + # source://prism//lib/prism/node.rb#8043 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8152 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7442 + # source://prism//lib/prism/node.rb#8054 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7447 + # source://prism//lib/prism/node.rb#8059 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7457 + # source://prism//lib/prism/node.rb#8069 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7452 + # source://prism//lib/prism/node.rb#8064 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#7462 + # source://prism//lib/prism/node.rb#8074 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::GlobalVariableAndWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7447 + # source://prism//lib/prism/node.rb#8059 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#7470 + # source://prism//lib/prism/node.rb#8082 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#161 + # source://prism//lib/prism/desugar_compiler.rb#163 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7501 + # source://prism//lib/prism/node.rb#8112 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7475 + # source://prism//lib/prism/node.rb#8087 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7478 + # source://prism//lib/prism/node.rb#8090 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#7496 + # source://prism//lib/prism/node.rb#8107 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#7485 + # source://prism//lib/prism/node.rb#8097 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12058,12 +14486,14 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7525 + # source://prism//lib/prism/node.rb#8136 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7492 + # source://prism//lib/prism/node.rb#8104 + sig { returns(Prism::Node) } def value; end class << self @@ -12074,7 +14504,7 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7535 + # source://prism//lib/prism/node.rb#8146 def type; end end end @@ -12084,77 +14514,118 @@ end # $target += value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7544 +# source://prism//lib/prism/node.rb#8165 class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void # # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#7546 + # source://prism//lib/prism/node.rb#8167 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8276 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7558 + # source://prism//lib/prism/node.rb#8179 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7563 + # source://prism//lib/prism/node.rb#8184 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7573 + # source://prism//lib/prism/node.rb#8194 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7568 + # source://prism//lib/prism/node.rb#8189 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#7578 + # source://prism//lib/prism/node.rb#8199 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).returns(Prism::GlobalVariableOperatorWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), operator: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7563 + # source://prism//lib/prism/node.rb#8184 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#7586 + # source://prism//lib/prism/node.rb#8207 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#173 + # source://prism//lib/prism/desugar_compiler.rb#175 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7615 + # source://prism//lib/prism/node.rb#8235 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7591 + # source://prism//lib/prism/node.rb#8212 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7594 + # source://prism//lib/prism/node.rb#8215 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#7611 + # source://prism//lib/prism/node.rb#8232 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#7601 + # source://prism//lib/prism/node.rb#8222 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12172,12 +14643,14 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7640 + # source://prism//lib/prism/node.rb#8260 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7608 + # source://prism//lib/prism/node.rb#8229 + sig { returns(Prism::Node) } def value; end class << self @@ -12188,7 +14661,7 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7650 + # source://prism//lib/prism/node.rb#8270 def type; end end end @@ -12198,77 +14671,116 @@ end # $target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#7659 +# source://prism//lib/prism/node.rb#8290 class Prism::GlobalVariableOrWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#7661 + # source://prism//lib/prism/node.rb#8292 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8401 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7672 + # source://prism//lib/prism/node.rb#8303 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7677 + # source://prism//lib/prism/node.rb#8308 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7687 + # source://prism//lib/prism/node.rb#8318 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7682 + # source://prism//lib/prism/node.rb#8313 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#7692 + # source://prism//lib/prism/node.rb#8323 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::GlobalVariableOrWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7677 + # source://prism//lib/prism/node.rb#8308 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#7700 + # source://prism//lib/prism/node.rb#8331 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#167 + # source://prism//lib/prism/desugar_compiler.rb#169 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7731 + # source://prism//lib/prism/node.rb#8361 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7705 + # source://prism//lib/prism/node.rb#8336 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#7708 + # source://prism//lib/prism/node.rb#8339 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#7726 + # source://prism//lib/prism/node.rb#8356 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#7715 + # source://prism//lib/prism/node.rb#8346 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12286,12 +14798,14 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7755 + # source://prism//lib/prism/node.rb#8385 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#7722 + # source://prism//lib/prism/node.rb#8353 + sig { returns(Prism::Node) } def value; end class << self @@ -12302,7 +14816,7 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7765 + # source://prism//lib/prism/node.rb#8395 def type; end end end @@ -12312,54 +14826,72 @@ end # $foo # ^^^^ # -# source://prism//lib/prism/node.rb#7774 +# source://prism//lib/prism/node.rb#8414 class Prism::GlobalVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode # - # source://prism//lib/prism/node.rb#7776 + # source://prism//lib/prism/node.rb#8416 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8500 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7784 + # source://prism//lib/prism/node.rb#8424 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7789 + # source://prism//lib/prism/node.rb#8429 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7799 + # source://prism//lib/prism/node.rb#8439 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7794 + # source://prism//lib/prism/node.rb#8434 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableReadNode # - # source://prism//lib/prism/node.rb#7804 + # source://prism//lib/prism/node.rb#8444 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableReadNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7789 + # source://prism//lib/prism/node.rb#8429 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#7812 + # source://prism//lib/prism/node.rb#8452 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7825 + # source://prism//lib/prism/node.rb#8464 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. @@ -12368,7 +14900,8 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # $_Test # name `:$_Test` # - # source://prism//lib/prism/node.rb#7821 + # source://prism//lib/prism/node.rb#8461 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -12386,7 +14919,8 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7845 + # source://prism//lib/prism/node.rb#8484 + sig { override.returns(Symbol) } def type; end class << self @@ -12397,7 +14931,7 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7855 + # source://prism//lib/prism/node.rb#8494 def type; end end end @@ -12407,59 +14941,78 @@ end # $foo, $bar = baz # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#7864 +# source://prism//lib/prism/node.rb#8510 class Prism::GlobalVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode # - # source://prism//lib/prism/node.rb#7866 + # source://prism//lib/prism/node.rb#8512 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8592 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7874 + # source://prism//lib/prism/node.rb#8520 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7879 + # source://prism//lib/prism/node.rb#8525 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7889 + # source://prism//lib/prism/node.rb#8535 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7884 + # source://prism//lib/prism/node.rb#8530 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableTargetNode # - # source://prism//lib/prism/node.rb#7894 + # source://prism//lib/prism/node.rb#8540 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableTargetNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7879 + # source://prism//lib/prism/node.rb#8525 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#7902 + # source://prism//lib/prism/node.rb#8548 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#7911 + # source://prism//lib/prism/node.rb#8556 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#7907 + # source://prism//lib/prism/node.rb#8553 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -12477,7 +15030,8 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#7931 + # source://prism//lib/prism/node.rb#8576 + sig { override.returns(Symbol) } def type; end class << self @@ -12488,7 +15042,7 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#7941 + # source://prism//lib/prism/node.rb#8586 def type; end end end @@ -12498,74 +15052,123 @@ end # $foo = 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#7950 +# source://prism//lib/prism/node.rb#8602 class Prism::GlobalVariableWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode # - # source://prism//lib/prism/node.rb#7952 + # source://prism//lib/prism/node.rb#8604 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8729 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#7963 + # source://prism//lib/prism/node.rb#8615 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7968 + # source://prism//lib/prism/node.rb#8620 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#7978 + # source://prism//lib/prism/node.rb#8630 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#7973 + # source://prism//lib/prism/node.rb#8625 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> GlobalVariableWriteNode # - # source://prism//lib/prism/node.rb#7983 + # source://prism//lib/prism/node.rb#8635 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::GlobalVariableWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#7968 + # source://prism//lib/prism/node.rb#8620 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#7991 + # source://prism//lib/prism/node.rb#8643 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8022 + # source://prism//lib/prism/node.rb#8689 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end - # attr_reader 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` # - # source://prism//lib/prism/node.rb#7996 + # $_Test = 123 # name `:$_Test` + # + # source://prism//lib/prism/node.rb#8652 + sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the global variable's name. + # + # $foo = :bar + # ^^^^ # - # source://prism//lib/prism/node.rb#7999 + # source://prism//lib/prism/node.rb#8658 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#8017 + # source://prism//lib/prism/node.rb#8684 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. + # + # $foo = :bar + # ^ # - # source://prism//lib/prism/node.rb#8009 + # source://prism//lib/prism/node.rb#8677 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12583,12 +15186,20 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8046 + # source://prism//lib/prism/node.rb#8713 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Prism::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 + # ^^^ # - # source://prism//lib/prism/node.rb#8006 + # source://prism//lib/prism/node.rb#8671 + sig { returns(Prism::Node) } def value; end class << self @@ -12599,7 +15210,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8056 + # source://prism//lib/prism/node.rb#8723 def type; end end end @@ -12609,28 +15220,46 @@ end # { a => b } # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8065 +# source://prism//lib/prism/node.rb#8742 class Prism::HashNode < ::Prism::Node # def initialize: (Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc, Location location) -> void # # @return [HashNode] a new instance of HashNode # - # source://prism//lib/prism/node.rb#8067 + # source://prism//lib/prism/node.rb#8744 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, opening_loc, elements, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#8864 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8077 + # source://prism//lib/prism/node.rb#8754 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8082 + # source://prism//lib/prism/node.rb#8759 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#8145 + # source://prism//lib/prism/node.rb#8821 + sig { returns(String) } def closing; end # The location of the closing brace. @@ -12638,33 +15267,46 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism//lib/prism/node.rb#8132 + # source://prism//lib/prism/node.rb#8809 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8092 + # source://prism//lib/prism/node.rb#8769 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8087 + # source://prism//lib/prism/node.rb#8764 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location, ?location: Location) -> HashNode # - # source://prism//lib/prism/node.rb#8097 + # source://prism//lib/prism/node.rb#8774 + sig do + params( + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::HashNode) + end def copy(opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8082 + # source://prism//lib/prism/node.rb#8759 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#8105 + # source://prism//lib/prism/node.rb#8782 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. @@ -12675,17 +15317,23 @@ class Prism::HashNode < ::Prism::Node # { **foo } # ^^^^^ # - # source://prism//lib/prism/node.rb#8126 + # source://prism//lib/prism/node.rb#8803 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } def elements; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8150 + # source://prism//lib/prism/node.rb#8826 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#8140 + # source://prism//lib/prism/node.rb#8816 + sig { returns(String) } def opening; end # The location of the opening brace. @@ -12693,7 +15341,8 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism//lib/prism/node.rb#8113 + # source://prism//lib/prism/node.rb#8790 + sig { returns(Prism::Location) } def opening_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12711,7 +15360,8 @@ class Prism::HashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8172 + # source://prism//lib/prism/node.rb#8848 + sig { override.returns(Symbol) } def type; end class << self @@ -12722,7 +15372,7 @@ class Prism::HashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8182 + # source://prism//lib/prism/node.rb#8858 def type; end end end @@ -12735,89 +15385,133 @@ end # foo => { a: 1, b: 2, **c } # ^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8194 +# source://prism//lib/prism/node.rb#8880 class Prism::HashPatternNode < ::Prism::Node # def initialize: (Prism::node? constant, Array[AssocNode] elements, AssocSplatNode | NoKeywordsParameterNode | nil rest, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [HashPatternNode] a new instance of HashPatternNode # - # source://prism//lib/prism/node.rb#8196 + # source://prism//lib/prism/node.rb#8882 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + elements: T::Array[Prism::AssocNode], + rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, constant, elements, rest, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9026 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8208 + # source://prism//lib/prism/node.rb#8894 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8213 + # source://prism//lib/prism/node.rb#8899 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#8286 + # source://prism//lib/prism/node.rb#8971 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#8267 + # source://prism//lib/prism/node.rb#8953 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8227 + # source://prism//lib/prism/node.rb#8913 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8218 + # source://prism//lib/prism/node.rb#8904 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader constant: Prism::node? # - # source://prism//lib/prism/node.rb#8245 + # source://prism//lib/prism/node.rb#8931 + sig { returns(T.nilable(Prism::Node)) } def constant; end # def copy: (?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> HashPatternNode # - # source://prism//lib/prism/node.rb#8232 + # source://prism//lib/prism/node.rb#8918 + sig do + params( + constant: T.nilable(Prism::Node), + elements: T::Array[Prism::AssocNode], + rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)), + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::HashPatternNode) + end def copy(constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8213 + # source://prism//lib/prism/node.rb#8899 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#8240 + # source://prism//lib/prism/node.rb#8926 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader elements: Array[AssocNode] # - # source://prism//lib/prism/node.rb#8248 + # source://prism//lib/prism/node.rb#8934 + sig { returns(T::Array[Prism::AssocNode]) } def elements; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8291 + # source://prism//lib/prism/node.rb#8976 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#8281 + # source://prism//lib/prism/node.rb#8966 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#8254 + # source://prism//lib/prism/node.rb#8940 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil # - # source://prism//lib/prism/node.rb#8251 + # source://prism//lib/prism/node.rb#8937 + sig { returns(T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode))) } def rest; end # Sometimes you want to check an instance of a node against a list of @@ -12835,7 +15529,8 @@ class Prism::HashPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8325 + # source://prism//lib/prism/node.rb#9010 + sig { override.returns(Symbol) } def type; end class << self @@ -12846,7 +15541,7 @@ class Prism::HashPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8335 + # source://prism//lib/prism/node.rb#9020 def type; end end end @@ -12861,7 +15556,7 @@ module Prism::HeredocQuery def heredoc?; end end -# Represents the use of the `if` keyword, either in the block form or the modifier form. +# Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. # # bar if foo # ^^^^^^^^^^ @@ -12869,102 +15564,199 @@ end # if foo then bar end # ^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8347 +# foo ? bar : baz +# ^^^^^^^^^^^^^^^ +# +# source://prism//lib/prism/node.rb#9047 class Prism::IfNode < ::Prism::Node # def initialize: (Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, Prism::node? consequent, Location? end_keyword_loc, Location location) -> void # # @return [IfNode] a new instance of IfNode # - # source://prism//lib/prism/node.rb#8349 + # source://prism//lib/prism/node.rb#9049 + sig do + params( + source: Prism::Source, + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::Node), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9264 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8362 + # source://prism//lib/prism/node.rb#9062 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8371 + # source://prism//lib/prism/node.rb#9071 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8385 + # source://prism//lib/prism/node.rb#9085 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8376 + # source://prism//lib/prism/node.rb#9076 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader consequent: Prism::node? + # 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 + # ^^^^^^^^^^^^ # - # source://prism//lib/prism/node.rb#8435 + # source://prism//lib/prism/node.rb#9176 + sig { returns(T.nilable(Prism::Node)) } def consequent; end # def copy: (?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: Prism::node?, ?end_keyword_loc: Location?, ?location: Location) -> IfNode # - # source://prism//lib/prism/node.rb#8390 + # source://prism//lib/prism/node.rb#9090 + sig do + params( + if_keyword_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::Node), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::IfNode) + end def copy(if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8371 + # source://prism//lib/prism/node.rb#9071 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Prism::node?, end_keyword_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#8398 + # source://prism//lib/prism/node.rb#9098 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8462 + # source://prism//lib/prism/node.rb#9207 + sig { returns(T.nilable(String)) } def end_keyword; end - # attr_reader end_keyword_loc: Location? + # The location of the `end` keyword if present, `nil` otherwise. + # + # if foo + # bar + # end + # ^^^ # - # source://prism//lib/prism/node.rb#8438 + # source://prism//lib/prism/node.rb#9184 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def if_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8452 + # source://prism//lib/prism/node.rb#9197 + sig { returns(T.nilable(String)) } def if_keyword; end - # attr_reader if_keyword_loc: Location? + # The location of the `if` keyword if present. + # + # bar if foo + # ^^ # - # source://prism//lib/prism/node.rb#8403 + # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. + # + # source://prism//lib/prism/node.rb#9108 + sig { returns(T.nilable(Prism::Location)) } def if_keyword_loc; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8467 + # source://prism//lib/prism/node.rb#9212 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end - # attr_reader predicate: Prism::node + # The node for the condition the `IfNode` is testing. # - # source://prism//lib/prism/node.rb#8416 + # if foo + # ^^^ + # bar + # end + # + # bar if foo + # ^^^ + # + # foo ? bar : baz + # ^^^ + # + # source://prism//lib/prism/node.rb#9132 + sig { returns(Prism::Node) } def predicate; end - # source://prism//lib/prism/node.rb#8366 + # source://prism//lib/prism/node.rb#9066 def set_newline_flag(newline_marked); end - # attr_reader statements: StatementsNode? + # Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided. # - # source://prism//lib/prism/node.rb#8432 + # if foo + # bar + # ^^^ + # baz + # ^^^ + # end + # + # source://prism//lib/prism/node.rb#9161 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#8457 + # source://prism//lib/prism/node.rb#9202 + sig { returns(T.nilable(String)) } def then_keyword; end - # attr_reader then_keyword_loc: Location? + # The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. + # + # if foo then bar end + # ^^^^ + # + # a ? b : c + # ^ # - # source://prism//lib/prism/node.rb#8419 + # source://prism//lib/prism/node.rb#9141 + sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12982,7 +15774,8 @@ class Prism::IfNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8503 + # source://prism//lib/prism/node.rb#9248 + sig { override.returns(Symbol) } def type; end class << self @@ -12993,7 +15786,7 @@ class Prism::IfNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8513 + # source://prism//lib/prism/node.rb#9258 def type; end end end @@ -13003,59 +15796,89 @@ end # 1.0i # ^^^^ # -# source://prism//lib/prism/node.rb#8522 +# source://prism//lib/prism/node.rb#9279 class Prism::ImaginaryNode < ::Prism::Node # def initialize: (FloatNode | IntegerNode | RationalNode numeric, Location location) -> void # # @return [ImaginaryNode] a new instance of ImaginaryNode # - # source://prism//lib/prism/node.rb#8524 + # source://prism//lib/prism/node.rb#9281 + sig do + params( + source: Prism::Source, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).void + end def initialize(source, numeric, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9362 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8532 + # source://prism//lib/prism/node.rb#9289 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8537 + # source://prism//lib/prism/node.rb#9294 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8547 + # source://prism//lib/prism/node.rb#9304 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8542 + # source://prism//lib/prism/node.rb#9299 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?numeric: FloatNode | IntegerNode | RationalNode, ?location: Location) -> ImaginaryNode # - # source://prism//lib/prism/node.rb#8552 + # source://prism//lib/prism/node.rb#9309 + sig do + params( + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).returns(Prism::ImaginaryNode) + end def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8537 + # source://prism//lib/prism/node.rb#9294 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: FloatNode | IntegerNode | RationalNode, location: Location } # - # source://prism//lib/prism/node.rb#8560 + # source://prism//lib/prism/node.rb#9317 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8569 + # source://prism//lib/prism/node.rb#9325 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader numeric: FloatNode | IntegerNode | RationalNode # - # source://prism//lib/prism/node.rb#8565 + # source://prism//lib/prism/node.rb#9322 + sig { returns(T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)) } def numeric; end # Sometimes you want to check an instance of a node against a list of @@ -13073,12 +15896,14 @@ class Prism::ImaginaryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8590 + # source://prism//lib/prism/node.rb#9346 + sig { override.returns(Symbol) } def type; end # Returns the value of the node as a Ruby Complex. # # source://prism//lib/prism/node_ext.rb#87 + sig { returns(Complex) } def value; end class << self @@ -13089,7 +15914,7 @@ class Prism::ImaginaryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8600 + # source://prism//lib/prism/node.rb#9356 def type; end end end @@ -13105,54 +15930,72 @@ end # foo in { bar: } # ^^^^ # -# source://prism//lib/prism/node.rb#8615 +# source://prism//lib/prism/node.rb#9378 class Prism::ImplicitNode < ::Prism::Node # def initialize: (Prism::node value, Location location) -> void # # @return [ImplicitNode] a new instance of ImplicitNode # - # source://prism//lib/prism/node.rb#8617 + # source://prism//lib/prism/node.rb#9380 + sig { params(source: Prism::Source, value: Prism::Node, location: Prism::Location).void } def initialize(source, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9461 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8625 + # source://prism//lib/prism/node.rb#9388 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8630 + # source://prism//lib/prism/node.rb#9393 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8640 + # source://prism//lib/prism/node.rb#9403 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8635 + # source://prism//lib/prism/node.rb#9398 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Prism::node, ?location: Location) -> ImplicitNode # - # source://prism//lib/prism/node.rb#8645 + # source://prism//lib/prism/node.rb#9408 + sig { params(value: Prism::Node, location: Prism::Location).returns(Prism::ImplicitNode) } def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8630 + # source://prism//lib/prism/node.rb#9393 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#8653 + # source://prism//lib/prism/node.rb#9416 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8662 + # source://prism//lib/prism/node.rb#9424 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -13170,12 +16013,14 @@ class Prism::ImplicitNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8683 + # source://prism//lib/prism/node.rb#9445 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#8658 + # source://prism//lib/prism/node.rb#9421 + sig { returns(Prism::Node) } def value; end class << self @@ -13186,7 +16031,7 @@ class Prism::ImplicitNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8693 + # source://prism//lib/prism/node.rb#9455 def type; end end end @@ -13205,54 +16050,72 @@ end # foo, = bar # ^ # -# source://prism//lib/prism/node.rb#8711 +# source://prism//lib/prism/node.rb#9480 class Prism::ImplicitRestNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ImplicitRestNode] a new instance of ImplicitRestNode # - # source://prism//lib/prism/node.rb#8713 + # source://prism//lib/prism/node.rb#9482 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9557 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8720 + # source://prism//lib/prism/node.rb#9489 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8725 + # source://prism//lib/prism/node.rb#9494 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8735 + # source://prism//lib/prism/node.rb#9504 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8730 + # source://prism//lib/prism/node.rb#9499 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> ImplicitRestNode # - # source://prism//lib/prism/node.rb#8740 + # source://prism//lib/prism/node.rb#9509 + sig { params(location: Prism::Location).returns(Prism::ImplicitRestNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8725 + # source://prism//lib/prism/node.rb#9494 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#8748 + # source://prism//lib/prism/node.rb#9517 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8754 + # source://prism//lib/prism/node.rb#9522 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -13270,7 +16133,8 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8773 + # source://prism//lib/prism/node.rb#9541 + sig { override.returns(Symbol) } def type; end class << self @@ -13281,7 +16145,7 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8783 + # source://prism//lib/prism/node.rb#9551 def type; end end end @@ -13291,84 +16155,125 @@ end # case a; in b then c end # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8792 +# source://prism//lib/prism/node.rb#9566 class Prism::InNode < ::Prism::Node # def initialize: (Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void # # @return [InNode] a new instance of InNode # - # source://prism//lib/prism/node.rb#8794 + # source://prism//lib/prism/node.rb#9568 + sig do + params( + source: Prism::Source, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, pattern, statements, in_loc, then_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9696 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8805 + # source://prism//lib/prism/node.rb#9579 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8810 + # source://prism//lib/prism/node.rb#9584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8823 + # source://prism//lib/prism/node.rb#9597 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8815 + # source://prism//lib/prism/node.rb#9589 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?, ?location: Location) -> InNode # - # source://prism//lib/prism/node.rb#8828 + # source://prism//lib/prism/node.rb#9602 + sig do + params( + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InNode) + end def copy(pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8810 + # source://prism//lib/prism/node.rb#9584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#8836 + # source://prism//lib/prism/node.rb#9610 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def in: () -> String # - # source://prism//lib/prism/node.rb#8868 + # source://prism//lib/prism/node.rb#9641 + sig { returns(String) } def in; end # attr_reader in_loc: Location # - # source://prism//lib/prism/node.rb#8847 + # source://prism//lib/prism/node.rb#9621 + sig { returns(Prism::Location) } def in_loc; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#8878 + # source://prism//lib/prism/node.rb#9651 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#8841 + # source://prism//lib/prism/node.rb#9615 + sig { returns(Prism::Node) } def pattern; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#8844 + # source://prism//lib/prism/node.rb#9618 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then: () -> String? # - # source://prism//lib/prism/node.rb#8873 + # source://prism//lib/prism/node.rb#9646 + sig { returns(T.nilable(String)) } def then; end # attr_reader then_loc: Location? # - # source://prism//lib/prism/node.rb#8854 + # source://prism//lib/prism/node.rb#9628 + sig { returns(T.nilable(Prism::Location)) } def then_loc; end # Sometimes you want to check an instance of a node against a list of @@ -13386,7 +16291,8 @@ class Prism::InNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#8907 + # source://prism//lib/prism/node.rb#9680 + sig { override.returns(Symbol) } def type; end class << self @@ -13397,7 +16303,7 @@ class Prism::InNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#8917 + # source://prism//lib/prism/node.rb#9690 def type; end end end @@ -13407,130 +16313,189 @@ end # foo.bar[baz] &&= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#8926 +# source://prism//lib/prism/node.rb#9709 class Prism::IndexAndWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void # # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode # - # source://prism//lib/prism/node.rb#8928 + # source://prism//lib/prism/node.rb#9711 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#9916 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#8944 + # source://prism//lib/prism/node.rb#9727 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9009 + # source://prism//lib/prism/node.rb#9792 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9043 + # source://prism//lib/prism/node.rb#9825 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9019 + # source://prism//lib/prism/node.rb#9802 + sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9053 + # source://prism//lib/prism/node.rb#9835 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#8989 + # source://prism//lib/prism/node.rb#9772 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8949 + # source://prism//lib/prism/node.rb#9732 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9063 + # source://prism//lib/prism/node.rb#9845 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9012 + # source://prism//lib/prism/node.rb#9795 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#8964 + # source://prism//lib/prism/node.rb#9747 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#8954 + # source://prism//lib/prism/node.rb#9737 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexAndWriteNode # - # source://prism//lib/prism/node.rb#8969 + # source://prism//lib/prism/node.rb#9752 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexAndWriteNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#8949 + # source://prism//lib/prism/node.rb#9732 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#8977 + # source://prism//lib/prism/node.rb#9760 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9048 + # source://prism//lib/prism/node.rb#9830 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9073 + # source://prism//lib/prism/node.rb#9855 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9058 + # source://prism//lib/prism/node.rb#9840 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9002 + # source://prism//lib/prism/node.rb#9785 + sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9068 + # source://prism//lib/prism/node.rb#9850 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9022 + # source://prism//lib/prism/node.rb#9805 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#8986 + # source://prism//lib/prism/node.rb#9769 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9033 + # source://prism//lib/prism/node.rb#9815 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -13548,26 +16513,30 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9118 + # source://prism//lib/prism/node.rb#9900 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9029 + # source://prism//lib/prism/node.rb#9812 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9038 + # source://prism//lib/prism/node.rb#9820 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#8982 + # source://prism//lib/prism/node.rb#9765 + sig { returns(Integer) } def flags; end class << self @@ -13578,7 +16547,7 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9128 + # source://prism//lib/prism/node.rb#9910 def type; end end end @@ -13588,130 +16557,191 @@ end # foo.bar[baz] += value # ^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9137 +# source://prism//lib/prism/node.rb#9934 class Prism::IndexOperatorWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void # # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode # - # source://prism//lib/prism/node.rb#9139 + # source://prism//lib/prism/node.rb#9936 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10141 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9156 + # source://prism//lib/prism/node.rb#9953 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9221 + # source://prism//lib/prism/node.rb#10018 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9258 + # source://prism//lib/prism/node.rb#10054 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9231 + # source://prism//lib/prism/node.rb#10028 + sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9268 + # source://prism//lib/prism/node.rb#10064 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#9201 + # source://prism//lib/prism/node.rb#9998 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9161 + # source://prism//lib/prism/node.rb#9958 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9278 + # source://prism//lib/prism/node.rb#10074 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9224 + # source://prism//lib/prism/node.rb#10021 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9176 + # source://prism//lib/prism/node.rb#9973 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9166 + # source://prism//lib/prism/node.rb#9963 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode # - # source://prism//lib/prism/node.rb#9181 + # source://prism//lib/prism/node.rb#9978 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator: Symbol, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexOperatorWriteNode) + end def copy(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: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9161 + # source://prism//lib/prism/node.rb#9958 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#9189 + # source://prism//lib/prism/node.rb#9986 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9263 + # source://prism//lib/prism/node.rb#10059 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9283 + # source://prism//lib/prism/node.rb#10079 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9273 + # source://prism//lib/prism/node.rb#10069 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9214 + # source://prism//lib/prism/node.rb#10011 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#9234 + # source://prism//lib/prism/node.rb#10031 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9237 + # source://prism//lib/prism/node.rb#10034 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#9198 + # source://prism//lib/prism/node.rb#9995 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9248 + # source://prism//lib/prism/node.rb#10044 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -13729,26 +16759,30 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9329 + # source://prism//lib/prism/node.rb#10125 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9244 + # source://prism//lib/prism/node.rb#10041 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9253 + # source://prism//lib/prism/node.rb#10049 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#9194 + # source://prism//lib/prism/node.rb#9991 + sig { returns(Integer) } def flags; end class << self @@ -13759,7 +16793,7 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9339 + # source://prism//lib/prism/node.rb#10135 def type; end end end @@ -13769,130 +16803,189 @@ end # foo.bar[baz] ||= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9348 +# source://prism//lib/prism/node.rb#10160 class Prism::IndexOrWriteNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void # # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode # - # source://prism//lib/prism/node.rb#9350 + # source://prism//lib/prism/node.rb#10162 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10367 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9366 + # source://prism//lib/prism/node.rb#10178 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9431 + # source://prism//lib/prism/node.rb#10243 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9465 + # source://prism//lib/prism/node.rb#10276 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9441 + # source://prism//lib/prism/node.rb#10253 + sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism//lib/prism/node.rb#9475 + # source://prism//lib/prism/node.rb#10286 + sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism//lib/prism/node.rb#9411 + # source://prism//lib/prism/node.rb#10223 + sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9371 + # source://prism//lib/prism/node.rb#10183 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9485 + # source://prism//lib/prism/node.rb#10296 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9434 + # source://prism//lib/prism/node.rb#10246 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9386 + # source://prism//lib/prism/node.rb#10198 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9376 + # source://prism//lib/prism/node.rb#10188 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOrWriteNode # - # source://prism//lib/prism/node.rb#9391 + # source://prism//lib/prism/node.rb#10203 + sig do + params( + flags: Integer, + receiver: T.nilable(Prism::Node), + call_operator_loc: T.nilable(Prism::Location), + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::IndexOrWriteNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9371 + # source://prism//lib/prism/node.rb#10183 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#9399 + # source://prism//lib/prism/node.rb#10211 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9470 + # source://prism//lib/prism/node.rb#10281 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9495 + # source://prism//lib/prism/node.rb#10306 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9480 + # source://prism//lib/prism/node.rb#10291 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9424 + # source://prism//lib/prism/node.rb#10236 + sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9490 + # source://prism//lib/prism/node.rb#10301 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9444 + # source://prism//lib/prism/node.rb#10256 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader receiver: Prism::node? # - # source://prism//lib/prism/node.rb#9408 + # source://prism//lib/prism/node.rb#10220 + sig { returns(T.nilable(Prism::Node)) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9455 + # source://prism//lib/prism/node.rb#10266 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -13910,26 +17003,30 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9540 + # source://prism//lib/prism/node.rb#10351 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9451 + # source://prism//lib/prism/node.rb#10263 + sig { returns(Prism::Node) } def value; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9460 + # source://prism//lib/prism/node.rb#10271 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#9404 + # source://prism//lib/prism/node.rb#10216 + sig { returns(Integer) } def flags; end class << self @@ -13940,7 +17037,7 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9550 + # source://prism//lib/prism/node.rb#10361 def type; end end end @@ -13958,110 +17055,159 @@ end # for foo[bar] in baz do end # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#9567 +# source://prism//lib/prism/node.rb#10393 class Prism::IndexTargetNode < ::Prism::Node # def initialize: (Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location location) -> void # # @return [IndexTargetNode] a new instance of IndexTargetNode # - # source://prism//lib/prism/node.rb#9569 + # source://prism//lib/prism/node.rb#10395 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10555 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9582 + # source://prism//lib/prism/node.rb#10408 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#9633 + # source://prism//lib/prism/node.rb#10459 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9657 + # source://prism//lib/prism/node.rb#10482 + sig { returns(T::Boolean) } def attribute_write?; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#9643 + # source://prism//lib/prism/node.rb#10469 + sig { returns(T.nilable(Prism::Node)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9587 + # source://prism//lib/prism/node.rb#10413 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#9672 + # source://prism//lib/prism/node.rb#10497 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#9636 + # source://prism//lib/prism/node.rb#10462 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9601 + # source://prism//lib/prism/node.rb#10427 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9592 + # source://prism//lib/prism/node.rb#10418 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?location: Location) -> IndexTargetNode # - # source://prism//lib/prism/node.rb#9606 + # source://prism//lib/prism/node.rb#10432 + sig do + params( + flags: Integer, + receiver: Prism::Node, + opening_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + closing_loc: Prism::Location, + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::IndexTargetNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9587 + # source://prism//lib/prism/node.rb#10413 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, location: Location } # - # source://prism//lib/prism/node.rb#9614 + # source://prism//lib/prism/node.rb#10440 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9662 + # source://prism//lib/prism/node.rb#10487 + sig { returns(T::Boolean) } def ignore_visibility?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9677 + # source://prism//lib/prism/node.rb#10502 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#9667 + # source://prism//lib/prism/node.rb#10492 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#9626 + # source://prism//lib/prism/node.rb#10452 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader receiver: Prism::node # - # source://prism//lib/prism/node.rb#9623 + # source://prism//lib/prism/node.rb#10449 + sig { returns(Prism::Node) } def receiver; end # def safe_navigation?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9647 + # source://prism//lib/prism/node.rb#10472 + sig { returns(T::Boolean) } def safe_navigation?; end # Sometimes you want to check an instance of a node against a list of @@ -14079,21 +17225,24 @@ class Prism::IndexTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9714 + # source://prism//lib/prism/node.rb#10539 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#9652 + # source://prism//lib/prism/node.rb#10477 + sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#9619 + # source://prism//lib/prism/node.rb#10445 + sig { returns(Integer) } def flags; end class << self @@ -14104,7 +17253,7 @@ class Prism::IndexTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9724 + # source://prism//lib/prism/node.rb#10549 def type; end end end @@ -14112,11 +17261,12 @@ end # InlineComment objects are the most common. They correspond to comments in # the source file like this one that start with #. # -# source://prism//lib/prism/parse_result.rb#305 +# source://prism//lib/prism/parse_result.rb#310 class Prism::InlineComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism//lib/prism/parse_result.rb#313 + # source://prism//lib/prism/parse_result.rb#318 + sig { returns(String) } def inspect; end # Returns true if this comment happens on the same line as other code and @@ -14124,7 +17274,8 @@ class Prism::InlineComment < ::Prism::Comment # # @return [Boolean] # - # source://prism//lib/prism/parse_result.rb#308 + # source://prism//lib/prism/parse_result.rb#313 + sig { override.returns(T::Boolean) } def trailing?; end end @@ -14133,77 +17284,116 @@ end # @target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9733 +# source://prism//lib/prism/node.rb#10570 class Prism::InstanceVariableAndWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode # - # source://prism//lib/prism/node.rb#9735 + # source://prism//lib/prism/node.rb#10572 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10681 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9746 + # source://prism//lib/prism/node.rb#10583 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9751 + # source://prism//lib/prism/node.rb#10588 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9761 + # source://prism//lib/prism/node.rb#10598 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9756 + # source://prism//lib/prism/node.rb#10593 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableAndWriteNode # - # source://prism//lib/prism/node.rb#9766 + # source://prism//lib/prism/node.rb#10603 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::InstanceVariableAndWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9751 + # source://prism//lib/prism/node.rb#10588 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#9774 + # source://prism//lib/prism/node.rb#10611 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#179 + # source://prism//lib/prism/desugar_compiler.rb#181 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9805 + # source://prism//lib/prism/node.rb#10641 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#9779 + # source://prism//lib/prism/node.rb#10616 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#9782 + # source://prism//lib/prism/node.rb#10619 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#9800 + # source://prism//lib/prism/node.rb#10636 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9789 + # source://prism//lib/prism/node.rb#10626 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -14221,12 +17411,14 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9829 + # source://prism//lib/prism/node.rb#10665 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9796 + # source://prism//lib/prism/node.rb#10633 + sig { returns(Prism::Node) } def value; end class << self @@ -14237,7 +17429,7 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9839 + # source://prism//lib/prism/node.rb#10675 def type; end end end @@ -14247,77 +17439,118 @@ end # @target += value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9848 +# source://prism//lib/prism/node.rb#10694 class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void # # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#9850 + # source://prism//lib/prism/node.rb#10696 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10805 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9862 + # source://prism//lib/prism/node.rb#10708 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9867 + # source://prism//lib/prism/node.rb#10713 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9877 + # source://prism//lib/prism/node.rb#10723 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9872 + # source://prism//lib/prism/node.rb#10718 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#9882 + # source://prism//lib/prism/node.rb#10728 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + operator: Symbol, + location: Prism::Location + ).returns(Prism::InstanceVariableOperatorWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), operator: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9867 + # source://prism//lib/prism/node.rb#10713 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#9890 + # source://prism//lib/prism/node.rb#10736 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#191 + # source://prism//lib/prism/desugar_compiler.rb#193 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#9919 + # source://prism//lib/prism/node.rb#10764 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#9895 + # source://prism//lib/prism/node.rb#10741 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#9898 + # source://prism//lib/prism/node.rb#10744 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#9915 + # source://prism//lib/prism/node.rb#10761 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#9905 + # source://prism//lib/prism/node.rb#10751 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -14335,12 +17568,14 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#9944 + # source://prism//lib/prism/node.rb#10789 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#9912 + # source://prism//lib/prism/node.rb#10758 + sig { returns(Prism::Node) } def value; end class << self @@ -14351,7 +17586,7 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#9954 + # source://prism//lib/prism/node.rb#10799 def type; end end end @@ -14361,77 +17596,116 @@ end # @target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#9963 +# source://prism//lib/prism/node.rb#10819 class Prism::InstanceVariableOrWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode # - # source://prism//lib/prism/node.rb#9965 + # source://prism//lib/prism/node.rb#10821 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#10930 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#9976 + # source://prism//lib/prism/node.rb#10832 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9981 + # source://prism//lib/prism/node.rb#10837 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#9991 + # source://prism//lib/prism/node.rb#10847 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#9986 + # source://prism//lib/prism/node.rb#10842 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableOrWriteNode # - # source://prism//lib/prism/node.rb#9996 + # source://prism//lib/prism/node.rb#10852 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::InstanceVariableOrWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#9981 + # source://prism//lib/prism/node.rb#10837 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#10004 + # source://prism//lib/prism/node.rb#10860 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # source://prism//lib/prism/desugar_compiler.rb#185 + # source://prism//lib/prism/desugar_compiler.rb#187 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10035 + # source://prism//lib/prism/node.rb#10890 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#10009 + # source://prism//lib/prism/node.rb#10865 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#10012 + # source://prism//lib/prism/node.rb#10868 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#10030 + # source://prism//lib/prism/node.rb#10885 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#10019 + # source://prism//lib/prism/node.rb#10875 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -14449,12 +17723,14 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10059 + # source://prism//lib/prism/node.rb#10914 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#10026 + # source://prism//lib/prism/node.rb#10882 + sig { returns(Prism::Node) } def value; end class << self @@ -14465,7 +17741,7 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10069 + # source://prism//lib/prism/node.rb#10924 def type; end end end @@ -14475,54 +17751,72 @@ end # @foo # ^^^^ # -# source://prism//lib/prism/node.rb#10078 +# source://prism//lib/prism/node.rb#10943 class Prism::InstanceVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode # - # source://prism//lib/prism/node.rb#10080 + # source://prism//lib/prism/node.rb#10945 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11029 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10088 + # source://prism//lib/prism/node.rb#10953 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10093 + # source://prism//lib/prism/node.rb#10958 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10103 + # source://prism//lib/prism/node.rb#10968 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10098 + # source://prism//lib/prism/node.rb#10963 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableReadNode # - # source://prism//lib/prism/node.rb#10108 + # source://prism//lib/prism/node.rb#10973 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableReadNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10093 + # source://prism//lib/prism/node.rb#10958 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#10116 + # source://prism//lib/prism/node.rb#10981 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10129 + # source://prism//lib/prism/node.rb#10993 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -14531,7 +17825,8 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # @_test # name `:@_test` # - # source://prism//lib/prism/node.rb#10125 + # source://prism//lib/prism/node.rb#10990 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -14549,7 +17844,8 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10149 + # source://prism//lib/prism/node.rb#11013 + sig { override.returns(Symbol) } def type; end class << self @@ -14560,7 +17856,7 @@ class Prism::InstanceVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10159 + # source://prism//lib/prism/node.rb#11023 def type; end end end @@ -14570,59 +17866,78 @@ end # @foo, @bar = baz # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#10168 +# source://prism//lib/prism/node.rb#11039 class Prism::InstanceVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode # - # source://prism//lib/prism/node.rb#10170 + # source://prism//lib/prism/node.rb#11041 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11121 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10178 + # source://prism//lib/prism/node.rb#11049 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10183 + # source://prism//lib/prism/node.rb#11054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10193 + # source://prism//lib/prism/node.rb#11064 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10188 + # source://prism//lib/prism/node.rb#11059 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableTargetNode # - # source://prism//lib/prism/node.rb#10198 + # source://prism//lib/prism/node.rb#11069 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableTargetNode) } def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10183 + # source://prism//lib/prism/node.rb#11054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#10206 + # source://prism//lib/prism/node.rb#11077 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10215 + # source://prism//lib/prism/node.rb#11085 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#10211 + # source://prism//lib/prism/node.rb#11082 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -14640,7 +17955,8 @@ class Prism::InstanceVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10235 + # source://prism//lib/prism/node.rb#11105 + sig { override.returns(Symbol) } def type; end class << self @@ -14651,7 +17967,7 @@ class Prism::InstanceVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10245 + # source://prism//lib/prism/node.rb#11115 def type; end end end @@ -14661,54 +17977,89 @@ end # @foo = 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#10254 +# source://prism//lib/prism/node.rb#11131 class Prism::InstanceVariableWriteNode < ::Prism::Node # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode # - # source://prism//lib/prism/node.rb#10256 + # source://prism//lib/prism/node.rb#11133 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11258 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10267 + # source://prism//lib/prism/node.rb#11144 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10272 + # source://prism//lib/prism/node.rb#11149 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10282 + # source://prism//lib/prism/node.rb#11159 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10277 + # source://prism//lib/prism/node.rb#11154 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> InstanceVariableWriteNode # - # source://prism//lib/prism/node.rb#10287 + # source://prism//lib/prism/node.rb#11164 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InstanceVariableWriteNode) + end def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10272 + # source://prism//lib/prism/node.rb#11149 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#10295 + # source://prism//lib/prism/node.rb#11172 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10343 + # source://prism//lib/prism/node.rb#11218 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -14717,7 +18068,8 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # @_foo = "bar" # name `@_foo` # - # source://prism//lib/prism/node.rb#10304 + # source://prism//lib/prism/node.rb#11181 + sig { returns(Symbol) } def name; end # The location of the variable name. @@ -14725,12 +18077,14 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @_x = 1 # ^^^ # - # source://prism//lib/prism/node.rb#10310 + # source://prism//lib/prism/node.rb#11187 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#10338 + # source://prism//lib/prism/node.rb#11213 + sig { returns(String) } def operator; end # The location of the `=` operator. @@ -14738,7 +18092,8 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @x = y # ^ # - # source://prism//lib/prism/node.rb#10330 + # source://prism//lib/prism/node.rb#11206 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -14756,11 +18111,11 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10367 + # source://prism//lib/prism/node.rb#11242 + sig { override.returns(Symbol) } def type; end - # The value to assign to the instance variable. Can be any node that - # represents a non-void expression. + # 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 # ^^^^ @@ -14768,7 +18123,8 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # @_x = 1234 # ^^^^ # - # source://prism//lib/prism/node.rb#10324 + # source://prism//lib/prism/node.rb#11200 + sig { returns(Prism::Node) } def value; end class << self @@ -14779,34 +18135,34 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10377 + # source://prism//lib/prism/node.rb#11252 def type; end end end # Flags for integer nodes that correspond to the base of the integer. # -# source://prism//lib/prism/node.rb#18850 +# source://prism//lib/prism/node.rb#20373 module Prism::IntegerBaseFlags; end # 0b prefix # -# source://prism//lib/prism/node.rb#18852 +# source://prism//lib/prism/node.rb#20375 Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) # 0d or no prefix # -# source://prism//lib/prism/node.rb#18855 +# source://prism//lib/prism/node.rb#20378 Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) # 0x prefix # -# source://prism//lib/prism/node.rb#18861 +# source://prism//lib/prism/node.rb#20384 Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) # 0o or 0 prefix # -# source://prism//lib/prism/node.rb#18858 +# source://prism//lib/prism/node.rb#20381 Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) # Represents an integer number literal. @@ -14814,82 +18170,104 @@ Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) # 1 # ^ # -# source://prism//lib/prism/node.rb#10386 +# source://prism//lib/prism/node.rb#11271 class Prism::IntegerNode < ::Prism::Node # def initialize: (Integer flags, Integer value, Location location) -> void # # @return [IntegerNode] a new instance of IntegerNode # - # source://prism//lib/prism/node.rb#10388 + # source://prism//lib/prism/node.rb#11273 + sig { params(source: Prism::Source, flags: Integer, value: Integer, location: Prism::Location).void } def initialize(source, flags, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11380 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10397 + # source://prism//lib/prism/node.rb#11282 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def binary?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10438 + # source://prism//lib/prism/node.rb#11322 + sig { returns(T::Boolean) } def binary?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10402 + # source://prism//lib/prism/node.rb#11287 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10412 + # source://prism//lib/prism/node.rb#11297 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10407 + # source://prism//lib/prism/node.rb#11292 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?value: Integer, ?location: Location) -> IntegerNode # - # source://prism//lib/prism/node.rb#10417 + # source://prism//lib/prism/node.rb#11302 + sig { params(flags: Integer, value: Integer, location: Prism::Location).returns(Prism::IntegerNode) } def copy(flags: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def decimal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10443 + # source://prism//lib/prism/node.rb#11327 + sig { returns(T::Boolean) } def decimal?; end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10402 + # source://prism//lib/prism/node.rb#11287 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, value: Integer, location: Location } # - # source://prism//lib/prism/node.rb#10425 + # source://prism//lib/prism/node.rb#11310 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def hexadecimal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10453 + # source://prism//lib/prism/node.rb#11337 + sig { returns(T::Boolean) } def hexadecimal?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10458 + # source://prism//lib/prism/node.rb#11342 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def octal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10448 + # source://prism//lib/prism/node.rb#11332 + sig { returns(T::Boolean) } def octal?; end # Sometimes you want to check an instance of a node against a list of @@ -14907,19 +18285,22 @@ class Prism::IntegerNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10480 + # source://prism//lib/prism/node.rb#11364 + sig { override.returns(Symbol) } def type; end # The value of the integer literal as a number. # - # source://prism//lib/prism/node.rb#10434 + # source://prism//lib/prism/node.rb#11319 + sig { returns(Integer) } def value; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#10430 + # source://prism//lib/prism/node.rb#11315 + sig { returns(Integer) } def flags; end class << self @@ -14930,7 +18311,7 @@ class Prism::IntegerNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10490 + # source://prism//lib/prism/node.rb#11374 def type; end end end @@ -14940,7 +18321,7 @@ end # if /foo #{bar} baz/ then end # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10499 +# source://prism//lib/prism/node.rb#11391 class Prism::InterpolatedMatchLastLineNode < ::Prism::Node include ::Prism::RegularExpressionOptions @@ -14948,139 +18329,191 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode # - # source://prism//lib/prism/node.rb#10501 + # source://prism//lib/prism/node.rb#11393 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, parts, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11568 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10512 + # source://prism//lib/prism/node.rb#11404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10597 + # source://prism//lib/prism/node.rb#11488 + sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10522 + # source://prism//lib/prism/node.rb#11414 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#10632 + # source://prism//lib/prism/node.rb#11523 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#10564 + # source://prism//lib/prism/node.rb#11456 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10532 + # source://prism//lib/prism/node.rb#11424 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10527 + # source://prism//lib/prism/node.rb#11419 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedMatchLastLineNode # - # source://prism//lib/prism/node.rb#10537 + # source://prism//lib/prism/node.rb#11429 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedMatchLastLineNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10522 + # source://prism//lib/prism/node.rb#11414 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#10545 + # source://prism//lib/prism/node.rb#11437 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10592 + # source://prism//lib/prism/node.rb#11483 + sig { returns(T::Boolean) } def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10577 + # source://prism//lib/prism/node.rb#11468 + sig { returns(T::Boolean) } def extended?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10617 + # source://prism//lib/prism/node.rb#11508 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_us_ascii_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10622 + # source://prism//lib/prism/node.rb#11513 + sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10612 + # source://prism//lib/prism/node.rb#11503 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10572 + # source://prism//lib/prism/node.rb#11463 + sig { returns(T::Boolean) } def ignore_case?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10637 + # source://prism//lib/prism/node.rb#11528 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10582 + # source://prism//lib/prism/node.rb#11473 + sig { returns(T::Boolean) } def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10587 + # source://prism//lib/prism/node.rb#11478 + sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#10627 + # source://prism//lib/prism/node.rb#11518 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#10554 + # source://prism//lib/prism/node.rb#11446 + sig { returns(Prism::Location) } def opening_loc; end + sig { returns(Integer) } + def options; end + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#10561 + # source://prism//lib/prism/node.rb#11453 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # source://prism//lib/prism/node.rb#10516 + # source://prism//lib/prism/node.rb#11408 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -15098,28 +18531,32 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10661 + # source://prism//lib/prism/node.rb#11552 + sig { override.returns(Symbol) } def type; end # def utf_8?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10607 + # source://prism//lib/prism/node.rb#11498 + sig { returns(T::Boolean) } def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10602 + # source://prism//lib/prism/node.rb#11493 + sig { returns(T::Boolean) } def windows_31j?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#10550 + # source://prism//lib/prism/node.rb#11442 + sig { returns(Integer) } def flags; end class << self @@ -15130,7 +18567,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10671 + # source://prism//lib/prism/node.rb#11562 def type; end end end @@ -15140,7 +18577,7 @@ end # /foo #{bar} baz/ # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10680 +# source://prism//lib/prism/node.rb#11582 class Prism::InterpolatedRegularExpressionNode < ::Prism::Node include ::Prism::RegularExpressionOptions @@ -15148,139 +18585,191 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode # - # source://prism//lib/prism/node.rb#10682 + # source://prism//lib/prism/node.rb#11584 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, parts, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11759 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10693 + # source://prism//lib/prism/node.rb#11595 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10778 + # source://prism//lib/prism/node.rb#11679 + sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10703 + # source://prism//lib/prism/node.rb#11605 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#10813 + # source://prism//lib/prism/node.rb#11714 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#10745 + # source://prism//lib/prism/node.rb#11647 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10713 + # source://prism//lib/prism/node.rb#11615 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10708 + # source://prism//lib/prism/node.rb#11610 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedRegularExpressionNode # - # source://prism//lib/prism/node.rb#10718 + # source://prism//lib/prism/node.rb#11620 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedRegularExpressionNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10703 + # source://prism//lib/prism/node.rb#11605 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#10726 + # source://prism//lib/prism/node.rb#11628 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10773 + # source://prism//lib/prism/node.rb#11674 + sig { returns(T::Boolean) } def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10758 + # source://prism//lib/prism/node.rb#11659 + sig { returns(T::Boolean) } def extended?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10798 + # source://prism//lib/prism/node.rb#11699 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_us_ascii_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10803 + # source://prism//lib/prism/node.rb#11704 + sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10793 + # source://prism//lib/prism/node.rb#11694 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10753 + # source://prism//lib/prism/node.rb#11654 + sig { returns(T::Boolean) } def ignore_case?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10818 + # source://prism//lib/prism/node.rb#11719 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10763 + # source://prism//lib/prism/node.rb#11664 + sig { returns(T::Boolean) } def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10768 + # source://prism//lib/prism/node.rb#11669 + sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#10808 + # source://prism//lib/prism/node.rb#11709 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#10735 + # source://prism//lib/prism/node.rb#11637 + sig { returns(Prism::Location) } def opening_loc; end + sig { returns(Integer) } + def options; end + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#10742 + # source://prism//lib/prism/node.rb#11644 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # source://prism//lib/prism/node.rb#10697 + # source://prism//lib/prism/node.rb#11599 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -15298,28 +18787,32 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10842 + # source://prism//lib/prism/node.rb#11743 + sig { override.returns(Symbol) } def type; end # def utf_8?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10788 + # source://prism//lib/prism/node.rb#11689 + sig { returns(T::Boolean) } def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10783 + # source://prism//lib/prism/node.rb#11684 + sig { returns(T::Boolean) } def windows_31j?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#10731 + # source://prism//lib/prism/node.rb#11633 + sig { returns(Integer) } def flags; end class << self @@ -15330,7 +18823,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#10852 + # source://prism//lib/prism/node.rb#11753 def type; end end end @@ -15340,7 +18833,7 @@ end # "foo #{bar} baz" # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#10861 +# source://prism//lib/prism/node.rb#11773 class Prism::InterpolatedStringNode < ::Prism::Node include ::Prism::HeredocQuery @@ -15348,90 +18841,137 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode # - # source://prism//lib/prism/node.rb#10863 + # source://prism//lib/prism/node.rb#11775 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, parts, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#11917 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#10874 + # source://prism//lib/prism/node.rb#11786 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10884 + # source://prism//lib/prism/node.rb#11796 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#10961 + # source://prism//lib/prism/node.rb#11872 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#10932 + # source://prism//lib/prism/node.rb#11844 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#10894 + # source://prism//lib/prism/node.rb#11806 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#10889 + # source://prism//lib/prism/node.rb#11801 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedStringNode # - # source://prism//lib/prism/node.rb#10899 + # source://prism//lib/prism/node.rb#11811 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InterpolatedStringNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#10884 + # source://prism//lib/prism/node.rb#11796 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#10907 + # source://prism//lib/prism/node.rb#11819 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def frozen?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10946 + # source://prism//lib/prism/node.rb#11857 + sig { returns(T::Boolean) } def frozen?; end + sig { returns(T::Boolean) } + def heredoc?; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#10966 + # source://prism//lib/prism/node.rb#11877 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def mutable?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#10951 + # source://prism//lib/prism/node.rb#11862 + sig { returns(T::Boolean) } def mutable?; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#10956 + # source://prism//lib/prism/node.rb#11867 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#10916 + # source://prism//lib/prism/node.rb#11828 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] # - # source://prism//lib/prism/node.rb#10929 + # source://prism//lib/prism/node.rb#11841 + sig do + returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)]) + end def parts; end - # source://prism//lib/prism/node.rb#10878 + # source://prism//lib/prism/node.rb#11790 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -15449,14 +18989,16 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#10990 + # source://prism//lib/prism/node.rb#11901 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#10912 + # source://prism//lib/prism/node.rb#11824 + sig { returns(Integer) } def flags; end class << self @@ -15467,20 +19009,20 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11000 + # source://prism//lib/prism/node.rb#11911 def type; end end end # Flags for interpolated string nodes that indicated mutability if they are also marked as literals. # -# source://prism//lib/prism/node.rb#18865 +# source://prism//lib/prism/node.rb#20388 module Prism::InterpolatedStringNodeFlags; end -# source://prism//lib/prism/node.rb#18867 +# source://prism//lib/prism/node.rb#20390 Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#18870 +# source://prism//lib/prism/node.rb#20393 Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # Represents a symbol literal that contains interpolation. @@ -15488,82 +19030,120 @@ Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # :"foo #{bar} baz" # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11009 +# source://prism//lib/prism/node.rb#11931 class Prism::InterpolatedSymbolNode < ::Prism::Node # def initialize: (Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc, Location location) -> void # # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode # - # source://prism//lib/prism/node.rb#11011 + # source://prism//lib/prism/node.rb#11933 + sig do + params( + source: Prism::Source, + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, opening_loc, parts, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12058 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11021 + # source://prism//lib/prism/node.rb#11943 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11031 + # source://prism//lib/prism/node.rb#11953 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#11094 + # source://prism//lib/prism/node.rb#12015 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#11075 + # source://prism//lib/prism/node.rb#11997 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11041 + # source://prism//lib/prism/node.rb#11963 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11036 + # source://prism//lib/prism/node.rb#11958 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedSymbolNode # - # source://prism//lib/prism/node.rb#11046 + # source://prism//lib/prism/node.rb#11968 + sig do + params( + opening_loc: T.nilable(Prism::Location), + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::InterpolatedSymbolNode) + end def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11031 + # source://prism//lib/prism/node.rb#11953 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#11054 + # source://prism//lib/prism/node.rb#11976 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11099 + # source://prism//lib/prism/node.rb#12020 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#11089 + # source://prism//lib/prism/node.rb#12010 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#11059 + # source://prism//lib/prism/node.rb#11981 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#11072 + # source://prism//lib/prism/node.rb#11994 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # source://prism//lib/prism/node.rb#11025 + # source://prism//lib/prism/node.rb#11947 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -15581,7 +19161,8 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11121 + # source://prism//lib/prism/node.rb#12042 + sig { override.returns(Symbol) } def type; end class << self @@ -15592,7 +19173,7 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11131 + # source://prism//lib/prism/node.rb#12052 def type; end end end @@ -15602,7 +19183,7 @@ end # `foo #{bar} baz` # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11140 +# source://prism//lib/prism/node.rb#12071 class Prism::InterpolatedXStringNode < ::Prism::Node include ::Prism::HeredocQuery @@ -15610,76 +19191,117 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode # - # source://prism//lib/prism/node.rb#11142 + # source://prism//lib/prism/node.rb#12073 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, opening_loc, parts, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12186 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11152 + # source://prism//lib/prism/node.rb#12083 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11162 + # source://prism//lib/prism/node.rb#12093 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#11213 + # source://prism//lib/prism/node.rb#12143 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#11200 + # source://prism//lib/prism/node.rb#12131 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11172 + # source://prism//lib/prism/node.rb#12103 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11167 + # source://prism//lib/prism/node.rb#12098 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedXStringNode # - # source://prism//lib/prism/node.rb#11177 + # source://prism//lib/prism/node.rb#12108 + sig do + params( + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::InterpolatedXStringNode) + end def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11162 + # source://prism//lib/prism/node.rb#12093 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#11185 + # source://prism//lib/prism/node.rb#12116 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + sig { returns(T::Boolean) } + def heredoc?; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11218 + # source://prism//lib/prism/node.rb#12148 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#11208 + # source://prism//lib/prism/node.rb#12138 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#11190 + # source://prism//lib/prism/node.rb#12121 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism//lib/prism/node.rb#11197 + # source://prism//lib/prism/node.rb#12128 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } def parts; end - # source://prism//lib/prism/node.rb#11156 + # source://prism//lib/prism/node.rb#12087 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -15697,7 +19319,8 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11240 + # source://prism//lib/prism/node.rb#12170 + sig { override.returns(Symbol) } def type; end class << self @@ -15708,7 +19331,7 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11250 + # source://prism//lib/prism/node.rb#12180 def type; end end end @@ -15718,54 +19341,72 @@ end # -> { it + it } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11259 +# source://prism//lib/prism/node.rb#12199 class Prism::ItParametersNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ItParametersNode] a new instance of ItParametersNode # - # source://prism//lib/prism/node.rb#11261 + # source://prism//lib/prism/node.rb#12201 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12276 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11268 + # source://prism//lib/prism/node.rb#12208 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11273 + # source://prism//lib/prism/node.rb#12213 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11283 + # source://prism//lib/prism/node.rb#12223 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11278 + # source://prism//lib/prism/node.rb#12218 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> ItParametersNode # - # source://prism//lib/prism/node.rb#11288 + # source://prism//lib/prism/node.rb#12228 + sig { params(location: Prism::Location).returns(Prism::ItParametersNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11273 + # source://prism//lib/prism/node.rb#12213 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#11296 + # source://prism//lib/prism/node.rb#12236 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11302 + # source://prism//lib/prism/node.rb#12241 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -15783,7 +19424,8 @@ class Prism::ItParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11321 + # source://prism//lib/prism/node.rb#12260 + sig { override.returns(Symbol) } def type; end class << self @@ -15794,7 +19436,7 @@ class Prism::ItParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11331 + # source://prism//lib/prism/node.rb#12270 def type; end end end @@ -15804,66 +19446,99 @@ end # foo(a: b) # ^^^^ # -# source://prism//lib/prism/node.rb#11340 +# source://prism//lib/prism/node.rb#12285 class Prism::KeywordHashNode < ::Prism::Node # def initialize: (Integer flags, Array[AssocNode | AssocSplatNode] elements, Location location) -> void # # @return [KeywordHashNode] a new instance of KeywordHashNode # - # source://prism//lib/prism/node.rb#11342 + # source://prism//lib/prism/node.rb#12287 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).void + end def initialize(source, flags, elements, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12379 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11351 + # source://prism//lib/prism/node.rb#12296 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11356 + # source://prism//lib/prism/node.rb#12301 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11366 + # source://prism//lib/prism/node.rb#12311 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11361 + # source://prism//lib/prism/node.rb#12306 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode], ?location: Location) -> KeywordHashNode # - # source://prism//lib/prism/node.rb#11371 + # source://prism//lib/prism/node.rb#12316 + sig do + params( + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).returns(Prism::KeywordHashNode) + end def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11356 + # source://prism//lib/prism/node.rb#12301 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[AssocNode | AssocSplatNode], location: Location } # - # source://prism//lib/prism/node.rb#11379 + # source://prism//lib/prism/node.rb#12324 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader elements: Array[AssocNode | AssocSplatNode] # - # source://prism//lib/prism/node.rb#11388 + # source://prism//lib/prism/node.rb#12333 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } def elements; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11397 + # source://prism//lib/prism/node.rb#12341 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def symbol_keys?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11392 + # source://prism//lib/prism/node.rb#12336 + sig { returns(T::Boolean) } def symbol_keys?; end # Sometimes you want to check an instance of a node against a list of @@ -15881,14 +19556,16 @@ class Prism::KeywordHashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11419 + # source://prism//lib/prism/node.rb#12363 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#11384 + # source://prism//lib/prism/node.rb#12329 + sig { returns(Integer) } def flags; end class << self @@ -15899,19 +19576,19 @@ class Prism::KeywordHashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11429 + # source://prism//lib/prism/node.rb#12373 def type; end end end # Flags for keyword hash nodes. # -# source://prism//lib/prism/node.rb#18874 +# source://prism//lib/prism/node.rb#20397 module Prism::KeywordHashNodeFlags; end # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments # -# source://prism//lib/prism/node.rb#18876 +# source://prism//lib/prism/node.rb#20399 Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) # Represents a keyword rest parameter to a method, block, or lambda definition. @@ -15920,81 +19597,121 @@ Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) # ^^^ # end # -# source://prism//lib/prism/node.rb#11439 +# source://prism//lib/prism/node.rb#12392 class Prism::KeywordRestParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode # - # source://prism//lib/prism/node.rb#11441 + # source://prism//lib/prism/node.rb#12394 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12519 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11452 + # source://prism//lib/prism/node.rb#12405 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11457 + # source://prism//lib/prism/node.rb#12410 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11467 + # source://prism//lib/prism/node.rb#12420 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11462 + # source://prism//lib/prism/node.rb#12415 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> KeywordRestParameterNode # - # source://prism//lib/prism/node.rb#11472 + # source://prism//lib/prism/node.rb#12425 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::KeywordRestParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11457 + # source://prism//lib/prism/node.rb#12410 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#11480 + # source://prism//lib/prism/node.rb#12433 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11523 + # source://prism//lib/prism/node.rb#12475 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#11489 + # source://prism//lib/prism/node.rb#12442 + sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#11492 + # source://prism//lib/prism/node.rb#12445 + sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#11518 + # source://prism//lib/prism/node.rb#12470 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11505 + # source://prism//lib/prism/node.rb#12458 + sig { returns(Prism::Location) } def operator_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#11513 + # source://prism//lib/prism/node.rb#12465 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -16012,14 +19729,16 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11551 + # source://prism//lib/prism/node.rb#12503 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#11485 + # source://prism//lib/prism/node.rb#12438 + sig { returns(Integer) } def flags; end class << self @@ -16030,7 +19749,7 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11561 + # source://prism//lib/prism/node.rb#12513 def type; end end end @@ -16040,99 +19759,147 @@ end # ->(value) { value * 2 } # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11570 +# source://prism//lib/prism/node.rb#12532 class Prism::LambdaNode < ::Prism::Node # def initialize: (Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, Prism::node? parameters, Prism::node? body, Location location) -> void # # @return [LambdaNode] a new instance of LambdaNode # - # source://prism//lib/prism/node.rb#11572 + # source://prism//lib/prism/node.rb#12534 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12679 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11585 + # source://prism//lib/prism/node.rb#12547 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#11648 + # source://prism//lib/prism/node.rb#12610 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11590 + # source://prism//lib/prism/node.rb#12552 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#11662 + # source://prism//lib/prism/node.rb#12623 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#11638 + # source://prism//lib/prism/node.rb#12600 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11603 + # source://prism//lib/prism/node.rb#12565 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11595 + # source://prism//lib/prism/node.rb#12557 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: Prism::node?, ?body: Prism::node?, ?location: Location) -> LambdaNode # - # source://prism//lib/prism/node.rb#11608 + # source://prism//lib/prism/node.rb#12570 + sig do + params( + locals: T::Array[Symbol], + operator_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::LambdaNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11590 + # source://prism//lib/prism/node.rb#12552 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Prism::node?, body: Prism::node?, location: Location } # - # source://prism//lib/prism/node.rb#11616 + # source://prism//lib/prism/node.rb#12578 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11667 + # source://prism//lib/prism/node.rb#12628 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#11621 + # source://prism//lib/prism/node.rb#12583 + sig { returns(T::Array[Symbol]) } def locals; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#11657 + # source://prism//lib/prism/node.rb#12618 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#11631 + # source://prism//lib/prism/node.rb#12593 + sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#11652 + # source://prism//lib/prism/node.rb#12613 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11624 + # source://prism//lib/prism/node.rb#12586 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader parameters: Prism::node? # - # source://prism//lib/prism/node.rb#11645 + # source://prism//lib/prism/node.rb#12607 + sig { returns(T.nilable(Prism::Node)) } def parameters; end # Sometimes you want to check an instance of a node against a list of @@ -16150,7 +19917,8 @@ class Prism::LambdaNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11702 + # source://prism//lib/prism/node.rb#12663 + sig { override.returns(Symbol) } def type; end class << self @@ -16161,7 +19929,7 @@ class Prism::LambdaNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11712 + # source://prism//lib/prism/node.rb#12673 def type; end end end @@ -16176,29 +19944,29 @@ end class Prism::LexCompat # @return [LexCompat] a new instance of LexCompat # - # source://prism//lib/prism/lex_compat.rb#602 + # source://prism//lib/prism/lex_compat.rb#619 def initialize(source, **options); end # Returns the value of attribute options. # - # source://prism//lib/prism/lex_compat.rb#600 + # source://prism//lib/prism/lex_compat.rb#617 def options; end - # source://prism//lib/prism/lex_compat.rb#607 + # source://prism//lib/prism/lex_compat.rb#624 def result; end # Returns the value of attribute source. # - # source://prism//lib/prism/lex_compat.rb#600 + # source://prism//lib/prism/lex_compat.rb#617 def source; end end # Ripper doesn't include the rest of the token in the event, so we need to # trim it down to just the content on the first line when comparing. # -# source://prism//lib/prism/lex_compat.rb#213 +# source://prism//lib/prism/lex_compat.rb#230 class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token - # source://prism//lib/prism/lex_compat.rb#214 + # source://prism//lib/prism/lex_compat.rb#231 def ==(other); end end @@ -16206,13 +19974,13 @@ end # heredoc that should be appended onto the list of tokens when the heredoc # closes. # -# source://prism//lib/prism/lex_compat.rb#274 +# source://prism//lib/prism/lex_compat.rb#291 module Prism::LexCompat::Heredoc class << self # Here we will split between the two types of heredocs and return the # object that will store their tokens. # - # source://prism//lib/prism/lex_compat.rb#586 + # source://prism//lib/prism/lex_compat.rb#603 def build(opening); end end end @@ -16221,23 +19989,23 @@ end # that need to be split on "\\\n" to mimic Ripper's behavior. We also need # to keep track of the state that the heredoc was opened in. # -# source://prism//lib/prism/lex_compat.rb#298 +# source://prism//lib/prism/lex_compat.rb#315 class Prism::LexCompat::Heredoc::DashHeredoc # @return [DashHeredoc] a new instance of DashHeredoc # - # source://prism//lib/prism/lex_compat.rb#301 + # source://prism//lib/prism/lex_compat.rb#318 def initialize(split); end - # source://prism//lib/prism/lex_compat.rb#306 + # source://prism//lib/prism/lex_compat.rb#323 def <<(token); end - # source://prism//lib/prism/lex_compat.rb#299 + # source://prism//lib/prism/lex_compat.rb#316 def split; end - # source://prism//lib/prism/lex_compat.rb#310 + # source://prism//lib/prism/lex_compat.rb#327 def to_a; end - # source://prism//lib/prism/lex_compat.rb#299 + # source://prism//lib/prism/lex_compat.rb#316 def tokens; end end @@ -16252,45 +20020,45 @@ end # some extra manipulation on the tokens to make them match Ripper's # output by mirroring the dedent logic that Ripper uses. # -# source://prism//lib/prism/lex_compat.rb#357 +# source://prism//lib/prism/lex_compat.rb#374 class Prism::LexCompat::Heredoc::DedentingHeredoc # @return [DedentingHeredoc] a new instance of DedentingHeredoc # - # source://prism//lib/prism/lex_compat.rb#362 + # source://prism//lib/prism/lex_compat.rb#379 def initialize; end # As tokens are coming in, we track the minimum amount of common leading # whitespace on plain string content tokens. This allows us to later # remove that amount of whitespace from the beginning of each line. # - # source://prism//lib/prism/lex_compat.rb#373 + # source://prism//lib/prism/lex_compat.rb#390 def <<(token); end # Returns the value of attribute dedent. # - # source://prism//lib/prism/lex_compat.rb#360 + # source://prism//lib/prism/lex_compat.rb#377 def dedent; end # Returns the value of attribute dedent_next. # - # source://prism//lib/prism/lex_compat.rb#360 + # source://prism//lib/prism/lex_compat.rb#377 def dedent_next; end # Returns the value of attribute embexpr_balance. # - # source://prism//lib/prism/lex_compat.rb#360 + # source://prism//lib/prism/lex_compat.rb#377 def embexpr_balance; end - # source://prism//lib/prism/lex_compat.rb#410 + # source://prism//lib/prism/lex_compat.rb#427 def to_a; end # Returns the value of attribute tokens. # - # source://prism//lib/prism/lex_compat.rb#360 + # source://prism//lib/prism/lex_compat.rb#377 def tokens; end end -# source://prism//lib/prism/lex_compat.rb#358 +# source://prism//lib/prism/lex_compat.rb#375 Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) # Heredocs that are no dash or tilde heredocs are just a list of tokens. @@ -16298,20 +20066,20 @@ Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), In # order back into the token stream and set the state of the last token to # the state that the heredoc was opened in. # -# source://prism//lib/prism/lex_compat.rb#279 +# source://prism//lib/prism/lex_compat.rb#296 class Prism::LexCompat::Heredoc::PlainHeredoc # @return [PlainHeredoc] a new instance of PlainHeredoc # - # source://prism//lib/prism/lex_compat.rb#282 + # source://prism//lib/prism/lex_compat.rb#299 def initialize; end - # source://prism//lib/prism/lex_compat.rb#286 + # source://prism//lib/prism/lex_compat.rb#303 def <<(token); end - # source://prism//lib/prism/lex_compat.rb#290 + # source://prism//lib/prism/lex_compat.rb#307 def to_a; end - # source://prism//lib/prism/lex_compat.rb#280 + # source://prism//lib/prism/lex_compat.rb#297 def tokens; end end @@ -16320,27 +20088,27 @@ end # through named captures in regular expressions). In that case we don't # compare the state. # -# source://prism//lib/prism/lex_compat.rb#231 +# source://prism//lib/prism/lex_compat.rb#248 class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token - # source://prism//lib/prism/lex_compat.rb#232 + # source://prism//lib/prism/lex_compat.rb#249 def ==(other); end end # Tokens where state should be ignored # used for :on_comment, :on_heredoc_end, :on_embexpr_end # -# source://prism//lib/prism/lex_compat.rb#221 +# source://prism//lib/prism/lex_compat.rb#238 class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token - # source://prism//lib/prism/lex_compat.rb#222 + # source://prism//lib/prism/lex_compat.rb#239 def ==(other); end end # Ignored newlines can occasionally have a LABEL state attached to them, so # we compare the state differently here. # -# source://prism//lib/prism/lex_compat.rb#242 +# source://prism//lib/prism/lex_compat.rb#259 class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token - # source://prism//lib/prism/lex_compat.rb#243 + # source://prism//lib/prism/lex_compat.rb#260 def ==(other); end end @@ -16353,9 +20121,9 @@ end # more accurately, so we need to allow comparing against both END and # END|LABEL. # -# source://prism//lib/prism/lex_compat.rb#262 +# source://prism//lib/prism/lex_compat.rb#279 class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token - # source://prism//lib/prism/lex_compat.rb#263 + # source://prism//lib/prism/lex_compat.rb#280 def ==(other); end end @@ -16363,55 +20131,112 @@ end # many-to-one mapping because we split up our token types, whereas Ripper # tends to group them. # -# source://prism//lib/prism/lex_compat.rb#16 +# source://prism//lib/prism/lex_compat.rb#33 Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) +# A result class specialized for holding tokens produced by the lexer. +# +# source://prism//lib/prism/lex_compat.rb#14 +class Prism::LexCompat::Result < ::Prism::Result + # Create a new lex compat result object with the given values. + # + # @return [Result] a new instance of Result + # + # source://prism//lib/prism/lex_compat.rb#19 + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for Result. + # + # source://prism//lib/prism/lex_compat.rb#25 + def deconstruct_keys(keys); end + + # The list of tokens that were produced by the lexer. + # + # source://prism//lib/prism/lex_compat.rb#16 + def value; end +end + # When we produce tokens, we produce the same arrays that Ripper does. # However, we add a couple of convenience methods onto them to make them a # little easier to work with. We delegate all other methods to the array. # -# source://prism//lib/prism/lex_compat.rb#187 +# source://prism//lib/prism/lex_compat.rb#204 class Prism::LexCompat::Token < ::SimpleDelegator # The type of the token. # - # source://prism//lib/prism/lex_compat.rb#196 + # source://prism//lib/prism/lex_compat.rb#213 def event; end # The location of the token in the source. # - # source://prism//lib/prism/lex_compat.rb#191 + # source://prism//lib/prism/lex_compat.rb#208 def location; end # The state of the lexer when this token was produced. # - # source://prism//lib/prism/lex_compat.rb#206 + # source://prism//lib/prism/lex_compat.rb#223 def state; end # The slice of the source that this token represents. # - # source://prism//lib/prism/lex_compat.rb#201 + # source://prism//lib/prism/lex_compat.rb#218 + def value; end +end + +# This is a result specific to the `lex` and `lex_file` methods. +# +# source://prism//lib/prism/parse_result.rb#515 +class Prism::LexResult < ::Prism::Result + # Create a new lex result object with the given values. + # + # @return [LexResult] a new instance of LexResult + # + # source://prism//lib/prism/parse_result.rb#520 + sig do + params( + value: T::Array[T.untyped], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for LexResult. + # + # source://prism//lib/prism/parse_result.rb#526 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # The list of tokens that were parsed from the source code. + # + # source://prism//lib/prism/parse_result.rb#517 + sig { returns(T::Array[T.untyped]) } def value; end end # This is a class that wraps the Ripper lexer to produce almost exactly the # same tokens. # -# source://prism//lib/prism/lex_compat.rb#855 +# source://prism//lib/prism/lex_compat.rb#872 class Prism::LexRipper # @return [LexRipper] a new instance of LexRipper # - # source://prism//lib/prism/lex_compat.rb#858 + # source://prism//lib/prism/lex_compat.rb#875 def initialize(source); end - # source://prism//lib/prism/lex_compat.rb#862 + # source://prism//lib/prism/lex_compat.rb#879 def result; end - # source://prism//lib/prism/lex_compat.rb#856 + # source://prism//lib/prism/lex_compat.rb#873 def source; end private - # source://prism//lib/prism/lex_compat.rb#896 + # source://prism//lib/prism/lex_compat.rb#913 def lex(source); end end @@ -16420,82 +20245,124 @@ end # target &&= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11721 +# source://prism//lib/prism/node.rb#12695 class Prism::LocalVariableAndWriteNode < ::Prism::Node # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void # # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#11723 + # source://prism//lib/prism/node.rb#12697 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end def initialize(source, name_loc, operator_loc, value, name, depth, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12811 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11735 + # source://prism//lib/prism/node.rb#12709 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11740 + # source://prism//lib/prism/node.rb#12714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11750 + # source://prism//lib/prism/node.rb#12724 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11745 + # source://prism//lib/prism/node.rb#12719 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableAndWriteNode # - # source://prism//lib/prism/node.rb#11755 + # source://prism//lib/prism/node.rb#12729 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableAndWriteNode) + end def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11740 + # source://prism//lib/prism/node.rb#12714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } # - # source://prism//lib/prism/node.rb#11763 + # source://prism//lib/prism/node.rb#12737 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#11788 + # source://prism//lib/prism/node.rb#12762 + sig { returns(Integer) } def depth; end - # source://prism//lib/prism/desugar_compiler.rb#197 + # source://prism//lib/prism/desugar_compiler.rb#199 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11797 + # source://prism//lib/prism/node.rb#12770 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#11785 + # source://prism//lib/prism/node.rb#12759 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#11768 + # source://prism//lib/prism/node.rb#12742 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#11792 + # source://prism//lib/prism/node.rb#12765 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11775 + # source://prism//lib/prism/node.rb#12749 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -16513,12 +20380,14 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11822 + # source://prism//lib/prism/node.rb#12795 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#11782 + # source://prism//lib/prism/node.rb#12756 + sig { returns(Prism::Node) } def value; end class << self @@ -16529,7 +20398,7 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11832 + # source://prism//lib/prism/node.rb#12805 def type; end end end @@ -16539,82 +20408,126 @@ end # target += value # ^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11841 +# source://prism//lib/prism/node.rb#12825 class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Symbol operator, Integer depth, Location location) -> void # # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#11843 + # source://prism//lib/prism/node.rb#12827 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + operator: Symbol, + depth: Integer, + location: Prism::Location + ).void + end def initialize(source, name_loc, operator_loc, value, name, operator, depth, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#12941 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11856 + # source://prism//lib/prism/node.rb#12840 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11861 + # source://prism//lib/prism/node.rb#12845 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11871 + # source://prism//lib/prism/node.rb#12855 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11866 + # source://prism//lib/prism/node.rb#12850 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode # - # source://prism//lib/prism/node.rb#11876 + # source://prism//lib/prism/node.rb#12860 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + operator: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableOperatorWriteNode) + end def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), operator: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11861 + # source://prism//lib/prism/node.rb#12845 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, operator: Symbol, depth: Integer, location: Location } # - # source://prism//lib/prism/node.rb#11884 + # source://prism//lib/prism/node.rb#12868 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#11912 + # source://prism//lib/prism/node.rb#12896 + sig { returns(Integer) } def depth; end - # source://prism//lib/prism/desugar_compiler.rb#209 + # source://prism//lib/prism/desugar_compiler.rb#211 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#11916 + # source://prism//lib/prism/node.rb#12899 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#11906 + # source://prism//lib/prism/node.rb#12890 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#11889 + # source://prism//lib/prism/node.rb#12873 + sig { returns(Prism::Location) } def name_loc; end # attr_reader operator: Symbol # - # source://prism//lib/prism/node.rb#11909 + # source://prism//lib/prism/node.rb#12893 + sig { returns(Symbol) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#11896 + # source://prism//lib/prism/node.rb#12880 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -16632,12 +20545,14 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#11942 + # source://prism//lib/prism/node.rb#12925 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#11903 + # source://prism//lib/prism/node.rb#12887 + sig { returns(Prism::Node) } def value; end class << self @@ -16648,7 +20563,7 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#11952 + # source://prism//lib/prism/node.rb#12935 def type; end end end @@ -16658,82 +20573,124 @@ end # target ||= value # ^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#11961 +# source://prism//lib/prism/node.rb#12956 class Prism::LocalVariableOrWriteNode < ::Prism::Node # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void # # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#11963 + # source://prism//lib/prism/node.rb#12958 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end def initialize(source, name_loc, operator_loc, value, name, depth, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13072 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#11975 + # source://prism//lib/prism/node.rb#12970 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11980 + # source://prism//lib/prism/node.rb#12975 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#11990 + # source://prism//lib/prism/node.rb#12985 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#11985 + # source://prism//lib/prism/node.rb#12980 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOrWriteNode # - # source://prism//lib/prism/node.rb#11995 + # source://prism//lib/prism/node.rb#12990 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).returns(Prism::LocalVariableOrWriteNode) + end def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#11980 + # source://prism//lib/prism/node.rb#12975 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } # - # source://prism//lib/prism/node.rb#12003 + # source://prism//lib/prism/node.rb#12998 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12028 + # source://prism//lib/prism/node.rb#13023 + sig { returns(Integer) } def depth; end - # source://prism//lib/prism/desugar_compiler.rb#203 + # source://prism//lib/prism/desugar_compiler.rb#205 def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12037 + # source://prism//lib/prism/node.rb#13031 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12025 + # source://prism//lib/prism/node.rb#13020 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#12008 + # source://prism//lib/prism/node.rb#13003 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12032 + # source://prism//lib/prism/node.rb#13026 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#12015 + # source://prism//lib/prism/node.rb#13010 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -16751,12 +20708,14 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12062 + # source://prism//lib/prism/node.rb#13056 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12022 + # source://prism//lib/prism/node.rb#13017 + sig { returns(Prism::Node) } def value; end class << self @@ -16767,7 +20726,7 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12072 + # source://prism//lib/prism/node.rb#13066 def type; end end end @@ -16777,49 +20736,63 @@ end # foo # ^^^ # -# source://prism//lib/prism/node.rb#12081 +# source://prism//lib/prism/node.rb#13086 class Prism::LocalVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Integer depth, Location location) -> void # # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode # - # source://prism//lib/prism/node.rb#12083 + # source://prism//lib/prism/node.rb#13088 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } def initialize(source, name, depth, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13191 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12092 + # source://prism//lib/prism/node.rb#13097 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12097 + # source://prism//lib/prism/node.rb#13102 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12107 + # source://prism//lib/prism/node.rb#13112 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12102 + # source://prism//lib/prism/node.rb#13107 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableReadNode # - # source://prism//lib/prism/node.rb#12112 + # source://prism//lib/prism/node.rb#13117 + sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableReadNode) } def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12097 + # source://prism//lib/prism/node.rb#13102 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism//lib/prism/node.rb#12120 + # source://prism//lib/prism/node.rb#13125 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # The number of visible scopes that should be searched to find the origin of this local variable. @@ -16830,12 +20803,17 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). # - # source://prism//lib/prism/node.rb#12146 + # source://prism//lib/prism/node.rb#13151 + sig { returns(Integer) } def depth; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12150 + # source://prism//lib/prism/node.rb#13154 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). @@ -16852,7 +20830,8 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # it # name `:0it` # - # source://prism//lib/prism/node.rb#12137 + # source://prism//lib/prism/node.rb#13142 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -16870,7 +20849,8 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12171 + # source://prism//lib/prism/node.rb#13175 + sig { override.returns(Symbol) } def type; end class << self @@ -16881,7 +20861,7 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12181 + # source://prism//lib/prism/node.rb#13185 def type; end end end @@ -16891,64 +20871,84 @@ end # foo, bar = baz # ^^^ ^^^ # -# source://prism//lib/prism/node.rb#12190 +# source://prism//lib/prism/node.rb#13202 class Prism::LocalVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Integer depth, Location location) -> void # # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode # - # source://prism//lib/prism/node.rb#12192 + # source://prism//lib/prism/node.rb#13204 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } def initialize(source, name, depth, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13289 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12201 + # source://prism//lib/prism/node.rb#13213 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12206 + # source://prism//lib/prism/node.rb#13218 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12216 + # source://prism//lib/prism/node.rb#13228 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12211 + # source://prism//lib/prism/node.rb#13223 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableTargetNode # - # source://prism//lib/prism/node.rb#12221 + # source://prism//lib/prism/node.rb#13233 + sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableTargetNode) } def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12206 + # source://prism//lib/prism/node.rb#13218 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism//lib/prism/node.rb#12229 + # source://prism//lib/prism/node.rb#13241 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader depth: Integer # - # source://prism//lib/prism/node.rb#12237 + # source://prism//lib/prism/node.rb#13249 + sig { returns(Integer) } def depth; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12241 + # source://prism//lib/prism/node.rb#13252 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#12234 + # source://prism//lib/prism/node.rb#13246 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -16966,7 +20966,8 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12262 + # source://prism//lib/prism/node.rb#13273 + sig { override.returns(Symbol) } def type; end class << self @@ -16977,7 +20978,7 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12272 + # source://prism//lib/prism/node.rb#13283 def type; end end end @@ -16987,79 +20988,137 @@ end # foo = 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#12281 +# source://prism//lib/prism/node.rb#13300 class Prism::LocalVariableWriteNode < ::Prism::Node # def initialize: (Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode # - # source://prism//lib/prism/node.rb#12283 + # source://prism//lib/prism/node.rb#13302 + sig do + params( + source: Prism::Source, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, depth, name_loc, value, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13442 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12295 + # source://prism//lib/prism/node.rb#13314 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12300 + # source://prism//lib/prism/node.rb#13319 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12310 + # source://prism//lib/prism/node.rb#13329 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12305 + # source://prism//lib/prism/node.rb#13324 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> LocalVariableWriteNode # - # source://prism//lib/prism/node.rb#12315 + # source://prism//lib/prism/node.rb#13334 + sig do + params( + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::LocalVariableWriteNode) + end def copy(name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12300 + # source://prism//lib/prism/node.rb#13319 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#12323 + # source://prism//lib/prism/node.rb#13342 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader 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 # - # source://prism//lib/prism/node.rb#12331 + # The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md). + # + # source://prism//lib/prism/node.rb#13360 + sig { returns(Integer) } def depth; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12357 + # source://prism//lib/prism/node.rb#13401 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end - # attr_reader 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` # - # source://prism//lib/prism/node.rb#12328 + # source://prism//lib/prism/node.rb#13351 + sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the variable name. + # + # foo = :bar + # ^^^ # - # source://prism//lib/prism/node.rb#12334 + # source://prism//lib/prism/node.rb#13366 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12352 + # source://prism//lib/prism/node.rb#13396 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. + # + # x = :y + # ^ # - # source://prism//lib/prism/node.rb#12344 + # source://prism//lib/prism/node.rb#13389 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -17077,12 +21136,24 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12382 + # source://prism//lib/prism/node.rb#13426 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Prism::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). # - # source://prism//lib/prism/node.rb#12341 + # 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 + # + # source://prism//lib/prism/node.rb#13383 + sig { returns(Prism::Node) } def value; end class << self @@ -17093,7 +21164,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12392 + # source://prism//lib/prism/node.rb#13436 def type; end end end @@ -17108,160 +21179,195 @@ class Prism::Location # @return [Location] a new instance of Location # # source://prism//lib/prism/parse_result.rb#119 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void } def initialize(source, start_offset, length); end # Returns true if the given other location is equal to this location. # - # source://prism//lib/prism/parse_result.rb#264 + # source://prism//lib/prism/parse_result.rb#269 + sig { params(other: T.untyped).returns(T::Boolean) } def ==(other); end + # Returns a new location that is the result of chopping off the last byte. + # + # source://prism//lib/prism/parse_result.rb#165 + sig { returns(Prism::Location) } + def chop; end + # Returns all comments that are associated with this location (both leading # and trailing comments). # # source://prism//lib/prism/parse_result.rb#155 + sig { returns(T::Array[Prism::Comment]) } def comments; end # Create a new location object with the given options. # # source://prism//lib/prism/parse_result.rb#160 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) } def copy(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end # Implement the hash pattern matching interface for Location. # - # source://prism//lib/prism/parse_result.rb#254 + # source://prism//lib/prism/parse_result.rb#259 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # The column number in characters where this location ends from the start of # the line. # - # source://prism//lib/prism/parse_result.rb#243 + # source://prism//lib/prism/parse_result.rb#248 + sig { returns(Integer) } def end_character_column; end # The character offset from the beginning of the source where this location # ends. # - # source://prism//lib/prism/parse_result.rb#192 + # source://prism//lib/prism/parse_result.rb#197 + sig { returns(Integer) } def end_character_offset; end # The column number in code units of the given encoding where this location # ends from the start of the line. # - # source://prism//lib/prism/parse_result.rb#249 + # source://prism//lib/prism/parse_result.rb#254 + sig { params(encoding: Encoding).returns(Integer) } def end_code_units_column(encoding = T.unsafe(nil)); end # The offset from the start of the file in code units of the given encoding. # - # source://prism//lib/prism/parse_result.rb#197 + # source://prism//lib/prism/parse_result.rb#202 + sig { params(encoding: Encoding).returns(Integer) } def end_code_units_offset(encoding = T.unsafe(nil)); end # The column number in bytes where this location ends from the start of the # line. # - # source://prism//lib/prism/parse_result.rb#237 + # source://prism//lib/prism/parse_result.rb#242 + sig { returns(Integer) } def end_column; end # The line number where this location ends. # - # source://prism//lib/prism/parse_result.rb#213 + # source://prism//lib/prism/parse_result.rb#218 + sig { returns(Integer) } def end_line; end # The byte offset from the beginning of the source where this location ends. # - # source://prism//lib/prism/parse_result.rb#186 + # source://prism//lib/prism/parse_result.rb#191 + sig { returns(Integer) } def end_offset; end # Returns a string representation of this location. # - # source://prism//lib/prism/parse_result.rb#165 + # source://prism//lib/prism/parse_result.rb#170 + sig { returns(String) } def inspect; 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. # - # source://prism//lib/prism/parse_result.rb#273 + # source://prism//lib/prism/parse_result.rb#278 + sig { params(other: Prism::Location).returns(Prism::Location) } def join(other); end # Attach a comment to the leading comments of this location. # # source://prism//lib/prism/parse_result.rb#138 + sig { params(comment: Prism::Comment).void } def leading_comment(comment); end # These are the comments that are associated with this location that exist # before the start of this location. # # source://prism//lib/prism/parse_result.rb#133 + sig { returns(T::Array[Prism::Comment]) } def leading_comments; end # The length of this location in bytes. # # source://prism//lib/prism/parse_result.rb#115 + sig { returns(Integer) } def length; end # Implement the pretty print interface for Location. # - # source://prism//lib/prism/parse_result.rb#259 + # source://prism//lib/prism/parse_result.rb#264 + sig { params(q: T.untyped).void } def pretty_print(q); end # The source code that this location represents. # - # source://prism//lib/prism/parse_result.rb#170 + # source://prism//lib/prism/parse_result.rb#175 + sig { returns(String) } def slice; end # The column number in characters where this location ends from the start of # the line. # - # source://prism//lib/prism/parse_result.rb#225 + # source://prism//lib/prism/parse_result.rb#230 + sig { returns(Integer) } def start_character_column; end # The character offset from the beginning of the source where this location # starts. # - # source://prism//lib/prism/parse_result.rb#176 + # source://prism//lib/prism/parse_result.rb#181 + sig { returns(Integer) } def start_character_offset; end # The column number in code units of the given encoding where this location # starts from the start of the line. # - # source://prism//lib/prism/parse_result.rb#231 + # source://prism//lib/prism/parse_result.rb#236 + sig { params(encoding: Encoding).returns(Integer) } def start_code_units_column(encoding = T.unsafe(nil)); end # The offset from the start of the file in code units of the given encoding. # - # source://prism//lib/prism/parse_result.rb#181 + # source://prism//lib/prism/parse_result.rb#186 + sig { params(encoding: Encoding).returns(Integer) } def start_code_units_offset(encoding = T.unsafe(nil)); end # The column number in bytes where this location starts from the start of # the line. # - # source://prism//lib/prism/parse_result.rb#219 + # source://prism//lib/prism/parse_result.rb#224 + sig { returns(Integer) } def start_column; end # The line number where this location starts. # - # source://prism//lib/prism/parse_result.rb#202 + # source://prism//lib/prism/parse_result.rb#207 + sig { returns(Integer) } def start_line; end # The content of the line where this location starts before this location. # - # source://prism//lib/prism/parse_result.rb#207 + # source://prism//lib/prism/parse_result.rb#212 + sig { returns(String) } def start_line_slice; end # The byte offset from the beginning of the source where this location # starts. # # source://prism//lib/prism/parse_result.rb#112 + sig { returns(Integer) } def start_offset; end # Attach a comment to the trailing comments of this location. # # source://prism//lib/prism/parse_result.rb#149 + sig { params(comment: Prism::Comment).void } def trailing_comment(comment); end # These are the comments that are associated with this location that exist # after the end of this location. # # source://prism//lib/prism/parse_result.rb#144 + sig { returns(T::Array[Prism::Comment]) } def trailing_comments; end protected @@ -17270,58 +21376,66 @@ class Prism::Location # offset and length. # # source://prism//lib/prism/parse_result.rb#107 + sig { returns(Prism::Source) } def source; end end # Flags for while and until loop nodes. # -# source://prism//lib/prism/node.rb#18880 +# source://prism//lib/prism/node.rb#20403 module Prism::LoopFlags; end # a loop after a begin statement, so the body is executed first before the condition # -# source://prism//lib/prism/node.rb#18882 +# source://prism//lib/prism/node.rb#20405 Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) # This represents a magic comment that was encountered during parsing. # -# source://prism//lib/prism/parse_result.rb#333 +# source://prism//lib/prism/parse_result.rb#338 class Prism::MagicComment # Create a new magic comment object with the given key and value locations. # # @return [MagicComment] a new instance of MagicComment # - # source://prism//lib/prism/parse_result.rb#341 + # source://prism//lib/prism/parse_result.rb#346 + sig { params(key_loc: Prism::Location, value_loc: Prism::Location).void } def initialize(key_loc, value_loc); end # Implement the hash pattern matching interface for MagicComment. # - # source://prism//lib/prism/parse_result.rb#357 + # source://prism//lib/prism/parse_result.rb#362 + 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. # - # source://prism//lib/prism/parse_result.rb#362 + # source://prism//lib/prism/parse_result.rb#367 + sig { returns(String) } def inspect; end # Returns the key of the magic comment by slicing it from the source code. # - # source://prism//lib/prism/parse_result.rb#347 + # source://prism//lib/prism/parse_result.rb#352 + sig { returns(String) } def key; end # A Location object representing the location of the key in the source. # - # source://prism//lib/prism/parse_result.rb#335 + # source://prism//lib/prism/parse_result.rb#340 + sig { returns(Prism::Location) } def key_loc; end # Returns the value of the magic comment by slicing it from the source code. # - # source://prism//lib/prism/parse_result.rb#352 + # source://prism//lib/prism/parse_result.rb#357 + sig { returns(String) } def value; end # A Location object representing the location of the value in the source. # - # source://prism//lib/prism/parse_result.rb#338 + # source://prism//lib/prism/parse_result.rb#343 + sig { returns(Prism::Location) } def value_loc; end end @@ -17330,7 +21444,7 @@ end # if /foo/i then end # ^^^^^^ # -# source://prism//lib/prism/node.rb#12401 +# source://prism//lib/prism/node.rb#13456 class Prism::MatchLastLineNode < ::Prism::Node include ::Prism::RegularExpressionOptions @@ -17338,143 +21452,198 @@ class Prism::MatchLastLineNode < ::Prism::Node # # @return [MatchLastLineNode] a new instance of MatchLastLineNode # - # source://prism//lib/prism/node.rb#12403 + # source://prism//lib/prism/node.rb#13458 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13642 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12415 + # source://prism//lib/prism/node.rb#13470 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12502 + # source://prism//lib/prism/node.rb#13556 + sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12420 + # source://prism//lib/prism/node.rb#13475 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#12542 + # source://prism//lib/prism/node.rb#13596 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#12466 + # source://prism//lib/prism/node.rb#13521 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12430 + # source://prism//lib/prism/node.rb#13485 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12425 + # source://prism//lib/prism/node.rb#13480 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#12537 + # source://prism//lib/prism/node.rb#13591 + sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#12459 + # source://prism//lib/prism/node.rb#13514 + sig { returns(Prism::Location) } def content_loc; end # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> MatchLastLineNode # - # source://prism//lib/prism/node.rb#12435 + # source://prism//lib/prism/node.rb#13490 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::MatchLastLineNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12420 + # source://prism//lib/prism/node.rb#13475 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism//lib/prism/node.rb#12443 + # source://prism//lib/prism/node.rb#13498 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12497 + # source://prism//lib/prism/node.rb#13551 + sig { returns(T::Boolean) } def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12482 + # source://prism//lib/prism/node.rb#13536 + sig { returns(T::Boolean) } def extended?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12522 + # source://prism//lib/prism/node.rb#13576 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_us_ascii_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12527 + # source://prism//lib/prism/node.rb#13581 + sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12517 + # source://prism//lib/prism/node.rb#13571 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12477 + # source://prism//lib/prism/node.rb#13531 + sig { returns(T::Boolean) } def ignore_case?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12547 + # source://prism//lib/prism/node.rb#13601 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12487 + # source://prism//lib/prism/node.rb#13541 + sig { returns(T::Boolean) } def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12492 + # source://prism//lib/prism/node.rb#13546 + sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#12532 + # source://prism//lib/prism/node.rb#13586 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#12452 + # source://prism//lib/prism/node.rb#13507 + sig { returns(Prism::Location) } def opening_loc; end + sig { returns(Integer) } + def options; 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 @@ -17490,33 +21659,38 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12572 + # source://prism//lib/prism/node.rb#13626 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#12473 + # source://prism//lib/prism/node.rb#13528 + sig { returns(String) } def unescaped; end # def utf_8?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12512 + # source://prism//lib/prism/node.rb#13566 + sig { returns(T::Boolean) } def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#12507 + # source://prism//lib/prism/node.rb#13561 + sig { returns(T::Boolean) } def windows_31j?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#12448 + # source://prism//lib/prism/node.rb#13503 + sig { returns(Integer) } def flags; end class << self @@ -17527,7 +21701,7 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12582 + # source://prism//lib/prism/node.rb#13636 def type; end end end @@ -17537,69 +21711,105 @@ end # foo in bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12591 +# source://prism//lib/prism/node.rb#13656 class Prism::MatchPredicateNode < ::Prism::Node # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void # # @return [MatchPredicateNode] a new instance of MatchPredicateNode # - # source://prism//lib/prism/node.rb#12593 + # source://prism//lib/prism/node.rb#13658 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, pattern, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13759 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12603 + # source://prism//lib/prism/node.rb#13668 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12608 + # source://prism//lib/prism/node.rb#13673 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12618 + # source://prism//lib/prism/node.rb#13683 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12613 + # source://prism//lib/prism/node.rb#13678 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchPredicateNode # - # source://prism//lib/prism/node.rb#12623 + # source://prism//lib/prism/node.rb#13688 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::MatchPredicateNode) + end def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12608 + # source://prism//lib/prism/node.rb#13673 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#12631 + # source://prism//lib/prism/node.rb#13696 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12655 + # source://prism//lib/prism/node.rb#13719 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12650 + # source://prism//lib/prism/node.rb#13714 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#12642 + # source://prism//lib/prism/node.rb#13707 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#12639 + # source://prism//lib/prism/node.rb#13704 + sig { returns(Prism::Node) } def pattern; end # Sometimes you want to check an instance of a node against a list of @@ -17617,12 +21827,14 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12679 + # source://prism//lib/prism/node.rb#13743 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12636 + # source://prism//lib/prism/node.rb#13701 + sig { returns(Prism::Node) } def value; end class << self @@ -17633,7 +21845,7 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12689 + # source://prism//lib/prism/node.rb#13753 def type; end end end @@ -17643,69 +21855,105 @@ end # foo => bar # ^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12698 +# source://prism//lib/prism/node.rb#13771 class Prism::MatchRequiredNode < ::Prism::Node # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void # # @return [MatchRequiredNode] a new instance of MatchRequiredNode # - # source://prism//lib/prism/node.rb#12700 + # source://prism//lib/prism/node.rb#13773 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, pattern, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13874 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12710 + # source://prism//lib/prism/node.rb#13783 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12715 + # source://prism//lib/prism/node.rb#13788 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12725 + # source://prism//lib/prism/node.rb#13798 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12720 + # source://prism//lib/prism/node.rb#13793 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchRequiredNode # - # source://prism//lib/prism/node.rb#12730 + # source://prism//lib/prism/node.rb#13803 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::MatchRequiredNode) + end def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12715 + # source://prism//lib/prism/node.rb#13788 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#12738 + # source://prism//lib/prism/node.rb#13811 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12762 + # source://prism//lib/prism/node.rb#13834 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#12757 + # source://prism//lib/prism/node.rb#13829 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#12749 + # source://prism//lib/prism/node.rb#13822 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader pattern: Prism::node # - # source://prism//lib/prism/node.rb#12746 + # source://prism//lib/prism/node.rb#13819 + sig { returns(Prism::Node) } def pattern; end # Sometimes you want to check an instance of a node against a list of @@ -17723,12 +21971,14 @@ class Prism::MatchRequiredNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12786 + # source://prism//lib/prism/node.rb#13858 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#12743 + # source://prism//lib/prism/node.rb#13816 + sig { returns(Prism::Node) } def value; end class << self @@ -17739,7 +21989,7 @@ class Prism::MatchRequiredNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12796 + # source://prism//lib/prism/node.rb#13868 def type; end end end @@ -17749,64 +21999,97 @@ end # /(?bar)/ =~ baz # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12805 +# source://prism//lib/prism/node.rb#13886 class Prism::MatchWriteNode < ::Prism::Node # def initialize: (CallNode call, Array[LocalVariableTargetNode] targets, Location location) -> void # # @return [MatchWriteNode] a new instance of MatchWriteNode # - # source://prism//lib/prism/node.rb#12807 + # source://prism//lib/prism/node.rb#13888 + sig do + params( + source: Prism::Source, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).void + end def initialize(source, call, targets, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#13974 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12816 + # source://prism//lib/prism/node.rb#13897 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader call: CallNode # - # source://prism//lib/prism/node.rb#12849 + # source://prism//lib/prism/node.rb#13930 + sig { returns(Prism::CallNode) } def call; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12821 + # source://prism//lib/prism/node.rb#13902 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12831 + # source://prism//lib/prism/node.rb#13912 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12826 + # source://prism//lib/prism/node.rb#13907 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?call: CallNode, ?targets: Array[LocalVariableTargetNode], ?location: Location) -> MatchWriteNode # - # source://prism//lib/prism/node.rb#12836 + # source://prism//lib/prism/node.rb#13917 + sig do + params( + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).returns(Prism::MatchWriteNode) + end def copy(call: T.unsafe(nil), targets: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12821 + # source://prism//lib/prism/node.rb#13902 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[LocalVariableTargetNode], location: Location } # - # source://prism//lib/prism/node.rb#12844 + # source://prism//lib/prism/node.rb#13925 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12856 + # source://prism//lib/prism/node.rb#13936 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader targets: Array[LocalVariableTargetNode] # - # source://prism//lib/prism/node.rb#12852 + # source://prism//lib/prism/node.rb#13933 + sig { returns(T::Array[Prism::LocalVariableTargetNode]) } def targets; end # Sometimes you want to check an instance of a node against a list of @@ -17824,7 +22107,8 @@ class Prism::MatchWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12878 + # source://prism//lib/prism/node.rb#13958 + sig { override.returns(Symbol) } def type; end class << self @@ -17835,61 +22119,79 @@ class Prism::MatchWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12888 + # source://prism//lib/prism/node.rb#13968 def type; end end end # Represents a node that is missing from the source and results in a syntax error. # -# source://prism//lib/prism/node.rb#12894 +# source://prism//lib/prism/node.rb#13983 class Prism::MissingNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [MissingNode] a new instance of MissingNode # - # source://prism//lib/prism/node.rb#12896 + # source://prism//lib/prism/node.rb#13985 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14060 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12903 + # source://prism//lib/prism/node.rb#13992 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12908 + # source://prism//lib/prism/node.rb#13997 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#12918 + # source://prism//lib/prism/node.rb#14007 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#12913 + # source://prism//lib/prism/node.rb#14002 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> MissingNode # - # source://prism//lib/prism/node.rb#12923 + # source://prism//lib/prism/node.rb#14012 + sig { params(location: Prism::Location).returns(Prism::MissingNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12908 + # source://prism//lib/prism/node.rb#13997 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#12931 + # source://prism//lib/prism/node.rb#14020 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#12937 + # source://prism//lib/prism/node.rb#14025 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -17907,7 +22209,8 @@ class Prism::MissingNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#12956 + # source://prism//lib/prism/node.rb#14044 + sig { override.returns(Symbol) } def type; end class << self @@ -17918,7 +22221,7 @@ class Prism::MissingNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#12966 + # source://prism//lib/prism/node.rb#14054 def type; end end end @@ -17928,94 +22231,141 @@ end # module Foo end # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#12975 +# source://prism//lib/prism/node.rb#14069 class Prism::ModuleNode < ::Prism::Node # def initialize: (Array[Symbol] locals, Location module_keyword_loc, Prism::node constant_path, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void # # @return [ModuleNode] a new instance of ModuleNode # - # source://prism//lib/prism/node.rb#12977 + # source://prism//lib/prism/node.rb#14071 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14203 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#12990 + # source://prism//lib/prism/node.rb#14084 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#13039 + # source://prism//lib/prism/node.rb#14133 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12995 + # source://prism//lib/prism/node.rb#14089 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13008 + # source://prism//lib/prism/node.rb#14102 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13000 + # source://prism//lib/prism/node.rb#14094 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader constant_path: Prism::node # - # source://prism//lib/prism/node.rb#13036 + # source://prism//lib/prism/node.rb#14130 + sig { returns(Prism::Node) } def constant_path; end # def copy: (?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ModuleNode # - # source://prism//lib/prism/node.rb#13013 + # source://prism//lib/prism/node.rb#14107 + sig do + params( + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).returns(Prism::ModuleNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#12995 + # source://prism//lib/prism/node.rb#14089 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], module_keyword_loc: Location, constant_path: Prism::node, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#13021 + # source://prism//lib/prism/node.rb#14115 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#13058 + # source://prism//lib/prism/node.rb#14151 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#13042 + # source://prism//lib/prism/node.rb#14136 + sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13063 + # source://prism//lib/prism/node.rb#14156 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#13026 + # source://prism//lib/prism/node.rb#14120 + sig { returns(T::Array[Symbol]) } def locals; end # def module_keyword: () -> String # - # source://prism//lib/prism/node.rb#13053 + # source://prism//lib/prism/node.rb#14146 + sig { returns(String) } def module_keyword; end # attr_reader module_keyword_loc: Location # - # source://prism//lib/prism/node.rb#13029 + # source://prism//lib/prism/node.rb#14123 + sig { returns(Prism::Location) } def module_keyword_loc; end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#13049 + # source://prism//lib/prism/node.rb#14143 + sig { returns(Symbol) } def name; end # Sometimes you want to check an instance of a node against a list of @@ -18033,7 +22383,8 @@ class Prism::ModuleNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13094 + # source://prism//lib/prism/node.rb#14187 + sig { override.returns(Symbol) } def type; end class << self @@ -18044,7 +22395,7 @@ class Prism::ModuleNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13104 + # source://prism//lib/prism/node.rb#14197 def type; end end end @@ -18054,89 +22405,137 @@ end # a, (b, c) = 1, 2, 3 # ^^^^^^ # -# source://prism//lib/prism/node.rb#13113 +# source://prism//lib/prism/node.rb#14219 class Prism::MultiTargetNode < ::Prism::Node # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc, Location location) -> void # # @return [MultiTargetNode] a new instance of MultiTargetNode # - # source://prism//lib/prism/node.rb#13115 + # source://prism//lib/prism/node.rb#14221 + sig do + params( + source: Prism::Source, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14360 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13127 + # source://prism//lib/prism/node.rb#14233 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13132 + # source://prism//lib/prism/node.rb#14238 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13146 + # source://prism//lib/prism/node.rb#14252 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13137 + # source://prism//lib/prism/node.rb#14243 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?location: Location) -> MultiTargetNode # - # source://prism//lib/prism/node.rb#13151 + # source://prism//lib/prism/node.rb#14257 + sig do + params( + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::MultiTargetNode) + end def copy(lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13132 + # source://prism//lib/prism/node.rb#14238 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], lparen_loc: Location?, rparen_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#13159 + # source://prism//lib/prism/node.rb#14265 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13210 + # source://prism//lib/prism/node.rb#14315 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] # - # source://prism//lib/prism/node.rb#13164 + # source://prism//lib/prism/node.rb#14270 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)]) + end def lefts; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#13200 + # source://prism//lib/prism/node.rb#14305 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#13173 + # source://prism//lib/prism/node.rb#14279 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # attr_reader rest: Prism::node? # - # source://prism//lib/prism/node.rb#13167 + # source://prism//lib/prism/node.rb#14273 + sig { returns(T.nilable(Prism::Node)) } def rest; end # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] # - # source://prism//lib/prism/node.rb#13170 + # source://prism//lib/prism/node.rb#14276 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)]) + end def rights; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#13205 + # source://prism//lib/prism/node.rb#14310 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#13186 + # source://prism//lib/prism/node.rb#14292 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -18154,7 +22553,8 @@ class Prism::MultiTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13239 + # source://prism//lib/prism/node.rb#14344 + sig { override.returns(Symbol) } def type; end class << self @@ -18165,7 +22565,7 @@ class Prism::MultiTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13249 + # source://prism//lib/prism/node.rb#14354 def type; end end end @@ -18175,99 +22575,153 @@ end # a, b, c = 1, 2, 3 # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13258 +# source://prism//lib/prism/node.rb#14376 class Prism::MultiWriteNode < ::Prism::Node # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [MultiWriteNode] a new instance of MultiWriteNode # - # source://prism//lib/prism/node.rb#13260 + # source://prism//lib/prism/node.rb#14378 + sig do + params( + source: Prism::Source, + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14538 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13274 + # source://prism//lib/prism/node.rb#14392 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13279 + # source://prism//lib/prism/node.rb#14397 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13294 + # source://prism//lib/prism/node.rb#14412 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13284 + # source://prism//lib/prism/node.rb#14402 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> MultiWriteNode # - # source://prism//lib/prism/node.rb#13299 + # source://prism//lib/prism/node.rb#14417 + sig do + params( + lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + rest: T.nilable(Prism::Node), + rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::MultiWriteNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13279 + # source://prism//lib/prism/node.rb#14397 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#13307 + # source://prism//lib/prism/node.rb#14425 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13373 + # source://prism//lib/prism/node.rb#14490 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] # - # source://prism//lib/prism/node.rb#13312 + # source://prism//lib/prism/node.rb#14430 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)]) + end def lefts; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#13358 + # source://prism//lib/prism/node.rb#14475 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#13321 + # source://prism//lib/prism/node.rb#14439 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#13368 + # source://prism//lib/prism/node.rb#14485 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#13347 + # source://prism//lib/prism/node.rb#14465 + sig { returns(Prism::Location) } def operator_loc; end # attr_reader rest: Prism::node? # - # source://prism//lib/prism/node.rb#13315 + # source://prism//lib/prism/node.rb#14433 + sig { returns(T.nilable(Prism::Node)) } def rest; end # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] # - # source://prism//lib/prism/node.rb#13318 + # source://prism//lib/prism/node.rb#14436 + sig do + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)]) + end def rights; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#13363 + # source://prism//lib/prism/node.rb#14480 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#13334 + # source://prism//lib/prism/node.rb#14452 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -18285,12 +22739,14 @@ class Prism::MultiWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13405 + # source://prism//lib/prism/node.rb#14522 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#13354 + # source://prism//lib/prism/node.rb#14472 + sig { returns(Prism::Node) } def value; end class << self @@ -18301,7 +22757,7 @@ class Prism::MultiWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13415 + # source://prism//lib/prism/node.rb#14532 def type; end end end @@ -19061,6 +23517,8 @@ class Prism::MutationCompiler < ::Prism::Compiler # # source://prism//lib/prism/mutation_compiler.rb#760 def visit_yield_node(node); end + + Result = type_member end # Represents the use of the `next` keyword. @@ -19068,69 +23526,103 @@ end # next 1 # ^^^^^^ # -# source://prism//lib/prism/node.rb#13424 +# source://prism//lib/prism/node.rb#14556 class Prism::NextNode < ::Prism::Node # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # # @return [NextNode] a new instance of NextNode # - # source://prism//lib/prism/node.rb#13426 + # source://prism//lib/prism/node.rb#14558 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, arguments, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14659 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13435 + # source://prism//lib/prism/node.rb#14567 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#13470 + # source://prism//lib/prism/node.rb#14602 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13440 + # source://prism//lib/prism/node.rb#14572 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13452 + # source://prism//lib/prism/node.rb#14584 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13445 + # source://prism//lib/prism/node.rb#14577 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> NextNode # - # source://prism//lib/prism/node.rb#13457 + # source://prism//lib/prism/node.rb#14589 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NextNode) + end def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13440 + # source://prism//lib/prism/node.rb#14572 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#13465 + # source://prism//lib/prism/node.rb#14597 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13486 + # source://prism//lib/prism/node.rb#14617 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#13481 + # source://prism//lib/prism/node.rb#14612 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#13473 + # source://prism//lib/prism/node.rb#14605 + sig { returns(Prism::Location) } def keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -19148,7 +23640,8 @@ class Prism::NextNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13512 + # source://prism//lib/prism/node.rb#14643 + sig { override.returns(Symbol) } def type; end class << self @@ -19159,7 +23652,7 @@ class Prism::NextNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13522 + # source://prism//lib/prism/node.rb#14653 def type; end end end @@ -19169,54 +23662,72 @@ end # nil # ^^^ # -# source://prism//lib/prism/node.rb#13531 +# source://prism//lib/prism/node.rb#14670 class Prism::NilNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [NilNode] a new instance of NilNode # - # source://prism//lib/prism/node.rb#13533 + # source://prism//lib/prism/node.rb#14672 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14747 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13540 + # source://prism//lib/prism/node.rb#14679 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13545 + # source://prism//lib/prism/node.rb#14684 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13555 + # source://prism//lib/prism/node.rb#14694 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13550 + # source://prism//lib/prism/node.rb#14689 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> NilNode # - # source://prism//lib/prism/node.rb#13560 + # source://prism//lib/prism/node.rb#14699 + sig { params(location: Prism::Location).returns(Prism::NilNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13545 + # source://prism//lib/prism/node.rb#14684 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#13568 + # source://prism//lib/prism/node.rb#14707 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13574 + # source://prism//lib/prism/node.rb#14712 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -19234,7 +23745,8 @@ class Prism::NilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13593 + # source://prism//lib/prism/node.rb#14731 + sig { override.returns(Symbol) } def type; end class << self @@ -19245,7 +23757,7 @@ class Prism::NilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13603 + # source://prism//lib/prism/node.rb#14741 def type; end end end @@ -19256,74 +23768,109 @@ end # ^^^^^ # end # -# source://prism//lib/prism/node.rb#13613 +# source://prism//lib/prism/node.rb#14757 class Prism::NoKeywordsParameterNode < ::Prism::Node # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void # # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode # - # source://prism//lib/prism/node.rb#13615 + # source://prism//lib/prism/node.rb#14759 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, operator_loc, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14862 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13624 + # source://prism//lib/prism/node.rb#14768 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13629 + # source://prism//lib/prism/node.rb#14773 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13639 + # source://prism//lib/prism/node.rb#14783 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13634 + # source://prism//lib/prism/node.rb#14778 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?operator_loc: Location, ?keyword_loc: Location, ?location: Location) -> NoKeywordsParameterNode # - # source://prism//lib/prism/node.rb#13644 + # source://prism//lib/prism/node.rb#14788 + sig do + params( + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end def copy(operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13629 + # source://prism//lib/prism/node.rb#14773 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#13652 + # source://prism//lib/prism/node.rb#14796 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13682 + # source://prism//lib/prism/node.rb#14825 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#13677 + # source://prism//lib/prism/node.rb#14820 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#13664 + # source://prism//lib/prism/node.rb#14808 + sig { returns(Prism::Location) } def keyword_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#13672 + # source://prism//lib/prism/node.rb#14815 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#13657 + # source://prism//lib/prism/node.rb#14801 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -19341,7 +23888,8 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13703 + # source://prism//lib/prism/node.rb#14846 + sig { override.returns(Symbol) } def type; end class << self @@ -19352,7 +23900,7 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13713 + # source://prism//lib/prism/node.rb#14856 def type; end end end @@ -19362,11 +23910,14 @@ end # # source://prism//lib/prism/node.rb#12 class Prism::Node + abstract! + # Accepts a visitor and calls back into the specialized visit function. # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#79 + # source://prism//lib/prism/node.rb#90 + sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # Returns an array of child nodes, including `nil`s in the place of optional @@ -19374,7 +23925,8 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#85 + # source://prism//lib/prism/node.rb#96 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # Returns an array of child nodes and locations that could potentially have @@ -19382,7 +23934,8 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#99 + # source://prism//lib/prism/node.rb#110 + sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # Returns an array of child nodes, excluding any `nil`s in the place of @@ -19390,7 +23943,8 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#93 + # source://prism//lib/prism/node.rb#104 + sig { abstract.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # Returns an array of child nodes, including `nil`s in the place of optional @@ -19398,26 +23952,33 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#85 + # source://prism//lib/prism/node.rb#96 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # The end offset of the node in the source. This method is effectively a # delegate method to the location object. # # source://prism//lib/prism/node.rb#34 + sig { returns(Integer) } def end_offset; end + sig { abstract.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns a string representation of the node. # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#110 + # source://prism//lib/prism/node.rb#121 + sig { abstract.params(inspector: Prism::NodeInspector).returns(String) } def inspect(inspector = T.unsafe(nil)); end # A Location instance that represents the location of this node in the # source. # # source://prism//lib/prism/node.rb#19 + sig { returns(Prism::Location) } def location; end # @return [Boolean] @@ -19429,6 +23990,7 @@ class Prism::Node # the pretty print object. # # source://prism//lib/prism/node.rb#58 + sig { params(q: T.untyped).void } def pretty_print(q); end # source://prism//lib/prism/node.rb#43 @@ -19437,17 +23999,20 @@ class Prism::Node # Slice the location of the node from the source. # # source://prism//lib/prism/node.rb#52 + sig { returns(String) } def slice; end # The start offset of the node in the source. This method is effectively a # delegate method to the location object. # # source://prism//lib/prism/node.rb#27 + sig { returns(Integer) } def start_offset; end # Convert this node into a graphviz dot graph string. # # source://prism//lib/prism/node.rb#66 + sig { returns(String) } def to_dot; end # Returns a symbol symbolizing the type of node that this represents. This @@ -19455,7 +24020,8 @@ class Prism::Node # # @raise [NoMethodError] # - # source://prism//lib/prism/node.rb#105 + # source://prism//lib/prism/node.rb#116 + sig { abstract.returns(Symbol) } def type; end private @@ -19463,7 +24029,26 @@ class Prism::Node # A pointer to the source that this node was created from. # # source://prism//lib/prism/node.rb#14 + sig { returns(Prism::Source) } def source; end + + class << self + # 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. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#74 + def fields; end + + # Returns the type of the node as a symbol. + # + # @raise [NoMethodError] + # + # source://prism//lib/prism/node.rb#126 + def type; end + end end # This object is responsible for generating the output for the inspect method @@ -19525,59 +24110,78 @@ end # -> { _1 + _2 } # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#13722 +# source://prism//lib/prism/node.rb#14873 class Prism::NumberedParametersNode < ::Prism::Node # def initialize: (Integer maximum, Location location) -> void # # @return [NumberedParametersNode] a new instance of NumberedParametersNode # - # source://prism//lib/prism/node.rb#13724 + # source://prism//lib/prism/node.rb#14875 + sig { params(source: Prism::Source, maximum: Integer, location: Prism::Location).void } def initialize(source, maximum, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#14955 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13732 + # source://prism//lib/prism/node.rb#14883 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13737 + # source://prism//lib/prism/node.rb#14888 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13747 + # source://prism//lib/prism/node.rb#14898 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13742 + # source://prism//lib/prism/node.rb#14893 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?maximum: Integer, ?location: Location) -> NumberedParametersNode # - # source://prism//lib/prism/node.rb#13752 + # source://prism//lib/prism/node.rb#14903 + sig { params(maximum: Integer, location: Prism::Location).returns(Prism::NumberedParametersNode) } def copy(maximum: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13737 + # source://prism//lib/prism/node.rb#14888 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } # - # source://prism//lib/prism/node.rb#13760 + # source://prism//lib/prism/node.rb#14911 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13769 + # source://prism//lib/prism/node.rb#14919 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader maximum: Integer # - # source://prism//lib/prism/node.rb#13765 + # source://prism//lib/prism/node.rb#14916 + sig { returns(Integer) } def maximum; end # Sometimes you want to check an instance of a node against a list of @@ -19595,7 +24199,8 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13789 + # source://prism//lib/prism/node.rb#14939 + sig { override.returns(Symbol) } def type; end class << self @@ -19606,7 +24211,7 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13799 + # source://prism//lib/prism/node.rb#14949 def type; end end end @@ -19616,54 +24221,72 @@ end # $1 # ^^ # -# source://prism//lib/prism/node.rb#13808 +# source://prism//lib/prism/node.rb#14965 class Prism::NumberedReferenceReadNode < ::Prism::Node # def initialize: (Integer number, Location location) -> void # # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode # - # source://prism//lib/prism/node.rb#13810 + # source://prism//lib/prism/node.rb#14967 + sig { params(source: Prism::Source, number: Integer, location: Prism::Location).void } def initialize(source, number, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15053 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13818 + # source://prism//lib/prism/node.rb#14975 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13823 + # source://prism//lib/prism/node.rb#14980 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13833 + # source://prism//lib/prism/node.rb#14990 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13828 + # source://prism//lib/prism/node.rb#14985 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?number: Integer, ?location: Location) -> NumberedReferenceReadNode # - # source://prism//lib/prism/node.rb#13838 + # source://prism//lib/prism/node.rb#14995 + sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) } def copy(number: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13823 + # source://prism//lib/prism/node.rb#14980 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location } # - # source://prism//lib/prism/node.rb#13846 + # source://prism//lib/prism/node.rb#15003 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13861 + # source://prism//lib/prism/node.rb#15017 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. @@ -19674,7 +24297,8 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # $4294967296 # number `0` # - # source://prism//lib/prism/node.rb#13857 + # source://prism//lib/prism/node.rb#15014 + sig { returns(Integer) } def number; end # Sometimes you want to check an instance of a node against a list of @@ -19692,7 +24316,8 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13881 + # source://prism//lib/prism/node.rb#15037 + sig { override.returns(Symbol) } def type; end class << self @@ -19703,7 +24328,7 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#13891 + # source://prism//lib/prism/node.rb#15047 def type; end end end @@ -19714,71 +24339,109 @@ end # ^^^^ # end # -# source://prism//lib/prism/node.rb#13901 +# source://prism//lib/prism/node.rb#15064 class Prism::OptionalKeywordParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location name_loc, Prism::node value, Location location) -> void # # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode # - # source://prism//lib/prism/node.rb#13903 + # source://prism//lib/prism/node.rb#15066 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15173 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#13914 + # source://prism//lib/prism/node.rb#15077 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13919 + # source://prism//lib/prism/node.rb#15082 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#13929 + # source://prism//lib/prism/node.rb#15092 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#13924 + # source://prism//lib/prism/node.rb#15087 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalKeywordParameterNode # - # source://prism//lib/prism/node.rb#13934 + # source://prism//lib/prism/node.rb#15097 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::OptionalKeywordParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#13919 + # source://prism//lib/prism/node.rb#15082 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#13942 + # source://prism//lib/prism/node.rb#15105 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#13970 + # source://prism//lib/prism/node.rb#15132 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#13951 + # source://prism//lib/prism/node.rb#15114 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#13954 + # source://prism//lib/prism/node.rb#15117 + sig { returns(Prism::Location) } def name_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#13965 + # source://prism//lib/prism/node.rb#15127 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -19796,19 +24459,22 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#13995 + # source://prism//lib/prism/node.rb#15157 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#13961 + # source://prism//lib/prism/node.rb#15124 + sig { returns(Prism::Node) } def value; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#13947 + # source://prism//lib/prism/node.rb#15110 + sig { returns(Integer) } def flags; end class << self @@ -19819,7 +24485,7 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14005 + # source://prism//lib/prism/node.rb#15167 def type; end end end @@ -19830,81 +24496,123 @@ end # ^^^^^ # end # -# source://prism//lib/prism/node.rb#14015 +# source://prism//lib/prism/node.rb#15187 class Prism::OptionalParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [OptionalParameterNode] a new instance of OptionalParameterNode # - # source://prism//lib/prism/node.rb#14017 + # source://prism//lib/prism/node.rb#15189 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, operator_loc, value, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15310 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14029 + # source://prism//lib/prism/node.rb#15201 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14034 + # source://prism//lib/prism/node.rb#15206 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14044 + # source://prism//lib/prism/node.rb#15216 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14039 + # source://prism//lib/prism/node.rb#15211 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalParameterNode # - # source://prism//lib/prism/node.rb#14049 + # source://prism//lib/prism/node.rb#15221 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).returns(Prism::OptionalParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14034 + # source://prism//lib/prism/node.rb#15206 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#14057 + # source://prism//lib/prism/node.rb#15229 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14097 + # source://prism//lib/prism/node.rb#15268 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#14066 + # source://prism//lib/prism/node.rb#15238 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#14069 + # source://prism//lib/prism/node.rb#15241 + sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14092 + # source://prism//lib/prism/node.rb#15263 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14076 + # source://prism//lib/prism/node.rb#15248 + sig { returns(Prism::Location) } def operator_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#14087 + # source://prism//lib/prism/node.rb#15258 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -19922,19 +24630,22 @@ class Prism::OptionalParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14123 + # source://prism//lib/prism/node.rb#15294 + sig { override.returns(Symbol) } def type; end # attr_reader value: Prism::node # - # source://prism//lib/prism/node.rb#14083 + # source://prism//lib/prism/node.rb#15255 + sig { returns(Prism::Node) } def value; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#14062 + # source://prism//lib/prism/node.rb#15234 + sig { returns(Integer) } def flags; end class << self @@ -19945,7 +24656,7 @@ class Prism::OptionalParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14133 + # source://prism//lib/prism/node.rb#15304 def type; end end end @@ -19955,54 +24666,87 @@ end # left or right # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14142 +# source://prism//lib/prism/node.rb#15324 class Prism::OrNode < ::Prism::Node # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # # @return [OrNode] a new instance of OrNode # - # source://prism//lib/prism/node.rb#14144 + # source://prism//lib/prism/node.rb#15326 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, left, right, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15442 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14154 + # source://prism//lib/prism/node.rb#15336 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14159 + # source://prism//lib/prism/node.rb#15341 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14169 + # source://prism//lib/prism/node.rb#15351 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14164 + # source://prism//lib/prism/node.rb#15346 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> OrNode # - # source://prism//lib/prism/node.rb#14174 + # source://prism//lib/prism/node.rb#15356 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::OrNode) + end def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14159 + # source://prism//lib/prism/node.rb#15341 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14182 + # source://prism//lib/prism/node.rb#15364 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14221 + # source://prism//lib/prism/node.rb#15402 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -20013,12 +24757,14 @@ class Prism::OrNode < ::Prism::Node # 1 || 2 # ^ # - # source://prism//lib/prism/node.rb#14193 + # source://prism//lib/prism/node.rb#15375 + sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14216 + # source://prism//lib/prism/node.rb#15397 + sig { returns(String) } def operator; end # The location of the `or` keyword or the `||` operator. @@ -20026,7 +24772,8 @@ class Prism::OrNode < ::Prism::Node # left or right # ^^ # - # source://prism//lib/prism/node.rb#14208 + # source://prism//lib/prism/node.rb#15390 + sig { returns(Prism::Location) } def operator_loc; end # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). @@ -20037,7 +24784,8 @@ class Prism::OrNode < ::Prism::Node # 1 or 2 # ^ # - # source://prism//lib/prism/node.rb#14202 + # source://prism//lib/prism/node.rb#15384 + sig { returns(Prism::Node) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -20055,7 +24803,8 @@ class Prism::OrNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14245 + # source://prism//lib/prism/node.rb#15426 + sig { override.returns(Symbol) } def type; end class << self @@ -20066,7 +24815,7 @@ class Prism::OrNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14255 + # source://prism//lib/prism/node.rb#15436 def type; end end end @@ -20315,12 +25064,12 @@ Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) # Flags for parameter nodes. # -# source://prism//lib/prism/node.rb#18886 +# source://prism//lib/prism/node.rb#20409 module Prism::ParameterFlags; end # a parameter name that has been repeated in the method signature # -# source://prism//lib/prism/node.rb#18888 +# source://prism//lib/prism/node.rb#20411 Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) # Represents the list of parameters on a method, block, or lambda definition. @@ -20329,94 +25078,147 @@ Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) # ^^^^^^^ # end # -# source://prism//lib/prism/node.rb#14265 +# source://prism//lib/prism/node.rb#15455 class Prism::ParametersNode < ::Prism::Node # def initialize: (Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void # # @return [ParametersNode] a new instance of ParametersNode # - # source://prism//lib/prism/node.rb#14267 + # source://prism//lib/prism/node.rb#15457 + sig do + params( + source: Prism::Source, + requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], + optionals: T::Array[Prism::OptionalParameterNode], + rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), + posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)], + keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], + keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), + block: T.nilable(Prism::BlockParameterNode), + location: Prism::Location + ).void + end def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15590 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14281 + # source://prism//lib/prism/node.rb#15471 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader block: BlockParameterNode? # - # source://prism//lib/prism/node.rb#14340 + # source://prism//lib/prism/node.rb#15530 + sig { returns(T.nilable(Prism::BlockParameterNode)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14286 + # source://prism//lib/prism/node.rb#15476 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14304 + # source://prism//lib/prism/node.rb#15494 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14291 + # source://prism//lib/prism/node.rb#15481 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode # - # source://prism//lib/prism/node.rb#14309 + # source://prism//lib/prism/node.rb#15499 + sig do + params( + requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], + optionals: T::Array[Prism::OptionalParameterNode], + rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), + posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)], + keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], + keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), + block: T.nilable(Prism::BlockParameterNode), + location: Prism::Location + ).returns(Prism::ParametersNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14286 + # source://prism//lib/prism/node.rb#15476 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location } # - # source://prism//lib/prism/node.rb#14317 + # source://prism//lib/prism/node.rb#15507 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14344 + # source://prism//lib/prism/node.rb#15533 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil # - # source://prism//lib/prism/node.rb#14337 + # source://prism//lib/prism/node.rb#15527 + sig do + returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode))) + end def keyword_rest; end # attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] # - # source://prism//lib/prism/node.rb#14334 + # source://prism//lib/prism/node.rb#15524 + sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) } def keywords; end # attr_reader optionals: Array[OptionalParameterNode] # - # source://prism//lib/prism/node.rb#14325 + # source://prism//lib/prism/node.rb#15515 + sig { returns(T::Array[Prism::OptionalParameterNode]) } def optionals; end # attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode] # - # source://prism//lib/prism/node.rb#14331 + # source://prism//lib/prism/node.rb#15521 + sig do + returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)]) + end def posts; end # attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode] # - # source://prism//lib/prism/node.rb#14322 + # source://prism//lib/prism/node.rb#15512 + sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)]) } def requireds; end # attr_reader rest: RestParameterNode | ImplicitRestNode | nil # - # source://prism//lib/prism/node.rb#14328 + # source://prism//lib/prism/node.rb#15518 + sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) } def rest; end # Mirrors the Method#parameters method. # # source://prism//lib/prism/node_ext.rb#210 + sig { returns(T::Array[T.any([Symbol, Symbol], [Symbol])]) } def signature; end # Sometimes you want to check an instance of a node against a list of @@ -20434,7 +25236,8 @@ class Prism::ParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14385 + # source://prism//lib/prism/node.rb#15574 + sig { override.returns(Symbol) } def type; end class << self @@ -20445,7 +25248,7 @@ class Prism::ParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14395 + # source://prism//lib/prism/node.rb#15584 def type; end end end @@ -20455,82 +25258,120 @@ end # (10 + 34) # ^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14404 +# source://prism//lib/prism/node.rb#15610 class Prism::ParenthesesNode < ::Prism::Node # def initialize: (Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void # # @return [ParenthesesNode] a new instance of ParenthesesNode # - # source://prism//lib/prism/node.rb#14406 + # source://prism//lib/prism/node.rb#15612 + sig do + params( + source: Prism::Source, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, body, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15731 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14416 + # source://prism//lib/prism/node.rb#15622 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#14455 + # source://prism//lib/prism/node.rb#15661 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14425 + # source://prism//lib/prism/node.rb#15631 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#14478 + # source://prism//lib/prism/node.rb#15683 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#14465 + # source://prism//lib/prism/node.rb#15671 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14437 + # source://prism//lib/prism/node.rb#15643 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14430 + # source://prism//lib/prism/node.rb#15636 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> ParenthesesNode # - # source://prism//lib/prism/node.rb#14442 + # source://prism//lib/prism/node.rb#15648 + sig do + params( + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::ParenthesesNode) + end def copy(body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14425 + # source://prism//lib/prism/node.rb#15631 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14450 + # source://prism//lib/prism/node.rb#15656 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14483 + # source://prism//lib/prism/node.rb#15688 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#14473 + # source://prism//lib/prism/node.rb#15678 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#14458 + # source://prism//lib/prism/node.rb#15664 + sig { returns(Prism::Location) } def opening_loc; end - # source://prism//lib/prism/node.rb#14420 + # source://prism//lib/prism/node.rb#15626 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -20548,7 +25389,8 @@ class Prism::ParenthesesNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14510 + # source://prism//lib/prism/node.rb#15715 + sig { override.returns(Symbol) } def type; end class << self @@ -20559,65 +25401,117 @@ class Prism::ParenthesesNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14520 + # source://prism//lib/prism/node.rb#15725 def type; end end end # This represents an error that was encountered during parsing. # -# source://prism//lib/prism/parse_result.rb#368 +# source://prism//lib/prism/parse_result.rb#373 class Prism::ParseError # Create a new error object with the given message and location. # # @return [ParseError] a new instance of ParseError # - # source://prism//lib/prism/parse_result.rb#383 + # source://prism//lib/prism/parse_result.rb#388 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } def initialize(type, message, location, level); end # Implement the hash pattern matching interface for ParseError. # - # source://prism//lib/prism/parse_result.rb#391 + # source://prism//lib/prism/parse_result.rb#396 + 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. # - # source://prism//lib/prism/parse_result.rb#396 + # source://prism//lib/prism/parse_result.rb#401 + sig { returns(String) } def inspect; end # The level of this error. # - # source://prism//lib/prism/parse_result.rb#380 + # source://prism//lib/prism/parse_result.rb#385 + sig { returns(Symbol) } def level; end # A Location object representing the location of this error in the source. # - # source://prism//lib/prism/parse_result.rb#377 + # source://prism//lib/prism/parse_result.rb#382 + sig { returns(Prism::Location) } def location; end # The message associated with this error. # - # source://prism//lib/prism/parse_result.rb#374 + # source://prism//lib/prism/parse_result.rb#379 + sig { returns(String) } def message; end # 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. # - # source://prism//lib/prism/parse_result.rb#371 + # source://prism//lib/prism/parse_result.rb#376 + sig { returns(Symbol) } def type; end end -# This represents the result of a call to ::parse or ::parse_file. It contains -# the AST, any comments that were encounters, and any errors that were -# encountered. +# This is a result specific to the `parse_lex` and `parse_lex_file` methods. +# +# source://prism//lib/prism/parse_result.rb#532 +class Prism::ParseLexResult < ::Prism::Result + # Create a new parse lex result object with the given values. + # + # @return [ParseLexResult] a new instance of ParseLexResult + # + # source://prism//lib/prism/parse_result.rb#538 + sig do + params( + value: [Prism::ProgramNode, T::Array[T.untyped]], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + + # Implement the hash pattern matching interface for ParseLexResult. + # + # source://prism//lib/prism/parse_result.rb#544 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # A tuple of the syntax tree and the list of tokens that were parsed from + # the source code. + # + # source://prism//lib/prism/parse_result.rb#535 + sig { returns([Prism::ProgramNode, T::Array[T.untyped]]) } + def value; end +end + +# This is a result specific to the `parse` and `parse_file` methods. # -# source://prism//lib/prism/parse_result.rb#438 -class Prism::ParseResult +# source://prism//lib/prism/parse_result.rb#498 +class Prism::ParseResult < ::Prism::Result # Create a new parse result object with the given values. # # @return [ParseResult] a new instance of ParseResult # - # source://prism//lib/prism/parse_result.rb#465 + # source://prism//lib/prism/parse_result.rb#503 + sig do + params( + value: Prism::ProgramNode, + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end # Attach the list of comments to their respective locations in the tree. @@ -20625,75 +25519,22 @@ class Prism::ParseResult # source://prism//lib/prism/parse_result/comments.rb#190 def attach_comments!; end - # The list of comments that were encountered during parsing. - # - # source://prism//lib/prism/parse_result.rb#445 - def comments; end - - # 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. - # - # source://prism//lib/prism/parse_result.rb#453 - def data_loc; end - # Implement the hash pattern matching interface for ParseResult. # - # source://prism//lib/prism/parse_result.rb#476 + # source://prism//lib/prism/parse_result.rb#509 + 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. - # - # source://prism//lib/prism/parse_result.rb#481 - def encoding; end - - # The list of errors that were generated during parsing. - # - # source://prism//lib/prism/parse_result.rb#456 - def errors; end - - # Returns true if there were errors during parsing and false if there were - # not. - # - # @return [Boolean] - # - # source://prism//lib/prism/parse_result.rb#493 - def failure?; end - - # The list of magic comments that were encountered during parsing. - # - # source://prism//lib/prism/parse_result.rb#448 - def magic_comments; end - # Walk the tree and mark nodes that are on a new line. # # source://prism//lib/prism/parse_result/newlines.rb#60 def mark_newlines!; end - # A Source instance that represents the source code that was parsed. - # - # source://prism//lib/prism/parse_result.rb#462 - def source; end - - # Returns true if there were no errors during parsing and false if there - # were. - # - # @return [Boolean] - # - # source://prism//lib/prism/parse_result.rb#487 - def success?; end - - # The value that was generated by parsing. Normally this holds the AST, but - # it can sometimes how a list of tokens or other results passed back from - # the parser. + # The syntax tree that was parsed from the source code. # - # source://prism//lib/prism/parse_result.rb#442 + # source://prism//lib/prism/parse_result.rb#500 + sig { returns(Prism::ProgramNode) } def value; end - - # The list of warnings that were generated during parsing. - # - # source://prism//lib/prism/parse_result.rb#459 - def warnings; end end # When we've parsed the source, we have both the syntax tree and the list of @@ -20856,44 +25697,51 @@ end # This represents a warning that was encountered during parsing. # -# source://prism//lib/prism/parse_result.rb#402 +# source://prism//lib/prism/parse_result.rb#407 class Prism::ParseWarning # Create a new warning object with the given message and location. # # @return [ParseWarning] a new instance of ParseWarning # - # source://prism//lib/prism/parse_result.rb#417 + # source://prism//lib/prism/parse_result.rb#422 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } def initialize(type, message, location, level); end # Implement the hash pattern matching interface for ParseWarning. # - # source://prism//lib/prism/parse_result.rb#425 + # source://prism//lib/prism/parse_result.rb#430 + 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. # - # source://prism//lib/prism/parse_result.rb#430 + # source://prism//lib/prism/parse_result.rb#435 + sig { returns(String) } def inspect; end # The level of this warning. # - # source://prism//lib/prism/parse_result.rb#414 + # source://prism//lib/prism/parse_result.rb#419 + sig { returns(Symbol) } def level; end # A Location object representing the location of this warning in the source. # - # source://prism//lib/prism/parse_result.rb#411 + # source://prism//lib/prism/parse_result.rb#416 + sig { returns(Prism::Location) } def location; end # The message associated with this warning. # - # source://prism//lib/prism/parse_result.rb#408 + # source://prism//lib/prism/parse_result.rb#413 + sig { returns(String) } def message; end # 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. # - # source://prism//lib/prism/parse_result.rb#405 + # source://prism//lib/prism/parse_result.rb#410 + sig { returns(Symbol) } def type; end end @@ -21058,89 +25906,131 @@ end # foo in ^(bar) # ^^^^^^ # -# source://prism//lib/prism/node.rb#14529 +# source://prism//lib/prism/node.rb#15743 class Prism::PinnedExpressionNode < ::Prism::Node # def initialize: (Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void # # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode # - # source://prism//lib/prism/node.rb#14531 + # source://prism//lib/prism/node.rb#15745 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15868 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14542 + # source://prism//lib/prism/node.rb#15756 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14547 + # source://prism//lib/prism/node.rb#15761 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14557 + # source://prism//lib/prism/node.rb#15771 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14552 + # source://prism//lib/prism/node.rb#15766 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location, ?location: Location) -> PinnedExpressionNode # - # source://prism//lib/prism/node.rb#14562 + # source://prism//lib/prism/node.rb#15776 + sig do + params( + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PinnedExpressionNode) + end def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14547 + # source://prism//lib/prism/node.rb#15761 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14570 + # source://prism//lib/prism/node.rb#15784 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#14575 + # source://prism//lib/prism/node.rb#15789 + sig { returns(Prism::Node) } def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14615 + # source://prism//lib/prism/node.rb#15828 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def lparen: () -> String # - # source://prism//lib/prism/node.rb#14605 + # source://prism//lib/prism/node.rb#15818 + sig { returns(String) } def lparen; end # attr_reader lparen_loc: Location # - # source://prism//lib/prism/node.rb#14585 + # source://prism//lib/prism/node.rb#15799 + sig { returns(Prism::Location) } def lparen_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14600 + # source://prism//lib/prism/node.rb#15813 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14578 + # source://prism//lib/prism/node.rb#15792 + sig { returns(Prism::Location) } def operator_loc; end # def rparen: () -> String # - # source://prism//lib/prism/node.rb#14610 + # source://prism//lib/prism/node.rb#15823 + sig { returns(String) } def rparen; end # attr_reader rparen_loc: Location # - # source://prism//lib/prism/node.rb#14592 + # source://prism//lib/prism/node.rb#15806 + sig { returns(Prism::Location) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -21158,7 +26048,8 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14639 + # source://prism//lib/prism/node.rb#15852 + sig { override.returns(Symbol) } def type; end class << self @@ -21169,7 +26060,7 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14649 + # source://prism//lib/prism/node.rb#15862 def type; end end end @@ -21179,64 +26070,97 @@ end # foo in ^bar # ^^^^ # -# source://prism//lib/prism/node.rb#14658 +# source://prism//lib/prism/node.rb#15881 class Prism::PinnedVariableNode < ::Prism::Node # def initialize: (Prism::node variable, Location operator_loc, Location location) -> void # # @return [PinnedVariableNode] a new instance of PinnedVariableNode # - # source://prism//lib/prism/node.rb#14660 + # source://prism//lib/prism/node.rb#15883 + sig do + params( + source: Prism::Source, + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, variable, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#15978 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14669 + # source://prism//lib/prism/node.rb#15892 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14674 + # source://prism//lib/prism/node.rb#15897 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14684 + # source://prism//lib/prism/node.rb#15907 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14679 + # source://prism//lib/prism/node.rb#15902 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?variable: Prism::node, ?operator_loc: Location, ?location: Location) -> PinnedVariableNode # - # source://prism//lib/prism/node.rb#14689 + # source://prism//lib/prism/node.rb#15912 + sig do + params( + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PinnedVariableNode) + end def copy(variable: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14674 + # source://prism//lib/prism/node.rb#15897 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Prism::node, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14697 + # source://prism//lib/prism/node.rb#15920 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14718 + # source://prism//lib/prism/node.rb#15940 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#14713 + # source://prism//lib/prism/node.rb#15935 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#14705 + # source://prism//lib/prism/node.rb#15928 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -21254,12 +26178,14 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14740 + # source://prism//lib/prism/node.rb#15962 + sig { override.returns(Symbol) } def type; end # attr_reader variable: Prism::node # - # source://prism//lib/prism/node.rb#14702 + # source://prism//lib/prism/node.rb#15925 + sig { returns(Prism::Node) } def variable; end class << self @@ -21270,7 +26196,7 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14750 + # source://prism//lib/prism/node.rb#15972 def type; end end end @@ -21280,89 +26206,131 @@ end # END { foo } # ^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14759 +# source://prism//lib/prism/node.rb#15989 class Prism::PostExecutionNode < ::Prism::Node # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # # @return [PostExecutionNode] a new instance of PostExecutionNode # - # source://prism//lib/prism/node.rb#14761 + # source://prism//lib/prism/node.rb#15991 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16120 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14772 + # source://prism//lib/prism/node.rb#16002 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14777 + # source://prism//lib/prism/node.rb#16007 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#14842 + # source://prism//lib/prism/node.rb#16071 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#14824 + # source://prism//lib/prism/node.rb#16054 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14789 + # source://prism//lib/prism/node.rb#16019 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14782 + # source://prism//lib/prism/node.rb#16012 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PostExecutionNode # - # source://prism//lib/prism/node.rb#14794 + # source://prism//lib/prism/node.rb#16024 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PostExecutionNode) + end def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14777 + # source://prism//lib/prism/node.rb#16007 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14802 + # source://prism//lib/prism/node.rb#16032 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14847 + # source://prism//lib/prism/node.rb#16076 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#14832 + # source://prism//lib/prism/node.rb#16061 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#14810 + # source://prism//lib/prism/node.rb#16040 + sig { returns(Prism::Location) } def keyword_loc; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#14837 + # source://prism//lib/prism/node.rb#16066 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#14817 + # source://prism//lib/prism/node.rb#16047 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#14807 + # source://prism//lib/prism/node.rb#16037 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -21380,7 +26348,8 @@ class Prism::PostExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#14875 + # source://prism//lib/prism/node.rb#16104 + sig { override.returns(Symbol) } def type; end class << self @@ -21391,7 +26360,7 @@ class Prism::PostExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#14885 + # source://prism//lib/prism/node.rb#16114 def type; end end end @@ -21401,89 +26370,131 @@ end # BEGIN { foo } # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#14894 +# source://prism//lib/prism/node.rb#16133 class Prism::PreExecutionNode < ::Prism::Node # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # # @return [PreExecutionNode] a new instance of PreExecutionNode # - # source://prism//lib/prism/node.rb#14896 + # source://prism//lib/prism/node.rb#16135 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16264 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#14907 + # source://prism//lib/prism/node.rb#16146 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14912 + # source://prism//lib/prism/node.rb#16151 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#14977 + # source://prism//lib/prism/node.rb#16215 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#14959 + # source://prism//lib/prism/node.rb#16198 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#14924 + # source://prism//lib/prism/node.rb#16163 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#14917 + # source://prism//lib/prism/node.rb#16156 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PreExecutionNode # - # source://prism//lib/prism/node.rb#14929 + # source://prism//lib/prism/node.rb#16168 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PreExecutionNode) + end def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#14912 + # source://prism//lib/prism/node.rb#16151 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#14937 + # source://prism//lib/prism/node.rb#16176 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#14982 + # source://prism//lib/prism/node.rb#16220 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#14967 + # source://prism//lib/prism/node.rb#16205 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#14945 + # source://prism//lib/prism/node.rb#16184 + sig { returns(Prism::Location) } def keyword_loc; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#14972 + # source://prism//lib/prism/node.rb#16210 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#14952 + # source://prism//lib/prism/node.rb#16191 + sig { returns(Prism::Location) } def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#14942 + # source://prism//lib/prism/node.rb#16181 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -21501,7 +26512,8 @@ class Prism::PreExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15010 + # source://prism//lib/prism/node.rb#16248 + sig { override.returns(Symbol) } def type; end class << self @@ -21512,71 +26524,104 @@ class Prism::PreExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15020 + # source://prism//lib/prism/node.rb#16258 def type; end end end # The top level node of any parse tree. # -# source://prism//lib/prism/node.rb#15026 +# source://prism//lib/prism/node.rb#16274 class Prism::ProgramNode < ::Prism::Node # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void # # @return [ProgramNode] a new instance of ProgramNode # - # source://prism//lib/prism/node.rb#15028 + # source://prism//lib/prism/node.rb#16276 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).void + end def initialize(source, locals, statements, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16362 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15037 + # source://prism//lib/prism/node.rb#16285 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15042 + # source://prism//lib/prism/node.rb#16290 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15052 + # source://prism//lib/prism/node.rb#16300 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15047 + # source://prism//lib/prism/node.rb#16295 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?locals: Array[Symbol], ?statements: StatementsNode, ?location: Location) -> ProgramNode # - # source://prism//lib/prism/node.rb#15057 + # source://prism//lib/prism/node.rb#16305 + sig do + params( + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).returns(Prism::ProgramNode) + end def copy(locals: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15042 + # source://prism//lib/prism/node.rb#16290 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location } # - # source://prism//lib/prism/node.rb#15065 + # source://prism//lib/prism/node.rb#16313 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15077 + # source://prism//lib/prism/node.rb#16324 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#15070 + # source://prism//lib/prism/node.rb#16318 + sig { returns(T::Array[Symbol]) } def locals; end # attr_reader statements: StatementsNode # - # source://prism//lib/prism/node.rb#15073 + # source://prism//lib/prism/node.rb#16321 + sig { returns(Prism::StatementsNode) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -21594,7 +26639,8 @@ class Prism::ProgramNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15099 + # source://prism//lib/prism/node.rb#16346 + sig { override.returns(Symbol) } def type; end class << self @@ -21605,19 +26651,19 @@ class Prism::ProgramNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15109 + # source://prism//lib/prism/node.rb#16356 def type; end end end # Flags for range and flip-flop nodes. # -# source://prism//lib/prism/node.rb#18892 +# source://prism//lib/prism/node.rb#20415 module Prism::RangeFlags; end # ... operator # -# source://prism//lib/prism/node.rb#18894 +# source://prism//lib/prism/node.rb#20417 Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # Represents the use of the `..` or `...` operators. @@ -21628,61 +26674,97 @@ Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) # c if a =~ /left/ ... b =~ /right/ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#15121 +# source://prism//lib/prism/node.rb#16377 class Prism::RangeNode < ::Prism::Node # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void # # @return [RangeNode] a new instance of RangeNode # - # source://prism//lib/prism/node.rb#15123 + # source://prism//lib/prism/node.rb#16379 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, left, right, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16516 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15134 + # source://prism//lib/prism/node.rb#16390 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15139 + # source://prism//lib/prism/node.rb#16395 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15152 + # source://prism//lib/prism/node.rb#16408 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15144 + # source://prism//lib/prism/node.rb#16400 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> RangeNode # - # source://prism//lib/prism/node.rb#15157 + # source://prism//lib/prism/node.rb#16413 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RangeNode) + end def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15139 + # source://prism//lib/prism/node.rb#16395 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#15165 + # source://prism//lib/prism/node.rb#16421 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def exclude_end?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15201 + # source://prism//lib/prism/node.rb#16456 + sig { returns(T::Boolean) } def exclude_end?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15211 + # source://prism//lib/prism/node.rb#16466 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); 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). @@ -21693,17 +26775,20 @@ class Prism::RangeNode < ::Prism::Node # hello...goodbye # ^^^^^ # - # source://prism//lib/prism/node.rb#15180 + # source://prism//lib/prism/node.rb#16436 + sig { returns(T.nilable(Prism::Node)) } def left; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#15206 + # source://prism//lib/prism/node.rb#16461 + sig { returns(String) } def operator; end # The location of the `..` or `...` operator. # - # source://prism//lib/prism/node.rb#15193 + # source://prism//lib/prism/node.rb#16449 + sig { returns(Prism::Location) } def operator_loc; end # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). @@ -21715,7 +26800,8 @@ class Prism::RangeNode < ::Prism::Node # ^^^ # If neither right-hand or left-hand side was included, this will be a MissingNode. # - # source://prism//lib/prism/node.rb#15190 + # source://prism//lib/prism/node.rb#16446 + sig { returns(T.nilable(Prism::Node)) } def right; end # Sometimes you want to check an instance of a node against a list of @@ -21733,14 +26819,16 @@ class Prism::RangeNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15245 + # source://prism//lib/prism/node.rb#16500 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#15170 + # source://prism//lib/prism/node.rb#16426 + sig { returns(Integer) } def flags; end class << self @@ -21751,7 +26839,7 @@ class Prism::RangeNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15255 + # source://prism//lib/prism/node.rb#16510 def type; end end end @@ -21761,59 +26849,78 @@ end # 1.0r # ^^^^ # -# source://prism//lib/prism/node.rb#15264 +# source://prism//lib/prism/node.rb#16529 class Prism::RationalNode < ::Prism::Node # def initialize: (Prism::node numeric, Location location) -> void # # @return [RationalNode] a new instance of RationalNode # - # source://prism//lib/prism/node.rb#15266 + # source://prism//lib/prism/node.rb#16531 + sig { params(source: Prism::Source, numeric: Prism::Node, location: Prism::Location).void } def initialize(source, numeric, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16612 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15274 + # source://prism//lib/prism/node.rb#16539 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15279 + # source://prism//lib/prism/node.rb#16544 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15289 + # source://prism//lib/prism/node.rb#16554 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15284 + # source://prism//lib/prism/node.rb#16549 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?numeric: Prism::node, ?location: Location) -> RationalNode # - # source://prism//lib/prism/node.rb#15294 + # source://prism//lib/prism/node.rb#16559 + sig { params(numeric: Prism::Node, location: Prism::Location).returns(Prism::RationalNode) } def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15279 + # source://prism//lib/prism/node.rb#16544 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#15302 + # source://prism//lib/prism/node.rb#16567 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15311 + # source://prism//lib/prism/node.rb#16575 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader numeric: Prism::node # - # source://prism//lib/prism/node.rb#15307 + # source://prism//lib/prism/node.rb#16572 + sig { returns(Prism::Node) } def numeric; end # Sometimes you want to check an instance of a node against a list of @@ -21831,12 +26938,14 @@ class Prism::RationalNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15332 + # source://prism//lib/prism/node.rb#16596 + sig { override.returns(Symbol) } def type; end # Returns the value of the node as a Ruby Rational. # # source://prism//lib/prism/node_ext.rb#94 + sig { returns(Rational) } def value; end class << self @@ -21847,7 +26956,7 @@ class Prism::RationalNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15342 + # source://prism//lib/prism/node.rb#16606 def type; end end end @@ -21857,54 +26966,72 @@ end # redo # ^^^^ # -# source://prism//lib/prism/node.rb#15351 +# source://prism//lib/prism/node.rb#16622 class Prism::RedoNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [RedoNode] a new instance of RedoNode # - # source://prism//lib/prism/node.rb#15353 + # source://prism//lib/prism/node.rb#16624 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16699 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15360 + # source://prism//lib/prism/node.rb#16631 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15365 + # source://prism//lib/prism/node.rb#16636 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15375 + # source://prism//lib/prism/node.rb#16646 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15370 + # source://prism//lib/prism/node.rb#16641 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> RedoNode # - # source://prism//lib/prism/node.rb#15380 + # source://prism//lib/prism/node.rb#16651 + sig { params(location: Prism::Location).returns(Prism::RedoNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15365 + # source://prism//lib/prism/node.rb#16636 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#15388 + # source://prism//lib/prism/node.rb#16659 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15394 + # source://prism//lib/prism/node.rb#16664 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -21922,7 +27049,8 @@ class Prism::RedoNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15413 + # source://prism//lib/prism/node.rb#16683 + sig { override.returns(Symbol) } def type; end class << self @@ -21933,69 +27061,199 @@ class Prism::RedoNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15423 + # source://prism//lib/prism/node.rb#16693 def type; end end end +# 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. +# +# source://prism//lib/prism/reflection.rb#13 +module Prism::Reflection + class << self + # Returns the fields for the given node. + # + # source://prism//lib/prism/reflection.rb#104 + sig { params(node: T.class_of(Prism::Node)).returns(T::Array[Prism::Reflection::Field]) } + def fields_for(node); end + end +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. +# +# source://prism//lib/prism/reflection.rb#45 +class Prism::Reflection::ConstantField < ::Prism::Reflection::Field; end + +# A constant list field represents a list of constant values on a node. It +# resolves to an array of symbols in Ruby. +# +# source://prism//lib/prism/reflection.rb#55 +class Prism::Reflection::ConstantListField < ::Prism::Reflection::Field; end + +# A field represents a single piece of data on a node. It is the base class +# for all other field types. +# +# source://prism//lib/prism/reflection.rb#16 +class Prism::Reflection::Field + # Initializes the field with the given name. + # + # @return [Field] a new instance of Field + # + # source://prism//lib/prism/reflection.rb#21 + sig { params(name: Symbol).void } + def initialize(name); end + + # The name of the field. + # + # source://prism//lib/prism/reflection.rb#18 + sig { returns(Symbol) } + def name; end +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. +# +# source://prism//lib/prism/reflection.rb#92 +class Prism::Reflection::FlagsField < ::Prism::Reflection::Field + # Initializes the flags field with the given name and flags. + # + # @return [FlagsField] a new instance of FlagsField + # + # source://prism//lib/prism/reflection.rb#97 + sig { params(name: Symbol, flags: T::Array[Symbol]).void } + def initialize(name, flags); end + + # The names of the flags in the bitset. + # + # source://prism//lib/prism/reflection.rb#94 + sig { returns(T::Array[Symbol]) } + def flags; end +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. +# +# source://prism//lib/prism/reflection.rb#85 +class Prism::Reflection::FloatField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#79 +class Prism::Reflection::IntegerField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#67 +class Prism::Reflection::LocationField < ::Prism::Reflection::Field; end + +# A node field represents a single child node in the syntax tree. It +# resolves to a Prism::Node in Ruby. +# +# source://prism//lib/prism/reflection.rb#28 +class Prism::Reflection::NodeField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#39 +class Prism::Reflection::NodeListField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#50 +class Prism::Reflection::OptionalConstantField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#73 +class Prism::Reflection::OptionalLocationField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#34 +class Prism::Reflection::OptionalNodeField < ::Prism::Reflection::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. +# +# source://prism//lib/prism/reflection.rb#61 +class Prism::Reflection::StringField < ::Prism::Reflection::Field; end + # Flags for regular expression and match last line nodes. # -# source://prism//lib/prism/node.rb#18898 +# source://prism//lib/prism/node.rb#20421 module Prism::RegularExpressionFlags; end # n - forces the ASCII-8BIT encoding # -# source://prism//lib/prism/node.rb#18915 +# source://prism//lib/prism/node.rb#20438 Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) # e - forces the EUC-JP encoding # -# source://prism//lib/prism/node.rb#18912 +# source://prism//lib/prism/node.rb#20435 Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer) # x - ignores whitespace and allows comments in regular expressions # -# source://prism//lib/prism/node.rb#18903 +# source://prism//lib/prism/node.rb#20426 Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#18927 +# source://prism//lib/prism/node.rb#20450 Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to US-ASCII # -# source://prism//lib/prism/node.rb#18930 +# source://prism//lib/prism/node.rb#20453 Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to UTF-8 # -# source://prism//lib/prism/node.rb#18924 +# source://prism//lib/prism/node.rb#20447 Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # i - ignores the case of characters when matching # -# source://prism//lib/prism/node.rb#18900 +# source://prism//lib/prism/node.rb#20423 Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer) # m - allows $ to match the end of lines within strings # -# source://prism//lib/prism/node.rb#18906 +# source://prism//lib/prism/node.rb#20429 Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer) # o - only interpolates values into the regular expression once # -# source://prism//lib/prism/node.rb#18909 +# source://prism//lib/prism/node.rb#20432 Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) # u - forces the UTF-8 encoding # -# source://prism//lib/prism/node.rb#18921 +# source://prism//lib/prism/node.rb#20444 Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) # s - forces the Windows-31J encoding # -# source://prism//lib/prism/node.rb#18918 +# source://prism//lib/prism/node.rb#20441 Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # Represents a regular expression literal with no interpolation. @@ -22003,7 +27261,7 @@ Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) # /foo/i # ^^^^^^ # -# source://prism//lib/prism/node.rb#15432 +# source://prism//lib/prism/node.rb#16708 class Prism::RegularExpressionNode < ::Prism::Node include ::Prism::RegularExpressionOptions @@ -22011,143 +27269,198 @@ class Prism::RegularExpressionNode < ::Prism::Node # # @return [RegularExpressionNode] a new instance of RegularExpressionNode # - # source://prism//lib/prism/node.rb#15434 + # source://prism//lib/prism/node.rb#16710 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#16894 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15446 + # source://prism//lib/prism/node.rb#16722 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def ascii_8bit?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15533 + # source://prism//lib/prism/node.rb#16808 + sig { returns(T::Boolean) } def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15451 + # source://prism//lib/prism/node.rb#16727 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#15573 + # source://prism//lib/prism/node.rb#16848 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#15497 + # source://prism//lib/prism/node.rb#16773 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15461 + # source://prism//lib/prism/node.rb#16737 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15456 + # source://prism//lib/prism/node.rb#16732 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#15568 + # source://prism//lib/prism/node.rb#16843 + sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#15490 + # source://prism//lib/prism/node.rb#16766 + sig { returns(Prism::Location) } def content_loc; end # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> RegularExpressionNode # - # source://prism//lib/prism/node.rb#15466 + # source://prism//lib/prism/node.rb#16742 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::RegularExpressionNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15451 + # source://prism//lib/prism/node.rb#16727 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism//lib/prism/node.rb#15474 + # source://prism//lib/prism/node.rb#16750 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def euc_jp?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15528 + # source://prism//lib/prism/node.rb#16803 + sig { returns(T::Boolean) } def euc_jp?; end # def extended?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15513 + # source://prism//lib/prism/node.rb#16788 + sig { returns(T::Boolean) } def extended?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15553 + # source://prism//lib/prism/node.rb#16828 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_us_ascii_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15558 + # source://prism//lib/prism/node.rb#16833 + sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15548 + # source://prism//lib/prism/node.rb#16823 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def ignore_case?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15508 + # source://prism//lib/prism/node.rb#16783 + sig { returns(T::Boolean) } def ignore_case?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15578 + # source://prism//lib/prism/node.rb#16853 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def multi_line?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15518 + # source://prism//lib/prism/node.rb#16793 + sig { returns(T::Boolean) } def multi_line?; end # def once?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15523 + # source://prism//lib/prism/node.rb#16798 + sig { returns(T::Boolean) } def once?; end # def opening: () -> String # - # source://prism//lib/prism/node.rb#15563 + # source://prism//lib/prism/node.rb#16838 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#15483 + # source://prism//lib/prism/node.rb#16759 + sig { returns(Prism::Location) } def opening_loc; end + sig { returns(Integer) } + def options; 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 @@ -22163,33 +27476,38 @@ class Prism::RegularExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15603 + # source://prism//lib/prism/node.rb#16878 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#15504 + # source://prism//lib/prism/node.rb#16780 + sig { returns(String) } def unescaped; end # def utf_8?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15543 + # source://prism//lib/prism/node.rb#16818 + sig { returns(T::Boolean) } def utf_8?; end # def windows_31j?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15538 + # source://prism//lib/prism/node.rb#16813 + sig { returns(T::Boolean) } def windows_31j?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#15479 + # source://prism//lib/prism/node.rb#16755 + sig { returns(Integer) } def flags; end class << self @@ -22200,7 +27518,7 @@ class Prism::RegularExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15613 + # source://prism//lib/prism/node.rb#16888 def type; end end end @@ -22220,71 +27538,107 @@ end # ^^ # end # -# source://prism//lib/prism/node.rb#15623 +# source://prism//lib/prism/node.rb#16909 class Prism::RequiredKeywordParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void # # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode # - # source://prism//lib/prism/node.rb#15625 + # source://prism//lib/prism/node.rb#16911 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17012 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15635 + # source://prism//lib/prism/node.rb#16921 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15640 + # source://prism//lib/prism/node.rb#16926 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15650 + # source://prism//lib/prism/node.rb#16936 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15645 + # source://prism//lib/prism/node.rb#16931 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?location: Location) -> RequiredKeywordParameterNode # - # source://prism//lib/prism/node.rb#15655 + # source://prism//lib/prism/node.rb#16941 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RequiredKeywordParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15640 + # source://prism//lib/prism/node.rb#16926 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#15663 + # source://prism//lib/prism/node.rb#16949 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15688 + # source://prism//lib/prism/node.rb#16973 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#15672 + # source://prism//lib/prism/node.rb#16958 + sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism//lib/prism/node.rb#15675 + # source://prism//lib/prism/node.rb#16961 + sig { returns(Prism::Location) } def name_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15683 + # source://prism//lib/prism/node.rb#16968 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -22302,14 +27656,16 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15711 + # source://prism//lib/prism/node.rb#16996 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#15668 + # source://prism//lib/prism/node.rb#16954 + sig { returns(Integer) } def flags; end class << self @@ -22320,7 +27676,7 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15721 + # source://prism//lib/prism/node.rb#17006 def type; end end end @@ -22331,66 +27687,86 @@ end # ^ # end # -# source://prism//lib/prism/node.rb#15731 +# source://prism//lib/prism/node.rb#17025 class Prism::RequiredParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location location) -> void # # @return [RequiredParameterNode] a new instance of RequiredParameterNode # - # source://prism//lib/prism/node.rb#15733 + # source://prism//lib/prism/node.rb#17027 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } def initialize(source, flags, name, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17119 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15742 + # source://prism//lib/prism/node.rb#17036 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15747 + # source://prism//lib/prism/node.rb#17041 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15757 + # source://prism//lib/prism/node.rb#17051 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15752 + # source://prism//lib/prism/node.rb#17046 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> RequiredParameterNode # - # source://prism//lib/prism/node.rb#15762 + # source://prism//lib/prism/node.rb#17056 + sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::RequiredParameterNode) } def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15747 + # source://prism//lib/prism/node.rb#17041 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } # - # source://prism//lib/prism/node.rb#15770 + # source://prism//lib/prism/node.rb#17064 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15788 + # source://prism//lib/prism/node.rb#17081 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol # - # source://prism//lib/prism/node.rb#15779 + # source://prism//lib/prism/node.rb#17073 + sig { returns(Symbol) } def name; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#15783 + # source://prism//lib/prism/node.rb#17076 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -22408,14 +27784,16 @@ class Prism::RequiredParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15810 + # source://prism//lib/prism/node.rb#17103 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#15775 + # source://prism//lib/prism/node.rb#17069 + sig { returns(Integer) } def flags; end class << self @@ -22426,7 +27804,7 @@ class Prism::RequiredParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15820 + # source://prism//lib/prism/node.rb#17113 def type; end end end @@ -22436,77 +27814,114 @@ end # foo rescue nil # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#15829 +# source://prism//lib/prism/node.rb#17130 class Prism::RescueModifierNode < ::Prism::Node # def initialize: (Prism::node expression, Location keyword_loc, Prism::node rescue_expression, Location location) -> void # # @return [RescueModifierNode] a new instance of RescueModifierNode # - # source://prism//lib/prism/node.rb#15831 + # source://prism//lib/prism/node.rb#17132 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, expression, keyword_loc, rescue_expression, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17237 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15841 + # source://prism//lib/prism/node.rb#17142 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15850 + # source://prism//lib/prism/node.rb#17151 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15860 + # source://prism//lib/prism/node.rb#17161 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15855 + # source://prism//lib/prism/node.rb#17156 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node, ?location: Location) -> RescueModifierNode # - # source://prism//lib/prism/node.rb#15865 + # source://prism//lib/prism/node.rb#17166 + sig do + params( + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).returns(Prism::RescueModifierNode) + end def copy(expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15850 + # source://prism//lib/prism/node.rb#17151 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node, location: Location } # - # source://prism//lib/prism/node.rb#15873 + # source://prism//lib/prism/node.rb#17174 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#15878 + # source://prism//lib/prism/node.rb#17179 + sig { returns(Prism::Node) } def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#15897 + # source://prism//lib/prism/node.rb#17197 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#15892 + # source://prism//lib/prism/node.rb#17192 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#15881 + # source://prism//lib/prism/node.rb#17182 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader rescue_expression: Prism::node # - # source://prism//lib/prism/node.rb#15888 + # source://prism//lib/prism/node.rb#17189 + sig { returns(Prism::Node) } def rescue_expression; end - # source://prism//lib/prism/node.rb#15845 + # source://prism//lib/prism/node.rb#17146 def set_newline_flag(newline_marked); end # Sometimes you want to check an instance of a node against a list of @@ -22524,7 +27939,8 @@ class Prism::RescueModifierNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#15921 + # source://prism//lib/prism/node.rb#17221 + sig { override.returns(Symbol) } def type; end class << self @@ -22535,7 +27951,7 @@ class Prism::RescueModifierNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#15931 + # source://prism//lib/prism/node.rb#17231 def type; end end end @@ -22550,94 +27966,141 @@ end # # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. # -# source://prism//lib/prism/node.rb#15945 +# source://prism//lib/prism/node.rb#17254 class Prism::RescueNode < ::Prism::Node # def initialize: (Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, Prism::node? reference, StatementsNode? statements, RescueNode? consequent, Location location) -> void # # @return [RescueNode] a new instance of RescueNode # - # source://prism//lib/prism/node.rb#15947 + # source://prism//lib/prism/node.rb#17256 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17405 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#15960 + # source://prism//lib/prism/node.rb#17269 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15965 + # source://prism//lib/prism/node.rb#17274 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#15980 + # source://prism//lib/prism/node.rb#17289 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#15970 + # source://prism//lib/prism/node.rb#17279 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader consequent: RescueNode? # - # source://prism//lib/prism/node.rb#16027 + # source://prism//lib/prism/node.rb#17336 + sig { returns(T.nilable(Prism::RescueNode)) } def consequent; end # def copy: (?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: Prism::node?, ?statements: StatementsNode?, ?consequent: RescueNode?, ?location: Location) -> RescueNode # - # source://prism//lib/prism/node.rb#15985 + # source://prism//lib/prism/node.rb#17294 + sig do + params( + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).returns(Prism::RescueNode) + end def copy(keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#15965 + # source://prism//lib/prism/node.rb#17274 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: Prism::node?, statements: StatementsNode?, consequent: RescueNode?, location: Location } # - # source://prism//lib/prism/node.rb#15993 + # source://prism//lib/prism/node.rb#17302 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader exceptions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#16005 + # source://prism//lib/prism/node.rb#17314 + sig { returns(T::Array[Prism::Node]) } def exceptions; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16041 + # source://prism//lib/prism/node.rb#17349 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#16031 + # source://prism//lib/prism/node.rb#17339 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#15998 + # source://prism//lib/prism/node.rb#17307 + sig { returns(Prism::Location) } def keyword_loc; end # def operator: () -> String? # - # source://prism//lib/prism/node.rb#16036 + # source://prism//lib/prism/node.rb#17344 + sig { returns(T.nilable(String)) } def operator; end # attr_reader operator_loc: Location? # - # source://prism//lib/prism/node.rb#16008 + # source://prism//lib/prism/node.rb#17317 + sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # attr_reader reference: Prism::node? # - # source://prism//lib/prism/node.rb#16021 + # source://prism//lib/prism/node.rb#17330 + sig { returns(T.nilable(Prism::Node)) } def reference; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#16024 + # source://prism//lib/prism/node.rb#17333 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -22655,7 +28118,8 @@ class Prism::RescueNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16081 + # source://prism//lib/prism/node.rb#17389 + sig { override.returns(Symbol) } def type; end class << self @@ -22666,7 +28130,7 @@ class Prism::RescueNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16091 + # source://prism//lib/prism/node.rb#17399 def type; end end end @@ -22677,81 +28141,121 @@ end # ^^ # end # -# source://prism//lib/prism/node.rb#16101 +# source://prism//lib/prism/node.rb#17422 class Prism::RestParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # # @return [RestParameterNode] a new instance of RestParameterNode # - # source://prism//lib/prism/node.rb#16103 + # source://prism//lib/prism/node.rb#17424 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, operator_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17549 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16114 + # source://prism//lib/prism/node.rb#17435 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16119 + # source://prism//lib/prism/node.rb#17440 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16129 + # source://prism//lib/prism/node.rb#17450 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16124 + # source://prism//lib/prism/node.rb#17445 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> RestParameterNode # - # source://prism//lib/prism/node.rb#16134 + # source://prism//lib/prism/node.rb#17455 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::RestParameterNode) + end def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16119 + # source://prism//lib/prism/node.rb#17440 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#16142 + # source://prism//lib/prism/node.rb#17463 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16185 + # source://prism//lib/prism/node.rb#17505 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader name: Symbol? # - # source://prism//lib/prism/node.rb#16151 + # source://prism//lib/prism/node.rb#17472 + sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism//lib/prism/node.rb#16154 + # source://prism//lib/prism/node.rb#17475 + sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#16180 + # source://prism//lib/prism/node.rb#17500 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#16167 + # source://prism//lib/prism/node.rb#17488 + sig { returns(Prism::Location) } def operator_loc; end # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16175 + # source://prism//lib/prism/node.rb#17495 + sig { returns(T::Boolean) } def repeated_parameter?; end # Sometimes you want to check an instance of a node against a list of @@ -22767,29 +28271,123 @@ class Prism::RestParameterNode < ::Prism::Node # you can take advantage of the fact that case statements with all symbol # keys will use a jump table. # - # def type: () -> Symbol + # def type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17533 + sig { override.returns(Symbol) } + def type; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism//lib/prism/node.rb#17468 + sig { returns(Integer) } + def flags; end + + class << self + # Similar to #type, this method returns a symbol that you can use for + # splitting on the type of the node without having to do a long === chain. + # Note that like #type, it will still be slower than using == for a single + # class, but should be faster in a case statement or an array comparison. + # + # def self.type: () -> Symbol + # + # source://prism//lib/prism/node.rb#17543 + def type; end + end +end + +# This represents the result of a call to ::parse or ::parse_file. It contains +# the requested structure, any comments that were encounters, and any errors +# that were encountered. +# +# source://prism//lib/prism/parse_result.rb#443 +class Prism::Result + # Create a new result object with the given values. + # + # @return [Result] a new instance of Result + # + # source://prism//lib/prism/parse_result.rb#465 + sig do + params( + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(comments, magic_comments, data_loc, errors, warnings, source); end + + # The list of comments that were encountered during parsing. + # + # source://prism//lib/prism/parse_result.rb#445 + sig { returns(T::Array[Prism::Comment]) } + def comments; end + + # 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. + # + # source://prism//lib/prism/parse_result.rb#453 + sig { returns(T.nilable(Prism::Location)) } + def data_loc; end + + # Implement the hash pattern matching interface for Result. + # + # source://prism//lib/prism/parse_result.rb#475 + 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. + # + # source://prism//lib/prism/parse_result.rb#480 + sig { returns(Encoding) } + def encoding; end + + # The list of errors that were generated during parsing. + # + # source://prism//lib/prism/parse_result.rb#456 + sig { returns(T::Array[Prism::ParseError]) } + def errors; end + + # Returns true if there were errors during parsing and false if there were + # not. + # + # @return [Boolean] # - # source://prism//lib/prism/node.rb#16213 - def type; end + # source://prism//lib/prism/parse_result.rb#492 + sig { returns(T::Boolean) } + def failure?; end - private + # The list of magic comments that were encountered during parsing. + # + # source://prism//lib/prism/parse_result.rb#448 + sig { returns(T::Array[Prism::MagicComment]) } + def magic_comments; end - # private attr_reader flags: Integer + # A Source instance that represents the source code that was parsed. # - # source://prism//lib/prism/node.rb#16147 - def flags; end + # source://prism//lib/prism/parse_result.rb#462 + sig { returns(Prism::Source) } + def source; end - class << self - # Similar to #type, this method returns a symbol that you can use for - # splitting on the type of the node without having to do a long === chain. - # Note that like #type, it will still be slower than using == for a single - # class, but should be faster in a case statement or an array comparison. - # - # def self.type: () -> Symbol - # - # source://prism//lib/prism/node.rb#16223 - def type; end - end + # Returns true if there were no errors during parsing and false if there + # were. + # + # @return [Boolean] + # + # source://prism//lib/prism/parse_result.rb#486 + sig { returns(T::Boolean) } + def success?; end + + # The list of warnings that were generated during parsing. + # + # source://prism//lib/prism/parse_result.rb#459 + sig { returns(T::Array[Prism::ParseWarning]) } + def warnings; end end # Represents the use of the `retry` keyword. @@ -22797,54 +28395,72 @@ end # retry # ^^^^^ # -# source://prism//lib/prism/node.rb#16232 +# source://prism//lib/prism/node.rb#17562 class Prism::RetryNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [RetryNode] a new instance of RetryNode # - # source://prism//lib/prism/node.rb#16234 + # source://prism//lib/prism/node.rb#17564 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17639 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16241 + # source://prism//lib/prism/node.rb#17571 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16246 + # source://prism//lib/prism/node.rb#17576 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16256 + # source://prism//lib/prism/node.rb#17586 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16251 + # source://prism//lib/prism/node.rb#17581 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> RetryNode # - # source://prism//lib/prism/node.rb#16261 + # source://prism//lib/prism/node.rb#17591 + sig { params(location: Prism::Location).returns(Prism::RetryNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16246 + # source://prism//lib/prism/node.rb#17576 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#16269 + # source://prism//lib/prism/node.rb#17599 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16275 + # source://prism//lib/prism/node.rb#17604 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -22862,7 +28478,8 @@ class Prism::RetryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16294 + # source://prism//lib/prism/node.rb#17623 + sig { override.returns(Symbol) } def type; end class << self @@ -22873,7 +28490,7 @@ class Prism::RetryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16304 + # source://prism//lib/prism/node.rb#17633 def type; end end end @@ -22883,69 +28500,103 @@ end # return 1 # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#16313 +# source://prism//lib/prism/node.rb#17648 class Prism::ReturnNode < ::Prism::Node # def initialize: (Location keyword_loc, ArgumentsNode? arguments, Location location) -> void # # @return [ReturnNode] a new instance of ReturnNode # - # source://prism//lib/prism/node.rb#16315 + # source://prism//lib/prism/node.rb#17650 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, arguments, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17751 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16324 + # source://prism//lib/prism/node.rb#17659 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#16366 + # source://prism//lib/prism/node.rb#17701 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16329 + # source://prism//lib/prism/node.rb#17664 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16341 + # source://prism//lib/prism/node.rb#17676 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16334 + # source://prism//lib/prism/node.rb#17669 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?keyword_loc: Location, ?arguments: ArgumentsNode?, ?location: Location) -> ReturnNode # - # source://prism//lib/prism/node.rb#16346 + # source://prism//lib/prism/node.rb#17681 + sig do + params( + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).returns(Prism::ReturnNode) + end def copy(keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16329 + # source://prism//lib/prism/node.rb#17664 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, arguments: ArgumentsNode?, location: Location } # - # source://prism//lib/prism/node.rb#16354 + # source://prism//lib/prism/node.rb#17689 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16375 + # source://prism//lib/prism/node.rb#17709 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#16370 + # source://prism//lib/prism/node.rb#17704 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#16359 + # source://prism//lib/prism/node.rb#17694 + sig { returns(Prism::Location) } def keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -22963,7 +28614,8 @@ class Prism::ReturnNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16401 + # source://prism//lib/prism/node.rb#17735 + sig { override.returns(Symbol) } def type; end class << self @@ -22974,7 +28626,7 @@ class Prism::ReturnNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16411 + # source://prism//lib/prism/node.rb#17745 def type; end end end @@ -22984,54 +28636,72 @@ end # self # ^^^^ # -# source://prism//lib/prism/node.rb#16420 +# source://prism//lib/prism/node.rb#17762 class Prism::SelfNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [SelfNode] a new instance of SelfNode # - # source://prism//lib/prism/node.rb#16422 + # source://prism//lib/prism/node.rb#17764 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17839 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16429 + # source://prism//lib/prism/node.rb#17771 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16434 + # source://prism//lib/prism/node.rb#17776 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16444 + # source://prism//lib/prism/node.rb#17786 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16439 + # source://prism//lib/prism/node.rb#17781 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> SelfNode # - # source://prism//lib/prism/node.rb#16449 + # source://prism//lib/prism/node.rb#17791 + sig { params(location: Prism::Location).returns(Prism::SelfNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16434 + # source://prism//lib/prism/node.rb#17776 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#16457 + # source://prism//lib/prism/node.rb#17799 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16463 + # source://prism//lib/prism/node.rb#17804 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -23049,7 +28719,8 @@ class Prism::SelfNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16482 + # source://prism//lib/prism/node.rb#17823 + sig { override.returns(Symbol) } def type; end class << self @@ -23060,7 +28731,7 @@ class Prism::SelfNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16492 + # source://prism//lib/prism/node.rb#17833 def type; end end end @@ -23127,22 +28798,22 @@ class Prism::Serialize::Loader # source://prism//lib/prism/serialize.rb#114 def load_line_offsets; end - # source://prism//lib/prism/serialize.rb#402 + # source://prism//lib/prism/serialize.rb#416 def load_metadata; end - # source://prism//lib/prism/serialize.rb#436 + # source://prism//lib/prism/serialize.rb#450 def load_nodes; end - # source://prism//lib/prism/serialize.rb#450 + # source://prism//lib/prism/serialize.rb#464 def load_result; end # source://prism//lib/prism/serialize.rb#110 def load_start_line; end - # source://prism//lib/prism/serialize.rb#411 + # source://prism//lib/prism/serialize.rb#425 def load_tokens; end - # source://prism//lib/prism/serialize.rb#424 + # source://prism//lib/prism/serialize.rb#438 def load_tokens_result; end # Returns the value of attribute serialized. @@ -23162,61 +28833,61 @@ class Prism::Serialize::Loader private - # source://prism//lib/prism/serialize.rb#536 + # source://prism//lib/prism/serialize.rb#550 def load_constant(index); end - # source://prism//lib/prism/serialize.rb#489 + # source://prism//lib/prism/serialize.rb#503 def load_double; end - # source://prism//lib/prism/serialize.rb#504 + # source://prism//lib/prism/serialize.rb#518 def load_embedded_string; end - # source://prism//lib/prism/serialize.rb#566 + # source://prism//lib/prism/serialize.rb#580 def load_error_level; end - # source://prism//lib/prism/serialize.rb#478 + # source://prism//lib/prism/serialize.rb#492 def load_integer; end - # source://prism//lib/prism/serialize.rb#520 + # source://prism//lib/prism/serialize.rb#534 def load_location; end - # source://prism//lib/prism/serialize.rb#524 + # source://prism//lib/prism/serialize.rb#538 def load_location_object; end - # source://prism//lib/prism/serialize.rb#595 + # source://prism//lib/prism/serialize.rb#609 def load_node; end - # source://prism//lib/prism/serialize.rb#561 + # source://prism//lib/prism/serialize.rb#575 def load_optional_constant; end - # source://prism//lib/prism/serialize.rb#528 + # source://prism//lib/prism/serialize.rb#542 def load_optional_location; end - # source://prism//lib/prism/serialize.rb#532 + # source://prism//lib/prism/serialize.rb#546 def load_optional_location_object; end - # source://prism//lib/prism/serialize.rb#497 + # source://prism//lib/prism/serialize.rb#511 def load_optional_node; end - # source://prism//lib/prism/serialize.rb#557 + # source://prism//lib/prism/serialize.rb#571 def load_required_constant; end - # source://prism//lib/prism/serialize.rb#508 + # source://prism//lib/prism/serialize.rb#522 def load_string; end - # source://prism//lib/prism/serialize.rb#493 + # source://prism//lib/prism/serialize.rb#507 def load_uint32; end - # source://prism//lib/prism/serialize.rb#473 + # source://prism//lib/prism/serialize.rb#487 def load_varsint; end # variable-length integer using https://en.wikipedia.org/wiki/LEB128 # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints # - # source://prism//lib/prism/serialize.rb#459 + # source://prism//lib/prism/serialize.rb#473 def load_varuint; end - # source://prism//lib/prism/serialize.rb#581 + # source://prism//lib/prism/serialize.rb#595 def load_warning_level; end end @@ -23248,7 +28919,7 @@ Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) # The token types that can be indexed by their enum values. # -# source://prism//lib/prism/serialize.rb#1819 +# source://prism//lib/prism/serialize.rb#1833 Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) # This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified. @@ -23256,75 +28927,109 @@ Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) # C = { a: 1 } # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16502 +# source://prism//lib/prism/node.rb#17849 class Prism::ShareableConstantNode < ::Prism::Node # def initialize: (Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write, Location location) -> void # # @return [ShareableConstantNode] a new instance of ShareableConstantNode # - # source://prism//lib/prism/node.rb#16504 + # source://prism//lib/prism/node.rb#17851 + sig do + params( + source: Prism::Source, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).void + end def initialize(source, flags, write, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#17954 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16513 + # source://prism//lib/prism/node.rb#17860 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16518 + # source://prism//lib/prism/node.rb#17865 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16528 + # source://prism//lib/prism/node.rb#17875 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16523 + # source://prism//lib/prism/node.rb#17870 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, ?location: Location) -> ShareableConstantNode # - # source://prism//lib/prism/node.rb#16533 + # source://prism//lib/prism/node.rb#17880 + sig do + params( + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).returns(Prism::ShareableConstantNode) + end def copy(flags: T.unsafe(nil), write: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16518 + # source://prism//lib/prism/node.rb#17865 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, location: Location } # - # source://prism//lib/prism/node.rb#16541 + # source://prism//lib/prism/node.rb#17888 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def experimental_copy?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16564 + # source://prism//lib/prism/node.rb#17910 + sig { returns(T::Boolean) } def experimental_copy?; end # def experimental_everything?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16559 + # source://prism//lib/prism/node.rb#17905 + sig { returns(T::Boolean) } def experimental_everything?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16569 + # source://prism//lib/prism/node.rb#17915 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def literal?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16554 + # source://prism//lib/prism/node.rb#17900 + sig { returns(T::Boolean) } def literal?; end # Sometimes you want to check an instance of a node against a list of @@ -23342,19 +29047,24 @@ class Prism::ShareableConstantNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16592 + # source://prism//lib/prism/node.rb#17938 + sig { override.returns(Symbol) } def type; end # The constant write that should be modified with the shareability state. # - # source://prism//lib/prism/node.rb#16550 + # source://prism//lib/prism/node.rb#17897 + sig do + returns(T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode)) + end def write; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#16546 + # source://prism//lib/prism/node.rb#17893 + sig { returns(Integer) } def flags; end class << self @@ -23365,29 +29075,29 @@ class Prism::ShareableConstantNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16602 + # source://prism//lib/prism/node.rb#17948 def type; end end end # Flags for shareable constant nodes. # -# source://prism//lib/prism/node.rb#18934 +# source://prism//lib/prism/node.rb#20457 module Prism::ShareableConstantNodeFlags; end # constant writes that should be modified with shareable constant value experimental copy # -# source://prism//lib/prism/node.rb#18942 +# source://prism//lib/prism/node.rb#20465 Prism::ShareableConstantNodeFlags::EXPERIMENTAL_COPY = T.let(T.unsafe(nil), Integer) # constant writes that should be modified with shareable constant value experimental everything # -# source://prism//lib/prism/node.rb#18939 +# source://prism//lib/prism/node.rb#20462 Prism::ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING = T.let(T.unsafe(nil), Integer) # constant writes that should be modified with shareable constant value literal # -# source://prism//lib/prism/node.rb#18936 +# source://prism//lib/prism/node.rb#20459 Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) # Represents a singleton class declaration involving the `class` keyword. @@ -23395,99 +29105,147 @@ Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) # class << self end # ^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16611 +# source://prism//lib/prism/node.rb#17965 class Prism::SingletonClassNode < ::Prism::Node # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, Prism::node? body, Location end_keyword_loc, Location location) -> void # # @return [SingletonClassNode] a new instance of SingletonClassNode # - # source://prism//lib/prism/node.rb#16613 + # source://prism//lib/prism/node.rb#17967 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18108 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16626 + # source://prism//lib/prism/node.rb#17980 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Prism::node? # - # source://prism//lib/prism/node.rb#16682 + # source://prism//lib/prism/node.rb#18036 + sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16631 + # source://prism//lib/prism/node.rb#17985 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def class_keyword: () -> String # - # source://prism//lib/prism/node.rb#16693 + # source://prism//lib/prism/node.rb#18046 + sig { returns(String) } def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism//lib/prism/node.rb#16665 + # source://prism//lib/prism/node.rb#18019 + sig { returns(Prism::Location) } def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16644 + # source://prism//lib/prism/node.rb#17998 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16636 + # source://prism//lib/prism/node.rb#17990 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?location: Location) -> SingletonClassNode # - # source://prism//lib/prism/node.rb#16649 + # source://prism//lib/prism/node.rb#18003 + sig do + params( + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + operator_loc: Prism::Location, + expression: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::SingletonClassNode) + end def copy(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), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16631 + # source://prism//lib/prism/node.rb#17985 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: Prism::node?, end_keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#16657 + # source://prism//lib/prism/node.rb#18011 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String # - # source://prism//lib/prism/node.rb#16703 + # source://prism//lib/prism/node.rb#18056 + sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism//lib/prism/node.rb#16685 + # source://prism//lib/prism/node.rb#18039 + sig { returns(Prism::Location) } def end_keyword_loc; end # attr_reader expression: Prism::node # - # source://prism//lib/prism/node.rb#16679 + # source://prism//lib/prism/node.rb#18033 + sig { returns(Prism::Node) } def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16708 + # source://prism//lib/prism/node.rb#18061 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # attr_reader locals: Array[Symbol] # - # source://prism//lib/prism/node.rb#16662 + # source://prism//lib/prism/node.rb#18016 + sig { returns(T::Array[Symbol]) } def locals; end # def operator: () -> String # - # source://prism//lib/prism/node.rb#16698 + # source://prism//lib/prism/node.rb#18051 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#16672 + # source://prism//lib/prism/node.rb#18026 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -23505,7 +29263,8 @@ class Prism::SingletonClassNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16739 + # source://prism//lib/prism/node.rb#18092 + sig { override.returns(Symbol) } def type; end class << self @@ -23516,7 +29275,7 @@ class Prism::SingletonClassNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16749 + # source://prism//lib/prism/node.rb#18102 def type; end end end @@ -23532,22 +29291,26 @@ class Prism::Source # @return [Source] a new instance of Source # # source://prism//lib/prism/parse_result.rb#18 + sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void } def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end # Return the column number in characters for the given byte offset. # # source://prism//lib/prism/parse_result.rb#59 + sig { params(byte_offset: Integer).returns(Integer) } def character_column(byte_offset); end # Return the character offset for the given byte offset. # # source://prism//lib/prism/parse_result.rb#54 + sig { params(byte_offset: Integer).returns(Integer) } def character_offset(byte_offset); end # Returns the column number in code units for the given encoding for the # given byte offset. # # source://prism//lib/prism/parse_result.rb#76 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } def code_units_column(byte_offset, encoding); end # Returns the offset from the start of the file for the given byte offset @@ -23558,50 +29321,59 @@ class Prism::Source # encodings, it is not captured here. # # source://prism//lib/prism/parse_result.rb#69 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } def code_units_offset(byte_offset, encoding); end # Return the column number for the given byte offset. # # source://prism//lib/prism/parse_result.rb#49 + sig { params(byte_offset: Integer).returns(Integer) } def column(byte_offset); end # Returns the encoding of the source code, which is set by parameters to the # parser or by the encoding magic comment. # # source://prism//lib/prism/parse_result.rb#26 + sig { returns(Encoding) } def encoding; end # Binary search through the offsets to find the line number for the given # byte offset. # # source://prism//lib/prism/parse_result.rb#38 + 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. # # source://prism//lib/prism/parse_result.rb#44 + sig { params(byte_offset: Integer).returns(Integer) } def line_start(byte_offset); end # The list of newline byte offsets in the source code. # # source://prism//lib/prism/parse_result.rb#15 + sig { returns(T::Array[Integer]) } def offsets; end # Perform a byteslice on the source code using the given byte offset and # byte length. # # source://prism//lib/prism/parse_result.rb#32 + sig { params(byte_offset: Integer, length: Integer).returns(String) } def slice(byte_offset, length); end # The source code that this source object represents. # # source://prism//lib/prism/parse_result.rb#9 + sig { returns(String) } def source; end # The line number where this source starts. # # source://prism//lib/prism/parse_result.rb#12 + sig { returns(Integer) } def start_line; end private @@ -23618,54 +29390,72 @@ end # __ENCODING__ # ^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#16758 +# source://prism//lib/prism/node.rb#18124 class Prism::SourceEncodingNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [SourceEncodingNode] a new instance of SourceEncodingNode # - # source://prism//lib/prism/node.rb#16760 + # source://prism//lib/prism/node.rb#18126 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18201 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16767 + # source://prism//lib/prism/node.rb#18133 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16772 + # source://prism//lib/prism/node.rb#18138 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16782 + # source://prism//lib/prism/node.rb#18148 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16777 + # source://prism//lib/prism/node.rb#18143 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> SourceEncodingNode # - # source://prism//lib/prism/node.rb#16787 + # source://prism//lib/prism/node.rb#18153 + sig { params(location: Prism::Location).returns(Prism::SourceEncodingNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16772 + # source://prism//lib/prism/node.rb#18138 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#16795 + # source://prism//lib/prism/node.rb#18161 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16801 + # source://prism//lib/prism/node.rb#18166 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -23683,7 +29473,8 @@ class Prism::SourceEncodingNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16820 + # source://prism//lib/prism/node.rb#18185 + sig { override.returns(Symbol) } def type; end class << self @@ -23694,7 +29485,7 @@ class Prism::SourceEncodingNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16830 + # source://prism//lib/prism/node.rb#18195 def type; end end end @@ -23704,87 +29495,110 @@ end # __FILE__ # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#16839 +# source://prism//lib/prism/node.rb#18210 class Prism::SourceFileNode < ::Prism::Node # def initialize: (Integer flags, String filepath, Location location) -> void # # @return [SourceFileNode] a new instance of SourceFileNode # - # source://prism//lib/prism/node.rb#16841 + # source://prism//lib/prism/node.rb#18212 + sig { params(source: Prism::Source, flags: Integer, filepath: String, location: Prism::Location).void } def initialize(source, flags, filepath, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18319 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16850 + # source://prism//lib/prism/node.rb#18221 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16855 + # source://prism//lib/prism/node.rb#18226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16865 + # source://prism//lib/prism/node.rb#18236 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16860 + # source://prism//lib/prism/node.rb#18231 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?filepath: String, ?location: Location) -> SourceFileNode # - # source://prism//lib/prism/node.rb#16870 + # source://prism//lib/prism/node.rb#18241 + sig { params(flags: Integer, filepath: String, location: Prism::Location).returns(Prism::SourceFileNode) } def copy(flags: T.unsafe(nil), filepath: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16855 + # source://prism//lib/prism/node.rb#18226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, filepath: String, location: Location } # - # source://prism//lib/prism/node.rb#16878 + # source://prism//lib/prism/node.rb#18249 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader filepath: String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs. # - # source://prism//lib/prism/node.rb#16887 + # source://prism//lib/prism/node.rb#18258 + sig { returns(String) } def filepath; end # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16896 + # source://prism//lib/prism/node.rb#18266 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16891 + # source://prism//lib/prism/node.rb#18261 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def frozen?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16901 + # source://prism//lib/prism/node.rb#18271 + sig { returns(T::Boolean) } def frozen?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16911 + # source://prism//lib/prism/node.rb#18281 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def mutable?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#16906 + # source://prism//lib/prism/node.rb#18276 + sig { returns(T::Boolean) } def mutable?; end # Sometimes you want to check an instance of a node against a list of @@ -23802,14 +29616,16 @@ class Prism::SourceFileNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#16933 + # source://prism//lib/prism/node.rb#18303 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#16883 + # source://prism//lib/prism/node.rb#18254 + sig { returns(Integer) } def flags; end class << self @@ -23820,7 +29636,7 @@ class Prism::SourceFileNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#16943 + # source://prism//lib/prism/node.rb#18313 def type; end end end @@ -23830,54 +29646,72 @@ end # __LINE__ # ^^^^^^^^ # -# source://prism//lib/prism/node.rb#16952 +# source://prism//lib/prism/node.rb#18330 class Prism::SourceLineNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [SourceLineNode] a new instance of SourceLineNode # - # source://prism//lib/prism/node.rb#16954 + # source://prism//lib/prism/node.rb#18332 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18407 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#16961 + # source://prism//lib/prism/node.rb#18339 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16966 + # source://prism//lib/prism/node.rb#18344 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#16976 + # source://prism//lib/prism/node.rb#18354 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#16971 + # source://prism//lib/prism/node.rb#18349 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> SourceLineNode # - # source://prism//lib/prism/node.rb#16981 + # source://prism//lib/prism/node.rb#18359 + sig { params(location: Prism::Location).returns(Prism::SourceLineNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#16966 + # source://prism//lib/prism/node.rb#18344 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#16989 + # source://prism//lib/prism/node.rb#18367 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#16995 + # source://prism//lib/prism/node.rb#18372 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -23895,7 +29729,8 @@ class Prism::SourceLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17014 + # source://prism//lib/prism/node.rb#18391 + sig { override.returns(Symbol) } def type; end class << self @@ -23906,7 +29741,7 @@ class Prism::SourceLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17024 + # source://prism//lib/prism/node.rb#18401 def type; end end end @@ -23916,69 +29751,103 @@ end # [*a] # ^^ # -# source://prism//lib/prism/node.rb#17033 +# source://prism//lib/prism/node.rb#18416 class Prism::SplatNode < ::Prism::Node # def initialize: (Location operator_loc, Prism::node? expression, Location location) -> void # # @return [SplatNode] a new instance of SplatNode # - # source://prism//lib/prism/node.rb#17035 + # source://prism//lib/prism/node.rb#18418 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, operator_loc, expression, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18519 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17044 + # source://prism//lib/prism/node.rb#18427 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17049 + # source://prism//lib/prism/node.rb#18432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17061 + # source://prism//lib/prism/node.rb#18444 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17054 + # source://prism//lib/prism/node.rb#18437 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?operator_loc: Location, ?expression: Prism::node?, ?location: Location) -> SplatNode # - # source://prism//lib/prism/node.rb#17066 + # source://prism//lib/prism/node.rb#18449 + sig do + params( + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::SplatNode) + end def copy(operator_loc: T.unsafe(nil), expression: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17049 + # source://prism//lib/prism/node.rb#18432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Prism::node?, location: Location } # - # source://prism//lib/prism/node.rb#17074 + # source://prism//lib/prism/node.rb#18457 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # attr_reader expression: Prism::node? # - # source://prism//lib/prism/node.rb#17086 + # source://prism//lib/prism/node.rb#18469 + sig { returns(T.nilable(Prism::Node)) } def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17095 + # source://prism//lib/prism/node.rb#18477 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def operator: () -> String # - # source://prism//lib/prism/node.rb#17090 + # source://prism//lib/prism/node.rb#18472 + sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism//lib/prism/node.rb#17079 + # source://prism//lib/prism/node.rb#18462 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -23996,7 +29865,8 @@ class Prism::SplatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17121 + # source://prism//lib/prism/node.rb#18503 + sig { override.returns(Symbol) } def type; end class << self @@ -24007,7 +29877,7 @@ class Prism::SplatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17131 + # source://prism//lib/prism/node.rb#18513 def type; end end end @@ -24017,59 +29887,78 @@ end # foo; bar; baz # ^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17140 +# source://prism//lib/prism/node.rb#18530 class Prism::StatementsNode < ::Prism::Node # def initialize: (Array[Prism::node] body, Location location) -> void # # @return [StatementsNode] a new instance of StatementsNode # - # source://prism//lib/prism/node.rb#17142 + # source://prism//lib/prism/node.rb#18532 + sig { params(source: Prism::Source, body: T::Array[Prism::Node], location: Prism::Location).void } def initialize(source, body, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18612 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17150 + # source://prism//lib/prism/node.rb#18540 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader body: Array[Prism::node] # - # source://prism//lib/prism/node.rb#17183 + # source://prism//lib/prism/node.rb#18573 + sig { returns(T::Array[Prism::Node]) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17155 + # source://prism//lib/prism/node.rb#18545 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17165 + # source://prism//lib/prism/node.rb#18555 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17160 + # source://prism//lib/prism/node.rb#18550 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?body: Array[Prism::node], ?location: Location) -> StatementsNode # - # source://prism//lib/prism/node.rb#17170 + # source://prism//lib/prism/node.rb#18560 + sig { params(body: T::Array[Prism::Node], location: Prism::Location).returns(Prism::StatementsNode) } def copy(body: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17155 + # source://prism//lib/prism/node.rb#18545 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Prism::node], location: Location } # - # source://prism//lib/prism/node.rb#17178 + # source://prism//lib/prism/node.rb#18568 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17187 + # source://prism//lib/prism/node.rb#18576 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -24087,7 +29976,8 @@ class Prism::StatementsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17207 + # source://prism//lib/prism/node.rb#18596 + sig { override.returns(Symbol) } def type; end class << self @@ -24098,30 +29988,30 @@ class Prism::StatementsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17217 + # source://prism//lib/prism/node.rb#18606 def type; end end end # Flags for string nodes. # -# source://prism//lib/prism/node.rb#18946 +# source://prism//lib/prism/node.rb#20469 module Prism::StringFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#18951 +# source://prism//lib/prism/node.rb#20474 Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to UTF-8 # -# source://prism//lib/prism/node.rb#18948 +# source://prism//lib/prism/node.rb#20471 Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#18954 +# source://prism//lib/prism/node.rb#20477 Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) -# source://prism//lib/prism/node.rb#18957 +# source://prism//lib/prism/node.rb#20480 Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string. @@ -24135,7 +30025,7 @@ Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer) # "foo #{bar} baz" # ^^^^ ^^^^ # -# source://prism//lib/prism/node.rb#17232 +# source://prism//lib/prism/node.rb#18629 class Prism::StringNode < ::Prism::Node include ::Prism::HeredocQuery @@ -24143,112 +30033,163 @@ class Prism::StringNode < ::Prism::Node # # @return [StringNode] a new instance of StringNode # - # source://prism//lib/prism/node.rb#17234 + # source://prism//lib/prism/node.rb#18631 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18792 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17246 + # source://prism//lib/prism/node.rb#18643 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17251 + # source://prism//lib/prism/node.rb#18648 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#17350 + # source://prism//lib/prism/node.rb#18746 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#17303 + # source://prism//lib/prism/node.rb#18700 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17261 + # source://prism//lib/prism/node.rb#18658 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17256 + # source://prism//lib/prism/node.rb#18653 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#17345 + # source://prism//lib/prism/node.rb#18741 + sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#17296 + # source://prism//lib/prism/node.rb#18693 + sig { returns(Prism::Location) } def content_loc; end # def copy: (?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> StringNode # - # source://prism//lib/prism/node.rb#17266 + # source://prism//lib/prism/node.rb#18663 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).returns(Prism::StringNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17251 + # source://prism//lib/prism/node.rb#18648 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location } # - # source://prism//lib/prism/node.rb#17274 + # source://prism//lib/prism/node.rb#18671 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17325 + # source://prism//lib/prism/node.rb#18721 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17320 + # source://prism//lib/prism/node.rb#18716 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def frozen?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17330 + # source://prism//lib/prism/node.rb#18726 + sig { returns(T::Boolean) } def frozen?; end + sig { returns(T::Boolean) } + def heredoc?; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17355 + # source://prism//lib/prism/node.rb#18751 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def mutable?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17335 + # source://prism//lib/prism/node.rb#18731 + sig { returns(T::Boolean) } def mutable?; end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#17340 + # source://prism//lib/prism/node.rb#18736 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#17283 + # source://prism//lib/prism/node.rb#18680 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; 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. # # source://prism//lib/prism/node_ext.rb#55 + sig { returns(Prism::InterpolatedStringNode) } def to_interpolated; end # Sometimes you want to check an instance of a node against a list of @@ -24266,19 +30207,22 @@ class Prism::StringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17380 + # source://prism//lib/prism/node.rb#18776 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#17316 + # source://prism//lib/prism/node.rb#18713 + sig { returns(String) } def unescaped; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#17279 + # source://prism//lib/prism/node.rb#18676 + sig { returns(Integer) } def flags; end class << self @@ -24289,7 +30233,7 @@ class Prism::StringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17390 + # source://prism//lib/prism/node.rb#18786 def type; end end end @@ -24302,94 +30246,139 @@ end # super foo, bar # ^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17402 +# source://prism//lib/prism/node.rb#18809 class Prism::SuperNode < ::Prism::Node # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Prism::node? block, Location location) -> void # # @return [SuperNode] a new instance of SuperNode # - # source://prism//lib/prism/node.rb#17404 + # source://prism//lib/prism/node.rb#18811 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#18963 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17416 + # source://prism//lib/prism/node.rb#18823 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#17472 + # source://prism//lib/prism/node.rb#18879 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # attr_reader block: Prism::node? # - # source://prism//lib/prism/node.rb#17488 + # source://prism//lib/prism/node.rb#18895 + sig { returns(T.nilable(Prism::Node)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17421 + # source://prism//lib/prism/node.rb#18828 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17434 + # source://prism//lib/prism/node.rb#18841 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17426 + # source://prism//lib/prism/node.rb#18833 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: Prism::node?, ?location: Location) -> SuperNode # - # source://prism//lib/prism/node.rb#17439 + # source://prism//lib/prism/node.rb#18846 + sig do + params( + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + block: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::SuperNode) + end def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17421 + # source://prism//lib/prism/node.rb#18828 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Prism::node?, location: Location } # - # source://prism//lib/prism/node.rb#17447 + # source://prism//lib/prism/node.rb#18854 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17507 + # source://prism//lib/prism/node.rb#18913 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#17492 + # source://prism//lib/prism/node.rb#18898 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#17452 + # source://prism//lib/prism/node.rb#18859 + sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#17497 + # source://prism//lib/prism/node.rb#18903 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#17459 + # source://prism//lib/prism/node.rb#18866 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#17502 + # source://prism//lib/prism/node.rb#18908 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#17475 + # source://prism//lib/prism/node.rb#18882 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -24407,7 +30396,8 @@ class Prism::SuperNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17541 + # source://prism//lib/prism/node.rb#18947 + sig { override.returns(Symbol) } def type; end class << self @@ -24418,29 +30408,29 @@ class Prism::SuperNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17551 + # source://prism//lib/prism/node.rb#18957 def type; end end end # Flags for symbol nodes. # -# source://prism//lib/prism/node.rb#18961 +# source://prism//lib/prism/node.rb#20484 module Prism::SymbolFlags; end # internal bytes forced the encoding to binary # -# source://prism//lib/prism/node.rb#18966 +# source://prism//lib/prism/node.rb#20489 Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to US-ASCII # -# source://prism//lib/prism/node.rb#18969 +# source://prism//lib/prism/node.rb#20492 Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer) # internal bytes forced the encoding to UTF-8 # -# source://prism//lib/prism/node.rb#18963 +# source://prism//lib/prism/node.rb#20486 Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # Represents a symbol literal or a symbol contained within a `%i` list. @@ -24451,95 +30441,139 @@ Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # %i[foo] # ^^^ # -# source://prism//lib/prism/node.rb#17563 +# source://prism//lib/prism/node.rb#18980 class Prism::SymbolNode < ::Prism::Node # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void # # @return [SymbolNode] a new instance of SymbolNode # - # source://prism//lib/prism/node.rb#17565 + # source://prism//lib/prism/node.rb#18982 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19144 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17577 + # source://prism//lib/prism/node.rb#18994 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17582 + # source://prism//lib/prism/node.rb#18999 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#17682 + # source://prism//lib/prism/node.rb#19098 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#17640 + # source://prism//lib/prism/node.rb#19057 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17592 + # source://prism//lib/prism/node.rb#19009 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17587 + # source://prism//lib/prism/node.rb#19004 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> SymbolNode # - # source://prism//lib/prism/node.rb#17597 + # source://prism//lib/prism/node.rb#19014 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + value_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).returns(Prism::SymbolNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17582 + # source://prism//lib/prism/node.rb#18999 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location } # - # source://prism//lib/prism/node.rb#17605 + # source://prism//lib/prism/node.rb#19022 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17662 + # source://prism//lib/prism/node.rb#19078 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_us_ascii_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17667 + # source://prism//lib/prism/node.rb#19083 + sig { returns(T::Boolean) } def forced_us_ascii_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#17657 + # source://prism//lib/prism/node.rb#19073 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17687 + # source://prism//lib/prism/node.rb#19103 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String? # - # source://prism//lib/prism/node.rb#17672 + # source://prism//lib/prism/node.rb#19088 + sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism//lib/prism/node.rb#17614 + # source://prism//lib/prism/node.rb#19031 + sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # Sometimes you want to check an instance of a node against a list of @@ -24557,29 +30591,34 @@ class Prism::SymbolNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17712 + # source://prism//lib/prism/node.rb#19128 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#17653 + # source://prism//lib/prism/node.rb#19070 + sig { returns(String) } def unescaped; end # def value: () -> String? # - # source://prism//lib/prism/node.rb#17677 + # source://prism//lib/prism/node.rb#19093 + sig { returns(T.nilable(String)) } def value; end # attr_reader value_loc: Location? # - # source://prism//lib/prism/node.rb#17627 + # source://prism//lib/prism/node.rb#19044 + sig { returns(T.nilable(Prism::Location)) } def value_loc; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#17610 + # source://prism//lib/prism/node.rb#19027 + sig { returns(Integer) } def flags; end class << self @@ -24590,57 +30629,65 @@ class Prism::SymbolNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17722 + # source://prism//lib/prism/node.rb#19138 def type; end end end # This represents a token from the Ruby source. # -# source://prism//lib/prism/parse_result.rb#499 +# source://prism//lib/prism/parse_result.rb#550 class Prism::Token # Create a new token object with the given type, value, and location. # # @return [Token] a new instance of Token # - # source://prism//lib/prism/parse_result.rb#511 + # source://prism//lib/prism/parse_result.rb#562 + sig { params(source: Prism::Source, type: Symbol, value: String, location: T.any(Integer, Prism::Location)).void } def initialize(source, type, value, location); end # Returns true if the given other token is equal to this token. # - # source://prism//lib/prism/parse_result.rb#546 + # source://prism//lib/prism/parse_result.rb#597 + sig { params(other: T.untyped).returns(T::Boolean) } def ==(other); end # Implement the hash pattern matching interface for Token. # - # source://prism//lib/prism/parse_result.rb#519 + # source://prism//lib/prism/parse_result.rb#570 + 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. # - # source://prism//lib/prism/parse_result.rb#524 + # source://prism//lib/prism/parse_result.rb#575 + sig { returns(Prism::Location) } def location; end # Implement the pretty print interface for Token. # - # source://prism//lib/prism/parse_result.rb#531 + # source://prism//lib/prism/parse_result.rb#582 + sig { params(q: T.untyped).void } def pretty_print(q); end # The type of token that this token is. # - # source://prism//lib/prism/parse_result.rb#505 + # source://prism//lib/prism/parse_result.rb#556 + sig { returns(Symbol) } def type; end # A byteslice of the source that this token represents. # - # source://prism//lib/prism/parse_result.rb#508 + # source://prism//lib/prism/parse_result.rb#559 + sig { returns(String) } def value; end private # The Source object that represents the source this token came from. # - # source://prism//lib/prism/parse_result.rb#501 + # source://prism//lib/prism/parse_result.rb#552 + sig { returns(Prism::Source) } def source; end end @@ -24685,6 +30732,7 @@ class Prism::Translation::Parser < ::Parser::Base def try_declare_numparam(node); end # source://prism//lib/prism/translation/parser.rb#31 + sig { overridable.returns(Integer) } def version; end # source://prism//lib/prism/translation/parser.rb#40 @@ -24766,6 +30814,7 @@ end # source://prism//lib/prism/translation/parser33.rb#6 class Prism::Translation::Parser33 < ::Prism::Translation::Parser # source://prism//lib/prism/translation/parser33.rb#7 + sig { override.returns(Integer) } def version; end end @@ -24774,6 +30823,7 @@ end # source://prism//lib/prism/translation/parser34.rb#6 class Prism::Translation::Parser34 < ::Prism::Translation::Parser # source://prism//lib/prism/translation/parser34.rb#7 + sig { override.returns(Integer) } def version; end end @@ -24782,6 +30832,8 @@ end # # source://prism//lib/prism/translation/parser/compiler.rb#8 class Prism::Translation::Parser::Compiler < ::Prism::Compiler + Result = type_member { { fixed: Parser::AST::Node } } + # Initialize a new compiler with the given parser, offset cache, and # options. # @@ -25187,7 +31239,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # if foo .. bar; end # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1323 + # source://prism//lib/prism/translation/parser/compiler.rb#1364 def visit_flip_flop_node(node); end # 1.0 @@ -25405,19 +31457,25 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # :"foo #{bar}" # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#983 + # source://prism//lib/prism/translation/parser/compiler.rb#1010 def visit_interpolated_symbol_node(node); end # `foo #{bar}` # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#993 + # source://prism//lib/prism/translation/parser/compiler.rb#1020 def visit_interpolated_x_string_node(node); end + # -> { it } + # ^^^^^^^^^ + # + # source://prism//lib/prism/translation/parser/compiler.rb#1035 + def visit_it_parameters_node(node); end + # foo(bar: baz) # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1008 + # source://prism//lib/prism/translation/parser/compiler.rb#1041 def visit_keyword_hash_node(node); end # def foo(**bar); end @@ -25426,13 +31484,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # def foo(**); end # ^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1017 + # source://prism//lib/prism/translation/parser/compiler.rb#1050 def visit_keyword_rest_parameter_node(node); end # -> {} # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1026 + # source://prism//lib/prism/translation/parser/compiler.rb#1059 def visit_lambda_node(node); end # foo += bar @@ -25440,13 +31498,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # foo &&= bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1067 + # source://prism//lib/prism/translation/parser/compiler.rb#1108 def visit_local_variable_and_write_node(node); end # foo += bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1067 + # source://prism//lib/prism/translation/parser/compiler.rb#1108 def visit_local_variable_operator_write_node(node); end # foo += bar @@ -25454,25 +31512,25 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # foo ||= bar # ^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1067 + # source://prism//lib/prism/translation/parser/compiler.rb#1108 def visit_local_variable_or_write_node(node); end # foo # ^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1051 + # source://prism//lib/prism/translation/parser/compiler.rb#1085 def visit_local_variable_read_node(node); end # foo, = bar # ^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1085 + # source://prism//lib/prism/translation/parser/compiler.rb#1126 def visit_local_variable_target_node(node); end # foo = 1 # ^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1057 + # source://prism//lib/prism/translation/parser/compiler.rb#1098 def visit_local_variable_write_node(node); end # /foo/ @@ -25480,50 +31538,50 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # if /foo/ then end # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1357 + # source://prism//lib/prism/translation/parser/compiler.rb#1398 def visit_match_last_line_node(node); end # foo in bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1095 + # source://prism//lib/prism/translation/parser/compiler.rb#1136 def visit_match_predicate_node(node); end # foo => bar # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1105 + # source://prism//lib/prism/translation/parser/compiler.rb#1146 def visit_match_required_node(node); end # /(?foo)/ =~ bar # ^^^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1115 + # source://prism//lib/prism/translation/parser/compiler.rb#1156 def visit_match_write_node(node); end # A node that is missing from the syntax tree. This is only used in the # case of a syntax error. The parser gem doesn't have such a concept, so # we invent our own here. # - # source://prism//lib/prism/translation/parser/compiler.rb#1126 + # source://prism//lib/prism/translation/parser/compiler.rb#1167 def visit_missing_node(node); end # module Foo; end # ^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1132 + # source://prism//lib/prism/translation/parser/compiler.rb#1173 def visit_module_node(node); end # foo, bar = baz # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1143 + # source://prism//lib/prism/translation/parser/compiler.rb#1184 def visit_multi_target_node(node); end # foo, bar = baz # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1157 + # source://prism//lib/prism/translation/parser/compiler.rb#1198 def visit_multi_write_node(node); end # next @@ -25532,55 +31590,55 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # next foo # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1178 + # source://prism//lib/prism/translation/parser/compiler.rb#1219 def visit_next_node(node); end # nil # ^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1190 + # source://prism//lib/prism/translation/parser/compiler.rb#1231 def visit_nil_node(node); end # def foo(**nil); end # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1196 + # source://prism//lib/prism/translation/parser/compiler.rb#1237 def visit_no_keywords_parameter_node(node); end # -> { _1 + _2 } # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1206 + # source://prism//lib/prism/translation/parser/compiler.rb#1247 def visit_numbered_parameters_node(node); end # $1 # ^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1212 + # source://prism//lib/prism/translation/parser/compiler.rb#1253 def visit_numbered_reference_read_node(node); end # def foo(bar: baz); end # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1218 + # source://prism//lib/prism/translation/parser/compiler.rb#1259 def visit_optional_keyword_parameter_node(node); end # def foo(bar = 1); end # ^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1224 + # source://prism//lib/prism/translation/parser/compiler.rb#1265 def visit_optional_parameter_node(node); end # a or b # ^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1230 + # source://prism//lib/prism/translation/parser/compiler.rb#1271 def visit_or_node(node); end # def foo(bar, *baz); end # ^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1236 + # source://prism//lib/prism/translation/parser/compiler.rb#1277 def visit_parameters_node(node); end # () @@ -25589,76 +31647,76 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # (1) # ^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1275 + # source://prism//lib/prism/translation/parser/compiler.rb#1316 def visit_parentheses_node(node); end # foo => ^(bar) # ^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1285 + # source://prism//lib/prism/translation/parser/compiler.rb#1326 def visit_pinned_expression_node(node); end # foo = 1 and bar => ^foo # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1292 + # source://prism//lib/prism/translation/parser/compiler.rb#1333 def visit_pinned_variable_node(node); end # END {} # - # source://prism//lib/prism/translation/parser/compiler.rb#1297 + # source://prism//lib/prism/translation/parser/compiler.rb#1338 def visit_post_execution_node(node); end # BEGIN {} # - # source://prism//lib/prism/translation/parser/compiler.rb#1307 + # source://prism//lib/prism/translation/parser/compiler.rb#1348 def visit_pre_execution_node(node); end # The top-level program node. # - # source://prism//lib/prism/translation/parser/compiler.rb#1317 + # source://prism//lib/prism/translation/parser/compiler.rb#1358 def visit_program_node(node); end # 0..5 # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1323 + # source://prism//lib/prism/translation/parser/compiler.rb#1364 def visit_range_node(node); end # 1r # ^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1345 + # source://prism//lib/prism/translation/parser/compiler.rb#1386 def visit_rational_node(node); end # redo # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1351 + # source://prism//lib/prism/translation/parser/compiler.rb#1392 def visit_redo_node(node); end # /foo/ # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1357 + # source://prism//lib/prism/translation/parser/compiler.rb#1398 def visit_regular_expression_node(node); end # def foo(bar:); end # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1372 + # source://prism//lib/prism/translation/parser/compiler.rb#1413 def visit_required_keyword_parameter_node(node); end # def foo(bar); end # ^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1378 + # source://prism//lib/prism/translation/parser/compiler.rb#1419 def visit_required_parameter_node(node); end # foo rescue bar # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1384 + # source://prism//lib/prism/translation/parser/compiler.rb#1425 def visit_rescue_modifier_node(node); end # begin; rescue; end @@ -25666,7 +31724,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # # @raise [CompilationError] # - # source://prism//lib/prism/translation/parser/compiler.rb#1402 + # source://prism//lib/prism/translation/parser/compiler.rb#1443 def visit_rescue_node(node); end # def foo(*bar); end @@ -25675,13 +31733,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # def foo(*); end # ^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1411 + # source://prism//lib/prism/translation/parser/compiler.rb#1452 def visit_rest_parameter_node(node); end # retry # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1417 + # source://prism//lib/prism/translation/parser/compiler.rb#1458 def visit_retry_node(node); end # return @@ -25690,42 +31748,42 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # return 1 # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1426 + # source://prism//lib/prism/translation/parser/compiler.rb#1467 def visit_return_node(node); end # self # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1438 + # source://prism//lib/prism/translation/parser/compiler.rb#1479 def visit_self_node(node); end # A shareable constant. # - # source://prism//lib/prism/translation/parser/compiler.rb#1443 + # source://prism//lib/prism/translation/parser/compiler.rb#1484 def visit_shareable_constant_node(node); end # class << self; end # ^^^^^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1449 + # source://prism//lib/prism/translation/parser/compiler.rb#1490 def visit_singleton_class_node(node); end # __ENCODING__ # ^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1461 + # source://prism//lib/prism/translation/parser/compiler.rb#1502 def visit_source_encoding_node(node); end # __FILE__ # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1467 + # source://prism//lib/prism/translation/parser/compiler.rb#1508 def visit_source_file_node(node); end # __LINE__ # ^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1473 + # source://prism//lib/prism/translation/parser/compiler.rb#1514 def visit_source_line_node(node); end # foo(*bar) @@ -25737,42 +31795,42 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # def foo(*); bar(*); end # ^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1485 + # source://prism//lib/prism/translation/parser/compiler.rb#1526 def visit_splat_node(node); end # A list of statements. # - # source://prism//lib/prism/translation/parser/compiler.rb#1498 + # source://prism//lib/prism/translation/parser/compiler.rb#1539 def visit_statements_node(node); end # "foo" # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1504 + # source://prism//lib/prism/translation/parser/compiler.rb#1545 def visit_string_node(node); end # super(foo) # ^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1535 + # source://prism//lib/prism/translation/parser/compiler.rb#1586 def visit_super_node(node); end # :foo # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1558 + # source://prism//lib/prism/translation/parser/compiler.rb#1609 def visit_symbol_node(node); end # true # ^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1590 + # source://prism//lib/prism/translation/parser/compiler.rb#1641 def visit_true_node(node); end # undef foo # ^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1596 + # source://prism//lib/prism/translation/parser/compiler.rb#1647 def visit_undef_node(node); end # unless foo; bar end @@ -25781,22 +31839,22 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # bar unless foo # ^^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1605 + # source://prism//lib/prism/translation/parser/compiler.rb#1656 def visit_unless_node(node); end # until foo; bar end - # ^^^^^^^^^^^^^^^^^ + # ^^^^^^^^^^^^^^^^^^ # # bar until foo # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1635 + # source://prism//lib/prism/translation/parser/compiler.rb#1686 def visit_until_node(node); end # case foo; when bar; end # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1657 + # source://prism//lib/prism/translation/parser/compiler.rb#1708 def visit_when_node(node); end # while foo; bar end @@ -25805,13 +31863,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # bar while foo # ^^^^^^^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1675 + # source://prism//lib/prism/translation/parser/compiler.rb#1726 def visit_while_node(node); end # `foo` # ^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1697 + # source://prism//lib/prism/translation/parser/compiler.rb#1748 def visit_x_string_node(node); end # yield @@ -25820,7 +31878,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # yield 1 # ^^^^^^^ # - # source://prism//lib/prism/translation/parser/compiler.rb#1729 + # source://prism//lib/prism/translation/parser/compiler.rb#1780 def visit_yield_node(node); end private @@ -25828,20 +31886,20 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # Initialize a new compiler with the given option overrides, used to # visit a subtree with the given options. # - # source://prism//lib/prism/translation/parser/compiler.rb#1743 + # source://prism//lib/prism/translation/parser/compiler.rb#1794 def copy_compiler(forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end # When *, **, &, or ... are used as an argument in a method call, we # check if they were allowed by the current context. To determine that # we build this lookup table. # - # source://prism//lib/prism/translation/parser/compiler.rb#1750 + # source://prism//lib/prism/translation/parser/compiler.rb#1801 def find_forwarding(node); end # Because we have mutated the AST to allow for newlines in the middle of # a rational, we need to manually handle the value here. # - # source://prism//lib/prism/translation/parser/compiler.rb#1764 + # source://prism//lib/prism/translation/parser/compiler.rb#1815 def imaginary_value(node); end # Negate the value of a numeric node. This is a special case where you @@ -25850,7 +31908,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # however, marks this as a numeric literal. We have to massage the tree # here to get it into the correct form. # - # source://prism//lib/prism/translation/parser/compiler.rb#1773 + # source://prism//lib/prism/translation/parser/compiler.rb#1824 def numeric_negate(message_loc, receiver); end # Blocks can have a special set of parameters that automatically expand @@ -25859,55 +31917,58 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler # # @return [Boolean] # - # source://prism//lib/prism/translation/parser/compiler.rb#1785 + # source://prism//lib/prism/translation/parser/compiler.rb#1836 def procarg0?(parameters); end # Because we have mutated the AST to allow for newlines in the middle of # a rational, we need to manually handle the value here. # - # source://prism//lib/prism/translation/parser/compiler.rb#1798 + # source://prism//lib/prism/translation/parser/compiler.rb#1849 def rational_value(node); end # Constructs a new source range from the given start and end offsets. # - # source://prism//lib/prism/translation/parser/compiler.rb#1812 + # source://prism//lib/prism/translation/parser/compiler.rb#1863 def srange(location); end # Constructs a new source range by finding the given tokens between the # given start offset and end offset. If the needle is not found, it - # returns nil. + # returns nil. Importantly it does not search past newlines or comments. # - # source://prism//lib/prism/translation/parser/compiler.rb#1824 + # Note that end_offset is allowed to be nil, in which case this will + # search until the end of the string. + # + # source://prism//lib/prism/translation/parser/compiler.rb#1878 def srange_find(start_offset, end_offset, tokens); end # Constructs a new source range from the given start and end offsets. # - # source://prism//lib/prism/translation/parser/compiler.rb#1817 + # source://prism//lib/prism/translation/parser/compiler.rb#1868 def srange_offsets(start_offset, end_offset); end # Transform a location into a token that the parser gem expects. # - # source://prism//lib/prism/translation/parser/compiler.rb#1833 + # source://prism//lib/prism/translation/parser/compiler.rb#1888 def token(location); end # Visit a block node on a call. # - # source://prism//lib/prism/translation/parser/compiler.rb#1838 + # source://prism//lib/prism/translation/parser/compiler.rb#1893 def visit_block(call, block); end # Visit a heredoc that can be either a string or an xstring. # - # source://prism//lib/prism/translation/parser/compiler.rb#1871 + # source://prism//lib/prism/translation/parser/compiler.rb#1927 def visit_heredoc(node); end # Visit a numeric node and account for the optional sign. # - # source://prism//lib/prism/translation/parser/compiler.rb#1917 + # source://prism//lib/prism/translation/parser/compiler.rb#1973 def visit_numeric(node, value); end # Within the given block, track that we're within a pattern. # - # source://prism//lib/prism/translation/parser/compiler.rb#1929 + # source://prism//lib/prism/translation/parser/compiler.rb#1985 def within_pattern; end end @@ -25920,7 +31981,7 @@ class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError; # store a reference to its constant to make it slightly faster to look # up. # -# source://prism//lib/prism/translation/parser/compiler.rb#1809 +# source://prism//lib/prism/translation/parser/compiler.rb#1860 Prism::Translation::Parser::Compiler::Range = Parser::Source::Range # source://prism//lib/prism/translation/parser.rb#12 @@ -26042,26 +32103,26 @@ Prism::Translation::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) # The main known difference is that we may omit dispatching some events in # some cases. This impacts the following events: # -# * on_assign_error -# * on_comma -# * on_ignored_nl -# * on_ignored_sp -# * on_kw -# * on_label_end -# * on_lbrace -# * on_lbracket -# * on_lparen -# * on_nl -# * on_op -# * on_operator_ambiguous -# * on_rbrace -# * on_rbracket -# * on_rparen -# * on_semicolon -# * on_sp -# * on_symbeg -# * on_tstring_beg -# * on_tstring_end +# - on_assign_error +# - on_comma +# - on_ignored_nl +# - on_ignored_sp +# - on_kw +# - on_label_end +# - on_lbrace +# - on_lbracket +# - on_lparen +# - on_nl +# - on_op +# - on_operator_ambiguous +# - on_rbrace +# - on_rbracket +# - on_rparen +# - on_semicolon +# - on_sp +# - on_symbeg +# - on_tstring_beg +# - on_tstring_end # # source://prism//lib/prism/translation/ripper.rb#43 class Prism::Translation::Ripper < ::Prism::Compiler @@ -26082,6 +32143,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler # @return [Boolean] # # source://prism//lib/prism/translation/ripper.rb#457 + sig { returns(T::Boolean) } def error?; end # The filename of the source being parsed. @@ -26097,6 +32159,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler # Parse the source and return the result. # # source://prism//lib/prism/translation/ripper.rb#462 + sig { returns(T.nilable(Result)) } def parse; end # The source that is being parsed. @@ -27836,20 +33899,20 @@ class Prism::Translation::Ripper < ::Prism::Compiler # By default, this method does not handle syntax errors in +src+, # use the +raise_errors+ keyword to raise a SyntaxError for an error in +src+. # - # require 'ripper' - # require 'pp' - # - # pp Ripper.lex("def m(a) nil end") - # #=> [[[1, 0], :on_kw, "def", FNAME ], - # [[1, 3], :on_sp, " ", FNAME ], - # [[1, 4], :on_ident, "m", ENDFN ], - # [[1, 5], :on_lparen, "(", BEG|LABEL], - # [[1, 6], :on_ident, "a", ARG ], - # [[1, 7], :on_rparen, ")", ENDFN ], - # [[1, 8], :on_sp, " ", BEG ], - # [[1, 9], :on_kw, "nil", END ], - # [[1, 12], :on_sp, " ", END ], - # [[1, 13], :on_kw, "end", END ]] + # require "ripper" + # require "pp" + # + # pp Ripper.lex("def m(a) nil end") + # #=> [[[1, 0], :on_kw, "def", FNAME ], + # [[1, 3], :on_sp, " ", FNAME ], + # [[1, 4], :on_ident, "m", ENDFN ], + # [[1, 5], :on_lparen, "(", BEG|LABEL], + # [[1, 6], :on_ident, "a", ARG ], + # [[1, 7], :on_rparen, ")", ENDFN ], + # [[1, 8], :on_sp, " ", BEG ], + # [[1, 9], :on_kw, "nil", END ], + # [[1, 12], :on_sp, " ", END ], + # [[1, 13], :on_kw, "end", END ]] # # source://prism//lib/prism/translation/ripper.rb#72 def lex(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end @@ -27868,15 +33931,15 @@ class Prism::Translation::Ripper < ::Prism::Compiler # returning +nil+ in such cases. Use the +raise_errors+ keyword # to raise a SyntaxError for an error in +src+. # - # require "ripper" - # require "pp" + # require "ripper" + # require "pp" # - # pp Ripper.sexp("def m(a) nil end") - # #=> [:program, - # [[:def, - # [:@ident, "m", [1, 4]], - # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil, nil, nil]], - # [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]] + # pp Ripper.sexp("def m(a) nil end") + # #=> [:program, + # [[:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil, nil, nil]], + # [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]] # # source://prism//lib/prism/translation/ripper.rb#381 def sexp(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end @@ -27888,25 +33951,27 @@ class Prism::Translation::Ripper < ::Prism::Compiler # returning +nil+ in such cases. Use the +raise_errors+ keyword # to raise a SyntaxError for an error in +src+. # - # require 'ripper' - # require 'pp' - # - # pp Ripper.sexp_raw("def m(a) nil end") - # #=> [:program, - # [:stmts_add, - # [:stmts_new], - # [:def, - # [:@ident, "m", [1, 4]], - # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]], - # [:bodystmt, - # [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]], - # nil, - # nil, - # nil]]]] + # require "ripper" + # require "pp" + # + # pp Ripper.sexp_raw("def m(a) nil end") + # #=> [:program, + # [:stmts_add, + # [:stmts_new], + # [:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]], + # [:bodystmt, + # [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]], + # nil, + # nil, + # nil]]]] # # source://prism//lib/prism/translation/ripper.rb#416 def sexp_raw(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end end + + Result = type_member end # A list of all of the Ruby binary operators. @@ -27951,6 +34016,8 @@ Prism::Translation::Ripper::SCANNER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) # # source://prism//lib/prism/translation/ripper/sexp.rb#10 class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper + Result = type_member { { fixed: T::Array[T.untyped] } } + # :stopdoc: # # source://prism//lib/prism/translation/ripper/sexp.rb#13 @@ -28544,6 +34611,8 @@ end # # source://prism//lib/prism/translation/ripper/sexp.rb#74 class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder + Result = type_member { { fixed: T::Array[T.untyped] } } + private # source://prism//lib/prism/translation/ripper/sexp.rb#92 @@ -28634,59 +34703,85 @@ class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper:: def on_xstring_new; end end +class Prism::Translation::RipperCompiler < Prism::Compiler + Result = type_member +end + +class Prism::Translation::RubyParser::Compiler < Prism::Compiler + Result = type_member { { fixed: Sexp } } +end + # Represents the use of the literal `true` keyword. # # true # ^^^^ # -# source://prism//lib/prism/node.rb#17731 +# source://prism//lib/prism/node.rb#19158 class Prism::TrueNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [TrueNode] a new instance of TrueNode # - # source://prism//lib/prism/node.rb#17733 + # source://prism//lib/prism/node.rb#19160 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19235 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17740 + # source://prism//lib/prism/node.rb#19167 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17745 + # source://prism//lib/prism/node.rb#19172 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17755 + # source://prism//lib/prism/node.rb#19182 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17750 + # source://prism//lib/prism/node.rb#19177 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?location: Location) -> TrueNode # - # source://prism//lib/prism/node.rb#17760 + # source://prism//lib/prism/node.rb#19187 + sig { params(location: Prism::Location).returns(Prism::TrueNode) } def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17745 + # source://prism//lib/prism/node.rb#19172 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism//lib/prism/node.rb#17768 + # source://prism//lib/prism/node.rb#19195 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17774 + # source://prism//lib/prism/node.rb#19200 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # Sometimes you want to check an instance of a node against a list of @@ -28704,7 +34799,8 @@ class Prism::TrueNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17793 + # source://prism//lib/prism/node.rb#19219 + sig { override.returns(Symbol) } def type; end class << self @@ -28715,7 +34811,7 @@ class Prism::TrueNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17803 + # source://prism//lib/prism/node.rb#19229 def type; end end end @@ -28725,69 +34821,103 @@ end # undef :foo, :bar, :baz # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17812 +# source://prism//lib/prism/node.rb#19244 class Prism::UndefNode < ::Prism::Node # def initialize: (Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc, Location location) -> void # # @return [UndefNode] a new instance of UndefNode # - # source://prism//lib/prism/node.rb#17814 + # source://prism//lib/prism/node.rb#19246 + sig do + params( + source: Prism::Source, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, names, keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19340 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17823 + # source://prism//lib/prism/node.rb#19255 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17828 + # source://prism//lib/prism/node.rb#19260 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17838 + # source://prism//lib/prism/node.rb#19270 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17833 + # source://prism//lib/prism/node.rb#19265 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location, ?location: Location) -> UndefNode # - # source://prism//lib/prism/node.rb#17843 + # source://prism//lib/prism/node.rb#19275 + sig do + params( + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::UndefNode) + end def copy(names: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17828 + # source://prism//lib/prism/node.rb#19260 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location, location: Location } # - # source://prism//lib/prism/node.rb#17851 + # source://prism//lib/prism/node.rb#19283 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#17872 + # source://prism//lib/prism/node.rb#19303 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#17867 + # source://prism//lib/prism/node.rb#19298 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#17859 + # source://prism//lib/prism/node.rb#19291 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader names: Array[SymbolNode | InterpolatedSymbolNode] # - # source://prism//lib/prism/node.rb#17856 + # source://prism//lib/prism/node.rb#19288 + sig { returns(T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) } def names; end # Sometimes you want to check an instance of a node against a list of @@ -28805,7 +34935,8 @@ class Prism::UndefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#17893 + # source://prism//lib/prism/node.rb#19324 + sig { override.returns(Symbol) } def type; end class << self @@ -28816,7 +34947,7 @@ class Prism::UndefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#17903 + # source://prism//lib/prism/node.rb#19334 def type; end end end @@ -28829,102 +34960,173 @@ end # unless foo then bar end # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#17915 +# source://prism//lib/prism/node.rb#19355 class Prism::UnlessNode < ::Prism::Node # def initialize: (Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void # # @return [UnlessNode] a new instance of UnlessNode # - # source://prism//lib/prism/node.rb#17917 + # source://prism//lib/prism/node.rb#19357 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19543 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#17930 + # source://prism//lib/prism/node.rb#19370 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17939 + # source://prism//lib/prism/node.rb#19379 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#17953 + # source://prism//lib/prism/node.rb#19393 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#17944 + # source://prism//lib/prism/node.rb#19384 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader consequent: ElseNode? + # The else clause of the unless expression, if present. + # + # unless cond then bar else baz end + # ^^^^^^^^ # - # source://prism//lib/prism/node.rb#17997 + # source://prism//lib/prism/node.rb#19457 + sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end # def copy: (?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: ElseNode?, ?end_keyword_loc: Location?, ?location: Location) -> UnlessNode # - # source://prism//lib/prism/node.rb#17958 + # source://prism//lib/prism/node.rb#19398 + sig do + params( + keyword_loc: Prism::Location, + predicate: Prism::Node, + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::ElseNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::UnlessNode) + end def copy(keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#17939 + # source://prism//lib/prism/node.rb#19379 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#17966 + # source://prism//lib/prism/node.rb#19406 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def end_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18024 + # source://prism//lib/prism/node.rb#19486 + sig { returns(T.nilable(String)) } def end_keyword; end - # attr_reader end_keyword_loc: Location? + # The location of the `end` keyword, if present. # - # source://prism//lib/prism/node.rb#18000 + # unless cond then bar end + # ^^^ + # + # source://prism//lib/prism/node.rb#19463 + sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18029 + # source://prism//lib/prism/node.rb#19491 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18014 + # source://prism//lib/prism/node.rb#19476 + sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `unless` keyword. # - # source://prism//lib/prism/node.rb#17971 + # unless cond then bar end + # ^^^^^^ + # + # bar unless cond + # ^^^^^^ + # + # source://prism//lib/prism/node.rb#19417 + sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader predicate: Prism::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 + # ^^^^ # - # source://prism//lib/prism/node.rb#17978 + # source://prism//lib/prism/node.rb#19430 + sig { returns(Prism::Node) } def predicate; end - # source://prism//lib/prism/node.rb#17934 + # source://prism//lib/prism/node.rb#19374 def set_newline_flag(newline_marked); end - # attr_reader statements: StatementsNode? + # 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 + # ^^^ # - # source://prism//lib/prism/node.rb#17994 + # source://prism//lib/prism/node.rb#19451 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18019 + # source://prism//lib/prism/node.rb#19481 + sig { returns(T.nilable(String)) } def then_keyword; end - # attr_reader then_keyword_loc: Location? + # The location of the `then` keyword, if present. + # unless cond then bar end ^^^^ # - # source://prism//lib/prism/node.rb#17981 + # source://prism//lib/prism/node.rb#19434 + sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -28942,7 +35144,8 @@ class Prism::UnlessNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18065 + # source://prism//lib/prism/node.rb#19527 + sig { override.returns(Symbol) } def type; end class << self @@ -28953,7 +35156,7 @@ class Prism::UnlessNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18075 + # source://prism//lib/prism/node.rb#19537 def type; end end end @@ -28966,94 +35169,138 @@ end # until foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18087 +# source://prism//lib/prism/node.rb#19561 class Prism::UntilNode < ::Prism::Node # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void # # @return [UntilNode] a new instance of UntilNode # - # source://prism//lib/prism/node.rb#18089 + # source://prism//lib/prism/node.rb#19563 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19707 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18101 + # source://prism//lib/prism/node.rb#19575 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18172 + # source://prism//lib/prism/node.rb#19645 + sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18110 + # source://prism//lib/prism/node.rb#19584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#18182 + # source://prism//lib/prism/node.rb#19655 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#18152 + # source://prism//lib/prism/node.rb#19626 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18123 + # source://prism//lib/prism/node.rb#19597 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18115 + # source://prism//lib/prism/node.rb#19589 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> UntilNode # - # source://prism//lib/prism/node.rb#18128 + # source://prism//lib/prism/node.rb#19602 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::UntilNode) + end def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18110 + # source://prism//lib/prism/node.rb#19584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } # - # source://prism//lib/prism/node.rb#18136 + # source://prism//lib/prism/node.rb#19610 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18187 + # source://prism//lib/prism/node.rb#19660 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18177 + # source://prism//lib/prism/node.rb#19650 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18145 + # source://prism//lib/prism/node.rb#19619 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader predicate: Prism::node # - # source://prism//lib/prism/node.rb#18165 + # source://prism//lib/prism/node.rb#19639 + sig { returns(Prism::Node) } def predicate; end - # source://prism//lib/prism/node.rb#18105 + # source://prism//lib/prism/node.rb#19579 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18168 + # source://prism//lib/prism/node.rb#19642 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -29071,14 +35318,16 @@ class Prism::UntilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18218 + # source://prism//lib/prism/node.rb#19691 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#18141 + # source://prism//lib/prism/node.rb#19615 + sig { returns(Integer) } def flags; end class << self @@ -29089,7 +35338,7 @@ class Prism::UntilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18228 + # source://prism//lib/prism/node.rb#19701 def type; end end end @@ -29121,751 +35370,901 @@ class Prism::Visitor < ::Prism::BasicVisitor # Visit a AliasGlobalVariableNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AliasGlobalVariableNode).void } def visit_alias_global_variable_node(node); end # Visit a AliasMethodNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AliasMethodNode).void } def visit_alias_method_node(node); end # Visit a AlternationPatternNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AlternationPatternNode).void } def visit_alternation_pattern_node(node); end # Visit a AndNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AndNode).void } def visit_and_node(node); end # Visit a ArgumentsNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArgumentsNode).void } def visit_arguments_node(node); end # Visit a ArrayNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArrayNode).void } def visit_array_node(node); end # Visit a ArrayPatternNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ArrayPatternNode).void } def visit_array_pattern_node(node); end # Visit a AssocNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AssocNode).void } def visit_assoc_node(node); end # Visit a AssocSplatNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::AssocSplatNode).void } def visit_assoc_splat_node(node); end # Visit a BackReferenceReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BackReferenceReadNode).void } def visit_back_reference_read_node(node); end # Visit a BeginNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BeginNode).void } def visit_begin_node(node); end # Visit a BlockArgumentNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockArgumentNode).void } def visit_block_argument_node(node); end # Visit a BlockLocalVariableNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockLocalVariableNode).void } def visit_block_local_variable_node(node); end # Visit a BlockNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockNode).void } def visit_block_node(node); end # Visit a BlockParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockParameterNode).void } def visit_block_parameter_node(node); end # Visit a BlockParametersNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BlockParametersNode).void } def visit_block_parameters_node(node); end # Visit a BreakNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::BreakNode).void } def visit_break_node(node); end # Visit a CallAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallAndWriteNode).void } def visit_call_and_write_node(node); end # Visit a CallNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallNode).void } def visit_call_node(node); end # Visit a CallOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallOperatorWriteNode).void } def visit_call_operator_write_node(node); end # Visit a CallOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallOrWriteNode).void } def visit_call_or_write_node(node); end # Visit a CallTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CallTargetNode).void } def visit_call_target_node(node); end # Visit a CapturePatternNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CapturePatternNode).void } def visit_capture_pattern_node(node); end # Visit a CaseMatchNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CaseMatchNode).void } def visit_case_match_node(node); end # Visit a CaseNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::CaseNode).void } def visit_case_node(node); end # Visit a ClassNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassNode).void } def visit_class_node(node); end # Visit a ClassVariableAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableAndWriteNode).void } def visit_class_variable_and_write_node(node); end # Visit a ClassVariableOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableOperatorWriteNode).void } def visit_class_variable_operator_write_node(node); end # Visit a ClassVariableOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableOrWriteNode).void } def visit_class_variable_or_write_node(node); end # Visit a ClassVariableReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableReadNode).void } def visit_class_variable_read_node(node); end # Visit a ClassVariableTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableTargetNode).void } def visit_class_variable_target_node(node); end # Visit a ClassVariableWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ClassVariableWriteNode).void } def visit_class_variable_write_node(node); end # Visit a ConstantAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantAndWriteNode).void } def visit_constant_and_write_node(node); end # Visit a ConstantOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantOperatorWriteNode).void } def visit_constant_operator_write_node(node); end # Visit a ConstantOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantOrWriteNode).void } def visit_constant_or_write_node(node); end # Visit a ConstantPathAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathAndWriteNode).void } def visit_constant_path_and_write_node(node); end # Visit a ConstantPathNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathNode).void } def visit_constant_path_node(node); end # Visit a ConstantPathOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathOperatorWriteNode).void } def visit_constant_path_operator_write_node(node); end # Visit a ConstantPathOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathOrWriteNode).void } def visit_constant_path_or_write_node(node); end # Visit a ConstantPathTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathTargetNode).void } def visit_constant_path_target_node(node); end # Visit a ConstantPathWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end # Visit a ConstantReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantReadNode).void } def visit_constant_read_node(node); end # Visit a ConstantTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantTargetNode).void } def visit_constant_target_node(node); end # Visit a ConstantWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end # Visit a DefNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::DefNode).void } def visit_def_node(node); end # Visit a DefinedNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::DefinedNode).void } def visit_defined_node(node); end # Visit a ElseNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ElseNode).void } def visit_else_node(node); end # Visit a EmbeddedStatementsNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EmbeddedStatementsNode).void } def visit_embedded_statements_node(node); end # Visit a EmbeddedVariableNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EmbeddedVariableNode).void } def visit_embedded_variable_node(node); end # Visit a EnsureNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::EnsureNode).void } def visit_ensure_node(node); end # Visit a FalseNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FalseNode).void } def visit_false_node(node); end # Visit a FindPatternNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FindPatternNode).void } def visit_find_pattern_node(node); end # Visit a FlipFlopNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FlipFlopNode).void } def visit_flip_flop_node(node); end # Visit a FloatNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::FloatNode).void } def visit_float_node(node); end # Visit a ForNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForNode).void } def visit_for_node(node); end # Visit a ForwardingArgumentsNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingArgumentsNode).void } def visit_forwarding_arguments_node(node); end # Visit a ForwardingParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingParameterNode).void } def visit_forwarding_parameter_node(node); end # Visit a ForwardingSuperNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ForwardingSuperNode).void } def visit_forwarding_super_node(node); end # Visit a GlobalVariableAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableAndWriteNode).void } def visit_global_variable_and_write_node(node); end # Visit a GlobalVariableOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableOperatorWriteNode).void } def visit_global_variable_operator_write_node(node); end # Visit a GlobalVariableOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableOrWriteNode).void } def visit_global_variable_or_write_node(node); end # Visit a GlobalVariableReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableReadNode).void } def visit_global_variable_read_node(node); end # Visit a GlobalVariableTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableTargetNode).void } def visit_global_variable_target_node(node); end # Visit a GlobalVariableWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::GlobalVariableWriteNode).void } def visit_global_variable_write_node(node); end # Visit a HashNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::HashNode).void } def visit_hash_node(node); end # Visit a HashPatternNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::HashPatternNode).void } def visit_hash_pattern_node(node); end # Visit a IfNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IfNode).void } def visit_if_node(node); end # Visit a ImaginaryNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImaginaryNode).void } def visit_imaginary_node(node); end # Visit a ImplicitNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImplicitNode).void } def visit_implicit_node(node); end # Visit a ImplicitRestNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ImplicitRestNode).void } def visit_implicit_rest_node(node); end # Visit a InNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InNode).void } def visit_in_node(node); end # Visit a IndexAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexAndWriteNode).void } def visit_index_and_write_node(node); end # Visit a IndexOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexOperatorWriteNode).void } def visit_index_operator_write_node(node); end # Visit a IndexOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexOrWriteNode).void } def visit_index_or_write_node(node); end # Visit a IndexTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IndexTargetNode).void } def visit_index_target_node(node); end # Visit a InstanceVariableAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableAndWriteNode).void } def visit_instance_variable_and_write_node(node); end # Visit a InstanceVariableOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableOperatorWriteNode).void } def visit_instance_variable_operator_write_node(node); end # Visit a InstanceVariableOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableOrWriteNode).void } def visit_instance_variable_or_write_node(node); end # Visit a InstanceVariableReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableReadNode).void } def visit_instance_variable_read_node(node); end # Visit a InstanceVariableTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableTargetNode).void } def visit_instance_variable_target_node(node); end # Visit a InstanceVariableWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InstanceVariableWriteNode).void } def visit_instance_variable_write_node(node); end # Visit a IntegerNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::IntegerNode).void } def visit_integer_node(node); end # Visit a InterpolatedMatchLastLineNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedMatchLastLineNode).void } def visit_interpolated_match_last_line_node(node); end # Visit a InterpolatedRegularExpressionNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedRegularExpressionNode).void } def visit_interpolated_regular_expression_node(node); end # Visit a InterpolatedStringNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end # Visit a InterpolatedSymbolNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedSymbolNode).void } def visit_interpolated_symbol_node(node); end # Visit a InterpolatedXStringNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::InterpolatedXStringNode).void } def visit_interpolated_x_string_node(node); end # Visit a ItParametersNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ItParametersNode).void } def visit_it_parameters_node(node); end # Visit a KeywordHashNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::KeywordHashNode).void } def visit_keyword_hash_node(node); end # Visit a KeywordRestParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::KeywordRestParameterNode).void } def visit_keyword_rest_parameter_node(node); end # Visit a LambdaNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LambdaNode).void } def visit_lambda_node(node); end # Visit a LocalVariableAndWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end # Visit a LocalVariableOperatorWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end # Visit a LocalVariableOrWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end # Visit a LocalVariableReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableReadNode).void } def visit_local_variable_read_node(node); end # Visit a LocalVariableTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableTargetNode).void } def visit_local_variable_target_node(node); end # Visit a LocalVariableWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end # Visit a MatchLastLineNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchLastLineNode).void } def visit_match_last_line_node(node); end # Visit a MatchPredicateNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchPredicateNode).void } def visit_match_predicate_node(node); end # Visit a MatchRequiredNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchRequiredNode).void } def visit_match_required_node(node); end # Visit a MatchWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MatchWriteNode).void } def visit_match_write_node(node); end # Visit a MissingNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MissingNode).void } def visit_missing_node(node); end # Visit a ModuleNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ModuleNode).void } def visit_module_node(node); end # Visit a MultiTargetNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MultiTargetNode).void } def visit_multi_target_node(node); end # Visit a MultiWriteNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::MultiWriteNode).void } def visit_multi_write_node(node); end # Visit a NextNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NextNode).void } def visit_next_node(node); end # Visit a NilNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NilNode).void } def visit_nil_node(node); end # Visit a NoKeywordsParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NoKeywordsParameterNode).void } def visit_no_keywords_parameter_node(node); end # Visit a NumberedParametersNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NumberedParametersNode).void } def visit_numbered_parameters_node(node); end # Visit a NumberedReferenceReadNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::NumberedReferenceReadNode).void } def visit_numbered_reference_read_node(node); end # Visit a OptionalKeywordParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OptionalKeywordParameterNode).void } def visit_optional_keyword_parameter_node(node); end # Visit a OptionalParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OptionalParameterNode).void } def visit_optional_parameter_node(node); end # Visit a OrNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::OrNode).void } def visit_or_node(node); end # Visit a ParametersNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ParametersNode).void } def visit_parameters_node(node); end # Visit a ParenthesesNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ParenthesesNode).void } def visit_parentheses_node(node); end # Visit a PinnedExpressionNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PinnedExpressionNode).void } def visit_pinned_expression_node(node); end # Visit a PinnedVariableNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PinnedVariableNode).void } def visit_pinned_variable_node(node); end # Visit a PostExecutionNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PostExecutionNode).void } def visit_post_execution_node(node); end # Visit a PreExecutionNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::PreExecutionNode).void } def visit_pre_execution_node(node); end # Visit a ProgramNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ProgramNode).void } def visit_program_node(node); end # Visit a RangeNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RangeNode).void } def visit_range_node(node); end # Visit a RationalNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RationalNode).void } def visit_rational_node(node); end # Visit a RedoNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RedoNode).void } def visit_redo_node(node); end # Visit a RegularExpressionNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RegularExpressionNode).void } def visit_regular_expression_node(node); end # Visit a RequiredKeywordParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RequiredKeywordParameterNode).void } def visit_required_keyword_parameter_node(node); end # Visit a RequiredParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RequiredParameterNode).void } def visit_required_parameter_node(node); end # Visit a RescueModifierNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RescueModifierNode).void } def visit_rescue_modifier_node(node); end # Visit a RescueNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RescueNode).void } def visit_rescue_node(node); end # Visit a RestParameterNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RestParameterNode).void } def visit_rest_parameter_node(node); end # Visit a RetryNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::RetryNode).void } def visit_retry_node(node); end # Visit a ReturnNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ReturnNode).void } def visit_return_node(node); end # Visit a SelfNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SelfNode).void } def visit_self_node(node); end # Visit a ShareableConstantNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::ShareableConstantNode).void } def visit_shareable_constant_node(node); end # Visit a SingletonClassNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end # Visit a SourceEncodingNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceEncodingNode).void } def visit_source_encoding_node(node); end # Visit a SourceFileNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceFileNode).void } def visit_source_file_node(node); end # Visit a SourceLineNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SourceLineNode).void } def visit_source_line_node(node); end # Visit a SplatNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SplatNode).void } def visit_splat_node(node); end # Visit a StatementsNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::StatementsNode).void } def visit_statements_node(node); end # Visit a StringNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::StringNode).void } def visit_string_node(node); end # Visit a SuperNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SuperNode).void } def visit_super_node(node); end # Visit a SymbolNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::SymbolNode).void } def visit_symbol_node(node); end # Visit a TrueNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::TrueNode).void } def visit_true_node(node); end # Visit a UndefNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UndefNode).void } def visit_undef_node(node); end # Visit a UnlessNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UnlessNode).void } def visit_unless_node(node); end # Visit a UntilNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::UntilNode).void } def visit_until_node(node); end # Visit a WhenNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::WhenNode).void } def visit_when_node(node); end # Visit a WhileNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::WhileNode).void } def visit_while_node(node); end # Visit a XStringNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::XStringNode).void } def visit_x_string_node(node); end # Visit a YieldNode node # # source://prism//lib/prism/visitor.rb#29 + sig { params(node: Prism::YieldNode).void } def visit_yield_node(node); end end @@ -29876,84 +36275,125 @@ end # ^^^^^^^^^ # end # -# source://prism//lib/prism/node.rb#18239 +# source://prism//lib/prism/node.rb#19723 class Prism::WhenNode < ::Prism::Node # def initialize: (Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements, Location location) -> void # # @return [WhenNode] a new instance of WhenNode # - # source://prism//lib/prism/node.rb#18241 + # source://prism//lib/prism/node.rb#19725 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, conditions, then_keyword_loc, statements, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#19852 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18252 + # source://prism//lib/prism/node.rb#19736 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18257 + # source://prism//lib/prism/node.rb#19741 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18270 + # source://prism//lib/prism/node.rb#19754 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18262 + # source://prism//lib/prism/node.rb#19746 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # attr_reader conditions: Array[Prism::node] # - # source://prism//lib/prism/node.rb#18295 + # source://prism//lib/prism/node.rb#19779 + sig { returns(T::Array[Prism::Node]) } def conditions; end # def copy: (?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?location: Location) -> WhenNode # - # source://prism//lib/prism/node.rb#18275 + # source://prism//lib/prism/node.rb#19759 + sig do + params( + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::WhenNode) + end def copy(keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18257 + # source://prism//lib/prism/node.rb#19741 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode?, location: Location } # - # source://prism//lib/prism/node.rb#18283 + # source://prism//lib/prism/node.rb#19767 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18325 + # source://prism//lib/prism/node.rb#19808 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18315 + # source://prism//lib/prism/node.rb#19798 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18288 + # source://prism//lib/prism/node.rb#19772 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18311 + # source://prism//lib/prism/node.rb#19795 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism//lib/prism/node.rb#18320 + # source://prism//lib/prism/node.rb#19803 + sig { returns(T.nilable(String)) } def then_keyword; end # attr_reader then_keyword_loc: Location? # - # source://prism//lib/prism/node.rb#18298 + # source://prism//lib/prism/node.rb#19782 + sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end # Sometimes you want to check an instance of a node against a list of @@ -29971,7 +36411,8 @@ class Prism::WhenNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18353 + # source://prism//lib/prism/node.rb#19836 + sig { override.returns(Symbol) } def type; end class << self @@ -29982,7 +36423,7 @@ class Prism::WhenNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18363 + # source://prism//lib/prism/node.rb#19846 def type; end end end @@ -29995,94 +36436,138 @@ end # while foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism//lib/prism/node.rb#18375 +# source://prism//lib/prism/node.rb#19869 class Prism::WhileNode < ::Prism::Node # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void # # @return [WhileNode] a new instance of WhileNode # - # source://prism//lib/prism/node.rb#18377 + # source://prism//lib/prism/node.rb#19871 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#20015 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18389 + # source://prism//lib/prism/node.rb#19883 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18460 + # source://prism//lib/prism/node.rb#19953 + sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18398 + # source://prism//lib/prism/node.rb#19892 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism//lib/prism/node.rb#18470 + # source://prism//lib/prism/node.rb#19963 + sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism//lib/prism/node.rb#18440 + # source://prism//lib/prism/node.rb#19934 + sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18411 + # source://prism//lib/prism/node.rb#19905 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18403 + # source://prism//lib/prism/node.rb#19897 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> WhileNode # - # source://prism//lib/prism/node.rb#18416 + # source://prism//lib/prism/node.rb#19910 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).returns(Prism::WhileNode) + end def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18398 + # source://prism//lib/prism/node.rb#19892 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } # - # source://prism//lib/prism/node.rb#18424 + # source://prism//lib/prism/node.rb#19918 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18475 + # source://prism//lib/prism/node.rb#19968 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18465 + # source://prism//lib/prism/node.rb#19958 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18433 + # source://prism//lib/prism/node.rb#19927 + sig { returns(Prism::Location) } def keyword_loc; end # attr_reader predicate: Prism::node # - # source://prism//lib/prism/node.rb#18453 + # source://prism//lib/prism/node.rb#19947 + sig { returns(Prism::Node) } def predicate; end - # source://prism//lib/prism/node.rb#18393 + # source://prism//lib/prism/node.rb#19887 def set_newline_flag(newline_marked); end # attr_reader statements: StatementsNode? # - # source://prism//lib/prism/node.rb#18456 + # source://prism//lib/prism/node.rb#19950 + sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # Sometimes you want to check an instance of a node against a list of @@ -30100,14 +36585,16 @@ class Prism::WhileNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18506 + # source://prism//lib/prism/node.rb#19999 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#18429 + # source://prism//lib/prism/node.rb#19923 + sig { returns(Integer) } def flags; end class << self @@ -30118,7 +36605,7 @@ class Prism::WhileNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18516 + # source://prism//lib/prism/node.rb#20009 def type; end end end @@ -30128,7 +36615,7 @@ end # `foo` # ^^^^^ # -# source://prism//lib/prism/node.rb#18525 +# source://prism//lib/prism/node.rb#20029 class Prism::XStringNode < ::Prism::Node include ::Prism::HeredocQuery @@ -30136,98 +36623,147 @@ class Prism::XStringNode < ::Prism::Node # # @return [XStringNode] a new instance of XStringNode # - # source://prism//lib/prism/node.rb#18527 + # source://prism//lib/prism/node.rb#20031 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#20170 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18539 + # source://prism//lib/prism/node.rb#20043 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18544 + # source://prism//lib/prism/node.rb#20048 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism//lib/prism/node.rb#18621 + # source://prism//lib/prism/node.rb#20124 + sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism//lib/prism/node.rb#18590 + # source://prism//lib/prism/node.rb#20094 + sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18554 + # source://prism//lib/prism/node.rb#20058 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18549 + # source://prism//lib/prism/node.rb#20053 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism//lib/prism/node.rb#18616 + # source://prism//lib/prism/node.rb#20119 + sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism//lib/prism/node.rb#18583 + # source://prism//lib/prism/node.rb#20087 + sig { returns(Prism::Location) } def content_loc; end # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> XStringNode # - # source://prism//lib/prism/node.rb#18559 + # source://prism//lib/prism/node.rb#20063 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::XStringNode) + end def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18544 + # source://prism//lib/prism/node.rb#20048 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism//lib/prism/node.rb#18567 + # source://prism//lib/prism/node.rb#20071 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18606 + # source://prism//lib/prism/node.rb#20109 + sig { returns(T::Boolean) } def forced_binary_encoding?; end # def forced_utf8_encoding?: () -> bool # # @return [Boolean] # - # source://prism//lib/prism/node.rb#18601 + # source://prism//lib/prism/node.rb#20104 + sig { returns(T::Boolean) } def forced_utf8_encoding?; end + sig { returns(T::Boolean) } + def heredoc?; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18626 + # source://prism//lib/prism/node.rb#20129 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def opening: () -> String # - # source://prism//lib/prism/node.rb#18611 + # source://prism//lib/prism/node.rb#20114 + sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism//lib/prism/node.rb#18576 + # source://prism//lib/prism/node.rb#20080 + sig { returns(Prism::Location) } def opening_loc; 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. # # source://prism//lib/prism/node_ext.rb#72 + sig { returns(Prism::InterpolatedXStringNode) } def to_interpolated; end # Sometimes you want to check an instance of a node against a list of @@ -30245,19 +36781,22 @@ class Prism::XStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18651 + # source://prism//lib/prism/node.rb#20154 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism//lib/prism/node.rb#18597 + # source://prism//lib/prism/node.rb#20101 + sig { returns(String) } def unescaped; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism//lib/prism/node.rb#18572 + # source://prism//lib/prism/node.rb#20076 + sig { returns(Integer) } def flags; end class << self @@ -30268,7 +36807,7 @@ class Prism::XStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18661 + # source://prism//lib/prism/node.rb#20164 def type; end end end @@ -30278,89 +36817,131 @@ end # yield 1 # ^^^^^^^ # -# source://prism//lib/prism/node.rb#18670 +# source://prism//lib/prism/node.rb#20184 class Prism::YieldNode < ::Prism::Node # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void # # @return [YieldNode] a new instance of YieldNode # - # source://prism//lib/prism/node.rb#18672 + # source://prism//lib/prism/node.rb#20186 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, location); end + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. + # + # source://prism//lib/prism/node.rb#20327 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism//lib/prism/node.rb#18683 + # source://prism//lib/prism/node.rb#20197 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism//lib/prism/node.rb#18738 + # source://prism//lib/prism/node.rb#20252 + sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18688 + # source://prism//lib/prism/node.rb#20202 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def comment_targets: () -> Array[Node | Location] # - # source://prism//lib/prism/node.rb#18700 + # source://prism//lib/prism/node.rb#20214 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end # def compact_child_nodes: () -> Array[Node] # - # source://prism//lib/prism/node.rb#18693 + # source://prism//lib/prism/node.rb#20207 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?location: Location) -> YieldNode # - # source://prism//lib/prism/node.rb#18705 + # source://prism//lib/prism/node.rb#20219 + sig do + params( + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).returns(Prism::YieldNode) + end def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism//lib/prism/node.rb#18688 + # source://prism//lib/prism/node.rb#20202 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location } # - # source://prism//lib/prism/node.rb#18713 + # source://prism//lib/prism/node.rb#20227 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inspect(NodeInspector inspector) -> String # - # source://prism//lib/prism/node.rb#18770 + # source://prism//lib/prism/node.rb#20283 + sig { params(inspector: T.untyped).returns(String) } def inspect(inspector = T.unsafe(nil)); end # def keyword: () -> String # - # source://prism//lib/prism/node.rb#18755 + # source://prism//lib/prism/node.rb#20268 + sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism//lib/prism/node.rb#18718 + # source://prism//lib/prism/node.rb#20232 + sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism//lib/prism/node.rb#18760 + # source://prism//lib/prism/node.rb#20273 + sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism//lib/prism/node.rb#18725 + # source://prism//lib/prism/node.rb#20239 + sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism//lib/prism/node.rb#18765 + # source://prism//lib/prism/node.rb#20278 + sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism//lib/prism/node.rb#18741 + # source://prism//lib/prism/node.rb#20255 + sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end # Sometimes you want to check an instance of a node against a list of @@ -30378,7 +36959,8 @@ class Prism::YieldNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism//lib/prism/node.rb#18798 + # source://prism//lib/prism/node.rb#20311 + sig { override.returns(Symbol) } def type; end class << self @@ -30389,7 +36971,13 @@ class Prism::YieldNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism//lib/prism/node.rb#18808 + # source://prism//lib/prism/node.rb#20321 def type; end end end + +# We keep this shim in here because our client libraries might not have +# ruby_parser in their bundle. +class Sexp < ::Array + Elem = type_member { { fixed: T.untyped }} +end